@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.
- package/README.md +5 -0
- package/dist/{SplitCellDialog-Dge_CE-B.cjs → SplitCellDialog-Bc2TjxMb.cjs} +1 -1
- package/dist/{SplitCellDialog-Vl4gq22E.js → SplitCellDialog-DULmbU_P.js} +6 -6
- package/dist/StylePicker-CD28Jh8D.cjs +4 -0
- package/dist/{StylePicker-CfC5Ef1i.js → StylePicker-D8VHvoMT.js} +664 -591
- package/dist/components/AnonymizationRectsOverlay.vue.d.ts +7 -4
- package/dist/components/AutocompleteSuggestionOverlay.vue.d.ts +5 -0
- package/dist/components/ContentControlWidgetsOverlay.vue.d.ts +5 -1
- package/dist/components/DocumentOutline.vue.d.ts +2 -0
- package/dist/components/DocxEditor/DocxEditorDialogs.vue.d.ts +3 -2
- package/dist/components/DocxEditor/pagedEditorRef.d.ts +11 -9
- package/dist/components/DocxEditor/types.d.ts +95 -18
- package/dist/components/DocxEditor.vue.d.ts +1 -1
- package/dist/components/FormattingBar.types.d.ts +2 -1
- package/dist/components/ReviewControls.vue.d.ts +2 -2
- package/dist/components/Toolbar.vue.d.ts +6 -5
- package/dist/components/UnifiedSidebar.vue.d.ts +3 -0
- package/dist/components/dialogs/FootnotePropertiesDialog.vue.d.ts +2 -2
- package/dist/components/dialogs/ImagePositionDialog.vue.d.ts +2 -2
- package/dist/components/dialogs/PageSetupDialog.vue.d.ts +4 -3
- package/dist/components/dialogs/SetNumberingValueDialog.vue.d.ts +2 -2
- package/dist/components/dialogs/TablePropertiesDialog.vue.d.ts +2 -2
- package/dist/components/dialogs/WatermarkDialog.vue.d.ts +4 -3
- package/dist/components/sidebar/CommentCard.vue.d.ts +2 -2
- package/dist/components/ui/ColorPicker.vue.d.ts +2 -1
- package/dist/components/ui/HorizontalRuler.vue.d.ts +4 -3
- package/dist/components/ui/TableBorderColorPicker.vue.d.ts +2 -1
- package/dist/components/ui/TableCellFillPicker.vue.d.ts +2 -1
- package/dist/components/ui/TableToolbar.vue.d.ts +2 -1
- package/dist/components/ui/VerticalRuler.vue.d.ts +3 -2
- package/dist/composables/documentChrome.d.ts +14 -0
- package/dist/composables/useCommentManagement.d.ts +5 -0
- package/dist/composables/useDocxEditor.d.ts +62 -15
- package/dist/composables/useDocxEditorRefApi.d.ts +10 -12
- package/dist/composables/useFontLifecycle.d.ts +2 -3
- package/dist/composables/useOutlineDrawerFocus.d.ts +1 -1
- package/dist/composables/usePageSetupControls.d.ts +2 -2
- package/dist/composables/usePagesPointer.d.ts +3 -2
- package/dist/composables/useParagraphStyleOptions.d.ts +2 -1
- package/dist/composables.cjs +1 -1
- package/dist/composables.js +1 -1
- package/dist/dialogs.cjs +1 -1
- package/dist/dialogs.js +1 -1
- package/dist/folio-vue.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.js +2233 -2187
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +28 -28
- package/dist/useZoom-7jho8rWN.cjs +1 -0
- package/dist/useZoom-hVxyaoZn.js +1122 -0
- package/dist/utils/listItems.d.ts +7 -0
- package/dist/utils/rawDocument.d.ts +13 -0
- package/dist/utils/stylePreview.d.ts +2 -1
- package/package.json +8 -8
- package/dist/StylePicker-Bgu0Slqa.cjs +0 -4
- package/dist/useZoom-B4Q-QRRT.cjs +0 -1
- package/dist/useZoom-DoMlCL_b.js +0 -1021
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { Command } from 'prosemirror-state';
|
|
2
2
|
import { EditorView } from 'prosemirror-view';
|
|
3
3
|
import { Theme } from '@stll/folio-core/types/document';
|
|
4
|
+
import { DeepReadonly } from '@stll/folio-core/types/documentModel';
|
|
4
5
|
/**
|
|
5
6
|
* A toolbar command factory: called with whatever arguments the specific
|
|
6
7
|
* command needs, it returns a ProseMirror `Command`.
|
|
@@ -19,7 +20,7 @@ type __VLS_Props = {
|
|
|
19
20
|
getCommands: () => Record<string, CommandFactory>;
|
|
20
21
|
stateTick: number;
|
|
21
22
|
/** Document theme — fed through to the border/fill color pickers. */
|
|
22
|
-
theme?: Theme | null;
|
|
23
|
+
theme?: DeepReadonly<Theme> | null;
|
|
23
24
|
};
|
|
24
25
|
declare function onBorderPreset(preset: TableBorderPreset): void;
|
|
25
26
|
declare function onBorderColor(hex: string): void;
|
|
@@ -1,6 +1,7 @@
|
|
|
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
|
-
sectionProps?: SectionProperties | null;
|
|
4
|
+
sectionProps?: DeepReadonly<SectionProperties> | null;
|
|
4
5
|
zoom?: number;
|
|
5
6
|
editable?: boolean;
|
|
6
7
|
unit?: "inch" | "cm";
|
|
@@ -13,8 +14,8 @@ declare const __VLS_export: import('vue').DefineComponent<__VLS_Props, {}, {}, {
|
|
|
13
14
|
"onBottom-margin-change"?: (twips: number) => any;
|
|
14
15
|
}>, {
|
|
15
16
|
unit: "cm" | "inch";
|
|
16
|
-
editable: boolean;
|
|
17
17
|
zoom: number;
|
|
18
|
+
editable: boolean;
|
|
18
19
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
19
20
|
declare const _default: typeof __VLS_export;
|
|
20
21
|
export default _default;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { SectionProperties, Style } from '@stll/folio-core/types/document';
|
|
2
|
+
import { DeepReadonly, ReadonlyDocument } from '@stll/folio-core/types/documentModel';
|
|
3
|
+
import { Watermark } from '@stll/folio-core/watermark';
|
|
4
|
+
/**
|
|
5
|
+
* The document-wide values the toolbar, the rulers and the page setup controls
|
|
6
|
+
* show. Derived from the document model by reading it, never from a document
|
|
7
|
+
* built for the purpose, so deriving them costs nothing per keystroke.
|
|
8
|
+
*/
|
|
9
|
+
export type DocumentChrome = {
|
|
10
|
+
sectionProperties: DeepReadonly<SectionProperties> | null;
|
|
11
|
+
watermark: DeepReadonly<Watermark> | undefined;
|
|
12
|
+
styles: DeepReadonly<Style[]> | undefined;
|
|
13
|
+
};
|
|
14
|
+
export declare const documentChrome: (document: ReadonlyDocument | null) => DocumentChrome;
|
|
@@ -12,6 +12,11 @@ export type UseCommentManagementOptions = {
|
|
|
12
12
|
commentsProp: () => Comment[] | undefined;
|
|
13
13
|
/** Fires on every comment-list mutation (controlled and uncontrolled). */
|
|
14
14
|
onCommentsChange: (comments: Comment[]) => void;
|
|
15
|
+
/**
|
|
16
|
+
* Whether the comments are a canonical room's: the controlled prop then
|
|
17
|
+
* only reports them and is never read back into the session.
|
|
18
|
+
*/
|
|
19
|
+
commentsFromRoom?: () => boolean;
|
|
15
20
|
/** Reactive invalidation for the canonical document reader. */
|
|
16
21
|
canonicalTick?: Ref<number>;
|
|
17
22
|
/** Re-run layout after a mutation that changed marks in the document. */
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { EditorState, Plugin } from 'prosemirror-state';
|
|
2
2
|
import { EditorView } from 'prosemirror-view';
|
|
3
3
|
import { MaybeRefOrGetter, Ref } from 'vue';
|
|
4
|
-
import {
|
|
4
|
+
import { CanonicalHistoryDrop, CanonicalHistoryEffect } from '@stll/folio-core/canonical/canonicalSession';
|
|
5
|
+
import { FolioAnonymizationTerm } from '@stll/folio-core/controller/anonymizationHighlights';
|
|
6
|
+
import { CanonicalRoomCollaboration } from '@stll/folio-core/controller/canonicalRoomEditor';
|
|
7
|
+
import { FolioEditor, FolioSaveOptions } from '@stll/folio-core/controller/folioEditor';
|
|
5
8
|
import { HeaderFooterPartKind } from '@stll/folio-core/controller/headerFooterEditorManager';
|
|
6
9
|
import { HiddenProseMirrorCollaboration, HiddenProseMirrorRemoteSelection } from '@stll/folio-core/controller/hiddenEditorManager';
|
|
7
10
|
import { NoteStoryKey } from '@stll/folio-core/controller/noteEditorManager';
|
|
@@ -13,10 +16,13 @@ import { DisplayMode } from '@stll/folio-core/managers/EditorModeManager';
|
|
|
13
16
|
import { LayoutSelectionGate } from '@stll/folio-core/paged-layout/LayoutSelectionGate';
|
|
14
17
|
import { HistoryShortcutOwner } from '@stll/folio-core/prosemirror/extensions/core/HistoryExtension';
|
|
15
18
|
import { CommandMap } from '@stll/folio-core/prosemirror/extensions/types';
|
|
16
|
-
import { AnonymizationMatch } from '@stll/folio-core/prosemirror/plugins/anonymizationDecorations';
|
|
17
19
|
import { TemplateSlashMenuKeyAction, TemplateSlashMenuState } from '@stll/folio-core/prosemirror/plugins/templateSlashMenu';
|
|
20
|
+
import { FolioAutocompleteState } from '@stll/folio-core/types/autocomplete';
|
|
21
|
+
import { EditorSession } from '@stll/folio-core/types/canonicalCapabilities';
|
|
18
22
|
import { Comment } from '@stll/folio-core/types/content';
|
|
19
23
|
import { Document } from '@stll/folio-core/types/document';
|
|
24
|
+
import { ReadonlyDocument } from '@stll/folio-core/types/documentModel';
|
|
25
|
+
import { FolioDerivedFields } from '@stll/folio-core/types/fields';
|
|
20
26
|
import { DocxInput } from '@stll/folio-core/utils/docxInput';
|
|
21
27
|
export type UseDocxEditorOptions = {
|
|
22
28
|
/**
|
|
@@ -35,8 +41,13 @@ export type UseDocxEditorOptions = {
|
|
|
35
41
|
pagesContainer: Ref<HTMLElement | null>;
|
|
36
42
|
/** Whether the editor is read-only. Reactive. */
|
|
37
43
|
readOnly?: MaybeRefOrGetter<boolean>;
|
|
38
|
-
/**
|
|
39
|
-
|
|
44
|
+
/**
|
|
45
|
+
* The editing engine. Unset, the editor runs the canonical session, which
|
|
46
|
+
* refuses an edit it cannot make yet with a notice, or the legacy session
|
|
47
|
+
* when `collaboration` is a Yjs fragment. `"legacy"` selects the
|
|
48
|
+
* ProseMirror-owned engine.
|
|
49
|
+
*/
|
|
50
|
+
experimentalSession?: MaybeRefOrGetter<EditorSession | undefined>;
|
|
40
51
|
/** Gap between pages in pixels. */
|
|
41
52
|
pageGap?: number;
|
|
42
53
|
/** Whether to paint each page's effective body-content boundary. Reactive. */
|
|
@@ -66,15 +77,19 @@ export type UseDocxEditorOptions = {
|
|
|
66
77
|
externalPlugins?: readonly Plugin[];
|
|
67
78
|
/** Who answers the undo and redo keys. Read once, when the editor is created. */
|
|
68
79
|
historyShortcuts?: HistoryShortcutOwner;
|
|
69
|
-
/**
|
|
70
|
-
|
|
80
|
+
/** A canonical commit was published, with what it did to the undo history. */
|
|
81
|
+
onCanonicalHistory?: (effect: CanonicalHistoryEffect) => void;
|
|
82
|
+
/** A peer's edit dropped local history steps, counted from the bottom. */
|
|
83
|
+
onCanonicalHistoryDrop?: (drop: CanonicalHistoryDrop) => void;
|
|
71
84
|
/**
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
* installed (inert until terms are pushed via `setAnonymizationTermsMeta`),
|
|
75
|
-
* mirroring the React adapter.
|
|
85
|
+
* Reactive collaboration: the canonical room the canonical session joins,
|
|
86
|
+
* or the Yjs fragment a legacy session edits with its binding plugins.
|
|
76
87
|
*/
|
|
77
|
-
|
|
88
|
+
collaboration?: MaybeRefOrGetter<UseDocxEditorCollaboration | CanonicalRoomCollaboration | undefined>;
|
|
89
|
+
/** The terms the editor highlights in the shown text; none when unset. */
|
|
90
|
+
getAnonymizationTerms?: () => readonly FolioAnonymizationTerm[] | undefined;
|
|
91
|
+
/** The fields whose display text the host derives; none when unset. */
|
|
92
|
+
getDerivedFields?: () => FolioDerivedFields | undefined;
|
|
78
93
|
/**
|
|
79
94
|
* Install the template-directive + slash-menu plugins so `{{...}}` markers are
|
|
80
95
|
* scanned and the `/` trigger is active. Reactive: toggling reconfigures the
|
|
@@ -86,6 +101,8 @@ export type UseDocxEditorOptions = {
|
|
|
86
101
|
onSlashMenuChange?: (state: TemplateSlashMenuState) => void;
|
|
87
102
|
/** Resolves a navigation/commit key while the slash menu is open. */
|
|
88
103
|
onSlashMenuKeyAction?: (action: TemplateSlashMenuKeyAction) => boolean;
|
|
104
|
+
/** Called after each change of the inline suggestion, including view teardown. */
|
|
105
|
+
onAutocompleteChange?: (state: FolioAutocompleteState) => void;
|
|
89
106
|
/** Callback on document change (debounced PM → Document model conversion). */
|
|
90
107
|
onChange?: (doc: Document) => void;
|
|
91
108
|
/** Callback on parse / layout / lifecycle error. */
|
|
@@ -154,6 +171,28 @@ export type UseDocxEditorReturn = {
|
|
|
154
171
|
parseError: Ref<string | null>;
|
|
155
172
|
/** Computed page layout, or null before first paint. */
|
|
156
173
|
layout: Ref<Layout | null>;
|
|
174
|
+
/**
|
|
175
|
+
* The document model the editor holds, to derive toolbar and overlay state
|
|
176
|
+
* from: in a canonical session the session's own document, replaced on each
|
|
177
|
+
* edit (read it, never hand it out); otherwise the document the last change
|
|
178
|
+
* notification wrote back. Reading it never builds a document.
|
|
179
|
+
*/
|
|
180
|
+
modelDocument: Readonly<Ref<ReadonlyDocument | null>>;
|
|
181
|
+
/**
|
|
182
|
+
* The session's own document in a canonical session, read without a copy
|
|
183
|
+
* (read it, never write it); otherwise null.
|
|
184
|
+
*/
|
|
185
|
+
readDocumentModel: () => ReadonlyDocument | null;
|
|
186
|
+
/**
|
|
187
|
+
* The bytes the current document was loaded from: replaced when a document
|
|
188
|
+
* is loaded or set, never by an edit.
|
|
189
|
+
*/
|
|
190
|
+
sourceBuffer: Readonly<Ref<ArrayBuffer | null>>;
|
|
191
|
+
/**
|
|
192
|
+
* Width in pixels of the first section's text column, for the hidden editor
|
|
193
|
+
* to lay out its content at; 0 before the first layout pass.
|
|
194
|
+
*/
|
|
195
|
+
hiddenEditorWidth: Ref<number>;
|
|
157
196
|
/** Flow blocks from the latest layout pass — the range-projection fallback. */
|
|
158
197
|
blocks: Ref<FlowBlock[]>;
|
|
159
198
|
/** Measures from the latest layout pass — the range-projection fallback. */
|
|
@@ -165,11 +204,19 @@ export type UseDocxEditorReturn = {
|
|
|
165
204
|
/** Load an already-parsed `Document` directly. */
|
|
166
205
|
loadDocument: (doc: Document) => void;
|
|
167
206
|
/** Serialize the current document to a DOCX blob. */
|
|
168
|
-
save: (options?:
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
207
|
+
save: (options?: FolioSaveOptions) => Promise<Blob | null>;
|
|
208
|
+
/**
|
|
209
|
+
* Build a copy of the current document, in time proportional to its size.
|
|
210
|
+
* For a host that owns the result; derived state reads `modelDocument`.
|
|
211
|
+
*/
|
|
172
212
|
getDocument: () => Document | null;
|
|
213
|
+
/**
|
|
214
|
+
* The current document for a reader, never copied: what `getDocument`
|
|
215
|
+
* copies. In a canonical session it is `readDocumentModel`'s, the session's
|
|
216
|
+
* own document; otherwise the document built from the editor state. Read
|
|
217
|
+
* it, never write it or hand it on.
|
|
218
|
+
*/
|
|
219
|
+
readDocument: () => ReadonlyDocument | null;
|
|
173
220
|
/** Publish a fresh Document object (e.g. after HF materialisation). */
|
|
174
221
|
setDocument: (doc: Document) => void;
|
|
175
222
|
/** Resolve a persistent header/footer EditorView by relationship id. */
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { EditorView } from 'prosemirror-view';
|
|
2
2
|
import { Ref } from 'vue';
|
|
3
|
-
import { OpStory } from '@stll/folio-core/
|
|
4
|
-
import { FolioEditor } from '@stll/folio-core/controller/folioEditor';
|
|
3
|
+
import { OpStory } from '@stll/folio-core/canonical/canonicalOperations';
|
|
4
|
+
import { FolioEditor, FolioSaveOptions } from '@stll/folio-core/controller/folioEditor';
|
|
5
5
|
import { Layout } from '@stll/folio-core/layout-engine';
|
|
6
6
|
import { DisplayMode, EditorReadOnlyReason } from '@stll/folio-core/managers/EditorModeManager';
|
|
7
|
+
import { EditorSession } from '@stll/folio-core/types/canonicalCapabilities';
|
|
7
8
|
import { Comment } from '@stll/folio-core/types/content';
|
|
8
9
|
import { Document } from '@stll/folio-core/types/document';
|
|
10
|
+
import { ReadonlyDocument } from '@stll/folio-core/types/documentModel';
|
|
9
11
|
import { DocxEditorRef } from '../components/DocxEditor/types';
|
|
10
12
|
import { UseFindReplaceReturn } from './useFindReplace';
|
|
11
13
|
type OperationView = Pick<EditorView, "state" | "dispatch">;
|
|
@@ -94,16 +96,16 @@ export type UseDocxEditorRefApiOptions = {
|
|
|
94
96
|
setComments: (comments: Comment[]) => void;
|
|
95
97
|
focus: () => void;
|
|
96
98
|
getDocument: () => Document | null;
|
|
99
|
+
/** The session's own document in a canonical session, without a copy; otherwise null. */
|
|
100
|
+
readDocumentModel: () => ReadonlyDocument | null;
|
|
97
101
|
getActiveView: () => EditorView | null;
|
|
98
|
-
getExperimentalSession?: () =>
|
|
102
|
+
getExperimentalSession?: () => EditorSession | undefined;
|
|
99
103
|
getActiveCanonicalStory?: () => OpStory;
|
|
100
104
|
closeNoteStory: () => void;
|
|
101
105
|
getHeaderFooterView: (rId: string) => EditorView | null;
|
|
102
106
|
setZoom: (zoom: number) => void;
|
|
103
107
|
/** Serialize and commit a host-facing save through useDocxEditor. */
|
|
104
|
-
saveDocument: (options?:
|
|
105
|
-
selective?: boolean;
|
|
106
|
-
}) => Promise<Blob | null>;
|
|
108
|
+
saveDocument: (options?: FolioSaveOptions) => Promise<Blob | null>;
|
|
107
109
|
/**
|
|
108
110
|
* Open the find/replace panel. Backs `openFind` and `openReplace`: the Vue
|
|
109
111
|
* panel has a single open state, so both land here.
|
|
@@ -118,13 +120,9 @@ export type UseDocxEditorRefApiOptions = {
|
|
|
118
120
|
type SaveDocumentForHostOptions = {
|
|
119
121
|
clearCommentsDirty: () => void;
|
|
120
122
|
onSave: ((buffer: ArrayBuffer) => void) | undefined;
|
|
121
|
-
saveDocument: (options?:
|
|
122
|
-
selective?: boolean;
|
|
123
|
-
}) => Promise<Blob | null>;
|
|
123
|
+
saveDocument: (options?: FolioSaveOptions) => Promise<Blob | null>;
|
|
124
124
|
};
|
|
125
|
-
export declare const saveDocumentForHost: (host: SaveDocumentForHostOptions, options?:
|
|
126
|
-
selective?: boolean;
|
|
127
|
-
}) => Promise<ArrayBuffer | null>;
|
|
125
|
+
export declare const saveDocumentForHost: (host: SaveDocumentForHostOptions, options?: FolioSaveOptions) => Promise<ArrayBuffer | null>;
|
|
128
126
|
export declare function useDocxEditorRefApi(opts: UseDocxEditorRefApiOptions): {
|
|
129
127
|
exposed: DocxEditorRef;
|
|
130
128
|
};
|
|
@@ -3,9 +3,8 @@ import { FontDefinition } from '../components/DocxEditor/types';
|
|
|
3
3
|
import { LoadedEmbeddedFonts } from '../utils/embeddedFonts';
|
|
4
4
|
export type UseFontLifecycleOptions = {
|
|
5
5
|
isReady: Ref<boolean>;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
} | null;
|
|
6
|
+
/** The bytes the current document was loaded from, if any. */
|
|
7
|
+
sourceBuffer: () => ArrayBuffer | null;
|
|
9
8
|
fonts: () => ReadonlyArray<FontDefinition> | undefined;
|
|
10
9
|
remeasure: () => void;
|
|
11
10
|
setEmbeddedFontFamilies: (families: ReadonlyMap<string, string> | null) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { MaybeRefOrGetter, Ref } from 'vue';
|
|
2
|
-
export type OutlineSurface = "column" | "rail" | "
|
|
2
|
+
export type OutlineSurface = "column" | "rail" | "expanded";
|
|
3
3
|
type UseOutlineDrawerFocusOptions = {
|
|
4
4
|
surface: MaybeRefOrGetter<OutlineSurface>;
|
|
5
5
|
available: MaybeRefOrGetter<boolean>;
|
|
@@ -11,7 +11,7 @@ export type UsePageSetupControlsOptions = {
|
|
|
11
11
|
* Notified after a direct section-properties write (margins, page size,
|
|
12
12
|
* orientation) so the host's `onChange` fires. These writes bypass the PM
|
|
13
13
|
* transaction pipeline, so this is their only change signal; ruler indent /
|
|
14
|
-
* tab-stop edits
|
|
14
|
+
* tab-stop edits run through the view's command owner and notify via the pipeline instead.
|
|
15
15
|
*/
|
|
16
16
|
onChange: (doc: Document) => void;
|
|
17
17
|
/** Canonical sessions publish section properties through the Document journal. */
|
|
@@ -26,5 +26,5 @@ export declare function usePageSetupControls(opts: UsePageSetupControlsOptions):
|
|
|
26
26
|
handleIndentLeftChange: (twips: number) => void;
|
|
27
27
|
handleIndentRightChange: (twips: number) => void;
|
|
28
28
|
handleFirstLineIndentChange: (twips: number) => void;
|
|
29
|
-
handleTabStopRemove: (
|
|
29
|
+
handleTabStopRemove: (position: number) => void;
|
|
30
30
|
};
|
|
@@ -2,9 +2,10 @@ import { Node as PMNode } from 'prosemirror-model';
|
|
|
2
2
|
import { Command } from 'prosemirror-state';
|
|
3
3
|
import { EditorView } from 'prosemirror-view';
|
|
4
4
|
import { Ref, ShallowRef } from 'vue';
|
|
5
|
-
import { DocumentOp } from '@stll/folio-core/
|
|
5
|
+
import { DocumentOp } from '@stll/folio-core/canonical/canonicalOperations';
|
|
6
6
|
import { NoteStoryKey } from '@stll/folio-core/controller/noteEditorManager';
|
|
7
7
|
import { Layout } from '@stll/folio-core/layout-engine';
|
|
8
|
+
import { EditorSession } from '@stll/folio-core/types/canonicalCapabilities';
|
|
8
9
|
import { Document } from '@stll/folio-core/types/document';
|
|
9
10
|
import { ImageSelectionInfo } from '../components/imageSelectionTypes';
|
|
10
11
|
import { HyperlinkPopupData } from '../components/ui/hyperlinkPopupTypes';
|
|
@@ -47,7 +48,7 @@ export type UsePagesPointerOptions = {
|
|
|
47
48
|
hyperlinkPopupData: Ref<HyperlinkPopupData | null>;
|
|
48
49
|
readOnly: Ref<boolean>;
|
|
49
50
|
showHeaderFooterEditing: Ref<boolean>;
|
|
50
|
-
getExperimentalSession?: () =>
|
|
51
|
+
getExperimentalSession?: () => EditorSession | undefined;
|
|
51
52
|
applyCanonicalOperations?: (operations: readonly DocumentOp[]) => boolean;
|
|
52
53
|
zoom: Ref<number>;
|
|
53
54
|
layout: Ref<Layout | null>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ComputedRef } from 'vue';
|
|
2
2
|
import { Style } from '@stll/folio-core/types/document';
|
|
3
|
+
import { DeepReadonly } from '@stll/folio-core/types/documentModel';
|
|
3
4
|
import { TranslationKey } from '../components/Toolbar/presets';
|
|
4
5
|
import { StylePreviewProps } from '../utils/stylePreview';
|
|
5
6
|
export type ResolvedStyle = {
|
|
@@ -12,7 +13,7 @@ export type UseParagraphStyleOptionsReturn = {
|
|
|
12
13
|
currentStyleLabel: ComputedRef<string>;
|
|
13
14
|
};
|
|
14
15
|
export declare function useParagraphStyleOptions(opts: {
|
|
15
|
-
documentStyles: () => Style[] | undefined;
|
|
16
|
+
documentStyles: () => DeepReadonly<Style[]> | undefined;
|
|
16
17
|
currentStyleId: () => string;
|
|
17
18
|
t: (key: TranslationKey) => string;
|
|
18
19
|
}): UseParagraphStyleOptionsReturn;
|
package/dist/composables.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./useZoom-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./useZoom-7jho8rWN.cjs");let t=require("vue"),n=require("@stll/folio-core/utils/textEncoding"),r=require("prosemirror-history"),i=require("@stll/folio-core/utils/documentPointerDown"),a=require("@stll/folio-core/managers/ClipboardManager"),o=require("@stll/folio-core/utils/clipboard"),s=require("@stll/folio-core/managers/TableSelectionManager"),c=require("@stll/folio-core/prosemirror/utils/visualLineNavigation"),l=require("@stll/folio-core/prosemirror/utils/extractTrackedChanges");function u(e={}){let{onCopy:r,onCut:i,onPaste:a,cleanWordFormatting:s=!0,editable:c=!0,onError:l}=e,u=(0,t.ref)(!1),d=(0,t.ref)(null),f=l?{onError:l}:{};async function p(e){if(u.value)return!1;u.value=!0;try{let t=await(0,o.copyRuns)(e.runs,f);return t&&r?.(e),t}finally{u.value=!1}}async function m(e){if(u.value||!c)return!1;u.value=!0;try{let t=await(0,o.copyRuns)(e.runs,f);return t&&i?.(e),t}finally{u.value=!1}}async function h(e=!1){if(u.value||!c)return null;u.value=!0;try{if(navigator.clipboard&&navigator.clipboard.read){let t=await navigator.clipboard.read(),r=``,i=``;for(let e of t)e.types.includes(`text/html`)&&(r=await(0,n.readBlobText)(await e.getType(`text/html`))),e.types.includes(`text/plain`)&&(i=await(0,n.readBlobText)(await e.getType(`text/plain`)));e&&(r=``);let c=(0,o.parseClipboardHtml)(r,i,s);return d.value=c,a?.(c,e),c}return null}catch(e){return l?.(e instanceof Error?e:Error(String(e))),null}finally{u.value=!1}}return{copy:p,cut:m,paste:h,isProcessing:u,lastPastedContent:d}}function d({isOpen:e,onClose:n,align:r=`left`}){let a=(0,t.ref)(null),o=(0,t.ref)(null),s=(0,t.ref)({position:`fixed`,top:`0px`,left:`0px`,zIndex:1e4});function c(e,t){s.value={position:`fixed`,top:e+`px`,left:t+`px`,zIndex:1e4}}function l(e){let t=e.target;t instanceof Node&&a.value&&!a.value.contains(t)&&o.value&&!o.value.contains(t)&&n()}function u(e){e.key===`Escape`&&n()}function d(e){let t=e.target;t instanceof Node&&o.value&&o.value.contains(t)||n()}let f;function p(){f=(0,i.onDocumentPointerDown)(document,l),document.addEventListener(`keydown`,u),window.addEventListener(`scroll`,d,!0)}function m(){f?.(),f=void 0,document.removeEventListener(`keydown`,u),window.removeEventListener(`scroll`,d,!0)}(0,t.watch)(e,e=>{if(!e){m();return}let t=a.value;if(!t)return;let n=t.getBoundingClientRect();r===`right`?requestAnimationFrame(()=>{let e=o.value;if(e){let t=e.getBoundingClientRect();c(n.bottom+4,n.right-t.width)}else c(n.bottom+4,n.left)}):c(n.bottom+4,n.left),p()}),(0,t.onScopeDispose)(m);function h(e){e.preventDefault(),e.stopPropagation()}return{containerRef:a,dropdownRef:o,dropdownStyle:s,handleMouseDown:h}}function f(e,n){let i=(0,t.computed)(()=>{n.value;let t=e.value;return t?(0,r.undoDepth)(t.state)>0:!1}),a=(0,t.computed)(()=>{n.value;let t=e.value;return t?(0,r.redoDepth)(t.state)>0:!1});function o(){let t=e.value;return t?(0,r.undo)(t.state,t.dispatch):!1}function s(){let t=e.value;return t?(0,r.redo)(t.state,t.dispatch):!1}return{canUndo:i,canRedo:a,undo:o,redo:s}}var p={backgroundColor:`rgba(26, 115, 232, 0.3)`,borderRadius:0,zIndex:0,opacity:1,mixBlendMode:`multiply`};function m(e){let t=window.getSelection();if(!t||t.rangeCount===0||t.isCollapsed)return[];let n=t.getRangeAt(0);if(e&&!e.contains(n.commonAncestorContainer))return[];let r=0,i=0;if(e){let t=e.getBoundingClientRect();r=t.left+e.scrollLeft,i=t.top+e.scrollTop}let a=[];for(let e of n.getClientRects())(e.width!==0||e.height!==0)&&a.push({left:e.left-r,top:e.top-i,width:e.width,height:e.height});return a}function h(e,t=2){if(e.length<=1)return e;let n=[...e].sort((e,n)=>Math.abs(e.top-n.top)<t?e.left-n.left:e.top-n.top),r=n[0];if(!r)return e;let i=[],a={...r};for(let e=1;e<n.length;e++){let r=n[e];if(!r)continue;let o=Math.abs(r.top-a.top)<t,s=r.left<=a.left+a.width+t;if(o&&s){let e=Math.max(a.left+a.width,r.left+r.width);a.width=e-a.left,a.height=Math.max(a.height,r.height)}else i.push(a),a={...r}}return i.push(a),i}function g(e){return h(m(e))}function _(){let e=window.getSelection();return e!==null&&!e.isCollapsed&&e.rangeCount>0}function v(e){let t=window.getSelection();return!t||t.rangeCount===0?!1:e.contains(t.getRangeAt(0).commonAncestorContainer)}var y=`docx-selection-styles`,b=null;function x(){b&&=(b.remove(),null),document.getElementById(y)?.remove()}function S(e=p){x();let t=`
|
|
2
2
|
/* DOCX Editor Selection Highlighting */
|
|
3
3
|
|
|
4
4
|
.docx-editor [contenteditable="true"]::selection,
|
package/dist/composables.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as e, c as t, d as n, i as r, l as i, n as a, o, r as s, s as c, t as l, u } from "./useZoom-
|
|
1
|
+
import { a as e, c as t, d as n, i as r, l as i, n as a, o, r as s, s as c, t as l, u } from "./useZoom-hVxyaoZn.js";
|
|
2
2
|
import { computed as d, onBeforeUnmount as f, onMounted as p, onScopeDispose as m, ref as h, watch as g } from "vue";
|
|
3
3
|
import { readBlobText as _ } from "@stll/folio-core/utils/textEncoding";
|
|
4
4
|
import { redo as v, redoDepth as y, undo as b, undoDepth as x } from "prosemirror-history";
|
package/dist/dialogs.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./SplitCellDialog-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./SplitCellDialog-Bc2TjxMb.cjs");exports.FindReplaceDialog=e.m,exports.FootnotePropertiesDialog=e.s,exports.HyperlinkDialog=e.p,exports.ImagePositionDialog=e.o,exports.ImagePropertiesDialog=e.f,exports.InsertImageDialog=e.a,exports.InsertSymbolDialog=e.d,exports.InsertTableDialog=e.r,exports.PageSetupDialog=e.u,exports.PasteSpecialDialog=e.n,exports.SplitCellDialog=e.t,exports.TablePropertiesDialog=e.l,exports.WatermarkDialog=e.c;
|
package/dist/dialogs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { m as FindReplaceDialog, s as FootnotePropertiesDialog, p as HyperlinkDialog, o as ImagePositionDialog, f as ImagePropertiesDialog, a as InsertImageDialog, d as InsertSymbolDialog, r as InsertTableDialog, u as PageSetupDialog, n as PasteSpecialDialog, t as SplitCellDialog, l as TablePropertiesDialog, c as WatermarkDialog } from "./SplitCellDialog-
|
|
1
|
+
export { m as FindReplaceDialog, s as FootnotePropertiesDialog, p as HyperlinkDialog, o as ImagePositionDialog, f as ImagePropertiesDialog, a as InsertImageDialog, d as InsertSymbolDialog, r as InsertTableDialog, u as PageSetupDialog, n as PasteSpecialDialog, t as SplitCellDialog, l as TablePropertiesDialog, c as WatermarkDialog } from "./SplitCellDialog-DULmbU_P.js";
|