restructure text editors and static assets

This commit is contained in:
sbwalker
2025-09-05 12:32:43 -04:00
parent 9f923ae968
commit 27041f464f
21 changed files with 36 additions and 2383 deletions

View File

@ -177,14 +177,14 @@
</div>
@code {
public string Name => "QuillJS";
public string Name => "QuillJS Text Editor";
private string resourceType = "Oqtane.Modules.Controls.QuillJSTextEditor, Oqtane.Client";
private bool _settingsLoaded;
private bool _initialized = false;
private QuillEditorInterop _interop;
private QuillJSTextEditorInterop _interop;
private FileManager _fileManager;
private string _activetab = "Rich";
private bool _allowSettings = false;
@ -246,14 +246,14 @@
public override List<Resource> Resources { get; set; } = new List<Resource>()
{
new Resource { ResourceType = ResourceType.Script, Bundle = "Quill", Url = "js/quill.min.js", Location = ResourceLocation.Body },
new Resource { ResourceType = ResourceType.Script, Bundle = "Quill", Url = "js/quill-blot-formatter.min.js", Location = ResourceLocation.Body },
new Resource { ResourceType = ResourceType.Script, Bundle = "Quill", Url = "js/quill-interop.js", Location = ResourceLocation.Body }
new Resource { ResourceType = ResourceType.Script, Bundle = "Quill", Url = "js/texteditors/quilljs/quill.min.js", Location = ResourceLocation.Body },
new Resource { ResourceType = ResourceType.Script, Bundle = "Quill", Url = "js/texteditors/quilljs/quill-blot-formatter.min.js", Location = ResourceLocation.Body },
new Resource { ResourceType = ResourceType.Script, Bundle = "Quill", Url = "js/texteditors/quilljs/quill-interop.js", Location = ResourceLocation.Body }
};
protected override void OnInitialized()
{
_interop = new QuillEditorInterop(JSRuntime);
_interop = new QuillJSTextEditorInterop(JSRuntime);
if (string.IsNullOrEmpty(Placeholder))
{
@ -277,7 +277,7 @@
{
// include CSS theme
var interop = new Interop(JSRuntime);
await interop.IncludeLink("", "stylesheet", $"{PageState?.Alias.BaseUrl}/css/quill/quill.{_theme}.css", "text/css", "", "", "");
await interop.IncludeLink("", "stylesheet", $"{PageState?.Alias.BaseUrl}/css/texteditors/quilljs/quill.{_theme}.css", "text/css", "", "", "");
}
await base.OnAfterRenderAsync(firstRender);

View File

@ -4,11 +4,11 @@ using System.Threading.Tasks;
namespace Oqtane.Modules.Controls
{
public class QuillEditorInterop
public class QuillJSTextEditorInterop
{
private readonly IJSRuntime _jsRuntime;
public QuillEditorInterop(IJSRuntime jsRuntime)
public QuillJSTextEditorInterop(IJSRuntime jsRuntime)
{
_jsRuntime = jsRuntime;
}

View File

@ -29,7 +29,7 @@
</RadzenHtmlEditor>
@code {
private Oqtane.Modules.Controls.RadzenEditorInterop _interop;
private Oqtane.Modules.Controls.RadzenTextEditorInterop _interop;
private RadzenHtmlEditor _editor;
private string _value;
private bool _visible = false;
@ -47,26 +47,27 @@
[Parameter]
public int Height { get; set; } = 450;
public string Name => "RadzenTextEditor";
public string Name => "Radzen HTML Editor";
public override List<Resource> Resources { get; set; } = new List<Resource>()
{
new Resource { ResourceType = ResourceType.Script, Url = "/_content/Radzen.Blazor/Radzen.Blazor.js", Location = ResourceLocation.Head },
new Resource { ResourceType = ResourceType.Script, Url = "/Modules/Oqtane.RadzenTextEditor/Resources/js/Interops/RadzenTextEditorInterop.js", Location = ResourceLocation.Head },
new Resource { ResourceType = ResourceType.Script, Url = "_content/Radzen.Blazor/Radzen.Blazor.js", Location = ResourceLocation.Body },
new Resource { ResourceType = ResourceType.Script, Url = "js/texteditors/radzen/radzen-interop.js", Location = ResourceLocation.Body }
};
protected override void OnInitialized()
{
_interop = new Oqtane.Modules.Controls.RadzenEditorInterop(JSRuntime);
_interop = new Oqtane.Modules.Controls.RadzenTextEditorInterop(JSRuntime);
}
protected override async Task OnAfterRenderAsync(bool firstRender)
{
await base.OnAfterRenderAsync(firstRender);
if (firstRender)
{
var interop = new Interop(JSRuntime);
await interop.IncludeLink("", "stylesheet", $"/Modules/Oqtane.RadzenTextEditor/Resources/css/radzentexteditor.override.css", "text/css", "", "", "");
await interop.IncludeLink("", "stylesheet", $"{PageState?.Alias.BaseUrl}/css/texteditors/radzen/radzentexteditor.css", "text/css", "", "", "");
await LoadSettings();
_visible = true;
StateHasChanged();

View File

@ -4,11 +4,11 @@ using System.Threading.Tasks;
namespace Oqtane.Modules.Controls
{
public class RadzenEditorInterop
public class RadzenTextEditorInterop
{
private readonly IJSRuntime _jsRuntime;
public RadzenEditorInterop(IJSRuntime jsRuntime)
public RadzenTextEditorInterop(IJSRuntime jsRuntime)
{
_jsRuntime = jsRuntime;
}

View File

@ -7,7 +7,7 @@
</div>
@code {
public string Name => "TextArea";
public string Name => "Basic Text Editor";
private ElementReference _editor;
private string _content;

View File

@ -23,6 +23,7 @@
<dependency id="Microsoft.AspNetCore.Components.WebAssembly.Authentication" version="9.0.8" exclude="Build,Analyzers" />
<dependency id="Microsoft.Extensions.Http" version="9.0.8" exclude="Build,Analyzers" />
<dependency id="Microsoft.Extensions.Localization" version="9.0.8" exclude="Build,Analyzers" />
<dependency id="Radzen.Blazor" version="7.3.3" exclude="Build,Analyzers" />
</group>
</dependencies>
</metadata>

View File

@ -20,25 +20,25 @@
<group targetFramework="net9.0">
<dependency id="Oqtane.Client" version="6.2.0" exclude="Build,Analyzers" />
<dependency id="Oqtane.Shared" version="6.2.0" exclude="Build,Analyzers" />
<dependency id="EFCore.NamingConventions" version="9.0.0" exclude="Build,Analyzers" />
<dependency id="HtmlAgilityPack" version="1.12.2" exclude="Build,Analyzers" />
<dependency id="MailKit" version="4.13.0" exclude="Build,Analyzers" />
<dependency id="Microsoft.AspNetCore.Authentication.OpenIdConnect" version="9.0.8" exclude="Build,Analyzers" />
<dependency id="Microsoft.AspNetCore.Components.WebAssembly.Server" version="9.0.8" exclude="Build,Analyzers" />
<dependency id="Microsoft.AspNetCore.Identity.EntityFrameworkCore" version="9.0.8" exclude="Build,Analyzers" />
<dependency id="Microsoft.Data.SqlClient" version="6.1.1" exclude="Build,Analyzers" />
<dependency id="Microsoft.Data.Sqlite.Core" version="9.0.8" exclude="Build,Analyzers" />
<dependency id="Microsoft.EntityFrameworkCore" version="9.0.8" exclude="Build,Analyzers" />
<dependency id="Microsoft.EntityFrameworkCore.Relational" version="9.0.8" exclude="Build,Analyzers" />
<dependency id="Microsoft.EntityFrameworkCore.SqlServer" version="9.0.8" exclude="Build,Analyzers" />
<dependency id="Microsoft.EntityFrameworkCore.Sqlite" version="9.0.8" exclude="Build,Analyzers" />
<dependency id="Microsoft.Extensions.Localization" version="9.0.8" exclude="Build,Analyzers" />
<dependency id="MySql.Data" version="9.4.0" exclude="Build,Analyzers" />
<dependency id="Npgsql.EntityFrameworkCore.PostgreSQL" version="9.0.4" exclude="Build,Analyzers" />
<dependency id="Pomelo.EntityFrameworkCore.MySql" version="9.0.0" exclude="Build,Analyzers" />
<dependency id="SQLitePCLRaw.bundle_e_sqlite3" version="3.0.2" exclude="Build,Analyzers" />
<dependency id="Microsoft.AspNetCore.Authentication.OpenIdConnect" version="9.0.8" exclude="Build,Analyzers" />
<dependency id="SixLabors.ImageSharp" version="3.1.11" exclude="Build,Analyzers" />
<dependency id="HtmlAgilityPack" version="1.12.2" exclude="Build,Analyzers" />
<dependency id="Swashbuckle.AspNetCore" version="9.0.4" exclude="Build,Analyzers" />
<dependency id="MailKit" version="4.13.0" exclude="Build,Analyzers" />
<dependency id="MySql.Data" version="9.4.0" exclude="Build,Analyzers" />
<dependency id="Pomelo.EntityFrameworkCore.MySql" version="9.0.0" exclude="Build,Analyzers" />
<dependency id="EFCore.NamingConventions" version="9.0.0" exclude="Build,Analyzers" />
<dependency id="Microsoft.EntityFrameworkCore.Relational" version="9.0.8" exclude="Build,Analyzers" />
<dependency id="Npgsql.EntityFrameworkCore.PostgreSQL" version="9.0.4" exclude="Build,Analyzers" />
<dependency id="Microsoft.EntityFrameworkCore.Sqlite" version="9.0.8" exclude="Build,Analyzers" />
<dependency id="Microsoft.Data.Sqlite.Core" version="9.0.8" exclude="Build,Analyzers" />
<dependency id="SQLitePCLRaw.bundle_e_sqlite3" version="3.0.2" exclude="Build,Analyzers" />
<dependency id="Microsoft.EntityFrameworkCore.SqlServer" version="9.0.8" exclude="Build,Analyzers" />
</group>
</dependencies>
<frameworkReferences>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -85,8 +85,10 @@ namespace Oqtane.Shared
public const string DefaultSearchProviderName = "DatabaseSearchProvider";
public static readonly string[] InternalPagePaths = { "login", "register", "reset", "404" };
public const string DefaultTextEditor = "Oqtane.Modules.Controls.QuillJSTextEditor, Oqtane.Client";
//Obtained from https://cdnjs.com/libraries/bootstrap
public const string DefaultTextEditor = "Oqtane.Modules.Controls.RadzenTextEditor, Oqtane.Client";
// obtained from https://cdnjs.com/libraries/bootstrap
public const string BootstrapScriptUrl = "https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.7/js/bootstrap.bundle.min.js";
public const string BootstrapScriptIntegrity = "sha512-Tc0i+vRogmX4NN7tuLbQfBxa8JkfUSAxSFVzmU31nVdHyiHElPPy2cWfFacmCJKw0VqovrzKhdd2TSTMdAxp2g==";
public const string BootstrapStylesheetUrl = "https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.7/css/bootstrap.min.css";