@eigenpal/docx-editor-vue 1.0.0 → 1.0.2
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/README.md +25 -0
- package/dist/index.cjs +3 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.js +190 -189
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -28,8 +28,9 @@ import { extractTrackedChanges as qe } from "@eigenpal/docx-editor-core/prosemir
|
|
|
28
28
|
import { TABLE_INSERT_HIDE_DELAY_MS as Je, detectTableInsertHover as Ye } from "@eigenpal/docx-editor-core/layout-bridge/tableInsertHover";
|
|
29
29
|
import { openReportIssue as Xe } from "@eigenpal/docx-editor-core/utils/reportIssue";
|
|
30
30
|
import { LayoutSelectionGate as Ze } from "@eigenpal/docx-editor-core/prosemirror";
|
|
31
|
+
import { createDocumentWithText as Qe, createEmptyDocument as $e } from "@eigenpal/docx-editor-core";
|
|
31
32
|
//#region src/utils/paraTextHelpers.ts
|
|
32
|
-
function
|
|
33
|
+
function et(e, t) {
|
|
33
34
|
if (!t.trim()) return null;
|
|
34
35
|
let n = null;
|
|
35
36
|
return e.descendants((e, r) => n ? !1 : e.isTextblock && e.attrs?.paraId === t ? (n = {
|
|
@@ -37,11 +38,11 @@ function Qe(e, t) {
|
|
|
37
38
|
to: r + e.nodeSize
|
|
38
39
|
}, !1) : !0), n;
|
|
39
40
|
}
|
|
40
|
-
function
|
|
41
|
+
function tt(e) {
|
|
41
42
|
let t = [];
|
|
42
43
|
return e.descendants((e) => !e.isText || !e.text ? !0 : e.marks.some((e) => e.type.name === "insertion") ? !1 : (t.push(e.text), !0)), t.join("");
|
|
43
44
|
}
|
|
44
|
-
function
|
|
45
|
+
function nt(e, t, n) {
|
|
45
46
|
if (t >= n) return "";
|
|
46
47
|
let r = [];
|
|
47
48
|
return e.nodesBetween(t, n, (e, i) => {
|
|
@@ -50,7 +51,7 @@ function et(e, t, n) {
|
|
|
50
51
|
a < o && r.push(e.text.slice(a - i, o - i));
|
|
51
52
|
}), r.join("");
|
|
52
53
|
}
|
|
53
|
-
function
|
|
54
|
+
function rt(e, t, n, r) {
|
|
54
55
|
if (!r) return null;
|
|
55
56
|
let i = "", a = [];
|
|
56
57
|
e.nodesBetween(t, n, (e, t) => {
|
|
@@ -77,7 +78,7 @@ function tt(e, t, n, r) {
|
|
|
77
78
|
}
|
|
78
79
|
//#endregion
|
|
79
80
|
//#region src/utils/refApiQueries.ts
|
|
80
|
-
function
|
|
81
|
+
function it(e, t, n) {
|
|
81
82
|
if (!e || !t) return [];
|
|
82
83
|
let r = n?.caseSensitive ?? !1, i = n?.limit ?? 20, a = r ? t : t.toLowerCase(), o = [];
|
|
83
84
|
return e.state.doc.descendants((e) => {
|
|
@@ -85,7 +86,7 @@ function nt(e, t, n) {
|
|
|
85
86
|
if (!e.isTextblock) return !0;
|
|
86
87
|
let n = e.attrs?.paraId;
|
|
87
88
|
if (!n) return !1;
|
|
88
|
-
let s =
|
|
89
|
+
let s = tt(e), c = r ? s : s.toLowerCase(), l = c.indexOf(a);
|
|
89
90
|
return l === -1 || c.indexOf(a, l + 1) !== -1 || o.push({
|
|
90
91
|
paraId: n,
|
|
91
92
|
match: s.slice(l, l + t.length),
|
|
@@ -94,13 +95,13 @@ function nt(e, t, n) {
|
|
|
94
95
|
}), !1;
|
|
95
96
|
}), o;
|
|
96
97
|
}
|
|
97
|
-
function
|
|
98
|
+
function at(e) {
|
|
98
99
|
if (!e) return null;
|
|
99
100
|
let { selection: t, doc: n } = e.state, r = t.$from, i = r.depth;
|
|
100
101
|
for (; i > 0 && !r.node(i).isTextblock;) i--;
|
|
101
102
|
let a = i > 0 ? r.node(i) : null;
|
|
102
103
|
if (!a) return null;
|
|
103
|
-
let o = a.attrs?.paraId ?? null, s = r.start(i), c = s + a.content.size, l =
|
|
104
|
+
let o = a.attrs?.paraId ?? null, s = r.start(i), c = s + a.content.size, l = nt(n, s, t.from), u = nt(n, t.from, t.to), d = nt(n, t.to, c);
|
|
104
105
|
return {
|
|
105
106
|
paraId: o,
|
|
106
107
|
selectedText: u,
|
|
@@ -109,7 +110,7 @@ function rt(e) {
|
|
|
109
110
|
after: d
|
|
110
111
|
};
|
|
111
112
|
}
|
|
112
|
-
function
|
|
113
|
+
function ot(e, t, n) {
|
|
113
114
|
if (!t || !e) return null;
|
|
114
115
|
let r = t.pages[n - 1];
|
|
115
116
|
if (!r) return null;
|
|
@@ -123,7 +124,7 @@ function it(e, t, n) {
|
|
|
123
124
|
let o = r.attrs?.paraId;
|
|
124
125
|
!o || i.has(o) || (i.add(o), a.push({
|
|
125
126
|
paraId: o,
|
|
126
|
-
text:
|
|
127
|
+
text: tt(r),
|
|
127
128
|
styleId: r.attrs?.styleId ?? void 0
|
|
128
129
|
}));
|
|
129
130
|
}
|
|
@@ -135,7 +136,7 @@ function it(e, t, n) {
|
|
|
135
136
|
}
|
|
136
137
|
//#endregion
|
|
137
138
|
//#region src/components/DecorationLayer.vue
|
|
138
|
-
var
|
|
139
|
+
var st = /* @__PURE__ */ A({
|
|
139
140
|
__name: "DecorationLayer",
|
|
140
141
|
props: {
|
|
141
142
|
getView: { type: Function },
|
|
@@ -227,13 +228,13 @@ var at = /* @__PURE__ */ A({
|
|
|
227
228
|
"aria-hidden": "true"
|
|
228
229
|
}, null, 512));
|
|
229
230
|
}
|
|
230
|
-
}),
|
|
231
|
+
}), ct = ["data-handle", "onMousedown"], lt = ["title"], ut = {
|
|
231
232
|
key: 0,
|
|
232
233
|
class: "image-overlay__dim"
|
|
233
|
-
},
|
|
234
|
+
}, dt = {
|
|
234
235
|
key: 1,
|
|
235
236
|
class: "image-overlay__dim image-overlay__dim--rotate"
|
|
236
|
-
},
|
|
237
|
+
}, ft = 4, pt = 15, mt = /* @__PURE__ */ b(/* @__PURE__ */ A({
|
|
237
238
|
__name: "ImageSelectionOverlay",
|
|
238
239
|
props: {
|
|
239
240
|
imageInfo: {},
|
|
@@ -451,7 +452,7 @@ var at = /* @__PURE__ */ A({
|
|
|
451
452
|
}
|
|
452
453
|
function me(e) {
|
|
453
454
|
let t = pe(e.clientX, e.clientY) - de, n = fe + t;
|
|
454
|
-
e.shiftKey || (n = Math.round(n /
|
|
455
|
+
e.shiftKey || (n = Math.round(n / pt) * pt), f.value = (n % 360 + 360) % 360, H && (H.style.transform = W(B, f.value) || "");
|
|
455
456
|
}
|
|
456
457
|
function he() {
|
|
457
458
|
document.removeEventListener("mousemove", me), document.removeEventListener("mouseup", he), l.value = !1, a("interact-end");
|
|
@@ -472,7 +473,7 @@ var at = /* @__PURE__ */ A({
|
|
|
472
473
|
if (!i.imageInfo || !p.value) return;
|
|
473
474
|
let t = e.clientX, n = e.clientY, r = p.value, o = !1, s = (e) => {
|
|
474
475
|
let s = e.clientX - t, l = e.clientY - n;
|
|
475
|
-
if (!(!o && Math.sqrt(s * s + l * l) <
|
|
476
|
+
if (!(!o && Math.sqrt(s * s + l * l) < ft)) {
|
|
476
477
|
if (!o) {
|
|
477
478
|
o = !0, c.value = !0, a("interact-start"), q = document.createElement("div"), q.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);";
|
|
478
479
|
let e = i.zoom;
|
|
@@ -571,22 +572,22 @@ var at = /* @__PURE__ */ A({
|
|
|
571
572
|
style: M(e.style),
|
|
572
573
|
"data-handle": e.pos,
|
|
573
574
|
onMousedown: G((t) => A(t, e.pos), ["prevent", "stop"])
|
|
574
|
-
}, null, 44,
|
|
575
|
+
}, null, 44, ct))), 128)),
|
|
575
576
|
n[5] ||= O("div", { class: "image-overlay__rotate-line" }, null, -1),
|
|
576
577
|
O("div", {
|
|
577
578
|
class: "image-overlay__rotate-handle",
|
|
578
579
|
style: M({ left: `${ie.value / 2 - 7}px` }),
|
|
579
580
|
title: z(r)("imageOverlay.rotate"),
|
|
580
581
|
onMousedown: n[2] ||= G((e) => K(e), ["prevent", "stop"])
|
|
581
|
-
}, null, 44,
|
|
582
|
-
s.value ? (F(), D("div",
|
|
583
|
-
l.value ? (F(), D("div",
|
|
582
|
+
}, null, 44, lt),
|
|
583
|
+
s.value ? (F(), D("div", ut, R(Math.round(u.value)) + " × " + R(Math.round(d.value)), 1)) : E("", !0),
|
|
584
|
+
l.value ? (F(), D("div", dt, R(Math.round(f.value)) + "° ", 1)) : E("", !0)
|
|
584
585
|
], 36)) : E("", !0);
|
|
585
586
|
}
|
|
586
|
-
}), [["__scopeId", "data-v-a6f20ec2"]]),
|
|
587
|
+
}), [["__scopeId", "data-v-a6f20ec2"]]), ht = { class: "doc-outline__header" }, gt = { class: "doc-outline__body" }, _t = {
|
|
587
588
|
key: 0,
|
|
588
589
|
class: "doc-outline__empty"
|
|
589
|
-
},
|
|
590
|
+
}, vt = ["onMousedown"], yt = /* @__PURE__ */ b(/* @__PURE__ */ A({
|
|
590
591
|
__name: "DocumentOutline",
|
|
591
592
|
props: {
|
|
592
593
|
isOpen: { type: Boolean },
|
|
@@ -600,7 +601,7 @@ var at = /* @__PURE__ */ A({
|
|
|
600
601
|
role: "navigation",
|
|
601
602
|
"aria-label": "Document outline",
|
|
602
603
|
onMousedown: n[1] ||= G(() => {}, ["stop"])
|
|
603
|
-
}, [O("div",
|
|
604
|
+
}, [O("div", ht, [O("button", {
|
|
604
605
|
class: "doc-outline__back",
|
|
605
606
|
title: "Close outline",
|
|
606
607
|
"aria-label": "Close outline",
|
|
@@ -608,14 +609,14 @@ var at = /* @__PURE__ */ A({
|
|
|
608
609
|
}, [k(c, {
|
|
609
610
|
name: "arrow_back",
|
|
610
611
|
size: 20
|
|
611
|
-
})]), n[2] ||= O("span", { class: "doc-outline__title" }, "Document Outline", -1)]), O("div",
|
|
612
|
+
})]), n[2] ||= O("span", { class: "doc-outline__title" }, "Document Outline", -1)]), O("div", gt, [e.headings.length === 0 ? (F(), D("div", _t, " No headings found ")) : E("", !0), (F(!0), D(C, null, L(e.headings, (e, n) => (F(), D("button", {
|
|
612
613
|
key: n,
|
|
613
614
|
class: "doc-outline__item",
|
|
614
615
|
style: M({ paddingLeft: 12 + (e.level - 1) * 16 + "px" }),
|
|
615
616
|
onMousedown: G((n) => t.$emit("navigate", e.pmPos), ["prevent"])
|
|
616
|
-
}, R(e.text || "(untitled)"), 45,
|
|
617
|
+
}, R(e.text || "(untitled)"), 45, vt))), 128))])], 32)) : E("", !0);
|
|
617
618
|
}
|
|
618
|
-
}), [["__scopeId", "data-v-cb2cdc39"]]),
|
|
619
|
+
}), [["__scopeId", "data-v-cb2cdc39"]]), bt = /* @__PURE__ */ b(/* @__PURE__ */ A({
|
|
619
620
|
__name: "PageIndicator",
|
|
620
621
|
props: {
|
|
621
622
|
currentPage: {},
|
|
@@ -634,7 +635,7 @@ var at = /* @__PURE__ */ A({
|
|
|
634
635
|
total: e.totalPages
|
|
635
636
|
})), 5));
|
|
636
637
|
}
|
|
637
|
-
}), [["__scopeId", "data-v-d117bf6e"]]),
|
|
638
|
+
}), [["__scopeId", "data-v-d117bf6e"]]), xt = { class: "hf-editor__toolbar" }, St = { class: "hf-editor__label" }, Ct = { class: "hf-editor__actions" }, wt = /* @__PURE__ */ b(/* @__PURE__ */ A({
|
|
638
639
|
__name: "InlineHeaderFooterEditor",
|
|
639
640
|
props: {
|
|
640
641
|
isOpen: { type: Boolean },
|
|
@@ -697,7 +698,7 @@ var at = /* @__PURE__ */ A({
|
|
|
697
698
|
style: M(o.value),
|
|
698
699
|
onMousedown: n[2] ||= G(() => {}, ["stop"]),
|
|
699
700
|
onContextmenu: n[3] ||= G(() => {}, ["stop"])
|
|
700
|
-
}, [O("div",
|
|
701
|
+
}, [O("div", xt, [O("span", St, R(e.position === "header" ? "Header" : "Footer"), 1), O("div", Ct, [
|
|
701
702
|
O("button", {
|
|
702
703
|
class: "hf-editor__btn",
|
|
703
704
|
title: "Remove",
|
|
@@ -719,10 +720,10 @@ var at = /* @__PURE__ */ A({
|
|
|
719
720
|
class: "hf-editor__content"
|
|
720
721
|
}, null, 512)], 36)) : E("", !0);
|
|
721
722
|
}
|
|
722
|
-
}), [["__scopeId", "data-v-343434c4"]]),
|
|
723
|
+
}), [["__scopeId", "data-v-343434c4"]]), Tt = {
|
|
723
724
|
key: 0,
|
|
724
725
|
class: "docx-editor-vue__title-bar"
|
|
725
|
-
},
|
|
726
|
+
}, Et = { class: "docx-editor-vue__title-bar-left" }, Dt = { class: "docx-editor-vue__title-bar-center" }, Ot = { class: "docx-editor-vue__title-bar-right" }, kt = /* @__PURE__ */ A({
|
|
726
727
|
__name: "DocxEditorMenuBar",
|
|
727
728
|
props: {
|
|
728
729
|
showMenuBar: { type: Boolean },
|
|
@@ -741,9 +742,9 @@ var at = /* @__PURE__ */ A({
|
|
|
741
742
|
],
|
|
742
743
|
setup(e, { emit: t }) {
|
|
743
744
|
let n = t;
|
|
744
|
-
return (t, r) => e.showMenuBar ? (F(), D("div",
|
|
745
|
-
O("div",
|
|
746
|
-
O("div",
|
|
745
|
+
return (t, r) => e.showMenuBar ? (F(), D("div", Tt, [
|
|
746
|
+
O("div", Et, [e.renderLogo ? (F(), T(de(e.renderLogo), { key: 0 })) : E("", !0), ue(t.$slots, "title-bar-left")]),
|
|
747
|
+
O("div", Dt, [k(g, {
|
|
747
748
|
"model-value": e.documentName,
|
|
748
749
|
editable: e.documentNameEditable,
|
|
749
750
|
"onUpdate:modelValue": r[0] ||= (e) => n("rename", e)
|
|
@@ -751,10 +752,10 @@ var at = /* @__PURE__ */ A({
|
|
|
751
752
|
onAction: r[1] ||= (e) => n("menu-action", e),
|
|
752
753
|
onInsertTable: r[2] ||= (e, t) => n("insert-table", e, t)
|
|
753
754
|
})]),
|
|
754
|
-
O("div",
|
|
755
|
+
O("div", Ot, [ue(t.$slots, "title-bar-right"), e.renderTitleBarRight ? (F(), T(de(e.renderTitleBarRight), { key: 0 })) : E("", !0)])
|
|
755
756
|
])) : E("", !0);
|
|
756
757
|
}
|
|
757
|
-
}),
|
|
758
|
+
}), At = /* @__PURE__ */ A({
|
|
758
759
|
__name: "DocxEditorDialogs",
|
|
759
760
|
props: {
|
|
760
761
|
view: {},
|
|
@@ -835,10 +836,10 @@ var at = /* @__PURE__ */ A({
|
|
|
835
836
|
}, null, 8, ["is-open"])
|
|
836
837
|
], 64));
|
|
837
838
|
}
|
|
838
|
-
}),
|
|
839
|
+
}), jt = ["disabled", "onMousedown"], Mt = { class: "ctx-menu__label" }, Nt = {
|
|
839
840
|
key: 0,
|
|
840
841
|
class: "ctx-menu__shortcut"
|
|
841
|
-
},
|
|
842
|
+
}, Pt = 220, Ft = 32, It = 10, Lt = /* @__PURE__ */ b(/* @__PURE__ */ A({
|
|
842
843
|
__name: "TextContextMenu",
|
|
843
844
|
props: {
|
|
844
845
|
isOpen: { type: Boolean },
|
|
@@ -971,8 +972,8 @@ var at = /* @__PURE__ */ A({
|
|
|
971
972
|
disabled: !n.canSplitCell
|
|
972
973
|
}), e;
|
|
973
974
|
}), o = w(() => {
|
|
974
|
-
let e = n.position.x, t = n.position.y, r = a.value.filter((e) => !e.divider).length, i = a.value.filter((e) => e.divider).length, o = r *
|
|
975
|
-
return typeof window < "u" && (e +
|
|
975
|
+
let e = n.position.x, t = n.position.y, r = a.value.filter((e) => !e.divider).length, i = a.value.filter((e) => e.divider).length, o = r * Ft + i * 9;
|
|
976
|
+
return typeof window < "u" && (e + Pt + It > window.innerWidth && (e = window.innerWidth - Pt - It), t + o + It > window.innerHeight && (t = window.innerHeight - o - It)), {
|
|
976
977
|
position: "fixed",
|
|
977
978
|
left: `${e}px`,
|
|
978
979
|
top: `${t}px`,
|
|
@@ -1008,27 +1009,27 @@ var at = /* @__PURE__ */ A({
|
|
|
1008
1009
|
}]),
|
|
1009
1010
|
disabled: e.disabled,
|
|
1010
1011
|
onMousedown: G((t) => s(e.action), ["prevent"])
|
|
1011
|
-
}, [O("span",
|
|
1012
|
+
}, [O("span", Mt, R(e.label), 1), e.shortcut ? (F(), D("span", Nt, R(e.shortcut), 1)) : E("", !0)], 42, jt))), 128))], 36)) : E("", !0)]));
|
|
1012
1013
|
}
|
|
1013
|
-
}), [["__scopeId", "data-v-741c4f71"]]),
|
|
1014
|
+
}), [["__scopeId", "data-v-741c4f71"]]), Rt = ["aria-label"], zt = { class: "image-ctx-menu__icon" }, Bt = { class: "image-ctx-menu__label" }, Vt = {
|
|
1014
1015
|
key: 1,
|
|
1015
1016
|
class: "image-ctx-menu__divider",
|
|
1016
1017
|
role: "separator"
|
|
1017
|
-
},
|
|
1018
|
+
}, Ht = [
|
|
1018
1019
|
"data-wrap-type",
|
|
1019
1020
|
"data-current",
|
|
1020
1021
|
"data-disabled",
|
|
1021
1022
|
"disabled",
|
|
1022
1023
|
"title",
|
|
1023
1024
|
"onClick"
|
|
1024
|
-
],
|
|
1025
|
+
], Ut = { class: "image-ctx-menu__icon" }, Wt = { class: "image-ctx-menu__label" }, Gt = ["aria-label"], Kt = ["disabled", "onClick"], qt = { class: "image-ctx-menu__label" }, Jt = {
|
|
1025
1026
|
key: 0,
|
|
1026
1027
|
class: "image-ctx-menu__shortcut"
|
|
1027
|
-
},
|
|
1028
|
+
}, Yt = {
|
|
1028
1029
|
key: 0,
|
|
1029
1030
|
class: "image-ctx-menu__divider",
|
|
1030
1031
|
role: "separator"
|
|
1031
|
-
},
|
|
1032
|
+
}, Q = 18, Xt = 260, Zt = 10, Qt = /* @__PURE__ */ b(/* @__PURE__ */ A({
|
|
1032
1033
|
__name: "ImageContextMenu",
|
|
1033
1034
|
props: {
|
|
1034
1035
|
state: {},
|
|
@@ -1062,11 +1063,11 @@ var at = /* @__PURE__ */ A({
|
|
|
1062
1063
|
let p = w(() => {
|
|
1063
1064
|
if (!r.state) return {};
|
|
1064
1065
|
let e = Te.length * 36 + 16, t = r.state.position.x, n = r.state.position.y;
|
|
1065
|
-
return typeof window < "u" && (t +
|
|
1066
|
+
return typeof window < "u" && (t + Xt > window.innerWidth && (t = window.innerWidth - Xt - Zt), n + e > window.innerHeight && (n = window.innerHeight - e - Zt), t < Zt && (t = Zt), n < Zt && (n = Zt)), {
|
|
1066
1067
|
position: "fixed",
|
|
1067
1068
|
left: `${t}px`,
|
|
1068
1069
|
top: `${n}px`,
|
|
1069
|
-
minWidth: `${
|
|
1070
|
+
minWidth: `${Xt}px`,
|
|
1070
1071
|
zIndex: 400
|
|
1071
1072
|
};
|
|
1072
1073
|
});
|
|
@@ -1110,11 +1111,11 @@ var at = /* @__PURE__ */ A({
|
|
|
1110
1111
|
"data-action": "open-properties",
|
|
1111
1112
|
onMousedown: n[1] ||= G(() => {}, ["prevent"]),
|
|
1112
1113
|
onClick: a
|
|
1113
|
-
}, [O("span",
|
|
1114
|
+
}, [O("span", zt, [k(c, {
|
|
1114
1115
|
name: "settings",
|
|
1115
|
-
size:
|
|
1116
|
-
})]), O("span",
|
|
1117
|
-
e.canOpenProperties ? (F(), D("div",
|
|
1116
|
+
size: Q
|
|
1117
|
+
})]), O("span", Bt, R(z(o)("imageWrap.menu.imageProperties")), 1)], 32)) : E("", !0),
|
|
1118
|
+
e.canOpenProperties ? (F(), D("div", Vt)) : E("", !0),
|
|
1118
1119
|
(F(!0), D(C, null, L(z(l), (e) => (F(), D("button", {
|
|
1119
1120
|
key: e.choice,
|
|
1120
1121
|
type: "button",
|
|
@@ -1128,17 +1129,17 @@ var at = /* @__PURE__ */ A({
|
|
|
1128
1129
|
onMousedown: n[2] ||= G(() => {}, ["prevent"]),
|
|
1129
1130
|
onClick: (t) => h(e)
|
|
1130
1131
|
}, [
|
|
1131
|
-
O("span",
|
|
1132
|
+
O("span", Ut, [k(c, {
|
|
1132
1133
|
name: f(e.iconHint),
|
|
1133
|
-
size:
|
|
1134
|
+
size: Q
|
|
1134
1135
|
}, null, 8, ["name"])]),
|
|
1135
|
-
O("span",
|
|
1136
|
+
O("span", Wt, R(z(o)(`imageWrap.menu.${e.i18nLabelKey}`)), 1),
|
|
1136
1137
|
e.choice === u.value ? (F(), D("span", {
|
|
1137
1138
|
key: 0,
|
|
1138
1139
|
class: "image-ctx-menu__current-dot",
|
|
1139
1140
|
"aria-label": z(o)("imageWrap.menu.ariaLabel")
|
|
1140
|
-
}, "●", 8,
|
|
1141
|
-
], 42,
|
|
1141
|
+
}, "●", 8, Gt)) : E("", !0)
|
|
1142
|
+
], 42, Ht))), 128)),
|
|
1142
1143
|
e.textActions && e.textActions.length > 0 ? (F(), D(C, { key: 2 }, [n[5] ||= O("div", {
|
|
1143
1144
|
class: "image-ctx-menu__divider",
|
|
1144
1145
|
role: "separator"
|
|
@@ -1149,10 +1150,10 @@ var at = /* @__PURE__ */ A({
|
|
|
1149
1150
|
disabled: e.disabled,
|
|
1150
1151
|
onMousedown: n[3] ||= G(() => {}, ["prevent"]),
|
|
1151
1152
|
onClick: (t) => g(e)
|
|
1152
|
-
}, [O("span",
|
|
1153
|
-
], 44,
|
|
1153
|
+
}, [O("span", qt, R(e.label), 1), e.shortcut ? (F(), D("span", Jt, R(e.shortcut), 1)) : E("", !0)], 40, Kt), e.dividerAfter ? (F(), D("div", Yt)) : E("", !0)], 64))), 128))], 64)) : E("", !0)
|
|
1154
|
+
], 44, Rt)) : E("", !0)]));
|
|
1154
1155
|
}
|
|
1155
|
-
}), [["__scopeId", "data-v-5c21ca8c"]]),
|
|
1156
|
+
}), [["__scopeId", "data-v-5c21ca8c"]]), $t = /* @__PURE__ */ A({
|
|
1156
1157
|
__name: "DocxEditorOverlays",
|
|
1157
1158
|
props: {
|
|
1158
1159
|
readOnly: { type: Boolean },
|
|
@@ -1170,7 +1171,7 @@ var at = /* @__PURE__ */ A({
|
|
|
1170
1171
|
],
|
|
1171
1172
|
setup(e, { emit: t }) {
|
|
1172
1173
|
let n = t;
|
|
1173
|
-
return (t, r) => (F(), D(C, null, [k(
|
|
1174
|
+
return (t, r) => (F(), D(C, null, [k(Lt, {
|
|
1174
1175
|
"is-open": e.contextMenu.isOpen,
|
|
1175
1176
|
position: e.contextMenu.position,
|
|
1176
1177
|
"has-selection": e.contextMenu.hasSelection,
|
|
@@ -1190,7 +1191,7 @@ var at = /* @__PURE__ */ A({
|
|
|
1190
1191
|
"on-image",
|
|
1191
1192
|
"can-merge-cells",
|
|
1192
1193
|
"can-split-cell"
|
|
1193
|
-
]), k(
|
|
1194
|
+
]), k(Qt, {
|
|
1194
1195
|
state: e.imageContextMenu,
|
|
1195
1196
|
"text-actions": e.imageContextMenuTextActions,
|
|
1196
1197
|
"can-open-properties": e.canOpenImageProperties,
|
|
@@ -1204,7 +1205,7 @@ var at = /* @__PURE__ */ A({
|
|
|
1204
1205
|
"can-open-properties"
|
|
1205
1206
|
])], 64));
|
|
1206
1207
|
}
|
|
1207
|
-
}),
|
|
1208
|
+
}), en = ["href", "title"], tn = ["title"], nn = ["title"], rn = ["title"], an = { class: "docx-hyperlink-popup__edit-row" }, $ = ["placeholder", "onKeydown"], on = { class: "docx-hyperlink-popup__edit-row" }, sn = ["onKeydown"], cn = ["disabled"], ln = /* @__PURE__ */ b(/* @__PURE__ */ A({
|
|
1208
1209
|
__name: "HyperlinkPopup",
|
|
1209
1210
|
props: {
|
|
1210
1211
|
data: {},
|
|
@@ -1253,28 +1254,28 @@ var at = /* @__PURE__ */ A({
|
|
|
1253
1254
|
class: le(["docx-hyperlink-popup", { "docx-hyperlink-popup--edit": o.value }]),
|
|
1254
1255
|
style: M(u.value),
|
|
1255
1256
|
onMousedown: n[6] ||= G(() => {}, ["stop"])
|
|
1256
|
-
}, [o.value ? (F(), D(C, { key: 1 }, [O("div",
|
|
1257
|
+
}, [o.value ? (F(), D(C, { key: 1 }, [O("div", an, [U(O("input", {
|
|
1257
1258
|
class: "docx-hyperlink-popup__input",
|
|
1258
1259
|
placeholder: z(r)("hyperlinkPopup.displayTextPlaceholder"),
|
|
1259
1260
|
"onUpdate:modelValue": n[2] ||= (e) => s.value = e,
|
|
1260
1261
|
onKeydown: [W(G(h, ["prevent"]), ["enter"]), n[3] ||= W((e) => t.$emit("close"), ["esc"])]
|
|
1261
|
-
}, null, 40,
|
|
1262
|
+
}, null, 40, $), [[B, s.value]])]), O("div", on, [U(O("input", {
|
|
1262
1263
|
class: "docx-hyperlink-popup__input",
|
|
1263
1264
|
placeholder: "https://...",
|
|
1264
1265
|
"onUpdate:modelValue": n[4] ||= (e) => c.value = e,
|
|
1265
1266
|
onKeydown: [W(G(h, ["prevent"]), ["enter"]), n[5] ||= W((e) => t.$emit("close"), ["esc"])]
|
|
1266
|
-
}, null, 40,
|
|
1267
|
+
}, null, 40, sn), [[B, c.value]]), O("button", {
|
|
1267
1268
|
class: "docx-hyperlink-popup__apply",
|
|
1268
1269
|
disabled: !c.value.trim(),
|
|
1269
1270
|
onClick: G(h, ["prevent"])
|
|
1270
|
-
}, R(z(r)("common.apply")), 9,
|
|
1271
|
+
}, R(z(r)("common.apply")), 9, cn)])], 64)) : (F(), D(C, { key: 0 }, [
|
|
1271
1272
|
n[10] ||= se("<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),
|
|
1272
1273
|
O("a", {
|
|
1273
1274
|
class: "docx-hyperlink-popup__url",
|
|
1274
1275
|
href: e.data.href,
|
|
1275
1276
|
title: e.data.href,
|
|
1276
1277
|
onClick: n[0] ||= G((n) => t.$emit("navigate", e.data.href), ["prevent"])
|
|
1277
|
-
}, R(e.data.href), 9,
|
|
1278
|
+
}, R(e.data.href), 9, en),
|
|
1278
1279
|
n[11] ||= O("span", { class: "docx-hyperlink-popup__sep" }, null, -1),
|
|
1279
1280
|
O("button", {
|
|
1280
1281
|
class: "docx-hyperlink-popup__btn",
|
|
@@ -1296,7 +1297,7 @@ var at = /* @__PURE__ */ A({
|
|
|
1296
1297
|
height: "13",
|
|
1297
1298
|
rx: "2",
|
|
1298
1299
|
ry: "2"
|
|
1299
|
-
}), O("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })], -1)]], 8,
|
|
1300
|
+
}), O("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })], -1)]], 8, tn),
|
|
1300
1301
|
e.readOnly ? E("", !0) : (F(), D("button", {
|
|
1301
1302
|
key: 0,
|
|
1302
1303
|
class: "docx-hyperlink-popup__btn",
|
|
@@ -1311,19 +1312,19 @@ var at = /* @__PURE__ */ A({
|
|
|
1311
1312
|
"stroke-width": "2",
|
|
1312
1313
|
"stroke-linecap": "round",
|
|
1313
1314
|
"stroke-linejoin": "round"
|
|
1314
|
-
}, [O("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }), O("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,
|
|
1315
|
+
}, [O("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }), O("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, nn)),
|
|
1315
1316
|
e.readOnly ? E("", !0) : (F(), D("button", {
|
|
1316
1317
|
key: 1,
|
|
1317
1318
|
class: "docx-hyperlink-popup__btn",
|
|
1318
1319
|
title: z(r)("hyperlinkPopup.removeLink"),
|
|
1319
1320
|
onClick: n[1] ||= G((e) => t.$emit("remove"), ["prevent"])
|
|
1320
|
-
}, [...n[9] ||= [se("<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,
|
|
1321
|
+
}, [...n[9] ||= [se("<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, rn))
|
|
1321
1322
|
], 64))], 38)) : E("", !0);
|
|
1322
1323
|
}
|
|
1323
1324
|
}), [["__scopeId", "data-v-9d23bb12"]]);
|
|
1324
1325
|
//#endregion
|
|
1325
1326
|
//#region src/composables/useFileIO.ts
|
|
1326
|
-
function
|
|
1327
|
+
function un(e) {
|
|
1327
1328
|
let t = I(null);
|
|
1328
1329
|
async function n() {
|
|
1329
1330
|
await e.nextTick(), e.extractCommentsAndChanges(), e.emit("ready");
|
|
@@ -1369,7 +1370,7 @@ function cn(e) {
|
|
|
1369
1370
|
}
|
|
1370
1371
|
//#endregion
|
|
1371
1372
|
//#region src/composables/useHyperlinkManagement.ts
|
|
1372
|
-
function
|
|
1373
|
+
function dn(e) {
|
|
1373
1374
|
let t = I(null);
|
|
1374
1375
|
function n(t) {
|
|
1375
1376
|
let n = e.editorView.value;
|
|
@@ -1431,7 +1432,7 @@ function ln(e) {
|
|
|
1431
1432
|
}
|
|
1432
1433
|
//#endregion
|
|
1433
1434
|
//#region src/composables/useFormattingActions.ts
|
|
1434
|
-
function
|
|
1435
|
+
function fn(e) {
|
|
1435
1436
|
function t() {
|
|
1436
1437
|
let t = e.editorView.value;
|
|
1437
1438
|
t && (pe(t.state, t.dispatch, t), t.focus());
|
|
@@ -1462,11 +1463,11 @@ function un(e) {
|
|
|
1462
1463
|
function a(t) {
|
|
1463
1464
|
let n = e.editorView.value;
|
|
1464
1465
|
if (!n) return !1;
|
|
1465
|
-
let r =
|
|
1466
|
+
let r = et(n.state.doc, t.paraId);
|
|
1466
1467
|
if (!r) return !1;
|
|
1467
1468
|
let i = r.from + 1, a = r.to - 1;
|
|
1468
1469
|
if (t.search) {
|
|
1469
|
-
let e =
|
|
1470
|
+
let e = rt(n.state.doc, r.from, r.to, t.search);
|
|
1470
1471
|
if (!e) return !1;
|
|
1471
1472
|
i = e.from, a = e.to;
|
|
1472
1473
|
}
|
|
@@ -1487,7 +1488,7 @@ function un(e) {
|
|
|
1487
1488
|
function o(t) {
|
|
1488
1489
|
let n = e.editorView.value;
|
|
1489
1490
|
if (!n) return !1;
|
|
1490
|
-
let r =
|
|
1491
|
+
let r = et(n.state.doc, t.paraId);
|
|
1491
1492
|
if (!r) return !1;
|
|
1492
1493
|
let i = e.getDocument(), a = i?.package?.styles ? Ve(i.package.styles) : null;
|
|
1493
1494
|
if (a && !a.hasParagraphStyle(t.styleId)) return !1;
|
|
@@ -1513,7 +1514,7 @@ function un(e) {
|
|
|
1513
1514
|
}
|
|
1514
1515
|
//#endregion
|
|
1515
1516
|
//#region src/composables/usePageSetupControls.ts
|
|
1516
|
-
function
|
|
1517
|
+
function pn(e) {
|
|
1517
1518
|
function t(t) {
|
|
1518
1519
|
let n = e.getDocument();
|
|
1519
1520
|
if (!n?.package?.document) return;
|
|
@@ -1568,7 +1569,7 @@ function dn(e) {
|
|
|
1568
1569
|
}
|
|
1569
1570
|
//#endregion
|
|
1570
1571
|
//#region src/composables/useOutlineSidebar.ts
|
|
1571
|
-
function
|
|
1572
|
+
function mn(e) {
|
|
1572
1573
|
function t() {
|
|
1573
1574
|
if (!e.showOutline.value) {
|
|
1574
1575
|
let t = e.editorView.value;
|
|
@@ -1598,7 +1599,7 @@ function fn(e) {
|
|
|
1598
1599
|
}
|
|
1599
1600
|
//#endregion
|
|
1600
1601
|
//#region src/composables/useKeyboardShortcuts.ts
|
|
1601
|
-
function
|
|
1602
|
+
function hn(e) {
|
|
1602
1603
|
function t(t) {
|
|
1603
1604
|
if (t.key === "F1") {
|
|
1604
1605
|
t.preventDefault(), e.showKeyboardShortcuts.value = !0;
|
|
@@ -1610,7 +1611,7 @@ function pn(e) {
|
|
|
1610
1611
|
}
|
|
1611
1612
|
//#endregion
|
|
1612
1613
|
//#region src/utils/commentFactories.ts
|
|
1613
|
-
function
|
|
1614
|
+
function gn(e, t, n, r) {
|
|
1614
1615
|
return {
|
|
1615
1616
|
id: e.reduce((e, t) => Math.max(e, t.id), 0) + 1,
|
|
1616
1617
|
author: n,
|
|
@@ -1632,9 +1633,9 @@ function mn(e, t, n, r) {
|
|
|
1632
1633
|
}
|
|
1633
1634
|
//#endregion
|
|
1634
1635
|
//#region src/composables/useCommentManagement.ts
|
|
1635
|
-
function
|
|
1636
|
+
function _n(e) {
|
|
1636
1637
|
function t(t, n, r) {
|
|
1637
|
-
return
|
|
1638
|
+
return gn(e.getDocument()?.package?.document?.comments ?? [], t, n, r);
|
|
1638
1639
|
}
|
|
1639
1640
|
function n(n) {
|
|
1640
1641
|
let r = e.getDocument(), i = e.editorView.value;
|
|
@@ -1642,11 +1643,11 @@ function hn(e) {
|
|
|
1642
1643
|
r.package.document.comments || (r.package.document.comments = []);
|
|
1643
1644
|
let a = i.state.schema.marks.comment;
|
|
1644
1645
|
if (!a) return null;
|
|
1645
|
-
let o =
|
|
1646
|
+
let o = et(i.state.doc, n.paraId);
|
|
1646
1647
|
if (!o) return null;
|
|
1647
1648
|
let s = o.from + 1, c = o.to - 1;
|
|
1648
1649
|
if (n.search) {
|
|
1649
|
-
let e =
|
|
1650
|
+
let e = rt(i.state.doc, o.from, o.to, n.search);
|
|
1650
1651
|
if (!e) return null;
|
|
1651
1652
|
s = e.from, c = e.to;
|
|
1652
1653
|
}
|
|
@@ -1671,14 +1672,14 @@ function hn(e) {
|
|
|
1671
1672
|
if (!n) return !1;
|
|
1672
1673
|
let { schema: r } = n.state;
|
|
1673
1674
|
if (!r.marks.deletion || !r.marks.insertion) return !1;
|
|
1674
|
-
let i =
|
|
1675
|
+
let i = et(n.state.doc, t.paraId);
|
|
1675
1676
|
if (!i) return !1;
|
|
1676
1677
|
let a = t.search === "", o = t.replaceWith === "";
|
|
1677
1678
|
if (a && o) return !1;
|
|
1678
1679
|
let s, c;
|
|
1679
1680
|
if (a) s = i.to - 1, c = i.to - 1;
|
|
1680
1681
|
else {
|
|
1681
|
-
let e =
|
|
1682
|
+
let e = rt(n.state.doc, i.from, i.to, t.search);
|
|
1682
1683
|
if (!e) return !1;
|
|
1683
1684
|
s = e.from, c = e.to;
|
|
1684
1685
|
}
|
|
@@ -1751,7 +1752,7 @@ function hn(e) {
|
|
|
1751
1752
|
}
|
|
1752
1753
|
//#endregion
|
|
1753
1754
|
//#region src/utils/domQueries.ts
|
|
1754
|
-
function
|
|
1755
|
+
function vn(e, t) {
|
|
1755
1756
|
let n = X(e);
|
|
1756
1757
|
for (let e of n) {
|
|
1757
1758
|
let n = Number(e.dataset.pmStart), r = Number(e.dataset.pmEnd);
|
|
@@ -1759,7 +1760,7 @@ function gn(e, t) {
|
|
|
1759
1760
|
}
|
|
1760
1761
|
return null;
|
|
1761
1762
|
}
|
|
1762
|
-
function
|
|
1763
|
+
function yn(e, t, n) {
|
|
1763
1764
|
if (!e || !t) return;
|
|
1764
1765
|
let r = null;
|
|
1765
1766
|
for (let t of X(e)) {
|
|
@@ -1776,21 +1777,21 @@ function _n(e, t, n) {
|
|
|
1776
1777
|
behavior: "smooth"
|
|
1777
1778
|
});
|
|
1778
1779
|
}
|
|
1779
|
-
function
|
|
1780
|
+
function bn(e, t, n, r) {
|
|
1780
1781
|
if (!e || !t) return null;
|
|
1781
1782
|
let i = Y(e, n, r, 1);
|
|
1782
1783
|
return i === null || i < 0 ? null : Math.min(i, t.state.doc.content.size);
|
|
1783
1784
|
}
|
|
1784
|
-
function
|
|
1785
|
+
function xn(e, t, n) {
|
|
1785
1786
|
if (!e) return;
|
|
1786
|
-
let r =
|
|
1787
|
+
let r = vn(e, t);
|
|
1787
1788
|
if (!r) return;
|
|
1788
1789
|
let i = r.textContent || "", a = Number(r.dataset.pmStart) || 0, [o, s] = he(i, t - a), c = a + o, l = a + s;
|
|
1789
1790
|
c < l && n(c, l);
|
|
1790
1791
|
}
|
|
1791
|
-
function
|
|
1792
|
+
function Sn(e, t, n) {
|
|
1792
1793
|
if (!e) return;
|
|
1793
|
-
let r =
|
|
1794
|
+
let r = vn(e, t);
|
|
1794
1795
|
if (!r) return;
|
|
1795
1796
|
let i = r.closest(".layout-paragraph");
|
|
1796
1797
|
if (!i) return;
|
|
@@ -1799,7 +1800,7 @@ function bn(e, t, n) {
|
|
|
1799
1800
|
}
|
|
1800
1801
|
//#endregion
|
|
1801
1802
|
//#region src/composables/useCommentLifecycle.ts
|
|
1802
|
-
function
|
|
1803
|
+
function Cn(e) {
|
|
1803
1804
|
let t = I(null), n = I(null), r = I(null), i = I(!1);
|
|
1804
1805
|
function a() {
|
|
1805
1806
|
let t = e.getDocument(), n = e.editorView.value;
|
|
@@ -1822,7 +1823,7 @@ function xn(e) {
|
|
|
1822
1823
|
t.value = null;
|
|
1823
1824
|
return;
|
|
1824
1825
|
}
|
|
1825
|
-
let s = o.getBoundingClientRect(), c =
|
|
1826
|
+
let s = o.getBoundingClientRect(), c = vn(a, r);
|
|
1826
1827
|
if (!c) {
|
|
1827
1828
|
t.value = null;
|
|
1828
1829
|
return;
|
|
@@ -1884,7 +1885,7 @@ function xn(e) {
|
|
|
1884
1885
|
let i = e.getDocument(), a = e.editorView.value;
|
|
1885
1886
|
if (!i?.package) return;
|
|
1886
1887
|
i.package.document.comments || (i.package.document.comments = []);
|
|
1887
|
-
let o =
|
|
1888
|
+
let o = gn(i.package.document.comments, t, "User");
|
|
1888
1889
|
i.package.document.comments.push(o), e.comments.value = [...i.package.document.comments];
|
|
1889
1890
|
let s = n.value;
|
|
1890
1891
|
if (a && s && s.from !== s.to) {
|
|
@@ -1933,7 +1934,7 @@ function xn(e) {
|
|
|
1933
1934
|
}
|
|
1934
1935
|
//#endregion
|
|
1935
1936
|
//#region src/composables/useImageActions.ts
|
|
1936
|
-
function
|
|
1937
|
+
function wn(e) {
|
|
1937
1938
|
let t = fe(null), n = I(!1), r = w(() => {
|
|
1938
1939
|
e.stateTick.value;
|
|
1939
1940
|
let n = e.editorView.value, r = t.value;
|
|
@@ -1992,10 +1993,10 @@ function Sn(e) {
|
|
|
1992
1993
|
}
|
|
1993
1994
|
//#endregion
|
|
1994
1995
|
//#region src/utils/imageClipboard.ts
|
|
1995
|
-
function
|
|
1996
|
+
function Tn(e, t) {
|
|
1996
1997
|
return e.getBlob(t);
|
|
1997
1998
|
}
|
|
1998
|
-
function
|
|
1999
|
+
function En(e, t) {
|
|
1999
2000
|
let n = e.state.doc.nodeAt(t);
|
|
2000
2001
|
if (!n || n.type.name !== "image") return;
|
|
2001
2002
|
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({
|
|
@@ -2007,13 +2008,13 @@ function wn(e, t) {
|
|
|
2007
2008
|
e.value = r, document.body.appendChild(e), e.select(), document.execCommand("copy"), document.body.removeChild(e);
|
|
2008
2009
|
});
|
|
2009
2010
|
}
|
|
2010
|
-
function
|
|
2011
|
+
function Dn(e) {
|
|
2011
2012
|
return new Promise((t, n) => {
|
|
2012
2013
|
let r = new FileReader();
|
|
2013
2014
|
r.onload = () => t(r.result), r.onerror = n, r.readAsDataURL(e);
|
|
2014
2015
|
});
|
|
2015
2016
|
}
|
|
2016
|
-
function
|
|
2017
|
+
function On(e) {
|
|
2017
2018
|
return new Promise((t) => {
|
|
2018
2019
|
let n = new Image();
|
|
2019
2020
|
n.onload = () => t({
|
|
@@ -2025,13 +2026,13 @@ function En(e) {
|
|
|
2025
2026
|
}), n.src = e;
|
|
2026
2027
|
});
|
|
2027
2028
|
}
|
|
2028
|
-
async function
|
|
2029
|
+
async function kn(e) {
|
|
2029
2030
|
try {
|
|
2030
2031
|
let t = await navigator.clipboard.read();
|
|
2031
2032
|
for (let n of t) {
|
|
2032
2033
|
let t = n.types.find((e) => e.startsWith("image/"));
|
|
2033
2034
|
if (t) {
|
|
2034
|
-
let r = await
|
|
2035
|
+
let r = await Dn(await Tn(n, t)), i = await On(r), a = i.width, o = i.height;
|
|
2035
2036
|
a > 612 && (o = Math.round(612 / a * o), a = 612);
|
|
2036
2037
|
let s = e.state.schema.nodes.image.create({
|
|
2037
2038
|
src: r,
|
|
@@ -2045,7 +2046,7 @@ async function Dn(e) {
|
|
|
2045
2046
|
return;
|
|
2046
2047
|
}
|
|
2047
2048
|
if (n.types.includes("text/html")) {
|
|
2048
|
-
let t = await (await
|
|
2049
|
+
let t = await (await Tn(n, "text/html")).text(), r = t.match(/<img[^>]+src="([^"]+)"[^>]*>/i);
|
|
2049
2050
|
if (r && r[1]) {
|
|
2050
2051
|
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({
|
|
2051
2052
|
src: n,
|
|
@@ -2060,7 +2061,7 @@ async function Dn(e) {
|
|
|
2060
2061
|
}
|
|
2061
2062
|
}
|
|
2062
2063
|
if (n.types.includes("text/plain")) {
|
|
2063
|
-
let t = await (await
|
|
2064
|
+
let t = await (await Tn(n, "text/plain")).text();
|
|
2064
2065
|
if (t && t !== "[image]") {
|
|
2065
2066
|
let { from: n } = e.state.selection;
|
|
2066
2067
|
e.dispatch(e.state.tr.insertText(t, n));
|
|
@@ -2076,14 +2077,14 @@ async function Dn(e) {
|
|
|
2076
2077
|
}
|
|
2077
2078
|
}
|
|
2078
2079
|
}
|
|
2079
|
-
function
|
|
2080
|
+
function An(e, t) {
|
|
2080
2081
|
let n = e.state.doc.nodeAt(t);
|
|
2081
2082
|
if (!n || n.type.name !== "image") return;
|
|
2082
2083
|
let r = document.createElement("input");
|
|
2083
2084
|
r.type = "file", r.accept = "image/*", r.onchange = async () => {
|
|
2084
2085
|
let i = r.files?.[0];
|
|
2085
2086
|
if (!i) return;
|
|
2086
|
-
let a = await
|
|
2087
|
+
let a = await Dn(i), o = await On(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);
|
|
2087
2088
|
try {
|
|
2088
2089
|
let r = e.state.tr.setNodeMarkup(t, void 0, {
|
|
2089
2090
|
...n.attrs,
|
|
@@ -2098,7 +2099,7 @@ function On(e, t) {
|
|
|
2098
2099
|
}
|
|
2099
2100
|
//#endregion
|
|
2100
2101
|
//#region src/composables/useContextMenus.ts
|
|
2101
|
-
function
|
|
2102
|
+
function jn(e) {
|
|
2102
2103
|
let { t } = n(), r = I({
|
|
2103
2104
|
isOpen: !1,
|
|
2104
2105
|
position: {
|
|
@@ -2219,16 +2220,16 @@ function kn(e) {
|
|
|
2219
2220
|
switch (t) {
|
|
2220
2221
|
case "cut":
|
|
2221
2222
|
if (e.selectedImage.value) {
|
|
2222
|
-
|
|
2223
|
+
En(n, e.selectedImage.value.pmPos);
|
|
2223
2224
|
let t = e.selectedImage.value.pmPos, r = n.state.doc.nodeAt(t);
|
|
2224
2225
|
r && (n.dispatch(n.state.tr.delete(t, t + r.nodeSize)), e.selectedImage.value = null);
|
|
2225
2226
|
} else document.execCommand("cut");
|
|
2226
2227
|
break;
|
|
2227
2228
|
case "copy":
|
|
2228
|
-
e.selectedImage.value ?
|
|
2229
|
+
e.selectedImage.value ? En(n, e.selectedImage.value.pmPos) : document.execCommand("copy");
|
|
2229
2230
|
break;
|
|
2230
2231
|
case "paste":
|
|
2231
|
-
|
|
2232
|
+
kn(n);
|
|
2232
2233
|
break;
|
|
2233
2234
|
case "pasteAsPlainText":
|
|
2234
2235
|
navigator.clipboard.readText().then((e) => {
|
|
@@ -2249,7 +2250,7 @@ function kn(e) {
|
|
|
2249
2250
|
e.selectedImage.value && (e.showImageProperties.value = !0);
|
|
2250
2251
|
break;
|
|
2251
2252
|
case "replaceImage":
|
|
2252
|
-
e.selectedImage.value &&
|
|
2253
|
+
e.selectedImage.value && An(n, e.selectedImage.value.pmPos);
|
|
2253
2254
|
break;
|
|
2254
2255
|
case "deleteImage":
|
|
2255
2256
|
if (e.selectedImage.value) {
|
|
@@ -2284,8 +2285,8 @@ function kn(e) {
|
|
|
2284
2285
|
}
|
|
2285
2286
|
//#endregion
|
|
2286
2287
|
//#region src/composables/usePagesPointer.ts
|
|
2287
|
-
var
|
|
2288
|
-
function
|
|
2288
|
+
var Mn = 500;
|
|
2289
|
+
function Nn(e) {
|
|
2289
2290
|
let t = I(null), n = null;
|
|
2290
2291
|
function r() {
|
|
2291
2292
|
n !== null && (clearTimeout(n), n = null);
|
|
@@ -2296,7 +2297,7 @@ function jn(e) {
|
|
|
2296
2297
|
visible: !1
|
|
2297
2298
|
}), d = null;
|
|
2298
2299
|
function f(t, n) {
|
|
2299
|
-
return
|
|
2300
|
+
return bn(e.pagesRef.value, e.editorView.value, t, n);
|
|
2300
2301
|
}
|
|
2301
2302
|
function p(t, n) {
|
|
2302
2303
|
let r = e.editorView.value;
|
|
@@ -2305,13 +2306,13 @@ function jn(e) {
|
|
|
2305
2306
|
r.dispatch(r.state.tr.setSelection(o));
|
|
2306
2307
|
}
|
|
2307
2308
|
function m(t) {
|
|
2308
|
-
|
|
2309
|
+
yn(e.pagesRef.value, e.pagesViewportRef.value, t);
|
|
2309
2310
|
}
|
|
2310
2311
|
function h(t) {
|
|
2311
|
-
|
|
2312
|
+
xn(e.pagesRef.value, t, p);
|
|
2312
2313
|
}
|
|
2313
2314
|
function g(t) {
|
|
2314
|
-
|
|
2315
|
+
Sn(e.pagesRef.value, t, p);
|
|
2315
2316
|
}
|
|
2316
2317
|
function _(t) {
|
|
2317
2318
|
let n = e.editorView.value;
|
|
@@ -2454,7 +2455,7 @@ function jn(e) {
|
|
|
2454
2455
|
return;
|
|
2455
2456
|
}
|
|
2456
2457
|
let d = Date.now();
|
|
2457
|
-
if (d - a <
|
|
2458
|
+
if (d - a < Mn && o === u ? s++ : s = 1, a = d, o = u, s === 2) h(u);
|
|
2458
2459
|
else if (s >= 3) g(u), s = 0;
|
|
2459
2460
|
else {
|
|
2460
2461
|
if (t.shiftKey) {
|
|
@@ -2520,7 +2521,7 @@ function jn(e) {
|
|
|
2520
2521
|
}
|
|
2521
2522
|
//#endregion
|
|
2522
2523
|
//#region src/composables/useSelectionSync.ts
|
|
2523
|
-
function
|
|
2524
|
+
function Pn(e) {
|
|
2524
2525
|
let t = null, n = null;
|
|
2525
2526
|
function r() {
|
|
2526
2527
|
let r = e.pagesRef.value;
|
|
@@ -2598,7 +2599,7 @@ function Mn(e) {
|
|
|
2598
2599
|
}
|
|
2599
2600
|
//#endregion
|
|
2600
2601
|
//#region src/composables/useMenuActions.ts
|
|
2601
|
-
function
|
|
2602
|
+
function Fn(e) {
|
|
2602
2603
|
function t(t) {
|
|
2603
2604
|
let n = e.editorView.value;
|
|
2604
2605
|
if (!n) return;
|
|
@@ -2668,7 +2669,7 @@ function Nn(e) {
|
|
|
2668
2669
|
}
|
|
2669
2670
|
//#endregion
|
|
2670
2671
|
//#region src/composables/useDocumentLifecycle.ts
|
|
2671
|
-
function
|
|
2672
|
+
function In(e) {
|
|
2672
2673
|
async function t(t) {
|
|
2673
2674
|
e.sidebarAutoOpenedRef.value = !1, await e.loadDocumentBuffer(t);
|
|
2674
2675
|
}
|
|
@@ -2687,7 +2688,7 @@ function Pn(e) {
|
|
|
2687
2688
|
}
|
|
2688
2689
|
//#endregion
|
|
2689
2690
|
//#region src/composables/useDocxEditorRefApi.ts
|
|
2690
|
-
function
|
|
2691
|
+
function Ln(e) {
|
|
2691
2692
|
function t() {
|
|
2692
2693
|
e.onPrint?.(), window.print();
|
|
2693
2694
|
}
|
|
@@ -2729,20 +2730,20 @@ function Fn(e) {
|
|
|
2729
2730
|
function l(t) {
|
|
2730
2731
|
let n = e.editorView.value;
|
|
2731
2732
|
if (!n) return !1;
|
|
2732
|
-
let r =
|
|
2733
|
+
let r = et(n.state.doc, t);
|
|
2733
2734
|
return r ? (e.scrollVisiblePositionIntoView(r.from + 1), !0) : !1;
|
|
2734
2735
|
}
|
|
2735
2736
|
function u(t, n) {
|
|
2736
|
-
return
|
|
2737
|
+
return it(e.editorView.value, t, n);
|
|
2737
2738
|
}
|
|
2738
2739
|
function d() {
|
|
2739
|
-
return
|
|
2740
|
+
return at(e.editorView.value);
|
|
2740
2741
|
}
|
|
2741
2742
|
function f() {
|
|
2742
2743
|
return e.comments.value;
|
|
2743
2744
|
}
|
|
2744
2745
|
function p(t) {
|
|
2745
|
-
return
|
|
2746
|
+
return ot(e.editorView.value, e.layout.value, t);
|
|
2746
2747
|
}
|
|
2747
2748
|
function m(t) {
|
|
2748
2749
|
return e.contentChangeSubscribers.add(t), () => e.contentChangeSubscribers.delete(t);
|
|
@@ -2784,16 +2785,16 @@ function Fn(e) {
|
|
|
2784
2785
|
}
|
|
2785
2786
|
//#endregion
|
|
2786
2787
|
//#region src/components/DocxEditor.vue?vue&type=script&setup=true&lang.ts
|
|
2787
|
-
var
|
|
2788
|
+
var Rn = { class: "docx-editor-vue__toolbar-shell" }, zn = {
|
|
2788
2789
|
key: 0,
|
|
2789
2790
|
class: "docx-editor-vue__error"
|
|
2790
|
-
},
|
|
2791
|
+
}, Bn = {
|
|
2791
2792
|
key: 1,
|
|
2792
2793
|
class: "docx-editor-vue__loading"
|
|
2793
|
-
},
|
|
2794
|
+
}, Vn = { class: "docx-editor-vue__editor-area" }, Hn = {
|
|
2794
2795
|
key: 0,
|
|
2795
2796
|
class: "docx-editor-vue__vertical-ruler"
|
|
2796
|
-
},
|
|
2797
|
+
}, Un = ["title"], Wn = ["title", "aria-label"], Gn = /* @__PURE__ */ A({
|
|
2797
2798
|
__name: "DocxEditor",
|
|
2798
2799
|
props: {
|
|
2799
2800
|
documentBuffer: { default: null },
|
|
@@ -2900,7 +2901,7 @@ var In = { class: "docx-editor-vue__toolbar-shell" }, Ln = {
|
|
|
2900
2901
|
onError: (e) => a("error", e),
|
|
2901
2902
|
onSelectionUpdate: () => {
|
|
2902
2903
|
v.value++, er();
|
|
2903
|
-
let e =
|
|
2904
|
+
let e = at(J.value);
|
|
2904
2905
|
x.forEach((t) => t(e));
|
|
2905
2906
|
}
|
|
2906
2907
|
}), Z = w(() => {
|
|
@@ -2944,7 +2945,7 @@ var In = { class: "docx-editor-vue__toolbar-shell" }, Ln = {
|
|
|
2944
2945
|
}
|
|
2945
2946
|
return !0;
|
|
2946
2947
|
}), n.sort((e, t) => e.name.localeCompare(t.name));
|
|
2947
|
-
}), { floatingCommentBtn: Ue, pendingCommentRange: We, addCommentYPosition: Ge, sidebarAutoOpenedRef: Ke, extractCommentsAndChanges: qe, handleAddComment: Je, handleCancelAddComment: Ye, handleStartAddComment: Xe, handleMarkerClick: Qe } =
|
|
2948
|
+
}), { floatingCommentBtn: Ue, pendingCommentRange: We, addCommentYPosition: Ge, sidebarAutoOpenedRef: Ke, extractCommentsAndChanges: qe, handleAddComment: Je, handleCancelAddComment: Ye, handleStartAddComment: Xe, handleMarkerClick: Qe } = Cn({
|
|
2948
2949
|
editorView: J,
|
|
2949
2950
|
getDocument: Y,
|
|
2950
2951
|
comments: K,
|
|
@@ -2959,7 +2960,7 @@ var In = { class: "docx-editor-vue__toolbar-shell" }, Ln = {
|
|
|
2959
2960
|
pagesRef: d,
|
|
2960
2961
|
pagesViewportRef: g,
|
|
2961
2962
|
emit: a
|
|
2962
|
-
}), { docxInputRef: $e, handleDocxFileChange: et, handleDocumentNameChange: tt, downloadCurrentDocument: nt, emitReadyAfterSidebarStateRefresh:
|
|
2963
|
+
}), { docxInputRef: $e, handleDocxFileChange: et, handleDocumentNameChange: tt, downloadCurrentDocument: nt, emitReadyAfterSidebarStateRefresh: rt, loadDocumentBuffer: it, loadDocument: ot, save: ct } = un({
|
|
2963
2964
|
loadBuffer: Ae,
|
|
2964
2965
|
loadParsedDocument: je,
|
|
2965
2966
|
getDocument: Y,
|
|
@@ -2969,20 +2970,20 @@ var In = { class: "docx-editor-vue__toolbar-shell" }, Ln = {
|
|
|
2969
2970
|
documentName: () => i.documentName,
|
|
2970
2971
|
onDocumentNameChange: i.onDocumentNameChange,
|
|
2971
2972
|
nextTick: j
|
|
2972
|
-
}), { hyperlinkPopupData: lt, handleHyperlinkSubmit: ut, handleHyperlinkRemove: dt, handleHyperlinkPopupNavigate:
|
|
2973
|
+
}), { hyperlinkPopupData: lt, handleHyperlinkSubmit: ut, handleHyperlinkRemove: dt, handleHyperlinkPopupNavigate: ft, handleHyperlinkPopupEdit: pt, handleHyperlinkPopupRemove: ht } = dn({
|
|
2973
2974
|
editorView: J,
|
|
2974
2975
|
getCommands: X
|
|
2975
|
-
}), { handleClearFormatting: gt, handleApplyStyle:
|
|
2976
|
+
}), { handleClearFormatting: gt, handleApplyStyle: _t, handleInsertPageBreak: vt, handleInsertSymbol: xt, applyFormatting: St, setParagraphStyle: Ct } = fn({
|
|
2976
2977
|
editorView: J,
|
|
2977
2978
|
getDocument: Y
|
|
2978
|
-
}), { handlePageSetupApply: Tt, handleLeftMarginChange: Et, handleRightMarginChange:
|
|
2979
|
+
}), { handlePageSetupApply: Tt, handleLeftMarginChange: Et, handleRightMarginChange: Dt, handleTopMarginChange: Ot, handleBottomMarginChange: jt, handleIndentLeftChange: Mt, handleIndentRightChange: Nt, handleFirstLineIndentChange: Pt, handleTabStopRemove: Ft } = pn({
|
|
2979
2980
|
editorView: J,
|
|
2980
2981
|
getDocument: Y,
|
|
2981
2982
|
readOnly: s,
|
|
2982
2983
|
stateTick: v,
|
|
2983
2984
|
reLayout: Ie,
|
|
2984
2985
|
emit: a
|
|
2985
|
-
}), { handleToggleOutline: It, handleOutlineNavigate: Lt, handleToggleSidebar: Rt, handleEditorScrollMouseDown: zt } =
|
|
2986
|
+
}), { handleToggleOutline: It, handleOutlineNavigate: Lt, handleToggleSidebar: Rt, handleEditorScrollMouseDown: zt } = mn({
|
|
2986
2987
|
editorView: J,
|
|
2987
2988
|
showOutline: L,
|
|
2988
2989
|
showSidebar: U,
|
|
@@ -2990,14 +2991,14 @@ var In = { class: "docx-editor-vue__toolbar-shell" }, Ln = {
|
|
|
2990
2991
|
activeSidebarItem: pe,
|
|
2991
2992
|
extractCommentsAndChanges: qe
|
|
2992
2993
|
});
|
|
2993
|
-
|
|
2994
|
+
hn({
|
|
2994
2995
|
showKeyboardShortcuts: B,
|
|
2995
2996
|
showFindReplace: C,
|
|
2996
2997
|
showHyperlink: ae,
|
|
2997
2998
|
handleZoomKeyDown: we,
|
|
2998
2999
|
disableFindReplaceShortcuts: () => i.disableFindReplaceShortcuts
|
|
2999
3000
|
});
|
|
3000
|
-
let { addComment: Bt, replyToComment: Vt, resolveComment: Ht, proposeChange: Ut, handleCommentReply: Wt, handleCommentUnresolve: Gt, handleCommentDelete: Kt, handleAcceptChange: qt, handleRejectChange: Jt, handleTrackedChangeReply: Yt } =
|
|
3001
|
+
let { addComment: Bt, replyToComment: Vt, resolveComment: Ht, proposeChange: Ut, handleCommentReply: Wt, handleCommentUnresolve: Gt, handleCommentDelete: Kt, handleAcceptChange: qt, handleRejectChange: Jt, handleTrackedChangeReply: Yt } = _n({
|
|
3001
3002
|
editorView: J,
|
|
3002
3003
|
getDocument: Y,
|
|
3003
3004
|
comments: K,
|
|
@@ -3008,12 +3009,12 @@ var In = { class: "docx-editor-vue__toolbar-shell" }, Ln = {
|
|
|
3008
3009
|
contentChangeSubscribers: b,
|
|
3009
3010
|
extractCommentsAndChanges: qe,
|
|
3010
3011
|
emit: a
|
|
3011
|
-
}), { selectedImage: Q, imageInteracting: Xt, imageToolbarContext:
|
|
3012
|
+
}), { selectedImage: Q, imageInteracting: Xt, imageToolbarContext: Zt, handleInsertImage: Qt, handleToolbarImageWrap: en, handleImageTransform: tn } = wn({
|
|
3012
3013
|
editorView: J,
|
|
3013
3014
|
zoom: q,
|
|
3014
3015
|
stateTick: v,
|
|
3015
3016
|
getCommands: X
|
|
3016
|
-
}), nn = S(), rn = null, { tableInsertButton: an, hfEdit: $, scrollPageInfo: on, resolvePos:
|
|
3017
|
+
}), nn = S(), rn = null, { tableInsertButton: an, hfEdit: $, scrollPageInfo: on, resolvePos: sn, setPmSelection: cn, scrollVisiblePositionIntoView: gn, handlePagesMouseDown: vn, handlePagesMouseMove: yn, handlePagesClick: bn, handlePagesDoubleClick: xn, handleTableInsertClick: Sn, clearTableInsertTimer: Tn, handleHfSave: En, handleHfRemove: Dn } = Nn({
|
|
3017
3018
|
editorView: J,
|
|
3018
3019
|
pagesRef: d,
|
|
3019
3020
|
pagesViewportRef: g,
|
|
@@ -3029,16 +3030,16 @@ var In = { class: "docx-editor-vue__toolbar-shell" }, Ln = {
|
|
|
3029
3030
|
reLayout: Ie,
|
|
3030
3031
|
emit: a,
|
|
3031
3032
|
clearOverlay: $n
|
|
3032
|
-
}), { contextMenu: On, imageContextMenu:
|
|
3033
|
+
}), { contextMenu: On, imageContextMenu: kn, imageContextMenuTextActions: An, handleContextMenu: Mn, handleSelectedImageContextMenu: Gn, handleImageWrapSelect: Kn, handleContextMenuAction: qn } = jn({
|
|
3033
3034
|
editorView: J,
|
|
3034
3035
|
selectedImage: Q,
|
|
3035
3036
|
zoom: q,
|
|
3036
3037
|
showImageProperties: A,
|
|
3037
3038
|
getCommands: X,
|
|
3038
3039
|
clearOverlay: $n,
|
|
3039
|
-
setPmSelection:
|
|
3040
|
-
resolvePos:
|
|
3041
|
-
}), { handleMenuAction: Jn, handleMenuTableInsert: Yn } =
|
|
3040
|
+
setPmSelection: cn,
|
|
3041
|
+
resolvePos: sn
|
|
3042
|
+
}), { handleMenuAction: Jn, handleMenuTableInsert: Yn } = Fn({
|
|
3042
3043
|
editorView: J,
|
|
3043
3044
|
getCommands: X,
|
|
3044
3045
|
docxInputRef: $e,
|
|
@@ -3048,17 +3049,17 @@ var In = { class: "docx-editor-vue__toolbar-shell" }, Ln = {
|
|
|
3048
3049
|
showInsertSymbol: se,
|
|
3049
3050
|
showKeyboardShortcuts: B,
|
|
3050
3051
|
handleClearFormatting: gt,
|
|
3051
|
-
handleInsertPageBreak:
|
|
3052
|
+
handleInsertPageBreak: vt,
|
|
3052
3053
|
handleToggleOutline: It,
|
|
3053
3054
|
handleToggleSidebar: Rt,
|
|
3054
3055
|
downloadCurrentDocument: nt,
|
|
3055
3056
|
emit: a
|
|
3056
3057
|
});
|
|
3057
|
-
|
|
3058
|
+
In({
|
|
3058
3059
|
documentBuffer: () => i.documentBuffer,
|
|
3059
3060
|
document: () => i.document,
|
|
3060
|
-
loadDocumentBuffer:
|
|
3061
|
-
loadDocument:
|
|
3061
|
+
loadDocumentBuffer: it,
|
|
3062
|
+
loadDocument: ot,
|
|
3062
3063
|
sidebarAutoOpenedRef: Ke
|
|
3063
3064
|
});
|
|
3064
3065
|
let Xn = () => J.value, Zn = () => d.value;
|
|
@@ -3081,7 +3082,7 @@ var In = { class: "docx-editor-vue__toolbar-shell" }, Ln = {
|
|
|
3081
3082
|
function er() {
|
|
3082
3083
|
tr.updateSelectionOverlay();
|
|
3083
3084
|
}
|
|
3084
|
-
let tr =
|
|
3085
|
+
let tr = Pn({
|
|
3085
3086
|
editorView: J,
|
|
3086
3087
|
pagesRef: d,
|
|
3087
3088
|
selectedImage: Q
|
|
@@ -3089,7 +3090,7 @@ var In = { class: "docx-editor-vue__toolbar-shell" }, Ln = {
|
|
|
3089
3090
|
N(() => {
|
|
3090
3091
|
$n();
|
|
3091
3092
|
});
|
|
3092
|
-
let { exposed: nr } =
|
|
3093
|
+
let { exposed: nr } = Ln({
|
|
3093
3094
|
editorView: J,
|
|
3094
3095
|
layout: ke,
|
|
3095
3096
|
pagesRef: d,
|
|
@@ -3101,15 +3102,15 @@ var In = { class: "docx-editor-vue__toolbar-shell" }, Ln = {
|
|
|
3101
3102
|
getDocument: Y,
|
|
3102
3103
|
setZoom: be,
|
|
3103
3104
|
save: ct,
|
|
3104
|
-
loadDocument:
|
|
3105
|
-
loadDocumentBuffer:
|
|
3105
|
+
loadDocument: ot,
|
|
3106
|
+
loadDocumentBuffer: it,
|
|
3106
3107
|
addComment: Bt,
|
|
3107
3108
|
replyToComment: Vt,
|
|
3108
3109
|
resolveComment: Ht,
|
|
3109
3110
|
proposeChange: Ut,
|
|
3110
|
-
applyFormatting:
|
|
3111
|
-
setParagraphStyle:
|
|
3112
|
-
scrollVisiblePositionIntoView:
|
|
3111
|
+
applyFormatting: St,
|
|
3112
|
+
setParagraphStyle: Ct,
|
|
3113
|
+
scrollVisiblePositionIntoView: gn,
|
|
3113
3114
|
contentChangeSubscribers: b,
|
|
3114
3115
|
selectionChangeSubscribers: x,
|
|
3115
3116
|
onPrint: i.onPrint
|
|
@@ -3127,7 +3128,7 @@ var In = { class: "docx-editor-vue__toolbar-shell" }, Ln = {
|
|
|
3127
3128
|
]),
|
|
3128
3129
|
style: M(e.style)
|
|
3129
3130
|
}, [
|
|
3130
|
-
O("div",
|
|
3131
|
+
O("div", Rn, [k(kt, {
|
|
3131
3132
|
"show-menu-bar": e.showMenuBar,
|
|
3132
3133
|
"document-name": e.documentName,
|
|
3133
3134
|
"document-name-editable": e.documentNameEditable,
|
|
@@ -3161,11 +3162,11 @@ var In = { class: "docx-editor-vue__toolbar-shell" }, Ln = {
|
|
|
3161
3162
|
"show-zoom-control": e.showZoomControl,
|
|
3162
3163
|
"editor-mode": o.value,
|
|
3163
3164
|
"comments-sidebar-open": U.value,
|
|
3164
|
-
"image-context": z(
|
|
3165
|
+
"image-context": z(Zt),
|
|
3165
3166
|
theme: Le.value,
|
|
3166
3167
|
"font-families": e.fontFamilies,
|
|
3167
3168
|
onInsertLink: n[0] ||= (e) => ae.value = !0,
|
|
3168
|
-
onApplyStyle: z(
|
|
3169
|
+
onApplyStyle: z(_t),
|
|
3169
3170
|
onZoomIn: z(xe),
|
|
3170
3171
|
onZoomOut: z(Se),
|
|
3171
3172
|
onZoomSet: z(be),
|
|
@@ -3217,7 +3218,7 @@ var In = { class: "docx-editor-vue__toolbar-shell" }, Ln = {
|
|
|
3217
3218
|
"onImageWrapType",
|
|
3218
3219
|
"onImageTransform"
|
|
3219
3220
|
])) : E("", !0)]),
|
|
3220
|
-
k(
|
|
3221
|
+
k(At, {
|
|
3221
3222
|
"show-find-replace": C.value,
|
|
3222
3223
|
"onUpdate:showFindReplace": n[2] ||= (e) => C.value = e,
|
|
3223
3224
|
"show-insert-image": ie.value,
|
|
@@ -3236,7 +3237,7 @@ var In = { class: "docx-editor-vue__toolbar-shell" }, Ln = {
|
|
|
3236
3237
|
bookmarks: He.value,
|
|
3237
3238
|
"selected-image-pm-pos": z(Q)?.pmPos ?? null,
|
|
3238
3239
|
"section-properties": Z.value,
|
|
3239
|
-
onInsertImage: z(
|
|
3240
|
+
onInsertImage: z(Qt),
|
|
3240
3241
|
onInsertSymbol: z(xt),
|
|
3241
3242
|
onHyperlinkSubmit: z(ut),
|
|
3242
3243
|
onHyperlinkRemove: z(dt),
|
|
@@ -3259,8 +3260,8 @@ var In = { class: "docx-editor-vue__toolbar-shell" }, Ln = {
|
|
|
3259
3260
|
"onHyperlinkRemove",
|
|
3260
3261
|
"onPageSetupApply"
|
|
3261
3262
|
]),
|
|
3262
|
-
z(Oe) ? (F(), D("div",
|
|
3263
|
-
!z(De) && !z(Oe) ? (F(), D("div",
|
|
3263
|
+
z(Oe) ? (F(), D("div", zn, R(z(Oe)), 1)) : E("", !0),
|
|
3264
|
+
!z(De) && !z(Oe) ? (F(), D("div", Bn, "Loading...")) : E("", !0),
|
|
3264
3265
|
O("div", {
|
|
3265
3266
|
ref_key: "hiddenPmRef",
|
|
3266
3267
|
ref: u,
|
|
@@ -3278,7 +3279,7 @@ var In = { class: "docx-editor-vue__toolbar-shell" }, Ln = {
|
|
|
3278
3279
|
zoom: z(q),
|
|
3279
3280
|
editable: !s.value,
|
|
3280
3281
|
onLeftMarginChange: z(Et),
|
|
3281
|
-
onRightMarginChange: z(
|
|
3282
|
+
onRightMarginChange: z(Dt),
|
|
3282
3283
|
onIndentLeftChange: z(Mt),
|
|
3283
3284
|
onIndentRightChange: z(Nt),
|
|
3284
3285
|
onFirstLineIndentChange: z(Pt),
|
|
@@ -3293,7 +3294,7 @@ var In = { class: "docx-editor-vue__toolbar-shell" }, Ln = {
|
|
|
3293
3294
|
"onIndentRightChange",
|
|
3294
3295
|
"onFirstLineIndentChange",
|
|
3295
3296
|
"onTabStopRemove"
|
|
3296
|
-
])], 4)) : E("", !0), O("div",
|
|
3297
|
+
])], 4)) : E("", !0), O("div", Vn, [
|
|
3297
3298
|
O("div", {
|
|
3298
3299
|
ref_key: "pagesViewportRef",
|
|
3299
3300
|
ref: g,
|
|
@@ -3301,15 +3302,15 @@ var In = { class: "docx-editor-vue__toolbar-shell" }, Ln = {
|
|
|
3301
3302
|
onMousedown: n[22] ||= (...e) => z(vn) && z(vn)(...e),
|
|
3302
3303
|
onMousemove: n[23] ||= (...e) => z(yn) && z(yn)(...e),
|
|
3303
3304
|
onClick: n[24] ||= (...e) => z(bn) && z(bn)(...e),
|
|
3304
|
-
onDblclick: n[25] ||= (...e) => z(
|
|
3305
|
-
onContextmenu: n[26] ||= G((...e) => z(
|
|
3305
|
+
onDblclick: n[25] ||= (...e) => z(xn) && z(xn)(...e),
|
|
3306
|
+
onContextmenu: n[26] ||= G((...e) => z(Mn) && z(Mn)(...e), ["prevent"]),
|
|
3306
3307
|
onWheel: n[27] ||= (...e) => z(Ce) && z(Ce)(...e)
|
|
3307
3308
|
}, [
|
|
3308
|
-
e.showRuler && Z.value ? (F(), D("div",
|
|
3309
|
+
e.showRuler && Z.value ? (F(), D("div", Hn, [k(p, {
|
|
3309
3310
|
"section-props": Z.value,
|
|
3310
3311
|
zoom: z(q),
|
|
3311
3312
|
editable: !s.value,
|
|
3312
|
-
onTopMarginChange: z(
|
|
3313
|
+
onTopMarginChange: z(Ot),
|
|
3313
3314
|
onBottomMarginChange: z(jt)
|
|
3314
3315
|
}, null, 8, [
|
|
3315
3316
|
"section-props",
|
|
@@ -3324,7 +3325,7 @@ var In = { class: "docx-editor-vue__toolbar-shell" }, Ln = {
|
|
|
3324
3325
|
class: "docx-editor-vue__pages paged-editor__pages",
|
|
3325
3326
|
style: M(Re.value)
|
|
3326
3327
|
}, null, 4),
|
|
3327
|
-
k(
|
|
3328
|
+
k(wt, {
|
|
3328
3329
|
"is-open": z($) !== null,
|
|
3329
3330
|
position: z($)?.position ?? "header",
|
|
3330
3331
|
"header-footer": z($)?.headerFooter ?? null,
|
|
@@ -3344,7 +3345,7 @@ var In = { class: "docx-editor-vue__toolbar-shell" }, Ln = {
|
|
|
3344
3345
|
"onSave",
|
|
3345
3346
|
"onRemove"
|
|
3346
3347
|
]),
|
|
3347
|
-
k(
|
|
3348
|
+
k(mt, {
|
|
3348
3349
|
"image-info": z(Q),
|
|
3349
3350
|
zoom: z(q),
|
|
3350
3351
|
view: z(J),
|
|
@@ -3359,7 +3360,7 @@ var In = { class: "docx-editor-vue__toolbar-shell" }, Ln = {
|
|
|
3359
3360
|
"view",
|
|
3360
3361
|
"onContextMenu"
|
|
3361
3362
|
]),
|
|
3362
|
-
k(
|
|
3363
|
+
k(st, {
|
|
3363
3364
|
"get-view": Xn,
|
|
3364
3365
|
"get-pages-container": Zn,
|
|
3365
3366
|
zoom: z(q),
|
|
@@ -3383,7 +3384,7 @@ var In = { class: "docx-editor-vue__toolbar-shell" }, Ln = {
|
|
|
3383
3384
|
}, [k(c, {
|
|
3384
3385
|
name: "add_comment",
|
|
3385
3386
|
size: 16
|
|
3386
|
-
})], 44,
|
|
3387
|
+
})], 44, Un)) : E("", !0),
|
|
3387
3388
|
z(an) && !s.value ? (F(), D("button", {
|
|
3388
3389
|
key: 2,
|
|
3389
3390
|
type: "button",
|
|
@@ -3394,7 +3395,7 @@ var In = { class: "docx-editor-vue__toolbar-shell" }, Ln = {
|
|
|
3394
3395
|
}),
|
|
3395
3396
|
title: z(an).type === "row" ? "Insert row below" : "Insert column to the right",
|
|
3396
3397
|
"aria-label": z(an).type === "row" ? "Insert row below" : "Insert column to the right",
|
|
3397
|
-
onMousedown: n[15] ||= (...e) => z(
|
|
3398
|
+
onMousedown: n[15] ||= (...e) => z(Sn) && z(Sn)(...e),
|
|
3398
3399
|
onMouseenter: n[16] ||= (...e) => z(Tn) && z(Tn)(...e),
|
|
3399
3400
|
onMouseleave: n[17] ||= (e) => an.value = null
|
|
3400
3401
|
}, [...n[36] ||= [O("svg", {
|
|
@@ -3407,7 +3408,7 @@ var In = { class: "docx-editor-vue__toolbar-shell" }, Ln = {
|
|
|
3407
3408
|
stroke: "currentColor",
|
|
3408
3409
|
"stroke-width": "1.5",
|
|
3409
3410
|
"stroke-linecap": "round"
|
|
3410
|
-
})], -1)]], 44,
|
|
3411
|
+
})], -1)]], 44, Wn)) : E("", !0),
|
|
3411
3412
|
k(ee, {
|
|
3412
3413
|
comments: K.value,
|
|
3413
3414
|
"pages-container": d.value,
|
|
@@ -3467,12 +3468,12 @@ var In = { class: "docx-editor-vue__toolbar-shell" }, Ln = {
|
|
|
3467
3468
|
"onRejectChange",
|
|
3468
3469
|
"onTrackedChangeReply"
|
|
3469
3470
|
]),
|
|
3470
|
-
k(
|
|
3471
|
+
k(ln, {
|
|
3471
3472
|
data: z(lt),
|
|
3472
3473
|
"read-only": s.value,
|
|
3473
|
-
onNavigate: z(
|
|
3474
|
+
onNavigate: z(ft),
|
|
3474
3475
|
onCopy: n[20] ||= (e) => lt.value = null,
|
|
3475
|
-
onEdit: z(
|
|
3476
|
+
onEdit: z(pt),
|
|
3476
3477
|
onRemove: z(ht),
|
|
3477
3478
|
onClose: n[21] ||= (e) => lt.value = null
|
|
3478
3479
|
}, null, 8, [
|
|
@@ -3494,7 +3495,7 @@ var In = { class: "docx-editor-vue__toolbar-shell" }, Ln = {
|
|
|
3494
3495
|
name: "format_list_bulleted",
|
|
3495
3496
|
size: 20
|
|
3496
3497
|
})], 32)) : E("", !0),
|
|
3497
|
-
z(on).totalPages > 1 ? (F(), T(
|
|
3498
|
+
z(on).totalPages > 1 ? (F(), T(bt, {
|
|
3498
3499
|
key: 1,
|
|
3499
3500
|
"current-page": z(on).currentPage,
|
|
3500
3501
|
"total-pages": z(on).totalPages,
|
|
@@ -3504,7 +3505,7 @@ var In = { class: "docx-editor-vue__toolbar-shell" }, Ln = {
|
|
|
3504
3505
|
"total-pages",
|
|
3505
3506
|
"visible"
|
|
3506
3507
|
])) : E("", !0),
|
|
3507
|
-
k(
|
|
3508
|
+
k(yt, {
|
|
3508
3509
|
"is-open": L.value,
|
|
3509
3510
|
headings: ge.value,
|
|
3510
3511
|
onClose: n[30] ||= (e) => L.value = !1,
|
|
@@ -3523,16 +3524,16 @@ var In = { class: "docx-editor-vue__toolbar-shell" }, Ln = {
|
|
|
3523
3524
|
style: { display: "none" },
|
|
3524
3525
|
onChange: n[32] ||= (...e) => z(et) && z(et)(...e)
|
|
3525
3526
|
}, null, 544),
|
|
3526
|
-
k(
|
|
3527
|
+
k($t, {
|
|
3527
3528
|
"read-only": s.value,
|
|
3528
3529
|
"context-menu": z(On),
|
|
3529
|
-
"image-context-menu": z(
|
|
3530
|
-
"image-context-menu-text-actions": z(
|
|
3530
|
+
"image-context-menu": z(kn),
|
|
3531
|
+
"image-context-menu-text-actions": z(An),
|
|
3531
3532
|
"can-open-image-properties": !!z(Q),
|
|
3532
3533
|
onContextMenuAction: z(qn),
|
|
3533
3534
|
onCloseContextMenu: n[33] ||= (e) => z(On).isOpen = !1,
|
|
3534
3535
|
onImageWrapSelect: z(Kn),
|
|
3535
|
-
onCloseImageContextMenu: n[34] ||= (e) =>
|
|
3536
|
+
onCloseImageContextMenu: n[34] ||= (e) => kn.value = null,
|
|
3536
3537
|
onOpenImageProperties: n[35] ||= (e) => A.value = !0
|
|
3537
3538
|
}, null, 8, [
|
|
3538
3539
|
"read-only",
|
|
@@ -3548,7 +3549,7 @@ var In = { class: "docx-editor-vue__toolbar-shell" }, Ln = {
|
|
|
3548
3549
|
});
|
|
3549
3550
|
//#endregion
|
|
3550
3551
|
//#region src/renderAsync.ts
|
|
3551
|
-
async function
|
|
3552
|
+
async function Kn(e, t, n = {}) {
|
|
3552
3553
|
let r = e instanceof ArrayBuffer ? e : await _e(e), i = null, a = null, o = !1, s = {
|
|
3553
3554
|
save: async () => {
|
|
3554
3555
|
let e = await (i?.save() ?? Promise.resolve(null));
|
|
@@ -3571,7 +3572,7 @@ async function Wn(e, t, n = {}) {
|
|
|
3571
3572
|
};
|
|
3572
3573
|
return new Promise((e, c) => {
|
|
3573
3574
|
a = ae({ setup() {
|
|
3574
|
-
return () => ce(
|
|
3575
|
+
return () => ce(Gn, {
|
|
3575
3576
|
...n,
|
|
3576
3577
|
documentBuffer: r,
|
|
3577
3578
|
showToolbar: n.showToolbar ?? !0,
|
|
@@ -3595,6 +3596,6 @@ async function Wn(e, t, n = {}) {
|
|
|
3595
3596
|
}
|
|
3596
3597
|
//#endregion
|
|
3597
3598
|
//#region src/index.ts
|
|
3598
|
-
var
|
|
3599
|
+
var qn = "0.0.2";
|
|
3599
3600
|
//#endregion
|
|
3600
|
-
export {
|
|
3601
|
+
export { Gn as DocxEditor, qn as VERSION, Qe as createDocumentWithText, $e as createEmptyDocument, r as defaultLocale, a as i18nPlugin, f as provideLocale, Kn as renderAsync, n as useTranslation };
|