@stll/folio-vue 0.23.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/README.md +24 -0
- 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 +11 -4
- 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 +3 -0
- package/dist/composables/useDocxEditorRefApi.d.ts +3 -0
- package/dist/composables/useFindReplace.d.ts +5 -1
- package/dist/composables/useFontLifecycle.d.ts +1 -0
- 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 -156
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1456 -1409
- 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-D8Wi1XkB.js → useZoom-Bw5gp69V.js} +262 -252
- package/dist/utils/embeddedFonts.d.ts +1 -1
- package/package.json +22 -10
- 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-CkbPWZ64.cjs +0 -1
|
@@ -34,45 +34,45 @@ 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 v, MIN_ROW_HEIGHT_TWIPS as
|
|
38
|
-
import { extractTrackedChanges as
|
|
39
|
-
import { ZOOM_MAX 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
|
+
import { extractTrackedChanges as et } from "@stll/folio-core/prosemirror/utils/extractTrackedChanges";
|
|
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
|
|
42
|
-
function
|
|
41
|
+
var S = "(prefers-color-scheme: dark)";
|
|
42
|
+
function rt() {
|
|
43
43
|
return typeof window < "u" && typeof window.matchMedia == "function";
|
|
44
44
|
}
|
|
45
|
-
function
|
|
45
|
+
function it(e, t) {
|
|
46
46
|
return e === "dark" || e === "system" && t;
|
|
47
47
|
}
|
|
48
|
-
function
|
|
49
|
-
if (!
|
|
50
|
-
let t = window.matchMedia(
|
|
48
|
+
function at(e) {
|
|
49
|
+
if (!rt()) return () => {};
|
|
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
|
|
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) => {
|
|
67
|
-
!i.value || n.value !== "system" || e(
|
|
67
|
+
!i.value || n.value !== "system" || e(at((e) => {
|
|
68
68
|
a.value = e;
|
|
69
69
|
}));
|
|
70
|
-
}), e(() =>
|
|
70
|
+
}), e(() => it(n.value, i.value && a.value));
|
|
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,112 +144,113 @@ 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
|
-
return
|
|
164
|
-
}, U = new ze(We({ historyShortcuts:
|
|
163
|
+
return x?.(n), !0;
|
|
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
|
-
...Je,
|
|
175
|
-
...c(x)?.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(),
|
|
181
|
+
let W = _e(), G = new Fe(), K = ke(), jt = Te({
|
|
182
182
|
relayout: () => {
|
|
183
|
-
let e = j.value?.state ??
|
|
184
|
-
e &&
|
|
183
|
+
let e = j.value?.state ?? K.lastEditorState;
|
|
184
|
+
e && X(e, { reason: "hyphenation-ready" });
|
|
185
185
|
},
|
|
186
|
-
onError: (e) =>
|
|
186
|
+
onError: (e) => x?.(e)
|
|
187
187
|
});
|
|
188
188
|
i(jt.cancel), i(Oe({
|
|
189
|
-
measuredFontSet: () =>
|
|
189
|
+
measuredFontSet: () => K.lastMeasureInputs?.fontSet ?? null,
|
|
190
190
|
relayout: () => {
|
|
191
191
|
if (A) return;
|
|
192
|
-
let e = j.value?.state ??
|
|
193
|
-
e &&
|
|
192
|
+
let e = j.value?.state ?? K.lastEditorState;
|
|
193
|
+
e && X(e, { reason: "font-ready" });
|
|
194
194
|
}
|
|
195
195
|
}));
|
|
196
196
|
let Mt = new Pe({
|
|
197
197
|
pageGap: se,
|
|
198
198
|
showShadow: !0
|
|
199
|
-
}),
|
|
200
|
-
getHost: () =>
|
|
201
|
-
|
|
202
|
-
|
|
199
|
+
}), q = Se({
|
|
200
|
+
getHost: () => ct.value,
|
|
201
|
+
getReadOnly: () => c(u),
|
|
202
|
+
getDocument: () => $.api.getCanonicalDocument() ?? E.value,
|
|
203
|
+
getCanonicalApi: () => $.api,
|
|
203
204
|
getExperimentalSession: () => c(_),
|
|
204
205
|
onSessionRefusal: (e, t, n) => {
|
|
205
|
-
z.value = e,
|
|
206
|
+
z.value = e, x?.(n ?? new g({
|
|
206
207
|
gap: t,
|
|
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
|
-
if (r && (B.value = !0,
|
|
214
|
+
if (r && (B.value = !0, Z.schedule()), r || i) {
|
|
214
215
|
let { from: r, to: i } = n.state.selection;
|
|
215
216
|
F.value = {
|
|
216
217
|
from: r,
|
|
217
218
|
kind: t,
|
|
218
219
|
rId: e,
|
|
219
220
|
to: i
|
|
220
|
-
},
|
|
221
|
+
}, S?.(n.state), W.emit("selectionChange", {
|
|
221
222
|
from: r,
|
|
222
223
|
to: i
|
|
223
224
|
});
|
|
224
225
|
}
|
|
225
226
|
G.requestRender();
|
|
226
227
|
}
|
|
227
|
-
}), Nt = { current: null },
|
|
228
|
+
}), Nt = { current: null }, J = Ce({
|
|
228
229
|
getHost: () => r?.value ?? null,
|
|
229
|
-
getPlugins: () =>
|
|
230
|
-
getDocument: () =>
|
|
231
|
-
getCanonicalApi: () =>
|
|
230
|
+
getPlugins: () => Ct,
|
|
231
|
+
getDocument: () => $.api.getCanonicalDocument() ?? E.value,
|
|
232
|
+
getCanonicalApi: () => $.api,
|
|
232
233
|
getExperimentalSession: () => c(_),
|
|
233
234
|
onSessionRefusal: (e, t, n) => {
|
|
234
|
-
z.value = e,
|
|
235
|
+
z.value = e, x?.(n ?? new g({
|
|
235
236
|
gap: t,
|
|
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 =
|
|
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
|
}
|
|
251
252
|
if (e || t) {
|
|
252
|
-
|
|
253
|
+
S?.(n.state);
|
|
253
254
|
let { from: e, to: t } = n.state.selection;
|
|
254
255
|
W.emit("selectionChange", {
|
|
255
256
|
from: e,
|
|
@@ -258,17 +259,17 @@ function O(e) {
|
|
|
258
259
|
}
|
|
259
260
|
}
|
|
260
261
|
});
|
|
261
|
-
Nt.current =
|
|
262
|
-
let
|
|
263
|
-
|
|
262
|
+
Nt.current = J;
|
|
263
|
+
let Y = () => {
|
|
264
|
+
q.sync(), J.sync();
|
|
264
265
|
};
|
|
265
|
-
l(() => c(_),
|
|
266
|
+
l(() => c(_), Y);
|
|
266
267
|
function Pt(e) {
|
|
267
|
-
e.layout && (L.value = e.layout), e.blocks && (
|
|
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
|
-
function
|
|
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,
|
|
@@ -276,8 +277,8 @@ function O(e) {
|
|
|
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 };
|
|
@@ -299,107 +300,108 @@ function O(e) {
|
|
|
299
300
|
mirrorMargins: h,
|
|
300
301
|
styles: ee,
|
|
301
302
|
layout: L.value,
|
|
302
|
-
hfPMs:
|
|
303
|
+
hfPMs: q,
|
|
303
304
|
painter: Mt,
|
|
304
305
|
pagesContainer: r,
|
|
305
|
-
session:
|
|
306
|
-
renderHfFromContentOrPm:
|
|
307
|
-
renderHeaderFooterContentByRId:
|
|
306
|
+
session: K,
|
|
307
|
+
renderHfFromContentOrPm: ht,
|
|
308
|
+
renderHeaderFooterContentByRId: gt,
|
|
308
309
|
readFontSetSignature: Ee,
|
|
309
|
-
buildFootnoteRenderItems:
|
|
310
|
-
describeInvalidHighlightMarks:
|
|
311
|
-
emptyTemplatePreviewEntries:
|
|
312
|
-
emptyTemplatePreviewHidden:
|
|
310
|
+
buildFootnoteRenderItems: _t,
|
|
311
|
+
describeInvalidHighlightMarks: vt,
|
|
312
|
+
emptyTemplatePreviewEntries: ft,
|
|
313
|
+
emptyTemplatePreviewHidden: pt,
|
|
313
314
|
hyphenationReadiness: jt,
|
|
314
|
-
markupView: c(me)
|
|
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));
|
|
318
|
-
|
|
320
|
+
x?.(t);
|
|
319
321
|
}
|
|
320
322
|
}
|
|
321
|
-
let
|
|
323
|
+
let Z = h({
|
|
322
324
|
readState: () => j.value?.state ?? null,
|
|
323
|
-
runLayout: (e, t) =>
|
|
325
|
+
runLayout: (e, t) => X(e, t),
|
|
324
326
|
...p,
|
|
325
327
|
clock: m
|
|
326
|
-
}),
|
|
328
|
+
}), Q = null, Ft = Le();
|
|
327
329
|
function It() {
|
|
328
|
-
|
|
329
|
-
let e = j.value, t =
|
|
330
|
+
Q !== null && (window.clearTimeout(Q), Q = null);
|
|
331
|
+
let e = j.value, t = E.value;
|
|
330
332
|
if (!(!e || !t)) try {
|
|
331
|
-
let n =
|
|
333
|
+
let n = $.api.getCanonicalDocument();
|
|
332
334
|
if (!n && V()) return;
|
|
333
335
|
let r = n ?? Ft.reconcile(Ie(e.state.doc, t, { stylesheetSource: { type: "package" } }), e.state.doc);
|
|
334
|
-
|
|
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
341
|
function Lt() {
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
},
|
|
342
|
+
Q !== null && window.clearTimeout(Q), Q = window.setTimeout(() => {
|
|
343
|
+
Q = null, It();
|
|
344
|
+
}, dt);
|
|
343
345
|
}
|
|
344
|
-
let
|
|
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:
|
|
350
|
-
getCollaboration: () => c(
|
|
351
|
+
getExternalPlugins: At,
|
|
352
|
+
getCollaboration: () => c(b),
|
|
351
353
|
getCollaborationModules: () => N.value,
|
|
352
354
|
getPrecomputedInitialState: () => null,
|
|
353
355
|
getReadOnly: () => c(u),
|
|
354
356
|
getExperimentalSession: () => c(_),
|
|
355
357
|
getEditingMode: () => c(y) ?? "editing",
|
|
356
|
-
getSuggestionAuthor:
|
|
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
|
+
getDocumentIdentity: () => String(D),
|
|
366
|
+
getDocumentContext: () => E.value,
|
|
365
367
|
onTransaction: zt,
|
|
366
368
|
onSelectionChange: (e) => {
|
|
367
|
-
M.value = e,
|
|
369
|
+
M.value = e, S?.(e), W.emit("selectionChange", {
|
|
368
370
|
from: e.selection.from,
|
|
369
371
|
to: e.selection.to
|
|
370
372
|
});
|
|
371
373
|
},
|
|
372
374
|
onKeyDown: () => !1,
|
|
373
|
-
onCopy: () =>
|
|
374
|
-
onCut: () =>
|
|
375
|
-
onPaste: () =>
|
|
376
|
-
onReadOnlyEditAttempt: () =>
|
|
375
|
+
onCopy: () => it?.(),
|
|
376
|
+
onCut: () => at?.(),
|
|
377
|
+
onPaste: () => C?.(),
|
|
378
|
+
onReadOnlyEditAttempt: () => ot?.(),
|
|
377
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
|
-
let e = c(
|
|
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
|
};
|
|
388
|
-
l(() => c(
|
|
390
|
+
l(() => c(b), (e, t, n) => {
|
|
389
391
|
if (P.value = [], !e) {
|
|
390
|
-
N.value = null,
|
|
392
|
+
N.value = null, $.retryViewCreation(), $.syncExternalDocument();
|
|
391
393
|
return;
|
|
392
394
|
}
|
|
393
395
|
let r = !1;
|
|
394
396
|
n(() => {
|
|
395
397
|
r = !0;
|
|
396
398
|
}), N.value = null, xe().then((e) => {
|
|
397
|
-
r || (N.value = e,
|
|
399
|
+
r || (N.value = e, $.retryViewCreation(), $.syncExternalDocument(), Rt());
|
|
398
400
|
}, (e) => {
|
|
399
|
-
r || (N.value = null,
|
|
401
|
+
r || (N.value = null, x?.(e instanceof Error ? e : Error(String(e))));
|
|
400
402
|
});
|
|
401
403
|
}, { immediate: !0 }), l(() => ({
|
|
402
|
-
awareness: c(
|
|
404
|
+
awareness: c(b)?.awareness,
|
|
403
405
|
modules: N.value,
|
|
404
406
|
view: j.value
|
|
405
407
|
}), ({ awareness: e, modules: t, view: n }, r, i) => {
|
|
@@ -415,101 +417,101 @@ function O(e) {
|
|
|
415
417
|
M.value = e;
|
|
416
418
|
let r = n[0]?.before;
|
|
417
419
|
if (t && r && Ft.noteBase(r), t) {
|
|
418
|
-
let e =
|
|
419
|
-
e && (
|
|
420
|
+
let e = $.api.getCanonicalDocument();
|
|
421
|
+
e && (E.value = e, Y()), B.value = !0, G.incrementStateSeq(), Z.schedule(), Lt();
|
|
420
422
|
}
|
|
421
423
|
G.requestRender();
|
|
422
424
|
}
|
|
423
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
436
|
let Vt = {
|
|
435
|
-
getDocx: async (e) => (await
|
|
436
|
-
loadDocument:
|
|
437
|
-
loadDocx:
|
|
437
|
+
getDocx: async (e) => (await Xt(e))?.buffer ?? null,
|
|
438
|
+
loadDocument: Yt,
|
|
439
|
+
loadDocx: Jt
|
|
438
440
|
}, Ht = ge({
|
|
439
|
-
getEditorApi: () =>
|
|
441
|
+
getEditorApi: () => $.api,
|
|
440
442
|
getLayout: () => L.value,
|
|
441
|
-
runLayout: (e, t) =>
|
|
443
|
+
runLayout: (e, t) => X(e, t),
|
|
442
444
|
getDocumentIO: () => Vt,
|
|
443
445
|
emitter: W
|
|
444
446
|
});
|
|
445
|
-
function
|
|
446
|
-
pe(c(y) === "suggesting", e.state, e.dispatch,
|
|
447
|
+
function Ut(e) {
|
|
448
|
+
pe(c(y) === "suggesting", e.state, e.dispatch, T());
|
|
447
449
|
}
|
|
448
|
-
l([() => c(y),
|
|
450
|
+
l([() => c(y), T], () => {
|
|
449
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 &&
|
|
455
|
-
for (let e of
|
|
456
|
-
let t =
|
|
457
|
-
t &&
|
|
456
|
+
e && Ut(e);
|
|
457
|
+
for (let e of J.listStories()) {
|
|
458
|
+
let t = J.getView(e);
|
|
459
|
+
t && Ut(t);
|
|
458
460
|
}
|
|
459
461
|
}), l(() => c(u), (e) => {
|
|
460
|
-
|
|
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
|
-
Q.ensureView();
|
|
478
|
-
}
|
|
479
478
|
function Gt() {
|
|
480
|
-
|
|
479
|
+
$.ensureView();
|
|
481
480
|
}
|
|
482
481
|
function Kt() {
|
|
483
|
-
|
|
484
|
-
|
|
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;
|
|
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) {
|
|
501
|
-
|
|
503
|
+
x?.(e instanceof Error ? e : Error(String(e)));
|
|
502
504
|
}
|
|
503
505
|
}
|
|
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;
|
|
@@ -518,40 +520,40 @@ function O(e) {
|
|
|
518
520
|
if (n.isErr()) throw n.error;
|
|
519
521
|
t = n.value;
|
|
520
522
|
}
|
|
521
|
-
let n = await Ae(t, { password: c(
|
|
522
|
-
|
|
523
|
+
let n = await Ae(t, { password: c(Je) });
|
|
524
|
+
E.value = n, Kt();
|
|
523
525
|
} catch (e) {
|
|
524
526
|
let t = e instanceof Error ? e : Error(String(e));
|
|
525
|
-
z.value = t.message,
|
|
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
|
-
let t =
|
|
537
|
+
let t = $.api.captureCanonicalSave();
|
|
536
538
|
if (t) {
|
|
537
539
|
let n = await be({
|
|
538
540
|
snapshot: t,
|
|
539
541
|
options: e,
|
|
540
|
-
featureFlags: c(
|
|
542
|
+
featureFlags: c(st)
|
|
541
543
|
});
|
|
542
|
-
for (let t of n.diagnostics) e?.onDiagnostic ||
|
|
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
|
-
return
|
|
552
|
+
return x?.(e instanceof Error ? e : Error(String(e))), null;
|
|
551
553
|
}
|
|
552
554
|
if (V()) return null;
|
|
553
|
-
|
|
554
|
-
let r =
|
|
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,75 @@ 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 ||
|
|
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
|
|
587
|
-
let e =
|
|
588
|
+
function Qt() {
|
|
589
|
+
let e = $.api.getCanonicalDocument();
|
|
588
590
|
if (e) return e;
|
|
589
591
|
if (V()) return null;
|
|
590
|
-
let t =
|
|
591
|
-
return t ? H(
|
|
592
|
-
}
|
|
593
|
-
function Qt(e) {
|
|
594
|
-
bt(d.modelEdits, "Direct document model changes are unavailable in this session.") || (D.value = e, J(), I.value && !q.getView(I.value) && (I.value = null));
|
|
592
|
+
let t = E.value;
|
|
593
|
+
return t ? H(J.snapshotDocument(q.snapshotDocument(t))) : null;
|
|
595
594
|
}
|
|
596
595
|
function $t(e) {
|
|
597
|
-
|
|
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));
|
|
598
597
|
}
|
|
599
|
-
function en() {
|
|
600
|
-
|
|
598
|
+
function en(e) {
|
|
599
|
+
return q.getView(e);
|
|
601
600
|
}
|
|
602
|
-
function tn(
|
|
603
|
-
|
|
604
|
-
t && ($(t), I.value = e, requestAnimationFrame(() => t.focus()));
|
|
601
|
+
function tn() {
|
|
602
|
+
Y();
|
|
605
603
|
}
|
|
606
|
-
function nn() {
|
|
607
|
-
|
|
604
|
+
function nn(e) {
|
|
605
|
+
let t = J.activate(e);
|
|
606
|
+
t && (Ut(t), I.value = e, requestAnimationFrame(() => t.focus()));
|
|
608
607
|
}
|
|
609
608
|
function rn() {
|
|
610
|
-
|
|
611
|
-
return e ? q.getView(e) : null;
|
|
609
|
+
J.activate(null), I.value = null;
|
|
612
610
|
}
|
|
613
611
|
function an() {
|
|
614
|
-
|
|
612
|
+
let e = I.value;
|
|
613
|
+
return e ? J.getView(e) : null;
|
|
615
614
|
}
|
|
616
615
|
function on() {
|
|
617
|
-
|
|
618
|
-
e ? e.focus() : j.value?.focus();
|
|
616
|
+
return U.getCommands();
|
|
619
617
|
}
|
|
620
618
|
function sn() {
|
|
619
|
+
let e = an();
|
|
620
|
+
e ? e.focus() : j.value?.focus();
|
|
621
|
+
}
|
|
622
|
+
function cn() {
|
|
621
623
|
let e = j.value;
|
|
622
|
-
e &&
|
|
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
|
-
|
|
632
|
-
|
|
633
|
-
|
|
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;
|
|
635
|
+
}
|
|
636
|
+
return i(ln), {
|
|
637
|
+
setEmbeddedFontFamilies: (e) => {
|
|
638
|
+
if (e) {
|
|
639
|
+
K.embeddedFontFamilyMap = new Map(e);
|
|
640
|
+
return;
|
|
641
|
+
}
|
|
642
|
+
delete K.embeddedFontFamilyMap;
|
|
643
|
+
},
|
|
634
644
|
editor: Ht,
|
|
635
645
|
editorView: j,
|
|
636
646
|
editorState: M,
|
|
@@ -641,26 +651,26 @@ function O(e) {
|
|
|
641
651
|
isDirty: B,
|
|
642
652
|
parseError: z,
|
|
643
653
|
layout: L,
|
|
644
|
-
blocks:
|
|
645
|
-
measures:
|
|
654
|
+
blocks: yt,
|
|
655
|
+
measures: bt,
|
|
646
656
|
syncCoordinator: G,
|
|
647
|
-
loadBuffer:
|
|
648
|
-
loadDocument:
|
|
649
|
-
save:
|
|
650
|
-
getDocument:
|
|
651
|
-
setDocument:
|
|
652
|
-
getHeaderFooterView:
|
|
653
|
-
syncHeaderFooterViews:
|
|
654
|
-
openNoteStory:
|
|
655
|
-
closeNoteStory:
|
|
656
|
-
getActiveNoteView:
|
|
657
|
-
getCommands:
|
|
658
|
-
focus:
|
|
659
|
-
reLayout:
|
|
660
|
-
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
|
|
661
671
|
};
|
|
662
672
|
}
|
|
663
|
-
function
|
|
673
|
+
function D(e, t) {
|
|
664
674
|
if (t < e.top + 40) {
|
|
665
675
|
let n = Math.max(0, e.top + 40 - t);
|
|
666
676
|
return -Math.min(12, n / 40 * 12);
|
|
@@ -673,7 +683,7 @@ function _t(e, t) {
|
|
|
673
683
|
}
|
|
674
684
|
//#endregion
|
|
675
685
|
//#region src/composables/useDragAutoScroll.ts
|
|
676
|
-
function
|
|
686
|
+
function O({ pagesContainer: e, onScrollExtendSelection: t }) {
|
|
677
687
|
let n = null, r = 0, a = 0, o = !1;
|
|
678
688
|
function s() {
|
|
679
689
|
return se(e.value);
|
|
@@ -685,7 +695,7 @@ function k({ pagesContainer: e, onScrollExtendSelection: t }) {
|
|
|
685
695
|
if (!o) return;
|
|
686
696
|
let e = s();
|
|
687
697
|
if (!e) return;
|
|
688
|
-
let i =
|
|
698
|
+
let i = D(e.getBoundingClientRect(), a);
|
|
689
699
|
i !== 0 && (ce(e, i), t(r, a)), n = requestAnimationFrame(l);
|
|
690
700
|
}
|
|
691
701
|
function u() {
|
|
@@ -706,7 +716,7 @@ function k({ pagesContainer: e, onScrollExtendSelection: t }) {
|
|
|
706
716
|
}
|
|
707
717
|
//#endregion
|
|
708
718
|
//#region src/composables/useTableResize.ts
|
|
709
|
-
function
|
|
719
|
+
function k() {
|
|
710
720
|
let e = {
|
|
711
721
|
active: !1,
|
|
712
722
|
startX: 0,
|
|
@@ -738,14 +748,14 @@ function A() {
|
|
|
738
748
|
}
|
|
739
749
|
function a(i, a) {
|
|
740
750
|
let o = i.target;
|
|
741
|
-
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;
|
|
742
752
|
}
|
|
743
753
|
function o(r) {
|
|
744
754
|
if (e.active && e.handle) {
|
|
745
755
|
r.preventDefault();
|
|
746
756
|
let t = r.clientX - e.startX, n = parseFloat(e.handle.style.left);
|
|
747
757
|
e.handle.style.left = `${n + t}px`, e.startX = r.clientX;
|
|
748
|
-
let i = Math.round(t *
|
|
758
|
+
let i = Math.round(t * y), a = e.origWidths.left + i, o = e.origWidths.right - i;
|
|
749
759
|
a >= v && o >= v && (e.origWidths = {
|
|
750
760
|
left: a,
|
|
751
761
|
right: o
|
|
@@ -756,21 +766,21 @@ function A() {
|
|
|
756
766
|
r.preventDefault();
|
|
757
767
|
let e = r.clientY - t.startY, n = parseFloat(t.handle.style.top);
|
|
758
768
|
t.handle.style.top = `${n + e}px`, t.startY = r.clientY;
|
|
759
|
-
let i = Math.round(e *
|
|
760
|
-
a >=
|
|
769
|
+
let i = Math.round(e * y), a = t.origHeight + i;
|
|
770
|
+
a >= Je && (t.origHeight = a);
|
|
761
771
|
return;
|
|
762
772
|
}
|
|
763
773
|
if (n.active && n.handle) {
|
|
764
774
|
r.preventDefault();
|
|
765
775
|
let e = r.clientX - n.startX, t = parseFloat(n.handle.style.left);
|
|
766
776
|
n.handle.style.left = `${t + e}px`, n.startX = r.clientX;
|
|
767
|
-
let i = Math.round(e *
|
|
777
|
+
let i = Math.round(e * y), a = n.origWidth + i;
|
|
768
778
|
a >= v && (n.origWidth = a);
|
|
769
779
|
}
|
|
770
780
|
}
|
|
771
781
|
function s(i) {
|
|
772
782
|
if (e.active) {
|
|
773
|
-
e.active = !1, e.handle?.classList.remove("dragging"), r &&
|
|
783
|
+
e.active = !1, e.handle?.classList.remove("dragging"), r && Ye(r, {
|
|
774
784
|
pmStart: e.tablePmStart,
|
|
775
785
|
colIdx: e.columnIndex,
|
|
776
786
|
newLeft: e.origWidths.left,
|
|
@@ -779,14 +789,14 @@ function A() {
|
|
|
779
789
|
return;
|
|
780
790
|
}
|
|
781
791
|
if (t.active) {
|
|
782
|
-
t.active = !1, t.handle?.classList.remove("dragging"), r &&
|
|
792
|
+
t.active = !1, t.handle?.classList.remove("dragging"), r && Ze(r, {
|
|
783
793
|
pmStart: t.tablePmStart,
|
|
784
794
|
rowIdx: t.rowIndex,
|
|
785
795
|
newHeight: t.origHeight
|
|
786
796
|
}), t.handle = null;
|
|
787
797
|
return;
|
|
788
798
|
}
|
|
789
|
-
n.active && (n.active = !1, n.handle?.classList.remove("dragging"), r &&
|
|
799
|
+
n.active && (n.active = !1, n.handle?.classList.remove("dragging"), r && Xe(r, {
|
|
790
800
|
pmStart: n.tablePmStart,
|
|
791
801
|
colIdx: n.columnIndex,
|
|
792
802
|
newWidth: n.origWidth
|
|
@@ -803,31 +813,31 @@ function A() {
|
|
|
803
813
|
isResizing: i
|
|
804
814
|
};
|
|
805
815
|
}
|
|
806
|
-
function
|
|
807
|
-
let n =
|
|
816
|
+
function A(e, t) {
|
|
817
|
+
let n = Qe(e, t.tablePmStart, t.columnIndex);
|
|
808
818
|
n && (t.origWidths = n);
|
|
809
819
|
}
|
|
810
|
-
function
|
|
811
|
-
let r =
|
|
820
|
+
function j(e, t, n) {
|
|
821
|
+
let r = $e(e, t.tablePmStart, t.rowIndex);
|
|
812
822
|
if (r != null) {
|
|
813
823
|
t.origHeight = r;
|
|
814
824
|
return;
|
|
815
825
|
}
|
|
816
826
|
let i = n.closest(".layout-table")?.querySelector(`[data-row-index="${t.rowIndex}"]`), a = i ? i.getBoundingClientRect().height : 30;
|
|
817
|
-
t.origHeight = Math.round(a *
|
|
827
|
+
t.origHeight = Math.round(a * y);
|
|
818
828
|
}
|
|
819
|
-
function
|
|
820
|
-
let n =
|
|
829
|
+
function M(e, t) {
|
|
830
|
+
let n = b(e, t.tablePmStart, t.columnIndex);
|
|
821
831
|
n != null && (t.origWidth = n);
|
|
822
832
|
}
|
|
823
833
|
//#endregion
|
|
824
834
|
//#region src/composables/useTrackedChanges.ts
|
|
825
|
-
function
|
|
826
|
-
return e(() => (n.value,
|
|
835
|
+
function N(t, n) {
|
|
836
|
+
return e(() => (n.value, et(t.value?.state ?? null)));
|
|
827
837
|
}
|
|
828
838
|
//#endregion
|
|
829
839
|
//#region src/composables/useZoom.ts
|
|
830
|
-
var
|
|
840
|
+
var P = nt, F = tt, I = [
|
|
831
841
|
.5,
|
|
832
842
|
.75,
|
|
833
843
|
1,
|
|
@@ -835,16 +845,16 @@ var F = S, I = et, L = [
|
|
|
835
845
|
1.5,
|
|
836
846
|
2
|
|
837
847
|
];
|
|
838
|
-
function
|
|
839
|
-
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);
|
|
840
850
|
function l(e) {
|
|
841
|
-
i.value = Math.max(
|
|
851
|
+
i.value = Math.max(P, Math.min(F, Math.round(e * 100) / 100));
|
|
842
852
|
}
|
|
843
853
|
function u() {
|
|
844
|
-
l(i.value +
|
|
854
|
+
l(i.value + x);
|
|
845
855
|
}
|
|
846
856
|
function d() {
|
|
847
|
-
l(i.value -
|
|
857
|
+
l(i.value - x);
|
|
848
858
|
}
|
|
849
859
|
function f() {
|
|
850
860
|
l(1);
|
|
@@ -870,8 +880,8 @@ function vt(t = 1) {
|
|
|
870
880
|
handleWheel: ee,
|
|
871
881
|
handleKeyDown: p,
|
|
872
882
|
installShortcuts: m,
|
|
873
|
-
ZOOM_PRESETS:
|
|
883
|
+
ZOOM_PRESETS: I
|
|
874
884
|
};
|
|
875
885
|
}
|
|
876
886
|
//#endregion
|
|
877
|
-
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 };
|