@eigenpal/docx-editor-vue 0.0.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/LICENSE +204 -0
- package/README.md +60 -0
- package/dist/KeyboardShortcutsDialog-BtJB9UOD.js +2902 -0
- package/dist/KeyboardShortcutsDialog-D72k5DXR.cjs +1 -0
- package/dist/MenuBar-BrQW4COn.cjs +4 -0
- package/dist/MenuBar-D_Dvwb0F.js +3313 -0
- package/dist/RenderedDomContext-CHc18N_2.js +2 -0
- package/dist/TablePropertiesDialog-Ct5XChwd.cjs +1 -0
- package/dist/TablePropertiesDialog-cJx_xxxE.js +987 -0
- package/dist/_plugin-vue_export-helper-B52Kst-M.js +8 -0
- package/dist/_plugin-vue_export-helper-CX7YVcP6.cjs +1 -0
- package/dist/components/DocxEditor/types.d.ts +100 -0
- package/dist/components/EditorToolbarContext.d.ts +9 -0
- package/dist/components/Toolbar/presets.d.ts +42 -0
- package/dist/components/dialogs/index.d.ts +27 -0
- package/dist/components/imageContextMenuTypes.d.ts +30 -0
- package/dist/components/imageSelectionTypes.d.ts +14 -0
- package/dist/components/insertTableState.d.ts +9 -0
- package/dist/components/sidebar/cardStyles.d.ts +3 -0
- package/dist/components/sidebar/cardUtils.d.ts +1 -0
- package/dist/components/sidebar/resolveItemPositions.d.ts +4 -0
- package/dist/components/sidebar/sidebarUtils.d.ts +4 -0
- package/dist/components/tableStylePresets.d.ts +53 -0
- package/dist/components/toolbarUtils.d.ts +1 -0
- package/dist/components/ui/Icons.d.ts +1 -0
- package/dist/components/ui/hyperlinkPopupTypes.d.ts +20 -0
- package/dist/composables/index.d.ts +30 -0
- package/dist/composables/useAutoSave.d.ts +40 -0
- package/dist/composables/useClipboard.d.ts +22 -0
- package/dist/composables/useCommentLifecycle.d.ts +52 -0
- package/dist/composables/useCommentManagement.d.ts +41 -0
- package/dist/composables/useCommentSidebarItems.d.ts +24 -0
- package/dist/composables/useContextMenus.d.ts +39 -0
- package/dist/composables/useDocumentLifecycle.d.ts +11 -0
- package/dist/composables/useDocxEditor.d.ts +56 -0
- package/dist/composables/useDocxEditorRefApi.d.ts +49 -0
- package/dist/composables/useDragAutoScroll.d.ts +11 -0
- package/dist/composables/useFileIO.d.ts +30 -0
- package/dist/composables/useFindReplace.d.ts +34 -0
- package/dist/composables/useFixedDropdown.d.ts +14 -0
- package/dist/composables/useFormattingActions.d.ts +40 -0
- package/dist/composables/useHistory.d.ts +9 -0
- package/dist/composables/useHyperlinkManagement.d.ts +38 -0
- package/dist/composables/useImageActions.d.ts +30 -0
- package/dist/composables/useKeyboardShortcuts.d.ts +17 -0
- package/dist/composables/useMenuActions.d.ts +23 -0
- package/dist/composables/useOutlineSidebar.d.ts +17 -0
- package/dist/composables/usePageSetupControls.d.ts +22 -0
- package/dist/composables/usePagesPointer.d.ts +70 -0
- package/dist/composables/useSelectionHighlight.d.ts +19 -0
- package/dist/composables/useSelectionSync.d.ts +13 -0
- package/dist/composables/useTableResize.d.ts +7 -0
- package/dist/composables/useTableSelection.d.ts +10 -0
- package/dist/composables/useToolbarDropdowns.d.ts +14 -0
- package/dist/composables/useTrackedChanges.d.ts +12 -0
- package/dist/composables/useVisualLineNavigation.d.ts +11 -0
- package/dist/composables/useWheelZoom.d.ts +10 -0
- package/dist/composables/useZoom.d.ts +16 -0
- package/dist/composables.cjs +1 -0
- package/dist/composables.js +485 -0
- package/dist/dialogs.cjs +1 -0
- package/dist/dialogs.js +3 -0
- package/dist/docx-editor-vue.css +2 -0
- package/dist/i18n/LocaleContext.d.ts +1 -0
- package/dist/i18n/index.d.ts +26 -0
- package/dist/index.cjs +20 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +3600 -0
- package/dist/lib/utils.d.ts +10 -0
- package/dist/plugin-api/RenderedDomContext.d.ts +1 -0
- package/dist/plugin-api/index.d.ts +18 -0
- package/dist/plugin-api/types.d.ts +28 -0
- package/dist/plugin-api.cjs +1 -0
- package/dist/plugin-api.js +62 -0
- package/dist/renderAsync.d.ts +31 -0
- package/dist/styles/index.d.ts +12 -0
- package/dist/styles/zIndex.d.ts +24 -0
- package/dist/styles.cjs +1 -0
- package/dist/styles.js +5 -0
- package/dist/ui.cjs +18 -0
- package/dist/ui.d.ts +79 -0
- package/dist/ui.js +963 -0
- package/dist/useTableResize-1oSe9Kjk.js +480 -0
- package/dist/useTableResize-lWdIgX9x.cjs +1 -0
- package/dist/utils/commentFactories.d.ts +7 -0
- package/dist/utils/domQueries.d.ts +28 -0
- package/dist/utils/imageClipboard.d.ts +9 -0
- package/dist/utils/paraTextHelpers.d.ts +29 -0
- package/dist/utils/refApiQueries.d.ts +46 -0
- package/dist/zIndex-CH0jZ7U7.cjs +1 -0
- package/dist/zIndex-CxELVe_L.js +12 -0
- package/package.json +119 -0
|
@@ -0,0 +1,3313 @@
|
|
|
1
|
+
import { d as e, p as t } from "./KeyboardShortcutsDialog-BtJB9UOD.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 = { class: "tc-card__body" }, yn = { class: "tc-card__deleted" }, bn = { class: "tc-card__inserted" }, xn = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
2237
|
+
__name: "TrackedChangeCard",
|
|
2238
|
+
props: {
|
|
2239
|
+
change: {},
|
|
2240
|
+
expanded: { type: Boolean }
|
|
2241
|
+
},
|
|
2242
|
+
emits: [
|
|
2243
|
+
"click",
|
|
2244
|
+
"accept",
|
|
2245
|
+
"reject",
|
|
2246
|
+
"reply"
|
|
2247
|
+
],
|
|
2248
|
+
setup(e) {
|
|
2249
|
+
let n = e, d = i(() => n.change.author || "Unknown");
|
|
2250
|
+
return (n, i) => (_(), s("div", {
|
|
2251
|
+
class: p(["tc-card", { "tc-card--expanded": e.expanded }]),
|
|
2252
|
+
onClick: i[3] ||= (e) => n.$emit("click"),
|
|
2253
|
+
onMousedown: i[4] ||= j(() => {}, ["stop"])
|
|
2254
|
+
}, [
|
|
2255
|
+
c("div", pn, [
|
|
2256
|
+
u(Ht, {
|
|
2257
|
+
name: d.value,
|
|
2258
|
+
size: 32
|
|
2259
|
+
}, null, 8, ["name"]),
|
|
2260
|
+
c("div", mn, [c("div", hn, C(d.value), 1), e.change.date ? (_(), s("div", gn, C(w(H)(e.change.date)), 1)) : o("", !0)]),
|
|
2261
|
+
e.expanded ? (_(), s("div", _n, [c("button", {
|
|
2262
|
+
class: "tc-card__icon-btn",
|
|
2263
|
+
title: "Accept",
|
|
2264
|
+
onClick: i[0] ||= j((t) => n.$emit("accept", e.change.from, e.change.to), ["stop"])
|
|
2265
|
+
}, [u(t, {
|
|
2266
|
+
name: "check",
|
|
2267
|
+
size: 20
|
|
2268
|
+
})]), c("button", {
|
|
2269
|
+
class: "tc-card__icon-btn",
|
|
2270
|
+
title: "Reject",
|
|
2271
|
+
onClick: i[1] ||= j((t) => n.$emit("reject", e.change.from, e.change.to), ["stop"])
|
|
2272
|
+
}, [u(t, {
|
|
2273
|
+
name: "close",
|
|
2274
|
+
size: 20
|
|
2275
|
+
})])])) : o("", !0)
|
|
2276
|
+
]),
|
|
2277
|
+
c("div", vn, [e.change.type === "replacement" ? (_(), s(r, { key: 0 }, [
|
|
2278
|
+
i[5] ||= l(" Replaced ", -1),
|
|
2279
|
+
c("span", yn, "\"" + C(w(K)(e.change.deletedText || "")) + "\"", 1),
|
|
2280
|
+
i[6] ||= l(" with ", -1),
|
|
2281
|
+
c("span", bn, "\"" + C(w(K)(e.change.text)) + "\"", 1)
|
|
2282
|
+
], 64)) : (_(), s(r, { key: 1 }, [l(C(e.change.type === "insertion" ? "Added" : "Deleted") + " ", 1), c("span", { class: p(e.change.type === "insertion" ? "tc-card__inserted" : "tc-card__deleted") }, " \"" + C(w(K)(e.change.text)) + "\" ", 3)], 64))]),
|
|
2283
|
+
e.expanded ? (_(), a($t, {
|
|
2284
|
+
key: 0,
|
|
2285
|
+
onSubmit: i[2] ||= (t) => n.$emit("reply", e.change.revisionId, t)
|
|
2286
|
+
})) : o("", !0)
|
|
2287
|
+
], 34));
|
|
2288
|
+
}
|
|
2289
|
+
}), [["__scopeId", "data-v-297b1eb8"]]), Sn = ["onKeydown"], Cn = { class: "add-comment-card__actions" }, wn = ["disabled"], Tn = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
2290
|
+
__name: "AddCommentCard",
|
|
2291
|
+
emits: ["submit", "cancel"],
|
|
2292
|
+
setup(e, { emit: t }) {
|
|
2293
|
+
let n = t, r = y(""), a = y(null), o = i(() => r.value.trim());
|
|
2294
|
+
g(() => {
|
|
2295
|
+
a.value?.focus({ preventScroll: !0 });
|
|
2296
|
+
});
|
|
2297
|
+
function l() {
|
|
2298
|
+
o.value && (n("submit", o.value), r.value = "");
|
|
2299
|
+
}
|
|
2300
|
+
function u() {
|
|
2301
|
+
n("cancel"), r.value = "";
|
|
2302
|
+
}
|
|
2303
|
+
return (e, t) => (_(), s("div", {
|
|
2304
|
+
class: "add-comment-card",
|
|
2305
|
+
onMousedown: t[3] ||= j(() => {}, ["stop"])
|
|
2306
|
+
}, [k(c("textarea", {
|
|
2307
|
+
ref_key: "inputRef",
|
|
2308
|
+
ref: a,
|
|
2309
|
+
"onUpdate:modelValue": t[0] ||= (e) => r.value = e,
|
|
2310
|
+
class: "add-comment-card__field",
|
|
2311
|
+
placeholder: "Add a comment",
|
|
2312
|
+
onMousedown: t[1] ||= j(() => {}, ["stop"]),
|
|
2313
|
+
onKeydown: [
|
|
2314
|
+
t[2] ||= j(() => {}, ["stop"]),
|
|
2315
|
+
A(j(l, ["exact", "prevent"]), ["enter"]),
|
|
2316
|
+
A(u, ["esc"])
|
|
2317
|
+
]
|
|
2318
|
+
}, null, 40, Sn), [[E, r.value]]), c("div", Cn, [c("button", {
|
|
2319
|
+
class: "add-comment-card__cancel",
|
|
2320
|
+
onClick: u
|
|
2321
|
+
}, "Cancel"), c("button", {
|
|
2322
|
+
class: p(["add-comment-card__submit", { "add-comment-card__submit--active": o.value }]),
|
|
2323
|
+
disabled: !o.value,
|
|
2324
|
+
onClick: l
|
|
2325
|
+
}, "Comment", 10, wn)])], 32));
|
|
2326
|
+
}
|
|
2327
|
+
}), [["__scopeId", "data-v-cc70979b"]]), En = ["data-card-id"], Dn = 16, On = 300, kn = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
2328
|
+
__name: "UnifiedSidebar",
|
|
2329
|
+
props: {
|
|
2330
|
+
isOpen: { type: Boolean },
|
|
2331
|
+
comments: {},
|
|
2332
|
+
trackedChanges: {},
|
|
2333
|
+
isAddingComment: { type: Boolean },
|
|
2334
|
+
showResolved: { type: Boolean },
|
|
2335
|
+
pagesContainer: {},
|
|
2336
|
+
pageWidthPx: {},
|
|
2337
|
+
zoom: {},
|
|
2338
|
+
activeItemId: {},
|
|
2339
|
+
addCommentYPosition: {}
|
|
2340
|
+
},
|
|
2341
|
+
emits: [
|
|
2342
|
+
"close",
|
|
2343
|
+
"add-comment",
|
|
2344
|
+
"cancel-add-comment",
|
|
2345
|
+
"comment-reply",
|
|
2346
|
+
"comment-resolve",
|
|
2347
|
+
"comment-unresolve",
|
|
2348
|
+
"comment-delete",
|
|
2349
|
+
"accept-change",
|
|
2350
|
+
"reject-change",
|
|
2351
|
+
"tracked-change-reply",
|
|
2352
|
+
"update:activeItemId"
|
|
2353
|
+
],
|
|
2354
|
+
setup(e, { emit: t }) {
|
|
2355
|
+
let n = e, d = t, f = y(null), p = i(() => n.activeItemId === void 0 ? f.value : n.activeItemId);
|
|
2356
|
+
function v(e) {
|
|
2357
|
+
let t = p.value === e ? null : e;
|
|
2358
|
+
f.value = t, d("update:activeItemId", t);
|
|
2359
|
+
}
|
|
2360
|
+
let x = i(() => {
|
|
2361
|
+
let e = [], t = n.comments.filter((e) => !e.parentId), r = /* @__PURE__ */ new Map();
|
|
2362
|
+
for (let e of n.comments) if (e.parentId != null) {
|
|
2363
|
+
let t = r.get(e.parentId) || [];
|
|
2364
|
+
t.push(e), r.set(e.parentId, t);
|
|
2365
|
+
}
|
|
2366
|
+
let i = 0;
|
|
2367
|
+
for (let a of t) a.done && !n.showResolved || e.push({
|
|
2368
|
+
id: `comment-${a.id}`,
|
|
2369
|
+
kind: "comment",
|
|
2370
|
+
anchorSelector: `[data-comment-id="${a.id}"]`,
|
|
2371
|
+
fallbackOrder: i++,
|
|
2372
|
+
comment: a,
|
|
2373
|
+
replies: r.get(a.id) || []
|
|
2374
|
+
});
|
|
2375
|
+
for (let t = 0; t < n.trackedChanges.length; t++) {
|
|
2376
|
+
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}"]`;
|
|
2377
|
+
e.push({
|
|
2378
|
+
id: `tc-${r.revisionId}-${t}`,
|
|
2379
|
+
kind: "tracked-change",
|
|
2380
|
+
anchorSelector: o,
|
|
2381
|
+
fallbackOrder: i++,
|
|
2382
|
+
change: r
|
|
2383
|
+
});
|
|
2384
|
+
}
|
|
2385
|
+
return e;
|
|
2386
|
+
}), w = y(null), T = y(/* @__PURE__ */ new Map()), E = null;
|
|
2387
|
+
function k() {
|
|
2388
|
+
let e = n.pagesContainer, t = x.value;
|
|
2389
|
+
if (!e || t.length === 0) {
|
|
2390
|
+
T.value = /* @__PURE__ */ new Map();
|
|
2391
|
+
return;
|
|
2392
|
+
}
|
|
2393
|
+
let r = e.getBoundingClientRect(), i = /* @__PURE__ */ new Map();
|
|
2394
|
+
for (let t of e.querySelectorAll("[data-comment-id]")) {
|
|
2395
|
+
let e = t.dataset.commentId;
|
|
2396
|
+
e && !i.has(e) && i.set(e, t);
|
|
2397
|
+
}
|
|
2398
|
+
let a = /* @__PURE__ */ new Map();
|
|
2399
|
+
for (let t of e.querySelectorAll(".docx-insertion[data-revision-id]")) {
|
|
2400
|
+
let e = t.dataset.revisionId;
|
|
2401
|
+
e && !a.has(e) && a.set(e, t);
|
|
2402
|
+
}
|
|
2403
|
+
let o = /* @__PURE__ */ new Map();
|
|
2404
|
+
for (let t of e.querySelectorAll(".docx-deletion[data-revision-id]")) {
|
|
2405
|
+
let e = t.dataset.revisionId;
|
|
2406
|
+
e && !o.has(e) && o.set(e, t);
|
|
2407
|
+
}
|
|
2408
|
+
let s = [];
|
|
2409
|
+
for (let n of t) {
|
|
2410
|
+
let t;
|
|
2411
|
+
if (n.kind === "comment") t = i.get(String(n.comment.id));
|
|
2412
|
+
else if (n.change.type === "deletion") t = o.get(String(n.change.revisionId));
|
|
2413
|
+
else {
|
|
2414
|
+
let e = n.change.insertionRevisionId ?? n.change.revisionId;
|
|
2415
|
+
t = a.get(String(e));
|
|
2416
|
+
}
|
|
2417
|
+
if (!t) continue;
|
|
2418
|
+
let c = t.getBoundingClientRect();
|
|
2419
|
+
s.push({
|
|
2420
|
+
id: n.id,
|
|
2421
|
+
targetY: c.top - r.top + e.scrollTop
|
|
2422
|
+
});
|
|
2423
|
+
}
|
|
2424
|
+
s.sort((e, t) => e.targetY - t.targetY);
|
|
2425
|
+
let c = /* @__PURE__ */ new Map(), l = w.value;
|
|
2426
|
+
if (l) for (let e of l.querySelectorAll("[data-card-id]")) {
|
|
2427
|
+
let t = e.dataset.cardId;
|
|
2428
|
+
t && c.set(t, e.offsetHeight);
|
|
2429
|
+
}
|
|
2430
|
+
let u = /* @__PURE__ */ new Map(), d = 0;
|
|
2431
|
+
for (let e of s) {
|
|
2432
|
+
let t = c.get(e.id) ?? 80, n = Math.max(e.targetY, d + q);
|
|
2433
|
+
u.set(e.id, n), d = n + t;
|
|
2434
|
+
}
|
|
2435
|
+
T.value = u;
|
|
2436
|
+
}
|
|
2437
|
+
let A = i(() => {
|
|
2438
|
+
let e = 0;
|
|
2439
|
+
for (let t of T.value.values()) e = Math.max(e, t);
|
|
2440
|
+
return e + 200;
|
|
2441
|
+
}), M = i(() => {
|
|
2442
|
+
let e = p.value;
|
|
2443
|
+
if (!e) return "";
|
|
2444
|
+
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; }`;
|
|
2445
|
+
if (e.startsWith("tc-")) {
|
|
2446
|
+
let t = e.split("-")[1];
|
|
2447
|
+
return `
|
|
2448
|
+
.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; }
|
|
2449
|
+
.paged-editor__pages .docx-deletion[data-revision-id="${t}"] { background-color: rgba(211, 47, 47, 0.2) !important; text-decoration-thickness: 2px !important; }
|
|
2450
|
+
`;
|
|
2451
|
+
}
|
|
2452
|
+
return "";
|
|
2453
|
+
}), N = i(() => {
|
|
2454
|
+
let e = n.addCommentYPosition;
|
|
2455
|
+
return e == null ? {
|
|
2456
|
+
position: "static",
|
|
2457
|
+
marginBottom: "8px"
|
|
2458
|
+
} : {
|
|
2459
|
+
position: "absolute",
|
|
2460
|
+
top: e + "px",
|
|
2461
|
+
left: 0,
|
|
2462
|
+
right: 0,
|
|
2463
|
+
transition: "top 0.15s ease"
|
|
2464
|
+
};
|
|
2465
|
+
}), P = i(() => {
|
|
2466
|
+
let e = n.pageWidthPx / 2 + Dn - J, t = T.value.size > 0 || x.value.length === 0;
|
|
2467
|
+
return {
|
|
2468
|
+
position: "absolute",
|
|
2469
|
+
top: "0",
|
|
2470
|
+
left: `calc(50% + ${e}px)`,
|
|
2471
|
+
width: On + "px",
|
|
2472
|
+
opacity: +!!t
|
|
2473
|
+
};
|
|
2474
|
+
});
|
|
2475
|
+
function F(e) {
|
|
2476
|
+
let t = T.value.get(e);
|
|
2477
|
+
return t == null ? {
|
|
2478
|
+
position: "static",
|
|
2479
|
+
marginBottom: "8px"
|
|
2480
|
+
} : {
|
|
2481
|
+
position: "absolute",
|
|
2482
|
+
top: t + "px",
|
|
2483
|
+
left: 0,
|
|
2484
|
+
right: 0,
|
|
2485
|
+
transition: "top 0.15s ease"
|
|
2486
|
+
};
|
|
2487
|
+
}
|
|
2488
|
+
let I = !1;
|
|
2489
|
+
function L() {
|
|
2490
|
+
I || (I = !0, requestAnimationFrame(() => {
|
|
2491
|
+
I = !1, k();
|
|
2492
|
+
}));
|
|
2493
|
+
}
|
|
2494
|
+
D(() => [
|
|
2495
|
+
x.value.length,
|
|
2496
|
+
p.value,
|
|
2497
|
+
n.pagesContainer,
|
|
2498
|
+
n.pageWidthPx,
|
|
2499
|
+
n.zoom
|
|
2500
|
+
], () => L(), { immediate: !0 });
|
|
2501
|
+
function R(e) {
|
|
2502
|
+
let t = e?.parentElement ?? null;
|
|
2503
|
+
for (; t;) {
|
|
2504
|
+
let e = getComputedStyle(t).overflowY;
|
|
2505
|
+
if (e === "auto" || e === "scroll") return t;
|
|
2506
|
+
t = t.parentElement;
|
|
2507
|
+
}
|
|
2508
|
+
return null;
|
|
2509
|
+
}
|
|
2510
|
+
let z = null;
|
|
2511
|
+
function B() {
|
|
2512
|
+
z && z.removeEventListener("scroll", L), z = R(n.pagesContainer), z && z.addEventListener("scroll", L, { passive: !0 });
|
|
2513
|
+
}
|
|
2514
|
+
return g(() => {
|
|
2515
|
+
L(), n.pagesContainer && (E = new ResizeObserver(() => L()), E.observe(n.pagesContainer), B());
|
|
2516
|
+
}), D(() => n.pagesContainer, (e, t) => {
|
|
2517
|
+
E?.disconnect(), E = null, e && (E = new ResizeObserver(() => L()), E.observe(e), B());
|
|
2518
|
+
}), h(() => {
|
|
2519
|
+
E?.disconnect(), z && z.removeEventListener("scroll", L);
|
|
2520
|
+
}), (t, n) => (_(), s(r, null, [M.value ? (_(), a(S("style"), { key: 0 }, {
|
|
2521
|
+
default: O(() => [l(C(M.value), 1)]),
|
|
2522
|
+
_: 1
|
|
2523
|
+
})) : o("", !0), e.isOpen ? (_(), s("aside", {
|
|
2524
|
+
key: 1,
|
|
2525
|
+
ref_key: "rootRef",
|
|
2526
|
+
ref: w,
|
|
2527
|
+
class: "unified-sidebar",
|
|
2528
|
+
style: m(P.value),
|
|
2529
|
+
onMousedown: n[9] ||= j(() => {}, ["stop"])
|
|
2530
|
+
}, [c("div", {
|
|
2531
|
+
class: "unified-sidebar__inner",
|
|
2532
|
+
style: m({ minHeight: A.value + "px" })
|
|
2533
|
+
}, [e.isAddingComment ? (_(), s("div", {
|
|
2534
|
+
key: 0,
|
|
2535
|
+
class: "unified-sidebar__addcomment",
|
|
2536
|
+
style: m(N.value)
|
|
2537
|
+
}, [u(Tn, {
|
|
2538
|
+
onSubmit: n[0] ||= (e) => t.$emit("add-comment", e),
|
|
2539
|
+
onCancel: n[1] ||= (e) => t.$emit("cancel-add-comment")
|
|
2540
|
+
})], 4)) : o("", !0), (_(!0), s(r, null, b(x.value, (e) => (_(), s("div", {
|
|
2541
|
+
key: e.id,
|
|
2542
|
+
class: "unified-sidebar__card-slot",
|
|
2543
|
+
"data-card-id": e.id,
|
|
2544
|
+
style: m(F(e.id))
|
|
2545
|
+
}, [e.kind === "comment" && e.comment.done && p.value !== e.id ? (_(), a(fn, {
|
|
2546
|
+
key: 0,
|
|
2547
|
+
comment: e.comment,
|
|
2548
|
+
onToggleExpand: (t) => v(e.id)
|
|
2549
|
+
}, null, 8, ["comment", "onToggleExpand"])) : e.kind === "comment" ? (_(), a(un, {
|
|
2550
|
+
key: 1,
|
|
2551
|
+
comment: e.comment,
|
|
2552
|
+
replies: e.replies,
|
|
2553
|
+
expanded: p.value === e.id,
|
|
2554
|
+
onClick: (t) => v(e.id),
|
|
2555
|
+
onReply: n[2] ||= (e, n) => t.$emit("comment-reply", e, n),
|
|
2556
|
+
onResolve: n[3] ||= (e) => t.$emit("comment-resolve", e),
|
|
2557
|
+
onUnresolve: n[4] ||= (e) => t.$emit("comment-unresolve", e),
|
|
2558
|
+
onDelete: n[5] ||= (e) => t.$emit("comment-delete", e)
|
|
2559
|
+
}, null, 8, [
|
|
2560
|
+
"comment",
|
|
2561
|
+
"replies",
|
|
2562
|
+
"expanded",
|
|
2563
|
+
"onClick"
|
|
2564
|
+
])) : e.kind === "tracked-change" ? (_(), a(xn, {
|
|
2565
|
+
key: 2,
|
|
2566
|
+
change: e.change,
|
|
2567
|
+
expanded: p.value === e.id,
|
|
2568
|
+
onClick: (t) => v(e.id),
|
|
2569
|
+
onAccept: n[6] ||= (e, n) => t.$emit("accept-change", e, n),
|
|
2570
|
+
onReject: n[7] ||= (e, n) => t.$emit("reject-change", e, n),
|
|
2571
|
+
onReply: n[8] ||= (e, n) => t.$emit("tracked-change-reply", e, n)
|
|
2572
|
+
}, null, 8, [
|
|
2573
|
+
"change",
|
|
2574
|
+
"expanded",
|
|
2575
|
+
"onClick"
|
|
2576
|
+
])) : o("", !0)], 12, En))), 128))], 4)], 36)) : o("", !0)], 64));
|
|
2577
|
+
}
|
|
2578
|
+
}), [["__scopeId", "data-v-7996a167"]]), An = ["title", "onClick"], jn = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
2579
|
+
__name: "CommentMarginMarkers",
|
|
2580
|
+
props: {
|
|
2581
|
+
comments: {},
|
|
2582
|
+
pagesContainer: {},
|
|
2583
|
+
zoom: {},
|
|
2584
|
+
pageWidthPx: {},
|
|
2585
|
+
sidebarOpen: { type: Boolean },
|
|
2586
|
+
resolvedCommentIds: {}
|
|
2587
|
+
},
|
|
2588
|
+
emits: ["marker-click"],
|
|
2589
|
+
setup(e) {
|
|
2590
|
+
let n = e, a = i(() => {
|
|
2591
|
+
if (n.sidebarOpen) return [];
|
|
2592
|
+
let e = n.pagesContainer;
|
|
2593
|
+
if (!e) return [];
|
|
2594
|
+
let t = e.getBoundingClientRect(), r = /* @__PURE__ */ new Map();
|
|
2595
|
+
for (let t of e.querySelectorAll("[data-comment-id]")) {
|
|
2596
|
+
let e = t.dataset.commentId;
|
|
2597
|
+
e && !r.has(e) && r.set(e, t);
|
|
2598
|
+
}
|
|
2599
|
+
let i = [];
|
|
2600
|
+
for (let a of n.comments) {
|
|
2601
|
+
if (a.parentId != null) continue;
|
|
2602
|
+
let o = r.get(String(a.id));
|
|
2603
|
+
if (!o) continue;
|
|
2604
|
+
let s = o.getBoundingClientRect();
|
|
2605
|
+
i.push({
|
|
2606
|
+
comment: a,
|
|
2607
|
+
isResolved: n.resolvedCommentIds.has(a.id),
|
|
2608
|
+
y: (s.top - t.top + e.scrollTop) / n.zoom
|
|
2609
|
+
});
|
|
2610
|
+
}
|
|
2611
|
+
return i;
|
|
2612
|
+
}), c = i(() => ({
|
|
2613
|
+
position: "absolute",
|
|
2614
|
+
top: 0,
|
|
2615
|
+
left: `calc(50% + ${n.pageWidthPx / n.zoom / 2 + 6}px)`,
|
|
2616
|
+
zIndex: 30,
|
|
2617
|
+
pointerEvents: "none"
|
|
2618
|
+
}));
|
|
2619
|
+
return (n, i) => a.value.length > 0 ? (_(), s("div", {
|
|
2620
|
+
key: 0,
|
|
2621
|
+
class: "docx-comment-margin-markers",
|
|
2622
|
+
style: m(c.value),
|
|
2623
|
+
onMousedown: i[0] ||= j(() => {}, ["stop"])
|
|
2624
|
+
}, [(_(!0), s(r, null, b(a.value, (r) => (_(), s("button", {
|
|
2625
|
+
key: r.comment.id,
|
|
2626
|
+
class: "docx-comment-margin-markers__btn",
|
|
2627
|
+
title: r.isResolved ? "Resolved comment" : "Comment",
|
|
2628
|
+
style: m({ top: r.y * e.zoom + "px" }),
|
|
2629
|
+
onClick: (e) => n.$emit("marker-click", r.comment.id)
|
|
2630
|
+
}, [u(t, {
|
|
2631
|
+
name: r.isResolved ? "chat_bubble_check" : "chat_bubble_outline",
|
|
2632
|
+
size: 18
|
|
2633
|
+
}, null, 8, ["name"])], 12, An))), 128))], 36)) : o("", !0);
|
|
2634
|
+
}
|
|
2635
|
+
}), [["__scopeId", "data-v-a20c82d9"]]), Mn = ["aria-valuemax"], Nn = { class: "docx-horizontal-ruler__ticks" }, Pn = ["title", "onDblclick"], Fn = 12240, In = 1440, Ln = 1440, Rn = 567, zn = 22, Bn = "#4285f4", Vn = "#3367d6", Hn = "#2a56c6", $ = 5, Un = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
2636
|
+
__name: "HorizontalRuler",
|
|
2637
|
+
props: {
|
|
2638
|
+
sectionProps: {},
|
|
2639
|
+
zoom: { default: 1 },
|
|
2640
|
+
editable: {
|
|
2641
|
+
type: Boolean,
|
|
2642
|
+
default: !0
|
|
2643
|
+
},
|
|
2644
|
+
showFirstLineIndent: {
|
|
2645
|
+
type: Boolean,
|
|
2646
|
+
default: !0
|
|
2647
|
+
},
|
|
2648
|
+
firstLineIndent: { default: 0 },
|
|
2649
|
+
hangingIndent: {
|
|
2650
|
+
type: Boolean,
|
|
2651
|
+
default: !1
|
|
2652
|
+
},
|
|
2653
|
+
indentLeft: { default: 0 },
|
|
2654
|
+
indentRight: { default: 0 },
|
|
2655
|
+
unit: { default: "inch" },
|
|
2656
|
+
tabStops: {}
|
|
2657
|
+
},
|
|
2658
|
+
emits: [
|
|
2659
|
+
"left-margin-change",
|
|
2660
|
+
"right-margin-change",
|
|
2661
|
+
"first-line-indent-change",
|
|
2662
|
+
"indent-left-change",
|
|
2663
|
+
"indent-right-change",
|
|
2664
|
+
"tab-stop-remove"
|
|
2665
|
+
],
|
|
2666
|
+
setup(e, { emit: t }) {
|
|
2667
|
+
let n = e, a = t, l = Math.round($ * 1.6), u = y(null), d = y(null), f = y(null), p = y(0), g = y("");
|
|
2668
|
+
function v(e) {
|
|
2669
|
+
return te(e) * n.zoom;
|
|
2670
|
+
}
|
|
2671
|
+
function x(e) {
|
|
2672
|
+
return Math.round(ee(e / n.zoom));
|
|
2673
|
+
}
|
|
2674
|
+
let S = i(() => n.sectionProps?.pageWidth ?? Fn), w = i(() => n.sectionProps?.marginLeft ?? In), T = i(() => n.sectionProps?.marginRight ?? In), 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(() => ({
|
|
2675
|
+
position: "relative",
|
|
2676
|
+
width: D.value + "px",
|
|
2677
|
+
height: zn + "px",
|
|
2678
|
+
backgroundColor: "transparent",
|
|
2679
|
+
overflow: "visible",
|
|
2680
|
+
userSelect: "none",
|
|
2681
|
+
cursor: d.value ? "ew-resize" : "default"
|
|
2682
|
+
})), z = i(() => ({
|
|
2683
|
+
position: "absolute",
|
|
2684
|
+
top: 0,
|
|
2685
|
+
left: 0,
|
|
2686
|
+
width: O.value + "px",
|
|
2687
|
+
height: zn + "px",
|
|
2688
|
+
backgroundColor: "rgba(0, 0, 0, 0.02)",
|
|
2689
|
+
borderRight: "1px solid rgba(0,0,0,0.06)",
|
|
2690
|
+
cursor: n.editable ? "ew-resize" : "default",
|
|
2691
|
+
zIndex: 1
|
|
2692
|
+
})), B = i(() => ({
|
|
2693
|
+
position: "absolute",
|
|
2694
|
+
top: 0,
|
|
2695
|
+
right: 0,
|
|
2696
|
+
width: k.value + "px",
|
|
2697
|
+
height: zn + "px",
|
|
2698
|
+
backgroundColor: "rgba(0, 0, 0, 0.02)",
|
|
2699
|
+
borderLeft: "1px solid rgba(0,0,0,0.06)",
|
|
2700
|
+
cursor: n.editable ? "ew-resize" : "default",
|
|
2701
|
+
zIndex: 1
|
|
2702
|
+
})), V = i(() => {
|
|
2703
|
+
let e = [];
|
|
2704
|
+
if (n.unit === "inch") {
|
|
2705
|
+
let t = Ln / 8, n = Math.ceil(S.value / t);
|
|
2706
|
+
for (let r = 0; r <= n; r++) {
|
|
2707
|
+
let n = r * t;
|
|
2708
|
+
if (n > S.value) break;
|
|
2709
|
+
let i = v(n);
|
|
2710
|
+
r % 8 == 0 ? e.push({
|
|
2711
|
+
position: i,
|
|
2712
|
+
height: 10,
|
|
2713
|
+
label: r / 8 > 0 ? String(r / 8) : void 0
|
|
2714
|
+
}) : r % 4 == 0 ? e.push({
|
|
2715
|
+
position: i,
|
|
2716
|
+
height: 6
|
|
2717
|
+
}) : r % 2 == 0 ? e.push({
|
|
2718
|
+
position: i,
|
|
2719
|
+
height: 4
|
|
2720
|
+
}) : e.push({
|
|
2721
|
+
position: i,
|
|
2722
|
+
height: 2
|
|
2723
|
+
});
|
|
2724
|
+
}
|
|
2725
|
+
} else {
|
|
2726
|
+
let t = Rn / 10, n = Math.ceil(S.value / t);
|
|
2727
|
+
for (let r = 0; r <= n; r++) {
|
|
2728
|
+
let n = r * t;
|
|
2729
|
+
if (n > S.value) break;
|
|
2730
|
+
let i = v(n);
|
|
2731
|
+
r % 10 == 0 ? e.push({
|
|
2732
|
+
position: i,
|
|
2733
|
+
height: 10,
|
|
2734
|
+
label: r / 10 > 0 ? String(r / 10) : void 0
|
|
2735
|
+
}) : r % 5 == 0 ? e.push({
|
|
2736
|
+
position: i,
|
|
2737
|
+
height: 6
|
|
2738
|
+
}) : e.push({
|
|
2739
|
+
position: i,
|
|
2740
|
+
height: 3
|
|
2741
|
+
});
|
|
2742
|
+
}
|
|
2743
|
+
}
|
|
2744
|
+
return e;
|
|
2745
|
+
}), H = i(() => n.tabStops?.length ? n.tabStops.map((e) => {
|
|
2746
|
+
let t = e.position ?? e.pos ?? 0;
|
|
2747
|
+
return {
|
|
2748
|
+
px: v(t),
|
|
2749
|
+
twips: t,
|
|
2750
|
+
label: U(t)
|
|
2751
|
+
};
|
|
2752
|
+
}) : []);
|
|
2753
|
+
function U(e) {
|
|
2754
|
+
return n.unit === "cm" ? (e / Rn).toFixed(1) + " cm" : (e / Ln).toFixed(2) + "\"";
|
|
2755
|
+
}
|
|
2756
|
+
function W(e) {
|
|
2757
|
+
return d.value === e ? Hn : f.value === e ? Vn : Bn;
|
|
2758
|
+
}
|
|
2759
|
+
function G(e, t, r) {
|
|
2760
|
+
return {
|
|
2761
|
+
position: "absolute",
|
|
2762
|
+
left: t - $ + "px",
|
|
2763
|
+
width: $ * 2 + "px",
|
|
2764
|
+
height: l + 2 + "px",
|
|
2765
|
+
cursor: n.editable ? "ew-resize" : "default",
|
|
2766
|
+
zIndex: r ? 10 : 4,
|
|
2767
|
+
...e === "down" ? { top: 0 } : { bottom: 0 }
|
|
2768
|
+
};
|
|
2769
|
+
}
|
|
2770
|
+
function K(e, t) {
|
|
2771
|
+
return e === "down" ? {
|
|
2772
|
+
position: "absolute",
|
|
2773
|
+
top: "1px",
|
|
2774
|
+
left: 0,
|
|
2775
|
+
width: 0,
|
|
2776
|
+
height: 0,
|
|
2777
|
+
borderLeft: `${$}px solid transparent`,
|
|
2778
|
+
borderRight: `${$}px solid transparent`,
|
|
2779
|
+
borderTop: `${l}px solid ${t}`,
|
|
2780
|
+
transition: "border-top-color 0.1s"
|
|
2781
|
+
} : {
|
|
2782
|
+
position: "absolute",
|
|
2783
|
+
bottom: "1px",
|
|
2784
|
+
left: 0,
|
|
2785
|
+
width: 0,
|
|
2786
|
+
height: 0,
|
|
2787
|
+
borderLeft: `${$}px solid transparent`,
|
|
2788
|
+
borderRight: `${$}px solid transparent`,
|
|
2789
|
+
borderBottom: `${l}px solid ${t}`,
|
|
2790
|
+
transition: "border-bottom-color 0.1s"
|
|
2791
|
+
};
|
|
2792
|
+
}
|
|
2793
|
+
let q = 0;
|
|
2794
|
+
function J(e, t) {
|
|
2795
|
+
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));
|
|
2796
|
+
}
|
|
2797
|
+
function ne(e) {
|
|
2798
|
+
if (!d.value || !u.value) return;
|
|
2799
|
+
let t = u.value.getBoundingClientRect();
|
|
2800
|
+
if (!t) return;
|
|
2801
|
+
let n = e.clientX - t.left;
|
|
2802
|
+
p.value = n;
|
|
2803
|
+
let r = x(n), i = re(d.value, r);
|
|
2804
|
+
g.value = U(i), X(d.value, i);
|
|
2805
|
+
}
|
|
2806
|
+
function Y(e) {
|
|
2807
|
+
d.value = null, document.removeEventListener("mousemove", ne), document.removeEventListener("mouseup", Y);
|
|
2808
|
+
}
|
|
2809
|
+
function re(e, t) {
|
|
2810
|
+
if (e === "leftMargin") {
|
|
2811
|
+
let e = S.value - T.value - 720;
|
|
2812
|
+
return Math.round(Math.max(0, Math.min(t, e)));
|
|
2813
|
+
}
|
|
2814
|
+
if (e === "rightMargin") {
|
|
2815
|
+
let e = S.value - t, n = S.value - w.value - 720;
|
|
2816
|
+
return Math.round(Math.max(0, Math.min(e, n)));
|
|
2817
|
+
}
|
|
2818
|
+
if (e === "firstLineIndent") {
|
|
2819
|
+
let e = t - (w.value + n.indentLeft), r = E.value - n.indentLeft - n.indentRight - 720;
|
|
2820
|
+
return Math.round(Math.max(-n.indentLeft, Math.min(e, r)));
|
|
2821
|
+
}
|
|
2822
|
+
if (e === "leftIndent") {
|
|
2823
|
+
let e = t - w.value, r = E.value - n.indentRight - 720;
|
|
2824
|
+
return Math.round(Math.max(0, Math.min(e, r)));
|
|
2825
|
+
}
|
|
2826
|
+
let r = S.value - T.value - t, i = E.value - n.indentLeft - 720;
|
|
2827
|
+
return Math.round(Math.max(0, Math.min(r, i)));
|
|
2828
|
+
}
|
|
2829
|
+
function X(e, t) {
|
|
2830
|
+
switch (e) {
|
|
2831
|
+
case "leftMargin":
|
|
2832
|
+
a("left-margin-change", t);
|
|
2833
|
+
break;
|
|
2834
|
+
case "rightMargin":
|
|
2835
|
+
a("right-margin-change", t);
|
|
2836
|
+
break;
|
|
2837
|
+
case "firstLineIndent":
|
|
2838
|
+
a("first-line-indent-change", t);
|
|
2839
|
+
break;
|
|
2840
|
+
case "leftIndent":
|
|
2841
|
+
a("indent-left-change", t);
|
|
2842
|
+
break;
|
|
2843
|
+
case "rightIndent":
|
|
2844
|
+
a("indent-right-change", t);
|
|
2845
|
+
break;
|
|
2846
|
+
}
|
|
2847
|
+
}
|
|
2848
|
+
return h(() => {
|
|
2849
|
+
document.removeEventListener("mousemove", ne), document.removeEventListener("mouseup", Y);
|
|
2850
|
+
}), (t, n) => (_(), s("div", {
|
|
2851
|
+
ref_key: "rulerRef",
|
|
2852
|
+
ref: u,
|
|
2853
|
+
class: "docx-horizontal-ruler",
|
|
2854
|
+
style: m(R.value),
|
|
2855
|
+
role: "slider",
|
|
2856
|
+
"aria-label": "Horizontal ruler",
|
|
2857
|
+
"aria-valuemin": 0,
|
|
2858
|
+
"aria-valuemax": S.value
|
|
2859
|
+
}, [
|
|
2860
|
+
c("div", {
|
|
2861
|
+
class: "docx-horizontal-ruler__margin",
|
|
2862
|
+
style: m(z.value),
|
|
2863
|
+
onMousedown: n[0] ||= j((t) => e.editable ? J("leftMargin", t) : null, ["prevent", "stop"])
|
|
2864
|
+
}, null, 36),
|
|
2865
|
+
c("div", {
|
|
2866
|
+
class: "docx-horizontal-ruler__margin",
|
|
2867
|
+
style: m(B.value),
|
|
2868
|
+
onMousedown: n[1] ||= j((t) => e.editable ? J("rightMargin", t) : null, ["prevent", "stop"])
|
|
2869
|
+
}, null, 36),
|
|
2870
|
+
c("div", Nn, [(_(!0), s(r, null, b(V.value, (e, t) => (_(), s(r, { key: t }, [c("div", {
|
|
2871
|
+
class: "docx-horizontal-ruler__tick-line",
|
|
2872
|
+
style: m({
|
|
2873
|
+
left: e.position + "px",
|
|
2874
|
+
height: e.height + "px"
|
|
2875
|
+
})
|
|
2876
|
+
}, null, 4), e.label ? (_(), s("div", {
|
|
2877
|
+
key: 0,
|
|
2878
|
+
class: "docx-horizontal-ruler__tick-label",
|
|
2879
|
+
style: m({ left: e.position + "px" })
|
|
2880
|
+
}, C(e.label), 5)) : o("", !0)], 64))), 128))]),
|
|
2881
|
+
e.showFirstLineIndent ? (_(), s("div", {
|
|
2882
|
+
key: 0,
|
|
2883
|
+
class: "docx-ruler-indent",
|
|
2884
|
+
style: m(G("down", L.value, d.value === "firstLineIndent")),
|
|
2885
|
+
onMousedown: n[2] ||= j((t) => e.editable ? J("firstLineIndent", t) : null, ["prevent", "stop"]),
|
|
2886
|
+
onMouseenter: n[3] ||= (e) => f.value = "firstLineIndent",
|
|
2887
|
+
onMouseleave: n[4] ||= (e) => f.value = null
|
|
2888
|
+
}, [c("div", { style: m(K("down", W("firstLineIndent"))) }, null, 4)], 36)) : o("", !0),
|
|
2889
|
+
e.editable ? (_(), s("div", {
|
|
2890
|
+
key: 1,
|
|
2891
|
+
class: "docx-ruler-indent",
|
|
2892
|
+
style: m(G("up", F.value, d.value === "leftIndent")),
|
|
2893
|
+
onMousedown: n[5] ||= j((e) => J("leftIndent", e), ["prevent", "stop"]),
|
|
2894
|
+
onMouseenter: n[6] ||= (e) => f.value = "leftIndent",
|
|
2895
|
+
onMouseleave: n[7] ||= (e) => f.value = null
|
|
2896
|
+
}, [c("div", { style: m(K("up", W("leftIndent"))) }, null, 4)], 36)) : o("", !0),
|
|
2897
|
+
e.editable ? (_(), s("div", {
|
|
2898
|
+
key: 2,
|
|
2899
|
+
class: "docx-ruler-indent",
|
|
2900
|
+
style: m(G("down", I.value, d.value === "rightIndent")),
|
|
2901
|
+
onMousedown: n[8] ||= j((e) => J("rightIndent", e), ["prevent", "stop"]),
|
|
2902
|
+
onMouseenter: n[9] ||= (e) => f.value = "rightIndent",
|
|
2903
|
+
onMouseleave: n[10] ||= (e) => f.value = null
|
|
2904
|
+
}, [c("div", { style: m(K("down", W("rightIndent"))) }, null, 4)], 36)) : o("", !0),
|
|
2905
|
+
(_(!0), s(r, null, b(H.value, (e, n) => (_(), s("div", {
|
|
2906
|
+
key: n,
|
|
2907
|
+
class: "docx-horizontal-ruler__tab",
|
|
2908
|
+
style: m({ left: e.px + "px" }),
|
|
2909
|
+
title: `${e.label}`,
|
|
2910
|
+
onDblclick: j((n) => t.$emit("tab-stop-remove", e.twips), ["prevent"])
|
|
2911
|
+
}, "L", 44, Pn))), 128)),
|
|
2912
|
+
d.value && g.value ? (_(), s("div", {
|
|
2913
|
+
key: 3,
|
|
2914
|
+
class: "docx-horizontal-ruler__tooltip",
|
|
2915
|
+
style: m({ left: p.value + "px" })
|
|
2916
|
+
}, C(g.value), 5)) : o("", !0)
|
|
2917
|
+
], 12, Mn));
|
|
2918
|
+
}
|
|
2919
|
+
}), [["__scopeId", "data-v-a27ea349"]]), Wn = { class: "docx-vertical-ruler__ticks" }, Gn = 15840, Kn = 1440, qn = 1440, Jn = 567, Yn = 20, Xn = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
2920
|
+
__name: "VerticalRuler",
|
|
2921
|
+
props: {
|
|
2922
|
+
sectionProps: {},
|
|
2923
|
+
zoom: { default: 1 },
|
|
2924
|
+
editable: {
|
|
2925
|
+
type: Boolean,
|
|
2926
|
+
default: !0
|
|
2927
|
+
},
|
|
2928
|
+
unit: { default: "inch" }
|
|
2929
|
+
},
|
|
2930
|
+
emits: ["top-margin-change", "bottom-margin-change"],
|
|
2931
|
+
setup(e, { emit: t }) {
|
|
2932
|
+
let n = e, a = t, l = y(null), u = y(null), d = y(null);
|
|
2933
|
+
function f(e) {
|
|
2934
|
+
return te(e) * n.zoom;
|
|
2935
|
+
}
|
|
2936
|
+
function p(e) {
|
|
2937
|
+
return Math.round(ee(e / n.zoom));
|
|
2938
|
+
}
|
|
2939
|
+
let g = i(() => n.sectionProps?.pageHeight ?? Gn), v = i(() => n.sectionProps?.marginTop ?? Kn), x = i(() => n.sectionProps?.marginBottom ?? Kn), S = i(() => f(g.value)), w = i(() => f(v.value)), T = i(() => f(x.value)), E = i(() => ({
|
|
2940
|
+
position: "relative",
|
|
2941
|
+
width: Yn + "px",
|
|
2942
|
+
height: S.value + "px",
|
|
2943
|
+
backgroundColor: "transparent",
|
|
2944
|
+
overflow: "visible",
|
|
2945
|
+
userSelect: "none",
|
|
2946
|
+
cursor: u.value ? "ns-resize" : "default"
|
|
2947
|
+
})), D = i(() => {
|
|
2948
|
+
let e = [];
|
|
2949
|
+
if (n.unit === "inch") {
|
|
2950
|
+
let t = qn / 8, n = Math.ceil(g.value / t);
|
|
2951
|
+
for (let r = 0; r <= n; r++) {
|
|
2952
|
+
let n = r * t;
|
|
2953
|
+
if (n > g.value) break;
|
|
2954
|
+
let i = f(n);
|
|
2955
|
+
r % 8 == 0 ? e.push({
|
|
2956
|
+
position: i,
|
|
2957
|
+
width: 10,
|
|
2958
|
+
label: r / 8 > 0 ? String(r / 8) : void 0
|
|
2959
|
+
}) : r % 4 == 0 ? e.push({
|
|
2960
|
+
position: i,
|
|
2961
|
+
width: 6
|
|
2962
|
+
}) : r % 2 == 0 ? e.push({
|
|
2963
|
+
position: i,
|
|
2964
|
+
width: 4
|
|
2965
|
+
}) : e.push({
|
|
2966
|
+
position: i,
|
|
2967
|
+
width: 2
|
|
2968
|
+
});
|
|
2969
|
+
}
|
|
2970
|
+
} else {
|
|
2971
|
+
let t = Jn / 10, n = Math.ceil(g.value / t);
|
|
2972
|
+
for (let r = 0; r <= n; r++) {
|
|
2973
|
+
let n = r * t;
|
|
2974
|
+
if (n > g.value) break;
|
|
2975
|
+
let i = f(n);
|
|
2976
|
+
r % 10 == 0 ? e.push({
|
|
2977
|
+
position: i,
|
|
2978
|
+
width: 10,
|
|
2979
|
+
label: r / 10 > 0 ? String(r / 10) : void 0
|
|
2980
|
+
}) : r % 5 == 0 ? e.push({
|
|
2981
|
+
position: i,
|
|
2982
|
+
width: 6
|
|
2983
|
+
}) : e.push({
|
|
2984
|
+
position: i,
|
|
2985
|
+
width: 3
|
|
2986
|
+
});
|
|
2987
|
+
}
|
|
2988
|
+
}
|
|
2989
|
+
return e;
|
|
2990
|
+
});
|
|
2991
|
+
function O(e) {
|
|
2992
|
+
return {
|
|
2993
|
+
position: "absolute",
|
|
2994
|
+
top: e - 5 + "px",
|
|
2995
|
+
right: 0,
|
|
2996
|
+
width: Yn + "px",
|
|
2997
|
+
height: "10px",
|
|
2998
|
+
cursor: n.editable ? "ns-resize" : "default",
|
|
2999
|
+
zIndex: u.value === null ? 1 : 10
|
|
3000
|
+
};
|
|
3001
|
+
}
|
|
3002
|
+
function k(e) {
|
|
3003
|
+
let t = u.value === e;
|
|
3004
|
+
return d.value, {
|
|
3005
|
+
position: "absolute",
|
|
3006
|
+
top: "0px",
|
|
3007
|
+
right: "2px",
|
|
3008
|
+
width: "0",
|
|
3009
|
+
height: "0",
|
|
3010
|
+
borderTop: "5px solid transparent",
|
|
3011
|
+
borderBottom: "5px solid transparent",
|
|
3012
|
+
borderRight: `8px solid ${t ? "var(--doc-primary-hover, #1557b0)" : "var(--doc-primary, #1a73e8)"}`,
|
|
3013
|
+
transition: "border-right-color 0.1s"
|
|
3014
|
+
};
|
|
3015
|
+
}
|
|
3016
|
+
let A = 0, M = 0;
|
|
3017
|
+
function N(e, t) {
|
|
3018
|
+
n.editable && (u.value = e, A = t.clientY, M = e === "topMargin" ? v.value : x.value, document.addEventListener("mousemove", P), document.addEventListener("mouseup", F));
|
|
3019
|
+
}
|
|
3020
|
+
function P(e) {
|
|
3021
|
+
if (!u.value) return;
|
|
3022
|
+
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)));
|
|
3023
|
+
u.value === "topMargin" ? a("top-margin-change", i) : a("bottom-margin-change", i);
|
|
3024
|
+
}
|
|
3025
|
+
function F() {
|
|
3026
|
+
u.value = null, document.removeEventListener("mousemove", P), document.removeEventListener("mouseup", F);
|
|
3027
|
+
}
|
|
3028
|
+
return h(() => {
|
|
3029
|
+
document.removeEventListener("mousemove", P), document.removeEventListener("mouseup", F);
|
|
3030
|
+
}), (t, n) => (_(), s("div", {
|
|
3031
|
+
ref_key: "rulerRef",
|
|
3032
|
+
ref: l,
|
|
3033
|
+
class: "docx-vertical-ruler",
|
|
3034
|
+
style: m(E.value),
|
|
3035
|
+
role: "slider",
|
|
3036
|
+
"aria-label": "Vertical ruler",
|
|
3037
|
+
"aria-orientation": "vertical"
|
|
3038
|
+
}, [
|
|
3039
|
+
c("div", Wn, [(_(!0), s(r, null, b(D.value, (e, t) => (_(), s(r, { key: t }, [c("div", {
|
|
3040
|
+
class: "docx-vertical-ruler__tick-line",
|
|
3041
|
+
style: m({
|
|
3042
|
+
top: e.position + "px",
|
|
3043
|
+
width: e.width + "px"
|
|
3044
|
+
})
|
|
3045
|
+
}, null, 4), e.label ? (_(), s("div", {
|
|
3046
|
+
key: 0,
|
|
3047
|
+
class: "docx-vertical-ruler__tick-label",
|
|
3048
|
+
style: m({ top: e.position + "px" })
|
|
3049
|
+
}, C(e.label), 5)) : o("", !0)], 64))), 128))]),
|
|
3050
|
+
e.editable ? (_(), s("div", {
|
|
3051
|
+
key: 0,
|
|
3052
|
+
class: "docx-vertical-ruler__marker",
|
|
3053
|
+
style: m(O(w.value)),
|
|
3054
|
+
onMousedown: n[0] ||= j((e) => N("topMargin", e), ["prevent"]),
|
|
3055
|
+
onMouseenter: n[1] ||= (e) => d.value = "topMargin",
|
|
3056
|
+
onMouseleave: n[2] ||= (e) => d.value = null
|
|
3057
|
+
}, [c("div", { style: m(k("topMargin")) }, null, 4)], 36)) : o("", !0),
|
|
3058
|
+
e.editable ? (_(), s("div", {
|
|
3059
|
+
key: 1,
|
|
3060
|
+
class: "docx-vertical-ruler__marker",
|
|
3061
|
+
style: m(O(S.value - T.value)),
|
|
3062
|
+
onMousedown: n[3] ||= j((e) => N("bottomMargin", e), ["prevent"]),
|
|
3063
|
+
onMouseenter: n[4] ||= (e) => d.value = "bottomMargin",
|
|
3064
|
+
onMouseleave: n[5] ||= (e) => d.value = null
|
|
3065
|
+
}, [c("div", { style: m(k("bottomMargin")) }, null, 4)], 36)) : o("", !0)
|
|
3066
|
+
], 4));
|
|
3067
|
+
}
|
|
3068
|
+
}), [["__scopeId", "data-v-6e1bbe22"]]), Zn = { class: "doc-name" }, Qn = ["value"], $n = {
|
|
3069
|
+
key: 1,
|
|
3070
|
+
class: "doc-name__text"
|
|
3071
|
+
}, er = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
3072
|
+
__name: "DocumentName",
|
|
3073
|
+
props: {
|
|
3074
|
+
modelValue: {},
|
|
3075
|
+
editable: {
|
|
3076
|
+
type: Boolean,
|
|
3077
|
+
default: !0
|
|
3078
|
+
}
|
|
3079
|
+
},
|
|
3080
|
+
emits: ["update:modelValue"],
|
|
3081
|
+
setup(e, { emit: t }) {
|
|
3082
|
+
let n = e, r = t, a = i(() => (n.modelValue || "").replace(/\.docx$/i, ""));
|
|
3083
|
+
function o(e) {
|
|
3084
|
+
let t = e.target.value;
|
|
3085
|
+
r("update:modelValue", t.endsWith(".docx") ? t : t + ".docx");
|
|
3086
|
+
}
|
|
3087
|
+
function c(e) {
|
|
3088
|
+
e.target.value.trim() || r("update:modelValue", "Untitled document.docx");
|
|
3089
|
+
}
|
|
3090
|
+
return (t, n) => (_(), s("div", Zn, [e.editable ? (_(), s("input", {
|
|
3091
|
+
key: 0,
|
|
3092
|
+
class: "doc-name__input",
|
|
3093
|
+
value: a.value,
|
|
3094
|
+
onInput: o,
|
|
3095
|
+
onBlur: c,
|
|
3096
|
+
placeholder: "Untitled document"
|
|
3097
|
+
}, null, 40, Qn)) : (_(), s("span", $n, C(a.value || "Untitled document"), 1))]));
|
|
3098
|
+
}
|
|
3099
|
+
}), [["__scopeId", "data-v-d78ee2fa"]]), tr = ["disabled", "onClick"], nr = {
|
|
3100
|
+
key: 0,
|
|
3101
|
+
class: "docx-menu-dropdown__separator"
|
|
3102
|
+
}, rr = ["onMouseenter", "onMouseleave"], ir = ["disabled", "onClick"], ar = { class: "docx-menu-dropdown__label" }, or = {
|
|
3103
|
+
key: 1,
|
|
3104
|
+
class: "docx-menu-dropdown__shortcut"
|
|
3105
|
+
}, sr = {
|
|
3106
|
+
key: 2,
|
|
3107
|
+
class: "docx-menu-dropdown__chevron"
|
|
3108
|
+
}, cr = {
|
|
3109
|
+
key: 0,
|
|
3110
|
+
class: "docx-menu-dropdown__submenu"
|
|
3111
|
+
}, lr = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
3112
|
+
__name: "MenuDropdown",
|
|
3113
|
+
props: {
|
|
3114
|
+
label: {},
|
|
3115
|
+
items: {},
|
|
3116
|
+
disabled: { type: Boolean },
|
|
3117
|
+
showChevron: {
|
|
3118
|
+
type: Boolean,
|
|
3119
|
+
default: !1
|
|
3120
|
+
}
|
|
3121
|
+
},
|
|
3122
|
+
setup(e) {
|
|
3123
|
+
function n(e) {
|
|
3124
|
+
return "type" in e && e.type === "separator";
|
|
3125
|
+
}
|
|
3126
|
+
let i = y(!1), d = y(null);
|
|
3127
|
+
function f() {
|
|
3128
|
+
i.value = !1, d.value = null;
|
|
3129
|
+
}
|
|
3130
|
+
function m(e) {
|
|
3131
|
+
e.disabled || e.submenu || (e.onClick?.(), f());
|
|
3132
|
+
}
|
|
3133
|
+
return (h, g) => (_(), a(Q, {
|
|
3134
|
+
open: i.value,
|
|
3135
|
+
"onUpdate:open": g[2] ||= (e) => i.value = e,
|
|
3136
|
+
onClose: f
|
|
3137
|
+
}, {
|
|
3138
|
+
trigger: O(({ toggle: n }) => [c("button", {
|
|
3139
|
+
type: "button",
|
|
3140
|
+
class: p(["docx-menu-dropdown__trigger", { "docx-menu-dropdown__trigger--open": i.value }]),
|
|
3141
|
+
disabled: e.disabled,
|
|
3142
|
+
onMousedown: g[0] ||= j(() => {}, ["prevent"]),
|
|
3143
|
+
onClick: j(n, ["prevent"])
|
|
3144
|
+
}, [l(C(e.label) + " ", 1), e.showChevron ? (_(), a(t, {
|
|
3145
|
+
key: 0,
|
|
3146
|
+
name: "arrow_drop_down",
|
|
3147
|
+
size: 16
|
|
3148
|
+
})) : o("", !0)], 42, tr)]),
|
|
3149
|
+
panel: O(() => [c("div", {
|
|
3150
|
+
class: "docx-menu-dropdown__menu",
|
|
3151
|
+
onMousedown: g[1] ||= j(() => {}, ["prevent"])
|
|
3152
|
+
}, [(_(!0), s(r, null, b(e.items, (e, i) => (_(), s(r, { key: i }, [n(e) ? (_(), s("div", nr)) : (_(), s("div", {
|
|
3153
|
+
key: 1,
|
|
3154
|
+
class: "docx-menu-dropdown__wrap",
|
|
3155
|
+
onMouseenter: (t) => e.submenu ? d.value = i : void 0,
|
|
3156
|
+
onMouseleave: (t) => e.submenu ? d.value = null : void 0
|
|
3157
|
+
}, [c("button", {
|
|
3158
|
+
type: "button",
|
|
3159
|
+
class: p(["docx-menu-dropdown__item", { "docx-menu-dropdown__item--disabled": e.disabled }]),
|
|
3160
|
+
disabled: e.disabled,
|
|
3161
|
+
onClick: j((t) => m(e), ["prevent"])
|
|
3162
|
+
}, [
|
|
3163
|
+
e.icon ? (_(), a(t, {
|
|
3164
|
+
key: 0,
|
|
3165
|
+
name: e.icon,
|
|
3166
|
+
size: 18
|
|
3167
|
+
}, null, 8, ["name"])) : o("", !0),
|
|
3168
|
+
c("span", ar, C(e.label), 1),
|
|
3169
|
+
e.shortcut ? (_(), s("span", or, C(e.shortcut), 1)) : o("", !0),
|
|
3170
|
+
e.submenu ? (_(), s("span", sr, [u(t, {
|
|
3171
|
+
name: "keyboard_arrow_right",
|
|
3172
|
+
size: 16
|
|
3173
|
+
})])) : o("", !0)
|
|
3174
|
+
], 10, ir), e.submenu && d.value === i ? (_(), s("div", cr, [x(h.$slots, "submenu", {
|
|
3175
|
+
item: e,
|
|
3176
|
+
closeMenu: f
|
|
3177
|
+
}, void 0, !0)])) : o("", !0)], 40, rr))], 64))), 128))], 32)]),
|
|
3178
|
+
_: 3
|
|
3179
|
+
}, 8, ["open"]));
|
|
3180
|
+
}
|
|
3181
|
+
}), [["__scopeId", "data-v-65cffcb2"]]), ur = ["aria-selected", "onMouseenter"], dr = { class: "docx-table-grid-inline__label" }, fr = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
3182
|
+
__name: "TableGridInline",
|
|
3183
|
+
props: {
|
|
3184
|
+
gridRows: { default: 6 },
|
|
3185
|
+
gridColumns: { default: 6 }
|
|
3186
|
+
},
|
|
3187
|
+
emits: ["insert"],
|
|
3188
|
+
setup(e, { emit: t }) {
|
|
3189
|
+
let n = e, a = t, o = y(0), l = y(0), u = i(() => {
|
|
3190
|
+
let e = [];
|
|
3191
|
+
for (let t = 1; t <= n.gridRows; t++) for (let r = 1; r <= n.gridColumns; r++) e.push({
|
|
3192
|
+
r: t,
|
|
3193
|
+
c: r
|
|
3194
|
+
});
|
|
3195
|
+
return e;
|
|
3196
|
+
});
|
|
3197
|
+
function d() {
|
|
3198
|
+
o.value > 0 && l.value > 0 && a("insert", o.value, l.value);
|
|
3199
|
+
}
|
|
3200
|
+
return (t, n) => (_(), s("div", null, [c("div", {
|
|
3201
|
+
class: "docx-table-grid-inline__grid",
|
|
3202
|
+
style: m({ gridTemplateColumns: `repeat(${e.gridColumns}, 18px)` }),
|
|
3203
|
+
role: "grid",
|
|
3204
|
+
"aria-label": "Table size selector",
|
|
3205
|
+
onMouseleave: n[0] ||= (e) => {
|
|
3206
|
+
o.value = 0, l.value = 0;
|
|
3207
|
+
}
|
|
3208
|
+
}, [(_(!0), s(r, null, b(u.value, (e) => (_(), s("div", {
|
|
3209
|
+
key: `${e.r}-${e.c}`,
|
|
3210
|
+
class: p(["docx-table-grid-inline__cell", { "docx-table-grid-inline__cell--active": e.r <= o.value && e.c <= l.value }]),
|
|
3211
|
+
role: "gridcell",
|
|
3212
|
+
"aria-selected": e.r <= o.value && e.c <= l.value,
|
|
3213
|
+
onMouseenter: (t) => {
|
|
3214
|
+
o.value = e.r, l.value = e.c;
|
|
3215
|
+
},
|
|
3216
|
+
onClick: j(d, ["prevent"])
|
|
3217
|
+
}, null, 42, ur))), 128))], 36), c("div", dr, C(o.value > 0 && l.value > 0 ? `${l.value} × ${o.value}` : "Select size"), 1)]));
|
|
3218
|
+
}
|
|
3219
|
+
}), [["__scopeId", "data-v-ecd8fc63"]]), pr = {
|
|
3220
|
+
class: "menu-bar",
|
|
3221
|
+
role: "menubar"
|
|
3222
|
+
}, mr = /* @__PURE__ */ n(/* @__PURE__ */ d({
|
|
3223
|
+
__name: "MenuBar",
|
|
3224
|
+
emits: ["action", "insert-table"],
|
|
3225
|
+
setup(t, { emit: n }) {
|
|
3226
|
+
let r = n, { t: c } = e();
|
|
3227
|
+
function l(e) {
|
|
3228
|
+
return () => r("action", e);
|
|
3229
|
+
}
|
|
3230
|
+
let d = i(() => [
|
|
3231
|
+
{
|
|
3232
|
+
icon: "file_upload",
|
|
3233
|
+
label: c("toolbar.open"),
|
|
3234
|
+
shortcut: c("toolbar.openShortcut"),
|
|
3235
|
+
onClick: l("open")
|
|
3236
|
+
},
|
|
3237
|
+
{
|
|
3238
|
+
icon: "file_download",
|
|
3239
|
+
label: c("toolbar.save"),
|
|
3240
|
+
shortcut: c("toolbar.saveShortcut"),
|
|
3241
|
+
onClick: l("save")
|
|
3242
|
+
},
|
|
3243
|
+
{ type: "separator" },
|
|
3244
|
+
{
|
|
3245
|
+
icon: "settings",
|
|
3246
|
+
label: c("toolbar.pageSetup"),
|
|
3247
|
+
onClick: l("pageSetup")
|
|
3248
|
+
}
|
|
3249
|
+
]), f = i(() => [{
|
|
3250
|
+
icon: "format_textdirection_l_to_r",
|
|
3251
|
+
label: c("toolbar.leftToRight"),
|
|
3252
|
+
onClick: l("dirLTR")
|
|
3253
|
+
}, {
|
|
3254
|
+
icon: "format_textdirection_r_to_l",
|
|
3255
|
+
label: c("toolbar.rightToLeft"),
|
|
3256
|
+
onClick: l("dirRTL")
|
|
3257
|
+
}]), p = i(() => [
|
|
3258
|
+
{
|
|
3259
|
+
icon: "image",
|
|
3260
|
+
label: c("toolbar.image"),
|
|
3261
|
+
onClick: l("insertImage")
|
|
3262
|
+
},
|
|
3263
|
+
{
|
|
3264
|
+
icon: "grid_on",
|
|
3265
|
+
label: c("toolbar.table"),
|
|
3266
|
+
key: "table",
|
|
3267
|
+
submenu: !0
|
|
3268
|
+
},
|
|
3269
|
+
{ type: "separator" },
|
|
3270
|
+
{
|
|
3271
|
+
icon: "page_break",
|
|
3272
|
+
label: c("toolbar.pageBreak"),
|
|
3273
|
+
onClick: l("insertPageBreak")
|
|
3274
|
+
},
|
|
3275
|
+
{
|
|
3276
|
+
icon: "format_list_numbered",
|
|
3277
|
+
label: c("toolbar.tableOfContents"),
|
|
3278
|
+
onClick: l("insertTOC")
|
|
3279
|
+
}
|
|
3280
|
+
]), m = i(() => [{
|
|
3281
|
+
label: c("toolbar.reportIssue"),
|
|
3282
|
+
onClick: l("reportIssue")
|
|
3283
|
+
}]);
|
|
3284
|
+
return (e, t) => (_(), s("div", pr, [
|
|
3285
|
+
u(lr, {
|
|
3286
|
+
label: w(c)("toolbar.file"),
|
|
3287
|
+
items: d.value
|
|
3288
|
+
}, null, 8, ["label", "items"]),
|
|
3289
|
+
u(lr, {
|
|
3290
|
+
label: w(c)("toolbar.format"),
|
|
3291
|
+
items: f.value
|
|
3292
|
+
}, null, 8, ["label", "items"]),
|
|
3293
|
+
u(lr, {
|
|
3294
|
+
label: w(c)("toolbar.insert"),
|
|
3295
|
+
items: p.value
|
|
3296
|
+
}, {
|
|
3297
|
+
submenu: O(({ item: e, closeMenu: t }) => [e.key === "table" ? (_(), a(fr, {
|
|
3298
|
+
key: 0,
|
|
3299
|
+
onInsert: (e, n) => {
|
|
3300
|
+
r("insert-table", e, n), t();
|
|
3301
|
+
}
|
|
3302
|
+
}, null, 8, ["onInsert"])) : o("", !0)]),
|
|
3303
|
+
_: 1
|
|
3304
|
+
}, 8, ["label", "items"]),
|
|
3305
|
+
u(lr, {
|
|
3306
|
+
label: w(c)("toolbar.help"),
|
|
3307
|
+
items: m.value
|
|
3308
|
+
}, null, 8, ["label", "items"])
|
|
3309
|
+
]));
|
|
3310
|
+
}
|
|
3311
|
+
}), [["__scopeId", "data-v-31c47d54"]]);
|
|
3312
|
+
//#endregion
|
|
3313
|
+
export { Ae as C, Z as D, Q as E, je as S, Te as T, st as _, Xn as a, Ze as b, kn as c, fn as d, un as f, Bt as g, Vt as h, er as i, Tn as l, Yt as m, fr as n, Un as o, $t as p, lr as r, jn as s, mr as t, xn as u, nt as v, ke as w, Xe as x, tt as y };
|