@stll/folio-vue 0.13.2 → 0.13.3
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/composables/useDocxEditor.d.ts +5 -4
- package/dist/composables/useDocxEditorRefApi.d.ts +16 -7
- package/dist/composables.cjs +1 -1
- package/dist/composables.js +1 -1
- package/dist/folio-vue.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +128 -124
- package/dist/{useZoom-lJ18bjuE.cjs → useZoom-CijHXVVG.cjs} +1 -1
- package/dist/{useZoom-CbTb1bPs.js → useZoom-DZmNIcAL.js} +278 -266
- package/package.json +2 -2
|
@@ -4,69 +4,69 @@ 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 {
|
|
8
|
-
import { createFolioEditorEmitter as
|
|
9
|
-
import { loadCollaborationModules as
|
|
10
|
-
import { createHeaderFooterEditorManager as
|
|
11
|
-
import { createNoteEditorManager as
|
|
12
|
-
import { collectRemoteSelections as
|
|
13
|
-
import { runLayoutPipeline as
|
|
14
|
-
import { browserClock as
|
|
15
|
-
import { createLayoutSession as
|
|
16
|
-
import { parseDocx as
|
|
17
|
-
import { getFootnoteText as
|
|
18
|
-
import { convertHeaderFooterPmDocToContent as
|
|
19
|
-
import { resolveSectionHeaderFooterRefs as
|
|
20
|
-
import { LayoutPainter as
|
|
21
|
-
import { LayoutSelectionGate as
|
|
22
|
-
import { getTransactionDirtyRange 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
|
|
7
|
+
import { FOLIO_DOCX_SERIALIZATION_MODE as _, createFolioEditor as ne } from "@stll/folio-core/controller/folioEditor";
|
|
8
|
+
import { createFolioEditorEmitter as v } from "@stll/folio-core/controller/folioEditorEvents";
|
|
9
|
+
import { loadCollaborationModules as re } from "@stll/folio-core/controller/collaborationModules";
|
|
10
|
+
import { createHeaderFooterEditorManager as ie } from "@stll/folio-core/controller/headerFooterEditorManager";
|
|
11
|
+
import { createNoteEditorManager as ae } from "@stll/folio-core/controller/noteEditorManager";
|
|
12
|
+
import { collectRemoteSelections as oe, createHiddenEditorManager as se, createHiddenEditorState as ce } from "@stll/folio-core/controller/hiddenEditorManager";
|
|
13
|
+
import { runLayoutPipeline as le } from "@stll/folio-core/controller/layoutPipeline";
|
|
14
|
+
import { browserClock as ue, createLayoutScheduler as de } from "@stll/folio-core/controller/layoutScheduler";
|
|
15
|
+
import { createLayoutSession as fe } from "@stll/folio-core/controller/layoutSession";
|
|
16
|
+
import { parseDocx as pe } from "@stll/folio-core/docx/parser";
|
|
17
|
+
import { getFootnoteText as me } from "@stll/folio-core/docx/footnoteParser";
|
|
18
|
+
import { convertHeaderFooterPmDocToContent as he, convertHeaderFooterToContent as ge } from "@stll/folio-core/layout-bridge/convert/headerFooterLayout";
|
|
19
|
+
import { resolveSectionHeaderFooterRefs as _e } from "@stll/folio-core/layout-engine";
|
|
20
|
+
import { LayoutPainter as ve } from "@stll/folio-core/layout-painter";
|
|
21
|
+
import { LayoutSelectionGate as ye } from "@stll/folio-core/paged-layout/LayoutSelectionGate";
|
|
22
|
+
import { getTransactionDirtyRange as be } from "@stll/folio-core/paged-layout/transactionDirtyRange";
|
|
23
|
+
import { fromProseDoc as xe } from "@stll/folio-core/prosemirror/conversion/fromProseDoc";
|
|
24
|
+
import { ExtensionManager as Se } from "@stll/folio-core/prosemirror/extensions/ExtensionManager";
|
|
25
|
+
import { getChangedParagraphIds as Ce, hasStructuralChanges as we, hasUntrackedChanges as Te } from "@stll/folio-core/prosemirror/extensions/features/ParagraphChangeTrackerExtension";
|
|
26
|
+
import { createStarterKit as Ee } from "@stll/folio-core/prosemirror/extensions/StarterKit";
|
|
27
|
+
import { createTemplatePreviewValuesPlugin as De } from "@stll/folio-core/prosemirror/plugins/templatePreviewValues";
|
|
28
|
+
import { templateSlashMenuPlugin as Oe } from "@stll/folio-core/prosemirror/plugins/templateSlashMenu";
|
|
29
|
+
import { resolveHeaderFooterContent as ke } from "@stll/folio-core/utils/headerFooter";
|
|
30
30
|
import { findVerticalScrollParent as y } from "@stll/folio-core/utils/findVerticalScrollParent";
|
|
31
|
-
import { MIN_CELL_WIDTH_TWIPS as b, MIN_ROW_HEIGHT_TWIPS as
|
|
32
|
-
import { extractTrackedChanges as
|
|
33
|
-
import { ZOOM_MAX as
|
|
31
|
+
import { MIN_CELL_WIDTH_TWIPS as b, MIN_ROW_HEIGHT_TWIPS as Ae, TWIPS_PER_PIXEL as x, commitColumnResize as je, commitRightEdgeResize as Me, commitRowResize as Ne, readColumnWidthAt as Pe, readColumnWidths as S, 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 Fe, ZOOM_MIN as Ie, ZOOM_STEP as Le } from "@stll/folio-core/utils/zoom";
|
|
34
34
|
//#region src/utils/colorMode.ts
|
|
35
|
-
var
|
|
36
|
-
function
|
|
35
|
+
var Re = "(prefers-color-scheme: dark)";
|
|
36
|
+
function ze() {
|
|
37
37
|
return typeof window < "u" && typeof window.matchMedia == "function";
|
|
38
38
|
}
|
|
39
|
-
function
|
|
39
|
+
function Be(e, t) {
|
|
40
40
|
return e === "dark" || e === "system" && t;
|
|
41
41
|
}
|
|
42
|
-
function
|
|
43
|
-
if (!
|
|
44
|
-
let t = window.matchMedia(
|
|
42
|
+
function Ve(e) {
|
|
43
|
+
if (!ze()) return () => {};
|
|
44
|
+
let t = window.matchMedia(Re);
|
|
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 T = "light", E = Symbol("folioColorMode"), D = (t = T) => {
|
|
52
|
+
a(E, e(() => c(t)));
|
|
53
|
+
}, O = { install(t, n = T) {
|
|
54
|
+
t.provide(E, e(() => c(n)));
|
|
55
55
|
} };
|
|
56
|
-
function
|
|
57
|
-
let n = t(
|
|
56
|
+
function k() {
|
|
57
|
+
let n = t(E, e(() => T)), 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(Ve((e) => {
|
|
62
62
|
a.value = e;
|
|
63
63
|
}));
|
|
64
|
-
}), e(() =>
|
|
64
|
+
}), e(() => Be(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 Ge(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) : ge(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 Je(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 Je(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,83 +138,83 @@ var j = /* @__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
|
-
}),
|
|
160
|
-
function
|
|
153
|
+
function j(e) {
|
|
154
|
+
let { hiddenContainer: t, hiddenHeaderFooterContainer: n, noteEditorContainer: r, pagesContainer: a, readOnly: u = !1, pageGap: p = He, showMarginGuides: me, marginGuideColor: he, password: ge, editorMode: y, author: b, externalPlugins: Ae = [], collaboration: x, onAnonymizationMatchesChange: je, showTemplateDirectives: Me, onSlashMenuChange: Ne, onSlashMenuKeyAction: Pe, onChange: S, onError: C, onSelectionUpdate: w, onEditorViewReady: Fe, onCopy: Ie, onCut: Le, onPaste: Re, onReadOnlyEditAttempt: ze, featureFlags: Be, onSelectiveSaveTripwire: Ve } = e, T = n ?? t, E = s(null), D = 0, O = s(null), k = s(null), A = s(null), j = s([]), M = s(null), N = s(null), P = s(null), F = s([]), I = s([]), L = o(!1), R = o(null), z = o(!1), B = new Se(Ee());
|
|
155
|
+
B.buildSchema(), B.initializeRuntime();
|
|
156
|
+
let V = ee(!1), $e = [V], et = h({ keymap: !0 }), tt = m({ onMatchesChange: (e) => je?.(e) }), H = g(), U = Oe({
|
|
157
|
+
onChange: (e) => Ne?.(e),
|
|
158
|
+
onKeyAction: (e) => Pe?.(e) ?? !1
|
|
159
|
+
}), nt = De(), rt = () => c(Me) === !0;
|
|
160
|
+
function it() {
|
|
161
161
|
return [
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
...
|
|
162
|
+
et,
|
|
163
|
+
V,
|
|
164
|
+
...Ae,
|
|
165
165
|
...c(x)?.plugins ?? [],
|
|
166
|
-
|
|
167
|
-
...
|
|
168
|
-
|
|
166
|
+
tt,
|
|
167
|
+
...rt() ? [H, U] : [],
|
|
168
|
+
nt
|
|
169
169
|
];
|
|
170
170
|
}
|
|
171
|
-
let W =
|
|
171
|
+
let W = v(), G = new ye(), at = fe(), ot = new ve({
|
|
172
172
|
pageGap: p,
|
|
173
173
|
showShadow: !0
|
|
174
|
-
}), K =
|
|
175
|
-
getHost: () =>
|
|
176
|
-
getDocument: () =>
|
|
177
|
-
getStyles: () =>
|
|
178
|
-
getTheme: () =>
|
|
174
|
+
}), K = ie({
|
|
175
|
+
getHost: () => T.value,
|
|
176
|
+
getDocument: () => E.value,
|
|
177
|
+
getStyles: () => E.value?.package.styles ?? null,
|
|
178
|
+
getTheme: () => E.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
|
+
z.value = !0;
|
|
182
|
+
let e = O.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
|
+
M.value = {
|
|
188
188
|
from: r,
|
|
189
189
|
kind: t,
|
|
190
190
|
rId: e,
|
|
191
191
|
to: i
|
|
192
|
-
},
|
|
192
|
+
}, w?.(n.state), W.emit("selectionChange", {
|
|
193
193
|
from: r,
|
|
194
194
|
to: i
|
|
195
195
|
});
|
|
196
196
|
}
|
|
197
197
|
G.requestRender();
|
|
198
198
|
}
|
|
199
|
-
}),
|
|
199
|
+
}), st = { current: null }, q = ae({
|
|
200
200
|
getHost: () => r?.value ?? null,
|
|
201
|
-
getPlugins: () =>
|
|
202
|
-
getDocument: () =>
|
|
203
|
-
getStyles: () =>
|
|
204
|
-
getTheme: () =>
|
|
201
|
+
getPlugins: () => $e,
|
|
202
|
+
getDocument: () => E.value,
|
|
203
|
+
getStyles: () => E.value?.package.styles ?? null,
|
|
204
|
+
getTheme: () => E.value?.package.theme ?? null,
|
|
205
205
|
onTransaction: ({ docChanged: e, selectionChanged: t, view: n }) => {
|
|
206
206
|
if (e) {
|
|
207
|
-
|
|
208
|
-
let e =
|
|
207
|
+
z.value = !0;
|
|
208
|
+
let e = E.value;
|
|
209
209
|
if (e) {
|
|
210
|
-
let t =
|
|
211
|
-
|
|
210
|
+
let t = st.current?.snapshotDocument(e) ?? e;
|
|
211
|
+
E.value = t, S?.(t), W.emit("docChange", t);
|
|
212
212
|
}
|
|
213
|
-
let t =
|
|
213
|
+
let t = O.value;
|
|
214
214
|
t && Y.schedule(t.state, null);
|
|
215
215
|
}
|
|
216
216
|
if (e || t) {
|
|
217
|
-
|
|
217
|
+
w?.(n.state);
|
|
218
218
|
let { from: e, to: t } = n.state.selection;
|
|
219
219
|
W.emit("selectionChange", {
|
|
220
220
|
from: e,
|
|
@@ -223,21 +223,21 @@ function M(e) {
|
|
|
223
223
|
}
|
|
224
224
|
}
|
|
225
225
|
});
|
|
226
|
-
|
|
227
|
-
function
|
|
228
|
-
e.layout && (
|
|
226
|
+
st.current = q;
|
|
227
|
+
function ct(e) {
|
|
228
|
+
e.layout && (P.value = e.layout), e.blocks && (F.value = e.blocks), e.measures && (I.value = e.measures), e.blockLookup && ot.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 = E.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, ne = _ !== void 0 && "mirrorMargins" in _ && _.mirrorMargins === !0, v = ke(i?.package);
|
|
232
232
|
try {
|
|
233
|
-
|
|
233
|
+
ct(le({
|
|
234
234
|
contentWidth: h,
|
|
235
235
|
columns: m,
|
|
236
236
|
pageSize: l,
|
|
237
237
|
margins: u,
|
|
238
238
|
pageGap: p,
|
|
239
|
-
showMarginGuides: c(
|
|
240
|
-
marginGuideColor: c(
|
|
239
|
+
showMarginGuides: c(me) === !0,
|
|
240
|
+
marginGuideColor: c(he),
|
|
241
241
|
syncCoordinator: G,
|
|
242
242
|
headerContent: v.headerContent,
|
|
243
243
|
footerContent: v.footerContent,
|
|
@@ -247,206 +247,211 @@ function M(e) {
|
|
|
247
247
|
footerContentRId: v.activeFooterRId,
|
|
248
248
|
firstPageHeaderContentRId: v.activeFirstHeaderRId,
|
|
249
249
|
firstPageFooterContentRId: v.activeFirstFooterRId,
|
|
250
|
-
sectionHeaderFooterRefs:
|
|
250
|
+
sectionHeaderFooterRefs: _e(i),
|
|
251
251
|
theme: ee,
|
|
252
252
|
sectionProperties: s,
|
|
253
253
|
document: i,
|
|
254
254
|
defaultTabStop: te,
|
|
255
255
|
mirrorMargins: ne,
|
|
256
256
|
styles: g,
|
|
257
|
-
layout:
|
|
257
|
+
layout: P.value,
|
|
258
258
|
hfPMs: K,
|
|
259
|
-
painter:
|
|
259
|
+
painter: ot,
|
|
260
260
|
pagesContainer: r,
|
|
261
|
-
session:
|
|
262
|
-
renderHfFromContentOrPm:
|
|
263
|
-
renderHeaderFooterContentByRId:
|
|
264
|
-
documentFontsAreLoaded:
|
|
265
|
-
buildFootnoteRenderItems:
|
|
266
|
-
describeInvalidHighlightMarks:
|
|
267
|
-
emptyTemplatePreviewEntries:
|
|
261
|
+
session: at,
|
|
262
|
+
renderHfFromContentOrPm: Je,
|
|
263
|
+
renderHeaderFooterContentByRId: Ye,
|
|
264
|
+
documentFontsAreLoaded: Qe,
|
|
265
|
+
buildFootnoteRenderItems: Xe,
|
|
266
|
+
describeInvalidHighlightMarks: Ze,
|
|
267
|
+
emptyTemplatePreviewEntries: Ke
|
|
268
268
|
}, e, t));
|
|
269
269
|
} catch (e) {
|
|
270
270
|
let t = e instanceof Error ? e : Error(String(e));
|
|
271
|
-
|
|
271
|
+
C?.(t);
|
|
272
272
|
}
|
|
273
273
|
}
|
|
274
|
-
let Y =
|
|
274
|
+
let Y = de({
|
|
275
275
|
runLayout: (e, t) => J(e, t),
|
|
276
|
-
debounceMs:
|
|
277
|
-
maxDelayMs:
|
|
278
|
-
clock:
|
|
276
|
+
debounceMs: Ue,
|
|
277
|
+
maxDelayMs: We,
|
|
278
|
+
clock: ue
|
|
279
279
|
}), X = null;
|
|
280
|
-
function
|
|
280
|
+
function lt() {
|
|
281
281
|
X !== null && (window.clearTimeout(X), X = null);
|
|
282
|
-
let e =
|
|
282
|
+
let e = O.value, t = E.value;
|
|
283
283
|
if (!(!e || !t)) try {
|
|
284
|
-
let n =
|
|
285
|
-
|
|
284
|
+
let n = xe(e.state.doc, t);
|
|
285
|
+
E.value = n, K.sync(), q.sync(), S?.(n), W.emit("docChange", n);
|
|
286
286
|
} catch (e) {
|
|
287
|
-
|
|
287
|
+
C?.(e instanceof Error ? e : Error(String(e)));
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
|
-
function
|
|
290
|
+
function ut() {
|
|
291
291
|
X !== null && window.clearTimeout(X), X = window.setTimeout(() => {
|
|
292
|
-
X = null,
|
|
293
|
-
},
|
|
292
|
+
X = null, lt();
|
|
293
|
+
}, Ge);
|
|
294
294
|
}
|
|
295
|
-
let Z =
|
|
295
|
+
let Z = se({
|
|
296
296
|
getHost: () => t.value,
|
|
297
|
-
getDocument: () =>
|
|
298
|
-
getStyles: () =>
|
|
299
|
-
getExtensionManager: () =>
|
|
300
|
-
getExternalPlugins:
|
|
297
|
+
getDocument: () => E.value,
|
|
298
|
+
getStyles: () => E.value?.package.styles ?? null,
|
|
299
|
+
getExtensionManager: () => B,
|
|
300
|
+
getExternalPlugins: it,
|
|
301
301
|
getCollaboration: () => c(x),
|
|
302
|
-
getCollaborationModules: () =>
|
|
302
|
+
getCollaborationModules: () => A.value,
|
|
303
303
|
getPrecomputedInitialState: () => null,
|
|
304
304
|
getReadOnly: () => c(u),
|
|
305
|
-
getDocumentIdentity: () => String(
|
|
306
|
-
getDocumentContext: () =>
|
|
307
|
-
onTransaction:
|
|
305
|
+
getDocumentIdentity: () => String(D),
|
|
306
|
+
getDocumentContext: () => E.value,
|
|
307
|
+
onTransaction: dt,
|
|
308
308
|
onSelectionChange: (e) => {
|
|
309
|
-
|
|
309
|
+
k.value = e, w?.(e), W.emit("selectionChange", {
|
|
310
310
|
from: e.selection.from,
|
|
311
311
|
to: e.selection.to
|
|
312
312
|
});
|
|
313
313
|
},
|
|
314
314
|
onKeyDown: () => !1,
|
|
315
|
-
onCopy: () =>
|
|
316
|
-
onCut: () =>
|
|
317
|
-
onPaste: () =>
|
|
318
|
-
onReadOnlyEditAttempt: () =>
|
|
319
|
-
onEditorViewReady:
|
|
315
|
+
onCopy: () => Ie?.(),
|
|
316
|
+
onCut: () => Le?.(),
|
|
317
|
+
onPaste: () => Re?.(),
|
|
318
|
+
onReadOnlyEditAttempt: () => ze?.(),
|
|
319
|
+
onEditorViewReady: ft,
|
|
320
320
|
onEditorViewDestroy: () => {
|
|
321
|
-
|
|
321
|
+
O.value = null, L.value = !1, Fe?.(null);
|
|
322
322
|
},
|
|
323
323
|
onRemoteSelectionsChange: (e) => {
|
|
324
|
-
|
|
324
|
+
j.value = e;
|
|
325
325
|
}
|
|
326
326
|
}), Q = () => {
|
|
327
|
-
let e = c(x)?.awareness, t =
|
|
328
|
-
|
|
327
|
+
let e = c(x)?.awareness, t = A.value, n = Z.getView();
|
|
328
|
+
j.value = e && t && n ? oe(n.state, e, t) : [];
|
|
329
329
|
};
|
|
330
330
|
l(() => c(x), (e, t, n) => {
|
|
331
|
-
if (
|
|
332
|
-
|
|
331
|
+
if (j.value = [], !e) {
|
|
332
|
+
A.value = null, Z.retryViewCreation(), Z.syncExternalDocument();
|
|
333
333
|
return;
|
|
334
334
|
}
|
|
335
335
|
let r = !1;
|
|
336
336
|
n(() => {
|
|
337
337
|
r = !0;
|
|
338
|
-
}),
|
|
339
|
-
r || (
|
|
338
|
+
}), A.value = null, re().then((e) => {
|
|
339
|
+
r || (A.value = e, Z.retryViewCreation(), Z.syncExternalDocument(), Q());
|
|
340
340
|
}, (e) => {
|
|
341
|
-
r || (
|
|
341
|
+
r || (A.value = null, C?.(e instanceof Error ? e : Error(String(e))));
|
|
342
342
|
});
|
|
343
343
|
}, { immediate: !0 }), l(() => ({
|
|
344
344
|
awareness: c(x)?.awareness,
|
|
345
|
-
modules:
|
|
346
|
-
view:
|
|
345
|
+
modules: A.value,
|
|
346
|
+
view: O.value
|
|
347
347
|
}), ({ awareness: e, modules: t, view: n }, r, i) => {
|
|
348
348
|
if (!e || !t || !n) {
|
|
349
|
-
|
|
349
|
+
j.value = [];
|
|
350
350
|
return;
|
|
351
351
|
}
|
|
352
352
|
e.on("change", Q), Q(), i(() => {
|
|
353
|
-
e.off("change", Q),
|
|
353
|
+
e.off("change", Q), j.value = [];
|
|
354
354
|
});
|
|
355
355
|
}, { flush: "post" });
|
|
356
|
-
function
|
|
357
|
-
|
|
356
|
+
function dt(e, t) {
|
|
357
|
+
k.value = t, e.docChanged && (z.value = !0, G.incrementStateSeq(), Y.schedule(t, be(e)), ut()), G.requestRender();
|
|
358
358
|
}
|
|
359
|
-
function
|
|
360
|
-
|
|
361
|
-
|
|
359
|
+
function ft(e) {
|
|
360
|
+
O.value = e, k.value = e.state, L.value = !0, J(e.state, { reason: "initial" }), G.requestRender(), $(e), Fe?.(e), c(u) || requestAnimationFrame(() => {
|
|
361
|
+
O.value === e && e.focus();
|
|
362
362
|
});
|
|
363
363
|
}
|
|
364
|
-
let
|
|
364
|
+
let pt = {
|
|
365
|
+
getDocx: async (e) => (await xt(e))?.buffer ?? null,
|
|
366
|
+
loadDocument: bt,
|
|
367
|
+
loadDocx: yt
|
|
368
|
+
}, mt = ne({
|
|
365
369
|
getEditorApi: () => Z.api,
|
|
366
|
-
getLayout: () =>
|
|
370
|
+
getLayout: () => P.value,
|
|
367
371
|
runLayout: (e, t) => J(e, t),
|
|
372
|
+
getDocumentIO: () => pt,
|
|
368
373
|
emitter: W
|
|
369
374
|
});
|
|
370
375
|
function $(e) {
|
|
371
376
|
te(c(y) === "suggesting", e.state, e.dispatch, c(b));
|
|
372
377
|
}
|
|
373
378
|
l([() => c(y), () => c(b)], () => {
|
|
374
|
-
let e =
|
|
379
|
+
let e = O.value;
|
|
375
380
|
e && $(e);
|
|
376
381
|
for (let e of q.listStories()) {
|
|
377
382
|
let t = q.getView(e);
|
|
378
383
|
t && $(t);
|
|
379
384
|
}
|
|
380
385
|
}), l(() => c(u), (e) => {
|
|
381
|
-
Z.syncEditable(), e &&
|
|
386
|
+
Z.syncEditable(), e && Ot();
|
|
382
387
|
});
|
|
383
|
-
function
|
|
384
|
-
let t =
|
|
385
|
-
if (t === e.state.plugins.includes(
|
|
386
|
-
let n = e.state.plugins.filter((e) => e !==
|
|
388
|
+
function ht(e) {
|
|
389
|
+
let t = rt();
|
|
390
|
+
if (t === e.state.plugins.includes(H)) return;
|
|
391
|
+
let n = e.state.plugins.filter((e) => e !== H && e !== U);
|
|
387
392
|
if (t) {
|
|
388
|
-
let e = n.indexOf(
|
|
389
|
-
n.splice(t, 0,
|
|
393
|
+
let e = n.indexOf(nt), t = e === -1 ? n.length : e;
|
|
394
|
+
n.splice(t, 0, H, U);
|
|
390
395
|
}
|
|
391
396
|
e.updateState(e.state.reconfigure({ plugins: n }));
|
|
392
397
|
}
|
|
393
|
-
l(() =>
|
|
394
|
-
let e =
|
|
395
|
-
e &&
|
|
398
|
+
l(() => rt(), () => {
|
|
399
|
+
let e = O.value;
|
|
400
|
+
e && ht(e);
|
|
396
401
|
});
|
|
397
|
-
function
|
|
402
|
+
function gt() {
|
|
398
403
|
Z.ensureView();
|
|
399
404
|
}
|
|
400
|
-
function
|
|
401
|
-
|
|
405
|
+
function _t() {
|
|
406
|
+
D += 1, z.value = !1, M.value = null, N.value = null, q.activate(null), Y.dispose(), Z.destroyView(), K.sync(), q.sync(), Z.ensureView(), Z.getView() || vt();
|
|
402
407
|
}
|
|
403
|
-
function
|
|
404
|
-
let e =
|
|
408
|
+
function vt() {
|
|
409
|
+
let e = E.value;
|
|
405
410
|
if (!(!e || c(x))) try {
|
|
406
|
-
let t =
|
|
411
|
+
let t = ce({
|
|
407
412
|
document: e,
|
|
408
413
|
styles: e.package.styles ?? null,
|
|
409
|
-
manager:
|
|
410
|
-
externalPlugins:
|
|
414
|
+
manager: B,
|
|
415
|
+
externalPlugins: it(),
|
|
411
416
|
collaborationModules: null,
|
|
412
417
|
reason: "mount"
|
|
413
418
|
});
|
|
414
|
-
|
|
419
|
+
k.value = t, J(t, { reason: "initial" });
|
|
415
420
|
} catch (e) {
|
|
416
|
-
|
|
421
|
+
C?.(e instanceof Error ? e : Error(String(e)));
|
|
417
422
|
}
|
|
418
423
|
}
|
|
419
424
|
l([
|
|
420
425
|
t,
|
|
421
426
|
a,
|
|
422
|
-
|
|
427
|
+
T,
|
|
423
428
|
...r ? [r] : []
|
|
424
429
|
], () => {
|
|
425
|
-
t.value &&
|
|
430
|
+
t.value && E.value && !Z.getView() && gt(), K.sync(), q.sync();
|
|
426
431
|
}, { flush: "post" });
|
|
427
|
-
async function
|
|
428
|
-
|
|
432
|
+
async function yt(e) {
|
|
433
|
+
R.value = null, L.value = !1;
|
|
429
434
|
try {
|
|
430
|
-
let t = await
|
|
431
|
-
|
|
435
|
+
let t = await pe(e, { password: c(ge) });
|
|
436
|
+
E.value = t, _t();
|
|
432
437
|
} catch (e) {
|
|
433
438
|
let t = e instanceof Error ? e : Error(String(e));
|
|
434
|
-
|
|
439
|
+
R.value = t.message, C?.(t);
|
|
435
440
|
}
|
|
436
441
|
}
|
|
437
|
-
function
|
|
438
|
-
|
|
442
|
+
function bt(e) {
|
|
443
|
+
R.value = null, E.value = e, _t();
|
|
439
444
|
}
|
|
440
|
-
async function
|
|
441
|
-
let t =
|
|
445
|
+
async function xt(e) {
|
|
446
|
+
let t = O.value, n = E.value;
|
|
442
447
|
if (!t || !n) return null;
|
|
443
|
-
let r = q.snapshotDocument(K.snapshotDocument(n)), i = t.state, { resolveSelectiveSaveFlags: a } = await import("@stll/folio-core/docx/selectiveSaveFlags"), o = a(c(
|
|
448
|
+
let r = q.snapshotDocument(K.snapshotDocument(n)), i = t.state, { resolveSelectiveSaveFlags: a } = await import("@stll/folio-core/docx/selectiveSaveFlags"), o = a(c(Be)), s = xe(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;
|
|
444
449
|
if (d && l) {
|
|
445
450
|
let { attemptSelectiveSave: e } = await import("@stll/folio-core/docx/selectiveSave");
|
|
446
451
|
m = await e(s, l, {
|
|
447
|
-
changedParaIds:
|
|
448
|
-
structuralChange:
|
|
449
|
-
hasUntrackedChanges:
|
|
452
|
+
changedParaIds: Ce(i),
|
|
453
|
+
structuralChange: we(i),
|
|
454
|
+
hasUntrackedChanges: Te(i),
|
|
450
455
|
maxBytes: o.selectiveSaveMaxBytes
|
|
451
456
|
});
|
|
452
457
|
}
|
|
@@ -455,82 +460,89 @@ function M(e) {
|
|
|
455
460
|
else if (o.selectiveSaveTripwire) try {
|
|
456
461
|
g = await f(s);
|
|
457
462
|
} catch {}
|
|
458
|
-
if (o.selectiveSaveTripwire && g &&
|
|
463
|
+
if (o.selectiveSaveTripwire && g && Ve) try {
|
|
459
464
|
let { compareSelectiveVsFull: e } = await import("@stll/folio-core/docx/selectiveSaveTripwire");
|
|
460
|
-
|
|
465
|
+
Ve(await e(m, g));
|
|
461
466
|
} catch {}
|
|
462
|
-
return
|
|
467
|
+
return {
|
|
468
|
+
buffer: h,
|
|
469
|
+
document: s
|
|
470
|
+
};
|
|
463
471
|
}
|
|
464
|
-
function
|
|
465
|
-
let
|
|
472
|
+
async function St(e) {
|
|
473
|
+
let t = await xt({ mode: e?.selective === !1 ? _.full : _.preferSelective });
|
|
474
|
+
return t ? (E.value = t.document, K.sync(), q.sync(), z.value = !1, new Blob([t.buffer], { type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" })) : null;
|
|
475
|
+
}
|
|
476
|
+
function Ct() {
|
|
477
|
+
let e = E.value;
|
|
466
478
|
return e ? q.snapshotDocument(K.snapshotDocument(e)) : null;
|
|
467
479
|
}
|
|
468
|
-
function
|
|
469
|
-
|
|
480
|
+
function wt(e) {
|
|
481
|
+
E.value = e, K.sync(), q.sync(), N.value && !q.getView(N.value) && (N.value = null);
|
|
470
482
|
}
|
|
471
|
-
function
|
|
483
|
+
function Tt(e) {
|
|
472
484
|
return K.getView(e);
|
|
473
485
|
}
|
|
474
|
-
function
|
|
486
|
+
function Et() {
|
|
475
487
|
K.sync();
|
|
476
488
|
}
|
|
477
|
-
function
|
|
489
|
+
function Dt(e) {
|
|
478
490
|
let t = q.activate(e);
|
|
479
|
-
t && ($(t),
|
|
491
|
+
t && ($(t), N.value = e, requestAnimationFrame(() => t.focus()));
|
|
480
492
|
}
|
|
481
|
-
function
|
|
482
|
-
q.activate(null),
|
|
493
|
+
function Ot() {
|
|
494
|
+
q.activate(null), N.value = null;
|
|
483
495
|
}
|
|
484
|
-
function
|
|
485
|
-
let e =
|
|
496
|
+
function kt() {
|
|
497
|
+
let e = N.value;
|
|
486
498
|
return e ? q.getView(e) : null;
|
|
487
499
|
}
|
|
488
|
-
function
|
|
489
|
-
return
|
|
500
|
+
function At() {
|
|
501
|
+
return B.getCommands();
|
|
490
502
|
}
|
|
491
|
-
function
|
|
492
|
-
let e =
|
|
493
|
-
e ? e.focus() :
|
|
503
|
+
function jt() {
|
|
504
|
+
let e = kt();
|
|
505
|
+
e ? e.focus() : O.value?.focus();
|
|
494
506
|
}
|
|
495
|
-
function
|
|
496
|
-
let e =
|
|
507
|
+
function Mt() {
|
|
508
|
+
let e = O.value;
|
|
497
509
|
e && J(e.state, { reason: "manual" });
|
|
498
510
|
}
|
|
499
|
-
l([() => c(
|
|
500
|
-
function
|
|
501
|
-
Y.dispose(), X !== null && (window.clearTimeout(X), X = null), Z.destroyView(),
|
|
502
|
-
}
|
|
503
|
-
return i(
|
|
504
|
-
editor:
|
|
505
|
-
editorView:
|
|
506
|
-
editorState:
|
|
507
|
-
remoteSelections:
|
|
508
|
-
headerFooterSelection:
|
|
509
|
-
activeNoteStory:
|
|
510
|
-
isReady:
|
|
511
|
-
isDirty:
|
|
512
|
-
parseError:
|
|
513
|
-
layout:
|
|
514
|
-
blocks:
|
|
515
|
-
measures:
|
|
511
|
+
l([() => c(me), () => c(he)], () => Mt());
|
|
512
|
+
function Nt() {
|
|
513
|
+
Y.dispose(), X !== null && (window.clearTimeout(X), X = null), Z.destroyView(), j.value = [], K.destroy(), q.destroy(), B.destroy(), k.value = null, P.value = null, E.value = null, L.value = !1;
|
|
514
|
+
}
|
|
515
|
+
return i(Nt), {
|
|
516
|
+
editor: mt,
|
|
517
|
+
editorView: O,
|
|
518
|
+
editorState: k,
|
|
519
|
+
remoteSelections: j,
|
|
520
|
+
headerFooterSelection: M,
|
|
521
|
+
activeNoteStory: N,
|
|
522
|
+
isReady: L,
|
|
523
|
+
isDirty: z,
|
|
524
|
+
parseError: R,
|
|
525
|
+
layout: P,
|
|
526
|
+
blocks: F,
|
|
527
|
+
measures: I,
|
|
516
528
|
syncCoordinator: G,
|
|
517
|
-
loadBuffer:
|
|
518
|
-
loadDocument:
|
|
519
|
-
save:
|
|
520
|
-
getDocument:
|
|
521
|
-
setDocument:
|
|
522
|
-
getHeaderFooterView:
|
|
523
|
-
syncHeaderFooterViews:
|
|
524
|
-
openNoteStory:
|
|
525
|
-
closeNoteStory:
|
|
526
|
-
getActiveNoteView:
|
|
527
|
-
getCommands:
|
|
528
|
-
focus:
|
|
529
|
-
reLayout:
|
|
530
|
-
destroy:
|
|
529
|
+
loadBuffer: yt,
|
|
530
|
+
loadDocument: bt,
|
|
531
|
+
save: St,
|
|
532
|
+
getDocument: Ct,
|
|
533
|
+
setDocument: wt,
|
|
534
|
+
getHeaderFooterView: Tt,
|
|
535
|
+
syncHeaderFooterViews: Et,
|
|
536
|
+
openNoteStory: Dt,
|
|
537
|
+
closeNoteStory: Ot,
|
|
538
|
+
getActiveNoteView: kt,
|
|
539
|
+
getCommands: At,
|
|
540
|
+
focus: jt,
|
|
541
|
+
reLayout: Mt,
|
|
542
|
+
destroy: Nt
|
|
531
543
|
};
|
|
532
544
|
}
|
|
533
|
-
function
|
|
545
|
+
function M(e, t) {
|
|
534
546
|
if (t < e.top + 40) {
|
|
535
547
|
let n = Math.max(0, e.top + 40 - t);
|
|
536
548
|
return -Math.min(12, n / 40 * 12);
|
|
@@ -543,7 +555,7 @@ function N(e, t) {
|
|
|
543
555
|
}
|
|
544
556
|
//#endregion
|
|
545
557
|
//#region src/composables/useDragAutoScroll.ts
|
|
546
|
-
function
|
|
558
|
+
function N({ pagesContainer: e, onScrollExtendSelection: t }) {
|
|
547
559
|
let n = null, r = 0, a = 0, o = !1, s = null;
|
|
548
560
|
function c() {
|
|
549
561
|
if (s) return s;
|
|
@@ -557,7 +569,7 @@ function P({ pagesContainer: e, onScrollExtendSelection: t }) {
|
|
|
557
569
|
if (!o) return;
|
|
558
570
|
let e = c();
|
|
559
571
|
if (!e) return;
|
|
560
|
-
let i =
|
|
572
|
+
let i = M(e.getBoundingClientRect(), a);
|
|
561
573
|
i !== 0 && (e.scrollTop += i, t(r, a)), n = requestAnimationFrame(u);
|
|
562
574
|
}
|
|
563
575
|
function d() {
|
|
@@ -578,7 +590,7 @@ function P({ pagesContainer: e, onScrollExtendSelection: t }) {
|
|
|
578
590
|
}
|
|
579
591
|
//#endregion
|
|
580
592
|
//#region src/composables/useTableResize.ts
|
|
581
|
-
function
|
|
593
|
+
function P() {
|
|
582
594
|
let e = {
|
|
583
595
|
active: !1,
|
|
584
596
|
startX: 0,
|
|
@@ -610,7 +622,7 @@ function F() {
|
|
|
610
622
|
}
|
|
611
623
|
function a(i, a) {
|
|
612
624
|
let o = i.target;
|
|
613
|
-
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),
|
|
625
|
+
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;
|
|
614
626
|
}
|
|
615
627
|
function o(r) {
|
|
616
628
|
if (e.active && e.handle) {
|
|
@@ -629,7 +641,7 @@ function F() {
|
|
|
629
641
|
let e = r.clientY - t.startY, n = parseFloat(t.handle.style.top);
|
|
630
642
|
t.handle.style.top = `${n + e}px`, t.startY = r.clientY;
|
|
631
643
|
let i = Math.round(e * x), a = t.origHeight + i;
|
|
632
|
-
a >=
|
|
644
|
+
a >= Ae && (t.origHeight = a);
|
|
633
645
|
return;
|
|
634
646
|
}
|
|
635
647
|
if (n.active && n.handle) {
|
|
@@ -642,7 +654,7 @@ function F() {
|
|
|
642
654
|
}
|
|
643
655
|
function s(i) {
|
|
644
656
|
if (e.active) {
|
|
645
|
-
e.active = !1, e.handle?.classList.remove("dragging"), r &&
|
|
657
|
+
e.active = !1, e.handle?.classList.remove("dragging"), r && je(r, {
|
|
646
658
|
pmStart: e.tablePmStart,
|
|
647
659
|
colIdx: e.columnIndex,
|
|
648
660
|
newLeft: e.origWidths.left,
|
|
@@ -651,14 +663,14 @@ function F() {
|
|
|
651
663
|
return;
|
|
652
664
|
}
|
|
653
665
|
if (t.active) {
|
|
654
|
-
t.active = !1, t.handle?.classList.remove("dragging"), r &&
|
|
666
|
+
t.active = !1, t.handle?.classList.remove("dragging"), r && Ne(r, {
|
|
655
667
|
pmStart: t.tablePmStart,
|
|
656
668
|
rowIdx: t.rowIndex,
|
|
657
669
|
newHeight: t.origHeight
|
|
658
670
|
}), t.handle = null;
|
|
659
671
|
return;
|
|
660
672
|
}
|
|
661
|
-
n.active && (n.active = !1, n.handle?.classList.remove("dragging"), r &&
|
|
673
|
+
n.active && (n.active = !1, n.handle?.classList.remove("dragging"), r && Me(r, {
|
|
662
674
|
pmStart: n.tablePmStart,
|
|
663
675
|
colIdx: n.columnIndex,
|
|
664
676
|
newWidth: n.origWidth
|
|
@@ -675,12 +687,12 @@ function F() {
|
|
|
675
687
|
isResizing: i
|
|
676
688
|
};
|
|
677
689
|
}
|
|
678
|
-
function
|
|
679
|
-
let n =
|
|
690
|
+
function F(e, t) {
|
|
691
|
+
let n = S(e, t.tablePmStart, t.columnIndex);
|
|
680
692
|
n && (t.origWidths = n);
|
|
681
693
|
}
|
|
682
|
-
function
|
|
683
|
-
let r =
|
|
694
|
+
function I(e, t, n) {
|
|
695
|
+
let r = C(e, t.tablePmStart, t.rowIndex);
|
|
684
696
|
if (r != null) {
|
|
685
697
|
t.origHeight = r;
|
|
686
698
|
return;
|
|
@@ -688,18 +700,18 @@ function L(e, t, n) {
|
|
|
688
700
|
let i = n.closest(".layout-table")?.querySelector(`[data-row-index="${t.rowIndex}"]`), a = i ? i.getBoundingClientRect().height : 30;
|
|
689
701
|
t.origHeight = Math.round(a * x);
|
|
690
702
|
}
|
|
691
|
-
function
|
|
692
|
-
let n =
|
|
703
|
+
function L(e, t) {
|
|
704
|
+
let n = Pe(e, t.tablePmStart, t.columnIndex);
|
|
693
705
|
n != null && (t.origWidth = n);
|
|
694
706
|
}
|
|
695
707
|
//#endregion
|
|
696
708
|
//#region src/composables/useTrackedChanges.ts
|
|
697
|
-
function
|
|
698
|
-
return e(() => (n.value,
|
|
709
|
+
function R(t, n) {
|
|
710
|
+
return e(() => (n.value, w(t.value?.state ?? null)));
|
|
699
711
|
}
|
|
700
712
|
//#endregion
|
|
701
713
|
//#region src/composables/useZoom.ts
|
|
702
|
-
var
|
|
714
|
+
var z = Ie, B = Fe, V = [
|
|
703
715
|
.5,
|
|
704
716
|
.75,
|
|
705
717
|
1,
|
|
@@ -707,16 +719,16 @@ var B = Fe, V = w, H = [
|
|
|
707
719
|
1.5,
|
|
708
720
|
2
|
|
709
721
|
];
|
|
710
|
-
function
|
|
711
|
-
let i = o(Math.max(
|
|
722
|
+
function $e(t = 1) {
|
|
723
|
+
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);
|
|
712
724
|
function l(e) {
|
|
713
|
-
i.value = Math.max(
|
|
725
|
+
i.value = Math.max(z, Math.min(B, Math.round(e * 100) / 100));
|
|
714
726
|
}
|
|
715
727
|
function u() {
|
|
716
|
-
l(i.value +
|
|
728
|
+
l(i.value + Le);
|
|
717
729
|
}
|
|
718
730
|
function d() {
|
|
719
|
-
l(i.value -
|
|
731
|
+
l(i.value - Le);
|
|
720
732
|
}
|
|
721
733
|
function f() {
|
|
722
734
|
l(1);
|
|
@@ -742,8 +754,8 @@ function Ze(t = 1) {
|
|
|
742
754
|
handleWheel: p,
|
|
743
755
|
handleKeyDown: m,
|
|
744
756
|
installShortcuts: h,
|
|
745
|
-
ZOOM_PRESETS:
|
|
757
|
+
ZOOM_PRESETS: V
|
|
746
758
|
};
|
|
747
759
|
}
|
|
748
760
|
//#endregion
|
|
749
|
-
export {
|
|
761
|
+
export { N as a, T as c, P as i, D as l, w as n, j as o, R as r, O as s, $e as t, k as u };
|