@heyirisai/docx-editor-vue 1.9.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/LICENSE +201 -0
- package/README.md +116 -0
- package/dist/KeyboardShortcutsDialog-B0fEvXnH.js +2799 -0
- package/dist/KeyboardShortcutsDialog-Cmezq6eJ.cjs +1 -0
- package/dist/RenderedDomContext-CHc18N_2.js +2 -0
- package/dist/TablePropertiesDialog-B6ncvNnv.cjs +1 -0
- package/dist/TablePropertiesDialog-P_vyKNTn.js +1145 -0
- package/dist/_plugin-vue_export-helper-B52Kst-M.js +8 -0
- package/dist/_plugin-vue_export-helper-CX7YVcP6.cjs +1 -0
- package/dist/components/DocxEditor/types.d.ts +193 -0
- package/dist/components/EditorToolbarContext.d.ts +9 -0
- package/dist/components/Toolbar/presets.d.ts +20 -0
- package/dist/components/dialogs/index.d.ts +27 -0
- package/dist/components/imageContextMenuTypes.d.ts +30 -0
- package/dist/components/imageSelectionTypes.d.ts +14 -0
- package/dist/components/insertTableState.d.ts +9 -0
- package/dist/components/sidebar/cardStyles.d.ts +3 -0
- package/dist/components/sidebar/cardUtils.d.ts +1 -0
- package/dist/components/sidebar/resolveItemPositions.d.ts +4 -0
- package/dist/components/sidebar/sidebarUtils.d.ts +4 -0
- package/dist/components/tableStylePresets.d.ts +53 -0
- package/dist/components/toolbarUtils.d.ts +1 -0
- package/dist/components/ui/Icons.d.ts +1 -0
- package/dist/components/ui/fontPickerValue.d.ts +1 -0
- package/dist/components/ui/fontPickerValue.test.d.ts +1 -0
- package/dist/components/ui/hyperlinkPopupTypes.d.ts +20 -0
- package/dist/composables/fileOpen.test.d.ts +1 -0
- package/dist/composables/imageOverlayRect.d.ts +44 -0
- package/dist/composables/imageOverlayRect.test.d.ts +1 -0
- package/dist/composables/index.d.ts +30 -0
- package/dist/composables/useAutoSave.d.ts +40 -0
- package/dist/composables/useClipboard.d.ts +22 -0
- package/dist/composables/useColorMode.d.ts +8 -0
- package/dist/composables/useCommentLifecycle.d.ts +62 -0
- package/dist/composables/useCommentManagement.d.ts +68 -0
- package/dist/composables/useCommentSidebarItems.d.ts +24 -0
- package/dist/composables/useCommentSidebarItems.test.d.ts +1 -0
- package/dist/composables/useContextMenus.cut.test.d.ts +1 -0
- package/dist/composables/useContextMenus.d.ts +39 -0
- package/dist/composables/useControllableBoolean.d.ts +16 -0
- package/dist/composables/useControllableBoolean.test.d.ts +1 -0
- package/dist/composables/useDocumentLifecycle.d.ts +11 -0
- package/dist/composables/useDocxEditor.d.ts +96 -0
- package/dist/composables/useDocxEditorRefApi.d.ts +53 -0
- package/dist/composables/useDragAutoScroll.d.ts +11 -0
- package/dist/composables/useFileIO.d.ts +41 -0
- package/dist/composables/useFindReplace.d.ts +34 -0
- package/dist/composables/useFixedDropdown.d.ts +14 -0
- package/dist/composables/useFontLifecycle.d.ts +12 -0
- package/dist/composables/useFormattingActions.d.ts +31 -0
- package/dist/composables/useHistory.d.ts +9 -0
- package/dist/composables/useHostCallbacks.d.ts +7 -0
- package/dist/composables/useHyperlinkManagement.d.ts +38 -0
- package/dist/composables/useImageActions.d.ts +24 -0
- package/dist/composables/useKeyboardShortcuts.d.ts +25 -0
- package/dist/composables/useMenuActions.d.ts +26 -0
- package/dist/composables/useOutlineSidebar.d.ts +24 -0
- package/dist/composables/useOutlineSidebar.test.d.ts +1 -0
- package/dist/composables/usePageSetupControls.d.ts +22 -0
- package/dist/composables/usePagesPointer.d.ts +86 -0
- package/dist/composables/useParagraphStyleOptions.d.ts +18 -0
- package/dist/composables/usePortalClass.d.ts +8 -0
- package/dist/composables/useSelectionHighlight.d.ts +19 -0
- package/dist/composables/useSelectionSync.d.ts +36 -0
- package/dist/composables/useTableResize.d.ts +7 -0
- package/dist/composables/useTableSelection.d.ts +10 -0
- package/dist/composables/useToolbarDropdowns.d.ts +15 -0
- package/dist/composables/useToolbarFontSize.d.ts +15 -0
- package/dist/composables/useTrackedChanges.d.ts +12 -0
- package/dist/composables/useVisualLineNavigation.d.ts +11 -0
- package/dist/composables/useWatermarkControls.d.ts +15 -0
- package/dist/composables/useWheelZoom.d.ts +10 -0
- package/dist/composables/useZoom.d.ts +16 -0
- package/dist/composables.cjs +1 -0
- package/dist/composables.js +401 -0
- package/dist/dialogs.cjs +1 -0
- package/dist/dialogs.js +3 -0
- package/dist/docx-editor-vue.css +2 -0
- package/dist/i18n/LocaleContext.d.ts +1 -0
- package/dist/i18n/index.d.ts +26 -0
- package/dist/index.cjs +19 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +4449 -0
- package/dist/lib/utils.d.ts +10 -0
- package/dist/plugin-api/RenderedDomContext.d.ts +1 -0
- package/dist/plugin-api/index.d.ts +18 -0
- package/dist/plugin-api/types.d.ts +28 -0
- package/dist/plugin-api.cjs +1 -0
- package/dist/plugin-api.js +62 -0
- package/dist/renderAsync.d.ts +31 -0
- package/dist/styles/index.d.ts +12 -0
- package/dist/styles/zIndex.d.ts +24 -0
- package/dist/styles.cjs +1 -0
- package/dist/styles.js +5 -0
- package/dist/ui.cjs +18 -0
- package/dist/ui.d.ts +79 -0
- package/dist/ui.js +986 -0
- package/dist/useCommentSidebarItems-DBeGKNGA.cjs +1 -0
- package/dist/useCommentSidebarItems-DXbF857R.js +45 -0
- package/dist/useDragAutoScroll-CVltVfKK.js +520 -0
- package/dist/useDragAutoScroll-liP5PRvM.cjs +1 -0
- package/dist/usePortalClass-B9gFYxe0.cjs +4 -0
- package/dist/usePortalClass-HM-UHRlE.js +3534 -0
- package/dist/utils/domQueries.d.ts +39 -0
- package/dist/utils/imageClipboard.d.ts +9 -0
- package/dist/utils/refApiQueries.d.ts +10 -0
- package/dist/zIndex-CH0jZ7U7.cjs +1 -0
- package/dist/zIndex-CxELVe_L.js +12 -0
- package/package.json +119 -0
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
import { t as e } from "./useCommentSidebarItems-DXbF857R.js";
|
|
2
|
+
import { i as t, n, r, t as i } from "./useDragAutoScroll-CVltVfKK.js";
|
|
3
|
+
import { computed as a, onBeforeUnmount as o, onMounted as s, reactive as c, ref as l, unref as u, watch as d } from "vue";
|
|
4
|
+
import { DEFAULT_SELECTION_STYLE as f, areSelectionStylesInjected as p, copyRuns as m, getMergedSelectionRects as h, getSelectedText as g, hasActiveSelection as _, injectSelectionStyles as v, isSelectionWithin as y, parseClipboardHtml as b, runsToClipboardContent as x } from "@heyirisai/docx-editor-core/utils";
|
|
5
|
+
import { redo as S, redoDepth as C, undo as w, undoDepth as T } from "prosemirror-history";
|
|
6
|
+
import { extractTrackedChanges as E } from "@heyirisai/docx-editor-core/prosemirror/utils/extractTrackedChanges";
|
|
7
|
+
import { AutoSaveManager as D, createSelectionFromDOM as O, formatLastSaveTime as k, formatStorageSize as A, getAutoSaveStatusLabel as j, getAutoSaveStorageSize as M, getSelectionRuns as N, isAutoSaveSupported as P } from "@heyirisai/docx-editor-core";
|
|
8
|
+
import { createDefaultFindOptions as F } from "@heyirisai/docx-editor-core/utils/findReplace";
|
|
9
|
+
import { TableSelectionManager as I, findTableFromClick as L } from "@heyirisai/docx-editor-core/managers/TableSelectionManager";
|
|
10
|
+
import { createVisualLineState as R, findLineElementAtPosition as z, findPositionOnLineAtClientX as B, getCaretClientX as V, handleVisualLineKeyDown as H } from "@heyirisai/docx-editor-core/prosemirror/utils/visualLineNavigation";
|
|
11
|
+
//#region src/composables/useAutoSave.ts
|
|
12
|
+
function U(e, t = {}) {
|
|
13
|
+
let n = l("idle"), r = l(null), i = l(!1), a = l(!0), { storageKey: s, interval: c, enabled: f = !0, maxAge: p, onSave: m, onError: h, onRecoveryAvailable: g, saveOnChange: _, debounceDelay: v } = t;
|
|
14
|
+
if (!P()) return {
|
|
15
|
+
status: n,
|
|
16
|
+
lastSaveTime: r,
|
|
17
|
+
hasRecoveryData: i,
|
|
18
|
+
isEnabled: a,
|
|
19
|
+
save: async () => !1,
|
|
20
|
+
clearAutoSave: () => {},
|
|
21
|
+
getRecoveryData: () => null,
|
|
22
|
+
acceptRecovery: () => null,
|
|
23
|
+
dismissRecovery: () => {},
|
|
24
|
+
enable: () => {},
|
|
25
|
+
disable: () => {}
|
|
26
|
+
};
|
|
27
|
+
let y = new D({
|
|
28
|
+
storageKey: s,
|
|
29
|
+
interval: c,
|
|
30
|
+
maxAge: p,
|
|
31
|
+
saveOnChange: _,
|
|
32
|
+
debounceDelay: v,
|
|
33
|
+
onSave: m,
|
|
34
|
+
onError: h,
|
|
35
|
+
onRecoveryAvailable: g
|
|
36
|
+
}), b = () => {
|
|
37
|
+
let e = y.getSnapshot();
|
|
38
|
+
n.value = e.status, r.value = e.lastSaveTime, i.value = e.hasRecoveryData, a.value = e.isEnabled;
|
|
39
|
+
}, x = y.subscribe(b);
|
|
40
|
+
f ? y.enable() : y.disable(), b(), d(() => u(e), (e) => y.onDocumentChanged(e ?? null), { immediate: !0 });
|
|
41
|
+
function S() {
|
|
42
|
+
return y.save();
|
|
43
|
+
}
|
|
44
|
+
function C() {
|
|
45
|
+
y.clear();
|
|
46
|
+
}
|
|
47
|
+
function w() {
|
|
48
|
+
return y.getRecoveryData();
|
|
49
|
+
}
|
|
50
|
+
function T() {
|
|
51
|
+
return y.acceptRecovery();
|
|
52
|
+
}
|
|
53
|
+
function E() {
|
|
54
|
+
y.dismissRecovery();
|
|
55
|
+
}
|
|
56
|
+
function O() {
|
|
57
|
+
y.enable();
|
|
58
|
+
}
|
|
59
|
+
function k() {
|
|
60
|
+
y.disable();
|
|
61
|
+
}
|
|
62
|
+
return o(() => {
|
|
63
|
+
x(), y.destroy();
|
|
64
|
+
}), {
|
|
65
|
+
status: n,
|
|
66
|
+
lastSaveTime: r,
|
|
67
|
+
hasRecoveryData: i,
|
|
68
|
+
isEnabled: a,
|
|
69
|
+
save: S,
|
|
70
|
+
clearAutoSave: C,
|
|
71
|
+
getRecoveryData: w,
|
|
72
|
+
acceptRecovery: T,
|
|
73
|
+
dismissRecovery: E,
|
|
74
|
+
enable: O,
|
|
75
|
+
disable: k
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
//#endregion
|
|
79
|
+
//#region src/composables/useClipboard.ts
|
|
80
|
+
function W(e = {}) {
|
|
81
|
+
let { onCopy: t, onCut: n, onPaste: r, cleanWordFormatting: i = !0, editable: a = !0, onError: o, theme: s } = e, c = l(!1), u = l(null);
|
|
82
|
+
async function d(e) {
|
|
83
|
+
if (c.value) return !1;
|
|
84
|
+
c.value = !0;
|
|
85
|
+
try {
|
|
86
|
+
let n = await m(e.runs, {
|
|
87
|
+
onError: o,
|
|
88
|
+
theme: s
|
|
89
|
+
});
|
|
90
|
+
return n && t?.(e), n;
|
|
91
|
+
} finally {
|
|
92
|
+
c.value = !1;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
async function f(e) {
|
|
96
|
+
if (c.value || !a) return !1;
|
|
97
|
+
c.value = !0;
|
|
98
|
+
try {
|
|
99
|
+
let t = await m(e.runs, {
|
|
100
|
+
onError: o,
|
|
101
|
+
theme: s
|
|
102
|
+
});
|
|
103
|
+
return t && n?.(e), t;
|
|
104
|
+
} finally {
|
|
105
|
+
c.value = !1;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
async function p(e = !1) {
|
|
109
|
+
if (c.value || !a) return null;
|
|
110
|
+
c.value = !0;
|
|
111
|
+
try {
|
|
112
|
+
if (navigator.clipboard && navigator.clipboard.read) {
|
|
113
|
+
let t = await navigator.clipboard.read(), n = "", a = "";
|
|
114
|
+
for (let e of t) e.types.includes("text/html") && (n = await (await e.getType("text/html")).text()), e.types.includes("text/plain") && (a = await (await e.getType("text/plain")).text());
|
|
115
|
+
e && (n = "");
|
|
116
|
+
let o = b(n, a, i);
|
|
117
|
+
return u.value = o, r?.(o, e), o;
|
|
118
|
+
}
|
|
119
|
+
return null;
|
|
120
|
+
} catch (e) {
|
|
121
|
+
return o?.(e instanceof Error ? e : Error(String(e))), null;
|
|
122
|
+
} finally {
|
|
123
|
+
c.value = !1;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return {
|
|
127
|
+
copy: d,
|
|
128
|
+
cut: f,
|
|
129
|
+
paste: p,
|
|
130
|
+
isProcessing: c,
|
|
131
|
+
lastPastedContent: u
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
//#endregion
|
|
135
|
+
//#region src/composables/useFindReplace.ts
|
|
136
|
+
function G(e = {}) {
|
|
137
|
+
let t = c({
|
|
138
|
+
isOpen: !1,
|
|
139
|
+
searchText: "",
|
|
140
|
+
replaceText: "",
|
|
141
|
+
options: F(),
|
|
142
|
+
matches: [],
|
|
143
|
+
currentIndex: 0,
|
|
144
|
+
replaceMode: e.initialReplaceMode ?? !1
|
|
145
|
+
});
|
|
146
|
+
function n(e) {
|
|
147
|
+
t.isOpen = !0, t.replaceMode = !1, e && (t.searchText = e), t.matches = [], t.currentIndex = 0;
|
|
148
|
+
}
|
|
149
|
+
function r(e) {
|
|
150
|
+
t.isOpen = !0, t.replaceMode = !0, e && (t.searchText = e), t.matches = [], t.currentIndex = 0;
|
|
151
|
+
}
|
|
152
|
+
function i() {
|
|
153
|
+
t.isOpen = !1;
|
|
154
|
+
}
|
|
155
|
+
function o() {
|
|
156
|
+
t.isOpen = !t.isOpen;
|
|
157
|
+
}
|
|
158
|
+
function s(e) {
|
|
159
|
+
t.searchText = e;
|
|
160
|
+
}
|
|
161
|
+
function l(e) {
|
|
162
|
+
t.replaceText = e;
|
|
163
|
+
}
|
|
164
|
+
function u(e) {
|
|
165
|
+
t.options = {
|
|
166
|
+
...t.options,
|
|
167
|
+
...e
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
function d(n, r = 0) {
|
|
171
|
+
let i = Math.max(0, Math.min(r, n.length - 1));
|
|
172
|
+
t.matches = n, t.currentIndex = n.length > 0 ? i : 0, e.onMatchesChange?.(n), n.length > 0 ? e.onCurrentMatchChange?.(n[i], i) : e.onCurrentMatchChange?.(null, -1);
|
|
173
|
+
}
|
|
174
|
+
function f() {
|
|
175
|
+
return t.matches.length === 0 ? 0 : (t.currentIndex = (t.currentIndex + 1) % t.matches.length, t.currentIndex);
|
|
176
|
+
}
|
|
177
|
+
function p() {
|
|
178
|
+
return t.matches.length === 0 ? 0 : (t.currentIndex = t.currentIndex === 0 ? t.matches.length - 1 : t.currentIndex - 1, t.currentIndex);
|
|
179
|
+
}
|
|
180
|
+
function m(e) {
|
|
181
|
+
t.matches.length === 0 || e < 0 || e >= t.matches.length || (t.currentIndex = e);
|
|
182
|
+
}
|
|
183
|
+
return {
|
|
184
|
+
state: t,
|
|
185
|
+
currentMatch: a(() => t.matches.length === 0 ? null : t.matches[t.currentIndex] ?? null),
|
|
186
|
+
hasMatches: a(() => t.matches.length > 0),
|
|
187
|
+
openFind: n,
|
|
188
|
+
openReplace: r,
|
|
189
|
+
close: i,
|
|
190
|
+
toggle: o,
|
|
191
|
+
setSearchText: s,
|
|
192
|
+
setReplaceText: l,
|
|
193
|
+
setOptions: u,
|
|
194
|
+
setMatches: d,
|
|
195
|
+
goToNextMatch: f,
|
|
196
|
+
goToPreviousMatch: p,
|
|
197
|
+
goToMatch: m
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
//#endregion
|
|
201
|
+
//#region src/composables/useFixedDropdown.ts
|
|
202
|
+
function K({ isOpen: e, onClose: t, align: n = "left" }) {
|
|
203
|
+
let r = l(null), i = l(null), a = l({
|
|
204
|
+
position: "fixed",
|
|
205
|
+
top: "0px",
|
|
206
|
+
left: "0px",
|
|
207
|
+
zIndex: 1e4
|
|
208
|
+
});
|
|
209
|
+
function s(e, t) {
|
|
210
|
+
a.value = {
|
|
211
|
+
position: "fixed",
|
|
212
|
+
top: e + "px",
|
|
213
|
+
left: t + "px",
|
|
214
|
+
zIndex: 1e4
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
function c(e) {
|
|
218
|
+
let n = e.target;
|
|
219
|
+
r.value && !r.value.contains(n) && i.value && !i.value.contains(n) && t();
|
|
220
|
+
}
|
|
221
|
+
function u(e) {
|
|
222
|
+
e.key === "Escape" && t();
|
|
223
|
+
}
|
|
224
|
+
function f(e) {
|
|
225
|
+
let n = e.target;
|
|
226
|
+
n && i.value && i.value.contains(n) || t();
|
|
227
|
+
}
|
|
228
|
+
function p() {
|
|
229
|
+
document.addEventListener("mousedown", c), document.addEventListener("keydown", u), window.addEventListener("scroll", f, !0);
|
|
230
|
+
}
|
|
231
|
+
function m() {
|
|
232
|
+
document.removeEventListener("mousedown", c), document.removeEventListener("keydown", u), window.removeEventListener("scroll", f, !0);
|
|
233
|
+
}
|
|
234
|
+
d(e, (e) => {
|
|
235
|
+
if (!e) {
|
|
236
|
+
m();
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
let t = r.value;
|
|
240
|
+
if (!t) return;
|
|
241
|
+
let a = t.getBoundingClientRect();
|
|
242
|
+
n === "right" ? requestAnimationFrame(() => {
|
|
243
|
+
let e = i.value;
|
|
244
|
+
if (e) {
|
|
245
|
+
let t = e.getBoundingClientRect();
|
|
246
|
+
s(a.bottom + 4, a.right - t.width);
|
|
247
|
+
} else s(a.bottom + 4, a.left);
|
|
248
|
+
}) : s(a.bottom + 4, a.left), p();
|
|
249
|
+
}), o(m);
|
|
250
|
+
function h(e) {
|
|
251
|
+
e.preventDefault(), e.stopPropagation();
|
|
252
|
+
}
|
|
253
|
+
return {
|
|
254
|
+
containerRef: r,
|
|
255
|
+
dropdownRef: i,
|
|
256
|
+
dropdownStyle: a,
|
|
257
|
+
handleMouseDown: h
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
//#endregion
|
|
261
|
+
//#region src/composables/useHistory.ts
|
|
262
|
+
function q(e, t) {
|
|
263
|
+
let n = a(() => {
|
|
264
|
+
t.value;
|
|
265
|
+
let n = e.value;
|
|
266
|
+
return n ? T(n.state) > 0 : !1;
|
|
267
|
+
}), r = a(() => {
|
|
268
|
+
t.value;
|
|
269
|
+
let n = e.value;
|
|
270
|
+
return n ? C(n.state) > 0 : !1;
|
|
271
|
+
});
|
|
272
|
+
function i() {
|
|
273
|
+
let t = e.value;
|
|
274
|
+
return t ? w(t.state, t.dispatch) : !1;
|
|
275
|
+
}
|
|
276
|
+
function o() {
|
|
277
|
+
let t = e.value;
|
|
278
|
+
return t ? S(t.state, t.dispatch) : !1;
|
|
279
|
+
}
|
|
280
|
+
return {
|
|
281
|
+
canUndo: n,
|
|
282
|
+
canRedo: r,
|
|
283
|
+
undo: i,
|
|
284
|
+
redo: o
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
//#endregion
|
|
288
|
+
//#region src/composables/useSelectionHighlight.ts
|
|
289
|
+
function J(e) {
|
|
290
|
+
let { containerRef: t, enabled: n = !0, config: r = f, useOverlay: i = !1, debounceMs: c = 16, onSelectionChange: u } = e, m = l(!1), b = l(""), x = l([]), S = l(!1), C = null, w = 0;
|
|
291
|
+
function T() {
|
|
292
|
+
let e = t.value, n = _(), r = g(), a = e ? y(e) : !1;
|
|
293
|
+
m.value = n, b.value = r, S.value = a, x.value = i && a && e ? h(e) : [], u?.(n && a, r);
|
|
294
|
+
}
|
|
295
|
+
function E() {
|
|
296
|
+
T();
|
|
297
|
+
}
|
|
298
|
+
function D() {
|
|
299
|
+
let e = performance.now();
|
|
300
|
+
if (e - w < c) {
|
|
301
|
+
C && clearTimeout(C), C = setTimeout(() => {
|
|
302
|
+
w = performance.now(), T(), C = null;
|
|
303
|
+
}, c);
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
w = e, T();
|
|
307
|
+
}
|
|
308
|
+
function O(e) {
|
|
309
|
+
return {
|
|
310
|
+
position: "absolute",
|
|
311
|
+
left: e.left + "px",
|
|
312
|
+
top: e.top + "px",
|
|
313
|
+
width: e.width + "px",
|
|
314
|
+
height: e.height + "px",
|
|
315
|
+
backgroundColor: r.backgroundColor,
|
|
316
|
+
borderRadius: r.borderRadius ? r.borderRadius + "px" : void 0,
|
|
317
|
+
border: r.borderColor ? `1px solid ${r.borderColor}` : void 0,
|
|
318
|
+
zIndex: r.zIndex ?? 0,
|
|
319
|
+
pointerEvents: "none"
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
return s(() => {
|
|
323
|
+
n && (p() || v(r), document.addEventListener("selectionchange", D));
|
|
324
|
+
}), o(() => {
|
|
325
|
+
document.removeEventListener("selectionchange", D), C && clearTimeout(C);
|
|
326
|
+
}), d(t, () => T()), {
|
|
327
|
+
hasSelection: a(() => m.value),
|
|
328
|
+
selectedText: a(() => b.value),
|
|
329
|
+
highlightRects: a(() => x.value),
|
|
330
|
+
isSelectionInContainer: a(() => S.value),
|
|
331
|
+
refresh: E,
|
|
332
|
+
getOverlayStyle: O
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
//#endregion
|
|
336
|
+
//#region src/composables/useTableSelection.ts
|
|
337
|
+
function Y() {
|
|
338
|
+
let e = new I(), t = l(null), n = () => {
|
|
339
|
+
t.value = e.getSnapshot().selectedCell;
|
|
340
|
+
}, r = e.subscribe(n);
|
|
341
|
+
n(), o(() => {
|
|
342
|
+
r();
|
|
343
|
+
});
|
|
344
|
+
function i(t, n, r) {
|
|
345
|
+
e.selectCell({
|
|
346
|
+
tableIndex: t,
|
|
347
|
+
rowIndex: n,
|
|
348
|
+
columnIndex: r
|
|
349
|
+
});
|
|
350
|
+
}
|
|
351
|
+
function a(t, n) {
|
|
352
|
+
let r = L(t, n);
|
|
353
|
+
r ? e.selectCell(r) : e.clearSelection();
|
|
354
|
+
}
|
|
355
|
+
function s() {
|
|
356
|
+
e.clearSelection();
|
|
357
|
+
}
|
|
358
|
+
function c(t, n, r) {
|
|
359
|
+
return e.isCellSelected(t, n, r);
|
|
360
|
+
}
|
|
361
|
+
return {
|
|
362
|
+
selectedCell: t,
|
|
363
|
+
handleCellClick: i,
|
|
364
|
+
handleClickTarget: a,
|
|
365
|
+
clearSelection: s,
|
|
366
|
+
isCellSelected: c
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
//#endregion
|
|
370
|
+
//#region src/composables/useTrackedChanges.ts
|
|
371
|
+
function X(e, t) {
|
|
372
|
+
return a(() => (t.value, E(e.value?.state ?? null)));
|
|
373
|
+
}
|
|
374
|
+
//#endregion
|
|
375
|
+
//#region src/composables/useVisualLineNavigation.ts
|
|
376
|
+
function Z(e) {
|
|
377
|
+
let t = R();
|
|
378
|
+
function n(t) {
|
|
379
|
+
let n = e.value;
|
|
380
|
+
return n ? V(n, t) : null;
|
|
381
|
+
}
|
|
382
|
+
function r(t) {
|
|
383
|
+
let n = e.value;
|
|
384
|
+
return n ? z(n, t) : null;
|
|
385
|
+
}
|
|
386
|
+
function i(e, t) {
|
|
387
|
+
return B(e, t);
|
|
388
|
+
}
|
|
389
|
+
function a(n, r) {
|
|
390
|
+
return H(t, n, r, e.value);
|
|
391
|
+
}
|
|
392
|
+
return {
|
|
393
|
+
state: t,
|
|
394
|
+
getCaretClientX: n,
|
|
395
|
+
findLineElementAtPosition: r,
|
|
396
|
+
findPositionOnLineAtClientX: i,
|
|
397
|
+
handlePMKeyDown: a
|
|
398
|
+
};
|
|
399
|
+
}
|
|
400
|
+
//#endregion
|
|
401
|
+
export { O as createSelectionFromDOM, E as extractTrackedChanges, k as formatLastSaveTime, A as formatStorageSize, j as getAutoSaveStatusLabel, M as getAutoSaveStorageSize, N as getSelectionRuns, P as isAutoSaveSupported, x as runsToClipboardContent, U as useAutoSave, W as useClipboard, e as useCommentSidebarItems, t as useDocxEditor, i as useDragAutoScroll, G as useFindReplace, K as useFixedDropdown, q as useHistory, J as useSelectionHighlight, n as useTableResize, Y as useTableSelection, X as useTrackedChanges, Z as useVisualLineNavigation, r as useWheelZoom, r as useZoom };
|
package/dist/dialogs.cjs
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./KeyboardShortcutsDialog-Cmezq6eJ.cjs`),t=require(`./TablePropertiesDialog-B6ncvNnv.cjs`);exports.FindReplaceDialog=e.o,exports.FootnotePropertiesDialog=t.s,exports.HyperlinkDialog=e.a,exports.ImagePositionDialog=t.o,exports.ImagePropertiesDialog=e.r,exports.InsertImageDialog=t.a,exports.InsertSymbolDialog=e.i,exports.InsertTableDialog=t.i,exports.KeyboardShortcutsDialog=e.t,exports.PageSetupDialog=e.n,exports.PasteSpecialDialog=t.r,exports.SplitCellDialog=t.n,exports.TablePropertiesDialog=t.t;
|
package/dist/dialogs.js
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, t as a } from "./KeyboardShortcutsDialog-B0fEvXnH.js";
|
|
2
|
+
import { a as o, i as s, n as c, o as l, r as u, s as d, t as f } from "./TablePropertiesDialog-P_vyKNTn.js";
|
|
3
|
+
export { r as FindReplaceDialog, d as FootnotePropertiesDialog, e as HyperlinkDialog, l as ImagePositionDialog, i as ImagePropertiesDialog, o as InsertImageDialog, t as InsertSymbolDialog, s as InsertTableDialog, a as KeyboardShortcutsDialog, n as PageSetupDialog, u as PasteSpecialDialog, c as SplitCellDialog, f as TablePropertiesDialog };
|