Guler.Editor.AspNetCore 0.2.0-alpha.0

This is a prerelease version of Guler.Editor.AspNetCore.
dotnet add package Guler.Editor.AspNetCore --version 0.2.0-alpha.0
                    
NuGet\Install-Package Guler.Editor.AspNetCore -Version 0.2.0-alpha.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Guler.Editor.AspNetCore" Version="0.2.0-alpha.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Guler.Editor.AspNetCore" Version="0.2.0-alpha.0" />
                    
Directory.Packages.props
<PackageReference Include="Guler.Editor.AspNetCore" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Guler.Editor.AspNetCore --version 0.2.0-alpha.0
                    
#r "nuget: Guler.Editor.AspNetCore, 0.2.0-alpha.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Guler.Editor.AspNetCore@0.2.0-alpha.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Guler.Editor.AspNetCore&version=0.2.0-alpha.0&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Guler.Editor.AspNetCore&version=0.2.0-alpha.0&prerelease
                    
Install as a Cake Tool

Stylus.AspNetCore

ASP.NET Core (.NET 8+) için Stylus editör + dosya yöneticisi paketi.

Stylus.Core üstüne inşa edilmiştir. Razor TagHelper, Minimal API endpoint'leri, IHttpContextAccessor tabanlı authorization, RCL Static Web Assets ile JS/CSS asset servisi.

Hızlı başlangıç

dotnet add package Stylus.AspNetCore
// Program.cs
using Stylus.AspNetCore.Extensions;

var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRazorPages();
builder.Services.AddStylus(opts =>
{
    opts.RootDirectory = "stylus-uploads"; // wwwroot altına relative
    opts.AllowedExtensions = new[] { ".jpg", ".png", ".pdf" };
});

var app = builder.Build();
app.UseStaticFiles();
app.UseAuthentication();
app.UseAuthorization();
app.MapRazorPages();
app.MapStylusFileManager(); // /_stylus/files altında 7 endpoint
app.Run();
@* Pages/Index.cshtml *@
@addTagHelper *, Stylus.AspNetCore

<form method="post">
    <stylus-editor id="editor" name="Article" value="@Model.Article.Html" />
    <button type="submit">Kaydet</button>
</form>
// Pages/Index.cshtml.cs
using Stylus.Core.Sanitization;

public class IndexModel : PageModel
{
    private readonly IStylusSanitizer _sanitizer;
    public IndexModel(IStylusSanitizer sanitizer) => _sanitizer = sanitizer;

    [BindProperty] public ArticleModel Article { get; set; } = new();

    public IActionResult OnPost()
    {
        Article.Html = _sanitizer.Sanitize(Article.Html); // XSS savunma
        // ... DB'ye yaz
        return RedirectToPage();
    }
}

public class ArticleModel
{
    public string Html { get; set; } = "";
    public string Json { get; set; } = "";
}

TagHelper attribute'ları

<stylus-editor> etiketine destekli:

Attribute Default Açıklama
id "stylus-editor" DOM id
name "Content" Form binding adı ({name}.Html + {name}.Json hidden input'ları)
value null Başlangıç HTML değeri
toolbar true Toolbar gösterilsin mi
char-count true Footer'da char counter
source-view true </> toggle butonu
autosave-delay 0 Idle ms; 0 = devre dışı
file-manager true Image butonu file picker dialog'unu açar
file-manager-url "/_stylus/files" API base URL
thumbnail-width 0 >0 ise editör img src'sine /thumb URL'si yazılır
thumbnail-format "jpeg" jpeg/png/webp

Feature seti

  • Editör: bold/italic/underline/strike/H1-H3/paragraph/bullet-list/ordered-list/blockquote/link/image/embed/source-view
  • Slash menu (Notion-style /)
  • Türkçe arayüz (i18n: TR + EN, override edilebilir)
  • Custom prompt/confirm modallar (focus trap + Esc/Enter + a11y)
  • Drag-drop image upload (file manager backend ile)
  • Server-side thumbnail (/thumb endpoint, SkiaSharp downscale)
  • Paste-from-Word HTML cleanup
  • Backend XSS sanitize (IStylusSanitizer + Stylus schema whitelist)

Authorization + tenant isolation

Default IStylusAuthorizationContext HttpContext.User.NameIdentifier claim'inden tenant scope üretir (u-{userId} prefix). Tüm storage operasyonları otomatik bu scope'a kapatılır — multi-tenant SaaS hazır.

builder.Services.AddStylus(
    fm => fm.RootDirectory = "uploads",
    auth =>
    {
        auth.TenantClaimType = "tenant_id"; // custom claim
        auth.TenantPrefix = "tenant-";
    });

Tüketici kendi IStylusAuthorizationContext impl'ini register edebilir (role-based, klasör pattern, owner check vs).

Bağımlılıklar

  • Stylus.Core (≥ 0.1.0-alpha.0)
  • SkiaSharp.NativeAssets.Linux (Linux container deploy için)

Lisans

MIT — Stylus open core taahhüdü.

Faz 2 alpha durumu

Bu paket Faz 2 alpha sürümündedir. Bir gerçek müşteri projesinde 2 hafta sorunsuz production deployment Faz 3'e geçiş kriteri.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.2.0-alpha.0 127 5/1/2026