@stll/folio-vue 0.28.1 → 0.30.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/README.md +5 -0
  2. package/dist/{SplitCellDialog-Dge_CE-B.cjs → SplitCellDialog-Bc2TjxMb.cjs} +1 -1
  3. package/dist/{SplitCellDialog-Vl4gq22E.js → SplitCellDialog-DULmbU_P.js} +6 -6
  4. package/dist/StylePicker-CD28Jh8D.cjs +4 -0
  5. package/dist/{StylePicker-CfC5Ef1i.js → StylePicker-D8VHvoMT.js} +664 -591
  6. package/dist/components/AnonymizationRectsOverlay.vue.d.ts +7 -4
  7. package/dist/components/AutocompleteSuggestionOverlay.vue.d.ts +5 -0
  8. package/dist/components/ContentControlWidgetsOverlay.vue.d.ts +5 -1
  9. package/dist/components/DocumentOutline.vue.d.ts +2 -0
  10. package/dist/components/DocxEditor/DocxEditorDialogs.vue.d.ts +3 -2
  11. package/dist/components/DocxEditor/pagedEditorRef.d.ts +11 -9
  12. package/dist/components/DocxEditor/types.d.ts +95 -18
  13. package/dist/components/DocxEditor.vue.d.ts +1 -1
  14. package/dist/components/FormattingBar.types.d.ts +2 -1
  15. package/dist/components/ReviewControls.vue.d.ts +2 -2
  16. package/dist/components/Toolbar.vue.d.ts +6 -5
  17. package/dist/components/UnifiedSidebar.vue.d.ts +3 -0
  18. package/dist/components/dialogs/FootnotePropertiesDialog.vue.d.ts +2 -2
  19. package/dist/components/dialogs/ImagePositionDialog.vue.d.ts +2 -2
  20. package/dist/components/dialogs/PageSetupDialog.vue.d.ts +4 -3
  21. package/dist/components/dialogs/SetNumberingValueDialog.vue.d.ts +2 -2
  22. package/dist/components/dialogs/TablePropertiesDialog.vue.d.ts +2 -2
  23. package/dist/components/dialogs/WatermarkDialog.vue.d.ts +4 -3
  24. package/dist/components/sidebar/CommentCard.vue.d.ts +2 -2
  25. package/dist/components/ui/ColorPicker.vue.d.ts +2 -1
  26. package/dist/components/ui/HorizontalRuler.vue.d.ts +4 -3
  27. package/dist/components/ui/TableBorderColorPicker.vue.d.ts +2 -1
  28. package/dist/components/ui/TableCellFillPicker.vue.d.ts +2 -1
  29. package/dist/components/ui/TableToolbar.vue.d.ts +2 -1
  30. package/dist/components/ui/VerticalRuler.vue.d.ts +3 -2
  31. package/dist/composables/documentChrome.d.ts +14 -0
  32. package/dist/composables/useCommentManagement.d.ts +5 -0
  33. package/dist/composables/useDocxEditor.d.ts +62 -15
  34. package/dist/composables/useDocxEditorRefApi.d.ts +10 -12
  35. package/dist/composables/useFontLifecycle.d.ts +2 -3
  36. package/dist/composables/useOutlineDrawerFocus.d.ts +1 -1
  37. package/dist/composables/usePageSetupControls.d.ts +2 -2
  38. package/dist/composables/usePagesPointer.d.ts +3 -2
  39. package/dist/composables/useParagraphStyleOptions.d.ts +2 -1
  40. package/dist/composables.cjs +1 -1
  41. package/dist/composables.js +1 -1
  42. package/dist/dialogs.cjs +1 -1
  43. package/dist/dialogs.js +1 -1
  44. package/dist/folio-vue.css +1 -1
  45. package/dist/index.cjs +1 -1
  46. package/dist/index.d.ts +5 -4
  47. package/dist/index.js +2233 -2187
  48. package/dist/ui.cjs +1 -1
  49. package/dist/ui.js +28 -28
  50. package/dist/useZoom-7jho8rWN.cjs +1 -0
  51. package/dist/useZoom-hVxyaoZn.js +1122 -0
  52. package/dist/utils/listItems.d.ts +7 -0
  53. package/dist/utils/rawDocument.d.ts +13 -0
  54. package/dist/utils/stylePreview.d.ts +2 -1
  55. package/package.json +8 -8
  56. package/dist/StylePicker-Bgu0Slqa.cjs +0 -4
  57. package/dist/useZoom-B4Q-QRRT.cjs +0 -1
  58. package/dist/useZoom-DoMlCL_b.js +0 -1021
@@ -1,12 +1,15 @@
1
1
  import { EditorState } from 'prosemirror-state';
2
- import { EditorView } from 'prosemirror-view';
2
+ import { AnonymizationHighlightsView, FolioAnonymizationMatch, FolioAnonymizationTerm } from '@stll/folio-core/controller/anonymizationHighlights';
3
3
  import { FlowBlock, Layout, Measure } from '@stll/folio-core/layout-engine/types';
4
4
  type __VLS_Props = {
5
- getView: () => EditorView | null;
5
+ /** The editor's highlights, read from the shown text of every story. */
6
+ getHighlights: () => AnonymizationHighlightsView;
6
7
  getPagesContainer: () => HTMLElement | null;
7
- /** Reactive editor state — changes on every transaction, including the
8
- * meta-only term push that a doc edit does not cover. */
8
+ /** Reactive editor state: changes on every body transaction. */
9
9
  editorState: EditorState | null;
10
+ /** The host's terms; a new list repaints. */
11
+ terms: readonly FolioAnonymizationTerm[] | undefined;
12
+ onMatchesChange?: ((matches: readonly FolioAnonymizationMatch[]) => void) | undefined;
10
13
  zoom: number;
11
14
  layout: Layout | null;
12
15
  blocks: FlowBlock[];
@@ -1,10 +1,15 @@
1
1
  import { EditorState } from 'prosemirror-state';
2
+ import { FolioAutocompleteState } from '@stll/folio-core/controller/autocompleteSuggestion';
3
+ import { FolioEditor } from '@stll/folio-core/controller/folioEditor';
2
4
  import { LayoutSelectionGate } from '@stll/folio-core/paged-layout/LayoutSelectionGate';
3
5
  type __VLS_Props = {
4
6
  getPagesContainer: () => HTMLElement | null;
5
7
  editorState: EditorState | null;
6
8
  zoom: number;
7
9
  syncCoordinator: LayoutSelectionGate;
10
+ /** The editor's suggestion. */
11
+ suggestion: FolioAutocompleteState;
12
+ editorPositionAt: FolioEditor["editorPositionAt"];
8
13
  };
9
14
  declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
10
15
  declare const _default: typeof __VLS_export;
@@ -3,6 +3,10 @@ type __VLS_Props = {
3
3
  eventRoot: HTMLElement | null;
4
4
  view: EditorView | null;
5
5
  };
6
- declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
6
+ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
+ refused: (message: string) => any;
8
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
9
+ onRefused?: (message: string) => any;
10
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
7
11
  declare const _default: typeof __VLS_export;
8
12
  export default _default;
@@ -9,6 +9,8 @@ type __VLS_Props = {
9
9
  docSize: number;
10
10
  activeId: string | null;
11
11
  surface: OutlineSurface;
12
+ /** The track the panel layout gives the surface; its default otherwise. */
13
+ width?: number;
12
14
  expanded?: boolean;
13
15
  };
14
16
  declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
@@ -1,5 +1,6 @@
1
1
  import { EditorView } from 'prosemirror-view';
2
2
  import { SectionProperties } from '@stll/folio-core/types/document';
3
+ import { DeepReadonly } from '@stll/folio-core/types/documentModel';
3
4
  import { TablePropertiesCommand } from '@stll/folio-core/utils/tableOperations';
4
5
  import { Watermark } from '@stll/folio-core/watermark';
5
6
  import { UseFindReplaceReturn } from '../../composables/useFindReplace';
@@ -18,7 +19,7 @@ type __VLS_Props = {
18
19
  view: EditorView | null;
19
20
  bookmarks: BookmarkOption[];
20
21
  selectedImagePmPos: number | null;
21
- sectionProperties: SectionProperties | null;
22
+ sectionProperties: DeepReadonly<SectionProperties> | null;
22
23
  showFindReplace: boolean;
23
24
  showHyperlink: boolean;
24
25
  showInsertSymbol: boolean;
@@ -27,7 +28,7 @@ type __VLS_Props = {
27
28
  showTableProperties: boolean;
28
29
  showWatermark: boolean;
29
30
  showNumberingValue: boolean;
30
- currentWatermark: Watermark | undefined;
31
+ currentWatermark: DeepReadonly<Watermark> | undefined;
31
32
  tableProperties: TablePropertiesCommand;
32
33
  };
33
34
  declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
@@ -4,7 +4,7 @@ import { FolioEditor } from '@stll/folio-core/controller/folioEditor';
4
4
  import { Layout } from '@stll/folio-core/layout-engine';
5
5
  import { BlockRect } from '@stll/folio-core/paged-layout/blockGeometry';
6
6
  import { ScrollToParaIdOptions } from '@stll/folio-core/paged-layout/paragraphFlash';
7
- import { Document } from '@stll/folio-core/types/document';
7
+ import { ReadonlyDocument } from '@stll/folio-core/types/documentModel';
8
8
  /**
9
9
  * Imperative handle exposed by `DocxEditorRef.getEditorRef()`.
10
10
  *
@@ -22,8 +22,16 @@ import { Document } from '@stll/folio-core/types/document';
22
22
  export type PagedEditorRef = {
23
23
  /** The headless editor controller (imperative API + events; Seam 6). */
24
24
  getEditor: () => FolioEditor;
25
- /** Get the current document. */
26
- getDocument: () => Document | null;
25
+ /**
26
+ * The current document, built over the editor's model and sharing its
27
+ * parts: read it, never write it (`DocxEditorRef.getDocument` hands a copy).
28
+ */
29
+ getDocument: () => ReadonlyDocument | null;
30
+ /**
31
+ * The editor's document model, without a copy: in a canonical session the
32
+ * session's own document (read it, never write it); otherwise null.
33
+ */
34
+ readDocumentModel: () => ReadonlyDocument | null;
27
35
  /** Get the ProseMirror EditorState. */
28
36
  getState: () => EditorState | null;
29
37
  /** Get the ProseMirror EditorView. */
@@ -85,12 +93,6 @@ export type PagedEditorRef = {
85
93
  from: number;
86
94
  to: number;
87
95
  } | null) => void;
88
- /**
89
- * Resolve the page number (1-indexed) that contains the given PM position, or
90
- * null if no layout is available yet. Works for unrendered pages too via the
91
- * page shell map.
92
- */
93
- getPageNumberForPmPos: (pmPos: number) => number | null;
94
96
  /** Painted geometry for one AI-snapshot block. */
95
97
  getBlockRect: (blockId: string) => BlockRect | null;
96
98
  /** Painted geometry for many AI-snapshot blocks in one layout read. */
@@ -3,8 +3,12 @@ import { EditorView } from 'prosemirror-view';
3
3
  import { CSSProperties, VNodeChild } from 'vue';
4
4
  import { XmlFragment } from 'yjs';
5
5
  import { FolioAIEditApplyMode, FolioAIEditApplyResult, FolioAIEditOperation, FolioAIEditSnapshot, FolioCommentAnchor, FolioDocumentNavigationTarget, FolioDocumentOperationBatch, FolioDocumentOperationResult, FolioDocumentOperationUndoHandle, FolioDocumentOperationUndoResult, FolioPendingSuggestionLoadResult, FolioPendingSuggestionRecord, FolioReviewChange, FolioUndefinedReferencePolicy } from '@stll/folio-core/ai-edits';
6
+ import { CanonicalHistoryDrop, CanonicalHistoryEffect } from '@stll/folio-core/canonical/canonicalSession';
6
7
  import { ContentControlFilter, SetContentControlContentInput, SetContentControlValueInput } from '@stll/folio-core/content-controls';
7
- import { FolioEditor } from '@stll/folio-core/controller/folioEditor';
8
+ import { FolioAnonymizationMatch, FolioAnonymizationTerm } from '@stll/folio-core/controller/anonymizationHighlights';
9
+ import { FolioAutocompleteApi, FolioAutocompleteState } from '@stll/folio-core/controller/autocompleteSuggestion';
10
+ import { CanonicalRoomCollaboration } from '@stll/folio-core/controller/canonicalRoomEditor';
11
+ import { FolioEditor, FolioSaveOptions, TextPosition } from '@stll/folio-core/controller/folioEditor';
8
12
  import { PageRendererName } from '@stll/folio-core/display-list/editor/pageRenderer';
9
13
  import { DocxCompatibility } from '@stll/folio-core/docx/compatibility';
10
14
  import { FolioSelectiveSaveFlags } from '@stll/folio-core/docx/selectiveSaveFlags';
@@ -16,14 +20,16 @@ import { BlockRect } from '@stll/folio-core/paged-layout/blockGeometry';
16
20
  import { ScrollToParaIdOptions } from '@stll/folio-core/paged-layout/paragraphFlash';
17
21
  import { ListState, SelectionState, TableContextInfo } from '@stll/folio-core/prosemirror';
18
22
  import { FolioSuggestion, SuggestionAppliedAs } from '@stll/folio-core/prosemirror/commands/comments';
19
- import { AnonymizationMatch } from '@stll/folio-core/prosemirror/plugins/anonymizationDecorations';
20
23
  import { TemplateSlashMenuKeyAction, TemplateSlashMenuState } from '@stll/folio-core/prosemirror/plugins/templateSlashMenu';
21
24
  import { Comment } from '@stll/folio-core/types/content';
22
25
  import { Document, ParagraphAlignment, SdtProperties, TabStop, Theme } from '@stll/folio-core/types/document';
26
+ import { FolioDerivedFields, FolioFieldInsertion } from '@stll/folio-core/types/fields';
23
27
  import { DocxInput } from '@stll/folio-core/utils/docxInput';
24
28
  import { FindMatch, FindOptions, FindResult } from '@stll/folio-core/utils/findReplace';
25
29
  import { OutlineDepth } from '@stll/folio-core/utils/outlineDepth';
26
30
  import { DocumentLoadState } from '@stll/folio-core/managers/DocumentLoaderManager';
31
+ import { EditorSession } from '@stll/folio-core/types/canonicalCapabilities';
32
+ import { DeepReadonly } from '@stll/folio-core/types/documentModel';
27
33
  import { FolioUIComponents } from '../../ui/folio-ui';
28
34
  import { FontOption } from '../../utils/fontOptions';
29
35
  import { PagedEditorRef } from './pagedEditorRef';
@@ -70,8 +76,16 @@ export type DocxEditorProps = {
70
76
  password?: string | undefined;
71
77
  /** Pre-parsed document (alternative to documentBuffer) */
72
78
  document?: Document | null;
73
- /** Experimental plain-text canonical session; unsupported edits are refused. */
74
- experimentalSession?: "canonical";
79
+ /**
80
+ * The editing engine. Unset, the editor runs the canonical session, which
81
+ * refuses unsupported edits with a notice, or the legacy session when
82
+ * `collaboration` is a Yjs fragment. `"legacy"` selects the
83
+ * ProseMirror-owned engine.
84
+ * A host plugin's transaction or a direct dispatch that changes the
85
+ * document is refused too, its refusal naming the transaction's meta keys:
86
+ * express such an edit as document operations (`applyDocumentOperations`).
87
+ */
88
+ experimentalSession?: EditorSession;
75
89
  /** Callback when document is saved */
76
90
  onSave?: (buffer: ArrayBuffer) => void;
77
91
  /** Author name used for comments and track changes */
@@ -117,7 +131,7 @@ export type DocxEditorProps = {
117
131
  */
118
132
  fonts?: ReadonlyArray<FontDefinition>;
119
133
  /** Theme for styling */
120
- theme?: Theme | null;
134
+ theme?: DeepReadonly<Theme> | null;
121
135
  /** Whether to show toolbar (default: true) */
122
136
  showToolbar?: boolean;
123
137
  /** Whether to show zoom control (default: true) */
@@ -254,8 +268,9 @@ export type DocxEditorProps = {
254
268
  /**
255
269
  * Controlled comments array. When provided, the editor reads comment thread
256
270
  * metadata from this prop and emits every change through `onCommentsChange`.
257
- * Use with collaboration backends (Yjs, etc.); PM carries range markers,
258
- * thread metadata lives outside the doc.
271
+ * In a canonical room the comments are operations of the room's journal:
272
+ * the editor reports them through `onCommentsChange` and never reads this
273
+ * prop back.
259
274
  */
260
275
  comments?: Comment[];
261
276
  /** Current document search results, including the zero-based current hit. */
@@ -264,21 +279,58 @@ export type DocxEditorProps = {
264
279
  onCommentsChange?: (comments: Comment[]) => void;
265
280
  /** Callback with the parsed document's editing compatibility report. */
266
281
  onCompatibilityChange?: (compatibility: DocxCompatibility) => void;
282
+ /**
283
+ * With the canonical session: called after each edit, undo or redo is
284
+ * published in any story, with what it did to the session's undo history.
285
+ * A host that keeps its own undo stack (and owns `hostShortcuts`'
286
+ * `"history"`) adds one entry per `opened` and undoes through the editor's
287
+ * ref.
288
+ */
289
+ onCanonicalHistory?: (effect: CanonicalHistoryEffect) => void;
290
+ /**
291
+ * With the canonical session: called when a peer's edit in a canonical
292
+ * room left local history steps unusable, with how many of each stack it
293
+ * dropped, counted from the bottom. A host that mirrors the steps in its
294
+ * own undo stack removes as many.
295
+ */
296
+ onCanonicalHistoryDrop?: (drop: CanonicalHistoryDrop) => void;
267
297
  /**
268
298
  * Fires when the live ProseMirror view is captured (or torn down). The host
269
299
  * wires this to drive the AI suggestion overlay (decoration meta, apply,
270
300
  * scroll-to) from outside the editor.
271
301
  */
272
302
  onEditorViewReady?: (view: EditorView | null) => void;
273
- /** Yjs-backed collaboration owner. Experimental and opt-in. */
303
+ /**
304
+ * Edit together with other editors. With the canonical session, the
305
+ * canonical room the session joins; with the legacy session, the Yjs
306
+ * fragment it edits. Experimental and opt-in.
307
+ */
274
308
  collaboration?: DocxEditorCollaboration | undefined;
275
309
  /**
276
- * Fires with the current anonymization match list every time the decoration
277
- * plugin recomputes it (mount, term push, doc edit, async DOCX load). The
278
- * host mirrors per-document counts and "matching workspace terms" to the
279
- * inspector facet without polling the plugin state.
310
+ * Terms to highlight wherever they occur in the shown text of every story
311
+ * (body, table cells, headers, footers, notes), in either session. A term
312
+ * matches literally, case-insensitively and on word boundaries, across
313
+ * formatting runs; text inside a tracked deletion is matched too.
314
+ * Highlights are view state: they never change the document, its undo
315
+ * history or its pending changes, and they follow every edit, a peer's
316
+ * included. Pass a new array to change the terms.
317
+ */
318
+ anonymizationTerms?: readonly FolioAnonymizationTerm[] | undefined;
319
+ /**
320
+ * Fields whose display text the host derives from the document (numbered
321
+ * references, for one). After each local edit the owned fields show what
322
+ * `displayTexts` gives them, in the same undo step as the edit; a peer in a
323
+ * shared room receives the update with it.
324
+ */
325
+ derivedFields?: FolioDerivedFields | undefined;
326
+ /** Called with the inline autocomplete suggestion each time it changes. */
327
+ onAutocompleteChange?: ((state: FolioAutocompleteState) => void) | undefined;
328
+ /**
329
+ * Fires with every occurrence, as text positions, each time the set of
330
+ * occurrences changes (new terms, an edit, a load). An edit elsewhere in
331
+ * the document does not fire it.
280
332
  */
281
- onAnonymizationMatchesChange?: (matches: readonly AnonymizationMatch[]) => void;
333
+ onAnonymizationMatchesChange?: (matches: readonly FolioAnonymizationMatch[]) => void;
282
334
  /**
283
335
  * Fires when the user clicks an anonymization highlight in the rendered
284
336
  * document. Hosts push the selection into a sidebar bridge so the inspector
@@ -344,7 +396,9 @@ export type DocxEditorProps = {
344
396
  onSelectiveSaveTripwire?: (result: TripwireResult) => void;
345
397
  };
346
398
  export type { FolioSelectiveSaveFlags, TripwireResult };
347
- export type DocxEditorCollaboration = {
399
+ export type DocxEditorCollaboration = CanonicalRoomCollaboration | DocxEditorYjsCollaboration;
400
+ /** A Yjs fragment the legacy session edits, and the plugins that bind it. */
401
+ export type DocxEditorYjsCollaboration = {
348
402
  awareness?: {
349
403
  clientID: number;
350
404
  getStates: () => Map<number, unknown>;
@@ -355,6 +409,8 @@ export type DocxEditorCollaboration = {
355
409
  plugins?: Plugin[] | undefined;
356
410
  shouldSeed?: boolean | undefined;
357
411
  yXmlFragment: XmlFragment;
412
+ /** A canonical room is reached through `connect`; a Yjs fragment has none. */
413
+ connect?: never;
358
414
  };
359
415
  export type DocxEditorApplyDocumentOperationsOptions = {
360
416
  undefinedReferences: FolioUndefinedReferencePolicy;
@@ -392,9 +448,7 @@ export type DocxEditorRef = {
392
448
  /** The headless editor controller (Seam 6), or null before the editor mounts. */
393
449
  getEditor: () => FolioEditor | null;
394
450
  /** Save the document to buffer. Pass { selective: false } to force full repack. */
395
- save: (options?: {
396
- selective?: boolean;
397
- }) => Promise<ArrayBuffer | null>;
451
+ save: (options?: FolioSaveOptions) => Promise<ArrayBuffer | null>;
398
452
  /** Set zoom level */
399
453
  setZoom: (zoom: number) => void;
400
454
  /** Get current zoom level */
@@ -575,6 +629,29 @@ export type DocxEditorRef = {
575
629
  getPageText: (page: number) => string | null;
576
630
  /** Resolve a stable block or text range to its real 1-based rendered page. */
577
631
  getTargetPage: (target: FolioDocumentNavigationTarget, snapshot?: FolioAIEditSnapshot) => number | null;
632
+ /**
633
+ * The 1-based rendered page that shows a body text position (story,
634
+ * paragraph id, offset), or null before layout or when no paragraph in the
635
+ * body has that id.
636
+ */
637
+ getPositionPage: (position: TextPosition) => number | null;
638
+ /**
639
+ * The inline autocomplete suggestion: ghost text streamed in at a text
640
+ * position and shown beside the caret, in either session. It is view
641
+ * state: it never changes the document, its undo history or its pending
642
+ * changes, and it stays on its text when a peer edits. Typing its next
643
+ * characters consumes them; any other edit dismisses it. Tab accepts it,
644
+ * Mod-ArrowRight its next word, Escape dismisses it.
645
+ */
646
+ autocomplete: FolioAutocompleteApi;
647
+ /** Every occurrence of the `anonymizationTerms`, as text positions. */
648
+ getAnonymizationMatches: () => readonly FolioAnonymizationMatch[];
649
+ /**
650
+ * Insert a field in place of the body selection: one undo step, a tracked
651
+ * insertion when suggesting. False when nothing was inserted, as while a
652
+ * header, footer or note is being edited.
653
+ */
654
+ insertField: (field: FolioFieldInsertion) => boolean;
578
655
  /** Painted geometry for one block, relative to this editor's scroll root. */
579
656
  getBlockRect: (blockId: string) => BlockRect | null;
580
657
  /** Painted geometry for many blocks in one layout read; missing ids are omitted. */
@@ -694,7 +771,7 @@ export type EditorState = {
694
771
  paragraphIndentRight: number;
695
772
  paragraphFirstLineIndent: number;
696
773
  paragraphHangingIndent: boolean;
697
- paragraphTabs: TabStop[] | null;
774
+ paragraphTabs: readonly DeepReadonly<TabStop>[] | null;
698
775
  /** ProseMirror table context (for showing table toolbar) */
699
776
  pmTableContext: TableContextInfo | null;
700
777
  /** Image context when cursor is on an image node */
@@ -38,8 +38,8 @@ declare const __VLS_base: import('vue').DefineComponent<DocxEditorProps, import(
38
38
  "onFind-result-change"?: (result: FindResult | null) => any;
39
39
  }>, {
40
40
  author: string;
41
- document: Document | null;
42
41
  mode: EditorMode;
42
+ document: Document | null;
43
43
  className: string;
44
44
  showCommentHighlights: boolean;
45
45
  readOnly: boolean;
@@ -1,4 +1,5 @@
1
1
  import { ColorValue, Theme } from '@stll/folio-core/types/document';
2
+ import { DeepReadonly } from '@stll/folio-core/types/documentModel';
2
3
  import { ListState } from '../utils/listState';
3
4
  import { ParagraphAlignment } from './ui/AlignmentButtons.types';
4
5
  import { StyleOption } from './ui/StylePicker.types';
@@ -63,5 +64,5 @@ export type FormattingBarProps = {
63
64
  /** Document styles for the style picker (Vue `StylePicker` option shape). */
64
65
  documentStyles?: StyleOption[];
65
66
  /** Document theme — feeds the color picker's theme-color matrix. */
66
- theme?: Theme | null;
67
+ theme?: DeepReadonly<Theme> | null;
67
68
  };
@@ -6,10 +6,10 @@ type __VLS_Props = {
6
6
  };
7
7
  declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
8
8
  "toggle-track-changes": () => any;
9
- "update:display-mode": (mode: "all-markup" | "simple-markup" | "no-markup" | "original") => any;
9
+ "update:display-mode": (mode: "original" | "all-markup" | "simple-markup" | "no-markup") => any;
10
10
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
11
11
  "onToggle-track-changes"?: () => any;
12
- "onUpdate:display-mode"?: (mode: "all-markup" | "simple-markup" | "no-markup" | "original") => any;
12
+ "onUpdate:display-mode"?: (mode: "original" | "all-markup" | "simple-markup" | "no-markup") => any;
13
13
  }>, {
14
14
  readOnly: boolean;
15
15
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -2,6 +2,7 @@ import { Command } from 'prosemirror-state';
2
2
  import { EditorView } from 'prosemirror-view';
3
3
  import { DisplayMode } from '@stll/folio-core/managers/EditorModeManager';
4
4
  import { Style, Theme } from '@stll/folio-core/types/document';
5
+ import { DeepReadonly } from '@stll/folio-core/types/documentModel';
5
6
  import { FontOption } from '../utils/fontOptions';
6
7
  import { EditorMode } from './DocxEditor/types';
7
8
  /**
@@ -57,7 +58,7 @@ type __VLS_Props = {
57
58
  (properties button) renders inline inside the pill. */
58
59
  imageContext?: ImageToolbarContext | null;
59
60
  /** Document theme — feeds the color picker's theme-color matrix. */
60
- theme?: Theme | null;
61
+ theme?: DeepReadonly<Theme> | null;
61
62
  /** Optional custom font list matching React's `fontFamilies` prop. */
62
63
  fontFamilies?: ReadonlyArray<string | FontOption>;
63
64
  /**
@@ -69,7 +70,7 @@ type __VLS_Props = {
69
70
  /** Paragraph styles from the loaded document (document.package.styles.styles).
70
71
  When present, the style picker shows the document's real styles + names,
71
72
  matching React's Toolbar `documentStyles` prop. Falls back to presets. */
72
- documentStyles?: Style[];
73
+ documentStyles?: DeepReadonly<Style[]>;
73
74
  };
74
75
  declare const __VLS_template: () => {
75
76
  __VLS_Slots: {
@@ -85,7 +86,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {},
85
86
  "insert-symbol": () => any;
86
87
  "insert-table": () => any;
87
88
  "toggle-track-changes": () => any;
88
- "update:display-mode": (mode: "all-markup" | "simple-markup" | "no-markup" | "original") => any;
89
+ "update:display-mode": (mode: "original" | "all-markup" | "simple-markup" | "no-markup") => any;
89
90
  "find-replace": () => any;
90
91
  "insert-image": () => any;
91
92
  "insert-link": () => any;
@@ -106,7 +107,7 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {},
106
107
  "onInsert-symbol"?: () => any;
107
108
  "onInsert-table"?: () => any;
108
109
  "onToggle-track-changes"?: () => any;
109
- "onUpdate:display-mode"?: (mode: "all-markup" | "simple-markup" | "no-markup" | "original") => any;
110
+ "onUpdate:display-mode"?: (mode: "original" | "all-markup" | "simple-markup" | "no-markup") => any;
110
111
  "onFind-replace"?: () => any;
111
112
  "onInsert-image"?: () => any;
112
113
  "onInsert-link"?: () => any;
@@ -122,8 +123,8 @@ declare const __VLS_base: import('vue').DefineComponent<__VLS_Props, {}, {}, {},
122
123
  "onImage-properties"?: () => any;
123
124
  "onImage-transform"?: (action: ImageTransformAction) => any;
124
125
  }>, {
125
- displayMode: "all-markup" | "simple-markup" | "no-markup" | "original";
126
126
  view: EditorView | null;
127
+ displayMode: "original" | "all-markup" | "simple-markup" | "no-markup";
127
128
  readOnly: boolean;
128
129
  trackChangesOn: boolean;
129
130
  getCommands: () => Record<string, CommandFactory>;
@@ -9,6 +9,9 @@ type __VLS_Props = {
9
9
  showResolved?: boolean;
10
10
  pagesContainer: HTMLElement | null;
11
11
  pageWidthPx: number;
12
+ /** Where the column starts in the scroll content, from the panel layout's
13
+ * numbers; null until the layout knows its width. */
14
+ columnStart?: number | null;
12
15
  zoom?: number;
13
16
  /** Controlled expansion shared by card clicks and search navigation.
14
17
  * Used by DocxEditor to auto-expand cards when the cursor
@@ -5,11 +5,11 @@ type __VLS_Props = {
5
5
  endnotePr?: EndnoteProperties;
6
6
  };
7
7
  declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
8
- apply: (footnotePr: FootnoteProperties, endnotePr: EndnoteProperties) => any;
9
8
  close: () => any;
9
+ apply: (footnotePr: FootnoteProperties, endnotePr: EndnoteProperties) => any;
10
10
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
11
- onApply?: (footnotePr: FootnoteProperties, endnotePr: EndnoteProperties) => any;
12
11
  onClose?: () => any;
12
+ onApply?: (footnotePr: FootnoteProperties, endnotePr: EndnoteProperties) => any;
13
13
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
14
14
  declare const _default: typeof __VLS_export;
15
15
  export default _default;
@@ -19,11 +19,11 @@ type __VLS_Props = {
19
19
  currentData?: ImagePositionData;
20
20
  };
21
21
  declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
22
- apply: (data: ImagePositionData) => any;
23
22
  close: () => any;
23
+ apply: (data: ImagePositionData) => any;
24
24
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
25
- onApply?: (data: ImagePositionData) => any;
26
25
  onClose?: () => any;
26
+ onApply?: (data: ImagePositionData) => any;
27
27
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
28
28
  declare const _default: typeof __VLS_export;
29
29
  export default _default;
@@ -1,14 +1,15 @@
1
1
  import { SectionProperties } from '@stll/folio-core/types/document';
2
+ import { DeepReadonly } from '@stll/folio-core/types/documentModel';
2
3
  type __VLS_Props = {
3
4
  isOpen: boolean;
4
- sectionProperties?: SectionProperties | null;
5
+ sectionProperties?: DeepReadonly<SectionProperties> | null;
5
6
  };
6
7
  declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
7
- apply: (props: Partial<SectionProperties>) => any;
8
8
  close: () => any;
9
+ apply: (props: Partial<SectionProperties>) => any;
9
10
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
10
- onApply?: (props: Partial<SectionProperties>) => any;
11
11
  onClose?: () => any;
12
+ onApply?: (props: Partial<SectionProperties>) => any;
12
13
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
13
14
  declare const _default: typeof __VLS_export;
14
15
  export default _default;
@@ -2,11 +2,11 @@ type __VLS_Props = {
2
2
  isOpen: boolean;
3
3
  };
4
4
  declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
5
- apply: (value: number) => any;
6
5
  close: () => any;
6
+ apply: (value: number) => any;
7
7
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
8
- onApply?: (value: number) => any;
9
8
  onClose?: () => any;
9
+ onApply?: (value: number) => any;
10
10
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
11
11
  declare const _default: typeof __VLS_export;
12
12
  export default _default;
@@ -5,11 +5,11 @@ type __VLS_Props = {
5
5
  currentProps?: TableProperties;
6
6
  };
7
7
  declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
8
- apply: (props: TablePropertiesCommand) => any;
9
8
  close: () => any;
9
+ apply: (props: TablePropertiesCommand) => any;
10
10
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
11
- onApply?: (props: TablePropertiesCommand) => any;
12
11
  onClose?: () => any;
12
+ onApply?: (props: TablePropertiesCommand) => any;
13
13
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
14
14
  declare const _default: typeof __VLS_export;
15
15
  export default _default;
@@ -1,14 +1,15 @@
1
+ import { DeepReadonly } from '@stll/folio-core/types/documentModel';
1
2
  import { Watermark } from '@stll/folio-core/watermark';
2
3
  type __VLS_Props = {
3
4
  isOpen: boolean;
4
- currentWatermark?: Watermark | undefined;
5
+ currentWatermark?: DeepReadonly<Watermark> | undefined;
5
6
  };
6
7
  declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
7
- apply: (watermark: Watermark | undefined) => any;
8
8
  close: () => any;
9
+ apply: (watermark: Watermark | undefined) => any;
9
10
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
10
- onApply?: (watermark: Watermark | undefined) => any;
11
11
  onClose?: () => any;
12
+ onApply?: (watermark: Watermark | undefined) => any;
12
13
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
13
14
  declare const _default: typeof __VLS_export;
14
15
  export default _default;
@@ -5,15 +5,15 @@ type __VLS_Props = {
5
5
  expanded: boolean;
6
6
  };
7
7
  declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
8
+ delete: (commentId: number) => any;
8
9
  reply: (commentId: number, text: string) => any;
9
10
  click: () => any;
10
- delete: (commentId: number) => any;
11
11
  resolve: (commentId: number) => any;
12
12
  unresolve: (commentId: number) => any;
13
13
  }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
14
+ onDelete?: (commentId: number) => any;
14
15
  onReply?: (commentId: number, text: string) => any;
15
16
  onClick?: () => any;
16
- onDelete?: (commentId: number) => any;
17
17
  onResolve?: (commentId: number) => any;
18
18
  onUnresolve?: (commentId: number) => any;
19
19
  }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -1,10 +1,11 @@
1
1
  import { CSSProperties } from 'vue';
2
2
  import { ColorValue, Theme } from '@stll/folio-core/types/document';
3
+ import { DeepReadonly } from '@stll/folio-core/types/documentModel';
3
4
  export type ColorPickerMode = "text" | "highlight" | "border";
4
5
  type __VLS_Props = {
5
6
  mode: ColorPickerMode;
6
7
  value?: ColorValue | string | undefined;
7
- theme?: Theme | null;
8
+ theme?: DeepReadonly<Theme> | null;
8
9
  disabled?: boolean;
9
10
  className?: string;
10
11
  style?: CSSProperties;
@@ -1,6 +1,7 @@
1
1
  import { SectionProperties, TabStop } from '@stll/folio-core/types/document';
2
+ import { DeepReadonly } from '@stll/folio-core/types/documentModel';
2
3
  type __VLS_Props = {
3
- sectionProps?: SectionProperties | null;
4
+ sectionProps?: DeepReadonly<SectionProperties> | null;
4
5
  zoom?: number;
5
6
  editable?: boolean;
6
7
  showFirstLineIndent?: boolean;
@@ -9,7 +10,7 @@ type __VLS_Props = {
9
10
  indentLeft?: number;
10
11
  indentRight?: number;
11
12
  unit?: "inch" | "cm";
12
- tabStops?: TabStop[] | null;
13
+ tabStops?: readonly DeepReadonly<TabStop>[] | null;
13
14
  };
14
15
  declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
15
16
  "left-margin-change": (twips: number) => any;
@@ -30,8 +31,8 @@ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {
30
31
  indentRight: number;
31
32
  hangingIndent: boolean;
32
33
  unit: "cm" | "inch";
33
- editable: boolean;
34
34
  zoom: number;
35
+ editable: boolean;
35
36
  firstLineIndent: number;
36
37
  showFirstLineIndent: boolean;
37
38
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
@@ -1,7 +1,8 @@
1
1
  import { Theme } from '@stll/folio-core/types/document';
2
+ import { DeepReadonly } from '@stll/folio-core/types/documentModel';
2
3
  type __VLS_Props = {
3
4
  disabled?: boolean;
4
- theme?: Theme | null;
5
+ theme?: DeepReadonly<Theme> | null;
5
6
  /** Current border color (RGB hex without #). */
6
7
  value?: string;
7
8
  };
@@ -1,7 +1,8 @@
1
1
  import { Theme } from '@stll/folio-core/types/document';
2
+ import { DeepReadonly } from '@stll/folio-core/types/documentModel';
2
3
  type __VLS_Props = {
3
4
  disabled?: boolean;
4
- theme?: Theme | null;
5
+ theme?: DeepReadonly<Theme> | null;
5
6
  /** Current fill color (RGB hex without #). */
6
7
  value?: string;
7
8
  };