@stll/folio-vue 0.24.0 → 0.25.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/ListButtons-B8HxA64I.cjs +4 -0
- package/dist/{ListButtons-DjLPhg8p.js → ListButtons-BeELtp_-.js} +201 -188
- package/dist/{SplitCellDialog-Id6nLwrR.js → SplitCellDialog-CSqbtDum.js} +748 -732
- package/dist/SplitCellDialog-DzKBu09z.cjs +15 -0
- package/dist/components/AnonymizationRectsOverlay.vue.d.ts +20 -0
- package/dist/components/AutocompleteCaretOverlay.vue.d.ts +4 -0
- package/dist/components/AutocompleteSuggestionOverlay.vue.d.ts +11 -0
- package/dist/components/CommentMarginMarkers.vue.d.ts +16 -0
- package/dist/components/ContentControlWidgetsOverlay.vue.d.ts +8 -0
- package/dist/components/DecorationLayer.vue.d.ts +12 -0
- package/dist/components/DocumentName.vue.d.ts +13 -0
- package/dist/components/DocumentOutline.vue.d.ts +28 -0
- package/dist/components/DocxEditor/DocxEditorDialogs.vue.d.ts +73 -0
- package/dist/components/DocxEditor/DocxEditorMenuBar.vue.d.ts +39 -0
- package/dist/components/DocxEditor/DocxEditorOverlays.vue.d.ts +42 -0
- package/dist/components/DocxEditor/types.d.ts +9 -2
- package/dist/components/DocxEditor.vue.d.ts +58 -0
- package/dist/components/EditingModeDropdown.vue.d.ts +11 -0
- package/dist/components/EditorToolbar.vue.d.ts +30 -0
- package/dist/components/FormattingBar.vue.d.ts +20 -0
- package/dist/components/HeaderFooterSelectionOverlay.vue.d.ts +12 -0
- package/dist/components/ImageContextMenu.vue.d.ts +24 -0
- package/dist/components/ImageSelectionOverlay.vue.d.ts +21 -0
- package/dist/components/InlineHeaderFooterEditor.vue.d.ts +15 -0
- package/dist/components/MenuBar.vue.d.ts +18 -0
- package/dist/components/PageIndicator.vue.d.ts +8 -0
- package/dist/components/PassageHighlightOverlay.vue.d.ts +16 -0
- package/dist/components/PrintButton.vue.d.ts +16 -0
- package/dist/components/ReviewControls.vue.d.ts +17 -0
- package/dist/components/TemplateDirectivesOverlay.vue.d.ts +15 -0
- package/dist/components/TextContextMenu.vue.d.ts +46 -0
- package/dist/components/TitleBar.vue.d.ts +17 -0
- package/dist/components/Toolbar.vue.d.ts +139 -0
- package/dist/components/UnifiedSidebar.vue.d.ts +55 -0
- package/dist/components/dialogs/FindReplaceDialog.vue.d.ts +20 -0
- package/dist/components/dialogs/FootnotePropertiesDialog.vue.d.ts +15 -0
- package/dist/components/dialogs/HyperlinkDialog.vue.d.ts +30 -0
- package/dist/components/dialogs/ImagePositionDialog.vue.d.ts +29 -0
- package/dist/components/dialogs/ImagePropertiesDialog.vue.d.ts +13 -0
- package/dist/components/dialogs/InsertImageDialog.vue.d.ts +21 -0
- package/dist/components/dialogs/InsertSymbolDialog.vue.d.ts +12 -0
- package/dist/components/dialogs/InsertTableDialog.vue.d.ts +22 -0
- package/dist/components/dialogs/PageSetupDialog.vue.d.ts +14 -0
- package/dist/components/dialogs/PasteSpecialDialog.vue.d.ts +16 -0
- package/dist/components/dialogs/SetNumberingValueDialog.vue.d.ts +12 -0
- package/dist/components/dialogs/SplitCellDialog.vue.d.ts +22 -0
- package/dist/components/dialogs/TablePropertiesDialog.vue.d.ts +15 -0
- package/dist/components/dialogs/WatermarkDialog.vue.d.ts +14 -0
- package/dist/components/dialogs/index.d.ts +13 -13
- package/dist/components/sidebar/AddCommentCard.vue.d.ts +9 -0
- package/dist/components/sidebar/Avatar.vue.d.ts +10 -0
- package/dist/components/sidebar/CommentCard.vue.d.ts +21 -0
- package/dist/components/sidebar/ReplyInput.vue.d.ts +7 -0
- package/dist/components/sidebar/ReplyThread.vue.d.ts +8 -0
- package/dist/components/sidebar/ResolvedCommentMarker.vue.d.ts +11 -0
- package/dist/components/sidebar/TrackedChangeCard.vue.d.ts +20 -0
- package/dist/components/ui/AlignmentButtons.vue.d.ts +15 -0
- package/dist/components/ui/Button.vue.d.ts +30 -0
- package/dist/components/ui/Checkbox.vue.d.ts +11 -0
- package/dist/components/ui/ColorPicker.vue.d.ts +30 -0
- package/dist/components/ui/DatePickerPopover.vue.d.ts +13 -0
- package/dist/components/ui/Dialog.vue.d.ts +28 -0
- package/dist/components/ui/FontPicker.vue.d.ts +21 -0
- package/dist/components/ui/FontSizePicker.vue.d.ts +27 -0
- package/dist/components/ui/HorizontalRuler.vue.d.ts +39 -0
- package/dist/components/ui/HyperlinkPopup.vue.d.ts +21 -0
- package/dist/components/ui/IconGridDropdown.vue.d.ts +32 -0
- package/dist/components/ui/ImageTransformDropdown.vue.d.ts +11 -0
- package/dist/components/ui/ImageWrapDropdown.vue.d.ts +15 -0
- package/dist/components/ui/Input.vue.d.ts +17 -0
- package/dist/components/ui/LineSpacingPicker.vue.d.ts +20 -0
- package/dist/components/ui/ListButtons.vue.d.ts +30 -0
- package/dist/components/ui/MaterialSymbol.vue.d.ts +13 -0
- package/dist/components/ui/MenuDropdown.vue.d.ts +42 -0
- package/dist/components/ui/OutlineRail.vue.d.ts +19 -0
- package/dist/components/ui/Popover.vue.d.ts +40 -0
- package/dist/components/ui/Select.vue.d.ts +15 -0
- package/dist/components/ui/StylePicker.vue.d.ts +16 -0
- package/dist/components/ui/TableBorderColorPicker.vue.d.ts +14 -0
- package/dist/components/ui/TableBorderPicker.vue.d.ts +11 -0
- package/dist/components/ui/TableBorderWidthPicker.vue.d.ts +10 -0
- package/dist/components/ui/TableCellFillPicker.vue.d.ts +14 -0
- package/dist/components/ui/TableGridInline.vue.d.ts +14 -0
- package/dist/components/ui/TableGridPicker.vue.d.ts +18 -0
- package/dist/components/ui/TableMoreDropdown.vue.d.ts +51 -0
- package/dist/components/ui/TableStyleGallery.vue.d.ts +10 -0
- package/dist/components/ui/TableToolbar.vue.d.ts +61 -0
- package/dist/components/ui/VerticalRuler.vue.d.ts +20 -0
- package/dist/components/ui/ZoomControl.vue.d.ts +12 -0
- package/dist/components/ui/icon-paths.json.d.ts +276 -0
- package/dist/composables/useDocxEditor.d.ts +2 -0
- package/dist/composables/useDocxEditorRefApi.d.ts +3 -0
- package/dist/composables/useFindReplace.d.ts +5 -1
- package/dist/composables.cjs +2 -2
- package/dist/composables.js +45 -44
- package/dist/dialogs.cjs +1 -1
- package/dist/dialogs.js +2 -5
- package/dist/folio-vue.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1611 -1564
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +2 -2
- package/dist/useFindReplace-BbW0xWo7.js +74 -0
- package/dist/useFindReplace-neQmDh2i.cjs +1 -0
- package/dist/useZoom-B1miNAf_.cjs +1 -0
- package/dist/{useZoom-BA92aWwm.js → useZoom-Bw5gp69V.js} +206 -203
- package/package.json +13 -2
- package/dist/ListButtons-DIWR-Q8d.cjs +0 -4
- package/dist/SplitCellDialog-B_z6ynxm.cjs +0 -15
- package/dist/useFindReplace-CL8Rbc3y.js +0 -59
- package/dist/useFindReplace-ZCrdvwEk.cjs +0 -1
- package/dist/useZoom-Bv8t7dYu.cjs +0 -1
|
@@ -34,11 +34,11 @@ import { createStarterKit as We } from "@stll/folio-core/prosemirror/extensions/
|
|
|
34
34
|
import { createTemplatePreviewValuesPlugin as Ge } from "@stll/folio-core/prosemirror/plugins/templatePreviewValues";
|
|
35
35
|
import { templateSlashMenuPlugin as Ke } from "@stll/folio-core/prosemirror/plugins/templateSlashMenu";
|
|
36
36
|
import { resolveHeaderFooterContent as qe } from "@stll/folio-core/utils/headerFooter";
|
|
37
|
-
import { MIN_CELL_WIDTH_TWIPS as
|
|
37
|
+
import { MIN_CELL_WIDTH_TWIPS as v, MIN_ROW_HEIGHT_TWIPS as Je, TWIPS_PER_PIXEL as y, commitColumnResize as Ye, commitRightEdgeResize as Xe, commitRowResize as Ze, readColumnWidthAt as b, readColumnWidths as Qe, readRowHeight as $e } from "@stll/folio-core/prosemirror/tableResize";
|
|
38
38
|
import { extractTrackedChanges as et } from "@stll/folio-core/prosemirror/utils/extractTrackedChanges";
|
|
39
|
-
import { ZOOM_MAX as tt, ZOOM_MIN as
|
|
39
|
+
import { ZOOM_MAX as tt, ZOOM_MIN as nt, ZOOM_STEP as x } from "@stll/folio-core/utils/zoom";
|
|
40
40
|
//#region src/utils/colorMode.ts
|
|
41
|
-
var
|
|
41
|
+
var S = "(prefers-color-scheme: dark)";
|
|
42
42
|
function rt() {
|
|
43
43
|
return typeof window < "u" && typeof window.matchMedia == "function";
|
|
44
44
|
}
|
|
@@ -47,20 +47,20 @@ function it(e, t) {
|
|
|
47
47
|
}
|
|
48
48
|
function at(e) {
|
|
49
49
|
if (!rt()) return () => {};
|
|
50
|
-
let t = window.matchMedia(
|
|
50
|
+
let t = window.matchMedia(S);
|
|
51
51
|
e(t.matches);
|
|
52
52
|
let n = (t) => e(t.matches);
|
|
53
53
|
return t.addEventListener("change", n), () => t.removeEventListener("change", n);
|
|
54
54
|
}
|
|
55
55
|
//#endregion
|
|
56
56
|
//#region src/composables/useColorMode.ts
|
|
57
|
-
var C = "light",
|
|
58
|
-
a(
|
|
59
|
-
},
|
|
60
|
-
t.provide(
|
|
57
|
+
var C = "light", ot = Symbol("folioColorMode"), st = (t = C) => {
|
|
58
|
+
a(ot, e(() => c(t)));
|
|
59
|
+
}, w = { install(t, n = C) {
|
|
60
|
+
t.provide(ot, e(() => c(n)));
|
|
61
61
|
} };
|
|
62
|
-
function
|
|
63
|
-
let n = t(
|
|
62
|
+
function ct() {
|
|
63
|
+
let n = t(ot, e(() => C)), i = o(!1), a = o(!1);
|
|
64
64
|
return r(() => {
|
|
65
65
|
i.value = !0;
|
|
66
66
|
}), u((e) => {
|
|
@@ -71,8 +71,8 @@ function E() {
|
|
|
71
71
|
}
|
|
72
72
|
//#endregion
|
|
73
73
|
//#region src/composables/useDocxEditor.ts
|
|
74
|
-
var
|
|
75
|
-
function
|
|
74
|
+
var lt = 24, ut = "User", dt = 250, ft = [], pt = [];
|
|
75
|
+
function mt(e) {
|
|
76
76
|
let t = e?.columnCount ?? 1;
|
|
77
77
|
if (t <= 1) return;
|
|
78
78
|
let n = {
|
|
@@ -82,7 +82,7 @@ function ft(e) {
|
|
|
82
82
|
};
|
|
83
83
|
return e?.separator !== void 0 && (n.separator = e.separator), n;
|
|
84
84
|
}
|
|
85
|
-
function
|
|
85
|
+
function ht(e, t, n, r, i, a) {
|
|
86
86
|
if (!e) return;
|
|
87
87
|
let o = t ? {
|
|
88
88
|
...a,
|
|
@@ -90,16 +90,16 @@ function pt(e, t, n, r, i, a) {
|
|
|
90
90
|
} : a, s = t ? n?.getView(t) : null;
|
|
91
91
|
return s ? je(s.state.doc, r, i, o) : Me(e, r, i, o);
|
|
92
92
|
}
|
|
93
|
-
function
|
|
93
|
+
function gt(e, t, n, r, i) {
|
|
94
94
|
if (!e || e.size === 0) return;
|
|
95
95
|
let a = /* @__PURE__ */ new Map();
|
|
96
96
|
for (let [o, s] of e) {
|
|
97
|
-
let e =
|
|
97
|
+
let e = ht(s, o, t, n, r, i);
|
|
98
98
|
e && a.set(o, e);
|
|
99
99
|
}
|
|
100
100
|
return a.size > 0 ? a : void 0;
|
|
101
101
|
}
|
|
102
|
-
function
|
|
102
|
+
function _t(e, t, n) {
|
|
103
103
|
let r = /* @__PURE__ */ new Map();
|
|
104
104
|
if (!n || !n.package.footnotes) return r;
|
|
105
105
|
let i = /* @__PURE__ */ new Map();
|
|
@@ -125,7 +125,7 @@ function ht(e, t, n) {
|
|
|
125
125
|
}
|
|
126
126
|
return r;
|
|
127
127
|
}
|
|
128
|
-
var
|
|
128
|
+
var T = /* @__PURE__ */ new Set([
|
|
129
129
|
"black",
|
|
130
130
|
"blue",
|
|
131
131
|
"cyan",
|
|
@@ -144,48 +144,48 @@ var D = /* @__PURE__ */ new Set([
|
|
|
144
144
|
"white",
|
|
145
145
|
"yellow"
|
|
146
146
|
]);
|
|
147
|
-
function
|
|
147
|
+
function vt(e) {
|
|
148
148
|
let t = [], n = (e, r) => {
|
|
149
|
-
for (let [n, i] of e.marks.entries()) i.type.name === "highlight" && !
|
|
149
|
+
for (let [n, i] of e.marks.entries()) i.type.name === "highlight" && !T.has(String(i.attrs.color)) && t.push(`${r}.marks[${n}]=${JSON.stringify(i.attrs)}`);
|
|
150
150
|
e.forEach((e, t, i) => {
|
|
151
151
|
n(e, `${r}.content[${i}]`);
|
|
152
152
|
});
|
|
153
153
|
};
|
|
154
154
|
return n(e, "doc"), t.join("; ");
|
|
155
155
|
}
|
|
156
|
-
function
|
|
157
|
-
let { hiddenContainer: t, hiddenHeaderFooterContainer: n, noteEditorContainer: r, pagesContainer: a, readOnly: u = !1, experimentalSession: _, pageGap: se =
|
|
156
|
+
function E(e) {
|
|
157
|
+
let { hiddenContainer: t, hiddenHeaderFooterContainer: n, noteEditorContainer: r, pagesContainer: a, readOnly: u = !1, experimentalSession: _, pageGap: se = lt, pageRenderer: ce, markupView: me = "all-markup", showCommentHighlights: je = !0, showMarginGuides: Me, marginGuideColor: v, password: Je, editorMode: y, author: Ye, externalPlugins: Xe = [], historyShortcuts: Ze = "editor", collaboration: b, onAnonymizationMatchesChange: Qe, showTemplateDirectives: $e, onSlashMenuChange: et, onSlashMenuKeyAction: tt, onChange: nt, onError: x, onSelectionUpdate: S, onEditorViewReady: rt, onCopy: it, onCut: at, onPaste: C, onReadOnlyEditAttempt: ot, featureFlags: st, onSelectiveSaveTripwire: w } = e, ct = n ?? t, T = () => c(Ye) ?? ut, E = s(null), D = 0, O = !1, k = 0, A = !1, j = s(null), M = s(null), N = s(null), P = s([]), F = s(null), I = s(null), L = s(null), yt = s([]), bt = s([]), R = o(!1), z = o(null), B = o(!1), V = () => ee(c(_), d.authorityRouting), H = (e) => V() ? ie(e) : e, xt = (e, t) => {
|
|
158
158
|
if (!V()) return !1;
|
|
159
159
|
let n = new g({
|
|
160
160
|
gap: e,
|
|
161
161
|
message: f(e, t)
|
|
162
162
|
});
|
|
163
163
|
return x?.(n), !0;
|
|
164
|
-
}, U = new ze(We({ historyShortcuts:
|
|
164
|
+
}, U = new ze(We({ historyShortcuts: Ze }));
|
|
165
165
|
U.buildSchema(), U.initializeRuntime();
|
|
166
|
-
let
|
|
167
|
-
onChange: (e) =>
|
|
168
|
-
onKeyAction: (e) =>
|
|
169
|
-
}),
|
|
170
|
-
function
|
|
166
|
+
let St = fe(!1), Ct = [St], wt = ue({ keymap: !0 }), Tt = le({ onMatchesChange: (e) => Qe?.(e) }), Et = de(), Dt = Ke({
|
|
167
|
+
onChange: (e) => et?.(e),
|
|
168
|
+
onKeyAction: (e) => tt?.(e) ?? !1
|
|
169
|
+
}), Ot = Ge(), kt = () => c($e) === !0;
|
|
170
|
+
function At() {
|
|
171
171
|
return [
|
|
172
|
-
Ct,
|
|
173
|
-
xt,
|
|
174
|
-
...Ye,
|
|
175
|
-
...c(b)?.plugins ?? [],
|
|
176
172
|
wt,
|
|
177
|
-
|
|
178
|
-
|
|
173
|
+
St,
|
|
174
|
+
...Xe,
|
|
175
|
+
...c(b)?.plugins ?? [],
|
|
176
|
+
Tt,
|
|
177
|
+
...kt() ? [Et, Dt] : [],
|
|
178
|
+
Ot
|
|
179
179
|
];
|
|
180
180
|
}
|
|
181
|
-
let W = _e(), G = new Fe(), K = ke(),
|
|
181
|
+
let W = _e(), G = new Fe(), K = ke(), jt = Te({
|
|
182
182
|
relayout: () => {
|
|
183
183
|
let e = j.value?.state ?? K.lastEditorState;
|
|
184
184
|
e && X(e, { reason: "hyphenation-ready" });
|
|
185
185
|
},
|
|
186
186
|
onError: (e) => x?.(e)
|
|
187
187
|
});
|
|
188
|
-
i(
|
|
188
|
+
i(jt.cancel), i(Oe({
|
|
189
189
|
measuredFontSet: () => K.lastMeasureInputs?.fontSet ?? null,
|
|
190
190
|
relayout: () => {
|
|
191
191
|
if (A) return;
|
|
@@ -193,12 +193,13 @@ function O(e) {
|
|
|
193
193
|
e && X(e, { reason: "font-ready" });
|
|
194
194
|
}
|
|
195
195
|
}));
|
|
196
|
-
let
|
|
196
|
+
let Mt = new Pe({
|
|
197
197
|
pageGap: se,
|
|
198
198
|
showShadow: !0
|
|
199
199
|
}), q = Se({
|
|
200
|
-
getHost: () =>
|
|
201
|
-
|
|
200
|
+
getHost: () => ct.value,
|
|
201
|
+
getReadOnly: () => c(u),
|
|
202
|
+
getDocument: () => $.api.getCanonicalDocument() ?? E.value,
|
|
202
203
|
getCanonicalApi: () => $.api,
|
|
203
204
|
getExperimentalSession: () => c(_),
|
|
204
205
|
onSessionRefusal: (e, t, n) => {
|
|
@@ -207,8 +208,8 @@ function O(e) {
|
|
|
207
208
|
message: e
|
|
208
209
|
}));
|
|
209
210
|
},
|
|
210
|
-
getStyles: () =>
|
|
211
|
-
getTheme: () =>
|
|
211
|
+
getStyles: () => E.value?.package.styles ?? null,
|
|
212
|
+
getTheme: () => E.value?.package.theme ?? null,
|
|
212
213
|
onTransaction: ({ rId: e, kind: t, view: n, docChanged: r, selectionChanged: i }) => {
|
|
213
214
|
if (r && (B.value = !0, Z.schedule()), r || i) {
|
|
214
215
|
let { from: r, to: i } = n.state.selection;
|
|
@@ -224,10 +225,10 @@ function O(e) {
|
|
|
224
225
|
}
|
|
225
226
|
G.requestRender();
|
|
226
227
|
}
|
|
227
|
-
}),
|
|
228
|
+
}), Nt = { current: null }, J = Ce({
|
|
228
229
|
getHost: () => r?.value ?? null,
|
|
229
|
-
getPlugins: () =>
|
|
230
|
-
getDocument: () => $.api.getCanonicalDocument() ??
|
|
230
|
+
getPlugins: () => Ct,
|
|
231
|
+
getDocument: () => $.api.getCanonicalDocument() ?? E.value,
|
|
231
232
|
getCanonicalApi: () => $.api,
|
|
232
233
|
getExperimentalSession: () => c(_),
|
|
233
234
|
onSessionRefusal: (e, t, n) => {
|
|
@@ -236,15 +237,15 @@ function O(e) {
|
|
|
236
237
|
message: e
|
|
237
238
|
}));
|
|
238
239
|
},
|
|
239
|
-
getStyles: () =>
|
|
240
|
-
getTheme: () =>
|
|
240
|
+
getStyles: () => E.value?.package.styles ?? null,
|
|
241
|
+
getTheme: () => E.value?.package.theme ?? null,
|
|
241
242
|
onTransaction: ({ docChanged: e, selectionChanged: t, view: n }) => {
|
|
242
243
|
if (e) {
|
|
243
244
|
B.value = !0;
|
|
244
|
-
let e =
|
|
245
|
+
let e = E.value;
|
|
245
246
|
if (e) {
|
|
246
|
-
let t = $.api.getCanonicalDocument() ??
|
|
247
|
-
|
|
247
|
+
let t = $.api.getCanonicalDocument() ?? Nt.current?.snapshotDocument(e) ?? e;
|
|
248
|
+
E.value = t, nt?.(H(t)), W.emit("docChange", H(t));
|
|
248
249
|
}
|
|
249
250
|
Z.schedule();
|
|
250
251
|
}
|
|
@@ -258,26 +259,26 @@ function O(e) {
|
|
|
258
259
|
}
|
|
259
260
|
}
|
|
260
261
|
});
|
|
261
|
-
|
|
262
|
+
Nt.current = J;
|
|
262
263
|
let Y = () => {
|
|
263
264
|
q.sync(), J.sync();
|
|
264
265
|
};
|
|
265
266
|
l(() => c(_), Y);
|
|
266
|
-
function
|
|
267
|
-
e.layout && (L.value = e.layout), e.blocks && (
|
|
267
|
+
function Pt(e) {
|
|
268
|
+
e.layout && (L.value = e.layout), e.blocks && (yt.value = e.blocks), e.measures && (bt.value = e.measures), e.blockLookup && Mt.setBlockLookup(e.blockLookup), e.layout && W.emit("layoutComplete", e.layout);
|
|
268
269
|
}
|
|
269
270
|
function X(e, t = {}) {
|
|
270
271
|
if (A) return;
|
|
271
|
-
let n = a.value, r = n instanceof HTMLDivElement ? n : null, i =
|
|
272
|
+
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 = oe(s), u = ae(s), d = mt(s), f = l.w - u.left - u.right, ee = i?.package.styles ?? null, p = i?.package.theme ?? null, m = i?.package.settings?.defaultTabStop, h = i?.package.settings?.mirrorMargins === !0, g = qe(i?.package);
|
|
272
273
|
try {
|
|
273
|
-
|
|
274
|
+
Pt(we({
|
|
274
275
|
contentWidth: f,
|
|
275
276
|
columns: d,
|
|
276
277
|
pageSize: l,
|
|
277
278
|
margins: u,
|
|
278
279
|
pageGap: se,
|
|
279
|
-
showMarginGuides: c(
|
|
280
|
-
marginGuideColor: c(
|
|
280
|
+
showMarginGuides: c(Me) === !0,
|
|
281
|
+
marginGuideColor: c(v),
|
|
281
282
|
...(() => {
|
|
282
283
|
let e = c(ce);
|
|
283
284
|
return e === void 0 ? {} : { pageRenderer: e };
|
|
@@ -300,18 +301,19 @@ function O(e) {
|
|
|
300
301
|
styles: ee,
|
|
301
302
|
layout: L.value,
|
|
302
303
|
hfPMs: q,
|
|
303
|
-
painter:
|
|
304
|
+
painter: Mt,
|
|
304
305
|
pagesContainer: r,
|
|
305
306
|
session: K,
|
|
306
|
-
renderHfFromContentOrPm:
|
|
307
|
-
renderHeaderFooterContentByRId:
|
|
307
|
+
renderHfFromContentOrPm: ht,
|
|
308
|
+
renderHeaderFooterContentByRId: gt,
|
|
308
309
|
readFontSetSignature: Ee,
|
|
309
|
-
buildFootnoteRenderItems:
|
|
310
|
-
describeInvalidHighlightMarks:
|
|
311
|
-
emptyTemplatePreviewEntries:
|
|
312
|
-
emptyTemplatePreviewHidden:
|
|
313
|
-
hyphenationReadiness:
|
|
314
|
-
markupView: c(me)
|
|
310
|
+
buildFootnoteRenderItems: _t,
|
|
311
|
+
describeInvalidHighlightMarks: vt,
|
|
312
|
+
emptyTemplatePreviewEntries: ft,
|
|
313
|
+
emptyTemplatePreviewHidden: pt,
|
|
314
|
+
hyphenationReadiness: jt,
|
|
315
|
+
markupView: c(me),
|
|
316
|
+
showCommentHighlights: c(je)
|
|
315
317
|
}, e, t));
|
|
316
318
|
} catch (e) {
|
|
317
319
|
let t = e instanceof Error ? e : Error(String(e));
|
|
@@ -323,46 +325,46 @@ function O(e) {
|
|
|
323
325
|
runLayout: (e, t) => X(e, t),
|
|
324
326
|
...p,
|
|
325
327
|
clock: m
|
|
326
|
-
}), Q = null,
|
|
327
|
-
function
|
|
328
|
+
}), Q = null, Ft = Le();
|
|
329
|
+
function It() {
|
|
328
330
|
Q !== null && (window.clearTimeout(Q), Q = null);
|
|
329
|
-
let e = j.value, t =
|
|
331
|
+
let e = j.value, t = E.value;
|
|
330
332
|
if (!(!e || !t)) try {
|
|
331
333
|
let n = $.api.getCanonicalDocument();
|
|
332
334
|
if (!n && V()) return;
|
|
333
|
-
let r = n ??
|
|
334
|
-
|
|
335
|
+
let r = n ?? Ft.reconcile(Ie(e.state.doc, t, { stylesheetSource: { type: "package" } }), e.state.doc);
|
|
336
|
+
E.value = r, Y(), nt?.(H(r)), W.emit("docChange", H(r));
|
|
335
337
|
} catch (e) {
|
|
336
338
|
x?.(e instanceof Error ? e : Error(String(e)));
|
|
337
339
|
}
|
|
338
340
|
}
|
|
339
|
-
function
|
|
341
|
+
function Lt() {
|
|
340
342
|
Q !== null && window.clearTimeout(Q), Q = window.setTimeout(() => {
|
|
341
|
-
Q = null,
|
|
342
|
-
},
|
|
343
|
+
Q = null, It();
|
|
344
|
+
}, dt);
|
|
343
345
|
}
|
|
344
346
|
let $ = ne({
|
|
345
347
|
getHost: () => t.value,
|
|
346
|
-
getDocument: () =>
|
|
347
|
-
getStyles: () =>
|
|
348
|
+
getDocument: () => E.value,
|
|
349
|
+
getStyles: () => E.value?.package.styles ?? null,
|
|
348
350
|
getExtensionManager: () => U,
|
|
349
|
-
getExternalPlugins:
|
|
351
|
+
getExternalPlugins: At,
|
|
350
352
|
getCollaboration: () => c(b),
|
|
351
353
|
getCollaborationModules: () => N.value,
|
|
352
354
|
getPrecomputedInitialState: () => null,
|
|
353
355
|
getReadOnly: () => c(u),
|
|
354
356
|
getExperimentalSession: () => c(_),
|
|
355
|
-
getEditingMode: () => c(
|
|
356
|
-
getSuggestionAuthor:
|
|
357
|
+
getEditingMode: () => c(y) ?? "editing",
|
|
358
|
+
getSuggestionAuthor: T,
|
|
357
359
|
onSessionRefusal: (e, t, n) => {
|
|
358
360
|
x?.(n ?? new g({
|
|
359
361
|
gap: t,
|
|
360
362
|
message: e
|
|
361
363
|
}));
|
|
362
364
|
},
|
|
363
|
-
getDocumentIdentity: () => String(
|
|
364
|
-
getDocumentContext: () =>
|
|
365
|
-
onTransaction:
|
|
365
|
+
getDocumentIdentity: () => String(D),
|
|
366
|
+
getDocumentContext: () => E.value,
|
|
367
|
+
onTransaction: zt,
|
|
366
368
|
onSelectionChange: (e) => {
|
|
367
369
|
M.value = e, S?.(e), W.emit("selectionChange", {
|
|
368
370
|
from: e.selection.from,
|
|
@@ -370,18 +372,18 @@ function O(e) {
|
|
|
370
372
|
});
|
|
371
373
|
},
|
|
372
374
|
onKeyDown: () => !1,
|
|
373
|
-
onCopy: () =>
|
|
374
|
-
onCut: () =>
|
|
375
|
-
onPaste: () =>
|
|
376
|
-
onReadOnlyEditAttempt: () =>
|
|
377
|
-
onEditorViewReady:
|
|
375
|
+
onCopy: () => it?.(),
|
|
376
|
+
onCut: () => at?.(),
|
|
377
|
+
onPaste: () => C?.(),
|
|
378
|
+
onReadOnlyEditAttempt: () => ot?.(),
|
|
379
|
+
onEditorViewReady: Bt,
|
|
378
380
|
onEditorViewDestroy: () => {
|
|
379
|
-
j.value = null, R.value = !1,
|
|
381
|
+
j.value = null, R.value = !1, rt?.(null);
|
|
380
382
|
},
|
|
381
383
|
onRemoteSelectionsChange: (e) => {
|
|
382
384
|
P.value = e;
|
|
383
385
|
}
|
|
384
|
-
}),
|
|
386
|
+
}), Rt = () => {
|
|
385
387
|
let e = c(b)?.awareness, t = N.value, n = $.getView();
|
|
386
388
|
P.value = e && t && n ? te(n.state, e, t) : [];
|
|
387
389
|
};
|
|
@@ -394,7 +396,7 @@ function O(e) {
|
|
|
394
396
|
n(() => {
|
|
395
397
|
r = !0;
|
|
396
398
|
}), N.value = null, xe().then((e) => {
|
|
397
|
-
r || (N.value = e, $.retryViewCreation(), $.syncExternalDocument(),
|
|
399
|
+
r || (N.value = e, $.retryViewCreation(), $.syncExternalDocument(), Rt());
|
|
398
400
|
}, (e) => {
|
|
399
401
|
r || (N.value = null, x?.(e instanceof Error ? e : Error(String(e))));
|
|
400
402
|
});
|
|
@@ -407,94 +409,94 @@ function O(e) {
|
|
|
407
409
|
P.value = [];
|
|
408
410
|
return;
|
|
409
411
|
}
|
|
410
|
-
e.on("change",
|
|
411
|
-
e.off("change",
|
|
412
|
+
e.on("change", Rt), Rt(), i(() => {
|
|
413
|
+
e.off("change", Rt), P.value = [];
|
|
412
414
|
});
|
|
413
415
|
}, { flush: "post" });
|
|
414
|
-
function
|
|
416
|
+
function zt({ newState: e, docChanged: t, transactions: n }) {
|
|
415
417
|
M.value = e;
|
|
416
418
|
let r = n[0]?.before;
|
|
417
|
-
if (t && r &&
|
|
419
|
+
if (t && r && Ft.noteBase(r), t) {
|
|
418
420
|
let e = $.api.getCanonicalDocument();
|
|
419
|
-
e && (
|
|
421
|
+
e && (E.value = e, Y()), B.value = !0, G.incrementStateSeq(), Z.schedule(), Lt();
|
|
420
422
|
}
|
|
421
423
|
G.requestRender();
|
|
422
424
|
}
|
|
423
|
-
function
|
|
425
|
+
function Bt(e) {
|
|
424
426
|
j.value = e, M.value = e.state, R.value = !0;
|
|
425
|
-
let t =
|
|
427
|
+
let t = E.value, n = D, r = ++k;
|
|
426
428
|
A = !0;
|
|
427
429
|
let i = () => {
|
|
428
|
-
k === r && (A = !1, !(
|
|
430
|
+
k === r && (A = !1, !(O || D !== n || $.getView() !== e) && (X(e.state, { reason: "initial" }), G.requestRender()));
|
|
429
431
|
};
|
|
430
|
-
De(t, e.state.doc).then(i, i),
|
|
432
|
+
De(t, e.state.doc).then(i, i), Ut(e), rt?.(e), c(u) || requestAnimationFrame(() => {
|
|
431
433
|
j.value === e && e.focus();
|
|
432
434
|
});
|
|
433
435
|
}
|
|
434
|
-
let
|
|
435
|
-
getDocx: async (e) => (await
|
|
436
|
-
loadDocument:
|
|
437
|
-
loadDocx:
|
|
438
|
-
},
|
|
436
|
+
let Vt = {
|
|
437
|
+
getDocx: async (e) => (await Xt(e))?.buffer ?? null,
|
|
438
|
+
loadDocument: Yt,
|
|
439
|
+
loadDocx: Jt
|
|
440
|
+
}, Ht = ge({
|
|
439
441
|
getEditorApi: () => $.api,
|
|
440
442
|
getLayout: () => L.value,
|
|
441
443
|
runLayout: (e, t) => X(e, t),
|
|
442
|
-
getDocumentIO: () =>
|
|
444
|
+
getDocumentIO: () => Vt,
|
|
443
445
|
emitter: W
|
|
444
446
|
});
|
|
445
|
-
function
|
|
446
|
-
pe(c(
|
|
447
|
+
function Ut(e) {
|
|
448
|
+
pe(c(y) === "suggesting", e.state, e.dispatch, T());
|
|
447
449
|
}
|
|
448
|
-
l([() => c(
|
|
449
|
-
|
|
450
|
+
l([() => c(y), T], () => {
|
|
451
|
+
Ht.setCanonicalMode(c(y) === "suggesting" ? {
|
|
450
452
|
type: "suggesting",
|
|
451
|
-
author:
|
|
453
|
+
author: T()
|
|
452
454
|
} : { type: "editing" });
|
|
453
455
|
let e = j.value;
|
|
454
|
-
e &&
|
|
456
|
+
e && Ut(e);
|
|
455
457
|
for (let e of J.listStories()) {
|
|
456
458
|
let t = J.getView(e);
|
|
457
|
-
t &&
|
|
459
|
+
t && Ut(t);
|
|
458
460
|
}
|
|
459
461
|
}), l(() => c(u), (e) => {
|
|
460
|
-
$.syncEditable(), e &&
|
|
462
|
+
$.syncEditable(), e && rn(), q.sync();
|
|
461
463
|
});
|
|
462
|
-
function
|
|
463
|
-
let t =
|
|
464
|
-
if (t === e.state.plugins.includes(
|
|
465
|
-
let n = e.state.plugins.filter((e) => e !==
|
|
464
|
+
function Wt(e) {
|
|
465
|
+
let t = kt();
|
|
466
|
+
if (t === e.state.plugins.includes(Et)) return;
|
|
467
|
+
let n = e.state.plugins.filter((e) => e !== Et && e !== Dt);
|
|
466
468
|
if (t) {
|
|
467
|
-
let e = n.indexOf(
|
|
468
|
-
n.splice(t, 0,
|
|
469
|
+
let e = n.indexOf(Ot), t = e === -1 ? n.length : e;
|
|
470
|
+
n.splice(t, 0, Et, Dt);
|
|
469
471
|
}
|
|
470
472
|
e.updateState(e.state.reconfigure({ plugins: n }));
|
|
471
473
|
}
|
|
472
|
-
l(() =>
|
|
474
|
+
l(() => kt(), () => {
|
|
473
475
|
let e = j.value;
|
|
474
|
-
e &&
|
|
476
|
+
e && Wt(e);
|
|
475
477
|
});
|
|
476
|
-
function Wt() {
|
|
477
|
-
$.ensureView();
|
|
478
|
-
}
|
|
479
478
|
function Gt() {
|
|
480
|
-
|
|
479
|
+
$.ensureView();
|
|
481
480
|
}
|
|
482
481
|
function Kt() {
|
|
483
|
-
|
|
482
|
+
D += 1, B.value = !1, F.value = null, I.value = null, J.activate(null), Z.dispose(), $.destroyView(), V() && $.ensureView(), Y(), $.ensureView(), $.getView() || qt();
|
|
483
|
+
}
|
|
484
|
+
function qt() {
|
|
485
|
+
let e = E.value;
|
|
484
486
|
if (!(!e || c(b))) try {
|
|
485
487
|
let t = re({
|
|
486
488
|
document: e,
|
|
487
489
|
styles: e.package.styles ?? null,
|
|
488
490
|
manager: U,
|
|
489
|
-
externalPlugins:
|
|
491
|
+
externalPlugins: At(),
|
|
490
492
|
collaborationModules: null,
|
|
491
493
|
reason: "mount"
|
|
492
494
|
});
|
|
493
495
|
M.value = t;
|
|
494
|
-
let n =
|
|
496
|
+
let n = D, r = ++k;
|
|
495
497
|
A = !0;
|
|
496
498
|
let i = () => {
|
|
497
|
-
k === r && (A = !1, !(
|
|
499
|
+
k === r && (A = !1, !(O || D !== n || E.value !== e || $.getView()) && X(t, { reason: "initial" }));
|
|
498
500
|
};
|
|
499
501
|
De(e, t.doc).then(i, i);
|
|
500
502
|
} catch (e) {
|
|
@@ -504,12 +506,12 @@ function O(e) {
|
|
|
504
506
|
l([
|
|
505
507
|
t,
|
|
506
508
|
a,
|
|
507
|
-
|
|
509
|
+
ct,
|
|
508
510
|
...r ? [r] : []
|
|
509
511
|
], () => {
|
|
510
|
-
t.value &&
|
|
512
|
+
t.value && E.value && !$.getView() && Gt(), Y();
|
|
511
513
|
}, { flush: "post" });
|
|
512
|
-
async function
|
|
514
|
+
async function Jt(e) {
|
|
513
515
|
z.value = null, R.value = !1;
|
|
514
516
|
try {
|
|
515
517
|
let t = e;
|
|
@@ -519,17 +521,17 @@ function O(e) {
|
|
|
519
521
|
t = n.value;
|
|
520
522
|
}
|
|
521
523
|
let n = await Ae(t, { password: c(Je) });
|
|
522
|
-
|
|
524
|
+
E.value = n, Kt();
|
|
523
525
|
} catch (e) {
|
|
524
526
|
let t = e instanceof Error ? e : Error(String(e));
|
|
525
527
|
z.value = t.message, x?.(t);
|
|
526
528
|
}
|
|
527
529
|
}
|
|
528
|
-
function
|
|
529
|
-
z.value = null,
|
|
530
|
+
function Yt(e) {
|
|
531
|
+
z.value = null, E.value = e, Ft.reset(), Kt();
|
|
530
532
|
}
|
|
531
|
-
async function
|
|
532
|
-
let t = j.value, n =
|
|
533
|
+
async function Xt(e) {
|
|
534
|
+
let t = j.value, n = E.value;
|
|
533
535
|
if (!t || !n) return null;
|
|
534
536
|
try {
|
|
535
537
|
let t = $.api.captureCanonicalSave();
|
|
@@ -537,21 +539,21 @@ function O(e) {
|
|
|
537
539
|
let n = await be({
|
|
538
540
|
snapshot: t,
|
|
539
541
|
options: e,
|
|
540
|
-
featureFlags: c(
|
|
542
|
+
featureFlags: c(st)
|
|
541
543
|
});
|
|
542
544
|
for (let t of n.diagnostics) e?.onDiagnostic || x?.(new ye({
|
|
543
545
|
gap: d.save,
|
|
544
546
|
diagnostic: t,
|
|
545
547
|
message: `Canonical save used a fidelity fallback: ${t.type} (${t.part}).`
|
|
546
548
|
}));
|
|
547
|
-
return n.tripwireResult &&
|
|
549
|
+
return n.tripwireResult && w?.(n.tripwireResult), n;
|
|
548
550
|
}
|
|
549
551
|
} catch (e) {
|
|
550
552
|
return x?.(e instanceof Error ? e : Error(String(e))), null;
|
|
551
553
|
}
|
|
552
554
|
if (V()) return null;
|
|
553
|
-
Q !== null &&
|
|
554
|
-
let r = J.snapshotDocument(q.snapshotDocument(n)), i = t.state, a = Re(Ie(i.doc, r, { stylesheetSource: { type: "package" } })), { resolveSelectiveSaveFlags: o } = await import("@stll/folio-core/docx/selectiveSaveFlags"), s = o(c(
|
|
555
|
+
Q !== null && It();
|
|
556
|
+
let r = J.snapshotDocument(q.snapshotDocument(n)), i = t.state, a = Re(Ie(i.doc, r, { stylesheetSource: { type: "package" } })), { resolveSelectiveSaveFlags: o } = await import("@stll/folio-core/docx/selectiveSaveFlags"), s = o(c(st)), l = a.originalBuffer ?? null, u = s.selectiveSave && e?.mode !== he.full, f = u || s.selectiveSaveTripwire, { repackDocx: ee, createDocx: p } = await import("@stll/folio-core/docx/rezip"), m = null;
|
|
555
557
|
if (f && l) {
|
|
556
558
|
let { attemptSelectiveSave: e } = await import("@stll/folio-core/docx/selectiveSave");
|
|
557
559
|
m = await e(a, l, {
|
|
@@ -570,67 +572,68 @@ function O(e) {
|
|
|
570
572
|
else if (s.selectiveSaveTripwire) try {
|
|
571
573
|
g = await te();
|
|
572
574
|
} catch {}
|
|
573
|
-
if (s.selectiveSaveTripwire && g &&
|
|
575
|
+
if (s.selectiveSaveTripwire && g && w) try {
|
|
574
576
|
let { compareSelectiveVsFull: e } = await import("@stll/folio-core/docx/selectiveSaveTripwire");
|
|
575
|
-
|
|
577
|
+
w(await e(m, g));
|
|
576
578
|
} catch {}
|
|
577
579
|
return {
|
|
578
580
|
buffer: h,
|
|
579
581
|
document: a
|
|
580
582
|
};
|
|
581
583
|
}
|
|
582
|
-
async function
|
|
583
|
-
let t = j.value, n = t?.state, r = await
|
|
584
|
-
return r ? (j.value === t && t?.state.doc === n?.doc && (r.version === void 0 || $.api.isCanonicalSaveCurrent(r.version)) && (
|
|
584
|
+
async function Zt(e) {
|
|
585
|
+
let t = j.value, n = t?.state, r = await Xt({ mode: e?.selective === !1 ? he.full : he.preferSelective });
|
|
586
|
+
return r ? (j.value === t && t?.state.doc === n?.doc && (r.version === void 0 || $.api.isCanonicalSaveCurrent(r.version)) && (E.value = r.document, Y(), B.value = !1), new Blob([r.buffer], { type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" })) : null;
|
|
585
587
|
}
|
|
586
|
-
function
|
|
588
|
+
function Qt() {
|
|
587
589
|
let e = $.api.getCanonicalDocument();
|
|
588
590
|
if (e) return e;
|
|
589
591
|
if (V()) return null;
|
|
590
|
-
let t =
|
|
592
|
+
let t = E.value;
|
|
591
593
|
return t ? H(J.snapshotDocument(q.snapshotDocument(t))) : null;
|
|
592
594
|
}
|
|
593
|
-
function Qt(e) {
|
|
594
|
-
bt(d.modelEdits, "Direct document model changes are unavailable in this session.") || (D.value = e, Y(), I.value && !J.getView(I.value) && (I.value = null));
|
|
595
|
-
}
|
|
596
595
|
function $t(e) {
|
|
596
|
+
xt(d.modelEdits, "Direct document model changes are unavailable in this session.") || (E.value = e, Y(), I.value && !J.getView(I.value) && (I.value = null));
|
|
597
|
+
}
|
|
598
|
+
function en(e) {
|
|
597
599
|
return q.getView(e);
|
|
598
600
|
}
|
|
599
|
-
function
|
|
601
|
+
function tn() {
|
|
600
602
|
Y();
|
|
601
603
|
}
|
|
602
|
-
function
|
|
604
|
+
function nn(e) {
|
|
603
605
|
let t = J.activate(e);
|
|
604
|
-
t && (
|
|
606
|
+
t && (Ut(t), I.value = e, requestAnimationFrame(() => t.focus()));
|
|
605
607
|
}
|
|
606
|
-
function
|
|
608
|
+
function rn() {
|
|
607
609
|
J.activate(null), I.value = null;
|
|
608
610
|
}
|
|
609
|
-
function
|
|
611
|
+
function an() {
|
|
610
612
|
let e = I.value;
|
|
611
613
|
return e ? J.getView(e) : null;
|
|
612
614
|
}
|
|
613
|
-
function
|
|
615
|
+
function on() {
|
|
614
616
|
return U.getCommands();
|
|
615
617
|
}
|
|
616
|
-
function
|
|
617
|
-
let e =
|
|
618
|
+
function sn() {
|
|
619
|
+
let e = an();
|
|
618
620
|
e ? e.focus() : j.value?.focus();
|
|
619
621
|
}
|
|
620
|
-
function
|
|
622
|
+
function cn() {
|
|
621
623
|
let e = j.value;
|
|
622
624
|
e && X(e.state, { reason: "manual" });
|
|
623
625
|
}
|
|
624
626
|
l([
|
|
625
|
-
() => c(je),
|
|
626
627
|
() => c(Me),
|
|
628
|
+
() => c(v),
|
|
627
629
|
() => c(ce),
|
|
628
|
-
() => c(me)
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
630
|
+
() => c(me),
|
|
631
|
+
() => c(je)
|
|
632
|
+
], () => cn());
|
|
633
|
+
function ln() {
|
|
634
|
+
O = !0, k += 1, A = !1, Z.dispose(), Q !== null && (window.clearTimeout(Q), Q = null), $.destroyView(), P.value = [], q.destroy(), J.destroy(), U.destroy(), M.value = null, L.value = null, E.value = null, R.value = !1;
|
|
632
635
|
}
|
|
633
|
-
return i(
|
|
636
|
+
return i(ln), {
|
|
634
637
|
setEmbeddedFontFamilies: (e) => {
|
|
635
638
|
if (e) {
|
|
636
639
|
K.embeddedFontFamilyMap = new Map(e);
|
|
@@ -638,7 +641,7 @@ function O(e) {
|
|
|
638
641
|
}
|
|
639
642
|
delete K.embeddedFontFamilyMap;
|
|
640
643
|
},
|
|
641
|
-
editor:
|
|
644
|
+
editor: Ht,
|
|
642
645
|
editorView: j,
|
|
643
646
|
editorState: M,
|
|
644
647
|
remoteSelections: P,
|
|
@@ -648,26 +651,26 @@ function O(e) {
|
|
|
648
651
|
isDirty: B,
|
|
649
652
|
parseError: z,
|
|
650
653
|
layout: L,
|
|
651
|
-
blocks:
|
|
652
|
-
measures:
|
|
654
|
+
blocks: yt,
|
|
655
|
+
measures: bt,
|
|
653
656
|
syncCoordinator: G,
|
|
654
|
-
loadBuffer:
|
|
655
|
-
loadDocument:
|
|
656
|
-
save:
|
|
657
|
-
getDocument:
|
|
658
|
-
setDocument:
|
|
659
|
-
getHeaderFooterView:
|
|
660
|
-
syncHeaderFooterViews:
|
|
661
|
-
openNoteStory:
|
|
662
|
-
closeNoteStory:
|
|
663
|
-
getActiveNoteView:
|
|
664
|
-
getCommands:
|
|
665
|
-
focus:
|
|
666
|
-
reLayout:
|
|
667
|
-
destroy:
|
|
657
|
+
loadBuffer: Jt,
|
|
658
|
+
loadDocument: Yt,
|
|
659
|
+
save: Zt,
|
|
660
|
+
getDocument: Qt,
|
|
661
|
+
setDocument: $t,
|
|
662
|
+
getHeaderFooterView: en,
|
|
663
|
+
syncHeaderFooterViews: tn,
|
|
664
|
+
openNoteStory: nn,
|
|
665
|
+
closeNoteStory: rn,
|
|
666
|
+
getActiveNoteView: an,
|
|
667
|
+
getCommands: on,
|
|
668
|
+
focus: sn,
|
|
669
|
+
reLayout: cn,
|
|
670
|
+
destroy: ln
|
|
668
671
|
};
|
|
669
672
|
}
|
|
670
|
-
function
|
|
673
|
+
function D(e, t) {
|
|
671
674
|
if (t < e.top + 40) {
|
|
672
675
|
let n = Math.max(0, e.top + 40 - t);
|
|
673
676
|
return -Math.min(12, n / 40 * 12);
|
|
@@ -680,7 +683,7 @@ function _t(e, t) {
|
|
|
680
683
|
}
|
|
681
684
|
//#endregion
|
|
682
685
|
//#region src/composables/useDragAutoScroll.ts
|
|
683
|
-
function
|
|
686
|
+
function O({ pagesContainer: e, onScrollExtendSelection: t }) {
|
|
684
687
|
let n = null, r = 0, a = 0, o = !1;
|
|
685
688
|
function s() {
|
|
686
689
|
return se(e.value);
|
|
@@ -692,7 +695,7 @@ function k({ pagesContainer: e, onScrollExtendSelection: t }) {
|
|
|
692
695
|
if (!o) return;
|
|
693
696
|
let e = s();
|
|
694
697
|
if (!e) return;
|
|
695
|
-
let i =
|
|
698
|
+
let i = D(e.getBoundingClientRect(), a);
|
|
696
699
|
i !== 0 && (ce(e, i), t(r, a)), n = requestAnimationFrame(l);
|
|
697
700
|
}
|
|
698
701
|
function u() {
|
|
@@ -713,7 +716,7 @@ function k({ pagesContainer: e, onScrollExtendSelection: t }) {
|
|
|
713
716
|
}
|
|
714
717
|
//#endregion
|
|
715
718
|
//#region src/composables/useTableResize.ts
|
|
716
|
-
function
|
|
719
|
+
function k() {
|
|
717
720
|
let e = {
|
|
718
721
|
active: !1,
|
|
719
722
|
startX: 0,
|
|
@@ -745,7 +748,7 @@ function A() {
|
|
|
745
748
|
}
|
|
746
749
|
function a(i, a) {
|
|
747
750
|
let o = i.target;
|
|
748
|
-
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),
|
|
751
|
+
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), A(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), j(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), M(a, n), !0) : !1 : !1;
|
|
749
752
|
}
|
|
750
753
|
function o(r) {
|
|
751
754
|
if (e.active && e.handle) {
|
|
@@ -753,7 +756,7 @@ function A() {
|
|
|
753
756
|
let t = r.clientX - e.startX, n = parseFloat(e.handle.style.left);
|
|
754
757
|
e.handle.style.left = `${n + t}px`, e.startX = r.clientX;
|
|
755
758
|
let i = Math.round(t * y), a = e.origWidths.left + i, o = e.origWidths.right - i;
|
|
756
|
-
a >=
|
|
759
|
+
a >= v && o >= v && (e.origWidths = {
|
|
757
760
|
left: a,
|
|
758
761
|
right: o
|
|
759
762
|
});
|
|
@@ -764,7 +767,7 @@ function A() {
|
|
|
764
767
|
let e = r.clientY - t.startY, n = parseFloat(t.handle.style.top);
|
|
765
768
|
t.handle.style.top = `${n + e}px`, t.startY = r.clientY;
|
|
766
769
|
let i = Math.round(e * y), a = t.origHeight + i;
|
|
767
|
-
a >=
|
|
770
|
+
a >= Je && (t.origHeight = a);
|
|
768
771
|
return;
|
|
769
772
|
}
|
|
770
773
|
if (n.active && n.handle) {
|
|
@@ -772,7 +775,7 @@ function A() {
|
|
|
772
775
|
let e = r.clientX - n.startX, t = parseFloat(n.handle.style.left);
|
|
773
776
|
n.handle.style.left = `${t + e}px`, n.startX = r.clientX;
|
|
774
777
|
let i = Math.round(e * y), a = n.origWidth + i;
|
|
775
|
-
a >=
|
|
778
|
+
a >= v && (n.origWidth = a);
|
|
776
779
|
}
|
|
777
780
|
}
|
|
778
781
|
function s(i) {
|
|
@@ -786,7 +789,7 @@ function A() {
|
|
|
786
789
|
return;
|
|
787
790
|
}
|
|
788
791
|
if (t.active) {
|
|
789
|
-
t.active = !1, t.handle?.classList.remove("dragging"), r &&
|
|
792
|
+
t.active = !1, t.handle?.classList.remove("dragging"), r && Ze(r, {
|
|
790
793
|
pmStart: t.tablePmStart,
|
|
791
794
|
rowIdx: t.rowIndex,
|
|
792
795
|
newHeight: t.origHeight
|
|
@@ -810,11 +813,11 @@ function A() {
|
|
|
810
813
|
isResizing: i
|
|
811
814
|
};
|
|
812
815
|
}
|
|
813
|
-
function
|
|
816
|
+
function A(e, t) {
|
|
814
817
|
let n = Qe(e, t.tablePmStart, t.columnIndex);
|
|
815
818
|
n && (t.origWidths = n);
|
|
816
819
|
}
|
|
817
|
-
function
|
|
820
|
+
function j(e, t, n) {
|
|
818
821
|
let r = $e(e, t.tablePmStart, t.rowIndex);
|
|
819
822
|
if (r != null) {
|
|
820
823
|
t.origHeight = r;
|
|
@@ -823,18 +826,18 @@ function M(e, t, n) {
|
|
|
823
826
|
let i = n.closest(".layout-table")?.querySelector(`[data-row-index="${t.rowIndex}"]`), a = i ? i.getBoundingClientRect().height : 30;
|
|
824
827
|
t.origHeight = Math.round(a * y);
|
|
825
828
|
}
|
|
826
|
-
function
|
|
827
|
-
let n =
|
|
829
|
+
function M(e, t) {
|
|
830
|
+
let n = b(e, t.tablePmStart, t.columnIndex);
|
|
828
831
|
n != null && (t.origWidth = n);
|
|
829
832
|
}
|
|
830
833
|
//#endregion
|
|
831
834
|
//#region src/composables/useTrackedChanges.ts
|
|
832
|
-
function
|
|
835
|
+
function N(t, n) {
|
|
833
836
|
return e(() => (n.value, et(t.value?.state ?? null)));
|
|
834
837
|
}
|
|
835
838
|
//#endregion
|
|
836
839
|
//#region src/composables/useZoom.ts
|
|
837
|
-
var
|
|
840
|
+
var P = nt, F = tt, I = [
|
|
838
841
|
.5,
|
|
839
842
|
.75,
|
|
840
843
|
1,
|
|
@@ -842,16 +845,16 @@ var F = x, I = tt, L = [
|
|
|
842
845
|
1.5,
|
|
843
846
|
2
|
|
844
847
|
];
|
|
845
|
-
function
|
|
846
|
-
let i = o(Math.max(
|
|
848
|
+
function L(t = 1) {
|
|
849
|
+
let i = o(Math.max(P, Math.min(F, t))), a = e(() => Math.round(i.value * 100)), s = e(() => i.value <= P), c = e(() => i.value >= F);
|
|
847
850
|
function l(e) {
|
|
848
|
-
i.value = Math.max(
|
|
851
|
+
i.value = Math.max(P, Math.min(F, Math.round(e * 100) / 100));
|
|
849
852
|
}
|
|
850
853
|
function u() {
|
|
851
|
-
l(i.value +
|
|
854
|
+
l(i.value + x);
|
|
852
855
|
}
|
|
853
856
|
function d() {
|
|
854
|
-
l(i.value -
|
|
857
|
+
l(i.value - x);
|
|
855
858
|
}
|
|
856
859
|
function f() {
|
|
857
860
|
l(1);
|
|
@@ -877,8 +880,8 @@ function vt(t = 1) {
|
|
|
877
880
|
handleWheel: ee,
|
|
878
881
|
handleKeyDown: p,
|
|
879
882
|
installShortcuts: m,
|
|
880
|
-
ZOOM_PRESETS:
|
|
883
|
+
ZOOM_PRESETS: I
|
|
881
884
|
};
|
|
882
885
|
}
|
|
883
886
|
//#endregion
|
|
884
|
-
export {
|
|
887
|
+
export { O as a, C as c, k as i, st as l, et as n, E as o, N as r, w as s, L as t, ct as u };
|