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