@eigenpal/docx-editor-vue 1.3.3 → 1.5.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-BbuDgglK.js → KeyboardShortcutsDialog-DtuQzPxi.js} +347 -505
- package/dist/{KeyboardShortcutsDialog-Bct8AJ0i.cjs → KeyboardShortcutsDialog-DyfvEiK5.cjs} +1 -1
- package/dist/{MenuBar-CbONA9-a.js → MenuBar-DfQrRpyI.js} +231 -214
- package/dist/{MenuBar-m0JEaF1X.cjs → MenuBar-p9bqtbLg.cjs} +2 -2
- package/dist/{TablePropertiesDialog-JWT68zEO.cjs → TablePropertiesDialog-BVlqA7s3.cjs} +1 -1
- package/dist/TablePropertiesDialog-D4xs_Xif.js +1145 -0
- package/dist/components/DocxEditor/types.d.ts +18 -0
- package/dist/composables/imageOverlayRect.d.ts +44 -0
- package/dist/composables/imageOverlayRect.test.d.ts +1 -0
- package/dist/composables/useCommentSidebarItems.test.d.ts +1 -0
- package/dist/composables/useFileIO.d.ts +5 -0
- package/dist/composables/useFormattingActions.d.ts +8 -0
- package/dist/composables/useImageActions.d.ts +0 -6
- package/dist/composables/useMenuActions.d.ts +1 -1
- package/dist/composables.cjs +1 -1
- package/dist/composables.js +2 -2
- package/dist/dialogs.cjs +1 -1
- package/dist/dialogs.js +3 -3
- package/dist/docx-editor-vue.css +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.js +1381 -1319
- package/dist/ui.cjs +2 -2
- package/dist/ui.js +76 -76
- package/dist/{useCommentSidebarItems-CbNvNCd3.cjs → useCommentSidebarItems-DBeGKNGA.cjs} +1 -1
- package/dist/{useCommentSidebarItems-BHomCzpj.js → useCommentSidebarItems-DXbF857R.js} +2 -1
- package/dist/{useDragAutoScroll-BB_IHM8f.js → useDragAutoScroll-BNPB-6SM.js} +5 -1
- package/dist/useDragAutoScroll-DCUotwOX.cjs +1 -0
- package/package.json +4 -4
- package/dist/TablePropertiesDialog-D5MIF3cj.js +0 -987
- package/dist/useDragAutoScroll-CkDV5Sel.cjs +0 -1
package/dist/index.js
CHANGED
|
@@ -1,42 +1,44 @@
|
|
|
1
|
-
import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s,
|
|
2
|
-
import { a as
|
|
3
|
-
import { t as
|
|
4
|
-
import { n as
|
|
5
|
-
import { t as
|
|
6
|
-
import { i as
|
|
7
|
-
import { Fragment as
|
|
8
|
-
import { NodeSelection as
|
|
9
|
-
import { applyCellSelectionHighlight as
|
|
10
|
-
import {
|
|
11
|
-
import { LayoutSelectionGate as
|
|
12
|
-
import { SIDEBAR_DOCUMENT_SHIFT as
|
|
13
|
-
import { extractSelectionContext as
|
|
14
|
-
import { clearFormatting as
|
|
15
|
-
import { getTableContext as
|
|
16
|
-
import { clickToPositionDom as
|
|
17
|
-
import { commitImageFloatMove as
|
|
18
|
-
import { IMAGE_LAYOUT_OPTIONS as
|
|
19
|
-
import { proseDocToBlocks as
|
|
20
|
-
import { twipsToPixels as
|
|
21
|
-
import { pictureWatermarkDisplayEmu as
|
|
22
|
-
import { makeRevisionInfo as
|
|
23
|
-
import { findPageIndexContainingPmPos as
|
|
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 {
|
|
1
|
+
import { a as e, c as t, d as n, f as r, i, l as a, n as o, o as s, r as c, s as l, t as u, u as d } from "./KeyboardShortcutsDialog-DtuQzPxi.js";
|
|
2
|
+
import { a as f, c as p, h as m, i as h, o as g, s as _, t as v, x as y } from "./MenuBar-DfQrRpyI.js";
|
|
3
|
+
import { t as b } from "./_plugin-vue_export-helper-B52Kst-M.js";
|
|
4
|
+
import { n as x } from "./RenderedDomContext-CHc18N_2.js";
|
|
5
|
+
import { t as S } from "./zIndex-CxELVe_L.js";
|
|
6
|
+
import { i as C, n as ee, r as te, t as ne } from "./useDragAutoScroll-BNPB-6SM.js";
|
|
7
|
+
import { Fragment as w, Teleport as T, computed as E, createApp as D, createBlock as O, createCommentVNode as k, createElementBlock as A, createElementVNode as j, createSlots as re, createStaticVNode as ie, createTextVNode as ae, createVNode as M, defineComponent as N, h as oe, isRef as se, nextTick as ce, normalizeClass as le, normalizeStyle as P, onBeforeUnmount as F, onMounted as I, openBlock as L, ref as R, renderList as z, renderSlot as ue, resolveDynamicComponent as de, shallowRef as fe, toDisplayString as B, unref as V, vModelCheckbox as H, vModelSelect as pe, vModelText as U, watch as W, withCtx as me, withDirectives as G, withKeys as K, withModifiers as q } from "vue";
|
|
8
|
+
import { NodeSelection as J, TextSelection as he } from "prosemirror-state";
|
|
9
|
+
import { applyCellSelectionHighlight as Y, clickToPositionDom as ge, computeHfCaretRectFromView as _e, computeHfSelectionRectsFromView as ve, findBodyPmAnchor as X, findBodyPmSpans as ye } from "@eigenpal/docx-editor-core/layout-bridge";
|
|
10
|
+
import { clampRangeToDoc as be, findChangeRange as xe, findCommentRange as Se, findInDocument as Ce, getPageContent as we, getSelectionInfo as Te } from "@eigenpal/docx-editor-core/prosemirror/queries";
|
|
11
|
+
import { LayoutSelectionGate as Ee, addRepeatingSectionItemTr as De, extractSelectionState as Oe, findContentControlPos as ke, findContentControlsInPM as Ae, removeContentControlTr as je, removeRepeatingSectionItemTr as Z, schema as Me, setContentControlContentTr as Ne, setContentControlValueAtPosTr as Pe, setContentControlValueTr as Fe } from "@eigenpal/docx-editor-core/prosemirror";
|
|
12
|
+
import { SIDEBAR_DOCUMENT_SHIFT as Ie, findWordBoundaries as Le, loadFontDefinitions as Re, onFontError as ze, pixelsToEmu as Be, readDocxFileFromInput as Q, toArrayBuffer as Ve } from "@eigenpal/docx-editor-core/utils";
|
|
13
|
+
import { extractSelectionContext as He } from "@eigenpal/docx-editor-core/prosemirror/plugins/selectionTracker";
|
|
14
|
+
import { clearFormatting as Ue, findHyperlinkRangeAt as We } from "@eigenpal/docx-editor-core/prosemirror/commands/formatting";
|
|
15
|
+
import { getTableContext as Ge } from "@eigenpal/docx-editor-core/prosemirror/extensions/nodes/TableExtension";
|
|
16
|
+
import { clickToPositionDom as Ke, getCaretPositionFromDom as qe, getSelectionRectsFromDom as Je } from "@eigenpal/docx-editor-core/layout-bridge/clickToPositionDom";
|
|
17
|
+
import { calculateResizedImageDimensions as Ye, commitImageFloatMove as Xe, commitImageInlineMove as Ze, commitImageResize as Qe, isFloatingImage as $e } from "@eigenpal/docx-editor-core/prosemirror/imageCommit";
|
|
18
|
+
import { IMAGE_LAYOUT_OPTIONS as et, captureInlinePositionEmu as tt, deriveLayoutChoice as nt, findImageElement as rt, isImageLayoutOptionEnabled as it, renderAllPagesNow as at, toolbarValueToLayoutTarget as ot } from "@eigenpal/docx-editor-core/layout-painter";
|
|
19
|
+
import { proseDocToBlocks as st } from "@eigenpal/docx-editor-core/prosemirror/conversion";
|
|
20
|
+
import { twipsToPixels as ct } from "@eigenpal/docx-editor-core/utils/units";
|
|
21
|
+
import { pictureWatermarkDisplayEmu as lt } from "@eigenpal/docx-editor-core/types/document";
|
|
22
|
+
import { makeRevisionInfo as ut } from "@eigenpal/docx-editor-core/prosemirror/plugins";
|
|
23
|
+
import { findPageIndexContainingPmPos as dt } from "@eigenpal/docx-editor-core/layout-engine";
|
|
24
|
+
import { acceptChange as ft, acceptChangeById as pt, getWatermarkFromState as mt, insertImageFromFile as ht, rejectChange as gt, rejectChangeById as _t, setWatermark as vt } from "@eigenpal/docx-editor-core/prosemirror/commands";
|
|
25
|
+
import { applyStyle as yt, removeTabStop as bt, setIndentFirstLine as xt, setIndentLeft as St, setIndentRight as Ct } from "@eigenpal/docx-editor-core/prosemirror/commands/paragraph";
|
|
26
|
+
import { createStyleResolver as wt } from "@eigenpal/docx-editor-core/prosemirror/styles";
|
|
27
|
+
import { getCachedNumberingMap as Tt } from "@eigenpal/docx-editor-core/docx";
|
|
28
|
+
import { insertPageBreak as Et } from "@eigenpal/docx-editor-core/prosemirror/commands/pageBreak";
|
|
29
|
+
import { applyFormatting as Dt, setParagraphStyle as Ot } from "@eigenpal/docx-editor-core/prosemirror/applyFormatting";
|
|
30
|
+
import { collectHeadings as kt } from "@eigenpal/docx-editor-core/utils/headingCollector";
|
|
31
|
+
import { addCommentToRange as At, applyProposedChange as jt, createComment as Mt } from "@eigenpal/docx-editor-core/prosemirror/commentOps";
|
|
32
|
+
import { PENDING_COMMENT_ID as Nt, createCommentIdAllocator as Pt, seedCommentAllocator as Ft } from "@eigenpal/docx-editor-core/prosemirror/commentIdAllocator";
|
|
33
|
+
import { extractTrackedChanges as It } from "@eigenpal/docx-editor-core/prosemirror/utils/extractTrackedChanges";
|
|
34
|
+
import { TABLE_INSERT_HIDE_DELAY_MS as Lt, detectTableInsertHover as Rt } from "@eigenpal/docx-editor-core/layout-bridge/tableInsertHover";
|
|
35
|
+
import { createCellDragTracker as zt, findCellPosFromPmPos as Bt } from "@eigenpal/docx-editor-core/prosemirror/cellDragSelection";
|
|
36
|
+
import { openReportIssue as Vt } from "@eigenpal/docx-editor-core/utils/reportIssue";
|
|
37
|
+
import { ContentControlNotFoundError as Ht } from "@eigenpal/docx-editor-core/agent";
|
|
38
|
+
import { findParaIdRange as Ut } from "@eigenpal/docx-editor-core/prosemirror/paraText";
|
|
39
|
+
import { createDocumentWithText as Wt, createEmptyDocument as Gt } from "@eigenpal/docx-editor-core";
|
|
38
40
|
//#region src/utils/domQueries.ts
|
|
39
|
-
function
|
|
41
|
+
function Kt(e) {
|
|
40
42
|
let t = window.document.querySelectorAll(`.layout-page-${e}`);
|
|
41
43
|
if (t.length === 0) return null;
|
|
42
44
|
let n = window.innerHeight / 2, r = t[0], i = Infinity;
|
|
@@ -46,18 +48,18 @@ function zt(e) {
|
|
|
46
48
|
}
|
|
47
49
|
return r;
|
|
48
50
|
}
|
|
49
|
-
function
|
|
50
|
-
let r = n ? Array.from(e.querySelectorAll(`.layout-page-${n} span[data-pm-start][data-pm-end]`)) :
|
|
51
|
+
function qt(e, t, n) {
|
|
52
|
+
let r = n ? Array.from(e.querySelectorAll(`.layout-page-${n} span[data-pm-start][data-pm-end]`)) : ye(e);
|
|
51
53
|
for (let e of r) {
|
|
52
54
|
let n = Number(e.dataset.pmStart), r = Number(e.dataset.pmEnd);
|
|
53
55
|
if (!isNaN(n) && !isNaN(r) && t >= n && t <= r) return e;
|
|
54
56
|
}
|
|
55
57
|
return null;
|
|
56
58
|
}
|
|
57
|
-
function
|
|
59
|
+
function Jt(e, t, n) {
|
|
58
60
|
if (!e || !t) return;
|
|
59
61
|
let r = null;
|
|
60
|
-
for (let t of
|
|
62
|
+
for (let t of ye(e)) {
|
|
61
63
|
let e = Number(t.dataset.pmStart), i = Number(t.dataset.pmEnd);
|
|
62
64
|
if (Number.isFinite(e) && Number.isFinite(i) && n >= e && n <= i) {
|
|
63
65
|
r = t;
|
|
@@ -71,21 +73,21 @@ function Vt(e, t, n) {
|
|
|
71
73
|
behavior: "smooth"
|
|
72
74
|
});
|
|
73
75
|
}
|
|
74
|
-
function
|
|
76
|
+
function Yt(e, t, n, r) {
|
|
75
77
|
if (!e || !t) return null;
|
|
76
|
-
let i =
|
|
78
|
+
let i = ge(e, n, r, 1);
|
|
77
79
|
return i === null || i < 0 ? null : Math.min(i, t.state.doc.content.size);
|
|
78
80
|
}
|
|
79
|
-
function
|
|
81
|
+
function Xt(e, t, n, r) {
|
|
80
82
|
if (!e) return;
|
|
81
|
-
let i =
|
|
83
|
+
let i = qt(e, t, r);
|
|
82
84
|
if (!i) return;
|
|
83
|
-
let a = i.textContent || "", o = Number(i.dataset.pmStart) || 0, [s, c] =
|
|
85
|
+
let a = i.textContent || "", o = Number(i.dataset.pmStart) || 0, [s, c] = Le(a, t - o), l = o + s, u = o + c;
|
|
84
86
|
l < u && n(l, u);
|
|
85
87
|
}
|
|
86
|
-
function
|
|
88
|
+
function Zt(e, t, n, r) {
|
|
87
89
|
if (!e) return;
|
|
88
|
-
let i =
|
|
90
|
+
let i = qt(e, t, r);
|
|
89
91
|
if (!i) return;
|
|
90
92
|
let a = i.closest(".layout-paragraph");
|
|
91
93
|
if (!a) return;
|
|
@@ -94,7 +96,7 @@ function Wt(e, t, n, r) {
|
|
|
94
96
|
}
|
|
95
97
|
//#endregion
|
|
96
98
|
//#region src/components/DecorationLayer.vue
|
|
97
|
-
var
|
|
99
|
+
var Qt = /* @__PURE__ */ N({
|
|
98
100
|
__name: "DecorationLayer",
|
|
99
101
|
props: {
|
|
100
102
|
getView: { type: Function },
|
|
@@ -118,7 +120,7 @@ var Gt = /* @__PURE__ */ M({
|
|
|
118
120
|
}), o();
|
|
119
121
|
}), F(() => {
|
|
120
122
|
i !== null && (cancelAnimationFrame(i), i = null), a?.();
|
|
121
|
-
}),
|
|
123
|
+
}), W(() => [
|
|
122
124
|
t.zoom,
|
|
123
125
|
t.transactionVersion,
|
|
124
126
|
r.value
|
|
@@ -129,7 +131,7 @@ var Gt = /* @__PURE__ */ M({
|
|
|
129
131
|
n.firstChild && n.replaceChildren();
|
|
130
132
|
return;
|
|
131
133
|
}
|
|
132
|
-
let a =
|
|
134
|
+
let a = x(t, r), o = a.getContainerOffset(), s = document.createDocumentFragment();
|
|
133
135
|
for (let { decoration: t, from: n, to: r } of i) {
|
|
134
136
|
if (n === r) {
|
|
135
137
|
let r = l(t, e);
|
|
@@ -179,20 +181,34 @@ var Gt = /* @__PURE__ */ M({
|
|
|
179
181
|
function u(e) {
|
|
180
182
|
return e.type?.attrs ?? null;
|
|
181
183
|
}
|
|
182
|
-
return (e, t) => (L(),
|
|
184
|
+
return (e, t) => (L(), A("div", {
|
|
183
185
|
ref_key: "overlayRef",
|
|
184
186
|
ref: n,
|
|
185
187
|
class: "paged-editor__decoration-overlay",
|
|
186
188
|
"aria-hidden": "true"
|
|
187
189
|
}, null, 512));
|
|
188
190
|
}
|
|
189
|
-
})
|
|
191
|
+
});
|
|
192
|
+
//#endregion
|
|
193
|
+
//#region src/composables/imageOverlayRect.ts
|
|
194
|
+
function $t(e) {
|
|
195
|
+
let t = Math.max(0, e.parentOffsetWidth - e.parentClientWidth) / 2, n = e.zoom || 1;
|
|
196
|
+
return {
|
|
197
|
+
left: (e.imageRect.left - e.parentRect.left - t + e.scrollLeft) / n,
|
|
198
|
+
top: (e.imageRect.top - e.parentRect.top + e.scrollTop) / n,
|
|
199
|
+
width: e.imageRect.width / n,
|
|
200
|
+
height: e.imageRect.height / n
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
//#endregion
|
|
204
|
+
//#region src/components/ImageSelectionOverlay.vue?vue&type=script&setup=true&lang.ts
|
|
205
|
+
var en = ["data-handle", "onMousedown"], tn = ["title"], nn = {
|
|
190
206
|
key: 0,
|
|
191
207
|
class: "image-overlay__dim"
|
|
192
|
-
},
|
|
208
|
+
}, rn = {
|
|
193
209
|
key: 1,
|
|
194
210
|
class: "image-overlay__dim image-overlay__dim--rotate"
|
|
195
|
-
},
|
|
211
|
+
}, an = 4, on = 15, sn = 250, cn = 700, ln = /* @__PURE__ */ b(/* @__PURE__ */ N({
|
|
196
212
|
__name: "ImageSelectionOverlay",
|
|
197
213
|
props: {
|
|
198
214
|
imageInfo: {},
|
|
@@ -206,7 +222,7 @@ var Gt = /* @__PURE__ */ M({
|
|
|
206
222
|
"context-menu"
|
|
207
223
|
],
|
|
208
224
|
setup(e, { emit: t }) {
|
|
209
|
-
let { t:
|
|
225
|
+
let { t: n } = d(), r = e, i = t, a = R(null), o = R(!1), s = R(!1), c = R(!1), l = R(0), u = R(0), f = R(0), p = R(null), m = "se", h = 0, g = 0, _ = 0, v = 0, y = null, b = null, x = null, C = null;
|
|
210
226
|
function ee(e, t) {
|
|
211
227
|
if (!e) return null;
|
|
212
228
|
try {
|
|
@@ -217,56 +233,82 @@ var Gt = /* @__PURE__ */ M({
|
|
|
217
233
|
}
|
|
218
234
|
}
|
|
219
235
|
function te() {
|
|
220
|
-
return
|
|
236
|
+
return a.value?.closest(".docx-editor-vue__pages-viewport")?.querySelector(".docx-editor-vue__pages") ?? null;
|
|
221
237
|
}
|
|
222
238
|
function ne() {
|
|
223
|
-
let e =
|
|
239
|
+
let e = r.imageInfo;
|
|
224
240
|
if (!e) return null;
|
|
225
241
|
if (e.element.isConnected) return e.element;
|
|
226
242
|
let t = te();
|
|
227
243
|
if (!t) return null;
|
|
228
|
-
let n =
|
|
229
|
-
return n ?
|
|
244
|
+
let n = X(t, e.pmPos);
|
|
245
|
+
return n ? rt(n) : null;
|
|
230
246
|
}
|
|
231
|
-
function
|
|
247
|
+
function T() {
|
|
232
248
|
let e = ne();
|
|
233
|
-
if (!e || !
|
|
249
|
+
if (!e || !a.value) {
|
|
234
250
|
p.value = null;
|
|
235
251
|
return;
|
|
236
252
|
}
|
|
237
|
-
let t =
|
|
253
|
+
let t = a.value.offsetParent;
|
|
238
254
|
if (!t) {
|
|
239
255
|
p.value = null;
|
|
240
256
|
return;
|
|
241
257
|
}
|
|
242
|
-
let n = t.getBoundingClientRect()
|
|
243
|
-
p.value = {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
258
|
+
let n = t.getBoundingClientRect();
|
|
259
|
+
p.value = $t({
|
|
260
|
+
imageRect: e.getBoundingClientRect(),
|
|
261
|
+
parentRect: n,
|
|
262
|
+
scrollLeft: t.scrollLeft,
|
|
263
|
+
scrollTop: t.scrollTop,
|
|
264
|
+
parentOffsetWidth: t.offsetWidth,
|
|
265
|
+
parentClientWidth: t.clientWidth,
|
|
266
|
+
zoom: r.zoom
|
|
267
|
+
});
|
|
249
268
|
}
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
269
|
+
let D = null;
|
|
270
|
+
function O() {
|
|
271
|
+
D?.();
|
|
272
|
+
let e = 0, t = "", n = 0, r = 0, i = (a) => {
|
|
273
|
+
r === 0 && (r = a);
|
|
274
|
+
let o = a - r;
|
|
275
|
+
T();
|
|
276
|
+
let s = p.value, c = s ? `${s.left}|${s.top}|${s.width}|${s.height}` : "";
|
|
277
|
+
n = c === t ? n + 1 : 0, t = c, !(o >= sn && n >= 2) && o < cn && (e = requestAnimationFrame(i));
|
|
258
278
|
};
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
279
|
+
e = requestAnimationFrame(i);
|
|
280
|
+
let a = setTimeout(T, sn);
|
|
281
|
+
D = () => {
|
|
282
|
+
cancelAnimationFrame(e), clearTimeout(a);
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
W(() => r.imageInfo, (e, t, n) => {
|
|
286
|
+
if (!r.imageInfo) {
|
|
287
|
+
p.value = null;
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
O(), n(() => D?.());
|
|
291
|
+
}, { immediate: !0 }), W(() => r.zoom, () => {
|
|
292
|
+
r.imageInfo && O();
|
|
293
|
+
}), W(() => r.imageInfo, (e, t, n) => {
|
|
294
|
+
if (!r.imageInfo) return;
|
|
295
|
+
let i = () => {
|
|
296
|
+
b && cancelAnimationFrame(b), b = requestAnimationFrame(T);
|
|
297
|
+
}, o = a.value?.closest(".docx-editor-vue__pages-viewport");
|
|
298
|
+
o?.addEventListener("scroll", i, { passive: !0 }), window.addEventListener("resize", i, { passive: !0 });
|
|
299
|
+
let s = null, c = !1;
|
|
300
|
+
ce(() => {
|
|
301
|
+
if (c || !r.imageInfo) return;
|
|
302
|
+
let e = te();
|
|
303
|
+
e && (s = new MutationObserver(() => O()), s.observe(e, {
|
|
304
|
+
attributes: !0,
|
|
305
|
+
attributeFilter: ["style"]
|
|
306
|
+
}));
|
|
307
|
+
}), n(() => {
|
|
308
|
+
c = !0, o?.removeEventListener("scroll", i), window.removeEventListener("resize", i), s?.disconnect(), b && cancelAnimationFrame(b);
|
|
267
309
|
});
|
|
268
310
|
}, { immediate: !0 });
|
|
269
|
-
let
|
|
311
|
+
let re = E(() => o.value ? l.value : p.value?.width || 0), ie = E(() => o.value ? u.value : p.value?.height || 0), ae = E(() => {
|
|
270
312
|
let e = p.value;
|
|
271
313
|
if (!e) return {
|
|
272
314
|
position: "absolute",
|
|
@@ -275,20 +317,20 @@ var Gt = /* @__PURE__ */ M({
|
|
|
275
317
|
visibility: "hidden",
|
|
276
318
|
pointerEvents: "none"
|
|
277
319
|
};
|
|
278
|
-
let t =
|
|
320
|
+
let t = o.value ? l.value : e.width, n = o.value ? u.value : e.height, i = r.zoom || 1;
|
|
279
321
|
return {
|
|
280
322
|
position: "absolute",
|
|
281
|
-
left: `${e.left *
|
|
282
|
-
top: `${e.top *
|
|
323
|
+
left: `${e.left * i}px`,
|
|
324
|
+
top: `${e.top * i}px`,
|
|
283
325
|
width: `${t}px`,
|
|
284
326
|
height: `${n}px`,
|
|
285
|
-
transform:
|
|
327
|
+
transform: i === 1 ? void 0 : `scale(${i})`,
|
|
286
328
|
transformOrigin: "top left",
|
|
287
|
-
zIndex:
|
|
329
|
+
zIndex: S.imageOverlay,
|
|
288
330
|
pointerEvents: "auto"
|
|
289
331
|
};
|
|
290
|
-
}),
|
|
291
|
-
let e =
|
|
332
|
+
}), M = E(() => {
|
|
333
|
+
let e = re.value, t = ie.value, n = `${e / 2 - 5}px`, r = `${t / 2 - 5}px`, i = `${e - 5}px`, a = `${t - 5}px`, o = "-5px";
|
|
292
334
|
return [
|
|
293
335
|
{
|
|
294
336
|
pos: "nw",
|
|
@@ -355,24 +397,13 @@ var Gt = /* @__PURE__ */ M({
|
|
|
355
397
|
}
|
|
356
398
|
}
|
|
357
399
|
];
|
|
358
|
-
})
|
|
359
|
-
function
|
|
360
|
-
|
|
361
|
-
if (oe(e) && a) {
|
|
362
|
-
let e = Math.max(c / r, l / i);
|
|
363
|
-
c = r * e, l = i * e;
|
|
364
|
-
}
|
|
365
|
-
return {
|
|
366
|
-
width: o === 0 ? r : Math.max(20, Math.min(2e3, c)),
|
|
367
|
-
height: s === 0 ? i : Math.max(20, Math.min(2e3, l))
|
|
368
|
-
};
|
|
369
|
-
}
|
|
370
|
-
function j(e, t) {
|
|
371
|
-
!i.imageInfo || !p.value || (m = t, h = e.clientX, g = e.clientY, _ = p.value.width, v = p.value.height, y = { ...p.value }, u.value = Math.round(_), d.value = Math.round(v), s.value = !0, a("interact-start"), document.addEventListener("mousemove", M), document.addEventListener("mouseup", ce));
|
|
400
|
+
});
|
|
401
|
+
function N(e, t) {
|
|
402
|
+
!r.imageInfo || !p.value || (m = t, h = e.clientX, g = e.clientY, _ = p.value.width, v = p.value.height, y = { ...p.value }, l.value = Math.round(_), u.value = Math.round(v), o.value = !0, i("interact-start"), document.addEventListener("mousemove", oe), document.addEventListener("mouseup", se));
|
|
372
403
|
}
|
|
373
|
-
function
|
|
374
|
-
let t =
|
|
375
|
-
|
|
404
|
+
function oe(e) {
|
|
405
|
+
let t = r.zoom, n = (e.clientX - h) / t, i = (e.clientY - g) / t, a = !e.shiftKey, o = Ye(m, n, i, _, v, a);
|
|
406
|
+
l.value = Math.round(o.width), u.value = Math.round(o.height);
|
|
376
407
|
let s = y;
|
|
377
408
|
s && (p.value = {
|
|
378
409
|
left: m.includes("w") ? s.left + (s.width - o.width) : s.left,
|
|
@@ -381,151 +412,151 @@ var Gt = /* @__PURE__ */ M({
|
|
|
381
412
|
height: s.height
|
|
382
413
|
});
|
|
383
414
|
}
|
|
384
|
-
function
|
|
385
|
-
document.removeEventListener("mousemove",
|
|
386
|
-
let e =
|
|
415
|
+
function se() {
|
|
416
|
+
document.removeEventListener("mousemove", oe), document.removeEventListener("mouseup", se), o.value = !1, y = null, i("interact-end");
|
|
417
|
+
let e = r.view, t = r.imageInfo;
|
|
387
418
|
if (!e || !t) {
|
|
388
|
-
|
|
419
|
+
T();
|
|
389
420
|
return;
|
|
390
421
|
}
|
|
391
|
-
let n =
|
|
392
|
-
n !== null &&
|
|
422
|
+
let n = Qe(e, t.pmPos, l.value, u.value);
|
|
423
|
+
n !== null && ve(n), ce(() => T());
|
|
393
424
|
}
|
|
394
|
-
let le = 0,
|
|
395
|
-
function
|
|
425
|
+
let le = 0, I = 0, ue = 0, de = 0, fe = null, H = null;
|
|
426
|
+
function pe(e) {
|
|
396
427
|
if (!e) return 0;
|
|
397
428
|
let t = e.match(/rotate\((-?\d+(?:\.\d+)?)deg\)/);
|
|
398
429
|
return t ? parseFloat(t[1]) : 0;
|
|
399
430
|
}
|
|
400
|
-
function
|
|
431
|
+
function U(e, t) {
|
|
401
432
|
let n = /scaleX\(-1\)/.test(e || ""), r = /scaleY\(-1\)/.test(e || ""), i = [], a = (t % 360 + 360) % 360;
|
|
402
433
|
return a !== 0 && i.push(`rotate(${a}deg)`), n && i.push("scaleX(-1)"), r && i.push("scaleY(-1)"), i.length > 0 ? i.join(" ") : null;
|
|
403
434
|
}
|
|
404
|
-
function
|
|
405
|
-
return Math.atan2(e - le, -(t -
|
|
435
|
+
function me(e, t) {
|
|
436
|
+
return Math.atan2(e - le, -(t - I)) * 180 / Math.PI;
|
|
406
437
|
}
|
|
407
|
-
function
|
|
408
|
-
if (!
|
|
409
|
-
let t =
|
|
410
|
-
le = t.left + t.width / 2,
|
|
411
|
-
let n = ee(
|
|
412
|
-
|
|
438
|
+
function G(e) {
|
|
439
|
+
if (!r.imageInfo) return;
|
|
440
|
+
let t = r.imageInfo.element.getBoundingClientRect();
|
|
441
|
+
le = t.left + t.width / 2, I = t.top + t.height / 2;
|
|
442
|
+
let n = ee(r.view, r.imageInfo.pmPos);
|
|
443
|
+
fe = n && n.attrs.transform || null, de = pe(fe), H = r.imageInfo.element.querySelector("img"), ue = me(e.clientX, e.clientY), f.value = de, c.value = !0, i("interact-start"), document.addEventListener("mousemove", K), document.addEventListener("mouseup", he);
|
|
413
444
|
}
|
|
414
|
-
function
|
|
415
|
-
let t =
|
|
416
|
-
e.shiftKey || (n = Math.round(n /
|
|
445
|
+
function K(e) {
|
|
446
|
+
let t = me(e.clientX, e.clientY) - ue, n = de + t;
|
|
447
|
+
e.shiftKey || (n = Math.round(n / on) * on), f.value = (n % 360 + 360) % 360, H && (H.style.transform = U(fe, f.value) || "");
|
|
417
448
|
}
|
|
418
|
-
function
|
|
419
|
-
document.removeEventListener("mousemove",
|
|
420
|
-
let e =
|
|
449
|
+
function he() {
|
|
450
|
+
document.removeEventListener("mousemove", K), document.removeEventListener("mouseup", he), c.value = !1, i("interact-end");
|
|
451
|
+
let e = r.view, t = r.imageInfo;
|
|
421
452
|
try {
|
|
422
453
|
let n = e && t ? ee(e, t.pmPos) : null;
|
|
423
454
|
e && t && n && (e.dispatch(e.state.tr.setNodeMarkup(t.pmPos, void 0, {
|
|
424
455
|
...n.attrs,
|
|
425
|
-
transform:
|
|
426
|
-
})),
|
|
456
|
+
transform: U(n.attrs.transform, f.value)
|
|
457
|
+
})), ve(t.pmPos));
|
|
427
458
|
} catch {} finally {
|
|
428
|
-
|
|
459
|
+
H && (H.style.transform = ""), H = null, fe = null;
|
|
429
460
|
}
|
|
430
|
-
|
|
461
|
+
ce(() => T());
|
|
431
462
|
}
|
|
432
|
-
let
|
|
433
|
-
function
|
|
434
|
-
if (!
|
|
435
|
-
let t = e.clientX, n = e.clientY,
|
|
436
|
-
let
|
|
437
|
-
if (!(!o && Math.sqrt(
|
|
463
|
+
let Y = null;
|
|
464
|
+
function ge(e) {
|
|
465
|
+
if (!r.imageInfo || !p.value) return;
|
|
466
|
+
let t = e.clientX, n = e.clientY, a = p.value, o = !1, c = (e) => {
|
|
467
|
+
let c = e.clientX - t, l = e.clientY - n;
|
|
468
|
+
if (!(!o && Math.sqrt(c * c + l * l) < an)) {
|
|
438
469
|
if (!o) {
|
|
439
|
-
o = !0,
|
|
440
|
-
let e =
|
|
441
|
-
|
|
470
|
+
o = !0, s.value = !0, i("interact-start"), Y = document.createElement("div"), Y.style.cssText = "position: fixed; pointer-events: none; z-index: 10000; opacity: 0.5; border: 2px dashed #2563eb; border-radius: 4px; background: rgba(37, 99, 235, 0.1);";
|
|
471
|
+
let e = r.zoom;
|
|
472
|
+
Y.style.width = `${a.width * e}px`, Y.style.height = `${a.height * e}px`, document.body.appendChild(Y);
|
|
442
473
|
}
|
|
443
|
-
if (
|
|
444
|
-
let t =
|
|
445
|
-
|
|
474
|
+
if (Y) {
|
|
475
|
+
let t = r.zoom;
|
|
476
|
+
Y.style.left = `${e.clientX - a.width * t / 2}px`, Y.style.top = `${e.clientY - a.height * t / 2}px`;
|
|
446
477
|
}
|
|
447
478
|
}
|
|
448
479
|
}, l = (e) => {
|
|
449
|
-
document.removeEventListener("mousemove",
|
|
480
|
+
document.removeEventListener("mousemove", c), document.removeEventListener("mouseup", l), x = null, C = null, Y &&= (Y.remove(), null), s.value = !1, o && (i("interact-end"), _e(e.clientX, e.clientY));
|
|
450
481
|
};
|
|
451
|
-
x =
|
|
482
|
+
x = c, C = l, document.addEventListener("mousemove", c), document.addEventListener("mouseup", l);
|
|
452
483
|
}
|
|
453
|
-
function
|
|
454
|
-
let n =
|
|
455
|
-
if (!n || !
|
|
456
|
-
let
|
|
457
|
-
if (
|
|
458
|
-
if (
|
|
459
|
-
let
|
|
460
|
-
if (!
|
|
484
|
+
function _e(e, t) {
|
|
485
|
+
let n = r.view, i = r.imageInfo;
|
|
486
|
+
if (!n || !i) return;
|
|
487
|
+
let o = ee(n, i.pmPos);
|
|
488
|
+
if (o) {
|
|
489
|
+
if ($e(o)) {
|
|
490
|
+
let o = (a.value?.closest(".docx-editor-vue__pages-viewport"))?.querySelectorAll(".layout-page");
|
|
491
|
+
if (!o || o.length === 0) return;
|
|
461
492
|
let s = null;
|
|
462
|
-
for (let e of
|
|
493
|
+
for (let e of o) {
|
|
463
494
|
let n = e.getBoundingClientRect();
|
|
464
495
|
if (t >= n.top && t <= n.bottom) {
|
|
465
496
|
s = e.querySelector(".layout-page-content");
|
|
466
497
|
break;
|
|
467
498
|
}
|
|
468
499
|
}
|
|
469
|
-
if (s ||=
|
|
470
|
-
let c = s.getBoundingClientRect(), l =
|
|
471
|
-
f !== null &&
|
|
500
|
+
if (s ||= o[o.length - 1].querySelector(".layout-page-content"), !s) return;
|
|
501
|
+
let c = s.getBoundingClientRect(), l = r.zoom, u = Be((e - c.left) / l), d = Be((t - c.top) / l), f = Xe(n, i.pmPos, u, d);
|
|
502
|
+
f !== null && ve(f);
|
|
472
503
|
} else {
|
|
473
|
-
let
|
|
474
|
-
if (!
|
|
475
|
-
let a =
|
|
504
|
+
let r = te();
|
|
505
|
+
if (!r) return;
|
|
506
|
+
let a = Ke(r, e, t, 1);
|
|
476
507
|
if (a == null || a < 0) return;
|
|
477
|
-
let o =
|
|
478
|
-
o !== null &&
|
|
508
|
+
let o = Ze(n, i.pmPos, a);
|
|
509
|
+
o !== null && ve(o);
|
|
479
510
|
}
|
|
480
|
-
|
|
511
|
+
ce(() => T());
|
|
481
512
|
}
|
|
482
513
|
}
|
|
483
|
-
function
|
|
484
|
-
let t =
|
|
514
|
+
function ve(e) {
|
|
515
|
+
let t = r.view;
|
|
485
516
|
if (t) try {
|
|
486
|
-
let n =
|
|
517
|
+
let n = J.create(t.state.doc, e);
|
|
487
518
|
t.dispatch(t.state.tr.setSelection(n));
|
|
488
519
|
} catch {}
|
|
489
520
|
}
|
|
490
521
|
return F(() => {
|
|
491
|
-
document.removeEventListener("mousemove",
|
|
492
|
-
}), (t,
|
|
522
|
+
document.removeEventListener("mousemove", oe), document.removeEventListener("mouseup", se), document.removeEventListener("mousemove", K), document.removeEventListener("mouseup", he), x && document.removeEventListener("mousemove", x), C && document.removeEventListener("mouseup", C), Y &&= (Y.remove(), null), b && cancelAnimationFrame(b), D?.();
|
|
523
|
+
}), (t, r) => e.imageInfo ? (L(), A("div", {
|
|
493
524
|
key: 0,
|
|
494
525
|
ref_key: "overlayRootRef",
|
|
495
|
-
ref:
|
|
526
|
+
ref: a,
|
|
496
527
|
class: "image-overlay",
|
|
497
|
-
style: P(
|
|
498
|
-
onMousedown:
|
|
528
|
+
style: P(ae.value),
|
|
529
|
+
onMousedown: r[3] ||= q(() => {}, ["stop"])
|
|
499
530
|
}, [
|
|
500
|
-
|
|
501
|
-
|
|
531
|
+
r[4] ||= j("div", { class: "image-overlay__border" }, null, -1),
|
|
532
|
+
j("div", {
|
|
502
533
|
class: "image-overlay__body",
|
|
503
|
-
style: P({ cursor:
|
|
504
|
-
onMousedown:
|
|
505
|
-
onContextmenu:
|
|
534
|
+
style: P({ cursor: s.value ? "grabbing" : "grab" }),
|
|
535
|
+
onMousedown: r[0] ||= q((e) => ge(e), ["prevent", "stop"]),
|
|
536
|
+
onContextmenu: r[1] ||= q((e) => t.$emit("context-menu", e), ["prevent", "stop"])
|
|
506
537
|
}, null, 36),
|
|
507
|
-
(L(!0),
|
|
538
|
+
(L(!0), A(w, null, z(M.value, (e) => (L(), A("div", {
|
|
508
539
|
key: e.pos,
|
|
509
540
|
class: "image-overlay__handle",
|
|
510
541
|
style: P(e.style),
|
|
511
542
|
"data-handle": e.pos,
|
|
512
|
-
onMousedown:
|
|
513
|
-
}, null, 44,
|
|
514
|
-
|
|
515
|
-
|
|
543
|
+
onMousedown: q((t) => N(t, e.pos), ["prevent", "stop"])
|
|
544
|
+
}, null, 44, en))), 128)),
|
|
545
|
+
r[5] ||= j("div", { class: "image-overlay__rotate-line" }, null, -1),
|
|
546
|
+
j("div", {
|
|
516
547
|
class: "image-overlay__rotate-handle",
|
|
517
|
-
style: P({ left: `${
|
|
518
|
-
title: V(
|
|
519
|
-
onMousedown:
|
|
520
|
-
}, null, 44,
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
], 36)) :
|
|
524
|
-
}
|
|
525
|
-
}), [["__scopeId", "data-v-
|
|
548
|
+
style: P({ left: `${re.value / 2 - 7}px` }),
|
|
549
|
+
title: V(n)("imageOverlay.rotate"),
|
|
550
|
+
onMousedown: r[2] ||= q((e) => G(e), ["prevent", "stop"])
|
|
551
|
+
}, null, 44, tn),
|
|
552
|
+
o.value ? (L(), A("div", nn, B(Math.round(l.value)) + " × " + B(Math.round(u.value)), 1)) : k("", !0),
|
|
553
|
+
c.value ? (L(), A("div", rn, B(Math.round(f.value)) + "° ", 1)) : k("", !0)
|
|
554
|
+
], 36)) : k("", !0);
|
|
555
|
+
}
|
|
556
|
+
}), [["__scopeId", "data-v-2c4a2064"]]), un = { class: "doc-outline__header" }, dn = { class: "doc-outline__body" }, fn = {
|
|
526
557
|
key: 0,
|
|
527
558
|
class: "doc-outline__empty"
|
|
528
|
-
},
|
|
559
|
+
}, pn = ["onMousedown"], mn = /* @__PURE__ */ b(/* @__PURE__ */ N({
|
|
529
560
|
__name: "DocumentOutline",
|
|
530
561
|
props: {
|
|
531
562
|
isOpen: { type: Boolean },
|
|
@@ -533,28 +564,28 @@ var Gt = /* @__PURE__ */ M({
|
|
|
533
564
|
},
|
|
534
565
|
emits: ["close", "navigate"],
|
|
535
566
|
setup(e) {
|
|
536
|
-
return (t, n) => e.isOpen ? (L(),
|
|
567
|
+
return (t, n) => e.isOpen ? (L(), A("nav", {
|
|
537
568
|
key: 0,
|
|
538
569
|
class: "doc-outline",
|
|
539
570
|
role: "navigation",
|
|
540
571
|
"aria-label": "Document outline",
|
|
541
|
-
onMousedown: n[1] ||=
|
|
542
|
-
}, [
|
|
572
|
+
onMousedown: n[1] ||= q(() => {}, ["stop"])
|
|
573
|
+
}, [j("div", un, [j("button", {
|
|
543
574
|
class: "doc-outline__back",
|
|
544
575
|
title: "Close outline",
|
|
545
576
|
"aria-label": "Close outline",
|
|
546
577
|
onClick: n[0] ||= (e) => t.$emit("close")
|
|
547
|
-
}, [
|
|
578
|
+
}, [M(r, {
|
|
548
579
|
name: "arrow_back",
|
|
549
580
|
size: 20
|
|
550
|
-
})]), n[2] ||=
|
|
581
|
+
})]), n[2] ||= j("span", { class: "doc-outline__title" }, "Document Outline", -1)]), j("div", dn, [e.headings.length === 0 ? (L(), A("div", fn, " No headings found ")) : k("", !0), (L(!0), A(w, null, z(e.headings, (e, n) => (L(), A("button", {
|
|
551
582
|
key: n,
|
|
552
583
|
class: "doc-outline__item",
|
|
553
584
|
style: P({ paddingLeft: 12 + (e.level - 1) * 16 + "px" }),
|
|
554
|
-
onMousedown:
|
|
555
|
-
}, B(e.text || "(untitled)"), 45,
|
|
585
|
+
onMousedown: q((n) => t.$emit("navigate", e.pmPos), ["prevent"])
|
|
586
|
+
}, B(e.text || "(untitled)"), 45, pn))), 128))])], 32)) : k("", !0);
|
|
556
587
|
}
|
|
557
|
-
}), [["__scopeId", "data-v-cb2cdc39"]]),
|
|
588
|
+
}), [["__scopeId", "data-v-cb2cdc39"]]), hn = /* @__PURE__ */ b(/* @__PURE__ */ N({
|
|
558
589
|
__name: "PageIndicator",
|
|
559
590
|
props: {
|
|
560
591
|
currentPage: {},
|
|
@@ -562,8 +593,8 @@ var Gt = /* @__PURE__ */ M({
|
|
|
562
593
|
visible: { type: Boolean }
|
|
563
594
|
},
|
|
564
595
|
setup(e) {
|
|
565
|
-
let { t } =
|
|
566
|
-
return (n, r) => (L(),
|
|
596
|
+
let { t } = d();
|
|
597
|
+
return (n, r) => (L(), A("div", {
|
|
567
598
|
class: "docx-editor-vue__page-indicator",
|
|
568
599
|
style: P({ opacity: +!!e.visible }),
|
|
569
600
|
"aria-live": "polite",
|
|
@@ -573,10 +604,10 @@ var Gt = /* @__PURE__ */ M({
|
|
|
573
604
|
total: e.totalPages
|
|
574
605
|
})), 5));
|
|
575
606
|
}
|
|
576
|
-
}), [["__scopeId", "data-v-d117bf6e"]]),
|
|
607
|
+
}), [["__scopeId", "data-v-d117bf6e"]]), gn = { class: "hf-editor__label" }, _n = {
|
|
577
608
|
class: "hf-editor__actions",
|
|
578
609
|
style: { position: "relative" }
|
|
579
|
-
},
|
|
610
|
+
}, vn = /* @__PURE__ */ b(/* @__PURE__ */ N({
|
|
580
611
|
__name: "InlineHeaderFooterEditor",
|
|
581
612
|
props: {
|
|
582
613
|
isOpen: { type: Boolean },
|
|
@@ -614,68 +645,68 @@ var Gt = /* @__PURE__ */ M({
|
|
|
614
645
|
pointerEvents: "none"
|
|
615
646
|
});
|
|
616
647
|
}
|
|
617
|
-
|
|
648
|
+
W(() => n.isOpen, (e) => {
|
|
618
649
|
e && (s(), n.view?.focus());
|
|
619
|
-
}),
|
|
650
|
+
}), W(() => n.targetRect, () => {
|
|
620
651
|
n.isOpen && s();
|
|
621
652
|
}, { deep: !0 });
|
|
622
653
|
function c() {
|
|
623
|
-
n.view && (r("save",
|
|
654
|
+
n.view && (r("save", st(n.view.state.doc)), r("close"));
|
|
624
655
|
}
|
|
625
|
-
return (t, n) => e.isOpen ? (L(),
|
|
656
|
+
return (t, n) => e.isOpen ? (L(), A("div", {
|
|
626
657
|
key: 0,
|
|
627
658
|
class: "hf-editor",
|
|
628
659
|
style: P(i.value)
|
|
629
|
-
}, [
|
|
630
|
-
class:
|
|
631
|
-
onMousedown: n[8] ||=
|
|
632
|
-
onContextmenu: n[9] ||=
|
|
633
|
-
}, [
|
|
634
|
-
|
|
660
|
+
}, [j("div", {
|
|
661
|
+
class: le(["hf-editor__toolbar", e.position === "footer" ? "hf-editor__toolbar--below" : "hf-editor__toolbar--above"]),
|
|
662
|
+
onMousedown: n[8] ||= q(() => {}, ["stop"]),
|
|
663
|
+
onContextmenu: n[9] ||= q(() => {}, ["stop"])
|
|
664
|
+
}, [j("span", gn, B(e.position === "header" ? "Header" : "Footer"), 1), j("div", _n, [
|
|
665
|
+
j("button", {
|
|
635
666
|
class: "hf-editor__btn",
|
|
636
667
|
title: "Options",
|
|
637
|
-
onMousedown: n[0] ||=
|
|
668
|
+
onMousedown: n[0] ||= q(() => {}, ["prevent"]),
|
|
638
669
|
onClick: n[1] ||= (e) => a.value = !a.value
|
|
639
670
|
}, " Options ▾ ", 32),
|
|
640
|
-
a.value ? (L(),
|
|
671
|
+
a.value ? (L(), A("div", {
|
|
641
672
|
key: 0,
|
|
642
673
|
class: "hf-editor__dropdown",
|
|
643
|
-
onMousedown: n[4] ||=
|
|
644
|
-
onContextmenu: n[5] ||=
|
|
645
|
-
}, [
|
|
674
|
+
onMousedown: n[4] ||= q(() => {}, ["stop"]),
|
|
675
|
+
onContextmenu: n[5] ||= q(() => {}, ["stop"])
|
|
676
|
+
}, [j("button", {
|
|
646
677
|
type: "button",
|
|
647
678
|
class: "hf-editor__dropdown-item",
|
|
648
679
|
onClick: n[2] ||= (e) => {
|
|
649
680
|
a.value = !1, o("PAGE");
|
|
650
681
|
}
|
|
651
|
-
}, " Insert current page number "),
|
|
682
|
+
}, " Insert current page number "), j("button", {
|
|
652
683
|
type: "button",
|
|
653
684
|
class: "hf-editor__dropdown-item",
|
|
654
685
|
onClick: n[3] ||= (e) => {
|
|
655
686
|
a.value = !1, o("NUMPAGES");
|
|
656
687
|
}
|
|
657
|
-
}, " Insert total page count ")], 32)) :
|
|
658
|
-
|
|
688
|
+
}, " Insert total page count ")], 32)) : k("", !0),
|
|
689
|
+
j("button", {
|
|
659
690
|
class: "hf-editor__btn",
|
|
660
691
|
title: "Remove",
|
|
661
|
-
onMousedown: n[6] ||=
|
|
692
|
+
onMousedown: n[6] ||= q((e) => t.$emit("remove"), ["prevent"])
|
|
662
693
|
}, " Remove ", 32),
|
|
663
|
-
|
|
694
|
+
j("button", {
|
|
664
695
|
class: "hf-editor__btn hf-editor__btn--primary",
|
|
665
696
|
title: "Save",
|
|
666
|
-
onMousedown:
|
|
697
|
+
onMousedown: q(c, ["prevent"])
|
|
667
698
|
}, " Save ", 32),
|
|
668
|
-
|
|
699
|
+
j("button", {
|
|
669
700
|
class: "hf-editor__btn",
|
|
670
701
|
title: "Cancel",
|
|
671
|
-
onMousedown: n[7] ||=
|
|
702
|
+
onMousedown: n[7] ||= q((e) => t.$emit("close"), ["prevent"])
|
|
672
703
|
}, " Cancel ", 32)
|
|
673
|
-
])], 34)], 4)) :
|
|
704
|
+
])], 34)], 4)) : k("", !0);
|
|
674
705
|
}
|
|
675
|
-
}), [["__scopeId", "data-v-e93a9f94"]]),
|
|
706
|
+
}), [["__scopeId", "data-v-e93a9f94"]]), yn = ["role"], bn = {
|
|
676
707
|
key: 0,
|
|
677
708
|
class: "layout-sdt-widget-empty"
|
|
678
|
-
},
|
|
709
|
+
}, xn = ["aria-selected", "onClick"], Sn = ["value"], Cn = ".layout-sdt-widget, .layout-inline-sdt-widget", wn = /* @__PURE__ */ N({
|
|
679
710
|
__name: "ContentControlWidgets",
|
|
680
711
|
props: {
|
|
681
712
|
container: {},
|
|
@@ -686,130 +717,144 @@ var Gt = /* @__PURE__ */ M({
|
|
|
686
717
|
let t = /^sdt@(\d+)$/.exec(e ?? "");
|
|
687
718
|
return t ? Number(t[1]) : null;
|
|
688
719
|
}
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
let
|
|
692
|
-
|
|
693
|
-
|
|
720
|
+
function n(e) {
|
|
721
|
+
if (e == null || e === "") return null;
|
|
722
|
+
let t = Number(e);
|
|
723
|
+
return Number.isFinite(t) ? t : null;
|
|
724
|
+
}
|
|
725
|
+
function r(e) {
|
|
726
|
+
let r = t(e.dataset.sdtGroupId) ?? n(e.dataset.sdtPos), i = e.dataset.sdtTag;
|
|
727
|
+
return r == null ? i ? { tag: i } : null : i ? {
|
|
728
|
+
pos: r,
|
|
729
|
+
tag: i
|
|
730
|
+
} : { pos: r };
|
|
731
|
+
}
|
|
732
|
+
let i = e, a = R(null), o = R(null);
|
|
733
|
+
function s(e, t) {
|
|
734
|
+
let n = i.view;
|
|
735
|
+
if (n) try {
|
|
736
|
+
let r = e.pos == null ? e.tag ? Fe(n.state, { tag: e.tag }, t) : null : Pe(n.state, e.pos, t);
|
|
737
|
+
if (!r) return;
|
|
738
|
+
n.dispatch(r), n.focus();
|
|
694
739
|
} catch {}
|
|
695
|
-
|
|
740
|
+
a.value = null;
|
|
696
741
|
}
|
|
697
|
-
function
|
|
698
|
-
let
|
|
699
|
-
if (!(!
|
|
700
|
-
let t = e.dataset.sdtRepeat === "add" ?
|
|
701
|
-
|
|
742
|
+
function c(e) {
|
|
743
|
+
let n = i.view, r = t(e.dataset.sdtGroupId);
|
|
744
|
+
if (!(!n || r == null)) try {
|
|
745
|
+
let t = e.dataset.sdtRepeat === "add" ? De(n.state, r) : Z(n.state, r);
|
|
746
|
+
n.dispatch(t), n.focus();
|
|
702
747
|
} catch {}
|
|
703
748
|
}
|
|
704
|
-
function
|
|
749
|
+
function l(e) {
|
|
705
750
|
let t = e.target;
|
|
706
|
-
(t?.closest?.(
|
|
751
|
+
(t?.closest?.(Cn) || t?.closest?.(".layout-sdt-repeat-btn")) && e.preventDefault();
|
|
707
752
|
}
|
|
708
|
-
function
|
|
709
|
-
let t =
|
|
710
|
-
if (!t || !
|
|
711
|
-
let
|
|
712
|
-
|
|
753
|
+
function u(e) {
|
|
754
|
+
let t = i.view, n = e.dataset.sdtWidget, o = r(e);
|
|
755
|
+
if (!t || !n || !o) return;
|
|
756
|
+
let c = o.pos == null ? o.tag ? Ae(t.state.doc, { tag: o.tag })[0] : void 0 : Ae(t.state.doc).find((e) => e.pos === o.pos), l = e.getBoundingClientRect();
|
|
757
|
+
n === "checkbox" ? s(o, {
|
|
713
758
|
kind: "checkbox",
|
|
714
|
-
checked: !
|
|
715
|
-
}) :
|
|
759
|
+
checked: !c?.checked
|
|
760
|
+
}) : n === "dropdown" ? a.value = {
|
|
716
761
|
kind: "dropdown",
|
|
717
|
-
|
|
718
|
-
items:
|
|
719
|
-
current:
|
|
720
|
-
x:
|
|
721
|
-
y:
|
|
722
|
-
} :
|
|
762
|
+
target: o,
|
|
763
|
+
items: c?.listItems ?? [],
|
|
764
|
+
current: c?.text ?? "",
|
|
765
|
+
x: l.left,
|
|
766
|
+
y: l.bottom + 2
|
|
767
|
+
} : n === "date" && (a.value = {
|
|
723
768
|
kind: "date",
|
|
724
|
-
|
|
725
|
-
current:
|
|
726
|
-
x:
|
|
727
|
-
y:
|
|
769
|
+
target: o,
|
|
770
|
+
current: c?.dateValue ?? "",
|
|
771
|
+
x: l.left,
|
|
772
|
+
y: l.bottom + 2
|
|
728
773
|
});
|
|
729
774
|
}
|
|
730
|
-
function
|
|
775
|
+
function d(e) {
|
|
731
776
|
let t = e.target?.closest?.(".layout-sdt-repeat-btn");
|
|
732
777
|
if (t) {
|
|
733
|
-
e.preventDefault(), e.stopPropagation(),
|
|
778
|
+
e.preventDefault(), e.stopPropagation(), c(t);
|
|
734
779
|
return;
|
|
735
780
|
}
|
|
736
|
-
let n = e.target?.closest?.(
|
|
737
|
-
n && (e.preventDefault(), e.stopPropagation(),
|
|
781
|
+
let n = e.target?.closest?.(Cn);
|
|
782
|
+
n && (e.preventDefault(), e.stopPropagation(), u(n));
|
|
738
783
|
}
|
|
739
|
-
function
|
|
784
|
+
function f(e) {
|
|
740
785
|
if (e.key !== "Enter" && e.key !== " ") return;
|
|
741
|
-
let t = e.target?.closest?.(
|
|
742
|
-
t && (e.preventDefault(),
|
|
786
|
+
let t = e.target?.closest?.(Cn);
|
|
787
|
+
t && (e.preventDefault(), u(t));
|
|
743
788
|
}
|
|
744
|
-
function
|
|
745
|
-
|
|
789
|
+
function p(e) {
|
|
790
|
+
a.value && !o.value?.contains(e.target) && (a.value = null);
|
|
746
791
|
}
|
|
747
|
-
function
|
|
748
|
-
e.key === "Escape" && (
|
|
792
|
+
function m(e) {
|
|
793
|
+
e.key === "Escape" && (a.value = null);
|
|
749
794
|
}
|
|
750
|
-
let
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
}, { immediate: !0 }),
|
|
754
|
-
e ? (document.addEventListener("mousedown",
|
|
755
|
-
let e =
|
|
795
|
+
let h = null;
|
|
796
|
+
W(() => i.container, (e) => {
|
|
797
|
+
h && (h.removeEventListener("mousedown", l), h.removeEventListener("click", d), h.removeEventListener("keydown", f)), h = e ?? null, h && (h.addEventListener("mousedown", l), h.addEventListener("click", d), h.addEventListener("keydown", f));
|
|
798
|
+
}, { immediate: !0 }), W(a, (e) => {
|
|
799
|
+
e ? (document.addEventListener("mousedown", p), document.addEventListener("keydown", m), e.kind === "dropdown" && ce(() => {
|
|
800
|
+
let e = o.value?.querySelectorAll(".layout-sdt-widget-option");
|
|
756
801
|
e?.length && ([...e].find((e) => e.getAttribute("aria-selected") === "true") ?? e[0]).focus();
|
|
757
|
-
})) : (document.removeEventListener("mousedown",
|
|
802
|
+
})) : (document.removeEventListener("mousedown", p), document.removeEventListener("keydown", m));
|
|
758
803
|
});
|
|
759
|
-
function
|
|
804
|
+
function g(e) {
|
|
760
805
|
if (e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
|
|
761
|
-
let t = [...
|
|
806
|
+
let t = [...o.value?.querySelectorAll(".layout-sdt-widget-option") ?? []];
|
|
762
807
|
if (!t.length) return;
|
|
763
808
|
e.preventDefault();
|
|
764
809
|
let n = t.indexOf(document.activeElement);
|
|
765
810
|
t[e.key === "ArrowDown" ? (n + 1) % t.length : (n - 1 + t.length) % t.length].focus();
|
|
766
811
|
}
|
|
767
812
|
F(() => {
|
|
768
|
-
|
|
813
|
+
h && (h.removeEventListener("mousedown", l), h.removeEventListener("click", d), h.removeEventListener("keydown", f)), document.removeEventListener("mousedown", p), document.removeEventListener("keydown", m);
|
|
769
814
|
});
|
|
770
|
-
function
|
|
815
|
+
function _(e) {
|
|
771
816
|
let t = e.target.value;
|
|
772
|
-
t &&
|
|
817
|
+
t && a.value && s(a.value.target, {
|
|
773
818
|
kind: "date",
|
|
774
819
|
date: t
|
|
775
820
|
});
|
|
776
821
|
}
|
|
777
|
-
return (e, t) =>
|
|
822
|
+
return (e, t) => a.value ? (L(), A("div", {
|
|
778
823
|
key: 0,
|
|
779
824
|
ref_key: "popupEl",
|
|
780
|
-
ref:
|
|
825
|
+
ref: o,
|
|
781
826
|
class: "layout-sdt-widget-popup",
|
|
782
|
-
role:
|
|
827
|
+
role: a.value.kind === "dropdown" ? "listbox" : void 0,
|
|
783
828
|
style: P({
|
|
784
829
|
position: "fixed",
|
|
785
|
-
top:
|
|
786
|
-
left:
|
|
830
|
+
top: a.value.y + "px",
|
|
831
|
+
left: a.value.x + "px",
|
|
787
832
|
zIndex: 1e3
|
|
788
833
|
}),
|
|
789
|
-
onKeydown:
|
|
790
|
-
onMousedown: t[0] ||=
|
|
791
|
-
}, [
|
|
834
|
+
onKeydown: g,
|
|
835
|
+
onMousedown: t[0] ||= q(() => {}, ["prevent"])
|
|
836
|
+
}, [a.value.kind === "dropdown" ? (L(), A(w, { key: 0 }, [a.value.items.length === 0 ? (L(), A("div", bn, "No options")) : k("", !0), (L(!0), A(w, null, z(a.value.items, (e) => (L(), A("button", {
|
|
792
837
|
key: e.value,
|
|
793
838
|
type: "button",
|
|
794
839
|
role: "option",
|
|
795
|
-
"aria-selected": e.displayText ===
|
|
796
|
-
class:
|
|
797
|
-
onClick: (t) => a
|
|
840
|
+
"aria-selected": e.displayText === a.value.current,
|
|
841
|
+
class: le(["layout-sdt-widget-option", { "is-selected": e.displayText === a.value.current }]),
|
|
842
|
+
onClick: (t) => s(a.value.target, {
|
|
798
843
|
kind: "dropdown",
|
|
799
844
|
value: e.value
|
|
800
845
|
})
|
|
801
|
-
}, B(e.displayText), 11,
|
|
846
|
+
}, B(e.displayText), 11, xn))), 128))], 64)) : (L(), A("input", {
|
|
802
847
|
key: 1,
|
|
803
848
|
type: "date",
|
|
804
849
|
class: "layout-sdt-widget-date",
|
|
805
|
-
value:
|
|
806
|
-
onChange:
|
|
807
|
-
}, null, 40,
|
|
850
|
+
value: a.value.current,
|
|
851
|
+
onChange: _
|
|
852
|
+
}, null, 40, Sn))], 44, yn)) : k("", !0);
|
|
808
853
|
}
|
|
809
|
-
}),
|
|
854
|
+
}), Tn = {
|
|
810
855
|
key: 0,
|
|
811
856
|
class: "docx-editor-vue__title-bar"
|
|
812
|
-
},
|
|
857
|
+
}, En = { class: "docx-editor-vue__title-bar-left" }, Dn = { class: "docx-editor-vue__title-bar-center" }, On = { class: "docx-editor-vue__title-bar-right" }, kn = /* @__PURE__ */ N({
|
|
813
858
|
__name: "DocxEditorMenuBar",
|
|
814
859
|
props: {
|
|
815
860
|
showMenuBar: { type: Boolean },
|
|
@@ -828,38 +873,38 @@ var Gt = /* @__PURE__ */ M({
|
|
|
828
873
|
],
|
|
829
874
|
setup(e, { emit: t }) {
|
|
830
875
|
let n = t;
|
|
831
|
-
return (t, r) => e.showMenuBar ? (L(),
|
|
832
|
-
|
|
833
|
-
|
|
876
|
+
return (t, r) => e.showMenuBar ? (L(), A("div", Tn, [
|
|
877
|
+
j("div", En, [e.renderLogo ? (L(), O(de(e.renderLogo), { key: 0 })) : k("", !0), ue(t.$slots, "title-bar-left")]),
|
|
878
|
+
j("div", Dn, [M(h, {
|
|
834
879
|
"model-value": e.documentName,
|
|
835
880
|
editable: e.documentNameEditable,
|
|
836
881
|
"onUpdate:modelValue": r[0] ||= (e) => n("rename", e)
|
|
837
|
-
}, null, 8, ["model-value", "editable"]),
|
|
882
|
+
}, null, 8, ["model-value", "editable"]), M(v, {
|
|
838
883
|
onAction: r[1] ||= (e) => n("menu-action", e),
|
|
839
884
|
onInsertTable: r[2] ||= (e, t) => n("insert-table", e, t)
|
|
840
885
|
})]),
|
|
841
|
-
|
|
842
|
-
])) :
|
|
886
|
+
j("div", On, [ue(t.$slots, "title-bar-right"), e.renderTitleBarRight ? (L(), O(de(e.renderTitleBarRight), { key: 0 })) : k("", !0)])
|
|
887
|
+
])) : k("", !0);
|
|
843
888
|
}
|
|
844
|
-
}),
|
|
889
|
+
}), An = ["aria-label"], jn = { class: "wm-header" }, Mn = { class: "wm-body" }, Nn = { class: "wm-radio-row" }, $ = ["checked"], Pn = {
|
|
845
890
|
for: "wm-none",
|
|
846
891
|
class: "wm-inline-label"
|
|
847
|
-
},
|
|
892
|
+
}, Fn = { class: "wm-radio-row" }, In = ["checked"], Ln = {
|
|
848
893
|
for: "wm-picture",
|
|
849
894
|
class: "wm-inline-label"
|
|
850
|
-
},
|
|
895
|
+
}, Rn = {
|
|
851
896
|
key: 0,
|
|
852
897
|
class: "wm-subform"
|
|
853
|
-
},
|
|
898
|
+
}, zn = { class: "wm-row" }, Bn = {
|
|
854
899
|
key: 0,
|
|
855
900
|
class: "wm-row"
|
|
856
|
-
},
|
|
901
|
+
}, Vn = ["src"], Hn = { class: "wm-row" }, Un = { class: "wm-label" }, Wn = { class: "wm-inline-label" }, Gn = { class: "wm-radio-row" }, Kn = ["checked"], qn = {
|
|
857
902
|
for: "wm-text",
|
|
858
903
|
class: "wm-inline-label"
|
|
859
|
-
},
|
|
904
|
+
}, Jn = {
|
|
860
905
|
key: 1,
|
|
861
906
|
class: "wm-subform"
|
|
862
|
-
},
|
|
907
|
+
}, Yn = { class: "wm-row" }, Xn = { class: "wm-label" }, Zn = ["value"], Qn = ["value"], $n = { class: "wm-row" }, er = { class: "wm-label" }, tr = { class: "wm-row" }, nr = { class: "wm-label" }, rr = ["value"], ir = { class: "wm-row" }, ar = { class: "wm-label" }, or = { class: "wm-inline-label" }, sr = { class: "wm-row" }, cr = { class: "wm-label" }, lr = { class: "wm-row" }, ur = { class: "wm-label" }, dr = { class: "wm-inline-label" }, fr = ["checked"], pr = { class: "wm-inline-label" }, mr = ["checked"], hr = { class: "wm-inline-label" }, gr = { class: "wm-footer" }, _r = ["disabled"], vr = /* @__PURE__ */ b(/* @__PURE__ */ N({
|
|
863
908
|
__name: "WatermarkDialog",
|
|
864
909
|
props: {
|
|
865
910
|
isOpen: { type: Boolean },
|
|
@@ -867,33 +912,33 @@ var Gt = /* @__PURE__ */ M({
|
|
|
867
912
|
},
|
|
868
913
|
emits: ["close", "apply"],
|
|
869
914
|
setup(e, { emit: t }) {
|
|
870
|
-
let
|
|
915
|
+
let n = [
|
|
871
916
|
"CONFIDENTIAL",
|
|
872
917
|
"DRAFT",
|
|
873
918
|
"DO NOT COPY",
|
|
874
919
|
"SAMPLE",
|
|
875
920
|
"URGENT",
|
|
876
921
|
"ASAP"
|
|
877
|
-
],
|
|
922
|
+
], r = [
|
|
878
923
|
"Calibri",
|
|
879
924
|
"Arial",
|
|
880
925
|
"Times New Roman",
|
|
881
926
|
"Georgia",
|
|
882
927
|
"Verdana",
|
|
883
928
|
"Courier New"
|
|
884
|
-
], { t:
|
|
885
|
-
|
|
929
|
+
], { t: i } = d(), a = e, o = t, s = R("none"), c = R("CONFIDENTIAL"), l = R("Calibri"), u = R(!0), f = R(54), p = R("#C0C0C0"), m = R("diagonal"), h = R(!0), g = R(void 0), _ = R(void 0), v = R(100), y = R(!0);
|
|
930
|
+
W(() => a.isOpen, (e) => {
|
|
886
931
|
if (!e) return;
|
|
887
|
-
let t =
|
|
888
|
-
t?.kind === "text" ? (
|
|
932
|
+
let t = a.current;
|
|
933
|
+
t?.kind === "text" ? (s.value = "text", c.value = t.text, l.value = t.font || "Calibri", u.value = t.fontSize === void 0, t.fontSize !== void 0 && (f.value = t.fontSize), p.value = t.color || "#C0C0C0", m.value = t.layout, h.value = t.semitransparent) : t?.kind === "picture" ? (s.value = "picture", g.value = t.dataUrl, _.value = t.widthEmu !== void 0 && t.heightEmu !== void 0 ? {
|
|
889
934
|
widthEmu: t.widthEmu,
|
|
890
935
|
heightEmu: t.heightEmu
|
|
891
|
-
} : void 0, v.value = Math.round((t.scale || 1) * 100), y.value = t.washout) :
|
|
936
|
+
} : void 0, v.value = Math.round((t.scale || 1) * 100), y.value = t.washout) : s.value = "none";
|
|
892
937
|
}, { immediate: !0 });
|
|
893
|
-
let b =
|
|
938
|
+
let b = E(() => s.value === "picture" && !g.value);
|
|
894
939
|
function x(e) {
|
|
895
940
|
let t = e.target.value;
|
|
896
|
-
t && (
|
|
941
|
+
t && (c.value = t);
|
|
897
942
|
}
|
|
898
943
|
function S(e) {
|
|
899
944
|
let t = e.target.files?.[0];
|
|
@@ -904,27 +949,27 @@ var Gt = /* @__PURE__ */ M({
|
|
|
904
949
|
if (g.value = e, _.value = void 0, !e) return;
|
|
905
950
|
let t = new Image();
|
|
906
951
|
t.onload = () => {
|
|
907
|
-
_.value =
|
|
952
|
+
_.value = lt(t.naturalWidth, t.naturalHeight);
|
|
908
953
|
}, t.src = e;
|
|
909
954
|
}, n.readAsDataURL(t);
|
|
910
955
|
}
|
|
911
956
|
function C() {
|
|
912
|
-
|
|
957
|
+
o("close");
|
|
913
958
|
}
|
|
914
959
|
function ee() {
|
|
915
|
-
if (
|
|
916
|
-
else if (
|
|
960
|
+
if (s.value === "none") o("apply", null);
|
|
961
|
+
else if (s.value === "text") o("apply", {
|
|
917
962
|
kind: "text",
|
|
918
|
-
text:
|
|
919
|
-
font:
|
|
963
|
+
text: c.value,
|
|
964
|
+
font: l.value,
|
|
920
965
|
color: p.value,
|
|
921
966
|
semitransparent: h.value,
|
|
922
967
|
layout: m.value,
|
|
923
|
-
fontSize:
|
|
968
|
+
fontSize: u.value ? void 0 : f.value
|
|
924
969
|
});
|
|
925
970
|
else {
|
|
926
971
|
if (!g.value) return;
|
|
927
|
-
|
|
972
|
+
o("apply", {
|
|
928
973
|
kind: "picture",
|
|
929
974
|
dataUrl: g.value,
|
|
930
975
|
scale: v.value / 100,
|
|
@@ -937,147 +982,147 @@ var Gt = /* @__PURE__ */ M({
|
|
|
937
982
|
function te(e) {
|
|
938
983
|
e.key === "Escape" && C();
|
|
939
984
|
}
|
|
940
|
-
return (t,
|
|
985
|
+
return (t, a) => e.isOpen ? (L(), A("div", {
|
|
941
986
|
key: 0,
|
|
942
987
|
class: "wm-overlay",
|
|
943
|
-
onMousedown:
|
|
988
|
+
onMousedown: q(C, ["self"]),
|
|
944
989
|
onKeydown: te
|
|
945
|
-
}, [
|
|
990
|
+
}, [j("div", {
|
|
946
991
|
class: "wm-dialog",
|
|
947
992
|
role: "dialog",
|
|
948
|
-
"aria-label": V(
|
|
949
|
-
onMousedown:
|
|
993
|
+
"aria-label": V(i)("dialogs.watermark.title"),
|
|
994
|
+
onMousedown: a[13] ||= q(() => {}, ["stop"])
|
|
950
995
|
}, [
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
996
|
+
j("div", jn, B(V(i)("dialogs.watermark.title")), 1),
|
|
997
|
+
j("div", Mn, [
|
|
998
|
+
j("div", Nn, [j("input", {
|
|
954
999
|
id: "wm-none",
|
|
955
1000
|
type: "radio",
|
|
956
|
-
checked:
|
|
957
|
-
onChange:
|
|
958
|
-
}, null, 40,
|
|
959
|
-
|
|
1001
|
+
checked: s.value === "none",
|
|
1002
|
+
onChange: a[0] ||= (e) => s.value = "none"
|
|
1003
|
+
}, null, 40, $), j("label", Pn, B(V(i)("dialogs.watermark.noWatermark")), 1)]),
|
|
1004
|
+
j("div", Fn, [j("input", {
|
|
960
1005
|
id: "wm-picture",
|
|
961
1006
|
type: "radio",
|
|
962
|
-
checked:
|
|
963
|
-
onChange:
|
|
964
|
-
}, null, 40,
|
|
965
|
-
|
|
966
|
-
|
|
1007
|
+
checked: s.value === "picture",
|
|
1008
|
+
onChange: a[1] ||= (e) => s.value = "picture"
|
|
1009
|
+
}, null, 40, In), j("label", Ln, B(V(i)("dialogs.watermark.picture")), 1)]),
|
|
1010
|
+
s.value === "picture" ? (L(), A("div", Rn, [
|
|
1011
|
+
j("div", zn, [j("input", {
|
|
967
1012
|
type: "file",
|
|
968
1013
|
accept: "image/*",
|
|
969
1014
|
onChange: S
|
|
970
1015
|
}, null, 32)]),
|
|
971
|
-
g.value ? (L(),
|
|
1016
|
+
g.value ? (L(), A("div", Bn, [j("img", {
|
|
972
1017
|
src: g.value,
|
|
973
1018
|
alt: "",
|
|
974
1019
|
class: "wm-preview"
|
|
975
|
-
}, null, 8,
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
1020
|
+
}, null, 8, Vn)])) : k("", !0),
|
|
1021
|
+
j("div", Hn, [
|
|
1022
|
+
j("span", Un, B(V(i)("dialogs.watermark.scale")), 1),
|
|
1023
|
+
G(j("input", {
|
|
979
1024
|
class: "wm-input wm-input--narrow",
|
|
980
1025
|
type: "number",
|
|
981
1026
|
min: "10",
|
|
982
1027
|
max: "500",
|
|
983
|
-
"onUpdate:modelValue":
|
|
1028
|
+
"onUpdate:modelValue": a[2] ||= (e) => v.value = e
|
|
984
1029
|
}, null, 512), [[
|
|
985
|
-
|
|
1030
|
+
U,
|
|
986
1031
|
v.value,
|
|
987
1032
|
void 0,
|
|
988
1033
|
{ number: !0 }
|
|
989
1034
|
]]),
|
|
990
|
-
|
|
1035
|
+
a[14] ||= j("span", { class: "wm-unit" }, "%", -1)
|
|
991
1036
|
]),
|
|
992
|
-
|
|
1037
|
+
j("label", Wn, [G(j("input", {
|
|
993
1038
|
type: "checkbox",
|
|
994
|
-
"onUpdate:modelValue":
|
|
995
|
-
}, null, 512), [[
|
|
996
|
-
])) :
|
|
997
|
-
|
|
1039
|
+
"onUpdate:modelValue": a[3] ||= (e) => y.value = e
|
|
1040
|
+
}, null, 512), [[H, y.value]]), ae(" " + B(V(i)("dialogs.watermark.washout")), 1)])
|
|
1041
|
+
])) : k("", !0),
|
|
1042
|
+
j("div", Gn, [j("input", {
|
|
998
1043
|
id: "wm-text",
|
|
999
1044
|
type: "radio",
|
|
1000
|
-
checked:
|
|
1001
|
-
onChange:
|
|
1002
|
-
}, null, 40,
|
|
1003
|
-
|
|
1004
|
-
|
|
1045
|
+
checked: s.value === "text",
|
|
1046
|
+
onChange: a[4] ||= (e) => s.value = "text"
|
|
1047
|
+
}, null, 40, Kn), j("label", qn, B(V(i)("dialogs.watermark.text")), 1)]),
|
|
1048
|
+
s.value === "text" ? (L(), A("div", Jn, [
|
|
1049
|
+
j("div", Yn, [j("span", Xn, B(V(i)("dialogs.watermark.presetLabel")), 1), j("select", {
|
|
1005
1050
|
class: "wm-input",
|
|
1006
|
-
value:
|
|
1051
|
+
value: n.includes(c.value) ? c.value : "",
|
|
1007
1052
|
onChange: x
|
|
1008
|
-
}, [
|
|
1053
|
+
}, [a[15] ||= j("option", { value: "" }, "—", -1), (L(), A(w, null, z(n, (e) => j("option", {
|
|
1009
1054
|
key: e,
|
|
1010
1055
|
value: e
|
|
1011
|
-
}, B(e), 9,
|
|
1012
|
-
|
|
1056
|
+
}, B(e), 9, Qn)), 64))], 40, Zn)]),
|
|
1057
|
+
j("div", $n, [j("span", er, B(V(i)("dialogs.watermark.textLabel")), 1), G(j("input", {
|
|
1013
1058
|
class: "wm-input",
|
|
1014
|
-
"onUpdate:modelValue":
|
|
1015
|
-
}, null, 512), [[
|
|
1016
|
-
|
|
1059
|
+
"onUpdate:modelValue": a[5] ||= (e) => c.value = e
|
|
1060
|
+
}, null, 512), [[U, c.value]])]),
|
|
1061
|
+
j("div", tr, [j("span", nr, B(V(i)("dialogs.watermark.fontLabel")), 1), G(j("select", {
|
|
1017
1062
|
class: "wm-input",
|
|
1018
|
-
"onUpdate:modelValue":
|
|
1019
|
-
}, [(L(),
|
|
1063
|
+
"onUpdate:modelValue": a[6] ||= (e) => l.value = e
|
|
1064
|
+
}, [(L(), A(w, null, z(r, (e) => j("option", {
|
|
1020
1065
|
key: e,
|
|
1021
1066
|
value: e
|
|
1022
|
-
}, B(e), 9,
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1067
|
+
}, B(e), 9, rr)), 64))], 512), [[pe, l.value]])]),
|
|
1068
|
+
j("div", ir, [
|
|
1069
|
+
j("span", ar, B(V(i)("dialogs.watermark.sizeLabel")), 1),
|
|
1070
|
+
j("label", or, [G(j("input", {
|
|
1026
1071
|
type: "checkbox",
|
|
1027
|
-
"onUpdate:modelValue":
|
|
1028
|
-
}, null, 512), [[
|
|
1029
|
-
|
|
1072
|
+
"onUpdate:modelValue": a[7] ||= (e) => u.value = e
|
|
1073
|
+
}, null, 512), [[H, u.value]]), ae(" " + B(V(i)("dialogs.watermark.sizeAuto")), 1)]),
|
|
1074
|
+
u.value ? k("", !0) : G((L(), A("input", {
|
|
1030
1075
|
key: 0,
|
|
1031
1076
|
class: "wm-input wm-input--narrow",
|
|
1032
1077
|
type: "number",
|
|
1033
1078
|
min: "8",
|
|
1034
1079
|
max: "200",
|
|
1035
|
-
"onUpdate:modelValue":
|
|
1080
|
+
"onUpdate:modelValue": a[8] ||= (e) => f.value = e
|
|
1036
1081
|
}, null, 512)), [[
|
|
1037
|
-
|
|
1082
|
+
U,
|
|
1038
1083
|
f.value,
|
|
1039
1084
|
void 0,
|
|
1040
1085
|
{ number: !0 }
|
|
1041
1086
|
]])
|
|
1042
1087
|
]),
|
|
1043
|
-
|
|
1088
|
+
j("div", sr, [j("span", cr, B(V(i)("dialogs.watermark.colorLabel")), 1), G(j("input", {
|
|
1044
1089
|
type: "color",
|
|
1045
|
-
"onUpdate:modelValue":
|
|
1046
|
-
}, null, 512), [[
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1090
|
+
"onUpdate:modelValue": a[9] ||= (e) => p.value = e
|
|
1091
|
+
}, null, 512), [[U, p.value]])]),
|
|
1092
|
+
j("div", lr, [
|
|
1093
|
+
j("span", ur, B(V(i)("dialogs.watermark.layoutLabel")), 1),
|
|
1094
|
+
j("label", dr, [j("input", {
|
|
1050
1095
|
type: "radio",
|
|
1051
1096
|
name: "wm-layout",
|
|
1052
1097
|
checked: m.value === "diagonal",
|
|
1053
|
-
onChange:
|
|
1054
|
-
}, null, 40,
|
|
1055
|
-
|
|
1098
|
+
onChange: a[10] ||= (e) => m.value = "diagonal"
|
|
1099
|
+
}, null, 40, fr), ae(" " + B(V(i)("dialogs.watermark.diagonal")), 1)]),
|
|
1100
|
+
j("label", pr, [j("input", {
|
|
1056
1101
|
type: "radio",
|
|
1057
1102
|
name: "wm-layout",
|
|
1058
1103
|
checked: m.value === "horizontal",
|
|
1059
|
-
onChange:
|
|
1060
|
-
}, null, 40,
|
|
1104
|
+
onChange: a[11] ||= (e) => m.value = "horizontal"
|
|
1105
|
+
}, null, 40, mr), ae(" " + B(V(i)("dialogs.watermark.horizontal")), 1)])
|
|
1061
1106
|
]),
|
|
1062
|
-
|
|
1107
|
+
j("label", hr, [G(j("input", {
|
|
1063
1108
|
type: "checkbox",
|
|
1064
|
-
"onUpdate:modelValue":
|
|
1065
|
-
}, null, 512), [[
|
|
1066
|
-
])) :
|
|
1109
|
+
"onUpdate:modelValue": a[12] ||= (e) => h.value = e
|
|
1110
|
+
}, null, 512), [[H, h.value]]), ae(" " + B(V(i)("dialogs.watermark.semitransparent")), 1)])
|
|
1111
|
+
])) : k("", !0)
|
|
1067
1112
|
]),
|
|
1068
|
-
|
|
1113
|
+
j("div", gr, [j("button", {
|
|
1069
1114
|
type: "button",
|
|
1070
1115
|
class: "wm-btn",
|
|
1071
1116
|
onClick: C
|
|
1072
|
-
}, B(V(
|
|
1117
|
+
}, B(V(i)("dialogs.watermark.cancelButton")), 1), j("button", {
|
|
1073
1118
|
type: "button",
|
|
1074
|
-
class:
|
|
1119
|
+
class: le(["wm-btn wm-btn--primary", { "wm-btn--disabled": b.value }]),
|
|
1075
1120
|
disabled: b.value,
|
|
1076
1121
|
onClick: ee
|
|
1077
|
-
}, B(V(
|
|
1078
|
-
], 40,
|
|
1122
|
+
}, B(V(i)("dialogs.watermark.applyButton")), 11, _r)])
|
|
1123
|
+
], 40, An)], 32)) : k("", !0);
|
|
1079
1124
|
}
|
|
1080
|
-
}), [["__scopeId", "data-v-5edfdc47"]]),
|
|
1125
|
+
}), [["__scopeId", "data-v-5edfdc47"]]), yr = /* @__PURE__ */ N({
|
|
1081
1126
|
__name: "DocxEditorDialogs",
|
|
1082
1127
|
props: {
|
|
1083
1128
|
view: {},
|
|
@@ -1086,7 +1131,6 @@ var Gt = /* @__PURE__ */ M({
|
|
|
1086
1131
|
sectionProperties: {},
|
|
1087
1132
|
scrollVisiblePositionIntoView: { type: Function },
|
|
1088
1133
|
showFindReplace: { type: Boolean },
|
|
1089
|
-
showInsertImage: { type: Boolean },
|
|
1090
1134
|
showHyperlink: { type: Boolean },
|
|
1091
1135
|
showInsertSymbol: { type: Boolean },
|
|
1092
1136
|
showImageProperties: { type: Boolean },
|
|
@@ -1097,14 +1141,12 @@ var Gt = /* @__PURE__ */ M({
|
|
|
1097
1141
|
},
|
|
1098
1142
|
emits: [
|
|
1099
1143
|
"update:showFindReplace",
|
|
1100
|
-
"update:showInsertImage",
|
|
1101
1144
|
"update:showHyperlink",
|
|
1102
1145
|
"update:showInsertSymbol",
|
|
1103
1146
|
"update:showImageProperties",
|
|
1104
1147
|
"update:showPageSetup",
|
|
1105
1148
|
"update:showWatermark",
|
|
1106
1149
|
"update:showKeyboardShortcuts",
|
|
1107
|
-
"insert-image",
|
|
1108
1150
|
"insert-symbol",
|
|
1109
1151
|
"hyperlink-submit",
|
|
1110
1152
|
"hyperlink-remove",
|
|
@@ -1113,8 +1155,8 @@ var Gt = /* @__PURE__ */ M({
|
|
|
1113
1155
|
],
|
|
1114
1156
|
setup(t, { emit: n }) {
|
|
1115
1157
|
let r = n;
|
|
1116
|
-
return (n, a) => (L(),
|
|
1117
|
-
|
|
1158
|
+
return (n, a) => (L(), A(w, null, [
|
|
1159
|
+
M(s, {
|
|
1118
1160
|
"is-open": t.showFindReplace,
|
|
1119
1161
|
view: t.view,
|
|
1120
1162
|
"scroll-visible-position-into-view": t.scrollVisiblePositionIntoView,
|
|
@@ -1124,60 +1166,55 @@ var Gt = /* @__PURE__ */ M({
|
|
|
1124
1166
|
"view",
|
|
1125
1167
|
"scroll-visible-position-into-view"
|
|
1126
1168
|
]),
|
|
1127
|
-
|
|
1128
|
-
"is-open": t.showInsertImage,
|
|
1129
|
-
onClose: a[1] ||= (e) => r("update:showInsertImage", !1),
|
|
1130
|
-
onInsert: a[2] ||= (e) => r("insert-image", e)
|
|
1131
|
-
}, null, 8, ["is-open"]),
|
|
1132
|
-
j(e, {
|
|
1169
|
+
M(e, {
|
|
1133
1170
|
"is-open": t.showHyperlink,
|
|
1134
1171
|
view: t.view,
|
|
1135
1172
|
bookmarks: t.bookmarks,
|
|
1136
|
-
onClose: a[
|
|
1137
|
-
onSubmit: a[
|
|
1138
|
-
onRemove: a[
|
|
1173
|
+
onClose: a[1] ||= (e) => r("update:showHyperlink", !1),
|
|
1174
|
+
onSubmit: a[2] ||= (e) => r("hyperlink-submit", e),
|
|
1175
|
+
onRemove: a[3] ||= (e) => r("hyperlink-remove")
|
|
1139
1176
|
}, null, 8, [
|
|
1140
1177
|
"is-open",
|
|
1141
1178
|
"view",
|
|
1142
1179
|
"bookmarks"
|
|
1143
1180
|
]),
|
|
1144
|
-
|
|
1181
|
+
M(i, {
|
|
1145
1182
|
"is-open": t.showInsertSymbol,
|
|
1146
|
-
onClose: a[
|
|
1147
|
-
onInsert: a[
|
|
1183
|
+
onClose: a[4] ||= (e) => r("update:showInsertSymbol", !1),
|
|
1184
|
+
onInsert: a[5] ||= (e) => r("insert-symbol", e)
|
|
1148
1185
|
}, null, 8, ["is-open"]),
|
|
1149
|
-
|
|
1186
|
+
M(c, {
|
|
1150
1187
|
"is-open": t.showImageProperties,
|
|
1151
1188
|
view: t.view,
|
|
1152
1189
|
"pm-pos": t.selectedImagePmPos,
|
|
1153
|
-
onClose: a[
|
|
1190
|
+
onClose: a[6] ||= (e) => r("update:showImageProperties", !1)
|
|
1154
1191
|
}, null, 8, [
|
|
1155
1192
|
"is-open",
|
|
1156
1193
|
"view",
|
|
1157
1194
|
"pm-pos"
|
|
1158
1195
|
]),
|
|
1159
|
-
|
|
1196
|
+
M(o, {
|
|
1160
1197
|
"is-open": t.showPageSetup,
|
|
1161
1198
|
"section-properties": t.sectionProperties,
|
|
1162
|
-
onClose: a[
|
|
1163
|
-
onApply: a[
|
|
1199
|
+
onClose: a[7] ||= (e) => r("update:showPageSetup", !1),
|
|
1200
|
+
onApply: a[8] ||= (e) => r("page-setup-apply", e)
|
|
1164
1201
|
}, null, 8, ["is-open", "section-properties"]),
|
|
1165
|
-
|
|
1202
|
+
M(vr, {
|
|
1166
1203
|
"is-open": t.showWatermark,
|
|
1167
1204
|
current: t.currentWatermark,
|
|
1168
|
-
onClose: a[
|
|
1169
|
-
onApply: a[
|
|
1205
|
+
onClose: a[9] ||= (e) => r("update:showWatermark", !1),
|
|
1206
|
+
onApply: a[10] ||= (e) => r("watermark-apply", e)
|
|
1170
1207
|
}, null, 8, ["is-open", "current"]),
|
|
1171
|
-
|
|
1208
|
+
M(u, {
|
|
1172
1209
|
"is-open": t.showKeyboardShortcuts,
|
|
1173
|
-
onClose: a[
|
|
1210
|
+
onClose: a[11] ||= (e) => r("update:showKeyboardShortcuts", !1)
|
|
1174
1211
|
}, null, 8, ["is-open"])
|
|
1175
1212
|
], 64));
|
|
1176
1213
|
}
|
|
1177
|
-
}),
|
|
1214
|
+
}), br = ["disabled", "onMousedown"], xr = { class: "ctx-menu__label" }, Sr = {
|
|
1178
1215
|
key: 0,
|
|
1179
1216
|
class: "ctx-menu__shortcut"
|
|
1180
|
-
},
|
|
1217
|
+
}, Cr = 220, wr = 32, Tr = 10, Er = /* @__PURE__ */ b(/* @__PURE__ */ N({
|
|
1181
1218
|
__name: "TextContextMenu",
|
|
1182
1219
|
props: {
|
|
1183
1220
|
isOpen: { type: Boolean },
|
|
@@ -1191,35 +1228,35 @@ var Gt = /* @__PURE__ */ M({
|
|
|
1191
1228
|
},
|
|
1192
1229
|
emits: ["close", "action"],
|
|
1193
1230
|
setup(e, { emit: t }) {
|
|
1194
|
-
let
|
|
1231
|
+
let n = e, r = t, { t: i } = d(), a = R(null), o = E(() => {
|
|
1195
1232
|
let e = [
|
|
1196
1233
|
{
|
|
1197
1234
|
id: "cut",
|
|
1198
|
-
label:
|
|
1235
|
+
label: i("contextMenu.cut"),
|
|
1199
1236
|
action: "cut",
|
|
1200
|
-
shortcut:
|
|
1201
|
-
disabled: !
|
|
1237
|
+
shortcut: i("contextMenu.cutShortcut"),
|
|
1238
|
+
disabled: !n.hasSelection || !n.isEditable
|
|
1202
1239
|
},
|
|
1203
1240
|
{
|
|
1204
1241
|
id: "copy",
|
|
1205
|
-
label:
|
|
1242
|
+
label: i("contextMenu.copy"),
|
|
1206
1243
|
action: "copy",
|
|
1207
|
-
shortcut:
|
|
1208
|
-
disabled: !
|
|
1244
|
+
shortcut: i("contextMenu.copyShortcut"),
|
|
1245
|
+
disabled: !n.hasSelection
|
|
1209
1246
|
},
|
|
1210
1247
|
{
|
|
1211
1248
|
id: "paste",
|
|
1212
|
-
label:
|
|
1249
|
+
label: i("contextMenu.paste"),
|
|
1213
1250
|
action: "paste",
|
|
1214
|
-
shortcut:
|
|
1215
|
-
disabled: !
|
|
1251
|
+
shortcut: i("contextMenu.pasteShortcut"),
|
|
1252
|
+
disabled: !n.isEditable
|
|
1216
1253
|
},
|
|
1217
1254
|
{
|
|
1218
1255
|
id: "pasteAsPlainText",
|
|
1219
|
-
label:
|
|
1256
|
+
label: i("contextMenu.pastePlainText"),
|
|
1220
1257
|
action: "pasteAsPlainText",
|
|
1221
|
-
shortcut:
|
|
1222
|
-
disabled: !
|
|
1258
|
+
shortcut: i("contextMenu.pastePlainTextShortcut"),
|
|
1259
|
+
disabled: !n.isEditable
|
|
1223
1260
|
},
|
|
1224
1261
|
{
|
|
1225
1262
|
id: "div1",
|
|
@@ -1229,52 +1266,52 @@ var Gt = /* @__PURE__ */ M({
|
|
|
1229
1266
|
},
|
|
1230
1267
|
{
|
|
1231
1268
|
id: "delete",
|
|
1232
|
-
label:
|
|
1269
|
+
label: i("contextMenu.delete"),
|
|
1233
1270
|
action: "delete",
|
|
1234
|
-
shortcut:
|
|
1235
|
-
disabled: !
|
|
1271
|
+
shortcut: i("contextMenu.deleteShortcut"),
|
|
1272
|
+
disabled: !n.hasSelection || !n.isEditable
|
|
1236
1273
|
},
|
|
1237
1274
|
{
|
|
1238
1275
|
id: "selectAll",
|
|
1239
|
-
label:
|
|
1276
|
+
label: i("contextMenu.selectAll"),
|
|
1240
1277
|
action: "selectAll",
|
|
1241
|
-
shortcut:
|
|
1278
|
+
shortcut: i("contextMenu.selectAllShortcut")
|
|
1242
1279
|
}
|
|
1243
1280
|
];
|
|
1244
|
-
return
|
|
1281
|
+
return n.onImage && n.isEditable && e.push({
|
|
1245
1282
|
id: "div-img",
|
|
1246
1283
|
label: "",
|
|
1247
1284
|
action: "",
|
|
1248
1285
|
divider: !0
|
|
1249
1286
|
}, {
|
|
1250
1287
|
id: "replaceImage",
|
|
1251
|
-
label:
|
|
1288
|
+
label: i("imageOverlay.replaceImage"),
|
|
1252
1289
|
action: "replaceImage"
|
|
1253
1290
|
}, {
|
|
1254
1291
|
id: "imageProperties",
|
|
1255
|
-
label:
|
|
1292
|
+
label: i("imageWrap.menu.imageProperties"),
|
|
1256
1293
|
action: "imageProperties"
|
|
1257
1294
|
}, {
|
|
1258
1295
|
id: "deleteImage",
|
|
1259
|
-
label:
|
|
1296
|
+
label: i("imageOverlay.deleteImage"),
|
|
1260
1297
|
action: "deleteImage",
|
|
1261
|
-
shortcut:
|
|
1262
|
-
}),
|
|
1298
|
+
shortcut: i("contextMenu.deleteShortcut")
|
|
1299
|
+
}), n.inTable && n.isEditable && e.push({
|
|
1263
1300
|
id: "div2",
|
|
1264
1301
|
label: "",
|
|
1265
1302
|
action: "",
|
|
1266
1303
|
divider: !0
|
|
1267
1304
|
}, {
|
|
1268
1305
|
id: "addRowAbove",
|
|
1269
|
-
label:
|
|
1306
|
+
label: i("table.insertRowAbove"),
|
|
1270
1307
|
action: "addRowAbove"
|
|
1271
1308
|
}, {
|
|
1272
1309
|
id: "addRowBelow",
|
|
1273
|
-
label:
|
|
1310
|
+
label: i("table.insertRowBelow"),
|
|
1274
1311
|
action: "addRowBelow"
|
|
1275
1312
|
}, {
|
|
1276
1313
|
id: "deleteRow",
|
|
1277
|
-
label:
|
|
1314
|
+
label: i("table.deleteRow"),
|
|
1278
1315
|
action: "deleteRow"
|
|
1279
1316
|
}, {
|
|
1280
1317
|
id: "div3",
|
|
@@ -1283,15 +1320,15 @@ var Gt = /* @__PURE__ */ M({
|
|
|
1283
1320
|
divider: !0
|
|
1284
1321
|
}, {
|
|
1285
1322
|
id: "addColLeft",
|
|
1286
|
-
label:
|
|
1323
|
+
label: i("table.insertColumnLeft"),
|
|
1287
1324
|
action: "addColumnLeft"
|
|
1288
1325
|
}, {
|
|
1289
1326
|
id: "addColRight",
|
|
1290
|
-
label:
|
|
1327
|
+
label: i("table.insertColumnRight"),
|
|
1291
1328
|
action: "addColumnRight"
|
|
1292
1329
|
}, {
|
|
1293
1330
|
id: "deleteCol",
|
|
1294
|
-
label:
|
|
1331
|
+
label: i("table.deleteColumn"),
|
|
1295
1332
|
action: "deleteColumn"
|
|
1296
1333
|
}, {
|
|
1297
1334
|
id: "div4",
|
|
@@ -1300,74 +1337,74 @@ var Gt = /* @__PURE__ */ M({
|
|
|
1300
1337
|
divider: !0
|
|
1301
1338
|
}, {
|
|
1302
1339
|
id: "mergeCells",
|
|
1303
|
-
label:
|
|
1340
|
+
label: i("table.mergeCells"),
|
|
1304
1341
|
action: "mergeCells",
|
|
1305
|
-
disabled: !
|
|
1342
|
+
disabled: !n.canMergeCells
|
|
1306
1343
|
}, {
|
|
1307
1344
|
id: "splitCell",
|
|
1308
|
-
label:
|
|
1345
|
+
label: i("table.splitCell"),
|
|
1309
1346
|
action: "splitCell",
|
|
1310
|
-
disabled: !
|
|
1347
|
+
disabled: !n.canSplitCell
|
|
1311
1348
|
}), e;
|
|
1312
|
-
}),
|
|
1313
|
-
let e =
|
|
1314
|
-
return typeof window < "u" && (e +
|
|
1349
|
+
}), s = E(() => {
|
|
1350
|
+
let e = n.position.x, t = n.position.y, r = o.value.filter((e) => !e.divider).length, i = o.value.filter((e) => e.divider).length, a = r * wr + i * 9;
|
|
1351
|
+
return typeof window < "u" && (e + Cr + Tr > window.innerWidth && (e = window.innerWidth - Cr - Tr), t + a + Tr > window.innerHeight && (t = window.innerHeight - a - Tr)), {
|
|
1315
1352
|
position: "fixed",
|
|
1316
1353
|
left: `${e}px`,
|
|
1317
1354
|
top: `${t}px`,
|
|
1318
1355
|
zIndex: 400
|
|
1319
1356
|
};
|
|
1320
1357
|
});
|
|
1321
|
-
function
|
|
1322
|
-
e && (
|
|
1358
|
+
function c(e) {
|
|
1359
|
+
e && (r("action", e), r("close"));
|
|
1323
1360
|
}
|
|
1324
|
-
function
|
|
1325
|
-
e.key === "Escape" &&
|
|
1361
|
+
function l(e) {
|
|
1362
|
+
e.key === "Escape" && r("close");
|
|
1326
1363
|
}
|
|
1327
|
-
return
|
|
1328
|
-
e &&
|
|
1329
|
-
}), (t, n) => (L(),
|
|
1364
|
+
return W(() => n.isOpen, (e) => {
|
|
1365
|
+
e && ce(() => a.value?.focus());
|
|
1366
|
+
}), (t, n) => (L(), O(T, { to: "body" }, [e.isOpen ? (L(), A("div", {
|
|
1330
1367
|
key: 0,
|
|
1331
1368
|
class: "ctx-menu-backdrop",
|
|
1332
1369
|
onMousedown: n[0] ||= (e) => t.$emit("close"),
|
|
1333
|
-
onContextmenu: n[1] ||=
|
|
1334
|
-
}, null, 32)) :
|
|
1370
|
+
onContextmenu: n[1] ||= q((e) => t.$emit("close"), ["prevent"])
|
|
1371
|
+
}, null, 32)) : k("", !0), e.isOpen ? (L(), A("div", {
|
|
1335
1372
|
key: 1,
|
|
1336
1373
|
ref_key: "menuRef",
|
|
1337
|
-
ref:
|
|
1374
|
+
ref: a,
|
|
1338
1375
|
class: "ctx-menu",
|
|
1339
|
-
style: P(
|
|
1340
|
-
onContextmenu: n[2] ||=
|
|
1341
|
-
onKeydown:
|
|
1342
|
-
}, [(L(!0),
|
|
1376
|
+
style: P(s.value),
|
|
1377
|
+
onContextmenu: n[2] ||= q(() => {}, ["prevent"]),
|
|
1378
|
+
onKeydown: l
|
|
1379
|
+
}, [(L(!0), A(w, null, z(o.value, (e, t) => (L(), A("button", {
|
|
1343
1380
|
key: e.id || t,
|
|
1344
|
-
class:
|
|
1381
|
+
class: le(["ctx-menu__item", {
|
|
1345
1382
|
"ctx-menu__item--disabled": e.disabled,
|
|
1346
1383
|
"ctx-menu__item--divider": e.divider
|
|
1347
1384
|
}]),
|
|
1348
1385
|
disabled: e.disabled,
|
|
1349
|
-
onMousedown:
|
|
1350
|
-
}, [
|
|
1386
|
+
onMousedown: q((t) => c(e.action), ["prevent"])
|
|
1387
|
+
}, [j("span", xr, B(e.label), 1), e.shortcut ? (L(), A("span", Sr, B(e.shortcut), 1)) : k("", !0)], 42, br))), 128))], 36)) : k("", !0)]));
|
|
1351
1388
|
}
|
|
1352
|
-
}), [["__scopeId", "data-v-b2122da6"]]),
|
|
1389
|
+
}), [["__scopeId", "data-v-b2122da6"]]), Dr = ["aria-label"], Or = { class: "image-ctx-menu__icon" }, kr = { class: "image-ctx-menu__label" }, Ar = {
|
|
1353
1390
|
key: 1,
|
|
1354
1391
|
class: "image-ctx-menu__divider",
|
|
1355
1392
|
role: "separator"
|
|
1356
|
-
},
|
|
1393
|
+
}, jr = [
|
|
1357
1394
|
"data-wrap-type",
|
|
1358
1395
|
"data-current",
|
|
1359
1396
|
"data-disabled",
|
|
1360
1397
|
"disabled",
|
|
1361
1398
|
"title",
|
|
1362
1399
|
"onClick"
|
|
1363
|
-
],
|
|
1400
|
+
], Mr = { class: "image-ctx-menu__icon" }, Nr = { class: "image-ctx-menu__label" }, Pr = ["aria-label"], Fr = ["disabled", "onClick"], Ir = { class: "image-ctx-menu__label" }, Lr = {
|
|
1364
1401
|
key: 0,
|
|
1365
1402
|
class: "image-ctx-menu__shortcut"
|
|
1366
|
-
},
|
|
1403
|
+
}, Rr = {
|
|
1367
1404
|
key: 0,
|
|
1368
1405
|
class: "image-ctx-menu__divider",
|
|
1369
1406
|
role: "separator"
|
|
1370
|
-
},
|
|
1407
|
+
}, zr = 18, Br = 260, Vr = 10, Hr = /* @__PURE__ */ b(/* @__PURE__ */ N({
|
|
1371
1408
|
__name: "ImageContextMenu",
|
|
1372
1409
|
props: {
|
|
1373
1410
|
state: {},
|
|
@@ -1384,11 +1421,11 @@ var Gt = /* @__PURE__ */ M({
|
|
|
1384
1421
|
"open-properties"
|
|
1385
1422
|
],
|
|
1386
1423
|
setup(e, { emit: t }) {
|
|
1387
|
-
let
|
|
1424
|
+
let n = e, i = t;
|
|
1388
1425
|
function a() {
|
|
1389
1426
|
i("open-properties"), i("close");
|
|
1390
1427
|
}
|
|
1391
|
-
let { t: o } =
|
|
1428
|
+
let { t: o } = d(), s = R(null), c = et, l = E(() => n.state ? nt(n.state.currentWrapType, n.state.currentCssFloat ?? null) : null), u = {
|
|
1392
1429
|
inline: "wrap_text",
|
|
1393
1430
|
squareLeft: "format_image_left",
|
|
1394
1431
|
squareRight: "format_image_right",
|
|
@@ -1396,21 +1433,21 @@ var Gt = /* @__PURE__ */ M({
|
|
|
1396
1433
|
inFront: "flip_to_front"
|
|
1397
1434
|
};
|
|
1398
1435
|
function f(e) {
|
|
1399
|
-
return
|
|
1436
|
+
return u[e];
|
|
1400
1437
|
}
|
|
1401
|
-
let p =
|
|
1402
|
-
if (!
|
|
1403
|
-
let e =
|
|
1404
|
-
return typeof window < "u" && (t +
|
|
1438
|
+
let p = E(() => {
|
|
1439
|
+
if (!n.state) return {};
|
|
1440
|
+
let e = et.length * 36 + 16, t = n.state.position.x, r = n.state.position.y;
|
|
1441
|
+
return typeof window < "u" && (t + Br > window.innerWidth && (t = window.innerWidth - Br - Vr), r + e > window.innerHeight && (r = window.innerHeight - e - Vr), t < Vr && (t = Vr), r < Vr && (r = Vr)), {
|
|
1405
1442
|
position: "fixed",
|
|
1406
1443
|
left: `${t}px`,
|
|
1407
|
-
top: `${
|
|
1408
|
-
minWidth: `${
|
|
1444
|
+
top: `${r}px`,
|
|
1445
|
+
minWidth: `${Br}px`,
|
|
1409
1446
|
zIndex: 400
|
|
1410
1447
|
};
|
|
1411
1448
|
});
|
|
1412
1449
|
function m(e) {
|
|
1413
|
-
return
|
|
1450
|
+
return n.state ? it(e, n.state.currentWrapType) : !1;
|
|
1414
1451
|
}
|
|
1415
1452
|
function h(e) {
|
|
1416
1453
|
m(e) && (i("select", e.choice), i("close"));
|
|
@@ -1424,12 +1461,12 @@ var Gt = /* @__PURE__ */ M({
|
|
|
1424
1461
|
function v(e) {
|
|
1425
1462
|
e.key === "Escape" && (e.preventDefault(), i("close"));
|
|
1426
1463
|
}
|
|
1427
|
-
return (t, n) => (L(),
|
|
1464
|
+
return (t, n) => (L(), O(T, { to: "body" }, [e.state && e.state.open ? (L(), A("div", {
|
|
1428
1465
|
key: 0,
|
|
1429
1466
|
class: "image-ctx-menu-backdrop",
|
|
1430
1467
|
onMousedown: _,
|
|
1431
|
-
onContextmenu: n[0] ||=
|
|
1432
|
-
}, null, 32)) :
|
|
1468
|
+
onContextmenu: n[0] ||= q((e) => t.$emit("close"), ["prevent"])
|
|
1469
|
+
}, null, 32)) : k("", !0), e.state && e.state.open ? (L(), A("div", {
|
|
1433
1470
|
key: 1,
|
|
1434
1471
|
ref_key: "menuRef",
|
|
1435
1472
|
ref: s,
|
|
@@ -1438,60 +1475,60 @@ var Gt = /* @__PURE__ */ M({
|
|
|
1438
1475
|
"aria-label": V(o)("imageWrap.menu.ariaLabel"),
|
|
1439
1476
|
"data-testid": "image-context-menu",
|
|
1440
1477
|
style: P(p.value),
|
|
1441
|
-
onContextmenu: n[4] ||=
|
|
1478
|
+
onContextmenu: n[4] ||= q(() => {}, ["prevent"]),
|
|
1442
1479
|
onKeydown: v
|
|
1443
1480
|
}, [
|
|
1444
|
-
e.canOpenProperties ? (L(),
|
|
1481
|
+
e.canOpenProperties ? (L(), A("button", {
|
|
1445
1482
|
key: 0,
|
|
1446
1483
|
type: "button",
|
|
1447
1484
|
role: "menuitem",
|
|
1448
1485
|
class: "image-ctx-menu__item",
|
|
1449
1486
|
"data-action": "open-properties",
|
|
1450
|
-
onMousedown: n[1] ||=
|
|
1487
|
+
onMousedown: n[1] ||= q(() => {}, ["prevent"]),
|
|
1451
1488
|
onClick: a
|
|
1452
|
-
}, [
|
|
1489
|
+
}, [j("span", Or, [M(r, {
|
|
1453
1490
|
name: "settings",
|
|
1454
|
-
size:
|
|
1455
|
-
})]),
|
|
1456
|
-
e.canOpenProperties ? (L(),
|
|
1457
|
-
(L(!0),
|
|
1491
|
+
size: zr
|
|
1492
|
+
})]), j("span", kr, B(V(o)("imageWrap.menu.imageProperties")), 1)], 32)) : k("", !0),
|
|
1493
|
+
e.canOpenProperties ? (L(), A("div", Ar)) : k("", !0),
|
|
1494
|
+
(L(!0), A(w, null, z(V(c), (e) => (L(), A("button", {
|
|
1458
1495
|
key: e.choice,
|
|
1459
1496
|
type: "button",
|
|
1460
1497
|
role: "menuitem",
|
|
1461
|
-
class:
|
|
1498
|
+
class: le(["image-ctx-menu__item", { "image-ctx-menu__item--current": e.choice === l.value }]),
|
|
1462
1499
|
"data-wrap-type": e.choice,
|
|
1463
|
-
"data-current": e.choice ===
|
|
1500
|
+
"data-current": e.choice === l.value ? "true" : "false",
|
|
1464
1501
|
"data-disabled": m(e) ? "false" : "true",
|
|
1465
1502
|
disabled: !m(e),
|
|
1466
1503
|
title: V(o)(`imageWrap.menuDesc.${e.i18nDescKey}`),
|
|
1467
|
-
onMousedown: n[2] ||=
|
|
1504
|
+
onMousedown: n[2] ||= q(() => {}, ["prevent"]),
|
|
1468
1505
|
onClick: (t) => h(e)
|
|
1469
1506
|
}, [
|
|
1470
|
-
|
|
1507
|
+
j("span", Mr, [M(r, {
|
|
1471
1508
|
name: f(e.iconHint),
|
|
1472
|
-
size:
|
|
1509
|
+
size: zr
|
|
1473
1510
|
}, null, 8, ["name"])]),
|
|
1474
|
-
|
|
1475
|
-
e.choice ===
|
|
1511
|
+
j("span", Nr, B(V(o)(`imageWrap.menu.${e.i18nLabelKey}`)), 1),
|
|
1512
|
+
e.choice === l.value ? (L(), A("span", {
|
|
1476
1513
|
key: 0,
|
|
1477
1514
|
class: "image-ctx-menu__current-dot",
|
|
1478
1515
|
"aria-label": V(o)("imageWrap.menu.ariaLabel")
|
|
1479
|
-
}, "●", 8,
|
|
1480
|
-
], 42,
|
|
1481
|
-
e.textActions && e.textActions.length > 0 ? (L(),
|
|
1516
|
+
}, "●", 8, Pr)) : k("", !0)
|
|
1517
|
+
], 42, jr))), 128)),
|
|
1518
|
+
e.textActions && e.textActions.length > 0 ? (L(), A(w, { key: 2 }, [n[5] ||= j("div", {
|
|
1482
1519
|
class: "image-ctx-menu__divider",
|
|
1483
1520
|
role: "separator"
|
|
1484
|
-
}, null, -1), (L(!0),
|
|
1521
|
+
}, null, -1), (L(!0), A(w, null, z(e.textActions, (e, t) => (L(), A(w, { key: `${e.action}-${t}` }, [j("button", {
|
|
1485
1522
|
type: "button",
|
|
1486
1523
|
role: "menuitem",
|
|
1487
1524
|
class: "image-ctx-menu__item image-ctx-menu__item--text",
|
|
1488
1525
|
disabled: e.disabled,
|
|
1489
|
-
onMousedown: n[3] ||=
|
|
1526
|
+
onMousedown: n[3] ||= q(() => {}, ["prevent"]),
|
|
1490
1527
|
onClick: (t) => g(e)
|
|
1491
|
-
}, [
|
|
1492
|
-
], 44,
|
|
1528
|
+
}, [j("span", Ir, B(e.label), 1), e.shortcut ? (L(), A("span", Lr, B(e.shortcut), 1)) : k("", !0)], 40, Fr), e.dividerAfter ? (L(), A("div", Rr)) : k("", !0)], 64))), 128))], 64)) : k("", !0)
|
|
1529
|
+
], 44, Dr)) : k("", !0)]));
|
|
1493
1530
|
}
|
|
1494
|
-
}), [["__scopeId", "data-v-5c21ca8c"]]),
|
|
1531
|
+
}), [["__scopeId", "data-v-5c21ca8c"]]), Ur = /* @__PURE__ */ N({
|
|
1495
1532
|
__name: "DocxEditorOverlays",
|
|
1496
1533
|
props: {
|
|
1497
1534
|
readOnly: { type: Boolean },
|
|
@@ -1509,7 +1546,7 @@ var Gt = /* @__PURE__ */ M({
|
|
|
1509
1546
|
],
|
|
1510
1547
|
setup(e, { emit: t }) {
|
|
1511
1548
|
let n = t;
|
|
1512
|
-
return (t, r) => (L(),
|
|
1549
|
+
return (t, r) => (L(), A(w, null, [M(Er, {
|
|
1513
1550
|
"is-open": e.contextMenu.isOpen,
|
|
1514
1551
|
position: e.contextMenu.position,
|
|
1515
1552
|
"has-selection": e.contextMenu.hasSelection,
|
|
@@ -1529,7 +1566,7 @@ var Gt = /* @__PURE__ */ M({
|
|
|
1529
1566
|
"on-image",
|
|
1530
1567
|
"can-merge-cells",
|
|
1531
1568
|
"can-split-cell"
|
|
1532
|
-
]),
|
|
1569
|
+
]), M(Hr, {
|
|
1533
1570
|
state: e.imageContextMenu,
|
|
1534
1571
|
"text-actions": e.imageContextMenuTextActions,
|
|
1535
1572
|
"can-open-properties": e.canOpenImageProperties,
|
|
@@ -1543,7 +1580,7 @@ var Gt = /* @__PURE__ */ M({
|
|
|
1543
1580
|
"can-open-properties"
|
|
1544
1581
|
])], 64));
|
|
1545
1582
|
}
|
|
1546
|
-
}),
|
|
1583
|
+
}), Wr = ["href", "title"], Gr = ["title"], Kr = ["title"], qr = ["title"], Jr = { class: "docx-hyperlink-popup__edit-row" }, Yr = ["placeholder", "onKeydown"], Xr = { class: "docx-hyperlink-popup__edit-row" }, Zr = ["onKeydown"], Qr = ["disabled"], $r = /* @__PURE__ */ b(/* @__PURE__ */ N({
|
|
1547
1584
|
__name: "HyperlinkPopup",
|
|
1548
1585
|
props: {
|
|
1549
1586
|
data: {},
|
|
@@ -1557,69 +1594,69 @@ var Gt = /* @__PURE__ */ M({
|
|
|
1557
1594
|
"close"
|
|
1558
1595
|
],
|
|
1559
1596
|
setup(e, { emit: t }) {
|
|
1560
|
-
let { t:
|
|
1561
|
-
left: (
|
|
1562
|
-
top: (
|
|
1597
|
+
let { t: n } = d(), r = e, i = t, a = R(!1), o = R(""), s = R(""), c = R(null), l = E(() => ({
|
|
1598
|
+
left: (r.data?.position.left ?? 0) + "px",
|
|
1599
|
+
top: (r.data?.position.top ?? 0) + "px"
|
|
1563
1600
|
}));
|
|
1564
|
-
|
|
1565
|
-
|
|
1601
|
+
W(() => r.data?.href, () => {
|
|
1602
|
+
a.value = !1;
|
|
1566
1603
|
});
|
|
1567
|
-
let
|
|
1604
|
+
let u = null, f = null;
|
|
1568
1605
|
function p() {
|
|
1569
|
-
f &&= (clearTimeout(f), null),
|
|
1606
|
+
f &&= (clearTimeout(f), null), u &&= (document.removeEventListener("mousedown", u), null);
|
|
1570
1607
|
}
|
|
1571
|
-
|
|
1572
|
-
p(), e && (
|
|
1573
|
-
let t =
|
|
1574
|
-
t && !t.contains(e.target) &&
|
|
1608
|
+
W(() => r.data, (e) => {
|
|
1609
|
+
p(), e && (u = (e) => {
|
|
1610
|
+
let t = c.value;
|
|
1611
|
+
t && !t.contains(e.target) && i("close");
|
|
1575
1612
|
}, f = setTimeout(() => {
|
|
1576
|
-
|
|
1613
|
+
u && document.addEventListener("mousedown", u);
|
|
1577
1614
|
}, 0));
|
|
1578
1615
|
}, { immediate: !0 }), F(p);
|
|
1579
1616
|
function m() {
|
|
1580
|
-
|
|
1617
|
+
r.data && (o.value = r.data.displayText, s.value = r.data.href, a.value = !0);
|
|
1581
1618
|
}
|
|
1582
1619
|
function h() {
|
|
1583
|
-
|
|
1620
|
+
s.value.trim() && (i("edit", o.value, s.value), a.value = !1);
|
|
1584
1621
|
}
|
|
1585
1622
|
function g() {
|
|
1586
|
-
|
|
1623
|
+
r.data && (i("copy", r.data.href), typeof navigator < "u" && navigator.clipboard && navigator.clipboard.writeText(r.data.href).catch(() => {}));
|
|
1587
1624
|
}
|
|
1588
|
-
return (t,
|
|
1625
|
+
return (t, r) => e.data ? (L(), A("div", {
|
|
1589
1626
|
key: 0,
|
|
1590
1627
|
ref_key: "popupRef",
|
|
1591
|
-
ref:
|
|
1592
|
-
class:
|
|
1593
|
-
style: P(
|
|
1594
|
-
onMousedown:
|
|
1595
|
-
}, [
|
|
1628
|
+
ref: c,
|
|
1629
|
+
class: le(["docx-hyperlink-popup", { "docx-hyperlink-popup--edit": a.value }]),
|
|
1630
|
+
style: P(l.value),
|
|
1631
|
+
onMousedown: r[6] ||= q(() => {}, ["stop"])
|
|
1632
|
+
}, [a.value ? (L(), A(w, { key: 1 }, [j("div", Jr, [G(j("input", {
|
|
1596
1633
|
class: "docx-hyperlink-popup__input",
|
|
1597
|
-
placeholder: V(
|
|
1598
|
-
"onUpdate:modelValue":
|
|
1599
|
-
onKeydown: [
|
|
1600
|
-
}, null, 40,
|
|
1634
|
+
placeholder: V(n)("hyperlinkPopup.displayTextPlaceholder"),
|
|
1635
|
+
"onUpdate:modelValue": r[2] ||= (e) => o.value = e,
|
|
1636
|
+
onKeydown: [K(q(h, ["prevent"]), ["enter"]), r[3] ||= K((e) => t.$emit("close"), ["esc"])]
|
|
1637
|
+
}, null, 40, Yr), [[U, o.value]])]), j("div", Xr, [G(j("input", {
|
|
1601
1638
|
class: "docx-hyperlink-popup__input",
|
|
1602
1639
|
placeholder: "https://...",
|
|
1603
|
-
"onUpdate:modelValue":
|
|
1604
|
-
onKeydown: [
|
|
1605
|
-
}, null, 40,
|
|
1640
|
+
"onUpdate:modelValue": r[4] ||= (e) => s.value = e,
|
|
1641
|
+
onKeydown: [K(q(h, ["prevent"]), ["enter"]), r[5] ||= K((e) => t.$emit("close"), ["esc"])]
|
|
1642
|
+
}, null, 40, Zr), [[U, s.value]]), j("button", {
|
|
1606
1643
|
class: "docx-hyperlink-popup__apply",
|
|
1607
|
-
disabled: !
|
|
1608
|
-
onClick:
|
|
1609
|
-
}, B(V(
|
|
1610
|
-
|
|
1611
|
-
|
|
1644
|
+
disabled: !s.value.trim(),
|
|
1645
|
+
onClick: q(h, ["prevent"])
|
|
1646
|
+
}, B(V(n)("common.apply")), 9, Qr)])], 64)) : (L(), A(w, { key: 0 }, [
|
|
1647
|
+
r[10] ||= ie("<span class=\"docx-hyperlink-popup__icon\" aria-hidden data-v-9d23bb12><svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" data-v-9d23bb12><circle cx=\"12\" cy=\"12\" r=\"10\" data-v-9d23bb12></circle><path d=\"M2 12h20\" data-v-9d23bb12></path><path d=\"M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z\" data-v-9d23bb12></path></svg></span>", 1),
|
|
1648
|
+
j("a", {
|
|
1612
1649
|
class: "docx-hyperlink-popup__url",
|
|
1613
1650
|
href: e.data.href,
|
|
1614
1651
|
title: e.data.href,
|
|
1615
|
-
onClick:
|
|
1616
|
-
}, B(e.data.href), 9,
|
|
1617
|
-
|
|
1618
|
-
|
|
1652
|
+
onClick: r[0] ||= q((n) => t.$emit("navigate", e.data.href), ["prevent"])
|
|
1653
|
+
}, B(e.data.href), 9, Wr),
|
|
1654
|
+
r[11] ||= j("span", { class: "docx-hyperlink-popup__sep" }, null, -1),
|
|
1655
|
+
j("button", {
|
|
1619
1656
|
class: "docx-hyperlink-popup__btn",
|
|
1620
|
-
title: V(
|
|
1621
|
-
onClick:
|
|
1622
|
-
}, [...
|
|
1657
|
+
title: V(n)("hyperlinkPopup.copyLink"),
|
|
1658
|
+
onClick: q(g, ["prevent"])
|
|
1659
|
+
}, [...r[7] ||= [j("svg", {
|
|
1623
1660
|
width: "18",
|
|
1624
1661
|
height: "18",
|
|
1625
1662
|
viewBox: "0 0 24 24",
|
|
@@ -1628,20 +1665,20 @@ var Gt = /* @__PURE__ */ M({
|
|
|
1628
1665
|
"stroke-width": "2",
|
|
1629
1666
|
"stroke-linecap": "round",
|
|
1630
1667
|
"stroke-linejoin": "round"
|
|
1631
|
-
}, [
|
|
1668
|
+
}, [j("rect", {
|
|
1632
1669
|
x: "9",
|
|
1633
1670
|
y: "9",
|
|
1634
1671
|
width: "13",
|
|
1635
1672
|
height: "13",
|
|
1636
1673
|
rx: "2",
|
|
1637
1674
|
ry: "2"
|
|
1638
|
-
}),
|
|
1639
|
-
e.readOnly ?
|
|
1675
|
+
}), j("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })], -1)]], 8, Gr),
|
|
1676
|
+
e.readOnly ? k("", !0) : (L(), A("button", {
|
|
1640
1677
|
key: 0,
|
|
1641
1678
|
class: "docx-hyperlink-popup__btn",
|
|
1642
|
-
title: V(
|
|
1643
|
-
onClick:
|
|
1644
|
-
}, [...
|
|
1679
|
+
title: V(n)("hyperlinkPopup.editLink"),
|
|
1680
|
+
onClick: q(m, ["prevent"])
|
|
1681
|
+
}, [...r[8] ||= [j("svg", {
|
|
1645
1682
|
width: "18",
|
|
1646
1683
|
height: "18",
|
|
1647
1684
|
viewBox: "0 0 24 24",
|
|
@@ -1650,65 +1687,71 @@ var Gt = /* @__PURE__ */ M({
|
|
|
1650
1687
|
"stroke-width": "2",
|
|
1651
1688
|
"stroke-linecap": "round",
|
|
1652
1689
|
"stroke-linejoin": "round"
|
|
1653
|
-
}, [
|
|
1654
|
-
e.readOnly ?
|
|
1690
|
+
}, [j("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }), j("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })], -1)]], 8, Kr)),
|
|
1691
|
+
e.readOnly ? k("", !0) : (L(), A("button", {
|
|
1655
1692
|
key: 1,
|
|
1656
1693
|
class: "docx-hyperlink-popup__btn",
|
|
1657
|
-
title: V(
|
|
1658
|
-
onClick:
|
|
1659
|
-
}, [...
|
|
1660
|
-
], 64))], 38)) :
|
|
1694
|
+
title: V(n)("hyperlinkPopup.removeLink"),
|
|
1695
|
+
onClick: r[1] ||= q((e) => t.$emit("remove"), ["prevent"])
|
|
1696
|
+
}, [...r[9] ||= [ie("<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" data-v-9d23bb12><path d=\"M18.84 12.25l1.72-1.71h-.02a5.004 5.004 0 0 0-.12-7.07 5.006 5.006 0 0 0-6.95 0l-1.72 1.71\" data-v-9d23bb12></path><path d=\"M5.17 11.75l-1.71 1.71a5.004 5.004 0 0 0 .12 7.07 5.006 5.006 0 0 0 6.95 0l1.71-1.71\" data-v-9d23bb12></path><line x1=\"8\" y1=\"2\" x2=\"8\" y2=\"5\" data-v-9d23bb12></line><line x1=\"2\" y1=\"8\" x2=\"5\" y2=\"8\" data-v-9d23bb12></line><line x1=\"16\" y1=\"19\" x2=\"16\" y2=\"22\" data-v-9d23bb12></line><line x1=\"19\" y1=\"16\" x2=\"22\" y2=\"16\" data-v-9d23bb12></line></svg>", 1)]], 8, qr))
|
|
1697
|
+
], 64))], 38)) : k("", !0);
|
|
1661
1698
|
}
|
|
1662
1699
|
}), [["__scopeId", "data-v-9d23bb12"]]);
|
|
1663
1700
|
//#endregion
|
|
1664
1701
|
//#region src/composables/useFileIO.ts
|
|
1665
|
-
function
|
|
1666
|
-
let t = R(null);
|
|
1667
|
-
|
|
1702
|
+
function ei(e) {
|
|
1703
|
+
let t = R(null), n = R(null);
|
|
1704
|
+
function r(t) {
|
|
1705
|
+
let n = t.target, r = n.files?.[0], i = e.getActiveView();
|
|
1706
|
+
r && i && ht(i, r, { onError: (t) => e.emit("error", t instanceof Error ? t : /* @__PURE__ */ Error("Failed to insert image")) }), n.value = "";
|
|
1707
|
+
}
|
|
1708
|
+
async function i() {
|
|
1668
1709
|
await e.nextTick(), e.extractCommentsAndChanges(), e.emit("ready");
|
|
1669
1710
|
}
|
|
1670
|
-
async function
|
|
1711
|
+
async function a(t) {
|
|
1671
1712
|
try {
|
|
1672
|
-
let
|
|
1673
|
-
if (!
|
|
1674
|
-
await e.loadBuffer(
|
|
1713
|
+
let n = await Q(t);
|
|
1714
|
+
if (!n) return;
|
|
1715
|
+
await e.loadBuffer(n.buffer), e.emit("update:document", e.getDocument()), e.emit("rename", n.name), await i();
|
|
1675
1716
|
} catch (t) {
|
|
1676
1717
|
e.emit("error", t instanceof Error ? t : /* @__PURE__ */ Error("Failed to open document"));
|
|
1677
1718
|
}
|
|
1678
1719
|
}
|
|
1679
|
-
function
|
|
1720
|
+
function o(t) {
|
|
1680
1721
|
e.onDocumentNameChange?.(t), e.emit("rename", t);
|
|
1681
1722
|
}
|
|
1682
|
-
async function
|
|
1723
|
+
async function s() {
|
|
1683
1724
|
let t = await e.saveBlob();
|
|
1684
1725
|
if (!t) return;
|
|
1685
1726
|
let n = (e.documentName() ?? "").trim() || "document", r = URL.createObjectURL(t), i = window.document.createElement("a");
|
|
1686
1727
|
i.href = r, i.download = `${n.replace(/\.docx$/i, "")}.docx`, i.click(), setTimeout(() => URL.revokeObjectURL(r), 0);
|
|
1687
1728
|
}
|
|
1688
|
-
async function
|
|
1689
|
-
await e.loadBuffer(t), e.emit("update:document", e.getDocument()), await
|
|
1729
|
+
async function c(t) {
|
|
1730
|
+
await e.loadBuffer(t), e.emit("update:document", e.getDocument()), await i();
|
|
1690
1731
|
}
|
|
1691
|
-
function
|
|
1692
|
-
e.loadParsedDocument(t), e.emit("update:document", t),
|
|
1732
|
+
function l(t) {
|
|
1733
|
+
e.loadParsedDocument(t), e.emit("update:document", t), i();
|
|
1693
1734
|
}
|
|
1694
|
-
async function
|
|
1735
|
+
async function u() {
|
|
1695
1736
|
let t = await e.saveBlob();
|
|
1696
1737
|
return t ? t.arrayBuffer() : null;
|
|
1697
1738
|
}
|
|
1698
1739
|
return {
|
|
1699
1740
|
docxInputRef: t,
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1741
|
+
imageInputRef: n,
|
|
1742
|
+
handleImageFileChange: r,
|
|
1743
|
+
handleDocxFileChange: a,
|
|
1744
|
+
handleDocumentNameChange: o,
|
|
1745
|
+
downloadCurrentDocument: s,
|
|
1746
|
+
emitReadyAfterSidebarStateRefresh: i,
|
|
1747
|
+
loadDocumentBuffer: c,
|
|
1748
|
+
loadDocument: l,
|
|
1749
|
+
save: u
|
|
1707
1750
|
};
|
|
1708
1751
|
}
|
|
1709
1752
|
//#endregion
|
|
1710
1753
|
//#region src/composables/useHyperlinkManagement.ts
|
|
1711
|
-
function
|
|
1754
|
+
function ti(e) {
|
|
1712
1755
|
let t = R(null);
|
|
1713
1756
|
function n(t) {
|
|
1714
1757
|
let n = e.editorView.value;
|
|
@@ -1737,7 +1780,7 @@ function Wr(e) {
|
|
|
1737
1780
|
function a(n, r) {
|
|
1738
1781
|
let i = e.editorView.value;
|
|
1739
1782
|
if (!i) return;
|
|
1740
|
-
let a =
|
|
1783
|
+
let a = We(i.state);
|
|
1741
1784
|
if (!a) {
|
|
1742
1785
|
t.value = null;
|
|
1743
1786
|
return;
|
|
@@ -1751,7 +1794,7 @@ function Wr(e) {
|
|
|
1751
1794
|
function o() {
|
|
1752
1795
|
let n = e.editorView.value;
|
|
1753
1796
|
if (!n) return;
|
|
1754
|
-
let r =
|
|
1797
|
+
let r = We(n.state, t.value?.href);
|
|
1755
1798
|
if (!r) {
|
|
1756
1799
|
t.value = null;
|
|
1757
1800
|
return;
|
|
@@ -1770,56 +1813,61 @@ function Wr(e) {
|
|
|
1770
1813
|
}
|
|
1771
1814
|
//#endregion
|
|
1772
1815
|
//#region src/composables/useFormattingActions.ts
|
|
1773
|
-
function
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1816
|
+
function ni(e) {
|
|
1817
|
+
let t = () => e.activeView?.value ?? e.editorView.value;
|
|
1818
|
+
function n() {
|
|
1819
|
+
let e = t();
|
|
1820
|
+
e && (Ue(e.state, e.dispatch, e), e.focus());
|
|
1777
1821
|
}
|
|
1778
|
-
function n
|
|
1779
|
-
let
|
|
1780
|
-
if (!
|
|
1781
|
-
let
|
|
1782
|
-
if (
|
|
1783
|
-
let e =
|
|
1784
|
-
|
|
1822
|
+
function r(n) {
|
|
1823
|
+
let r = t();
|
|
1824
|
+
if (!r) return;
|
|
1825
|
+
let i = e.getDocument(), a = i?.package?.styles;
|
|
1826
|
+
if (a) {
|
|
1827
|
+
let e = wt(a).resolveParagraphStyle(n);
|
|
1828
|
+
yt(n, {
|
|
1785
1829
|
paragraphFormatting: e.paragraphFormatting,
|
|
1786
|
-
runFormatting: e.runFormatting
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
n.
|
|
1830
|
+
runFormatting: e.runFormatting,
|
|
1831
|
+
numbering: i?.package?.numbering ? Tt(i.package.numbering) : null
|
|
1832
|
+
})(r.state, (e) => r.dispatch(e));
|
|
1833
|
+
} else yt(n)(r.state, (e) => r.dispatch(e));
|
|
1834
|
+
r.focus();
|
|
1790
1835
|
}
|
|
1791
|
-
function
|
|
1836
|
+
function i() {
|
|
1792
1837
|
let t = e.editorView.value;
|
|
1793
|
-
t && (
|
|
1838
|
+
t && (Et(t.state, (e) => t.dispatch(e), t), t.focus());
|
|
1794
1839
|
}
|
|
1795
|
-
function
|
|
1796
|
-
let n =
|
|
1840
|
+
function a(e) {
|
|
1841
|
+
let n = t();
|
|
1797
1842
|
if (!n) return;
|
|
1798
|
-
let { from: r } = n.state.selection, i = n.state.tr.insertText(
|
|
1843
|
+
let { from: r } = n.state.selection, i = n.state.tr.insertText(e, r);
|
|
1799
1844
|
n.dispatch(i.scrollIntoView()), n.focus();
|
|
1800
1845
|
}
|
|
1801
|
-
function
|
|
1846
|
+
function o(t) {
|
|
1802
1847
|
let n = e.editorView.value;
|
|
1803
|
-
return n ?
|
|
1848
|
+
return n ? Dt(n, t) : !1;
|
|
1804
1849
|
}
|
|
1805
|
-
function
|
|
1850
|
+
function s(t) {
|
|
1806
1851
|
let n = e.editorView.value;
|
|
1807
1852
|
if (!n) return !1;
|
|
1808
1853
|
let r = e.getDocument();
|
|
1809
|
-
return
|
|
1854
|
+
return Ot(n, t, {
|
|
1855
|
+
styleResolver: r?.package?.styles ? wt(r.package.styles) : null,
|
|
1856
|
+
numbering: r?.package?.numbering ? Tt(r.package.numbering) : null
|
|
1857
|
+
});
|
|
1810
1858
|
}
|
|
1811
1859
|
return {
|
|
1812
|
-
handleClearFormatting:
|
|
1813
|
-
handleApplyStyle:
|
|
1814
|
-
handleInsertPageBreak:
|
|
1815
|
-
handleInsertSymbol:
|
|
1816
|
-
applyFormatting:
|
|
1817
|
-
setParagraphStyle:
|
|
1860
|
+
handleClearFormatting: n,
|
|
1861
|
+
handleApplyStyle: r,
|
|
1862
|
+
handleInsertPageBreak: i,
|
|
1863
|
+
handleInsertSymbol: a,
|
|
1864
|
+
applyFormatting: o,
|
|
1865
|
+
setParagraphStyle: s
|
|
1818
1866
|
};
|
|
1819
1867
|
}
|
|
1820
1868
|
//#endregion
|
|
1821
1869
|
//#region src/composables/usePageSetupControls.ts
|
|
1822
|
-
function
|
|
1870
|
+
function ri(e) {
|
|
1823
1871
|
function t(t) {
|
|
1824
1872
|
let n = e.getDocument();
|
|
1825
1873
|
if (!n?.package?.document) return;
|
|
@@ -1846,19 +1894,19 @@ function Kr(e) {
|
|
|
1846
1894
|
}
|
|
1847
1895
|
function s(t) {
|
|
1848
1896
|
let n = e.editorView.value;
|
|
1849
|
-
n &&
|
|
1897
|
+
n && St(t)(n.state, n.dispatch);
|
|
1850
1898
|
}
|
|
1851
1899
|
function c(t) {
|
|
1852
1900
|
let n = e.editorView.value;
|
|
1853
|
-
n &&
|
|
1901
|
+
n && Ct(t)(n.state, n.dispatch);
|
|
1854
1902
|
}
|
|
1855
1903
|
function l(t) {
|
|
1856
1904
|
let n = e.editorView.value;
|
|
1857
|
-
n && (t < 0 ?
|
|
1905
|
+
n && (t < 0 ? xt(-t, !0)(n.state, n.dispatch) : xt(t, !1)(n.state, n.dispatch));
|
|
1858
1906
|
}
|
|
1859
1907
|
function u(t) {
|
|
1860
1908
|
let n = e.editorView.value;
|
|
1861
|
-
n &&
|
|
1909
|
+
n && bt(t)(n.state, n.dispatch);
|
|
1862
1910
|
}
|
|
1863
1911
|
return {
|
|
1864
1912
|
handlePageSetupApply: t,
|
|
@@ -1874,16 +1922,16 @@ function Kr(e) {
|
|
|
1874
1922
|
}
|
|
1875
1923
|
//#endregion
|
|
1876
1924
|
//#region src/composables/useWatermarkControls.ts
|
|
1877
|
-
function
|
|
1878
|
-
let t = R(!1), n =
|
|
1925
|
+
function ii(e) {
|
|
1926
|
+
let t = R(!1), n = E(() => {
|
|
1879
1927
|
e.stateTick.value;
|
|
1880
1928
|
let t = e.editorView.value;
|
|
1881
|
-
return t ?
|
|
1929
|
+
return t ? mt(t.state) ?? void 0 : void 0;
|
|
1882
1930
|
});
|
|
1883
1931
|
function r(t) {
|
|
1884
1932
|
if (e.readOnly.value) return;
|
|
1885
1933
|
let n = e.editorView.value;
|
|
1886
|
-
n && (
|
|
1934
|
+
n && (vt(t)(n.state, n.dispatch), e.stateTick.value++, n.focus());
|
|
1887
1935
|
}
|
|
1888
1936
|
return {
|
|
1889
1937
|
showWatermark: t,
|
|
@@ -1893,18 +1941,18 @@ function qr(e) {
|
|
|
1893
1941
|
}
|
|
1894
1942
|
//#endregion
|
|
1895
1943
|
//#region src/composables/useOutlineSidebar.ts
|
|
1896
|
-
function
|
|
1944
|
+
function ai(e) {
|
|
1897
1945
|
function t() {
|
|
1898
1946
|
if (!e.showOutline.value) {
|
|
1899
1947
|
let t = e.editorView.value;
|
|
1900
|
-
t && (e.outlineHeadings.value =
|
|
1948
|
+
t && (e.outlineHeadings.value = kt(t.state.doc));
|
|
1901
1949
|
}
|
|
1902
1950
|
e.showOutline.value = !e.showOutline.value;
|
|
1903
1951
|
}
|
|
1904
1952
|
function n(t) {
|
|
1905
1953
|
let n = e.editorView.value;
|
|
1906
1954
|
if (!n) return;
|
|
1907
|
-
let r = n.state.doc.resolve(Math.min(t + 1, n.state.doc.content.size)), i =
|
|
1955
|
+
let r = n.state.doc.resolve(Math.min(t + 1, n.state.doc.content.size)), i = he.near(r);
|
|
1908
1956
|
n.dispatch(n.state.tr.setSelection(i).scrollIntoView()), n.focus();
|
|
1909
1957
|
}
|
|
1910
1958
|
function r() {
|
|
@@ -1923,7 +1971,7 @@ function Jr(e) {
|
|
|
1923
1971
|
}
|
|
1924
1972
|
//#endregion
|
|
1925
1973
|
//#region src/composables/useKeyboardShortcuts.ts
|
|
1926
|
-
function
|
|
1974
|
+
function oi(e) {
|
|
1927
1975
|
function t(t) {
|
|
1928
1976
|
if (t.key === "F1") {
|
|
1929
1977
|
t.preventDefault(), e.showKeyboardShortcuts.value = !0;
|
|
@@ -1935,22 +1983,22 @@ function Yr(e) {
|
|
|
1935
1983
|
}
|
|
1936
1984
|
//#endregion
|
|
1937
1985
|
//#region src/composables/useCommentManagement.ts
|
|
1938
|
-
function
|
|
1986
|
+
function si(e) {
|
|
1939
1987
|
let t = () => V(e.author) ?? "User";
|
|
1940
1988
|
function n(t) {
|
|
1941
1989
|
e.comments.value = t, e.commentCallbacks?.onCommentsChange?.(t);
|
|
1942
1990
|
}
|
|
1943
1991
|
function r() {
|
|
1944
|
-
|
|
1992
|
+
Ft(e.commentIdAllocator, e.getDocument()?.package?.document?.comments, e.editorView.value);
|
|
1945
1993
|
}
|
|
1946
1994
|
function i(t, n, i) {
|
|
1947
|
-
return r(),
|
|
1995
|
+
return r(), Mt(e.commentIdAllocator, t, n, i);
|
|
1948
1996
|
}
|
|
1949
1997
|
function a(t) {
|
|
1950
1998
|
let i = e.getDocument(), a = e.editorView.value;
|
|
1951
1999
|
if (!i?.package?.document || !a) return null;
|
|
1952
2000
|
i.package.document.comments || (i.package.document.comments = []), r();
|
|
1953
|
-
let o =
|
|
2001
|
+
let o = At(a, t, e.commentIdAllocator);
|
|
1954
2002
|
return o ? (i.package.document.comments.push(o), n([...i.package.document.comments]), e.showSidebar.value = !0, e.emit("change", i), e.contentChangeSubscribers.forEach((e) => e(i)), o.id) : null;
|
|
1955
2003
|
}
|
|
1956
2004
|
function o(t, r, a) {
|
|
@@ -1969,7 +2017,7 @@ function Xr(e) {
|
|
|
1969
2017
|
let n = e.editorView.value;
|
|
1970
2018
|
if (!n) return !1;
|
|
1971
2019
|
r();
|
|
1972
|
-
let i =
|
|
2020
|
+
let i = jt(n, t, e.commentIdAllocator);
|
|
1973
2021
|
return i && (e.extractCommentsAndChanges(), e.showSidebar.value = !0), i;
|
|
1974
2022
|
}
|
|
1975
2023
|
function l(n, r) {
|
|
@@ -1996,36 +2044,26 @@ function Xr(e) {
|
|
|
1996
2044
|
}
|
|
1997
2045
|
function p(t, n) {
|
|
1998
2046
|
let r = e.editorView.value;
|
|
1999
|
-
r && (
|
|
2047
|
+
r && (ft(t, n)(r.state, r.dispatch), e.extractCommentsAndChanges(), r.focus());
|
|
2000
2048
|
}
|
|
2001
2049
|
function m(t, n) {
|
|
2002
2050
|
let r = e.editorView.value;
|
|
2003
|
-
r && (
|
|
2051
|
+
r && (gt(t, n)(r.state, r.dispatch), e.extractCommentsAndChanges(), r.focus());
|
|
2004
2052
|
}
|
|
2005
2053
|
function h(t) {
|
|
2006
2054
|
let n = e.editorView.value;
|
|
2007
|
-
n && (
|
|
2055
|
+
n && (pt(t)(n.state, n.dispatch), e.extractCommentsAndChanges(), n.focus());
|
|
2008
2056
|
}
|
|
2009
2057
|
function g(t) {
|
|
2010
2058
|
let n = e.editorView.value;
|
|
2011
|
-
n && (
|
|
2059
|
+
n && (_t(t)(n.state, n.dispatch), e.extractCommentsAndChanges(), n.focus());
|
|
2012
2060
|
}
|
|
2013
2061
|
function _(r, a) {
|
|
2014
|
-
let o = e.getDocument()
|
|
2015
|
-
if (!o?.package?.document
|
|
2062
|
+
let o = e.getDocument();
|
|
2063
|
+
if (!o?.package?.document) return;
|
|
2016
2064
|
o.package.document.comments || (o.package.document.comments = []);
|
|
2017
|
-
let
|
|
2018
|
-
|
|
2019
|
-
let l = null, u = s.state.schema.marks.insertion, d = s.state.schema.marks.deletion;
|
|
2020
|
-
if (s.state.doc.descendants((e, t) => {
|
|
2021
|
-
if (l !== null) return !1;
|
|
2022
|
-
for (let n of e.marks) if ((n.type === u || n.type === d) && n.attrs.revisionId === r) return l = t, !1;
|
|
2023
|
-
return !0;
|
|
2024
|
-
}), l === null) return;
|
|
2025
|
-
let f = i(a, t());
|
|
2026
|
-
o.package.document.comments.push(f), n([...o.package.document.comments]);
|
|
2027
|
-
let p = l, m = Math.min(p + 1, s.state.doc.content.size);
|
|
2028
|
-
s.dispatch(s.state.tr.addMark(p, m, c.create({ commentId: f.id }))), e.emit("change", o);
|
|
2065
|
+
let s = i(a, t(), r);
|
|
2066
|
+
o.package.document.comments.push(s), n([...o.package.document.comments]), e.emit("change", o);
|
|
2029
2067
|
}
|
|
2030
2068
|
return {
|
|
2031
2069
|
addComment: a,
|
|
@@ -2045,8 +2083,8 @@ function Xr(e) {
|
|
|
2045
2083
|
}
|
|
2046
2084
|
//#endregion
|
|
2047
2085
|
//#region src/composables/useHostCallbacks.ts
|
|
2048
|
-
function
|
|
2049
|
-
return
|
|
2086
|
+
function ci(e, t) {
|
|
2087
|
+
return W(t, (t) => t && e.onEditorViewReady?.(t), { immediate: !0 }), { commentCallbacks: {
|
|
2050
2088
|
onCommentAdd: (t) => e.onCommentAdd?.(t),
|
|
2051
2089
|
onCommentResolve: (t) => e.onCommentResolve?.(t),
|
|
2052
2090
|
onCommentDelete: (t) => e.onCommentDelete?.(t),
|
|
@@ -2056,11 +2094,11 @@ function Zr(e, t) {
|
|
|
2056
2094
|
}
|
|
2057
2095
|
//#endregion
|
|
2058
2096
|
//#region src/composables/useCommentLifecycle.ts
|
|
2059
|
-
function
|
|
2097
|
+
function li(e) {
|
|
2060
2098
|
let t = R(null), n = R(null), r = R(null), i = R(!1);
|
|
2061
2099
|
function a() {
|
|
2062
2100
|
let t = e.getDocument(), n = e.editorView.value;
|
|
2063
|
-
!t || !n || (e.comments.value = [...t.package?.document?.comments ?? []], e.trackedChanges.value =
|
|
2101
|
+
!t || !n || (e.comments.value = [...t.package?.document?.comments ?? []], e.trackedChanges.value = It(n.state).entries, !i.value && (e.comments.value.length > 0 || e.trackedChanges.value.length > 0) && (e.showSidebar.value = !0, i.value = !0));
|
|
2064
2102
|
}
|
|
2065
2103
|
function o() {
|
|
2066
2104
|
e.stateTick.value;
|
|
@@ -2079,7 +2117,7 @@ function Qr(e) {
|
|
|
2079
2117
|
t.value = null;
|
|
2080
2118
|
return;
|
|
2081
2119
|
}
|
|
2082
|
-
let s = o.getBoundingClientRect(), c =
|
|
2120
|
+
let s = o.getBoundingClientRect(), c = qt(a, r);
|
|
2083
2121
|
if (!c) {
|
|
2084
2122
|
t.value = null;
|
|
2085
2123
|
return;
|
|
@@ -2107,7 +2145,7 @@ function Qr(e) {
|
|
|
2107
2145
|
for (let t of r) {
|
|
2108
2146
|
if (t.type.name === "comment" && t.attrs.commentId != null) {
|
|
2109
2147
|
let n = t.attrs.commentId;
|
|
2110
|
-
if (n ===
|
|
2148
|
+
if (n === Nt || e.resolvedCommentIds.value.has(n)) continue;
|
|
2111
2149
|
i = `comment-${n}`;
|
|
2112
2150
|
break;
|
|
2113
2151
|
}
|
|
@@ -2132,7 +2170,7 @@ function Qr(e) {
|
|
|
2132
2170
|
}, r.value = t.value?.top ?? null;
|
|
2133
2171
|
let s = i.state.schema.marks.comment;
|
|
2134
2172
|
if (s) {
|
|
2135
|
-
let e = i.state.tr.addMark(a, o, s.create({ commentId:
|
|
2173
|
+
let e = i.state.tr.addMark(a, o, s.create({ commentId: Nt }));
|
|
2136
2174
|
i.dispatch(e);
|
|
2137
2175
|
}
|
|
2138
2176
|
e.showSidebar.value = !0, e.isAddingComment.value = !0, t.value = null;
|
|
@@ -2140,8 +2178,8 @@ function Qr(e) {
|
|
|
2140
2178
|
function l(t) {
|
|
2141
2179
|
let i = e.getDocument(), a = e.editorView.value;
|
|
2142
2180
|
if (!i?.package) return;
|
|
2143
|
-
i.package.document.comments || (i.package.document.comments = []),
|
|
2144
|
-
let o =
|
|
2181
|
+
i.package.document.comments || (i.package.document.comments = []), Ft(e.commentIdAllocator, i.package.document.comments, a);
|
|
2182
|
+
let o = Mt(e.commentIdAllocator, t, V(e.author) ?? "User");
|
|
2145
2183
|
i.package.document.comments.push(o), e.comments.value = [...i.package.document.comments], e.commentCallbacks?.onCommentsChange?.(e.comments.value), e.commentCallbacks?.onCommentAdd?.(o);
|
|
2146
2184
|
let s = n.value;
|
|
2147
2185
|
if (a && s && s.from !== s.to) {
|
|
@@ -2164,11 +2202,11 @@ function Qr(e) {
|
|
|
2164
2202
|
function d(t) {
|
|
2165
2203
|
e.showSidebar.value = !0;
|
|
2166
2204
|
}
|
|
2167
|
-
|
|
2205
|
+
W([
|
|
2168
2206
|
e.stateTick,
|
|
2169
2207
|
e.isAddingComment,
|
|
2170
2208
|
e.zoom
|
|
2171
|
-
], () => o()),
|
|
2209
|
+
], () => o()), W(e.stateTick, () => s()), W(e.stateTick, () => a());
|
|
2172
2210
|
let f = null;
|
|
2173
2211
|
return I(() => {
|
|
2174
2212
|
f = new ResizeObserver(() => o()), e.pagesRef.value && f.observe(e.pagesRef.value), window.addEventListener("resize", o);
|
|
@@ -2190,8 +2228,8 @@ function Qr(e) {
|
|
|
2190
2228
|
}
|
|
2191
2229
|
//#endregion
|
|
2192
2230
|
//#region src/composables/useImageActions.ts
|
|
2193
|
-
function
|
|
2194
|
-
let t =
|
|
2231
|
+
function ui(e) {
|
|
2232
|
+
let t = fe(null), n = R(!1), r = E(() => {
|
|
2195
2233
|
e.stateTick.value;
|
|
2196
2234
|
let n = e.editorView.value, r = t.value;
|
|
2197
2235
|
if (!n || !r) return null;
|
|
@@ -2202,28 +2240,15 @@ function $r(e) {
|
|
|
2202
2240
|
cssFloat: i.attrs.cssFloat ?? null
|
|
2203
2241
|
};
|
|
2204
2242
|
});
|
|
2205
|
-
function i(
|
|
2206
|
-
let n = e.editorView.value;
|
|
2207
|
-
if (!n) return;
|
|
2208
|
-
let r = n.state.schema.nodes.image;
|
|
2209
|
-
if (!r) return;
|
|
2210
|
-
let i = r.create({
|
|
2211
|
-
src: t.src,
|
|
2212
|
-
alt: t.alt,
|
|
2213
|
-
width: t.width,
|
|
2214
|
-
height: t.height
|
|
2215
|
-
});
|
|
2216
|
-
bt(n.state, n.dispatch, i, n.state.selection.from), n.focus();
|
|
2217
|
-
}
|
|
2218
|
-
function a(n) {
|
|
2243
|
+
function i(n) {
|
|
2219
2244
|
let r = e.editorView.value, i = t.value;
|
|
2220
2245
|
if (!r || !i) return;
|
|
2221
|
-
let a =
|
|
2246
|
+
let a = ot(n);
|
|
2222
2247
|
if (!a) return;
|
|
2223
|
-
let o = r.state.doc.nodeAt(i.pmPos), s = e.getCommands(), c = o?.attrs.wrapType === "inline" && a !== "inline" ? { initialPositionEmu:
|
|
2248
|
+
let o = r.state.doc.nodeAt(i.pmPos), s = e.getCommands(), c = o?.attrs.wrapType === "inline" && a !== "inline" ? { initialPositionEmu: tt(i.element, e.zoom.value) } : void 0, l = s.setImageWrapType?.(i.pmPos, a, c);
|
|
2224
2249
|
l && (l(r.state, (e) => r.dispatch(e), r), r.focus());
|
|
2225
2250
|
}
|
|
2226
|
-
function
|
|
2251
|
+
function a(n) {
|
|
2227
2252
|
let r = e.editorView.value, i = t.value;
|
|
2228
2253
|
if (!r || !i) return;
|
|
2229
2254
|
let a = r.state.doc.nodeAt(i.pmPos);
|
|
@@ -2242,15 +2267,14 @@ function $r(e) {
|
|
|
2242
2267
|
selectedImage: t,
|
|
2243
2268
|
imageInteracting: n,
|
|
2244
2269
|
imageToolbarContext: r,
|
|
2245
|
-
|
|
2246
|
-
|
|
2247
|
-
handleImageTransform: o
|
|
2270
|
+
handleToolbarImageWrap: i,
|
|
2271
|
+
handleImageTransform: a
|
|
2248
2272
|
};
|
|
2249
2273
|
}
|
|
2250
2274
|
//#endregion
|
|
2251
2275
|
//#region src/utils/imageClipboard.ts
|
|
2252
|
-
function
|
|
2253
|
-
let r =
|
|
2276
|
+
function di(e, t, n) {
|
|
2277
|
+
let r = ut(e.state), i = e.state.schema.marks.insertion;
|
|
2254
2278
|
if (!r || !i) return;
|
|
2255
2279
|
let a = t.selection.from, o = a - n.nodeSize;
|
|
2256
2280
|
o < 0 || t.addMark(o, a, i.create({
|
|
@@ -2259,10 +2283,10 @@ function ei(e, t, n) {
|
|
|
2259
2283
|
date: r.date
|
|
2260
2284
|
}));
|
|
2261
2285
|
}
|
|
2262
|
-
function
|
|
2286
|
+
function fi(e, t) {
|
|
2263
2287
|
return e.getBlob(t);
|
|
2264
2288
|
}
|
|
2265
|
-
function
|
|
2289
|
+
function pi(e, t) {
|
|
2266
2290
|
let n = e.state.doc.nodeAt(t);
|
|
2267
2291
|
if (!n || n.type.name !== "image") return;
|
|
2268
2292
|
let r = `<img src="${n.attrs.src}" data-pm-image="true" data-width="${n.attrs.width ?? ""}" data-height="${n.attrs.height ?? ""}" data-wrap-type="${n.attrs.wrapType ?? ""}" data-display-mode="${n.attrs.displayMode ?? ""}" data-rid="${n.attrs.rId ?? ""}" />`, i = new ClipboardItem({
|
|
@@ -2274,13 +2298,13 @@ function ni(e, t) {
|
|
|
2274
2298
|
e.value = r, document.body.appendChild(e), e.select(), document.execCommand("copy"), document.body.removeChild(e);
|
|
2275
2299
|
});
|
|
2276
2300
|
}
|
|
2277
|
-
function
|
|
2301
|
+
function mi(e) {
|
|
2278
2302
|
return new Promise((t, n) => {
|
|
2279
2303
|
let r = new FileReader();
|
|
2280
2304
|
r.onload = () => t(r.result), r.onerror = n, r.readAsDataURL(e);
|
|
2281
2305
|
});
|
|
2282
2306
|
}
|
|
2283
|
-
function
|
|
2307
|
+
function hi(e) {
|
|
2284
2308
|
return new Promise((t) => {
|
|
2285
2309
|
let n = new Image();
|
|
2286
2310
|
n.onload = () => t({
|
|
@@ -2292,13 +2316,13 @@ function ii(e) {
|
|
|
2292
2316
|
}), n.src = e;
|
|
2293
2317
|
});
|
|
2294
2318
|
}
|
|
2295
|
-
async function
|
|
2319
|
+
async function gi(e) {
|
|
2296
2320
|
try {
|
|
2297
2321
|
let t = await navigator.clipboard.read();
|
|
2298
2322
|
for (let n of t) {
|
|
2299
2323
|
let t = n.types.find((e) => e.startsWith("image/"));
|
|
2300
2324
|
if (t) {
|
|
2301
|
-
let r = await
|
|
2325
|
+
let r = await mi(await fi(n, t)), i = await hi(r), a = i.width, o = i.height;
|
|
2302
2326
|
a > 612 && (o = Math.round(612 / a * o), a = 612);
|
|
2303
2327
|
let s = e.state.schema.nodes.image.create({
|
|
2304
2328
|
src: r,
|
|
@@ -2308,11 +2332,11 @@ async function ai(e) {
|
|
|
2308
2332
|
wrapType: "inline",
|
|
2309
2333
|
displayMode: "inline"
|
|
2310
2334
|
}), c = e.state.tr.replaceSelectionWith(s);
|
|
2311
|
-
|
|
2335
|
+
di(e, c, s), e.dispatch(c);
|
|
2312
2336
|
return;
|
|
2313
2337
|
}
|
|
2314
2338
|
if (n.types.includes("text/html")) {
|
|
2315
|
-
let t = await (await
|
|
2339
|
+
let t = await (await fi(n, "text/html")).text(), r = t.match(/<img[^>]+src="([^"]+)"[^>]*>/i);
|
|
2316
2340
|
if (r && r[1]) {
|
|
2317
2341
|
let n = r[1], i = t.match(/data-width="(\d+)"/), a = t.match(/data-height="(\d+)"/), o = i ? Number(i[1]) : 200, s = a ? Number(a[1]) : 200, c = e.state.schema.nodes.image.create({
|
|
2318
2342
|
src: n,
|
|
@@ -2322,12 +2346,12 @@ async function ai(e) {
|
|
|
2322
2346
|
wrapType: "inline",
|
|
2323
2347
|
displayMode: "inline"
|
|
2324
2348
|
}), l = e.state.tr.replaceSelectionWith(c);
|
|
2325
|
-
|
|
2349
|
+
di(e, l, c), e.dispatch(l);
|
|
2326
2350
|
return;
|
|
2327
2351
|
}
|
|
2328
2352
|
}
|
|
2329
2353
|
if (n.types.includes("text/plain")) {
|
|
2330
|
-
let t = await (await
|
|
2354
|
+
let t = await (await fi(n, "text/plain")).text();
|
|
2331
2355
|
if (t && t !== "[image]") {
|
|
2332
2356
|
let { from: n } = e.state.selection;
|
|
2333
2357
|
e.dispatch(e.state.tr.insertText(t, n));
|
|
@@ -2343,14 +2367,14 @@ async function ai(e) {
|
|
|
2343
2367
|
}
|
|
2344
2368
|
}
|
|
2345
2369
|
}
|
|
2346
|
-
function
|
|
2370
|
+
function _i(e, t) {
|
|
2347
2371
|
let n = e.state.doc.nodeAt(t);
|
|
2348
2372
|
if (!n || n.type.name !== "image") return;
|
|
2349
2373
|
let r = document.createElement("input");
|
|
2350
2374
|
r.type = "file", r.accept = "image/*", r.onchange = async () => {
|
|
2351
2375
|
let i = r.files?.[0];
|
|
2352
2376
|
if (!i) return;
|
|
2353
|
-
let a = await
|
|
2377
|
+
let a = await mi(i), o = await hi(a), s = n.attrs.width || o.width, c = n.attrs.height || o.height, l = Math.min(s / o.width, c / o.height), u = Math.round(o.width * l), d = Math.round(o.height * l);
|
|
2354
2378
|
try {
|
|
2355
2379
|
let r = e.state.tr.setNodeMarkup(t, void 0, {
|
|
2356
2380
|
...n.attrs,
|
|
@@ -2365,8 +2389,8 @@ function oi(e, t) {
|
|
|
2365
2389
|
}
|
|
2366
2390
|
//#endregion
|
|
2367
2391
|
//#region src/composables/useContextMenus.ts
|
|
2368
|
-
function
|
|
2369
|
-
let { t } =
|
|
2392
|
+
function vi(e) {
|
|
2393
|
+
let { t } = d(), n = R({
|
|
2370
2394
|
isOpen: !1,
|
|
2371
2395
|
position: {
|
|
2372
2396
|
x: 0,
|
|
@@ -2377,7 +2401,7 @@ function si(e) {
|
|
|
2377
2401
|
onImage: !1,
|
|
2378
2402
|
canMergeCells: !1,
|
|
2379
2403
|
canSplitCell: !1
|
|
2380
|
-
}),
|
|
2404
|
+
}), r = R(null), i = E(() => [
|
|
2381
2405
|
{
|
|
2382
2406
|
action: "cut",
|
|
2383
2407
|
label: t("contextMenu.cut"),
|
|
@@ -2400,16 +2424,16 @@ function si(e) {
|
|
|
2400
2424
|
shortcut: t("contextMenu.deleteShortcut")
|
|
2401
2425
|
}
|
|
2402
2426
|
]);
|
|
2403
|
-
function
|
|
2404
|
-
let
|
|
2405
|
-
if (!
|
|
2406
|
-
let a = t.target, o =
|
|
2427
|
+
function a(t) {
|
|
2428
|
+
let i = e.editorView.value;
|
|
2429
|
+
if (!i) return;
|
|
2430
|
+
let a = t.target, o = rt(a);
|
|
2407
2431
|
if (o) {
|
|
2408
2432
|
let a = Number(o.dataset.pmStart);
|
|
2409
2433
|
if (!isNaN(a)) {
|
|
2410
2434
|
try {
|
|
2411
|
-
let e =
|
|
2412
|
-
|
|
2435
|
+
let e = J.create(i.state.doc, a);
|
|
2436
|
+
i.dispatch(i.state.tr.setSelection(e));
|
|
2413
2437
|
} catch {}
|
|
2414
2438
|
e.selectedImage.value = {
|
|
2415
2439
|
element: o,
|
|
@@ -2417,32 +2441,32 @@ function si(e) {
|
|
|
2417
2441
|
width: o.offsetWidth,
|
|
2418
2442
|
height: o.offsetHeight
|
|
2419
2443
|
}, e.clearOverlay();
|
|
2420
|
-
let s =
|
|
2444
|
+
let s = i.state.doc.nodeAt(a);
|
|
2421
2445
|
if (s && s.type.name === "image") {
|
|
2422
|
-
let
|
|
2423
|
-
|
|
2446
|
+
let i = s.attrs.wrapType ?? "inline", c = s.attrs.cssFloat;
|
|
2447
|
+
r.value = {
|
|
2424
2448
|
open: !0,
|
|
2425
2449
|
position: {
|
|
2426
2450
|
x: t.clientX,
|
|
2427
2451
|
y: t.clientY
|
|
2428
2452
|
},
|
|
2429
2453
|
pmPos: a,
|
|
2430
|
-
currentWrapType:
|
|
2454
|
+
currentWrapType: i,
|
|
2431
2455
|
currentCssFloat: c ?? null,
|
|
2432
|
-
inlinePositionEmu:
|
|
2433
|
-
},
|
|
2456
|
+
inlinePositionEmu: i === "inline" ? tt(o, e.zoom.value) : void 0
|
|
2457
|
+
}, n.value.isOpen = !1;
|
|
2434
2458
|
return;
|
|
2435
2459
|
}
|
|
2436
2460
|
}
|
|
2437
2461
|
}
|
|
2438
2462
|
{
|
|
2439
|
-
let { from:
|
|
2440
|
-
if (a !== null && (a <
|
|
2463
|
+
let { from: n, to: r } = i.state.selection, a = e.resolvePos(t.clientX, t.clientY);
|
|
2464
|
+
if (a !== null && (a < n || a > r)) try {
|
|
2441
2465
|
e.setPmSelection(a);
|
|
2442
2466
|
} catch {}
|
|
2443
2467
|
}
|
|
2444
|
-
let s =
|
|
2445
|
-
|
|
2468
|
+
let s = Ge(i.state), { empty: c } = i.state.selection;
|
|
2469
|
+
r.value &&= null, n.value = {
|
|
2446
2470
|
isOpen: !0,
|
|
2447
2471
|
position: {
|
|
2448
2472
|
x: t.clientX,
|
|
@@ -2455,13 +2479,13 @@ function si(e) {
|
|
|
2455
2479
|
canSplitCell: !!s.canSplitCell
|
|
2456
2480
|
};
|
|
2457
2481
|
}
|
|
2458
|
-
function
|
|
2459
|
-
let
|
|
2460
|
-
if (!
|
|
2461
|
-
let o =
|
|
2482
|
+
function o(t) {
|
|
2483
|
+
let i = e.editorView.value, a = e.selectedImage.value;
|
|
2484
|
+
if (!i || !a) return;
|
|
2485
|
+
let o = i.state.doc.nodeAt(a.pmPos);
|
|
2462
2486
|
if (!o || o.type.name !== "image") return;
|
|
2463
2487
|
let s = o.attrs.wrapType ?? "inline", c = o.attrs.cssFloat;
|
|
2464
|
-
|
|
2488
|
+
r.value = {
|
|
2465
2489
|
open: !0,
|
|
2466
2490
|
position: {
|
|
2467
2491
|
x: t.clientX,
|
|
@@ -2470,32 +2494,32 @@ function si(e) {
|
|
|
2470
2494
|
pmPos: a.pmPos,
|
|
2471
2495
|
currentWrapType: s,
|
|
2472
2496
|
currentCssFloat: c ?? null,
|
|
2473
|
-
inlinePositionEmu: s === "inline" ?
|
|
2474
|
-
},
|
|
2497
|
+
inlinePositionEmu: s === "inline" ? tt(a.element, e.zoom.value) : void 0
|
|
2498
|
+
}, n.value.isOpen = !1;
|
|
2475
2499
|
}
|
|
2476
|
-
function
|
|
2477
|
-
let n = e.editorView.value,
|
|
2478
|
-
if (!n || !
|
|
2479
|
-
let a = e.getCommands(), o =
|
|
2500
|
+
function s(t) {
|
|
2501
|
+
let n = e.editorView.value, i = r.value;
|
|
2502
|
+
if (!n || !i) return;
|
|
2503
|
+
let a = e.getCommands(), o = i.inlinePositionEmu && t !== "inline" ? { initialPositionEmu: i.inlinePositionEmu } : void 0, s = a.setImageWrapType?.(i.pmPos, t, o);
|
|
2480
2504
|
s && (s(n.state, (e) => n.dispatch(e), n), n.focus());
|
|
2481
2505
|
}
|
|
2482
|
-
function
|
|
2506
|
+
function c(t) {
|
|
2483
2507
|
let n = e.editorView.value;
|
|
2484
2508
|
if (!n) return;
|
|
2485
2509
|
let r = e.getCommands();
|
|
2486
2510
|
switch (t) {
|
|
2487
2511
|
case "cut":
|
|
2488
2512
|
if (e.selectedImage.value) {
|
|
2489
|
-
|
|
2513
|
+
pi(n, e.selectedImage.value.pmPos);
|
|
2490
2514
|
let t = e.selectedImage.value.pmPos, r = n.state.doc.nodeAt(t);
|
|
2491
2515
|
r && (n.dispatch(n.state.tr.delete(t, t + r.nodeSize)), e.selectedImage.value = null);
|
|
2492
2516
|
} else document.execCommand("cut");
|
|
2493
2517
|
break;
|
|
2494
2518
|
case "copy":
|
|
2495
|
-
e.selectedImage.value ?
|
|
2519
|
+
e.selectedImage.value ? pi(n, e.selectedImage.value.pmPos) : document.execCommand("copy");
|
|
2496
2520
|
break;
|
|
2497
2521
|
case "paste":
|
|
2498
|
-
|
|
2522
|
+
gi(n);
|
|
2499
2523
|
break;
|
|
2500
2524
|
case "pasteAsPlainText":
|
|
2501
2525
|
navigator.clipboard.readText().then((e) => {
|
|
@@ -2508,7 +2532,7 @@ function si(e) {
|
|
|
2508
2532
|
break;
|
|
2509
2533
|
}
|
|
2510
2534
|
case "selectAll": {
|
|
2511
|
-
let e =
|
|
2535
|
+
let e = he.create(n.state.doc, 0, n.state.doc.content.size);
|
|
2512
2536
|
n.dispatch(n.state.tr.setSelection(e));
|
|
2513
2537
|
break;
|
|
2514
2538
|
}
|
|
@@ -2516,7 +2540,7 @@ function si(e) {
|
|
|
2516
2540
|
e.selectedImage.value && (e.showImageProperties.value = !0);
|
|
2517
2541
|
break;
|
|
2518
2542
|
case "replaceImage":
|
|
2519
|
-
e.selectedImage.value &&
|
|
2543
|
+
e.selectedImage.value && _i(n, e.selectedImage.value.pmPos);
|
|
2520
2544
|
break;
|
|
2521
2545
|
case "deleteImage":
|
|
2522
2546
|
if (e.selectedImage.value) {
|
|
@@ -2540,39 +2564,39 @@ function si(e) {
|
|
|
2540
2564
|
n.focus();
|
|
2541
2565
|
}
|
|
2542
2566
|
return {
|
|
2543
|
-
contextMenu:
|
|
2544
|
-
imageContextMenu:
|
|
2545
|
-
imageContextMenuTextActions:
|
|
2546
|
-
handleContextMenu:
|
|
2547
|
-
handleSelectedImageContextMenu:
|
|
2548
|
-
handleImageWrapSelect:
|
|
2549
|
-
handleContextMenuAction:
|
|
2567
|
+
contextMenu: n,
|
|
2568
|
+
imageContextMenu: r,
|
|
2569
|
+
imageContextMenuTextActions: i,
|
|
2570
|
+
handleContextMenu: a,
|
|
2571
|
+
handleSelectedImageContextMenu: o,
|
|
2572
|
+
handleImageWrapSelect: s,
|
|
2573
|
+
handleContextMenuAction: c
|
|
2550
2574
|
};
|
|
2551
2575
|
}
|
|
2552
2576
|
//#endregion
|
|
2553
2577
|
//#region src/composables/usePagesPointer.ts
|
|
2554
|
-
var
|
|
2555
|
-
function
|
|
2578
|
+
var yi = 500;
|
|
2579
|
+
function bi(e) {
|
|
2556
2580
|
let t = R(null), n = null;
|
|
2557
2581
|
function r() {
|
|
2558
2582
|
n !== null && (clearTimeout(n), n = null);
|
|
2559
2583
|
}
|
|
2560
|
-
let i =
|
|
2584
|
+
let i = fe(null), a = 0, o = null, s = 0, c = !1, l = null, u = zt(), d = ne({
|
|
2561
2585
|
pagesContainer: e.pagesRef,
|
|
2562
2586
|
onScrollExtendSelection: (e, t) => {
|
|
2563
2587
|
if (!c || l === null) return;
|
|
2564
|
-
let n =
|
|
2565
|
-
n !== null && n !== l &&
|
|
2588
|
+
let n = m(e, t);
|
|
2589
|
+
n !== null && n !== l && g(l, n);
|
|
2566
2590
|
}
|
|
2567
|
-
}),
|
|
2591
|
+
}), f = R({
|
|
2568
2592
|
currentPage: 1,
|
|
2569
2593
|
totalPages: 1,
|
|
2570
2594
|
visible: !1
|
|
2571
|
-
}),
|
|
2572
|
-
function
|
|
2573
|
-
return
|
|
2595
|
+
}), p = null;
|
|
2596
|
+
function m(t, n) {
|
|
2597
|
+
return Yt(e.pagesRef.value, e.editorView.value, t, n);
|
|
2574
2598
|
}
|
|
2575
|
-
function
|
|
2599
|
+
function h() {
|
|
2576
2600
|
let t = i.value;
|
|
2577
2601
|
if (t?.headerFooter && e.getHfPmView) {
|
|
2578
2602
|
let n = e.getHfPmView(t.headerFooter);
|
|
@@ -2580,42 +2604,42 @@ function li(e) {
|
|
|
2580
2604
|
}
|
|
2581
2605
|
return e.editorView.value;
|
|
2582
2606
|
}
|
|
2583
|
-
function
|
|
2584
|
-
let n =
|
|
2607
|
+
function g(e, t) {
|
|
2608
|
+
let n = h();
|
|
2585
2609
|
if (n) try {
|
|
2586
|
-
let r = n.state.doc.resolve(e), i = t === void 0 ? r : n.state.doc.resolve(t), a =
|
|
2610
|
+
let r = n.state.doc.resolve(e), i = t === void 0 ? r : n.state.doc.resolve(t), a = he.between(r, i);
|
|
2587
2611
|
n.dispatch(n.state.tr.setSelection(a));
|
|
2588
2612
|
} catch {}
|
|
2589
2613
|
}
|
|
2590
|
-
function g(t) {
|
|
2591
|
-
Vt(e.pagesRef.value, e.pagesViewportRef.value, t);
|
|
2592
|
-
}
|
|
2593
2614
|
function _(t) {
|
|
2594
|
-
|
|
2615
|
+
Jt(e.pagesRef.value, e.pagesViewportRef.value, t);
|
|
2595
2616
|
}
|
|
2596
2617
|
function v(t) {
|
|
2597
|
-
|
|
2618
|
+
Xt(e.pagesRef.value, t, g, i.value?.position);
|
|
2598
2619
|
}
|
|
2599
2620
|
function y(t) {
|
|
2621
|
+
Zt(e.pagesRef.value, t, g, i.value?.position);
|
|
2622
|
+
}
|
|
2623
|
+
function b(t) {
|
|
2600
2624
|
let n = e.editorView.value;
|
|
2601
2625
|
if (!n) return;
|
|
2602
2626
|
let r = null;
|
|
2603
2627
|
if (n.state.doc.descendants((e, n) => r === null ? (e.attrs?.bookmarks)?.some((e) => e.name === t) ? (r = n, !1) : !0 : !1), r !== null) {
|
|
2604
|
-
|
|
2628
|
+
_(r);
|
|
2605
2629
|
try {
|
|
2606
|
-
|
|
2630
|
+
g(Math.min(r + 1, n.state.doc.content.size));
|
|
2607
2631
|
} catch {
|
|
2608
|
-
|
|
2632
|
+
g(r);
|
|
2609
2633
|
}
|
|
2610
2634
|
}
|
|
2611
2635
|
}
|
|
2612
|
-
function
|
|
2636
|
+
function x(a) {
|
|
2613
2637
|
if (e.readOnly.value || c) return;
|
|
2614
2638
|
let o = e.pagesRef.value;
|
|
2615
2639
|
if (!o) return;
|
|
2616
2640
|
let s = e.pagesViewportRef.value;
|
|
2617
2641
|
if (!s) return;
|
|
2618
|
-
let l =
|
|
2642
|
+
let l = Rt({
|
|
2619
2643
|
mouseX: a.clientX,
|
|
2620
2644
|
mouseY: a.clientY,
|
|
2621
2645
|
pagesContainer: o,
|
|
@@ -2625,7 +2649,7 @@ function li(e) {
|
|
|
2625
2649
|
if (!l) {
|
|
2626
2650
|
n === null && (n = setTimeout(() => {
|
|
2627
2651
|
t.value = null, n = null;
|
|
2628
|
-
},
|
|
2652
|
+
}, Lt));
|
|
2629
2653
|
return;
|
|
2630
2654
|
}
|
|
2631
2655
|
let u = s.getBoundingClientRect();
|
|
@@ -2636,26 +2660,26 @@ function li(e) {
|
|
|
2636
2660
|
cellPmPos: l.cellPmPos
|
|
2637
2661
|
}, r();
|
|
2638
2662
|
}
|
|
2639
|
-
function
|
|
2663
|
+
function S(n) {
|
|
2640
2664
|
n.preventDefault(), n.stopPropagation();
|
|
2641
2665
|
let r = t.value, i = e.editorView.value;
|
|
2642
2666
|
if (!r || !i) return;
|
|
2643
|
-
let a = i.state.tr.setSelection(
|
|
2667
|
+
let a = i.state.tr.setSelection(he.create(i.state.doc, r.cellPmPos + 1));
|
|
2644
2668
|
i.dispatch(a);
|
|
2645
2669
|
let o = e.getCommands(), s = r.type === "row" ? o.addRowBelow?.() : o.addColumnRight?.();
|
|
2646
2670
|
s && (s(i.state, (e) => i.dispatch(e), i), t.value = null, i.focus());
|
|
2647
2671
|
}
|
|
2648
|
-
function
|
|
2672
|
+
function C(t) {
|
|
2649
2673
|
let n = t.target?.closest("a[href]");
|
|
2650
2674
|
if (!n) return;
|
|
2651
2675
|
t.preventDefault();
|
|
2652
2676
|
let r = n.getAttribute("href") || "";
|
|
2653
2677
|
if (r.startsWith("#")) {
|
|
2654
2678
|
let e = r.slice(1);
|
|
2655
|
-
e &&
|
|
2679
|
+
e && b(e);
|
|
2656
2680
|
return;
|
|
2657
2681
|
}
|
|
2658
|
-
let i =
|
|
2682
|
+
let i = h();
|
|
2659
2683
|
if (i && i.state.selection.from !== i.state.selection.to) return;
|
|
2660
2684
|
let a = e.pagesViewportRef.value;
|
|
2661
2685
|
if (!a) return;
|
|
@@ -2670,7 +2694,7 @@ function li(e) {
|
|
|
2670
2694
|
}
|
|
2671
2695
|
};
|
|
2672
2696
|
}
|
|
2673
|
-
function
|
|
2697
|
+
function ee(t) {
|
|
2674
2698
|
let n = t.target, r = n.closest(".layout-page-header"), a = n.closest(".layout-page-footer"), o = r ?? a;
|
|
2675
2699
|
if (!o) return;
|
|
2676
2700
|
let s = r ? "header" : "footer", c = e.getDocument();
|
|
@@ -2736,7 +2760,7 @@ function li(e) {
|
|
|
2736
2760
|
}
|
|
2737
2761
|
};
|
|
2738
2762
|
}
|
|
2739
|
-
function
|
|
2763
|
+
function te(t) {
|
|
2740
2764
|
let n = e.getDocument(), r = i.value;
|
|
2741
2765
|
if (!n?.package || !r) return;
|
|
2742
2766
|
let a = r.position === "header" ? n.package.headers : n.package.footers;
|
|
@@ -2744,7 +2768,7 @@ function li(e) {
|
|
|
2744
2768
|
let o = a.get(r.rId);
|
|
2745
2769
|
o && (o.content = t), e.syncHfPMs?.(), e.reLayout(), e.emit("change", n);
|
|
2746
2770
|
}
|
|
2747
|
-
function
|
|
2771
|
+
function w() {
|
|
2748
2772
|
let t = e.getDocument(), n = i.value;
|
|
2749
2773
|
if (!t?.package || !n || !n.rId) {
|
|
2750
2774
|
i.value = null;
|
|
@@ -2776,59 +2800,67 @@ function li(e) {
|
|
|
2776
2800
|
};
|
|
2777
2801
|
i.value = null, e.setDocument?.(d), e.syncHfPMs?.(), e.reLayout(), e.emit("change", d);
|
|
2778
2802
|
}
|
|
2779
|
-
function
|
|
2803
|
+
function T(t) {
|
|
2780
2804
|
if (t.button !== 0 || e.imageInteracting.value) return;
|
|
2781
2805
|
let n = e.editorView.value;
|
|
2782
2806
|
if (!n) return;
|
|
2783
2807
|
let r = t.target;
|
|
2784
2808
|
i.value && (r.closest(".layout-page-header") || r.closest(".layout-page-footer") || r.closest(".hf-editor") || (i.value = null, n.focus()));
|
|
2785
|
-
let
|
|
2786
|
-
if (!e.readOnly.value && e.tableResize.tryStartResize(t,
|
|
2787
|
-
let
|
|
2788
|
-
if (
|
|
2809
|
+
let d = h() ?? n;
|
|
2810
|
+
if (!e.readOnly.value && e.tableResize.tryStartResize(t, d)) return;
|
|
2811
|
+
let f = rt(r);
|
|
2812
|
+
if (f) {
|
|
2789
2813
|
t.preventDefault(), t.stopPropagation();
|
|
2790
|
-
let n = Number(
|
|
2814
|
+
let n = Number(f.dataset.pmStart);
|
|
2791
2815
|
if (!isNaN(n)) {
|
|
2792
2816
|
try {
|
|
2793
|
-
|
|
2817
|
+
d.dispatch(d.state.tr.setSelection(J.create(d.state.doc, n)));
|
|
2794
2818
|
} catch {}
|
|
2795
2819
|
e.selectedImage.value = {
|
|
2796
|
-
element:
|
|
2820
|
+
element: f,
|
|
2797
2821
|
pmPos: n,
|
|
2798
|
-
width:
|
|
2799
|
-
height:
|
|
2822
|
+
width: f.offsetWidth,
|
|
2823
|
+
height: f.offsetHeight
|
|
2800
2824
|
}, e.clearOverlay();
|
|
2801
2825
|
}
|
|
2802
|
-
|
|
2826
|
+
d.focus();
|
|
2803
2827
|
return;
|
|
2804
2828
|
}
|
|
2805
2829
|
e.selectedImage.value = null, t.preventDefault();
|
|
2806
|
-
let
|
|
2807
|
-
if (
|
|
2808
|
-
|
|
2830
|
+
let p = m(t.clientX, t.clientY);
|
|
2831
|
+
if (p === null) {
|
|
2832
|
+
d.focus();
|
|
2809
2833
|
return;
|
|
2810
2834
|
}
|
|
2811
|
-
let
|
|
2812
|
-
if (
|
|
2813
|
-
else if (s >= 3)
|
|
2835
|
+
let _ = Date.now();
|
|
2836
|
+
if (_ - a < yi && o === p ? s++ : s = 1, a = _, o = p, s === 2) v(p);
|
|
2837
|
+
else if (s >= 3) y(p), s = 0;
|
|
2814
2838
|
else {
|
|
2815
2839
|
if (t.shiftKey) {
|
|
2816
|
-
let { from: e } =
|
|
2817
|
-
|
|
2818
|
-
} else
|
|
2819
|
-
l =
|
|
2840
|
+
let { from: e } = d.state.selection;
|
|
2841
|
+
g(e, p);
|
|
2842
|
+
} else g(p);
|
|
2843
|
+
l = p, c = !0, u.begin(Bt(d, p));
|
|
2820
2844
|
}
|
|
2821
|
-
|
|
2845
|
+
d.focus();
|
|
2822
2846
|
}
|
|
2823
|
-
function
|
|
2847
|
+
function E(e) {
|
|
2824
2848
|
if (!c || l === null) return;
|
|
2825
|
-
let t =
|
|
2826
|
-
t !== null
|
|
2827
|
-
|
|
2828
|
-
|
|
2829
|
-
|
|
2849
|
+
let t = m(e.clientX, e.clientY);
|
|
2850
|
+
if (t !== null) {
|
|
2851
|
+
let n = h();
|
|
2852
|
+
if (n && u.update(n, t, e.clientX)) {
|
|
2853
|
+
d.updateMousePosition(e.clientX, e.clientY);
|
|
2854
|
+
return;
|
|
2855
|
+
}
|
|
2856
|
+
t !== l && g(l, t);
|
|
2857
|
+
}
|
|
2858
|
+
d.updateMousePosition(e.clientX, e.clientY);
|
|
2830
2859
|
}
|
|
2831
2860
|
function D() {
|
|
2861
|
+
c = !1, u.end(), d.stopAutoScroll();
|
|
2862
|
+
}
|
|
2863
|
+
function O() {
|
|
2832
2864
|
let t = e.pagesViewportRef.value, n = e.layout.value;
|
|
2833
2865
|
if (!t || !n || n.pages.length === 0) return;
|
|
2834
2866
|
let r = t.scrollTop, i = n.pages.length, a = r + t.clientHeight / 2, o = 24, s = 1;
|
|
@@ -2840,42 +2872,42 @@ function li(e) {
|
|
|
2840
2872
|
}
|
|
2841
2873
|
o = r + 24, s = e + 2;
|
|
2842
2874
|
}
|
|
2843
|
-
s = Math.min(s, i),
|
|
2875
|
+
s = Math.min(s, i), f.value = {
|
|
2844
2876
|
currentPage: s,
|
|
2845
2877
|
totalPages: i,
|
|
2846
2878
|
visible: !0
|
|
2847
|
-
},
|
|
2848
|
-
|
|
2849
|
-
...
|
|
2879
|
+
}, p && clearTimeout(p), p = setTimeout(() => {
|
|
2880
|
+
f.value = {
|
|
2881
|
+
...f.value,
|
|
2850
2882
|
visible: !1
|
|
2851
2883
|
};
|
|
2852
2884
|
}, 600);
|
|
2853
2885
|
}
|
|
2854
2886
|
return I(() => {
|
|
2855
|
-
window.addEventListener("mousemove",
|
|
2887
|
+
window.addEventListener("mousemove", E), window.addEventListener("mouseup", D), e.pagesViewportRef.value?.addEventListener("scroll", O, { passive: !0 });
|
|
2856
2888
|
}), F(() => {
|
|
2857
|
-
r(), window.removeEventListener("mousemove",
|
|
2889
|
+
r(), window.removeEventListener("mousemove", E), window.removeEventListener("mouseup", D), e.pagesViewportRef.value?.removeEventListener("scroll", O), p && clearTimeout(p);
|
|
2858
2890
|
}), {
|
|
2859
2891
|
tableInsertButton: t,
|
|
2860
2892
|
hfEdit: i,
|
|
2861
|
-
scrollPageInfo:
|
|
2862
|
-
resolvePos:
|
|
2863
|
-
setPmSelection:
|
|
2864
|
-
scrollVisiblePositionIntoView:
|
|
2865
|
-
navigateToBookmark:
|
|
2866
|
-
handlePagesMouseDown:
|
|
2867
|
-
handlePagesMouseMove:
|
|
2868
|
-
handlePagesClick:
|
|
2869
|
-
handlePagesDoubleClick:
|
|
2870
|
-
handleTableInsertClick:
|
|
2893
|
+
scrollPageInfo: f,
|
|
2894
|
+
resolvePos: m,
|
|
2895
|
+
setPmSelection: g,
|
|
2896
|
+
scrollVisiblePositionIntoView: _,
|
|
2897
|
+
navigateToBookmark: b,
|
|
2898
|
+
handlePagesMouseDown: T,
|
|
2899
|
+
handlePagesMouseMove: x,
|
|
2900
|
+
handlePagesClick: C,
|
|
2901
|
+
handlePagesDoubleClick: ee,
|
|
2902
|
+
handleTableInsertClick: S,
|
|
2871
2903
|
clearTableInsertTimer: r,
|
|
2872
|
-
handleHfSave:
|
|
2873
|
-
handleHfRemove:
|
|
2904
|
+
handleHfSave: te,
|
|
2905
|
+
handleHfRemove: w
|
|
2874
2906
|
};
|
|
2875
2907
|
}
|
|
2876
2908
|
//#endregion
|
|
2877
2909
|
//#region src/composables/useSelectionSync.ts
|
|
2878
|
-
function
|
|
2910
|
+
function xi(e) {
|
|
2879
2911
|
let t = null, n = null, r = null;
|
|
2880
2912
|
function i() {
|
|
2881
2913
|
let r = e.pagesRef.value;
|
|
@@ -2887,8 +2919,8 @@ function ui(e) {
|
|
|
2887
2919
|
let t = e.pagesRef.value, n = e.editorView.value;
|
|
2888
2920
|
if (!t || !n || e.isHfEditing?.value) return;
|
|
2889
2921
|
let i = n.state.selection;
|
|
2890
|
-
if (i instanceof
|
|
2891
|
-
let n =
|
|
2922
|
+
if (i instanceof J && i.node.type.name === "image") {
|
|
2923
|
+
let n = X(t, i.from), r = n ? rt(n) : null;
|
|
2892
2924
|
if (r) {
|
|
2893
2925
|
let t = e.selectedImage.value;
|
|
2894
2926
|
(!t || t.element !== r || t.pmPos !== i.from || t.width !== r.offsetWidth || t.height !== r.offsetHeight) && (e.selectedImage.value = {
|
|
@@ -2906,12 +2938,12 @@ function ui(e) {
|
|
|
2906
2938
|
function o() {
|
|
2907
2939
|
let r = e.pagesRef.value, o = e.editorView.value;
|
|
2908
2940
|
if (!r || !o || (i(), e.isHfEditing?.value)) return;
|
|
2909
|
-
a(),
|
|
2941
|
+
a(), Y(r, o.state);
|
|
2910
2942
|
let s = o.state.selection;
|
|
2911
|
-
if (s instanceof
|
|
2943
|
+
if (s instanceof J && s.node.type.name === "image") return;
|
|
2912
2944
|
let { from: c, to: l, empty: u } = s, d = r.scrollTop, f = r.scrollLeft, p = e.zoom.value || 1;
|
|
2913
2945
|
if (u) {
|
|
2914
|
-
let e =
|
|
2946
|
+
let e = qe(r, c, r.getBoundingClientRect());
|
|
2915
2947
|
if (e) {
|
|
2916
2948
|
let i = document.createElement("div");
|
|
2917
2949
|
i.className = "vue-caret", i.style.cssText = `
|
|
@@ -2922,7 +2954,7 @@ function ui(e) {
|
|
|
2922
2954
|
height: ${e.height}px;
|
|
2923
2955
|
background: #000;
|
|
2924
2956
|
pointer-events: none;
|
|
2925
|
-
z-index: ${
|
|
2957
|
+
z-index: ${S.selectionOverlay};
|
|
2926
2958
|
`, r.appendChild(i), n = i;
|
|
2927
2959
|
let a = !0;
|
|
2928
2960
|
t = setInterval(() => {
|
|
@@ -2931,7 +2963,7 @@ function ui(e) {
|
|
|
2931
2963
|
}
|
|
2932
2964
|
return;
|
|
2933
2965
|
}
|
|
2934
|
-
let m =
|
|
2966
|
+
let m = Je(r, c, l, r.getBoundingClientRect());
|
|
2935
2967
|
for (let e of m) {
|
|
2936
2968
|
let t = document.createElement("div");
|
|
2937
2969
|
t.className = "vue-sel-rect", t.style.cssText = `
|
|
@@ -2942,7 +2974,7 @@ function ui(e) {
|
|
|
2942
2974
|
height: ${e.height / p}px;
|
|
2943
2975
|
background: rgba(66, 133, 244, 0.3);
|
|
2944
2976
|
pointer-events: none;
|
|
2945
|
-
z-index: ${
|
|
2977
|
+
z-index: ${S.selectionOverlay};
|
|
2946
2978
|
`, r.appendChild(t);
|
|
2947
2979
|
}
|
|
2948
2980
|
}
|
|
@@ -2955,7 +2987,7 @@ function ui(e) {
|
|
|
2955
2987
|
}
|
|
2956
2988
|
//#endregion
|
|
2957
2989
|
//#region src/composables/useMenuActions.ts
|
|
2958
|
-
function
|
|
2990
|
+
function Si(e) {
|
|
2959
2991
|
function t(t) {
|
|
2960
2992
|
let n = e.editorView.value;
|
|
2961
2993
|
if (!n) return;
|
|
@@ -2986,7 +3018,7 @@ function di(e) {
|
|
|
2986
3018
|
e.handleClearFormatting();
|
|
2987
3019
|
break;
|
|
2988
3020
|
case "insertImage":
|
|
2989
|
-
e.
|
|
3021
|
+
e.imageInputRef.value?.click();
|
|
2990
3022
|
break;
|
|
2991
3023
|
case "insertLink":
|
|
2992
3024
|
e.showHyperlink.value = !0;
|
|
@@ -3010,7 +3042,7 @@ function di(e) {
|
|
|
3010
3042
|
e.showKeyboardShortcuts.value = !0;
|
|
3011
3043
|
break;
|
|
3012
3044
|
case "reportIssue":
|
|
3013
|
-
|
|
3045
|
+
Vt();
|
|
3014
3046
|
break;
|
|
3015
3047
|
case "dirLTR":
|
|
3016
3048
|
t("setLtr");
|
|
@@ -3028,29 +3060,29 @@ function di(e) {
|
|
|
3028
3060
|
}
|
|
3029
3061
|
//#endregion
|
|
3030
3062
|
//#region src/composables/useDocumentLifecycle.ts
|
|
3031
|
-
function
|
|
3063
|
+
function Ci(e) {
|
|
3032
3064
|
async function t(t) {
|
|
3033
3065
|
e.sidebarAutoOpenedRef.value = !1, await e.loadDocumentBuffer(t);
|
|
3034
3066
|
}
|
|
3035
3067
|
function n(t) {
|
|
3036
3068
|
e.sidebarAutoOpenedRef.value = !1, e.loadDocument(t);
|
|
3037
3069
|
}
|
|
3038
|
-
|
|
3070
|
+
W(e.documentBuffer, (e) => {
|
|
3039
3071
|
e && t(e);
|
|
3040
|
-
}),
|
|
3072
|
+
}), W(e.document, (e) => {
|
|
3041
3073
|
e && n(e);
|
|
3042
3074
|
}), I(async () => {
|
|
3043
|
-
await
|
|
3075
|
+
await ce();
|
|
3044
3076
|
let r = e.documentBuffer(), i = e.document();
|
|
3045
3077
|
r ? await t(r) : i && n(i);
|
|
3046
3078
|
});
|
|
3047
3079
|
}
|
|
3048
3080
|
//#endregion
|
|
3049
3081
|
//#region src/composables/useDocxEditorRefApi.ts
|
|
3050
|
-
function
|
|
3082
|
+
function wi(e) {
|
|
3051
3083
|
function t() {
|
|
3052
3084
|
let t = e.pagesRef.value;
|
|
3053
|
-
t &&
|
|
3085
|
+
t && at(t), e.onPrint?.(), window.print();
|
|
3054
3086
|
}
|
|
3055
3087
|
function n() {
|
|
3056
3088
|
t();
|
|
@@ -3084,71 +3116,93 @@ function pi(e) {
|
|
|
3084
3116
|
function c() {
|
|
3085
3117
|
let t = e.layout.value, n = e.editorView.value;
|
|
3086
3118
|
if (!t || !n) return 0;
|
|
3087
|
-
let r =
|
|
3119
|
+
let r = dt(t, n.state.selection.from);
|
|
3088
3120
|
return r == null ? 0 : r + 1;
|
|
3089
3121
|
}
|
|
3090
3122
|
function l(t) {
|
|
3091
3123
|
let n = e.editorView.value;
|
|
3092
3124
|
if (!n) return !1;
|
|
3093
|
-
let r =
|
|
3125
|
+
let r = Ut(n.state.doc, t);
|
|
3094
3126
|
return r ? (e.scrollVisiblePositionIntoView(r.from + 1), !0) : !1;
|
|
3095
3127
|
}
|
|
3096
3128
|
function u(t, n) {
|
|
3097
|
-
return
|
|
3129
|
+
return Ce(e.editorView.value, t, n);
|
|
3098
3130
|
}
|
|
3099
3131
|
function d() {
|
|
3100
|
-
return
|
|
3132
|
+
return Te(e.editorView.value);
|
|
3101
3133
|
}
|
|
3102
3134
|
function f() {
|
|
3103
3135
|
return e.comments.value;
|
|
3104
3136
|
}
|
|
3105
3137
|
function p(t) {
|
|
3106
3138
|
let n = e.editorView.value;
|
|
3107
|
-
return n ?
|
|
3139
|
+
return n ? Ae(n.state.doc, t ?? {}) : [];
|
|
3108
3140
|
}
|
|
3109
3141
|
function m(t) {
|
|
3110
3142
|
let n = e.editorView.value;
|
|
3111
3143
|
if (!n) return !1;
|
|
3112
|
-
let r =
|
|
3144
|
+
let r = ke(n.state.doc, t);
|
|
3113
3145
|
return r == null ? !1 : (a(r), !0);
|
|
3114
3146
|
}
|
|
3115
3147
|
function h(t, n, r) {
|
|
3148
|
+
let i = he.between(t.state.doc.resolve(n), t.state.doc.resolve(r));
|
|
3149
|
+
t.dispatch(t.state.tr.setSelection(i)), e.scrollVisiblePositionIntoView(n);
|
|
3150
|
+
}
|
|
3151
|
+
function g(t, n) {
|
|
3152
|
+
let r = e.editorView.value;
|
|
3153
|
+
if (!r) return;
|
|
3154
|
+
let i = be(r.state.doc, t, n);
|
|
3155
|
+
i && h(r, i.from, i.to);
|
|
3156
|
+
}
|
|
3157
|
+
function _(t) {
|
|
3158
|
+
let n = e.editorView.value;
|
|
3159
|
+
if (!n) return !1;
|
|
3160
|
+
let r = Se(n, t);
|
|
3161
|
+
return r ? (h(n, r.from, r.to), !0) : !1;
|
|
3162
|
+
}
|
|
3163
|
+
function v(t) {
|
|
3164
|
+
let n = e.editorView.value;
|
|
3165
|
+
if (!n) return !1;
|
|
3166
|
+
let r = xe(n, t);
|
|
3167
|
+
return r ? (h(n, r.from, r.to), !0) : !1;
|
|
3168
|
+
}
|
|
3169
|
+
function y(t, n, r) {
|
|
3116
3170
|
let i = e.editorView.value;
|
|
3117
3171
|
if (!i) return !1;
|
|
3118
3172
|
try {
|
|
3119
3173
|
return i.dispatch(Ne(i.state, t, n, r)), !0;
|
|
3120
3174
|
} catch (e) {
|
|
3121
|
-
if (e instanceof
|
|
3175
|
+
if (e instanceof Ht) return !1;
|
|
3122
3176
|
throw e;
|
|
3123
3177
|
}
|
|
3124
3178
|
}
|
|
3125
|
-
function
|
|
3179
|
+
function b(t, n) {
|
|
3126
3180
|
let r = e.editorView.value;
|
|
3127
3181
|
if (!r) return !1;
|
|
3128
3182
|
try {
|
|
3129
|
-
return r.dispatch(
|
|
3183
|
+
return r.dispatch(je(r.state, t, n)), !0;
|
|
3130
3184
|
} catch (e) {
|
|
3131
|
-
if (e instanceof
|
|
3185
|
+
if (e instanceof Ht) return !1;
|
|
3132
3186
|
throw e;
|
|
3133
3187
|
}
|
|
3134
3188
|
}
|
|
3135
|
-
function
|
|
3189
|
+
function x(t, n, r) {
|
|
3136
3190
|
let i = e.editorView.value;
|
|
3137
3191
|
if (!i) return !1;
|
|
3138
3192
|
try {
|
|
3139
|
-
return i.dispatch(
|
|
3193
|
+
return i.dispatch(Fe(i.state, t, n, r)), !0;
|
|
3140
3194
|
} catch (e) {
|
|
3141
|
-
if (e instanceof
|
|
3195
|
+
if (e instanceof Ht) return !1;
|
|
3142
3196
|
throw e;
|
|
3143
3197
|
}
|
|
3144
3198
|
}
|
|
3145
|
-
function
|
|
3146
|
-
return
|
|
3199
|
+
function S(t) {
|
|
3200
|
+
return we(e.editorView.value, e.layout.value, t);
|
|
3147
3201
|
}
|
|
3148
|
-
function
|
|
3202
|
+
function C(t) {
|
|
3149
3203
|
return e.contentChangeSubscribers.add(t), () => e.contentChangeSubscribers.delete(t);
|
|
3150
3204
|
}
|
|
3151
|
-
function
|
|
3205
|
+
function ee(t) {
|
|
3152
3206
|
return e.selectionChangeSubscribers.add(t), () => e.selectionChangeSubscribers.delete(t);
|
|
3153
3207
|
}
|
|
3154
3208
|
return { exposed: {
|
|
@@ -3171,44 +3225,47 @@ function pi(e) {
|
|
|
3171
3225
|
resolveComment: e.resolveComment,
|
|
3172
3226
|
proposeChange: e.proposeChange,
|
|
3173
3227
|
scrollToParaId: l,
|
|
3228
|
+
scrollToCommentId: _,
|
|
3229
|
+
scrollToChangeId: v,
|
|
3230
|
+
highlightRange: g,
|
|
3174
3231
|
findInDocument: u,
|
|
3175
3232
|
getSelectionInfo: d,
|
|
3176
3233
|
getComments: f,
|
|
3177
3234
|
getContentControls: p,
|
|
3178
3235
|
scrollToContentControl: m,
|
|
3179
|
-
setContentControlContent:
|
|
3180
|
-
removeContentControl:
|
|
3181
|
-
setContentControlValue:
|
|
3236
|
+
setContentControlContent: y,
|
|
3237
|
+
removeContentControl: b,
|
|
3238
|
+
setContentControlValue: x,
|
|
3182
3239
|
applyFormatting: e.applyFormatting,
|
|
3183
3240
|
setParagraphStyle: e.setParagraphStyle,
|
|
3184
|
-
getPageContent:
|
|
3241
|
+
getPageContent: S,
|
|
3185
3242
|
getTotalPages: s,
|
|
3186
3243
|
getCurrentPage: c,
|
|
3187
|
-
onContentChange:
|
|
3188
|
-
onSelectionChange:
|
|
3244
|
+
onContentChange: C,
|
|
3245
|
+
onSelectionChange: ee
|
|
3189
3246
|
} };
|
|
3190
3247
|
}
|
|
3191
3248
|
//#endregion
|
|
3192
3249
|
//#region src/composables/useFontLifecycle.ts
|
|
3193
|
-
function
|
|
3194
|
-
|
|
3195
|
-
|
|
3250
|
+
function Ti(e, t) {
|
|
3251
|
+
W(e, (e) => {
|
|
3252
|
+
Re(e);
|
|
3196
3253
|
}, { immediate: !0 });
|
|
3197
|
-
let n =
|
|
3254
|
+
let n = ze(t);
|
|
3198
3255
|
F(() => n());
|
|
3199
3256
|
}
|
|
3200
3257
|
//#endregion
|
|
3201
3258
|
//#region src/components/DocxEditor.vue?vue&type=script&setup=true&lang.ts
|
|
3202
|
-
var
|
|
3259
|
+
var Ei = { class: "docx-editor-vue__toolbar-shell" }, Di = {
|
|
3203
3260
|
key: 0,
|
|
3204
3261
|
class: "docx-editor-vue__error"
|
|
3205
|
-
},
|
|
3262
|
+
}, Oi = {
|
|
3206
3263
|
key: 1,
|
|
3207
3264
|
class: "docx-editor-vue__loading"
|
|
3208
|
-
},
|
|
3265
|
+
}, ki = { class: "docx-editor-vue__editor-area" }, Ai = {
|
|
3209
3266
|
key: 0,
|
|
3210
3267
|
class: "docx-editor-vue__vertical-ruler"
|
|
3211
|
-
},
|
|
3268
|
+
}, ji = ["title"], Mi = ["title", "aria-label"], Ni = /* @__PURE__ */ N({
|
|
3212
3269
|
__name: "DocxEditor",
|
|
3213
3270
|
props: {
|
|
3214
3271
|
documentBuffer: { default: null },
|
|
@@ -3309,41 +3366,41 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
|
|
|
3309
3366
|
"menu-action",
|
|
3310
3367
|
"mode-change"
|
|
3311
3368
|
],
|
|
3312
|
-
setup(e, { expose:
|
|
3313
|
-
let i = e,
|
|
3314
|
-
|
|
3315
|
-
let { t:
|
|
3316
|
-
|
|
3317
|
-
let { editorView:
|
|
3318
|
-
hiddenContainer:
|
|
3319
|
-
pagesContainer:
|
|
3320
|
-
readOnly:
|
|
3369
|
+
setup(e, { expose: t, emit: n }) {
|
|
3370
|
+
let i = e, o = n, s = R(i.mode), c = E(() => i.readOnly || s.value === "viewing"), u = E(() => i.author);
|
|
3371
|
+
a(E(() => i.i18n));
|
|
3372
|
+
let { t: d } = l(E(() => i.i18n)), h = R(null), v = R(null), b = R(null), x = R(0), S = /* @__PURE__ */ new Set(), ne = /* @__PURE__ */ new Set(), T = new Ee(), D = R(!1), ie = R(!1), ae = R(!1), N = R(!1), oe = R(!1), H = R(i.showOutline), pe = R(!1), U = R(!1), G = R(!1), K = R(null), J = fe([]), Y = fe([]), ge = fe([]), { zoom: X, zoomPercent: ye, isMinZoom: be, isMaxZoom: xe, setZoom: Se, zoomIn: Ce, zoomOut: we, handleWheel: De, handleKeyDown: ke, installShortcuts: Ae, ZOOM_PRESETS: je } = te(i.initialZoom);
|
|
3373
|
+
Ae();
|
|
3374
|
+
let { editorView: Z, isReady: Me, parseError: Ne, layout: Pe, loadBuffer: Fe, loadDocument: Le, save: Re, focus: ze, destroy: Be, getDocument: Q, getCommands: Ve, reLayout: Ue, getHfPmView: We, syncHfPMs: Ge, setHfTransactionListener: Ke, setDocument: qe } = C({
|
|
3375
|
+
hiddenContainer: h,
|
|
3376
|
+
pagesContainer: v,
|
|
3377
|
+
readOnly: c,
|
|
3321
3378
|
externalPlugins: i.externalPlugins,
|
|
3322
|
-
syncCoordinator:
|
|
3323
|
-
editorMode:
|
|
3324
|
-
author:
|
|
3379
|
+
syncCoordinator: T,
|
|
3380
|
+
editorMode: s,
|
|
3381
|
+
author: u,
|
|
3325
3382
|
onChange: (e) => {
|
|
3326
|
-
|
|
3383
|
+
o("change", e), o("update:document", e), i.onChange?.(e), S.forEach((t) => t(e));
|
|
3327
3384
|
},
|
|
3328
3385
|
onError: (e) => {
|
|
3329
|
-
|
|
3386
|
+
o("error", e), i.onError?.(e);
|
|
3330
3387
|
},
|
|
3331
3388
|
onSelectionUpdate: () => {
|
|
3332
3389
|
x.value++;
|
|
3333
|
-
let e =
|
|
3334
|
-
i.onSelectionChange?.(e ?
|
|
3335
|
-
let t =
|
|
3336
|
-
|
|
3390
|
+
let e = Z.value;
|
|
3391
|
+
i.onSelectionChange?.(e ? Oe(e.state) : null);
|
|
3392
|
+
let t = Te(e);
|
|
3393
|
+
ne.forEach((e) => e(t));
|
|
3337
3394
|
}
|
|
3338
|
-
}), { commentCallbacks:
|
|
3395
|
+
}), { commentCallbacks: Je } = ci(i, Z), Ye = E(() => {
|
|
3339
3396
|
x.value;
|
|
3340
|
-
let e =
|
|
3397
|
+
let e = Q();
|
|
3341
3398
|
if (!e?.package?.document) return null;
|
|
3342
3399
|
let t = e.package.document;
|
|
3343
3400
|
return t.finalSectionProperties ?? t.sections?.[0]?.properties ?? null;
|
|
3344
|
-
}),
|
|
3401
|
+
}), Xe = E(() => {
|
|
3345
3402
|
x.value;
|
|
3346
|
-
let e =
|
|
3403
|
+
let e = Z.value, t = e ? He(e.state).paragraphFormatting : {};
|
|
3347
3404
|
return {
|
|
3348
3405
|
indentLeft: t.indentLeft ?? 0,
|
|
3349
3406
|
indentRight: t.indentRight ?? 0,
|
|
@@ -3351,26 +3408,26 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
|
|
|
3351
3408
|
hangingIndent: t.hangingIndent ?? !1,
|
|
3352
3409
|
tabStops: t.tabs ?? null
|
|
3353
3410
|
};
|
|
3354
|
-
}),
|
|
3355
|
-
function
|
|
3356
|
-
|
|
3411
|
+
}), Ze = E(() => (x.value, Q()?.package?.theme ?? i.theme ?? null)), Qe = R(null), $e = R([]);
|
|
3412
|
+
function et(e, t) {
|
|
3413
|
+
Qe.value = _e(e, t), $e.value = ve(e, t);
|
|
3357
3414
|
}
|
|
3358
|
-
function
|
|
3359
|
-
|
|
3415
|
+
function tt() {
|
|
3416
|
+
Qe.value = null, $e.value = [];
|
|
3360
3417
|
}
|
|
3361
|
-
|
|
3362
|
-
|
|
3418
|
+
Ti(() => i.fonts, (e) => {
|
|
3419
|
+
o("error", e), i.onError?.(e);
|
|
3363
3420
|
});
|
|
3364
|
-
let
|
|
3421
|
+
let nt = E(() => $.value?.headerFooter ? We($.value.headerFooter) ?? null : null), rt = E(() => nt.value ?? Z.value);
|
|
3365
3422
|
I(() => {
|
|
3366
|
-
|
|
3367
|
-
requestAnimationFrame(() => {
|
|
3423
|
+
Ke((e, t) => {
|
|
3424
|
+
x.value++, requestAnimationFrame(() => {
|
|
3368
3425
|
let e = $.value;
|
|
3369
3426
|
if (!e) return;
|
|
3370
|
-
|
|
3371
|
-
let n =
|
|
3427
|
+
et(t, e.position);
|
|
3428
|
+
let n = Kt(e.position), r = b.value;
|
|
3372
3429
|
if (!n || !r) return;
|
|
3373
|
-
let i = n.getBoundingClientRect(), a = r.getBoundingClientRect(), o =
|
|
3430
|
+
let i = n.getBoundingClientRect(), a = r.getBoundingClientRect(), o = X.value || 1;
|
|
3374
3431
|
$.value = {
|
|
3375
3432
|
...e,
|
|
3376
3433
|
targetRect: {
|
|
@@ -3381,20 +3438,20 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
|
|
|
3381
3438
|
}
|
|
3382
3439
|
};
|
|
3383
3440
|
});
|
|
3384
|
-
}),
|
|
3441
|
+
}), W(() => $.value, (e) => {
|
|
3385
3442
|
if (!e) {
|
|
3386
|
-
|
|
3443
|
+
tt();
|
|
3387
3444
|
return;
|
|
3388
3445
|
}
|
|
3389
|
-
let t =
|
|
3446
|
+
let t = Z.value;
|
|
3390
3447
|
if (t) {
|
|
3391
3448
|
try {
|
|
3392
|
-
let e = t.state.tr.setSelection(
|
|
3449
|
+
let e = t.state.tr.setSelection(he.create(t.state.doc, 0));
|
|
3393
3450
|
t.dispatch(e);
|
|
3394
3451
|
} catch {}
|
|
3395
3452
|
t.dom.blur?.();
|
|
3396
3453
|
}
|
|
3397
|
-
|
|
3454
|
+
or.updateSelectionOverlay();
|
|
3398
3455
|
});
|
|
3399
3456
|
let e = 0;
|
|
3400
3457
|
function t() {
|
|
@@ -3402,35 +3459,35 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
|
|
|
3402
3459
|
e = 0;
|
|
3403
3460
|
let t = $.value;
|
|
3404
3461
|
if (!t?.headerFooter) return;
|
|
3405
|
-
let n =
|
|
3406
|
-
n &&
|
|
3462
|
+
let n = We(t.headerFooter);
|
|
3463
|
+
n && et(n, t.position);
|
|
3407
3464
|
}));
|
|
3408
3465
|
}
|
|
3409
3466
|
window.addEventListener("scroll", t, !0), window.addEventListener("resize", t), F(() => {
|
|
3410
3467
|
e && cancelAnimationFrame(e), window.removeEventListener("scroll", t, !0), window.removeEventListener("resize", t);
|
|
3411
3468
|
});
|
|
3412
3469
|
});
|
|
3413
|
-
let
|
|
3470
|
+
let it = E(() => {
|
|
3414
3471
|
let e = [];
|
|
3415
|
-
return
|
|
3472
|
+
return U.value && e.push(`translateX(-${Ie}px)`), X.value !== 1 && e.push(`scale(${X.value})`), {
|
|
3416
3473
|
transform: e.length > 0 ? e.join(" ") : void 0,
|
|
3417
3474
|
transformOrigin: "top center",
|
|
3418
3475
|
transition: "transform 0.2s ease"
|
|
3419
3476
|
};
|
|
3420
|
-
}),
|
|
3477
|
+
}), at = E(() => ({
|
|
3421
3478
|
paddingLeft: "20px",
|
|
3422
|
-
paddingRight: 20 + (
|
|
3479
|
+
paddingRight: 20 + (U.value ? Ie * 2 : 0) + "px",
|
|
3423
3480
|
transition: "padding 0.2s ease"
|
|
3424
|
-
})),
|
|
3425
|
-
let e =
|
|
3426
|
-
return
|
|
3427
|
-
}),
|
|
3481
|
+
})), ot = E(() => {
|
|
3482
|
+
let e = Ye.value;
|
|
3483
|
+
return ct(e?.pageWidth ?? 12240) * X.value;
|
|
3484
|
+
}), st = E(() => {
|
|
3428
3485
|
let e = /* @__PURE__ */ new Set();
|
|
3429
|
-
for (let t of
|
|
3486
|
+
for (let t of J.value) t.parentId == null && t.done && e.add(t.id);
|
|
3430
3487
|
return e;
|
|
3431
|
-
}), lt =
|
|
3488
|
+
}), lt = E(() => {
|
|
3432
3489
|
x.value;
|
|
3433
|
-
let e =
|
|
3490
|
+
let e = Z.value;
|
|
3434
3491
|
if (!e) return [];
|
|
3435
3492
|
let t = /* @__PURE__ */ new Set(), n = [];
|
|
3436
3493
|
return e.state.doc.descendants((e) => {
|
|
@@ -3445,199 +3502,201 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
|
|
|
3445
3502
|
}
|
|
3446
3503
|
return !0;
|
|
3447
3504
|
}), n.sort((e, t) => e.name.localeCompare(t.name));
|
|
3448
|
-
}), ut =
|
|
3449
|
-
editorView:
|
|
3450
|
-
getDocument:
|
|
3451
|
-
comments:
|
|
3452
|
-
trackedChanges:
|
|
3453
|
-
resolvedCommentIds:
|
|
3454
|
-
activeSidebarItem:
|
|
3455
|
-
showSidebar:
|
|
3456
|
-
isAddingComment:
|
|
3457
|
-
readOnly:
|
|
3458
|
-
zoom:
|
|
3505
|
+
}), ut = Pt(), { floatingCommentBtn: dt, pendingCommentRange: ft, addCommentYPosition: pt, sidebarAutoOpenedRef: mt, extractCommentsAndChanges: ht, handleAddComment: gt, handleCancelAddComment: _t, handleStartAddComment: vt, handleMarkerClick: yt } = li({
|
|
3506
|
+
editorView: Z,
|
|
3507
|
+
getDocument: Q,
|
|
3508
|
+
comments: J,
|
|
3509
|
+
trackedChanges: Y,
|
|
3510
|
+
resolvedCommentIds: st,
|
|
3511
|
+
activeSidebarItem: K,
|
|
3512
|
+
showSidebar: U,
|
|
3513
|
+
isAddingComment: G,
|
|
3514
|
+
readOnly: c,
|
|
3515
|
+
zoom: X,
|
|
3459
3516
|
stateTick: x,
|
|
3460
|
-
pagesRef:
|
|
3461
|
-
pagesViewportRef:
|
|
3462
|
-
emit:
|
|
3517
|
+
pagesRef: v,
|
|
3518
|
+
pagesViewportRef: b,
|
|
3519
|
+
emit: o,
|
|
3463
3520
|
commentIdAllocator: ut,
|
|
3464
|
-
author:
|
|
3465
|
-
commentCallbacks:
|
|
3466
|
-
}), { docxInputRef: bt,
|
|
3467
|
-
loadBuffer:
|
|
3468
|
-
loadParsedDocument:
|
|
3469
|
-
getDocument:
|
|
3470
|
-
saveBlob:
|
|
3521
|
+
author: u,
|
|
3522
|
+
commentCallbacks: Je
|
|
3523
|
+
}), { docxInputRef: bt, imageInputRef: xt, handleImageFileChange: St, handleDocxFileChange: Ct, handleDocumentNameChange: wt, downloadCurrentDocument: Tt, loadDocumentBuffer: Et, loadDocument: Dt, save: Ot } = ei({
|
|
3524
|
+
loadBuffer: Fe,
|
|
3525
|
+
loadParsedDocument: Le,
|
|
3526
|
+
getDocument: Q,
|
|
3527
|
+
saveBlob: Re,
|
|
3471
3528
|
extractCommentsAndChanges: ht,
|
|
3472
|
-
emit:
|
|
3529
|
+
emit: o,
|
|
3473
3530
|
documentName: () => i.documentName,
|
|
3474
3531
|
onDocumentNameChange: i.onDocumentNameChange,
|
|
3475
|
-
|
|
3476
|
-
|
|
3477
|
-
|
|
3478
|
-
|
|
3479
|
-
|
|
3480
|
-
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
|
|
3484
|
-
|
|
3485
|
-
|
|
3532
|
+
getActiveView: () => rt.value,
|
|
3533
|
+
nextTick: ce
|
|
3534
|
+
}), { hyperlinkPopupData: kt, handleHyperlinkSubmit: At, handleHyperlinkRemove: jt, handleHyperlinkPopupNavigate: Mt, handleHyperlinkPopupEdit: Nt, handleHyperlinkPopupRemove: Ft } = ti({
|
|
3535
|
+
editorView: Z,
|
|
3536
|
+
getCommands: Ve
|
|
3537
|
+
}), { handleClearFormatting: It, handleApplyStyle: Lt, handleInsertPageBreak: Rt, handleInsertSymbol: zt, applyFormatting: Bt, setParagraphStyle: Vt } = ni({
|
|
3538
|
+
editorView: Z,
|
|
3539
|
+
activeView: rt,
|
|
3540
|
+
getDocument: Q
|
|
3541
|
+
}), { handlePageSetupApply: Ht, handleLeftMarginChange: Ut, handleRightMarginChange: Wt, handleTopMarginChange: Gt, handleBottomMarginChange: qt, handleIndentLeftChange: Jt, handleIndentRightChange: Yt, handleFirstLineIndentChange: Xt, handleTabStopRemove: Zt } = ri({
|
|
3542
|
+
editorView: Z,
|
|
3543
|
+
getDocument: Q,
|
|
3544
|
+
readOnly: c,
|
|
3486
3545
|
stateTick: x,
|
|
3487
|
-
reLayout:
|
|
3488
|
-
emit:
|
|
3489
|
-
}), { showWatermark:
|
|
3490
|
-
editorView:
|
|
3491
|
-
readOnly:
|
|
3546
|
+
reLayout: Ue,
|
|
3547
|
+
emit: o
|
|
3548
|
+
}), { showWatermark: $t, currentWatermark: en, handleWatermarkApply: tn } = ii({
|
|
3549
|
+
editorView: Z,
|
|
3550
|
+
readOnly: c,
|
|
3492
3551
|
stateTick: x
|
|
3493
|
-
}), { handleToggleOutline:
|
|
3494
|
-
editorView:
|
|
3495
|
-
showOutline:
|
|
3496
|
-
showSidebar:
|
|
3497
|
-
outlineHeadings:
|
|
3498
|
-
activeSidebarItem:
|
|
3552
|
+
}), { handleToggleOutline: nn, handleOutlineNavigate: rn, handleToggleSidebar: an, handleEditorScrollMouseDown: on } = ai({
|
|
3553
|
+
editorView: Z,
|
|
3554
|
+
showOutline: H,
|
|
3555
|
+
showSidebar: U,
|
|
3556
|
+
outlineHeadings: ge,
|
|
3557
|
+
activeSidebarItem: K,
|
|
3499
3558
|
extractCommentsAndChanges: ht
|
|
3500
3559
|
});
|
|
3501
|
-
|
|
3502
|
-
showKeyboardShortcuts:
|
|
3503
|
-
showFindReplace:
|
|
3504
|
-
showHyperlink:
|
|
3505
|
-
handleZoomKeyDown:
|
|
3560
|
+
oi({
|
|
3561
|
+
showKeyboardShortcuts: pe,
|
|
3562
|
+
showFindReplace: D,
|
|
3563
|
+
showHyperlink: ie,
|
|
3564
|
+
handleZoomKeyDown: ke,
|
|
3506
3565
|
disableFindReplaceShortcuts: () => i.disableFindReplaceShortcuts
|
|
3507
3566
|
});
|
|
3508
|
-
let { addComment:
|
|
3509
|
-
editorView:
|
|
3510
|
-
getDocument:
|
|
3511
|
-
comments:
|
|
3512
|
-
trackedChanges:
|
|
3513
|
-
showSidebar:
|
|
3514
|
-
isAddingComment:
|
|
3567
|
+
let { addComment: sn, replyToComment: cn, resolveComment: un, proposeChange: dn, handleCommentReply: fn, handleCommentResolve: pn, handleCommentUnresolve: gn, handleCommentDelete: _n, handleAcceptChange: yn, handleRejectChange: bn, handleAcceptChangeById: xn, handleRejectChangeById: Sn, handleTrackedChangeReply: Cn } = si({
|
|
3568
|
+
editorView: Z,
|
|
3569
|
+
getDocument: Q,
|
|
3570
|
+
comments: J,
|
|
3571
|
+
trackedChanges: Y,
|
|
3572
|
+
showSidebar: U,
|
|
3573
|
+
isAddingComment: G,
|
|
3515
3574
|
pendingCommentRange: ft,
|
|
3516
3575
|
contentChangeSubscribers: S,
|
|
3517
3576
|
extractCommentsAndChanges: ht,
|
|
3518
|
-
emit:
|
|
3577
|
+
emit: o,
|
|
3519
3578
|
commentIdAllocator: ut,
|
|
3520
|
-
author:
|
|
3521
|
-
commentCallbacks:
|
|
3522
|
-
}), { selectedImage:
|
|
3523
|
-
editorView:
|
|
3524
|
-
zoom:
|
|
3579
|
+
author: u,
|
|
3580
|
+
commentCallbacks: Je
|
|
3581
|
+
}), { selectedImage: Tn, imageInteracting: En, imageToolbarContext: Dn, handleToolbarImageWrap: On, handleImageTransform: An } = ui({
|
|
3582
|
+
editorView: Z,
|
|
3583
|
+
zoom: X,
|
|
3525
3584
|
stateTick: x,
|
|
3526
|
-
getCommands:
|
|
3527
|
-
}),
|
|
3528
|
-
editorView:
|
|
3529
|
-
pagesRef:
|
|
3530
|
-
pagesViewportRef:
|
|
3531
|
-
selectedImage:
|
|
3532
|
-
imageInteracting:
|
|
3533
|
-
hyperlinkPopupData:
|
|
3534
|
-
readOnly:
|
|
3535
|
-
zoom:
|
|
3536
|
-
layout:
|
|
3537
|
-
tableResize:
|
|
3538
|
-
getCommands:
|
|
3539
|
-
getDocument:
|
|
3540
|
-
reLayout:
|
|
3541
|
-
emit:
|
|
3542
|
-
clearOverlay:
|
|
3543
|
-
syncHfPMs:
|
|
3544
|
-
getHfPmView:
|
|
3545
|
-
setDocument:
|
|
3546
|
-
}), { contextMenu:
|
|
3547
|
-
editorView:
|
|
3548
|
-
selectedImage:
|
|
3549
|
-
zoom:
|
|
3550
|
-
showImageProperties:
|
|
3551
|
-
getCommands:
|
|
3552
|
-
clearOverlay:
|
|
3553
|
-
setPmSelection:
|
|
3554
|
-
resolvePos:
|
|
3555
|
-
}), { handleMenuAction:
|
|
3556
|
-
editorView:
|
|
3557
|
-
getCommands:
|
|
3585
|
+
getCommands: Ve
|
|
3586
|
+
}), jn = ee(), Mn = null, { tableInsertButton: Nn, hfEdit: $, scrollPageInfo: Pn, resolvePos: Fn, setPmSelection: In, scrollVisiblePositionIntoView: Ln, handlePagesMouseDown: Rn, handlePagesMouseMove: zn, handlePagesClick: Bn, handlePagesDoubleClick: Vn, handleTableInsertClick: Hn, clearTableInsertTimer: Un, handleHfSave: Wn, handleHfRemove: Gn } = bi({
|
|
3587
|
+
editorView: Z,
|
|
3588
|
+
pagesRef: v,
|
|
3589
|
+
pagesViewportRef: b,
|
|
3590
|
+
selectedImage: Tn,
|
|
3591
|
+
imageInteracting: En,
|
|
3592
|
+
hyperlinkPopupData: kt,
|
|
3593
|
+
readOnly: c,
|
|
3594
|
+
zoom: X,
|
|
3595
|
+
layout: Pe,
|
|
3596
|
+
tableResize: jn,
|
|
3597
|
+
getCommands: Ve,
|
|
3598
|
+
getDocument: Q,
|
|
3599
|
+
reLayout: Ue,
|
|
3600
|
+
emit: o,
|
|
3601
|
+
clearOverlay: ir,
|
|
3602
|
+
syncHfPMs: Ge,
|
|
3603
|
+
getHfPmView: We,
|
|
3604
|
+
setDocument: qe
|
|
3605
|
+
}), { contextMenu: Kn, imageContextMenu: qn, imageContextMenuTextActions: Jn, handleContextMenu: Yn, handleSelectedImageContextMenu: Xn, handleImageWrapSelect: Zn, handleContextMenuAction: Qn } = vi({
|
|
3606
|
+
editorView: Z,
|
|
3607
|
+
selectedImage: Tn,
|
|
3608
|
+
zoom: X,
|
|
3609
|
+
showImageProperties: N,
|
|
3610
|
+
getCommands: Ve,
|
|
3611
|
+
clearOverlay: ir,
|
|
3612
|
+
setPmSelection: In,
|
|
3613
|
+
resolvePos: Fn
|
|
3614
|
+
}), { handleMenuAction: $n, handleMenuTableInsert: er } = Si({
|
|
3615
|
+
editorView: Z,
|
|
3616
|
+
getCommands: Ve,
|
|
3558
3617
|
docxInputRef: bt,
|
|
3559
|
-
|
|
3560
|
-
|
|
3561
|
-
|
|
3562
|
-
showHyperlink:
|
|
3563
|
-
showInsertSymbol:
|
|
3564
|
-
showKeyboardShortcuts:
|
|
3565
|
-
handleClearFormatting:
|
|
3566
|
-
handleInsertPageBreak:
|
|
3567
|
-
handleToggleOutline:
|
|
3568
|
-
handleToggleSidebar:
|
|
3569
|
-
downloadCurrentDocument:
|
|
3570
|
-
emit:
|
|
3618
|
+
imageInputRef: xt,
|
|
3619
|
+
showPageSetup: oe,
|
|
3620
|
+
showWatermark: $t,
|
|
3621
|
+
showHyperlink: ie,
|
|
3622
|
+
showInsertSymbol: ae,
|
|
3623
|
+
showKeyboardShortcuts: pe,
|
|
3624
|
+
handleClearFormatting: It,
|
|
3625
|
+
handleInsertPageBreak: Rt,
|
|
3626
|
+
handleToggleOutline: nn,
|
|
3627
|
+
handleToggleSidebar: an,
|
|
3628
|
+
downloadCurrentDocument: Tt,
|
|
3629
|
+
emit: o
|
|
3571
3630
|
});
|
|
3572
|
-
|
|
3631
|
+
Ci({
|
|
3573
3632
|
documentBuffer: () => i.documentBuffer,
|
|
3574
3633
|
document: () => i.document,
|
|
3575
|
-
loadDocumentBuffer:
|
|
3576
|
-
loadDocument:
|
|
3634
|
+
loadDocumentBuffer: Et,
|
|
3635
|
+
loadDocument: Dt,
|
|
3577
3636
|
sidebarAutoOpenedRef: mt
|
|
3578
3637
|
});
|
|
3579
|
-
let
|
|
3580
|
-
|
|
3581
|
-
e && e !==
|
|
3582
|
-
}),
|
|
3583
|
-
|
|
3638
|
+
let tr = () => Z.value, nr = () => v.value;
|
|
3639
|
+
W(() => i.mode, (e) => {
|
|
3640
|
+
e && e !== s.value && (s.value = e);
|
|
3641
|
+
}), W(() => i.showOutline, (e) => {
|
|
3642
|
+
H.value = !!e;
|
|
3584
3643
|
});
|
|
3585
|
-
function
|
|
3586
|
-
|
|
3644
|
+
function rr(e) {
|
|
3645
|
+
s.value !== e && (s.value = e, o("mode-change", e));
|
|
3587
3646
|
}
|
|
3588
3647
|
I(() => {
|
|
3589
|
-
|
|
3648
|
+
Mn = jn.install();
|
|
3590
3649
|
}), F(() => {
|
|
3591
|
-
|
|
3650
|
+
Mn?.();
|
|
3592
3651
|
});
|
|
3593
|
-
function rr() {
|
|
3594
|
-
ar.clearOverlay();
|
|
3595
|
-
}
|
|
3596
3652
|
function ir() {
|
|
3597
|
-
|
|
3653
|
+
or.clearOverlay();
|
|
3598
3654
|
}
|
|
3599
|
-
|
|
3600
|
-
|
|
3601
|
-
|
|
3602
|
-
|
|
3603
|
-
|
|
3604
|
-
|
|
3605
|
-
|
|
3606
|
-
|
|
3607
|
-
|
|
3608
|
-
|
|
3655
|
+
function ar() {
|
|
3656
|
+
or.updateSelectionOverlay();
|
|
3657
|
+
}
|
|
3658
|
+
let or = xi({
|
|
3659
|
+
editorView: Z,
|
|
3660
|
+
pagesRef: v,
|
|
3661
|
+
zoom: X,
|
|
3662
|
+
selectedImage: Tn,
|
|
3663
|
+
isHfEditing: E(() => $.value !== null),
|
|
3664
|
+
imageInteracting: En
|
|
3665
|
+
}), sr = T.onRender(() => ar());
|
|
3666
|
+
ar(), F(() => {
|
|
3667
|
+
sr(), ir();
|
|
3609
3668
|
});
|
|
3610
|
-
let { exposed:
|
|
3611
|
-
editorView:
|
|
3612
|
-
layout:
|
|
3613
|
-
pagesRef:
|
|
3614
|
-
pagesViewportRef:
|
|
3615
|
-
zoom:
|
|
3616
|
-
comments:
|
|
3617
|
-
focus:
|
|
3618
|
-
destroy:
|
|
3619
|
-
getDocument:
|
|
3620
|
-
setZoom:
|
|
3621
|
-
save:
|
|
3622
|
-
loadDocument:
|
|
3623
|
-
loadDocumentBuffer:
|
|
3624
|
-
addComment:
|
|
3625
|
-
replyToComment:
|
|
3626
|
-
resolveComment:
|
|
3627
|
-
proposeChange:
|
|
3628
|
-
applyFormatting:
|
|
3629
|
-
setParagraphStyle:
|
|
3630
|
-
scrollVisiblePositionIntoView:
|
|
3669
|
+
let { exposed: cr } = wi({
|
|
3670
|
+
editorView: Z,
|
|
3671
|
+
layout: Pe,
|
|
3672
|
+
pagesRef: v,
|
|
3673
|
+
pagesViewportRef: b,
|
|
3674
|
+
zoom: X,
|
|
3675
|
+
comments: J,
|
|
3676
|
+
focus: ze,
|
|
3677
|
+
destroy: Be,
|
|
3678
|
+
getDocument: Q,
|
|
3679
|
+
setZoom: Se,
|
|
3680
|
+
save: Ot,
|
|
3681
|
+
loadDocument: Dt,
|
|
3682
|
+
loadDocumentBuffer: Et,
|
|
3683
|
+
addComment: sn,
|
|
3684
|
+
replyToComment: cn,
|
|
3685
|
+
resolveComment: un,
|
|
3686
|
+
proposeChange: dn,
|
|
3687
|
+
applyFormatting: Bt,
|
|
3688
|
+
setParagraphStyle: Vt,
|
|
3689
|
+
scrollVisiblePositionIntoView: Ln,
|
|
3631
3690
|
contentChangeSubscribers: S,
|
|
3632
|
-
selectionChangeSubscribers:
|
|
3691
|
+
selectionChangeSubscribers: ne,
|
|
3633
3692
|
onPrint: i.onPrint
|
|
3634
3693
|
});
|
|
3635
|
-
return
|
|
3636
|
-
class:
|
|
3694
|
+
return t(cr), (t, n) => (L(), A("div", {
|
|
3695
|
+
class: le([
|
|
3637
3696
|
"docx-editor-vue ep-root paged-editor",
|
|
3638
3697
|
e.className,
|
|
3639
3698
|
{
|
|
3640
|
-
"paged-editor--readonly":
|
|
3699
|
+
"paged-editor--readonly": c.value,
|
|
3641
3700
|
"paged-editor--hf-editing": V($) !== null,
|
|
3642
3701
|
"paged-editor--editing-header": V($)?.position === "header",
|
|
3643
3702
|
"paged-editor--editing-footer": V($)?.position === "footer"
|
|
@@ -3645,18 +3704,18 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
|
|
|
3645
3704
|
]),
|
|
3646
3705
|
style: P(e.style)
|
|
3647
3706
|
}, [
|
|
3648
|
-
|
|
3707
|
+
j("div", Ei, [M(kn, {
|
|
3649
3708
|
"show-menu-bar": e.showMenuBar,
|
|
3650
3709
|
"document-name": e.documentName,
|
|
3651
3710
|
"document-name-editable": e.documentNameEditable,
|
|
3652
3711
|
"render-logo": e.renderLogo,
|
|
3653
3712
|
"render-title-bar-right": e.renderTitleBarRight,
|
|
3654
|
-
onRename: V(
|
|
3655
|
-
onMenuAction: V(
|
|
3656
|
-
onInsertTable: V(
|
|
3713
|
+
onRename: V(wt),
|
|
3714
|
+
onMenuAction: V($n),
|
|
3715
|
+
onInsertTable: V(er)
|
|
3657
3716
|
}, {
|
|
3658
|
-
"title-bar-left":
|
|
3659
|
-
"title-bar-right":
|
|
3717
|
+
"title-bar-left": me(() => [ue(t.$slots, "title-bar-left")]),
|
|
3718
|
+
"title-bar-right": me(() => [ue(t.$slots, "title-bar-right")]),
|
|
3660
3719
|
_: 3
|
|
3661
3720
|
}, 8, [
|
|
3662
3721
|
"show-menu-bar",
|
|
@@ -3667,37 +3726,37 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
|
|
|
3667
3726
|
"onRename",
|
|
3668
3727
|
"onMenuAction",
|
|
3669
3728
|
"onInsertTable"
|
|
3670
|
-
]), e.showToolbar ? (L(),
|
|
3729
|
+
]), e.showToolbar ? (L(), O(y, {
|
|
3671
3730
|
key: 0,
|
|
3672
|
-
view:
|
|
3673
|
-
"get-commands": V(
|
|
3731
|
+
view: rt.value,
|
|
3732
|
+
"get-commands": V(Ve),
|
|
3674
3733
|
"state-tick": x.value,
|
|
3675
|
-
"zoom-percent": V(
|
|
3676
|
-
"is-min-zoom": V(
|
|
3677
|
-
"is-max-zoom": V(
|
|
3678
|
-
"zoom-presets": V(
|
|
3734
|
+
"zoom-percent": V(ye),
|
|
3735
|
+
"is-min-zoom": V(be),
|
|
3736
|
+
"is-max-zoom": V(xe),
|
|
3737
|
+
"zoom-presets": V(je),
|
|
3679
3738
|
"show-zoom-control": e.showZoomControl,
|
|
3680
|
-
"editor-mode":
|
|
3681
|
-
"comments-sidebar-open":
|
|
3682
|
-
"image-context": V(
|
|
3683
|
-
theme:
|
|
3739
|
+
"editor-mode": s.value,
|
|
3740
|
+
"comments-sidebar-open": U.value,
|
|
3741
|
+
"image-context": V(Dn),
|
|
3742
|
+
theme: Ze.value,
|
|
3684
3743
|
"font-families": e.fontFamilies,
|
|
3685
|
-
onInsertLink: n[0] ||= (e) =>
|
|
3686
|
-
onApplyStyle: V(
|
|
3687
|
-
onZoomIn: V(
|
|
3688
|
-
onZoomOut: V(
|
|
3689
|
-
onZoomSet: V(
|
|
3690
|
-
onToggleSidebar: V(
|
|
3691
|
-
onModeChange:
|
|
3744
|
+
onInsertLink: n[0] ||= (e) => ie.value = !0,
|
|
3745
|
+
onApplyStyle: V(Lt),
|
|
3746
|
+
onZoomIn: V(Ce),
|
|
3747
|
+
onZoomOut: V(we),
|
|
3748
|
+
onZoomSet: V(Se),
|
|
3749
|
+
onToggleSidebar: V(an),
|
|
3750
|
+
onModeChange: rr,
|
|
3692
3751
|
onImageWrapType: V(On),
|
|
3693
|
-
onImageProperties: n[1] ||= (e) =>
|
|
3694
|
-
onImageTransform: V(
|
|
3695
|
-
},
|
|
3696
|
-
"table-context":
|
|
3697
|
-
view:
|
|
3698
|
-
"get-commands": V(
|
|
3752
|
+
onImageProperties: n[1] ||= (e) => N.value = !0,
|
|
3753
|
+
onImageTransform: V(An)
|
|
3754
|
+
}, re({
|
|
3755
|
+
"table-context": me(() => [M(m, {
|
|
3756
|
+
view: rt.value,
|
|
3757
|
+
"get-commands": V(Ve),
|
|
3699
3758
|
"state-tick": x.value,
|
|
3700
|
-
theme:
|
|
3759
|
+
theme: Ze.value
|
|
3701
3760
|
}, null, 8, [
|
|
3702
3761
|
"view",
|
|
3703
3762
|
"get-commands",
|
|
@@ -3707,11 +3766,11 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
|
|
|
3707
3766
|
_: 2
|
|
3708
3767
|
}, [e.toolbarExtra ? {
|
|
3709
3768
|
name: "toolbar-extra",
|
|
3710
|
-
fn:
|
|
3769
|
+
fn: me(() => [(L(), O(de(e.toolbarExtra)))]),
|
|
3711
3770
|
key: "0"
|
|
3712
3771
|
} : {
|
|
3713
3772
|
name: "toolbar-extra",
|
|
3714
|
-
fn:
|
|
3773
|
+
fn: me(() => [ue(t.$slots, "toolbar-extra")]),
|
|
3715
3774
|
key: "1"
|
|
3716
3775
|
}]), 1032, [
|
|
3717
3776
|
"view",
|
|
@@ -3734,39 +3793,35 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
|
|
|
3734
3793
|
"onToggleSidebar",
|
|
3735
3794
|
"onImageWrapType",
|
|
3736
3795
|
"onImageTransform"
|
|
3737
|
-
])) :
|
|
3738
|
-
|
|
3739
|
-
"show-find-replace":
|
|
3740
|
-
"onUpdate:showFindReplace": n[2] ||= (e) =>
|
|
3741
|
-
"show-
|
|
3742
|
-
"onUpdate:
|
|
3743
|
-
"show-
|
|
3744
|
-
"onUpdate:
|
|
3745
|
-
"show-
|
|
3746
|
-
"onUpdate:
|
|
3747
|
-
"show-
|
|
3748
|
-
"onUpdate:
|
|
3749
|
-
"show-
|
|
3750
|
-
"onUpdate:
|
|
3751
|
-
"show-
|
|
3752
|
-
"onUpdate:
|
|
3753
|
-
|
|
3754
|
-
"onUpdate:showKeyboardShortcuts": n[9] ||= (e) => he.value = e,
|
|
3755
|
-
view: V(X),
|
|
3796
|
+
])) : k("", !0)]),
|
|
3797
|
+
M(yr, {
|
|
3798
|
+
"show-find-replace": D.value,
|
|
3799
|
+
"onUpdate:showFindReplace": n[2] ||= (e) => D.value = e,
|
|
3800
|
+
"show-hyperlink": ie.value,
|
|
3801
|
+
"onUpdate:showHyperlink": n[3] ||= (e) => ie.value = e,
|
|
3802
|
+
"show-insert-symbol": ae.value,
|
|
3803
|
+
"onUpdate:showInsertSymbol": n[4] ||= (e) => ae.value = e,
|
|
3804
|
+
"show-image-properties": N.value,
|
|
3805
|
+
"onUpdate:showImageProperties": n[5] ||= (e) => N.value = e,
|
|
3806
|
+
"show-page-setup": oe.value,
|
|
3807
|
+
"onUpdate:showPageSetup": n[6] ||= (e) => oe.value = e,
|
|
3808
|
+
"show-watermark": V($t),
|
|
3809
|
+
"onUpdate:showWatermark": n[7] ||= (e) => se($t) ? $t.value = e : null,
|
|
3810
|
+
"show-keyboard-shortcuts": pe.value,
|
|
3811
|
+
"onUpdate:showKeyboardShortcuts": n[8] ||= (e) => pe.value = e,
|
|
3812
|
+
view: V(Z),
|
|
3756
3813
|
bookmarks: lt.value,
|
|
3757
|
-
"selected-image-pm-pos": V(
|
|
3758
|
-
"section-properties":
|
|
3759
|
-
"current-watermark": V(
|
|
3760
|
-
"scroll-visible-position-into-view": V(
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
|
|
3766
|
-
onWatermarkApply: V(en)
|
|
3814
|
+
"selected-image-pm-pos": V(Tn)?.pmPos ?? null,
|
|
3815
|
+
"section-properties": Ye.value,
|
|
3816
|
+
"current-watermark": V(en),
|
|
3817
|
+
"scroll-visible-position-into-view": V(Ln),
|
|
3818
|
+
onInsertSymbol: V(zt),
|
|
3819
|
+
onHyperlinkSubmit: V(At),
|
|
3820
|
+
onHyperlinkRemove: V(jt),
|
|
3821
|
+
onPageSetupApply: V(Ht),
|
|
3822
|
+
onWatermarkApply: V(tn)
|
|
3767
3823
|
}, null, 8, [
|
|
3768
3824
|
"show-find-replace",
|
|
3769
|
-
"show-insert-image",
|
|
3770
3825
|
"show-hyperlink",
|
|
3771
3826
|
"show-insert-symbol",
|
|
3772
3827
|
"show-image-properties",
|
|
@@ -3779,42 +3834,41 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
|
|
|
3779
3834
|
"section-properties",
|
|
3780
3835
|
"current-watermark",
|
|
3781
3836
|
"scroll-visible-position-into-view",
|
|
3782
|
-
"onInsertImage",
|
|
3783
3837
|
"onInsertSymbol",
|
|
3784
3838
|
"onHyperlinkSubmit",
|
|
3785
3839
|
"onHyperlinkRemove",
|
|
3786
3840
|
"onPageSetupApply",
|
|
3787
3841
|
"onWatermarkApply"
|
|
3788
3842
|
]),
|
|
3789
|
-
V(
|
|
3790
|
-
!V(
|
|
3791
|
-
|
|
3843
|
+
V(Ne) ? (L(), A("div", Di, B(V(Ne)), 1)) : k("", !0),
|
|
3844
|
+
!V(Me) && !V(Ne) ? (L(), A("div", Oi, "Loading...")) : k("", !0),
|
|
3845
|
+
j("div", {
|
|
3792
3846
|
ref_key: "hiddenPmRef",
|
|
3793
|
-
ref:
|
|
3847
|
+
ref: h,
|
|
3794
3848
|
class: "docx-editor-vue__hidden-pm paged-editor__hidden-pm"
|
|
3795
3849
|
}, null, 512),
|
|
3796
|
-
|
|
3850
|
+
j("div", {
|
|
3797
3851
|
class: "docx-editor-vue__editor-scroll",
|
|
3798
|
-
onMousedown: n[
|
|
3799
|
-
}, [e.showRuler &&
|
|
3852
|
+
onMousedown: n[31] ||= (...e) => V(on) && V(on)(...e)
|
|
3853
|
+
}, [e.showRuler && Ye.value ? (L(), A("div", {
|
|
3800
3854
|
key: 0,
|
|
3801
3855
|
class: "docx-editor-vue__ruler-row",
|
|
3802
|
-
style: P(
|
|
3803
|
-
}, [
|
|
3804
|
-
"section-props":
|
|
3805
|
-
zoom: V(
|
|
3806
|
-
editable: !
|
|
3807
|
-
"indent-left":
|
|
3808
|
-
"indent-right":
|
|
3809
|
-
"first-line-indent":
|
|
3810
|
-
"hanging-indent":
|
|
3811
|
-
"tab-stops":
|
|
3812
|
-
onLeftMarginChange: V(
|
|
3813
|
-
onRightMarginChange: V(
|
|
3814
|
-
onIndentLeftChange: V(
|
|
3815
|
-
onIndentRightChange: V(
|
|
3816
|
-
onFirstLineIndentChange: V(
|
|
3817
|
-
onTabStopRemove: V(
|
|
3856
|
+
style: P(at.value)
|
|
3857
|
+
}, [M(g, {
|
|
3858
|
+
"section-props": Ye.value,
|
|
3859
|
+
zoom: V(X),
|
|
3860
|
+
editable: !c.value,
|
|
3861
|
+
"indent-left": Xe.value.indentLeft,
|
|
3862
|
+
"indent-right": Xe.value.indentRight,
|
|
3863
|
+
"first-line-indent": Xe.value.firstLineIndent,
|
|
3864
|
+
"hanging-indent": Xe.value.hangingIndent,
|
|
3865
|
+
"tab-stops": Xe.value.tabStops,
|
|
3866
|
+
onLeftMarginChange: V(Ut),
|
|
3867
|
+
onRightMarginChange: V(Wt),
|
|
3868
|
+
onIndentLeftChange: V(Jt),
|
|
3869
|
+
onIndentRightChange: V(Yt),
|
|
3870
|
+
onFirstLineIndentChange: V(Xt),
|
|
3871
|
+
onTabStopRemove: V(Zt)
|
|
3818
3872
|
}, null, 8, [
|
|
3819
3873
|
"section-props",
|
|
3820
3874
|
"zoom",
|
|
@@ -3830,50 +3884,50 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
|
|
|
3830
3884
|
"onIndentRightChange",
|
|
3831
3885
|
"onFirstLineIndentChange",
|
|
3832
3886
|
"onTabStopRemove"
|
|
3833
|
-
])], 4)) :
|
|
3834
|
-
|
|
3887
|
+
])], 4)) : k("", !0), j("div", ki, [
|
|
3888
|
+
j("div", {
|
|
3835
3889
|
ref_key: "pagesViewportRef",
|
|
3836
|
-
ref:
|
|
3890
|
+
ref: b,
|
|
3837
3891
|
class: "docx-editor-vue__pages-viewport",
|
|
3838
|
-
onMousedown: n[
|
|
3839
|
-
onMousemove: n[
|
|
3840
|
-
onClick: n[
|
|
3841
|
-
onDblclick: n[
|
|
3842
|
-
onContextmenu: n[
|
|
3843
|
-
onWheel: n[
|
|
3892
|
+
onMousedown: n[22] ||= (...e) => V(Rn) && V(Rn)(...e),
|
|
3893
|
+
onMousemove: n[23] ||= (...e) => V(zn) && V(zn)(...e),
|
|
3894
|
+
onClick: n[24] ||= (...e) => V(Bn) && V(Bn)(...e),
|
|
3895
|
+
onDblclick: n[25] ||= (...e) => V(Vn) && V(Vn)(...e),
|
|
3896
|
+
onContextmenu: n[26] ||= q((...e) => V(Yn) && V(Yn)(...e), ["prevent"]),
|
|
3897
|
+
onWheel: n[27] ||= (...e) => V(De) && V(De)(...e)
|
|
3844
3898
|
}, [
|
|
3845
|
-
e.showRuler &&
|
|
3846
|
-
"section-props":
|
|
3847
|
-
zoom: V(
|
|
3848
|
-
editable: !
|
|
3849
|
-
onTopMarginChange: V(
|
|
3850
|
-
onBottomMarginChange: V(
|
|
3899
|
+
e.showRuler && Ye.value ? (L(), A("div", Ai, [M(f, {
|
|
3900
|
+
"section-props": Ye.value,
|
|
3901
|
+
zoom: V(X),
|
|
3902
|
+
editable: !c.value,
|
|
3903
|
+
onTopMarginChange: V(Gt),
|
|
3904
|
+
onBottomMarginChange: V(qt)
|
|
3851
3905
|
}, null, 8, [
|
|
3852
3906
|
"section-props",
|
|
3853
3907
|
"zoom",
|
|
3854
3908
|
"editable",
|
|
3855
3909
|
"onTopMarginChange",
|
|
3856
3910
|
"onBottomMarginChange"
|
|
3857
|
-
])])) :
|
|
3858
|
-
|
|
3911
|
+
])])) : k("", !0),
|
|
3912
|
+
j("div", {
|
|
3859
3913
|
ref_key: "pagesRef",
|
|
3860
|
-
ref:
|
|
3914
|
+
ref: v,
|
|
3861
3915
|
class: "docx-editor-vue__pages paged-editor__pages",
|
|
3862
|
-
style: P(
|
|
3916
|
+
style: P(it.value)
|
|
3863
3917
|
}, null, 4),
|
|
3864
|
-
|
|
3918
|
+
c.value ? k("", !0) : (L(), O(wn, {
|
|
3865
3919
|
key: 1,
|
|
3866
|
-
container:
|
|
3867
|
-
view: V(
|
|
3920
|
+
container: v.value,
|
|
3921
|
+
view: V(Z)
|
|
3868
3922
|
}, null, 8, ["container", "view"])),
|
|
3869
|
-
|
|
3923
|
+
M(vn, {
|
|
3870
3924
|
"is-open": V($) !== null,
|
|
3871
3925
|
position: V($)?.position ?? "header",
|
|
3872
|
-
view:
|
|
3926
|
+
view: nt.value,
|
|
3873
3927
|
"target-rect": V($)?.targetRect ?? null,
|
|
3874
|
-
onSave: V(
|
|
3875
|
-
onClose: n[
|
|
3876
|
-
onRemove: V(
|
|
3928
|
+
onSave: V(Wn),
|
|
3929
|
+
onClose: n[9] ||= (e) => $.value = null,
|
|
3930
|
+
onRemove: V(Gn)
|
|
3877
3931
|
}, null, 8, [
|
|
3878
3932
|
"is-open",
|
|
3879
3933
|
"position",
|
|
@@ -3882,7 +3936,7 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
|
|
|
3882
3936
|
"onSave",
|
|
3883
3937
|
"onRemove"
|
|
3884
3938
|
]),
|
|
3885
|
-
(L(!0),
|
|
3939
|
+
(L(!0), A(w, null, z(V($) ? $e.value : [], (e, t) => (L(), A("div", {
|
|
3886
3940
|
key: `hf-sel-${t}-${e.top}-${e.left}`,
|
|
3887
3941
|
class: "vue-hf-sel-rect",
|
|
3888
3942
|
"aria-hidden": "true",
|
|
@@ -3897,48 +3951,48 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
|
|
|
3897
3951
|
zIndex: 9998
|
|
3898
3952
|
})
|
|
3899
3953
|
}, null, 4))), 128)),
|
|
3900
|
-
V($) &&
|
|
3954
|
+
V($) && Qe.value ? (L(), A("div", {
|
|
3901
3955
|
key: 2,
|
|
3902
3956
|
"aria-hidden": "true",
|
|
3903
3957
|
style: P({
|
|
3904
3958
|
position: "fixed",
|
|
3905
|
-
top: `${
|
|
3906
|
-
left: `${
|
|
3959
|
+
top: `${Qe.value.top}px`,
|
|
3960
|
+
left: `${Qe.value.left}px`,
|
|
3907
3961
|
width: "2px",
|
|
3908
|
-
height: `${
|
|
3962
|
+
height: `${Qe.value.height}px`,
|
|
3909
3963
|
background: "#4285f4",
|
|
3910
3964
|
pointerEvents: "none",
|
|
3911
3965
|
zIndex: 9999,
|
|
3912
3966
|
animation: "hf-caret-blink 1.06s steps(1) infinite"
|
|
3913
3967
|
})
|
|
3914
|
-
}, null, 4)) :
|
|
3915
|
-
|
|
3916
|
-
"image-info": V(
|
|
3917
|
-
zoom: V(
|
|
3918
|
-
view: V(
|
|
3919
|
-
onOpenProperties: n[
|
|
3920
|
-
onDeselect: n[
|
|
3921
|
-
onInteractStart: n[
|
|
3922
|
-
onInteractEnd: n[
|
|
3923
|
-
onContextMenu: V(
|
|
3968
|
+
}, null, 4)) : k("", !0),
|
|
3969
|
+
M(ln, {
|
|
3970
|
+
"image-info": V(Tn),
|
|
3971
|
+
zoom: V(X),
|
|
3972
|
+
view: V(Z),
|
|
3973
|
+
onOpenProperties: n[10] ||= (e) => N.value = !0,
|
|
3974
|
+
onDeselect: n[11] ||= (e) => Tn.value = null,
|
|
3975
|
+
onInteractStart: n[12] ||= (e) => En.value = !0,
|
|
3976
|
+
onInteractEnd: n[13] ||= (e) => En.value = !1,
|
|
3977
|
+
onContextMenu: V(Xn)
|
|
3924
3978
|
}, null, 8, [
|
|
3925
3979
|
"image-info",
|
|
3926
3980
|
"zoom",
|
|
3927
3981
|
"view",
|
|
3928
3982
|
"onContextMenu"
|
|
3929
3983
|
]),
|
|
3930
|
-
|
|
3931
|
-
"get-view":
|
|
3932
|
-
"get-pages-container":
|
|
3933
|
-
zoom: V(
|
|
3984
|
+
M(Qt, {
|
|
3985
|
+
"get-view": tr,
|
|
3986
|
+
"get-pages-container": nr,
|
|
3987
|
+
zoom: V(X),
|
|
3934
3988
|
"transaction-version": x.value,
|
|
3935
|
-
"sync-coordinator": V(
|
|
3989
|
+
"sync-coordinator": V(T)
|
|
3936
3990
|
}, null, 8, [
|
|
3937
3991
|
"zoom",
|
|
3938
3992
|
"transaction-version",
|
|
3939
3993
|
"sync-coordinator"
|
|
3940
3994
|
]),
|
|
3941
|
-
V(dt) && !
|
|
3995
|
+
V(dt) && !G.value && !c.value ? (L(), A("button", {
|
|
3942
3996
|
key: 3,
|
|
3943
3997
|
type: "button",
|
|
3944
3998
|
class: "docx-editor-vue__floating-comment",
|
|
@@ -3946,43 +4000,43 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
|
|
|
3946
4000
|
top: V(dt).top + "px",
|
|
3947
4001
|
left: V(dt).left + "px"
|
|
3948
4002
|
}),
|
|
3949
|
-
title: V(
|
|
3950
|
-
onMousedown: n[
|
|
3951
|
-
}, [
|
|
4003
|
+
title: V(d)("comments.addComment"),
|
|
4004
|
+
onMousedown: n[14] ||= q((...e) => V(vt) && V(vt)(...e), ["prevent", "stop"])
|
|
4005
|
+
}, [M(r, {
|
|
3952
4006
|
name: "add_comment",
|
|
3953
4007
|
size: 16
|
|
3954
|
-
})], 44,
|
|
3955
|
-
V(
|
|
4008
|
+
})], 44, ji)) : k("", !0),
|
|
4009
|
+
V(Nn) && !c.value ? (L(), A("button", {
|
|
3956
4010
|
key: 4,
|
|
3957
4011
|
type: "button",
|
|
3958
4012
|
class: "docx-editor-vue__table-insert-btn",
|
|
3959
4013
|
style: P({
|
|
3960
|
-
left: V(
|
|
3961
|
-
top: V(
|
|
4014
|
+
left: V(Nn).x + "px",
|
|
4015
|
+
top: V(Nn).y + "px"
|
|
3962
4016
|
}),
|
|
3963
|
-
title: V(
|
|
3964
|
-
"aria-label": V(
|
|
3965
|
-
onMousedown: n[
|
|
3966
|
-
onMouseenter: n[
|
|
3967
|
-
onMouseleave: n[
|
|
3968
|
-
}, [...n[37] ||= [
|
|
4017
|
+
title: V(Nn).type === "row" ? "Insert row below" : "Insert column to the right",
|
|
4018
|
+
"aria-label": V(Nn).type === "row" ? "Insert row below" : "Insert column to the right",
|
|
4019
|
+
onMousedown: n[15] ||= (...e) => V(Hn) && V(Hn)(...e),
|
|
4020
|
+
onMouseenter: n[16] ||= (...e) => V(Un) && V(Un)(...e),
|
|
4021
|
+
onMouseleave: n[17] ||= (e) => Nn.value = null
|
|
4022
|
+
}, [...n[37] ||= [j("svg", {
|
|
3969
4023
|
width: "12",
|
|
3970
4024
|
height: "12",
|
|
3971
4025
|
viewBox: "0 0 12 12",
|
|
3972
4026
|
fill: "none"
|
|
3973
|
-
}, [
|
|
4027
|
+
}, [j("path", {
|
|
3974
4028
|
d: "M6 1v10M1 6h10",
|
|
3975
4029
|
stroke: "currentColor",
|
|
3976
4030
|
"stroke-width": "1.5",
|
|
3977
4031
|
"stroke-linecap": "round"
|
|
3978
|
-
})], -1)]], 44,
|
|
3979
|
-
|
|
3980
|
-
comments:
|
|
3981
|
-
"pages-container":
|
|
3982
|
-
zoom: V(
|
|
3983
|
-
"page-width-px":
|
|
3984
|
-
"sidebar-open":
|
|
3985
|
-
"resolved-comment-ids":
|
|
4032
|
+
})], -1)]], 44, Mi)) : k("", !0),
|
|
4033
|
+
M(_, {
|
|
4034
|
+
comments: J.value,
|
|
4035
|
+
"pages-container": v.value,
|
|
4036
|
+
zoom: V(X),
|
|
4037
|
+
"page-width-px": ot.value,
|
|
4038
|
+
"sidebar-open": U.value,
|
|
4039
|
+
"resolved-comment-ids": st.value,
|
|
3986
4040
|
onMarkerClick: V(yt)
|
|
3987
4041
|
}, null, 8, [
|
|
3988
4042
|
"comments",
|
|
@@ -3993,22 +4047,22 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
|
|
|
3993
4047
|
"resolved-comment-ids",
|
|
3994
4048
|
"onMarkerClick"
|
|
3995
4049
|
]),
|
|
3996
|
-
|
|
3997
|
-
"is-open":
|
|
3998
|
-
comments:
|
|
3999
|
-
"tracked-changes":
|
|
4000
|
-
"is-adding-comment":
|
|
4050
|
+
M(p, {
|
|
4051
|
+
"is-open": U.value,
|
|
4052
|
+
comments: J.value,
|
|
4053
|
+
"tracked-changes": Y.value,
|
|
4054
|
+
"is-adding-comment": G.value,
|
|
4001
4055
|
"add-comment-y-position": V(pt),
|
|
4002
4056
|
"show-resolved": !0,
|
|
4003
|
-
"pages-container":
|
|
4004
|
-
"page-width-px":
|
|
4005
|
-
zoom: V(
|
|
4006
|
-
"active-item-id":
|
|
4007
|
-
onClose: n[
|
|
4057
|
+
"pages-container": v.value,
|
|
4058
|
+
"page-width-px": ot.value,
|
|
4059
|
+
zoom: V(X),
|
|
4060
|
+
"active-item-id": K.value,
|
|
4061
|
+
onClose: n[18] ||= (e) => U.value = !1,
|
|
4008
4062
|
onAddComment: V(gt),
|
|
4009
4063
|
onCancelAddComment: V(_t),
|
|
4010
|
-
onCommentReply: V(
|
|
4011
|
-
onCommentResolve: V(
|
|
4064
|
+
onCommentReply: V(fn),
|
|
4065
|
+
onCommentResolve: V(pn),
|
|
4012
4066
|
onCommentUnresolve: V(gn),
|
|
4013
4067
|
onCommentDelete: V(_n),
|
|
4014
4068
|
onAcceptChange: V(yn),
|
|
@@ -4016,7 +4070,7 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
|
|
|
4016
4070
|
onAcceptChangeById: V(xn),
|
|
4017
4071
|
onRejectChangeById: V(Sn),
|
|
4018
4072
|
onTrackedChangeReply: V(Cn),
|
|
4019
|
-
"onUpdate:activeItemId": n[
|
|
4073
|
+
"onUpdate:activeItemId": n[19] ||= (e) => K.value = e
|
|
4020
4074
|
}, null, 8, [
|
|
4021
4075
|
"is-open",
|
|
4022
4076
|
"comments",
|
|
@@ -4039,14 +4093,14 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
|
|
|
4039
4093
|
"onRejectChangeById",
|
|
4040
4094
|
"onTrackedChangeReply"
|
|
4041
4095
|
]),
|
|
4042
|
-
|
|
4043
|
-
data: V(
|
|
4044
|
-
"read-only":
|
|
4045
|
-
onNavigate: V(
|
|
4046
|
-
onCopy: n[
|
|
4047
|
-
onEdit: V(
|
|
4048
|
-
onRemove: V(
|
|
4049
|
-
onClose: n[
|
|
4096
|
+
M($r, {
|
|
4097
|
+
data: V(kt),
|
|
4098
|
+
"read-only": c.value,
|
|
4099
|
+
onNavigate: V(Mt),
|
|
4100
|
+
onCopy: n[20] ||= (e) => kt.value = null,
|
|
4101
|
+
onEdit: V(Nt),
|
|
4102
|
+
onRemove: V(Ft),
|
|
4103
|
+
onClose: n[21] ||= (e) => kt.value = null
|
|
4050
4104
|
}, null, 8, [
|
|
4051
4105
|
"data",
|
|
4052
4106
|
"read-only",
|
|
@@ -4055,57 +4109,65 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
|
|
|
4055
4109
|
"onRemove"
|
|
4056
4110
|
])
|
|
4057
4111
|
], 544),
|
|
4058
|
-
!
|
|
4112
|
+
!H.value && e.showOutlineButton ? (L(), A("button", {
|
|
4059
4113
|
key: 0,
|
|
4060
4114
|
type: "button",
|
|
4061
4115
|
class: "docx-editor-vue__outline-toggle",
|
|
4062
4116
|
title: "Show document outline",
|
|
4063
|
-
onClick: n[
|
|
4064
|
-
onMousedown: n[
|
|
4065
|
-
}, [
|
|
4117
|
+
onClick: n[28] ||= (...e) => V(nn) && V(nn)(...e),
|
|
4118
|
+
onMousedown: n[29] ||= q(() => {}, ["stop"])
|
|
4119
|
+
}, [M(r, {
|
|
4066
4120
|
name: "format_list_bulleted",
|
|
4067
4121
|
size: 20
|
|
4068
|
-
})], 32)) :
|
|
4069
|
-
V(
|
|
4122
|
+
})], 32)) : k("", !0),
|
|
4123
|
+
V(Pn).totalPages > 1 ? (L(), O(hn, {
|
|
4070
4124
|
key: 1,
|
|
4071
|
-
"current-page": V(
|
|
4072
|
-
"total-pages": V(
|
|
4073
|
-
visible: V(
|
|
4125
|
+
"current-page": V(Pn).currentPage,
|
|
4126
|
+
"total-pages": V(Pn).totalPages,
|
|
4127
|
+
visible: V(Pn).visible
|
|
4074
4128
|
}, null, 8, [
|
|
4075
4129
|
"current-page",
|
|
4076
4130
|
"total-pages",
|
|
4077
4131
|
"visible"
|
|
4078
|
-
])) :
|
|
4079
|
-
|
|
4080
|
-
"is-open":
|
|
4081
|
-
headings:
|
|
4082
|
-
onClose: n[
|
|
4083
|
-
onNavigate: V(
|
|
4132
|
+
])) : k("", !0),
|
|
4133
|
+
M(mn, {
|
|
4134
|
+
"is-open": H.value,
|
|
4135
|
+
headings: ge.value,
|
|
4136
|
+
onClose: n[30] ||= (e) => H.value = !1,
|
|
4137
|
+
onNavigate: V(rn)
|
|
4084
4138
|
}, null, 8, [
|
|
4085
4139
|
"is-open",
|
|
4086
4140
|
"headings",
|
|
4087
4141
|
"onNavigate"
|
|
4088
4142
|
])
|
|
4089
4143
|
])], 32),
|
|
4090
|
-
|
|
4144
|
+
j("input", {
|
|
4091
4145
|
ref_key: "docxInputRef",
|
|
4092
4146
|
ref: bt,
|
|
4093
4147
|
type: "file",
|
|
4094
4148
|
accept: ".docx,application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
4095
4149
|
style: { display: "none" },
|
|
4096
|
-
onChange: n[
|
|
4150
|
+
onChange: n[32] ||= (...e) => V(Ct) && V(Ct)(...e)
|
|
4151
|
+
}, null, 544),
|
|
4152
|
+
j("input", {
|
|
4153
|
+
ref_key: "imageInputRef",
|
|
4154
|
+
ref: xt,
|
|
4155
|
+
type: "file",
|
|
4156
|
+
accept: "image/*",
|
|
4157
|
+
style: { display: "none" },
|
|
4158
|
+
onChange: n[33] ||= (...e) => V(St) && V(St)(...e)
|
|
4097
4159
|
}, null, 544),
|
|
4098
|
-
|
|
4099
|
-
"read-only":
|
|
4100
|
-
"context-menu": V(
|
|
4101
|
-
"image-context-menu": V(
|
|
4102
|
-
"image-context-menu-text-actions": V(
|
|
4103
|
-
"can-open-image-properties": !!V(
|
|
4104
|
-
onContextMenuAction: V(
|
|
4105
|
-
onCloseContextMenu: n[34] ||= (e) => V(
|
|
4106
|
-
onImageWrapSelect: V(
|
|
4107
|
-
onCloseImageContextMenu: n[35] ||= (e) =>
|
|
4108
|
-
onOpenImageProperties: n[36] ||= (e) =>
|
|
4160
|
+
M(Ur, {
|
|
4161
|
+
"read-only": c.value,
|
|
4162
|
+
"context-menu": V(Kn),
|
|
4163
|
+
"image-context-menu": V(qn),
|
|
4164
|
+
"image-context-menu-text-actions": V(Jn),
|
|
4165
|
+
"can-open-image-properties": !!V(Tn),
|
|
4166
|
+
onContextMenuAction: V(Qn),
|
|
4167
|
+
onCloseContextMenu: n[34] ||= (e) => V(Kn).isOpen = !1,
|
|
4168
|
+
onImageWrapSelect: V(Zn),
|
|
4169
|
+
onCloseImageContextMenu: n[35] ||= (e) => qn.value = null,
|
|
4170
|
+
onOpenImageProperties: n[36] ||= (e) => N.value = !0
|
|
4109
4171
|
}, null, 8, [
|
|
4110
4172
|
"read-only",
|
|
4111
4173
|
"context-menu",
|
|
@@ -4120,8 +4182,8 @@ var hi = { class: "docx-editor-vue__toolbar-shell" }, gi = {
|
|
|
4120
4182
|
});
|
|
4121
4183
|
//#endregion
|
|
4122
4184
|
//#region src/renderAsync.ts
|
|
4123
|
-
async function
|
|
4124
|
-
let r = e instanceof ArrayBuffer ? e : await
|
|
4185
|
+
async function Pi(e, t, n = {}) {
|
|
4186
|
+
let r = e instanceof ArrayBuffer ? e : await Ve(e), i = null, a = null, o = !1, s = {
|
|
4125
4187
|
save: async () => {
|
|
4126
4188
|
let e = await (i?.save() ?? Promise.resolve(null));
|
|
4127
4189
|
return e ? new Blob([e], { type: "application/vnd.openxmlformats-officedocument.wordprocessingml.document" }) : null;
|
|
@@ -4142,8 +4204,8 @@ async function Ci(e, t, n = {}) {
|
|
|
4142
4204
|
}
|
|
4143
4205
|
};
|
|
4144
4206
|
return new Promise((e, c) => {
|
|
4145
|
-
a =
|
|
4146
|
-
return () =>
|
|
4207
|
+
a = D({ setup() {
|
|
4208
|
+
return () => oe(Ni, {
|
|
4147
4209
|
...n,
|
|
4148
4210
|
documentBuffer: r,
|
|
4149
4211
|
showToolbar: n.showToolbar ?? !0,
|
|
@@ -4167,6 +4229,6 @@ async function Ci(e, t, n = {}) {
|
|
|
4167
4229
|
}
|
|
4168
4230
|
//#endregion
|
|
4169
4231
|
//#region src/index.ts
|
|
4170
|
-
var
|
|
4232
|
+
var Fi = "0.0.2";
|
|
4171
4233
|
//#endregion
|
|
4172
|
-
export {
|
|
4234
|
+
export { Ni as DocxEditor, Fi as VERSION, Wt as createDocumentWithText, Gt as createEmptyDocument, n as defaultLocale, t as i18nPlugin, a as provideLocale, Pi as renderAsync, d as useTranslation };
|