The anchor is an inline atom, the note text a block in the one noteSection at the document end; a sync plugin keeps notes in anchor order, renumbers them per class and drops the ones whose anchor is gone. Numbering, indent, size and separator defaults are LibreOffice's, read out of a document it saved. Endnotes still render in flow at the document end — lifting a footnote to the foot of its page is the next step.
16 lines
532 B
TypeScript
16 lines
532 B
TypeScript
// The document's note settings as a reactive singleton (same shape as sheet.svelte.ts):
|
|
// the extension reads noteSettings() when it renumbers, the dialog replaces it.
|
|
|
|
import { clampNoteSettings, loadNoteSettings, saveNoteSettings, type NoteSettings } from './noteSettings';
|
|
|
|
let current = $state<NoteSettings>(loadNoteSettings());
|
|
|
|
export function noteSettings(): NoteSettings {
|
|
return current;
|
|
}
|
|
|
|
export function setNoteSettings(next: NoteSettings): void {
|
|
current = clampNoteSettings(next);
|
|
saveNoteSettings(current);
|
|
}
|