@stll/folio-vue 0.21.1 → 0.22.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/dist/ListButtons-DIWR-Q8d.cjs +4 -0
- package/dist/{ListButtons-CSyBR9KM.js → ListButtons-DjLPhg8p.js} +398 -379
- package/dist/{SplitCellDialog-NOmSMMla.cjs → SplitCellDialog-B_z6ynxm.cjs} +2 -2
- package/dist/components/DocxEditor/types.d.ts +2 -0
- package/dist/composables/useCommentManagement.d.ts +2 -0
- package/dist/composables/useDocxEditor.d.ts +2 -0
- package/dist/composables/useDocxEditorRefApi.d.ts +3 -2
- package/dist/composables/usePageSetupControls.d.ts +2 -0
- package/dist/composables/usePagesPointer.d.ts +3 -0
- package/dist/composables/useTransientNotice.d.ts +5 -0
- package/dist/composables.cjs +1 -1
- package/dist/composables.js +1 -1
- package/dist/dialogs.cjs +1 -1
- package/dist/folio-vue.css +1 -1
- package/dist/i18n/messages/ar.d.ts +1 -0
- package/dist/i18n/messages/cs.d.ts +1 -0
- package/dist/i18n/messages/de.d.ts +1 -0
- package/dist/i18n/messages/en.d.ts +1 -0
- package/dist/i18n/messages/es.d.ts +1 -0
- package/dist/i18n/messages/et.d.ts +1 -0
- package/dist/i18n/messages/fr.d.ts +1 -0
- package/dist/i18n/messages/he.d.ts +1 -0
- package/dist/i18n/messages/hi.d.ts +1 -0
- package/dist/i18n/messages/hu.d.ts +1 -0
- package/dist/i18n/messages/locales.d.ts +1 -0
- package/dist/i18n/messages/lt.d.ts +1 -0
- package/dist/i18n/messages/lv.d.ts +1 -0
- package/dist/i18n/messages/pl.d.ts +1 -0
- package/dist/i18n/messages/pt-BR.d.ts +1 -0
- package/dist/i18n/messages/sk.d.ts +1 -0
- package/dist/i18n/messages/tr.d.ts +1 -0
- package/dist/i18n/messages/zh-CN.d.ts +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +1496 -1362
- package/dist/messages/ar.cjs +1 -0
- package/dist/messages/ar.js +2 -0
- package/dist/messages/cs.cjs +1 -0
- package/dist/messages/cs.js +2 -0
- package/dist/messages/de.cjs +1 -0
- package/dist/messages/de.js +2 -0
- package/dist/messages/en.cjs +1 -0
- package/dist/messages/en.js +2 -0
- package/dist/messages/es.cjs +1 -0
- package/dist/messages/es.js +2 -0
- package/dist/messages/et.cjs +1 -0
- package/dist/messages/et.js +2 -0
- package/dist/messages/fr.cjs +1 -0
- package/dist/messages/fr.js +2 -0
- package/dist/messages/he.cjs +1 -0
- package/dist/messages/he.js +2 -0
- package/dist/messages/hi.cjs +1 -0
- package/dist/messages/hi.js +2 -0
- package/dist/messages/hu.cjs +1 -0
- package/dist/messages/hu.js +2 -0
- package/dist/messages/locales.cjs +1 -0
- package/dist/messages/locales.js +2 -0
- package/dist/messages/lt.cjs +1 -0
- package/dist/messages/lt.js +2 -0
- package/dist/messages/lv.cjs +1 -0
- package/dist/messages/lv.js +2 -0
- package/dist/messages/pl.cjs +1 -0
- package/dist/messages/pl.js +2 -0
- package/dist/messages/pt-BR.cjs +1 -0
- package/dist/messages/pt-BR.js +2 -0
- package/dist/messages/sk.cjs +1 -0
- package/dist/messages/sk.js +2 -0
- package/dist/messages/tr.cjs +1 -0
- package/dist/messages/tr.js +2 -0
- package/dist/messages/zh-CN.cjs +1 -0
- package/dist/messages/zh-CN.js +2 -0
- package/dist/rolldown-runtime-C6qsp3rV.cjs +1 -0
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +1 -1
- package/dist/useZoom-BT2c88KW.cjs +1 -0
- package/dist/{useZoom-C75jJC2q.js → useZoom-BycIz5VE.js} +324 -283
- package/dist/utils/domQueries.d.ts +2 -6
- package/dist/utils/viewportPosition.d.ts +11 -0
- package/package.json +8 -3
- package/dist/ListButtons-BSRd6dsB.cjs +0 -4
- package/dist/useZoom-Df8U8Fko.cjs +0 -1
|
@@ -1,58 +1,61 @@
|
|
|
1
1
|
import { computed as e, inject as t, onBeforeUnmount as n, onMounted as r, onScopeDispose as i, provide as a, ref as o, shallowRef as s, toValue as c, watch as l, watchEffect as u } from "vue";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
2
|
+
import { TRANSACTION_LAYOUT_TIMING as d, browserClock as f, createLayoutScheduler as p } from "@stll/folio-core/controller/layoutScheduler";
|
|
3
|
+
import { CanonicalSessionRefusalError as m, collectRemoteSelections as h, createHiddenEditorManager as g, createHiddenEditorState as _ } from "@stll/folio-core/controller/hiddenEditorManager";
|
|
4
|
+
import { cloneDocumentWithParagraphPropertySources as ee } from "@stll/folio-core/docx/document-clone";
|
|
5
|
+
import { getMargins as te, getPageSize as ne, twipsToPixels as v } from "@stll/folio-core/paged-layout/sectionGeometry";
|
|
6
|
+
import { getEditorScrollRoot as re, scrollEditorBy as ie } from "@stll/folio-core/paged-layout/editorScrollRoot";
|
|
7
|
+
import { createAnonymizationDecorationsPlugin as ae } from "@stll/folio-core/prosemirror/plugins/anonymizationDecorations";
|
|
8
|
+
import { autocompleteSuggestionPlugin as oe } from "@stll/folio-core/prosemirror/plugins/autocompleteSuggestion";
|
|
9
|
+
import { createTemplateDirectivesPlugin as se } from "@stll/folio-core/prosemirror/plugins/templateDirectives";
|
|
10
|
+
import { createSuggestionModePlugin as ce, setSuggestionMode as le } from "@stll/folio-core/prosemirror/plugins/suggestionMode";
|
|
11
|
+
import { FOLIO_DOCX_SERIALIZATION_MODE as ue, createFolioEditor as de } from "@stll/folio-core/controller/folioEditor";
|
|
12
|
+
import { createFolioEditorEmitter as fe } from "@stll/folio-core/controller/folioEditorEvents";
|
|
13
|
+
import { prepareCanonicalDocxInput as pe } from "@stll/folio-core/docx/canonicalSessionInput";
|
|
14
|
+
import { repackWithCanonicalStoryRemovals as me } from "@stll/folio-core/docx/canonicalStoryRepack";
|
|
15
|
+
import { loadCollaborationModules as he } from "@stll/folio-core/controller/collaborationModules";
|
|
16
|
+
import { createHeaderFooterEditorManager as ge } from "@stll/folio-core/controller/headerFooterEditorManager";
|
|
17
|
+
import { createNoteEditorManager as _e } from "@stll/folio-core/controller/noteEditorManager";
|
|
18
|
+
import { runLayoutPipeline as ve } from "@stll/folio-core/controller/layoutPipeline";
|
|
19
|
+
import { createHyphenationReadiness as ye } from "@stll/folio-core/controller/hyphenationReadiness";
|
|
20
|
+
import { readFontSetSignature as be, waitForInitialLayoutFonts as xe, watchLayoutFontLoads as Se } from "@stll/folio-core/controller/fontReadiness";
|
|
21
|
+
import { createLayoutSession as Ce } from "@stll/folio-core/controller/layoutSession";
|
|
22
|
+
import { parseDocx as we } from "@stll/folio-core/docx/parser";
|
|
23
|
+
import { getFootnoteText as Te } from "@stll/folio-core/docx/footnoteParser";
|
|
24
|
+
import { convertHeaderFooterPmDocToContent as Ee, convertHeaderFooterToContent as De } from "@stll/folio-core/layout-bridge/convert/headerFooterLayout";
|
|
25
|
+
import { resolveSectionHeaderFooterRefs as Oe } from "@stll/folio-core/layout-engine";
|
|
26
|
+
import { LayoutPainter as ke } from "@stll/folio-core/layout-painter";
|
|
27
|
+
import { LayoutSelectionGate as Ae } from "@stll/folio-core/paged-layout/LayoutSelectionGate";
|
|
28
|
+
import { fromProseDoc as je } from "@stll/folio-core/prosemirror/conversion/fromProseDoc";
|
|
29
|
+
import { createNoteReferenceFollower as Me, withoutUnreferencedNotes as Ne } from "@stll/folio-core/prosemirror/noteReferenceReview";
|
|
30
|
+
import { ExtensionManager as Pe } from "@stll/folio-core/prosemirror/extensions/ExtensionManager";
|
|
31
|
+
import { getChangedParagraphIds as Fe, hasStructuralChanges as Ie, hasUntrackedChanges as Le, repackWithEditorSectionRemovals as Re } from "@stll/folio-core/prosemirror/extensions/features/ParagraphChangeTrackerExtension";
|
|
32
|
+
import { createStarterKit as ze } from "@stll/folio-core/prosemirror/extensions/StarterKit";
|
|
33
|
+
import { createTemplatePreviewValuesPlugin as Be } from "@stll/folio-core/prosemirror/plugins/templatePreviewValues";
|
|
34
|
+
import { templateSlashMenuPlugin as Ve } from "@stll/folio-core/prosemirror/plugins/templateSlashMenu";
|
|
35
|
+
import { resolveHeaderFooterContent as He } from "@stll/folio-core/utils/headerFooter";
|
|
36
|
+
import { MIN_CELL_WIDTH_TWIPS as y, MIN_ROW_HEIGHT_TWIPS as b, TWIPS_PER_PIXEL as x, commitColumnResize as Ue, commitRightEdgeResize as We, commitRowResize as S, readColumnWidthAt as Ge, readColumnWidths as Ke, readRowHeight as qe } from "@stll/folio-core/prosemirror/tableResize";
|
|
37
|
+
import { extractTrackedChanges as Je } from "@stll/folio-core/prosemirror/utils/extractTrackedChanges";
|
|
38
|
+
import { ZOOM_MAX as Ye, ZOOM_MIN as C, ZOOM_STEP as w } from "@stll/folio-core/utils/zoom";
|
|
36
39
|
//#region src/utils/colorMode.ts
|
|
37
|
-
var
|
|
38
|
-
function
|
|
40
|
+
var Xe = "(prefers-color-scheme: dark)";
|
|
41
|
+
function Ze() {
|
|
39
42
|
return typeof window < "u" && typeof window.matchMedia == "function";
|
|
40
43
|
}
|
|
41
|
-
function
|
|
44
|
+
function Qe(e, t) {
|
|
42
45
|
return e === "dark" || e === "system" && t;
|
|
43
46
|
}
|
|
44
|
-
function
|
|
45
|
-
if (!
|
|
46
|
-
let t = window.matchMedia(
|
|
47
|
+
function $e(e) {
|
|
48
|
+
if (!Ze()) return () => {};
|
|
49
|
+
let t = window.matchMedia(Xe);
|
|
47
50
|
e(t.matches);
|
|
48
51
|
let n = (t) => e(t.matches);
|
|
49
52
|
return t.addEventListener("change", n), () => t.removeEventListener("change", n);
|
|
50
53
|
}
|
|
51
54
|
//#endregion
|
|
52
55
|
//#region src/composables/useColorMode.ts
|
|
53
|
-
var T = "light", E = Symbol("folioColorMode"),
|
|
56
|
+
var T = "light", E = Symbol("folioColorMode"), et = (t = T) => {
|
|
54
57
|
a(E, e(() => c(t)));
|
|
55
|
-
},
|
|
58
|
+
}, tt = { install(t, n = T) {
|
|
56
59
|
t.provide(E, e(() => c(n)));
|
|
57
60
|
} };
|
|
58
61
|
function D() {
|
|
@@ -60,42 +63,42 @@ function D() {
|
|
|
60
63
|
return r(() => {
|
|
61
64
|
i.value = !0;
|
|
62
65
|
}), u((e) => {
|
|
63
|
-
!i.value || n.value !== "system" || e(
|
|
66
|
+
!i.value || n.value !== "system" || e($e((e) => {
|
|
64
67
|
a.value = e;
|
|
65
68
|
}));
|
|
66
|
-
}), e(() =>
|
|
69
|
+
}), e(() => Qe(n.value, i.value && a.value));
|
|
67
70
|
}
|
|
68
71
|
//#endregion
|
|
69
72
|
//#region src/composables/useDocxEditor.ts
|
|
70
|
-
var
|
|
71
|
-
function
|
|
73
|
+
var nt = 24, rt = 250, it = [], at = [];
|
|
74
|
+
function ot(e) {
|
|
72
75
|
let t = e?.columnCount ?? 1;
|
|
73
76
|
if (t <= 1) return;
|
|
74
77
|
let n = {
|
|
75
78
|
count: t,
|
|
76
|
-
gap:
|
|
79
|
+
gap: v(e?.columnSpace ?? 720),
|
|
77
80
|
equalWidth: e?.equalWidth ?? !0
|
|
78
81
|
};
|
|
79
82
|
return e?.separator !== void 0 && (n.separator = e.separator), n;
|
|
80
83
|
}
|
|
81
|
-
function
|
|
84
|
+
function st(e, t, n, r, i, a) {
|
|
82
85
|
if (!e) return;
|
|
83
86
|
let o = t ? {
|
|
84
87
|
...a,
|
|
85
88
|
rId: t
|
|
86
89
|
} : a, s = t ? n?.getView(t) : null;
|
|
87
|
-
return s ?
|
|
90
|
+
return s ? Ee(s.state.doc, r, i, o) : De(e, r, i, o);
|
|
88
91
|
}
|
|
89
|
-
function
|
|
92
|
+
function ct(e, t, n, r, i) {
|
|
90
93
|
if (!e || e.size === 0) return;
|
|
91
94
|
let a = /* @__PURE__ */ new Map();
|
|
92
95
|
for (let [o, s] of e) {
|
|
93
|
-
let e =
|
|
96
|
+
let e = st(s, o, t, n, r, i);
|
|
94
97
|
e && a.set(o, e);
|
|
95
98
|
}
|
|
96
99
|
return a.size > 0 ? a : void 0;
|
|
97
100
|
}
|
|
98
|
-
function
|
|
101
|
+
function lt(e, t, n) {
|
|
99
102
|
let r = /* @__PURE__ */ new Map();
|
|
100
103
|
if (!n || !n.package.footnotes) return r;
|
|
101
104
|
let i = /* @__PURE__ */ new Map();
|
|
@@ -109,7 +112,7 @@ function it(e, t, n) {
|
|
|
109
112
|
e.push({
|
|
110
113
|
displayNumber: String(o),
|
|
111
114
|
noteId: n,
|
|
112
|
-
text:
|
|
115
|
+
text: Te(r),
|
|
113
116
|
...a ? { content: {
|
|
114
117
|
blocks: a.blocks,
|
|
115
118
|
measures: a.measures,
|
|
@@ -140,7 +143,7 @@ var O = /* @__PURE__ */ new Set([
|
|
|
140
143
|
"white",
|
|
141
144
|
"yellow"
|
|
142
145
|
]);
|
|
143
|
-
function
|
|
146
|
+
function ut(e) {
|
|
144
147
|
let t = [], n = (e, r) => {
|
|
145
148
|
for (let [n, i] of e.marks.entries()) i.type.name === "highlight" && !O.has(String(i.attrs.color)) && t.push(`${r}.marks[${n}]=${JSON.stringify(i.attrs)}`);
|
|
146
149
|
e.forEach((e, t, i) => {
|
|
@@ -150,44 +153,53 @@ function at(e) {
|
|
|
150
153
|
return n(e, "doc"), t.join("; ");
|
|
151
154
|
}
|
|
152
155
|
function k(e) {
|
|
153
|
-
let { hiddenContainer: t, hiddenHeaderFooterContainer: n, noteEditorContainer: r, pagesContainer: a, readOnly: u = !1, pageGap:
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
156
|
+
let { hiddenContainer: t, hiddenHeaderFooterContainer: n, noteEditorContainer: r, pagesContainer: a, readOnly: u = !1, experimentalSession: v, pageGap: re = nt, pageRenderer: ie, markupView: Te = "all-markup", showMarginGuides: Ee, marginGuideColor: De, password: y, editorMode: b, author: x, externalPlugins: Ue = [], historyShortcuts: We = "editor", collaboration: S, onAnonymizationMatchesChange: Ge, showTemplateDirectives: Ke, onSlashMenuChange: qe, onSlashMenuKeyAction: Je, onChange: Ye, onError: C, onSelectionUpdate: w, onEditorViewReady: Xe, onCopy: Ze, onCut: Qe, onPaste: $e, onReadOnlyEditAttempt: T, featureFlags: E, onSelectiveSaveTripwire: et } = e, tt = n ?? t, D = s(null), O = 0, k = !1, A = 0, j = !1, M = s(null), N = s(null), P = s(null), F = s([]), I = s(null), L = s(null), R = s(null), dt = s([]), ft = s([]), z = o(!1), B = o(null), V = o(!1), pt = () => c(v) === "canonical", H = (e) => pt() ? ee(e) : e, mt = (e) => {
|
|
157
|
+
if (!pt()) return !1;
|
|
158
|
+
let t = new m({ message: e });
|
|
159
|
+
return C?.(t), !0;
|
|
160
|
+
}, U = new Pe(ze({ historyShortcuts: We }));
|
|
161
|
+
U.buildSchema(), U.initializeRuntime();
|
|
162
|
+
let ht = ce(!1), gt = [ht], _t = oe({ keymap: !0 }), vt = ae({ onMatchesChange: (e) => Ge?.(e) }), yt = se(), bt = Ve({
|
|
163
|
+
onChange: (e) => qe?.(e),
|
|
164
|
+
onKeyAction: (e) => Je?.(e) ?? !1
|
|
165
|
+
}), xt = Be(), St = () => c(Ke) === !0;
|
|
166
|
+
function Ct() {
|
|
160
167
|
return [
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
...
|
|
168
|
+
_t,
|
|
169
|
+
ht,
|
|
170
|
+
...Ue,
|
|
164
171
|
...c(S)?.plugins ?? [],
|
|
165
|
-
|
|
166
|
-
...
|
|
167
|
-
|
|
172
|
+
vt,
|
|
173
|
+
...St() ? [yt, bt] : [],
|
|
174
|
+
xt
|
|
168
175
|
];
|
|
169
176
|
}
|
|
170
|
-
let W =
|
|
177
|
+
let W = fe(), G = new Ae(), wt = Ce(), Tt = ye({
|
|
171
178
|
relayout: () => {
|
|
172
|
-
let e = M.value?.state ??
|
|
179
|
+
let e = M.value?.state ?? wt.lastEditorState;
|
|
173
180
|
e && Y(e, { reason: "hyphenation-ready" });
|
|
174
181
|
},
|
|
175
182
|
onError: (e) => C?.(e)
|
|
176
183
|
});
|
|
177
|
-
i(
|
|
178
|
-
measuredFontSet: () =>
|
|
184
|
+
i(Tt.cancel), i(Se({
|
|
185
|
+
measuredFontSet: () => wt.lastMeasureInputs?.fontSet ?? null,
|
|
179
186
|
relayout: () => {
|
|
180
187
|
if (j) return;
|
|
181
|
-
let e = M.value?.state ??
|
|
188
|
+
let e = M.value?.state ?? wt.lastEditorState;
|
|
182
189
|
e && Y(e, { reason: "font-ready" });
|
|
183
190
|
}
|
|
184
191
|
}));
|
|
185
|
-
let
|
|
186
|
-
pageGap:
|
|
192
|
+
let Et = new ke({
|
|
193
|
+
pageGap: re,
|
|
187
194
|
showShadow: !0
|
|
188
|
-
}),
|
|
189
|
-
getHost: () =>
|
|
190
|
-
getDocument: () => D.value,
|
|
195
|
+
}), K = ge({
|
|
196
|
+
getHost: () => tt.value,
|
|
197
|
+
getDocument: () => Q.api.getCanonicalDocument() ?? D.value,
|
|
198
|
+
getCanonicalApi: () => Q.api,
|
|
199
|
+
getExperimentalSession: () => c(v),
|
|
200
|
+
onSessionRefusal: (e) => {
|
|
201
|
+
B.value = e, C?.(new m({ message: e }));
|
|
202
|
+
},
|
|
191
203
|
getStyles: () => D.value?.package.styles ?? null,
|
|
192
204
|
getTheme: () => D.value?.package.theme ?? null,
|
|
193
205
|
onTransaction: ({ rId: e, kind: t, view: n, docChanged: r, selectionChanged: i }) => {
|
|
@@ -205,10 +217,15 @@ function k(e) {
|
|
|
205
217
|
}
|
|
206
218
|
G.requestRender();
|
|
207
219
|
}
|
|
208
|
-
}),
|
|
220
|
+
}), Dt = { current: null }, q = _e({
|
|
209
221
|
getHost: () => r?.value ?? null,
|
|
210
|
-
getPlugins: () =>
|
|
211
|
-
getDocument: () => D.value,
|
|
222
|
+
getPlugins: () => gt,
|
|
223
|
+
getDocument: () => Q.api.getCanonicalDocument() ?? D.value,
|
|
224
|
+
getCanonicalApi: () => Q.api,
|
|
225
|
+
getExperimentalSession: () => c(v),
|
|
226
|
+
onSessionRefusal: (e) => {
|
|
227
|
+
B.value = e, C?.(new m({ message: e }));
|
|
228
|
+
},
|
|
212
229
|
getStyles: () => D.value?.package.styles ?? null,
|
|
213
230
|
getTheme: () => D.value?.package.theme ?? null,
|
|
214
231
|
onTransaction: ({ docChanged: e, selectionChanged: t, view: n }) => {
|
|
@@ -216,8 +233,8 @@ function k(e) {
|
|
|
216
233
|
V.value = !0;
|
|
217
234
|
let e = D.value;
|
|
218
235
|
if (e) {
|
|
219
|
-
let t =
|
|
220
|
-
D.value = t,
|
|
236
|
+
let t = Q.api.getCanonicalDocument() ?? Dt.current?.snapshotDocument(e) ?? e;
|
|
237
|
+
D.value = t, Ye?.(H(t)), W.emit("docChange", H(t));
|
|
221
238
|
}
|
|
222
239
|
X.schedule();
|
|
223
240
|
}
|
|
@@ -231,96 +248,106 @@ function k(e) {
|
|
|
231
248
|
}
|
|
232
249
|
}
|
|
233
250
|
});
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
251
|
+
Dt.current = q;
|
|
252
|
+
let J = () => {
|
|
253
|
+
K.sync(), q.sync();
|
|
254
|
+
};
|
|
255
|
+
l(() => c(v), J);
|
|
256
|
+
function Ot(e) {
|
|
257
|
+
e.layout && (R.value = e.layout), e.blocks && (dt.value = e.blocks), e.measures && (ft.value = e.measures), e.blockLookup && Et.setBlockLookup(e.blockLookup), e.layout && W.emit("layoutComplete", e.layout);
|
|
237
258
|
}
|
|
238
259
|
function Y(e, t = {}) {
|
|
239
260
|
if (j) return;
|
|
240
|
-
let n = a.value, r = n instanceof HTMLDivElement ? n : null, i = D.value, o = i?.package.document, s = o?.sections?.[0]?.properties ?? o?.finalSectionProperties ?? null, l =
|
|
261
|
+
let n = a.value, r = n instanceof HTMLDivElement ? n : null, i = D.value, o = i?.package.document, s = o?.sections?.[0]?.properties ?? o?.finalSectionProperties ?? null, l = ne(s), u = te(s), d = ot(s), f = l.w - u.left - u.right, p = i?.package.styles ?? null, m = i?.package.theme ?? null, h = i?.package.settings?.defaultTabStop, g = i?.package.settings?.mirrorMargins === !0, _ = He(i?.package);
|
|
241
262
|
try {
|
|
242
|
-
|
|
243
|
-
contentWidth:
|
|
244
|
-
columns:
|
|
263
|
+
Ot(ve({
|
|
264
|
+
contentWidth: f,
|
|
265
|
+
columns: d,
|
|
245
266
|
pageSize: l,
|
|
246
267
|
margins: u,
|
|
247
|
-
pageGap:
|
|
248
|
-
showMarginGuides: c(
|
|
249
|
-
marginGuideColor: c(
|
|
268
|
+
pageGap: re,
|
|
269
|
+
showMarginGuides: c(Ee) === !0,
|
|
270
|
+
marginGuideColor: c(De),
|
|
250
271
|
...(() => {
|
|
251
|
-
let e = c(
|
|
272
|
+
let e = c(ie);
|
|
252
273
|
return e === void 0 ? {} : { pageRenderer: e };
|
|
253
274
|
})(),
|
|
254
275
|
syncCoordinator: G,
|
|
255
|
-
headerContent:
|
|
256
|
-
footerContent:
|
|
257
|
-
firstPageHeaderContent:
|
|
258
|
-
firstPageFooterContent:
|
|
259
|
-
headerContentRId:
|
|
260
|
-
footerContentRId:
|
|
261
|
-
firstPageHeaderContentRId:
|
|
262
|
-
firstPageFooterContentRId:
|
|
263
|
-
sectionHeaderFooterRefs:
|
|
264
|
-
theme:
|
|
276
|
+
headerContent: _.headerContent,
|
|
277
|
+
footerContent: _.footerContent,
|
|
278
|
+
firstPageHeaderContent: _.firstPageHeaderContent,
|
|
279
|
+
firstPageFooterContent: _.firstPageFooterContent,
|
|
280
|
+
headerContentRId: _.activeHeaderRId,
|
|
281
|
+
footerContentRId: _.activeFooterRId,
|
|
282
|
+
firstPageHeaderContentRId: _.activeFirstHeaderRId,
|
|
283
|
+
firstPageFooterContentRId: _.activeFirstFooterRId,
|
|
284
|
+
sectionHeaderFooterRefs: Oe(i),
|
|
285
|
+
theme: m,
|
|
265
286
|
sectionProperties: s,
|
|
266
287
|
document: i,
|
|
267
|
-
defaultTabStop:
|
|
268
|
-
mirrorMargins:
|
|
269
|
-
styles:
|
|
288
|
+
defaultTabStop: h,
|
|
289
|
+
mirrorMargins: g,
|
|
290
|
+
styles: p,
|
|
270
291
|
layout: R.value,
|
|
271
|
-
hfPMs:
|
|
272
|
-
painter:
|
|
292
|
+
hfPMs: K,
|
|
293
|
+
painter: Et,
|
|
273
294
|
pagesContainer: r,
|
|
274
|
-
session:
|
|
275
|
-
renderHfFromContentOrPm:
|
|
276
|
-
renderHeaderFooterContentByRId:
|
|
277
|
-
readFontSetSignature:
|
|
278
|
-
buildFootnoteRenderItems:
|
|
279
|
-
describeInvalidHighlightMarks:
|
|
280
|
-
emptyTemplatePreviewEntries:
|
|
281
|
-
emptyTemplatePreviewHidden:
|
|
282
|
-
hyphenationReadiness:
|
|
283
|
-
markupView: c(
|
|
295
|
+
session: wt,
|
|
296
|
+
renderHfFromContentOrPm: st,
|
|
297
|
+
renderHeaderFooterContentByRId: ct,
|
|
298
|
+
readFontSetSignature: be,
|
|
299
|
+
buildFootnoteRenderItems: lt,
|
|
300
|
+
describeInvalidHighlightMarks: ut,
|
|
301
|
+
emptyTemplatePreviewEntries: it,
|
|
302
|
+
emptyTemplatePreviewHidden: at,
|
|
303
|
+
hyphenationReadiness: Tt,
|
|
304
|
+
markupView: c(Te)
|
|
284
305
|
}, e, t));
|
|
285
306
|
} catch (e) {
|
|
286
307
|
let t = e instanceof Error ? e : Error(String(e));
|
|
287
308
|
C?.(t);
|
|
288
309
|
}
|
|
289
310
|
}
|
|
290
|
-
let X =
|
|
311
|
+
let X = p({
|
|
291
312
|
readState: () => M.value?.state ?? null,
|
|
292
313
|
runLayout: (e, t) => Y(e, t),
|
|
293
|
-
...
|
|
294
|
-
clock:
|
|
295
|
-
}), Z = null,
|
|
296
|
-
function
|
|
314
|
+
...d,
|
|
315
|
+
clock: f
|
|
316
|
+
}), Z = null, kt = Me();
|
|
317
|
+
function At() {
|
|
297
318
|
Z !== null && (window.clearTimeout(Z), Z = null);
|
|
298
319
|
let e = M.value, t = D.value;
|
|
299
320
|
if (!(!e || !t)) try {
|
|
300
|
-
let n =
|
|
301
|
-
D.value = n,
|
|
321
|
+
let n = Q.api.getCanonicalDocument() ?? kt.reconcile(je(e.state.doc, t), e.state.doc);
|
|
322
|
+
D.value = n, J(), Ye?.(H(n)), W.emit("docChange", H(n));
|
|
302
323
|
} catch (e) {
|
|
303
324
|
C?.(e instanceof Error ? e : Error(String(e)));
|
|
304
325
|
}
|
|
305
326
|
}
|
|
306
|
-
function
|
|
327
|
+
function jt() {
|
|
307
328
|
Z !== null && window.clearTimeout(Z), Z = window.setTimeout(() => {
|
|
308
|
-
Z = null,
|
|
309
|
-
},
|
|
329
|
+
Z = null, At();
|
|
330
|
+
}, rt);
|
|
310
331
|
}
|
|
311
|
-
let Q =
|
|
332
|
+
let Q = g({
|
|
312
333
|
getHost: () => t.value,
|
|
313
334
|
getDocument: () => D.value,
|
|
314
335
|
getStyles: () => D.value?.package.styles ?? null,
|
|
315
|
-
getExtensionManager: () =>
|
|
316
|
-
getExternalPlugins:
|
|
336
|
+
getExtensionManager: () => U,
|
|
337
|
+
getExternalPlugins: Ct,
|
|
317
338
|
getCollaboration: () => c(S),
|
|
318
339
|
getCollaborationModules: () => P.value,
|
|
319
340
|
getPrecomputedInitialState: () => null,
|
|
320
341
|
getReadOnly: () => c(u),
|
|
342
|
+
getExperimentalSession: () => c(v),
|
|
343
|
+
getEditingMode: () => c(b) ?? "editing",
|
|
344
|
+
getSuggestionAuthor: () => c(x) ?? "User",
|
|
345
|
+
onSessionRefusal: (e) => {
|
|
346
|
+
C?.(new m({ message: e }));
|
|
347
|
+
},
|
|
321
348
|
getDocumentIdentity: () => String(O),
|
|
322
349
|
getDocumentContext: () => D.value,
|
|
323
|
-
onTransaction:
|
|
350
|
+
onTransaction: Nt,
|
|
324
351
|
onSelectionChange: (e) => {
|
|
325
352
|
N.value = e, w?.(e), W.emit("selectionChange", {
|
|
326
353
|
from: e.selection.from,
|
|
@@ -328,20 +355,20 @@ function k(e) {
|
|
|
328
355
|
});
|
|
329
356
|
},
|
|
330
357
|
onKeyDown: () => !1,
|
|
331
|
-
onCopy: () =>
|
|
332
|
-
onCut: () =>
|
|
333
|
-
onPaste: () =>
|
|
358
|
+
onCopy: () => Ze?.(),
|
|
359
|
+
onCut: () => Qe?.(),
|
|
360
|
+
onPaste: () => $e?.(),
|
|
334
361
|
onReadOnlyEditAttempt: () => T?.(),
|
|
335
|
-
onEditorViewReady:
|
|
362
|
+
onEditorViewReady: Pt,
|
|
336
363
|
onEditorViewDestroy: () => {
|
|
337
|
-
M.value = null, z.value = !1,
|
|
364
|
+
M.value = null, z.value = !1, Xe?.(null);
|
|
338
365
|
},
|
|
339
366
|
onRemoteSelectionsChange: (e) => {
|
|
340
367
|
F.value = e;
|
|
341
368
|
}
|
|
342
|
-
}),
|
|
369
|
+
}), Mt = () => {
|
|
343
370
|
let e = c(S)?.awareness, t = P.value, n = Q.getView();
|
|
344
|
-
F.value = e && t && n ?
|
|
371
|
+
F.value = e && t && n ? h(n.state, e, t) : [];
|
|
345
372
|
};
|
|
346
373
|
l(() => c(S), (e, t, n) => {
|
|
347
374
|
if (F.value = [], !e) {
|
|
@@ -351,8 +378,8 @@ function k(e) {
|
|
|
351
378
|
let r = !1;
|
|
352
379
|
n(() => {
|
|
353
380
|
r = !0;
|
|
354
|
-
}), P.value = null,
|
|
355
|
-
r || (P.value = e, Q.retryViewCreation(), Q.syncExternalDocument(),
|
|
381
|
+
}), P.value = null, he().then((e) => {
|
|
382
|
+
r || (P.value = e, Q.retryViewCreation(), Q.syncExternalDocument(), Mt());
|
|
356
383
|
}, (e) => {
|
|
357
384
|
r || (P.value = null, C?.(e instanceof Error ? e : Error(String(e))));
|
|
358
385
|
});
|
|
@@ -365,78 +392,82 @@ function k(e) {
|
|
|
365
392
|
F.value = [];
|
|
366
393
|
return;
|
|
367
394
|
}
|
|
368
|
-
e.on("change",
|
|
369
|
-
e.off("change",
|
|
395
|
+
e.on("change", Mt), Mt(), i(() => {
|
|
396
|
+
e.off("change", Mt), F.value = [];
|
|
370
397
|
});
|
|
371
398
|
}, { flush: "post" });
|
|
372
|
-
function
|
|
399
|
+
function Nt({ newState: e, docChanged: t, transactions: n }) {
|
|
373
400
|
N.value = e;
|
|
374
401
|
let r = n[0]?.before;
|
|
375
|
-
t && r &&
|
|
402
|
+
if (t && r && kt.noteBase(r), t) {
|
|
403
|
+
let e = Q.api.getCanonicalDocument();
|
|
404
|
+
e && (D.value = e, J()), V.value = !0, G.incrementStateSeq(), X.schedule(), jt();
|
|
405
|
+
}
|
|
406
|
+
G.requestRender();
|
|
376
407
|
}
|
|
377
|
-
function
|
|
408
|
+
function Pt(e) {
|
|
378
409
|
M.value = e, N.value = e.state, z.value = !0;
|
|
379
410
|
let t = D.value, n = O, r = ++A;
|
|
380
411
|
j = !0;
|
|
381
412
|
let i = () => {
|
|
382
413
|
A === r && (j = !1, !(k || O !== n || Q.getView() !== e) && (Y(e.state, { reason: "initial" }), G.requestRender()));
|
|
383
414
|
};
|
|
384
|
-
|
|
415
|
+
xe(t, e.state.doc).then(i, i), $(e), Xe?.(e), c(u) || requestAnimationFrame(() => {
|
|
385
416
|
M.value === e && e.focus();
|
|
386
417
|
});
|
|
387
418
|
}
|
|
388
|
-
let
|
|
389
|
-
getDocx: async (e) => (await
|
|
390
|
-
loadDocument:
|
|
391
|
-
loadDocx:
|
|
392
|
-
},
|
|
419
|
+
let Ft = {
|
|
420
|
+
getDocx: async (e) => (await Ut(e))?.buffer ?? null,
|
|
421
|
+
loadDocument: Ht,
|
|
422
|
+
loadDocx: Vt
|
|
423
|
+
}, It = de({
|
|
393
424
|
getEditorApi: () => Q.api,
|
|
394
425
|
getLayout: () => R.value,
|
|
395
426
|
runLayout: (e, t) => Y(e, t),
|
|
396
|
-
getDocumentIO: () =>
|
|
427
|
+
getDocumentIO: () => Ft,
|
|
397
428
|
emitter: W
|
|
398
429
|
});
|
|
399
|
-
function
|
|
400
|
-
|
|
430
|
+
function $(e) {
|
|
431
|
+
le(c(b) === "suggesting", e.state, e.dispatch, c(x));
|
|
401
432
|
}
|
|
402
|
-
l([() => c(
|
|
433
|
+
l([() => c(b), () => c(x)], () => {
|
|
403
434
|
let e = M.value;
|
|
404
|
-
e &&
|
|
405
|
-
for (let e of
|
|
406
|
-
let t =
|
|
407
|
-
t &&
|
|
435
|
+
e && $(e);
|
|
436
|
+
for (let e of q.listStories()) {
|
|
437
|
+
let t = q.getView(e);
|
|
438
|
+
t && $(t);
|
|
408
439
|
}
|
|
409
440
|
}), l(() => c(u), (e) => {
|
|
410
|
-
Q.syncEditable(), e &&
|
|
441
|
+
Q.syncEditable(), e && Xt();
|
|
411
442
|
});
|
|
412
|
-
function
|
|
413
|
-
let t =
|
|
414
|
-
if (t === e.state.plugins.includes(
|
|
415
|
-
let n = e.state.plugins.filter((e) => e !==
|
|
443
|
+
function Lt(e) {
|
|
444
|
+
let t = St();
|
|
445
|
+
if (t === e.state.plugins.includes(yt)) return;
|
|
446
|
+
let n = e.state.plugins.filter((e) => e !== yt && e !== bt);
|
|
416
447
|
if (t) {
|
|
417
|
-
let e = n.indexOf(
|
|
418
|
-
n.splice(t, 0,
|
|
448
|
+
let e = n.indexOf(xt), t = e === -1 ? n.length : e;
|
|
449
|
+
n.splice(t, 0, yt, bt);
|
|
419
450
|
}
|
|
420
451
|
e.updateState(e.state.reconfigure({ plugins: n }));
|
|
421
452
|
}
|
|
422
|
-
l(() =>
|
|
453
|
+
l(() => St(), () => {
|
|
423
454
|
let e = M.value;
|
|
424
|
-
e &&
|
|
455
|
+
e && Lt(e);
|
|
425
456
|
});
|
|
426
|
-
function
|
|
457
|
+
function Rt() {
|
|
427
458
|
Q.ensureView();
|
|
428
459
|
}
|
|
429
|
-
function
|
|
430
|
-
O += 1, V.value = !1, I.value = null, L.value = null,
|
|
460
|
+
function zt() {
|
|
461
|
+
O += 1, V.value = !1, I.value = null, L.value = null, q.activate(null), X.dispose(), Q.destroyView(), pt() && Q.ensureView(), J(), Q.ensureView(), Q.getView() || Bt();
|
|
431
462
|
}
|
|
432
|
-
function
|
|
463
|
+
function Bt() {
|
|
433
464
|
let e = D.value;
|
|
434
465
|
if (!(!e || c(S))) try {
|
|
435
|
-
let t =
|
|
466
|
+
let t = _({
|
|
436
467
|
document: e,
|
|
437
468
|
styles: e.package.styles ?? null,
|
|
438
|
-
manager:
|
|
439
|
-
externalPlugins:
|
|
469
|
+
manager: U,
|
|
470
|
+
externalPlugins: Ct(),
|
|
440
471
|
collaborationModules: null,
|
|
441
472
|
reason: "mount"
|
|
442
473
|
});
|
|
@@ -446,7 +477,7 @@ function k(e) {
|
|
|
446
477
|
let i = () => {
|
|
447
478
|
A === r && (j = !1, !(k || O !== n || D.value !== e || Q.getView()) && Y(t, { reason: "initial" }));
|
|
448
479
|
};
|
|
449
|
-
|
|
480
|
+
xe(e, t.doc).then(i, i);
|
|
450
481
|
} catch (e) {
|
|
451
482
|
C?.(e instanceof Error ? e : Error(String(e)));
|
|
452
483
|
}
|
|
@@ -454,106 +485,118 @@ function k(e) {
|
|
|
454
485
|
l([
|
|
455
486
|
t,
|
|
456
487
|
a,
|
|
457
|
-
|
|
488
|
+
tt,
|
|
458
489
|
...r ? [r] : []
|
|
459
490
|
], () => {
|
|
460
|
-
t.value && D.value && !Q.getView() &&
|
|
491
|
+
t.value && D.value && !Q.getView() && Rt(), J();
|
|
461
492
|
}, { flush: "post" });
|
|
462
|
-
async function
|
|
493
|
+
async function Vt(e) {
|
|
463
494
|
B.value = null, z.value = !1;
|
|
464
495
|
try {
|
|
465
|
-
let t =
|
|
466
|
-
|
|
496
|
+
let t = e;
|
|
497
|
+
if (pt()) {
|
|
498
|
+
let n = await pe(e);
|
|
499
|
+
if (n.isErr()) throw n.error;
|
|
500
|
+
t = n.value;
|
|
501
|
+
}
|
|
502
|
+
let n = await we(t, { password: c(y) });
|
|
503
|
+
D.value = n, zt();
|
|
467
504
|
} catch (e) {
|
|
468
505
|
let t = e instanceof Error ? e : Error(String(e));
|
|
469
506
|
B.value = t.message, C?.(t);
|
|
470
507
|
}
|
|
471
508
|
}
|
|
472
|
-
function
|
|
473
|
-
B.value = null, D.value = e,
|
|
509
|
+
function Ht(e) {
|
|
510
|
+
B.value = null, D.value = e, kt.reset(), zt();
|
|
474
511
|
}
|
|
475
|
-
async function
|
|
476
|
-
Z !== null &&
|
|
512
|
+
async function Ut(e) {
|
|
513
|
+
Z !== null && At();
|
|
477
514
|
let t = M.value, n = D.value;
|
|
478
515
|
if (!t || !n) return null;
|
|
479
|
-
let r =
|
|
480
|
-
if (
|
|
516
|
+
let r = q.snapshotDocument(K.snapshotDocument(n)), i = t.state, a = Q.api.getCanonicalDocument(), o = Ne(a ?? je(i.doc, r)), { resolveSelectiveSaveFlags: s } = await import("@stll/folio-core/docx/selectiveSaveFlags"), l = s(c(E)), u = o.originalBuffer ?? null, d = l.selectiveSave && e?.mode !== ue.full, f = d || l.selectiveSaveTripwire, { repackDocx: p, createDocx: m } = await import("@stll/folio-core/docx/rezip"), h = null;
|
|
517
|
+
if (f && u) {
|
|
481
518
|
let { attemptSelectiveSave: e } = await import("@stll/folio-core/docx/selectiveSave");
|
|
482
|
-
|
|
483
|
-
changedParaIds:
|
|
484
|
-
structuralChange:
|
|
485
|
-
hasUntrackedChanges:
|
|
486
|
-
maxBytes:
|
|
519
|
+
h = await e(o, u, {
|
|
520
|
+
changedParaIds: Fe(i),
|
|
521
|
+
structuralChange: Ie(i),
|
|
522
|
+
hasUntrackedChanges: Le(i),
|
|
523
|
+
maxBytes: l.selectiveSaveMaxBytes
|
|
487
524
|
});
|
|
488
525
|
}
|
|
489
|
-
let
|
|
526
|
+
let g = d ? h : null, _ = null, ee = () => a ? me({
|
|
527
|
+
document: o,
|
|
528
|
+
repack: () => p(o)
|
|
529
|
+
}) : Re({
|
|
490
530
|
state: i,
|
|
491
|
-
document:
|
|
492
|
-
repack: () =>
|
|
531
|
+
document: o,
|
|
532
|
+
repack: () => p(o)
|
|
493
533
|
});
|
|
494
|
-
if (!
|
|
495
|
-
else if (
|
|
496
|
-
|
|
534
|
+
if (!g) _ = u ? await ee() : await m(o), g = _;
|
|
535
|
+
else if (l.selectiveSaveTripwire) try {
|
|
536
|
+
_ = await ee();
|
|
497
537
|
} catch {}
|
|
498
|
-
if (
|
|
538
|
+
if (l.selectiveSaveTripwire && _ && et) try {
|
|
499
539
|
let { compareSelectiveVsFull: e } = await import("@stll/folio-core/docx/selectiveSaveTripwire");
|
|
500
|
-
|
|
540
|
+
et(await e(h, _));
|
|
501
541
|
} catch {}
|
|
502
542
|
return {
|
|
503
|
-
buffer:
|
|
504
|
-
document:
|
|
543
|
+
buffer: g,
|
|
544
|
+
document: o
|
|
505
545
|
};
|
|
506
546
|
}
|
|
507
|
-
async function
|
|
508
|
-
let t = await
|
|
509
|
-
return
|
|
547
|
+
async function Wt(e) {
|
|
548
|
+
let t = M.value, n = t?.state, r = await Ut({ mode: e?.selective === !1 ? ue.full : ue.preferSelective });
|
|
549
|
+
return r ? (M.value === t && t?.state.doc === n?.doc && (D.value = r.document, J(), V.value = !1), new Blob([r.buffer], { type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" })) : null;
|
|
510
550
|
}
|
|
511
|
-
function
|
|
512
|
-
let e =
|
|
513
|
-
|
|
551
|
+
function Gt() {
|
|
552
|
+
let e = Q.api.getCanonicalDocument();
|
|
553
|
+
if (e) return e;
|
|
554
|
+
if (c(v) === "canonical") return null;
|
|
555
|
+
let t = D.value;
|
|
556
|
+
return t ? H(q.snapshotDocument(K.snapshotDocument(t))) : null;
|
|
514
557
|
}
|
|
515
|
-
function
|
|
516
|
-
D.value = e,
|
|
558
|
+
function Kt(e) {
|
|
559
|
+
mt("Direct document model changes are unavailable in this session.") || (D.value = e, J(), L.value && !q.getView(L.value) && (L.value = null));
|
|
517
560
|
}
|
|
518
|
-
function
|
|
519
|
-
return
|
|
561
|
+
function qt(e) {
|
|
562
|
+
return K.getView(e);
|
|
520
563
|
}
|
|
521
|
-
function
|
|
522
|
-
|
|
564
|
+
function Jt() {
|
|
565
|
+
J();
|
|
523
566
|
}
|
|
524
|
-
function
|
|
525
|
-
let t =
|
|
526
|
-
t && (
|
|
567
|
+
function Yt(e) {
|
|
568
|
+
let t = q.activate(e);
|
|
569
|
+
t && ($(t), L.value = e, requestAnimationFrame(() => t.focus()));
|
|
527
570
|
}
|
|
528
|
-
function
|
|
529
|
-
|
|
571
|
+
function Xt() {
|
|
572
|
+
q.activate(null), L.value = null;
|
|
530
573
|
}
|
|
531
|
-
function
|
|
574
|
+
function Zt() {
|
|
532
575
|
let e = L.value;
|
|
533
|
-
return e ?
|
|
576
|
+
return e ? q.getView(e) : null;
|
|
534
577
|
}
|
|
535
|
-
function
|
|
536
|
-
return
|
|
578
|
+
function Qt() {
|
|
579
|
+
return U.getCommands();
|
|
537
580
|
}
|
|
538
|
-
function
|
|
539
|
-
let e =
|
|
581
|
+
function $t() {
|
|
582
|
+
let e = Zt();
|
|
540
583
|
e ? e.focus() : M.value?.focus();
|
|
541
584
|
}
|
|
542
|
-
function
|
|
585
|
+
function en() {
|
|
543
586
|
let e = M.value;
|
|
544
587
|
e && Y(e.state, { reason: "manual" });
|
|
545
588
|
}
|
|
546
589
|
l([
|
|
547
|
-
() => c(
|
|
548
|
-
() => c(
|
|
549
|
-
() => c(
|
|
550
|
-
() => c(
|
|
551
|
-
], () =>
|
|
552
|
-
function
|
|
553
|
-
k = !0, A += 1, j = !1, X.dispose(), Z !== null && (window.clearTimeout(Z), Z = null), Q.destroyView(), F.value = [],
|
|
554
|
-
}
|
|
555
|
-
return i(
|
|
556
|
-
editor:
|
|
590
|
+
() => c(Ee),
|
|
591
|
+
() => c(De),
|
|
592
|
+
() => c(ie),
|
|
593
|
+
() => c(Te)
|
|
594
|
+
], () => en());
|
|
595
|
+
function tn() {
|
|
596
|
+
k = !0, A += 1, j = !1, X.dispose(), Z !== null && (window.clearTimeout(Z), Z = null), Q.destroyView(), F.value = [], K.destroy(), q.destroy(), U.destroy(), N.value = null, R.value = null, D.value = null, z.value = !1;
|
|
597
|
+
}
|
|
598
|
+
return i(tn), {
|
|
599
|
+
editor: It,
|
|
557
600
|
editorView: M,
|
|
558
601
|
editorState: N,
|
|
559
602
|
remoteSelections: F,
|
|
@@ -563,23 +606,23 @@ function k(e) {
|
|
|
563
606
|
isDirty: V,
|
|
564
607
|
parseError: B,
|
|
565
608
|
layout: R,
|
|
566
|
-
blocks:
|
|
567
|
-
measures:
|
|
609
|
+
blocks: dt,
|
|
610
|
+
measures: ft,
|
|
568
611
|
syncCoordinator: G,
|
|
569
|
-
loadBuffer:
|
|
570
|
-
loadDocument:
|
|
571
|
-
save:
|
|
572
|
-
getDocument:
|
|
573
|
-
setDocument:
|
|
574
|
-
getHeaderFooterView:
|
|
575
|
-
syncHeaderFooterViews:
|
|
576
|
-
openNoteStory:
|
|
577
|
-
closeNoteStory:
|
|
578
|
-
getActiveNoteView:
|
|
579
|
-
getCommands:
|
|
580
|
-
focus:
|
|
581
|
-
reLayout:
|
|
582
|
-
destroy:
|
|
612
|
+
loadBuffer: Vt,
|
|
613
|
+
loadDocument: Ht,
|
|
614
|
+
save: Wt,
|
|
615
|
+
getDocument: Gt,
|
|
616
|
+
setDocument: Kt,
|
|
617
|
+
getHeaderFooterView: qt,
|
|
618
|
+
syncHeaderFooterViews: Jt,
|
|
619
|
+
openNoteStory: Yt,
|
|
620
|
+
closeNoteStory: Xt,
|
|
621
|
+
getActiveNoteView: Zt,
|
|
622
|
+
getCommands: Qt,
|
|
623
|
+
focus: $t,
|
|
624
|
+
reLayout: en,
|
|
625
|
+
destroy: tn
|
|
583
626
|
};
|
|
584
627
|
}
|
|
585
628
|
function A(e, t) {
|
|
@@ -596,36 +639,34 @@ function A(e, t) {
|
|
|
596
639
|
//#endregion
|
|
597
640
|
//#region src/composables/useDragAutoScroll.ts
|
|
598
641
|
function j({ pagesContainer: e, onScrollExtendSelection: t }) {
|
|
599
|
-
let n = null, r = 0, a = 0, o = !1
|
|
600
|
-
function
|
|
601
|
-
|
|
602
|
-
let t = e.value;
|
|
603
|
-
return t ? (s = Ie(t), s) : null;
|
|
642
|
+
let n = null, r = 0, a = 0, o = !1;
|
|
643
|
+
function s() {
|
|
644
|
+
return re(e.value);
|
|
604
645
|
}
|
|
605
|
-
function
|
|
646
|
+
function c() {
|
|
606
647
|
o = !1, n !== null && (cancelAnimationFrame(n), n = null);
|
|
607
648
|
}
|
|
608
|
-
function
|
|
649
|
+
function l() {
|
|
609
650
|
if (!o) return;
|
|
610
|
-
let e =
|
|
651
|
+
let e = s();
|
|
611
652
|
if (!e) return;
|
|
612
653
|
let i = A(e.getBoundingClientRect(), a);
|
|
613
|
-
i !== 0 && (e
|
|
654
|
+
i !== 0 && (ie(e, i), t(r, a)), n = requestAnimationFrame(l);
|
|
614
655
|
}
|
|
615
|
-
function
|
|
616
|
-
o || (o = !0, n = requestAnimationFrame(
|
|
656
|
+
function u() {
|
|
657
|
+
o || (o = !0, n = requestAnimationFrame(l));
|
|
617
658
|
}
|
|
618
|
-
function
|
|
659
|
+
function d(e, t) {
|
|
619
660
|
if (r = e, a = t, !o) {
|
|
620
|
-
let e =
|
|
661
|
+
let e = s();
|
|
621
662
|
if (!e) return;
|
|
622
663
|
let n = e.getBoundingClientRect();
|
|
623
|
-
(t < n.top + 40 || t > n.bottom - 40) &&
|
|
664
|
+
(t < n.top + 40 || t > n.bottom - 40) && u();
|
|
624
665
|
}
|
|
625
666
|
}
|
|
626
|
-
return i(() =>
|
|
627
|
-
updateMousePosition:
|
|
628
|
-
stopAutoScroll:
|
|
667
|
+
return i(() => c()), {
|
|
668
|
+
updateMousePosition: d,
|
|
669
|
+
stopAutoScroll: c
|
|
629
670
|
};
|
|
630
671
|
}
|
|
631
672
|
//#endregion
|
|
@@ -670,7 +711,7 @@ function M() {
|
|
|
670
711
|
let t = r.clientX - e.startX, n = parseFloat(e.handle.style.left);
|
|
671
712
|
e.handle.style.left = `${n + t}px`, e.startX = r.clientX;
|
|
672
713
|
let i = Math.round(t * x), a = e.origWidths.left + i, o = e.origWidths.right - i;
|
|
673
|
-
a >=
|
|
714
|
+
a >= y && o >= y && (e.origWidths = {
|
|
674
715
|
left: a,
|
|
675
716
|
right: o
|
|
676
717
|
});
|
|
@@ -681,7 +722,7 @@ function M() {
|
|
|
681
722
|
let e = r.clientY - t.startY, n = parseFloat(t.handle.style.top);
|
|
682
723
|
t.handle.style.top = `${n + e}px`, t.startY = r.clientY;
|
|
683
724
|
let i = Math.round(e * x), a = t.origHeight + i;
|
|
684
|
-
a >=
|
|
725
|
+
a >= b && (t.origHeight = a);
|
|
685
726
|
return;
|
|
686
727
|
}
|
|
687
728
|
if (n.active && n.handle) {
|
|
@@ -689,12 +730,12 @@ function M() {
|
|
|
689
730
|
let e = r.clientX - n.startX, t = parseFloat(n.handle.style.left);
|
|
690
731
|
n.handle.style.left = `${t + e}px`, n.startX = r.clientX;
|
|
691
732
|
let i = Math.round(e * x), a = n.origWidth + i;
|
|
692
|
-
a >=
|
|
733
|
+
a >= y && (n.origWidth = a);
|
|
693
734
|
}
|
|
694
735
|
}
|
|
695
736
|
function s(i) {
|
|
696
737
|
if (e.active) {
|
|
697
|
-
e.active = !1, e.handle?.classList.remove("dragging"), r &&
|
|
738
|
+
e.active = !1, e.handle?.classList.remove("dragging"), r && Ue(r, {
|
|
698
739
|
pmStart: e.tablePmStart,
|
|
699
740
|
colIdx: e.columnIndex,
|
|
700
741
|
newLeft: e.origWidths.left,
|
|
@@ -710,7 +751,7 @@ function M() {
|
|
|
710
751
|
}), t.handle = null;
|
|
711
752
|
return;
|
|
712
753
|
}
|
|
713
|
-
n.active && (n.active = !1, n.handle?.classList.remove("dragging"), r &&
|
|
754
|
+
n.active && (n.active = !1, n.handle?.classList.remove("dragging"), r && We(r, {
|
|
714
755
|
pmStart: n.tablePmStart,
|
|
715
756
|
colIdx: n.columnIndex,
|
|
716
757
|
newWidth: n.origWidth
|
|
@@ -728,11 +769,11 @@ function M() {
|
|
|
728
769
|
};
|
|
729
770
|
}
|
|
730
771
|
function N(e, t) {
|
|
731
|
-
let n =
|
|
772
|
+
let n = Ke(e, t.tablePmStart, t.columnIndex);
|
|
732
773
|
n && (t.origWidths = n);
|
|
733
774
|
}
|
|
734
775
|
function P(e, t, n) {
|
|
735
|
-
let r =
|
|
776
|
+
let r = qe(e, t.tablePmStart, t.rowIndex);
|
|
736
777
|
if (r != null) {
|
|
737
778
|
t.origHeight = r;
|
|
738
779
|
return;
|
|
@@ -741,17 +782,17 @@ function P(e, t, n) {
|
|
|
741
782
|
t.origHeight = Math.round(a * x);
|
|
742
783
|
}
|
|
743
784
|
function F(e, t) {
|
|
744
|
-
let n =
|
|
785
|
+
let n = Ge(e, t.tablePmStart, t.columnIndex);
|
|
745
786
|
n != null && (t.origWidth = n);
|
|
746
787
|
}
|
|
747
788
|
//#endregion
|
|
748
789
|
//#region src/composables/useTrackedChanges.ts
|
|
749
790
|
function I(t, n) {
|
|
750
|
-
return e(() => (n.value,
|
|
791
|
+
return e(() => (n.value, Je(t.value?.state ?? null)));
|
|
751
792
|
}
|
|
752
793
|
//#endregion
|
|
753
794
|
//#region src/composables/useZoom.ts
|
|
754
|
-
var L = C, R =
|
|
795
|
+
var L = C, R = Ye, dt = [
|
|
755
796
|
.5,
|
|
756
797
|
.75,
|
|
757
798
|
1,
|
|
@@ -759,7 +800,7 @@ var L = C, R = We, ot = [
|
|
|
759
800
|
1.5,
|
|
760
801
|
2
|
|
761
802
|
];
|
|
762
|
-
function
|
|
803
|
+
function ft(t = 1) {
|
|
763
804
|
let i = o(Math.max(L, Math.min(R, t))), a = e(() => Math.round(i.value * 100)), s = e(() => i.value <= L), c = e(() => i.value >= R);
|
|
764
805
|
function l(e) {
|
|
765
806
|
i.value = Math.max(L, Math.min(R, Math.round(e * 100) / 100));
|
|
@@ -794,8 +835,8 @@ function st(t = 1) {
|
|
|
794
835
|
handleWheel: p,
|
|
795
836
|
handleKeyDown: m,
|
|
796
837
|
installShortcuts: h,
|
|
797
|
-
ZOOM_PRESETS:
|
|
838
|
+
ZOOM_PRESETS: dt
|
|
798
839
|
};
|
|
799
840
|
}
|
|
800
841
|
//#endregion
|
|
801
|
-
export { j as a, T as c, M as i,
|
|
842
|
+
export { j as a, T as c, M as i, et as l, Je as n, k as o, I as r, tt as s, ft as t, D as u };
|