From 061a3cfdb94e0994dfd95cf53b5aa103b221fa76 Mon Sep 17 00:00:00 2001 From: lix-2026 Date: Tue, 26 May 2026 03:03:27 +0800 Subject: [PATCH] refactor: split tiptap editor style --- ...ime-module-maintainability-checklist-v1.md | 2 +- .../src/editor_runtime/mod.rs | 1 + .../src/editor_runtime/style.rs | 2422 ++++++++++++++++ rust/spikes/leptos-tiptap-spike/src/lib.rs | 2424 +---------------- 4 files changed, 2425 insertions(+), 2424 deletions(-) create mode 100644 rust/spikes/leptos-tiptap-spike/src/editor_runtime/style.rs diff --git a/design/10-review/process/16-mnote-web-runtime-module-maintainability-checklist-v1.md b/design/10-review/process/16-mnote-web-runtime-module-maintainability-checklist-v1.md index f8cf002d..f72644df 100644 --- a/design/10-review/process/16-mnote-web-runtime-module-maintainability-checklist-v1.md +++ b/design/10-review/process/16-mnote-web-runtime-module-maintainability-checklist-v1.md @@ -243,7 +243,7 @@ cargo test --manifest-path rust/Cargo.toml -p mnote-web --lib routes::tree -- -- 拆分项: -- [ ] E1. `style.rs`:迁出 `SPIKE_STYLE`,根 `lib.rs` 只引用常量。 +- [x] E1. `style.rs`:迁出 `SPIKE_STYLE`,根 `lib.rs` 只引用常量。 - [ ] E2. `mount.rs`:迁出 mount context、mounted handles、`mount_app_into` 周边可独立部分;`#[wasm_bindgen]` wrapper 可暂留根文件。 - [ ] E3. `runtime_bridge.rs`:迁出 `dispatch_runtime_event`、`dispatch_*_to_target`、host command listener install。 - [ ] E4. `block_transform.rs`:迁出 `run_block_turn_into_action`、`top_level_block_matches_action`、page/block transform helpers。 diff --git a/rust/spikes/leptos-tiptap-spike/src/editor_runtime/mod.rs b/rust/spikes/leptos-tiptap-spike/src/editor_runtime/mod.rs index b692825d..fabc9e90 100644 --- a/rust/spikes/leptos-tiptap-spike/src/editor_runtime/mod.rs +++ b/rust/spikes/leptos-tiptap-spike/src/editor_runtime/mod.rs @@ -16,5 +16,6 @@ pub(crate) mod mindmap_node_view; pub(crate) mod overlays; pub(crate) mod persistence; pub(crate) mod slash_actions; +pub(crate) mod style; pub(crate) mod table_commands; pub(crate) mod table_toolbar_view; diff --git a/rust/spikes/leptos-tiptap-spike/src/editor_runtime/style.rs b/rust/spikes/leptos-tiptap-spike/src/editor_runtime/style.rs new file mode 100644 index 00000000..3017dde2 --- /dev/null +++ b/rust/spikes/leptos-tiptap-spike/src/editor_runtime/style.rs @@ -0,0 +1,2422 @@ +pub(crate) const SPIKE_STYLE: &str = r#" +:root { + --tt-color-text: #111827; + --tt-color-text-gray: #6b7280; + --tt-color-text-brown: #8b5e3c; + --tt-color-text-orange: #c96b1f; + --tt-color-text-yellow: #b7791f; + --tt-color-text-green: #18794e; + --tt-color-text-blue: #1d4ed8; + --tt-color-text-purple: #7c3aed; + --tt-color-text-pink: #be185d; + --tt-color-text-red: #b91c1c; + --tt-color-highlight-yellow: #fef3c7; + --tt-color-highlight-green: #dcfce7; + --tt-color-highlight-blue: #dbeafe; + --tt-color-highlight-purple: #ede9fe; + --tt-color-highlight-pink: #fce7f3; + --tt-color-highlight-red: #fee2e2; + --tt-color-highlight-orange: #ffedd5; + --tt-color-highlight-gray: #e5e7eb; +} + +.app-shell { + max-width: 1180px; + margin: 0 auto; + padding: 28px 20px 72px; +} + +.app-shell-embedded { + max-width: none; + margin: 0; + padding: 0; +} + +.app-shell-embedded .hero-bar, +.app-shell-embedded .title-input, +.app-shell-embedded .editor-subcopy, +.app-shell-embedded .footer-strip, +.app-shell-embedded .debug-drawer, +.app-shell-embedded .editor-crumbs:first-child, +.app-shell-embedded .editor-crumbs:last-child { + display: none; +} + +.app-shell-embedded .editor-card { + border: none; + border-radius: 0; + box-shadow: none; + background: transparent; + overflow: visible; +} + +.app-shell-embedded .editor-topbar { + display: none; +} + +.app-shell-embedded .editor-stage { + margin: 0; + border: none; + border-radius: 0; + background: transparent; + box-shadow: none; +} + +.hero-bar { + display: flex; + justify-content: space-between; + align-items: flex-start; + gap: 18px; + margin-bottom: 20px; +} + +.hero-meta { + display: grid; + gap: 10px; +} + +.hero-tag { + display: inline-flex; + align-items: center; + gap: 8px; + width: fit-content; + padding: 6px 12px; + border-radius: 999px; + background: rgba(15, 118, 110, 0.12); + color: var(--accent-strong); + font-size: 12px; + letter-spacing: .08em; + text-transform: uppercase; +} + +.hero-title { + margin: 0; + font-size: 40px; + line-height: 1.04; +} + +.hero-copy { + margin: 0; + max-width: 680px; + color: var(--muted); + line-height: 1.75; +} + +.hero-actions { + display: flex; + flex-wrap: wrap; + gap: 10px; + justify-content: flex-end; +} + +.hero-chip { + display: inline-flex; + align-items: center; + gap: 8px; + padding: 10px 14px; + border: 1px solid var(--line); + border-radius: 16px; + background: rgba(255, 255, 255, 0.92); + color: var(--ink); + font-size: 13px; + box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05); +} + +.hero-chip strong { + color: var(--accent-strong); +} + +.editor-card { + position: relative; + border: 1px solid rgba(100, 116, 139, 0.18); + border-radius: 30px; + background: + linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(254, 251, 246, 0.98) 100%); + box-shadow: 0 28px 64px rgba(15, 23, 42, 0.08); + overflow: hidden; +} + +.editor-topbar { + display: flex; + justify-content: space-between; + align-items: center; + gap: 14px; + padding: 18px 22px 12px; +} + +.editor-crumbs { + display: flex; + align-items: center; + gap: 10px; + color: var(--muted); + font-size: 13px; +} + +.editor-crumbs strong { + color: var(--ink); +} + +.title-input { + width: 100%; + border: none; + outline: none; + background: transparent; + font-size: 48px; + line-height: 1.05; + font-weight: 700; + color: #0f172a; + padding: 8px 22px 6px; +} + +.title-input::placeholder { + color: #94a3b8; +} + +.editor-subcopy { + display: flex; + flex-wrap: wrap; + gap: 10px 16px; + align-items: center; + padding: 0 22px 18px; + color: var(--muted); + font-size: 14px; +} + +.hint-pill { + display: inline-flex; + align-items: center; + gap: 8px; + padding: 8px 12px; + border-radius: 999px; + background: rgba(15, 118, 110, 0.09); + color: var(--accent-strong); + font-size: 13px; +} + +.editor-stage { + position: relative; + width: min(100%, 900px); + margin: 0 auto 18px; + border: 1px solid rgba(100, 116, 139, 0.18); + border-radius: 26px; + background: rgba(255, 255, 255, 0.92); + box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8); +} + +.editor-stage[data-page-wide-layout="true"] { + width: min(100%, 1120px); +} + +.mnote-mindmap-placeholder { + width: min(1280px, calc(100vw - 340px)); + margin: 10px 0; + margin-left: 50%; + transform: translateX(-50%); +} + +.mnote-mindmap-editor-root { + position: relative; + overflow: hidden; + border: 1px solid rgba(148, 163, 184, 0.32); + border-radius: 8px; + background: #ffffff; + color: #0f172a; +} + +.mnote-leptos-mindmap-shell { + position: relative; + height: min(72vh, 720px); + min-height: 560px; + display: flex; + flex-direction: column; +} + +.mnote-mindmap-command-toolbar, +.mnote-mindmap-bottom-bar { + display: flex; + align-items: center; + gap: 6px; + padding: 8px; + border-bottom: 1px solid rgba(148, 163, 184, 0.26); + background: #ffffff; +} + +.mnote-mindmap-command-toolbar { + flex-wrap: nowrap; +} + +.mnote-mindmap-schema-toolbar { + position: absolute; + left: 50%; + top: 22px; + z-index: 4; + width: max-content; + max-width: min(980px, calc(100% - 184px)); + box-sizing: border-box; + transform: translateX(-50%); + gap: 8px; + padding: 7px 12px; + border: 1px solid rgba(15, 23, 42, 0.08); + border-radius: 6px; + background: rgba(255, 255, 255, 0.95); + box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1); + backdrop-filter: blur(10px); + overflow-x: visible; + overflow-y: visible; + scrollbar-width: none; +} + +.mnote-mindmap-toolbar-primary, +.mnote-mindmap-toolbar-secondary { + display: flex; + align-items: center; + gap: 8px; + justify-content: center; + flex-wrap: nowrap; + min-width: 0; +} + +.mnote-mindmap-toolbar-cluster { + display: inline-flex; + align-items: center; + gap: 4px; + flex: 0 0 auto; + min-width: 0; + white-space: nowrap; +} + +.mnote-mindmap-toolbar-cluster-file { + padding-left: 8px; + border-left: 1px solid rgba(148, 163, 184, 0.24); +} + +.mnote-mindmap-toolbar-group { + display: inline-flex; + align-items: center; + gap: 4px; + padding-right: 10px; + border-right: 1px solid rgba(148, 163, 184, 0.22); +} + +.mnote-mindmap-toolbar-group:last-child { + border-right: 0; +} + +.mnote-mindmap-toolbar-group-label { + position: absolute; + width: 1px; + height: 1px; + margin: -1px; + overflow: hidden; + clip: rect(0 0 0 0); + color: #64748b; + font-size: 11px; +} + +.mnote-mindmap-toolbar-primary input, +.mnote-mindmap-bottom-bar input { + height: 28px; + border: 1px solid rgba(148, 163, 184, 0.42); + border-radius: 6px; + padding: 0 8px; + background: #fff; + color: #0f172a; + font-size: 12px; +} + +.mnote-mindmap-tool, +.mnote-mindmap-bottom-bar button, +.mnote-mindmap-side-tab { + height: 28px; + border: 1px solid rgba(148, 163, 184, 0.34); + border-radius: 6px; + padding: 0 9px; + background: #fff; + color: #334155; + font-size: 12px; + cursor: pointer; +} + +.mnote-mindmap-schema-toolbar .mnote-mindmap-tool { + flex-direction: column; + display: inline-flex; + align-items: center; + justify-content: center; + gap: 2px; + width: 46px; + height: 40px; + min-width: 46px; + padding: 3px 4px; + color: #475569; +} + +.mnote-mindmap-tool-icon { + min-width: 16px; + font-size: 15px; + line-height: 1; +} + +.mnote-mindmap-tool-label { + max-width: 42px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + font-size: 11px; + line-height: 14px; +} + +.mnote-mindmap-tool:disabled, +.mnote-mindmap-bottom-bar button:disabled, +.mnote-mindmap-side-tab:disabled { + cursor: default; + opacity: 0.48; +} + +.mnote-mindmap-toolbar-more { + position: relative; + display: inline-flex; + flex: 0 0 auto; +} + +.mnote-mindmap-toolbar-more-button[data-open="true"] { + border-color: rgba(37, 99, 235, 0.42); + background: #eff6ff; + color: #1d4ed8; +} + +.mnote-mindmap-toolbar-more-menu { + position: absolute; + right: 0; + top: calc(100% + 8px); + z-index: 8; + display: grid; + grid-template-columns: 1fr; + gap: 4px; + min-width: 128px; + padding: 8px; + border: 1px solid rgba(15, 23, 42, 0.1); + border-radius: 6px; + background: #ffffff; + box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16); +} + +.mnote-mindmap-toolbar-more-menu .mnote-mindmap-tool { + flex-direction: row; + justify-content: flex-start; + width: 100%; + min-width: 112px; + height: 30px; + gap: 8px; + padding: 0 8px; +} + +.mnote-mindmap-toolbar-more-menu .mnote-mindmap-tool-label { + max-width: none; + font-size: 12px; +} + +.mnote-mindmap-workspace { + display: grid; + grid-template-columns: minmax(0, 1fr); + min-height: 460px; +} + +.mnote-mindmap-workspace[data-layout="floating-overlay"] { + position: relative; + display: block; + width: 100%; + height: 100%; + min-height: 560px; + overflow: hidden; + background: #f7f8fa; +} + +.mnote-mindmap-canvas-layer { + position: absolute; + inset: 0; + z-index: 1; +} + +.mnote-mindmap-overlay-layer { + position: absolute; + inset: 0; + z-index: 3; + pointer-events: none; +} + +.mnote-mindmap-overlay-layer > * { + pointer-events: auto; +} + +.mnote-mindmap-rust-shell-mount, +.mnote-mindmap-rust-shell { + position: absolute; + inset: 0; + z-index: 4; + pointer-events: none; +} + +.mnote-mindmap-rust-shell > * { + pointer-events: auto; +} + +.mnote-mindmap-workspace[data-debug-chrome="true"] { + grid-template-columns: minmax(0, 1fr) 132px; +} + +.mnote-mindmap-workspace[data-debug-chrome="false"] { + grid-template-columns: minmax(0, 1fr) 172px; +} + +.mnote-leptos-mindmap-runtime { + position: relative; + height: 460px; + min-height: 460px; + overflow: hidden; + background: #ffffff; +} + +.mnote-mindmap-workspace[data-layout="floating-overlay"] .mnote-leptos-mindmap-runtime { + position: absolute; + inset: 0; + width: 100%; + height: 100%; + min-height: 100%; + background: #f7f8fa; +} + +.mnote-leptos-mindmap-runtime svg { + position: absolute; + inset: 0; + width: 100%; + height: 100%; + pointer-events: auto; +} + +.mnote-leptos-mindmap-runtime .smm-node { + cursor: default; +} + +.mnote-mindmap-side-panel { + border-left: 1px solid rgba(148, 163, 184, 0.26); + background: #fff; + padding: 8px; +} + +.mnote-mindmap-schema-sidebar { + position: absolute; + right: 18px; + top: 50%; + z-index: 4; + width: auto; + max-height: calc(100% - 130px); + transform: translateY(-50%); + display: flex; + align-items: flex-start; + gap: 12px; + border: 0; + border-radius: 0; + background: transparent; + box-shadow: none; + backdrop-filter: none; + padding: 0; +} + +.mnote-mindmap-side-rail { + width: 60px; + display: flex; + flex-direction: column; + gap: 8px; + padding: 10px 8px 8px; + border: 1px solid rgba(15, 23, 42, 0.08); + border-radius: 10px; + background: rgba(255, 255, 255, 0.96); + box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1); + backdrop-filter: blur(10px); +} + +.mnote-mindmap-side-rail-handle, +.mnote-mindmap-side-restore-handle, +.mnote-mindmap-side-drawer-close { + display: inline-flex; + align-items: center; + justify-content: center; + border: 1px solid rgba(148, 163, 184, 0.24); + background: rgba(248, 250, 252, 0.98); + color: #475569; +} + +.mnote-mindmap-side-rail-handle { + width: 100%; + min-height: 24px; + border-radius: 8px; +} + +.mnote-mindmap-side-restore-handle { + width: 22px; + min-height: 72px; + margin-top: 64px; + border-radius: 999px; + box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1); +} + +.mnote-mindmap-side-rail-handle:hover, +.mnote-mindmap-side-restore-handle:hover, +.mnote-mindmap-side-drawer-close:hover { + border-color: rgba(37, 99, 235, 0.36); + background: #eff6ff; + color: #1d4ed8; +} + +.mnote-mindmap-side-tab { + width: 100%; + display: inline-flex; + flex-direction: column; + align-items: center; + gap: 3px; + justify-content: center; + margin-bottom: 0; + min-height: 56px; + padding: 8px 2px; + text-align: center; + border: 0; + border-radius: 8px; + background: transparent; + color: #475569; + position: relative; +} + +.mnote-mindmap-side-icon { + width: 100%; + overflow: hidden; + color: #64748b; + font-size: 13px; + text-overflow: ellipsis; +} + +.mnote-mindmap-side-tab-label { + font-size: 11px; + line-height: 1.2; +} + +.mnote-mindmap-side-tab[data-active="true"] { + background: #eff6ff; + color: #1d4ed8; +} + +.mnote-mindmap-side-tab[data-active="true"]::before { + content: ""; + position: absolute; + left: -8px; + top: 8px; + bottom: 8px; + width: 3px; + border-radius: 999px; + background: #2563eb; +} + +.mnote-mindmap-side-body { + position: absolute; + right: 72px; + top: 0; + width: 300px; + margin-top: 0; + color: #64748b; + font-size: 12px; + padding: 16px; + border: 1px solid rgba(15, 23, 42, 0.08); + border-radius: 12px; + background: rgba(255, 255, 255, 0.96); + box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1); + backdrop-filter: blur(10px); +} + +.mnote-mindmap-schema-sidebar .mnote-mindmap-side-body { + padding-top: 16px; +} + +.mnote-mindmap-side-body strong, +.mnote-mindmap-side-body span { + display: block; +} + +.mnote-mindmap-side-drawer-header { + display: flex; + align-items: flex-start; + justify-content: space-between; + gap: 12px; +} + +.mnote-mindmap-side-drawer-heading { + min-width: 0; + flex: 1; +} + +.mnote-mindmap-side-drawer-heading strong { + color: #0f172a; + font-size: 15px; + line-height: 1.3; +} + +.mnote-mindmap-side-drawer-heading span { + margin-top: 4px; + color: #64748b; + font-size: 12px; +} + +.mnote-mindmap-side-drawer-close { + width: 28px; + min-width: 28px; + min-height: 28px; + border-radius: 8px; +} + +.mnote-mindmap-side-swatches { + display: flex; + gap: 5px; + margin-top: 8px; +} + +.mnote-mindmap-side-swatches i { + width: 18px; + height: 18px; + border: 1px solid rgba(148, 163, 184, 0.38); + border-radius: 4px; + background: #f8fafc; +} + +.mnote-mindmap-side-options { + display: grid; + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 10px; + margin-top: 16px; +} + +.mnote-mindmap-side-option { + min-height: 40px; + padding: 10px; + border: 1px solid rgba(148, 163, 184, 0.28); + border-radius: 8px; + background: #f8fafc; + color: #334155; + font-size: 12px; + line-height: 1.3; + text-align: left; +} + +.mnote-mindmap-side-option:hover { + border-color: rgba(37, 99, 235, 0.38); + background: #eff6ff; + color: #1d4ed8; +} + +.mnote-mindmap-side-option-readonly { + background: #fff; +} + +.mnote-mindmap-side-option-label { + color: inherit; + font-weight: 500; +} + +.mnote-mindmap-side-option-description { + margin-top: 4px; + color: #64748b; + font-size: 11px; +} + +.mnote-mindmap-side-option-swatch { + display: flex; + align-items: center; + gap: 10px; +} + +.mnote-mindmap-side-option-swatch-chip { + width: 18px; + height: 18px; + min-width: 18px; + border: 1px solid rgba(148, 163, 184, 0.28); + border-radius: 999px; +} + +.mnote-mindmap-side-option-layout-card { + display: flex; + min-height: 86px; + flex-direction: column; + justify-content: flex-start; + gap: 8px; +} + +.mnote-mindmap-side-option-preview-card { + display: inline-flex; + align-items: center; + justify-content: center; + width: 100%; + min-height: 38px; + border-radius: 6px; + background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%); + color: #1d4ed8; + font-size: 11px; + line-height: 1; +} + +.mnote-mindmap-side-outline { + max-height: 172px; + margin: 16px 0 0; + padding-left: 14px; + overflow: auto; + color: #334155; + font-size: 11px; + line-height: 1.45; +} + +.mnote-mindmap-side-outline:empty { + display: none; +} + +.mnote-mindmap-side-swatches i:nth-child(2) { + background: #eef2ff; +} + +.mnote-mindmap-side-swatches i:nth-child(3) { + background: #ecfeff; +} + +.mnote-mindmap-bottom-bar { + border-top: 1px solid rgba(148, 163, 184, 0.26); + border-bottom: 0; + font-size: 12px; + color: #475569; +} + +.mnote-mindmap-schema-navigator { + position: absolute; + right: 28px; + bottom: 22px; + z-index: 4; + display: inline-flex; + align-items: center; + gap: 8px; + justify-content: flex-end; + min-height: 40px; + padding: 6px 8px; + border: 1px solid rgba(15, 23, 42, 0.08); + border-radius: 6px; + background: rgba(255, 255, 255, 0.94); + box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08); + backdrop-filter: blur(10px); +} + +.mnote-mindmap-schema-navigator [data-testid="mindmap-schema-navigator-stats"] { + margin-right: auto; +} + +.mnote-mindmap-schema-navigator-group { + display: inline-flex; + align-items: center; + gap: 6px; +} + +.mnote-mindmap-schema-navigator-button { + display: inline-flex; + align-items: center; + justify-content: center; + width: 30px; + min-width: 30px; + padding: 0; +} + +.mnote-mindmap-schema-navigator-button[data-active="true"] { + border-color: rgba(37, 99, 235, 0.32); + background: rgba(219, 234, 254, 0.94); + color: #1d4ed8; +} + +.mnote-mindmap-schema-navigator-zoom { + width: 62px; + text-align: center; + font-variant-numeric: tabular-nums; +} + +.mnote-mindmap-schema-navigator-search-wrap { + display: inline-flex; + align-items: center; + gap: 6px; +} + +.mnote-mindmap-schema-navigator-search-wrap input { + width: 136px; +} + +.mnote-mindmap-minimap { + position: absolute; + right: 28px; + bottom: 76px; + z-index: 4; + width: 180px; + height: 118px; + border: 1px solid rgba(15, 23, 42, 0.12); + border-radius: 6px; + background: rgba(255, 255, 255, 0.9); + box-shadow: 0 2px 16px rgba(15, 23, 42, 0.08); + pointer-events: auto; +} + +.mnote-mindmap-minimap-map { + position: absolute; + inset: 12px; +} + +.mnote-mindmap-minimap-map span { + position: absolute; + display: block; + width: 42px; + height: 14px; + border-radius: 4px; + background: #dbeafe; +} + +.mnote-mindmap-minimap-map span:nth-child(1) { + left: 54px; + top: 8px; + background: #bfdbfe; +} + +.mnote-mindmap-minimap-map span:nth-child(2) { + left: 22px; + top: 52px; + background: #dcfce7; +} + +.mnote-mindmap-minimap-map span:nth-child(3) { + right: 22px; + top: 52px; + background: #fde68a; +} + +.mnote-mindmap-minimap-viewport { + position: absolute; + left: 38px; + top: 30px; + width: 104px; + height: 62px; + border: 2px solid rgba(37, 99, 235, 0.75); + border-radius: 5px; + background: rgba(37, 99, 235, 0.08); +} + +.mnote-mindmap-context-menu { + position: absolute; + z-index: 8; + min-width: 132px; + padding: 6px; + border: 1px solid rgba(15, 23, 42, 0.12); + border-radius: 6px; + background: rgba(255, 255, 255, 0.96); + box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14); + pointer-events: auto; +} + +.mnote-mindmap-context-menu button { + display: block; + width: 100%; + min-height: 26px; + padding: 4px 8px; + border: 0; + border-radius: 4px; + background: transparent; + color: #334155; + font-size: 12px; + text-align: left; +} + +.mnote-mindmap-context-menu button:hover { + background: #eff6ff; + color: #1d4ed8; +} + +.mnote-mindmap-count { + position: absolute; + left: 28px; + bottom: 30px; + z-index: 4; + display: flex; + gap: 18px; + color: #64748b; + font-size: 12px; + pointer-events: auto; +} + +.block-handle-shell { + position: absolute; + left: 12px; + z-index: 80; + display: inline-flex; + flex-direction: column; + align-items: center; + gap: 1px; + width: 26px; + padding: 0; + background: transparent; + pointer-events: none; +} + +.block-handle-shell[data-dragging="true"] { + pointer-events: none; + opacity: 1; +} + +.block-handle-insert, +.block-handle-trigger { + position: relative; + width: 22px; + height: 20px; + display: inline-flex; + align-items: center; + justify-content: center; + border: none; + border-radius: 5px; + background: transparent; + color: #6b7280; + cursor: pointer; + pointer-events: auto; + transition: background .12s ease, border-color .12s ease, box-shadow .12s ease, color .12s ease, opacity .12s ease; +} + +.block-handle-insert { + opacity: 0; +} + +.block-handle-shell[data-menu-open="true"] .block-handle-insert { + opacity: 0; + pointer-events: none; +} + +.block-handle-trigger { + height: 22px; + border: 1px solid rgba(148, 163, 184, 0.42); + background: rgba(255, 255, 255, 0.96); + box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1); + cursor: grab; +} + +.block-handle-trigger:hover, +.block-handle-shell[data-keyboard-selected="true"] .block-handle-trigger, +.block-handle-shell[data-menu-open="true"] .block-handle-trigger { + border-color: rgba(107, 114, 128, 0.5); + background: #f8fafc; + color: #4b5563; + box-shadow: 0 2px 8px rgba(15, 23, 42, 0.14); +} + +.block-handle-trigger:active { + cursor: grabbing; +} + +.block-handle-icon-dots { + display: grid; + grid-template-columns: repeat(2, 3px); + grid-auto-rows: 3px; + gap: 3px; +} + +.block-handle-icon-dots span, +.block-handle-icon-lines span { + width: 3px; + height: 3px; + border-radius: 999px; + background: currentColor; +} + +.block-handle-icon-lines { + display: grid; + gap: 3px; +} + +.block-handle-icon-lines span { + display: none; + width: 12px; + height: 1.5px; + border-radius: 999px; +} + +.block-handle-shell[data-menu-open="true"] .block-handle-icon-dots span { + display: none; +} + +.block-handle-shell[data-menu-open="true"] .block-handle-icon-lines span { + display: block; +} + +.block-insert-line { + display: none; +} + +.block-insert-plus { + display: inline-flex; + align-items: center; + justify-content: center; + width: 18px; + height: 18px; + border: 1px solid rgba(148, 163, 184, 0.42); + border-radius: 5px; + background: rgba(255, 255, 255, 0.96); + color: #5f6773; + font-size: 16px; + line-height: 1; + box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1); +} + +.block-handle-insert:hover, +.block-handle-insert:focus-visible { + opacity: 1; +} + +.block-handle-insert:hover .block-insert-plus, +.block-handle-insert:focus-visible .block-insert-plus { + border-color: rgba(107, 114, 128, 0.5); + background: #f8fafc; + color: #4b5563; +} + +.block-insert-tooltip { + position: absolute; + left: 26px; + top: 50%; + transform: translateY(-50%); + min-width: 118px; + display: none; + gap: 5px; + align-items: center; + padding: 5px 7px; + border-radius: 5px; + background: rgba(17, 24, 39, 0.94); + color: #fff; + font-size: 12px; + line-height: 1.2; + white-space: nowrap; + box-shadow: 0 8px 22px rgba(15, 23, 42, 0.2); +} + +.block-insert-tooltip kbd { + color: rgba(255, 255, 255, 0.72); + font: inherit; +} + +.block-handle-insert:hover .block-insert-tooltip, +.block-handle-insert:focus-visible .block-insert-tooltip { + display: inline-flex; +} + +.block-drag-menu { + position: fixed; + top: 0; + left: 0; + width: 242px; + min-width: 242px; + box-sizing: border-box; + display: grid; + gap: 0; + padding: 10px; + border: 1px solid rgba(15, 23, 42, 0.08); + border-radius: 8px; + background: #fff; + background-image: linear-gradient(#fff, #fff); + color: var(--ink); + box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18); + z-index: 120; + pointer-events: auto; + isolation: isolate; + overflow: visible; + overscroll-behavior: contain; + scrollbar-width: thin; +} + + +.block-drag-menu::before { + content: ""; + position: absolute; + inset: 0; + z-index: -1; + border-radius: inherit; + background: #fff; +} + +.block-drag-menu > * { + position: relative; + z-index: 1; +} + + +.block-drag-menu-label, +.block-drag-menu-actions, +.block-drag-menu-section, +.block-drag-menu-item { + background-color: #fff; +} + +.block-drag-command-input { + width: 100%; + height: 34px; + padding: 0 10px; + border: 1px solid rgba(148, 163, 184, 0.24); + border-radius: 5px; + background: #fff; + color: #9ca3af; + font: inherit; +} + +.block-drag-menu-label { + display: grid; + gap: 4px; +} + +.block-drag-menu-label strong { + font-size: 14px; +} + +.block-drag-menu-label span { + color: var(--muted); + font-size: 12px; +} + +.block-drag-menu-shortcut, +.block-drag-menu-arrow { + margin-left: auto; + color: #a1a1aa; + font-size: 13px; + white-space: nowrap; +} + +.block-drag-menu-icon { + min-width: 22px; + color: #60646c; + font-size: 16px; + line-height: 1; + text-align: center; +} + +.block-drag-menu-switch { + margin-left: auto; + width: 28px; + height: 16px; + border-radius: 999px; + background: #d4d4d8; + position: relative; +} + +.block-drag-menu-switch::after { + content: ""; + position: absolute; + width: 12px; + height: 12px; + left: 2px; + top: 2px; + border-radius: 999px; + background: #fff; +} + +.block-drag-submenu { + position: absolute; + left: calc(100% + 8px); + top: 0; + width: 206px; + max-height: min(620px, 80vh); + overflow-y: auto; + display: grid; + gap: 0; + padding: 6px; + border: 1px solid rgba(15, 23, 42, 0.08); + border-radius: 8px; + background: #fff; + box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18); + z-index: 130; + pointer-events: auto; +} + +.block-drag-tertiary-submenu { + position: absolute; + left: calc(100% + 8px); + top: 0; + width: 206px; + display: grid; + gap: 0; + padding: 6px; + border: 1px solid rgba(15, 23, 42, 0.08); + border-radius: 8px; + background: #fff; + box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18); + z-index: 140; + pointer-events: auto; +} + +.block-drag-menu-item[disabled] { + color: #a1a1aa; + cursor: default; +} + +.block-drag-menu-item[disabled]:hover { + background: transparent; +} + +.block-drag-menu-back { + width: 100%; + display: inline-flex; + align-items: center; + gap: 8px; + border: none; + background: transparent; + color: var(--muted); + padding: 2px 2px 6px; + cursor: pointer; +} + +.block-drag-menu-back:hover { + color: var(--accent-strong); +} + +.block-drag-menu-actions { + display: grid; + gap: 0; +} + +.block-drag-menu-section { + display: grid; + gap: 0; +} + +.block-drag-menu-divider { + height: 1px; + margin: 4px -10px; + background: rgba(148, 163, 184, 0.22); +} + +.block-drag-menu-item { + width: 100%; + display: flex; + align-items: center; + justify-content: flex-start; + gap: 10px; + text-align: left; + border: 1px solid transparent; + border-radius: 6px; + background: transparent; + color: inherit; + min-height: 31px; + padding: 5px 8px; + white-space: nowrap; + cursor: pointer; + transition: background .12s ease, border-color .12s ease; +} + +.block-drag-menu-item:hover { + background: rgba(17, 24, 39, 0.06); + border-color: transparent; +} + +.block-drag-menu-item > span:not(.block-drag-menu-icon):not(.block-drag-menu-shortcut):not(.block-drag-menu-arrow):not(.block-drag-menu-switch) { + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; +} + +.block-drag-menu-footer { + display: grid; + gap: 2px; + margin: 6px -2px -2px; + padding-top: 8px; + border-top: 1px solid rgba(148, 163, 184, 0.18); + color: #a1a1aa; + font-size: 12px; + line-height: 1.35; +} + + +.block-drop-indicator { + position: absolute; + left: 56px; + right: 34px; + height: 2px; + border-radius: 999px; + background: rgba(15, 118, 110, 0.78); + box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12); + z-index: 13; +} + +.block-layout-outline { + position: absolute; + left: 56px; + right: 34px; + min-height: 30px; + border: 1px dashed rgba(148, 163, 184, 0.95); + border-radius: 4px; + background: rgba(255, 71, 71, 0.06); + pointer-events: none; + z-index: 12; +} + +.floating-toolbar { + position: absolute; + left: 0; + top: 0; + transform: translate(-50%, calc(-100% - 14px)); + z-index: 12; + display: flex; + align-items: center; + gap: 2px; + flex-wrap: nowrap; + max-width: min(720px, calc(100% - 32px)); + padding: 3px; + border: 1px solid rgba(15, 23, 42, 0.08); + border-radius: 8px; + background: rgba(255, 255, 255, 0.98); + color: #0f172a; + box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14); + backdrop-filter: blur(16px); +} + +.floating-toolbar-group { + display: flex; + align-items: center; + gap: 2px; +} + +.image-floating-toolbar { + position: absolute; + left: 0; + top: 0; + transform: translate(-50%, calc(-100% - 12px)); + z-index: 122; + display: inline-flex; + align-items: center; + gap: 3px; + padding: 4px; + border: 1px solid rgba(15, 23, 42, 0.1); + border-radius: 8px; + background: rgba(255, 255, 255, 0.98); + color: #111827; + box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16); + backdrop-filter: blur(16px); + pointer-events: auto; +} + +.image-toolbar-btn { + min-width: 30px; + height: 30px; + display: inline-flex; + align-items: center; + justify-content: center; + padding: 0 8px; + border: none; + border-radius: 6px; + background: transparent; + color: inherit; + font: inherit; + font-size: 13px; + font-weight: 600; + cursor: pointer; +} + +.image-toolbar-btn:hover, +.image-toolbar-btn:focus-visible, +.image-toolbar-btn[data-active="true"] { + background: rgba(255, 229, 229, 0.95); + outline: none; +} + +.image-toolbar-btn:disabled { + color: #a1a1aa; + cursor: not-allowed; + opacity: 0.55; + background: transparent; +} + +.image-toolbar-separator { + width: 1px; + align-self: stretch; + min-height: 22px; + background: rgba(148, 163, 184, 0.3); +} + +.toolbar-popover-anchor { + position: relative; + display: inline-flex; + align-items: center; +} + +.toolbar-separator { + width: 1px; + align-self: stretch; + margin: 4px 3px; + background: rgba(148, 163, 184, 0.28); +} + +.toolbar-btn { + min-width: 30px; + height: 30px; + border: none; + border-radius: 6px; + background: transparent; + color: inherit; + padding: 0 10px; + cursor: pointer; + transition: background .12s ease, border-color .12s ease, transform .12s ease; + font-size: 14px; + font-weight: 600; +} + +.toolbar-btn:hover { + background: rgba(148, 163, 184, 0.16); +} + +.toolbar-btn[data-active="true"] { + background: rgba(15, 118, 110, 0.14); + color: var(--accent-strong); +} + +.toolbar-btn[data-wide="true"] { + min-width: 56px; + justify-content: space-between; +} + +.turn-into-panel { + position: absolute; + bottom: calc(100% + 10px); + left: 50%; + transform: translateX(-50%); + min-width: 220px; + max-height: min(420px, calc(100vh - 32px)); + display: grid; + gap: 6px; + padding: 10px; + border-radius: 18px; + border: 1px solid rgba(15, 23, 42, 0.1); + background: rgba(255, 255, 255, 0.98); + color: var(--ink); + box-shadow: 0 20px 44px rgba(15, 23, 42, 0.16); + overflow-y: auto; + overscroll-behavior: contain; + z-index: 2; +} + +.toolbar-popover-panel { + position: absolute; + bottom: calc(100% + 10px); + left: 50%; + transform: translateX(-50%); + min-width: 248px; + max-height: min(440px, calc(100vh - 32px)); + display: grid; + gap: 10px; + padding: 12px; + border-radius: 18px; + border: 1px solid rgba(15, 23, 42, 0.1); + background: rgba(255, 255, 255, 0.98); + color: var(--ink); + box-shadow: 0 20px 44px rgba(15, 23, 42, 0.16); + overflow-y: auto; + overscroll-behavior: contain; + scrollbar-width: thin; + z-index: 2; +} + +.turn-into-item, +.slash-item, +.toolbar-menu-item { + width: 100%; + display: grid; + gap: 4px; + text-align: left; + border: 1px solid transparent; + border-radius: 14px; + background: transparent; + color: inherit; + padding: 10px 12px; + cursor: pointer; + transition: background .12s ease, border-color .12s ease; +} + +.turn-into-item:hover, +.slash-item:hover, +.slash-item[data-active="true"], +.toolbar-menu-item:hover, +.toolbar-menu-item[data-active="true"] { + background: rgba(15, 118, 110, 0.08); + border-color: rgba(15, 118, 110, 0.18); +} + +.turn-into-item > span, +.slash-item-copy > span, +.toolbar-menu-item > span { + color: var(--muted); + font-size: 12px; +} + +.slash-item-copy strong { + color: #30343b; + font-size: 14px; + font-weight: 500; +} + +.toolbar-popover-section { + display: grid; + gap: 8px; +} + +.toolbar-popover-title { + color: var(--muted); + font-size: 12px; + font-weight: 700; + letter-spacing: 0.02em; +} + +.toolbar-color-grid { + display: grid; + gap: 6px; + grid-template-columns: repeat(2, minmax(0, 1fr)); +} + +.toolbar-color-item { + display: flex; + align-items: center; + gap: 10px; +} + +.toolbar-color-chip { + width: 18px; + height: 18px; + flex: 0 0 18px; + border-radius: 999px; + border: 1px solid rgba(15, 23, 42, 0.14); + box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6); +} + +.toolbar-more-list { + display: grid; + gap: 6px; +} + +.toolbar-more-item strong { + font-size: 14px; +} + +.slash-menu { + position: fixed; + top: 24px; + left: 24px; + z-index: 130; + width: min(316px, calc(100vw - 16px)); + max-height: min(430px, calc(100vh - 16px)); + display: grid; + gap: 0; + padding: 8px; + border: 1px solid rgba(15, 23, 42, 0.08); + border-radius: 8px; + background: #fff; + box-shadow: 0 16px 38px rgba(15, 23, 42, 0.18); + overflow-y: auto; + overscroll-behavior: contain; + scrollbar-width: thin; +} + +.slash-list { + display: grid; + gap: 2px; +} + +.slash-section-label { + padding: 10px 6px 5px; + color: #9097a3; + font-size: 12px; +} + +.slash-item-row { + display: grid; + grid-template-columns: 26px minmax(0, 1fr) auto; + align-items: center; + gap: 8px; +} + +.slash-item-icon { + color: #6b7280; + font-size: 14px; +} + +.slash-item-copy { + display: grid; + gap: 1px; + min-width: 0; +} + +.slash-item-shortcut { + color: #a0a7b2; + font-size: 12px; +} + +.editor-surface { + display: block; + width: 100%; + min-height: 580px; + padding: 76px 0 32px; +} + +.app-shell-embedded .editor-surface { + min-height: 640px; + padding: 18px 0 28vh; +} + +.editor-surface .ProseMirror { + outline: none; + min-height: 472px; + line-height: 1.78; + font-size: 17px; + color: #1f2937; +} + +.editor-surface .ProseMirror img[src] { + display: block; + max-width: 100%; + height: auto; + margin: 8px 0; + border-radius: 6px; +} + +.editor-surface .ProseMirror img[data-align="center"] { + margin-left: auto; + margin-right: auto; +} + +.editor-surface .ProseMirror img[data-align="right"] { + margin-left: auto; + margin-right: 0; +} + +.editor-surface .ProseMirror img.ProseMirror-selectednode { + outline: 2px solid rgba(255, 71, 71, 0.78); + outline-offset: 3px; + box-shadow: 0 0 0 5px rgba(255, 71, 71, 0.12); +} + +.editor-surface .ProseMirror .tiptap-table-of-contents-node { + display: block; + margin: 12px 0; + padding: 10px 12px; + border: 1px solid rgba(229, 231, 235, 0.95); + border-radius: 6px; + background: #fff; + color: #374151; +} + +.editor-surface .ProseMirror .tiptap-table-of-contents-node.ProseMirror-selectednode { + outline: 2px solid rgba(255, 71, 71, 0.62); + outline-offset: 2px; +} + +.editor-surface .ProseMirror [data-block-id]:target { + outline: 2px solid #2563eb; + outline-offset: 3px; + background: rgba(37, 99, 235, 0.08); + scroll-margin-top: 72px; + transition: background 0.18s ease, outline-color 0.18s ease; +} + +.tiptap-table-of-contents-title-row { + display: flex; + align-items: center; + justify-content: space-between; + min-height: 24px; + gap: 8px; +} + +.tiptap-table-of-contents-title { + font-size: 14px; + line-height: 20px; + font-weight: 600; + color: #4b5563; +} + +.tiptap-table-of-contents-title-toggle { + width: 24px; + height: 24px; + display: inline-flex; + align-items: center; + justify-content: center; + border: 0; + border-radius: 4px; + background: transparent; + color: #9ca3af; + font-size: 12px; + cursor: pointer; +} + +.tiptap-table-of-contents-title-toggle:hover { + background: rgba(17, 24, 39, 0.06); + color: #4b5563; +} + +.tiptap-table-of-contents-list { + display: grid; + gap: 2px; + margin-top: 6px; +} + +.tiptap-table-of-contents-item { + display: block; + min-height: 24px; + padding: 2px 6px; + border-radius: 4px; + color: #6b7280; + font-size: 14px; + line-height: 20px; + text-decoration: none; +} + +.tiptap-table-of-contents-item[data-depth="2"] { padding-left: 20px; } +.tiptap-table-of-contents-item[data-depth="3"] { padding-left: 34px; } +.tiptap-table-of-contents-item[data-depth="4"] { padding-left: 48px; } +.tiptap-table-of-contents-item[data-depth="5"] { padding-left: 62px; } +.tiptap-table-of-contents-item[data-depth="6"] { padding-left: 76px; } + +.tiptap-table-of-contents-item:hover { + background: rgba(17, 24, 39, 0.05); + color: #374151; +} + +.tiptap-table-of-contents-empty { + margin-top: 4px; + color: #9ca3af; + font-size: 14px; + line-height: 22px; +} + +.editor-surface .ProseMirror .tableWrapper { + width: 100%; + overflow-x: auto; + margin: 8px 0; +} + +.editor-surface .ProseMirror table { + width: 100%; + border-collapse: collapse; + table-layout: fixed; + margin: 8px 0; +} + +.editor-surface .ProseMirror .tableWrapper table { + margin: 0; +} + +.editor-surface .ProseMirror td, +.editor-surface .ProseMirror th { + position: relative; + min-width: 84px; + height: 32px; + padding: 5px 8px; + border: 1px solid rgba(148, 163, 184, 0.72); + vertical-align: top; +} + +.editor-surface .ProseMirror th { + background: rgba(248, 250, 252, 0.96); + font-weight: 600; +} + +.editor-surface .ProseMirror table[data-hidden-borders="true"] td, +.editor-surface .ProseMirror table[data-hidden-borders="true"] th { + border-width: 0; +} + +.editor-surface .ProseMirror .selectedCell::after { + content: ""; + position: absolute; + inset: 0; + background: rgba(59, 130, 246, 0.12); + pointer-events: none; +} + +.editor-surface .ProseMirror .column-resize-handle { + position: absolute; + top: 0; + right: -4px; + bottom: -1px; + width: 8px; + background: rgba(239, 68, 68, 0.34); + cursor: col-resize; + pointer-events: none; + z-index: 4; +} + +.editor-surface .ProseMirror .column-resize-dragging { + background: rgba(255, 71, 71, 0.08); +} + +.editor-surface .ProseMirror.resize-cursor, +.editor-surface .ProseMirror.resize-cursor * { + cursor: col-resize !important; +} + +.table-controls { + position: absolute; + z-index: 118; + pointer-events: none; +} + +.table-aux-btn { + position: absolute; + width: 18px; + height: 18px; + display: inline-flex; + align-items: center; + justify-content: center; + padding: 0; + border: none; + border-radius: 4px; + background: transparent; + color: rgba(148, 163, 184, 0.95); + font: inherit; + font-size: 15px; + line-height: 1; + cursor: pointer; + pointer-events: auto; +} + +.table-aux-btn:hover, +.table-aux-btn:focus-visible, +.table-aux-btn[data-active="true"] { + background: rgba(255, 229, 229, 0.95); + color: rgba(107, 114, 128, 0.96); + outline: none; +} + +.table-selection-overlay { + position: absolute; + border-radius: 4px; + background: rgba(255, 71, 71, 0.12); + outline: 1px solid rgba(255, 71, 71, 0.18); + pointer-events: none; +} + +.table-toolbar { + position: absolute; + top: 34px; + right: 44px; + display: inline-flex; + align-items: center; + gap: 4px; + padding: 5px; + border: 1px solid rgba(15, 23, 42, 0.08); + border-radius: 8px; + background: #fff; + color: #111827; + box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16); + z-index: 120; + pointer-events: auto; +} + +.table-toolbar-btn { + min-width: 30px; + height: 30px; + display: inline-flex; + align-items: center; + justify-content: center; + padding: 0 8px; + border: none; + border-radius: 5px; + background: transparent; + color: #111827; + font: inherit; + font-size: 13px; + cursor: pointer; +} + +.table-toolbar-btn:hover, +.table-toolbar-btn:focus-visible { + background: rgba(241, 245, 249, 0.95); + outline: none; +} + +.table-toolbar-separator { + align-self: stretch; + width: 1px; + min-height: 22px; + background: rgba(148, 163, 184, 0.3); +} + +.table-options-menu { + position: absolute; + top: calc(100% + 6px); + right: 0; + width: 160px; + display: grid; + gap: 2px; + padding: 6px; + border: 1px solid rgba(15, 23, 42, 0.08); + border-radius: 8px; + background: #fff; + color: #111827; + box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16); + z-index: 125; +} + +.table-option-btn { + width: 100%; + min-height: 30px; + display: flex; + align-items: center; + justify-content: space-between; + gap: 8px; + padding: 5px 8px; + border: none; + border-radius: 5px; + background: transparent; + color: #111827; + font: inherit; + font-size: 13px; + cursor: pointer; + text-align: left; +} + +.table-option-btn:hover, +.table-option-btn:focus-visible { + background: rgba(241, 245, 249, 0.95); + outline: none; +} + +.table-option-switch { + position: relative; + width: 28px; + height: 16px; + flex: 0 0 auto; + border-radius: 999px; + background: #d1d5db; + transition: background .12s ease; +} + +.table-option-switch::after { + content: ""; + position: absolute; + top: 2px; + left: 2px; + width: 12px; + height: 12px; + border-radius: 999px; + background: #fff; + box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2); + transition: transform .12s ease; +} + +.table-option-btn[aria-checked="true"] .table-option-switch { + background: #9ca3af; +} + +.table-option-btn[aria-checked="true"] .table-option-switch::after { + transform: translateX(12px); +} + +.app-shell-embedded .editor-surface .ProseMirror { + min-height: 600px; + width: min(100%, 708px); + margin: 0 auto; + padding: 2.25rem 3rem 30vh; + font-family: "DM Sans", "Noto Sans SC", "PingFang SC", sans-serif; +} + +.app-shell-embedded .editor-surface[data-small-text="true"] .ProseMirror, +.editor-surface[data-small-text="true"] .ProseMirror { + font-size: 15px; + line-height: 1.66; +} + +.app-shell-embedded .editor-surface[data-layout-density="compact"] .ProseMirror, +.editor-surface[data-layout-density="compact"] .ProseMirror { + line-height: 1.54; +} + +.app-shell-embedded .editor-surface[data-layout-density="spacious"] .ProseMirror, +.editor-surface[data-layout-density="spacious"] .ProseMirror { + line-height: 1.92; +} + +.editor-surface .ProseMirror h1, +.editor-surface .ProseMirror h2, +.editor-surface .ProseMirror h3, +.editor-surface .ProseMirror h4 { + line-height: 1.12; + color: #0f172a; + margin: 1.12em 0 0.46em; + letter-spacing: -0.02em; +} + +.editor-surface .ProseMirror h1 { + font-size: 2.1em; +} + +.editor-surface .ProseMirror h2 { + font-size: 1.56em; +} + +.editor-surface .ProseMirror h3 { + font-size: 1.28em; +} + +.editor-surface .ProseMirror h4 { + font-size: 1.08em; +} + +.editor-surface .ProseMirror ul, +.editor-surface .ProseMirror ol { + padding-left: 1.5em; +} + +.editor-surface .ProseMirror ul[data-type="taskList"] { + list-style: none; + padding-left: 0.25em; +} + +.editor-surface .ProseMirror ul[data-type="taskList"] li { + display: flex; + flex-direction: row; + align-items: flex-start; +} + +.editor-surface .ProseMirror ul[data-type="taskList"] li:not(:has(> p:first-child)) { + list-style-type: none; +} + +.editor-surface .ProseMirror ul[data-type="taskList"] li[data-checked="true"] > div > p, +.editor-surface .ProseMirror ul[data-type="taskList"] li[data-checked="true"] > div > p span { + opacity: 0.5; + text-decoration: line-through; +} + +.editor-surface .ProseMirror ul[data-type="taskList"] li label { + position: relative; + padding-top: 0.375rem; + padding-right: 0.5rem; +} + +.editor-surface .ProseMirror ul[data-type="taskList"] li label input[type="checkbox"] { + position: absolute; + opacity: 0; + width: 0; + height: 0; +} + +.editor-surface .ProseMirror ul[data-type="taskList"] li label span { + display: block; + width: 1em; + height: 1em; + border: 1px solid rgba(148, 163, 184, 0.7); + border-radius: 0.25rem; + position: relative; + cursor: pointer; + background-color: rgba(255, 255, 255, 0.96); + transition: + background-color 80ms ease-out, + border-color 80ms ease-out; +} + +.editor-surface .ProseMirror ul[data-type="taskList"] li label span::before { + content: ""; + position: absolute; + left: 50%; + top: 50%; + transform: translate(-50%, -50%); + width: 0.75em; + height: 0.75em; + background-color: #ffffff; + opacity: 0; + -webkit-mask: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22currentColor%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21.4142%204.58579C22.1953%205.36683%2022.1953%206.63317%2021.4142%207.41421L10.4142%2018.4142C9.63317%2019.1953%208.36684%2019.1953%207.58579%2018.4142L2.58579%2013.4142C1.80474%2012.6332%201.80474%2011.3668%202.58579%2010.5858C3.36683%209.80474%204.63317%209.80474%205.41421%2010.5858L9%2014.1716L18.5858%204.58579C19.3668%203.80474%2020.6332%203.80474%2021.4142%204.58579Z%22%20fill%3D%22currentColor%22%2F%3E%3C%2Fsvg%3E") center/contain no-repeat; + mask: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22currentColor%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21.4142%204.58579C22.1953%205.36683%2022.1953%206.63317%2021.4142%207.41421L10.4142%2018.4142C9.63317%2019.1953%208.36684%2019.1953%207.58579%2018.4142L2.58579%2013.4142C1.80474%2012.6332%201.80474%2011.3668%202.58579%2010.5858C3.36683%209.80474%204.63317%209.80474%205.41421%2010.5858L9%2014.1716L18.5858%204.58579C19.3668%203.80474%2020.6332%203.80474%2021.4142%204.58579Z%22%20fill%3D%22currentColor%22%2F%3E%3C%2Fsvg%3E") center/contain no-repeat; +} + +.editor-surface .ProseMirror ul[data-type="taskList"] li label input[type="checkbox"]:checked + span { + background: var(--accent-strong); + border-color: var(--accent-strong); +} + +.editor-surface .ProseMirror ul[data-type="taskList"] li label input[type="checkbox"]:checked + span::before { + opacity: 1; +} + +.editor-surface .ProseMirror ul[data-type="taskList"] li > div { + flex: 1 1 0%; + min-width: 0; +} + +.editor-surface .ProseMirror ul[data-type="taskList"] li > div > p { + margin: 0; +} + +.editor-surface .ProseMirror pre { + background: #14222b; + color: #f8fafc; + padding: 16px 18px; + border-radius: 18px; + overflow: auto; +} + +.editor-surface .ProseMirror blockquote { + margin: 1.1em 0; + padding-left: 16px; + border-left: 3px solid rgba(15, 118, 110, 0.5); + color: #334155; +} + +.editor-surface .ProseMirror hr { + margin: 1.6em 0; + border: none; + border-top: 1px solid rgba(100, 116, 139, 0.28); +} + +.editor-surface .ProseMirror p.is-editor-empty:first-child::before, +.editor-surface .ProseMirror p.is-empty::before { + color: #94a3b8; + content: attr(data-placeholder); + float: left; + height: 0; + pointer-events: none; +} + +.editor-surface .ProseMirror p.is-editor-empty, +.editor-surface .ProseMirror p.is-empty { + min-height: 1.6em; +} + +.editor-surface .ProseMirror p:has(> a.mnote-page-block-link) { + width: 100%; + margin: 0 0 8px; + padding: 2px 6px; + border-radius: 4px; + background: rgba(255, 71, 71, 0.12); +} + +.editor-surface .ProseMirror a.mnote-page-block-link { + display: inline-flex; + align-items: center; + gap: 6px; + max-width: 100%; + padding: 1px 4px; + border-radius: 4px; + color: #37352f; + font-weight: 600; + line-height: 1.45; + text-decoration: none; + cursor: pointer; +} + +.editor-surface .ProseMirror a.mnote-page-block-link::before { + content: ""; + width: 14px; + height: 14px; + flex: 0 0 auto; + border: 1.4px solid #c8c5c0; + border-radius: 3px; + background: linear-gradient(180deg, #ffffff 0%, #f6f4f1 100%); + box-shadow: inset 0 -2px 0 rgba(55, 53, 47, 0.08); +} + +.editor-surface .ProseMirror a.mnote-page-block-link:hover { + color: #37352f; + background: rgba(55, 53, 47, 0.08); + text-decoration: none; +} + +.editor-surface .ProseMirror a.mnote-uploaded-attachment-row { + display: inline-flex; + align-items: center; + gap: 7px; + max-width: 100%; + min-height: 28px; + margin: 1px 0; + padding: 2px 4px; + border: 0; + border-radius: 4px; + color: #37352f; + font-weight: 500; + line-height: 1.4; + text-decoration: none; + background: transparent; + box-shadow: none; +} + +.editor-surface .ProseMirror a.mnote-uploaded-attachment-row::before { + content: ""; + width: 18px; + height: 18px; + flex: 0 0 auto; + border-radius: 4px; + background: var(--attachment-icon-bg, #e9ecef); + border: 1px solid var(--attachment-icon-border, rgba(55, 53, 47, 0.14)); +} + +.editor-surface .ProseMirror a.mnote-uploaded-attachment-row::after { + content: "◉"; + flex: 0 0 auto; + margin-left: 4px; + color: #9ca3af; + font-size: 11px; +} + +.editor-surface .ProseMirror a.mnote-uploaded-attachment-row:hover { + background: rgba(55, 53, 47, 0.06); + text-decoration: none; +} + +.editor-surface .ProseMirror a.mnote-uploaded-attachment-word { + --attachment-icon-bg: #4f82ff; + --attachment-icon-border: #3366d6; +} + +.editor-surface .ProseMirror a.mnote-uploaded-attachment-ppt { + --attachment-icon-bg: #ea581f; + --attachment-icon-border: #cf4817; +} + +.editor-surface .ProseMirror a.mnote-uploaded-attachment-sheet { + --attachment-icon-bg: #2f9e44; + --attachment-icon-border: #25813a; +} + +.editor-surface .ProseMirror a.mnote-uploaded-attachment-pdf { + --attachment-icon-bg: #ef4444; + --attachment-icon-border: #dc2626; +} + +.editor-surface .ProseMirror a.mnote-uploaded-attachment-file { + --attachment-icon-bg: #9ca3af; + --attachment-icon-border: #6b7280; +} + +.footer-strip { + display: flex; + justify-content: space-between; + gap: 12px; + flex-wrap: wrap; + padding: 0 22px 22px; + color: var(--muted); + font-size: 13px; +} + +.footer-strip code { + color: var(--accent-strong); +} + +.debug-drawer { + margin-top: 22px; + border: 1px solid rgba(100, 116, 139, 0.18); + border-radius: 22px; + background: rgba(255, 255, 255, 0.85); + overflow: hidden; +} + +.debug-drawer summary { + cursor: pointer; + list-style: none; + padding: 18px 20px; + display: flex; + justify-content: space-between; + align-items: center; + font-weight: 600; +} + +.debug-drawer summary::-webkit-details-marker { + display: none; +} + +.debug-grid { + display: grid; + gap: 16px; + padding: 0 20px 20px; + grid-template-columns: repeat(3, minmax(0, 1fr)); +} + +.debug-card { + border: 1px solid rgba(100, 116, 139, 0.18); + border-radius: 18px; + background: rgba(255, 255, 255, 0.88); + padding: 16px; +} + +.debug-card h3 { + margin: 0 0 10px; + font-size: 14px; +} + +.debug-card pre { + margin: 0; + max-height: 260px; + overflow: auto; + white-space: pre-wrap; + word-break: break-word; + color: #1e293b; +} + +@media (max-width: 920px) { + .hero-bar, + .editor-topbar, + .footer-strip { + flex-direction: column; + align-items: flex-start; + } + + .title-input { + font-size: 34px; + } + + .editor-surface { + padding: 88px 0 24px; + min-height: 460px; + } + + .app-shell-embedded .editor-surface { + padding: 12px 0 24vh; + } + + .app-shell-embedded .editor-surface .ProseMirror { + padding: 1.5rem 1.5rem 24vh; + } + + .debug-grid { + grid-template-columns: 1fr; + } + + .floating-toolbar, + .slash-menu, + .block-drag-menu { + left: 16px; + right: 16px; + width: auto; + min-width: 0; + transform: none; + } + + .floating-toolbar { + top: 12px; + } +} + +@media (max-width: 768px) { + .editor-stage { + width: 100%; + } + + .mnote-mindmap-workspace { + grid-template-columns: minmax(0, 1fr); + } + + .mnote-mindmap-side-panel { + border-left: 0; + border-top: 1px solid rgba(148, 163, 184, 0.26); + } + + .block-handle-shell, + .block-drop-indicator { + display: none; + } + + .app-shell-embedded .editor-surface { + padding-left: 0; + } +} +"#; diff --git a/rust/spikes/leptos-tiptap-spike/src/lib.rs b/rust/spikes/leptos-tiptap-spike/src/lib.rs index 0d716fd5..11b534f0 100644 --- a/rust/spikes/leptos-tiptap-spike/src/lib.rs +++ b/rust/spikes/leptos-tiptap-spike/src/lib.rs @@ -70,6 +70,7 @@ use editor_runtime::persistence::{ persisted_document_identity, PersistedDocumentIdentity, }; use editor_runtime::slash_actions::{SlashActionKind, SLASH_ACTIONS}; +use editor_runtime::style::SPIKE_STYLE; use editor_runtime::table_toolbar_view::table_toolbar_view; #[cfg(test)] use editor_runtime::persistence::persisted_document_storage_key; @@ -327,2429 +328,6 @@ const TOOLBAR_ALIGN_OPTIONS: [ToolbarAlignOption; 4] = [ }, ]; -const SPIKE_STYLE: &str = r#" -:root { - --tt-color-text: #111827; - --tt-color-text-gray: #6b7280; - --tt-color-text-brown: #8b5e3c; - --tt-color-text-orange: #c96b1f; - --tt-color-text-yellow: #b7791f; - --tt-color-text-green: #18794e; - --tt-color-text-blue: #1d4ed8; - --tt-color-text-purple: #7c3aed; - --tt-color-text-pink: #be185d; - --tt-color-text-red: #b91c1c; - --tt-color-highlight-yellow: #fef3c7; - --tt-color-highlight-green: #dcfce7; - --tt-color-highlight-blue: #dbeafe; - --tt-color-highlight-purple: #ede9fe; - --tt-color-highlight-pink: #fce7f3; - --tt-color-highlight-red: #fee2e2; - --tt-color-highlight-orange: #ffedd5; - --tt-color-highlight-gray: #e5e7eb; -} - -.app-shell { - max-width: 1180px; - margin: 0 auto; - padding: 28px 20px 72px; -} - -.app-shell-embedded { - max-width: none; - margin: 0; - padding: 0; -} - -.app-shell-embedded .hero-bar, -.app-shell-embedded .title-input, -.app-shell-embedded .editor-subcopy, -.app-shell-embedded .footer-strip, -.app-shell-embedded .debug-drawer, -.app-shell-embedded .editor-crumbs:first-child, -.app-shell-embedded .editor-crumbs:last-child { - display: none; -} - -.app-shell-embedded .editor-card { - border: none; - border-radius: 0; - box-shadow: none; - background: transparent; - overflow: visible; -} - -.app-shell-embedded .editor-topbar { - display: none; -} - -.app-shell-embedded .editor-stage { - margin: 0; - border: none; - border-radius: 0; - background: transparent; - box-shadow: none; -} - -.hero-bar { - display: flex; - justify-content: space-between; - align-items: flex-start; - gap: 18px; - margin-bottom: 20px; -} - -.hero-meta { - display: grid; - gap: 10px; -} - -.hero-tag { - display: inline-flex; - align-items: center; - gap: 8px; - width: fit-content; - padding: 6px 12px; - border-radius: 999px; - background: rgba(15, 118, 110, 0.12); - color: var(--accent-strong); - font-size: 12px; - letter-spacing: .08em; - text-transform: uppercase; -} - -.hero-title { - margin: 0; - font-size: 40px; - line-height: 1.04; -} - -.hero-copy { - margin: 0; - max-width: 680px; - color: var(--muted); - line-height: 1.75; -} - -.hero-actions { - display: flex; - flex-wrap: wrap; - gap: 10px; - justify-content: flex-end; -} - -.hero-chip { - display: inline-flex; - align-items: center; - gap: 8px; - padding: 10px 14px; - border: 1px solid var(--line); - border-radius: 16px; - background: rgba(255, 255, 255, 0.92); - color: var(--ink); - font-size: 13px; - box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05); -} - -.hero-chip strong { - color: var(--accent-strong); -} - -.editor-card { - position: relative; - border: 1px solid rgba(100, 116, 139, 0.18); - border-radius: 30px; - background: - linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(254, 251, 246, 0.98) 100%); - box-shadow: 0 28px 64px rgba(15, 23, 42, 0.08); - overflow: hidden; -} - -.editor-topbar { - display: flex; - justify-content: space-between; - align-items: center; - gap: 14px; - padding: 18px 22px 12px; -} - -.editor-crumbs { - display: flex; - align-items: center; - gap: 10px; - color: var(--muted); - font-size: 13px; -} - -.editor-crumbs strong { - color: var(--ink); -} - -.title-input { - width: 100%; - border: none; - outline: none; - background: transparent; - font-size: 48px; - line-height: 1.05; - font-weight: 700; - color: #0f172a; - padding: 8px 22px 6px; -} - -.title-input::placeholder { - color: #94a3b8; -} - -.editor-subcopy { - display: flex; - flex-wrap: wrap; - gap: 10px 16px; - align-items: center; - padding: 0 22px 18px; - color: var(--muted); - font-size: 14px; -} - -.hint-pill { - display: inline-flex; - align-items: center; - gap: 8px; - padding: 8px 12px; - border-radius: 999px; - background: rgba(15, 118, 110, 0.09); - color: var(--accent-strong); - font-size: 13px; -} - -.editor-stage { - position: relative; - width: min(100%, 900px); - margin: 0 auto 18px; - border: 1px solid rgba(100, 116, 139, 0.18); - border-radius: 26px; - background: rgba(255, 255, 255, 0.92); - box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8); -} - -.editor-stage[data-page-wide-layout="true"] { - width: min(100%, 1120px); -} - -.mnote-mindmap-placeholder { - width: min(1280px, calc(100vw - 340px)); - margin: 10px 0; - margin-left: 50%; - transform: translateX(-50%); -} - -.mnote-mindmap-editor-root { - position: relative; - overflow: hidden; - border: 1px solid rgba(148, 163, 184, 0.32); - border-radius: 8px; - background: #ffffff; - color: #0f172a; -} - -.mnote-leptos-mindmap-shell { - position: relative; - height: min(72vh, 720px); - min-height: 560px; - display: flex; - flex-direction: column; -} - -.mnote-mindmap-command-toolbar, -.mnote-mindmap-bottom-bar { - display: flex; - align-items: center; - gap: 6px; - padding: 8px; - border-bottom: 1px solid rgba(148, 163, 184, 0.26); - background: #ffffff; -} - -.mnote-mindmap-command-toolbar { - flex-wrap: nowrap; -} - -.mnote-mindmap-schema-toolbar { - position: absolute; - left: 50%; - top: 22px; - z-index: 4; - width: max-content; - max-width: min(980px, calc(100% - 184px)); - box-sizing: border-box; - transform: translateX(-50%); - gap: 8px; - padding: 7px 12px; - border: 1px solid rgba(15, 23, 42, 0.08); - border-radius: 6px; - background: rgba(255, 255, 255, 0.95); - box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1); - backdrop-filter: blur(10px); - overflow-x: visible; - overflow-y: visible; - scrollbar-width: none; -} - -.mnote-mindmap-toolbar-primary, -.mnote-mindmap-toolbar-secondary { - display: flex; - align-items: center; - gap: 8px; - justify-content: center; - flex-wrap: nowrap; - min-width: 0; -} - -.mnote-mindmap-toolbar-cluster { - display: inline-flex; - align-items: center; - gap: 4px; - flex: 0 0 auto; - min-width: 0; - white-space: nowrap; -} - -.mnote-mindmap-toolbar-cluster-file { - padding-left: 8px; - border-left: 1px solid rgba(148, 163, 184, 0.24); -} - -.mnote-mindmap-toolbar-group { - display: inline-flex; - align-items: center; - gap: 4px; - padding-right: 10px; - border-right: 1px solid rgba(148, 163, 184, 0.22); -} - -.mnote-mindmap-toolbar-group:last-child { - border-right: 0; -} - -.mnote-mindmap-toolbar-group-label { - position: absolute; - width: 1px; - height: 1px; - margin: -1px; - overflow: hidden; - clip: rect(0 0 0 0); - color: #64748b; - font-size: 11px; -} - -.mnote-mindmap-toolbar-primary input, -.mnote-mindmap-bottom-bar input { - height: 28px; - border: 1px solid rgba(148, 163, 184, 0.42); - border-radius: 6px; - padding: 0 8px; - background: #fff; - color: #0f172a; - font-size: 12px; -} - -.mnote-mindmap-tool, -.mnote-mindmap-bottom-bar button, -.mnote-mindmap-side-tab { - height: 28px; - border: 1px solid rgba(148, 163, 184, 0.34); - border-radius: 6px; - padding: 0 9px; - background: #fff; - color: #334155; - font-size: 12px; - cursor: pointer; -} - -.mnote-mindmap-schema-toolbar .mnote-mindmap-tool { - flex-direction: column; - display: inline-flex; - align-items: center; - justify-content: center; - gap: 2px; - width: 46px; - height: 40px; - min-width: 46px; - padding: 3px 4px; - color: #475569; -} - -.mnote-mindmap-tool-icon { - min-width: 16px; - font-size: 15px; - line-height: 1; -} - -.mnote-mindmap-tool-label { - max-width: 42px; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - font-size: 11px; - line-height: 14px; -} - -.mnote-mindmap-tool:disabled, -.mnote-mindmap-bottom-bar button:disabled, -.mnote-mindmap-side-tab:disabled { - cursor: default; - opacity: 0.48; -} - -.mnote-mindmap-toolbar-more { - position: relative; - display: inline-flex; - flex: 0 0 auto; -} - -.mnote-mindmap-toolbar-more-button[data-open="true"] { - border-color: rgba(37, 99, 235, 0.42); - background: #eff6ff; - color: #1d4ed8; -} - -.mnote-mindmap-toolbar-more-menu { - position: absolute; - right: 0; - top: calc(100% + 8px); - z-index: 8; - display: grid; - grid-template-columns: 1fr; - gap: 4px; - min-width: 128px; - padding: 8px; - border: 1px solid rgba(15, 23, 42, 0.1); - border-radius: 6px; - background: #ffffff; - box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16); -} - -.mnote-mindmap-toolbar-more-menu .mnote-mindmap-tool { - flex-direction: row; - justify-content: flex-start; - width: 100%; - min-width: 112px; - height: 30px; - gap: 8px; - padding: 0 8px; -} - -.mnote-mindmap-toolbar-more-menu .mnote-mindmap-tool-label { - max-width: none; - font-size: 12px; -} - -.mnote-mindmap-workspace { - display: grid; - grid-template-columns: minmax(0, 1fr); - min-height: 460px; -} - -.mnote-mindmap-workspace[data-layout="floating-overlay"] { - position: relative; - display: block; - width: 100%; - height: 100%; - min-height: 560px; - overflow: hidden; - background: #f7f8fa; -} - -.mnote-mindmap-canvas-layer { - position: absolute; - inset: 0; - z-index: 1; -} - -.mnote-mindmap-overlay-layer { - position: absolute; - inset: 0; - z-index: 3; - pointer-events: none; -} - -.mnote-mindmap-overlay-layer > * { - pointer-events: auto; -} - -.mnote-mindmap-rust-shell-mount, -.mnote-mindmap-rust-shell { - position: absolute; - inset: 0; - z-index: 4; - pointer-events: none; -} - -.mnote-mindmap-rust-shell > * { - pointer-events: auto; -} - -.mnote-mindmap-workspace[data-debug-chrome="true"] { - grid-template-columns: minmax(0, 1fr) 132px; -} - -.mnote-mindmap-workspace[data-debug-chrome="false"] { - grid-template-columns: minmax(0, 1fr) 172px; -} - -.mnote-leptos-mindmap-runtime { - position: relative; - height: 460px; - min-height: 460px; - overflow: hidden; - background: #ffffff; -} - -.mnote-mindmap-workspace[data-layout="floating-overlay"] .mnote-leptos-mindmap-runtime { - position: absolute; - inset: 0; - width: 100%; - height: 100%; - min-height: 100%; - background: #f7f8fa; -} - -.mnote-leptos-mindmap-runtime svg { - position: absolute; - inset: 0; - width: 100%; - height: 100%; - pointer-events: auto; -} - -.mnote-leptos-mindmap-runtime .smm-node { - cursor: default; -} - -.mnote-mindmap-side-panel { - border-left: 1px solid rgba(148, 163, 184, 0.26); - background: #fff; - padding: 8px; -} - -.mnote-mindmap-schema-sidebar { - position: absolute; - right: 18px; - top: 50%; - z-index: 4; - width: auto; - max-height: calc(100% - 130px); - transform: translateY(-50%); - display: flex; - align-items: flex-start; - gap: 12px; - border: 0; - border-radius: 0; - background: transparent; - box-shadow: none; - backdrop-filter: none; - padding: 0; -} - -.mnote-mindmap-side-rail { - width: 60px; - display: flex; - flex-direction: column; - gap: 8px; - padding: 10px 8px 8px; - border: 1px solid rgba(15, 23, 42, 0.08); - border-radius: 10px; - background: rgba(255, 255, 255, 0.96); - box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1); - backdrop-filter: blur(10px); -} - -.mnote-mindmap-side-rail-handle, -.mnote-mindmap-side-restore-handle, -.mnote-mindmap-side-drawer-close { - display: inline-flex; - align-items: center; - justify-content: center; - border: 1px solid rgba(148, 163, 184, 0.24); - background: rgba(248, 250, 252, 0.98); - color: #475569; -} - -.mnote-mindmap-side-rail-handle { - width: 100%; - min-height: 24px; - border-radius: 8px; -} - -.mnote-mindmap-side-restore-handle { - width: 22px; - min-height: 72px; - margin-top: 64px; - border-radius: 999px; - box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1); -} - -.mnote-mindmap-side-rail-handle:hover, -.mnote-mindmap-side-restore-handle:hover, -.mnote-mindmap-side-drawer-close:hover { - border-color: rgba(37, 99, 235, 0.36); - background: #eff6ff; - color: #1d4ed8; -} - -.mnote-mindmap-side-tab { - width: 100%; - display: inline-flex; - flex-direction: column; - align-items: center; - gap: 3px; - justify-content: center; - margin-bottom: 0; - min-height: 56px; - padding: 8px 2px; - text-align: center; - border: 0; - border-radius: 8px; - background: transparent; - color: #475569; - position: relative; -} - -.mnote-mindmap-side-icon { - width: 100%; - overflow: hidden; - color: #64748b; - font-size: 13px; - text-overflow: ellipsis; -} - -.mnote-mindmap-side-tab-label { - font-size: 11px; - line-height: 1.2; -} - -.mnote-mindmap-side-tab[data-active="true"] { - background: #eff6ff; - color: #1d4ed8; -} - -.mnote-mindmap-side-tab[data-active="true"]::before { - content: ""; - position: absolute; - left: -8px; - top: 8px; - bottom: 8px; - width: 3px; - border-radius: 999px; - background: #2563eb; -} - -.mnote-mindmap-side-body { - position: absolute; - right: 72px; - top: 0; - width: 300px; - margin-top: 0; - color: #64748b; - font-size: 12px; - padding: 16px; - border: 1px solid rgba(15, 23, 42, 0.08); - border-radius: 12px; - background: rgba(255, 255, 255, 0.96); - box-shadow: 0 10px 28px rgba(15, 23, 42, 0.1); - backdrop-filter: blur(10px); -} - -.mnote-mindmap-schema-sidebar .mnote-mindmap-side-body { - padding-top: 16px; -} - -.mnote-mindmap-side-body strong, -.mnote-mindmap-side-body span { - display: block; -} - -.mnote-mindmap-side-drawer-header { - display: flex; - align-items: flex-start; - justify-content: space-between; - gap: 12px; -} - -.mnote-mindmap-side-drawer-heading { - min-width: 0; - flex: 1; -} - -.mnote-mindmap-side-drawer-heading strong { - color: #0f172a; - font-size: 15px; - line-height: 1.3; -} - -.mnote-mindmap-side-drawer-heading span { - margin-top: 4px; - color: #64748b; - font-size: 12px; -} - -.mnote-mindmap-side-drawer-close { - width: 28px; - min-width: 28px; - min-height: 28px; - border-radius: 8px; -} - -.mnote-mindmap-side-swatches { - display: flex; - gap: 5px; - margin-top: 8px; -} - -.mnote-mindmap-side-swatches i { - width: 18px; - height: 18px; - border: 1px solid rgba(148, 163, 184, 0.38); - border-radius: 4px; - background: #f8fafc; -} - -.mnote-mindmap-side-options { - display: grid; - grid-template-columns: repeat(2, minmax(0, 1fr)); - gap: 10px; - margin-top: 16px; -} - -.mnote-mindmap-side-option { - min-height: 40px; - padding: 10px; - border: 1px solid rgba(148, 163, 184, 0.28); - border-radius: 8px; - background: #f8fafc; - color: #334155; - font-size: 12px; - line-height: 1.3; - text-align: left; -} - -.mnote-mindmap-side-option:hover { - border-color: rgba(37, 99, 235, 0.38); - background: #eff6ff; - color: #1d4ed8; -} - -.mnote-mindmap-side-option-readonly { - background: #fff; -} - -.mnote-mindmap-side-option-label { - color: inherit; - font-weight: 500; -} - -.mnote-mindmap-side-option-description { - margin-top: 4px; - color: #64748b; - font-size: 11px; -} - -.mnote-mindmap-side-option-swatch { - display: flex; - align-items: center; - gap: 10px; -} - -.mnote-mindmap-side-option-swatch-chip { - width: 18px; - height: 18px; - min-width: 18px; - border: 1px solid rgba(148, 163, 184, 0.28); - border-radius: 999px; -} - -.mnote-mindmap-side-option-layout-card { - display: flex; - min-height: 86px; - flex-direction: column; - justify-content: flex-start; - gap: 8px; -} - -.mnote-mindmap-side-option-preview-card { - display: inline-flex; - align-items: center; - justify-content: center; - width: 100%; - min-height: 38px; - border-radius: 6px; - background: linear-gradient(180deg, #eff6ff 0%, #dbeafe 100%); - color: #1d4ed8; - font-size: 11px; - line-height: 1; -} - -.mnote-mindmap-side-outline { - max-height: 172px; - margin: 16px 0 0; - padding-left: 14px; - overflow: auto; - color: #334155; - font-size: 11px; - line-height: 1.45; -} - -.mnote-mindmap-side-outline:empty { - display: none; -} - -.mnote-mindmap-side-swatches i:nth-child(2) { - background: #eef2ff; -} - -.mnote-mindmap-side-swatches i:nth-child(3) { - background: #ecfeff; -} - -.mnote-mindmap-bottom-bar { - border-top: 1px solid rgba(148, 163, 184, 0.26); - border-bottom: 0; - font-size: 12px; - color: #475569; -} - -.mnote-mindmap-schema-navigator { - position: absolute; - right: 28px; - bottom: 22px; - z-index: 4; - display: inline-flex; - align-items: center; - gap: 8px; - justify-content: flex-end; - min-height: 40px; - padding: 6px 8px; - border: 1px solid rgba(15, 23, 42, 0.08); - border-radius: 6px; - background: rgba(255, 255, 255, 0.94); - box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08); - backdrop-filter: blur(10px); -} - -.mnote-mindmap-schema-navigator [data-testid="mindmap-schema-navigator-stats"] { - margin-right: auto; -} - -.mnote-mindmap-schema-navigator-group { - display: inline-flex; - align-items: center; - gap: 6px; -} - -.mnote-mindmap-schema-navigator-button { - display: inline-flex; - align-items: center; - justify-content: center; - width: 30px; - min-width: 30px; - padding: 0; -} - -.mnote-mindmap-schema-navigator-button[data-active="true"] { - border-color: rgba(37, 99, 235, 0.32); - background: rgba(219, 234, 254, 0.94); - color: #1d4ed8; -} - -.mnote-mindmap-schema-navigator-zoom { - width: 62px; - text-align: center; - font-variant-numeric: tabular-nums; -} - -.mnote-mindmap-schema-navigator-search-wrap { - display: inline-flex; - align-items: center; - gap: 6px; -} - -.mnote-mindmap-schema-navigator-search-wrap input { - width: 136px; -} - -.mnote-mindmap-minimap { - position: absolute; - right: 28px; - bottom: 76px; - z-index: 4; - width: 180px; - height: 118px; - border: 1px solid rgba(15, 23, 42, 0.12); - border-radius: 6px; - background: rgba(255, 255, 255, 0.9); - box-shadow: 0 2px 16px rgba(15, 23, 42, 0.08); - pointer-events: auto; -} - -.mnote-mindmap-minimap-map { - position: absolute; - inset: 12px; -} - -.mnote-mindmap-minimap-map span { - position: absolute; - display: block; - width: 42px; - height: 14px; - border-radius: 4px; - background: #dbeafe; -} - -.mnote-mindmap-minimap-map span:nth-child(1) { - left: 54px; - top: 8px; - background: #bfdbfe; -} - -.mnote-mindmap-minimap-map span:nth-child(2) { - left: 22px; - top: 52px; - background: #dcfce7; -} - -.mnote-mindmap-minimap-map span:nth-child(3) { - right: 22px; - top: 52px; - background: #fde68a; -} - -.mnote-mindmap-minimap-viewport { - position: absolute; - left: 38px; - top: 30px; - width: 104px; - height: 62px; - border: 2px solid rgba(37, 99, 235, 0.75); - border-radius: 5px; - background: rgba(37, 99, 235, 0.08); -} - -.mnote-mindmap-context-menu { - position: absolute; - z-index: 8; - min-width: 132px; - padding: 6px; - border: 1px solid rgba(15, 23, 42, 0.12); - border-radius: 6px; - background: rgba(255, 255, 255, 0.96); - box-shadow: 0 8px 24px rgba(15, 23, 42, 0.14); - pointer-events: auto; -} - -.mnote-mindmap-context-menu button { - display: block; - width: 100%; - min-height: 26px; - padding: 4px 8px; - border: 0; - border-radius: 4px; - background: transparent; - color: #334155; - font-size: 12px; - text-align: left; -} - -.mnote-mindmap-context-menu button:hover { - background: #eff6ff; - color: #1d4ed8; -} - -.mnote-mindmap-count { - position: absolute; - left: 28px; - bottom: 30px; - z-index: 4; - display: flex; - gap: 18px; - color: #64748b; - font-size: 12px; - pointer-events: auto; -} - -.block-handle-shell { - position: absolute; - left: 12px; - z-index: 80; - display: inline-flex; - flex-direction: column; - align-items: center; - gap: 1px; - width: 26px; - padding: 0; - background: transparent; - pointer-events: none; -} - -.block-handle-shell[data-dragging="true"] { - pointer-events: none; - opacity: 1; -} - -.block-handle-insert, -.block-handle-trigger { - position: relative; - width: 22px; - height: 20px; - display: inline-flex; - align-items: center; - justify-content: center; - border: none; - border-radius: 5px; - background: transparent; - color: #6b7280; - cursor: pointer; - pointer-events: auto; - transition: background .12s ease, border-color .12s ease, box-shadow .12s ease, color .12s ease, opacity .12s ease; -} - -.block-handle-insert { - opacity: 0; -} - -.block-handle-shell[data-menu-open="true"] .block-handle-insert { - opacity: 0; - pointer-events: none; -} - -.block-handle-trigger { - height: 22px; - border: 1px solid rgba(148, 163, 184, 0.42); - background: rgba(255, 255, 255, 0.96); - box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1); - cursor: grab; -} - -.block-handle-trigger:hover, -.block-handle-shell[data-keyboard-selected="true"] .block-handle-trigger, -.block-handle-shell[data-menu-open="true"] .block-handle-trigger { - border-color: rgba(107, 114, 128, 0.5); - background: #f8fafc; - color: #4b5563; - box-shadow: 0 2px 8px rgba(15, 23, 42, 0.14); -} - -.block-handle-trigger:active { - cursor: grabbing; -} - -.block-handle-icon-dots { - display: grid; - grid-template-columns: repeat(2, 3px); - grid-auto-rows: 3px; - gap: 3px; -} - -.block-handle-icon-dots span, -.block-handle-icon-lines span { - width: 3px; - height: 3px; - border-radius: 999px; - background: currentColor; -} - -.block-handle-icon-lines { - display: grid; - gap: 3px; -} - -.block-handle-icon-lines span { - display: none; - width: 12px; - height: 1.5px; - border-radius: 999px; -} - -.block-handle-shell[data-menu-open="true"] .block-handle-icon-dots span { - display: none; -} - -.block-handle-shell[data-menu-open="true"] .block-handle-icon-lines span { - display: block; -} - -.block-insert-line { - display: none; -} - -.block-insert-plus { - display: inline-flex; - align-items: center; - justify-content: center; - width: 18px; - height: 18px; - border: 1px solid rgba(148, 163, 184, 0.42); - border-radius: 5px; - background: rgba(255, 255, 255, 0.96); - color: #5f6773; - font-size: 16px; - line-height: 1; - box-shadow: 0 1px 4px rgba(15, 23, 42, 0.1); -} - -.block-handle-insert:hover, -.block-handle-insert:focus-visible { - opacity: 1; -} - -.block-handle-insert:hover .block-insert-plus, -.block-handle-insert:focus-visible .block-insert-plus { - border-color: rgba(107, 114, 128, 0.5); - background: #f8fafc; - color: #4b5563; -} - -.block-insert-tooltip { - position: absolute; - left: 26px; - top: 50%; - transform: translateY(-50%); - min-width: 118px; - display: none; - gap: 5px; - align-items: center; - padding: 5px 7px; - border-radius: 5px; - background: rgba(17, 24, 39, 0.94); - color: #fff; - font-size: 12px; - line-height: 1.2; - white-space: nowrap; - box-shadow: 0 8px 22px rgba(15, 23, 42, 0.2); -} - -.block-insert-tooltip kbd { - color: rgba(255, 255, 255, 0.72); - font: inherit; -} - -.block-handle-insert:hover .block-insert-tooltip, -.block-handle-insert:focus-visible .block-insert-tooltip { - display: inline-flex; -} - -.block-drag-menu { - position: fixed; - top: 0; - left: 0; - width: 242px; - min-width: 242px; - box-sizing: border-box; - display: grid; - gap: 0; - padding: 10px; - border: 1px solid rgba(15, 23, 42, 0.08); - border-radius: 8px; - background: #fff; - background-image: linear-gradient(#fff, #fff); - color: var(--ink); - box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18); - z-index: 120; - pointer-events: auto; - isolation: isolate; - overflow: visible; - overscroll-behavior: contain; - scrollbar-width: thin; -} - - -.block-drag-menu::before { - content: ""; - position: absolute; - inset: 0; - z-index: -1; - border-radius: inherit; - background: #fff; -} - -.block-drag-menu > * { - position: relative; - z-index: 1; -} - - -.block-drag-menu-label, -.block-drag-menu-actions, -.block-drag-menu-section, -.block-drag-menu-item { - background-color: #fff; -} - -.block-drag-command-input { - width: 100%; - height: 34px; - padding: 0 10px; - border: 1px solid rgba(148, 163, 184, 0.24); - border-radius: 5px; - background: #fff; - color: #9ca3af; - font: inherit; -} - -.block-drag-menu-label { - display: grid; - gap: 4px; -} - -.block-drag-menu-label strong { - font-size: 14px; -} - -.block-drag-menu-label span { - color: var(--muted); - font-size: 12px; -} - -.block-drag-menu-shortcut, -.block-drag-menu-arrow { - margin-left: auto; - color: #a1a1aa; - font-size: 13px; - white-space: nowrap; -} - -.block-drag-menu-icon { - min-width: 22px; - color: #60646c; - font-size: 16px; - line-height: 1; - text-align: center; -} - -.block-drag-menu-switch { - margin-left: auto; - width: 28px; - height: 16px; - border-radius: 999px; - background: #d4d4d8; - position: relative; -} - -.block-drag-menu-switch::after { - content: ""; - position: absolute; - width: 12px; - height: 12px; - left: 2px; - top: 2px; - border-radius: 999px; - background: #fff; -} - -.block-drag-submenu { - position: absolute; - left: calc(100% + 8px); - top: 0; - width: 206px; - max-height: min(620px, 80vh); - overflow-y: auto; - display: grid; - gap: 0; - padding: 6px; - border: 1px solid rgba(15, 23, 42, 0.08); - border-radius: 8px; - background: #fff; - box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18); - z-index: 130; - pointer-events: auto; -} - -.block-drag-tertiary-submenu { - position: absolute; - left: calc(100% + 8px); - top: 0; - width: 206px; - display: grid; - gap: 0; - padding: 6px; - border: 1px solid rgba(15, 23, 42, 0.08); - border-radius: 8px; - background: #fff; - box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18); - z-index: 140; - pointer-events: auto; -} - -.block-drag-menu-item[disabled] { - color: #a1a1aa; - cursor: default; -} - -.block-drag-menu-item[disabled]:hover { - background: transparent; -} - -.block-drag-menu-back { - width: 100%; - display: inline-flex; - align-items: center; - gap: 8px; - border: none; - background: transparent; - color: var(--muted); - padding: 2px 2px 6px; - cursor: pointer; -} - -.block-drag-menu-back:hover { - color: var(--accent-strong); -} - -.block-drag-menu-actions { - display: grid; - gap: 0; -} - -.block-drag-menu-section { - display: grid; - gap: 0; -} - -.block-drag-menu-divider { - height: 1px; - margin: 4px -10px; - background: rgba(148, 163, 184, 0.22); -} - -.block-drag-menu-item { - width: 100%; - display: flex; - align-items: center; - justify-content: flex-start; - gap: 10px; - text-align: left; - border: 1px solid transparent; - border-radius: 6px; - background: transparent; - color: inherit; - min-height: 31px; - padding: 5px 8px; - white-space: nowrap; - cursor: pointer; - transition: background .12s ease, border-color .12s ease; -} - -.block-drag-menu-item:hover { - background: rgba(17, 24, 39, 0.06); - border-color: transparent; -} - -.block-drag-menu-item > span:not(.block-drag-menu-icon):not(.block-drag-menu-shortcut):not(.block-drag-menu-arrow):not(.block-drag-menu-switch) { - min-width: 0; - overflow: hidden; - text-overflow: ellipsis; -} - -.block-drag-menu-footer { - display: grid; - gap: 2px; - margin: 6px -2px -2px; - padding-top: 8px; - border-top: 1px solid rgba(148, 163, 184, 0.18); - color: #a1a1aa; - font-size: 12px; - line-height: 1.35; -} - - -.block-drop-indicator { - position: absolute; - left: 56px; - right: 34px; - height: 2px; - border-radius: 999px; - background: rgba(15, 118, 110, 0.78); - box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.12); - z-index: 13; -} - -.block-layout-outline { - position: absolute; - left: 56px; - right: 34px; - min-height: 30px; - border: 1px dashed rgba(148, 163, 184, 0.95); - border-radius: 4px; - background: rgba(255, 71, 71, 0.06); - pointer-events: none; - z-index: 12; -} - -.floating-toolbar { - position: absolute; - left: 0; - top: 0; - transform: translate(-50%, calc(-100% - 14px)); - z-index: 12; - display: flex; - align-items: center; - gap: 2px; - flex-wrap: nowrap; - max-width: min(720px, calc(100% - 32px)); - padding: 3px; - border: 1px solid rgba(15, 23, 42, 0.08); - border-radius: 8px; - background: rgba(255, 255, 255, 0.98); - color: #0f172a; - box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14); - backdrop-filter: blur(16px); -} - -.floating-toolbar-group { - display: flex; - align-items: center; - gap: 2px; -} - -.image-floating-toolbar { - position: absolute; - left: 0; - top: 0; - transform: translate(-50%, calc(-100% - 12px)); - z-index: 122; - display: inline-flex; - align-items: center; - gap: 3px; - padding: 4px; - border: 1px solid rgba(15, 23, 42, 0.1); - border-radius: 8px; - background: rgba(255, 255, 255, 0.98); - color: #111827; - box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16); - backdrop-filter: blur(16px); - pointer-events: auto; -} - -.image-toolbar-btn { - min-width: 30px; - height: 30px; - display: inline-flex; - align-items: center; - justify-content: center; - padding: 0 8px; - border: none; - border-radius: 6px; - background: transparent; - color: inherit; - font: inherit; - font-size: 13px; - font-weight: 600; - cursor: pointer; -} - -.image-toolbar-btn:hover, -.image-toolbar-btn:focus-visible, -.image-toolbar-btn[data-active="true"] { - background: rgba(255, 229, 229, 0.95); - outline: none; -} - -.image-toolbar-btn:disabled { - color: #a1a1aa; - cursor: not-allowed; - opacity: 0.55; - background: transparent; -} - -.image-toolbar-separator { - width: 1px; - align-self: stretch; - min-height: 22px; - background: rgba(148, 163, 184, 0.3); -} - -.toolbar-popover-anchor { - position: relative; - display: inline-flex; - align-items: center; -} - -.toolbar-separator { - width: 1px; - align-self: stretch; - margin: 4px 3px; - background: rgba(148, 163, 184, 0.28); -} - -.toolbar-btn { - min-width: 30px; - height: 30px; - border: none; - border-radius: 6px; - background: transparent; - color: inherit; - padding: 0 10px; - cursor: pointer; - transition: background .12s ease, border-color .12s ease, transform .12s ease; - font-size: 14px; - font-weight: 600; -} - -.toolbar-btn:hover { - background: rgba(148, 163, 184, 0.16); -} - -.toolbar-btn[data-active="true"] { - background: rgba(15, 118, 110, 0.14); - color: var(--accent-strong); -} - -.toolbar-btn[data-wide="true"] { - min-width: 56px; - justify-content: space-between; -} - -.turn-into-panel { - position: absolute; - bottom: calc(100% + 10px); - left: 50%; - transform: translateX(-50%); - min-width: 220px; - max-height: min(420px, calc(100vh - 32px)); - display: grid; - gap: 6px; - padding: 10px; - border-radius: 18px; - border: 1px solid rgba(15, 23, 42, 0.1); - background: rgba(255, 255, 255, 0.98); - color: var(--ink); - box-shadow: 0 20px 44px rgba(15, 23, 42, 0.16); - overflow-y: auto; - overscroll-behavior: contain; - z-index: 2; -} - -.toolbar-popover-panel { - position: absolute; - bottom: calc(100% + 10px); - left: 50%; - transform: translateX(-50%); - min-width: 248px; - max-height: min(440px, calc(100vh - 32px)); - display: grid; - gap: 10px; - padding: 12px; - border-radius: 18px; - border: 1px solid rgba(15, 23, 42, 0.1); - background: rgba(255, 255, 255, 0.98); - color: var(--ink); - box-shadow: 0 20px 44px rgba(15, 23, 42, 0.16); - overflow-y: auto; - overscroll-behavior: contain; - scrollbar-width: thin; - z-index: 2; -} - -.turn-into-item, -.slash-item, -.toolbar-menu-item { - width: 100%; - display: grid; - gap: 4px; - text-align: left; - border: 1px solid transparent; - border-radius: 14px; - background: transparent; - color: inherit; - padding: 10px 12px; - cursor: pointer; - transition: background .12s ease, border-color .12s ease; -} - -.turn-into-item:hover, -.slash-item:hover, -.slash-item[data-active="true"], -.toolbar-menu-item:hover, -.toolbar-menu-item[data-active="true"] { - background: rgba(15, 118, 110, 0.08); - border-color: rgba(15, 118, 110, 0.18); -} - -.turn-into-item > span, -.slash-item-copy > span, -.toolbar-menu-item > span { - color: var(--muted); - font-size: 12px; -} - -.slash-item-copy strong { - color: #30343b; - font-size: 14px; - font-weight: 500; -} - -.toolbar-popover-section { - display: grid; - gap: 8px; -} - -.toolbar-popover-title { - color: var(--muted); - font-size: 12px; - font-weight: 700; - letter-spacing: 0.02em; -} - -.toolbar-color-grid { - display: grid; - gap: 6px; - grid-template-columns: repeat(2, minmax(0, 1fr)); -} - -.toolbar-color-item { - display: flex; - align-items: center; - gap: 10px; -} - -.toolbar-color-chip { - width: 18px; - height: 18px; - flex: 0 0 18px; - border-radius: 999px; - border: 1px solid rgba(15, 23, 42, 0.14); - box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6); -} - -.toolbar-more-list { - display: grid; - gap: 6px; -} - -.toolbar-more-item strong { - font-size: 14px; -} - -.slash-menu { - position: fixed; - top: 24px; - left: 24px; - z-index: 130; - width: min(316px, calc(100vw - 16px)); - max-height: min(430px, calc(100vh - 16px)); - display: grid; - gap: 0; - padding: 8px; - border: 1px solid rgba(15, 23, 42, 0.08); - border-radius: 8px; - background: #fff; - box-shadow: 0 16px 38px rgba(15, 23, 42, 0.18); - overflow-y: auto; - overscroll-behavior: contain; - scrollbar-width: thin; -} - -.slash-list { - display: grid; - gap: 2px; -} - -.slash-section-label { - padding: 10px 6px 5px; - color: #9097a3; - font-size: 12px; -} - -.slash-item-row { - display: grid; - grid-template-columns: 26px minmax(0, 1fr) auto; - align-items: center; - gap: 8px; -} - -.slash-item-icon { - color: #6b7280; - font-size: 14px; -} - -.slash-item-copy { - display: grid; - gap: 1px; - min-width: 0; -} - -.slash-item-shortcut { - color: #a0a7b2; - font-size: 12px; -} - -.editor-surface { - display: block; - width: 100%; - min-height: 580px; - padding: 76px 0 32px; -} - -.app-shell-embedded .editor-surface { - min-height: 640px; - padding: 18px 0 28vh; -} - -.editor-surface .ProseMirror { - outline: none; - min-height: 472px; - line-height: 1.78; - font-size: 17px; - color: #1f2937; -} - -.editor-surface .ProseMirror img[src] { - display: block; - max-width: 100%; - height: auto; - margin: 8px 0; - border-radius: 6px; -} - -.editor-surface .ProseMirror img[data-align="center"] { - margin-left: auto; - margin-right: auto; -} - -.editor-surface .ProseMirror img[data-align="right"] { - margin-left: auto; - margin-right: 0; -} - -.editor-surface .ProseMirror img.ProseMirror-selectednode { - outline: 2px solid rgba(255, 71, 71, 0.78); - outline-offset: 3px; - box-shadow: 0 0 0 5px rgba(255, 71, 71, 0.12); -} - -.editor-surface .ProseMirror .tiptap-table-of-contents-node { - display: block; - margin: 12px 0; - padding: 10px 12px; - border: 1px solid rgba(229, 231, 235, 0.95); - border-radius: 6px; - background: #fff; - color: #374151; -} - -.editor-surface .ProseMirror .tiptap-table-of-contents-node.ProseMirror-selectednode { - outline: 2px solid rgba(255, 71, 71, 0.62); - outline-offset: 2px; -} - -.editor-surface .ProseMirror [data-block-id]:target { - outline: 2px solid #2563eb; - outline-offset: 3px; - background: rgba(37, 99, 235, 0.08); - scroll-margin-top: 72px; - transition: background 0.18s ease, outline-color 0.18s ease; -} - -.tiptap-table-of-contents-title-row { - display: flex; - align-items: center; - justify-content: space-between; - min-height: 24px; - gap: 8px; -} - -.tiptap-table-of-contents-title { - font-size: 14px; - line-height: 20px; - font-weight: 600; - color: #4b5563; -} - -.tiptap-table-of-contents-title-toggle { - width: 24px; - height: 24px; - display: inline-flex; - align-items: center; - justify-content: center; - border: 0; - border-radius: 4px; - background: transparent; - color: #9ca3af; - font-size: 12px; - cursor: pointer; -} - -.tiptap-table-of-contents-title-toggle:hover { - background: rgba(17, 24, 39, 0.06); - color: #4b5563; -} - -.tiptap-table-of-contents-list { - display: grid; - gap: 2px; - margin-top: 6px; -} - -.tiptap-table-of-contents-item { - display: block; - min-height: 24px; - padding: 2px 6px; - border-radius: 4px; - color: #6b7280; - font-size: 14px; - line-height: 20px; - text-decoration: none; -} - -.tiptap-table-of-contents-item[data-depth="2"] { padding-left: 20px; } -.tiptap-table-of-contents-item[data-depth="3"] { padding-left: 34px; } -.tiptap-table-of-contents-item[data-depth="4"] { padding-left: 48px; } -.tiptap-table-of-contents-item[data-depth="5"] { padding-left: 62px; } -.tiptap-table-of-contents-item[data-depth="6"] { padding-left: 76px; } - -.tiptap-table-of-contents-item:hover { - background: rgba(17, 24, 39, 0.05); - color: #374151; -} - -.tiptap-table-of-contents-empty { - margin-top: 4px; - color: #9ca3af; - font-size: 14px; - line-height: 22px; -} - -.editor-surface .ProseMirror .tableWrapper { - width: 100%; - overflow-x: auto; - margin: 8px 0; -} - -.editor-surface .ProseMirror table { - width: 100%; - border-collapse: collapse; - table-layout: fixed; - margin: 8px 0; -} - -.editor-surface .ProseMirror .tableWrapper table { - margin: 0; -} - -.editor-surface .ProseMirror td, -.editor-surface .ProseMirror th { - position: relative; - min-width: 84px; - height: 32px; - padding: 5px 8px; - border: 1px solid rgba(148, 163, 184, 0.72); - vertical-align: top; -} - -.editor-surface .ProseMirror th { - background: rgba(248, 250, 252, 0.96); - font-weight: 600; -} - -.editor-surface .ProseMirror table[data-hidden-borders="true"] td, -.editor-surface .ProseMirror table[data-hidden-borders="true"] th { - border-width: 0; -} - -.editor-surface .ProseMirror .selectedCell::after { - content: ""; - position: absolute; - inset: 0; - background: rgba(59, 130, 246, 0.12); - pointer-events: none; -} - -.editor-surface .ProseMirror .column-resize-handle { - position: absolute; - top: 0; - right: -4px; - bottom: -1px; - width: 8px; - background: rgba(239, 68, 68, 0.34); - cursor: col-resize; - pointer-events: none; - z-index: 4; -} - -.editor-surface .ProseMirror .column-resize-dragging { - background: rgba(255, 71, 71, 0.08); -} - -.editor-surface .ProseMirror.resize-cursor, -.editor-surface .ProseMirror.resize-cursor * { - cursor: col-resize !important; -} - -.table-controls { - position: absolute; - z-index: 118; - pointer-events: none; -} - -.table-aux-btn { - position: absolute; - width: 18px; - height: 18px; - display: inline-flex; - align-items: center; - justify-content: center; - padding: 0; - border: none; - border-radius: 4px; - background: transparent; - color: rgba(148, 163, 184, 0.95); - font: inherit; - font-size: 15px; - line-height: 1; - cursor: pointer; - pointer-events: auto; -} - -.table-aux-btn:hover, -.table-aux-btn:focus-visible, -.table-aux-btn[data-active="true"] { - background: rgba(255, 229, 229, 0.95); - color: rgba(107, 114, 128, 0.96); - outline: none; -} - -.table-selection-overlay { - position: absolute; - border-radius: 4px; - background: rgba(255, 71, 71, 0.12); - outline: 1px solid rgba(255, 71, 71, 0.18); - pointer-events: none; -} - -.table-toolbar { - position: absolute; - top: 34px; - right: 44px; - display: inline-flex; - align-items: center; - gap: 4px; - padding: 5px; - border: 1px solid rgba(15, 23, 42, 0.08); - border-radius: 8px; - background: #fff; - color: #111827; - box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16); - z-index: 120; - pointer-events: auto; -} - -.table-toolbar-btn { - min-width: 30px; - height: 30px; - display: inline-flex; - align-items: center; - justify-content: center; - padding: 0 8px; - border: none; - border-radius: 5px; - background: transparent; - color: #111827; - font: inherit; - font-size: 13px; - cursor: pointer; -} - -.table-toolbar-btn:hover, -.table-toolbar-btn:focus-visible { - background: rgba(241, 245, 249, 0.95); - outline: none; -} - -.table-toolbar-separator { - align-self: stretch; - width: 1px; - min-height: 22px; - background: rgba(148, 163, 184, 0.3); -} - -.table-options-menu { - position: absolute; - top: calc(100% + 6px); - right: 0; - width: 160px; - display: grid; - gap: 2px; - padding: 6px; - border: 1px solid rgba(15, 23, 42, 0.08); - border-radius: 8px; - background: #fff; - color: #111827; - box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16); - z-index: 125; -} - -.table-option-btn { - width: 100%; - min-height: 30px; - display: flex; - align-items: center; - justify-content: space-between; - gap: 8px; - padding: 5px 8px; - border: none; - border-radius: 5px; - background: transparent; - color: #111827; - font: inherit; - font-size: 13px; - cursor: pointer; - text-align: left; -} - -.table-option-btn:hover, -.table-option-btn:focus-visible { - background: rgba(241, 245, 249, 0.95); - outline: none; -} - -.table-option-switch { - position: relative; - width: 28px; - height: 16px; - flex: 0 0 auto; - border-radius: 999px; - background: #d1d5db; - transition: background .12s ease; -} - -.table-option-switch::after { - content: ""; - position: absolute; - top: 2px; - left: 2px; - width: 12px; - height: 12px; - border-radius: 999px; - background: #fff; - box-shadow: 0 1px 2px rgba(15, 23, 42, 0.2); - transition: transform .12s ease; -} - -.table-option-btn[aria-checked="true"] .table-option-switch { - background: #9ca3af; -} - -.table-option-btn[aria-checked="true"] .table-option-switch::after { - transform: translateX(12px); -} - -.app-shell-embedded .editor-surface .ProseMirror { - min-height: 600px; - width: min(100%, 708px); - margin: 0 auto; - padding: 2.25rem 3rem 30vh; - font-family: "DM Sans", "Noto Sans SC", "PingFang SC", sans-serif; -} - -.app-shell-embedded .editor-surface[data-small-text="true"] .ProseMirror, -.editor-surface[data-small-text="true"] .ProseMirror { - font-size: 15px; - line-height: 1.66; -} - -.app-shell-embedded .editor-surface[data-layout-density="compact"] .ProseMirror, -.editor-surface[data-layout-density="compact"] .ProseMirror { - line-height: 1.54; -} - -.app-shell-embedded .editor-surface[data-layout-density="spacious"] .ProseMirror, -.editor-surface[data-layout-density="spacious"] .ProseMirror { - line-height: 1.92; -} - -.editor-surface .ProseMirror h1, -.editor-surface .ProseMirror h2, -.editor-surface .ProseMirror h3, -.editor-surface .ProseMirror h4 { - line-height: 1.12; - color: #0f172a; - margin: 1.12em 0 0.46em; - letter-spacing: -0.02em; -} - -.editor-surface .ProseMirror h1 { - font-size: 2.1em; -} - -.editor-surface .ProseMirror h2 { - font-size: 1.56em; -} - -.editor-surface .ProseMirror h3 { - font-size: 1.28em; -} - -.editor-surface .ProseMirror h4 { - font-size: 1.08em; -} - -.editor-surface .ProseMirror ul, -.editor-surface .ProseMirror ol { - padding-left: 1.5em; -} - -.editor-surface .ProseMirror ul[data-type="taskList"] { - list-style: none; - padding-left: 0.25em; -} - -.editor-surface .ProseMirror ul[data-type="taskList"] li { - display: flex; - flex-direction: row; - align-items: flex-start; -} - -.editor-surface .ProseMirror ul[data-type="taskList"] li:not(:has(> p:first-child)) { - list-style-type: none; -} - -.editor-surface .ProseMirror ul[data-type="taskList"] li[data-checked="true"] > div > p, -.editor-surface .ProseMirror ul[data-type="taskList"] li[data-checked="true"] > div > p span { - opacity: 0.5; - text-decoration: line-through; -} - -.editor-surface .ProseMirror ul[data-type="taskList"] li label { - position: relative; - padding-top: 0.375rem; - padding-right: 0.5rem; -} - -.editor-surface .ProseMirror ul[data-type="taskList"] li label input[type="checkbox"] { - position: absolute; - opacity: 0; - width: 0; - height: 0; -} - -.editor-surface .ProseMirror ul[data-type="taskList"] li label span { - display: block; - width: 1em; - height: 1em; - border: 1px solid rgba(148, 163, 184, 0.7); - border-radius: 0.25rem; - position: relative; - cursor: pointer; - background-color: rgba(255, 255, 255, 0.96); - transition: - background-color 80ms ease-out, - border-color 80ms ease-out; -} - -.editor-surface .ProseMirror ul[data-type="taskList"] li label span::before { - content: ""; - position: absolute; - left: 50%; - top: 50%; - transform: translate(-50%, -50%); - width: 0.75em; - height: 0.75em; - background-color: #ffffff; - opacity: 0; - -webkit-mask: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22currentColor%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21.4142%204.58579C22.1953%205.36683%2022.1953%206.63317%2021.4142%207.41421L10.4142%2018.4142C9.63317%2019.1953%208.36684%2019.1953%207.58579%2018.4142L2.58579%2013.4142C1.80474%2012.6332%201.80474%2011.3668%202.58579%2010.5858C3.36683%209.80474%204.63317%209.80474%205.41421%2010.5858L9%2014.1716L18.5858%204.58579C19.3668%203.80474%2020.6332%203.80474%2021.4142%204.58579Z%22%20fill%3D%22currentColor%22%2F%3E%3C%2Fsvg%3E") center/contain no-repeat; - mask: url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22currentColor%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20fill-rule%3D%22evenodd%22%20clip-rule%3D%22evenodd%22%20d%3D%22M21.4142%204.58579C22.1953%205.36683%2022.1953%206.63317%2021.4142%207.41421L10.4142%2018.4142C9.63317%2019.1953%208.36684%2019.1953%207.58579%2018.4142L2.58579%2013.4142C1.80474%2012.6332%201.80474%2011.3668%202.58579%2010.5858C3.36683%209.80474%204.63317%209.80474%205.41421%2010.5858L9%2014.1716L18.5858%204.58579C19.3668%203.80474%2020.6332%203.80474%2021.4142%204.58579Z%22%20fill%3D%22currentColor%22%2F%3E%3C%2Fsvg%3E") center/contain no-repeat; -} - -.editor-surface .ProseMirror ul[data-type="taskList"] li label input[type="checkbox"]:checked + span { - background: var(--accent-strong); - border-color: var(--accent-strong); -} - -.editor-surface .ProseMirror ul[data-type="taskList"] li label input[type="checkbox"]:checked + span::before { - opacity: 1; -} - -.editor-surface .ProseMirror ul[data-type="taskList"] li > div { - flex: 1 1 0%; - min-width: 0; -} - -.editor-surface .ProseMirror ul[data-type="taskList"] li > div > p { - margin: 0; -} - -.editor-surface .ProseMirror pre { - background: #14222b; - color: #f8fafc; - padding: 16px 18px; - border-radius: 18px; - overflow: auto; -} - -.editor-surface .ProseMirror blockquote { - margin: 1.1em 0; - padding-left: 16px; - border-left: 3px solid rgba(15, 118, 110, 0.5); - color: #334155; -} - -.editor-surface .ProseMirror hr { - margin: 1.6em 0; - border: none; - border-top: 1px solid rgba(100, 116, 139, 0.28); -} - -.editor-surface .ProseMirror p.is-editor-empty:first-child::before, -.editor-surface .ProseMirror p.is-empty::before { - color: #94a3b8; - content: attr(data-placeholder); - float: left; - height: 0; - pointer-events: none; -} - -.editor-surface .ProseMirror p.is-editor-empty, -.editor-surface .ProseMirror p.is-empty { - min-height: 1.6em; -} - -.editor-surface .ProseMirror p:has(> a.mnote-page-block-link) { - width: 100%; - margin: 0 0 8px; - padding: 2px 6px; - border-radius: 4px; - background: rgba(255, 71, 71, 0.12); -} - -.editor-surface .ProseMirror a.mnote-page-block-link { - display: inline-flex; - align-items: center; - gap: 6px; - max-width: 100%; - padding: 1px 4px; - border-radius: 4px; - color: #37352f; - font-weight: 600; - line-height: 1.45; - text-decoration: none; - cursor: pointer; -} - -.editor-surface .ProseMirror a.mnote-page-block-link::before { - content: ""; - width: 14px; - height: 14px; - flex: 0 0 auto; - border: 1.4px solid #c8c5c0; - border-radius: 3px; - background: linear-gradient(180deg, #ffffff 0%, #f6f4f1 100%); - box-shadow: inset 0 -2px 0 rgba(55, 53, 47, 0.08); -} - -.editor-surface .ProseMirror a.mnote-page-block-link:hover { - color: #37352f; - background: rgba(55, 53, 47, 0.08); - text-decoration: none; -} - -.editor-surface .ProseMirror a.mnote-uploaded-attachment-row { - display: inline-flex; - align-items: center; - gap: 7px; - max-width: 100%; - min-height: 28px; - margin: 1px 0; - padding: 2px 4px; - border: 0; - border-radius: 4px; - color: #37352f; - font-weight: 500; - line-height: 1.4; - text-decoration: none; - background: transparent; - box-shadow: none; -} - -.editor-surface .ProseMirror a.mnote-uploaded-attachment-row::before { - content: ""; - width: 18px; - height: 18px; - flex: 0 0 auto; - border-radius: 4px; - background: var(--attachment-icon-bg, #e9ecef); - border: 1px solid var(--attachment-icon-border, rgba(55, 53, 47, 0.14)); -} - -.editor-surface .ProseMirror a.mnote-uploaded-attachment-row::after { - content: "◉"; - flex: 0 0 auto; - margin-left: 4px; - color: #9ca3af; - font-size: 11px; -} - -.editor-surface .ProseMirror a.mnote-uploaded-attachment-row:hover { - background: rgba(55, 53, 47, 0.06); - text-decoration: none; -} - -.editor-surface .ProseMirror a.mnote-uploaded-attachment-word { - --attachment-icon-bg: #4f82ff; - --attachment-icon-border: #3366d6; -} - -.editor-surface .ProseMirror a.mnote-uploaded-attachment-ppt { - --attachment-icon-bg: #ea581f; - --attachment-icon-border: #cf4817; -} - -.editor-surface .ProseMirror a.mnote-uploaded-attachment-sheet { - --attachment-icon-bg: #2f9e44; - --attachment-icon-border: #25813a; -} - -.editor-surface .ProseMirror a.mnote-uploaded-attachment-pdf { - --attachment-icon-bg: #ef4444; - --attachment-icon-border: #dc2626; -} - -.editor-surface .ProseMirror a.mnote-uploaded-attachment-file { - --attachment-icon-bg: #9ca3af; - --attachment-icon-border: #6b7280; -} - -.footer-strip { - display: flex; - justify-content: space-between; - gap: 12px; - flex-wrap: wrap; - padding: 0 22px 22px; - color: var(--muted); - font-size: 13px; -} - -.footer-strip code { - color: var(--accent-strong); -} - -.debug-drawer { - margin-top: 22px; - border: 1px solid rgba(100, 116, 139, 0.18); - border-radius: 22px; - background: rgba(255, 255, 255, 0.85); - overflow: hidden; -} - -.debug-drawer summary { - cursor: pointer; - list-style: none; - padding: 18px 20px; - display: flex; - justify-content: space-between; - align-items: center; - font-weight: 600; -} - -.debug-drawer summary::-webkit-details-marker { - display: none; -} - -.debug-grid { - display: grid; - gap: 16px; - padding: 0 20px 20px; - grid-template-columns: repeat(3, minmax(0, 1fr)); -} - -.debug-card { - border: 1px solid rgba(100, 116, 139, 0.18); - border-radius: 18px; - background: rgba(255, 255, 255, 0.88); - padding: 16px; -} - -.debug-card h3 { - margin: 0 0 10px; - font-size: 14px; -} - -.debug-card pre { - margin: 0; - max-height: 260px; - overflow: auto; - white-space: pre-wrap; - word-break: break-word; - color: #1e293b; -} - -@media (max-width: 920px) { - .hero-bar, - .editor-topbar, - .footer-strip { - flex-direction: column; - align-items: flex-start; - } - - .title-input { - font-size: 34px; - } - - .editor-surface { - padding: 88px 0 24px; - min-height: 460px; - } - - .app-shell-embedded .editor-surface { - padding: 12px 0 24vh; - } - - .app-shell-embedded .editor-surface .ProseMirror { - padding: 1.5rem 1.5rem 24vh; - } - - .debug-grid { - grid-template-columns: 1fr; - } - - .floating-toolbar, - .slash-menu, - .block-drag-menu { - left: 16px; - right: 16px; - width: auto; - min-width: 0; - transform: none; - } - - .floating-toolbar { - top: 12px; - } -} - -@media (max-width: 768px) { - .editor-stage { - width: 100%; - } - - .mnote-mindmap-workspace { - grid-template-columns: minmax(0, 1fr); - } - - .mnote-mindmap-side-panel { - border-left: 0; - border-top: 1px solid rgba(148, 163, 184, 0.26); - } - - .block-handle-shell, - .block-drop-indicator { - display: none; - } - - .app-shell-embedded .editor-surface { - padding-left: 0; - } -} -"#; - #[derive(Clone, Copy)] struct FoldedHeadingAction { level: u8,