@stll/folio-vue 0.16.3 → 0.16.5
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.
|
@@ -4,8 +4,8 @@ import { createAnonymizationDecorationsPlugin as m } from "@stll/folio-core/pros
|
|
|
4
4
|
import { autocompleteSuggestionPlugin as h } from "@stll/folio-core/prosemirror/plugins/autocompleteSuggestion";
|
|
5
5
|
import { createTemplateDirectivesPlugin as g } from "@stll/folio-core/prosemirror/plugins/templateDirectives";
|
|
6
6
|
import { createSuggestionModePlugin as ee, setSuggestionMode as te } from "@stll/folio-core/prosemirror/plugins/suggestionMode";
|
|
7
|
-
import { FOLIO_DOCX_SERIALIZATION_MODE as _, createFolioEditor as
|
|
8
|
-
import { createFolioEditorEmitter as
|
|
7
|
+
import { FOLIO_DOCX_SERIALIZATION_MODE as _, createFolioEditor as v } from "@stll/folio-core/controller/folioEditor";
|
|
8
|
+
import { createFolioEditorEmitter as ne } from "@stll/folio-core/controller/folioEditorEvents";
|
|
9
9
|
import { loadCollaborationModules as re } from "@stll/folio-core/controller/collaborationModules";
|
|
10
10
|
import { createHeaderFooterEditorManager as ie } from "@stll/folio-core/controller/headerFooterEditorManager";
|
|
11
11
|
import { createNoteEditorManager as ae } from "@stll/folio-core/controller/noteEditorManager";
|
|
@@ -14,59 +14,59 @@ import { runLayoutPipeline as le } from "@stll/folio-core/controller/layoutPipel
|
|
|
14
14
|
import { browserClock as ue, createLayoutScheduler as de } from "@stll/folio-core/controller/layoutScheduler";
|
|
15
15
|
import { createLayoutSession as fe } from "@stll/folio-core/controller/layoutSession";
|
|
16
16
|
import { parseDocx as pe } from "@stll/folio-core/docx/parser";
|
|
17
|
-
import { getFootnoteText as
|
|
18
|
-
import { convertHeaderFooterPmDocToContent as
|
|
19
|
-
import { resolveSectionHeaderFooterRefs as
|
|
20
|
-
import { LayoutPainter as
|
|
21
|
-
import { LayoutSelectionGate as
|
|
22
|
-
import { getTransactionsDirtyRange as
|
|
23
|
-
import { fromProseDoc as
|
|
24
|
-
import { ExtensionManager as
|
|
25
|
-
import { getChangedParagraphIds as
|
|
26
|
-
import { createStarterKit as
|
|
27
|
-
import { createTemplatePreviewValuesPlugin as
|
|
28
|
-
import { templateSlashMenuPlugin as
|
|
29
|
-
import { resolveHeaderFooterContent as
|
|
30
|
-
import { findVerticalScrollParent as
|
|
31
|
-
import { MIN_CELL_WIDTH_TWIPS as
|
|
32
|
-
import { extractTrackedChanges as
|
|
33
|
-
import { ZOOM_MAX as
|
|
17
|
+
import { getFootnoteText as me } from "@stll/folio-core/docx/footnoteParser";
|
|
18
|
+
import { convertHeaderFooterPmDocToContent as he, convertHeaderFooterToContent as y } from "@stll/folio-core/layout-bridge/convert/headerFooterLayout";
|
|
19
|
+
import { resolveSectionHeaderFooterRefs as ge } from "@stll/folio-core/layout-engine";
|
|
20
|
+
import { LayoutPainter as _e } from "@stll/folio-core/layout-painter";
|
|
21
|
+
import { LayoutSelectionGate as ve } from "@stll/folio-core/paged-layout/LayoutSelectionGate";
|
|
22
|
+
import { getTransactionsDirtyRange as ye } from "@stll/folio-core/paged-layout/transactionDirtyRange";
|
|
23
|
+
import { fromProseDoc as be } from "@stll/folio-core/prosemirror/conversion/fromProseDoc";
|
|
24
|
+
import { ExtensionManager as xe } from "@stll/folio-core/prosemirror/extensions/ExtensionManager";
|
|
25
|
+
import { getChangedParagraphIds as Se, hasStructuralChanges as Ce, hasUntrackedChanges as we } from "@stll/folio-core/prosemirror/extensions/features/ParagraphChangeTrackerExtension";
|
|
26
|
+
import { createStarterKit as Te } from "@stll/folio-core/prosemirror/extensions/StarterKit";
|
|
27
|
+
import { createTemplatePreviewValuesPlugin as Ee } from "@stll/folio-core/prosemirror/plugins/templatePreviewValues";
|
|
28
|
+
import { templateSlashMenuPlugin as De } from "@stll/folio-core/prosemirror/plugins/templateSlashMenu";
|
|
29
|
+
import { resolveHeaderFooterContent as Oe } from "@stll/folio-core/utils/headerFooter";
|
|
30
|
+
import { findVerticalScrollParent as ke } from "@stll/folio-core/utils/findVerticalScrollParent";
|
|
31
|
+
import { MIN_CELL_WIDTH_TWIPS as b, MIN_ROW_HEIGHT_TWIPS as Ae, TWIPS_PER_PIXEL as x, commitColumnResize as S, commitRightEdgeResize as je, commitRowResize as Me, readColumnWidthAt as Ne, readColumnWidths as Pe, readRowHeight as C } from "@stll/folio-core/prosemirror/tableResize";
|
|
32
|
+
import { extractTrackedChanges as w } from "@stll/folio-core/prosemirror/utils/extractTrackedChanges";
|
|
33
|
+
import { ZOOM_MAX as T, ZOOM_MIN as Fe, ZOOM_STEP as Ie } from "@stll/folio-core/utils/zoom";
|
|
34
34
|
//#region src/utils/colorMode.ts
|
|
35
|
-
var
|
|
36
|
-
function
|
|
35
|
+
var Le = "(prefers-color-scheme: dark)";
|
|
36
|
+
function Re() {
|
|
37
37
|
return typeof window < "u" && typeof window.matchMedia == "function";
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function ze(e, t) {
|
|
40
40
|
return e === "dark" || e === "system" && t;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
if (!
|
|
44
|
-
let t = window.matchMedia(
|
|
42
|
+
function Be(e) {
|
|
43
|
+
if (!Re()) return () => {};
|
|
44
|
+
let t = window.matchMedia(Le);
|
|
45
45
|
e(t.matches);
|
|
46
46
|
let n = (t) => e(t.matches);
|
|
47
47
|
return t.addEventListener("change", n), () => t.removeEventListener("change", n);
|
|
48
48
|
}
|
|
49
49
|
//#endregion
|
|
50
50
|
//#region src/composables/useColorMode.ts
|
|
51
|
-
var
|
|
52
|
-
a(
|
|
53
|
-
},
|
|
54
|
-
t.provide(
|
|
51
|
+
var E = "light", D = Symbol("folioColorMode"), O = (t = E) => {
|
|
52
|
+
a(D, e(() => c(t)));
|
|
53
|
+
}, Ve = { install(t, n = E) {
|
|
54
|
+
t.provide(D, e(() => c(n)));
|
|
55
55
|
} };
|
|
56
|
-
function
|
|
57
|
-
let n = t(
|
|
56
|
+
function k() {
|
|
57
|
+
let n = t(D, e(() => E)), i = o(!1), a = o(!1);
|
|
58
58
|
return r(() => {
|
|
59
59
|
i.value = !0;
|
|
60
60
|
}), u((e) => {
|
|
61
|
-
!i.value || n.value !== "system" || e(
|
|
61
|
+
!i.value || n.value !== "system" || e(Be((e) => {
|
|
62
62
|
a.value = e;
|
|
63
63
|
}));
|
|
64
|
-
}), e(() =>
|
|
64
|
+
}), e(() => ze(n.value, i.value && a.value));
|
|
65
65
|
}
|
|
66
66
|
//#endregion
|
|
67
67
|
//#region src/composables/useDocxEditor.ts
|
|
68
|
-
var
|
|
69
|
-
function
|
|
68
|
+
var He = 24, Ue = 32, We = 96, Ge = 250, Ke = [];
|
|
69
|
+
function qe(e) {
|
|
70
70
|
let t = e?.columnCount ?? 1;
|
|
71
71
|
if (t <= 1) return;
|
|
72
72
|
let n = {
|
|
@@ -76,24 +76,24 @@ function We(e) {
|
|
|
76
76
|
};
|
|
77
77
|
return e?.separator !== void 0 && (n.separator = e.separator), n;
|
|
78
78
|
}
|
|
79
|
-
function
|
|
79
|
+
function Je(e, t, n, r, i, a) {
|
|
80
80
|
if (!e) return;
|
|
81
81
|
let o = t ? {
|
|
82
82
|
...a,
|
|
83
83
|
rId: t
|
|
84
84
|
} : a, s = t ? n?.getView(t) : null;
|
|
85
|
-
return s ?
|
|
85
|
+
return s ? he(s.state.doc, r, i, o) : y(e, r, i, o);
|
|
86
86
|
}
|
|
87
|
-
function
|
|
87
|
+
function Ye(e, t, n, r, i) {
|
|
88
88
|
if (!e || e.size === 0) return;
|
|
89
89
|
let a = /* @__PURE__ */ new Map();
|
|
90
90
|
for (let [o, s] of e) {
|
|
91
|
-
let e =
|
|
91
|
+
let e = Je(s, o, t, n, r, i);
|
|
92
92
|
e && a.set(o, e);
|
|
93
93
|
}
|
|
94
94
|
return a.size > 0 ? a : void 0;
|
|
95
95
|
}
|
|
96
|
-
function
|
|
96
|
+
function Xe(e, t, n) {
|
|
97
97
|
let r = /* @__PURE__ */ new Map();
|
|
98
98
|
if (!n || !n.package.footnotes) return r;
|
|
99
99
|
let i = /* @__PURE__ */ new Map();
|
|
@@ -107,7 +107,7 @@ function qe(e, t, n) {
|
|
|
107
107
|
e.push({
|
|
108
108
|
displayNumber: String(o),
|
|
109
109
|
noteId: n,
|
|
110
|
-
text:
|
|
110
|
+
text: me(r),
|
|
111
111
|
...a ? { content: {
|
|
112
112
|
blocks: a.blocks,
|
|
113
113
|
measures: a.measures,
|
|
@@ -119,7 +119,7 @@ function qe(e, t, n) {
|
|
|
119
119
|
}
|
|
120
120
|
return r;
|
|
121
121
|
}
|
|
122
|
-
var
|
|
122
|
+
var A = /* @__PURE__ */ new Set([
|
|
123
123
|
"black",
|
|
124
124
|
"blue",
|
|
125
125
|
"cyan",
|
|
@@ -138,58 +138,58 @@ var N = /* @__PURE__ */ new Set([
|
|
|
138
138
|
"white",
|
|
139
139
|
"yellow"
|
|
140
140
|
]);
|
|
141
|
-
function
|
|
141
|
+
function Ze(e) {
|
|
142
142
|
let t = [], n = (e, r) => {
|
|
143
|
-
for (let [n, i] of e.marks.entries()) i.type.name === "highlight" && !
|
|
143
|
+
for (let [n, i] of e.marks.entries()) i.type.name === "highlight" && !A.has(String(i.attrs.color)) && t.push(`${r}.marks[${n}]=${JSON.stringify(i.attrs)}`);
|
|
144
144
|
e.forEach((e, t, i) => {
|
|
145
145
|
n(e, `${r}.content[${i}]`);
|
|
146
146
|
});
|
|
147
147
|
};
|
|
148
148
|
return n(e, "doc"), t.join("; ");
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function Qe() {
|
|
151
151
|
return typeof document > "u" || !("fonts" in document) || document.fonts.status === "loaded";
|
|
152
152
|
}
|
|
153
|
-
function
|
|
154
|
-
let { hiddenContainer: t, hiddenHeaderFooterContainer: n, noteEditorContainer: r, pagesContainer: a, readOnly: u = !1, pageGap: p =
|
|
155
|
-
|
|
156
|
-
let
|
|
157
|
-
onChange: (e) =>
|
|
158
|
-
onKeyAction: (e) =>
|
|
159
|
-
}),
|
|
153
|
+
function j(e) {
|
|
154
|
+
let { hiddenContainer: t, hiddenHeaderFooterContainer: n, noteEditorContainer: r, pagesContainer: a, readOnly: u = !1, pageGap: p = He, pageRenderer: me, showMarginGuides: he, marginGuideColor: y, password: ke, editorMode: b, author: Ae, externalPlugins: x = [], collaboration: S, onAnonymizationMatchesChange: je, showTemplateDirectives: Me, onSlashMenuChange: Ne, onSlashMenuKeyAction: Pe, onChange: C, onError: w, onSelectionUpdate: T, onEditorViewReady: Fe, onCopy: Ie, onCut: Le, onPaste: Re, onReadOnlyEditAttempt: ze, featureFlags: Be, onSelectiveSaveTripwire: E } = e, D = n ?? t, O = s(null), Ve = 0, k = s(null), A = s(null), j = s(null), M = s([]), N = s(null), P = s(null), F = s(null), I = s([]), L = s([]), R = o(!1), z = o(null), B = o(!1), V = new xe(Te());
|
|
155
|
+
V.buildSchema(), V.initializeRuntime();
|
|
156
|
+
let $e = ee(!1), et = [$e], tt = h({ keymap: !0 }), nt = m({ onMatchesChange: (e) => je?.(e) }), H = g(), rt = De({
|
|
157
|
+
onChange: (e) => Ne?.(e),
|
|
158
|
+
onKeyAction: (e) => Pe?.(e) ?? !1
|
|
159
|
+
}), it = Ee(), U = () => c(Me) === !0;
|
|
160
160
|
function at() {
|
|
161
161
|
return [
|
|
162
|
-
et,
|
|
163
|
-
Qe,
|
|
164
|
-
...C,
|
|
165
|
-
...c(w)?.plugins ?? [],
|
|
166
162
|
tt,
|
|
167
|
-
|
|
168
|
-
|
|
163
|
+
$e,
|
|
164
|
+
...x,
|
|
165
|
+
...c(S)?.plugins ?? [],
|
|
166
|
+
nt,
|
|
167
|
+
...U() ? [H, rt] : [],
|
|
168
|
+
it
|
|
169
169
|
];
|
|
170
170
|
}
|
|
171
|
-
let W =
|
|
171
|
+
let W = ne(), G = new ve(), ot = fe(), st = new _e({
|
|
172
172
|
pageGap: p,
|
|
173
173
|
showShadow: !0
|
|
174
174
|
}), K = ie({
|
|
175
|
-
getHost: () =>
|
|
176
|
-
getDocument: () =>
|
|
177
|
-
getStyles: () =>
|
|
178
|
-
getTheme: () =>
|
|
175
|
+
getHost: () => D.value,
|
|
176
|
+
getDocument: () => O.value,
|
|
177
|
+
getStyles: () => O.value?.package.styles ?? null,
|
|
178
|
+
getTheme: () => O.value?.package.theme ?? null,
|
|
179
179
|
onTransaction: ({ rId: e, kind: t, view: n, docChanged: r, selectionChanged: i }) => {
|
|
180
180
|
if (r) {
|
|
181
|
-
|
|
182
|
-
let e =
|
|
181
|
+
B.value = !0;
|
|
182
|
+
let e = k.value;
|
|
183
183
|
e && Y.schedule(e.state, null);
|
|
184
184
|
}
|
|
185
185
|
if (r || i) {
|
|
186
186
|
let { from: r, to: i } = n.state.selection;
|
|
187
|
-
|
|
187
|
+
N.value = {
|
|
188
188
|
from: r,
|
|
189
189
|
kind: t,
|
|
190
190
|
rId: e,
|
|
191
191
|
to: i
|
|
192
|
-
},
|
|
192
|
+
}, T?.(n.state), W.emit("selectionChange", {
|
|
193
193
|
from: r,
|
|
194
194
|
to: i
|
|
195
195
|
});
|
|
@@ -198,23 +198,23 @@ function P(e) {
|
|
|
198
198
|
}
|
|
199
199
|
}), ct = { current: null }, q = ae({
|
|
200
200
|
getHost: () => r?.value ?? null,
|
|
201
|
-
getPlugins: () =>
|
|
202
|
-
getDocument: () =>
|
|
203
|
-
getStyles: () =>
|
|
204
|
-
getTheme: () =>
|
|
201
|
+
getPlugins: () => et,
|
|
202
|
+
getDocument: () => O.value,
|
|
203
|
+
getStyles: () => O.value?.package.styles ?? null,
|
|
204
|
+
getTheme: () => O.value?.package.theme ?? null,
|
|
205
205
|
onTransaction: ({ docChanged: e, selectionChanged: t, view: n }) => {
|
|
206
206
|
if (e) {
|
|
207
|
-
|
|
208
|
-
let e =
|
|
207
|
+
B.value = !0;
|
|
208
|
+
let e = O.value;
|
|
209
209
|
if (e) {
|
|
210
210
|
let t = ct.current?.snapshotDocument(e) ?? e;
|
|
211
|
-
|
|
211
|
+
O.value = t, C?.(t), W.emit("docChange", t);
|
|
212
212
|
}
|
|
213
|
-
let t =
|
|
213
|
+
let t = k.value;
|
|
214
214
|
t && Y.schedule(t.state, null);
|
|
215
215
|
}
|
|
216
216
|
if (e || t) {
|
|
217
|
-
|
|
217
|
+
T?.(n.state);
|
|
218
218
|
let { from: e, to: t } = n.state.selection;
|
|
219
219
|
W.emit("selectionChange", {
|
|
220
220
|
from: e,
|
|
@@ -225,10 +225,10 @@ function P(e) {
|
|
|
225
225
|
});
|
|
226
226
|
ct.current = q;
|
|
227
227
|
function lt(e) {
|
|
228
|
-
e.layout && (
|
|
228
|
+
e.layout && (F.value = e.layout), e.blocks && (I.value = e.blocks), e.measures && (L.value = e.measures), e.blockLookup && st.setBlockLookup(e.blockLookup), e.layout && W.emit("layoutComplete", e.layout);
|
|
229
229
|
}
|
|
230
230
|
function J(e, t = {}) {
|
|
231
|
-
let n = a.value, r = n instanceof HTMLDivElement ? n : null, i =
|
|
231
|
+
let n = a.value, r = n instanceof HTMLDivElement ? n : null, i = O.value, o = i?.package.document, s = o?.sections?.[0]?.properties ?? o?.finalSectionProperties ?? null, l = f(s), u = d(s), m = qe(s), h = l.w - u.left - u.right, g = i?.package.styles ?? null, ee = i?.package.theme ?? null, te = i?.package.settings?.defaultTabStop, _ = i?.package.settings?.mirrorMargins === !0, v = Oe(i?.package);
|
|
232
232
|
try {
|
|
233
233
|
lt(le({
|
|
234
234
|
contentWidth: h,
|
|
@@ -236,10 +236,10 @@ function P(e) {
|
|
|
236
236
|
pageSize: l,
|
|
237
237
|
margins: u,
|
|
238
238
|
pageGap: p,
|
|
239
|
-
showMarginGuides: c(
|
|
240
|
-
marginGuideColor: c(
|
|
239
|
+
showMarginGuides: c(he) === !0,
|
|
240
|
+
marginGuideColor: c(y),
|
|
241
241
|
...(() => {
|
|
242
|
-
let e = c(
|
|
242
|
+
let e = c(me);
|
|
243
243
|
return e === void 0 ? {} : { pageRenderer: e };
|
|
244
244
|
})(),
|
|
245
245
|
syncCoordinator: G,
|
|
@@ -251,136 +251,136 @@ function P(e) {
|
|
|
251
251
|
footerContentRId: v.activeFooterRId,
|
|
252
252
|
firstPageHeaderContentRId: v.activeFirstHeaderRId,
|
|
253
253
|
firstPageFooterContentRId: v.activeFirstFooterRId,
|
|
254
|
-
sectionHeaderFooterRefs:
|
|
254
|
+
sectionHeaderFooterRefs: ge(i),
|
|
255
255
|
theme: ee,
|
|
256
256
|
sectionProperties: s,
|
|
257
257
|
document: i,
|
|
258
258
|
defaultTabStop: te,
|
|
259
|
-
mirrorMargins:
|
|
259
|
+
mirrorMargins: _,
|
|
260
260
|
styles: g,
|
|
261
|
-
layout:
|
|
261
|
+
layout: F.value,
|
|
262
262
|
hfPMs: K,
|
|
263
263
|
painter: st,
|
|
264
264
|
pagesContainer: r,
|
|
265
265
|
session: ot,
|
|
266
|
-
renderHfFromContentOrPm:
|
|
267
|
-
renderHeaderFooterContentByRId:
|
|
268
|
-
documentFontsAreLoaded:
|
|
269
|
-
buildFootnoteRenderItems:
|
|
270
|
-
describeInvalidHighlightMarks:
|
|
271
|
-
emptyTemplatePreviewEntries:
|
|
266
|
+
renderHfFromContentOrPm: Je,
|
|
267
|
+
renderHeaderFooterContentByRId: Ye,
|
|
268
|
+
documentFontsAreLoaded: Qe,
|
|
269
|
+
buildFootnoteRenderItems: Xe,
|
|
270
|
+
describeInvalidHighlightMarks: Ze,
|
|
271
|
+
emptyTemplatePreviewEntries: Ke
|
|
272
272
|
}, e, t));
|
|
273
273
|
} catch (e) {
|
|
274
274
|
let t = e instanceof Error ? e : Error(String(e));
|
|
275
|
-
|
|
275
|
+
w?.(t);
|
|
276
276
|
}
|
|
277
277
|
}
|
|
278
278
|
let Y = de({
|
|
279
279
|
runLayout: (e, t) => J(e, t),
|
|
280
|
-
debounceMs:
|
|
281
|
-
maxDelayMs:
|
|
280
|
+
debounceMs: Ue,
|
|
281
|
+
maxDelayMs: We,
|
|
282
282
|
clock: ue
|
|
283
283
|
}), X = null;
|
|
284
284
|
function ut() {
|
|
285
285
|
X !== null && (window.clearTimeout(X), X = null);
|
|
286
|
-
let e =
|
|
286
|
+
let e = k.value, t = O.value;
|
|
287
287
|
if (!(!e || !t)) try {
|
|
288
|
-
let n =
|
|
289
|
-
|
|
288
|
+
let n = be(e.state.doc, t);
|
|
289
|
+
O.value = n, K.sync(), q.sync(), C?.(n), W.emit("docChange", n);
|
|
290
290
|
} catch (e) {
|
|
291
|
-
|
|
291
|
+
w?.(e instanceof Error ? e : Error(String(e)));
|
|
292
292
|
}
|
|
293
293
|
}
|
|
294
294
|
function dt() {
|
|
295
295
|
X !== null && window.clearTimeout(X), X = window.setTimeout(() => {
|
|
296
296
|
X = null, ut();
|
|
297
|
-
},
|
|
297
|
+
}, Ge);
|
|
298
298
|
}
|
|
299
299
|
let Z = se({
|
|
300
300
|
getHost: () => t.value,
|
|
301
|
-
getDocument: () =>
|
|
302
|
-
getStyles: () =>
|
|
303
|
-
getExtensionManager: () =>
|
|
301
|
+
getDocument: () => O.value,
|
|
302
|
+
getStyles: () => O.value?.package.styles ?? null,
|
|
303
|
+
getExtensionManager: () => V,
|
|
304
304
|
getExternalPlugins: at,
|
|
305
|
-
getCollaboration: () => c(
|
|
306
|
-
getCollaborationModules: () =>
|
|
305
|
+
getCollaboration: () => c(S),
|
|
306
|
+
getCollaborationModules: () => j.value,
|
|
307
307
|
getPrecomputedInitialState: () => null,
|
|
308
308
|
getReadOnly: () => c(u),
|
|
309
|
-
getDocumentIdentity: () => String(
|
|
310
|
-
getDocumentContext: () =>
|
|
309
|
+
getDocumentIdentity: () => String(Ve),
|
|
310
|
+
getDocumentContext: () => O.value,
|
|
311
311
|
onTransaction: ft,
|
|
312
312
|
onSelectionChange: (e) => {
|
|
313
|
-
|
|
313
|
+
A.value = e, T?.(e), W.emit("selectionChange", {
|
|
314
314
|
from: e.selection.from,
|
|
315
315
|
to: e.selection.to
|
|
316
316
|
});
|
|
317
317
|
},
|
|
318
318
|
onKeyDown: () => !1,
|
|
319
|
-
onCopy: () =>
|
|
320
|
-
onCut: () =>
|
|
321
|
-
onPaste: () =>
|
|
322
|
-
onReadOnlyEditAttempt: () =>
|
|
319
|
+
onCopy: () => Ie?.(),
|
|
320
|
+
onCut: () => Le?.(),
|
|
321
|
+
onPaste: () => Re?.(),
|
|
322
|
+
onReadOnlyEditAttempt: () => ze?.(),
|
|
323
323
|
onEditorViewReady: pt,
|
|
324
324
|
onEditorViewDestroy: () => {
|
|
325
|
-
|
|
325
|
+
k.value = null, R.value = !1, Fe?.(null);
|
|
326
326
|
},
|
|
327
327
|
onRemoteSelectionsChange: (e) => {
|
|
328
|
-
|
|
328
|
+
M.value = e;
|
|
329
329
|
}
|
|
330
330
|
}), Q = () => {
|
|
331
|
-
let e = c(
|
|
332
|
-
|
|
331
|
+
let e = c(S)?.awareness, t = j.value, n = Z.getView();
|
|
332
|
+
M.value = e && t && n ? oe(n.state, e, t) : [];
|
|
333
333
|
};
|
|
334
|
-
l(() => c(
|
|
335
|
-
if (
|
|
336
|
-
|
|
334
|
+
l(() => c(S), (e, t, n) => {
|
|
335
|
+
if (M.value = [], !e) {
|
|
336
|
+
j.value = null, Z.retryViewCreation(), Z.syncExternalDocument();
|
|
337
337
|
return;
|
|
338
338
|
}
|
|
339
339
|
let r = !1;
|
|
340
340
|
n(() => {
|
|
341
341
|
r = !0;
|
|
342
|
-
}),
|
|
343
|
-
r || (
|
|
342
|
+
}), j.value = null, re().then((e) => {
|
|
343
|
+
r || (j.value = e, Z.retryViewCreation(), Z.syncExternalDocument(), Q());
|
|
344
344
|
}, (e) => {
|
|
345
|
-
r || (
|
|
345
|
+
r || (j.value = null, w?.(e instanceof Error ? e : Error(String(e))));
|
|
346
346
|
});
|
|
347
347
|
}, { immediate: !0 }), l(() => ({
|
|
348
|
-
awareness: c(
|
|
349
|
-
modules:
|
|
350
|
-
view:
|
|
348
|
+
awareness: c(S)?.awareness,
|
|
349
|
+
modules: j.value,
|
|
350
|
+
view: k.value
|
|
351
351
|
}), ({ awareness: e, modules: t, view: n }, r, i) => {
|
|
352
352
|
if (!e || !t || !n) {
|
|
353
|
-
|
|
353
|
+
M.value = [];
|
|
354
354
|
return;
|
|
355
355
|
}
|
|
356
356
|
e.on("change", Q), Q(), i(() => {
|
|
357
|
-
e.off("change", Q),
|
|
357
|
+
e.off("change", Q), M.value = [];
|
|
358
358
|
});
|
|
359
359
|
}, { flush: "post" });
|
|
360
360
|
function ft({ transactions: e, newState: t, docChanged: n }) {
|
|
361
|
-
|
|
361
|
+
A.value = t, n && (B.value = !0, G.incrementStateSeq(), Y.schedule(t, ye(e)), dt()), G.requestRender();
|
|
362
362
|
}
|
|
363
363
|
function pt(e) {
|
|
364
|
-
|
|
365
|
-
|
|
364
|
+
k.value = e, A.value = e.state, R.value = !0, J(e.state, { reason: "initial" }), G.requestRender(), $(e), Fe?.(e), c(u) || requestAnimationFrame(() => {
|
|
365
|
+
k.value === e && e.focus();
|
|
366
366
|
});
|
|
367
367
|
}
|
|
368
368
|
let mt = {
|
|
369
369
|
getDocx: async (e) => (await St(e))?.buffer ?? null,
|
|
370
370
|
loadDocument: xt,
|
|
371
371
|
loadDocx: bt
|
|
372
|
-
}, ht =
|
|
372
|
+
}, ht = v({
|
|
373
373
|
getEditorApi: () => Z.api,
|
|
374
|
-
getLayout: () =>
|
|
374
|
+
getLayout: () => F.value,
|
|
375
375
|
runLayout: (e, t) => J(e, t),
|
|
376
376
|
getDocumentIO: () => mt,
|
|
377
377
|
emitter: W
|
|
378
378
|
});
|
|
379
379
|
function $(e) {
|
|
380
|
-
te(c(
|
|
380
|
+
te(c(b) === "suggesting", e.state, e.dispatch, c(Ae));
|
|
381
381
|
}
|
|
382
|
-
l([() => c(
|
|
383
|
-
let e =
|
|
382
|
+
l([() => c(b), () => c(Ae)], () => {
|
|
383
|
+
let e = k.value;
|
|
384
384
|
e && $(e);
|
|
385
385
|
for (let e of q.listStories()) {
|
|
386
386
|
let t = q.getView(e);
|
|
@@ -390,72 +390,72 @@ function P(e) {
|
|
|
390
390
|
Z.syncEditable(), e && kt();
|
|
391
391
|
});
|
|
392
392
|
function gt(e) {
|
|
393
|
-
let t =
|
|
394
|
-
if (t === e.state.plugins.includes(
|
|
395
|
-
let n = e.state.plugins.filter((e) => e !==
|
|
393
|
+
let t = U();
|
|
394
|
+
if (t === e.state.plugins.includes(H)) return;
|
|
395
|
+
let n = e.state.plugins.filter((e) => e !== H && e !== rt);
|
|
396
396
|
if (t) {
|
|
397
|
-
let e = n.indexOf(
|
|
398
|
-
n.splice(t, 0,
|
|
397
|
+
let e = n.indexOf(it), t = e === -1 ? n.length : e;
|
|
398
|
+
n.splice(t, 0, H, rt);
|
|
399
399
|
}
|
|
400
400
|
e.updateState(e.state.reconfigure({ plugins: n }));
|
|
401
401
|
}
|
|
402
|
-
l(() =>
|
|
403
|
-
let e =
|
|
402
|
+
l(() => U(), () => {
|
|
403
|
+
let e = k.value;
|
|
404
404
|
e && gt(e);
|
|
405
405
|
});
|
|
406
406
|
function _t() {
|
|
407
407
|
Z.ensureView();
|
|
408
408
|
}
|
|
409
409
|
function vt() {
|
|
410
|
-
|
|
410
|
+
Ve += 1, B.value = !1, N.value = null, P.value = null, q.activate(null), Y.dispose(), Z.destroyView(), K.sync(), q.sync(), Z.ensureView(), Z.getView() || yt();
|
|
411
411
|
}
|
|
412
412
|
function yt() {
|
|
413
|
-
let e =
|
|
414
|
-
if (!(!e || c(
|
|
413
|
+
let e = O.value;
|
|
414
|
+
if (!(!e || c(S))) try {
|
|
415
415
|
let t = ce({
|
|
416
416
|
document: e,
|
|
417
417
|
styles: e.package.styles ?? null,
|
|
418
|
-
manager:
|
|
418
|
+
manager: V,
|
|
419
419
|
externalPlugins: at(),
|
|
420
420
|
collaborationModules: null,
|
|
421
421
|
reason: "mount"
|
|
422
422
|
});
|
|
423
|
-
|
|
423
|
+
A.value = t, J(t, { reason: "initial" });
|
|
424
424
|
} catch (e) {
|
|
425
|
-
|
|
425
|
+
w?.(e instanceof Error ? e : Error(String(e)));
|
|
426
426
|
}
|
|
427
427
|
}
|
|
428
428
|
l([
|
|
429
429
|
t,
|
|
430
430
|
a,
|
|
431
|
-
|
|
431
|
+
D,
|
|
432
432
|
...r ? [r] : []
|
|
433
433
|
], () => {
|
|
434
|
-
t.value &&
|
|
434
|
+
t.value && O.value && !Z.getView() && _t(), K.sync(), q.sync();
|
|
435
435
|
}, { flush: "post" });
|
|
436
436
|
async function bt(e) {
|
|
437
|
-
|
|
437
|
+
z.value = null, R.value = !1;
|
|
438
438
|
try {
|
|
439
|
-
let t = await pe(e, { password: c(
|
|
440
|
-
|
|
439
|
+
let t = await pe(e, { password: c(ke) });
|
|
440
|
+
O.value = t, vt();
|
|
441
441
|
} catch (e) {
|
|
442
442
|
let t = e instanceof Error ? e : Error(String(e));
|
|
443
|
-
|
|
443
|
+
z.value = t.message, w?.(t);
|
|
444
444
|
}
|
|
445
445
|
}
|
|
446
446
|
function xt(e) {
|
|
447
|
-
|
|
447
|
+
z.value = null, O.value = e, vt();
|
|
448
448
|
}
|
|
449
449
|
async function St(e) {
|
|
450
|
-
let t =
|
|
450
|
+
let t = k.value, n = O.value;
|
|
451
451
|
if (!t || !n) return null;
|
|
452
|
-
let r = q.snapshotDocument(K.snapshotDocument(n)), i = t.state, { resolveSelectiveSaveFlags: a } = await import("@stll/folio-core/docx/selectiveSaveFlags"), o = a(c(
|
|
452
|
+
let r = q.snapshotDocument(K.snapshotDocument(n)), i = t.state, { resolveSelectiveSaveFlags: a } = await import("@stll/folio-core/docx/selectiveSaveFlags"), o = a(c(Be)), s = be(i.doc, r), l = s.originalBuffer ?? null, u = o.selectiveSave && e?.mode !== _.full, d = u || o.selectiveSaveTripwire, { repackDocx: f, createDocx: p } = await import("@stll/folio-core/docx/rezip"), m = null;
|
|
453
453
|
if (d && l) {
|
|
454
454
|
let { attemptSelectiveSave: e } = await import("@stll/folio-core/docx/selectiveSave");
|
|
455
455
|
m = await e(s, l, {
|
|
456
|
-
changedParaIds:
|
|
457
|
-
structuralChange:
|
|
458
|
-
hasUntrackedChanges:
|
|
456
|
+
changedParaIds: Se(i),
|
|
457
|
+
structuralChange: Ce(i),
|
|
458
|
+
hasUntrackedChanges: we(i),
|
|
459
459
|
maxBytes: o.selectiveSaveMaxBytes
|
|
460
460
|
});
|
|
461
461
|
}
|
|
@@ -464,9 +464,9 @@ function P(e) {
|
|
|
464
464
|
else if (o.selectiveSaveTripwire) try {
|
|
465
465
|
g = await f(s);
|
|
466
466
|
} catch {}
|
|
467
|
-
if (o.selectiveSaveTripwire && g &&
|
|
467
|
+
if (o.selectiveSaveTripwire && g && E) try {
|
|
468
468
|
let { compareSelectiveVsFull: e } = await import("@stll/folio-core/docx/selectiveSaveTripwire");
|
|
469
|
-
|
|
469
|
+
E(await e(m, g));
|
|
470
470
|
} catch {}
|
|
471
471
|
return {
|
|
472
472
|
buffer: h,
|
|
@@ -475,14 +475,14 @@ function P(e) {
|
|
|
475
475
|
}
|
|
476
476
|
async function Ct(e) {
|
|
477
477
|
let t = await St({ mode: e?.selective === !1 ? _.full : _.preferSelective });
|
|
478
|
-
return t ? (
|
|
478
|
+
return t ? (O.value = t.document, K.sync(), q.sync(), B.value = !1, new Blob([t.buffer], { type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" })) : null;
|
|
479
479
|
}
|
|
480
480
|
function wt() {
|
|
481
|
-
let e =
|
|
481
|
+
let e = O.value;
|
|
482
482
|
return e ? q.snapshotDocument(K.snapshotDocument(e)) : null;
|
|
483
483
|
}
|
|
484
484
|
function Tt(e) {
|
|
485
|
-
|
|
485
|
+
O.value = e, K.sync(), q.sync(), P.value && !q.getView(P.value) && (P.value = null);
|
|
486
486
|
}
|
|
487
487
|
function Et(e) {
|
|
488
488
|
return K.getView(e);
|
|
@@ -492,47 +492,47 @@ function P(e) {
|
|
|
492
492
|
}
|
|
493
493
|
function Ot(e) {
|
|
494
494
|
let t = q.activate(e);
|
|
495
|
-
t && ($(t),
|
|
495
|
+
t && ($(t), P.value = e, requestAnimationFrame(() => t.focus()));
|
|
496
496
|
}
|
|
497
497
|
function kt() {
|
|
498
|
-
q.activate(null),
|
|
498
|
+
q.activate(null), P.value = null;
|
|
499
499
|
}
|
|
500
500
|
function At() {
|
|
501
|
-
let e =
|
|
501
|
+
let e = P.value;
|
|
502
502
|
return e ? q.getView(e) : null;
|
|
503
503
|
}
|
|
504
504
|
function jt() {
|
|
505
|
-
return
|
|
505
|
+
return V.getCommands();
|
|
506
506
|
}
|
|
507
507
|
function Mt() {
|
|
508
508
|
let e = At();
|
|
509
|
-
e ? e.focus() :
|
|
509
|
+
e ? e.focus() : k.value?.focus();
|
|
510
510
|
}
|
|
511
511
|
function Nt() {
|
|
512
|
-
let e =
|
|
512
|
+
let e = k.value;
|
|
513
513
|
e && J(e.state, { reason: "manual" });
|
|
514
514
|
}
|
|
515
515
|
l([
|
|
516
|
-
() => c(
|
|
517
|
-
() => c(
|
|
518
|
-
() => c(
|
|
516
|
+
() => c(he),
|
|
517
|
+
() => c(y),
|
|
518
|
+
() => c(me)
|
|
519
519
|
], () => Nt());
|
|
520
520
|
function Pt() {
|
|
521
|
-
Y.dispose(), X !== null && (window.clearTimeout(X), X = null), Z.destroyView(),
|
|
521
|
+
Y.dispose(), X !== null && (window.clearTimeout(X), X = null), Z.destroyView(), M.value = [], K.destroy(), q.destroy(), V.destroy(), A.value = null, F.value = null, O.value = null, R.value = !1;
|
|
522
522
|
}
|
|
523
523
|
return i(Pt), {
|
|
524
524
|
editor: ht,
|
|
525
|
-
editorView:
|
|
526
|
-
editorState:
|
|
527
|
-
remoteSelections:
|
|
528
|
-
headerFooterSelection:
|
|
529
|
-
activeNoteStory:
|
|
530
|
-
isReady:
|
|
531
|
-
isDirty:
|
|
532
|
-
parseError:
|
|
533
|
-
layout:
|
|
534
|
-
blocks:
|
|
535
|
-
measures:
|
|
525
|
+
editorView: k,
|
|
526
|
+
editorState: A,
|
|
527
|
+
remoteSelections: M,
|
|
528
|
+
headerFooterSelection: N,
|
|
529
|
+
activeNoteStory: P,
|
|
530
|
+
isReady: R,
|
|
531
|
+
isDirty: B,
|
|
532
|
+
parseError: z,
|
|
533
|
+
layout: F,
|
|
534
|
+
blocks: I,
|
|
535
|
+
measures: L,
|
|
536
536
|
syncCoordinator: G,
|
|
537
537
|
loadBuffer: bt,
|
|
538
538
|
loadDocument: xt,
|
|
@@ -550,7 +550,7 @@ function P(e) {
|
|
|
550
550
|
destroy: Pt
|
|
551
551
|
};
|
|
552
552
|
}
|
|
553
|
-
function
|
|
553
|
+
function M(e, t) {
|
|
554
554
|
if (t < e.top + 40) {
|
|
555
555
|
let n = Math.max(0, e.top + 40 - t);
|
|
556
556
|
return -Math.min(12, n / 40 * 12);
|
|
@@ -563,12 +563,12 @@ function F(e, t) {
|
|
|
563
563
|
}
|
|
564
564
|
//#endregion
|
|
565
565
|
//#region src/composables/useDragAutoScroll.ts
|
|
566
|
-
function
|
|
566
|
+
function N({ pagesContainer: e, onScrollExtendSelection: t }) {
|
|
567
567
|
let n = null, r = 0, a = 0, o = !1, s = null;
|
|
568
568
|
function c() {
|
|
569
569
|
if (s) return s;
|
|
570
570
|
let t = e.value;
|
|
571
|
-
return t ? (s =
|
|
571
|
+
return t ? (s = ke(t), s) : null;
|
|
572
572
|
}
|
|
573
573
|
function l() {
|
|
574
574
|
o = !1, n !== null && (cancelAnimationFrame(n), n = null);
|
|
@@ -577,7 +577,7 @@ function I({ pagesContainer: e, onScrollExtendSelection: t }) {
|
|
|
577
577
|
if (!o) return;
|
|
578
578
|
let e = c();
|
|
579
579
|
if (!e) return;
|
|
580
|
-
let i =
|
|
580
|
+
let i = M(e.getBoundingClientRect(), a);
|
|
581
581
|
i !== 0 && (e.scrollTop += i, t(r, a)), n = requestAnimationFrame(u);
|
|
582
582
|
}
|
|
583
583
|
function d() {
|
|
@@ -598,7 +598,7 @@ function I({ pagesContainer: e, onScrollExtendSelection: t }) {
|
|
|
598
598
|
}
|
|
599
599
|
//#endregion
|
|
600
600
|
//#region src/composables/useTableResize.ts
|
|
601
|
-
function
|
|
601
|
+
function P() {
|
|
602
602
|
let e = {
|
|
603
603
|
active: !1,
|
|
604
604
|
startX: 0,
|
|
@@ -630,15 +630,15 @@ function L() {
|
|
|
630
630
|
}
|
|
631
631
|
function a(i, a) {
|
|
632
632
|
let o = i.target;
|
|
633
|
-
return o instanceof HTMLElement ? o.classList.contains("layout-table-resize-handle") ? (i.preventDefault(), i.stopPropagation(), r = a, e.active = !0, e.startX = i.clientX, e.handle = o, o.classList.add("dragging"), e.columnIndex = parseInt(o.dataset.columnIndex ?? "0", 10), e.tablePmStart = parseInt(o.dataset.tablePmStart ?? "0", 10),
|
|
633
|
+
return o instanceof HTMLElement ? o.classList.contains("layout-table-resize-handle") ? (i.preventDefault(), i.stopPropagation(), r = a, e.active = !0, e.startX = i.clientX, e.handle = o, o.classList.add("dragging"), e.columnIndex = parseInt(o.dataset.columnIndex ?? "0", 10), e.tablePmStart = parseInt(o.dataset.tablePmStart ?? "0", 10), F(a, e), !0) : o.classList.contains("layout-table-row-resize-handle") || o.classList.contains("layout-table-edge-handle-bottom") ? (i.preventDefault(), i.stopPropagation(), r = a, t.active = !0, t.startY = i.clientY, t.handle = o, t.isEdge = o.dataset.isEdge === "bottom", o.classList.add("dragging"), t.rowIndex = parseInt(o.dataset.rowIndex ?? "0", 10), t.tablePmStart = parseInt(o.dataset.tablePmStart ?? "0", 10), I(a, t, o), !0) : o.classList.contains("layout-table-edge-handle-right") ? (i.preventDefault(), i.stopPropagation(), r = a, n.active = !0, n.startX = i.clientX, n.handle = o, o.classList.add("dragging"), n.columnIndex = parseInt(o.dataset.columnIndex ?? "0", 10), n.tablePmStart = parseInt(o.dataset.tablePmStart ?? "0", 10), L(a, n), !0) : !1 : !1;
|
|
634
634
|
}
|
|
635
635
|
function o(r) {
|
|
636
636
|
if (e.active && e.handle) {
|
|
637
637
|
r.preventDefault();
|
|
638
638
|
let t = r.clientX - e.startX, n = parseFloat(e.handle.style.left);
|
|
639
639
|
e.handle.style.left = `${n + t}px`, e.startX = r.clientX;
|
|
640
|
-
let i = Math.round(t *
|
|
641
|
-
a >=
|
|
640
|
+
let i = Math.round(t * x), a = e.origWidths.left + i, o = e.origWidths.right - i;
|
|
641
|
+
a >= b && o >= b && (e.origWidths = {
|
|
642
642
|
left: a,
|
|
643
643
|
right: o
|
|
644
644
|
});
|
|
@@ -648,21 +648,21 @@ function L() {
|
|
|
648
648
|
r.preventDefault();
|
|
649
649
|
let e = r.clientY - t.startY, n = parseFloat(t.handle.style.top);
|
|
650
650
|
t.handle.style.top = `${n + e}px`, t.startY = r.clientY;
|
|
651
|
-
let i = Math.round(e *
|
|
652
|
-
a >=
|
|
651
|
+
let i = Math.round(e * x), a = t.origHeight + i;
|
|
652
|
+
a >= Ae && (t.origHeight = a);
|
|
653
653
|
return;
|
|
654
654
|
}
|
|
655
655
|
if (n.active && n.handle) {
|
|
656
656
|
r.preventDefault();
|
|
657
657
|
let e = r.clientX - n.startX, t = parseFloat(n.handle.style.left);
|
|
658
658
|
n.handle.style.left = `${t + e}px`, n.startX = r.clientX;
|
|
659
|
-
let i = Math.round(e *
|
|
660
|
-
a >=
|
|
659
|
+
let i = Math.round(e * x), a = n.origWidth + i;
|
|
660
|
+
a >= b && (n.origWidth = a);
|
|
661
661
|
}
|
|
662
662
|
}
|
|
663
663
|
function s(i) {
|
|
664
664
|
if (e.active) {
|
|
665
|
-
e.active = !1, e.handle?.classList.remove("dragging"), r &&
|
|
665
|
+
e.active = !1, e.handle?.classList.remove("dragging"), r && S(r, {
|
|
666
666
|
pmStart: e.tablePmStart,
|
|
667
667
|
colIdx: e.columnIndex,
|
|
668
668
|
newLeft: e.origWidths.left,
|
|
@@ -671,14 +671,14 @@ function L() {
|
|
|
671
671
|
return;
|
|
672
672
|
}
|
|
673
673
|
if (t.active) {
|
|
674
|
-
t.active = !1, t.handle?.classList.remove("dragging"), r &&
|
|
674
|
+
t.active = !1, t.handle?.classList.remove("dragging"), r && Me(r, {
|
|
675
675
|
pmStart: t.tablePmStart,
|
|
676
676
|
rowIdx: t.rowIndex,
|
|
677
677
|
newHeight: t.origHeight
|
|
678
678
|
}), t.handle = null;
|
|
679
679
|
return;
|
|
680
680
|
}
|
|
681
|
-
n.active && (n.active = !1, n.handle?.classList.remove("dragging"), r &&
|
|
681
|
+
n.active && (n.active = !1, n.handle?.classList.remove("dragging"), r && je(r, {
|
|
682
682
|
pmStart: n.tablePmStart,
|
|
683
683
|
colIdx: n.columnIndex,
|
|
684
684
|
newWidth: n.origWidth
|
|
@@ -695,31 +695,31 @@ function L() {
|
|
|
695
695
|
isResizing: i
|
|
696
696
|
};
|
|
697
697
|
}
|
|
698
|
-
function
|
|
699
|
-
let n =
|
|
698
|
+
function F(e, t) {
|
|
699
|
+
let n = Pe(e, t.tablePmStart, t.columnIndex);
|
|
700
700
|
n && (t.origWidths = n);
|
|
701
701
|
}
|
|
702
|
-
function
|
|
703
|
-
let r =
|
|
702
|
+
function I(e, t, n) {
|
|
703
|
+
let r = C(e, t.tablePmStart, t.rowIndex);
|
|
704
704
|
if (r != null) {
|
|
705
705
|
t.origHeight = r;
|
|
706
706
|
return;
|
|
707
707
|
}
|
|
708
708
|
let i = n.closest(".layout-table")?.querySelector(`[data-row-index="${t.rowIndex}"]`), a = i ? i.getBoundingClientRect().height : 30;
|
|
709
|
-
t.origHeight = Math.round(a *
|
|
709
|
+
t.origHeight = Math.round(a * x);
|
|
710
710
|
}
|
|
711
|
-
function
|
|
712
|
-
let n =
|
|
711
|
+
function L(e, t) {
|
|
712
|
+
let n = Ne(e, t.tablePmStart, t.columnIndex);
|
|
713
713
|
n != null && (t.origWidth = n);
|
|
714
714
|
}
|
|
715
715
|
//#endregion
|
|
716
716
|
//#region src/composables/useTrackedChanges.ts
|
|
717
|
-
function
|
|
718
|
-
return e(() => (n.value,
|
|
717
|
+
function R(t, n) {
|
|
718
|
+
return e(() => (n.value, w(t.value?.state ?? null)));
|
|
719
719
|
}
|
|
720
720
|
//#endregion
|
|
721
721
|
//#region src/composables/useZoom.ts
|
|
722
|
-
var
|
|
722
|
+
var z = Fe, B = T, V = [
|
|
723
723
|
.5,
|
|
724
724
|
.75,
|
|
725
725
|
1,
|
|
@@ -727,16 +727,16 @@ var B = Pe, V = E, H = [
|
|
|
727
727
|
1.5,
|
|
728
728
|
2
|
|
729
729
|
];
|
|
730
|
-
function
|
|
731
|
-
let i = o(Math.max(
|
|
730
|
+
function $e(t = 1) {
|
|
731
|
+
let i = o(Math.max(z, Math.min(B, t))), a = e(() => Math.round(i.value * 100)), s = e(() => i.value <= z), c = e(() => i.value >= B);
|
|
732
732
|
function l(e) {
|
|
733
|
-
i.value = Math.max(
|
|
733
|
+
i.value = Math.max(z, Math.min(B, Math.round(e * 100) / 100));
|
|
734
734
|
}
|
|
735
735
|
function u() {
|
|
736
|
-
l(i.value +
|
|
736
|
+
l(i.value + Ie);
|
|
737
737
|
}
|
|
738
738
|
function d() {
|
|
739
|
-
l(i.value -
|
|
739
|
+
l(i.value - Ie);
|
|
740
740
|
}
|
|
741
741
|
function f() {
|
|
742
742
|
l(1);
|
|
@@ -762,8 +762,8 @@ function Qe(t = 1) {
|
|
|
762
762
|
handleWheel: p,
|
|
763
763
|
handleKeyDown: m,
|
|
764
764
|
installShortcuts: h,
|
|
765
|
-
ZOOM_PRESETS:
|
|
765
|
+
ZOOM_PRESETS: V
|
|
766
766
|
};
|
|
767
767
|
}
|
|
768
768
|
//#endregion
|
|
769
|
-
export {
|
|
769
|
+
export { N as a, E as c, P as i, O as l, w as n, j as o, R as r, Ve as s, $e as t, k as u };
|