@eigenpal/docx-editor-vue 1.2.1 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{KeyboardShortcutsDialog-5ZsgieYf.js → KeyboardShortcutsDialog-00eb4Ova.js} +23 -0
- package/dist/KeyboardShortcutsDialog-EW9K4wuO.cjs +1 -0
- package/dist/MenuBar-DeogoqFP.js +3330 -0
- package/dist/MenuBar-bU4-4dnA.cjs +4 -0
- package/dist/{TablePropertiesDialog-DTCcLpPC.cjs → TablePropertiesDialog-BZLpFAkg.cjs} +1 -1
- package/dist/{TablePropertiesDialog-PR4ftalH.js → TablePropertiesDialog-CBTvM4Xy.js} +1 -1
- package/dist/composables/useMenuActions.d.ts +1 -0
- package/dist/composables/useSelectionSync.d.ts +16 -0
- package/dist/composables/useWatermarkControls.d.ts +15 -0
- package/dist/composables.cjs +1 -1
- package/dist/composables.js +102 -143
- package/dist/dialogs.cjs +1 -1
- package/dist/dialogs.js +2 -2
- package/dist/docx-editor-vue.css +1 -1
- package/dist/index.cjs +10 -10
- package/dist/index.js +1328 -955
- package/dist/ui.cjs +1 -1
- package/dist/ui.js +3 -3
- package/dist/useCommentSidebarItems-BHomCzpj.js +44 -0
- package/dist/useCommentSidebarItems-CbNvNCd3.cjs +1 -0
- package/dist/useTableResize-DBpEiuGQ.cjs +1 -0
- package/dist/{useTableResize-BcBdSaOE.js → useTableResize-uq2ksRDf.js} +118 -114
- package/dist/utils/domQueries.d.ts +17 -6
- package/package.json +4 -4
- package/dist/KeyboardShortcutsDialog-DiG-tfJT.cjs +0 -1
- package/dist/MenuBar-DLXxthZk.js +0 -3365
- package/dist/MenuBar-De3YJFpj.cjs +0 -4
- package/dist/useTableResize-DTag4SY0.cjs +0 -1
package/dist/MenuBar-DLXxthZk.js
DELETED
|
@@ -1,3365 +0,0 @@
|
|
|
1
|
-
import { d as e, p as t } from "./KeyboardShortcutsDialog-5ZsgieYf.js";
|
|
2
|
-
import { t as n } from "./_plugin-vue_export-helper-B52Kst-M.js";
|
|
3
|
-
import { Fragment as r, computed as i, createBlock as a, createCommentVNode as o, createElementBlock as s, createElementVNode as c, createTextVNode as l, createVNode as u, defineComponent as d, nextTick as f, normalizeClass as p, normalizeStyle as m, onBeforeUnmount as h, onMounted as g, openBlock as _, reactive as v, ref as y, renderList as b, renderSlot as x, resolveDynamicComponent as S, toDisplayString as C, unref as w, vModelSelect as T, vModelText as E, watch as D, withCtx as O, withDirectives as k, withKeys as A, withModifiers as j } from "vue";
|
|
4
|
-
import { redoDepth as M, undoDepth as N } from "prosemirror-history";
|
|
5
|
-
import { extractSelectionContext as P } from "@eigenpal/docx-editor-core/prosemirror/plugins/selectionTracker";
|
|
6
|
-
import { clearFormatting as F } from "@eigenpal/docx-editor-core/prosemirror/commands/formatting";
|
|
7
|
-
import { generateThemeTintShadeMatrix as I, resolveColor as L, resolveColorToHex as R, resolveHighlightColor as z } from "@eigenpal/docx-editor-core/utils";
|
|
8
|
-
import { normalizeFontFamilies as B } from "@eigenpal/docx-editor-core/utils/fontOptions";
|
|
9
|
-
import { getTableContext as V } from "@eigenpal/docx-editor-core/prosemirror/extensions/nodes/TableExtension";
|
|
10
|
-
import { formatDate as H, getAvatarColor as U, getCommentText as W, getInitials as G, truncateText as K } from "@eigenpal/docx-editor-core/utils/comments";
|
|
11
|
-
import { MIN_CARD_GAP as q, SIDEBAR_DOCUMENT_SHIFT as J } from "@eigenpal/docx-editor-core/utils/sidebarConstants";
|
|
12
|
-
import { pixelsToTwips as ee, twipsToPixels as te } from "@eigenpal/docx-editor-core/utils/units";
|
|
13
|
-
//#region src/components/ui/ColorPicker.vue?vue&type=script&setup=true&lang.ts
|
|
14
|
-
var ne = [
|
|
15
|
-
"disabled",
|
|
16
|
-
"title",
|
|
17
|
-
"aria-label"
|
|
18
|
-
], Y = [
|
|
19
|
-
"disabled",
|
|
20
|
-
"title",
|
|
21
|
-
"aria-label",
|
|
22
|
-
"aria-expanded"
|
|
23
|
-
], re = [
|
|
24
|
-
"disabled",
|
|
25
|
-
"title",
|
|
26
|
-
"aria-label",
|
|
27
|
-
"aria-expanded"
|
|
28
|
-
], X = { class: "docx-color-picker__button-stack" }, ie = ["aria-label"], ae = {
|
|
29
|
-
key: 0,
|
|
30
|
-
class: "docx-color-picker__auto-icon docx-color-picker__auto-icon--none"
|
|
31
|
-
}, oe = {
|
|
32
|
-
key: 1,
|
|
33
|
-
class: "docx-color-picker__auto-icon docx-color-picker__auto-icon--auto"
|
|
34
|
-
}, se = { class: "docx-color-picker__section-label" }, ce = { class: "docx-color-picker__grid" }, le = [
|
|
35
|
-
"title",
|
|
36
|
-
"aria-label",
|
|
37
|
-
"aria-selected",
|
|
38
|
-
"onClick"
|
|
39
|
-
], ue = { class: "docx-color-picker__section-label" }, de = { class: "docx-color-picker__grid" }, fe = [
|
|
40
|
-
"title",
|
|
41
|
-
"aria-label",
|
|
42
|
-
"aria-selected",
|
|
43
|
-
"onClick"
|
|
44
|
-
], pe = { class: "docx-color-picker__section-label" }, me = { class: "docx-color-picker__custom" }, he = ["onKeydown"], ge = ["disabled"], Z = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
45
|
-
__name: "ColorPicker",
|
|
46
|
-
props: {
|
|
47
|
-
mode: {},
|
|
48
|
-
value: {},
|
|
49
|
-
theme: {},
|
|
50
|
-
disabled: {
|
|
51
|
-
type: Boolean,
|
|
52
|
-
default: !1
|
|
53
|
-
},
|
|
54
|
-
className: {},
|
|
55
|
-
style: {},
|
|
56
|
-
title: {},
|
|
57
|
-
icon: {},
|
|
58
|
-
autoLabel: {},
|
|
59
|
-
splitButton: {
|
|
60
|
-
type: Boolean,
|
|
61
|
-
default: !0
|
|
62
|
-
},
|
|
63
|
-
defaultColor: {}
|
|
64
|
-
},
|
|
65
|
-
emits: ["change"],
|
|
66
|
-
setup(n, { emit: a }) {
|
|
67
|
-
let d = n, f = a, { t: v } = e(), x = [
|
|
68
|
-
{
|
|
69
|
-
nameKey: "colorPicker.colors.darkRed",
|
|
70
|
-
hex: "C00000"
|
|
71
|
-
},
|
|
72
|
-
{
|
|
73
|
-
nameKey: "colorPicker.colors.red",
|
|
74
|
-
hex: "FF0000"
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
nameKey: "colorPicker.colors.orange",
|
|
78
|
-
hex: "FFC000"
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
nameKey: "colorPicker.colors.yellow",
|
|
82
|
-
hex: "FFFF00"
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
nameKey: "colorPicker.colors.lightGreen",
|
|
86
|
-
hex: "92D050"
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
nameKey: "colorPicker.colors.green",
|
|
90
|
-
hex: "00B050"
|
|
91
|
-
},
|
|
92
|
-
{
|
|
93
|
-
nameKey: "colorPicker.colors.lightBlue",
|
|
94
|
-
hex: "00B0F0"
|
|
95
|
-
},
|
|
96
|
-
{
|
|
97
|
-
nameKey: "colorPicker.colors.blue",
|
|
98
|
-
hex: "0070C0"
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
nameKey: "colorPicker.colors.darkBlue",
|
|
102
|
-
hex: "002060"
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
nameKey: "colorPicker.colors.purple",
|
|
106
|
-
hex: "7030A0"
|
|
107
|
-
}
|
|
108
|
-
];
|
|
109
|
-
function S(e) {
|
|
110
|
-
return e ? typeof e == "string" ? d.mode === "highlight" ? z(e) || (e === "none" ? "transparent" : e.startsWith("#") ? e : `#${e}`) : e.startsWith("#") ? e : `#${e}` : L(e, d.theme) : d.mode === "text" || d.mode === "border" ? "#000000" : "transparent";
|
|
111
|
-
}
|
|
112
|
-
function T(e) {
|
|
113
|
-
return /^[0-9A-Fa-f]{6}$/.test(e.replace(/^#/, ""));
|
|
114
|
-
}
|
|
115
|
-
function O(e) {
|
|
116
|
-
let t = e.replace(/^#/, "");
|
|
117
|
-
if (t.length !== 6) return !1;
|
|
118
|
-
let n = parseInt(t.slice(0, 2), 16), r = parseInt(t.slice(2, 4), 16), i = parseInt(t.slice(4, 6), 16);
|
|
119
|
-
return (n * 299 + r * 587 + i * 114) / 1e3 > 230;
|
|
120
|
-
}
|
|
121
|
-
function M(e, t) {
|
|
122
|
-
return e ? (typeof e == "string" ? e.replace(/^#/, "").toUpperCase() : R(e, d.theme)) === t.toUpperCase() : !1;
|
|
123
|
-
}
|
|
124
|
-
let N = y(!1), P = y(""), F = y(null), B = y(null), V = y(d.defaultColor ?? (d.mode === "highlight" ? "FFFF00" : d.mode === "border" ? { rgb: "000000" } : { rgb: "FF0000" })), H = i(() => I(d.theme?.colorScheme ?? null)), U = i(() => H.value.flatMap((e, t) => e.map((e, n) => ({
|
|
125
|
-
...e,
|
|
126
|
-
key: `${t}-${n}`
|
|
127
|
-
})))), W = i(() => S(d.value)), G = i(() => S(V.value)), K = i(() => d.mode === "text" ? v("formattingBar.fontColor") : d.mode === "highlight" ? v("formattingBar.highlightColor") : v("table.borderColor")), q = i(() => d.icon ?? (d.mode === "text" ? "format_color_text" : d.mode === "highlight" ? "ink_highlighter" : "border_color"));
|
|
128
|
-
D(() => [
|
|
129
|
-
d.value,
|
|
130
|
-
d.mode,
|
|
131
|
-
d.theme
|
|
132
|
-
], () => {
|
|
133
|
-
let e = S(d.value).replace(/^#/, "");
|
|
134
|
-
/^[0-9A-Fa-f]{6}$/.test(e) && (P.value = e.toUpperCase());
|
|
135
|
-
}, { immediate: !0 });
|
|
136
|
-
let J = y({});
|
|
137
|
-
function ee() {
|
|
138
|
-
let e = F.value;
|
|
139
|
-
if (!e) return;
|
|
140
|
-
let t = e.getBoundingClientRect();
|
|
141
|
-
J.value = {
|
|
142
|
-
top: `${t.bottom + 4}px`,
|
|
143
|
-
left: `${t.left}px`
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
function te() {
|
|
147
|
-
d.disabled || (N.value || ee(), N.value = !N.value);
|
|
148
|
-
}
|
|
149
|
-
function Z(e, t = !0) {
|
|
150
|
-
t && (V.value = e), f("change", e), N.value = !1;
|
|
151
|
-
}
|
|
152
|
-
function _e() {
|
|
153
|
-
d.disabled || f("change", V.value);
|
|
154
|
-
}
|
|
155
|
-
function Q(e) {
|
|
156
|
-
if (d.mode === "highlight") {
|
|
157
|
-
Z(e.hex);
|
|
158
|
-
return;
|
|
159
|
-
}
|
|
160
|
-
let t = {
|
|
161
|
-
themeColor: e.themeSlot,
|
|
162
|
-
rgb: e.hex
|
|
163
|
-
};
|
|
164
|
-
e.tint && (t.themeTint = e.tint), e.shade && (t.themeShade = e.shade), Z(t);
|
|
165
|
-
}
|
|
166
|
-
function ve(e) {
|
|
167
|
-
Z(d.mode === "highlight" ? e : { rgb: e });
|
|
168
|
-
}
|
|
169
|
-
function ye() {
|
|
170
|
-
Z(d.mode === "highlight" ? "none" : { auto: !0 }, !1);
|
|
171
|
-
}
|
|
172
|
-
function be() {
|
|
173
|
-
let e = P.value.replace(/^#/, "").toUpperCase();
|
|
174
|
-
T(e) && (Z(d.mode === "highlight" ? e : { rgb: e }), P.value = "");
|
|
175
|
-
}
|
|
176
|
-
function xe(e) {
|
|
177
|
-
e.target.tagName !== "INPUT" && e.preventDefault();
|
|
178
|
-
}
|
|
179
|
-
function Se(e) {
|
|
180
|
-
if (!N.value) return;
|
|
181
|
-
let t = e.target;
|
|
182
|
-
F.value?.contains(t) || B.value?.contains(t) || (N.value = !1);
|
|
183
|
-
}
|
|
184
|
-
return g(() => document.addEventListener("mousedown", Se)), h(() => document.removeEventListener("mousedown", Se)), (e, i) => (_(), s("div", {
|
|
185
|
-
ref_key: "containerRef",
|
|
186
|
-
ref: F,
|
|
187
|
-
class: p(["docx-color-picker", n.className]),
|
|
188
|
-
style: m(n.style)
|
|
189
|
-
}, [n.splitButton ? (_(), s("div", {
|
|
190
|
-
key: 0,
|
|
191
|
-
class: p(["docx-color-picker__split", { "is-disabled": n.disabled }])
|
|
192
|
-
}, [c("button", {
|
|
193
|
-
type: "button",
|
|
194
|
-
class: "docx-color-picker__apply",
|
|
195
|
-
disabled: n.disabled,
|
|
196
|
-
title: n.title ?? K.value,
|
|
197
|
-
"aria-label": n.title ?? K.value,
|
|
198
|
-
onMousedown: i[0] ||= j(() => {}, ["prevent"]),
|
|
199
|
-
onClick: _e
|
|
200
|
-
}, [u(t, {
|
|
201
|
-
name: q.value,
|
|
202
|
-
size: 18
|
|
203
|
-
}, null, 8, ["name"]), c("span", {
|
|
204
|
-
class: p(["docx-color-picker__bar", { "is-light": G.value === "transparent" || O(G.value) }]),
|
|
205
|
-
style: m({ background: G.value === "transparent" ? "#fff" : G.value })
|
|
206
|
-
}, null, 6)], 40, ne), c("button", {
|
|
207
|
-
type: "button",
|
|
208
|
-
class: p(["docx-color-picker__arrow", { "is-open": N.value }]),
|
|
209
|
-
disabled: n.disabled,
|
|
210
|
-
title: n.title ?? K.value,
|
|
211
|
-
"aria-label": n.title ?? K.value,
|
|
212
|
-
"aria-haspopup": "true",
|
|
213
|
-
"aria-expanded": N.value,
|
|
214
|
-
onMousedown: i[1] ||= j(() => {}, ["prevent"]),
|
|
215
|
-
onClick: te
|
|
216
|
-
}, [u(t, {
|
|
217
|
-
name: "arrow_drop_down",
|
|
218
|
-
size: 18
|
|
219
|
-
})], 42, Y)], 2)) : (_(), s("button", {
|
|
220
|
-
key: 1,
|
|
221
|
-
type: "button",
|
|
222
|
-
class: p(["docx-color-picker__button", { "is-open": N.value }]),
|
|
223
|
-
disabled: n.disabled,
|
|
224
|
-
title: n.title ?? K.value,
|
|
225
|
-
"aria-label": n.title ?? K.value,
|
|
226
|
-
"aria-haspopup": "true",
|
|
227
|
-
"aria-expanded": N.value,
|
|
228
|
-
onMousedown: i[2] ||= j(() => {}, ["prevent"]),
|
|
229
|
-
onClick: te
|
|
230
|
-
}, [c("span", X, [u(t, {
|
|
231
|
-
name: q.value,
|
|
232
|
-
size: 18
|
|
233
|
-
}, null, 8, ["name"]), c("span", {
|
|
234
|
-
class: p(["docx-color-picker__bar", { "is-light": W.value === "transparent" || O(W.value) }]),
|
|
235
|
-
style: m({ background: W.value === "transparent" ? "#fff" : W.value })
|
|
236
|
-
}, null, 6)]), u(t, {
|
|
237
|
-
name: "arrow_drop_down",
|
|
238
|
-
size: 14
|
|
239
|
-
})], 42, re)), N.value && !n.disabled ? (_(), s("div", {
|
|
240
|
-
key: 2,
|
|
241
|
-
ref_key: "panelRef",
|
|
242
|
-
ref: B,
|
|
243
|
-
class: "docx-color-picker__panel",
|
|
244
|
-
style: m(J.value),
|
|
245
|
-
role: "dialog",
|
|
246
|
-
"aria-label": w(v)("colorPicker.ariaLabel", { type: K.value }),
|
|
247
|
-
onMousedown: xe
|
|
248
|
-
}, [
|
|
249
|
-
c("button", {
|
|
250
|
-
type: "button",
|
|
251
|
-
class: "docx-color-picker__auto",
|
|
252
|
-
onMousedown: i[3] ||= j(() => {}, ["prevent"]),
|
|
253
|
-
onClick: ye
|
|
254
|
-
}, [n.mode === "highlight" ? (_(), s("span", ae, [...i[10] ||= [c("span", { class: "docx-color-picker__auto-slash" }, null, -1)]])) : (_(), s("span", oe)), l(" " + C(n.autoLabel ?? (n.mode === "highlight" ? w(v)("colorPicker.noColor") : w(v)("colorPicker.automatic"))), 1)], 32),
|
|
255
|
-
i[12] ||= c("div", { class: "docx-color-picker__divider" }, null, -1),
|
|
256
|
-
c("div", se, C(w(v)("colorPicker.themeColors")), 1),
|
|
257
|
-
c("div", ce, [(_(!0), s(r, null, b(U.value, (e) => (_(), s("button", {
|
|
258
|
-
key: e.key,
|
|
259
|
-
type: "button",
|
|
260
|
-
class: p(["docx-color-picker__cell", { "is-selected": M(n.value, e.hex) }]),
|
|
261
|
-
style: m({ background: "#" + e.hex }),
|
|
262
|
-
title: e.label,
|
|
263
|
-
"aria-label": e.label,
|
|
264
|
-
"aria-selected": M(n.value, e.hex),
|
|
265
|
-
onMousedown: i[4] ||= j(() => {}, ["prevent"]),
|
|
266
|
-
onClick: (t) => Q(e)
|
|
267
|
-
}, null, 46, le))), 128))]),
|
|
268
|
-
i[13] ||= c("div", { class: "docx-color-picker__divider" }, null, -1),
|
|
269
|
-
c("div", ue, C(w(v)("colorPicker.standardColors")), 1),
|
|
270
|
-
c("div", de, [(_(), s(r, null, b(x, (e) => c("button", {
|
|
271
|
-
key: e.hex,
|
|
272
|
-
type: "button",
|
|
273
|
-
class: p(["docx-color-picker__cell", { "is-selected": M(n.value, e.hex) }]),
|
|
274
|
-
style: m({ background: "#" + e.hex }),
|
|
275
|
-
title: w(v)(e.nameKey),
|
|
276
|
-
"aria-label": w(v)(e.nameKey),
|
|
277
|
-
"aria-selected": M(n.value, e.hex),
|
|
278
|
-
onMousedown: i[5] ||= j(() => {}, ["prevent"]),
|
|
279
|
-
onClick: (t) => ve(e.hex)
|
|
280
|
-
}, null, 46, fe)), 64))]),
|
|
281
|
-
i[14] ||= c("div", { class: "docx-color-picker__divider" }, null, -1),
|
|
282
|
-
c("div", pe, C(w(v)("colorPicker.customColor")), 1),
|
|
283
|
-
c("div", me, [
|
|
284
|
-
i[11] ||= c("span", { class: "docx-color-picker__hash" }, "#", -1),
|
|
285
|
-
k(c("input", {
|
|
286
|
-
"onUpdate:modelValue": i[6] ||= (e) => P.value = e,
|
|
287
|
-
type: "text",
|
|
288
|
-
class: "docx-color-picker__hex",
|
|
289
|
-
placeholder: "FF0000",
|
|
290
|
-
maxlength: "6",
|
|
291
|
-
"aria-label": "Custom hex color",
|
|
292
|
-
onInput: i[7] ||= (e) => P.value = P.value.replace(/[^0-9A-Fa-f]/g, "").slice(0, 6),
|
|
293
|
-
onKeydown: A(j(be, ["prevent"]), ["enter"]),
|
|
294
|
-
onMousedown: i[8] ||= j(() => {}, ["stop"])
|
|
295
|
-
}, null, 40, he), [[E, P.value]]),
|
|
296
|
-
c("button", {
|
|
297
|
-
type: "button",
|
|
298
|
-
class: "docx-color-picker__apply-btn",
|
|
299
|
-
disabled: !T(P.value),
|
|
300
|
-
onMousedown: i[9] ||= j(() => {}, ["prevent"]),
|
|
301
|
-
onClick: be
|
|
302
|
-
}, C(w(v)("common.apply")), 41, ge)
|
|
303
|
-
])
|
|
304
|
-
], 44, ie)) : o("", !0)], 6));
|
|
305
|
-
}
|
|
306
|
-
}), [["__scopeId", "data-v-2cbf59ab"]]), _e = 4, Q = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
307
|
-
__name: "Popover",
|
|
308
|
-
props: {
|
|
309
|
-
open: { type: Boolean },
|
|
310
|
-
placement: { default: "bottom-left" },
|
|
311
|
-
panelClass: {},
|
|
312
|
-
panelStyle: {},
|
|
313
|
-
closeOnScroll: {
|
|
314
|
-
type: Boolean,
|
|
315
|
-
default: !0
|
|
316
|
-
}
|
|
317
|
-
},
|
|
318
|
-
emits: ["close", "update:open"],
|
|
319
|
-
setup(e, { emit: t }) {
|
|
320
|
-
let n = e, r = t, i = y(null), a = y(null), c = y({ position: "fixed" });
|
|
321
|
-
function l() {
|
|
322
|
-
let e = i.value;
|
|
323
|
-
if (!e) return;
|
|
324
|
-
let t = e.getBoundingClientRect(), r = { position: "fixed" };
|
|
325
|
-
n.placement.startsWith("top") ? (r.bottom = `${Math.round(window.innerHeight - t.top + _e)}px`, r.top = "auto") : (r.top = `${Math.round(t.bottom + _e)}px`, r.bottom = "auto"), n.placement.endsWith("right") ? (r.right = `${Math.round(window.innerWidth - t.right)}px`, r.left = "auto") : (r.left = `${Math.round(t.left)}px`, r.right = "auto"), c.value = r;
|
|
326
|
-
}
|
|
327
|
-
function u() {
|
|
328
|
-
r("update:open", !n.open), n.open && r("close");
|
|
329
|
-
}
|
|
330
|
-
function d() {
|
|
331
|
-
r("update:open", !1), r("close");
|
|
332
|
-
}
|
|
333
|
-
function f(e) {
|
|
334
|
-
if (!n.open) return;
|
|
335
|
-
let t = e.target;
|
|
336
|
-
i.value?.contains(t) || a.value?.contains(t) || d();
|
|
337
|
-
}
|
|
338
|
-
function v(e) {
|
|
339
|
-
e.key === "Escape" && n.open && d();
|
|
340
|
-
}
|
|
341
|
-
function b(e) {
|
|
342
|
-
!n.closeOnScroll || !n.open || a.value?.contains(e.target) || d();
|
|
343
|
-
}
|
|
344
|
-
function S() {
|
|
345
|
-
n.open && l();
|
|
346
|
-
}
|
|
347
|
-
function C() {
|
|
348
|
-
document.addEventListener("mousedown", f), document.addEventListener("keydown", v), window.addEventListener("scroll", b, !0), window.addEventListener("resize", S);
|
|
349
|
-
}
|
|
350
|
-
function w() {
|
|
351
|
-
document.removeEventListener("mousedown", f), document.removeEventListener("keydown", v), window.removeEventListener("scroll", b, !0), window.removeEventListener("resize", S);
|
|
352
|
-
}
|
|
353
|
-
return D(() => n.open, (e) => {
|
|
354
|
-
e ? (l(), C()) : w();
|
|
355
|
-
}), D(() => n.placement, () => n.open && l()), g(() => {
|
|
356
|
-
n.open && (l(), C());
|
|
357
|
-
}), h(w), (t, n) => (_(), s("span", {
|
|
358
|
-
ref_key: "rootRef",
|
|
359
|
-
ref: i,
|
|
360
|
-
class: "docx-popover"
|
|
361
|
-
}, [x(t.$slots, "trigger", {
|
|
362
|
-
toggle: u,
|
|
363
|
-
open: e.open
|
|
364
|
-
}, void 0, !0), e.open ? (_(), s("div", {
|
|
365
|
-
key: 0,
|
|
366
|
-
ref_key: "panelRef",
|
|
367
|
-
ref: a,
|
|
368
|
-
class: p(["docx-popover__panel", e.panelClass]),
|
|
369
|
-
style: m([c.value, e.panelStyle ?? {}]),
|
|
370
|
-
onMousedown: n[0] ||= j(() => {}, ["stop"])
|
|
371
|
-
}, [x(t.$slots, "panel", {}, void 0, !0)], 38)) : o("", !0)], 512));
|
|
372
|
-
}
|
|
373
|
-
}), [["__scopeId", "data-v-20a24bb6"]]), ve = ["title", "onClick"], ye = {
|
|
374
|
-
key: 0,
|
|
375
|
-
class: "editing-mode__label"
|
|
376
|
-
}, be = { class: "editing-mode__panel" }, xe = ["onClick"], Se = { class: "editing-mode__option-text" }, Ce = { class: "editing-mode__option-label" }, we = { class: "editing-mode__option-desc" }, Te = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
377
|
-
__name: "EditingModeDropdown",
|
|
378
|
-
props: { modelValue: {} },
|
|
379
|
-
emits: ["update:modelValue"],
|
|
380
|
-
setup(e, { emit: n }) {
|
|
381
|
-
let l = e, d = n, f = [
|
|
382
|
-
{
|
|
383
|
-
value: "editing",
|
|
384
|
-
label: "Editing",
|
|
385
|
-
icon: "edit_note",
|
|
386
|
-
desc: "Edit document directly"
|
|
387
|
-
},
|
|
388
|
-
{
|
|
389
|
-
value: "suggesting",
|
|
390
|
-
label: "Suggesting",
|
|
391
|
-
icon: "rate_review",
|
|
392
|
-
desc: "Edits become suggestions"
|
|
393
|
-
},
|
|
394
|
-
{
|
|
395
|
-
value: "viewing",
|
|
396
|
-
label: "Viewing",
|
|
397
|
-
icon: "visibility",
|
|
398
|
-
desc: "Read or print final document"
|
|
399
|
-
}
|
|
400
|
-
], m = y(!1), v = y(!1), x = i(() => f.find((e) => e.value === l.modelValue) ?? f[0]);
|
|
401
|
-
function S(e) {
|
|
402
|
-
d("update:modelValue", e), m.value = !1;
|
|
403
|
-
}
|
|
404
|
-
let w = null;
|
|
405
|
-
function T(e) {
|
|
406
|
-
v.value = e.matches;
|
|
407
|
-
}
|
|
408
|
-
return g(() => {
|
|
409
|
-
w = window.matchMedia("(max-width: 1400px)"), v.value = w.matches, w.addEventListener("change", T);
|
|
410
|
-
}), h(() => w?.removeEventListener("change", T)), (n, i) => (_(), a(Q, {
|
|
411
|
-
open: m.value,
|
|
412
|
-
placement: "bottom-right",
|
|
413
|
-
"onUpdate:open": i[0] ||= (e) => m.value = e,
|
|
414
|
-
onClose: i[1] ||= (e) => m.value = !1
|
|
415
|
-
}, {
|
|
416
|
-
trigger: O(({ toggle: e }) => [c("button", {
|
|
417
|
-
type: "button",
|
|
418
|
-
class: p(["editing-mode__trigger", {
|
|
419
|
-
"editing-mode__trigger--open": m.value,
|
|
420
|
-
"editing-mode__trigger--compact": v.value
|
|
421
|
-
}]),
|
|
422
|
-
title: `${x.value.label} (Ctrl+Shift+E)`,
|
|
423
|
-
onClick: j(e, ["prevent"])
|
|
424
|
-
}, [
|
|
425
|
-
u(t, {
|
|
426
|
-
name: x.value.icon,
|
|
427
|
-
size: 18
|
|
428
|
-
}, null, 8, ["name"]),
|
|
429
|
-
v.value ? o("", !0) : (_(), s("span", ye, C(x.value.label), 1)),
|
|
430
|
-
u(t, {
|
|
431
|
-
name: "arrow_drop_down",
|
|
432
|
-
size: 16
|
|
433
|
-
})
|
|
434
|
-
], 10, ve)]),
|
|
435
|
-
panel: O(() => [c("div", be, [(_(), s(r, null, b(f, (n) => c("button", {
|
|
436
|
-
key: n.value,
|
|
437
|
-
type: "button",
|
|
438
|
-
class: "editing-mode__option",
|
|
439
|
-
onClick: j((e) => S(n.value), ["prevent"])
|
|
440
|
-
}, [
|
|
441
|
-
u(t, {
|
|
442
|
-
name: n.icon,
|
|
443
|
-
size: 20
|
|
444
|
-
}, null, 8, ["name"]),
|
|
445
|
-
c("span", Se, [c("span", Ce, C(n.label), 1), c("span", we, C(n.desc), 1)]),
|
|
446
|
-
n.value === e.modelValue ? (_(), a(t, {
|
|
447
|
-
key: 0,
|
|
448
|
-
name: "check",
|
|
449
|
-
size: 18,
|
|
450
|
-
class: "editing-mode__check"
|
|
451
|
-
})) : o("", !0)
|
|
452
|
-
], 8, xe)), 64))])]),
|
|
453
|
-
_: 1
|
|
454
|
-
}, 8, ["open"]));
|
|
455
|
-
}
|
|
456
|
-
}), [["__scopeId", "data-v-5d5c5f86"]]), Ee = [
|
|
457
|
-
"disabled",
|
|
458
|
-
"aria-label",
|
|
459
|
-
"title",
|
|
460
|
-
"aria-expanded",
|
|
461
|
-
"onClick"
|
|
462
|
-
], De = { class: "docx-icon-grid__panel" }, Oe = ["title", "onClick"], ke = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
463
|
-
__name: "IconGridDropdown",
|
|
464
|
-
props: {
|
|
465
|
-
options: {},
|
|
466
|
-
activeValue: {},
|
|
467
|
-
triggerIcon: {},
|
|
468
|
-
tooltipContent: {},
|
|
469
|
-
disabled: { type: Boolean },
|
|
470
|
-
ariaLabel: {}
|
|
471
|
-
},
|
|
472
|
-
emits: ["select"],
|
|
473
|
-
setup(e, { emit: n }) {
|
|
474
|
-
let i = n, o = y(!1);
|
|
475
|
-
function l(e) {
|
|
476
|
-
i("select", e), o.value = !1;
|
|
477
|
-
}
|
|
478
|
-
return (n, i) => (_(), a(Q, {
|
|
479
|
-
open: o.value,
|
|
480
|
-
"onUpdate:open": i[0] ||= (e) => o.value = e,
|
|
481
|
-
onClose: i[1] ||= (e) => o.value = !1
|
|
482
|
-
}, {
|
|
483
|
-
trigger: O(({ toggle: n }) => [c("button", {
|
|
484
|
-
type: "button",
|
|
485
|
-
class: p(["docx-icon-grid__btn", { "docx-icon-grid__btn--open": o.value }]),
|
|
486
|
-
disabled: e.disabled,
|
|
487
|
-
"aria-label": e.ariaLabel ?? e.tooltipContent,
|
|
488
|
-
title: e.tooltipContent,
|
|
489
|
-
"aria-expanded": o.value,
|
|
490
|
-
"aria-haspopup": "true",
|
|
491
|
-
onClick: j(n, ["prevent"])
|
|
492
|
-
}, [u(t, {
|
|
493
|
-
name: e.triggerIcon,
|
|
494
|
-
size: 20
|
|
495
|
-
}, null, 8, ["name"]), u(t, {
|
|
496
|
-
name: "arrow_drop_down",
|
|
497
|
-
size: 14
|
|
498
|
-
})], 10, Ee)]),
|
|
499
|
-
panel: O(() => [c("div", De, [(_(!0), s(r, null, b(e.options, (n) => (_(), s("button", {
|
|
500
|
-
key: n.value,
|
|
501
|
-
type: "button",
|
|
502
|
-
class: p(["docx-icon-grid__option", { "docx-icon-grid__option--active": e.activeValue === n.value }]),
|
|
503
|
-
title: n.label,
|
|
504
|
-
onClick: j((e) => l(n.value), ["prevent"])
|
|
505
|
-
}, [u(t, {
|
|
506
|
-
name: n.iconName,
|
|
507
|
-
size: 18
|
|
508
|
-
}, null, 8, ["name"])], 10, Oe))), 128))])]),
|
|
509
|
-
_: 1
|
|
510
|
-
}, 8, ["open"]));
|
|
511
|
-
}
|
|
512
|
-
}), [["__scopeId", "data-v-435b9662"]]), Ae = /* @__PURE__ */ d({
|
|
513
|
-
__name: "ImageWrapDropdown",
|
|
514
|
-
props: {
|
|
515
|
-
imageContext: {},
|
|
516
|
-
disabled: { type: Boolean }
|
|
517
|
-
},
|
|
518
|
-
emits: ["change"],
|
|
519
|
-
setup(e) {
|
|
520
|
-
let t = e, n = [
|
|
521
|
-
{
|
|
522
|
-
value: "inline",
|
|
523
|
-
label: "In line",
|
|
524
|
-
iconName: "format_image_left"
|
|
525
|
-
},
|
|
526
|
-
{
|
|
527
|
-
value: "wrapRight",
|
|
528
|
-
label: "Float left",
|
|
529
|
-
iconName: "format_image_right"
|
|
530
|
-
},
|
|
531
|
-
{
|
|
532
|
-
value: "wrapLeft",
|
|
533
|
-
label: "Float right",
|
|
534
|
-
iconName: "format_image_left"
|
|
535
|
-
},
|
|
536
|
-
{
|
|
537
|
-
value: "topAndBottom",
|
|
538
|
-
label: "Top & bottom",
|
|
539
|
-
iconName: "horizontal_rule"
|
|
540
|
-
},
|
|
541
|
-
{
|
|
542
|
-
value: "behind",
|
|
543
|
-
label: "Behind text",
|
|
544
|
-
iconName: "flip_to_back"
|
|
545
|
-
},
|
|
546
|
-
{
|
|
547
|
-
value: "inFront",
|
|
548
|
-
label: "In front of text",
|
|
549
|
-
iconName: "flip_to_front"
|
|
550
|
-
}
|
|
551
|
-
], r = i(() => {
|
|
552
|
-
let e = t.imageContext;
|
|
553
|
-
return e.displayMode === "float" && e.cssFloat === "left" ? "wrapRight" : e.displayMode === "float" && e.cssFloat === "right" ? "wrapLeft" : e.wrapType;
|
|
554
|
-
}), o = i(() => n.find((e) => e.value === r.value) ?? n[0]);
|
|
555
|
-
return (t, i) => (_(), a(ke, {
|
|
556
|
-
options: n,
|
|
557
|
-
"active-value": r.value,
|
|
558
|
-
"trigger-icon": o.value.iconName,
|
|
559
|
-
"tooltip-content": `Wrap: ${o.value.label}`,
|
|
560
|
-
disabled: e.disabled,
|
|
561
|
-
onSelect: i[0] ||= (e) => t.$emit("change", e)
|
|
562
|
-
}, null, 8, [
|
|
563
|
-
"active-value",
|
|
564
|
-
"trigger-icon",
|
|
565
|
-
"tooltip-content",
|
|
566
|
-
"disabled"
|
|
567
|
-
]));
|
|
568
|
-
}
|
|
569
|
-
}), je = /* @__PURE__ */ d({
|
|
570
|
-
__name: "ImageTransformDropdown",
|
|
571
|
-
props: { disabled: { type: Boolean } },
|
|
572
|
-
emits: ["transform"],
|
|
573
|
-
setup(e) {
|
|
574
|
-
let t = [
|
|
575
|
-
{
|
|
576
|
-
value: "rotateCW",
|
|
577
|
-
label: "Rotate clockwise",
|
|
578
|
-
iconName: "rotate_right"
|
|
579
|
-
},
|
|
580
|
-
{
|
|
581
|
-
value: "rotateCCW",
|
|
582
|
-
label: "Rotate counter-clockwise",
|
|
583
|
-
iconName: "rotate_left"
|
|
584
|
-
},
|
|
585
|
-
{
|
|
586
|
-
value: "flipH",
|
|
587
|
-
label: "Flip horizontal",
|
|
588
|
-
iconName: "swap_horiz"
|
|
589
|
-
},
|
|
590
|
-
{
|
|
591
|
-
value: "flipV",
|
|
592
|
-
label: "Flip vertical",
|
|
593
|
-
iconName: "swap_vert"
|
|
594
|
-
}
|
|
595
|
-
];
|
|
596
|
-
return (n, r) => (_(), a(ke, {
|
|
597
|
-
options: t,
|
|
598
|
-
"trigger-icon": "rotate_right",
|
|
599
|
-
"tooltip-content": "Rotate / flip",
|
|
600
|
-
disabled: e.disabled,
|
|
601
|
-
onSelect: r[0] ||= (e) => n.$emit("transform", e)
|
|
602
|
-
}, null, 8, ["disabled"]));
|
|
603
|
-
}
|
|
604
|
-
}), Me = [
|
|
605
|
-
{
|
|
606
|
-
name: "Arial",
|
|
607
|
-
fontFamily: "Arial",
|
|
608
|
-
category: "sans-serif"
|
|
609
|
-
},
|
|
610
|
-
{
|
|
611
|
-
name: "Calibri",
|
|
612
|
-
fontFamily: "Calibri",
|
|
613
|
-
category: "sans-serif"
|
|
614
|
-
},
|
|
615
|
-
{
|
|
616
|
-
name: "Helvetica",
|
|
617
|
-
fontFamily: "Helvetica",
|
|
618
|
-
category: "sans-serif"
|
|
619
|
-
},
|
|
620
|
-
{
|
|
621
|
-
name: "Verdana",
|
|
622
|
-
fontFamily: "Verdana",
|
|
623
|
-
category: "sans-serif"
|
|
624
|
-
},
|
|
625
|
-
{
|
|
626
|
-
name: "Open Sans",
|
|
627
|
-
fontFamily: "Open Sans",
|
|
628
|
-
category: "sans-serif"
|
|
629
|
-
},
|
|
630
|
-
{
|
|
631
|
-
name: "Roboto",
|
|
632
|
-
fontFamily: "Roboto",
|
|
633
|
-
category: "sans-serif"
|
|
634
|
-
},
|
|
635
|
-
{
|
|
636
|
-
name: "Times New Roman",
|
|
637
|
-
fontFamily: "Times New Roman",
|
|
638
|
-
category: "serif"
|
|
639
|
-
},
|
|
640
|
-
{
|
|
641
|
-
name: "Georgia",
|
|
642
|
-
fontFamily: "Georgia",
|
|
643
|
-
category: "serif"
|
|
644
|
-
},
|
|
645
|
-
{
|
|
646
|
-
name: "Cambria",
|
|
647
|
-
fontFamily: "Cambria",
|
|
648
|
-
category: "serif"
|
|
649
|
-
},
|
|
650
|
-
{
|
|
651
|
-
name: "Garamond",
|
|
652
|
-
fontFamily: "Garamond",
|
|
653
|
-
category: "serif"
|
|
654
|
-
},
|
|
655
|
-
{
|
|
656
|
-
name: "Courier New",
|
|
657
|
-
fontFamily: "Courier New",
|
|
658
|
-
category: "monospace"
|
|
659
|
-
},
|
|
660
|
-
{
|
|
661
|
-
name: "Consolas",
|
|
662
|
-
fontFamily: "Consolas",
|
|
663
|
-
category: "monospace"
|
|
664
|
-
}
|
|
665
|
-
], Ne = [
|
|
666
|
-
8,
|
|
667
|
-
9,
|
|
668
|
-
10,
|
|
669
|
-
11,
|
|
670
|
-
12,
|
|
671
|
-
14,
|
|
672
|
-
16,
|
|
673
|
-
18,
|
|
674
|
-
20,
|
|
675
|
-
24,
|
|
676
|
-
28,
|
|
677
|
-
36,
|
|
678
|
-
48,
|
|
679
|
-
72
|
|
680
|
-
], Pe = [
|
|
681
|
-
{
|
|
682
|
-
id: "Normal",
|
|
683
|
-
label: "Normal",
|
|
684
|
-
previewStyle: { fontSize: "13px" }
|
|
685
|
-
},
|
|
686
|
-
{
|
|
687
|
-
id: "Title",
|
|
688
|
-
label: "Title",
|
|
689
|
-
previewStyle: {
|
|
690
|
-
fontSize: "20px",
|
|
691
|
-
fontWeight: "bold"
|
|
692
|
-
}
|
|
693
|
-
},
|
|
694
|
-
{
|
|
695
|
-
id: "Subtitle",
|
|
696
|
-
label: "Subtitle",
|
|
697
|
-
previewStyle: {
|
|
698
|
-
fontSize: "15px",
|
|
699
|
-
color: "#6b7280"
|
|
700
|
-
}
|
|
701
|
-
},
|
|
702
|
-
{
|
|
703
|
-
id: "Heading1",
|
|
704
|
-
label: "Heading 1",
|
|
705
|
-
previewStyle: {
|
|
706
|
-
fontSize: "18px",
|
|
707
|
-
fontWeight: "bold",
|
|
708
|
-
color: "#4a6c8c"
|
|
709
|
-
}
|
|
710
|
-
},
|
|
711
|
-
{
|
|
712
|
-
id: "Heading2",
|
|
713
|
-
label: "Heading 2",
|
|
714
|
-
previewStyle: {
|
|
715
|
-
fontSize: "16px",
|
|
716
|
-
fontWeight: "bold",
|
|
717
|
-
color: "#4a6c8c"
|
|
718
|
-
}
|
|
719
|
-
},
|
|
720
|
-
{
|
|
721
|
-
id: "Heading3",
|
|
722
|
-
label: "Heading 3",
|
|
723
|
-
previewStyle: {
|
|
724
|
-
fontSize: "14px",
|
|
725
|
-
fontWeight: "bold",
|
|
726
|
-
color: "#4a6c8c"
|
|
727
|
-
}
|
|
728
|
-
}
|
|
729
|
-
], Fe = [
|
|
730
|
-
{
|
|
731
|
-
label: "Single",
|
|
732
|
-
value: 240
|
|
733
|
-
},
|
|
734
|
-
{
|
|
735
|
-
label: "1.15",
|
|
736
|
-
value: 276
|
|
737
|
-
},
|
|
738
|
-
{
|
|
739
|
-
label: "1.5",
|
|
740
|
-
value: 360
|
|
741
|
-
},
|
|
742
|
-
{
|
|
743
|
-
label: "Double",
|
|
744
|
-
value: 480
|
|
745
|
-
}
|
|
746
|
-
], Ie = [
|
|
747
|
-
.5,
|
|
748
|
-
.75,
|
|
749
|
-
1,
|
|
750
|
-
1.25,
|
|
751
|
-
1.5,
|
|
752
|
-
2
|
|
753
|
-
];
|
|
754
|
-
//#endregion
|
|
755
|
-
//#region src/composables/useToolbarDropdowns.ts
|
|
756
|
-
function Le(e) {
|
|
757
|
-
let t = y(null), n = y({
|
|
758
|
-
top: 0,
|
|
759
|
-
left: 0
|
|
760
|
-
});
|
|
761
|
-
function r(t) {
|
|
762
|
-
switch (t) {
|
|
763
|
-
case "zoom": return e.zoom.value;
|
|
764
|
-
case "style": return e.style.value;
|
|
765
|
-
case "font": return e.font.value;
|
|
766
|
-
case "size": return e.size.value;
|
|
767
|
-
case "align": return e.align.value;
|
|
768
|
-
case "spacing": return e.spacing.value;
|
|
769
|
-
default: return null;
|
|
770
|
-
}
|
|
771
|
-
}
|
|
772
|
-
function a(e) {
|
|
773
|
-
let t = r(e);
|
|
774
|
-
if (!t) return;
|
|
775
|
-
let i = t.getBoundingClientRect();
|
|
776
|
-
n.value = {
|
|
777
|
-
top: i.bottom,
|
|
778
|
-
left: i.left
|
|
779
|
-
};
|
|
780
|
-
}
|
|
781
|
-
let o = i(() => ({
|
|
782
|
-
top: n.value.top + "px",
|
|
783
|
-
left: n.value.left + "px"
|
|
784
|
-
}));
|
|
785
|
-
function s(e) {
|
|
786
|
-
t.value !== e && a(e), t.value = t.value === e ? null : e;
|
|
787
|
-
}
|
|
788
|
-
function c(n) {
|
|
789
|
-
let r = [
|
|
790
|
-
e.zoom,
|
|
791
|
-
e.style,
|
|
792
|
-
e.font,
|
|
793
|
-
e.size,
|
|
794
|
-
e.align,
|
|
795
|
-
e.spacing
|
|
796
|
-
], i = n.target;
|
|
797
|
-
r.some((e) => e.value?.contains(i)) || (t.value = null);
|
|
798
|
-
}
|
|
799
|
-
return g(() => document.addEventListener("mousedown", c)), h(() => document.removeEventListener("mousedown", c)), {
|
|
800
|
-
openDropdown: t,
|
|
801
|
-
dropdownMenuStyle: o,
|
|
802
|
-
toggleDropdown: s
|
|
803
|
-
};
|
|
804
|
-
}
|
|
805
|
-
//#endregion
|
|
806
|
-
//#region src/components/Toolbar.vue?vue&type=script&setup=true&lang.ts
|
|
807
|
-
var Re = {
|
|
808
|
-
key: 0,
|
|
809
|
-
class: "basic-toolbar"
|
|
810
|
-
}, ze = ["disabled"], Be = ["disabled"], Ve = ["disabled"], He = ["disabled"], Ue = ["onMousedown"], We = ["onMousedown"], Ge = {
|
|
811
|
-
key: 0,
|
|
812
|
-
class: "toolbar-dropdown__group-label"
|
|
813
|
-
}, Ke = ["onMousedown"], qe = ["onMousedown"], Je = ["disabled"], Ye = ["onMousedown"], Xe = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
814
|
-
__name: "Toolbar",
|
|
815
|
-
props: {
|
|
816
|
-
view: {},
|
|
817
|
-
getCommands: { type: Function },
|
|
818
|
-
stateTick: {},
|
|
819
|
-
zoomPercent: {},
|
|
820
|
-
isMinZoom: { type: Boolean },
|
|
821
|
-
isMaxZoom: { type: Boolean },
|
|
822
|
-
zoomPresets: {},
|
|
823
|
-
showZoomControl: { type: Boolean },
|
|
824
|
-
editorMode: {},
|
|
825
|
-
commentsSidebarOpen: { type: Boolean },
|
|
826
|
-
imageContext: {},
|
|
827
|
-
theme: {},
|
|
828
|
-
fontFamilies: {}
|
|
829
|
-
},
|
|
830
|
-
emits: [
|
|
831
|
-
"find-replace",
|
|
832
|
-
"insert-table",
|
|
833
|
-
"insert-image",
|
|
834
|
-
"insert-link",
|
|
835
|
-
"insert-symbol",
|
|
836
|
-
"insert-page-break",
|
|
837
|
-
"insert-toc",
|
|
838
|
-
"page-setup",
|
|
839
|
-
"toggle-outline",
|
|
840
|
-
"zoom-in",
|
|
841
|
-
"zoom-out",
|
|
842
|
-
"zoom-set",
|
|
843
|
-
"toggle-sidebar",
|
|
844
|
-
"apply-style",
|
|
845
|
-
"mode-change",
|
|
846
|
-
"image-wrap-type",
|
|
847
|
-
"image-properties",
|
|
848
|
-
"image-transform"
|
|
849
|
-
],
|
|
850
|
-
setup(e, { emit: n }) {
|
|
851
|
-
let d = e, f = n, h = i(() => d.zoomPercent ?? 100), g = i(() => d.isMinZoom ?? !1), v = i(() => d.isMaxZoom ?? !1), S = i(() => d.zoomPresets ?? Ie), T = i(() => d.showZoomControl ?? !0), E = y(null), D = y(null), O = y(null), k = y(null), A = y(null), I = y(null), { openDropdown: L, dropdownMenuStyle: R, toggleDropdown: z } = Le({
|
|
852
|
-
zoom: I,
|
|
853
|
-
style: E,
|
|
854
|
-
font: D,
|
|
855
|
-
size: O,
|
|
856
|
-
align: k,
|
|
857
|
-
spacing: A
|
|
858
|
-
}), V = i(() => {
|
|
859
|
-
d.stateTick;
|
|
860
|
-
let e = d.view;
|
|
861
|
-
return e ? P(e.state) : {
|
|
862
|
-
hasSelection: !1,
|
|
863
|
-
isMultiParagraph: !1,
|
|
864
|
-
textFormatting: {},
|
|
865
|
-
paragraphFormatting: {},
|
|
866
|
-
startParagraphIndex: 0,
|
|
867
|
-
endParagraphIndex: 0,
|
|
868
|
-
inList: !1,
|
|
869
|
-
activeCommentIds: [],
|
|
870
|
-
inInsertion: !1,
|
|
871
|
-
inDeletion: !1
|
|
872
|
-
};
|
|
873
|
-
}), H = i(() => {
|
|
874
|
-
let e = V.value.textFormatting.fontFamily;
|
|
875
|
-
return e?.ascii || e?.hAnsi || "Arial";
|
|
876
|
-
}), U = i(() => {
|
|
877
|
-
let e = V.value.textFormatting.fontSize;
|
|
878
|
-
return e ? e / 2 : 11;
|
|
879
|
-
}), W = i(() => V.value.paragraphFormatting.alignment || "left"), G = i(() => {
|
|
880
|
-
switch (W.value) {
|
|
881
|
-
case "center": return "format_align_center";
|
|
882
|
-
case "right": return "format_align_right";
|
|
883
|
-
case "both": return "format_align_justify";
|
|
884
|
-
default: return "format_align_left";
|
|
885
|
-
}
|
|
886
|
-
}), K = i(() => {
|
|
887
|
-
let e = V.value.paragraphFormatting.styleId || "Normal";
|
|
888
|
-
return Pe.find((t) => t.id === e)?.label || e;
|
|
889
|
-
}), q = i(() => {
|
|
890
|
-
d.stateTick;
|
|
891
|
-
let e = d.view;
|
|
892
|
-
return e ? N(e.state) > 0 : !1;
|
|
893
|
-
}), J = i(() => {
|
|
894
|
-
d.stateTick;
|
|
895
|
-
let e = d.view;
|
|
896
|
-
return e ? M(e.state) > 0 : !1;
|
|
897
|
-
}), ee = i(() => {
|
|
898
|
-
let e = V.value, t = e.inList && (e.listLevel ?? 0) > 0, n = (e.paragraphFormatting.indentLeft ?? 0) > 0;
|
|
899
|
-
return t || n;
|
|
900
|
-
}), te = i(() => {
|
|
901
|
-
let e = V.value.textFormatting.color?.rgb;
|
|
902
|
-
return e ? e.replace(/^#/, "").toUpperCase() : void 0;
|
|
903
|
-
}), ne = i(() => {
|
|
904
|
-
let e = V.value.textFormatting.highlight;
|
|
905
|
-
if (!(!e || e === "none")) return e.replace(/^#/, "").toUpperCase();
|
|
906
|
-
}), Y = i(() => B(d.fontFamilies) ?? Me), re = i(() => [
|
|
907
|
-
{
|
|
908
|
-
label: "Sans-serif",
|
|
909
|
-
fonts: Y.value.filter((e) => e.category === "sans-serif")
|
|
910
|
-
},
|
|
911
|
-
{
|
|
912
|
-
label: "Serif",
|
|
913
|
-
fonts: Y.value.filter((e) => e.category === "serif")
|
|
914
|
-
},
|
|
915
|
-
{
|
|
916
|
-
label: "Monospace",
|
|
917
|
-
fonts: Y.value.filter((e) => e.category === "monospace")
|
|
918
|
-
},
|
|
919
|
-
{
|
|
920
|
-
label: "Other",
|
|
921
|
-
fonts: Y.value.filter((e) => !e.category || e.category === "other")
|
|
922
|
-
}
|
|
923
|
-
]);
|
|
924
|
-
function X(e, ...t) {
|
|
925
|
-
let n = d.view;
|
|
926
|
-
if (!n) return;
|
|
927
|
-
let r = d.getCommands()[e];
|
|
928
|
-
if (!r) {
|
|
929
|
-
console.warn("[Toolbar] command not found:", e);
|
|
930
|
-
return;
|
|
931
|
-
}
|
|
932
|
-
r(...t)(n.state, (e) => n.dispatch(e), n), n.hasFocus() || n.focus(), L.value = null;
|
|
933
|
-
}
|
|
934
|
-
function ie(e) {
|
|
935
|
-
X("setFontFamily", e);
|
|
936
|
-
}
|
|
937
|
-
function ae(e) {
|
|
938
|
-
X("setFontSize", e * 2);
|
|
939
|
-
}
|
|
940
|
-
function oe() {
|
|
941
|
-
let e = U.value;
|
|
942
|
-
ae(Ne.find((t) => t > e) || e + 2);
|
|
943
|
-
}
|
|
944
|
-
function se() {
|
|
945
|
-
let e = U.value;
|
|
946
|
-
ae([...Ne].reverse().find((t) => t < e) || Math.max(1, e - 2));
|
|
947
|
-
}
|
|
948
|
-
function ce(e) {
|
|
949
|
-
if (typeof e == "object" && e.auto) {
|
|
950
|
-
X("clearTextColor");
|
|
951
|
-
return;
|
|
952
|
-
}
|
|
953
|
-
X("setTextColor", typeof e == "string" ? { rgb: e } : e);
|
|
954
|
-
}
|
|
955
|
-
function le() {
|
|
956
|
-
let e = d.view;
|
|
957
|
-
e && (F(e.state, (t) => e.dispatch(t), e), e.hasFocus() || e.focus());
|
|
958
|
-
}
|
|
959
|
-
function ue(e) {
|
|
960
|
-
X("setHighlight", typeof e == "string" ? e : e.rgb ?? "none");
|
|
961
|
-
}
|
|
962
|
-
function de(e) {
|
|
963
|
-
f("apply-style", e), L.value = null;
|
|
964
|
-
}
|
|
965
|
-
function fe(e) {
|
|
966
|
-
X("setLineSpacing", e);
|
|
967
|
-
}
|
|
968
|
-
function pe(e) {
|
|
969
|
-
let t = V.value.paragraphFormatting.lineSpacing;
|
|
970
|
-
return t ? Math.abs(t - e) < 10 : e === 240;
|
|
971
|
-
}
|
|
972
|
-
return (n, i) => e.view ? (_(), s("div", Re, [
|
|
973
|
-
c("button", {
|
|
974
|
-
title: "Undo (Ctrl+Z)",
|
|
975
|
-
disabled: !q.value,
|
|
976
|
-
onMousedown: i[0] ||= j((e) => X("undo"), ["prevent"])
|
|
977
|
-
}, [u(t, { name: "undo" })], 40, ze),
|
|
978
|
-
c("button", {
|
|
979
|
-
title: "Redo (Ctrl+Y)",
|
|
980
|
-
disabled: !J.value,
|
|
981
|
-
onMousedown: i[1] ||= j((e) => X("redo"), ["prevent"])
|
|
982
|
-
}, [u(t, { name: "redo" })], 40, Be),
|
|
983
|
-
i[35] ||= c("span", { class: "divider" }, null, -1),
|
|
984
|
-
T.value ? (_(), s("div", {
|
|
985
|
-
key: 0,
|
|
986
|
-
class: "toolbar-dropdown zoom-group",
|
|
987
|
-
ref_key: "zoomDropdownRef",
|
|
988
|
-
ref: I
|
|
989
|
-
}, [
|
|
990
|
-
c("button", {
|
|
991
|
-
class: "size-btn",
|
|
992
|
-
onMousedown: i[2] ||= j((e) => n.$emit("zoom-out"), ["prevent"]),
|
|
993
|
-
disabled: g.value,
|
|
994
|
-
title: "Zoom out"
|
|
995
|
-
}, " − ", 40, Ve),
|
|
996
|
-
c("button", {
|
|
997
|
-
class: "toolbar-dropdown__trigger zoom-trigger",
|
|
998
|
-
onMousedown: i[3] ||= j((e) => w(z)("zoom"), ["prevent"]),
|
|
999
|
-
title: "Zoom level"
|
|
1000
|
-
}, C(h.value) + "% ", 33),
|
|
1001
|
-
c("button", {
|
|
1002
|
-
class: "size-btn",
|
|
1003
|
-
onMousedown: i[4] ||= j((e) => n.$emit("zoom-in"), ["prevent"]),
|
|
1004
|
-
disabled: v.value,
|
|
1005
|
-
title: "Zoom in"
|
|
1006
|
-
}, " + ", 40, He),
|
|
1007
|
-
w(L) === "zoom" ? (_(), s("div", {
|
|
1008
|
-
key: 0,
|
|
1009
|
-
style: m(w(R)),
|
|
1010
|
-
class: "toolbar-dropdown__menu zoom-menu"
|
|
1011
|
-
}, [(_(!0), s(r, null, b(S.value, (e) => (_(), s("button", {
|
|
1012
|
-
key: e,
|
|
1013
|
-
class: p(["toolbar-dropdown__item", { active: h.value === Math.round(e * 100) }]),
|
|
1014
|
-
onMousedown: j((t) => n.$emit("zoom-set", e), ["prevent"])
|
|
1015
|
-
}, C(Math.round(e * 100)) + "% ", 43, Ue))), 128))], 4)) : o("", !0)
|
|
1016
|
-
], 512)) : o("", !0),
|
|
1017
|
-
i[36] ||= c("span", { class: "divider" }, null, -1),
|
|
1018
|
-
c("div", {
|
|
1019
|
-
class: "toolbar-dropdown",
|
|
1020
|
-
ref_key: "styleDropdownRef",
|
|
1021
|
-
ref: E
|
|
1022
|
-
}, [c("button", {
|
|
1023
|
-
class: "toolbar-dropdown__trigger style-trigger",
|
|
1024
|
-
onMousedown: i[5] ||= j((e) => w(z)("style"), ["prevent"]),
|
|
1025
|
-
title: "Paragraph style"
|
|
1026
|
-
}, [l(C(K.value) + " ", 1), u(t, {
|
|
1027
|
-
class: "chevron",
|
|
1028
|
-
name: "arrow_drop_down",
|
|
1029
|
-
size: 16
|
|
1030
|
-
})], 32), w(L) === "style" ? (_(), s("div", {
|
|
1031
|
-
key: 0,
|
|
1032
|
-
style: m(w(R)),
|
|
1033
|
-
class: "toolbar-dropdown__menu style-menu"
|
|
1034
|
-
}, [(_(!0), s(r, null, b(w(Pe), (e) => (_(), s("button", {
|
|
1035
|
-
key: e.id,
|
|
1036
|
-
class: p(["toolbar-dropdown__item", { active: (V.value.paragraphFormatting.styleId || "Normal") === e.id }]),
|
|
1037
|
-
style: m(e.previewStyle),
|
|
1038
|
-
onMousedown: j((t) => de(e.id), ["prevent"])
|
|
1039
|
-
}, C(e.label), 47, We))), 128))], 4)) : o("", !0)], 512),
|
|
1040
|
-
i[37] ||= c("span", { class: "divider" }, null, -1),
|
|
1041
|
-
c("div", {
|
|
1042
|
-
class: "toolbar-dropdown",
|
|
1043
|
-
ref_key: "fontDropdownRef",
|
|
1044
|
-
ref: D
|
|
1045
|
-
}, [c("button", {
|
|
1046
|
-
class: "toolbar-dropdown__trigger font-trigger",
|
|
1047
|
-
onMousedown: i[6] ||= j((e) => w(z)("font"), ["prevent"]),
|
|
1048
|
-
title: "Font family"
|
|
1049
|
-
}, [l(C(H.value) + " ", 1), u(t, {
|
|
1050
|
-
class: "chevron",
|
|
1051
|
-
name: "arrow_drop_down",
|
|
1052
|
-
size: 16
|
|
1053
|
-
})], 32), w(L) === "font" ? (_(), s("div", {
|
|
1054
|
-
key: 0,
|
|
1055
|
-
style: m(w(R)),
|
|
1056
|
-
class: "toolbar-dropdown__menu font-menu"
|
|
1057
|
-
}, [(_(!0), s(r, null, b(re.value, (e) => (_(), s(r, { key: e.label }, [e.fonts.length > 0 ? (_(), s("div", Ge, C(e.label), 1)) : o("", !0), (_(!0), s(r, null, b(e.fonts, (e) => (_(), s("button", {
|
|
1058
|
-
key: e.name,
|
|
1059
|
-
class: p(["toolbar-dropdown__item", { active: H.value === e.name }]),
|
|
1060
|
-
style: m({ fontFamily: e.fontFamily }),
|
|
1061
|
-
onMousedown: j((t) => ie(e.name), ["prevent"])
|
|
1062
|
-
}, C(e.name), 47, Ke))), 128))], 64))), 128))], 4)) : o("", !0)], 512),
|
|
1063
|
-
c("div", {
|
|
1064
|
-
class: "toolbar-dropdown font-size-group",
|
|
1065
|
-
ref_key: "sizeDropdownRef",
|
|
1066
|
-
ref: O
|
|
1067
|
-
}, [
|
|
1068
|
-
c("button", {
|
|
1069
|
-
class: "size-btn",
|
|
1070
|
-
onMousedown: j(se, ["prevent"]),
|
|
1071
|
-
title: "Decrease font size"
|
|
1072
|
-
}, " − ", 32),
|
|
1073
|
-
c("button", {
|
|
1074
|
-
class: "toolbar-dropdown__trigger size-trigger",
|
|
1075
|
-
onMousedown: i[7] ||= j((e) => w(z)("size"), ["prevent"]),
|
|
1076
|
-
title: "Font size"
|
|
1077
|
-
}, C(U.value), 33),
|
|
1078
|
-
c("button", {
|
|
1079
|
-
class: "size-btn",
|
|
1080
|
-
onMousedown: j(oe, ["prevent"]),
|
|
1081
|
-
title: "Increase font size"
|
|
1082
|
-
}, " + ", 32),
|
|
1083
|
-
w(L) === "size" ? (_(), s("div", {
|
|
1084
|
-
key: 0,
|
|
1085
|
-
style: m(w(R)),
|
|
1086
|
-
class: "toolbar-dropdown__menu size-menu"
|
|
1087
|
-
}, [(_(!0), s(r, null, b(w(Ne), (e) => (_(), s("button", {
|
|
1088
|
-
key: e,
|
|
1089
|
-
class: p(["toolbar-dropdown__item", { active: U.value === e }]),
|
|
1090
|
-
onMousedown: j((t) => ae(e), ["prevent"])
|
|
1091
|
-
}, C(e), 43, qe))), 128))], 4)) : o("", !0)
|
|
1092
|
-
], 512),
|
|
1093
|
-
i[38] ||= c("span", { class: "divider" }, null, -1),
|
|
1094
|
-
c("button", {
|
|
1095
|
-
title: "Bold (Ctrl+B)",
|
|
1096
|
-
class: p({ active: V.value.textFormatting.bold }),
|
|
1097
|
-
onMousedown: i[8] ||= j((e) => X("toggleBold"), ["prevent"])
|
|
1098
|
-
}, [u(t, { name: "format_bold" })], 34),
|
|
1099
|
-
c("button", {
|
|
1100
|
-
title: "Italic (Ctrl+I)",
|
|
1101
|
-
class: p({ active: V.value.textFormatting.italic }),
|
|
1102
|
-
onMousedown: i[9] ||= j((e) => X("toggleItalic"), ["prevent"])
|
|
1103
|
-
}, [u(t, { name: "format_italic" })], 34),
|
|
1104
|
-
c("button", {
|
|
1105
|
-
title: "Underline (Ctrl+U)",
|
|
1106
|
-
class: p({ active: !!V.value.textFormatting.underline }),
|
|
1107
|
-
onMousedown: i[10] ||= j((e) => X("toggleUnderline"), ["prevent"])
|
|
1108
|
-
}, [u(t, { name: "format_underlined" })], 34),
|
|
1109
|
-
c("button", {
|
|
1110
|
-
title: "Strikethrough",
|
|
1111
|
-
class: p({ active: V.value.textFormatting.strike }),
|
|
1112
|
-
onMousedown: i[11] ||= j((e) => X("toggleStrike"), ["prevent"])
|
|
1113
|
-
}, [u(t, { name: "strikethrough_s" })], 34),
|
|
1114
|
-
u(Z, {
|
|
1115
|
-
mode: "text",
|
|
1116
|
-
value: te.value,
|
|
1117
|
-
theme: e.theme ?? null,
|
|
1118
|
-
onChange: ce
|
|
1119
|
-
}, null, 8, ["value", "theme"]),
|
|
1120
|
-
u(Z, {
|
|
1121
|
-
mode: "highlight",
|
|
1122
|
-
value: ne.value,
|
|
1123
|
-
theme: e.theme ?? null,
|
|
1124
|
-
onChange: ue
|
|
1125
|
-
}, null, 8, ["value", "theme"]),
|
|
1126
|
-
c("button", {
|
|
1127
|
-
title: "Insert link (Ctrl+K)",
|
|
1128
|
-
onMousedown: i[12] ||= j((e) => n.$emit("insert-link"), ["prevent"])
|
|
1129
|
-
}, [u(t, { name: "link" })], 32),
|
|
1130
|
-
c("button", {
|
|
1131
|
-
title: "Superscript (Ctrl+Shift+=)",
|
|
1132
|
-
class: p({ active: V.value.textFormatting.vertAlign === "superscript" }),
|
|
1133
|
-
onMousedown: i[13] ||= j((e) => X("toggleSuperscript"), ["prevent"])
|
|
1134
|
-
}, [u(t, { name: "superscript" })], 34),
|
|
1135
|
-
c("button", {
|
|
1136
|
-
title: "Subscript (Ctrl+=)",
|
|
1137
|
-
class: p({ active: V.value.textFormatting.vertAlign === "subscript" }),
|
|
1138
|
-
onMousedown: i[14] ||= j((e) => X("toggleSubscript"), ["prevent"])
|
|
1139
|
-
}, [u(t, { name: "subscript" })], 34),
|
|
1140
|
-
i[39] ||= c("span", { class: "divider" }, null, -1),
|
|
1141
|
-
c("div", {
|
|
1142
|
-
class: "toolbar-dropdown",
|
|
1143
|
-
ref_key: "alignDropdownRef",
|
|
1144
|
-
ref: k
|
|
1145
|
-
}, [c("button", {
|
|
1146
|
-
class: "toolbar-dropdown__trigger align-trigger",
|
|
1147
|
-
onMousedown: i[15] ||= j((e) => w(z)("align"), ["prevent"]),
|
|
1148
|
-
title: "Alignment"
|
|
1149
|
-
}, [u(t, { name: G.value }, null, 8, ["name"]), u(t, {
|
|
1150
|
-
class: "chevron",
|
|
1151
|
-
name: "arrow_drop_down",
|
|
1152
|
-
size: 16
|
|
1153
|
-
})], 32), w(L) === "align" ? (_(), s("div", {
|
|
1154
|
-
key: 0,
|
|
1155
|
-
style: m(w(R)),
|
|
1156
|
-
class: "toolbar-dropdown__menu align-menu"
|
|
1157
|
-
}, [
|
|
1158
|
-
c("button", {
|
|
1159
|
-
class: p(["toolbar-dropdown__item dropdown-item--icon", { active: W.value === "left" }]),
|
|
1160
|
-
onMousedown: i[16] ||= j((e) => {
|
|
1161
|
-
X("alignLeft"), L.value = null;
|
|
1162
|
-
}, ["prevent"])
|
|
1163
|
-
}, [u(t, {
|
|
1164
|
-
name: "format_align_left",
|
|
1165
|
-
size: 18
|
|
1166
|
-
}), i[30] ||= l(" Left (Ctrl+L) ", -1)], 34),
|
|
1167
|
-
c("button", {
|
|
1168
|
-
class: p(["toolbar-dropdown__item dropdown-item--icon", { active: W.value === "center" }]),
|
|
1169
|
-
onMousedown: i[17] ||= j((e) => {
|
|
1170
|
-
X("alignCenter"), L.value = null;
|
|
1171
|
-
}, ["prevent"])
|
|
1172
|
-
}, [u(t, {
|
|
1173
|
-
name: "format_align_center",
|
|
1174
|
-
size: 18
|
|
1175
|
-
}), i[31] ||= l(" Center (Ctrl+E) ", -1)], 34),
|
|
1176
|
-
c("button", {
|
|
1177
|
-
class: p(["toolbar-dropdown__item dropdown-item--icon", { active: W.value === "right" }]),
|
|
1178
|
-
onMousedown: i[18] ||= j((e) => {
|
|
1179
|
-
X("alignRight"), L.value = null;
|
|
1180
|
-
}, ["prevent"])
|
|
1181
|
-
}, [u(t, {
|
|
1182
|
-
name: "format_align_right",
|
|
1183
|
-
size: 18
|
|
1184
|
-
}), i[32] ||= l(" Right (Ctrl+R) ", -1)], 34),
|
|
1185
|
-
c("button", {
|
|
1186
|
-
class: p(["toolbar-dropdown__item dropdown-item--icon", { active: W.value === "both" }]),
|
|
1187
|
-
onMousedown: i[19] ||= j((e) => {
|
|
1188
|
-
X("alignJustify"), L.value = null;
|
|
1189
|
-
}, ["prevent"])
|
|
1190
|
-
}, [u(t, {
|
|
1191
|
-
name: "format_align_justify",
|
|
1192
|
-
size: 18
|
|
1193
|
-
}), i[33] ||= l(" Justify (Ctrl+J) ", -1)], 34)
|
|
1194
|
-
], 4)) : o("", !0)], 512),
|
|
1195
|
-
c("button", {
|
|
1196
|
-
title: "Bullet List",
|
|
1197
|
-
class: p({ active: V.value.inList && V.value.listType === "bullet" }),
|
|
1198
|
-
onMousedown: i[20] ||= j((e) => X("toggleBulletList"), ["prevent"])
|
|
1199
|
-
}, [u(t, { name: "format_list_bulleted" })], 34),
|
|
1200
|
-
c("button", {
|
|
1201
|
-
title: "Numbered List",
|
|
1202
|
-
class: p({ active: V.value.inList && V.value.listType === "numbered" }),
|
|
1203
|
-
onMousedown: i[21] ||= j((e) => X("toggleNumberedList"), ["prevent"])
|
|
1204
|
-
}, [u(t, { name: "format_list_numbered" })], 34),
|
|
1205
|
-
c("button", {
|
|
1206
|
-
title: "Decrease Indent (Shift+Tab)",
|
|
1207
|
-
disabled: !ee.value,
|
|
1208
|
-
onMousedown: i[22] ||= j((e) => X("outdent"), ["prevent"])
|
|
1209
|
-
}, [u(t, { name: "format_indent_decrease" })], 40, Je),
|
|
1210
|
-
c("button", {
|
|
1211
|
-
title: "Increase Indent (Tab)",
|
|
1212
|
-
onMousedown: i[23] ||= j((e) => X("indent"), ["prevent"])
|
|
1213
|
-
}, [u(t, { name: "format_indent_increase" })], 32),
|
|
1214
|
-
c("div", {
|
|
1215
|
-
class: "toolbar-dropdown",
|
|
1216
|
-
ref_key: "spacingDropdownRef",
|
|
1217
|
-
ref: A
|
|
1218
|
-
}, [c("button", {
|
|
1219
|
-
class: "toolbar-dropdown__trigger",
|
|
1220
|
-
onMousedown: i[24] ||= j((e) => w(z)("spacing"), ["prevent"]),
|
|
1221
|
-
title: "Line spacing"
|
|
1222
|
-
}, [u(t, { name: "format_line_spacing" }), u(t, {
|
|
1223
|
-
class: "chevron",
|
|
1224
|
-
name: "arrow_drop_down",
|
|
1225
|
-
size: 16
|
|
1226
|
-
})], 32), w(L) === "spacing" ? (_(), s("div", {
|
|
1227
|
-
key: 0,
|
|
1228
|
-
style: m(w(R)),
|
|
1229
|
-
class: "toolbar-dropdown__menu"
|
|
1230
|
-
}, [(_(!0), s(r, null, b(w(Fe), (e) => (_(), s("button", {
|
|
1231
|
-
key: e.value,
|
|
1232
|
-
class: p(["toolbar-dropdown__item", { active: pe(e.value) }]),
|
|
1233
|
-
onMousedown: j((t) => fe(e.value), ["prevent"])
|
|
1234
|
-
}, C(e.label), 43, Ye))), 128))], 4)) : o("", !0)], 512),
|
|
1235
|
-
c("button", {
|
|
1236
|
-
title: "Clear formatting",
|
|
1237
|
-
onMousedown: j(le, ["prevent"])
|
|
1238
|
-
}, [u(t, { name: "format_clear" })], 32),
|
|
1239
|
-
i[40] ||= c("span", { class: "divider" }, null, -1),
|
|
1240
|
-
c("button", {
|
|
1241
|
-
title: "Comments & Changes",
|
|
1242
|
-
class: p({ active: e.commentsSidebarOpen }),
|
|
1243
|
-
onMousedown: i[25] ||= j((e) => n.$emit("toggle-sidebar"), ["prevent"])
|
|
1244
|
-
}, [u(t, { name: "comment" })], 34),
|
|
1245
|
-
e.imageContext ? (_(), s(r, { key: 1 }, [
|
|
1246
|
-
i[34] ||= c("span", { class: "divider" }, null, -1),
|
|
1247
|
-
u(Ae, {
|
|
1248
|
-
"image-context": e.imageContext,
|
|
1249
|
-
onChange: i[26] ||= (e) => n.$emit("image-wrap-type", e)
|
|
1250
|
-
}, null, 8, ["image-context"]),
|
|
1251
|
-
u(je, { onTransform: i[27] ||= (e) => n.$emit("image-transform", e) }),
|
|
1252
|
-
c("button", {
|
|
1253
|
-
title: "Image properties",
|
|
1254
|
-
onMousedown: i[28] ||= j((e) => n.$emit("image-properties"), ["prevent"])
|
|
1255
|
-
}, [u(t, { name: "tune" })], 32)
|
|
1256
|
-
], 64)) : o("", !0),
|
|
1257
|
-
x(n.$slots, "table-context", {}, void 0, !0),
|
|
1258
|
-
i[41] ||= c("span", { class: "divider" }, null, -1),
|
|
1259
|
-
e.editorMode ? (_(), a(Te, {
|
|
1260
|
-
key: 2,
|
|
1261
|
-
"model-value": e.editorMode,
|
|
1262
|
-
"onUpdate:modelValue": i[29] ||= (e) => n.$emit("mode-change", e)
|
|
1263
|
-
}, null, 8, ["model-value"])) : o("", !0),
|
|
1264
|
-
x(n.$slots, "toolbar-extra", {}, void 0, !0)
|
|
1265
|
-
])) : o("", !0);
|
|
1266
|
-
}
|
|
1267
|
-
}), [["__scopeId", "data-v-25c08b74"]]), Ze = /* @__PURE__ */ d({
|
|
1268
|
-
__name: "TableCellFillPicker",
|
|
1269
|
-
props: {
|
|
1270
|
-
disabled: { type: Boolean },
|
|
1271
|
-
theme: {},
|
|
1272
|
-
value: {}
|
|
1273
|
-
},
|
|
1274
|
-
emits: ["change"],
|
|
1275
|
-
setup(t, { emit: n }) {
|
|
1276
|
-
let r = n, { t: i } = e();
|
|
1277
|
-
function o(e) {
|
|
1278
|
-
typeof e == "string" && r("change", e === "none" ? "" : e.replace(/^#/, ""));
|
|
1279
|
-
}
|
|
1280
|
-
return (e, n) => (_(), a(Z, {
|
|
1281
|
-
mode: "highlight",
|
|
1282
|
-
value: t.value,
|
|
1283
|
-
theme: t.theme ?? null,
|
|
1284
|
-
disabled: t.disabled,
|
|
1285
|
-
title: w(i)("table.cellFillColor"),
|
|
1286
|
-
icon: "format_color_fill",
|
|
1287
|
-
"auto-label": w(i)("colorPicker.noColor"),
|
|
1288
|
-
onChange: o
|
|
1289
|
-
}, null, 8, [
|
|
1290
|
-
"value",
|
|
1291
|
-
"theme",
|
|
1292
|
-
"disabled",
|
|
1293
|
-
"title",
|
|
1294
|
-
"auto-label"
|
|
1295
|
-
]));
|
|
1296
|
-
}
|
|
1297
|
-
}), Qe = ["disabled", "onClick"], $e = { class: "docx-tbp__panel" }, et = ["title", "onClick"], tt = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
1298
|
-
__name: "TableBorderPicker",
|
|
1299
|
-
props: { disabled: { type: Boolean } },
|
|
1300
|
-
emits: ["change"],
|
|
1301
|
-
setup(e, { emit: n }) {
|
|
1302
|
-
let i = n, o = y(!1), l = [
|
|
1303
|
-
{
|
|
1304
|
-
value: "all",
|
|
1305
|
-
icon: "border_all",
|
|
1306
|
-
label: "All borders"
|
|
1307
|
-
},
|
|
1308
|
-
{
|
|
1309
|
-
value: "none",
|
|
1310
|
-
icon: "border_clear",
|
|
1311
|
-
label: "No borders"
|
|
1312
|
-
},
|
|
1313
|
-
{
|
|
1314
|
-
value: "box",
|
|
1315
|
-
icon: "border_outer",
|
|
1316
|
-
label: "Outside borders"
|
|
1317
|
-
},
|
|
1318
|
-
{
|
|
1319
|
-
value: "inside",
|
|
1320
|
-
icon: "border_inner",
|
|
1321
|
-
label: "Inside borders"
|
|
1322
|
-
},
|
|
1323
|
-
{
|
|
1324
|
-
value: "top",
|
|
1325
|
-
icon: "border_top",
|
|
1326
|
-
label: "Top border"
|
|
1327
|
-
},
|
|
1328
|
-
{
|
|
1329
|
-
value: "bottom",
|
|
1330
|
-
icon: "border_bottom",
|
|
1331
|
-
label: "Bottom border"
|
|
1332
|
-
},
|
|
1333
|
-
{
|
|
1334
|
-
value: "left",
|
|
1335
|
-
icon: "border_left",
|
|
1336
|
-
label: "Left border"
|
|
1337
|
-
},
|
|
1338
|
-
{
|
|
1339
|
-
value: "right",
|
|
1340
|
-
icon: "border_right",
|
|
1341
|
-
label: "Right border"
|
|
1342
|
-
},
|
|
1343
|
-
{
|
|
1344
|
-
value: "insideH",
|
|
1345
|
-
icon: "border_horizontal",
|
|
1346
|
-
label: "Inside horizontal"
|
|
1347
|
-
},
|
|
1348
|
-
{
|
|
1349
|
-
value: "insideV",
|
|
1350
|
-
icon: "border_vertical",
|
|
1351
|
-
label: "Inside vertical"
|
|
1352
|
-
}
|
|
1353
|
-
];
|
|
1354
|
-
function d(e) {
|
|
1355
|
-
i("change", e), o.value = !1;
|
|
1356
|
-
}
|
|
1357
|
-
return (n, i) => (_(), a(Q, {
|
|
1358
|
-
open: o.value,
|
|
1359
|
-
"onUpdate:open": i[0] ||= (e) => o.value = e,
|
|
1360
|
-
onClose: i[1] ||= (e) => o.value = !1
|
|
1361
|
-
}, {
|
|
1362
|
-
trigger: O(({ toggle: n }) => [c("button", {
|
|
1363
|
-
type: "button",
|
|
1364
|
-
class: "docx-tbp__btn",
|
|
1365
|
-
disabled: e.disabled,
|
|
1366
|
-
title: "Borders",
|
|
1367
|
-
onClick: j(n, ["prevent"])
|
|
1368
|
-
}, [u(t, {
|
|
1369
|
-
name: "border_all",
|
|
1370
|
-
size: 20
|
|
1371
|
-
})], 8, Qe)]),
|
|
1372
|
-
panel: O(() => [c("div", $e, [(_(), s(r, null, b(l, (e) => c("button", {
|
|
1373
|
-
key: e.value,
|
|
1374
|
-
type: "button",
|
|
1375
|
-
class: "docx-tbp__option",
|
|
1376
|
-
title: e.label,
|
|
1377
|
-
onClick: j((t) => d(e.value), ["prevent"])
|
|
1378
|
-
}, [u(t, {
|
|
1379
|
-
name: e.icon,
|
|
1380
|
-
size: 20
|
|
1381
|
-
}, null, 8, ["name"])], 8, et)), 64))])]),
|
|
1382
|
-
_: 1
|
|
1383
|
-
}, 8, ["open"]));
|
|
1384
|
-
}
|
|
1385
|
-
}), [["__scopeId", "data-v-51d7b6e0"]]), nt = /* @__PURE__ */ d({
|
|
1386
|
-
__name: "TableBorderColorPicker",
|
|
1387
|
-
props: {
|
|
1388
|
-
disabled: { type: Boolean },
|
|
1389
|
-
theme: {},
|
|
1390
|
-
value: {}
|
|
1391
|
-
},
|
|
1392
|
-
emits: ["change"],
|
|
1393
|
-
setup(t, { emit: n }) {
|
|
1394
|
-
let r = n, { t: i } = e();
|
|
1395
|
-
function o(e) {
|
|
1396
|
-
typeof e == "string" ? r("change", e.replace(/^#/, "")) : e.rgb ? r("change", e.rgb.replace(/^#/, "")) : e.auto && r("change", "000000");
|
|
1397
|
-
}
|
|
1398
|
-
return (e, n) => (_(), a(Z, {
|
|
1399
|
-
mode: "border",
|
|
1400
|
-
value: t.value,
|
|
1401
|
-
theme: t.theme ?? null,
|
|
1402
|
-
disabled: t.disabled,
|
|
1403
|
-
title: w(i)("table.borderColor"),
|
|
1404
|
-
onChange: o
|
|
1405
|
-
}, null, 8, [
|
|
1406
|
-
"value",
|
|
1407
|
-
"theme",
|
|
1408
|
-
"disabled",
|
|
1409
|
-
"title"
|
|
1410
|
-
]));
|
|
1411
|
-
}
|
|
1412
|
-
}), rt = ["disabled", "onClick"], it = { class: "docx-tbwidth__panel" }, at = ["onClick"], ot = { class: "docx-tbwidth__label" }, st = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
1413
|
-
__name: "TableBorderWidthPicker",
|
|
1414
|
-
props: { disabled: { type: Boolean } },
|
|
1415
|
-
emits: ["change"],
|
|
1416
|
-
setup(e, { emit: n }) {
|
|
1417
|
-
let i = n, o = y(!1), l = [
|
|
1418
|
-
{
|
|
1419
|
-
label: "0.5pt",
|
|
1420
|
-
eighths: 4,
|
|
1421
|
-
previewPx: 1
|
|
1422
|
-
},
|
|
1423
|
-
{
|
|
1424
|
-
label: "0.75pt",
|
|
1425
|
-
eighths: 6,
|
|
1426
|
-
previewPx: 1
|
|
1427
|
-
},
|
|
1428
|
-
{
|
|
1429
|
-
label: "1pt",
|
|
1430
|
-
eighths: 8,
|
|
1431
|
-
previewPx: 2
|
|
1432
|
-
},
|
|
1433
|
-
{
|
|
1434
|
-
label: "1.5pt",
|
|
1435
|
-
eighths: 12,
|
|
1436
|
-
previewPx: 2
|
|
1437
|
-
},
|
|
1438
|
-
{
|
|
1439
|
-
label: "2.25pt",
|
|
1440
|
-
eighths: 18,
|
|
1441
|
-
previewPx: 3
|
|
1442
|
-
},
|
|
1443
|
-
{
|
|
1444
|
-
label: "3pt",
|
|
1445
|
-
eighths: 24,
|
|
1446
|
-
previewPx: 4
|
|
1447
|
-
},
|
|
1448
|
-
{
|
|
1449
|
-
label: "4.5pt",
|
|
1450
|
-
eighths: 36,
|
|
1451
|
-
previewPx: 6
|
|
1452
|
-
},
|
|
1453
|
-
{
|
|
1454
|
-
label: "6pt",
|
|
1455
|
-
eighths: 48,
|
|
1456
|
-
previewPx: 8
|
|
1457
|
-
}
|
|
1458
|
-
];
|
|
1459
|
-
function d(e) {
|
|
1460
|
-
i("change", e), o.value = !1;
|
|
1461
|
-
}
|
|
1462
|
-
return (n, i) => (_(), a(Q, {
|
|
1463
|
-
open: o.value,
|
|
1464
|
-
"onUpdate:open": i[0] ||= (e) => o.value = e,
|
|
1465
|
-
onClose: i[1] ||= (e) => o.value = !1
|
|
1466
|
-
}, {
|
|
1467
|
-
trigger: O(({ toggle: n }) => [c("button", {
|
|
1468
|
-
type: "button",
|
|
1469
|
-
class: "docx-tbwidth__btn",
|
|
1470
|
-
disabled: e.disabled,
|
|
1471
|
-
title: "Border width",
|
|
1472
|
-
onClick: j(n, ["prevent"])
|
|
1473
|
-
}, [u(t, {
|
|
1474
|
-
name: "line_weight",
|
|
1475
|
-
size: 20
|
|
1476
|
-
})], 8, rt)]),
|
|
1477
|
-
panel: O(() => [c("div", it, [(_(), s(r, null, b(l, (e) => c("button", {
|
|
1478
|
-
key: e.eighths,
|
|
1479
|
-
type: "button",
|
|
1480
|
-
class: "docx-tbwidth__option",
|
|
1481
|
-
onClick: j((t) => d(e.eighths), ["prevent"])
|
|
1482
|
-
}, [c("span", {
|
|
1483
|
-
class: "docx-tbwidth__preview",
|
|
1484
|
-
style: m({ borderTopWidth: e.previewPx + "px" })
|
|
1485
|
-
}, null, 4), c("span", ot, C(e.label), 1)], 8, at)), 64))])]),
|
|
1486
|
-
_: 1
|
|
1487
|
-
}, 8, ["open"]));
|
|
1488
|
-
}
|
|
1489
|
-
}), [["__scopeId", "data-v-c134095d"]]), ct = [
|
|
1490
|
-
"disabled",
|
|
1491
|
-
"title",
|
|
1492
|
-
"onClick"
|
|
1493
|
-
], lt = ["aria-label"], ut = ["disabled"], dt = ["disabled"], ft = ["disabled"], pt = ["disabled"], mt = { class: "docx-tmore__section-label" }, ht = { class: "docx-tmore__icon-row" }, gt = ["title"], _t = ["title"], vt = ["title"], yt = { class: "docx-tmore__section-label" }, bt = { class: "docx-tmore__icon-row" }, xt = ["title"], St = ["title"], Ct = ["title"], wt = { class: "docx-tmore__grow" }, Tt = {
|
|
1494
|
-
key: 0,
|
|
1495
|
-
class: "docx-tmore__sub"
|
|
1496
|
-
}, Et = { class: "docx-tmore__margin-grid" }, Dt = { class: "docx-tmore__field-label" }, Ot = ["onUpdate:modelValue"], kt = { class: "docx-tmore__grow" }, At = {
|
|
1497
|
-
key: 1,
|
|
1498
|
-
class: "docx-tmore__sub"
|
|
1499
|
-
}, jt = { class: "docx-tmore__row-field" }, Mt = { class: "docx-tmore__field-label" }, Nt = { value: "auto" }, Pt = { value: "atLeast" }, Ft = { value: "exact" }, It = {
|
|
1500
|
-
key: 0,
|
|
1501
|
-
class: "docx-tmore__row-field"
|
|
1502
|
-
}, Lt = { class: "docx-tmore__field-label" }, Rt = { class: "docx-tmore__grow" }, zt = {
|
|
1503
|
-
key: 2,
|
|
1504
|
-
class: "docx-tmore__sub docx-tmore__sub--list"
|
|
1505
|
-
}, Bt = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
1506
|
-
__name: "TableMoreDropdown",
|
|
1507
|
-
props: {
|
|
1508
|
-
disabled: {
|
|
1509
|
-
type: Boolean,
|
|
1510
|
-
default: !1
|
|
1511
|
-
},
|
|
1512
|
-
canSplit: {
|
|
1513
|
-
type: Boolean,
|
|
1514
|
-
default: !1
|
|
1515
|
-
},
|
|
1516
|
-
canMerge: {
|
|
1517
|
-
type: Boolean,
|
|
1518
|
-
default: !1
|
|
1519
|
-
},
|
|
1520
|
-
rowCount: { default: 0 },
|
|
1521
|
-
columnCount: { default: 0 },
|
|
1522
|
-
currentJustification: { default: "left" }
|
|
1523
|
-
},
|
|
1524
|
-
emits: [
|
|
1525
|
-
"action",
|
|
1526
|
-
"cell-margins",
|
|
1527
|
-
"cell-text-direction",
|
|
1528
|
-
"row-height"
|
|
1529
|
-
],
|
|
1530
|
-
setup(n, { emit: i }) {
|
|
1531
|
-
let l = n, d = i, { t: f } = e(), m = y(!1), h = y(!1), g = y(!1), x = y(!1), S = v({
|
|
1532
|
-
top: 0,
|
|
1533
|
-
bottom: 0,
|
|
1534
|
-
left: 108,
|
|
1535
|
-
right: 108
|
|
1536
|
-
}), A = y(0), M = y("atLeast");
|
|
1537
|
-
D(m, (e) => {
|
|
1538
|
-
e || (h.value = !1, g.value = !1, x.value = !1);
|
|
1539
|
-
});
|
|
1540
|
-
function N(e) {
|
|
1541
|
-
return l.disabled ? !0 : e === "splitCell" ? !l.canSplit : e === "mergeCells" ? !l.canMerge : e === "deleteRow" ? (l.rowCount ?? 0) <= 1 : e === "deleteColumn" ? (l.columnCount ?? 0) <= 1 : !1;
|
|
1542
|
-
}
|
|
1543
|
-
function P(e) {
|
|
1544
|
-
N(e) || (d("action", e), m.value = !1);
|
|
1545
|
-
}
|
|
1546
|
-
let F = (e) => {
|
|
1547
|
-
let t = Number(e);
|
|
1548
|
-
return Number.isFinite(t) && t > 0 ? t : 0;
|
|
1549
|
-
};
|
|
1550
|
-
function I() {
|
|
1551
|
-
d("cell-margins", {
|
|
1552
|
-
top: F(S.top),
|
|
1553
|
-
bottom: F(S.bottom),
|
|
1554
|
-
left: F(S.left),
|
|
1555
|
-
right: F(S.right)
|
|
1556
|
-
}), m.value = !1;
|
|
1557
|
-
}
|
|
1558
|
-
function L() {
|
|
1559
|
-
let e = F(A.value);
|
|
1560
|
-
M.value === "auto" || e <= 0 ? d("row-height", { height: null }) : d("row-height", {
|
|
1561
|
-
height: e,
|
|
1562
|
-
rule: M.value
|
|
1563
|
-
}), m.value = !1;
|
|
1564
|
-
}
|
|
1565
|
-
function R(e) {
|
|
1566
|
-
d("cell-text-direction", e), m.value = !1;
|
|
1567
|
-
}
|
|
1568
|
-
return (e, i) => (_(), a(Q, {
|
|
1569
|
-
open: m.value,
|
|
1570
|
-
placement: "bottom-right",
|
|
1571
|
-
"onUpdate:open": i[34] ||= (e) => m.value = e,
|
|
1572
|
-
onClose: i[35] ||= (e) => m.value = !1
|
|
1573
|
-
}, {
|
|
1574
|
-
trigger: O(({ toggle: e }) => [c("button", {
|
|
1575
|
-
type: "button",
|
|
1576
|
-
class: p(["docx-tmore__btn", { "docx-tmore__btn--open": m.value }]),
|
|
1577
|
-
disabled: n.disabled,
|
|
1578
|
-
title: w(f)("tableAdvanced.tableOptions"),
|
|
1579
|
-
onClick: j(e, ["prevent"])
|
|
1580
|
-
}, [u(t, {
|
|
1581
|
-
name: "more_vert",
|
|
1582
|
-
size: 20
|
|
1583
|
-
})], 10, ct)]),
|
|
1584
|
-
panel: O(() => [c("div", {
|
|
1585
|
-
class: "docx-tmore__panel",
|
|
1586
|
-
role: "menu",
|
|
1587
|
-
"aria-label": w(f)("tableAdvanced.tableOptionsMenu")
|
|
1588
|
-
}, [
|
|
1589
|
-
c("button", {
|
|
1590
|
-
type: "button",
|
|
1591
|
-
class: "docx-tmore__item",
|
|
1592
|
-
onClick: i[0] ||= j((e) => P("addRowAbove"), ["prevent"])
|
|
1593
|
-
}, [u(t, {
|
|
1594
|
-
name: "add",
|
|
1595
|
-
size: 18
|
|
1596
|
-
}), c("span", null, C(w(f)("table.insertRowAbove")), 1)]),
|
|
1597
|
-
c("button", {
|
|
1598
|
-
type: "button",
|
|
1599
|
-
class: "docx-tmore__item",
|
|
1600
|
-
onClick: i[1] ||= j((e) => P("addRowBelow"), ["prevent"])
|
|
1601
|
-
}, [u(t, {
|
|
1602
|
-
name: "add",
|
|
1603
|
-
size: 18
|
|
1604
|
-
}), c("span", null, C(w(f)("table.insertRowBelow")), 1)]),
|
|
1605
|
-
c("button", {
|
|
1606
|
-
type: "button",
|
|
1607
|
-
class: "docx-tmore__item",
|
|
1608
|
-
onClick: i[2] ||= j((e) => P("addColumnLeft"), ["prevent"])
|
|
1609
|
-
}, [u(t, {
|
|
1610
|
-
name: "add",
|
|
1611
|
-
size: 18
|
|
1612
|
-
}), c("span", null, C(w(f)("table.insertColumnLeft")), 1)]),
|
|
1613
|
-
c("button", {
|
|
1614
|
-
type: "button",
|
|
1615
|
-
class: "docx-tmore__item",
|
|
1616
|
-
onClick: i[3] ||= j((e) => P("addColumnRight"), ["prevent"])
|
|
1617
|
-
}, [u(t, {
|
|
1618
|
-
name: "add",
|
|
1619
|
-
size: 18
|
|
1620
|
-
}), c("span", null, C(w(f)("table.insertColumnRight")), 1)]),
|
|
1621
|
-
i[38] ||= c("div", { class: "docx-tmore__separator" }, null, -1),
|
|
1622
|
-
c("button", {
|
|
1623
|
-
type: "button",
|
|
1624
|
-
class: "docx-tmore__item",
|
|
1625
|
-
disabled: N("mergeCells"),
|
|
1626
|
-
onClick: i[4] ||= j((e) => P("mergeCells"), ["prevent"])
|
|
1627
|
-
}, [u(t, {
|
|
1628
|
-
name: "call_merge",
|
|
1629
|
-
size: 18
|
|
1630
|
-
}), c("span", null, C(w(f)("table.mergeCells")), 1)], 8, ut),
|
|
1631
|
-
c("button", {
|
|
1632
|
-
type: "button",
|
|
1633
|
-
class: "docx-tmore__item",
|
|
1634
|
-
disabled: N("splitCell"),
|
|
1635
|
-
onClick: i[5] ||= j((e) => P("splitCell"), ["prevent"])
|
|
1636
|
-
}, [u(t, {
|
|
1637
|
-
name: "call_split",
|
|
1638
|
-
size: 18
|
|
1639
|
-
}), c("span", null, C(w(f)("table.splitCell")), 1)], 8, dt),
|
|
1640
|
-
i[39] ||= c("div", { class: "docx-tmore__separator" }, null, -1),
|
|
1641
|
-
c("button", {
|
|
1642
|
-
type: "button",
|
|
1643
|
-
class: "docx-tmore__item docx-tmore__item--danger",
|
|
1644
|
-
disabled: N("deleteRow"),
|
|
1645
|
-
onClick: i[6] ||= j((e) => P("deleteRow"), ["prevent"])
|
|
1646
|
-
}, [u(t, {
|
|
1647
|
-
name: "delete",
|
|
1648
|
-
size: 18
|
|
1649
|
-
}), c("span", null, C(w(f)("table.deleteRow")), 1)], 8, ft),
|
|
1650
|
-
c("button", {
|
|
1651
|
-
type: "button",
|
|
1652
|
-
class: "docx-tmore__item docx-tmore__item--danger",
|
|
1653
|
-
disabled: N("deleteColumn"),
|
|
1654
|
-
onClick: i[7] ||= j((e) => P("deleteColumn"), ["prevent"])
|
|
1655
|
-
}, [u(t, {
|
|
1656
|
-
name: "delete",
|
|
1657
|
-
size: 18
|
|
1658
|
-
}), c("span", null, C(w(f)("table.deleteColumn")), 1)], 8, pt),
|
|
1659
|
-
c("button", {
|
|
1660
|
-
type: "button",
|
|
1661
|
-
class: "docx-tmore__item docx-tmore__item--danger",
|
|
1662
|
-
onClick: i[8] ||= j((e) => P("deleteTable"), ["prevent"])
|
|
1663
|
-
}, [u(t, {
|
|
1664
|
-
name: "delete",
|
|
1665
|
-
size: 18
|
|
1666
|
-
}), c("span", null, C(w(f)("table.deleteTable")), 1)]),
|
|
1667
|
-
i[40] ||= c("div", { class: "docx-tmore__separator" }, null, -1),
|
|
1668
|
-
c("div", mt, C(w(f)("tableAdvanced.verticalAlignment")), 1),
|
|
1669
|
-
c("div", ht, [
|
|
1670
|
-
c("button", {
|
|
1671
|
-
type: "button",
|
|
1672
|
-
class: "docx-tmore__icon-btn",
|
|
1673
|
-
title: w(f)("tableAdvanced.top"),
|
|
1674
|
-
onMousedown: i[9] ||= j(() => {}, ["prevent"]),
|
|
1675
|
-
onClick: i[10] ||= j((e) => P("verticalAlignTop"), ["prevent"])
|
|
1676
|
-
}, [u(t, {
|
|
1677
|
-
name: "vertical_align_top",
|
|
1678
|
-
size: 16
|
|
1679
|
-
})], 40, gt),
|
|
1680
|
-
c("button", {
|
|
1681
|
-
type: "button",
|
|
1682
|
-
class: "docx-tmore__icon-btn",
|
|
1683
|
-
title: w(f)("tableAdvanced.middle"),
|
|
1684
|
-
onMousedown: i[11] ||= j(() => {}, ["prevent"]),
|
|
1685
|
-
onClick: i[12] ||= j((e) => P("verticalAlignMiddle"), ["prevent"])
|
|
1686
|
-
}, [u(t, {
|
|
1687
|
-
name: "vertical_align_center",
|
|
1688
|
-
size: 16
|
|
1689
|
-
})], 40, _t),
|
|
1690
|
-
c("button", {
|
|
1691
|
-
type: "button",
|
|
1692
|
-
class: "docx-tmore__icon-btn",
|
|
1693
|
-
title: w(f)("tableAdvanced.bottom"),
|
|
1694
|
-
onMousedown: i[13] ||= j(() => {}, ["prevent"]),
|
|
1695
|
-
onClick: i[14] ||= j((e) => P("verticalAlignBottom"), ["prevent"])
|
|
1696
|
-
}, [u(t, {
|
|
1697
|
-
name: "vertical_align_bottom",
|
|
1698
|
-
size: 16
|
|
1699
|
-
})], 40, vt)
|
|
1700
|
-
]),
|
|
1701
|
-
i[41] ||= c("div", { class: "docx-tmore__separator" }, null, -1),
|
|
1702
|
-
c("div", yt, C(w(f)("tableAdvanced.tableAlignment")), 1),
|
|
1703
|
-
c("div", bt, [
|
|
1704
|
-
c("button", {
|
|
1705
|
-
type: "button",
|
|
1706
|
-
class: p(["docx-tmore__icon-btn", { "docx-tmore__icon-btn--active": n.currentJustification === "left" }]),
|
|
1707
|
-
title: w(f)("tableAdvanced.alignTableLeft"),
|
|
1708
|
-
onMousedown: i[15] ||= j(() => {}, ["prevent"]),
|
|
1709
|
-
onClick: i[16] ||= j((e) => P("alignTableLeft"), ["prevent"])
|
|
1710
|
-
}, [u(t, {
|
|
1711
|
-
name: "format_align_left",
|
|
1712
|
-
size: 16
|
|
1713
|
-
})], 42, xt),
|
|
1714
|
-
c("button", {
|
|
1715
|
-
type: "button",
|
|
1716
|
-
class: p(["docx-tmore__icon-btn", { "docx-tmore__icon-btn--active": n.currentJustification === "center" }]),
|
|
1717
|
-
title: w(f)("tableAdvanced.alignTableCenter"),
|
|
1718
|
-
onMousedown: i[17] ||= j(() => {}, ["prevent"]),
|
|
1719
|
-
onClick: i[18] ||= j((e) => P("alignTableCenter"), ["prevent"])
|
|
1720
|
-
}, [u(t, {
|
|
1721
|
-
name: "format_align_center",
|
|
1722
|
-
size: 16
|
|
1723
|
-
})], 42, St),
|
|
1724
|
-
c("button", {
|
|
1725
|
-
type: "button",
|
|
1726
|
-
class: p(["docx-tmore__icon-btn", { "docx-tmore__icon-btn--active": n.currentJustification === "right" }]),
|
|
1727
|
-
title: w(f)("tableAdvanced.alignTableRight"),
|
|
1728
|
-
onMousedown: i[19] ||= j(() => {}, ["prevent"]),
|
|
1729
|
-
onClick: i[20] ||= j((e) => P("alignTableRight"), ["prevent"])
|
|
1730
|
-
}, [u(t, {
|
|
1731
|
-
name: "format_align_right",
|
|
1732
|
-
size: 16
|
|
1733
|
-
})], 42, Ct)
|
|
1734
|
-
]),
|
|
1735
|
-
i[42] ||= c("div", { class: "docx-tmore__separator" }, null, -1),
|
|
1736
|
-
c("button", {
|
|
1737
|
-
type: "button",
|
|
1738
|
-
class: "docx-tmore__item",
|
|
1739
|
-
onClick: i[21] ||= j((e) => h.value = !h.value, ["prevent"])
|
|
1740
|
-
}, [
|
|
1741
|
-
u(t, {
|
|
1742
|
-
name: "padding",
|
|
1743
|
-
size: 18
|
|
1744
|
-
}),
|
|
1745
|
-
c("span", wt, C(w(f)("tableAdvanced.cellMargins")), 1),
|
|
1746
|
-
u(t, {
|
|
1747
|
-
name: h.value ? "expand_less" : "expand_more",
|
|
1748
|
-
size: 18
|
|
1749
|
-
}, null, 8, ["name"])
|
|
1750
|
-
]),
|
|
1751
|
-
h.value ? (_(), s("div", Tt, [c("div", Et, [(_(), s(r, null, b([
|
|
1752
|
-
"top",
|
|
1753
|
-
"bottom",
|
|
1754
|
-
"left",
|
|
1755
|
-
"right"
|
|
1756
|
-
], (e) => c("label", {
|
|
1757
|
-
key: e,
|
|
1758
|
-
class: "docx-tmore__field"
|
|
1759
|
-
}, [
|
|
1760
|
-
c("span", Dt, C(e), 1),
|
|
1761
|
-
k(c("input", {
|
|
1762
|
-
type: "number",
|
|
1763
|
-
min: "0",
|
|
1764
|
-
step: "20",
|
|
1765
|
-
"onUpdate:modelValue": (t) => S[e] = t,
|
|
1766
|
-
class: "docx-tmore__input"
|
|
1767
|
-
}, null, 8, Ot), [[
|
|
1768
|
-
E,
|
|
1769
|
-
S[e],
|
|
1770
|
-
void 0,
|
|
1771
|
-
{ number: !0 }
|
|
1772
|
-
]]),
|
|
1773
|
-
i[36] ||= c("span", { class: "docx-tmore__unit" }, "tw", -1)
|
|
1774
|
-
])), 64))]), c("button", {
|
|
1775
|
-
type: "button",
|
|
1776
|
-
class: "docx-tmore__apply",
|
|
1777
|
-
onClick: j(I, ["prevent"])
|
|
1778
|
-
}, C(w(f)("common.apply")), 1)])) : o("", !0),
|
|
1779
|
-
c("button", {
|
|
1780
|
-
type: "button",
|
|
1781
|
-
class: "docx-tmore__item",
|
|
1782
|
-
onClick: i[22] ||= j((e) => g.value = !g.value, ["prevent"])
|
|
1783
|
-
}, [
|
|
1784
|
-
u(t, {
|
|
1785
|
-
name: "height",
|
|
1786
|
-
size: 18
|
|
1787
|
-
}),
|
|
1788
|
-
c("span", kt, C(w(f)("tableAdvanced.rowHeight")), 1),
|
|
1789
|
-
u(t, {
|
|
1790
|
-
name: g.value ? "expand_less" : "expand_more",
|
|
1791
|
-
size: 18
|
|
1792
|
-
}, null, 8, ["name"])
|
|
1793
|
-
]),
|
|
1794
|
-
g.value ? (_(), s("div", At, [
|
|
1795
|
-
c("label", jt, [c("span", Mt, C(w(f)("tableAdvanced.rule")), 1), k(c("select", {
|
|
1796
|
-
"onUpdate:modelValue": i[23] ||= (e) => M.value = e,
|
|
1797
|
-
class: "docx-tmore__select"
|
|
1798
|
-
}, [
|
|
1799
|
-
c("option", Nt, C(w(f)("tableAdvanced.heightRules.auto")), 1),
|
|
1800
|
-
c("option", Pt, C(w(f)("tableAdvanced.heightRules.atLeast")), 1),
|
|
1801
|
-
c("option", Ft, C(w(f)("tableAdvanced.heightRules.exact")), 1)
|
|
1802
|
-
], 512), [[T, M.value]])]),
|
|
1803
|
-
M.value === "auto" ? o("", !0) : (_(), s("label", It, [
|
|
1804
|
-
c("span", Lt, C(w(f)("tableAdvanced.height")), 1),
|
|
1805
|
-
k(c("input", {
|
|
1806
|
-
type: "number",
|
|
1807
|
-
min: "0",
|
|
1808
|
-
step: "20",
|
|
1809
|
-
"onUpdate:modelValue": i[24] ||= (e) => A.value = e,
|
|
1810
|
-
class: "docx-tmore__input"
|
|
1811
|
-
}, null, 512), [[
|
|
1812
|
-
E,
|
|
1813
|
-
A.value,
|
|
1814
|
-
void 0,
|
|
1815
|
-
{ number: !0 }
|
|
1816
|
-
]]),
|
|
1817
|
-
i[37] ||= c("span", { class: "docx-tmore__unit" }, "tw", -1)
|
|
1818
|
-
])),
|
|
1819
|
-
c("button", {
|
|
1820
|
-
type: "button",
|
|
1821
|
-
class: "docx-tmore__apply",
|
|
1822
|
-
onClick: j(L, ["prevent"])
|
|
1823
|
-
}, C(w(f)("common.apply")), 1)
|
|
1824
|
-
])) : o("", !0),
|
|
1825
|
-
c("button", {
|
|
1826
|
-
type: "button",
|
|
1827
|
-
class: "docx-tmore__item",
|
|
1828
|
-
onClick: i[25] ||= j((e) => x.value = !x.value, ["prevent"])
|
|
1829
|
-
}, [
|
|
1830
|
-
u(t, {
|
|
1831
|
-
name: "text_rotation_none",
|
|
1832
|
-
size: 18
|
|
1833
|
-
}),
|
|
1834
|
-
c("span", Rt, C(w(f)("tableAdvanced.textDirection")), 1),
|
|
1835
|
-
u(t, {
|
|
1836
|
-
name: x.value ? "expand_less" : "expand_more",
|
|
1837
|
-
size: 18
|
|
1838
|
-
}, null, 8, ["name"])
|
|
1839
|
-
]),
|
|
1840
|
-
x.value ? (_(), s("div", zt, [
|
|
1841
|
-
c("button", {
|
|
1842
|
-
type: "button",
|
|
1843
|
-
class: "docx-tmore__sub-item",
|
|
1844
|
-
onClick: i[26] ||= j((e) => R(null), ["prevent"])
|
|
1845
|
-
}, C(w(f)("tableAdvanced.textDirections.horizontal")), 1),
|
|
1846
|
-
c("button", {
|
|
1847
|
-
type: "button",
|
|
1848
|
-
class: "docx-tmore__sub-item",
|
|
1849
|
-
onClick: i[27] ||= j((e) => R("tbRl"), ["prevent"])
|
|
1850
|
-
}, C(w(f)("tableAdvanced.textDirections.verticalRL")), 1),
|
|
1851
|
-
c("button", {
|
|
1852
|
-
type: "button",
|
|
1853
|
-
class: "docx-tmore__sub-item",
|
|
1854
|
-
onClick: i[28] ||= j((e) => R("btLr"), ["prevent"])
|
|
1855
|
-
}, C(w(f)("tableAdvanced.textDirections.verticalLR")), 1)
|
|
1856
|
-
])) : o("", !0),
|
|
1857
|
-
i[43] ||= c("div", { class: "docx-tmore__separator" }, null, -1),
|
|
1858
|
-
c("button", {
|
|
1859
|
-
type: "button",
|
|
1860
|
-
class: "docx-tmore__item",
|
|
1861
|
-
onClick: i[29] ||= j((e) => P("toggleHeaderRow"), ["prevent"])
|
|
1862
|
-
}, [u(t, {
|
|
1863
|
-
name: "table_rows",
|
|
1864
|
-
size: 18
|
|
1865
|
-
}), c("span", null, C(w(f)("tableAdvanced.toggleHeaderRow")), 1)]),
|
|
1866
|
-
c("button", {
|
|
1867
|
-
type: "button",
|
|
1868
|
-
class: "docx-tmore__item",
|
|
1869
|
-
onClick: i[30] ||= j((e) => P("distributeColumns"), ["prevent"])
|
|
1870
|
-
}, [u(t, {
|
|
1871
|
-
name: "view_column",
|
|
1872
|
-
size: 18
|
|
1873
|
-
}), c("span", null, C(w(f)("tableAdvanced.distributeColumns")), 1)]),
|
|
1874
|
-
c("button", {
|
|
1875
|
-
type: "button",
|
|
1876
|
-
class: "docx-tmore__item",
|
|
1877
|
-
onClick: i[31] ||= j((e) => P("autoFit"), ["prevent"])
|
|
1878
|
-
}, [u(t, {
|
|
1879
|
-
name: "fit_width",
|
|
1880
|
-
size: 18
|
|
1881
|
-
}), c("span", null, C(w(f)("tableAdvanced.autoFit")), 1)]),
|
|
1882
|
-
c("button", {
|
|
1883
|
-
type: "button",
|
|
1884
|
-
class: "docx-tmore__item",
|
|
1885
|
-
onClick: i[32] ||= j((e) => P("toggleNoWrap"), ["prevent"])
|
|
1886
|
-
}, [u(t, {
|
|
1887
|
-
name: "wrap_text",
|
|
1888
|
-
size: 18
|
|
1889
|
-
}), c("span", null, C(w(f)("tableAdvanced.toggleNoWrap")), 1)]),
|
|
1890
|
-
i[44] ||= c("div", { class: "docx-tmore__separator" }, null, -1),
|
|
1891
|
-
c("button", {
|
|
1892
|
-
type: "button",
|
|
1893
|
-
class: "docx-tmore__item",
|
|
1894
|
-
onClick: i[33] ||= j((e) => P("tableProperties"), ["prevent"])
|
|
1895
|
-
}, [u(t, {
|
|
1896
|
-
name: "settings",
|
|
1897
|
-
size: 18
|
|
1898
|
-
}), c("span", null, C(w(f)("tableAdvanced.tableProperties")), 1)])
|
|
1899
|
-
], 8, lt)]),
|
|
1900
|
-
_: 1
|
|
1901
|
-
}, 8, ["open"]));
|
|
1902
|
-
}
|
|
1903
|
-
}), [["__scopeId", "data-v-dbab3895"]]), Vt = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
1904
|
-
__name: "TableToolbar",
|
|
1905
|
-
props: {
|
|
1906
|
-
view: {},
|
|
1907
|
-
getCommands: { type: Function },
|
|
1908
|
-
stateTick: {},
|
|
1909
|
-
theme: {}
|
|
1910
|
-
},
|
|
1911
|
-
setup(e) {
|
|
1912
|
-
let t = e, n = i(() => {
|
|
1913
|
-
t.stateTick;
|
|
1914
|
-
let e = t.view;
|
|
1915
|
-
return e ? V(e.state) : null;
|
|
1916
|
-
}), a = i(() => !!n.value?.isInTable), l = i(() => {
|
|
1917
|
-
t.stateTick;
|
|
1918
|
-
let e = t.view;
|
|
1919
|
-
if (!e) return !1;
|
|
1920
|
-
let { $from: n } = e.state.selection;
|
|
1921
|
-
for (let e = n.depth; e > 0; e--) if (n.node(e).type.name === "tableCell") {
|
|
1922
|
-
let t = n.node(e), r = t.attrs.colspan || 1, i = t.attrs.rowspan || 1;
|
|
1923
|
-
return r > 1 || i > 1;
|
|
1924
|
-
}
|
|
1925
|
-
return !1;
|
|
1926
|
-
}), d = i(() => !!n.value?.hasMultiCellSelection), f = i(() => n.value?.rowCount ?? 0), p = i(() => n.value?.columnCount ?? 0), m = i(() => {
|
|
1927
|
-
let e = n.value?.table?.attrs?.justification;
|
|
1928
|
-
return e === "center" || e === "right" ? e : "left";
|
|
1929
|
-
}), h = {
|
|
1930
|
-
style: "single",
|
|
1931
|
-
size: 4,
|
|
1932
|
-
color: { rgb: "000000" }
|
|
1933
|
-
};
|
|
1934
|
-
D([() => t.view, () => t.stateTick], () => {
|
|
1935
|
-
let e = t.view;
|
|
1936
|
-
if (!e) return;
|
|
1937
|
-
let n = V(e.state), r = n.cellBorderColor;
|
|
1938
|
-
!r || !n.isInTable || typeof r == "object" && "rgb" in r && typeof r.rgb == "string" && (h.color = { rgb: r.rgb });
|
|
1939
|
-
}, { immediate: !0 });
|
|
1940
|
-
function g(e, ...n) {
|
|
1941
|
-
let r = t.view;
|
|
1942
|
-
if (!r) return !1;
|
|
1943
|
-
let i = t.getCommands()[e];
|
|
1944
|
-
if (typeof i != "function") return !1;
|
|
1945
|
-
let a = i(...n);
|
|
1946
|
-
return typeof a == "function" ? (a(r.state, (e) => r.dispatch(e), r), r.focus(), !0) : !1;
|
|
1947
|
-
}
|
|
1948
|
-
function v(e) {
|
|
1949
|
-
let t = {
|
|
1950
|
-
...h,
|
|
1951
|
-
color: { ...h.color }
|
|
1952
|
-
};
|
|
1953
|
-
switch (e) {
|
|
1954
|
-
case "all":
|
|
1955
|
-
g("setAllTableBorders", t);
|
|
1956
|
-
return;
|
|
1957
|
-
case "none":
|
|
1958
|
-
g("removeTableBorders");
|
|
1959
|
-
return;
|
|
1960
|
-
case "box":
|
|
1961
|
-
g("setOutsideTableBorders", t);
|
|
1962
|
-
return;
|
|
1963
|
-
case "inside":
|
|
1964
|
-
case "insideH":
|
|
1965
|
-
case "insideV":
|
|
1966
|
-
g("setInsideTableBorders", t);
|
|
1967
|
-
return;
|
|
1968
|
-
case "top":
|
|
1969
|
-
case "bottom":
|
|
1970
|
-
case "left":
|
|
1971
|
-
case "right":
|
|
1972
|
-
g("setCellBorder", e, t, !0);
|
|
1973
|
-
return;
|
|
1974
|
-
}
|
|
1975
|
-
}
|
|
1976
|
-
function y(e) {
|
|
1977
|
-
h.color = { rgb: e.replace(/^#/, "") }, g("setTableBorderColor", e);
|
|
1978
|
-
}
|
|
1979
|
-
function b(e) {
|
|
1980
|
-
h.size = e, g("setTableBorderWidth", e);
|
|
1981
|
-
}
|
|
1982
|
-
function x(e) {
|
|
1983
|
-
g("setCellFillColor", e);
|
|
1984
|
-
}
|
|
1985
|
-
let S = {
|
|
1986
|
-
autoFit: ["autoFitContents"],
|
|
1987
|
-
alignTableLeft: ["setTableProperties", { justification: "left" }],
|
|
1988
|
-
alignTableCenter: ["setTableProperties", { justification: "center" }],
|
|
1989
|
-
alignTableRight: ["setTableProperties", { justification: "right" }],
|
|
1990
|
-
verticalAlignTop: ["setCellVerticalAlign", "top"],
|
|
1991
|
-
verticalAlignMiddle: ["setCellVerticalAlign", "center"],
|
|
1992
|
-
verticalAlignBottom: ["setCellVerticalAlign", "bottom"]
|
|
1993
|
-
};
|
|
1994
|
-
function C(e) {
|
|
1995
|
-
if (e === "tableProperties") return;
|
|
1996
|
-
let t = S[e];
|
|
1997
|
-
t ? g(...t) : g(e);
|
|
1998
|
-
}
|
|
1999
|
-
function w(e) {
|
|
2000
|
-
g("setCellMargins", e);
|
|
2001
|
-
}
|
|
2002
|
-
function T(e) {
|
|
2003
|
-
g("setCellTextDirection", e);
|
|
2004
|
-
}
|
|
2005
|
-
function E(e) {
|
|
2006
|
-
g("setRowHeight", e.height, e.rule);
|
|
2007
|
-
}
|
|
2008
|
-
return (t, n) => a.value ? (_(), s(r, { key: 0 }, [
|
|
2009
|
-
n[0] ||= c("span", { class: "divider" }, null, -1),
|
|
2010
|
-
u(tt, { onChange: v }),
|
|
2011
|
-
u(nt, {
|
|
2012
|
-
theme: e.theme ?? null,
|
|
2013
|
-
onChange: y
|
|
2014
|
-
}, null, 8, ["theme"]),
|
|
2015
|
-
u(st, { onChange: b }),
|
|
2016
|
-
u(Ze, {
|
|
2017
|
-
theme: e.theme ?? null,
|
|
2018
|
-
onChange: x
|
|
2019
|
-
}, null, 8, ["theme"]),
|
|
2020
|
-
u(Bt, {
|
|
2021
|
-
"can-split": l.value,
|
|
2022
|
-
"can-merge": d.value,
|
|
2023
|
-
"row-count": f.value,
|
|
2024
|
-
"column-count": p.value,
|
|
2025
|
-
"current-justification": m.value,
|
|
2026
|
-
onAction: C,
|
|
2027
|
-
onCellMargins: w,
|
|
2028
|
-
onCellTextDirection: T,
|
|
2029
|
-
onRowHeight: E
|
|
2030
|
-
}, null, 8, [
|
|
2031
|
-
"can-split",
|
|
2032
|
-
"can-merge",
|
|
2033
|
-
"row-count",
|
|
2034
|
-
"column-count",
|
|
2035
|
-
"current-justification"
|
|
2036
|
-
])
|
|
2037
|
-
], 64)) : o("", !0);
|
|
2038
|
-
}
|
|
2039
|
-
}), [["__scopeId", "data-v-56725acf"]]), Ht = /* @__PURE__ */ d({
|
|
2040
|
-
__name: "Avatar",
|
|
2041
|
-
props: {
|
|
2042
|
-
name: { default: "U" },
|
|
2043
|
-
size: { default: 32 }
|
|
2044
|
-
},
|
|
2045
|
-
setup(e) {
|
|
2046
|
-
let t = e, n = i(() => G(t.name || "U")), r = i(() => ({
|
|
2047
|
-
width: t.size + "px",
|
|
2048
|
-
height: t.size + "px",
|
|
2049
|
-
borderRadius: "50%",
|
|
2050
|
-
backgroundColor: U(t.name || "U"),
|
|
2051
|
-
color: "#fff",
|
|
2052
|
-
display: "flex",
|
|
2053
|
-
alignItems: "center",
|
|
2054
|
-
justifyContent: "center",
|
|
2055
|
-
fontSize: t.size === 32 ? "13px" : "11px",
|
|
2056
|
-
fontWeight: 500,
|
|
2057
|
-
flexShrink: 0
|
|
2058
|
-
}));
|
|
2059
|
-
return (e, t) => (_(), s("div", {
|
|
2060
|
-
class: "docx-avatar",
|
|
2061
|
-
style: m(r.value)
|
|
2062
|
-
}, C(n.value), 5));
|
|
2063
|
-
}
|
|
2064
|
-
}), Ut = {
|
|
2065
|
-
key: 0,
|
|
2066
|
-
class: "reply-thread"
|
|
2067
|
-
}, Wt = {
|
|
2068
|
-
key: 0,
|
|
2069
|
-
class: "reply-thread__more"
|
|
2070
|
-
}, Gt = { class: "reply-thread__header" }, Kt = { class: "reply-thread__author-block" }, qt = { class: "reply-thread__author" }, Jt = { class: "reply-thread__date" }, Yt = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
2071
|
-
__name: "ReplyThread",
|
|
2072
|
-
props: {
|
|
2073
|
-
replies: {},
|
|
2074
|
-
isExpanded: { type: Boolean }
|
|
2075
|
-
},
|
|
2076
|
-
setup(e) {
|
|
2077
|
-
let t = e, n = i(() => t.isExpanded ? t.replies : t.replies.slice(-1)), a = i(() => t.isExpanded ? 0 : Math.max(0, t.replies.length - 1));
|
|
2078
|
-
return (t, i) => e.replies.length > 0 ? (_(), s("div", Ut, [a.value > 0 ? (_(), s("div", Wt, C(a.value) + " " + C(a.value === 1 ? "reply" : "replies"), 1)) : o("", !0), (_(!0), s(r, null, b(n.value, (t) => (_(), s("div", {
|
|
2079
|
-
key: t.id,
|
|
2080
|
-
class: p(["reply-thread__item", { "reply-thread__item--expanded": e.isExpanded }])
|
|
2081
|
-
}, [c("div", Gt, [u(Ht, {
|
|
2082
|
-
name: t.author,
|
|
2083
|
-
size: 28
|
|
2084
|
-
}, null, 8, ["name"]), c("div", Kt, [c("div", qt, C(t.author || "Unknown"), 1), c("div", Jt, C(w(H)(t.date)), 1)])]), c("div", { class: p(["reply-thread__body", { "reply-thread__body--clamp": !e.isExpanded }]) }, C(w(W)(t.content)), 3)], 2))), 128))])) : o("", !0);
|
|
2085
|
-
}
|
|
2086
|
-
}), [["__scopeId", "data-v-fc8a461d"]]), Xt = ["onKeydown"], Zt = { class: "reply-input__actions" }, Qt = ["disabled"], $t = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
2087
|
-
__name: "ReplyInput",
|
|
2088
|
-
emits: ["submit"],
|
|
2089
|
-
setup(e, { emit: t }) {
|
|
2090
|
-
let n = t, a = y(!1), o = y(""), l = y(null), u = i(() => o.value.trim());
|
|
2091
|
-
function d() {
|
|
2092
|
-
a.value = !0, f(() => l.value?.focus({ preventScroll: !0 }));
|
|
2093
|
-
}
|
|
2094
|
-
function m() {
|
|
2095
|
-
a.value = !1, o.value = "";
|
|
2096
|
-
}
|
|
2097
|
-
function h() {
|
|
2098
|
-
let e = u.value;
|
|
2099
|
-
e && n("submit", e), o.value = "", a.value = !1;
|
|
2100
|
-
}
|
|
2101
|
-
return (e, t) => (_(), s("div", {
|
|
2102
|
-
onClick: t[4] ||= j(() => {}, ["stop"]),
|
|
2103
|
-
onMousedown: t[5] ||= j(() => {}, ["stop"]),
|
|
2104
|
-
class: "reply-input"
|
|
2105
|
-
}, [a.value ? (_(), s(r, { key: 1 }, [k(c("input", {
|
|
2106
|
-
ref_key: "inputRef",
|
|
2107
|
-
ref: l,
|
|
2108
|
-
"onUpdate:modelValue": t[1] ||= (e) => o.value = e,
|
|
2109
|
-
type: "text",
|
|
2110
|
-
placeholder: "Reply",
|
|
2111
|
-
class: "reply-input__field reply-input__field--active",
|
|
2112
|
-
onMousedown: t[2] ||= j(() => {}, ["stop"]),
|
|
2113
|
-
onKeydown: [
|
|
2114
|
-
t[3] ||= j(() => {}, ["stop"]),
|
|
2115
|
-
A(j(h, ["prevent"]), ["enter"]),
|
|
2116
|
-
A(m, ["esc"])
|
|
2117
|
-
]
|
|
2118
|
-
}, null, 40, Xt), [[E, o.value]]), c("div", Zt, [c("button", {
|
|
2119
|
-
class: "reply-input__cancel",
|
|
2120
|
-
onClick: j(m, ["stop"])
|
|
2121
|
-
}, "Cancel"), c("button", {
|
|
2122
|
-
class: p(["reply-input__submit", { "reply-input__submit--active": u.value }]),
|
|
2123
|
-
disabled: !u.value,
|
|
2124
|
-
onClick: j(h, ["stop"])
|
|
2125
|
-
}, "Reply", 10, Qt)])], 64)) : (_(), s("input", {
|
|
2126
|
-
key: 0,
|
|
2127
|
-
readonly: "",
|
|
2128
|
-
placeholder: "Reply",
|
|
2129
|
-
class: "reply-input__field reply-input__field--inactive",
|
|
2130
|
-
onMousedown: t[0] ||= j(() => {}, ["stop"]),
|
|
2131
|
-
onClick: j(d, ["stop"])
|
|
2132
|
-
}, null, 32))], 32));
|
|
2133
|
-
}
|
|
2134
|
-
}), [["__scopeId", "data-v-aa3d5b08"]]), en = ["data-comment-id"], tn = {
|
|
2135
|
-
key: 0,
|
|
2136
|
-
class: "comment-card__resolved"
|
|
2137
|
-
}, nn = { class: "comment-card__head" }, rn = { class: "comment-card__author-block" }, an = { class: "comment-card__author" }, on = { class: "comment-card__date" }, sn = {
|
|
2138
|
-
key: 0,
|
|
2139
|
-
class: "comment-card__actions"
|
|
2140
|
-
}, cn = ["title"], ln = { class: "comment-card__body" }, un = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
2141
|
-
__name: "CommentCard",
|
|
2142
|
-
props: {
|
|
2143
|
-
comment: {},
|
|
2144
|
-
replies: {},
|
|
2145
|
-
expanded: { type: Boolean }
|
|
2146
|
-
},
|
|
2147
|
-
emits: [
|
|
2148
|
-
"click",
|
|
2149
|
-
"reply",
|
|
2150
|
-
"resolve",
|
|
2151
|
-
"unresolve",
|
|
2152
|
-
"delete"
|
|
2153
|
-
],
|
|
2154
|
-
setup(e, { emit: n }) {
|
|
2155
|
-
let r = e, i = n, l = y(!1);
|
|
2156
|
-
function d() {
|
|
2157
|
-
l.value = !1, i("delete", r.comment.id);
|
|
2158
|
-
}
|
|
2159
|
-
return (n, r) => (_(), s("div", {
|
|
2160
|
-
class: p(["comment-card", { "comment-card--expanded": e.expanded }]),
|
|
2161
|
-
"data-comment-id": e.comment.id,
|
|
2162
|
-
onClick: r[5] ||= (e) => n.$emit("click"),
|
|
2163
|
-
onMousedown: r[6] ||= j(() => {}, ["stop"])
|
|
2164
|
-
}, [
|
|
2165
|
-
e.comment.done ? (_(), s("div", tn, [u(t, {
|
|
2166
|
-
name: "check",
|
|
2167
|
-
size: 12
|
|
2168
|
-
}), r[7] ||= c("span", null, "Resolved", -1)])) : o("", !0),
|
|
2169
|
-
c("div", nn, [
|
|
2170
|
-
u(Ht, {
|
|
2171
|
-
name: e.comment.author,
|
|
2172
|
-
size: 32
|
|
2173
|
-
}, null, 8, ["name"]),
|
|
2174
|
-
c("div", rn, [c("div", an, C(e.comment.author || "Unknown"), 1), c("div", on, C(w(H)(e.comment.date)), 1)]),
|
|
2175
|
-
e.expanded ? (_(), s("div", sn, [
|
|
2176
|
-
c("button", {
|
|
2177
|
-
class: "comment-card__icon-btn",
|
|
2178
|
-
title: e.comment.done ? "Reopen" : "Resolve",
|
|
2179
|
-
onClick: r[0] ||= j((t) => e.comment.done ? n.$emit("unresolve", e.comment.id) : n.$emit("resolve", e.comment.id), ["stop"])
|
|
2180
|
-
}, [u(t, {
|
|
2181
|
-
name: e.comment.done ? "undo" : "check",
|
|
2182
|
-
size: 20
|
|
2183
|
-
}, null, 8, ["name"])], 8, cn),
|
|
2184
|
-
c("button", {
|
|
2185
|
-
class: "comment-card__icon-btn",
|
|
2186
|
-
title: "More options",
|
|
2187
|
-
onClick: r[1] ||= j((e) => l.value = !l.value, ["stop"])
|
|
2188
|
-
}, [u(t, {
|
|
2189
|
-
name: "more_vert",
|
|
2190
|
-
size: 20
|
|
2191
|
-
})]),
|
|
2192
|
-
l.value ? (_(), s("div", {
|
|
2193
|
-
key: 0,
|
|
2194
|
-
class: "comment-card__menu",
|
|
2195
|
-
onClick: r[2] ||= j(() => {}, ["stop"]),
|
|
2196
|
-
onMousedown: r[3] ||= j(() => {}, ["stop"])
|
|
2197
|
-
}, [c("button", {
|
|
2198
|
-
class: "comment-card__menu-item",
|
|
2199
|
-
onClick: d
|
|
2200
|
-
}, "Delete")], 32)) : o("", !0)
|
|
2201
|
-
])) : o("", !0)
|
|
2202
|
-
]),
|
|
2203
|
-
c("div", ln, C(w(W)(e.comment.content)), 1),
|
|
2204
|
-
u(Yt, {
|
|
2205
|
-
replies: e.replies,
|
|
2206
|
-
"is-expanded": e.expanded
|
|
2207
|
-
}, null, 8, ["replies", "is-expanded"]),
|
|
2208
|
-
e.expanded && !e.comment.done ? (_(), a($t, {
|
|
2209
|
-
key: 1,
|
|
2210
|
-
onSubmit: r[4] ||= (t) => n.$emit("reply", e.comment.id, t)
|
|
2211
|
-
})) : o("", !0)
|
|
2212
|
-
], 42, en));
|
|
2213
|
-
}
|
|
2214
|
-
}), [["__scopeId", "data-v-b9e94a26"]]), dn = ["data-comment-id"], fn = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
2215
|
-
__name: "ResolvedCommentMarker",
|
|
2216
|
-
props: { comment: {} },
|
|
2217
|
-
emits: ["toggle-expand"],
|
|
2218
|
-
setup(e) {
|
|
2219
|
-
return (n, r) => (_(), s("div", {
|
|
2220
|
-
class: "resolved-comment-marker",
|
|
2221
|
-
"data-comment-id": e.comment.id,
|
|
2222
|
-
"data-comment-resolved": "true",
|
|
2223
|
-
onClick: r[0] ||= (e) => n.$emit("toggle-expand"),
|
|
2224
|
-
onMousedown: r[1] ||= j(() => {}, ["stop"])
|
|
2225
|
-
}, [u(t, {
|
|
2226
|
-
name: "chat_bubble_check",
|
|
2227
|
-
size: 20
|
|
2228
|
-
})], 40, dn));
|
|
2229
|
-
}
|
|
2230
|
-
}), [["__scopeId", "data-v-c3b210c1"]]), pn = { class: "tc-card__head" }, mn = { class: "tc-card__author-block" }, hn = { class: "tc-card__author" }, gn = {
|
|
2231
|
-
key: 0,
|
|
2232
|
-
class: "tc-card__date"
|
|
2233
|
-
}, _n = {
|
|
2234
|
-
key: 0,
|
|
2235
|
-
class: "tc-card__actions"
|
|
2236
|
-
}, vn = ["title"], yn = ["title"], bn = { class: "tc-card__body" }, xn = { class: "tc-card__deleted" }, Sn = { class: "tc-card__inserted" }, Cn = { class: "tc-card__inserted" }, wn = { class: "tc-card__deleted" }, Tn = { class: "tc-card__changed" }, En = {
|
|
2237
|
-
key: 4,
|
|
2238
|
-
class: "tc-card__inserted"
|
|
2239
|
-
}, Dn = {
|
|
2240
|
-
key: 5,
|
|
2241
|
-
class: "tc-card__deleted"
|
|
2242
|
-
}, On = {
|
|
2243
|
-
key: 6,
|
|
2244
|
-
class: "tc-card__inserted"
|
|
2245
|
-
}, kn = {
|
|
2246
|
-
key: 7,
|
|
2247
|
-
class: "tc-card__deleted"
|
|
2248
|
-
}, An = {
|
|
2249
|
-
key: 8,
|
|
2250
|
-
class: "tc-card__changed"
|
|
2251
|
-
}, jn = {
|
|
2252
|
-
key: 9,
|
|
2253
|
-
class: "tc-card__changed"
|
|
2254
|
-
}, Mn = {
|
|
2255
|
-
key: 10,
|
|
2256
|
-
class: "tc-card__changed"
|
|
2257
|
-
}, Nn = {
|
|
2258
|
-
key: 11,
|
|
2259
|
-
class: "tc-card__changed"
|
|
2260
|
-
}, Pn = {
|
|
2261
|
-
key: 12,
|
|
2262
|
-
class: "tc-card__inserted"
|
|
2263
|
-
}, Fn = {
|
|
2264
|
-
key: 13,
|
|
2265
|
-
class: "tc-card__deleted"
|
|
2266
|
-
}, In = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
2267
|
-
__name: "TrackedChangeCard",
|
|
2268
|
-
props: {
|
|
2269
|
-
change: {},
|
|
2270
|
-
expanded: { type: Boolean }
|
|
2271
|
-
},
|
|
2272
|
-
emits: [
|
|
2273
|
-
"click",
|
|
2274
|
-
"accept-by-id",
|
|
2275
|
-
"reject-by-id",
|
|
2276
|
-
"reply"
|
|
2277
|
-
],
|
|
2278
|
-
setup(n, { emit: d }) {
|
|
2279
|
-
let { t: f } = e(), m = n, h = d, g = i(() => m.change.author || f("trackedChanges.unknown"));
|
|
2280
|
-
function v() {
|
|
2281
|
-
let e = new Set([m.change.revisionId]);
|
|
2282
|
-
m.change.type === "replacement" && m.change.insertionRevisionId != null && e.add(m.change.insertionRevisionId);
|
|
2283
|
-
for (let t of m.change.coalescedRevisionIds ?? []) e.add(t);
|
|
2284
|
-
return [...e];
|
|
2285
|
-
}
|
|
2286
|
-
function y() {
|
|
2287
|
-
for (let e of v()) h("accept-by-id", e);
|
|
2288
|
-
}
|
|
2289
|
-
function b() {
|
|
2290
|
-
for (let e of v()) h("reject-by-id", e);
|
|
2291
|
-
}
|
|
2292
|
-
return (e, i) => (_(), s("div", {
|
|
2293
|
-
class: p(["tc-card", { "tc-card--expanded": n.expanded }]),
|
|
2294
|
-
onClick: i[1] ||= (t) => e.$emit("click"),
|
|
2295
|
-
onMousedown: i[2] ||= j(() => {}, ["stop"])
|
|
2296
|
-
}, [
|
|
2297
|
-
c("div", pn, [
|
|
2298
|
-
u(Ht, {
|
|
2299
|
-
name: g.value,
|
|
2300
|
-
size: 32
|
|
2301
|
-
}, null, 8, ["name"]),
|
|
2302
|
-
c("div", mn, [c("div", hn, C(g.value), 1), n.change.date ? (_(), s("div", gn, C(w(H)(n.change.date)), 1)) : o("", !0)]),
|
|
2303
|
-
n.expanded ? (_(), s("div", _n, [c("button", {
|
|
2304
|
-
class: "tc-card__icon-btn",
|
|
2305
|
-
title: w(f)("common.accept"),
|
|
2306
|
-
onClick: j(y, ["stop"])
|
|
2307
|
-
}, [u(t, {
|
|
2308
|
-
name: "check",
|
|
2309
|
-
size: 20
|
|
2310
|
-
})], 8, vn), c("button", {
|
|
2311
|
-
class: "tc-card__icon-btn",
|
|
2312
|
-
title: w(f)("common.reject"),
|
|
2313
|
-
onClick: j(b, ["stop"])
|
|
2314
|
-
}, [u(t, {
|
|
2315
|
-
name: "close",
|
|
2316
|
-
size: 20
|
|
2317
|
-
})], 8, yn)])) : o("", !0)
|
|
2318
|
-
]),
|
|
2319
|
-
c("div", bn, [n.change.type === "replacement" ? (_(), s(r, { key: 0 }, [
|
|
2320
|
-
l(C(w(f)("trackedChanges.replaced")) + " ", 1),
|
|
2321
|
-
c("span", xn, "\"" + C(w(K)(n.change.deletedText || "")) + "\"", 1),
|
|
2322
|
-
l(" " + C(w(f)("trackedChanges.with")) + " ", 1),
|
|
2323
|
-
c("span", Sn, "\"" + C(w(K)(n.change.text)) + "\"", 1)
|
|
2324
|
-
], 64)) : n.change.type === "paragraphMarkInsertion" ? (_(), s(r, { key: 1 }, [l(C(w(f)("revisions.paragraphMarkInserted")), 1), n.change.text ? (_(), s(r, { key: 0 }, [i[3] ||= l(": ", -1), c("span", Cn, "\"" + C(w(K)(n.change.text)) + "\"", 1)], 64)) : o("", !0)], 64)) : n.change.type === "paragraphMarkDeletion" ? (_(), s(r, { key: 2 }, [l(C(w(f)("revisions.paragraphMarkDeleted")), 1), n.change.text ? (_(), s(r, { key: 0 }, [i[4] ||= l(": ", -1), c("span", wn, "\"" + C(w(K)(n.change.text)) + "\"", 1)], 64)) : o("", !0)], 64)) : n.change.type === "paragraphPropertiesChanged" ? (_(), s(r, { key: 3 }, [l(C(w(f)("revisions.paragraphPropertiesChanged")), 1), n.change.text ? (_(), s(r, { key: 0 }, [i[5] ||= l(": ", -1), c("span", Tn, "\"" + C(w(K)(n.change.text)) + "\"", 1)], 64)) : o("", !0)], 64)) : n.change.type === "rowInserted" ? (_(), s("span", En, C(w(f)("revisions.rowInserted")), 1)) : n.change.type === "rowDeleted" ? (_(), s("span", Dn, C(w(f)("revisions.rowDeleted")), 1)) : n.change.type === "cellInserted" ? (_(), s("span", On, C(w(f)("revisions.cellInserted")), 1)) : n.change.type === "cellDeleted" ? (_(), s("span", kn, C(w(f)("revisions.cellDeleted")), 1)) : n.change.type === "cellMerged" ? (_(), s("span", An, C(w(f)("revisions.cellMerged")), 1)) : n.change.type === "rowPropertiesChanged" ? (_(), s("span", jn, C(w(f)("revisions.rowPropertiesChanged")), 1)) : n.change.type === "cellPropertiesChanged" ? (_(), s("span", Mn, C(w(f)("revisions.cellPropertiesChanged")), 1)) : n.change.type === "tablePropertiesChanged" ? (_(), s("span", Nn, C(w(f)("revisions.tablePropertiesChanged")), 1)) : n.change.type === "tableInserted" ? (_(), s("span", Pn, C(w(f)("revisions.tableInserted")), 1)) : n.change.type === "tableDeleted" ? (_(), s("span", Fn, C(w(f)("revisions.tableDeleted")), 1)) : (_(), s(r, { key: 14 }, [l(C(n.change.type === "insertion" ? w(f)("trackedChanges.added") : w(f)("trackedChanges.deleted")) + " ", 1), c("span", { class: p(n.change.type === "insertion" ? "tc-card__inserted" : "tc-card__deleted") }, " \"" + C(w(K)(n.change.text)) + "\" ", 3)], 64))]),
|
|
2325
|
-
n.expanded ? (_(), a($t, {
|
|
2326
|
-
key: 0,
|
|
2327
|
-
onSubmit: i[0] ||= (t) => e.$emit("reply", n.change.revisionId, t)
|
|
2328
|
-
})) : o("", !0)
|
|
2329
|
-
], 34));
|
|
2330
|
-
}
|
|
2331
|
-
}), [["__scopeId", "data-v-317869c0"]]), Ln = ["onKeydown"], Rn = { class: "add-comment-card__actions" }, zn = ["disabled"], Bn = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
2332
|
-
__name: "AddCommentCard",
|
|
2333
|
-
emits: ["submit", "cancel"],
|
|
2334
|
-
setup(e, { emit: t }) {
|
|
2335
|
-
let n = t, r = y(""), a = y(null), o = i(() => r.value.trim());
|
|
2336
|
-
g(() => {
|
|
2337
|
-
a.value?.focus({ preventScroll: !0 });
|
|
2338
|
-
});
|
|
2339
|
-
function l() {
|
|
2340
|
-
o.value && (n("submit", o.value), r.value = "");
|
|
2341
|
-
}
|
|
2342
|
-
function u() {
|
|
2343
|
-
n("cancel"), r.value = "";
|
|
2344
|
-
}
|
|
2345
|
-
return (e, t) => (_(), s("div", {
|
|
2346
|
-
class: "add-comment-card",
|
|
2347
|
-
onMousedown: t[3] ||= j(() => {}, ["stop"])
|
|
2348
|
-
}, [k(c("textarea", {
|
|
2349
|
-
ref_key: "inputRef",
|
|
2350
|
-
ref: a,
|
|
2351
|
-
"onUpdate:modelValue": t[0] ||= (e) => r.value = e,
|
|
2352
|
-
class: "add-comment-card__field",
|
|
2353
|
-
placeholder: "Add a comment",
|
|
2354
|
-
onMousedown: t[1] ||= j(() => {}, ["stop"]),
|
|
2355
|
-
onKeydown: [
|
|
2356
|
-
t[2] ||= j(() => {}, ["stop"]),
|
|
2357
|
-
A(j(l, ["exact", "prevent"]), ["enter"]),
|
|
2358
|
-
A(u, ["esc"])
|
|
2359
|
-
]
|
|
2360
|
-
}, null, 40, Ln), [[E, r.value]]), c("div", Rn, [c("button", {
|
|
2361
|
-
class: "add-comment-card__cancel",
|
|
2362
|
-
onClick: u
|
|
2363
|
-
}, "Cancel"), c("button", {
|
|
2364
|
-
class: p(["add-comment-card__submit", { "add-comment-card__submit--active": o.value }]),
|
|
2365
|
-
disabled: !o.value,
|
|
2366
|
-
onClick: l
|
|
2367
|
-
}, "Comment", 10, zn)])], 32));
|
|
2368
|
-
}
|
|
2369
|
-
}), [["__scopeId", "data-v-cc70979b"]]), Vn = ["data-card-id"], Hn = 16, Un = 300, Wn = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
2370
|
-
__name: "UnifiedSidebar",
|
|
2371
|
-
props: {
|
|
2372
|
-
isOpen: { type: Boolean },
|
|
2373
|
-
comments: {},
|
|
2374
|
-
trackedChanges: {},
|
|
2375
|
-
isAddingComment: { type: Boolean },
|
|
2376
|
-
showResolved: { type: Boolean },
|
|
2377
|
-
pagesContainer: {},
|
|
2378
|
-
pageWidthPx: {},
|
|
2379
|
-
zoom: {},
|
|
2380
|
-
activeItemId: {},
|
|
2381
|
-
addCommentYPosition: {}
|
|
2382
|
-
},
|
|
2383
|
-
emits: [
|
|
2384
|
-
"close",
|
|
2385
|
-
"add-comment",
|
|
2386
|
-
"cancel-add-comment",
|
|
2387
|
-
"comment-reply",
|
|
2388
|
-
"comment-resolve",
|
|
2389
|
-
"comment-unresolve",
|
|
2390
|
-
"comment-delete",
|
|
2391
|
-
"accept-change",
|
|
2392
|
-
"reject-change",
|
|
2393
|
-
"accept-change-by-id",
|
|
2394
|
-
"reject-change-by-id",
|
|
2395
|
-
"tracked-change-reply",
|
|
2396
|
-
"update:activeItemId"
|
|
2397
|
-
],
|
|
2398
|
-
setup(e, { emit: t }) {
|
|
2399
|
-
let n = e, d = t, f = y(null), p = i(() => n.activeItemId === void 0 ? f.value : n.activeItemId);
|
|
2400
|
-
function v(e) {
|
|
2401
|
-
let t = p.value === e ? null : e;
|
|
2402
|
-
f.value = t, d("update:activeItemId", t);
|
|
2403
|
-
}
|
|
2404
|
-
let x = i(() => {
|
|
2405
|
-
let e = [], t = n.comments.filter((e) => !e.parentId), r = /* @__PURE__ */ new Map();
|
|
2406
|
-
for (let e of n.comments) if (e.parentId != null) {
|
|
2407
|
-
let t = r.get(e.parentId) || [];
|
|
2408
|
-
t.push(e), r.set(e.parentId, t);
|
|
2409
|
-
}
|
|
2410
|
-
let i = 0;
|
|
2411
|
-
for (let a of t) a.done && !n.showResolved || e.push({
|
|
2412
|
-
id: `comment-${a.id}`,
|
|
2413
|
-
kind: "comment",
|
|
2414
|
-
anchorSelector: `[data-comment-id="${a.id}"]`,
|
|
2415
|
-
fallbackOrder: i++,
|
|
2416
|
-
comment: a,
|
|
2417
|
-
replies: r.get(a.id) || []
|
|
2418
|
-
});
|
|
2419
|
-
for (let t = 0; t < n.trackedChanges.length; t++) {
|
|
2420
|
-
let r = n.trackedChanges[t], a = r.insertionRevisionId ?? r.revisionId, o = r.type === "deletion" ? `.docx-deletion[data-revision-id="${r.revisionId}"]` : `.docx-insertion[data-revision-id="${a}"]`;
|
|
2421
|
-
e.push({
|
|
2422
|
-
id: `tc-${r.revisionId}-${t}`,
|
|
2423
|
-
kind: "tracked-change",
|
|
2424
|
-
anchorSelector: o,
|
|
2425
|
-
fallbackOrder: i++,
|
|
2426
|
-
change: r
|
|
2427
|
-
});
|
|
2428
|
-
}
|
|
2429
|
-
return e;
|
|
2430
|
-
}), w = y(null), T = y(/* @__PURE__ */ new Map()), E = null;
|
|
2431
|
-
function k() {
|
|
2432
|
-
let e = n.pagesContainer, t = x.value;
|
|
2433
|
-
if (!e || t.length === 0) {
|
|
2434
|
-
T.value = /* @__PURE__ */ new Map();
|
|
2435
|
-
return;
|
|
2436
|
-
}
|
|
2437
|
-
let r = e.getBoundingClientRect(), i = /* @__PURE__ */ new Map();
|
|
2438
|
-
for (let t of e.querySelectorAll("[data-comment-id]")) {
|
|
2439
|
-
let e = t.dataset.commentId;
|
|
2440
|
-
e && !i.has(e) && i.set(e, t);
|
|
2441
|
-
}
|
|
2442
|
-
let a = /* @__PURE__ */ new Map();
|
|
2443
|
-
for (let t of e.querySelectorAll(".docx-insertion[data-revision-id]")) {
|
|
2444
|
-
let e = t.dataset.revisionId;
|
|
2445
|
-
e && !a.has(e) && a.set(e, t);
|
|
2446
|
-
}
|
|
2447
|
-
let o = /* @__PURE__ */ new Map();
|
|
2448
|
-
for (let t of e.querySelectorAll(".docx-deletion[data-revision-id]")) {
|
|
2449
|
-
let e = t.dataset.revisionId;
|
|
2450
|
-
e && !o.has(e) && o.set(e, t);
|
|
2451
|
-
}
|
|
2452
|
-
for (let t of e.querySelectorAll(".ep-revision-table[data-revision-id], .ep-revision-row[data-revision-id], .ep-revision-cell[data-revision-id], .layout-revision-pmark[data-revision-id]")) {
|
|
2453
|
-
let e = t.dataset.revisionId;
|
|
2454
|
-
if (!e) continue;
|
|
2455
|
-
let n = t.classList.contains("ep-revision-ins") || t.classList.contains("layout-revision-ins") ? a : o;
|
|
2456
|
-
n.has(e) || n.set(e, t);
|
|
2457
|
-
}
|
|
2458
|
-
let s = [];
|
|
2459
|
-
for (let n of t) {
|
|
2460
|
-
let t;
|
|
2461
|
-
if (n.kind === "comment") t = i.get(String(n.comment.id));
|
|
2462
|
-
else if (n.change.type === "deletion") t = o.get(String(n.change.revisionId));
|
|
2463
|
-
else {
|
|
2464
|
-
let e = n.change.insertionRevisionId ?? n.change.revisionId;
|
|
2465
|
-
t = a.get(String(e));
|
|
2466
|
-
}
|
|
2467
|
-
if (!t) continue;
|
|
2468
|
-
let c = t.getBoundingClientRect();
|
|
2469
|
-
s.push({
|
|
2470
|
-
id: n.id,
|
|
2471
|
-
targetY: c.top - r.top + e.scrollTop
|
|
2472
|
-
});
|
|
2473
|
-
}
|
|
2474
|
-
s.sort((e, t) => e.targetY - t.targetY);
|
|
2475
|
-
let c = /* @__PURE__ */ new Map(), l = w.value;
|
|
2476
|
-
if (l) for (let e of l.querySelectorAll("[data-card-id]")) {
|
|
2477
|
-
let t = e.dataset.cardId;
|
|
2478
|
-
t && c.set(t, e.offsetHeight);
|
|
2479
|
-
}
|
|
2480
|
-
let u = /* @__PURE__ */ new Map(), d = 0;
|
|
2481
|
-
for (let e of s) {
|
|
2482
|
-
let t = c.get(e.id) ?? 80, n = Math.max(e.targetY, d + q);
|
|
2483
|
-
u.set(e.id, n), d = n + t;
|
|
2484
|
-
}
|
|
2485
|
-
T.value = u;
|
|
2486
|
-
}
|
|
2487
|
-
let A = i(() => {
|
|
2488
|
-
let e = 0;
|
|
2489
|
-
for (let t of T.value.values()) e = Math.max(e, t);
|
|
2490
|
-
return e + 200;
|
|
2491
|
-
}), M = i(() => {
|
|
2492
|
-
let e = p.value;
|
|
2493
|
-
if (!e) return "";
|
|
2494
|
-
if (e.startsWith("comment-")) return `.paged-editor__pages [data-comment-id="${e.slice(8)}"] { background-color: rgba(255, 212, 0, 0.35) !important; border-bottom: 2px solid rgba(255, 212, 0, 0.7) !important; }`;
|
|
2495
|
-
if (e.startsWith("tc-")) {
|
|
2496
|
-
let t = e.split("-")[1];
|
|
2497
|
-
return `
|
|
2498
|
-
.paged-editor__pages .docx-insertion[data-revision-id="${x.value.find((t) => t.id === e)?.change?.insertionRevisionId ?? Number(t)}"] { background-color: rgba(52, 168, 83, 0.2) !important; border-bottom: 2px solid #2e7d32 !important; }
|
|
2499
|
-
.paged-editor__pages .docx-deletion[data-revision-id="${t}"] { background-color: rgba(211, 47, 47, 0.2) !important; text-decoration-thickness: 2px !important; }
|
|
2500
|
-
`;
|
|
2501
|
-
}
|
|
2502
|
-
return "";
|
|
2503
|
-
}), N = i(() => {
|
|
2504
|
-
let e = n.addCommentYPosition;
|
|
2505
|
-
return e == null ? {
|
|
2506
|
-
position: "static",
|
|
2507
|
-
marginBottom: "8px"
|
|
2508
|
-
} : {
|
|
2509
|
-
position: "absolute",
|
|
2510
|
-
top: e + "px",
|
|
2511
|
-
left: 0,
|
|
2512
|
-
right: 0,
|
|
2513
|
-
transition: "top 0.15s ease"
|
|
2514
|
-
};
|
|
2515
|
-
}), P = i(() => {
|
|
2516
|
-
let e = n.pageWidthPx / 2 + Hn - J, t = T.value.size > 0 || x.value.length === 0;
|
|
2517
|
-
return {
|
|
2518
|
-
position: "absolute",
|
|
2519
|
-
top: "0",
|
|
2520
|
-
left: `calc(50% + ${e}px)`,
|
|
2521
|
-
width: Un + "px",
|
|
2522
|
-
opacity: +!!t
|
|
2523
|
-
};
|
|
2524
|
-
});
|
|
2525
|
-
function F(e) {
|
|
2526
|
-
let t = T.value.get(e);
|
|
2527
|
-
return t == null ? {
|
|
2528
|
-
position: "static",
|
|
2529
|
-
marginBottom: "8px"
|
|
2530
|
-
} : {
|
|
2531
|
-
position: "absolute",
|
|
2532
|
-
top: t + "px",
|
|
2533
|
-
left: 0,
|
|
2534
|
-
right: 0,
|
|
2535
|
-
transition: "top 0.15s ease"
|
|
2536
|
-
};
|
|
2537
|
-
}
|
|
2538
|
-
let I = !1;
|
|
2539
|
-
function L() {
|
|
2540
|
-
I || (I = !0, requestAnimationFrame(() => {
|
|
2541
|
-
I = !1, k();
|
|
2542
|
-
}));
|
|
2543
|
-
}
|
|
2544
|
-
D(() => [
|
|
2545
|
-
x.value.length,
|
|
2546
|
-
p.value,
|
|
2547
|
-
n.pagesContainer,
|
|
2548
|
-
n.pageWidthPx,
|
|
2549
|
-
n.zoom
|
|
2550
|
-
], () => L(), { immediate: !0 });
|
|
2551
|
-
function R(e) {
|
|
2552
|
-
let t = e?.parentElement ?? null;
|
|
2553
|
-
for (; t;) {
|
|
2554
|
-
let e = getComputedStyle(t).overflowY;
|
|
2555
|
-
if (e === "auto" || e === "scroll") return t;
|
|
2556
|
-
t = t.parentElement;
|
|
2557
|
-
}
|
|
2558
|
-
return null;
|
|
2559
|
-
}
|
|
2560
|
-
let z = null;
|
|
2561
|
-
function B() {
|
|
2562
|
-
z && z.removeEventListener("scroll", L), z = R(n.pagesContainer), z && z.addEventListener("scroll", L, { passive: !0 });
|
|
2563
|
-
}
|
|
2564
|
-
return g(() => {
|
|
2565
|
-
L(), n.pagesContainer && (E = new ResizeObserver(() => L()), E.observe(n.pagesContainer), B());
|
|
2566
|
-
}), D(() => n.pagesContainer, (e, t) => {
|
|
2567
|
-
E?.disconnect(), E = null, e && (E = new ResizeObserver(() => L()), E.observe(e), B());
|
|
2568
|
-
}), h(() => {
|
|
2569
|
-
E?.disconnect(), z && z.removeEventListener("scroll", L);
|
|
2570
|
-
}), (t, n) => (_(), s(r, null, [M.value ? (_(), a(S("style"), { key: 0 }, {
|
|
2571
|
-
default: O(() => [l(C(M.value), 1)]),
|
|
2572
|
-
_: 1
|
|
2573
|
-
})) : o("", !0), e.isOpen ? (_(), s("aside", {
|
|
2574
|
-
key: 1,
|
|
2575
|
-
ref_key: "rootRef",
|
|
2576
|
-
ref: w,
|
|
2577
|
-
class: "unified-sidebar",
|
|
2578
|
-
style: m(P.value),
|
|
2579
|
-
onMousedown: n[11] ||= j(() => {}, ["stop"])
|
|
2580
|
-
}, [c("div", {
|
|
2581
|
-
class: "unified-sidebar__inner",
|
|
2582
|
-
style: m({ minHeight: A.value + "px" })
|
|
2583
|
-
}, [e.isAddingComment ? (_(), s("div", {
|
|
2584
|
-
key: 0,
|
|
2585
|
-
class: "unified-sidebar__addcomment",
|
|
2586
|
-
style: m(N.value)
|
|
2587
|
-
}, [u(Bn, {
|
|
2588
|
-
onSubmit: n[0] ||= (e) => t.$emit("add-comment", e),
|
|
2589
|
-
onCancel: n[1] ||= (e) => t.$emit("cancel-add-comment")
|
|
2590
|
-
})], 4)) : o("", !0), (_(!0), s(r, null, b(x.value, (e) => (_(), s("div", {
|
|
2591
|
-
key: e.id,
|
|
2592
|
-
class: "unified-sidebar__card-slot",
|
|
2593
|
-
"data-card-id": e.id,
|
|
2594
|
-
style: m(F(e.id))
|
|
2595
|
-
}, [e.kind === "comment" && e.comment.done && p.value !== e.id ? (_(), a(fn, {
|
|
2596
|
-
key: 0,
|
|
2597
|
-
comment: e.comment,
|
|
2598
|
-
onToggleExpand: (t) => v(e.id)
|
|
2599
|
-
}, null, 8, ["comment", "onToggleExpand"])) : e.kind === "comment" ? (_(), a(un, {
|
|
2600
|
-
key: 1,
|
|
2601
|
-
comment: e.comment,
|
|
2602
|
-
replies: e.replies,
|
|
2603
|
-
expanded: p.value === e.id,
|
|
2604
|
-
onClick: (t) => v(e.id),
|
|
2605
|
-
onReply: n[2] ||= (e, n) => t.$emit("comment-reply", e, n),
|
|
2606
|
-
onResolve: n[3] ||= (e) => t.$emit("comment-resolve", e),
|
|
2607
|
-
onUnresolve: n[4] ||= (e) => t.$emit("comment-unresolve", e),
|
|
2608
|
-
onDelete: n[5] ||= (e) => t.$emit("comment-delete", e)
|
|
2609
|
-
}, null, 8, [
|
|
2610
|
-
"comment",
|
|
2611
|
-
"replies",
|
|
2612
|
-
"expanded",
|
|
2613
|
-
"onClick"
|
|
2614
|
-
])) : e.kind === "tracked-change" ? (_(), a(In, {
|
|
2615
|
-
key: 2,
|
|
2616
|
-
change: e.change,
|
|
2617
|
-
expanded: p.value === e.id,
|
|
2618
|
-
onClick: (t) => v(e.id),
|
|
2619
|
-
onAccept: n[6] ||= (e, n) => t.$emit("accept-change", e, n),
|
|
2620
|
-
onReject: n[7] ||= (e, n) => t.$emit("reject-change", e, n),
|
|
2621
|
-
onAcceptById: n[8] ||= (e) => t.$emit("accept-change-by-id", e),
|
|
2622
|
-
onRejectById: n[9] ||= (e) => t.$emit("reject-change-by-id", e),
|
|
2623
|
-
onReply: n[10] ||= (e, n) => t.$emit("tracked-change-reply", e, n)
|
|
2624
|
-
}, null, 8, [
|
|
2625
|
-
"change",
|
|
2626
|
-
"expanded",
|
|
2627
|
-
"onClick"
|
|
2628
|
-
])) : o("", !0)], 12, Vn))), 128))], 4)], 36)) : o("", !0)], 64));
|
|
2629
|
-
}
|
|
2630
|
-
}), [["__scopeId", "data-v-afcac95b"]]), Gn = ["title", "onClick"], Kn = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
2631
|
-
__name: "CommentMarginMarkers",
|
|
2632
|
-
props: {
|
|
2633
|
-
comments: {},
|
|
2634
|
-
pagesContainer: {},
|
|
2635
|
-
zoom: {},
|
|
2636
|
-
pageWidthPx: {},
|
|
2637
|
-
sidebarOpen: { type: Boolean },
|
|
2638
|
-
resolvedCommentIds: {}
|
|
2639
|
-
},
|
|
2640
|
-
emits: ["marker-click"],
|
|
2641
|
-
setup(e) {
|
|
2642
|
-
let n = e, a = i(() => {
|
|
2643
|
-
if (n.sidebarOpen) return [];
|
|
2644
|
-
let e = n.pagesContainer;
|
|
2645
|
-
if (!e) return [];
|
|
2646
|
-
let t = e.getBoundingClientRect(), r = /* @__PURE__ */ new Map();
|
|
2647
|
-
for (let t of e.querySelectorAll("[data-comment-id]")) {
|
|
2648
|
-
let e = t.dataset.commentId;
|
|
2649
|
-
e && !r.has(e) && r.set(e, t);
|
|
2650
|
-
}
|
|
2651
|
-
let i = [];
|
|
2652
|
-
for (let a of n.comments) {
|
|
2653
|
-
if (a.parentId != null) continue;
|
|
2654
|
-
let o = r.get(String(a.id));
|
|
2655
|
-
if (!o) continue;
|
|
2656
|
-
let s = o.getBoundingClientRect();
|
|
2657
|
-
i.push({
|
|
2658
|
-
comment: a,
|
|
2659
|
-
isResolved: n.resolvedCommentIds.has(a.id),
|
|
2660
|
-
y: (s.top - t.top + e.scrollTop) / n.zoom
|
|
2661
|
-
});
|
|
2662
|
-
}
|
|
2663
|
-
return i;
|
|
2664
|
-
}), c = i(() => ({
|
|
2665
|
-
position: "absolute",
|
|
2666
|
-
top: 0,
|
|
2667
|
-
left: `calc(50% + ${n.pageWidthPx / n.zoom / 2 + 6}px)`,
|
|
2668
|
-
zIndex: 30,
|
|
2669
|
-
pointerEvents: "none"
|
|
2670
|
-
}));
|
|
2671
|
-
return (n, i) => a.value.length > 0 ? (_(), s("div", {
|
|
2672
|
-
key: 0,
|
|
2673
|
-
class: "docx-comment-margin-markers",
|
|
2674
|
-
style: m(c.value),
|
|
2675
|
-
onMousedown: i[0] ||= j(() => {}, ["stop"])
|
|
2676
|
-
}, [(_(!0), s(r, null, b(a.value, (r) => (_(), s("button", {
|
|
2677
|
-
key: r.comment.id,
|
|
2678
|
-
class: "docx-comment-margin-markers__btn",
|
|
2679
|
-
title: r.isResolved ? "Resolved comment" : "Comment",
|
|
2680
|
-
style: m({ top: r.y * e.zoom + "px" }),
|
|
2681
|
-
onClick: (e) => n.$emit("marker-click", r.comment.id)
|
|
2682
|
-
}, [u(t, {
|
|
2683
|
-
name: r.isResolved ? "chat_bubble_check" : "chat_bubble_outline",
|
|
2684
|
-
size: 18
|
|
2685
|
-
}, null, 8, ["name"])], 12, Gn))), 128))], 36)) : o("", !0);
|
|
2686
|
-
}
|
|
2687
|
-
}), [["__scopeId", "data-v-a20c82d9"]]), qn = ["aria-valuemax"], Jn = { class: "docx-horizontal-ruler__ticks" }, Yn = ["title", "onDblclick"], Xn = 12240, Zn = 1440, Qn = 1440, $n = 567, er = 22, tr = "#4285f4", nr = "#3367d6", rr = "#2a56c6", $ = 5, ir = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
2688
|
-
__name: "HorizontalRuler",
|
|
2689
|
-
props: {
|
|
2690
|
-
sectionProps: {},
|
|
2691
|
-
zoom: { default: 1 },
|
|
2692
|
-
editable: {
|
|
2693
|
-
type: Boolean,
|
|
2694
|
-
default: !0
|
|
2695
|
-
},
|
|
2696
|
-
showFirstLineIndent: {
|
|
2697
|
-
type: Boolean,
|
|
2698
|
-
default: !0
|
|
2699
|
-
},
|
|
2700
|
-
firstLineIndent: { default: 0 },
|
|
2701
|
-
hangingIndent: {
|
|
2702
|
-
type: Boolean,
|
|
2703
|
-
default: !1
|
|
2704
|
-
},
|
|
2705
|
-
indentLeft: { default: 0 },
|
|
2706
|
-
indentRight: { default: 0 },
|
|
2707
|
-
unit: { default: "inch" },
|
|
2708
|
-
tabStops: {}
|
|
2709
|
-
},
|
|
2710
|
-
emits: [
|
|
2711
|
-
"left-margin-change",
|
|
2712
|
-
"right-margin-change",
|
|
2713
|
-
"first-line-indent-change",
|
|
2714
|
-
"indent-left-change",
|
|
2715
|
-
"indent-right-change",
|
|
2716
|
-
"tab-stop-remove"
|
|
2717
|
-
],
|
|
2718
|
-
setup(e, { emit: t }) {
|
|
2719
|
-
let n = e, a = t, l = Math.round($ * 1.6), u = y(null), d = y(null), f = y(null), p = y(0), g = y("");
|
|
2720
|
-
function v(e) {
|
|
2721
|
-
return te(e) * n.zoom;
|
|
2722
|
-
}
|
|
2723
|
-
function x(e) {
|
|
2724
|
-
return Math.round(ee(e / n.zoom));
|
|
2725
|
-
}
|
|
2726
|
-
let S = i(() => n.sectionProps?.pageWidth ?? Xn), w = i(() => n.sectionProps?.marginLeft ?? Zn), T = i(() => n.sectionProps?.marginRight ?? Zn), E = i(() => S.value - w.value - T.value), D = i(() => v(S.value)), O = i(() => v(w.value)), k = i(() => v(T.value)), A = i(() => v(n.indentLeft)), M = i(() => v(n.indentRight)), N = i(() => n.hangingIndent ? -n.firstLineIndent : n.firstLineIndent), P = i(() => v(N.value)), F = i(() => O.value + A.value), I = i(() => D.value - k.value - M.value), L = i(() => O.value + A.value + P.value), R = i(() => ({
|
|
2727
|
-
position: "relative",
|
|
2728
|
-
width: D.value + "px",
|
|
2729
|
-
height: er + "px",
|
|
2730
|
-
backgroundColor: "transparent",
|
|
2731
|
-
overflow: "visible",
|
|
2732
|
-
userSelect: "none",
|
|
2733
|
-
cursor: d.value ? "ew-resize" : "default"
|
|
2734
|
-
})), z = i(() => ({
|
|
2735
|
-
position: "absolute",
|
|
2736
|
-
top: 0,
|
|
2737
|
-
left: 0,
|
|
2738
|
-
width: O.value + "px",
|
|
2739
|
-
height: er + "px",
|
|
2740
|
-
backgroundColor: "rgba(0, 0, 0, 0.02)",
|
|
2741
|
-
borderRight: "1px solid rgba(0,0,0,0.06)",
|
|
2742
|
-
cursor: n.editable ? "ew-resize" : "default",
|
|
2743
|
-
zIndex: 1
|
|
2744
|
-
})), B = i(() => ({
|
|
2745
|
-
position: "absolute",
|
|
2746
|
-
top: 0,
|
|
2747
|
-
right: 0,
|
|
2748
|
-
width: k.value + "px",
|
|
2749
|
-
height: er + "px",
|
|
2750
|
-
backgroundColor: "rgba(0, 0, 0, 0.02)",
|
|
2751
|
-
borderLeft: "1px solid rgba(0,0,0,0.06)",
|
|
2752
|
-
cursor: n.editable ? "ew-resize" : "default",
|
|
2753
|
-
zIndex: 1
|
|
2754
|
-
})), V = i(() => {
|
|
2755
|
-
let e = [];
|
|
2756
|
-
if (n.unit === "inch") {
|
|
2757
|
-
let t = Qn / 8, n = Math.ceil(S.value / t);
|
|
2758
|
-
for (let r = 0; r <= n; r++) {
|
|
2759
|
-
let n = r * t;
|
|
2760
|
-
if (n > S.value) break;
|
|
2761
|
-
let i = v(n);
|
|
2762
|
-
r % 8 == 0 ? e.push({
|
|
2763
|
-
position: i,
|
|
2764
|
-
height: 10,
|
|
2765
|
-
label: r / 8 > 0 ? String(r / 8) : void 0
|
|
2766
|
-
}) : r % 4 == 0 ? e.push({
|
|
2767
|
-
position: i,
|
|
2768
|
-
height: 6
|
|
2769
|
-
}) : r % 2 == 0 ? e.push({
|
|
2770
|
-
position: i,
|
|
2771
|
-
height: 4
|
|
2772
|
-
}) : e.push({
|
|
2773
|
-
position: i,
|
|
2774
|
-
height: 2
|
|
2775
|
-
});
|
|
2776
|
-
}
|
|
2777
|
-
} else {
|
|
2778
|
-
let t = $n / 10, n = Math.ceil(S.value / t);
|
|
2779
|
-
for (let r = 0; r <= n; r++) {
|
|
2780
|
-
let n = r * t;
|
|
2781
|
-
if (n > S.value) break;
|
|
2782
|
-
let i = v(n);
|
|
2783
|
-
r % 10 == 0 ? e.push({
|
|
2784
|
-
position: i,
|
|
2785
|
-
height: 10,
|
|
2786
|
-
label: r / 10 > 0 ? String(r / 10) : void 0
|
|
2787
|
-
}) : r % 5 == 0 ? e.push({
|
|
2788
|
-
position: i,
|
|
2789
|
-
height: 6
|
|
2790
|
-
}) : e.push({
|
|
2791
|
-
position: i,
|
|
2792
|
-
height: 3
|
|
2793
|
-
});
|
|
2794
|
-
}
|
|
2795
|
-
}
|
|
2796
|
-
return e;
|
|
2797
|
-
}), H = i(() => n.tabStops?.length ? n.tabStops.map((e) => {
|
|
2798
|
-
let t = e.position ?? e.pos ?? 0;
|
|
2799
|
-
return {
|
|
2800
|
-
px: v(t),
|
|
2801
|
-
twips: t,
|
|
2802
|
-
label: U(t)
|
|
2803
|
-
};
|
|
2804
|
-
}) : []);
|
|
2805
|
-
function U(e) {
|
|
2806
|
-
return n.unit === "cm" ? (e / $n).toFixed(1) + " cm" : (e / Qn).toFixed(2) + "\"";
|
|
2807
|
-
}
|
|
2808
|
-
function W(e) {
|
|
2809
|
-
return d.value === e ? rr : f.value === e ? nr : tr;
|
|
2810
|
-
}
|
|
2811
|
-
function G(e, t, r) {
|
|
2812
|
-
return {
|
|
2813
|
-
position: "absolute",
|
|
2814
|
-
left: t - $ + "px",
|
|
2815
|
-
width: $ * 2 + "px",
|
|
2816
|
-
height: l + 2 + "px",
|
|
2817
|
-
cursor: n.editable ? "ew-resize" : "default",
|
|
2818
|
-
zIndex: r ? 10 : 4,
|
|
2819
|
-
...e === "down" ? { top: 0 } : { bottom: 0 }
|
|
2820
|
-
};
|
|
2821
|
-
}
|
|
2822
|
-
function K(e, t) {
|
|
2823
|
-
return e === "down" ? {
|
|
2824
|
-
position: "absolute",
|
|
2825
|
-
top: "1px",
|
|
2826
|
-
left: 0,
|
|
2827
|
-
width: 0,
|
|
2828
|
-
height: 0,
|
|
2829
|
-
borderLeft: `${$}px solid transparent`,
|
|
2830
|
-
borderRight: `${$}px solid transparent`,
|
|
2831
|
-
borderTop: `${l}px solid ${t}`,
|
|
2832
|
-
transition: "border-top-color 0.1s"
|
|
2833
|
-
} : {
|
|
2834
|
-
position: "absolute",
|
|
2835
|
-
bottom: "1px",
|
|
2836
|
-
left: 0,
|
|
2837
|
-
width: 0,
|
|
2838
|
-
height: 0,
|
|
2839
|
-
borderLeft: `${$}px solid transparent`,
|
|
2840
|
-
borderRight: `${$}px solid transparent`,
|
|
2841
|
-
borderBottom: `${l}px solid ${t}`,
|
|
2842
|
-
transition: "border-bottom-color 0.1s"
|
|
2843
|
-
};
|
|
2844
|
-
}
|
|
2845
|
-
let q = 0;
|
|
2846
|
-
function J(e, t) {
|
|
2847
|
-
n.editable && (d.value = e, t.clientX, e === "leftMargin" ? q = w.value : e === "rightMargin" ? q = T.value : e === "leftIndent" ? q = n.indentLeft : e === "rightIndent" ? q = n.indentRight : e === "firstLineIndent" && (q = n.firstLineIndent), p.value = t.clientX - (u.value?.getBoundingClientRect().left ?? 0), g.value = U(q), document.addEventListener("mousemove", ne), document.addEventListener("mouseup", Y));
|
|
2848
|
-
}
|
|
2849
|
-
function ne(e) {
|
|
2850
|
-
if (!d.value || !u.value) return;
|
|
2851
|
-
let t = u.value.getBoundingClientRect();
|
|
2852
|
-
if (!t) return;
|
|
2853
|
-
let n = e.clientX - t.left;
|
|
2854
|
-
p.value = n;
|
|
2855
|
-
let r = x(n), i = re(d.value, r);
|
|
2856
|
-
g.value = U(i), X(d.value, i);
|
|
2857
|
-
}
|
|
2858
|
-
function Y(e) {
|
|
2859
|
-
d.value = null, document.removeEventListener("mousemove", ne), document.removeEventListener("mouseup", Y);
|
|
2860
|
-
}
|
|
2861
|
-
function re(e, t) {
|
|
2862
|
-
if (e === "leftMargin") {
|
|
2863
|
-
let e = S.value - T.value - 720;
|
|
2864
|
-
return Math.round(Math.max(0, Math.min(t, e)));
|
|
2865
|
-
}
|
|
2866
|
-
if (e === "rightMargin") {
|
|
2867
|
-
let e = S.value - t, n = S.value - w.value - 720;
|
|
2868
|
-
return Math.round(Math.max(0, Math.min(e, n)));
|
|
2869
|
-
}
|
|
2870
|
-
if (e === "firstLineIndent") {
|
|
2871
|
-
let e = t - (w.value + n.indentLeft), r = E.value - n.indentLeft - n.indentRight - 720;
|
|
2872
|
-
return Math.round(Math.max(-n.indentLeft, Math.min(e, r)));
|
|
2873
|
-
}
|
|
2874
|
-
if (e === "leftIndent") {
|
|
2875
|
-
let e = t - w.value, r = E.value - n.indentRight - 720;
|
|
2876
|
-
return Math.round(Math.max(0, Math.min(e, r)));
|
|
2877
|
-
}
|
|
2878
|
-
let r = S.value - T.value - t, i = E.value - n.indentLeft - 720;
|
|
2879
|
-
return Math.round(Math.max(0, Math.min(r, i)));
|
|
2880
|
-
}
|
|
2881
|
-
function X(e, t) {
|
|
2882
|
-
switch (e) {
|
|
2883
|
-
case "leftMargin":
|
|
2884
|
-
a("left-margin-change", t);
|
|
2885
|
-
break;
|
|
2886
|
-
case "rightMargin":
|
|
2887
|
-
a("right-margin-change", t);
|
|
2888
|
-
break;
|
|
2889
|
-
case "firstLineIndent":
|
|
2890
|
-
a("first-line-indent-change", t);
|
|
2891
|
-
break;
|
|
2892
|
-
case "leftIndent":
|
|
2893
|
-
a("indent-left-change", t);
|
|
2894
|
-
break;
|
|
2895
|
-
case "rightIndent":
|
|
2896
|
-
a("indent-right-change", t);
|
|
2897
|
-
break;
|
|
2898
|
-
}
|
|
2899
|
-
}
|
|
2900
|
-
return h(() => {
|
|
2901
|
-
document.removeEventListener("mousemove", ne), document.removeEventListener("mouseup", Y);
|
|
2902
|
-
}), (t, n) => (_(), s("div", {
|
|
2903
|
-
ref_key: "rulerRef",
|
|
2904
|
-
ref: u,
|
|
2905
|
-
class: "docx-horizontal-ruler",
|
|
2906
|
-
style: m(R.value),
|
|
2907
|
-
role: "slider",
|
|
2908
|
-
"aria-label": "Horizontal ruler",
|
|
2909
|
-
"aria-valuemin": 0,
|
|
2910
|
-
"aria-valuemax": S.value
|
|
2911
|
-
}, [
|
|
2912
|
-
c("div", {
|
|
2913
|
-
class: "docx-horizontal-ruler__margin",
|
|
2914
|
-
style: m(z.value),
|
|
2915
|
-
onMousedown: n[0] ||= j((t) => e.editable ? J("leftMargin", t) : null, ["prevent", "stop"])
|
|
2916
|
-
}, null, 36),
|
|
2917
|
-
c("div", {
|
|
2918
|
-
class: "docx-horizontal-ruler__margin",
|
|
2919
|
-
style: m(B.value),
|
|
2920
|
-
onMousedown: n[1] ||= j((t) => e.editable ? J("rightMargin", t) : null, ["prevent", "stop"])
|
|
2921
|
-
}, null, 36),
|
|
2922
|
-
c("div", Jn, [(_(!0), s(r, null, b(V.value, (e, t) => (_(), s(r, { key: t }, [c("div", {
|
|
2923
|
-
class: "docx-horizontal-ruler__tick-line",
|
|
2924
|
-
style: m({
|
|
2925
|
-
left: e.position + "px",
|
|
2926
|
-
height: e.height + "px"
|
|
2927
|
-
})
|
|
2928
|
-
}, null, 4), e.label ? (_(), s("div", {
|
|
2929
|
-
key: 0,
|
|
2930
|
-
class: "docx-horizontal-ruler__tick-label",
|
|
2931
|
-
style: m({ left: e.position + "px" })
|
|
2932
|
-
}, C(e.label), 5)) : o("", !0)], 64))), 128))]),
|
|
2933
|
-
e.showFirstLineIndent ? (_(), s("div", {
|
|
2934
|
-
key: 0,
|
|
2935
|
-
class: "docx-ruler-indent",
|
|
2936
|
-
style: m(G("down", L.value, d.value === "firstLineIndent")),
|
|
2937
|
-
onMousedown: n[2] ||= j((t) => e.editable ? J("firstLineIndent", t) : null, ["prevent", "stop"]),
|
|
2938
|
-
onMouseenter: n[3] ||= (e) => f.value = "firstLineIndent",
|
|
2939
|
-
onMouseleave: n[4] ||= (e) => f.value = null
|
|
2940
|
-
}, [c("div", { style: m(K("down", W("firstLineIndent"))) }, null, 4)], 36)) : o("", !0),
|
|
2941
|
-
e.editable ? (_(), s("div", {
|
|
2942
|
-
key: 1,
|
|
2943
|
-
class: "docx-ruler-indent",
|
|
2944
|
-
style: m(G("up", F.value, d.value === "leftIndent")),
|
|
2945
|
-
onMousedown: n[5] ||= j((e) => J("leftIndent", e), ["prevent", "stop"]),
|
|
2946
|
-
onMouseenter: n[6] ||= (e) => f.value = "leftIndent",
|
|
2947
|
-
onMouseleave: n[7] ||= (e) => f.value = null
|
|
2948
|
-
}, [c("div", { style: m(K("up", W("leftIndent"))) }, null, 4)], 36)) : o("", !0),
|
|
2949
|
-
e.editable ? (_(), s("div", {
|
|
2950
|
-
key: 2,
|
|
2951
|
-
class: "docx-ruler-indent",
|
|
2952
|
-
style: m(G("down", I.value, d.value === "rightIndent")),
|
|
2953
|
-
onMousedown: n[8] ||= j((e) => J("rightIndent", e), ["prevent", "stop"]),
|
|
2954
|
-
onMouseenter: n[9] ||= (e) => f.value = "rightIndent",
|
|
2955
|
-
onMouseleave: n[10] ||= (e) => f.value = null
|
|
2956
|
-
}, [c("div", { style: m(K("down", W("rightIndent"))) }, null, 4)], 36)) : o("", !0),
|
|
2957
|
-
(_(!0), s(r, null, b(H.value, (e, n) => (_(), s("div", {
|
|
2958
|
-
key: n,
|
|
2959
|
-
class: "docx-horizontal-ruler__tab",
|
|
2960
|
-
style: m({ left: e.px + "px" }),
|
|
2961
|
-
title: `${e.label}`,
|
|
2962
|
-
onDblclick: j((n) => t.$emit("tab-stop-remove", e.twips), ["prevent"])
|
|
2963
|
-
}, "L", 44, Yn))), 128)),
|
|
2964
|
-
d.value && g.value ? (_(), s("div", {
|
|
2965
|
-
key: 3,
|
|
2966
|
-
class: "docx-horizontal-ruler__tooltip",
|
|
2967
|
-
style: m({ left: p.value + "px" })
|
|
2968
|
-
}, C(g.value), 5)) : o("", !0)
|
|
2969
|
-
], 12, qn));
|
|
2970
|
-
}
|
|
2971
|
-
}), [["__scopeId", "data-v-a27ea349"]]), ar = { class: "docx-vertical-ruler__ticks" }, or = 15840, sr = 1440, cr = 1440, lr = 567, ur = 20, dr = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
2972
|
-
__name: "VerticalRuler",
|
|
2973
|
-
props: {
|
|
2974
|
-
sectionProps: {},
|
|
2975
|
-
zoom: { default: 1 },
|
|
2976
|
-
editable: {
|
|
2977
|
-
type: Boolean,
|
|
2978
|
-
default: !0
|
|
2979
|
-
},
|
|
2980
|
-
unit: { default: "inch" }
|
|
2981
|
-
},
|
|
2982
|
-
emits: ["top-margin-change", "bottom-margin-change"],
|
|
2983
|
-
setup(e, { emit: t }) {
|
|
2984
|
-
let n = e, a = t, l = y(null), u = y(null), d = y(null);
|
|
2985
|
-
function f(e) {
|
|
2986
|
-
return te(e) * n.zoom;
|
|
2987
|
-
}
|
|
2988
|
-
function p(e) {
|
|
2989
|
-
return Math.round(ee(e / n.zoom));
|
|
2990
|
-
}
|
|
2991
|
-
let g = i(() => n.sectionProps?.pageHeight ?? or), v = i(() => n.sectionProps?.marginTop ?? sr), x = i(() => n.sectionProps?.marginBottom ?? sr), S = i(() => f(g.value)), w = i(() => f(v.value)), T = i(() => f(x.value)), E = i(() => ({
|
|
2992
|
-
position: "relative",
|
|
2993
|
-
width: ur + "px",
|
|
2994
|
-
height: S.value + "px",
|
|
2995
|
-
backgroundColor: "transparent",
|
|
2996
|
-
overflow: "visible",
|
|
2997
|
-
userSelect: "none",
|
|
2998
|
-
cursor: u.value ? "ns-resize" : "default"
|
|
2999
|
-
})), D = i(() => {
|
|
3000
|
-
let e = [];
|
|
3001
|
-
if (n.unit === "inch") {
|
|
3002
|
-
let t = cr / 8, n = Math.ceil(g.value / t);
|
|
3003
|
-
for (let r = 0; r <= n; r++) {
|
|
3004
|
-
let n = r * t;
|
|
3005
|
-
if (n > g.value) break;
|
|
3006
|
-
let i = f(n);
|
|
3007
|
-
r % 8 == 0 ? e.push({
|
|
3008
|
-
position: i,
|
|
3009
|
-
width: 10,
|
|
3010
|
-
label: r / 8 > 0 ? String(r / 8) : void 0
|
|
3011
|
-
}) : r % 4 == 0 ? e.push({
|
|
3012
|
-
position: i,
|
|
3013
|
-
width: 6
|
|
3014
|
-
}) : r % 2 == 0 ? e.push({
|
|
3015
|
-
position: i,
|
|
3016
|
-
width: 4
|
|
3017
|
-
}) : e.push({
|
|
3018
|
-
position: i,
|
|
3019
|
-
width: 2
|
|
3020
|
-
});
|
|
3021
|
-
}
|
|
3022
|
-
} else {
|
|
3023
|
-
let t = lr / 10, n = Math.ceil(g.value / t);
|
|
3024
|
-
for (let r = 0; r <= n; r++) {
|
|
3025
|
-
let n = r * t;
|
|
3026
|
-
if (n > g.value) break;
|
|
3027
|
-
let i = f(n);
|
|
3028
|
-
r % 10 == 0 ? e.push({
|
|
3029
|
-
position: i,
|
|
3030
|
-
width: 10,
|
|
3031
|
-
label: r / 10 > 0 ? String(r / 10) : void 0
|
|
3032
|
-
}) : r % 5 == 0 ? e.push({
|
|
3033
|
-
position: i,
|
|
3034
|
-
width: 6
|
|
3035
|
-
}) : e.push({
|
|
3036
|
-
position: i,
|
|
3037
|
-
width: 3
|
|
3038
|
-
});
|
|
3039
|
-
}
|
|
3040
|
-
}
|
|
3041
|
-
return e;
|
|
3042
|
-
});
|
|
3043
|
-
function O(e) {
|
|
3044
|
-
return {
|
|
3045
|
-
position: "absolute",
|
|
3046
|
-
top: e - 5 + "px",
|
|
3047
|
-
right: 0,
|
|
3048
|
-
width: ur + "px",
|
|
3049
|
-
height: "10px",
|
|
3050
|
-
cursor: n.editable ? "ns-resize" : "default",
|
|
3051
|
-
zIndex: u.value === null ? 1 : 10
|
|
3052
|
-
};
|
|
3053
|
-
}
|
|
3054
|
-
function k(e) {
|
|
3055
|
-
let t = u.value === e;
|
|
3056
|
-
return d.value, {
|
|
3057
|
-
position: "absolute",
|
|
3058
|
-
top: "0px",
|
|
3059
|
-
right: "2px",
|
|
3060
|
-
width: "0",
|
|
3061
|
-
height: "0",
|
|
3062
|
-
borderTop: "5px solid transparent",
|
|
3063
|
-
borderBottom: "5px solid transparent",
|
|
3064
|
-
borderRight: `8px solid ${t ? "var(--doc-primary-hover, #1557b0)" : "var(--doc-primary, #1a73e8)"}`,
|
|
3065
|
-
transition: "border-right-color 0.1s"
|
|
3066
|
-
};
|
|
3067
|
-
}
|
|
3068
|
-
let A = 0, M = 0;
|
|
3069
|
-
function N(e, t) {
|
|
3070
|
-
n.editable && (u.value = e, A = t.clientY, M = e === "topMargin" ? v.value : x.value, document.addEventListener("mousemove", P), document.addEventListener("mouseup", F));
|
|
3071
|
-
}
|
|
3072
|
-
function P(e) {
|
|
3073
|
-
if (!u.value) return;
|
|
3074
|
-
let t = e.clientY - A, n = p(u.value === "topMargin" ? t : -t), r = g.value - (u.value === "topMargin" ? x.value : v.value) - 720, i = Math.round(Math.max(0, Math.min(M + n, r)));
|
|
3075
|
-
u.value === "topMargin" ? a("top-margin-change", i) : a("bottom-margin-change", i);
|
|
3076
|
-
}
|
|
3077
|
-
function F() {
|
|
3078
|
-
u.value = null, document.removeEventListener("mousemove", P), document.removeEventListener("mouseup", F);
|
|
3079
|
-
}
|
|
3080
|
-
return h(() => {
|
|
3081
|
-
document.removeEventListener("mousemove", P), document.removeEventListener("mouseup", F);
|
|
3082
|
-
}), (t, n) => (_(), s("div", {
|
|
3083
|
-
ref_key: "rulerRef",
|
|
3084
|
-
ref: l,
|
|
3085
|
-
class: "docx-vertical-ruler",
|
|
3086
|
-
style: m(E.value),
|
|
3087
|
-
role: "slider",
|
|
3088
|
-
"aria-label": "Vertical ruler",
|
|
3089
|
-
"aria-orientation": "vertical"
|
|
3090
|
-
}, [
|
|
3091
|
-
c("div", ar, [(_(!0), s(r, null, b(D.value, (e, t) => (_(), s(r, { key: t }, [c("div", {
|
|
3092
|
-
class: "docx-vertical-ruler__tick-line",
|
|
3093
|
-
style: m({
|
|
3094
|
-
top: e.position + "px",
|
|
3095
|
-
width: e.width + "px"
|
|
3096
|
-
})
|
|
3097
|
-
}, null, 4), e.label ? (_(), s("div", {
|
|
3098
|
-
key: 0,
|
|
3099
|
-
class: "docx-vertical-ruler__tick-label",
|
|
3100
|
-
style: m({ top: e.position + "px" })
|
|
3101
|
-
}, C(e.label), 5)) : o("", !0)], 64))), 128))]),
|
|
3102
|
-
e.editable ? (_(), s("div", {
|
|
3103
|
-
key: 0,
|
|
3104
|
-
class: "docx-vertical-ruler__marker",
|
|
3105
|
-
style: m(O(w.value)),
|
|
3106
|
-
onMousedown: n[0] ||= j((e) => N("topMargin", e), ["prevent"]),
|
|
3107
|
-
onMouseenter: n[1] ||= (e) => d.value = "topMargin",
|
|
3108
|
-
onMouseleave: n[2] ||= (e) => d.value = null
|
|
3109
|
-
}, [c("div", { style: m(k("topMargin")) }, null, 4)], 36)) : o("", !0),
|
|
3110
|
-
e.editable ? (_(), s("div", {
|
|
3111
|
-
key: 1,
|
|
3112
|
-
class: "docx-vertical-ruler__marker",
|
|
3113
|
-
style: m(O(S.value - T.value)),
|
|
3114
|
-
onMousedown: n[3] ||= j((e) => N("bottomMargin", e), ["prevent"]),
|
|
3115
|
-
onMouseenter: n[4] ||= (e) => d.value = "bottomMargin",
|
|
3116
|
-
onMouseleave: n[5] ||= (e) => d.value = null
|
|
3117
|
-
}, [c("div", { style: m(k("bottomMargin")) }, null, 4)], 36)) : o("", !0)
|
|
3118
|
-
], 4));
|
|
3119
|
-
}
|
|
3120
|
-
}), [["__scopeId", "data-v-6e1bbe22"]]), fr = { class: "doc-name" }, pr = ["value"], mr = {
|
|
3121
|
-
key: 1,
|
|
3122
|
-
class: "doc-name__text"
|
|
3123
|
-
}, hr = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
3124
|
-
__name: "DocumentName",
|
|
3125
|
-
props: {
|
|
3126
|
-
modelValue: {},
|
|
3127
|
-
editable: {
|
|
3128
|
-
type: Boolean,
|
|
3129
|
-
default: !0
|
|
3130
|
-
}
|
|
3131
|
-
},
|
|
3132
|
-
emits: ["update:modelValue"],
|
|
3133
|
-
setup(e, { emit: t }) {
|
|
3134
|
-
let n = e, r = t, a = i(() => (n.modelValue || "").replace(/\.docx$/i, ""));
|
|
3135
|
-
function o(e) {
|
|
3136
|
-
let t = e.target.value;
|
|
3137
|
-
r("update:modelValue", t.endsWith(".docx") ? t : t + ".docx");
|
|
3138
|
-
}
|
|
3139
|
-
function c(e) {
|
|
3140
|
-
e.target.value.trim() || r("update:modelValue", "Untitled document.docx");
|
|
3141
|
-
}
|
|
3142
|
-
return (t, n) => (_(), s("div", fr, [e.editable ? (_(), s("input", {
|
|
3143
|
-
key: 0,
|
|
3144
|
-
class: "doc-name__input",
|
|
3145
|
-
value: a.value,
|
|
3146
|
-
onInput: o,
|
|
3147
|
-
onBlur: c,
|
|
3148
|
-
placeholder: "Untitled document"
|
|
3149
|
-
}, null, 40, pr)) : (_(), s("span", mr, C(a.value || "Untitled document"), 1))]));
|
|
3150
|
-
}
|
|
3151
|
-
}), [["__scopeId", "data-v-d78ee2fa"]]), gr = ["disabled", "onClick"], _r = {
|
|
3152
|
-
key: 0,
|
|
3153
|
-
class: "docx-menu-dropdown__separator"
|
|
3154
|
-
}, vr = ["onMouseenter", "onMouseleave"], yr = ["disabled", "onClick"], br = { class: "docx-menu-dropdown__label" }, xr = {
|
|
3155
|
-
key: 1,
|
|
3156
|
-
class: "docx-menu-dropdown__shortcut"
|
|
3157
|
-
}, Sr = {
|
|
3158
|
-
key: 2,
|
|
3159
|
-
class: "docx-menu-dropdown__chevron"
|
|
3160
|
-
}, Cr = {
|
|
3161
|
-
key: 0,
|
|
3162
|
-
class: "docx-menu-dropdown__submenu"
|
|
3163
|
-
}, wr = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
3164
|
-
__name: "MenuDropdown",
|
|
3165
|
-
props: {
|
|
3166
|
-
label: {},
|
|
3167
|
-
items: {},
|
|
3168
|
-
disabled: { type: Boolean },
|
|
3169
|
-
showChevron: {
|
|
3170
|
-
type: Boolean,
|
|
3171
|
-
default: !1
|
|
3172
|
-
}
|
|
3173
|
-
},
|
|
3174
|
-
setup(e) {
|
|
3175
|
-
function n(e) {
|
|
3176
|
-
return "type" in e && e.type === "separator";
|
|
3177
|
-
}
|
|
3178
|
-
let i = y(!1), d = y(null);
|
|
3179
|
-
function f() {
|
|
3180
|
-
i.value = !1, d.value = null;
|
|
3181
|
-
}
|
|
3182
|
-
function m(e) {
|
|
3183
|
-
e.disabled || e.submenu || (e.onClick?.(), f());
|
|
3184
|
-
}
|
|
3185
|
-
return (h, g) => (_(), a(Q, {
|
|
3186
|
-
open: i.value,
|
|
3187
|
-
"onUpdate:open": g[2] ||= (e) => i.value = e,
|
|
3188
|
-
onClose: f
|
|
3189
|
-
}, {
|
|
3190
|
-
trigger: O(({ toggle: n }) => [c("button", {
|
|
3191
|
-
type: "button",
|
|
3192
|
-
class: p(["docx-menu-dropdown__trigger", { "docx-menu-dropdown__trigger--open": i.value }]),
|
|
3193
|
-
disabled: e.disabled,
|
|
3194
|
-
onMousedown: g[0] ||= j(() => {}, ["prevent"]),
|
|
3195
|
-
onClick: j(n, ["prevent"])
|
|
3196
|
-
}, [l(C(e.label) + " ", 1), e.showChevron ? (_(), a(t, {
|
|
3197
|
-
key: 0,
|
|
3198
|
-
name: "arrow_drop_down",
|
|
3199
|
-
size: 16
|
|
3200
|
-
})) : o("", !0)], 42, gr)]),
|
|
3201
|
-
panel: O(() => [c("div", {
|
|
3202
|
-
class: "docx-menu-dropdown__menu",
|
|
3203
|
-
onMousedown: g[1] ||= j(() => {}, ["prevent"])
|
|
3204
|
-
}, [(_(!0), s(r, null, b(e.items, (e, i) => (_(), s(r, { key: i }, [n(e) ? (_(), s("div", _r)) : (_(), s("div", {
|
|
3205
|
-
key: 1,
|
|
3206
|
-
class: "docx-menu-dropdown__wrap",
|
|
3207
|
-
onMouseenter: (t) => e.submenu ? d.value = i : void 0,
|
|
3208
|
-
onMouseleave: (t) => e.submenu ? d.value = null : void 0
|
|
3209
|
-
}, [c("button", {
|
|
3210
|
-
type: "button",
|
|
3211
|
-
class: p(["docx-menu-dropdown__item", { "docx-menu-dropdown__item--disabled": e.disabled }]),
|
|
3212
|
-
disabled: e.disabled,
|
|
3213
|
-
onClick: j((t) => m(e), ["prevent"])
|
|
3214
|
-
}, [
|
|
3215
|
-
e.icon ? (_(), a(t, {
|
|
3216
|
-
key: 0,
|
|
3217
|
-
name: e.icon,
|
|
3218
|
-
size: 18
|
|
3219
|
-
}, null, 8, ["name"])) : o("", !0),
|
|
3220
|
-
c("span", br, C(e.label), 1),
|
|
3221
|
-
e.shortcut ? (_(), s("span", xr, C(e.shortcut), 1)) : o("", !0),
|
|
3222
|
-
e.submenu ? (_(), s("span", Sr, [u(t, {
|
|
3223
|
-
name: "keyboard_arrow_right",
|
|
3224
|
-
size: 16
|
|
3225
|
-
})])) : o("", !0)
|
|
3226
|
-
], 10, yr), e.submenu && d.value === i ? (_(), s("div", Cr, [x(h.$slots, "submenu", {
|
|
3227
|
-
item: e,
|
|
3228
|
-
closeMenu: f
|
|
3229
|
-
}, void 0, !0)])) : o("", !0)], 40, vr))], 64))), 128))], 32)]),
|
|
3230
|
-
_: 3
|
|
3231
|
-
}, 8, ["open"]));
|
|
3232
|
-
}
|
|
3233
|
-
}), [["__scopeId", "data-v-65cffcb2"]]), Tr = ["aria-selected", "onMouseenter"], Er = { class: "docx-table-grid-inline__label" }, Dr = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
3234
|
-
__name: "TableGridInline",
|
|
3235
|
-
props: {
|
|
3236
|
-
gridRows: { default: 6 },
|
|
3237
|
-
gridColumns: { default: 6 }
|
|
3238
|
-
},
|
|
3239
|
-
emits: ["insert"],
|
|
3240
|
-
setup(e, { emit: t }) {
|
|
3241
|
-
let n = e, a = t, o = y(0), l = y(0), u = i(() => {
|
|
3242
|
-
let e = [];
|
|
3243
|
-
for (let t = 1; t <= n.gridRows; t++) for (let r = 1; r <= n.gridColumns; r++) e.push({
|
|
3244
|
-
r: t,
|
|
3245
|
-
c: r
|
|
3246
|
-
});
|
|
3247
|
-
return e;
|
|
3248
|
-
});
|
|
3249
|
-
function d() {
|
|
3250
|
-
o.value > 0 && l.value > 0 && a("insert", o.value, l.value);
|
|
3251
|
-
}
|
|
3252
|
-
return (t, n) => (_(), s("div", null, [c("div", {
|
|
3253
|
-
class: "docx-table-grid-inline__grid",
|
|
3254
|
-
style: m({ gridTemplateColumns: `repeat(${e.gridColumns}, 18px)` }),
|
|
3255
|
-
role: "grid",
|
|
3256
|
-
"aria-label": "Table size selector",
|
|
3257
|
-
onMouseleave: n[0] ||= (e) => {
|
|
3258
|
-
o.value = 0, l.value = 0;
|
|
3259
|
-
}
|
|
3260
|
-
}, [(_(!0), s(r, null, b(u.value, (e) => (_(), s("div", {
|
|
3261
|
-
key: `${e.r}-${e.c}`,
|
|
3262
|
-
class: p(["docx-table-grid-inline__cell", { "docx-table-grid-inline__cell--active": e.r <= o.value && e.c <= l.value }]),
|
|
3263
|
-
role: "gridcell",
|
|
3264
|
-
"aria-selected": e.r <= o.value && e.c <= l.value,
|
|
3265
|
-
onMouseenter: (t) => {
|
|
3266
|
-
o.value = e.r, l.value = e.c;
|
|
3267
|
-
},
|
|
3268
|
-
onClick: j(d, ["prevent"])
|
|
3269
|
-
}, null, 42, Tr))), 128))], 36), c("div", Er, C(o.value > 0 && l.value > 0 ? `${l.value} × ${o.value}` : "Select size"), 1)]));
|
|
3270
|
-
}
|
|
3271
|
-
}), [["__scopeId", "data-v-ecd8fc63"]]), Or = {
|
|
3272
|
-
class: "menu-bar",
|
|
3273
|
-
role: "menubar"
|
|
3274
|
-
}, kr = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
3275
|
-
__name: "MenuBar",
|
|
3276
|
-
emits: ["action", "insert-table"],
|
|
3277
|
-
setup(t, { emit: n }) {
|
|
3278
|
-
let r = n, { t: c } = e();
|
|
3279
|
-
function l(e) {
|
|
3280
|
-
return () => r("action", e);
|
|
3281
|
-
}
|
|
3282
|
-
let d = i(() => [
|
|
3283
|
-
{
|
|
3284
|
-
icon: "file_upload",
|
|
3285
|
-
label: c("toolbar.open"),
|
|
3286
|
-
shortcut: c("toolbar.openShortcut"),
|
|
3287
|
-
onClick: l("open")
|
|
3288
|
-
},
|
|
3289
|
-
{
|
|
3290
|
-
icon: "file_download",
|
|
3291
|
-
label: c("toolbar.save"),
|
|
3292
|
-
shortcut: c("toolbar.saveShortcut"),
|
|
3293
|
-
onClick: l("save")
|
|
3294
|
-
},
|
|
3295
|
-
{ type: "separator" },
|
|
3296
|
-
{
|
|
3297
|
-
icon: "settings",
|
|
3298
|
-
label: c("toolbar.pageSetup"),
|
|
3299
|
-
onClick: l("pageSetup")
|
|
3300
|
-
}
|
|
3301
|
-
]), f = i(() => [{
|
|
3302
|
-
icon: "format_textdirection_l_to_r",
|
|
3303
|
-
label: c("toolbar.leftToRight"),
|
|
3304
|
-
onClick: l("dirLTR")
|
|
3305
|
-
}, {
|
|
3306
|
-
icon: "format_textdirection_r_to_l",
|
|
3307
|
-
label: c("toolbar.rightToLeft"),
|
|
3308
|
-
onClick: l("dirRTL")
|
|
3309
|
-
}]), p = i(() => [
|
|
3310
|
-
{
|
|
3311
|
-
icon: "image",
|
|
3312
|
-
label: c("toolbar.image"),
|
|
3313
|
-
onClick: l("insertImage")
|
|
3314
|
-
},
|
|
3315
|
-
{
|
|
3316
|
-
icon: "grid_on",
|
|
3317
|
-
label: c("toolbar.table"),
|
|
3318
|
-
key: "table",
|
|
3319
|
-
submenu: !0
|
|
3320
|
-
},
|
|
3321
|
-
{ type: "separator" },
|
|
3322
|
-
{
|
|
3323
|
-
icon: "page_break",
|
|
3324
|
-
label: c("toolbar.pageBreak"),
|
|
3325
|
-
onClick: l("insertPageBreak")
|
|
3326
|
-
},
|
|
3327
|
-
{
|
|
3328
|
-
icon: "format_list_numbered",
|
|
3329
|
-
label: c("toolbar.tableOfContents"),
|
|
3330
|
-
onClick: l("insertTOC")
|
|
3331
|
-
}
|
|
3332
|
-
]), m = i(() => [{
|
|
3333
|
-
label: c("toolbar.reportIssue"),
|
|
3334
|
-
onClick: l("reportIssue")
|
|
3335
|
-
}]);
|
|
3336
|
-
return (e, t) => (_(), s("div", Or, [
|
|
3337
|
-
u(wr, {
|
|
3338
|
-
label: w(c)("toolbar.file"),
|
|
3339
|
-
items: d.value
|
|
3340
|
-
}, null, 8, ["label", "items"]),
|
|
3341
|
-
u(wr, {
|
|
3342
|
-
label: w(c)("toolbar.format"),
|
|
3343
|
-
items: f.value
|
|
3344
|
-
}, null, 8, ["label", "items"]),
|
|
3345
|
-
u(wr, {
|
|
3346
|
-
label: w(c)("toolbar.insert"),
|
|
3347
|
-
items: p.value
|
|
3348
|
-
}, {
|
|
3349
|
-
submenu: O(({ item: e, closeMenu: t }) => [e.key === "table" ? (_(), a(Dr, {
|
|
3350
|
-
key: 0,
|
|
3351
|
-
onInsert: (e, n) => {
|
|
3352
|
-
r("insert-table", e, n), t();
|
|
3353
|
-
}
|
|
3354
|
-
}, null, 8, ["onInsert"])) : o("", !0)]),
|
|
3355
|
-
_: 1
|
|
3356
|
-
}, 8, ["label", "items"]),
|
|
3357
|
-
u(wr, {
|
|
3358
|
-
label: w(c)("toolbar.help"),
|
|
3359
|
-
items: m.value
|
|
3360
|
-
}, null, 8, ["label", "items"])
|
|
3361
|
-
]));
|
|
3362
|
-
}
|
|
3363
|
-
}), [["__scopeId", "data-v-31c47d54"]]);
|
|
3364
|
-
//#endregion
|
|
3365
|
-
export { Ae as C, Z as D, Q as E, je as S, Te as T, st as _, dr as a, Ze as b, Wn as c, fn as d, un as f, Bt as g, Vt as h, hr as i, Bn as l, Yt as m, Dr as n, ir as o, $t as p, wr as r, Kn as s, kr as t, In as u, nt as v, ke as w, Xe as x, tt as y };
|