@heyirisai/docx-editor-vue 1.9.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 +201 -0
- package/README.md +116 -0
- package/dist/KeyboardShortcutsDialog-B0fEvXnH.js +2799 -0
- package/dist/KeyboardShortcutsDialog-Cmezq6eJ.cjs +1 -0
- package/dist/RenderedDomContext-CHc18N_2.js +2 -0
- package/dist/TablePropertiesDialog-B6ncvNnv.cjs +1 -0
- package/dist/TablePropertiesDialog-P_vyKNTn.js +1145 -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 +193 -0
- package/dist/components/EditorToolbarContext.d.ts +9 -0
- package/dist/components/Toolbar/presets.d.ts +20 -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/fontPickerValue.d.ts +1 -0
- package/dist/components/ui/fontPickerValue.test.d.ts +1 -0
- package/dist/components/ui/hyperlinkPopupTypes.d.ts +20 -0
- package/dist/composables/fileOpen.test.d.ts +1 -0
- package/dist/composables/imageOverlayRect.d.ts +44 -0
- package/dist/composables/imageOverlayRect.test.d.ts +1 -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/useColorMode.d.ts +8 -0
- package/dist/composables/useCommentLifecycle.d.ts +62 -0
- package/dist/composables/useCommentManagement.d.ts +68 -0
- package/dist/composables/useCommentSidebarItems.d.ts +24 -0
- package/dist/composables/useCommentSidebarItems.test.d.ts +1 -0
- package/dist/composables/useContextMenus.cut.test.d.ts +1 -0
- package/dist/composables/useContextMenus.d.ts +39 -0
- package/dist/composables/useControllableBoolean.d.ts +16 -0
- package/dist/composables/useControllableBoolean.test.d.ts +1 -0
- package/dist/composables/useDocumentLifecycle.d.ts +11 -0
- package/dist/composables/useDocxEditor.d.ts +96 -0
- package/dist/composables/useDocxEditorRefApi.d.ts +53 -0
- package/dist/composables/useDragAutoScroll.d.ts +11 -0
- package/dist/composables/useFileIO.d.ts +41 -0
- package/dist/composables/useFindReplace.d.ts +34 -0
- package/dist/composables/useFixedDropdown.d.ts +14 -0
- package/dist/composables/useFontLifecycle.d.ts +12 -0
- package/dist/composables/useFormattingActions.d.ts +31 -0
- package/dist/composables/useHistory.d.ts +9 -0
- package/dist/composables/useHostCallbacks.d.ts +7 -0
- package/dist/composables/useHyperlinkManagement.d.ts +38 -0
- package/dist/composables/useImageActions.d.ts +24 -0
- package/dist/composables/useKeyboardShortcuts.d.ts +25 -0
- package/dist/composables/useMenuActions.d.ts +26 -0
- package/dist/composables/useOutlineSidebar.d.ts +24 -0
- package/dist/composables/useOutlineSidebar.test.d.ts +1 -0
- package/dist/composables/usePageSetupControls.d.ts +22 -0
- package/dist/composables/usePagesPointer.d.ts +86 -0
- package/dist/composables/useParagraphStyleOptions.d.ts +18 -0
- package/dist/composables/usePortalClass.d.ts +8 -0
- package/dist/composables/useSelectionHighlight.d.ts +19 -0
- package/dist/composables/useSelectionSync.d.ts +36 -0
- package/dist/composables/useTableResize.d.ts +7 -0
- package/dist/composables/useTableSelection.d.ts +10 -0
- package/dist/composables/useToolbarDropdowns.d.ts +15 -0
- package/dist/composables/useToolbarFontSize.d.ts +15 -0
- package/dist/composables/useTrackedChanges.d.ts +12 -0
- package/dist/composables/useVisualLineNavigation.d.ts +11 -0
- package/dist/composables/useWatermarkControls.d.ts +15 -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 +401 -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 +19 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +4449 -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 +986 -0
- package/dist/useCommentSidebarItems-DBeGKNGA.cjs +1 -0
- package/dist/useCommentSidebarItems-DXbF857R.js +45 -0
- package/dist/useDragAutoScroll-CVltVfKK.js +520 -0
- package/dist/useDragAutoScroll-liP5PRvM.cjs +1 -0
- package/dist/usePortalClass-B9gFYxe0.cjs +4 -0
- package/dist/usePortalClass-HM-UHRlE.js +3534 -0
- package/dist/utils/domQueries.d.ts +39 -0
- package/dist/utils/imageClipboard.d.ts +9 -0
- package/dist/utils/refApiQueries.d.ts +10 -0
- package/dist/zIndex-CH0jZ7U7.cjs +1 -0
- package/dist/zIndex-CxELVe_L.js +12 -0
- package/package.json +119 -0
package/dist/ui.js
ADDED
|
@@ -0,0 +1,986 @@
|
|
|
1
|
+
import { a as e, f as t, i as n, n as r, o as i, r as a, t as o, u as s } from "./KeyboardShortcutsDialog-B0fEvXnH.js";
|
|
2
|
+
import { C as c, D as l, E as u, O as d, S as f, T as ee, _ as te, a as p, b as m, c as h, d as g, f as _, g as v, h as y, i as b, k as x, l as ne, m as re, n as ie, o as ae, p as oe, r as S, s as se, u as ce, v as le, w as ue, x as de, y as fe } from "./usePortalClass-HM-UHRlE.js";
|
|
3
|
+
import { t as C } from "./_plugin-vue_export-helper-B52Kst-M.js";
|
|
4
|
+
import { a as pe, c as me, i as he, n as ge, o as w, r as T, s as E, t as D } from "./TablePropertiesDialog-P_vyKNTn.js";
|
|
5
|
+
import { Fragment as O, Teleport as k, computed as A, createBlock as j, createCommentVNode as M, createElementBlock as N, createElementVNode as P, createTextVNode as F, createVNode as I, defineComponent as L, guardReactiveProps as _e, nextTick as R, normalizeClass as z, normalizeProps as ve, normalizeStyle as B, onBeforeUnmount as V, onMounted as H, openBlock as U, ref as W, renderList as G, renderSlot as K, resolveDynamicComponent as ye, toDisplayString as q, unref as J, watch as be, withCtx as Y, withKeys as X, withModifiers as Z } from "vue";
|
|
6
|
+
import "@heyirisai/docx-editor-core/utils/units";
|
|
7
|
+
import { createDefaultListState as xe } from "@heyirisai/docx-editor-core/utils/listState";
|
|
8
|
+
import { CARD_STYLE_COLLAPSED as Se, CARD_STYLE_EXPANDED as Ce } from "@heyirisai/docx-editor-core/utils/cardStyles";
|
|
9
|
+
//#region src/components/EditorToolbar.vue?vue&type=script&setup=true&lang.ts
|
|
10
|
+
var we = { class: "docx-editor-toolbar" }, Te = { class: "docx-editor-toolbar__title-row" }, Ee = { class: "docx-editor-toolbar__title-left" }, De = { class: "docx-editor-toolbar__title-center" }, Oe = { class: "docx-editor-toolbar__title-right" }, ke = /* @__PURE__ */ C(/* @__PURE__ */ L({
|
|
11
|
+
inheritAttrs: !1,
|
|
12
|
+
__name: "EditorToolbar",
|
|
13
|
+
props: { showMenuBar: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: !0
|
|
16
|
+
} },
|
|
17
|
+
emits: ["menu-action"],
|
|
18
|
+
setup(e) {
|
|
19
|
+
return (t, n) => (U(), N("div", we, [K(t.$slots, "title-bar", {}, () => [P("div", Te, [
|
|
20
|
+
P("div", Ee, [K(t.$slots, "title-bar-left", {}, void 0, !0)]),
|
|
21
|
+
P("div", De, [K(t.$slots, "document-name", {}, void 0, !0), e.showMenuBar ? (U(), j(S, {
|
|
22
|
+
key: 0,
|
|
23
|
+
onAction: n[0] ||= (e) => t.$emit("menu-action", e)
|
|
24
|
+
})) : M("", !0)]),
|
|
25
|
+
P("div", Oe, [K(t.$slots, "title-bar-right", {}, void 0, !0)])
|
|
26
|
+
])], !0), K(t.$slots, "toolbar", {}, () => [I(c, ve(_e(t.$attrs)), null, 16)], !0)]));
|
|
27
|
+
}
|
|
28
|
+
}), [["__scopeId", "data-v-f2023632"]]), Ae = {}, je = { class: "docx-title-bar" }, Me = { class: "docx-title-bar__left" }, Ne = { class: "docx-title-bar__center" }, Pe = { class: "docx-title-bar__right" };
|
|
29
|
+
function Fe(e, t) {
|
|
30
|
+
return U(), N("div", je, [
|
|
31
|
+
P("div", Me, [K(e.$slots, "left", {}, void 0, !0)]),
|
|
32
|
+
P("div", Ne, [K(e.$slots, "default", {}, void 0, !0)]),
|
|
33
|
+
P("div", Pe, [K(e.$slots, "right", {}, void 0, !0)])
|
|
34
|
+
]);
|
|
35
|
+
}
|
|
36
|
+
var Ie = /* @__PURE__ */ C(Ae, [["render", Fe], ["__scopeId", "data-v-ae11d49f"]]), Le = ["title"], Re = {
|
|
37
|
+
key: 0,
|
|
38
|
+
class: "responsive-toolbar__overflow-menu"
|
|
39
|
+
}, ze = /* @__PURE__ */ C(/* @__PURE__ */ L({
|
|
40
|
+
__name: "ResponsiveToolbar",
|
|
41
|
+
setup(e) {
|
|
42
|
+
let { t } = s(), n = W(null), r = W(null), i = W(null), a = W(0), o = W(!1), c = null;
|
|
43
|
+
function l() {
|
|
44
|
+
let e = n.value, t = r.value;
|
|
45
|
+
if (!e || !t) return;
|
|
46
|
+
let i = e.clientWidth - 40, o = Array.from(t.children), s = 0;
|
|
47
|
+
for (let e of o) e.style.display = "";
|
|
48
|
+
let c = 0;
|
|
49
|
+
for (let e of o) c += e.offsetWidth + 2, c > i ? e.style.display = "none" : s++;
|
|
50
|
+
a.value = o.length - s;
|
|
51
|
+
}
|
|
52
|
+
function u(e) {
|
|
53
|
+
let t = e.target;
|
|
54
|
+
i.value?.contains(t) || (o.value = !1);
|
|
55
|
+
}
|
|
56
|
+
return H(() => {
|
|
57
|
+
c = new ResizeObserver(() => {
|
|
58
|
+
R(l);
|
|
59
|
+
}), n.value && c.observe(n.value), R(l), document.addEventListener("mousedown", u);
|
|
60
|
+
}), V(() => {
|
|
61
|
+
c?.disconnect(), document.removeEventListener("mousedown", u);
|
|
62
|
+
}), (e, s) => (U(), N("div", {
|
|
63
|
+
class: "responsive-toolbar",
|
|
64
|
+
ref_key: "containerRef",
|
|
65
|
+
ref: n
|
|
66
|
+
}, [P("div", {
|
|
67
|
+
class: "responsive-toolbar__items",
|
|
68
|
+
ref_key: "itemsRef",
|
|
69
|
+
ref: r
|
|
70
|
+
}, [K(e.$slots, "default", {}, void 0, !0)], 512), a.value > 0 ? (U(), N("div", {
|
|
71
|
+
key: 0,
|
|
72
|
+
class: "responsive-toolbar__overflow",
|
|
73
|
+
ref_key: "overflowRef",
|
|
74
|
+
ref: i
|
|
75
|
+
}, [P("button", {
|
|
76
|
+
class: "responsive-toolbar__overflow-btn",
|
|
77
|
+
onMousedown: s[0] ||= Z((e) => o.value = !o.value, ["prevent"]),
|
|
78
|
+
title: J(t)("formattingBar.moreItems", { count: a.value })
|
|
79
|
+
}, " ⋯ ", 40, Le), o.value ? (U(), N("div", Re, [K(e.$slots, "overflow", {}, void 0, !0)])) : M("", !0)], 512)) : M("", !0)], 512));
|
|
80
|
+
}
|
|
81
|
+
}), [["__scopeId", "data-v-134de3f0"]]);
|
|
82
|
+
//#endregion
|
|
83
|
+
//#region src/components/ui/fontPickerValue.ts
|
|
84
|
+
function Q(e) {
|
|
85
|
+
let t = e.trim();
|
|
86
|
+
if (!t) return "";
|
|
87
|
+
let n = null, r = "";
|
|
88
|
+
for (let e of t) {
|
|
89
|
+
if ((e === "\"" || e === "'") && n === null) {
|
|
90
|
+
n = e, r += e;
|
|
91
|
+
continue;
|
|
92
|
+
}
|
|
93
|
+
if (e === n) {
|
|
94
|
+
n = null, r += e;
|
|
95
|
+
continue;
|
|
96
|
+
}
|
|
97
|
+
if (e === "," && n === null) break;
|
|
98
|
+
r += e;
|
|
99
|
+
}
|
|
100
|
+
return r.trim().replace(/^['"]|['"]$/g, "");
|
|
101
|
+
}
|
|
102
|
+
//#endregion
|
|
103
|
+
//#region src/components/ui/FontPicker.vue?vue&type=script&setup=true&lang.ts
|
|
104
|
+
var Be = ["value", "disabled"], Ve = {
|
|
105
|
+
key: 0,
|
|
106
|
+
label: "Sans-serif"
|
|
107
|
+
}, He = ["value"], Ue = {
|
|
108
|
+
key: 1,
|
|
109
|
+
label: "Serif"
|
|
110
|
+
}, We = ["value"], Ge = {
|
|
111
|
+
key: 2,
|
|
112
|
+
label: "Monospace"
|
|
113
|
+
}, Ke = ["value"], qe = {
|
|
114
|
+
key: 3,
|
|
115
|
+
label: "Other"
|
|
116
|
+
}, Je = ["value"], Ye = /* @__PURE__ */ C(/* @__PURE__ */ L({
|
|
117
|
+
__name: "FontPicker",
|
|
118
|
+
props: {
|
|
119
|
+
value: {},
|
|
120
|
+
fonts: {},
|
|
121
|
+
disabled: {
|
|
122
|
+
type: Boolean,
|
|
123
|
+
default: !1
|
|
124
|
+
},
|
|
125
|
+
className: {},
|
|
126
|
+
placeholder: { default: "Font" },
|
|
127
|
+
showPreview: {
|
|
128
|
+
type: Boolean,
|
|
129
|
+
default: !0
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
emits: ["change"],
|
|
133
|
+
setup(e, { emit: t }) {
|
|
134
|
+
let n = e, r = t, i = [
|
|
135
|
+
{
|
|
136
|
+
name: "Arial",
|
|
137
|
+
fontFamily: "Arial, Helvetica, sans-serif",
|
|
138
|
+
category: "sans-serif"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
name: "Calibri",
|
|
142
|
+
fontFamily: "\"Calibri\", Arial, sans-serif",
|
|
143
|
+
category: "sans-serif"
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: "Helvetica",
|
|
147
|
+
fontFamily: "Helvetica, Arial, sans-serif",
|
|
148
|
+
category: "sans-serif"
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
name: "Verdana",
|
|
152
|
+
fontFamily: "Verdana, Geneva, sans-serif",
|
|
153
|
+
category: "sans-serif"
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
name: "Open Sans",
|
|
157
|
+
fontFamily: "\"Open Sans\", sans-serif",
|
|
158
|
+
category: "sans-serif"
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
name: "Roboto",
|
|
162
|
+
fontFamily: "Roboto, sans-serif",
|
|
163
|
+
category: "sans-serif"
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: "Times New Roman",
|
|
167
|
+
fontFamily: "\"Times New Roman\", Times, serif",
|
|
168
|
+
category: "serif"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
name: "Georgia",
|
|
172
|
+
fontFamily: "Georgia, serif",
|
|
173
|
+
category: "serif"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
name: "Cambria",
|
|
177
|
+
fontFamily: "Cambria, Georgia, serif",
|
|
178
|
+
category: "serif"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
name: "Garamond",
|
|
182
|
+
fontFamily: "Garamond, serif",
|
|
183
|
+
category: "serif"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
name: "Courier New",
|
|
187
|
+
fontFamily: "\"Courier New\", monospace",
|
|
188
|
+
category: "monospace"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
name: "Consolas",
|
|
192
|
+
fontFamily: "Consolas, monospace",
|
|
193
|
+
category: "monospace"
|
|
194
|
+
}
|
|
195
|
+
], a = A(() => n.fonts ?? i), o = A(() => {
|
|
196
|
+
let e = {
|
|
197
|
+
"sans-serif": [],
|
|
198
|
+
serif: [],
|
|
199
|
+
monospace: [],
|
|
200
|
+
other: []
|
|
201
|
+
};
|
|
202
|
+
for (let t of a.value) e[t.category ?? "other"].push(t);
|
|
203
|
+
return e;
|
|
204
|
+
}), s = A(() => n.value ? a.value.find((e) => e.fontFamily === n.value || e.name.toLowerCase() === n.value.toLowerCase() || Q(e.fontFamily).toLowerCase() === n.value.toLowerCase())?.name ?? n.value : n.placeholder);
|
|
205
|
+
function c(e) {
|
|
206
|
+
let t = e.target.value, n = a.value.find((e) => e.name === t);
|
|
207
|
+
r("change", n ? Q(n.fontFamily) || n.name : t);
|
|
208
|
+
}
|
|
209
|
+
return (t, n) => (U(), N("select", {
|
|
210
|
+
class: z(["docx-font-picker", e.className]),
|
|
211
|
+
value: s.value,
|
|
212
|
+
disabled: e.disabled,
|
|
213
|
+
"aria-label": "Font family",
|
|
214
|
+
onChange: c
|
|
215
|
+
}, [
|
|
216
|
+
o.value["sans-serif"].length ? (U(), N("optgroup", Ve, [(U(!0), N(O, null, G(o.value["sans-serif"], (t) => (U(), N("option", {
|
|
217
|
+
key: t.name,
|
|
218
|
+
value: t.name,
|
|
219
|
+
style: B(e.showPreview ? { fontFamily: t.fontFamily } : void 0)
|
|
220
|
+
}, q(t.name), 13, He))), 128))])) : M("", !0),
|
|
221
|
+
o.value.serif.length ? (U(), N("optgroup", Ue, [(U(!0), N(O, null, G(o.value.serif, (t) => (U(), N("option", {
|
|
222
|
+
key: t.name,
|
|
223
|
+
value: t.name,
|
|
224
|
+
style: B(e.showPreview ? { fontFamily: t.fontFamily } : void 0)
|
|
225
|
+
}, q(t.name), 13, We))), 128))])) : M("", !0),
|
|
226
|
+
o.value.monospace.length ? (U(), N("optgroup", Ge, [(U(!0), N(O, null, G(o.value.monospace, (t) => (U(), N("option", {
|
|
227
|
+
key: t.name,
|
|
228
|
+
value: t.name,
|
|
229
|
+
style: B(e.showPreview ? { fontFamily: t.fontFamily } : void 0)
|
|
230
|
+
}, q(t.name), 13, Ke))), 128))])) : M("", !0),
|
|
231
|
+
o.value.other.length ? (U(), N("optgroup", qe, [(U(!0), N(O, null, G(o.value.other, (t) => (U(), N("option", {
|
|
232
|
+
key: t.name,
|
|
233
|
+
value: t.name,
|
|
234
|
+
style: B(e.showPreview ? { fontFamily: t.fontFamily } : void 0)
|
|
235
|
+
}, q(t.name), 13, Je))), 128))])) : M("", !0)
|
|
236
|
+
], 42, Be));
|
|
237
|
+
}
|
|
238
|
+
}), [["__scopeId", "data-v-30a12967"]]), Xe = { class: "docx-font-size" }, Ze = ["disabled"], Qe = [
|
|
239
|
+
"value",
|
|
240
|
+
"disabled",
|
|
241
|
+
"placeholder"
|
|
242
|
+
], $e = ["disabled"], et = /* @__PURE__ */ C(/* @__PURE__ */ L({
|
|
243
|
+
__name: "FontSizePicker",
|
|
244
|
+
props: {
|
|
245
|
+
value: {},
|
|
246
|
+
sizes: {},
|
|
247
|
+
disabled: {
|
|
248
|
+
type: Boolean,
|
|
249
|
+
default: !1
|
|
250
|
+
},
|
|
251
|
+
minSize: { default: 1 },
|
|
252
|
+
maxSize: { default: 1638 },
|
|
253
|
+
placeholder: { default: "11" }
|
|
254
|
+
},
|
|
255
|
+
emits: ["change"],
|
|
256
|
+
setup(e, { emit: t }) {
|
|
257
|
+
let n = e, r = t, i = [
|
|
258
|
+
8,
|
|
259
|
+
9,
|
|
260
|
+
10,
|
|
261
|
+
11,
|
|
262
|
+
12,
|
|
263
|
+
14,
|
|
264
|
+
16,
|
|
265
|
+
18,
|
|
266
|
+
20,
|
|
267
|
+
24,
|
|
268
|
+
28,
|
|
269
|
+
36,
|
|
270
|
+
48,
|
|
271
|
+
72
|
|
272
|
+
], a = A(() => n.sizes ?? i), o = A(() => n.value ?? parseInt(n.placeholder, 10) ?? 11), s = A(() => n.value === void 0 ? n.placeholder : String(n.value));
|
|
273
|
+
function c(e) {
|
|
274
|
+
return a.value.find((t) => t > e) ?? Math.min(e + 1, n.maxSize);
|
|
275
|
+
}
|
|
276
|
+
function l(e) {
|
|
277
|
+
return [...a.value].reverse().find((t) => t < e) ?? Math.max(e - 1, n.minSize);
|
|
278
|
+
}
|
|
279
|
+
function u() {
|
|
280
|
+
n.disabled || r("change", l(o.value));
|
|
281
|
+
}
|
|
282
|
+
function d() {
|
|
283
|
+
n.disabled || r("change", c(o.value));
|
|
284
|
+
}
|
|
285
|
+
function f(e) {
|
|
286
|
+
let t = parseFloat(e.target.value);
|
|
287
|
+
!isNaN(t) && t >= n.minSize && t <= n.maxSize && r("change", Math.round(t * 2) / 2);
|
|
288
|
+
}
|
|
289
|
+
return (t, n) => (U(), N("div", Xe, [
|
|
290
|
+
P("button", {
|
|
291
|
+
type: "button",
|
|
292
|
+
class: "docx-font-size__btn",
|
|
293
|
+
disabled: e.disabled || o.value <= e.minSize,
|
|
294
|
+
title: "Decrease font size",
|
|
295
|
+
onClick: Z(u, ["prevent"])
|
|
296
|
+
}, "−", 8, Ze),
|
|
297
|
+
P("input", {
|
|
298
|
+
class: "docx-font-size__input",
|
|
299
|
+
type: "text",
|
|
300
|
+
value: s.value,
|
|
301
|
+
disabled: e.disabled,
|
|
302
|
+
placeholder: e.placeholder,
|
|
303
|
+
onKeydown: [
|
|
304
|
+
n[0] ||= X(Z((e) => {
|
|
305
|
+
u(), e.stopPropagation();
|
|
306
|
+
}, ["prevent"]), ["up"]),
|
|
307
|
+
n[1] ||= X(Z((e) => {
|
|
308
|
+
d(), e.stopPropagation();
|
|
309
|
+
}, ["prevent"]), ["down"]),
|
|
310
|
+
n[2] ||= X(Z((e) => f(e), ["prevent"]), ["enter"])
|
|
311
|
+
],
|
|
312
|
+
onBlur: n[3] ||= (e) => f(e)
|
|
313
|
+
}, null, 40, Qe),
|
|
314
|
+
P("button", {
|
|
315
|
+
type: "button",
|
|
316
|
+
class: "docx-font-size__btn",
|
|
317
|
+
disabled: e.disabled || o.value >= e.maxSize,
|
|
318
|
+
title: "Increase font size",
|
|
319
|
+
onClick: Z(d, ["prevent"])
|
|
320
|
+
}, "+", 8, $e)
|
|
321
|
+
]));
|
|
322
|
+
}
|
|
323
|
+
}), [["__scopeId", "data-v-593c3ec6"]]), tt = ["value", "disabled"], nt = ["value"], rt = /* @__PURE__ */ C(/* @__PURE__ */ L({
|
|
324
|
+
__name: "LineSpacingPicker",
|
|
325
|
+
props: {
|
|
326
|
+
value: {},
|
|
327
|
+
options: {},
|
|
328
|
+
disabled: {
|
|
329
|
+
type: Boolean,
|
|
330
|
+
default: !1
|
|
331
|
+
},
|
|
332
|
+
className: {}
|
|
333
|
+
},
|
|
334
|
+
emits: ["change"],
|
|
335
|
+
setup(e, { emit: t }) {
|
|
336
|
+
let n = e, r = t, i = [
|
|
337
|
+
{
|
|
338
|
+
label: "Single",
|
|
339
|
+
value: 1,
|
|
340
|
+
twipsValue: 240
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
label: "1.15",
|
|
344
|
+
value: 1.15,
|
|
345
|
+
twipsValue: 276
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
label: "1.5",
|
|
349
|
+
value: 1.5,
|
|
350
|
+
twipsValue: 360
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
label: "Double",
|
|
354
|
+
value: 2,
|
|
355
|
+
twipsValue: 480
|
|
356
|
+
}
|
|
357
|
+
], a = A(() => n.options ?? i), o = A(() => n.value ?? a.value[0].twipsValue);
|
|
358
|
+
function s(e) {
|
|
359
|
+
let t = parseInt(e.target.value, 10);
|
|
360
|
+
isNaN(t) || r("change", t);
|
|
361
|
+
}
|
|
362
|
+
return (t, n) => (U(), N("select", {
|
|
363
|
+
class: z(["docx-line-spacing", e.className]),
|
|
364
|
+
value: String(o.value),
|
|
365
|
+
disabled: e.disabled,
|
|
366
|
+
"aria-label": "Line spacing",
|
|
367
|
+
onChange: s
|
|
368
|
+
}, [(U(!0), N(O, null, G(a.value, (e) => (U(), N("option", {
|
|
369
|
+
key: e.twipsValue,
|
|
370
|
+
value: String(e.twipsValue)
|
|
371
|
+
}, q(e.label), 9, nt))), 128))], 42, tt));
|
|
372
|
+
}
|
|
373
|
+
}), [["__scopeId", "data-v-8cd813f2"]]), it = ["value", "disabled"], at = ["value"], ot = /* @__PURE__ */ C(/* @__PURE__ */ L({
|
|
374
|
+
__name: "StylePicker",
|
|
375
|
+
props: {
|
|
376
|
+
value: {},
|
|
377
|
+
styles: {},
|
|
378
|
+
disabled: {
|
|
379
|
+
type: Boolean,
|
|
380
|
+
default: !1
|
|
381
|
+
},
|
|
382
|
+
className: {}
|
|
383
|
+
},
|
|
384
|
+
emits: ["change"],
|
|
385
|
+
setup(e, { emit: t }) {
|
|
386
|
+
let n = e, r = t, i = [
|
|
387
|
+
{
|
|
388
|
+
styleId: "Normal",
|
|
389
|
+
name: "Normal text"
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
styleId: "Title",
|
|
393
|
+
name: "Title"
|
|
394
|
+
},
|
|
395
|
+
{
|
|
396
|
+
styleId: "Subtitle",
|
|
397
|
+
name: "Subtitle"
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
styleId: "Heading1",
|
|
401
|
+
name: "Heading 1"
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
styleId: "Heading2",
|
|
405
|
+
name: "Heading 2"
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
styleId: "Heading3",
|
|
409
|
+
name: "Heading 3"
|
|
410
|
+
}
|
|
411
|
+
], a = A(() => n.styles ?? i);
|
|
412
|
+
function o(e) {
|
|
413
|
+
r("change", e.target.value);
|
|
414
|
+
}
|
|
415
|
+
return (t, n) => (U(), N("select", {
|
|
416
|
+
class: z(["docx-style-picker", e.className]),
|
|
417
|
+
value: e.value ?? "Normal",
|
|
418
|
+
disabled: e.disabled,
|
|
419
|
+
"aria-label": "Paragraph style",
|
|
420
|
+
onChange: o
|
|
421
|
+
}, [(U(!0), N(O, null, G(a.value, (e) => (U(), N("option", {
|
|
422
|
+
key: e.styleId,
|
|
423
|
+
value: e.styleId
|
|
424
|
+
}, q(e.name), 9, at))), 128))], 42, it));
|
|
425
|
+
}
|
|
426
|
+
}), [["__scopeId", "data-v-dce7e34a"]]), st = [
|
|
427
|
+
"disabled",
|
|
428
|
+
"title",
|
|
429
|
+
"aria-expanded",
|
|
430
|
+
"onClick"
|
|
431
|
+
], ct = { class: "docx-align__panel" }, lt = ["title", "onClick"], ut = /* @__PURE__ */ C(/* @__PURE__ */ L({
|
|
432
|
+
__name: "AlignmentButtons",
|
|
433
|
+
props: {
|
|
434
|
+
value: { default: "left" },
|
|
435
|
+
disabled: {
|
|
436
|
+
type: Boolean,
|
|
437
|
+
default: !1
|
|
438
|
+
}
|
|
439
|
+
},
|
|
440
|
+
emits: ["change"],
|
|
441
|
+
setup(e, { emit: n }) {
|
|
442
|
+
let r = e, i = n, a = W(!1), o = [
|
|
443
|
+
{
|
|
444
|
+
value: "left",
|
|
445
|
+
label: "Align left",
|
|
446
|
+
icon: "format_align_left",
|
|
447
|
+
shortcut: "Ctrl+L"
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
value: "center",
|
|
451
|
+
label: "Center",
|
|
452
|
+
icon: "format_align_center",
|
|
453
|
+
shortcut: "Ctrl+E"
|
|
454
|
+
},
|
|
455
|
+
{
|
|
456
|
+
value: "right",
|
|
457
|
+
label: "Align right",
|
|
458
|
+
icon: "format_align_right",
|
|
459
|
+
shortcut: "Ctrl+R"
|
|
460
|
+
},
|
|
461
|
+
{
|
|
462
|
+
value: "both",
|
|
463
|
+
label: "Justify",
|
|
464
|
+
icon: "format_align_justify",
|
|
465
|
+
shortcut: "Ctrl+J"
|
|
466
|
+
}
|
|
467
|
+
], s = A(() => o.find((e) => e.value === r.value)?.icon ?? "format_align_left"), c = A(() => o.find((e) => e.value === r.value)?.label ?? "Left");
|
|
468
|
+
function l(e) {
|
|
469
|
+
i("change", e), a.value = !1;
|
|
470
|
+
}
|
|
471
|
+
return (n, r) => (U(), j(d, {
|
|
472
|
+
open: a.value,
|
|
473
|
+
"onUpdate:open": r[0] ||= (e) => a.value = e,
|
|
474
|
+
onClose: r[1] ||= (e) => a.value = !1
|
|
475
|
+
}, {
|
|
476
|
+
trigger: Y(({ toggle: n }) => [P("button", {
|
|
477
|
+
type: "button",
|
|
478
|
+
class: z(["docx-align__btn", { "docx-align__btn--open": a.value }]),
|
|
479
|
+
disabled: e.disabled,
|
|
480
|
+
title: `Alignment: ${c.value}`,
|
|
481
|
+
"aria-expanded": a.value,
|
|
482
|
+
"aria-haspopup": "true",
|
|
483
|
+
onClick: Z(n, ["prevent"])
|
|
484
|
+
}, [I(t, {
|
|
485
|
+
name: s.value,
|
|
486
|
+
size: 20
|
|
487
|
+
}, null, 8, ["name"]), I(t, {
|
|
488
|
+
name: "arrow_drop_down",
|
|
489
|
+
size: 14
|
|
490
|
+
})], 10, st)]),
|
|
491
|
+
panel: Y(() => [P("div", ct, [(U(), N(O, null, G(o, (n) => P("button", {
|
|
492
|
+
key: n.value,
|
|
493
|
+
type: "button",
|
|
494
|
+
class: z(["docx-align__option", { "docx-align__option--active": e.value === n.value }]),
|
|
495
|
+
title: `${n.label} (${n.shortcut})`,
|
|
496
|
+
onClick: Z((e) => l(n.value), ["prevent"])
|
|
497
|
+
}, [I(t, {
|
|
498
|
+
name: n.icon,
|
|
499
|
+
size: 20
|
|
500
|
+
}, null, 8, ["name"])], 10, lt)), 64))])]),
|
|
501
|
+
_: 1
|
|
502
|
+
}, 8, ["open"]));
|
|
503
|
+
}
|
|
504
|
+
}), [["__scopeId", "data-v-412e177a"]]), dt = { class: "docx-list-btns" }, ft = ["disabled"], pt = ["disabled"], mt = ["disabled"], ht = ["disabled"], gt = /* @__PURE__ */ C(/* @__PURE__ */ L({
|
|
505
|
+
__name: "ListButtons",
|
|
506
|
+
props: {
|
|
507
|
+
listState: {},
|
|
508
|
+
disabled: {
|
|
509
|
+
type: Boolean,
|
|
510
|
+
default: !1
|
|
511
|
+
},
|
|
512
|
+
showIndentButtons: {
|
|
513
|
+
type: Boolean,
|
|
514
|
+
default: !0
|
|
515
|
+
},
|
|
516
|
+
canOutdent: {
|
|
517
|
+
type: Boolean,
|
|
518
|
+
default: !0
|
|
519
|
+
}
|
|
520
|
+
},
|
|
521
|
+
emits: [
|
|
522
|
+
"bullet-list",
|
|
523
|
+
"numbered-list",
|
|
524
|
+
"indent",
|
|
525
|
+
"outdent"
|
|
526
|
+
],
|
|
527
|
+
setup(e) {
|
|
528
|
+
return (n, r) => (U(), N("span", dt, [
|
|
529
|
+
P("button", {
|
|
530
|
+
type: "button",
|
|
531
|
+
class: z(["docx-list-btns__btn", { "docx-list-btns__btn--active": e.listState?.isInList && e.listState?.type === "bullet" }]),
|
|
532
|
+
disabled: e.disabled,
|
|
533
|
+
title: "Bullet list",
|
|
534
|
+
onClick: r[0] ||= Z((e) => n.$emit("bullet-list"), ["prevent"])
|
|
535
|
+
}, [I(t, {
|
|
536
|
+
name: "format_list_bulleted",
|
|
537
|
+
size: 20
|
|
538
|
+
})], 10, ft),
|
|
539
|
+
P("button", {
|
|
540
|
+
type: "button",
|
|
541
|
+
class: z(["docx-list-btns__btn", { "docx-list-btns__btn--active": e.listState?.isInList && e.listState?.type === "numbered" }]),
|
|
542
|
+
disabled: e.disabled,
|
|
543
|
+
title: "Numbered list",
|
|
544
|
+
onClick: r[1] ||= Z((e) => n.$emit("numbered-list"), ["prevent"])
|
|
545
|
+
}, [I(t, {
|
|
546
|
+
name: "format_list_numbered",
|
|
547
|
+
size: 20
|
|
548
|
+
})], 10, pt),
|
|
549
|
+
e.showIndentButtons ? (U(), N(O, { key: 0 }, [P("button", {
|
|
550
|
+
type: "button",
|
|
551
|
+
class: "docx-list-btns__btn",
|
|
552
|
+
disabled: e.disabled || !e.canOutdent,
|
|
553
|
+
title: "Decrease indent",
|
|
554
|
+
onClick: r[2] ||= Z((e) => n.$emit("outdent"), ["prevent"])
|
|
555
|
+
}, [I(t, {
|
|
556
|
+
name: "format_indent_decrease",
|
|
557
|
+
size: 20
|
|
558
|
+
})], 8, mt), P("button", {
|
|
559
|
+
type: "button",
|
|
560
|
+
class: "docx-list-btns__btn",
|
|
561
|
+
disabled: e.disabled,
|
|
562
|
+
title: "Increase indent",
|
|
563
|
+
onClick: r[3] ||= Z((e) => n.$emit("indent"), ["prevent"])
|
|
564
|
+
}, [I(t, {
|
|
565
|
+
name: "format_indent_increase",
|
|
566
|
+
size: 20
|
|
567
|
+
})], 8, ht)], 64)) : M("", !0)
|
|
568
|
+
]));
|
|
569
|
+
}
|
|
570
|
+
}), [["__scopeId", "data-v-1b9a4dcd"]]), _t = [
|
|
571
|
+
"value",
|
|
572
|
+
"disabled",
|
|
573
|
+
"aria-label"
|
|
574
|
+
], vt = ["value"], yt = /* @__PURE__ */ C(/* @__PURE__ */ L({
|
|
575
|
+
__name: "ZoomControl",
|
|
576
|
+
props: {
|
|
577
|
+
value: { default: 1 },
|
|
578
|
+
levels: {},
|
|
579
|
+
disabled: {
|
|
580
|
+
type: Boolean,
|
|
581
|
+
default: !1
|
|
582
|
+
},
|
|
583
|
+
className: {},
|
|
584
|
+
compact: {
|
|
585
|
+
type: Boolean,
|
|
586
|
+
default: !1
|
|
587
|
+
}
|
|
588
|
+
},
|
|
589
|
+
emits: ["change"],
|
|
590
|
+
setup(e, { emit: t }) {
|
|
591
|
+
let n = e, r = t, i = [
|
|
592
|
+
{
|
|
593
|
+
value: .5,
|
|
594
|
+
label: "50%"
|
|
595
|
+
},
|
|
596
|
+
{
|
|
597
|
+
value: .75,
|
|
598
|
+
label: "75%"
|
|
599
|
+
},
|
|
600
|
+
{
|
|
601
|
+
value: 1,
|
|
602
|
+
label: "100%"
|
|
603
|
+
},
|
|
604
|
+
{
|
|
605
|
+
value: 1.25,
|
|
606
|
+
label: "125%"
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
value: 1.5,
|
|
610
|
+
label: "150%"
|
|
611
|
+
},
|
|
612
|
+
{
|
|
613
|
+
value: 2,
|
|
614
|
+
label: "200%"
|
|
615
|
+
}
|
|
616
|
+
], a = A(() => n.levels ?? i), o = A(() => {
|
|
617
|
+
let e = a.value.find((e) => Math.abs(e.value - n.value) < .001);
|
|
618
|
+
return e ? e.label : `${Math.round(n.value * 100)}%`;
|
|
619
|
+
});
|
|
620
|
+
function s(e) {
|
|
621
|
+
let t = parseFloat(e.target.value);
|
|
622
|
+
isNaN(t) || r("change", t);
|
|
623
|
+
}
|
|
624
|
+
return (t, n) => (U(), N("select", {
|
|
625
|
+
class: z(["docx-zoom-control", {
|
|
626
|
+
"docx-zoom-control--compact": e.compact,
|
|
627
|
+
[e.className ?? ""]: !!e.className
|
|
628
|
+
}]),
|
|
629
|
+
value: e.value,
|
|
630
|
+
disabled: e.disabled,
|
|
631
|
+
"aria-label": `Zoom: ${o.value}`,
|
|
632
|
+
onChange: s
|
|
633
|
+
}, [(U(!0), N(O, null, G(a.value, (e) => (U(), N("option", {
|
|
634
|
+
key: e.value,
|
|
635
|
+
value: e.value
|
|
636
|
+
}, q(e.label), 9, vt))), 128))], 42, _t));
|
|
637
|
+
}
|
|
638
|
+
}), [["__scopeId", "data-v-734f61aa"]]), bt = /* @__PURE__ */ C(/* @__PURE__ */ L({
|
|
639
|
+
__name: "Tooltip",
|
|
640
|
+
props: {
|
|
641
|
+
content: {},
|
|
642
|
+
side: { default: "bottom" },
|
|
643
|
+
delayMs: { default: 400 }
|
|
644
|
+
},
|
|
645
|
+
setup(e) {
|
|
646
|
+
let t = ie(), n = e, r = W(!1), i = W({
|
|
647
|
+
x: 0,
|
|
648
|
+
y: 0
|
|
649
|
+
}), a = W(null), o = null;
|
|
650
|
+
function s() {
|
|
651
|
+
o = setTimeout(() => {
|
|
652
|
+
let e = a.value;
|
|
653
|
+
if (e) {
|
|
654
|
+
let t = e.getBoundingClientRect();
|
|
655
|
+
i.value = {
|
|
656
|
+
x: t.left + t.width / 2,
|
|
657
|
+
y: n.side === "top" ? t.top - 8 : t.bottom + 8
|
|
658
|
+
};
|
|
659
|
+
}
|
|
660
|
+
r.value = !0;
|
|
661
|
+
}, n.delayMs);
|
|
662
|
+
}
|
|
663
|
+
function c() {
|
|
664
|
+
o &&= (clearTimeout(o), null), r.value = !1;
|
|
665
|
+
}
|
|
666
|
+
V(() => {
|
|
667
|
+
o && clearTimeout(o);
|
|
668
|
+
});
|
|
669
|
+
let l = A(() => ({
|
|
670
|
+
left: i.value.x + "px",
|
|
671
|
+
top: i.value.y + "px",
|
|
672
|
+
transform: n.side === "top" ? "translate(-50%, -100%)" : n.side === "bottom" ? "translate(-50%, 0)" : void 0
|
|
673
|
+
}));
|
|
674
|
+
return (n, i) => (U(), N(O, null, [P("span", {
|
|
675
|
+
ref_key: "triggerRef",
|
|
676
|
+
ref: a,
|
|
677
|
+
class: "docx-tooltip__trigger",
|
|
678
|
+
onMouseenter: s,
|
|
679
|
+
onMouseleave: c
|
|
680
|
+
}, [K(n.$slots, "default", {}, void 0, !0)], 544), (U(), j(k, { to: "body" }, [r.value ? (U(), N("div", {
|
|
681
|
+
key: 0,
|
|
682
|
+
class: z(["docx-tooltip", J(t)]),
|
|
683
|
+
style: B(l.value)
|
|
684
|
+
}, q(e.content), 7)) : M("", !0)]))], 64));
|
|
685
|
+
}
|
|
686
|
+
}), [["__scopeId", "data-v-f8255ce5"]]), xt = ["aria-label"], St = {
|
|
687
|
+
key: 0,
|
|
688
|
+
class: "docx-loading__spinner"
|
|
689
|
+
}, Ct = {
|
|
690
|
+
key: 1,
|
|
691
|
+
class: "docx-loading__bar"
|
|
692
|
+
}, wt = {
|
|
693
|
+
key: 2,
|
|
694
|
+
class: "docx-loading__message"
|
|
695
|
+
}, Tt = /* @__PURE__ */ C(/* @__PURE__ */ L({
|
|
696
|
+
__name: "LoadingIndicator",
|
|
697
|
+
props: {
|
|
698
|
+
isLoading: { type: Boolean },
|
|
699
|
+
variant: { default: "spinner" },
|
|
700
|
+
size: { default: "medium" },
|
|
701
|
+
message: {},
|
|
702
|
+
overlay: {
|
|
703
|
+
type: Boolean,
|
|
704
|
+
default: !1
|
|
705
|
+
},
|
|
706
|
+
progress: { default: null }
|
|
707
|
+
},
|
|
708
|
+
setup(e) {
|
|
709
|
+
return (t, n) => e.isLoading ? (U(), N("div", {
|
|
710
|
+
key: 0,
|
|
711
|
+
class: z([
|
|
712
|
+
"docx-loading",
|
|
713
|
+
`docx-loading--${e.variant}`,
|
|
714
|
+
`docx-loading--${e.size}`,
|
|
715
|
+
{ "docx-loading--overlay": e.overlay }
|
|
716
|
+
]),
|
|
717
|
+
role: "status",
|
|
718
|
+
"aria-label": e.message
|
|
719
|
+
}, [e.variant === "spinner" ? (U(), N("span", St)) : e.variant === "bar" || e.variant === "progress" ? (U(), N("div", Ct, [P("div", {
|
|
720
|
+
class: "docx-loading__bar-fill",
|
|
721
|
+
style: B(e.variant === "progress" && e.progress != null ? { width: e.progress + "%" } : void 0)
|
|
722
|
+
}, null, 4)])) : M("", !0), e.message ? (U(), N("span", wt, q(e.message), 1)) : M("", !0)], 10, xt)) : M("", !0);
|
|
723
|
+
}
|
|
724
|
+
}), [["__scopeId", "data-v-5ffccb99"]]), Et = ["disabled"], Dt = "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50", Ot = /* @__PURE__ */ L({
|
|
725
|
+
__name: "Button",
|
|
726
|
+
props: {
|
|
727
|
+
variant: { default: "default" },
|
|
728
|
+
size: { default: "default" },
|
|
729
|
+
disabled: {
|
|
730
|
+
type: Boolean,
|
|
731
|
+
default: !1
|
|
732
|
+
},
|
|
733
|
+
className: { default: "" }
|
|
734
|
+
},
|
|
735
|
+
emits: ["click"],
|
|
736
|
+
setup(e) {
|
|
737
|
+
let t = e, n = {
|
|
738
|
+
default: "bg-primary text-primary-foreground hover:bg-primary/90",
|
|
739
|
+
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90",
|
|
740
|
+
outline: "border border-input bg-background hover:bg-accent hover:text-accent-foreground",
|
|
741
|
+
secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80",
|
|
742
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
743
|
+
link: "text-primary underline-offset-4 hover:underline"
|
|
744
|
+
}, r = {
|
|
745
|
+
default: "h-10 px-4 py-2",
|
|
746
|
+
sm: "h-9 rounded-md px-3",
|
|
747
|
+
lg: "h-11 rounded-md px-8",
|
|
748
|
+
icon: "h-9 w-9",
|
|
749
|
+
"icon-sm": "h-7 w-7"
|
|
750
|
+
}, i = A(() => [
|
|
751
|
+
Dt,
|
|
752
|
+
n[t.variant],
|
|
753
|
+
r[t.size],
|
|
754
|
+
t.className
|
|
755
|
+
].filter(Boolean).join(" "));
|
|
756
|
+
return (t, n) => (U(), N("button", {
|
|
757
|
+
class: z(i.value),
|
|
758
|
+
disabled: e.disabled,
|
|
759
|
+
onClick: n[0] ||= (e) => t.$emit("click", e)
|
|
760
|
+
}, [K(t.$slots, "default")], 10, Et));
|
|
761
|
+
}
|
|
762
|
+
}), kt = [
|
|
763
|
+
"disabled",
|
|
764
|
+
"aria-expanded",
|
|
765
|
+
"title",
|
|
766
|
+
"onClick"
|
|
767
|
+
], At = { class: "docx-table-grid__panel" }, jt = { class: "docx-table-grid__label" }, Mt = ["onMouseenter", "onClick"], Nt = /* @__PURE__ */ C(/* @__PURE__ */ L({
|
|
768
|
+
__name: "TableGridPicker",
|
|
769
|
+
props: {
|
|
770
|
+
disabled: {
|
|
771
|
+
type: Boolean,
|
|
772
|
+
default: !1
|
|
773
|
+
},
|
|
774
|
+
gridRows: { default: 5 },
|
|
775
|
+
gridColumns: { default: 5 },
|
|
776
|
+
tooltip: { default: "Insert table" }
|
|
777
|
+
},
|
|
778
|
+
emits: ["insert"],
|
|
779
|
+
setup(e, { emit: n }) {
|
|
780
|
+
let r = e, i = n, a = W(!1), o = W({
|
|
781
|
+
rows: 1,
|
|
782
|
+
cols: 1
|
|
783
|
+
}), s = A(() => {
|
|
784
|
+
let e = [];
|
|
785
|
+
for (let t = 1; t <= r.gridRows; t++) for (let n = 1; n <= r.gridColumns; n++) e.push({
|
|
786
|
+
r: t,
|
|
787
|
+
c: n
|
|
788
|
+
});
|
|
789
|
+
return e;
|
|
790
|
+
});
|
|
791
|
+
function c(e, t) {
|
|
792
|
+
i("insert", e, t), a.value = !1;
|
|
793
|
+
}
|
|
794
|
+
function l() {
|
|
795
|
+
a.value = !1, o.value = {
|
|
796
|
+
rows: 1,
|
|
797
|
+
cols: 1
|
|
798
|
+
};
|
|
799
|
+
}
|
|
800
|
+
return (n, r) => (U(), j(d, {
|
|
801
|
+
open: a.value,
|
|
802
|
+
"onUpdate:open": r[0] ||= (e) => a.value = e,
|
|
803
|
+
onClose: l
|
|
804
|
+
}, {
|
|
805
|
+
trigger: Y(({ toggle: n }) => [P("button", {
|
|
806
|
+
type: "button",
|
|
807
|
+
class: "docx-table-grid__btn",
|
|
808
|
+
disabled: e.disabled,
|
|
809
|
+
"aria-expanded": a.value,
|
|
810
|
+
"aria-haspopup": "grid",
|
|
811
|
+
title: e.tooltip,
|
|
812
|
+
onClick: Z(n, ["prevent"])
|
|
813
|
+
}, [I(t, {
|
|
814
|
+
name: "grid_on",
|
|
815
|
+
size: 20
|
|
816
|
+
})], 8, kt)]),
|
|
817
|
+
panel: Y(() => [P("div", At, [P("div", jt, q(o.value.rows) + " × " + q(o.value.cols), 1), P("div", {
|
|
818
|
+
class: "docx-table-grid__grid",
|
|
819
|
+
style: B({ gridTemplateColumns: `repeat(${e.gridColumns}, 18px)` })
|
|
820
|
+
}, [(U(!0), N(O, null, G(s.value, (e) => (U(), N("button", {
|
|
821
|
+
key: `${e.r}-${e.c}`,
|
|
822
|
+
class: z(["docx-table-grid__cell", { "docx-table-grid__cell--active": e.r <= o.value.rows && e.c <= o.value.cols }]),
|
|
823
|
+
onMouseenter: (t) => o.value = {
|
|
824
|
+
rows: e.r,
|
|
825
|
+
cols: e.c
|
|
826
|
+
},
|
|
827
|
+
onClick: Z((t) => c(e.r, e.c), ["prevent"])
|
|
828
|
+
}, null, 42, Mt))), 128))], 4)])]),
|
|
829
|
+
_: 1
|
|
830
|
+
}, 8, ["open"]));
|
|
831
|
+
}
|
|
832
|
+
}), [["__scopeId", "data-v-34f6875c"]]), $ = { class: "docx-table-insert" }, Pt = [
|
|
833
|
+
"disabled",
|
|
834
|
+
"title",
|
|
835
|
+
"onClick"
|
|
836
|
+
], Ft = /* @__PURE__ */ C(/* @__PURE__ */ L({
|
|
837
|
+
__name: "TableInsertButtons",
|
|
838
|
+
props: { disabled: { type: Boolean } },
|
|
839
|
+
emits: ["action"],
|
|
840
|
+
setup(e, { emit: n }) {
|
|
841
|
+
let r = n, i = [
|
|
842
|
+
{
|
|
843
|
+
action: "addRowAbove",
|
|
844
|
+
icon: "keyboard_arrow_up",
|
|
845
|
+
label: "Insert row above"
|
|
846
|
+
},
|
|
847
|
+
{
|
|
848
|
+
action: "addRowBelow",
|
|
849
|
+
icon: "keyboard_arrow_down",
|
|
850
|
+
label: "Insert row below"
|
|
851
|
+
},
|
|
852
|
+
{
|
|
853
|
+
action: "addColumnLeft",
|
|
854
|
+
icon: "keyboard_arrow_left",
|
|
855
|
+
label: "Insert column left"
|
|
856
|
+
},
|
|
857
|
+
{
|
|
858
|
+
action: "addColumnRight",
|
|
859
|
+
icon: "keyboard_arrow_right",
|
|
860
|
+
label: "Insert column right"
|
|
861
|
+
}
|
|
862
|
+
];
|
|
863
|
+
return (n, a) => (U(), N("span", $, [(U(), N(O, null, G(i, (n) => P("button", {
|
|
864
|
+
key: n.action,
|
|
865
|
+
type: "button",
|
|
866
|
+
class: "docx-table-insert__btn",
|
|
867
|
+
disabled: e.disabled,
|
|
868
|
+
title: n.label,
|
|
869
|
+
onClick: Z((e) => r("action", n.action), ["prevent"])
|
|
870
|
+
}, [I(t, {
|
|
871
|
+
name: n.icon,
|
|
872
|
+
size: 20
|
|
873
|
+
}, null, 8, ["name"])], 8, Pt)), 64))]));
|
|
874
|
+
}
|
|
875
|
+
}), [["__scopeId", "data-v-a11c0f43"]]), It = ["disabled", "title"], Lt = /* @__PURE__ */ C(/* @__PURE__ */ L({
|
|
876
|
+
__name: "TableMergeButton",
|
|
877
|
+
props: {
|
|
878
|
+
canSplit: { type: Boolean },
|
|
879
|
+
disabled: { type: Boolean }
|
|
880
|
+
},
|
|
881
|
+
emits: ["action"],
|
|
882
|
+
setup(e, { emit: n }) {
|
|
883
|
+
let r = n;
|
|
884
|
+
return (n, i) => (U(), N("button", {
|
|
885
|
+
type: "button",
|
|
886
|
+
class: "docx-table-merge",
|
|
887
|
+
disabled: e.disabled,
|
|
888
|
+
title: e.canSplit ? "Split cells" : "Merge cells",
|
|
889
|
+
onClick: i[0] ||= Z((t) => r("action", e.canSplit ? "splitCells" : "mergeCells"), ["prevent"])
|
|
890
|
+
}, [I(t, {
|
|
891
|
+
name: e.canSplit ? "call_split" : "call_merge",
|
|
892
|
+
size: 20
|
|
893
|
+
}, null, 8, ["name"])], 8, It));
|
|
894
|
+
}
|
|
895
|
+
}), [["__scopeId", "data-v-467e6c3e"]]), Rt = ["disabled", "title"], zt = {
|
|
896
|
+
key: 0,
|
|
897
|
+
class: "print-btn__icon"
|
|
898
|
+
}, Bt = /* @__PURE__ */ C(/* @__PURE__ */ L({
|
|
899
|
+
__name: "PrintButton",
|
|
900
|
+
props: {
|
|
901
|
+
disabled: {
|
|
902
|
+
type: Boolean,
|
|
903
|
+
default: !1
|
|
904
|
+
},
|
|
905
|
+
label: { default: "Print" },
|
|
906
|
+
compact: {
|
|
907
|
+
type: Boolean,
|
|
908
|
+
default: !1
|
|
909
|
+
}
|
|
910
|
+
},
|
|
911
|
+
emits: ["print"],
|
|
912
|
+
setup(e, { emit: t }) {
|
|
913
|
+
let n = e, r = t;
|
|
914
|
+
function i() {
|
|
915
|
+
n.disabled || (r("print"), window.print());
|
|
916
|
+
}
|
|
917
|
+
return (t, n) => (U(), N("button", {
|
|
918
|
+
class: "print-btn",
|
|
919
|
+
disabled: e.disabled,
|
|
920
|
+
title: e.label,
|
|
921
|
+
onMousedown: Z(i, ["prevent"])
|
|
922
|
+
}, [F(q(e.compact ? "" : e.label) + " ", 1), e.compact ? (U(), N("span", zt, "🖨")) : M("", !0)], 40, Rt));
|
|
923
|
+
}
|
|
924
|
+
}), [["__scopeId", "data-v-3e413c06"]]), Vt = "\n@media print {\n body * { visibility: hidden; }\n .docx-print-pages, .docx-print-pages * { visibility: visible; }\n .docx-print-pages { position: absolute; left: 0; top: 0; }\n .docx-print-page {\n box-shadow: none !important;\n margin: 0 !important;\n page-break-after: always;\n page-break-inside: avoid;\n }\n img { max-width: 100%; page-break-inside: avoid; }\n table, tr { page-break-inside: avoid; }\n h1, h2, h3, h4, h5, h6 { page-break-after: avoid; }\n p { orphans: 3; widows: 3; }\n}\n@page { margin: 0; size: auto; }\n", Ht = /* @__PURE__ */ L({
|
|
925
|
+
__name: "PrintPreview",
|
|
926
|
+
setup(e) {
|
|
927
|
+
return (e, t) => (U(), j(ye("style"), null, {
|
|
928
|
+
default: Y(() => [F(q(Vt))]),
|
|
929
|
+
_: 1
|
|
930
|
+
}));
|
|
931
|
+
}
|
|
932
|
+
}), Ut = ["title"], Wt = {
|
|
933
|
+
key: 0,
|
|
934
|
+
class: "unsaved-indicator__dot"
|
|
935
|
+
}, Gt = {
|
|
936
|
+
key: 1,
|
|
937
|
+
class: "unsaved-indicator__badge"
|
|
938
|
+
}, Kt = {
|
|
939
|
+
key: 2,
|
|
940
|
+
class: "unsaved-indicator__text"
|
|
941
|
+
}, qt = /* @__PURE__ */ C(/* @__PURE__ */ L({
|
|
942
|
+
__name: "UnsavedIndicator",
|
|
943
|
+
props: {
|
|
944
|
+
currentState: {},
|
|
945
|
+
warnOnUnload: {
|
|
946
|
+
type: Boolean,
|
|
947
|
+
default: !0
|
|
948
|
+
},
|
|
949
|
+
variant: { default: "dot" },
|
|
950
|
+
label: { default: "Unsaved changes" },
|
|
951
|
+
title: { default: "You have unsaved changes" }
|
|
952
|
+
},
|
|
953
|
+
setup(e, { expose: t }) {
|
|
954
|
+
let n = e, r = W(!1), i = W(0), a = null;
|
|
955
|
+
be(() => n.currentState, (e) => {
|
|
956
|
+
if (e !== void 0) {
|
|
957
|
+
if (a === null) {
|
|
958
|
+
a = e;
|
|
959
|
+
return;
|
|
960
|
+
}
|
|
961
|
+
e !== a && (r.value = !0, i.value++);
|
|
962
|
+
}
|
|
963
|
+
});
|
|
964
|
+
function o() {
|
|
965
|
+
a = n.currentState ?? null, r.value = !1, i.value = 0;
|
|
966
|
+
}
|
|
967
|
+
function s(e) {
|
|
968
|
+
r.value && n.warnOnUnload && (e.preventDefault(), e.returnValue = "");
|
|
969
|
+
}
|
|
970
|
+
return H(() => {
|
|
971
|
+
window.addEventListener("beforeunload", s);
|
|
972
|
+
}), V(() => {
|
|
973
|
+
window.removeEventListener("beforeunload", s);
|
|
974
|
+
}), t({
|
|
975
|
+
hasUnsavedChanges: r,
|
|
976
|
+
changeCount: i,
|
|
977
|
+
markAsSaved: o
|
|
978
|
+
}), (t, n) => r.value ? (U(), N("span", {
|
|
979
|
+
key: 0,
|
|
980
|
+
class: z(["unsaved-indicator", `unsaved-indicator--${e.variant}`]),
|
|
981
|
+
title: e.title
|
|
982
|
+
}, [e.variant === "dot" ? (U(), N("span", Wt)) : e.variant === "badge" ? (U(), N("span", Gt, q(i.value), 1)) : (U(), N("span", Kt, q(e.label), 1))], 10, Ut)) : M("", !0);
|
|
983
|
+
}
|
|
984
|
+
}), [["__scopeId", "data-v-769d4022"]]), Jt = Se, Yt = Ce;
|
|
985
|
+
//#endregion
|
|
986
|
+
export { g as AddCommentCard, ut as AlignmentButtons, Ot as Button, Jt as CARD_STYLE_COLLAPSED, Yt as CARD_STYLE_EXPANDED, x as ColorPicker, re as CommentCard, ne as CommentMarginMarkers, ae as DocumentName, l as EditingModeDropdown, ke as EditorToolbar, i as FindReplaceDialog, Ye as FontPicker, et as FontSizePicker, E as FootnotePropertiesDialog, h as HorizontalRuler, e as HyperlinkDialog, u as IconGridDropdown, w as ImagePositionDialog, a as ImagePropertiesDialog, ue as ImageTransformDropdown, ee as ImageWrapDropdown, pe as InsertImageDialog, n as InsertSymbolDialog, he as InsertTableDialog, o as KeyboardShortcutsDialog, rt as LineSpacingPicker, gt as ListButtons, Tt as LoadingIndicator, S as MenuBar, p as MenuDropdown, r as PageSetupDialog, T as PasteSpecialDialog, d as Popover, Bt as PrintButton, Ht as PrintPreview, y as ReplyInput, v as ReplyThread, oe as ResolvedCommentMarker, ze as ResponsiveToolbar, ge as SplitCellDialog, ot as StylePicker, m as TableBorderColorPicker, de as TableBorderPicker, fe as TableBorderWidthPicker, f as TableCellFillPicker, b as TableGridInline, Nt as TableGridPicker, Ft as TableInsertButtons, Lt as TableMergeButton, le as TableMoreDropdown, D as TablePropertiesDialog, me as TableStyleGallery, te as TableToolbar, Ie as TitleBar, c as Toolbar, bt as Tooltip, _ as TrackedChangeCard, ce as UnifiedSidebar, qt as UnsavedIndicator, se as VerticalRuler, yt as ZoomControl, xe as createDefaultListState };
|