@stll/folio-vue 0.26.0 → 0.26.1
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/SplitCellDialog-DfMw2Ev2.cjs +15 -0
- package/dist/{SplitCellDialog-CWvjxbog.js → SplitCellDialog-bNeugz_3.js} +1181 -1207
- package/dist/{ListButtons-1YJNViXB.js → StylePicker-DfIQUq6G.js} +1095 -1106
- package/dist/StylePicker-ynX3GzFu.cjs +4 -0
- package/dist/components/DocxEditor/DocxEditorDialogs.vue.d.ts +2 -2
- package/dist/components/DocxEditor/pagedEditorRef.d.ts +1 -1
- package/dist/components/DocxEditor/types.d.ts +10 -10
- package/dist/components/DocxEditor.vue.d.ts +5 -5
- package/dist/components/InlineHeaderFooterEditor.vue.d.ts +2 -2
- package/dist/components/OutlineToggleButton.vue.d.ts +21 -0
- package/dist/components/ReviewControls.vue.d.ts +2 -2
- package/dist/components/Toolbar.vue.d.ts +9 -9
- package/dist/components/dialogs/FootnotePropertiesDialog.vue.d.ts +2 -2
- package/dist/components/dialogs/HyperlinkDialog.vue.d.ts +2 -2
- package/dist/components/dialogs/ImagePositionDialog.vue.d.ts +2 -2
- package/dist/components/dialogs/PageSetupDialog.vue.d.ts +2 -2
- package/dist/components/dialogs/SetNumberingValueDialog.vue.d.ts +2 -2
- package/dist/components/dialogs/TablePropertiesDialog.vue.d.ts +2 -2
- package/dist/components/dialogs/WatermarkDialog.vue.d.ts +2 -2
- package/dist/components/sidebar/CommentCard.vue.d.ts +2 -2
- package/dist/components/sidebar/TrackedChangeCard.vue.d.ts +2 -2
- package/dist/components/sidebar/cardStyles.d.ts +1 -1
- package/dist/components/tableStylePresets.d.ts +1 -1
- package/dist/components/ui/Button.vue.d.ts +1 -1
- package/dist/components/ui/FontSizePicker.vue.d.ts +1 -1
- package/dist/components/ui/HorizontalRuler.vue.d.ts +2 -2
- package/dist/components/ui/HyperlinkPopup.vue.d.ts +4 -4
- package/dist/components/ui/Input.vue.d.ts +1 -1
- package/dist/components/ui/ListButtons.vue.d.ts +1 -1
- package/dist/components/ui/OutlineRail.vue.d.ts +1 -1
- package/dist/components/ui/TableMoreDropdown.vue.d.ts +1 -1
- package/dist/components/ui/TableToolbar.vue.d.ts +1 -1
- package/dist/components/ui/VerticalRuler.vue.d.ts +2 -2
- package/dist/components/ui/icon-paths.json.d.ts +18 -6
- package/dist/composables/useAutoSave.d.ts +1 -1
- package/dist/composables/useClipboard.d.ts +2 -2
- package/dist/composables/useCommentLifecycle.d.ts +1 -1
- package/dist/composables/useCommentManagement.d.ts +1 -1
- package/dist/composables/useContextMenus.d.ts +2 -2
- package/dist/composables/useDocxEditor.d.ts +4 -4
- package/dist/composables/useDocxEditorRefApi.d.ts +5 -5
- package/dist/composables/useFindReplace.d.ts +2 -2
- package/dist/composables/useFixedDropdown.d.ts +1 -1
- package/dist/composables/useFormattingActions.d.ts +1 -1
- package/dist/composables/useHistory.d.ts +1 -1
- package/dist/composables/useHyperlinkManagement.d.ts +1 -1
- package/dist/composables/useImageActions.d.ts +1 -1
- package/dist/composables/useOutlineSidebar.d.ts +1 -1
- package/dist/composables/usePageSetupControls.d.ts +1 -1
- package/dist/composables/usePagesPointer.d.ts +3 -3
- package/dist/composables/useParagraphStyleOptions.d.ts +1 -1
- package/dist/composables/useSelectionHighlight.d.ts +1 -1
- package/dist/composables/useSelectionSync.d.ts +1 -1
- package/dist/composables/useToolbarDropdowns.d.ts +1 -1
- package/dist/composables/useToolbarFontSize.d.ts +1 -1
- package/dist/composables/useTrackedChanges.d.ts +1 -1
- package/dist/composables/useVisualLineNavigation.d.ts +1 -1
- package/dist/composables/useZoom.d.ts +1 -1
- package/dist/composables.cjs +2 -2
- package/dist/composables.js +65 -71
- package/dist/dialogs.cjs +1 -1
- package/dist/dialogs.js +1 -2
- package/dist/folio-vue.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4831 -4865
- package/dist/messages/ar.cjs +1 -1
- package/dist/messages/ar.js +1 -2
- package/dist/messages/cs.cjs +1 -1
- package/dist/messages/cs.js +1 -2
- package/dist/messages/de.cjs +1 -1
- package/dist/messages/de.js +1 -2
- package/dist/messages/en.cjs +1 -1
- package/dist/messages/en.js +1 -2
- package/dist/messages/es.cjs +1 -1
- package/dist/messages/es.js +1 -2
- package/dist/messages/et.cjs +1 -1
- package/dist/messages/et.js +1 -2
- package/dist/messages/fr.cjs +1 -1
- package/dist/messages/fr.js +1 -2
- package/dist/messages/he.cjs +1 -1
- package/dist/messages/he.js +1 -2
- package/dist/messages/hi.cjs +1 -1
- package/dist/messages/hi.js +1 -2
- package/dist/messages/hu.cjs +1 -1
- package/dist/messages/hu.js +1 -2
- package/dist/messages/locales.js +1 -2
- package/dist/messages/lt.cjs +1 -1
- package/dist/messages/lt.js +1 -2
- package/dist/messages/lv.cjs +1 -1
- package/dist/messages/lv.js +1 -2
- package/dist/messages/pl.cjs +1 -1
- package/dist/messages/pl.js +1 -2
- package/dist/messages/pt-BR.cjs +1 -1
- package/dist/messages/pt-BR.js +1 -2
- package/dist/messages/sk.cjs +1 -1
- package/dist/messages/sk.js +1 -2
- package/dist/messages/tr.cjs +1 -1
- package/dist/messages/tr.js +1 -2
- package/dist/messages/zh-CN.cjs +1 -1
- package/dist/messages/zh-CN.js +1 -2
- package/dist/{rolldown-runtime-C6qsp3rV.cjs → rolldown-runtime-CYJQrBu7.cjs} +1 -1
- package/dist/ui.cjs +1 -1
- package/dist/ui.d.ts +1 -1
- package/dist/ui.js +21 -27
- package/dist/useZoom-Bwnae1jX.cjs +1 -0
- package/dist/{useZoom-C_sQUu4b.js → useZoom-CX0mrPQY.js} +372 -386
- package/dist/utils/viewportPosition.d.ts +1 -1
- package/package.json +13 -13
- package/dist/ListButtons-Cw5RTKNt.cjs +0 -4
- package/dist/SplitCellDialog-Dpp-FPQ6.cjs +0 -15
- package/dist/useZoom-CbH76z8x.cjs +0 -1
|
@@ -1,111 +1,111 @@
|
|
|
1
1
|
import { computed as e, inject as t, onBeforeUnmount as n, onMounted as r, onScopeDispose as i, provide as a, reactive as o, ref as s, shallowRef as c, toValue as l, watch as u, watchEffect as d } from "vue";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { getMargins as
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import {
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import { MIN_CELL_WIDTH_TWIPS as
|
|
44
|
-
import { extractTrackedChanges as
|
|
45
|
-
import { ZOOM_MAX as
|
|
2
|
+
import { CanonicalSessionRefusalError as f, collectRemoteSelections as p, createHiddenEditorManager as m, createHiddenEditorState as h } from "@stll/folio-core/controller/hiddenEditorManager";
|
|
3
|
+
import { cloneDocumentWithParagraphPropertySources as g } from "@stll/folio-core/docx/document-clone";
|
|
4
|
+
import { getEditorReadOnlyReason as ee } from "@stll/folio-core/managers/EditorModeManager";
|
|
5
|
+
import { getEditorScrollRoot as _, scrollEditorBy as v } from "@stll/folio-core/paged-layout/editorScrollRoot";
|
|
6
|
+
import { getMargins as te, getPageSize as y, twipsToPixels as b } from "@stll/folio-core/paged-layout/sectionGeometry";
|
|
7
|
+
import { CANONICAL_GAP as x, canonicalRefusalMessage as ne, usesCanonicalSession as re } from "@stll/folio-core/types/canonicalCapabilities";
|
|
8
|
+
import { createSuggestionModePlugin as ie, setSuggestionMode as S } from "@stll/folio-core/prosemirror/plugins/suggestionMode";
|
|
9
|
+
import { loadCollaborationModules as ae } from "@stll/folio-core/controller/collaborationModules";
|
|
10
|
+
import { FOLIO_DOCX_SERIALIZATION_MODE as C, createFolioEditor as oe } from "@stll/folio-core/controller/folioEditor";
|
|
11
|
+
import { createFolioEditorEmitter as se } from "@stll/folio-core/controller/folioEditorEvents";
|
|
12
|
+
import { readFontSetSignature as ce, waitForInitialLayoutFonts as w, watchLayoutFontLoads as le } from "@stll/folio-core/controller/fontReadiness";
|
|
13
|
+
import { createHeaderFooterEditorManager as ue } from "@stll/folio-core/controller/headerFooterEditorManager";
|
|
14
|
+
import { createHyphenationReadiness as de } from "@stll/folio-core/controller/hyphenationReadiness";
|
|
15
|
+
import { runLayoutPipeline as fe } from "@stll/folio-core/controller/layoutPipeline";
|
|
16
|
+
import { TRANSACTION_LAYOUT_TIMING as T, browserClock as pe, createLayoutScheduler as me } from "@stll/folio-core/controller/layoutScheduler";
|
|
17
|
+
import { createLayoutSession as he } from "@stll/folio-core/controller/layoutSession";
|
|
18
|
+
import { createNoteEditorManager as ge } from "@stll/folio-core/controller/noteEditorManager";
|
|
19
|
+
import { CanonicalSaveDiagnosticError as _e, serializeCanonicalSave as ve } from "@stll/folio-core/docx/canonicalSave";
|
|
20
|
+
import { prepareCanonicalDocxInput as ye } from "@stll/folio-core/docx/canonicalSessionInput";
|
|
21
|
+
import { parseDocx as be } from "@stll/folio-core/docx/parser";
|
|
22
|
+
import { getFootnoteText as xe } from "@stll/folio-core/docx/storyPlainText";
|
|
23
|
+
import { convertHeaderFooterPmDocToContent as Se, convertHeaderFooterToContent as Ce } from "@stll/folio-core/layout-bridge/convert/headerFooterLayout";
|
|
24
|
+
import { resolveSectionHeaderFooterRefs as we } from "@stll/folio-core/layout-engine";
|
|
25
|
+
import { LayoutPainter as Te, releaseDisplayPageResources as Ee } from "@stll/folio-core/layout-painter";
|
|
26
|
+
import { LayoutSelectionGate as De } from "@stll/folio-core/paged-layout/LayoutSelectionGate";
|
|
27
|
+
import { fromProseDoc as Oe } from "@stll/folio-core/prosemirror/conversion/fromProseDoc";
|
|
28
|
+
import { ExtensionManager as ke } from "@stll/folio-core/prosemirror/extensions/ExtensionManager";
|
|
29
|
+
import { getChangedParagraphIds as Ae, hasStructuralChanges as je, hasUntrackedChanges as Me, repackWithEditorSectionRemovals as Ne } from "@stll/folio-core/prosemirror/extensions/features/ParagraphChangeTrackerExtension";
|
|
30
|
+
import { createStarterKit as Pe } from "@stll/folio-core/prosemirror/extensions/StarterKit";
|
|
31
|
+
import { createNoteReferenceFollower as Fe, withoutUnreferencedNotes as Ie } from "@stll/folio-core/prosemirror/noteReferenceReview";
|
|
32
|
+
import { createAnonymizationDecorationsPlugin as Le } from "@stll/folio-core/prosemirror/plugins/anonymizationDecorations";
|
|
33
|
+
import { autocompleteSuggestionPlugin as Re } from "@stll/folio-core/prosemirror/plugins/autocompleteSuggestion";
|
|
34
|
+
import { createTemplateDirectivesPlugin as ze } from "@stll/folio-core/prosemirror/plugins/templateDirectives";
|
|
35
|
+
import { createTemplatePreviewValuesPlugin as Be } from "@stll/folio-core/prosemirror/plugins/templatePreviewValues";
|
|
36
|
+
import { templateSlashMenuPlugin as Ve } from "@stll/folio-core/prosemirror/plugins/templateSlashMenu";
|
|
37
|
+
import { resolveHeaderFooterContent as He } from "@stll/folio-core/utils/headerFooter";
|
|
38
|
+
import { FindReplaceManager as Ue } from "@stll/folio-core/managers/FindReplaceManager";
|
|
39
|
+
import { findInDisplayedDocument as We, resolveFindMatchRange as Ge } from "@stll/folio-core/prosemirror/findReplaceSelection";
|
|
40
|
+
import { createFindMatchView as Ke, getRenderedSearchStories as E } from "@stll/folio-core/utils/findMatchView";
|
|
41
|
+
import { createDefaultFindOptions as qe, replaceEligibility as Je } from "@stll/folio-core/utils/findReplace";
|
|
42
|
+
import { createFindSearchKey as Ye, sameFindSearchKey as Xe } from "@stll/folio-core/utils/findSearchKey";
|
|
43
|
+
import { MIN_CELL_WIDTH_TWIPS as Ze, MIN_ROW_HEIGHT_TWIPS as D, TWIPS_PER_PIXEL as O, clampRowResizeDelta as Qe, commitColumnResize as $e, commitRightEdgeResize as et, commitRowResize as tt, readColumnWidthAt as nt, readColumnWidths as rt, readRowHeight as it } from "@stll/folio-core/prosemirror/tableResize";
|
|
44
|
+
import { extractTrackedChanges as at } from "@stll/folio-core/prosemirror/utils/extractTrackedChanges";
|
|
45
|
+
import { ZOOM_MAX as ot, ZOOM_MIN as k, ZOOM_STEP as A } from "@stll/folio-core/utils/zoom";
|
|
46
46
|
//#region src/utils/colorMode.ts
|
|
47
|
-
var
|
|
48
|
-
function
|
|
47
|
+
var st = "(prefers-color-scheme: dark)";
|
|
48
|
+
function j() {
|
|
49
49
|
return typeof window < "u" && typeof window.matchMedia == "function";
|
|
50
50
|
}
|
|
51
|
-
function
|
|
51
|
+
function M(e, t) {
|
|
52
52
|
return e === "dark" || e === "system" && t;
|
|
53
53
|
}
|
|
54
|
-
function
|
|
55
|
-
if (!
|
|
56
|
-
let t = window.matchMedia(
|
|
54
|
+
function N(e) {
|
|
55
|
+
if (!j()) return () => {};
|
|
56
|
+
let t = window.matchMedia(st);
|
|
57
57
|
e(t.matches);
|
|
58
58
|
let n = (t) => e(t.matches);
|
|
59
59
|
return t.addEventListener("change", n), () => t.removeEventListener("change", n);
|
|
60
60
|
}
|
|
61
61
|
//#endregion
|
|
62
62
|
//#region src/composables/useColorMode.ts
|
|
63
|
-
var
|
|
64
|
-
a(
|
|
65
|
-
},
|
|
66
|
-
t.provide(
|
|
63
|
+
var P = "light", F = Symbol("folioColorMode"), I = (t = P) => {
|
|
64
|
+
a(F, e(() => l(t)));
|
|
65
|
+
}, ct = { install(t, n = P) {
|
|
66
|
+
t.provide(F, e(() => l(n)));
|
|
67
67
|
} };
|
|
68
|
-
function
|
|
69
|
-
let n = t(
|
|
68
|
+
function L() {
|
|
69
|
+
let n = t(F, e(() => P)), i = s(!1), a = s(!1);
|
|
70
70
|
return r(() => {
|
|
71
71
|
i.value = !0;
|
|
72
72
|
}), d((e) => {
|
|
73
|
-
|
|
73
|
+
i.value && n.value === "system" && e(N((e) => {
|
|
74
74
|
a.value = e;
|
|
75
75
|
}));
|
|
76
|
-
}), e(() =>
|
|
76
|
+
}), e(() => M(n.value, i.value && a.value));
|
|
77
77
|
}
|
|
78
78
|
//#endregion
|
|
79
79
|
//#region src/composables/useDocxEditor.ts
|
|
80
|
-
var
|
|
81
|
-
function
|
|
80
|
+
var lt = 24, ut = "User", dt = 250, ft = [], pt = [];
|
|
81
|
+
function mt(e) {
|
|
82
82
|
let t = e?.columnCount ?? 1;
|
|
83
83
|
if (t <= 1) return;
|
|
84
84
|
let n = {
|
|
85
85
|
count: t,
|
|
86
|
-
gap:
|
|
86
|
+
gap: b(e?.columnSpace ?? 720),
|
|
87
87
|
equalWidth: e?.equalWidth ?? !0
|
|
88
88
|
};
|
|
89
89
|
return e?.separator !== void 0 && (n.separator = e.separator), n;
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function ht(e, t, n, r, i, a) {
|
|
92
92
|
if (!e) return;
|
|
93
93
|
let o = t ? {
|
|
94
94
|
...a,
|
|
95
95
|
rId: t
|
|
96
96
|
} : a, s = t ? n?.getView(t) : null;
|
|
97
|
-
return s ?
|
|
97
|
+
return s ? Se(s.state.doc, r, i, o) : Ce(e, r, i, o);
|
|
98
98
|
}
|
|
99
|
-
function
|
|
99
|
+
function gt(e, t, n, r, i) {
|
|
100
100
|
if (!e || e.size === 0) return;
|
|
101
101
|
let a = /* @__PURE__ */ new Map();
|
|
102
102
|
for (let [o, s] of e) {
|
|
103
|
-
let e =
|
|
103
|
+
let e = ht(s, o, t, n, r, i);
|
|
104
104
|
e && a.set(o, e);
|
|
105
105
|
}
|
|
106
106
|
return a.size > 0 ? a : void 0;
|
|
107
107
|
}
|
|
108
|
-
function
|
|
108
|
+
function _t(e, t, n) {
|
|
109
109
|
let r = /* @__PURE__ */ new Map();
|
|
110
110
|
if (!n || !n.package.footnotes) return r;
|
|
111
111
|
let i = /* @__PURE__ */ new Map();
|
|
@@ -119,7 +119,7 @@ function gt(e, t, n) {
|
|
|
119
119
|
e.push({
|
|
120
120
|
displayNumber: String(o),
|
|
121
121
|
noteId: n,
|
|
122
|
-
text:
|
|
122
|
+
text: xe(r),
|
|
123
123
|
...a ? { content: {
|
|
124
124
|
blocks: a.blocks,
|
|
125
125
|
measures: a.measures,
|
|
@@ -131,7 +131,7 @@ function gt(e, t, n) {
|
|
|
131
131
|
}
|
|
132
132
|
return r;
|
|
133
133
|
}
|
|
134
|
-
var
|
|
134
|
+
var R = /* @__PURE__ */ new Set([
|
|
135
135
|
"black",
|
|
136
136
|
"blue",
|
|
137
137
|
"cyan",
|
|
@@ -150,48 +150,48 @@ var L = /* @__PURE__ */ new Set([
|
|
|
150
150
|
"white",
|
|
151
151
|
"yellow"
|
|
152
152
|
]);
|
|
153
|
-
function
|
|
153
|
+
function vt(e) {
|
|
154
154
|
let t = [], n = (e, r) => {
|
|
155
|
-
for (let [n, i] of e.marks.entries()) i.type.name === "highlight" && !
|
|
155
|
+
for (let [n, i] of e.marks.entries()) i.type.name === "highlight" && !R.has(String(i.attrs.color)) && t.push(`${r}.marks[${n}]=${JSON.stringify(i.attrs)}`);
|
|
156
156
|
e.forEach((e, t, i) => {
|
|
157
157
|
n(e, `${r}.content[${i}]`);
|
|
158
158
|
});
|
|
159
159
|
};
|
|
160
160
|
return n(e, "doc"), t.join("; ");
|
|
161
161
|
}
|
|
162
|
-
function
|
|
163
|
-
let { hiddenContainer: t, hiddenHeaderFooterContainer: n, noteEditorContainer: r, pagesContainer: a, readOnly: o = !1, experimentalSession: d, pageGap:
|
|
162
|
+
function yt(e) {
|
|
163
|
+
let { hiddenContainer: t, hiddenHeaderFooterContainer: n, noteEditorContainer: r, pagesContainer: a, readOnly: o = !1, experimentalSession: d, pageGap: ee = lt, pageRenderer: _, markupView: v = "all-markup", showCommentHighlights: b = !0, showMarginGuides: xe, marginGuideColor: Se, password: Ce, editorMode: Ue, author: We, externalPlugins: Ge = [], historyShortcuts: Ke = "editor", collaboration: E, onAnonymizationMatchesChange: qe, showTemplateDirectives: Je, onSlashMenuChange: Ye, onSlashMenuKeyAction: Xe, onChange: Ze, onError: D, onSelectionUpdate: O, onEditorViewReady: Qe, onCopy: $e, onCut: et, onPaste: tt, onReadOnlyEditAttempt: nt, featureFlags: rt, onSelectiveSaveTripwire: it } = e, at = n ?? t, ot = () => l(We) ?? ut, k = c(null), A = 0, st = !1, j = 0, M = !1, N = c(null), P = c(null), F = c(null), I = c([]), ct = c(null), L = c(null), R = c(null), yt = c([]), bt = c([]), z = s(!1), B = s(null), V = s(!1), H = () => re(l(d), x.authorityRouting), U = (e) => H() ? g(e) : e, xt = (e, t) => {
|
|
164
164
|
if (!H()) return !1;
|
|
165
|
-
let n = new
|
|
165
|
+
let n = new f({
|
|
166
166
|
gap: e,
|
|
167
|
-
message:
|
|
167
|
+
message: ne(e, t)
|
|
168
168
|
});
|
|
169
169
|
return D?.(n), !0;
|
|
170
|
-
}, W = new
|
|
170
|
+
}, W = new ke(Pe({ historyShortcuts: Ke }));
|
|
171
171
|
W.buildSchema(), W.initializeRuntime();
|
|
172
|
-
let
|
|
173
|
-
onChange: (e) =>
|
|
174
|
-
onKeyAction: (e) =>
|
|
175
|
-
}),
|
|
176
|
-
function
|
|
172
|
+
let St = ie(!1), Ct = [St], wt = Re({ keymap: !0 }), Tt = Le({ onMatchesChange: (e) => qe?.(e) }), Et = ze(), Dt = Ve({
|
|
173
|
+
onChange: (e) => Ye?.(e),
|
|
174
|
+
onKeyAction: (e) => Xe?.(e) ?? !1
|
|
175
|
+
}), Ot = Be(), kt = () => l(Je) === !0;
|
|
176
|
+
function At() {
|
|
177
177
|
return [
|
|
178
|
-
Ct,
|
|
179
|
-
xt,
|
|
180
|
-
...We,
|
|
181
|
-
...l(E)?.plugins ?? [],
|
|
182
178
|
wt,
|
|
183
|
-
|
|
184
|
-
|
|
179
|
+
St,
|
|
180
|
+
...Ge,
|
|
181
|
+
...l(E)?.plugins ?? [],
|
|
182
|
+
Tt,
|
|
183
|
+
...kt() ? [Et, Dt] : [],
|
|
184
|
+
Ot
|
|
185
185
|
];
|
|
186
186
|
}
|
|
187
|
-
let G =
|
|
187
|
+
let G = se(), K = new De(), q = he(), jt = de({
|
|
188
188
|
relayout: () => {
|
|
189
189
|
let e = N.value?.state ?? q.lastEditorState;
|
|
190
190
|
e && Z(e, { reason: "hyphenation-ready" });
|
|
191
191
|
},
|
|
192
192
|
onError: (e) => D?.(e)
|
|
193
193
|
});
|
|
194
|
-
i(
|
|
194
|
+
i(jt.cancel), i(le({
|
|
195
195
|
measuredFontSet: () => q.lastMeasureInputs?.fontSet ?? null,
|
|
196
196
|
relayout: () => {
|
|
197
197
|
if (M) return;
|
|
@@ -199,17 +199,17 @@ function R(e) {
|
|
|
199
199
|
e && Z(e, { reason: "font-ready" });
|
|
200
200
|
}
|
|
201
201
|
}));
|
|
202
|
-
let
|
|
203
|
-
pageGap:
|
|
202
|
+
let Mt = new Te({
|
|
203
|
+
pageGap: ee,
|
|
204
204
|
showShadow: !0
|
|
205
|
-
}), J =
|
|
206
|
-
getHost: () =>
|
|
205
|
+
}), J = ue({
|
|
206
|
+
getHost: () => at.value,
|
|
207
207
|
getReadOnly: () => l(o),
|
|
208
208
|
getDocument: () => $.api.getCanonicalDocument() ?? k.value,
|
|
209
209
|
getCanonicalApi: () => $.api,
|
|
210
210
|
getExperimentalSession: () => l(d),
|
|
211
211
|
onSessionRefusal: (e, t, n) => {
|
|
212
|
-
B.value = e, D?.(n ?? new
|
|
212
|
+
B.value = e, D?.(n ?? new f({
|
|
213
213
|
gap: t,
|
|
214
214
|
message: e
|
|
215
215
|
}));
|
|
@@ -217,9 +217,9 @@ function R(e) {
|
|
|
217
217
|
getStyles: () => k.value?.package.styles ?? null,
|
|
218
218
|
getTheme: () => k.value?.package.theme ?? null,
|
|
219
219
|
onTransaction: ({ rId: e, kind: t, view: n, docChanged: r, selectionChanged: i }) => {
|
|
220
|
-
if (r && (V.value = !0,
|
|
220
|
+
if (r && (V.value = !0, Ft.schedule()), r || i) {
|
|
221
221
|
let { from: r, to: i } = n.state.selection;
|
|
222
|
-
|
|
222
|
+
ct.value = {
|
|
223
223
|
from: r,
|
|
224
224
|
kind: t,
|
|
225
225
|
rId: e,
|
|
@@ -231,14 +231,14 @@ function R(e) {
|
|
|
231
231
|
}
|
|
232
232
|
K.requestRender();
|
|
233
233
|
}
|
|
234
|
-
}),
|
|
234
|
+
}), Nt = { current: null }, Y = ge({
|
|
235
235
|
getHost: () => r?.value ?? null,
|
|
236
|
-
getPlugins: () =>
|
|
236
|
+
getPlugins: () => Ct,
|
|
237
237
|
getDocument: () => $.api.getCanonicalDocument() ?? k.value,
|
|
238
238
|
getCanonicalApi: () => $.api,
|
|
239
239
|
getExperimentalSession: () => l(d),
|
|
240
240
|
onSessionRefusal: (e, t, n) => {
|
|
241
|
-
B.value = e, D?.(n ?? new
|
|
241
|
+
B.value = e, D?.(n ?? new f({
|
|
242
242
|
gap: t,
|
|
243
243
|
message: e
|
|
244
244
|
}));
|
|
@@ -250,10 +250,10 @@ function R(e) {
|
|
|
250
250
|
V.value = !0;
|
|
251
251
|
let e = k.value;
|
|
252
252
|
if (e) {
|
|
253
|
-
let t = $.api.getCanonicalDocument() ??
|
|
254
|
-
k.value = t,
|
|
253
|
+
let t = $.api.getCanonicalDocument() ?? Nt.current?.snapshotDocument(e) ?? e;
|
|
254
|
+
k.value = t, Ze?.(U(t)), G.emit("docChange", U(t));
|
|
255
255
|
}
|
|
256
|
-
|
|
256
|
+
Ft.schedule();
|
|
257
257
|
}
|
|
258
258
|
if (e || t) {
|
|
259
259
|
O?.(n.state);
|
|
@@ -265,40 +265,40 @@ function R(e) {
|
|
|
265
265
|
}
|
|
266
266
|
}
|
|
267
267
|
});
|
|
268
|
-
|
|
268
|
+
Nt.current = Y;
|
|
269
269
|
let X = () => {
|
|
270
270
|
J.sync(), Y.sync();
|
|
271
271
|
};
|
|
272
272
|
u(() => l(d), X);
|
|
273
|
-
function
|
|
274
|
-
e.layout && (R.value = e.layout), e.blocks && (
|
|
273
|
+
function Pt(e) {
|
|
274
|
+
e.layout && (R.value = e.layout), e.blocks && (yt.value = e.blocks), e.measures && (bt.value = e.measures), e.blockLookup && Mt.setBlockLookup(e.blockLookup), e.layout && G.emit("layoutComplete", e.layout);
|
|
275
275
|
}
|
|
276
276
|
function Z(e, t = {}) {
|
|
277
277
|
if (M) return;
|
|
278
|
-
let n = a.value, r = n instanceof HTMLDivElement ? n : null, i = k.value, o = i?.package.document, s = o?.sections?.[0]?.properties ?? o?.finalSectionProperties ?? null, c =
|
|
278
|
+
let n = a.value, r = n instanceof HTMLDivElement ? n : null, i = k.value, o = i?.package.document, s = o?.sections?.[0]?.properties ?? o?.finalSectionProperties ?? null, c = y(s), u = te(s), d = mt(s), f = c.w - u.left - u.right, p = i?.package.styles ?? null, m = i?.package.theme ?? null, h = i?.package.settings?.defaultTabStop, g = i?.package.settings?.mirrorMargins === !0, x = He(i?.package);
|
|
279
279
|
try {
|
|
280
|
-
|
|
280
|
+
Pt(fe({
|
|
281
281
|
contentWidth: f,
|
|
282
282
|
columns: d,
|
|
283
283
|
pageSize: c,
|
|
284
284
|
margins: u,
|
|
285
|
-
pageGap:
|
|
286
|
-
showMarginGuides: l(
|
|
287
|
-
marginGuideColor: l(
|
|
285
|
+
pageGap: ee,
|
|
286
|
+
showMarginGuides: l(xe) === !0,
|
|
287
|
+
marginGuideColor: l(Se),
|
|
288
288
|
...(() => {
|
|
289
|
-
let e = l(
|
|
289
|
+
let e = l(_);
|
|
290
290
|
return e === void 0 ? {} : { pageRenderer: e };
|
|
291
291
|
})(),
|
|
292
292
|
syncCoordinator: K,
|
|
293
|
-
headerContent:
|
|
294
|
-
footerContent:
|
|
295
|
-
firstPageHeaderContent:
|
|
296
|
-
firstPageFooterContent:
|
|
297
|
-
headerContentRId:
|
|
298
|
-
footerContentRId:
|
|
299
|
-
firstPageHeaderContentRId:
|
|
300
|
-
firstPageFooterContentRId:
|
|
301
|
-
sectionHeaderFooterRefs:
|
|
293
|
+
headerContent: x.headerContent,
|
|
294
|
+
footerContent: x.footerContent,
|
|
295
|
+
firstPageHeaderContent: x.firstPageHeaderContent,
|
|
296
|
+
firstPageFooterContent: x.firstPageFooterContent,
|
|
297
|
+
headerContentRId: x.activeHeaderRId,
|
|
298
|
+
footerContentRId: x.activeFooterRId,
|
|
299
|
+
firstPageHeaderContentRId: x.activeFirstHeaderRId,
|
|
300
|
+
firstPageFooterContentRId: x.activeFirstFooterRId,
|
|
301
|
+
sectionHeaderFooterRefs: we(i),
|
|
302
302
|
theme: m,
|
|
303
303
|
sectionProperties: s,
|
|
304
304
|
document: i,
|
|
@@ -307,70 +307,70 @@ function R(e) {
|
|
|
307
307
|
styles: p,
|
|
308
308
|
layout: R.value,
|
|
309
309
|
hfPMs: J,
|
|
310
|
-
painter:
|
|
310
|
+
painter: Mt,
|
|
311
311
|
pagesContainer: r,
|
|
312
312
|
session: q,
|
|
313
|
-
renderHfFromContentOrPm:
|
|
314
|
-
renderHeaderFooterContentByRId:
|
|
315
|
-
readFontSetSignature:
|
|
316
|
-
buildFootnoteRenderItems:
|
|
317
|
-
describeInvalidHighlightMarks:
|
|
318
|
-
emptyTemplatePreviewEntries:
|
|
319
|
-
emptyTemplatePreviewHidden:
|
|
320
|
-
hyphenationReadiness:
|
|
321
|
-
markupView: l(
|
|
322
|
-
showCommentHighlights: l(
|
|
313
|
+
renderHfFromContentOrPm: ht,
|
|
314
|
+
renderHeaderFooterContentByRId: gt,
|
|
315
|
+
readFontSetSignature: ce,
|
|
316
|
+
buildFootnoteRenderItems: _t,
|
|
317
|
+
describeInvalidHighlightMarks: vt,
|
|
318
|
+
emptyTemplatePreviewEntries: ft,
|
|
319
|
+
emptyTemplatePreviewHidden: pt,
|
|
320
|
+
hyphenationReadiness: jt,
|
|
321
|
+
markupView: l(v),
|
|
322
|
+
showCommentHighlights: l(b)
|
|
323
323
|
}, e, t));
|
|
324
324
|
} catch (e) {
|
|
325
325
|
let t = e instanceof Error ? e : Error(String(e));
|
|
326
326
|
D?.(t);
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
|
-
let
|
|
329
|
+
let Ft = me({
|
|
330
330
|
readState: () => N.value?.state ?? null,
|
|
331
331
|
runLayout: (e, t) => Z(e, t),
|
|
332
|
-
...
|
|
333
|
-
clock:
|
|
334
|
-
}), Q = null,
|
|
335
|
-
function
|
|
332
|
+
...T,
|
|
333
|
+
clock: pe
|
|
334
|
+
}), Q = null, It = Fe();
|
|
335
|
+
function Lt() {
|
|
336
336
|
Q !== null && (window.clearTimeout(Q), Q = null);
|
|
337
337
|
let e = N.value, t = k.value;
|
|
338
|
-
if (
|
|
338
|
+
if (e && t) try {
|
|
339
339
|
let n = $.api.getCanonicalDocument();
|
|
340
340
|
if (!n && H()) return;
|
|
341
|
-
let r = n ??
|
|
342
|
-
k.value = r, X(),
|
|
341
|
+
let r = n ?? It.reconcile(Oe(e.state.doc, t, { stylesheetSource: { type: "package" } }), e.state.doc);
|
|
342
|
+
k.value = r, X(), Ze?.(U(r)), G.emit("docChange", U(r));
|
|
343
343
|
} catch (e) {
|
|
344
344
|
D?.(e instanceof Error ? e : Error(String(e)));
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
|
-
function
|
|
347
|
+
function Rt() {
|
|
348
348
|
Q !== null && window.clearTimeout(Q), Q = window.setTimeout(() => {
|
|
349
|
-
Q = null,
|
|
350
|
-
},
|
|
349
|
+
Q = null, Lt();
|
|
350
|
+
}, dt);
|
|
351
351
|
}
|
|
352
|
-
let $ =
|
|
352
|
+
let $ = m({
|
|
353
353
|
getHost: () => t.value,
|
|
354
354
|
getDocument: () => k.value,
|
|
355
355
|
getStyles: () => k.value?.package.styles ?? null,
|
|
356
356
|
getExtensionManager: () => W,
|
|
357
|
-
getExternalPlugins:
|
|
357
|
+
getExternalPlugins: At,
|
|
358
358
|
getCollaboration: () => l(E),
|
|
359
359
|
getCollaborationModules: () => F.value,
|
|
360
360
|
getPrecomputedInitialState: () => null,
|
|
361
361
|
getReadOnly: () => l(o),
|
|
362
362
|
getExperimentalSession: () => l(d),
|
|
363
|
-
getEditingMode: () => l(
|
|
364
|
-
getSuggestionAuthor:
|
|
363
|
+
getEditingMode: () => l(Ue) ?? "editing",
|
|
364
|
+
getSuggestionAuthor: ot,
|
|
365
365
|
onSessionRefusal: (e, t, n) => {
|
|
366
|
-
D?.(n ?? new
|
|
366
|
+
D?.(n ?? new f({
|
|
367
367
|
gap: t,
|
|
368
368
|
message: e
|
|
369
369
|
}));
|
|
370
370
|
},
|
|
371
371
|
getDocumentIdentity: () => String(A),
|
|
372
372
|
getDocumentContext: () => k.value,
|
|
373
|
-
onTransaction:
|
|
373
|
+
onTransaction: Bt,
|
|
374
374
|
onSelectionChange: (e) => {
|
|
375
375
|
P.value = e, O?.(e), G.emit("selectionChange", {
|
|
376
376
|
from: e.selection.from,
|
|
@@ -378,20 +378,20 @@ function R(e) {
|
|
|
378
378
|
});
|
|
379
379
|
},
|
|
380
380
|
onKeyDown: () => !1,
|
|
381
|
-
onCopy: () =>
|
|
382
|
-
onCut: () =>
|
|
383
|
-
onPaste: () =>
|
|
384
|
-
onReadOnlyEditAttempt: () =>
|
|
385
|
-
onEditorViewReady:
|
|
381
|
+
onCopy: () => $e?.(),
|
|
382
|
+
onCut: () => et?.(),
|
|
383
|
+
onPaste: () => tt?.(),
|
|
384
|
+
onReadOnlyEditAttempt: () => nt?.(),
|
|
385
|
+
onEditorViewReady: Vt,
|
|
386
386
|
onEditorViewDestroy: () => {
|
|
387
|
-
N.value = null, z.value = !1,
|
|
387
|
+
N.value = null, z.value = !1, Qe?.(null);
|
|
388
388
|
},
|
|
389
389
|
onRemoteSelectionsChange: (e) => {
|
|
390
390
|
I.value = e;
|
|
391
391
|
}
|
|
392
|
-
}),
|
|
392
|
+
}), zt = () => {
|
|
393
393
|
let e = l(E)?.awareness, t = F.value, n = $.getView();
|
|
394
|
-
I.value = e && t && n ?
|
|
394
|
+
I.value = e && t && n ? p(n.state, e, t) : [];
|
|
395
395
|
};
|
|
396
396
|
u(() => l(E), (e, t, n) => {
|
|
397
397
|
if (I.value = [], !e) {
|
|
@@ -401,8 +401,8 @@ function R(e) {
|
|
|
401
401
|
let r = !1;
|
|
402
402
|
n(() => {
|
|
403
403
|
r = !0;
|
|
404
|
-
}), F.value = null,
|
|
405
|
-
r || (F.value = e, $.retryViewCreation(), $.syncExternalDocument(),
|
|
404
|
+
}), F.value = null, ae().then((e) => {
|
|
405
|
+
r || (F.value = e, $.retryViewCreation(), $.syncExternalDocument(), zt());
|
|
406
406
|
}, (e) => {
|
|
407
407
|
r || (F.value = null, D?.(e instanceof Error ? e : Error(String(e))));
|
|
408
408
|
});
|
|
@@ -411,90 +411,87 @@ function R(e) {
|
|
|
411
411
|
modules: F.value,
|
|
412
412
|
view: N.value
|
|
413
413
|
}), ({ awareness: e, modules: t, view: n }, r, i) => {
|
|
414
|
-
|
|
415
|
-
I.value = [];
|
|
416
|
-
|
|
417
|
-
}
|
|
418
|
-
e.on("change", Rt), Rt(), i(() => {
|
|
419
|
-
e.off("change", Rt), I.value = [];
|
|
420
|
-
});
|
|
414
|
+
!e || !t || !n ? I.value = [] : (e.on("change", zt), zt(), i(() => {
|
|
415
|
+
e.off("change", zt), I.value = [];
|
|
416
|
+
}));
|
|
421
417
|
}, { flush: "post" });
|
|
422
|
-
function
|
|
418
|
+
function Bt({ newState: e, docChanged: t, transactions: n }) {
|
|
423
419
|
P.value = e;
|
|
424
420
|
let r = n[0]?.before;
|
|
425
|
-
if (t && r &&
|
|
421
|
+
if (t && r && It.noteBase(r), t) {
|
|
426
422
|
let e = $.api.getCanonicalDocument();
|
|
427
|
-
e && (k.value = e, X()), V.value = !0, K.incrementStateSeq(),
|
|
423
|
+
e && (k.value = e, X()), V.value = !0, K.incrementStateSeq(), Ft.schedule(), Rt();
|
|
428
424
|
}
|
|
429
425
|
K.requestRender();
|
|
430
426
|
}
|
|
431
|
-
function
|
|
427
|
+
function Vt(e) {
|
|
432
428
|
N.value = e, P.value = e.state, z.value = !0;
|
|
433
429
|
let t = k.value, n = A, r = ++j;
|
|
434
430
|
M = !0;
|
|
435
431
|
let i = () => {
|
|
436
|
-
j === r && (M = !1, !(
|
|
432
|
+
j === r && (M = !1, !(st || A !== n || $.getView() !== e) && (Z(e.state, { reason: "initial" }), K.requestRender()));
|
|
437
433
|
};
|
|
438
|
-
|
|
434
|
+
w(t, e.state.doc).then(i, i), Wt(e), Qe?.(e), l(o) || requestAnimationFrame(() => {
|
|
439
435
|
N.value === e && e.focus();
|
|
440
436
|
});
|
|
441
437
|
}
|
|
442
|
-
let
|
|
443
|
-
getDocx: async (e) => (await
|
|
444
|
-
loadDocument:
|
|
445
|
-
loadDocx:
|
|
446
|
-
},
|
|
438
|
+
let Ht = {
|
|
439
|
+
getDocx: async (e) => (await Zt(e))?.buffer ?? null,
|
|
440
|
+
loadDocument: Xt,
|
|
441
|
+
loadDocx: Yt
|
|
442
|
+
}, Ut = oe({
|
|
447
443
|
getEditorApi: () => $.api,
|
|
448
444
|
getLayout: () => R.value,
|
|
449
445
|
runLayout: (e, t) => Z(e, t),
|
|
450
|
-
getDocumentIO: () =>
|
|
446
|
+
getDocumentIO: () => Ht,
|
|
451
447
|
emitter: G
|
|
452
448
|
});
|
|
453
|
-
function
|
|
454
|
-
|
|
449
|
+
function Wt(e) {
|
|
450
|
+
let t = l(Ue) === "suggesting";
|
|
451
|
+
S(t, e.state, e.dispatch, ot());
|
|
455
452
|
}
|
|
456
|
-
u([() => l(
|
|
457
|
-
|
|
453
|
+
u([() => l(Ue), ot], () => {
|
|
454
|
+
Ut.setCanonicalMode(l(Ue) === "suggesting" ? {
|
|
458
455
|
type: "suggesting",
|
|
459
|
-
author:
|
|
456
|
+
author: ot()
|
|
460
457
|
} : { type: "editing" });
|
|
461
458
|
let e = N.value;
|
|
462
|
-
e &&
|
|
459
|
+
e && Wt(e);
|
|
463
460
|
for (let e of Y.listStories()) {
|
|
464
461
|
let t = Y.getView(e);
|
|
465
|
-
t &&
|
|
462
|
+
t && Wt(t);
|
|
466
463
|
}
|
|
467
464
|
}), u(() => l(o), (e) => {
|
|
468
|
-
$.syncEditable(), e &&
|
|
465
|
+
$.syncEditable(), e && an(), J.sync();
|
|
469
466
|
});
|
|
470
|
-
function
|
|
471
|
-
let t =
|
|
472
|
-
if (t === e.state.plugins.includes(
|
|
473
|
-
let n = e.state.plugins.filter((e) => e !==
|
|
467
|
+
function Gt(e) {
|
|
468
|
+
let t = kt();
|
|
469
|
+
if (t === e.state.plugins.includes(Et)) return;
|
|
470
|
+
let n = e.state.plugins.filter((e) => e !== Et && e !== Dt);
|
|
474
471
|
if (t) {
|
|
475
|
-
let e = n.indexOf(
|
|
476
|
-
n.splice(t, 0,
|
|
472
|
+
let e = n.indexOf(Ot), t = e === -1 ? n.length : e;
|
|
473
|
+
n.splice(t, 0, Et, Dt);
|
|
477
474
|
}
|
|
478
475
|
e.updateState(e.state.reconfigure({ plugins: n }));
|
|
479
476
|
}
|
|
480
|
-
u(() =>
|
|
477
|
+
u(() => kt(), () => {
|
|
481
478
|
let e = N.value;
|
|
482
|
-
e &&
|
|
479
|
+
e && Gt(e);
|
|
483
480
|
});
|
|
484
|
-
function Gt() {
|
|
485
|
-
$.ensureView();
|
|
486
|
-
}
|
|
487
481
|
function Kt() {
|
|
488
|
-
|
|
482
|
+
$.ensureView();
|
|
489
483
|
}
|
|
490
484
|
function qt() {
|
|
485
|
+
A += 1, V.value = !1, ct.value = null, L.value = null, Y.activate(null), Ft.dispose(), $.destroyView(), H() && $.ensureView(), X(), $.ensureView(), $.getView() || Jt();
|
|
486
|
+
}
|
|
487
|
+
function Jt() {
|
|
491
488
|
let e = k.value;
|
|
492
|
-
if (
|
|
493
|
-
let t =
|
|
489
|
+
if (e && !l(E)) try {
|
|
490
|
+
let t = h({
|
|
494
491
|
document: e,
|
|
495
492
|
styles: e.package.styles ?? null,
|
|
496
493
|
manager: W,
|
|
497
|
-
externalPlugins:
|
|
494
|
+
externalPlugins: At(),
|
|
498
495
|
collaborationModules: null,
|
|
499
496
|
reason: "mount"
|
|
500
497
|
});
|
|
@@ -502,9 +499,9 @@ function R(e) {
|
|
|
502
499
|
let n = A, r = ++j;
|
|
503
500
|
M = !0;
|
|
504
501
|
let i = () => {
|
|
505
|
-
j === r && (M = !1, !(
|
|
502
|
+
j === r && (M = !1, !(st || A !== n || k.value !== e || $.getView()) && Z(t, { reason: "initial" }));
|
|
506
503
|
};
|
|
507
|
-
|
|
504
|
+
w(e, t.doc).then(i, i);
|
|
508
505
|
} catch (e) {
|
|
509
506
|
D?.(e instanceof Error ? e : Error(String(e)));
|
|
510
507
|
}
|
|
@@ -512,86 +509,86 @@ function R(e) {
|
|
|
512
509
|
u([
|
|
513
510
|
t,
|
|
514
511
|
a,
|
|
515
|
-
|
|
512
|
+
at,
|
|
516
513
|
...r ? [r] : []
|
|
517
514
|
], () => {
|
|
518
|
-
t.value && k.value && !$.getView() &&
|
|
515
|
+
t.value && k.value && !$.getView() && Kt(), X();
|
|
519
516
|
}, { flush: "post" });
|
|
520
|
-
async function
|
|
517
|
+
async function Yt(e) {
|
|
521
518
|
B.value = null, z.value = !1;
|
|
522
519
|
try {
|
|
523
520
|
let t = e;
|
|
524
521
|
if (H()) {
|
|
525
|
-
let n = await
|
|
522
|
+
let n = await ye(e);
|
|
526
523
|
if (n.isErr()) throw n.error;
|
|
527
524
|
t = n.value;
|
|
528
525
|
}
|
|
529
|
-
let n = await
|
|
530
|
-
k.value = n,
|
|
526
|
+
let n = await be(t, { password: l(Ce) });
|
|
527
|
+
k.value = n, qt();
|
|
531
528
|
} catch (e) {
|
|
532
529
|
let t = e instanceof Error ? e : Error(String(e));
|
|
533
530
|
B.value = t.message, D?.(t);
|
|
534
531
|
}
|
|
535
532
|
}
|
|
536
|
-
function
|
|
537
|
-
B.value = null, k.value = e,
|
|
533
|
+
function Xt(e) {
|
|
534
|
+
B.value = null, k.value = e, It.reset(), qt();
|
|
538
535
|
}
|
|
539
|
-
async function
|
|
536
|
+
async function Zt(e) {
|
|
540
537
|
let t = N.value, n = k.value;
|
|
541
538
|
if (!t || !n) return null;
|
|
542
539
|
try {
|
|
543
540
|
let t = $.api.captureCanonicalSave();
|
|
544
541
|
if (t) {
|
|
545
|
-
let n = await
|
|
542
|
+
let n = await ve({
|
|
546
543
|
snapshot: t,
|
|
547
544
|
options: e,
|
|
548
|
-
featureFlags: l(
|
|
545
|
+
featureFlags: l(rt)
|
|
549
546
|
});
|
|
550
|
-
for (let t of n.diagnostics) e?.onDiagnostic || D?.(new
|
|
551
|
-
gap:
|
|
547
|
+
for (let t of n.diagnostics) e?.onDiagnostic || D?.(new _e({
|
|
548
|
+
gap: x.save,
|
|
552
549
|
diagnostic: t,
|
|
553
550
|
message: `Canonical save used a fidelity fallback: ${t.type} (${t.part}).`
|
|
554
551
|
}));
|
|
555
|
-
return n.tripwireResult &&
|
|
552
|
+
return n.tripwireResult && it?.(n.tripwireResult), n;
|
|
556
553
|
}
|
|
557
554
|
} catch (e) {
|
|
558
555
|
return D?.(e instanceof Error ? e : Error(String(e))), null;
|
|
559
556
|
}
|
|
560
557
|
if (H()) return null;
|
|
561
|
-
Q !== null &&
|
|
562
|
-
let r = Y.snapshotDocument(J.snapshotDocument(n)), i = t.state, a =
|
|
558
|
+
Q !== null && Lt();
|
|
559
|
+
let r = Y.snapshotDocument(J.snapshotDocument(n)), i = t.state, a = Ie(Oe(i.doc, r, { stylesheetSource: { type: "package" } })), { resolveSelectiveSaveFlags: o } = await import("@stll/folio-core/docx/selectiveSaveFlags"), s = o(l(rt)), c = a.originalBuffer ?? null, u = s.selectiveSave && e?.mode !== C.full, d = u || s.selectiveSaveTripwire, { repackDocx: f, createDocx: p } = await import("@stll/folio-core/docx/rezip"), m = null;
|
|
563
560
|
if (d && c) {
|
|
564
561
|
let { attemptSelectiveSave: e } = await import("@stll/folio-core/docx/selectiveSave");
|
|
565
|
-
|
|
566
|
-
changedParaIds:
|
|
567
|
-
structuralChange:
|
|
568
|
-
hasUntrackedChanges:
|
|
562
|
+
m = await e(a, c, {
|
|
563
|
+
changedParaIds: Ae(i),
|
|
564
|
+
structuralChange: je(i),
|
|
565
|
+
hasUntrackedChanges: Me(i),
|
|
569
566
|
maxBytes: s.selectiveSaveMaxBytes
|
|
570
567
|
});
|
|
571
568
|
}
|
|
572
|
-
let
|
|
569
|
+
let h = u ? m : null, g = null, ee = () => Ne({
|
|
573
570
|
state: i,
|
|
574
571
|
document: a,
|
|
575
|
-
repack: () =>
|
|
572
|
+
repack: () => f(a)
|
|
576
573
|
});
|
|
577
|
-
if (!
|
|
574
|
+
if (!h) g = c ? await ee() : await p(a), h = g;
|
|
578
575
|
else if (s.selectiveSaveTripwire) try {
|
|
579
|
-
|
|
576
|
+
g = await ee();
|
|
580
577
|
} catch {}
|
|
581
|
-
if (s.selectiveSaveTripwire &&
|
|
578
|
+
if (s.selectiveSaveTripwire && g && it) try {
|
|
582
579
|
let { compareSelectiveVsFull: e } = await import("@stll/folio-core/docx/selectiveSaveTripwire");
|
|
583
|
-
|
|
580
|
+
it(await e(m, g));
|
|
584
581
|
} catch {}
|
|
585
582
|
return {
|
|
586
|
-
buffer:
|
|
583
|
+
buffer: h,
|
|
587
584
|
document: a
|
|
588
585
|
};
|
|
589
586
|
}
|
|
590
|
-
async function
|
|
591
|
-
let t = N.value, n = t?.state, r = await
|
|
587
|
+
async function Qt(e) {
|
|
588
|
+
let t = N.value, n = t?.state, r = await Zt({ mode: e?.selective === !1 ? C.full : C.preferSelective });
|
|
592
589
|
return r ? (N.value === t && t?.state.doc === n?.doc && (r.version === void 0 || $.api.isCanonicalSaveCurrent(r.version)) && (k.value = r.document, X(), V.value = !1), new Blob([r.buffer], { type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" })) : null;
|
|
593
590
|
}
|
|
594
|
-
function
|
|
591
|
+
function $t() {
|
|
595
592
|
let e = $.api.getCanonicalDocument();
|
|
596
593
|
if (e) return e;
|
|
597
594
|
if (H()) return null;
|
|
@@ -600,186 +597,182 @@ function R(e) {
|
|
|
600
597
|
let n = $.api.getDocument() ?? t;
|
|
601
598
|
return U(Y.snapshotDocument(J.snapshotDocument(n)));
|
|
602
599
|
}
|
|
603
|
-
function $t(e) {
|
|
604
|
-
bt(f.modelEdits, "Direct document model changes are unavailable in this session.") || (k.value = e, X(), L.value && !Y.getView(L.value) && (L.value = null));
|
|
605
|
-
}
|
|
606
600
|
function en(e) {
|
|
601
|
+
xt(x.modelEdits, "Direct document model changes are unavailable in this session.") || (k.value = e, X(), L.value && !Y.getView(L.value) && (L.value = null));
|
|
602
|
+
}
|
|
603
|
+
function tn(e) {
|
|
607
604
|
return J.getView(e);
|
|
608
605
|
}
|
|
609
|
-
function
|
|
606
|
+
function nn() {
|
|
610
607
|
X();
|
|
611
608
|
}
|
|
612
|
-
function
|
|
609
|
+
function rn(e) {
|
|
613
610
|
let t = Y.activate(e);
|
|
614
|
-
t && (
|
|
611
|
+
t && (Wt(t), L.value = e, requestAnimationFrame(() => t.focus()));
|
|
615
612
|
}
|
|
616
|
-
function
|
|
613
|
+
function an() {
|
|
617
614
|
Y.activate(null), L.value = null;
|
|
618
615
|
}
|
|
619
|
-
function
|
|
616
|
+
function on() {
|
|
620
617
|
let e = L.value;
|
|
621
618
|
return e ? Y.getView(e) : null;
|
|
622
619
|
}
|
|
623
|
-
function
|
|
620
|
+
function sn() {
|
|
624
621
|
return W.getCommands();
|
|
625
622
|
}
|
|
626
|
-
function
|
|
627
|
-
let e =
|
|
623
|
+
function cn() {
|
|
624
|
+
let e = on();
|
|
628
625
|
e ? e.focus() : N.value?.focus();
|
|
629
626
|
}
|
|
630
|
-
function
|
|
627
|
+
function ln() {
|
|
631
628
|
let e = N.value;
|
|
632
629
|
e && Z(e.state, { reason: "manual" });
|
|
633
630
|
}
|
|
634
631
|
u([
|
|
635
|
-
() => l(
|
|
636
|
-
() => l(
|
|
637
|
-
() => l(
|
|
638
|
-
() => l(
|
|
639
|
-
() => l(
|
|
640
|
-
], () =>
|
|
641
|
-
function
|
|
642
|
-
|
|
643
|
-
}
|
|
644
|
-
return i(
|
|
632
|
+
() => l(xe),
|
|
633
|
+
() => l(Se),
|
|
634
|
+
() => l(_),
|
|
635
|
+
() => l(v),
|
|
636
|
+
() => l(b)
|
|
637
|
+
], () => ln());
|
|
638
|
+
function un() {
|
|
639
|
+
st = !0, a.value && Ee(a.value), j += 1, M = !1, Ft.dispose(), Q !== null && (window.clearTimeout(Q), Q = null), $.destroyView(), I.value = [], J.destroy(), Y.destroy(), W.destroy(), P.value = null, R.value = null, k.value = null, z.value = !1;
|
|
640
|
+
}
|
|
641
|
+
return i(un), {
|
|
645
642
|
setEmbeddedFontFamilies: (e) => {
|
|
646
|
-
|
|
647
|
-
q.embeddedFontFamilyMap = new Map(e);
|
|
648
|
-
return;
|
|
649
|
-
}
|
|
650
|
-
delete q.embeddedFontFamilyMap;
|
|
643
|
+
e ? q.embeddedFontFamilyMap = new Map(e) : delete q.embeddedFontFamilyMap;
|
|
651
644
|
},
|
|
652
|
-
editor:
|
|
645
|
+
editor: Ut,
|
|
653
646
|
editorView: N,
|
|
654
647
|
editorState: P,
|
|
655
648
|
remoteSelections: I,
|
|
656
|
-
headerFooterSelection:
|
|
649
|
+
headerFooterSelection: ct,
|
|
657
650
|
activeNoteStory: L,
|
|
658
651
|
isReady: z,
|
|
659
652
|
isDirty: V,
|
|
660
653
|
parseError: B,
|
|
661
654
|
layout: R,
|
|
662
|
-
blocks:
|
|
663
|
-
measures:
|
|
655
|
+
blocks: yt,
|
|
656
|
+
measures: bt,
|
|
664
657
|
syncCoordinator: K,
|
|
665
|
-
loadBuffer:
|
|
666
|
-
loadDocument:
|
|
667
|
-
save:
|
|
668
|
-
getDocument:
|
|
669
|
-
setDocument:
|
|
670
|
-
getHeaderFooterView:
|
|
671
|
-
syncHeaderFooterViews:
|
|
672
|
-
openNoteStory:
|
|
673
|
-
closeNoteStory:
|
|
674
|
-
getActiveNoteView:
|
|
675
|
-
getCommands:
|
|
676
|
-
focus:
|
|
677
|
-
reLayout:
|
|
678
|
-
destroy:
|
|
658
|
+
loadBuffer: Yt,
|
|
659
|
+
loadDocument: Xt,
|
|
660
|
+
save: Qt,
|
|
661
|
+
getDocument: $t,
|
|
662
|
+
setDocument: en,
|
|
663
|
+
getHeaderFooterView: tn,
|
|
664
|
+
syncHeaderFooterViews: nn,
|
|
665
|
+
openNoteStory: rn,
|
|
666
|
+
closeNoteStory: an,
|
|
667
|
+
getActiveNoteView: on,
|
|
668
|
+
getCommands: sn,
|
|
669
|
+
focus: cn,
|
|
670
|
+
reLayout: ln,
|
|
671
|
+
destroy: un
|
|
679
672
|
};
|
|
680
673
|
}
|
|
681
674
|
//#endregion
|
|
682
675
|
//#region src/composables/useFindReplace.ts
|
|
683
|
-
function
|
|
684
|
-
let g = new
|
|
676
|
+
function bt({ editorView: t, pagesRef: n, getDocument: r, layout: a, commentRoot: l, revealComment: d, displayMode: f, readOnly: p, onReadonlyEditAttempt: m, onResultChange: h }) {
|
|
677
|
+
let g = new Ue(), _ = s(""), v = s(""), te = o(qe()), y = c([]), b = s(-1), x = e(() => y.value.at(b.value) ?? null), ne = () => ee({
|
|
685
678
|
editingMode: t.value?.editable === !1 ? "viewing" : "editing",
|
|
686
679
|
readOnlyProp: p.value,
|
|
687
680
|
displayMode: f.value
|
|
688
681
|
}), re = e(ne), ie = e(() => {
|
|
689
|
-
let e =
|
|
690
|
-
return ne() === null && !!t.value && !!e &&
|
|
691
|
-
}),
|
|
682
|
+
let e = x.value;
|
|
683
|
+
return ne() === null && !!t.value && !!e && se() && Je(e).status === "allowed";
|
|
684
|
+
}), S = null, ae, C = null, oe = (e) => {
|
|
692
685
|
let n = t.value?.state.doc;
|
|
693
686
|
return {
|
|
694
687
|
query: _.value,
|
|
695
688
|
options: {
|
|
696
|
-
...
|
|
689
|
+
...te,
|
|
697
690
|
displayMode: f.value,
|
|
698
691
|
includeComments: !!l
|
|
699
692
|
},
|
|
700
693
|
document: e,
|
|
701
694
|
...n ? { bodyVersion: n } : {},
|
|
702
|
-
context: { renderedStories:
|
|
695
|
+
context: { renderedStories: E(a.value) }
|
|
703
696
|
};
|
|
704
|
-
},
|
|
697
|
+
}, se = () => {
|
|
705
698
|
let e = r();
|
|
706
|
-
return !!e &&
|
|
707
|
-
},
|
|
708
|
-
clearTimeout(
|
|
709
|
-
},
|
|
710
|
-
|
|
711
|
-
},
|
|
712
|
-
|
|
713
|
-
},
|
|
714
|
-
|
|
699
|
+
return !!e && Xe(C, Ye(oe(e)));
|
|
700
|
+
}, ce = () => g.getResult(), w = () => h(ce()), le = () => {
|
|
701
|
+
clearTimeout(ae), ae = void 0;
|
|
702
|
+
}, ue = () => {
|
|
703
|
+
le(), g.clear(), S?.destroy(), S = null, y.value = [], C = null, b.value = -1;
|
|
704
|
+
}, de = () => {
|
|
705
|
+
ue(), _.value = "", w();
|
|
706
|
+
}, fe = (e) => (b.value = e, S?.navigate(e, d), w(), !0), T = (e = "query") => {
|
|
707
|
+
le();
|
|
715
708
|
let i = r(), o = n.value, s = t.value?.state.doc;
|
|
716
|
-
if (!i || !_.value.trim()) return
|
|
717
|
-
let c = oe(i), u =
|
|
709
|
+
if (!i || !_.value.trim()) return de(), [];
|
|
710
|
+
let c = oe(i), u = We({
|
|
718
711
|
document: c.document,
|
|
719
712
|
state: t.value?.state ?? null,
|
|
720
713
|
searchText: c.query,
|
|
721
714
|
options: c.options,
|
|
722
715
|
context: c.context
|
|
723
716
|
});
|
|
724
|
-
if (u === null) return
|
|
725
|
-
let d =
|
|
726
|
-
return
|
|
717
|
+
if (u === null) return ue(), w(), [];
|
|
718
|
+
let d = Ye(c), f = e === "refresh" && C?.query === d.query, p = g.setMatches(u, f ? g.getResult()?.currentIndex ?? 0 : 0);
|
|
719
|
+
return C = d, y.value = u, b.value = u.length > 0 ? p.currentIndex : -1, S?.destroy(), S = o ? Ke({
|
|
727
720
|
container: o,
|
|
728
721
|
document: i,
|
|
729
722
|
bodyDoc: s,
|
|
730
723
|
matches: u,
|
|
731
724
|
commentRoot: l?.value ?? void 0,
|
|
732
725
|
layout: a.value
|
|
733
|
-
}) : null,
|
|
734
|
-
},
|
|
735
|
-
|
|
736
|
-
},
|
|
726
|
+
}) : null, S?.paint(b.value), u.at(0) && !f ? fe(0) : w(), u;
|
|
727
|
+
}, pe = () => {
|
|
728
|
+
le(), ae = setTimeout(() => T("refresh"), 120);
|
|
729
|
+
}, me = (e, t) => (_.value = e, Object.assign(te, qe(), t), T(), ce()), he = (e) => {
|
|
737
730
|
let t = g.goTo(e);
|
|
738
|
-
return t ?
|
|
739
|
-
},
|
|
731
|
+
return t ? fe(t.index) : !1;
|
|
732
|
+
}, ge = (e) => {
|
|
740
733
|
let t = g.navigate(e);
|
|
741
|
-
return t ? (
|
|
742
|
-
},
|
|
734
|
+
return t ? (fe(t.index), t.match) : null;
|
|
735
|
+
}, _e = () => !se() && (T("refresh"), !0), ve = () => {
|
|
743
736
|
let e = ne();
|
|
744
|
-
return e
|
|
737
|
+
return e !== null && (m?.(e), !0);
|
|
745
738
|
};
|
|
746
739
|
return u(f, () => {
|
|
747
|
-
_.value.trim() &&
|
|
740
|
+
_.value.trim() && T();
|
|
748
741
|
}), i(() => {
|
|
749
|
-
|
|
742
|
+
le(), S?.destroy();
|
|
750
743
|
}), {
|
|
751
744
|
searchText: _,
|
|
752
745
|
replaceText: v,
|
|
753
|
-
options:
|
|
746
|
+
options: te,
|
|
754
747
|
matches: y,
|
|
755
748
|
currentIndex: b,
|
|
756
|
-
currentMatch:
|
|
749
|
+
currentMatch: x,
|
|
757
750
|
canReplaceCurrent: ie,
|
|
758
751
|
replacementRefusal: re,
|
|
759
|
-
performSearch:
|
|
760
|
-
scheduleSearch:
|
|
761
|
-
find:
|
|
762
|
-
getFindResult:
|
|
763
|
-
goToMatch:
|
|
764
|
-
findNext: () =>
|
|
765
|
-
findPrevious: () =>
|
|
752
|
+
performSearch: T,
|
|
753
|
+
scheduleSearch: pe,
|
|
754
|
+
find: me,
|
|
755
|
+
getFindResult: ce,
|
|
756
|
+
goToMatch: he,
|
|
757
|
+
findNext: () => ge("next"),
|
|
758
|
+
findPrevious: () => ge("previous"),
|
|
766
759
|
replaceCurrent: () => {
|
|
767
760
|
let e = t.value;
|
|
768
|
-
if (!e ||
|
|
769
|
-
let n =
|
|
761
|
+
if (!e || ve() || _e()) return !1;
|
|
762
|
+
let n = x.value;
|
|
770
763
|
if (!ie.value || !e || !n) return !1;
|
|
771
764
|
if (n.text === v.value) return !0;
|
|
772
|
-
let r =
|
|
773
|
-
return r ? (e.dispatch(e.state.tr.insertText(v.value, r.from, r.to)),
|
|
765
|
+
let r = Ge(e.state.doc, n);
|
|
766
|
+
return r ? (e.dispatch(e.state.tr.insertText(v.value, r.from, r.to)), T("refresh"), !0) : !1;
|
|
774
767
|
},
|
|
775
768
|
replaceAll: () => {
|
|
776
769
|
let e = t.value, n = y.value.length;
|
|
777
|
-
if (!e ||
|
|
770
|
+
if (!e || ve() || _e()) return {
|
|
778
771
|
replacedCount: 0,
|
|
779
772
|
skippedCount: n
|
|
780
773
|
};
|
|
781
|
-
let r = y.value.filter((e) =>
|
|
782
|
-
let n =
|
|
774
|
+
let r = y.value.filter((e) => Je(e).status === "allowed"), i = r.filter((e) => e.text === v.value).length, a = r.filter((e) => e.text !== v.value).flatMap((t) => {
|
|
775
|
+
let n = Ge(e.state.doc, t);
|
|
783
776
|
return n ? [n] : [];
|
|
784
777
|
}).toSorted((e, t) => t.from - e.from), o = a.length + i, s = {
|
|
785
778
|
replacedCount: o,
|
|
@@ -788,12 +781,12 @@ function vt({ editorView: t, pagesRef: n, getDocument: r, layout: a, commentRoot
|
|
|
788
781
|
if (!a.length) return s;
|
|
789
782
|
let c = e.state.tr;
|
|
790
783
|
for (let e of a) c = c.insertText(v.value, e.from, e.to);
|
|
791
|
-
return e.dispatch(c),
|
|
784
|
+
return e.dispatch(c), T(), s;
|
|
792
785
|
},
|
|
793
|
-
clear:
|
|
786
|
+
clear: de
|
|
794
787
|
};
|
|
795
788
|
}
|
|
796
|
-
function
|
|
789
|
+
function z(e, t) {
|
|
797
790
|
if (t < e.top + 40) {
|
|
798
791
|
let n = Math.max(0, e.top + 40 - t);
|
|
799
792
|
return -Math.min(12, n / 40 * 12);
|
|
@@ -806,10 +799,10 @@ function yt(e, t) {
|
|
|
806
799
|
}
|
|
807
800
|
//#endregion
|
|
808
801
|
//#region src/composables/useDragAutoScroll.ts
|
|
809
|
-
function
|
|
802
|
+
function B({ pagesContainer: e, onScrollExtendSelection: t }) {
|
|
810
803
|
let n = null, r = 0, a = 0, o = !1;
|
|
811
804
|
function s() {
|
|
812
|
-
return
|
|
805
|
+
return _(e.value);
|
|
813
806
|
}
|
|
814
807
|
function c() {
|
|
815
808
|
o = !1, n !== null && (cancelAnimationFrame(n), n = null);
|
|
@@ -818,8 +811,8 @@ function z({ pagesContainer: e, onScrollExtendSelection: t }) {
|
|
|
818
811
|
if (!o) return;
|
|
819
812
|
let e = s();
|
|
820
813
|
if (!e) return;
|
|
821
|
-
let i =
|
|
822
|
-
i !== 0 && (
|
|
814
|
+
let i = z(e.getBoundingClientRect(), a);
|
|
815
|
+
i !== 0 && (v(e, i), t(r, a)), n = requestAnimationFrame(l);
|
|
823
816
|
}
|
|
824
817
|
function u() {
|
|
825
818
|
o || (o = !0, n = requestAnimationFrame(l));
|
|
@@ -839,7 +832,7 @@ function z({ pagesContainer: e, onScrollExtendSelection: t }) {
|
|
|
839
832
|
}
|
|
840
833
|
//#endregion
|
|
841
834
|
//#region src/composables/useTableResize.ts
|
|
842
|
-
function
|
|
835
|
+
function V() {
|
|
843
836
|
let e = {
|
|
844
837
|
active: !1,
|
|
845
838
|
startX: 0,
|
|
@@ -857,7 +850,8 @@ function B() {
|
|
|
857
850
|
rowIndex: 0,
|
|
858
851
|
isEdge: !1,
|
|
859
852
|
tablePmStart: 0,
|
|
860
|
-
origHeight: 0
|
|
853
|
+
origHeight: 0,
|
|
854
|
+
minimumHeight: D
|
|
861
855
|
}, n = {
|
|
862
856
|
active: !1,
|
|
863
857
|
startX: 0,
|
|
@@ -871,7 +865,7 @@ function B() {
|
|
|
871
865
|
}
|
|
872
866
|
function a(i, a) {
|
|
873
867
|
let o = i.target;
|
|
874
|
-
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),
|
|
868
|
+
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), H(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), U(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), xt(a, n), !0) : !1 : !1;
|
|
875
869
|
}
|
|
876
870
|
function o(r) {
|
|
877
871
|
if (e.active && e.handle) {
|
|
@@ -879,47 +873,39 @@ function B() {
|
|
|
879
873
|
let t = r.clientX - e.startX, n = parseFloat(e.handle.style.left);
|
|
880
874
|
e.handle.style.left = `${n + t}px`, e.startX = r.clientX;
|
|
881
875
|
let i = Math.round(t * O), a = e.origWidths.left + i, o = e.origWidths.right - i;
|
|
882
|
-
a >=
|
|
876
|
+
a >= Ze && o >= Ze && (e.origWidths = {
|
|
883
877
|
left: a,
|
|
884
878
|
right: o
|
|
885
879
|
});
|
|
886
|
-
|
|
887
|
-
}
|
|
888
|
-
if (t.active && t.handle) {
|
|
880
|
+
} else if (t.active && t.handle) {
|
|
889
881
|
r.preventDefault();
|
|
890
882
|
let e = r.clientY - t.startY, n = parseFloat(t.handle.style.top);
|
|
891
|
-
t.
|
|
892
|
-
let i = Math.round(e * O), a =
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
883
|
+
t.startY = r.clientY;
|
|
884
|
+
let i = Math.round(e * O), a = Qe({
|
|
885
|
+
currentHeight: t.origHeight,
|
|
886
|
+
delta: i,
|
|
887
|
+
minimumHeight: t.minimumHeight
|
|
888
|
+
});
|
|
889
|
+
t.handle.style.top = `${n + a / O}px`, t.origHeight += a;
|
|
890
|
+
} else if (n.active && n.handle) {
|
|
897
891
|
r.preventDefault();
|
|
898
892
|
let e = r.clientX - n.startX, t = parseFloat(n.handle.style.left);
|
|
899
893
|
n.handle.style.left = `${t + e}px`, n.startX = r.clientX;
|
|
900
894
|
let i = Math.round(e * O), a = n.origWidth + i;
|
|
901
|
-
a >=
|
|
895
|
+
a >= Ze && (n.origWidth = a);
|
|
902
896
|
}
|
|
903
897
|
}
|
|
904
898
|
function s(i) {
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
t.active = !1, t.handle?.classList.remove("dragging"), r && $e(r, {
|
|
916
|
-
pmStart: t.tablePmStart,
|
|
917
|
-
rowIdx: t.rowIndex,
|
|
918
|
-
newHeight: t.origHeight
|
|
919
|
-
}), t.handle = null;
|
|
920
|
-
return;
|
|
921
|
-
}
|
|
922
|
-
n.active && (n.active = !1, n.handle?.classList.remove("dragging"), r && Qe(r, {
|
|
899
|
+
e.active ? (e.active = !1, e.handle?.classList.remove("dragging"), r && $e(r, {
|
|
900
|
+
pmStart: e.tablePmStart,
|
|
901
|
+
colIdx: e.columnIndex,
|
|
902
|
+
newLeft: e.origWidths.left,
|
|
903
|
+
newRight: e.origWidths.right
|
|
904
|
+
}), e.handle = null) : t.active ? (t.active = !1, t.handle?.classList.remove("dragging"), r && tt(r, {
|
|
905
|
+
pmStart: t.tablePmStart,
|
|
906
|
+
rowIdx: t.rowIndex,
|
|
907
|
+
newHeight: t.origHeight
|
|
908
|
+
}), t.handle = null) : n.active && (n.active = !1, n.handle?.classList.remove("dragging"), r && et(r, {
|
|
923
909
|
pmStart: n.tablePmStart,
|
|
924
910
|
colIdx: n.columnIndex,
|
|
925
911
|
newWidth: n.origWidth
|
|
@@ -936,31 +922,31 @@ function B() {
|
|
|
936
922
|
isResizing: i
|
|
937
923
|
};
|
|
938
924
|
}
|
|
939
|
-
function
|
|
940
|
-
let n =
|
|
925
|
+
function H(e, t) {
|
|
926
|
+
let n = rt(e, t.tablePmStart, t.columnIndex);
|
|
941
927
|
n && (t.origWidths = n);
|
|
942
928
|
}
|
|
943
|
-
function
|
|
944
|
-
let r =
|
|
945
|
-
if (r != null)
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
t.
|
|
929
|
+
function U(e, t, n) {
|
|
930
|
+
let r = it(e, t.tablePmStart, t.rowIndex);
|
|
931
|
+
if (r != null) t.origHeight = r;
|
|
932
|
+
else {
|
|
933
|
+
let e = n.closest(".layout-table")?.querySelector(`[data-row-index="${t.rowIndex}"]`), r = e ? e.getBoundingClientRect().height : 30;
|
|
934
|
+
t.origHeight = Math.round(r * O);
|
|
935
|
+
}
|
|
936
|
+
t.minimumHeight = Math.min(D, t.origHeight);
|
|
951
937
|
}
|
|
952
|
-
function
|
|
953
|
-
let n =
|
|
938
|
+
function xt(e, t) {
|
|
939
|
+
let n = nt(e, t.tablePmStart, t.columnIndex);
|
|
954
940
|
n != null && (t.origWidth = n);
|
|
955
941
|
}
|
|
956
942
|
//#endregion
|
|
957
943
|
//#region src/composables/useTrackedChanges.ts
|
|
958
|
-
function
|
|
959
|
-
return e(() => (n.value,
|
|
944
|
+
function W(t, n) {
|
|
945
|
+
return e(() => (n.value, at(t.value?.state ?? null)));
|
|
960
946
|
}
|
|
961
947
|
//#endregion
|
|
962
948
|
//#region src/composables/useZoom.ts
|
|
963
|
-
var
|
|
949
|
+
var St = k, Ct = ot, wt = [
|
|
964
950
|
.5,
|
|
965
951
|
.75,
|
|
966
952
|
1,
|
|
@@ -968,16 +954,16 @@ var W = at, xt = it, St = [
|
|
|
968
954
|
1.5,
|
|
969
955
|
2
|
|
970
956
|
];
|
|
971
|
-
function
|
|
972
|
-
let i = s(Math.max(
|
|
957
|
+
function Tt(t = 1) {
|
|
958
|
+
let i = s(Math.max(St, Math.min(Ct, t))), a = e(() => Math.round(i.value * 100)), o = e(() => i.value <= St), c = e(() => i.value >= Ct);
|
|
973
959
|
function l(e) {
|
|
974
|
-
i.value = Math.max(
|
|
960
|
+
i.value = Math.max(St, Math.min(Ct, Math.round(e * 100) / 100));
|
|
975
961
|
}
|
|
976
962
|
function u() {
|
|
977
|
-
l(i.value +
|
|
963
|
+
l(i.value + A);
|
|
978
964
|
}
|
|
979
965
|
function d() {
|
|
980
|
-
l(i.value -
|
|
966
|
+
l(i.value - A);
|
|
981
967
|
}
|
|
982
968
|
function f() {
|
|
983
969
|
l(1);
|
|
@@ -1003,8 +989,8 @@ function Ct(t = 1) {
|
|
|
1003
989
|
handleWheel: p,
|
|
1004
990
|
handleKeyDown: m,
|
|
1005
991
|
installShortcuts: h,
|
|
1006
|
-
ZOOM_PRESETS:
|
|
992
|
+
ZOOM_PRESETS: wt
|
|
1007
993
|
};
|
|
1008
994
|
}
|
|
1009
995
|
//#endregion
|
|
1010
|
-
export {
|
|
996
|
+
export { B as a, ct as c, L as d, V as i, P as l, at as n, bt as o, W as r, yt as s, Tt as t, I as u };
|