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