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