Guler.Editor.AspNetCore
0.2.0-alpha.0
dotnet add package Guler.Editor.AspNetCore --version 0.2.0-alpha.0
NuGet\Install-Package Guler.Editor.AspNetCore -Version 0.2.0-alpha.0
<PackageReference Include="Guler.Editor.AspNetCore" Version="0.2.0-alpha.0" />
<PackageVersion Include="Guler.Editor.AspNetCore" Version="0.2.0-alpha.0" />
<PackageReference Include="Guler.Editor.AspNetCore" />
paket add Guler.Editor.AspNetCore --version 0.2.0-alpha.0
#r "nuget: Guler.Editor.AspNetCore, 0.2.0-alpha.0"
#:package Guler.Editor.AspNetCore@0.2.0-alpha.0
#addin nuget:?package=Guler.Editor.AspNetCore&version=0.2.0-alpha.0&prerelease
#tool nuget:?package=Guler.Editor.AspNetCore&version=0.2.0-alpha.0&prerelease
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 (
/thumbendpoint, 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 | Versions 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. |
-
net8.0
- Guler.Editor.Core (>= 0.2.0-alpha.0)
- Guler.Editor.Licensing (>= 0.2.0-alpha.0)
- SkiaSharp.NativeAssets.Linux (>= 3.116.1)
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 |