From 1aa74c0a9fb891bd60457e0ebcd314c0dae916af Mon Sep 17 00:00:00 2001 From: Steffen Becker Date: Thu, 13 Aug 2026 11:50:53 +0000 Subject: [PATCH] feat: a footnotes and endnotes options dialog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Numbering format, start value, restart, position, prefix/suffix and the two styles per class, plus the separator's length, thickness, spacing, alignment and colour. The separator rides :root custom properties, so editor.css draws the line and pageBreaks.ts reserves its band from the same values. A settings change is no document change, so it carries a resync meta — without it the numbering kept the format it was typed under. --- src/App.svelte | 6 + src/lib/components/Editor.svelte | 22 ++ src/lib/components/NoteOptionsDialog.svelte | 246 ++++++++++++++++++ src/lib/components/ToolbarExpanded.svelte | 16 +- src/lib/components/ribbon/Ribbon.svelte | 4 +- .../ribbon/tabs/ReferencesTab.svelte | 10 +- src/lib/editor/extensions/notes.ts | 6 +- src/lib/i18n/locales/de.ts | 29 +++ src/lib/i18n/locales/en.ts | 29 +++ src/lib/storage/noteSettings.ts | 13 + src/styles/editor.css | 13 +- 11 files changed, 381 insertions(+), 13 deletions(-) create mode 100644 src/lib/components/NoteOptionsDialog.svelte diff --git a/src/App.svelte b/src/App.svelte index ba6d7db..477f991 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -40,6 +40,7 @@ import UiLanguagePicker from './lib/components/UiLanguagePicker.svelte'; import AboutDialog from './lib/components/AboutDialog.svelte'; import StyleManagerDialog from './lib/components/StyleManagerDialog.svelte'; + import NoteOptionsDialog from './lib/components/NoteOptionsDialog.svelte'; import { t } from './lib/i18n/i18n.svelte'; import { withShortcut } from './lib/i18n/shortcut'; import { DEFAULT_SHORTCUTS, matchesEvent, shortcutHint } from './lib/editor/shortcuts'; @@ -56,6 +57,7 @@ let aboutOpen = $state(false); let styleManagerOpen = $state(false); let styleManagerFamily = $state('paragraph'); + let noteOptionsOpen = $state(false); function openStyleManager(family: StyleFamily) { styleManagerFamily = family; @@ -201,6 +203,7 @@ saveSpacingModel(spacingModel); }); + $effect(() => { savePageRtl(pageRtl); }); @@ -862,6 +865,7 @@ {hfActive} onManageStyles={openStyleManager} onManageTableStyles={() => openStyleManager('table')} + onNoteOptions={() => (noteOptionsOpen = true)} onEditZone={(zone) => (hfActive = zone)} onFind={openFind} {namePlaceholder} @@ -1096,6 +1100,7 @@ onEditZone={(zone) => (hfActive = zone)} onDebugDump={handleDebugDump} onManageTableStyles={() => openStyleManager('table')} + onNoteOptions={() => (noteOptionsOpen = true)} /> {@render toolbarScrollbar()} @@ -1212,6 +1217,7 @@ + diff --git a/src/lib/components/ToolbarExpanded.svelte b/src/lib/components/ToolbarExpanded.svelte index b67c962..6346a8f 100644 --- a/src/lib/components/ToolbarExpanded.svelte +++ b/src/lib/components/ToolbarExpanded.svelte @@ -30,8 +30,8 @@ import { t } from '../i18n/i18n.svelte'; import { shortcutHint, type ShortcutId } from '../editor/shortcuts'; - let { editor, tick, showFormattingMarks = $bindable(), showRuler = $bindable(true), pageMargins = $bindable(DEFAULT_MARGINS), pageOrientation = $bindable('portrait'), pageFormat = $bindable('A4'), hfDistances = $bindable(DEFAULT_HF_DISTANCES), differentFirstPage = $bindable(false), differentOddEven = $bindable(false), hfActive = null, onEditZone, onDebugDump, onManageTableStyles }: - { editor: Editor | null; tick: number; showFormattingMarks: boolean; showRuler?: boolean; pageMargins?: PageMargins; pageOrientation?: Orientation; pageFormat?: PageFormat; hfDistances?: HfDistances; differentFirstPage?: boolean; differentOddEven?: boolean; hfActive?: 'header' | 'footer' | null; onEditZone?: (zone: 'header' | 'footer') => void; onDebugDump?: () => void; onManageTableStyles?: () => void } = $props(); + let { editor, tick, showFormattingMarks = $bindable(), showRuler = $bindable(true), pageMargins = $bindable(DEFAULT_MARGINS), pageOrientation = $bindable('portrait'), pageFormat = $bindable('A4'), hfDistances = $bindable(DEFAULT_HF_DISTANCES), differentFirstPage = $bindable(false), differentOddEven = $bindable(false), hfActive = null, onEditZone, onDebugDump, onManageTableStyles, onNoteOptions }: + { editor: Editor | null; tick: number; showFormattingMarks: boolean; showRuler?: boolean; pageMargins?: PageMargins; pageOrientation?: Orientation; pageFormat?: PageFormat; hfDistances?: HfDistances; differentFirstPage?: boolean; differentOddEven?: boolean; hfActive?: 'header' | 'footer' | null; onEditZone?: (zone: 'header' | 'footer') => void; onDebugDump?: () => void; onManageTableStyles?: () => void; onNoteOptions?: () => void } = $props(); const PAGE_FORMATS = Object.keys(PAGE_FORMAT_CM) as PageFormat[]; @@ -1749,6 +1749,18 @@ +