@eigenpal/docx-editor-vue 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{KeyboardShortcutsDialog-5ZsgieYf.js → KeyboardShortcutsDialog-00eb4Ova.js} +23 -0
- package/dist/KeyboardShortcutsDialog-EW9K4wuO.cjs +1 -0
- package/dist/MenuBar-DeogoqFP.js +3330 -0
- package/dist/MenuBar-bU4-4dnA.cjs +4 -0
- package/dist/{TablePropertiesDialog-DTCcLpPC.cjs → TablePropertiesDialog-BZLpFAkg.cjs} +1 -1
- package/dist/{TablePropertiesDialog-PR4ftalH.js → TablePropertiesDialog-CBTvM4Xy.js} +1 -1
- package/dist/composables/useMenuActions.d.ts +1 -0
- package/dist/composables/useSelectionSync.d.ts +16 -0
- package/dist/composables/useWatermarkControls.d.ts +15 -0
- package/dist/composables.cjs +1 -1
- package/dist/composables.js +102 -143
- package/dist/dialogs.cjs +1 -1
- package/dist/dialogs.js +2 -2
- package/dist/docx-editor-vue.css +1 -1
- package/dist/index.cjs +10 -10
- package/dist/index.js +1328 -955
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +3 -3
- package/dist/useCommentSidebarItems-BHomCzpj.js +44 -0
- package/dist/useCommentSidebarItems-CbNvNCd3.cjs +1 -0
- package/dist/useTableResize-DBpEiuGQ.cjs +1 -0
- package/dist/{useTableResize-BcBdSaOE.js → useTableResize-uq2ksRDf.js} +118 -114
- package/dist/utils/domQueries.d.ts +17 -6
- package/package.json +4 -4
- package/dist/KeyboardShortcutsDialog-DiG-tfJT.cjs +0 -1
- package/dist/MenuBar-DLXxthZk.js +0 -3365
- package/dist/MenuBar-De3YJFpj.cjs +0 -4
- package/dist/useTableResize-DTag4SY0.cjs +0 -1
package/dist/composables.js
CHANGED
|
@@ -1,20 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { DEFAULT_SELECTION_STYLE as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
1
|
+
import { t as e } from "./useCommentSidebarItems-BHomCzpj.js";
|
|
2
|
+
import { n as t, r as n, t as r } from "./useTableResize-uq2ksRDf.js";
|
|
3
|
+
import { computed as i, onBeforeUnmount as a, onMounted as o, reactive as s, ref as c, unref as l, watch as u } from "vue";
|
|
4
|
+
import { DEFAULT_SELECTION_STYLE as d, areSelectionStylesInjected as f, copyRuns as p, getMergedSelectionRects as m, getSelectedText as h, hasActiveSelection as g, injectSelectionStyles as _, isSelectionWithin as v, parseClipboardHtml as y, runsToClipboardContent as b } from "@eigenpal/docx-editor-core/utils";
|
|
5
|
+
import { redo as x, redoDepth as S, undo as C, undoDepth as w } from "prosemirror-history";
|
|
6
|
+
import { extractTrackedChanges as T } from "@eigenpal/docx-editor-core/prosemirror/utils/extractTrackedChanges";
|
|
7
|
+
import { AutoSaveManager as E, createSelectionFromDOM as D, formatLastSaveTime as O, formatStorageSize as k, getAutoSaveStatusLabel as A, getAutoSaveStorageSize as j, getSelectionRuns as M, isAutoSaveSupported as N } from "@eigenpal/docx-editor-core";
|
|
8
|
+
import { findVerticalScrollParent as P } from "@eigenpal/docx-editor-core/utils/findVerticalScrollParent";
|
|
9
|
+
import { createDefaultFindOptions as F } from "@eigenpal/docx-editor-core/utils/findReplace";
|
|
10
|
+
import { TableSelectionManager as I, findTableFromClick as L } from "@eigenpal/docx-editor-core/managers/TableSelectionManager";
|
|
11
|
+
import { createVisualLineState as R, findLineElementAtPosition as z, findPositionOnLineAtClientX as B, getCaretClientX as V, handleVisualLineKeyDown as H } from "@eigenpal/docx-editor-core/prosemirror/utils/visualLineNavigation";
|
|
11
12
|
//#region src/composables/useAutoSave.ts
|
|
12
|
-
function
|
|
13
|
-
let n =
|
|
14
|
-
if (!
|
|
13
|
+
function U(e, t = {}) {
|
|
14
|
+
let n = c("idle"), r = c(null), i = c(!1), o = c(!0), { storageKey: s, interval: d, enabled: f = !0, maxAge: p, onSave: m, onError: h, onRecoveryAvailable: g, saveOnChange: _, debounceDelay: v } = t;
|
|
15
|
+
if (!N()) return {
|
|
15
16
|
status: n,
|
|
16
17
|
lastSaveTime: r,
|
|
17
|
-
hasRecoveryData:
|
|
18
|
+
hasRecoveryData: i,
|
|
18
19
|
isEnabled: o,
|
|
19
20
|
save: async () => !1,
|
|
20
21
|
clearAutoSave: () => {},
|
|
@@ -24,8 +25,8 @@ function H(e, t = {}) {
|
|
|
24
25
|
enable: () => {},
|
|
25
26
|
disable: () => {}
|
|
26
27
|
};
|
|
27
|
-
let y = new
|
|
28
|
-
storageKey:
|
|
28
|
+
let y = new E({
|
|
29
|
+
storageKey: s,
|
|
29
30
|
interval: d,
|
|
30
31
|
maxAge: p,
|
|
31
32
|
saveOnChange: _,
|
|
@@ -35,9 +36,9 @@ function H(e, t = {}) {
|
|
|
35
36
|
onRecoveryAvailable: g
|
|
36
37
|
}), b = () => {
|
|
37
38
|
let e = y.getSnapshot();
|
|
38
|
-
n.value = e.status, r.value = e.lastSaveTime,
|
|
39
|
+
n.value = e.status, r.value = e.lastSaveTime, i.value = e.hasRecoveryData, o.value = e.isEnabled;
|
|
39
40
|
}, x = y.subscribe(b);
|
|
40
|
-
f ? y.enable() : y.disable(), b(),
|
|
41
|
+
f ? y.enable() : y.disable(), b(), u(() => l(e), (e) => y.onDocumentChanged(e ?? null), { immediate: !0 });
|
|
41
42
|
function S() {
|
|
42
43
|
return y.save();
|
|
43
44
|
}
|
|
@@ -47,7 +48,7 @@ function H(e, t = {}) {
|
|
|
47
48
|
function w() {
|
|
48
49
|
return y.getRecoveryData();
|
|
49
50
|
}
|
|
50
|
-
function
|
|
51
|
+
function T() {
|
|
51
52
|
return y.acceptRecovery();
|
|
52
53
|
}
|
|
53
54
|
function D() {
|
|
@@ -59,17 +60,17 @@ function H(e, t = {}) {
|
|
|
59
60
|
function k() {
|
|
60
61
|
y.disable();
|
|
61
62
|
}
|
|
62
|
-
return
|
|
63
|
+
return a(() => {
|
|
63
64
|
x(), y.destroy();
|
|
64
65
|
}), {
|
|
65
66
|
status: n,
|
|
66
67
|
lastSaveTime: r,
|
|
67
|
-
hasRecoveryData:
|
|
68
|
+
hasRecoveryData: i,
|
|
68
69
|
isEnabled: o,
|
|
69
70
|
save: S,
|
|
70
71
|
clearAutoSave: C,
|
|
71
72
|
getRecoveryData: w,
|
|
72
|
-
acceptRecovery:
|
|
73
|
+
acceptRecovery: T,
|
|
73
74
|
dismissRecovery: D,
|
|
74
75
|
enable: O,
|
|
75
76
|
disable: k
|
|
@@ -77,15 +78,15 @@ function H(e, t = {}) {
|
|
|
77
78
|
}
|
|
78
79
|
//#endregion
|
|
79
80
|
//#region src/composables/useClipboard.ts
|
|
80
|
-
function
|
|
81
|
-
let { onCopy: t, onCut: n, onPaste: r, cleanWordFormatting: i = !0, editable: a = !0, onError: o, theme:
|
|
81
|
+
function W(e = {}) {
|
|
82
|
+
let { onCopy: t, onCut: n, onPaste: r, cleanWordFormatting: i = !0, editable: a = !0, onError: o, theme: s } = e, l = c(!1), u = c(null);
|
|
82
83
|
async function d(e) {
|
|
83
84
|
if (l.value) return !1;
|
|
84
85
|
l.value = !0;
|
|
85
86
|
try {
|
|
86
|
-
let n = await
|
|
87
|
+
let n = await p(e.runs, {
|
|
87
88
|
onError: o,
|
|
88
|
-
theme:
|
|
89
|
+
theme: s
|
|
89
90
|
});
|
|
90
91
|
return n && t?.(e), n;
|
|
91
92
|
} finally {
|
|
@@ -96,16 +97,16 @@ function U(e = {}) {
|
|
|
96
97
|
if (l.value || !a) return !1;
|
|
97
98
|
l.value = !0;
|
|
98
99
|
try {
|
|
99
|
-
let t = await
|
|
100
|
+
let t = await p(e.runs, {
|
|
100
101
|
onError: o,
|
|
101
|
-
theme:
|
|
102
|
+
theme: s
|
|
102
103
|
});
|
|
103
104
|
return t && n?.(e), t;
|
|
104
105
|
} finally {
|
|
105
106
|
l.value = !1;
|
|
106
107
|
}
|
|
107
108
|
}
|
|
108
|
-
async function
|
|
109
|
+
async function m(e = !1) {
|
|
109
110
|
if (l.value || !a) return null;
|
|
110
111
|
l.value = !0;
|
|
111
112
|
try {
|
|
@@ -113,7 +114,7 @@ function U(e = {}) {
|
|
|
113
114
|
let t = await navigator.clipboard.read(), n = "", a = "";
|
|
114
115
|
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
116
|
e && (n = "");
|
|
116
|
-
let o =
|
|
117
|
+
let o = y(n, a, i);
|
|
117
118
|
return u.value = o, r?.(o, e), o;
|
|
118
119
|
}
|
|
119
120
|
return null;
|
|
@@ -126,62 +127,20 @@ function U(e = {}) {
|
|
|
126
127
|
return {
|
|
127
128
|
copy: d,
|
|
128
129
|
cut: f,
|
|
129
|
-
paste:
|
|
130
|
+
paste: m,
|
|
130
131
|
isProcessing: l,
|
|
131
132
|
lastPastedContent: u
|
|
132
133
|
};
|
|
133
134
|
}
|
|
134
135
|
//#endregion
|
|
135
|
-
//#region src/composables/useCommentSidebarItems.ts
|
|
136
|
-
function W({ comments: e, trackedChanges: t, showResolved: n, isAddingComment: i, addCommentYPosition: a }) {
|
|
137
|
-
return r(() => {
|
|
138
|
-
let r = [];
|
|
139
|
-
i?.value && a?.value != null && r.push({
|
|
140
|
-
id: "new-comment-input",
|
|
141
|
-
anchorPos: 0,
|
|
142
|
-
fixedY: a.value,
|
|
143
|
-
priority: -1e3,
|
|
144
|
-
isTemporary: !0,
|
|
145
|
-
estimatedHeight: 120,
|
|
146
|
-
kind: "add-comment"
|
|
147
|
-
});
|
|
148
|
-
let o = /* @__PURE__ */ new Map();
|
|
149
|
-
for (let t of e.value) if (t.parentId != null) {
|
|
150
|
-
let e = o.get(t.parentId);
|
|
151
|
-
e ? e.push(t) : o.set(t.parentId, [t]);
|
|
152
|
-
}
|
|
153
|
-
for (let t of e.value) t.parentId ?? (t.done && !n?.value || r.push({
|
|
154
|
-
id: `comment-${t.id}`,
|
|
155
|
-
anchorPos: 0,
|
|
156
|
-
anchorKey: `comment-${t.id}`,
|
|
157
|
-
priority: 0,
|
|
158
|
-
estimatedHeight: t.done ? 28 : 80,
|
|
159
|
-
kind: "comment",
|
|
160
|
-
comment: t,
|
|
161
|
-
replies: o.get(t.id) ?? []
|
|
162
|
-
}));
|
|
163
|
-
return t.value.forEach((e, t) => {
|
|
164
|
-
r.push({
|
|
165
|
-
id: `tc-${e.revisionId}-${t}`,
|
|
166
|
-
anchorPos: e.from,
|
|
167
|
-
anchorKey: `revision-${e.revisionId}`,
|
|
168
|
-
priority: 1,
|
|
169
|
-
estimatedHeight: 80,
|
|
170
|
-
kind: "tracked-change",
|
|
171
|
-
change: e
|
|
172
|
-
});
|
|
173
|
-
}), r;
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
//#endregion
|
|
177
136
|
//#region src/composables/useDragAutoScroll.ts
|
|
178
137
|
var G = 40, K = 12;
|
|
179
138
|
function q({ pagesContainer: e, onScrollExtendSelection: t }) {
|
|
180
|
-
let n = null, r = 0,
|
|
139
|
+
let n = null, r = 0, i = 0, o = !1, s = null;
|
|
181
140
|
function c() {
|
|
182
141
|
if (s) return s;
|
|
183
142
|
let t = e.value;
|
|
184
|
-
return t ? (s =
|
|
143
|
+
return t ? (s = P(t), s) : null;
|
|
185
144
|
}
|
|
186
145
|
function l() {
|
|
187
146
|
o = !1, n !== null && (cancelAnimationFrame(n), n = null);
|
|
@@ -190,28 +149,28 @@ function q({ pagesContainer: e, onScrollExtendSelection: t }) {
|
|
|
190
149
|
if (!o) return;
|
|
191
150
|
let e = c();
|
|
192
151
|
if (!e) return;
|
|
193
|
-
let
|
|
194
|
-
if (
|
|
195
|
-
let e = Math.max(0,
|
|
152
|
+
let a = e.getBoundingClientRect(), s = 0;
|
|
153
|
+
if (i < a.top + G) {
|
|
154
|
+
let e = Math.max(0, a.top + G - i);
|
|
196
155
|
s = -Math.min(K, e / G * K);
|
|
197
|
-
} else if (
|
|
198
|
-
let e = Math.max(0,
|
|
156
|
+
} else if (i > a.bottom - G) {
|
|
157
|
+
let e = Math.max(0, i - (a.bottom - G));
|
|
199
158
|
s = Math.min(K, e / G * K);
|
|
200
159
|
}
|
|
201
|
-
s !== 0 && (e.scrollTop += s, t(r,
|
|
160
|
+
s !== 0 && (e.scrollTop += s, t(r, i)), n = requestAnimationFrame(u);
|
|
202
161
|
}
|
|
203
162
|
function d() {
|
|
204
163
|
o || (o = !0, n = requestAnimationFrame(u));
|
|
205
164
|
}
|
|
206
165
|
function f(e, t) {
|
|
207
|
-
if (r = e,
|
|
166
|
+
if (r = e, i = t, !o) {
|
|
208
167
|
let e = c();
|
|
209
168
|
if (!e) return;
|
|
210
169
|
let n = e.getBoundingClientRect();
|
|
211
170
|
(t < n.top + G || t > n.bottom - G) && d();
|
|
212
171
|
}
|
|
213
172
|
}
|
|
214
|
-
return
|
|
173
|
+
return a(() => l()), {
|
|
215
174
|
updateMousePosition: f,
|
|
216
175
|
stopAutoScroll: l
|
|
217
176
|
};
|
|
@@ -219,11 +178,11 @@ function q({ pagesContainer: e, onScrollExtendSelection: t }) {
|
|
|
219
178
|
//#endregion
|
|
220
179
|
//#region src/composables/useFindReplace.ts
|
|
221
180
|
function J(e = {}) {
|
|
222
|
-
let t =
|
|
181
|
+
let t = s({
|
|
223
182
|
isOpen: !1,
|
|
224
183
|
searchText: "",
|
|
225
184
|
replaceText: "",
|
|
226
|
-
options:
|
|
185
|
+
options: F(),
|
|
227
186
|
matches: [],
|
|
228
187
|
currentIndex: 0,
|
|
229
188
|
replaceMode: e.initialReplaceMode ?? !1
|
|
@@ -231,13 +190,13 @@ function J(e = {}) {
|
|
|
231
190
|
function n(e) {
|
|
232
191
|
t.isOpen = !0, t.replaceMode = !1, e && (t.searchText = e), t.matches = [], t.currentIndex = 0;
|
|
233
192
|
}
|
|
234
|
-
function
|
|
193
|
+
function r(e) {
|
|
235
194
|
t.isOpen = !0, t.replaceMode = !0, e && (t.searchText = e), t.matches = [], t.currentIndex = 0;
|
|
236
195
|
}
|
|
237
196
|
function a() {
|
|
238
197
|
t.isOpen = !1;
|
|
239
198
|
}
|
|
240
|
-
function
|
|
199
|
+
function o() {
|
|
241
200
|
t.isOpen = !t.isOpen;
|
|
242
201
|
}
|
|
243
202
|
function c(e) {
|
|
@@ -267,12 +226,12 @@ function J(e = {}) {
|
|
|
267
226
|
}
|
|
268
227
|
return {
|
|
269
228
|
state: t,
|
|
270
|
-
currentMatch:
|
|
271
|
-
hasMatches:
|
|
229
|
+
currentMatch: i(() => t.matches.length === 0 ? null : t.matches[t.currentIndex] ?? null),
|
|
230
|
+
hasMatches: i(() => t.matches.length > 0),
|
|
272
231
|
openFind: n,
|
|
273
|
-
openReplace:
|
|
232
|
+
openReplace: r,
|
|
274
233
|
close: a,
|
|
275
|
-
toggle:
|
|
234
|
+
toggle: o,
|
|
276
235
|
setSearchText: c,
|
|
277
236
|
setReplaceText: l,
|
|
278
237
|
setOptions: u,
|
|
@@ -285,13 +244,13 @@ function J(e = {}) {
|
|
|
285
244
|
//#endregion
|
|
286
245
|
//#region src/composables/useFixedDropdown.ts
|
|
287
246
|
function Y({ isOpen: e, onClose: t, align: n = "left" }) {
|
|
288
|
-
let r =
|
|
247
|
+
let r = c(null), i = c(null), o = c({
|
|
289
248
|
position: "fixed",
|
|
290
249
|
top: "0px",
|
|
291
250
|
left: "0px",
|
|
292
251
|
zIndex: 1e4
|
|
293
252
|
});
|
|
294
|
-
function
|
|
253
|
+
function s(e, t) {
|
|
295
254
|
o.value = {
|
|
296
255
|
position: "fixed",
|
|
297
256
|
top: e + "px",
|
|
@@ -299,9 +258,9 @@ function Y({ isOpen: e, onClose: t, align: n = "left" }) {
|
|
|
299
258
|
zIndex: 1e4
|
|
300
259
|
};
|
|
301
260
|
}
|
|
302
|
-
function
|
|
261
|
+
function l(e) {
|
|
303
262
|
let n = e.target;
|
|
304
|
-
r.value && !r.value.contains(n) &&
|
|
263
|
+
r.value && !r.value.contains(n) && i.value && !i.value.contains(n) && t();
|
|
305
264
|
}
|
|
306
265
|
function d(e) {
|
|
307
266
|
e.key === "Escape" && t();
|
|
@@ -310,33 +269,33 @@ function Y({ isOpen: e, onClose: t, align: n = "left" }) {
|
|
|
310
269
|
t();
|
|
311
270
|
}
|
|
312
271
|
function p() {
|
|
313
|
-
document.addEventListener("mousedown",
|
|
272
|
+
document.addEventListener("mousedown", l), document.addEventListener("keydown", d), window.addEventListener("scroll", f, !0);
|
|
314
273
|
}
|
|
315
274
|
function m() {
|
|
316
|
-
document.removeEventListener("mousedown",
|
|
275
|
+
document.removeEventListener("mousedown", l), document.removeEventListener("keydown", d), window.removeEventListener("scroll", f, !0);
|
|
317
276
|
}
|
|
318
|
-
|
|
277
|
+
u(e, (e) => {
|
|
319
278
|
if (!e) {
|
|
320
279
|
m();
|
|
321
280
|
return;
|
|
322
281
|
}
|
|
323
282
|
let t = r.value;
|
|
324
283
|
if (!t) return;
|
|
325
|
-
let
|
|
284
|
+
let a = t.getBoundingClientRect();
|
|
326
285
|
n === "right" ? requestAnimationFrame(() => {
|
|
327
|
-
let e =
|
|
286
|
+
let e = i.value;
|
|
328
287
|
if (e) {
|
|
329
288
|
let t = e.getBoundingClientRect();
|
|
330
|
-
|
|
331
|
-
} else
|
|
332
|
-
}) :
|
|
333
|
-
}),
|
|
289
|
+
s(a.bottom + 4, a.right - t.width);
|
|
290
|
+
} else s(a.bottom + 4, a.left);
|
|
291
|
+
}) : s(a.bottom + 4, a.left), p();
|
|
292
|
+
}), a(m);
|
|
334
293
|
function h(e) {
|
|
335
294
|
e.preventDefault(), e.stopPropagation();
|
|
336
295
|
}
|
|
337
296
|
return {
|
|
338
297
|
containerRef: r,
|
|
339
|
-
dropdownRef:
|
|
298
|
+
dropdownRef: i,
|
|
340
299
|
dropdownStyle: o,
|
|
341
300
|
handleMouseDown: h
|
|
342
301
|
};
|
|
@@ -344,26 +303,26 @@ function Y({ isOpen: e, onClose: t, align: n = "left" }) {
|
|
|
344
303
|
//#endregion
|
|
345
304
|
//#region src/composables/useHistory.ts
|
|
346
305
|
function X(e, t) {
|
|
347
|
-
let n =
|
|
306
|
+
let n = i(() => {
|
|
348
307
|
t.value;
|
|
349
308
|
let n = e.value;
|
|
350
|
-
return n ?
|
|
351
|
-
}),
|
|
309
|
+
return n ? w(n.state) > 0 : !1;
|
|
310
|
+
}), r = i(() => {
|
|
352
311
|
t.value;
|
|
353
312
|
let n = e.value;
|
|
354
|
-
return n ?
|
|
313
|
+
return n ? S(n.state) > 0 : !1;
|
|
355
314
|
});
|
|
356
315
|
function a() {
|
|
357
316
|
let t = e.value;
|
|
358
|
-
return t ?
|
|
317
|
+
return t ? C(t.state, t.dispatch) : !1;
|
|
359
318
|
}
|
|
360
319
|
function o() {
|
|
361
320
|
let t = e.value;
|
|
362
|
-
return t ?
|
|
321
|
+
return t ? x(t.state, t.dispatch) : !1;
|
|
363
322
|
}
|
|
364
323
|
return {
|
|
365
324
|
canUndo: n,
|
|
366
|
-
canRedo:
|
|
325
|
+
canRedo: r,
|
|
367
326
|
undo: a,
|
|
368
327
|
redo: o
|
|
369
328
|
};
|
|
@@ -371,20 +330,20 @@ function X(e, t) {
|
|
|
371
330
|
//#endregion
|
|
372
331
|
//#region src/composables/useSelectionHighlight.ts
|
|
373
332
|
function Z(e) {
|
|
374
|
-
let { containerRef: t, enabled: n = !0, config:
|
|
333
|
+
let { containerRef: t, enabled: n = !0, config: r = d, useOverlay: s = !1, debounceMs: l = 16, onSelectionChange: p } = e, y = c(!1), b = c(""), x = c([]), S = c(!1), C = null, w = 0;
|
|
375
334
|
function T() {
|
|
376
|
-
let e = t.value, n =
|
|
377
|
-
|
|
335
|
+
let e = t.value, n = g(), r = h(), i = e ? v(e) : !1;
|
|
336
|
+
y.value = n, b.value = r, S.value = i, x.value = s && i && e ? m(e) : [], p?.(n && i, r);
|
|
378
337
|
}
|
|
379
338
|
function E() {
|
|
380
339
|
T();
|
|
381
340
|
}
|
|
382
341
|
function D() {
|
|
383
342
|
let e = performance.now();
|
|
384
|
-
if (e - w <
|
|
343
|
+
if (e - w < l) {
|
|
385
344
|
C && clearTimeout(C), C = setTimeout(() => {
|
|
386
345
|
w = performance.now(), T(), C = null;
|
|
387
|
-
},
|
|
346
|
+
}, l);
|
|
388
347
|
return;
|
|
389
348
|
}
|
|
390
349
|
w = e, T();
|
|
@@ -396,22 +355,22 @@ function Z(e) {
|
|
|
396
355
|
top: e.top + "px",
|
|
397
356
|
width: e.width + "px",
|
|
398
357
|
height: e.height + "px",
|
|
399
|
-
backgroundColor:
|
|
400
|
-
borderRadius:
|
|
401
|
-
border:
|
|
402
|
-
zIndex:
|
|
358
|
+
backgroundColor: r.backgroundColor,
|
|
359
|
+
borderRadius: r.borderRadius ? r.borderRadius + "px" : void 0,
|
|
360
|
+
border: r.borderColor ? `1px solid ${r.borderColor}` : void 0,
|
|
361
|
+
zIndex: r.zIndex ?? 0,
|
|
403
362
|
pointerEvents: "none"
|
|
404
363
|
};
|
|
405
364
|
}
|
|
406
|
-
return
|
|
407
|
-
n && (
|
|
408
|
-
}),
|
|
365
|
+
return o(() => {
|
|
366
|
+
n && (f() || _(r), document.addEventListener("selectionchange", D));
|
|
367
|
+
}), a(() => {
|
|
409
368
|
document.removeEventListener("selectionchange", D), C && clearTimeout(C);
|
|
410
|
-
}),
|
|
411
|
-
hasSelection:
|
|
412
|
-
selectedText:
|
|
413
|
-
highlightRects:
|
|
414
|
-
isSelectionInContainer:
|
|
369
|
+
}), u(t, () => T()), {
|
|
370
|
+
hasSelection: i(() => y.value),
|
|
371
|
+
selectedText: i(() => b.value),
|
|
372
|
+
highlightRects: i(() => x.value),
|
|
373
|
+
isSelectionInContainer: i(() => S.value),
|
|
415
374
|
refresh: E,
|
|
416
375
|
getOverlayStyle: O
|
|
417
376
|
};
|
|
@@ -419,13 +378,13 @@ function Z(e) {
|
|
|
419
378
|
//#endregion
|
|
420
379
|
//#region src/composables/useTableSelection.ts
|
|
421
380
|
function Q() {
|
|
422
|
-
let e = new
|
|
381
|
+
let e = new I(), t = c(null), n = () => {
|
|
423
382
|
t.value = e.getSnapshot().selectedCell;
|
|
424
383
|
}, r = e.subscribe(n);
|
|
425
|
-
n(),
|
|
384
|
+
n(), a(() => {
|
|
426
385
|
r();
|
|
427
386
|
});
|
|
428
|
-
function
|
|
387
|
+
function i(t, n, r) {
|
|
429
388
|
e.selectCell({
|
|
430
389
|
tableIndex: t,
|
|
431
390
|
rowIndex: n,
|
|
@@ -433,10 +392,10 @@ function Q() {
|
|
|
433
392
|
});
|
|
434
393
|
}
|
|
435
394
|
function o(t, n) {
|
|
436
|
-
let r =
|
|
395
|
+
let r = L(t, n);
|
|
437
396
|
r ? e.selectCell(r) : e.clearSelection();
|
|
438
397
|
}
|
|
439
|
-
function
|
|
398
|
+
function s() {
|
|
440
399
|
e.clearSelection();
|
|
441
400
|
}
|
|
442
401
|
function l(t, n, r) {
|
|
@@ -444,34 +403,34 @@ function Q() {
|
|
|
444
403
|
}
|
|
445
404
|
return {
|
|
446
405
|
selectedCell: t,
|
|
447
|
-
handleCellClick:
|
|
406
|
+
handleCellClick: i,
|
|
448
407
|
handleClickTarget: o,
|
|
449
|
-
clearSelection:
|
|
408
|
+
clearSelection: s,
|
|
450
409
|
isCellSelected: l
|
|
451
410
|
};
|
|
452
411
|
}
|
|
453
412
|
//#endregion
|
|
454
413
|
//#region src/composables/useTrackedChanges.ts
|
|
455
414
|
function $(e, t) {
|
|
456
|
-
return
|
|
415
|
+
return i(() => (t.value, T(e.value?.state ?? null)));
|
|
457
416
|
}
|
|
458
417
|
//#endregion
|
|
459
418
|
//#region src/composables/useVisualLineNavigation.ts
|
|
460
419
|
function ee(e) {
|
|
461
|
-
let t =
|
|
420
|
+
let t = R();
|
|
462
421
|
function n(t) {
|
|
463
422
|
let n = e.value;
|
|
464
|
-
return n ?
|
|
423
|
+
return n ? V(n, t) : null;
|
|
465
424
|
}
|
|
466
425
|
function r(t) {
|
|
467
426
|
let n = e.value;
|
|
468
|
-
return n ?
|
|
427
|
+
return n ? z(n, t) : null;
|
|
469
428
|
}
|
|
470
429
|
function i(e, t) {
|
|
471
|
-
return
|
|
430
|
+
return B(e, t);
|
|
472
431
|
}
|
|
473
432
|
function a(n, r) {
|
|
474
|
-
return
|
|
433
|
+
return H(t, n, r, e.value);
|
|
475
434
|
}
|
|
476
435
|
return {
|
|
477
436
|
state: t,
|
|
@@ -482,4 +441,4 @@ function ee(e) {
|
|
|
482
441
|
};
|
|
483
442
|
}
|
|
484
443
|
//#endregion
|
|
485
|
-
export {
|
|
444
|
+
export { D as createSelectionFromDOM, T as extractTrackedChanges, O as formatLastSaveTime, k as formatStorageSize, A as getAutoSaveStatusLabel, j as getAutoSaveStorageSize, M as getSelectionRuns, N as isAutoSaveSupported, b as runsToClipboardContent, U as useAutoSave, W as useClipboard, e as useCommentSidebarItems, n as useDocxEditor, q as useDragAutoScroll, J as useFindReplace, Y as useFixedDropdown, X as useHistory, Z as useSelectionHighlight, r as useTableResize, Q as useTableSelection, $ as useTrackedChanges, ee as useVisualLineNavigation, t as useWheelZoom, t as useZoom };
|
package/dist/dialogs.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./KeyboardShortcutsDialog-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./KeyboardShortcutsDialog-EW9K4wuO.cjs`),t=require(`./TablePropertiesDialog-BZLpFAkg.cjs`);exports.FindReplaceDialog=e.s,exports.FootnotePropertiesDialog=t.o,exports.HyperlinkDialog=e.a,exports.ImagePositionDialog=t.a,exports.ImagePropertiesDialog=e.r,exports.InsertImageDialog=e.o,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
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./KeyboardShortcutsDialog-
|
|
2
|
-
import { a as s, i as c, n as l, o as u, r as d, t as f } from "./TablePropertiesDialog-
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, s as a, t as o } from "./KeyboardShortcutsDialog-00eb4Ova.js";
|
|
2
|
+
import { a as s, i as c, n as l, o as u, r as d, t as f } from "./TablePropertiesDialog-CBTvM4Xy.js";
|
|
3
3
|
export { a as FindReplaceDialog, u as FootnotePropertiesDialog, e as HyperlinkDialog, s as ImagePositionDialog, i as ImagePropertiesDialog, r as InsertImageDialog, t as InsertSymbolDialog, c as InsertTableDialog, o as KeyboardShortcutsDialog, n as PageSetupDialog, d as PasteSpecialDialog, l as SplitCellDialog, f as TablePropertiesDialog };
|