feat(creator): Add polished single-chapter editor workspace page under /creator/edit/{BookId}/{ChapterId}
- Implementedfullscreen wrapper layout to eliminate browser scrollbar bugs - Styled matte finish sidebar with active chapter indicators - Standardized header alignment with clean monospace ID badge - Integrated footer panel for state save indicators and premium action triggers
This commit is contained in:
@@ -0,0 +1,60 @@
|
|||||||
|
@page "/creator/edit/{BookId}/{ChapterId}"
|
||||||
|
@layout MainHubLayout
|
||||||
|
@attribute [Authorize]
|
||||||
|
|
||||||
|
<div class="creator-edit-fullscreen-wrapper">
|
||||||
|
|
||||||
|
<div class="chapters-sidebar">
|
||||||
|
<h2>Rozdziały</h2>
|
||||||
|
<div class="chapter-item active">
|
||||||
|
<span>1. Rozdział 1: Wprowadzenie d...</span>
|
||||||
|
</div>
|
||||||
|
<div class="chapter-item">
|
||||||
|
<span>2. Rozdział 2: Zabezpieczenia i...</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="editor-workspace-area">
|
||||||
|
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem;">
|
||||||
|
<h1 class="chapter-title">Rozdział 1: Wprowadzenie do Zen Mode</h1>
|
||||||
|
<span class="chapter-id-badge">ID: @GetSafeChapterIdPrefix()...</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="editor-canvas-card">
|
||||||
|
<div class="milkdown-premium-container" spellcheck="false">
|
||||||
|
<div id="editor"></div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="editor-footer-bar">
|
||||||
|
<div class="cloud-status">
|
||||||
|
<i class="fa-solid fa-circle-check"></i>
|
||||||
|
<span>Saved to Cloud</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button class="btn-nexus-premium" @onclick="FetchContent">
|
||||||
|
<span>Fetch Markdown Content</span>
|
||||||
|
<i class="fa-solid fa-arrow-right"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
@code {
|
||||||
|
[Parameter]
|
||||||
|
public string BookId { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
[Parameter]
|
||||||
|
public string ChapterId { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
private void FetchContent()
|
||||||
|
{
|
||||||
|
// Actual retrieval logic can go here
|
||||||
|
}
|
||||||
|
|
||||||
|
private string GetSafeChapterIdPrefix()
|
||||||
|
{
|
||||||
|
if (string.IsNullOrEmpty(ChapterId)) return "N/A";
|
||||||
|
return ChapterId.Length >= 8 ? ChapterId.Substring(0, 8) : ChapterId;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,141 @@
|
|||||||
|
/* --- 1. BLOKADA VIEWPORTU (ZERO GLOBAL SCROLL) --- */
|
||||||
|
.creator-edit-fullscreen-wrapper {
|
||||||
|
width: 100% !important;
|
||||||
|
max-width: 100% !important;
|
||||||
|
height: calc(100vh - 4rem) !important; /* Idealne odcięcie od topbaru platformy */
|
||||||
|
margin: 0;
|
||||||
|
padding: 0 !important; /* Likwidujemy marginesy zewnętrzne dla pełnego ekranu roboczego */
|
||||||
|
display: flex;
|
||||||
|
overflow: hidden !important; /* Całkowity zakaz przewijania głównego okna */
|
||||||
|
background-color: var(--bg-base);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- 2. LUKSUSOWY PANEL BOCZNY ROZDZIAŁÓW --- */
|
||||||
|
.chapters-sidebar {
|
||||||
|
width: 280px !important;
|
||||||
|
flex-shrink: 0;
|
||||||
|
background-color: #16161a !important; /* Matowy, głęboki odcień grafitu */
|
||||||
|
border-right: 1px solid rgba(255, 255, 255, 0.05) !important;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 2rem 1rem !important;
|
||||||
|
overflow-y: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-light .chapters-sidebar {
|
||||||
|
background-color: #ede9df !important; /* Harmonijna, ciemniejsza sepia dla jasnego motywu */
|
||||||
|
border-right: 1px solid var(--border) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chapters-sidebar h2 {
|
||||||
|
font-size: 1.25rem;
|
||||||
|
font-weight: 700;
|
||||||
|
color: var(--text-main);
|
||||||
|
margin-bottom: 1.5rem;
|
||||||
|
padding-left: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Elementy listy rozdziałów */
|
||||||
|
.chapter-item {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 10px 14px !important;
|
||||||
|
margin-bottom: 4px;
|
||||||
|
border-radius: 8px;
|
||||||
|
color: var(--text-muted);
|
||||||
|
font-size: 0.95rem;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: all 0.2s ease;
|
||||||
|
border-left: 3px solid transparent !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Stan aktywny wybranego rozdziału (Zunifikowany z systemem) */
|
||||||
|
.chapter-item.active {
|
||||||
|
background-color: rgba(0, 255, 153, 0.04) !important;
|
||||||
|
color: var(--accent) !important;
|
||||||
|
font-weight: 600;
|
||||||
|
border-left: 3px solid var(--accent) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.theme-light .chapter-item.active {
|
||||||
|
background-color: rgba(16, 185, 129, 0.06) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chapter-item:hover:not(.active) {
|
||||||
|
background-color: rgba(255, 255, 255, 0.02);
|
||||||
|
color: var(--text-main);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- 3. OBSZAR WORKSPACE (KREATOR CENTRUM) --- */
|
||||||
|
.editor-workspace-area {
|
||||||
|
flex-grow: 1;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
|
padding: 2.5rem 3.5rem 1.5rem 3.5rem !important; /* Większy oddech boczny dla trybu Zen */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Tytuł rozdziału u góry */
|
||||||
|
.editor-workspace-area h1.chapter-title {
|
||||||
|
font-size: 2.2rem;
|
||||||
|
font-weight: 700;
|
||||||
|
color: var(--text-main);
|
||||||
|
margin: 0 0 1.5rem 0;
|
||||||
|
letter-spacing: -0.5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Dyskretny indykator ID rozdziału */
|
||||||
|
.chapter-id-badge {
|
||||||
|
font-family: 'Azeret Mono', monospace;
|
||||||
|
font-size: 0.75rem;
|
||||||
|
color: var(--text-muted);
|
||||||
|
background: rgba(255, 255, 255, 0.02);
|
||||||
|
padding: 2px 8px;
|
||||||
|
border-radius: 4px;
|
||||||
|
border: 1px solid rgba(255, 255, 255, 0.05);
|
||||||
|
opacity: 0.6;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- 4. KARTA ROBOCZA EDYTORA I SCROLLBAR --- */
|
||||||
|
.editor-canvas-card {
|
||||||
|
background-color: var(--bg-surface) !important;
|
||||||
|
border: 1px solid var(--border) !important;
|
||||||
|
border-radius: 16px;
|
||||||
|
padding: 2.5rem !important;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
flex-grow: 1;
|
||||||
|
overflow: hidden; /* Kontrola przewijania wyłącznie wewnątrz tekstu */
|
||||||
|
}
|
||||||
|
|
||||||
|
::deep .ProseMirror {
|
||||||
|
color: var(--text-main) !important;
|
||||||
|
flex-grow: 1;
|
||||||
|
overflow-y: auto !important; /* Przewija się tylko tekst książki! */
|
||||||
|
padding-right: 20px !important;
|
||||||
|
outline: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* --- 5. ZINTEGROWANY PASEK STANU I AKCJI (FOOTER) --- */
|
||||||
|
.editor-footer-bar {
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
margin-top: 1.5rem;
|
||||||
|
padding-top: 1rem;
|
||||||
|
border-top: 1px solid var(--border);
|
||||||
|
flex-shrink: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.cloud-status {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
font-size: 0.85rem;
|
||||||
|
color: var(--text-muted);
|
||||||
|
}
|
||||||
|
|
||||||
|
.cloud-status i {
|
||||||
|
color: var(--accent); /* Zielona dioda zapisu statusu */
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user