@stll/folio-vue 0.32.1 → 0.33.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/FindReplaceDialog-CfcTl2Ra.cjs +1 -0
- package/dist/FindReplaceDialog-DEWjhuOw.js +168 -0
- package/dist/HorizontalRuler-Cuk0l4Us.cjs +1 -0
- package/dist/HorizontalRuler-TM9dg--R.js +341 -0
- package/dist/HyperlinkDialog-BEse_y7R.js +175 -0
- package/dist/HyperlinkDialog-Cs1y6aol.cjs +1 -0
- package/dist/ImagePropertiesDialog-CTbX2GrE.cjs +1 -0
- package/dist/ImagePropertiesDialog-mrJ8S3sl.js +186 -0
- package/dist/ImageSelectionOverlay-DULrvfOJ.js +386 -0
- package/dist/ImageSelectionOverlay-Dr0lg9WZ.cjs +1 -0
- package/dist/InsertSymbolDialog-BjB-Q9EO.js +93 -0
- package/dist/InsertSymbolDialog-BsjgPYM-.cjs +1 -0
- package/dist/PageSetupDialog-CZ5fE9rz.cjs +1 -0
- package/dist/PageSetupDialog-DNNSezj3.js +208 -0
- package/dist/SetNumberingValueDialog-ClCYr37D.cjs +1 -0
- package/dist/SetNumberingValueDialog-CwLHfO7f.js +54 -0
- package/dist/SplitCellDialog-Bfuo5WCO.cjs +1 -0
- package/dist/SplitCellDialog-HIg4ZEqt.js +1031 -0
- package/dist/StylePicker-BnGGlXOX.cjs +4 -0
- package/dist/{StylePicker-DmTN56Yg.js → StylePicker-F3cLPvRE.js} +593 -1100
- package/dist/TablePropertiesDialog-CRX9Xgdr.js +102 -0
- package/dist/TablePropertiesDialog-ClJSuB0F.cjs +1 -0
- package/dist/VerticalRuler-D973NTMv.js +178 -0
- package/dist/VerticalRuler-DVi2P_TO.cjs +1 -0
- package/dist/WatermarkDialog-BYyBTlDK.cjs +1 -0
- package/dist/WatermarkDialog-BoAdQ-qK.js +161 -0
- package/dist/components/dialogs/recentSymbols.d.ts +7 -0
- package/dist/composables/useDocxEditor.d.ts +4 -1
- package/dist/composables.cjs +1 -1
- package/dist/composables.js +1 -1
- package/dist/dialogs.cjs +1 -1
- package/dist/dialogs.js +9 -1
- package/dist/{SplitCellDialog-BczVYfpm.js → folio-ui-ctJdVP-s.js} +678 -2753
- package/dist/folio-ui-u7h3WXUO.cjs +15 -0
- package/dist/folio-vue.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.js +1665 -2064
- package/dist/messages/ar.cjs +1 -1
- package/dist/messages/cs.cjs +1 -1
- package/dist/messages/de.cjs +1 -1
- package/dist/messages/en.cjs +1 -1
- package/dist/messages/es.cjs +1 -1
- package/dist/messages/et.cjs +1 -1
- package/dist/messages/fr.cjs +1 -1
- package/dist/messages/he.cjs +1 -1
- package/dist/messages/hi.cjs +1 -1
- package/dist/messages/hu.cjs +1 -1
- package/dist/messages/lt.cjs +1 -1
- package/dist/messages/lv.cjs +1 -1
- package/dist/messages/pl.cjs +1 -1
- package/dist/messages/pt-BR.cjs +1 -1
- package/dist/messages/sk.cjs +1 -1
- package/dist/messages/tr.cjs +1 -1
- package/dist/messages/zh-CN.cjs +1 -1
- package/dist/rolldown-runtime-DbbDpzbe.cjs +1 -0
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +28 -18
- package/dist/{useZoom-1kmdkmJ4.js → useZoom-CX69Me_z.js} +289 -285
- package/dist/useZoom-QSSrGY_r.cjs +1 -0
- package/package.json +2 -2
- package/dist/SplitCellDialog-CrLHwVLc.cjs +0 -15
- package/dist/StylePicker-C0iEQnw6.cjs +0 -4
- package/dist/rolldown-runtime-5iZMYShA.cjs +0 -1
- package/dist/useZoom-Bj5B9uT1.cjs +0 -1
|
@@ -3,43 +3,44 @@ import { CanonicalSessionRefusalError as p, createHiddenEditorManager as m, crea
|
|
|
3
3
|
import { getEditorReadOnlyReason as ee } from "@stll/folio-core/managers/EditorModeManager";
|
|
4
4
|
import { getEditorScrollRoot as g, scrollEditorBy as _ } from "@stll/folio-core/paged-layout/editorScrollRoot";
|
|
5
5
|
import { getMargins as te, getPageSize as ne, twipsToPixels as v } from "@stll/folio-core/paged-layout/sectionGeometry";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { readPaintedTableStart as S } from "@stll/folio-core/utils/paintedPositions";
|
|
6
|
+
import { readModel as y } from "@stll/folio-core/types/documentModel";
|
|
7
|
+
import { readPaintedTableStart as b } from "@stll/folio-core/utils/paintedPositions";
|
|
9
8
|
import { NO_ANONYMIZATION_TERMS as re } from "@stll/folio-core/controller/anonymizationHighlights";
|
|
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 {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
9
|
+
import { createDisplayListPainterLoader as ie } from "@stll/folio-core/controller/deferredDisplayListPainter";
|
|
10
|
+
import { DOCUMENT_CHANGE_NOTIFY_DELAY_MS as ae } from "@stll/folio-core/controller/documentChangeNotification";
|
|
11
|
+
import { FOLIO_DOCX_SERIALIZATION_MODE as x, createFolioEditor as S } from "@stll/folio-core/controller/folioEditor";
|
|
12
|
+
import { createFolioEditorEmitter as C } from "@stll/folio-core/controller/folioEditorEvents";
|
|
13
|
+
import { readFontSetSignature as oe, waitForInitialLayoutFonts as w, watchLayoutFontLoads as se } from "@stll/folio-core/controller/fontReadiness";
|
|
14
|
+
import { createHeaderFooterEditorManager as T } from "@stll/folio-core/controller/headerFooterEditorManager";
|
|
15
|
+
import { createHyphenationReadiness as ce } from "@stll/folio-core/controller/hyphenationReadiness";
|
|
16
|
+
import { runLayoutPipelineWithPainter as le } from "@stll/folio-core/controller/layoutPipelineExecution";
|
|
17
|
+
import { TRANSACTION_LAYOUT_TIMING as ue, browserClock as de, createLayoutScheduler as E } from "@stll/folio-core/controller/layoutScheduler";
|
|
18
|
+
import { createLayoutSession as fe } from "@stll/folio-core/controller/layoutSession";
|
|
19
|
+
import { createNoteEditorManager as pe } from "@stll/folio-core/controller/noteEditorManager";
|
|
20
|
+
import { PAGE_RENDERER as me } from "@stll/folio-core/display-list/editor/pageRenderer";
|
|
21
|
+
import { holdsUniqueParagraphIds as he, openCanonicalDocx as ge, prepareCanonicalDocumentInput as _e } from "@stll/folio-core/docx/canonicalSessionInput";
|
|
22
|
+
import { carryParseFacts as ve, cloneDocumentWithParagraphPropertySources as ye } from "@stll/folio-core/docx/document-clone";
|
|
23
|
+
import { getFootnoteText as be } from "@stll/folio-core/docx/storyPlainText";
|
|
24
|
+
import { convertHeaderFooterPmDocToContent as xe, convertHeaderFooterToContent as Se } from "@stll/folio-core/layout-bridge/convert/headerFooterLayout";
|
|
25
|
+
import { resolveSectionHeaderFooterRefs as Ce } from "@stll/folio-core/layout-engine";
|
|
26
|
+
import { LayoutPainter as we, releaseDisplayPageResources as Te } from "@stll/folio-core/layout-painter";
|
|
27
|
+
import { LayoutSelectionGate as Ee } from "@stll/folio-core/paged-layout/LayoutSelectionGate";
|
|
28
|
+
import { ExtensionManager as De } from "@stll/folio-core/prosemirror/extensions/ExtensionManager";
|
|
29
|
+
import { createStarterKit as Oe } from "@stll/folio-core/prosemirror/extensions/StarterKit";
|
|
30
|
+
import { createTemplateDirectivesPlugin as ke } from "@stll/folio-core/prosemirror/plugins/templateDirectives";
|
|
31
|
+
import { createTemplatePreviewValuesPlugin as Ae } from "@stll/folio-core/prosemirror/plugins/templatePreviewValues";
|
|
32
|
+
import { templateSlashMenuPlugin as je } from "@stll/folio-core/prosemirror/plugins/templateSlashMenu";
|
|
33
|
+
import { resolveHeaderFooterContent as Me } from "@stll/folio-core/utils/headerFooter";
|
|
34
|
+
import { lockHeldRevisions as Ne, trackedChangeEntryRevisionIds as Pe } from "@stll/folio-core/prosemirror/commands/comments";
|
|
35
|
+
import { FindReplaceManager as Fe } from "@stll/folio-core/managers/FindReplaceManager";
|
|
36
|
+
import { findInDisplayedDocument as Ie } from "@stll/folio-core/prosemirror/findReplaceSelection";
|
|
37
|
+
import { replaceFindMatch as Le, replaceFindMatches as Re } from "@stll/folio-core/prosemirror/replaceFindMatches";
|
|
38
|
+
import { createFindMatchView as ze, getRenderedSearchStories as Be } from "@stll/folio-core/utils/findMatchView";
|
|
39
|
+
import { createDefaultFindOptions as Ve, replaceEligibility as He } from "@stll/folio-core/utils/findReplace";
|
|
40
|
+
import { createFindSearchKey as D, sameFindSearchKey as Ue } from "@stll/folio-core/utils/findSearchKey";
|
|
41
|
+
import { MIN_CELL_WIDTH_TWIPS as We, MIN_ROW_HEIGHT_TWIPS as Ge, TWIPS_PER_PIXEL as O, clampRowResizeDelta as Ke, columnResizeCommand as qe, readColumnWidthAt as Je, readColumnWidths as Ye, readRowHeight as Xe, rightEdgeResizeCommand as Ze, rowResizeCommand as k } from "@stll/folio-core/prosemirror/tableResize";
|
|
42
|
+
import { extractTrackedChanges as Qe } from "@stll/folio-core/prosemirror/utils/extractTrackedChanges";
|
|
43
|
+
import { ZOOM_MAX as $e, ZOOM_MIN as A, ZOOM_STEP as j } from "@stll/folio-core/utils/zoom";
|
|
43
44
|
// src/utils/colorMode.ts
|
|
44
45
|
var M = "(prefers-color-scheme: dark)";
|
|
45
46
|
function N() {
|
|
@@ -56,13 +57,13 @@ function F(e) {
|
|
|
56
57
|
return t.addEventListener("change", n), () => t.removeEventListener("change", n);
|
|
57
58
|
}
|
|
58
59
|
// src/composables/useColorMode.ts
|
|
59
|
-
var
|
|
60
|
-
a(
|
|
61
|
-
},
|
|
62
|
-
t.provide(
|
|
60
|
+
var I = "light", L = Symbol("folioColorMode"), et = (t = I) => {
|
|
61
|
+
a(L, e(() => u(t)));
|
|
62
|
+
}, R = { install(t, n = I) {
|
|
63
|
+
t.provide(L, e(() => u(n)));
|
|
63
64
|
} };
|
|
64
|
-
function
|
|
65
|
-
let n = t(
|
|
65
|
+
function z() {
|
|
66
|
+
let n = t(L, e(() => I)), i = s(!1), a = s(!1);
|
|
66
67
|
return r(() => {
|
|
67
68
|
i.value = !0;
|
|
68
69
|
}), f((e) => {
|
|
@@ -72,19 +73,19 @@ function R() {
|
|
|
72
73
|
}), e(() => P(n.value, i.value && a.value));
|
|
73
74
|
}
|
|
74
75
|
// src/utils/rawDocument.ts
|
|
75
|
-
var
|
|
76
|
+
var tt = (e) => B(e, /* @__PURE__ */ new Map()), B = (e, t) => {
|
|
76
77
|
if (typeof e != "object" || !e) return e;
|
|
77
78
|
let n = l(e), r = t.get(n);
|
|
78
79
|
if (r !== void 0) return r;
|
|
79
80
|
t.set(n, n);
|
|
80
|
-
let i =
|
|
81
|
+
let i = nt(n, t);
|
|
81
82
|
return t.set(n, i), i;
|
|
82
|
-
},
|
|
83
|
+
}, nt = (e, t) => {
|
|
83
84
|
if (ArrayBuffer.isView(e) || e instanceof ArrayBuffer) return e;
|
|
84
85
|
if (e instanceof Map) {
|
|
85
86
|
let n = !1, r = [];
|
|
86
87
|
for (let [i, a] of e) {
|
|
87
|
-
let e =
|
|
88
|
+
let e = B(i, t), o = B(a, t);
|
|
88
89
|
(e !== i || o !== a) && (n = !0), r.push([e, o]);
|
|
89
90
|
}
|
|
90
91
|
return n ? new Map(r) : e;
|
|
@@ -92,14 +93,14 @@ var nt = (e) => z(e, /* @__PURE__ */ new Map()), z = (e, t) => {
|
|
|
92
93
|
if (e instanceof Set) {
|
|
93
94
|
let n = !1, r = [];
|
|
94
95
|
for (let i of e) {
|
|
95
|
-
let e =
|
|
96
|
+
let e = B(i, t);
|
|
96
97
|
e !== i && (n = !0), r.push(e);
|
|
97
98
|
}
|
|
98
99
|
return n ? new Set(r) : e;
|
|
99
100
|
}
|
|
100
101
|
if (Array.isArray(e)) {
|
|
101
102
|
let n = !1, r = e.map((e) => {
|
|
102
|
-
let r =
|
|
103
|
+
let r = B(e, t);
|
|
103
104
|
return r !== e && (n = !0), r;
|
|
104
105
|
});
|
|
105
106
|
return n ? r : e;
|
|
@@ -107,15 +108,15 @@ var nt = (e) => z(e, /* @__PURE__ */ new Map()), z = (e, t) => {
|
|
|
107
108
|
let n = Object.getOwnPropertyDescriptors(e), r = !1;
|
|
108
109
|
for (let e of Reflect.ownKeys(n)) {
|
|
109
110
|
let i = Reflect.get(n, e);
|
|
110
|
-
if (!
|
|
111
|
-
let a =
|
|
111
|
+
if (!rt(i)) continue;
|
|
112
|
+
let a = B(i.value, t);
|
|
112
113
|
a !== i.value && (r = !0, i.value = a);
|
|
113
114
|
}
|
|
114
115
|
if (!r) return e;
|
|
115
116
|
let i = Object.create(Reflect.getPrototypeOf(e), n);
|
|
116
|
-
return
|
|
117
|
-
},
|
|
118
|
-
function
|
|
117
|
+
return ve(i, e), i;
|
|
118
|
+
}, rt = (e) => typeof e == "object" && !!e && "value" in e, it = 24, at = "User", ot = [], st = [];
|
|
119
|
+
function ct(e) {
|
|
119
120
|
let t = e?.columnCount ?? 1;
|
|
120
121
|
if (t <= 1) return;
|
|
121
122
|
let n = {
|
|
@@ -125,24 +126,24 @@ function lt(e) {
|
|
|
125
126
|
};
|
|
126
127
|
return e?.separator !== void 0 && (n.separator = e.separator), n;
|
|
127
128
|
}
|
|
128
|
-
function
|
|
129
|
+
function lt(e, t, n, r, i, a) {
|
|
129
130
|
if (!e) return;
|
|
130
131
|
let o = t ? {
|
|
131
132
|
...a,
|
|
132
133
|
rId: t
|
|
133
134
|
} : a, s = t ? n?.getView(t) : null;
|
|
134
|
-
return s ?
|
|
135
|
+
return s ? xe(s.state.doc, r, i, o) : Se(e, r, i, o);
|
|
135
136
|
}
|
|
136
|
-
function
|
|
137
|
+
function ut(e, t, n, r, i) {
|
|
137
138
|
if (!e || e.size === 0) return;
|
|
138
139
|
let a = /* @__PURE__ */ new Map();
|
|
139
140
|
for (let [o, s] of e) {
|
|
140
|
-
let e =
|
|
141
|
+
let e = lt(s, o, t, n, r, i);
|
|
141
142
|
e && a.set(o, e);
|
|
142
143
|
}
|
|
143
144
|
return a.size > 0 ? a : void 0;
|
|
144
145
|
}
|
|
145
|
-
function
|
|
146
|
+
function dt(e, t, n) {
|
|
146
147
|
let r = /* @__PURE__ */ new Map();
|
|
147
148
|
if (!n || !n.package.footnotes) return r;
|
|
148
149
|
let i = /* @__PURE__ */ new Map();
|
|
@@ -156,7 +157,7 @@ function ft(e, t, n) {
|
|
|
156
157
|
e.push({
|
|
157
158
|
displayNumber: String(o),
|
|
158
159
|
noteId: n,
|
|
159
|
-
text:
|
|
160
|
+
text: be(r),
|
|
160
161
|
...a ? { content: {
|
|
161
162
|
blocks: a.blocks,
|
|
162
163
|
measures: a.measures,
|
|
@@ -168,7 +169,7 @@ function ft(e, t, n) {
|
|
|
168
169
|
}
|
|
169
170
|
return r;
|
|
170
171
|
}
|
|
171
|
-
var
|
|
172
|
+
var V = /* @__PURE__ */ new Set([
|
|
172
173
|
"black",
|
|
173
174
|
"blue",
|
|
174
175
|
"cyan",
|
|
@@ -187,49 +188,43 @@ var B = /* @__PURE__ */ new Set([
|
|
|
187
188
|
"white",
|
|
188
189
|
"yellow"
|
|
189
190
|
]);
|
|
190
|
-
function
|
|
191
|
+
function ft(e) {
|
|
191
192
|
let t = [], n = (e, r) => {
|
|
192
|
-
for (let [n, i] of e.marks.entries()) i.type.name === "highlight" && !
|
|
193
|
+
for (let [n, i] of e.marks.entries()) i.type.name === "highlight" && !V.has(String(i.attrs.color)) && t.push(`${r}.marks[${n}]=${JSON.stringify(i.attrs)}`);
|
|
193
194
|
e.forEach((e, t, i) => {
|
|
194
195
|
n(e, `${r}.content[${i}]`);
|
|
195
196
|
});
|
|
196
197
|
};
|
|
197
198
|
return n(e, "doc"), t.join("; ");
|
|
198
199
|
}
|
|
199
|
-
function
|
|
200
|
-
let { hiddenContainer: t, hiddenHeaderFooterContainer: n, noteEditorContainer: r, pagesContainer: a, readOnly: o = !1, pageGap: l =
|
|
200
|
+
function H(e) {
|
|
201
|
+
let { hiddenContainer: t, hiddenHeaderFooterContainer: n, noteEditorContainer: r, pagesContainer: a, readOnly: o = !1, pageGap: l = it, pageRenderer: f, markupView: ee = "all-markup", showCommentHighlights: g = !0, altChunkMarkerText: _, showMarginGuides: v, marginGuideColor: b, password: ve, editorMode: be, author: xe, externalPlugins: Se = [], historyShortcuts: Ne = "editor", onCanonicalHistory: Pe, onCanonicalHistoryDrop: Fe, collaboration: Ie, getAnonymizationTerms: Le, getDerivedFields: Re, showTemplateDirectives: ze, onSlashMenuChange: Be, onSlashMenuKeyAction: Ve, onChange: He, onError: D, onSelectionUpdate: Ue, onEditorViewReady: We, onCopy: Ge, onCut: O, onPaste: Ke, onReadOnlyEditAttempt: qe, featureFlags: Je, onSelectiveSaveTripwire: Ye } = e, Xe = n ?? t, Ze = () => u(xe) ?? at, k = c(null), Qe = () => {
|
|
201
202
|
let e = k.value;
|
|
202
|
-
return (e &&
|
|
203
|
-
},
|
|
204
|
-
let t =
|
|
205
|
-
|
|
206
|
-
},
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
U.buildSchema(), U.initializeRuntime();
|
|
214
|
-
let _t = Ae(), vt = Me({
|
|
215
|
-
onChange: (e) => Ve?.(e),
|
|
216
|
-
onKeyAction: (e) => He?.(e) ?? !1
|
|
217
|
-
}), yt = je(), W = () => u(Be) === !0;
|
|
218
|
-
function bt() {
|
|
203
|
+
return (e && y(e).package.styles) ?? null;
|
|
204
|
+
}, $e = c(null), A = 0, j = !1, M = 0, N = !1, P = c(null), F = c(null), I = () => u(Ie), L = c([]), et = c(null), R = c(null), z = c(null), B = s(0), nt = c([]), rt = c([]), V = s(!1), H = s(null), U = s(!1), pt = (e) => ye(e), mt = (e) => {
|
|
205
|
+
let t = pt(e);
|
|
206
|
+
He?.(t), G.emit("docChange", t);
|
|
207
|
+
}, W = new De(Oe({ historyShortcuts: Ne }));
|
|
208
|
+
W.buildSchema(), W.initializeRuntime();
|
|
209
|
+
let ht = ke(), gt = je({
|
|
210
|
+
onChange: (e) => Be?.(e),
|
|
211
|
+
onKeyAction: (e) => Ve?.(e) ?? !1
|
|
212
|
+
}), _t = Ae(), vt = () => u(ze) === !0;
|
|
213
|
+
function yt() {
|
|
219
214
|
return [
|
|
220
|
-
...
|
|
221
|
-
...
|
|
222
|
-
|
|
215
|
+
...Se,
|
|
216
|
+
...vt() ? [ht, gt] : [],
|
|
217
|
+
_t
|
|
223
218
|
];
|
|
224
219
|
}
|
|
225
|
-
let G =
|
|
220
|
+
let G = C(), K = new Ee(), q = fe(), bt = ce({
|
|
226
221
|
relayout: () => {
|
|
227
222
|
let e = P.value?.state ?? q.lastEditorState;
|
|
228
223
|
e && X(e, { reason: "hyphenation-ready" });
|
|
229
224
|
},
|
|
230
|
-
onError: (e) =>
|
|
225
|
+
onError: (e) => D?.(e)
|
|
231
226
|
});
|
|
232
|
-
i(
|
|
227
|
+
i(bt.cancel), i(se({
|
|
233
228
|
measuredFontSet: () => q.lastMeasureInputs?.fontSet ?? null,
|
|
234
229
|
relayout: () => {
|
|
235
230
|
if (N) return;
|
|
@@ -237,55 +232,55 @@ function V(e) {
|
|
|
237
232
|
e && X(e, { reason: "font-ready" });
|
|
238
233
|
}
|
|
239
234
|
}));
|
|
240
|
-
let
|
|
235
|
+
let xt = new we({
|
|
241
236
|
pageGap: l,
|
|
242
237
|
showShadow: !0
|
|
243
|
-
}),
|
|
238
|
+
}), St = T({
|
|
244
239
|
getHost: () => Xe.value,
|
|
245
240
|
getReadOnly: () => u(o),
|
|
246
241
|
getCanonicalApi: () => $.api,
|
|
247
242
|
readCanonicalDocument: () => $.readCanonicalDocument(),
|
|
248
243
|
onSessionRefusal: (e, t, n) => {
|
|
249
|
-
|
|
244
|
+
H.value = e, D?.(n ?? new p({
|
|
250
245
|
ground: t,
|
|
251
246
|
message: e
|
|
252
247
|
}));
|
|
253
248
|
},
|
|
254
|
-
getStyles:
|
|
249
|
+
getStyles: Qe,
|
|
255
250
|
onTransaction: ({ rId: e, kind: t, view: n, docChanged: r, selectionChanged: i }) => {
|
|
256
|
-
if (r && (
|
|
251
|
+
if (r && (U.value = !0, Z.schedule()), r || i) {
|
|
257
252
|
let { from: r, to: i } = n.state.selection;
|
|
258
|
-
|
|
253
|
+
et.value = {
|
|
259
254
|
from: r,
|
|
260
255
|
kind: t,
|
|
261
256
|
rId: e,
|
|
262
257
|
to: i
|
|
263
|
-
},
|
|
258
|
+
}, Ue?.(n.state), G.emit("selectionChange", {
|
|
264
259
|
from: r,
|
|
265
260
|
to: i
|
|
266
261
|
});
|
|
267
262
|
}
|
|
268
263
|
K.requestRender();
|
|
269
264
|
}
|
|
270
|
-
}), J =
|
|
265
|
+
}), J = pe({
|
|
271
266
|
getHost: () => r?.value ?? null,
|
|
272
267
|
getCanonicalApi: () => $.api,
|
|
273
268
|
readCanonicalDocument: () => $.readCanonicalDocument(),
|
|
274
269
|
onSessionRefusal: (e, t, n) => {
|
|
275
|
-
|
|
270
|
+
H.value = e, D?.(n ?? new p({
|
|
276
271
|
ground: t,
|
|
277
272
|
message: e
|
|
278
273
|
}));
|
|
279
274
|
},
|
|
280
|
-
getStyles:
|
|
275
|
+
getStyles: Qe,
|
|
281
276
|
onTransaction: ({ docChanged: e, selectionChanged: t, view: n }) => {
|
|
282
277
|
if (e) {
|
|
283
|
-
|
|
278
|
+
U.value = !0;
|
|
284
279
|
let e = k.value;
|
|
285
280
|
e && (k.value = $.readCanonicalDocument() ?? e, Ot()), Z.schedule();
|
|
286
281
|
}
|
|
287
282
|
if (e || t) {
|
|
288
|
-
|
|
283
|
+
Ue?.(n.state);
|
|
289
284
|
let { from: e, to: t } = n.state.selection;
|
|
290
285
|
G.emit("selectionChange", {
|
|
291
286
|
from: e,
|
|
@@ -294,29 +289,38 @@ function V(e) {
|
|
|
294
289
|
}
|
|
295
290
|
}
|
|
296
291
|
}), Y = () => {
|
|
297
|
-
|
|
292
|
+
St.sync(), J.sync();
|
|
298
293
|
};
|
|
299
|
-
function
|
|
300
|
-
e.layout && (
|
|
301
|
-
}
|
|
294
|
+
function Ct(e) {
|
|
295
|
+
e.layout && (z.value = e.layout), e.blocks && (nt.value = e.blocks), e.measures && (rt.value = e.measures), e.blockLookup && xt.setBlockLookup(e.blockLookup), e.layout && G.emit("layoutComplete", e.layout);
|
|
296
|
+
}
|
|
297
|
+
let wt = ie({
|
|
298
|
+
onReady: () => {
|
|
299
|
+
if (j || u(f) !== me.displayList) return;
|
|
300
|
+
let e = P.value;
|
|
301
|
+
e && X(e.state, { reason: "layout-input" });
|
|
302
|
+
},
|
|
303
|
+
onError: (e) => {
|
|
304
|
+
!j && u(f) === me.displayList && D?.(e);
|
|
305
|
+
}
|
|
306
|
+
});
|
|
302
307
|
function X(e, t = {}) {
|
|
303
308
|
if (N) return;
|
|
304
|
-
let n =
|
|
305
|
-
|
|
306
|
-
let
|
|
309
|
+
let n = u(f), r = n === me.displayList ? wt() : void 0;
|
|
310
|
+
if (n === me.displayList && !r) return;
|
|
311
|
+
let i = a.value, o = i instanceof HTMLDivElement ? i : null, s = k.value, c = s && y(s), d = c?.package.document, p = d?.sections?.[0]?.properties ?? d?.finalSectionProperties ?? null, m = ne(p), h = te(p), re = ct(p), ie = m.w - h.left - h.right;
|
|
312
|
+
B.value = ie;
|
|
313
|
+
let ae = c?.package.styles ?? null, x = s?.package.theme ?? null, S = s?.package.settings?.defaultTabStop, C = s?.package.settings?.mirrorMargins === !0, w = Me(c?.package);
|
|
307
314
|
try {
|
|
308
|
-
|
|
309
|
-
contentWidth:
|
|
310
|
-
columns:
|
|
311
|
-
pageSize:
|
|
312
|
-
margins:
|
|
315
|
+
Ct(le({
|
|
316
|
+
contentWidth: ie,
|
|
317
|
+
columns: re,
|
|
318
|
+
pageSize: m,
|
|
319
|
+
margins: h,
|
|
313
320
|
pageGap: l,
|
|
314
321
|
showMarginGuides: u(v) === !0,
|
|
315
|
-
marginGuideColor: u(
|
|
316
|
-
...
|
|
317
|
-
let e = u(f);
|
|
318
|
-
return e === void 0 ? {} : { pageRenderer: e };
|
|
319
|
-
})(),
|
|
322
|
+
marginGuideColor: u(b),
|
|
323
|
+
...r ? { displayListPagePainter: r } : {},
|
|
320
324
|
syncCoordinator: K,
|
|
321
325
|
headerContent: w.headerContent,
|
|
322
326
|
footerContent: w.footerContent,
|
|
@@ -326,48 +330,48 @@ function V(e) {
|
|
|
326
330
|
footerContentRId: w.activeFooterRId,
|
|
327
331
|
firstPageHeaderContentRId: w.activeFirstHeaderRId,
|
|
328
332
|
firstPageFooterContentRId: w.activeFirstFooterRId,
|
|
329
|
-
sectionHeaderFooterRefs:
|
|
330
|
-
theme:
|
|
331
|
-
sectionProperties:
|
|
332
|
-
document:
|
|
333
|
-
defaultTabStop:
|
|
333
|
+
sectionHeaderFooterRefs: Ce(c),
|
|
334
|
+
theme: x,
|
|
335
|
+
sectionProperties: p,
|
|
336
|
+
document: s,
|
|
337
|
+
defaultTabStop: S,
|
|
334
338
|
mirrorMargins: C,
|
|
335
|
-
styles:
|
|
336
|
-
layout:
|
|
337
|
-
hfPMs:
|
|
338
|
-
painter:
|
|
339
|
-
pagesContainer:
|
|
339
|
+
styles: ae,
|
|
340
|
+
layout: z.value,
|
|
341
|
+
hfPMs: St,
|
|
342
|
+
painter: xt,
|
|
343
|
+
pagesContainer: o,
|
|
340
344
|
session: q,
|
|
341
|
-
renderHfFromContentOrPm:
|
|
342
|
-
renderHeaderFooterContentByRId:
|
|
345
|
+
renderHfFromContentOrPm: lt,
|
|
346
|
+
renderHeaderFooterContentByRId: ut,
|
|
343
347
|
readFontSetSignature: oe,
|
|
344
|
-
buildFootnoteRenderItems:
|
|
345
|
-
describeInvalidHighlightMarks:
|
|
346
|
-
emptyTemplatePreviewEntries:
|
|
347
|
-
emptyTemplatePreviewHidden:
|
|
348
|
-
hyphenationReadiness:
|
|
348
|
+
buildFootnoteRenderItems: dt,
|
|
349
|
+
describeInvalidHighlightMarks: ft,
|
|
350
|
+
emptyTemplatePreviewEntries: ot,
|
|
351
|
+
emptyTemplatePreviewHidden: st,
|
|
352
|
+
hyphenationReadiness: bt,
|
|
349
353
|
markupView: u(ee),
|
|
350
354
|
showCommentHighlights: u(g),
|
|
351
355
|
..._ === void 0 ? {} : { altChunkMarkerText: u(_) }
|
|
352
356
|
}, e, t));
|
|
353
357
|
} catch (e) {
|
|
354
358
|
let t = e instanceof Error ? e : Error(String(e));
|
|
355
|
-
|
|
359
|
+
D?.(t);
|
|
356
360
|
}
|
|
357
361
|
}
|
|
358
|
-
let Z =
|
|
362
|
+
let Z = E({
|
|
359
363
|
readState: () => P.value?.state ?? null,
|
|
360
364
|
runLayout: (e, t) => X(e, t),
|
|
361
|
-
...
|
|
362
|
-
clock:
|
|
365
|
+
...ue,
|
|
366
|
+
clock: de
|
|
363
367
|
}), Q = null;
|
|
364
368
|
function Tt() {
|
|
365
369
|
if (Q !== null && (window.clearTimeout(Q), Q = null), P.value && k.value) try {
|
|
366
370
|
let e = $.readCanonicalDocument();
|
|
367
371
|
if (!e) return;
|
|
368
|
-
k.value = e, Y(), Dt(),
|
|
372
|
+
k.value = e, Y(), Dt(), mt(e);
|
|
369
373
|
} catch (e) {
|
|
370
|
-
|
|
374
|
+
D?.(e instanceof Error ? e : Error(String(e)));
|
|
371
375
|
}
|
|
372
376
|
}
|
|
373
377
|
let Et = null;
|
|
@@ -378,42 +382,42 @@ function V(e) {
|
|
|
378
382
|
Dt(), Et = window.setTimeout(() => {
|
|
379
383
|
if (Et = null, Q !== null) return;
|
|
380
384
|
let e = k.value;
|
|
381
|
-
e &&
|
|
382
|
-
},
|
|
385
|
+
e && mt(e);
|
|
386
|
+
}, ae);
|
|
383
387
|
}
|
|
384
388
|
function kt() {
|
|
385
389
|
Q !== null && window.clearTimeout(Q), Q = window.setTimeout(() => {
|
|
386
390
|
Q = null, Tt();
|
|
387
|
-
},
|
|
391
|
+
}, ae);
|
|
388
392
|
}
|
|
389
393
|
let $ = m({
|
|
390
394
|
getHost: () => t.value,
|
|
391
395
|
getDocument: () => k.value,
|
|
392
|
-
getStyles:
|
|
393
|
-
getExtensionManager: () =>
|
|
394
|
-
getExternalPlugins:
|
|
395
|
-
getAnonymizationTerms: () =>
|
|
396
|
-
getDerivedFields: () =>
|
|
397
|
-
getCanonicalRoom:
|
|
396
|
+
getStyles: Qe,
|
|
397
|
+
getExtensionManager: () => W,
|
|
398
|
+
getExternalPlugins: yt,
|
|
399
|
+
getAnonymizationTerms: () => Le?.() ?? re,
|
|
400
|
+
getDerivedFields: () => Re?.(),
|
|
401
|
+
getCanonicalRoom: I,
|
|
398
402
|
getReadOnly: () => u(o),
|
|
399
|
-
getHistoryShortcuts: () =>
|
|
400
|
-
onCanonicalHistory: (e) =>
|
|
401
|
-
onCanonicalHistoryDrop: (e) =>
|
|
402
|
-
getEditingMode: () => u(
|
|
403
|
+
getHistoryShortcuts: () => Ne,
|
|
404
|
+
onCanonicalHistory: (e) => Pe?.(e),
|
|
405
|
+
onCanonicalHistoryDrop: (e) => Fe?.(e),
|
|
406
|
+
getEditingMode: () => u(be) ?? "editing",
|
|
403
407
|
getSuggestionAuthor: Ze,
|
|
404
408
|
onSessionRefusal: (e, t, n) => {
|
|
405
|
-
|
|
409
|
+
D?.(n ?? new p({
|
|
406
410
|
ground: t,
|
|
407
411
|
message: e
|
|
408
412
|
}));
|
|
409
413
|
},
|
|
410
|
-
getDocumentIdentity: () => String(
|
|
414
|
+
getDocumentIdentity: () => String(A),
|
|
411
415
|
getDocumentContext: () => k.value,
|
|
412
416
|
onTransaction: jt,
|
|
413
417
|
onCanonicalCompositionLayout: Mt,
|
|
414
418
|
getEmbeddedFontFamilyMap: () => q.embeddedFontFamilyMap,
|
|
415
419
|
onSelectionChange: (e) => {
|
|
416
|
-
F.value = e,
|
|
420
|
+
F.value = e, Ue?.(e), G.emit("selectionChange", {
|
|
417
421
|
from: e.selection.from,
|
|
418
422
|
to: e.selection.to
|
|
419
423
|
});
|
|
@@ -425,19 +429,19 @@ function V(e) {
|
|
|
425
429
|
onReadOnlyEditAttempt: () => qe?.(),
|
|
426
430
|
onEditorViewReady: Nt,
|
|
427
431
|
onEditorViewDestroy: () => {
|
|
428
|
-
P.value = null,
|
|
432
|
+
P.value = null, V.value = !1, We?.(null);
|
|
429
433
|
},
|
|
430
434
|
onRemoteSelectionsChange: (e) => {
|
|
431
|
-
|
|
435
|
+
L.value = e;
|
|
432
436
|
}
|
|
433
437
|
}), At = $.api.autocomplete.subscribe((t) => e.onAutocompleteChange?.(t));
|
|
434
|
-
d(() => u(
|
|
435
|
-
|
|
438
|
+
d(() => u(Ie), () => {
|
|
439
|
+
L.value = [], $.retryViewCreation(), $.syncExternalDocument();
|
|
436
440
|
}, { immediate: !0 });
|
|
437
441
|
function jt({ newState: e, docChanged: t }) {
|
|
438
442
|
if (F.value = e, t) {
|
|
439
443
|
let e = $.readCanonicalDocument();
|
|
440
|
-
e && (k.value = e, Y()),
|
|
444
|
+
e && (k.value = e, Y()), U.value = !0, K.incrementStateSeq(), Z.schedule(), kt();
|
|
441
445
|
}
|
|
442
446
|
K.requestRender();
|
|
443
447
|
}
|
|
@@ -446,13 +450,13 @@ function V(e) {
|
|
|
446
450
|
e && (F.value = e.state), K.incrementStateSeq(), Z.schedule(), K.requestRender();
|
|
447
451
|
}
|
|
448
452
|
function Nt(e) {
|
|
449
|
-
P.value = e, F.value = e.state,
|
|
450
|
-
let t = k.value, n =
|
|
453
|
+
P.value = e, F.value = e.state, V.value = !0;
|
|
454
|
+
let t = k.value, n = A, r = ++M;
|
|
451
455
|
N = !0;
|
|
452
456
|
let i = () => {
|
|
453
|
-
M === r && (N = !1,
|
|
457
|
+
M === r && (N = !1, j || A !== n || $.getView() !== e || (X(e.state, { reason: "initial" }), K.requestRender()));
|
|
454
458
|
};
|
|
455
|
-
|
|
459
|
+
w(t, e.state.doc).then(i, i), We?.(e), u(o) || requestAnimationFrame(() => {
|
|
456
460
|
P.value === e && !e.hasFocus() && e.focus();
|
|
457
461
|
});
|
|
458
462
|
}
|
|
@@ -463,32 +467,32 @@ function V(e) {
|
|
|
463
467
|
},
|
|
464
468
|
loadDocument: Ht,
|
|
465
469
|
loadDocx: Vt
|
|
466
|
-
}, Ft =
|
|
470
|
+
}, Ft = S({
|
|
467
471
|
getEditorApi: () => $.api,
|
|
468
|
-
getLayout: () =>
|
|
472
|
+
getLayout: () => z.value,
|
|
469
473
|
runLayout: (e, t) => X(e, t),
|
|
470
474
|
getDocumentIO: () => Pt,
|
|
471
475
|
emitter: G
|
|
472
476
|
});
|
|
473
|
-
d([() => u(
|
|
474
|
-
Ft.setCanonicalMode(u(
|
|
477
|
+
d([() => u(be), Ze], () => {
|
|
478
|
+
Ft.setCanonicalMode(u(be) === "suggesting" ? {
|
|
475
479
|
type: "suggesting",
|
|
476
480
|
author: Ze()
|
|
477
481
|
} : { type: "editing" });
|
|
478
482
|
}), d(() => u(o), (e) => {
|
|
479
|
-
$.syncEditable(), e && en(),
|
|
483
|
+
$.syncEditable(), e && en(), St.sync();
|
|
480
484
|
});
|
|
481
485
|
function It(e) {
|
|
482
|
-
let t =
|
|
483
|
-
if (t === e.state.plugins.includes(
|
|
484
|
-
let n = e.state.plugins.filter((e) => e !==
|
|
486
|
+
let t = vt();
|
|
487
|
+
if (t === e.state.plugins.includes(ht)) return;
|
|
488
|
+
let n = e.state.plugins.filter((e) => e !== ht && e !== gt);
|
|
485
489
|
if (t) {
|
|
486
|
-
let e = n.indexOf(
|
|
487
|
-
n.splice(t, 0,
|
|
490
|
+
let e = n.indexOf(_t), t = e === -1 ? n.length : e;
|
|
491
|
+
n.splice(t, 0, ht, gt);
|
|
488
492
|
}
|
|
489
493
|
e.updateState(e.state.reconfigure({ plugins: n }));
|
|
490
494
|
}
|
|
491
|
-
d(() =>
|
|
495
|
+
d(() => vt(), () => {
|
|
492
496
|
let e = P.value;
|
|
493
497
|
e && It(e);
|
|
494
498
|
});
|
|
@@ -496,27 +500,27 @@ function V(e) {
|
|
|
496
500
|
$.ensureView();
|
|
497
501
|
}
|
|
498
502
|
function Rt() {
|
|
499
|
-
Dt(),
|
|
503
|
+
Dt(), A += 1, $e.value = k.value?.originalBuffer ?? null, U.value = !1, et.value = null, R.value = null, J.activate(null), Z.dispose(), $.destroyView(), $.ensureView(), Y(), $.ensureView(), $.getView() || zt();
|
|
500
504
|
}
|
|
501
505
|
function zt() {
|
|
502
506
|
let e = k.value;
|
|
503
507
|
if (e) try {
|
|
504
508
|
let t = h({
|
|
505
509
|
document: e,
|
|
506
|
-
styles:
|
|
507
|
-
manager:
|
|
508
|
-
externalPlugins:
|
|
510
|
+
styles: y(e).package.styles ?? null,
|
|
511
|
+
manager: W,
|
|
512
|
+
externalPlugins: yt(),
|
|
509
513
|
reason: "mount"
|
|
510
514
|
});
|
|
511
515
|
F.value = t;
|
|
512
|
-
let n =
|
|
516
|
+
let n = A, r = ++M;
|
|
513
517
|
N = !0;
|
|
514
518
|
let i = () => {
|
|
515
|
-
M === r && (N = !1,
|
|
519
|
+
M === r && (N = !1, j || A !== n || k.value !== e || $.getView() || X(t, { reason: "initial" }));
|
|
516
520
|
};
|
|
517
|
-
|
|
521
|
+
w(e, t.doc).then(i, i);
|
|
518
522
|
} catch (e) {
|
|
519
|
-
|
|
523
|
+
D?.(e instanceof Error ? e : Error(String(e)));
|
|
520
524
|
}
|
|
521
525
|
}
|
|
522
526
|
d([
|
|
@@ -529,26 +533,26 @@ function V(e) {
|
|
|
529
533
|
}, { flush: "post" });
|
|
530
534
|
let Bt = 0;
|
|
531
535
|
async function Vt(e) {
|
|
532
|
-
Bt += 1,
|
|
536
|
+
Bt += 1, H.value = null, V.value = !1;
|
|
533
537
|
try {
|
|
534
|
-
let t = await
|
|
538
|
+
let t = await ge(e, { password: u(ve) });
|
|
535
539
|
if (t.isErr()) throw t.error;
|
|
536
540
|
let n = t.value.document;
|
|
537
541
|
k.value = n, Rt();
|
|
538
542
|
} catch (e) {
|
|
539
543
|
let t = e instanceof Error ? e : Error(String(e));
|
|
540
|
-
|
|
544
|
+
H.value = t.message, D?.(t);
|
|
541
545
|
}
|
|
542
546
|
}
|
|
543
547
|
function Ht(e) {
|
|
544
548
|
let t = Bt += 1;
|
|
545
|
-
|
|
546
|
-
let n =
|
|
547
|
-
|
|
549
|
+
H.value = null;
|
|
550
|
+
let n = tt(e);
|
|
551
|
+
he(n) ? Wt(n) : Ut(n, t);
|
|
548
552
|
}
|
|
549
553
|
async function Ut(e, t) {
|
|
550
|
-
let n = await
|
|
551
|
-
t === Bt && (n.isErr() ? (
|
|
554
|
+
let n = await _e(e);
|
|
555
|
+
t === Bt && (n.isErr() ? (H.value = n.error.message, D?.(n.error)) : Wt(n.value));
|
|
552
556
|
}
|
|
553
557
|
function Wt(e) {
|
|
554
558
|
k.value = e, Rt();
|
|
@@ -564,12 +568,12 @@ function V(e) {
|
|
|
564
568
|
options: e,
|
|
565
569
|
featureFlags: n
|
|
566
570
|
});
|
|
567
|
-
for (let t of a.diagnostics) e?.onDiagnostic ||
|
|
571
|
+
for (let t of a.diagnostics) e?.onDiagnostic || D?.(r(t));
|
|
568
572
|
return a;
|
|
569
573
|
}
|
|
570
574
|
return null;
|
|
571
575
|
} catch (e) {
|
|
572
|
-
return
|
|
576
|
+
return D?.(e instanceof Error ? e : Error(String(e))), null;
|
|
573
577
|
}
|
|
574
578
|
}
|
|
575
579
|
async function Kt(e) {
|
|
@@ -577,12 +581,12 @@ function V(e) {
|
|
|
577
581
|
onDiagnostic: e?.onDiagnostic,
|
|
578
582
|
onSelectiveDecline: e?.onSelectiveDecline,
|
|
579
583
|
onSerializationPath: e?.onSerializationPath,
|
|
580
|
-
mode: e?.selective === !1 ?
|
|
584
|
+
mode: e?.selective === !1 ? x.full : x.preferSelective
|
|
581
585
|
});
|
|
582
586
|
return r ? (P.value === t && t?.state.doc === n?.doc && (r.version === void 0 || $.api.isCanonicalSaveCurrent(r.version)) && (r.version !== void 0 && $.api.markCanonicalSaved(r.version, {
|
|
583
587
|
buffer: r.buffer,
|
|
584
588
|
path: r.path
|
|
585
|
-
}), k.value = r.document, Y(),
|
|
589
|
+
}), k.value = r.document, Y(), U.value = !1), r.tripwireResult && Ye?.(r.tripwireResult), new Blob([r.buffer], { type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" })) : null;
|
|
586
590
|
}
|
|
587
591
|
function qt() {
|
|
588
592
|
return $.readCanonicalDocument();
|
|
@@ -592,30 +596,30 @@ function V(e) {
|
|
|
592
596
|
}
|
|
593
597
|
function Yt() {
|
|
594
598
|
let e = Jt();
|
|
595
|
-
return e &&
|
|
599
|
+
return e && pt(e);
|
|
596
600
|
}
|
|
597
601
|
function Xt(e) {
|
|
598
|
-
|
|
602
|
+
Ht(e);
|
|
599
603
|
}
|
|
600
604
|
function Zt(e) {
|
|
601
|
-
return
|
|
605
|
+
return St.getView(e);
|
|
602
606
|
}
|
|
603
607
|
function Qt() {
|
|
604
608
|
Y();
|
|
605
609
|
}
|
|
606
610
|
function $t(e) {
|
|
607
611
|
let t = J.activate(e);
|
|
608
|
-
t && (
|
|
612
|
+
t && (R.value = e, requestAnimationFrame(() => t.focus()));
|
|
609
613
|
}
|
|
610
614
|
function en() {
|
|
611
|
-
J.activate(null),
|
|
615
|
+
J.activate(null), R.value = null;
|
|
612
616
|
}
|
|
613
617
|
function tn() {
|
|
614
|
-
let e =
|
|
618
|
+
let e = R.value;
|
|
615
619
|
return e ? J.getView(e) : null;
|
|
616
620
|
}
|
|
617
621
|
function nn() {
|
|
618
|
-
return
|
|
622
|
+
return W.getCommands();
|
|
619
623
|
}
|
|
620
624
|
function rn() {
|
|
621
625
|
let e = tn();
|
|
@@ -627,14 +631,14 @@ function V(e) {
|
|
|
627
631
|
}
|
|
628
632
|
d([
|
|
629
633
|
() => u(v),
|
|
630
|
-
() => u(
|
|
634
|
+
() => u(b),
|
|
631
635
|
() => u(f),
|
|
632
636
|
() => u(ee),
|
|
633
637
|
() => u(g),
|
|
634
638
|
() => u(_)
|
|
635
639
|
], () => an());
|
|
636
640
|
function on() {
|
|
637
|
-
|
|
641
|
+
j = !0, a.value && Te(a.value), M += 1, N = !1, Z.dispose(), Q !== null && (window.clearTimeout(Q), Q = null), Dt(), $.destroyView(), L.value = [], St.destroy(), J.destroy(), W.destroy(), F.value = null, z.value = null, k.value = null, $e.value = null, V.value = !1;
|
|
638
642
|
}
|
|
639
643
|
return i(() => {
|
|
640
644
|
on(), At();
|
|
@@ -645,19 +649,19 @@ function V(e) {
|
|
|
645
649
|
editor: Ft,
|
|
646
650
|
editorView: P,
|
|
647
651
|
editorState: F,
|
|
648
|
-
remoteSelections:
|
|
649
|
-
headerFooterSelection:
|
|
650
|
-
activeNoteStory:
|
|
651
|
-
isReady:
|
|
652
|
-
isDirty:
|
|
653
|
-
parseError:
|
|
652
|
+
remoteSelections: L,
|
|
653
|
+
headerFooterSelection: et,
|
|
654
|
+
activeNoteStory: R,
|
|
655
|
+
isReady: V,
|
|
656
|
+
isDirty: U,
|
|
657
|
+
parseError: H,
|
|
654
658
|
modelDocument: k,
|
|
655
659
|
readDocumentModel: qt,
|
|
656
|
-
sourceBuffer:
|
|
657
|
-
hiddenEditorWidth:
|
|
658
|
-
layout:
|
|
659
|
-
blocks:
|
|
660
|
-
measures:
|
|
660
|
+
sourceBuffer: $e,
|
|
661
|
+
hiddenEditorWidth: B,
|
|
662
|
+
layout: z,
|
|
663
|
+
blocks: nt,
|
|
664
|
+
measures: rt,
|
|
661
665
|
syncCoordinator: K,
|
|
662
666
|
loadBuffer: Vt,
|
|
663
667
|
loadDocument: Ht,
|
|
@@ -677,15 +681,15 @@ function V(e) {
|
|
|
677
681
|
};
|
|
678
682
|
}
|
|
679
683
|
// src/composables/useFindReplace.ts
|
|
680
|
-
function
|
|
681
|
-
let g = new
|
|
684
|
+
function U({ editorView: t, pagesRef: n, getDocument: r, layout: a, commentRoot: l, revealComment: u, displayMode: f, readOnly: p, onReadonlyEditAttempt: m, onResultChange: h }) {
|
|
685
|
+
let g = new Fe(), _ = s(""), te = s(""), ne = o(Ve()), v = c([]), y = s(-1), b = e(() => v.value.at(y.value) ?? null), re = () => ee({
|
|
682
686
|
editingMode: t.value?.editable === !1 ? "viewing" : "editing",
|
|
683
687
|
readOnlyProp: p.value,
|
|
684
688
|
displayMode: f.value
|
|
685
|
-
}),
|
|
689
|
+
}), ie = e(re), ae = e(() => {
|
|
686
690
|
let e = b.value;
|
|
687
|
-
return
|
|
688
|
-
}),
|
|
691
|
+
return re() === null && !!t.value && !!e && w() && He(e).status === "allowed";
|
|
692
|
+
}), x = null, S, C = null, oe = (e) => {
|
|
689
693
|
let n = t.value?.state.doc;
|
|
690
694
|
return {
|
|
691
695
|
query: _.value,
|
|
@@ -696,54 +700,54 @@ function H({ editorView: t, pagesRef: n, getDocument: r, layout: a, commentRoot:
|
|
|
696
700
|
},
|
|
697
701
|
document: e,
|
|
698
702
|
...n ? { bodyVersion: n } : {},
|
|
699
|
-
context: { renderedStories:
|
|
703
|
+
context: { renderedStories: Be(a.value) }
|
|
700
704
|
};
|
|
701
|
-
},
|
|
705
|
+
}, w = () => {
|
|
702
706
|
let e = r();
|
|
703
|
-
return !!e &&
|
|
704
|
-
}, se = () => g.getResult(),
|
|
705
|
-
clearTimeout(
|
|
707
|
+
return !!e && Ue(C, D(oe(e)));
|
|
708
|
+
}, se = () => g.getResult(), T = () => h(se()), ce = () => {
|
|
709
|
+
clearTimeout(S), S = void 0;
|
|
710
|
+
}, le = () => {
|
|
711
|
+
ce(), g.clear(), x?.destroy(), x = null, v.value = [], C = null, y.value = -1;
|
|
706
712
|
}, ue = () => {
|
|
707
|
-
le(),
|
|
708
|
-
}, de = () => {
|
|
709
|
-
|
|
710
|
-
}, fe = (e) => (y.value = e, C?.navigate(e, u), ce(), !0), T = (e = "query") => {
|
|
711
|
-
le();
|
|
713
|
+
le(), _.value = "", T();
|
|
714
|
+
}, de = (e) => (y.value = e, x?.navigate(e, u), T(), !0), E = (e = "query") => {
|
|
715
|
+
ce();
|
|
712
716
|
let i = r(), o = n.value, s = t.value?.state.doc;
|
|
713
|
-
if (!i || !_.value.trim()) return
|
|
714
|
-
let c =
|
|
717
|
+
if (!i || !_.value.trim()) return ue(), [];
|
|
718
|
+
let c = oe(i), u = Ie({
|
|
715
719
|
document: c.document,
|
|
716
720
|
state: t.value?.state ?? null,
|
|
717
721
|
searchText: c.query,
|
|
718
722
|
options: c.options,
|
|
719
723
|
context: c.context
|
|
720
724
|
});
|
|
721
|
-
if (u === null) return
|
|
722
|
-
let d =
|
|
723
|
-
return
|
|
725
|
+
if (u === null) return le(), T(), [];
|
|
726
|
+
let d = D(c), f = e === "refresh" && C?.query === d.query, p = g.setMatches(u, f ? g.getResult()?.currentIndex ?? 0 : 0);
|
|
727
|
+
return C = d, v.value = u, y.value = u.length > 0 ? p.currentIndex : -1, x?.destroy(), x = o ? ze({
|
|
724
728
|
container: o,
|
|
725
729
|
document: i,
|
|
726
730
|
bodyDoc: s,
|
|
727
731
|
matches: u,
|
|
728
732
|
commentRoot: l?.value ?? void 0,
|
|
729
733
|
layout: a.value
|
|
730
|
-
}) : null,
|
|
731
|
-
},
|
|
732
|
-
|
|
733
|
-
},
|
|
734
|
+
}) : null, x?.paint(y.value), u.at(0) && !f ? de(0) : T(), u;
|
|
735
|
+
}, fe = () => {
|
|
736
|
+
ce(), S = setTimeout(() => E("refresh"), 120);
|
|
737
|
+
}, pe = (e, t) => (_.value = e, Object.assign(ne, Ve(), t), E(), se()), me = (e) => {
|
|
734
738
|
let t = g.goTo(e);
|
|
735
|
-
return t ?
|
|
736
|
-
},
|
|
739
|
+
return t ? de(t.index) : !1;
|
|
740
|
+
}, he = (e) => {
|
|
737
741
|
let t = g.navigate(e);
|
|
738
|
-
return t ? (
|
|
739
|
-
},
|
|
740
|
-
let e =
|
|
742
|
+
return t ? (de(t.index), t.match) : null;
|
|
743
|
+
}, ge = () => !w() && (E("refresh"), !0), _e = () => {
|
|
744
|
+
let e = re();
|
|
741
745
|
return e !== null && (m?.(e), !0);
|
|
742
746
|
};
|
|
743
747
|
return d(f, () => {
|
|
744
|
-
_.value.trim() &&
|
|
748
|
+
_.value.trim() && E();
|
|
745
749
|
}), i(() => {
|
|
746
|
-
|
|
750
|
+
ce(), x?.destroy();
|
|
747
751
|
}), {
|
|
748
752
|
searchText: _,
|
|
749
753
|
replaceText: te,
|
|
@@ -751,36 +755,36 @@ function H({ editorView: t, pagesRef: n, getDocument: r, layout: a, commentRoot:
|
|
|
751
755
|
matches: v,
|
|
752
756
|
currentIndex: y,
|
|
753
757
|
currentMatch: b,
|
|
754
|
-
canReplaceCurrent:
|
|
755
|
-
replacementRefusal:
|
|
756
|
-
performSearch:
|
|
757
|
-
scheduleSearch:
|
|
758
|
-
find:
|
|
758
|
+
canReplaceCurrent: ae,
|
|
759
|
+
replacementRefusal: ie,
|
|
760
|
+
performSearch: E,
|
|
761
|
+
scheduleSearch: fe,
|
|
762
|
+
find: pe,
|
|
759
763
|
getFindResult: se,
|
|
760
|
-
goToMatch:
|
|
761
|
-
findNext: () =>
|
|
762
|
-
findPrevious: () =>
|
|
764
|
+
goToMatch: me,
|
|
765
|
+
findNext: () => he("next"),
|
|
766
|
+
findPrevious: () => he("previous"),
|
|
763
767
|
replaceCurrent: () => {
|
|
764
768
|
let e = t.value;
|
|
765
|
-
if (!e ||
|
|
769
|
+
if (!e || _e() || ge()) return !1;
|
|
766
770
|
let n = b.value;
|
|
767
|
-
if (!
|
|
768
|
-
let r = e.state.doc, i =
|
|
769
|
-
return e.state.doc !== r &&
|
|
771
|
+
if (!ae.value || !n) return !1;
|
|
772
|
+
let r = e.state.doc, i = Le(e, n, te.value);
|
|
773
|
+
return e.state.doc !== r && E("refresh"), i;
|
|
770
774
|
},
|
|
771
775
|
replaceAll: () => {
|
|
772
776
|
let e = t.value, n = v.value.length;
|
|
773
|
-
if (!e ||
|
|
777
|
+
if (!e || _e() || ge()) return {
|
|
774
778
|
replacedCount: 0,
|
|
775
779
|
skippedCount: n
|
|
776
780
|
};
|
|
777
|
-
let r = e.state.doc, i =
|
|
778
|
-
return e.state.doc !== r &&
|
|
781
|
+
let r = e.state.doc, i = Re(e, v.value, te.value);
|
|
782
|
+
return e.state.doc !== r && E(), i;
|
|
779
783
|
},
|
|
780
|
-
clear:
|
|
784
|
+
clear: ue
|
|
781
785
|
};
|
|
782
786
|
}
|
|
783
|
-
function
|
|
787
|
+
function pt(e, t) {
|
|
784
788
|
if (t < e.top + 40) {
|
|
785
789
|
let n = Math.max(0, e.top + 40 - t);
|
|
786
790
|
return -Math.min(12, n / 40 * 12);
|
|
@@ -792,7 +796,7 @@ function mt(e, t) {
|
|
|
792
796
|
return 0;
|
|
793
797
|
}
|
|
794
798
|
// src/composables/useDragAutoScroll.ts
|
|
795
|
-
function
|
|
799
|
+
function mt({ pagesContainer: e, onScrollExtendSelection: t }) {
|
|
796
800
|
let n = null, r = 0, a = 0, o = !1;
|
|
797
801
|
function s() {
|
|
798
802
|
return g(e.value);
|
|
@@ -804,7 +808,7 @@ function ht({ pagesContainer: e, onScrollExtendSelection: t }) {
|
|
|
804
808
|
if (!o) return;
|
|
805
809
|
let e = s();
|
|
806
810
|
if (!e) return;
|
|
807
|
-
let i =
|
|
811
|
+
let i = pt(e.getBoundingClientRect(), a);
|
|
808
812
|
i !== 0 && (_(e, i), t(r, a)), n = requestAnimationFrame(l);
|
|
809
813
|
}
|
|
810
814
|
function u() {
|
|
@@ -824,7 +828,7 @@ function ht({ pagesContainer: e, onScrollExtendSelection: t }) {
|
|
|
824
828
|
};
|
|
825
829
|
}
|
|
826
830
|
// src/composables/useTableResize.ts
|
|
827
|
-
function
|
|
831
|
+
function W({ runCommand: e }) {
|
|
828
832
|
let t = {
|
|
829
833
|
active: !1,
|
|
830
834
|
startX: 0,
|
|
@@ -857,7 +861,7 @@ function gt({ runCommand: e }) {
|
|
|
857
861
|
}
|
|
858
862
|
function o(e, a) {
|
|
859
863
|
let o = e.target;
|
|
860
|
-
return o instanceof HTMLElement ? o.classList.contains("layout-table-resize-handle") ? (e.preventDefault(), e.stopPropagation(), i = a, t.active = !0, t.startX = e.clientX, t.handle = o, o.classList.add("dragging"), t.columnIndex = parseInt(o.dataset.columnIndex ?? "0", 10), t.tablePmStart =
|
|
864
|
+
return o instanceof HTMLElement ? o.classList.contains("layout-table-resize-handle") ? (e.preventDefault(), e.stopPropagation(), i = a, t.active = !0, t.startX = e.clientX, t.handle = o, o.classList.add("dragging"), t.columnIndex = parseInt(o.dataset.columnIndex ?? "0", 10), t.tablePmStart = b(o) ?? 0, ht(a, t), !0) : o.classList.contains("layout-table-row-resize-handle") || o.classList.contains("layout-table-edge-handle-bottom") ? (e.preventDefault(), e.stopPropagation(), i = a, n.active = !0, n.startY = e.clientY, n.handle = o, n.isEdge = o.dataset.isEdge === "bottom", o.classList.add("dragging"), n.rowIndex = parseInt(o.dataset.rowIndex ?? "0", 10), n.tablePmStart = b(o) ?? 0, gt(a, n, o), !0) : o.classList.contains("layout-table-edge-handle-right") ? (e.preventDefault(), e.stopPropagation(), i = a, r.active = !0, r.startX = e.clientX, r.handle = o, o.classList.add("dragging"), r.columnIndex = parseInt(o.dataset.columnIndex ?? "0", 10), r.tablePmStart = b(o) ?? 0, _t(a, r), !0) : !1 : !1;
|
|
861
865
|
}
|
|
862
866
|
function s(e) {
|
|
863
867
|
if (t.active && t.handle) {
|
|
@@ -865,7 +869,7 @@ function gt({ runCommand: e }) {
|
|
|
865
869
|
let n = e.clientX - t.startX, r = parseFloat(t.handle.style.left);
|
|
866
870
|
t.handle.style.left = `${r + n}px`, t.startX = e.clientX;
|
|
867
871
|
let i = Math.round(n * O), a = t.origWidths.left + i, o = t.origWidths.right - i;
|
|
868
|
-
a >=
|
|
872
|
+
a >= We && o >= We && (t.origWidths = {
|
|
869
873
|
left: a,
|
|
870
874
|
right: o
|
|
871
875
|
});
|
|
@@ -884,7 +888,7 @@ function gt({ runCommand: e }) {
|
|
|
884
888
|
let t = e.clientX - r.startX, n = parseFloat(r.handle.style.left);
|
|
885
889
|
r.handle.style.left = `${n + t}px`, r.startX = e.clientX;
|
|
886
890
|
let i = Math.round(t * O), a = r.origWidth + i;
|
|
887
|
-
a >=
|
|
891
|
+
a >= We && (r.origWidth = a);
|
|
888
892
|
}
|
|
889
893
|
}
|
|
890
894
|
function c(a) {
|
|
@@ -914,11 +918,11 @@ function gt({ runCommand: e }) {
|
|
|
914
918
|
isResizing: a
|
|
915
919
|
};
|
|
916
920
|
}
|
|
917
|
-
function
|
|
921
|
+
function ht(e, t) {
|
|
918
922
|
let n = Ye(e, t.tablePmStart, t.columnIndex);
|
|
919
923
|
n && (t.origWidths = n);
|
|
920
924
|
}
|
|
921
|
-
function
|
|
925
|
+
function gt(e, t, n) {
|
|
922
926
|
let r = Xe(e, t.tablePmStart, t.rowIndex);
|
|
923
927
|
if (r != null) t.origHeight = r;
|
|
924
928
|
else {
|
|
@@ -927,24 +931,24 @@ function _t(e, t, n) {
|
|
|
927
931
|
}
|
|
928
932
|
t.minimumHeight = Math.min(Ge, t.origHeight);
|
|
929
933
|
}
|
|
930
|
-
function
|
|
934
|
+
function _t(e, t) {
|
|
931
935
|
let n = Je(e, t.tablePmStart, t.columnIndex);
|
|
932
936
|
n != null && (t.origWidth = n);
|
|
933
937
|
}
|
|
934
938
|
// src/composables/useTrackedChanges.ts
|
|
935
|
-
function
|
|
939
|
+
function vt(t, n) {
|
|
936
940
|
return e(() => {
|
|
937
941
|
n.value;
|
|
938
|
-
let e = t.value?.state ?? null, r =
|
|
942
|
+
let e = t.value?.state ?? null, r = Qe(e);
|
|
939
943
|
if (e === null) return r;
|
|
940
944
|
let i = {
|
|
941
|
-
accept:
|
|
942
|
-
reject:
|
|
945
|
+
accept: Ne(e, "accept"),
|
|
946
|
+
reject: Ne(e, "reject")
|
|
943
947
|
};
|
|
944
948
|
if (i.accept.size === 0 && i.reject.size === 0) return r;
|
|
945
949
|
let a = r.entries;
|
|
946
950
|
for (let e of a) {
|
|
947
|
-
let t =
|
|
951
|
+
let t = Pe(e);
|
|
948
952
|
e.heldByLock = {
|
|
949
953
|
accept: t.some((e) => i.accept.has(e)),
|
|
950
954
|
reject: t.some((e) => i.reject.has(e))
|
|
@@ -957,7 +961,7 @@ function yt(t, n) {
|
|
|
957
961
|
});
|
|
958
962
|
}
|
|
959
963
|
// src/composables/useZoom.ts
|
|
960
|
-
var
|
|
964
|
+
var yt = A, G = $e, K = [
|
|
961
965
|
.5,
|
|
962
966
|
.75,
|
|
963
967
|
1,
|
|
@@ -965,16 +969,16 @@ var W = j, bt = Qe, G = [
|
|
|
965
969
|
1.5,
|
|
966
970
|
2
|
|
967
971
|
];
|
|
968
|
-
function
|
|
969
|
-
let i = s(Math.max(
|
|
972
|
+
function q(t = 1) {
|
|
973
|
+
let i = s(Math.max(yt, Math.min(G, t))), a = e(() => Math.round(i.value * 100)), o = e(() => i.value <= yt), c = e(() => i.value >= G);
|
|
970
974
|
function l(e) {
|
|
971
|
-
i.value = Math.max(
|
|
975
|
+
i.value = Math.max(yt, Math.min(G, Math.round(e * 100) / 100));
|
|
972
976
|
}
|
|
973
977
|
function u() {
|
|
974
|
-
l(i.value +
|
|
978
|
+
l(i.value + j);
|
|
975
979
|
}
|
|
976
980
|
function d() {
|
|
977
|
-
l(i.value -
|
|
981
|
+
l(i.value - j);
|
|
978
982
|
}
|
|
979
983
|
function f() {
|
|
980
984
|
l(1);
|
|
@@ -1000,7 +1004,7 @@ function K(t = 1) {
|
|
|
1000
1004
|
handleWheel: p,
|
|
1001
1005
|
handleKeyDown: m,
|
|
1002
1006
|
installShortcuts: h,
|
|
1003
|
-
ZOOM_PRESETS:
|
|
1007
|
+
ZOOM_PRESETS: K
|
|
1004
1008
|
};
|
|
1005
1009
|
}
|
|
1006
|
-
export {
|
|
1010
|
+
export { mt as a, R as c, z as d, W as i, I as l, Qe as n, U as o, vt as r, H as s, q as t, et as u };
|