@harbour-enterprises/superdoc 0.12.5 → 0.12.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/super-editor.es-BMTopH0N.cjs +455 -0
- package/dist/chunks/{super-editor.es-uFc1kYwr.es.js → super-editor.es-CvWf9Igx.es.js} +9157 -8920
- package/dist/core/SuperDoc.d.ts.map +1 -1
- package/dist/style.css +1 -1
- package/dist/super-editor/ai-writer.es.js +2 -2
- package/dist/super-editor/chunks/{converter-Cid1Ewvn.js → converter-DPOXB8vR.js} +1585 -1519
- package/dist/super-editor/chunks/{docx-zipper-CldOGPZ9.js → docx-zipper-DTjI-Z4r.js} +1 -1
- package/dist/super-editor/chunks/{editor-DfsXlTev.js → editor-aYSWfnOz.js} +5467 -5308
- package/dist/super-editor/chunks/{toolbar-1h7-NG3P.js → toolbar-B5CeHdmH.js} +964 -958
- package/dist/super-editor/components/toolbar/defaultItems.d.ts.map +1 -1
- package/dist/super-editor/components/toolbar/super-toolbar.d.ts.map +1 -1
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/core/Editor.d.ts +21 -3
- package/dist/super-editor/core/Editor.d.ts.map +1 -1
- package/dist/super-editor/core/commands/setMark.d.ts +2 -1
- package/dist/super-editor/core/commands/setMark.d.ts.map +1 -1
- package/dist/super-editor/core/commands/unsetAllMarks.d.ts +2 -1
- package/dist/super-editor/core/commands/unsetAllMarks.d.ts.map +1 -1
- package/dist/super-editor/core/commands/unsetMark.d.ts +2 -1
- package/dist/super-editor/core/commands/unsetMark.d.ts.map +1 -1
- package/dist/super-editor/core/helpers/annotator.d.ts +18 -1
- package/dist/super-editor/core/helpers/annotator.d.ts.map +1 -1
- package/dist/super-editor/core/super-converter/SuperConverter.d.ts +4 -1
- package/dist/super-editor/core/super-converter/SuperConverter.d.ts.map +1 -1
- package/dist/super-editor/core/super-converter/exporter.d.ts.map +1 -1
- package/dist/super-editor/core/super-converter/helpers.d.ts +1 -0
- package/dist/super-editor/core/super-converter/helpers.d.ts.map +1 -1
- package/dist/super-editor/docx-zipper.es.js +2 -2
- package/dist/super-editor/editor.es.js +3 -3
- package/dist/super-editor/extensions/pagination/pagination-helpers.d.ts +15 -0
- package/dist/super-editor/extensions/pagination/pagination-helpers.d.ts.map +1 -1
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/style.css +1 -1
- package/dist/super-editor/super-editor.es.js +271 -264
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +1 -1
- package/dist/super-editor.es.js +8 -8
- package/dist/superdoc.cjs +5 -5
- package/dist/superdoc.es.js +4 -4
- package/dist/superdoc.umd.js +9230 -8990
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/super-editor.es-Bqp77LuU.cjs +0 -455
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var Ct = Object.defineProperty;
|
|
2
|
+
var Ge = (e) => {
|
|
3
3
|
throw TypeError(e);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var ze = (e, s, t) =>
|
|
7
|
-
var Te = (e, s, t) => (
|
|
8
|
-
var N = (e, s, t) => (
|
|
9
|
-
import { _ as q, a as
|
|
10
|
-
import { C as
|
|
11
|
-
import {
|
|
12
|
-
import { O as
|
|
13
|
-
import { ref as h, createElementBlock as k, openBlock as C, createElementVNode as _, unref as M, getCurrentInstance as
|
|
14
|
-
import { t as Z, s as
|
|
15
|
-
import
|
|
16
|
-
import { D as
|
|
17
|
-
import { createZip as
|
|
18
|
-
var
|
|
5
|
+
var kt = (e, s, t) => s in e ? Ct(e, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[s] = t;
|
|
6
|
+
var ze = (e, s, t) => kt(e, typeof s != "symbol" ? s + "" : s, t), Ke = (e, s, t) => s.has(e) || Ge("Cannot " + t);
|
|
7
|
+
var Te = (e, s, t) => (Ke(e, s, "read from private field"), t ? t.call(e) : s.get(e)), Re = (e, s, t) => s.has(e) ? Ge("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(e) : s.set(e, t);
|
|
8
|
+
var N = (e, s, t) => (Ke(e, s, "access private method"), t);
|
|
9
|
+
import { _ as q, a as Je, b as _t, I as Oe, f as xt, c as Xe, d as St, i as Et, u as At, r as Tt, E as Ne, e as Ft, P as It, h as Lt, M as Mt, j as Dt, A as Ht, N as Bt } from "./chunks/editor-aYSWfnOz.js";
|
|
10
|
+
import { C as Po, T as jo, l as Uo, n as qo, k as Go, m as Ko } from "./chunks/editor-aYSWfnOz.js";
|
|
11
|
+
import { a2 as $t, E as zt, a5 as Rt, T as Qe, a as Ot } from "./chunks/converter-DPOXB8vR.js";
|
|
12
|
+
import { O as Zo } from "./chunks/converter-DPOXB8vR.js";
|
|
13
|
+
import { ref as h, createElementBlock as k, openBlock as C, createElementVNode as _, unref as M, getCurrentInstance as Nt, computed as j, watch as Wt, onMounted as Ce, createCommentVNode as ee, withDirectives as et, withKeys as tt, normalizeClass as te, withModifiers as he, vModelText as nt, createTextVNode as ot, toDisplayString as ie, Fragment as U, renderList as ne, normalizeStyle as Q, createVNode as P, h as $, createApp as Vt, reactive as Ze, onUnmounted as Pt, shallowRef as it, onBeforeUnmount as st, createBlock as jt } from "vue";
|
|
14
|
+
import { t as Z, s as Ut, T as qt, N as J } from "./chunks/toolbar-B5CeHdmH.js";
|
|
15
|
+
import Gt from "./ai-writer.es.js";
|
|
16
|
+
import { D as Jo } from "./chunks/docx-zipper-DTjI-Z4r.js";
|
|
17
|
+
import { createZip as ei } from "./file-zipper.es.js";
|
|
18
|
+
var at = { exports: {} };
|
|
19
19
|
(function(e) {
|
|
20
20
|
var s = Object.prototype.hasOwnProperty, t = "~";
|
|
21
21
|
function n() {
|
|
@@ -119,10 +119,10 @@ var st = { exports: {} };
|
|
|
119
119
|
var u;
|
|
120
120
|
return d ? (u = t ? t + d : d, this._events[u] && c(this, u)) : (this._events = new n(), this._eventsCount = 0), this;
|
|
121
121
|
}, a.prototype.off = a.prototype.removeListener, a.prototype.addListener = a.prototype.on, a.prefixed = t, a.EventEmitter = a, e.exports = a;
|
|
122
|
-
})(
|
|
123
|
-
var
|
|
124
|
-
const
|
|
125
|
-
function
|
|
122
|
+
})(at);
|
|
123
|
+
var Kt = at.exports;
|
|
124
|
+
const Xt = /* @__PURE__ */ $t(Kt);
|
|
125
|
+
function Zt(e) {
|
|
126
126
|
let s = e;
|
|
127
127
|
for (; s; ) {
|
|
128
128
|
const t = window.getComputedStyle(s).overflowY;
|
|
@@ -132,9 +132,9 @@ function Xt(e) {
|
|
|
132
132
|
}
|
|
133
133
|
return document.scrollingElement || document.documentElement;
|
|
134
134
|
}
|
|
135
|
-
function
|
|
135
|
+
function Yt(e, s = { behavior: "smooth", block: "start" }) {
|
|
136
136
|
if (!e) return;
|
|
137
|
-
const t =
|
|
137
|
+
const t = Zt(e), n = t.getBoundingClientRect(), i = e.getBoundingClientRect().top - n.top + t.scrollTop;
|
|
138
138
|
t.scrollTo({
|
|
139
139
|
top: s.block === "start" ? i : i - t.clientHeight + e.offsetHeight,
|
|
140
140
|
behavior: s.behavior
|
|
@@ -147,7 +147,7 @@ const x = (e) => {
|
|
|
147
147
|
throw new Error("Toolbar button item needs either icon or label - " + e.name);
|
|
148
148
|
if (!e.name)
|
|
149
149
|
throw new Error("Invalid toolbar item name - " + e.name);
|
|
150
|
-
const t = h(
|
|
150
|
+
const t = h(zt()), n = e.type, o = h(e.name), i = e.command, c = e.noArgumentCommand, a = h(e.icon), l = h(e.group || "center"), d = h(e.allowWithoutEditor), u = h(e.attributes || {}), r = e.disabled || !1, w = h(e.disabled), v = h(!1), b = h(!1), y = h(e.style), g = h(e.isNarrow), L = h(e.isWide), D = h(e.minWidth), p = h(e.suppressActiveHighlight || !1), S = h(e.argument), F = h(null), O = h(null), W = h(e.iconColor), oe = h(e.hasCaret), ue = h(e.dropdownStyles), ve = h(e.tooltip), ge = h(e.tooltipVisible), Y = h(e.tooltipTimeout), T = h(e.defaultLabel), H = h(e.label), B = h(e.hideLabel), z = h(e.inlineTextInputVisible), G = h(e.hasInlineTextInput), K = h(e.markName), ce = h(e.labelAttr), se = h(e.selectedValue), ke = h(e.dropdownValueKey), Ie = h(e.inputRef || null), be = h([]);
|
|
151
151
|
if (e.options) {
|
|
152
152
|
if (!Array.isArray(e.options)) throw new Error("Invalid toolbar item options - " + e.options);
|
|
153
153
|
be.value.push(...e.options);
|
|
@@ -186,13 +186,13 @@ const x = (e) => {
|
|
|
186
186
|
argument: S,
|
|
187
187
|
parentItem: O,
|
|
188
188
|
iconColor: W,
|
|
189
|
-
hasCaret:
|
|
189
|
+
hasCaret: oe,
|
|
190
190
|
dropdownStyles: ue,
|
|
191
191
|
tooltipVisible: ge,
|
|
192
192
|
tooltipTimeout: Y,
|
|
193
193
|
defaultLabel: T,
|
|
194
|
-
label:
|
|
195
|
-
hideLabel:
|
|
194
|
+
label: H,
|
|
195
|
+
hideLabel: B,
|
|
196
196
|
inlineTextInputVisible: z,
|
|
197
197
|
hasInlineTextInput: G,
|
|
198
198
|
markName: K,
|
|
@@ -213,53 +213,53 @@ const x = (e) => {
|
|
|
213
213
|
onActivate: xe,
|
|
214
214
|
onDeactivate: Se
|
|
215
215
|
};
|
|
216
|
-
},
|
|
216
|
+
}, Jt = { class: "alignment-buttons" }, Qt = ["innerHTML"], en = ["innerHTML"], tn = ["innerHTML"], nn = ["innerHTML"], on = {
|
|
217
217
|
__name: "AlignmentButtons",
|
|
218
218
|
emits: ["select"],
|
|
219
219
|
setup(e, { emit: s }) {
|
|
220
220
|
const t = s, n = (o) => {
|
|
221
221
|
t("select", o);
|
|
222
222
|
};
|
|
223
|
-
return (o, i) => (C(), k("div",
|
|
223
|
+
return (o, i) => (C(), k("div", Jt, [
|
|
224
224
|
_("div", {
|
|
225
225
|
class: "button-icon",
|
|
226
226
|
onClick: i[0] || (i[0] = (c) => n("left")),
|
|
227
227
|
innerHTML: M(Z).alignLeft,
|
|
228
228
|
"data-item": "btn-textAlign-option"
|
|
229
|
-
}, null, 8,
|
|
229
|
+
}, null, 8, Qt),
|
|
230
230
|
_("div", {
|
|
231
231
|
class: "button-icon",
|
|
232
232
|
onClick: i[1] || (i[1] = (c) => n("center")),
|
|
233
233
|
innerHTML: M(Z).alignCenter,
|
|
234
234
|
"data-item": "btn-textAlign-option"
|
|
235
|
-
}, null, 8,
|
|
235
|
+
}, null, 8, en),
|
|
236
236
|
_("div", {
|
|
237
237
|
class: "button-icon",
|
|
238
238
|
onClick: i[2] || (i[2] = (c) => n("right")),
|
|
239
239
|
innerHTML: M(Z).alignRight,
|
|
240
240
|
"data-item": "btn-textAlign-option"
|
|
241
|
-
}, null, 8,
|
|
241
|
+
}, null, 8, tn),
|
|
242
242
|
_("div", {
|
|
243
243
|
class: "button-icon",
|
|
244
244
|
onClick: i[3] || (i[3] = (c) => n("justify")),
|
|
245
245
|
innerHTML: M(Z).alignJustify,
|
|
246
246
|
"data-item": "btn-textAlign-option"
|
|
247
|
-
}, null, 8,
|
|
247
|
+
}, null, 8, nn)
|
|
248
248
|
]));
|
|
249
249
|
}
|
|
250
|
-
},
|
|
250
|
+
}, sn = /* @__PURE__ */ q(on, [["__scopeId", "data-v-932a4937"]]), an = { class: "link-input-ctn" }, ln = {
|
|
251
251
|
key: 0,
|
|
252
252
|
class: "link-title"
|
|
253
|
-
},
|
|
253
|
+
}, rn = {
|
|
254
254
|
key: 1,
|
|
255
255
|
class: "link-title"
|
|
256
|
-
},
|
|
256
|
+
}, cn = {
|
|
257
257
|
key: 2,
|
|
258
258
|
class: "link-title"
|
|
259
|
-
},
|
|
259
|
+
}, dn = { key: 3 }, un = { class: "input-row" }, mn = ["innerHTML"], pn = ["onKeydown"], fn = ["innerHTML"], hn = { class: "input-row link-buttons" }, vn = ["innerHTML"], gn = {
|
|
260
260
|
key: 4,
|
|
261
261
|
class: "input-row go-to-anchor clickable"
|
|
262
|
-
},
|
|
262
|
+
}, bn = {
|
|
263
263
|
__name: "LinkInput",
|
|
264
264
|
props: {
|
|
265
265
|
initialText: {
|
|
@@ -286,7 +286,7 @@ const x = (e) => {
|
|
|
286
286
|
},
|
|
287
287
|
emits: ["submit", "cancel"],
|
|
288
288
|
setup(e, { emit: s }) {
|
|
289
|
-
const t = s, n = e, { proxy: o } =
|
|
289
|
+
const t = s, n = e, { proxy: o } = Nt(), i = () => {
|
|
290
290
|
if (o?.$submit instanceof Function && o.$submit(), d.value && r.value) {
|
|
291
291
|
t("submit", { text: l.value, href: u.value });
|
|
292
292
|
return;
|
|
@@ -303,7 +303,7 @@ const x = (e) => {
|
|
|
303
303
|
}), w = j(() => b.value ? "Apply" : "Remove"), v = j(() => !r.value), b = j(() => !y.value), y = j(() => n.href && !d.value), g = j(() => n.href.startsWith("#")), L = () => {
|
|
304
304
|
window.open(u.value, "_blank");
|
|
305
305
|
};
|
|
306
|
-
|
|
306
|
+
Wt(
|
|
307
307
|
() => n.href,
|
|
308
308
|
(p) => {
|
|
309
309
|
d.value = p;
|
|
@@ -315,34 +315,34 @@ const x = (e) => {
|
|
|
315
315
|
};
|
|
316
316
|
return Ce(() => {
|
|
317
317
|
n.showInput && D();
|
|
318
|
-
}), (p, S) => (C(), k("div",
|
|
319
|
-
e.href ? g.value ? (C(), k("div",
|
|
320
|
-
e.showInput && !g.value ? (C(), k("div",
|
|
321
|
-
_("div",
|
|
318
|
+
}), (p, S) => (C(), k("div", an, [
|
|
319
|
+
e.href ? g.value ? (C(), k("div", rn, "Page anchor")) : (C(), k("div", cn, "Edit link")) : (C(), k("div", ln, "Add link")),
|
|
320
|
+
e.showInput && !g.value ? (C(), k("div", dn, [
|
|
321
|
+
_("div", un, [
|
|
322
322
|
_("div", {
|
|
323
323
|
class: "input-icon",
|
|
324
324
|
innerHTML: M(Z).linkInput
|
|
325
|
-
}, null, 8,
|
|
326
|
-
|
|
325
|
+
}, null, 8, mn),
|
|
326
|
+
et(_("input", {
|
|
327
327
|
type: "text",
|
|
328
328
|
placeholder: "Type or paste a link",
|
|
329
|
-
class:
|
|
329
|
+
class: te({ error: a.value }),
|
|
330
330
|
"onUpdate:modelValue": S[0] || (S[0] = (F) => d.value = F),
|
|
331
331
|
onKeydown: [
|
|
332
|
-
|
|
332
|
+
tt(he(i, ["stop", "prevent"]), ["enter"]),
|
|
333
333
|
S[1] || (S[1] = (F) => a.value = !1)
|
|
334
334
|
]
|
|
335
|
-
}, null, 42,
|
|
336
|
-
[
|
|
335
|
+
}, null, 42, pn), [
|
|
336
|
+
[nt, d.value]
|
|
337
337
|
]),
|
|
338
338
|
_("div", {
|
|
339
|
-
class:
|
|
339
|
+
class: te(["open-link-icon", { disabled: !r.value }]),
|
|
340
340
|
innerHTML: M(Z).openLink,
|
|
341
341
|
onClick: L,
|
|
342
342
|
"data-item": "btn-link-open"
|
|
343
|
-
}, null, 10,
|
|
343
|
+
}, null, 10, fn)
|
|
344
344
|
]),
|
|
345
|
-
_("div",
|
|
345
|
+
_("div", hn, [
|
|
346
346
|
e.href ? (C(), k("button", {
|
|
347
347
|
key: 0,
|
|
348
348
|
class: "remove-btn",
|
|
@@ -352,24 +352,24 @@ const x = (e) => {
|
|
|
352
352
|
_("div", {
|
|
353
353
|
class: "remove-btn__icon",
|
|
354
354
|
innerHTML: M(Z).removeLink
|
|
355
|
-
}, null, 8,
|
|
356
|
-
S[3] || (S[3] =
|
|
355
|
+
}, null, 8, vn),
|
|
356
|
+
S[3] || (S[3] = ot(" Remove "))
|
|
357
357
|
])) : ee("", !0),
|
|
358
358
|
b.value ? (C(), k("button", {
|
|
359
359
|
key: 1,
|
|
360
|
-
class:
|
|
360
|
+
class: te(["submit-btn", { "disable-btn": v.value }]),
|
|
361
361
|
onClick: i,
|
|
362
362
|
"data-item": "btn-link-apply"
|
|
363
363
|
}, ie(w.value), 3)) : ee("", !0)
|
|
364
364
|
])
|
|
365
|
-
])) : g.value ? (C(), k("div",
|
|
365
|
+
])) : g.value ? (C(), k("div", gn, [
|
|
366
366
|
_("a", {
|
|
367
367
|
onClick: S[2] || (S[2] = he((...F) => e.goToAnchor && e.goToAnchor(...F), ["stop", "prevent"]))
|
|
368
368
|
}, "Go to " + ie(e.href.startsWith("#_") ? e.href.substring(2) : e.href), 1)
|
|
369
369
|
])) : ee("", !0)
|
|
370
370
|
]));
|
|
371
371
|
}
|
|
372
|
-
},
|
|
372
|
+
}, yn = /* @__PURE__ */ q(bn, [["__scopeId", "data-v-04bac853"]]), wn = { class: "document-mode" }, Cn = ["onClick"], kn = { class: "document-mode-column icon-column" }, _n = ["innerHTML"], xn = { class: "document-mode-column text-column" }, Sn = { class: "document-mode-type" }, En = { class: "document-mode-description" }, An = {
|
|
373
373
|
__name: "DocumentMode",
|
|
374
374
|
props: {
|
|
375
375
|
options: {
|
|
@@ -381,34 +381,37 @@ const x = (e) => {
|
|
|
381
381
|
const t = s, n = (o) => {
|
|
382
382
|
t("select", o);
|
|
383
383
|
};
|
|
384
|
-
return (o, i) => (C(), k("div",
|
|
385
|
-
(C(!0), k(U, null,
|
|
386
|
-
class:
|
|
384
|
+
return (o, i) => (C(), k("div", wn, [
|
|
385
|
+
(C(!0), k(U, null, ne(e.options, (c) => (C(), k("div", {
|
|
386
|
+
class: te(["option-item", { disabled: c.disabled }]),
|
|
387
387
|
onClick: (a) => n(c),
|
|
388
388
|
"data-item": "btn-documentMode-option"
|
|
389
389
|
}, [
|
|
390
|
-
_("div",
|
|
390
|
+
_("div", kn, [
|
|
391
391
|
_("div", {
|
|
392
392
|
class: "icon-column__icon",
|
|
393
393
|
innerHTML: c.icon
|
|
394
|
-
}, null, 8,
|
|
394
|
+
}, null, 8, _n)
|
|
395
395
|
]),
|
|
396
|
-
_("div",
|
|
397
|
-
_("div",
|
|
398
|
-
_("div",
|
|
396
|
+
_("div", xn, [
|
|
397
|
+
_("div", Sn, ie(c.label), 1),
|
|
398
|
+
_("div", En, ie(c.description), 1)
|
|
399
399
|
])
|
|
400
|
-
], 10,
|
|
400
|
+
], 10, Cn))), 256))
|
|
401
401
|
]));
|
|
402
402
|
}
|
|
403
|
-
},
|
|
403
|
+
}, Tn = /* @__PURE__ */ q(An, [["__scopeId", "data-v-8afd7fbb"]]), Fn = {
|
|
404
404
|
key: 0,
|
|
405
405
|
class: "linked-style-buttons"
|
|
406
|
-
},
|
|
406
|
+
}, In = ["onClick"], Ln = {
|
|
407
407
|
__name: "LinkedStyle",
|
|
408
408
|
props: {
|
|
409
409
|
editor: {
|
|
410
410
|
type: Object,
|
|
411
411
|
required: !0
|
|
412
|
+
},
|
|
413
|
+
selectedOption: {
|
|
414
|
+
type: String
|
|
412
415
|
}
|
|
413
416
|
},
|
|
414
417
|
emits: ["select"],
|
|
@@ -416,20 +419,20 @@ const x = (e) => {
|
|
|
416
419
|
const t = s, n = e, o = (i) => {
|
|
417
420
|
t("select", i);
|
|
418
421
|
};
|
|
419
|
-
return (i, c) => n.editor ? (C(), k("div",
|
|
420
|
-
(C(!0), k(U, null,
|
|
421
|
-
class: "style-item",
|
|
422
|
+
return (i, c) => n.editor ? (C(), k("div", Fn, [
|
|
423
|
+
(C(!0), k(U, null, ne(M(Je)(e.editor), (a) => (C(), k("div", {
|
|
424
|
+
class: te(["style-item", { selected: e.selectedOption === a.id }]),
|
|
422
425
|
onClick: (l) => o(a)
|
|
423
426
|
}, [
|
|
424
427
|
_("div", {
|
|
425
428
|
class: "style-name",
|
|
426
|
-
style: Q(M(
|
|
429
|
+
style: Q(M(_t)(a, null, !1)),
|
|
427
430
|
"data-item": "btn-linkedStyles-option"
|
|
428
431
|
}, ie(a.definition.attrs.name), 5)
|
|
429
|
-
],
|
|
432
|
+
], 10, In))), 256))
|
|
430
433
|
])) : ee("", !0);
|
|
431
434
|
}
|
|
432
|
-
},
|
|
435
|
+
}, Mn = /* @__PURE__ */ q(Ln, [["__scopeId", "data-v-bf5a8c1e"]]), Dn = ["onClick"], Hn = ["innerHTML"], Bn = ["innerHTML"], $n = {
|
|
433
436
|
__name: "IconGridRow",
|
|
434
437
|
props: {
|
|
435
438
|
icons: {
|
|
@@ -448,11 +451,11 @@ const x = (e) => {
|
|
|
448
451
|
};
|
|
449
452
|
return Ce(() => {
|
|
450
453
|
if (!n.icons.every((l) => Array.isArray(l))) throw new Error("icon props must be 2d array");
|
|
451
|
-
}), (a, l) => (C(!0), k(U, null,
|
|
454
|
+
}), (a, l) => (C(!0), k(U, null, ne(e.icons, (d, u) => (C(), k("div", {
|
|
452
455
|
class: "option-row",
|
|
453
456
|
key: u
|
|
454
457
|
}, [
|
|
455
|
-
(C(!0), k(U, null,
|
|
458
|
+
(C(!0), k(U, null, ne(d, (r, w) => (C(), k("div", {
|
|
456
459
|
class: "option",
|
|
457
460
|
key: w,
|
|
458
461
|
onClick: he((v) => c(r), ["stop", "prevent"])
|
|
@@ -461,18 +464,18 @@ const x = (e) => {
|
|
|
461
464
|
class: "option__icon",
|
|
462
465
|
innerHTML: r.icon,
|
|
463
466
|
style: Q(r.style)
|
|
464
|
-
}, null, 12,
|
|
467
|
+
}, null, 12, Hn),
|
|
465
468
|
o.value(r) ? (C(), k("div", {
|
|
466
469
|
key: 0,
|
|
467
470
|
class: "option__check",
|
|
468
471
|
innerHTML: M(Z).colorOptionCheck,
|
|
469
472
|
style: Q(i(r.value, w))
|
|
470
473
|
}, null, 12, Bn)) : ee("", !0)
|
|
471
|
-
], 8,
|
|
474
|
+
], 8, Dn))), 128))
|
|
472
475
|
]))), 128));
|
|
473
476
|
}
|
|
474
|
-
},
|
|
475
|
-
`,
|
|
477
|
+
}, Ye = /* @__PURE__ */ q($n, [["__scopeId", "data-v-6a2a9a40"]]), zn = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M320 512c53.2 0 101.4-21.6 136.1-56.6l-298.3-235C140 257.1 128 292.3 128 320c0 106 86 192 192 192zM505.2 370.7c4.4-16.2 6.8-33.1 6.8-50.7c0-91.2-130.2-262.3-166.6-308.3C339.4 4.2 330.5 0 320.9 0l-1.8 0c-9.6 0-18.5 4.2-24.5 11.7C277.8 33 240.7 81.3 205.8 136L38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L505.2 370.7zM224 336c0 44.2 35.8 80 80 80c8.8 0 16 7.2 16 16s-7.2 16-16 16c-61.9 0-112-50.1-112-112c0-8.8 7.2-16 16-16s16 7.2 16 16z"/></svg>
|
|
478
|
+
`, Rn = { class: "options-grid-wrap" }, On = ["innerHTML"], Nn = { class: "option-grid-ctn" }, Wn = {
|
|
476
479
|
__name: "IconGrid",
|
|
477
480
|
props: {
|
|
478
481
|
icons: {
|
|
@@ -497,27 +500,27 @@ const x = (e) => {
|
|
|
497
500
|
const t = s, n = (o) => {
|
|
498
501
|
t("select", o);
|
|
499
502
|
};
|
|
500
|
-
return (o, i) => (C(), k("div",
|
|
503
|
+
return (o, i) => (C(), k("div", Rn, [
|
|
501
504
|
e.hasNoneIcon ? (C(), k("div", {
|
|
502
505
|
key: 0,
|
|
503
506
|
class: "none-option",
|
|
504
507
|
onClick: i[0] || (i[0] = (c) => n("none"))
|
|
505
508
|
}, [
|
|
506
509
|
_("span", {
|
|
507
|
-
innerHTML: M(
|
|
510
|
+
innerHTML: M(zn),
|
|
508
511
|
class: "none-icon"
|
|
509
|
-
}, null, 8,
|
|
510
|
-
i[1] || (i[1] =
|
|
512
|
+
}, null, 8, On),
|
|
513
|
+
i[1] || (i[1] = ot(" None "))
|
|
511
514
|
])) : ee("", !0),
|
|
512
|
-
_("div",
|
|
513
|
-
P(
|
|
515
|
+
_("div", Nn, [
|
|
516
|
+
P(Ye, {
|
|
514
517
|
icons: e.icons,
|
|
515
518
|
"active-color": e.activeColor,
|
|
516
519
|
onSelect: n
|
|
517
520
|
}, null, 8, ["icons", "active-color"]),
|
|
518
521
|
e.customIcons.flat().length ? (C(), k(U, { key: 0 }, [
|
|
519
522
|
i[2] || (i[2] = _("span", { class: "option-grid-ctn__subtitle" }, "Custom colors", -1)),
|
|
520
|
-
P(
|
|
523
|
+
P(Ye, {
|
|
521
524
|
icons: e.customIcons,
|
|
522
525
|
"active-color": e.activeColor,
|
|
523
526
|
onSelect: n
|
|
@@ -526,7 +529,7 @@ const x = (e) => {
|
|
|
526
529
|
])
|
|
527
530
|
]));
|
|
528
531
|
}
|
|
529
|
-
},
|
|
532
|
+
}, Vn = /* @__PURE__ */ q(Wn, [["__scopeId", "data-v-47b783db"]]), Pn = (e) => {
|
|
530
533
|
e.expand.value = !1;
|
|
531
534
|
}, f = (e, s = null) => ({
|
|
532
535
|
label: s,
|
|
@@ -539,18 +542,18 @@ const x = (e) => {
|
|
|
539
542
|
}
|
|
540
543
|
}), We = (e, s, t = [], n = !1) => {
|
|
541
544
|
const o = (i) => {
|
|
542
|
-
s.iconColor.value = i, e.emitCommand({ item: s, argument: i }),
|
|
545
|
+
s.iconColor.value = i, e.emitCommand({ item: s, argument: i }), Pn(s);
|
|
543
546
|
};
|
|
544
547
|
return $("div", {}, [
|
|
545
|
-
$(
|
|
546
|
-
icons:
|
|
548
|
+
$(Vn, {
|
|
549
|
+
icons: lt,
|
|
547
550
|
customIcons: t,
|
|
548
551
|
activeColor: s.iconColor,
|
|
549
552
|
hasNoneIcon: n,
|
|
550
553
|
onSelect: o
|
|
551
554
|
})
|
|
552
555
|
]);
|
|
553
|
-
},
|
|
556
|
+
}, lt = [
|
|
554
557
|
[
|
|
555
558
|
f("#111111"),
|
|
556
559
|
f("#333333"),
|
|
@@ -623,7 +626,7 @@ const x = (e) => {
|
|
|
623
626
|
f("#DFCDF2"),
|
|
624
627
|
f("#A91DFF")
|
|
625
628
|
]
|
|
626
|
-
],
|
|
629
|
+
], jn = () => lt.flat().map((e) => e.value), Un = { class: "toolbar-table-grid-wrapper" }, qn = ["data-cols", "data-rows", "onClick"], Gn = { class: "toolbar-table-grid-value" }, Kn = {
|
|
627
630
|
__name: "TableGrid",
|
|
628
631
|
emits: ["select", "clickoutside"],
|
|
629
632
|
setup(e, { emit: s }) {
|
|
@@ -640,27 +643,27 @@ const x = (e) => {
|
|
|
640
643
|
}, c = ({ cols: a, rows: l }) => {
|
|
641
644
|
t("select", { cols: a, rows: l });
|
|
642
645
|
};
|
|
643
|
-
return (a, l) => (C(), k("div",
|
|
646
|
+
return (a, l) => (C(), k("div", Un, [
|
|
644
647
|
_("div", {
|
|
645
648
|
class: "toolbar-table-grid",
|
|
646
649
|
onMouseover: i,
|
|
647
650
|
"data-grid": "true"
|
|
648
651
|
}, [
|
|
649
|
-
(C(), k(U, null,
|
|
650
|
-
(C(), k(U, null,
|
|
652
|
+
(C(), k(U, null, ne(5, (d) => (C(), k(U, { key: d }, [
|
|
653
|
+
(C(), k(U, null, ne(5, (u) => _("div", {
|
|
651
654
|
class: "toolbar-table-grid__item",
|
|
652
655
|
key: `${d}_${u}`,
|
|
653
656
|
"data-cols": u,
|
|
654
657
|
"data-rows": d,
|
|
655
658
|
"data-item": "true",
|
|
656
659
|
onClick: he((r) => c({ cols: u, rows: d }), ["stop", "prevent"])
|
|
657
|
-
}, null, 8,
|
|
660
|
+
}, null, 8, qn)), 64))
|
|
658
661
|
], 64))), 64))
|
|
659
662
|
], 32),
|
|
660
|
-
_("div",
|
|
663
|
+
_("div", Gn, ie(n.value) + " x " + ie(o.value), 1)
|
|
661
664
|
]));
|
|
662
665
|
}
|
|
663
|
-
},
|
|
666
|
+
}, Xn = /* @__PURE__ */ q(Kn, [["__scopeId", "data-v-06352ab9"]]), Zn = { class: "toolbar-table-actions" }, Yn = ["onClick", "data-item"], Jn = { class: "toolbar-table-actions__icon" }, Qn = ["innerHTML"], eo = { class: "toolbar-table-actions__label" }, to = {
|
|
664
667
|
__name: "TableActions",
|
|
665
668
|
props: {
|
|
666
669
|
options: {
|
|
@@ -672,24 +675,24 @@ const x = (e) => {
|
|
|
672
675
|
const t = s, n = (o) => {
|
|
673
676
|
t("select", { command: o.command });
|
|
674
677
|
};
|
|
675
|
-
return (o, i) => (C(), k("div",
|
|
676
|
-
(C(!0), k(U, null,
|
|
677
|
-
class:
|
|
678
|
+
return (o, i) => (C(), k("div", Zn, [
|
|
679
|
+
(C(!0), k(U, null, ne(e.options, (c) => (C(), k("div", {
|
|
680
|
+
class: te(["toolbar-table-actions__item", { "toolbar-table-actions__item--border": c.bottomBorder }]),
|
|
678
681
|
onClick: (a) => n(c),
|
|
679
682
|
"data-item": c.props?.["data-item"] || ""
|
|
680
683
|
}, [
|
|
681
|
-
_("div",
|
|
684
|
+
_("div", Jn, [
|
|
682
685
|
_("div", {
|
|
683
686
|
class: "toolbar-table-actions__icon-wrapper",
|
|
684
687
|
innerHTML: c.icon
|
|
685
|
-
}, null, 8,
|
|
688
|
+
}, null, 8, Qn)
|
|
686
689
|
]),
|
|
687
|
-
_("div",
|
|
688
|
-
], 10,
|
|
690
|
+
_("div", eo, ie(c.label), 1)
|
|
691
|
+
], 10, Yn))), 256))
|
|
689
692
|
]));
|
|
690
693
|
}
|
|
691
|
-
},
|
|
692
|
-
`,
|
|
694
|
+
}, no = /* @__PURE__ */ q(to, [["__scopeId", "data-v-fdbfb4b0"]]), oo = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"/></svg>
|
|
695
|
+
`, io = { class: "search-input-ctn" }, so = { class: "row" }, ao = ["onKeydown"], lo = {
|
|
693
696
|
__name: "SearchInput",
|
|
694
697
|
props: {
|
|
695
698
|
searchRef: {
|
|
@@ -701,18 +704,18 @@ const x = (e) => {
|
|
|
701
704
|
const t = h(""), n = s, o = () => {
|
|
702
705
|
n("submit", { value: t.value });
|
|
703
706
|
};
|
|
704
|
-
return (i, c) => (C(), k("div",
|
|
705
|
-
_("div",
|
|
706
|
-
|
|
707
|
+
return (i, c) => (C(), k("div", io, [
|
|
708
|
+
_("div", so, [
|
|
709
|
+
et(_("input", {
|
|
707
710
|
ref: e.searchRef,
|
|
708
711
|
"onUpdate:modelValue": c[0] || (c[0] = (a) => t.value = a),
|
|
709
712
|
class: "search-input",
|
|
710
713
|
type: "text",
|
|
711
714
|
name: "search",
|
|
712
715
|
placeholder: "Type search string",
|
|
713
|
-
onKeydown:
|
|
714
|
-
}, null, 40,
|
|
715
|
-
[
|
|
716
|
+
onKeydown: tt(he(o, ["stop", "prevent"]), ["enter"])
|
|
717
|
+
}, null, 40, ao), [
|
|
718
|
+
[nt, t.value]
|
|
716
719
|
])
|
|
717
720
|
]),
|
|
718
721
|
_("div", { class: "row submit" }, [
|
|
@@ -723,7 +726,7 @@ const x = (e) => {
|
|
|
723
726
|
])
|
|
724
727
|
]));
|
|
725
728
|
}
|
|
726
|
-
},
|
|
729
|
+
}, ro = /* @__PURE__ */ q(lo, [["__scopeId", "data-v-af870fbd"]]), co = [
|
|
727
730
|
{
|
|
728
731
|
label: "Georgia",
|
|
729
732
|
key: "Georgia, serif",
|
|
@@ -762,7 +765,7 @@ const x = (e) => {
|
|
|
762
765
|
}
|
|
763
766
|
], re = (e) => {
|
|
764
767
|
e.expand.value = !1;
|
|
765
|
-
},
|
|
768
|
+
}, uo = ({
|
|
766
769
|
superToolbar: e,
|
|
767
770
|
toolbarIcons: s,
|
|
768
771
|
toolbarFonts: t,
|
|
@@ -790,7 +793,7 @@ const x = (e) => {
|
|
|
790
793
|
isWide: !0,
|
|
791
794
|
style: { width: "116px" },
|
|
792
795
|
suppressActiveHighlight: !0,
|
|
793
|
-
options: [...t ||
|
|
796
|
+
options: [...t || co],
|
|
794
797
|
onActivate: ({ fontFamily: m }) => {
|
|
795
798
|
m && (l.label.value = m);
|
|
796
799
|
},
|
|
@@ -815,14 +818,14 @@ const x = (e) => {
|
|
|
815
818
|
render: () => {
|
|
816
819
|
let m = "";
|
|
817
820
|
if (e.activeEditor) {
|
|
818
|
-
const { state: A } = e.activeEditor, { from: V, to: le, empty:
|
|
819
|
-
m =
|
|
821
|
+
const { state: A } = e.activeEditor, { from: V, to: le, empty: wt } = A.selection;
|
|
822
|
+
m = wt ? "" : A.doc.textBetween(V, le);
|
|
820
823
|
}
|
|
821
824
|
return $(
|
|
822
825
|
"div",
|
|
823
826
|
{},
|
|
824
827
|
[
|
|
825
|
-
$(
|
|
828
|
+
$(Gt, {
|
|
826
829
|
handleClose: () => {
|
|
827
830
|
re(d);
|
|
828
831
|
},
|
|
@@ -870,7 +873,7 @@ const x = (e) => {
|
|
|
870
873
|
],
|
|
871
874
|
onActivate: ({ fontSize: m }) => {
|
|
872
875
|
if (!m) return u.label.value = u.defaultLabel.value;
|
|
873
|
-
let E =
|
|
876
|
+
let E = Ut(m, 12);
|
|
874
877
|
E < 8 && (E = 8), E > 96 && (E = 96), u.label.value = String(E);
|
|
875
878
|
},
|
|
876
879
|
onDeactivate: () => u.label.value = u.defaultLabel.value
|
|
@@ -948,7 +951,7 @@ const x = (e) => {
|
|
|
948
951
|
}
|
|
949
952
|
]
|
|
950
953
|
}), D = () => $("div", {}, [
|
|
951
|
-
$(
|
|
954
|
+
$(ro, {
|
|
952
955
|
onSubmit: ({ value: E }) => {
|
|
953
956
|
e.activeEditor.commands.search(E);
|
|
954
957
|
},
|
|
@@ -976,7 +979,7 @@ const x = (e) => {
|
|
|
976
979
|
});
|
|
977
980
|
function S(m) {
|
|
978
981
|
return $("div", {}, [
|
|
979
|
-
$(
|
|
982
|
+
$(yn, {
|
|
980
983
|
onSubmit: ({ href: A }) => {
|
|
981
984
|
re(m), m.attributes.value.link = { href: A };
|
|
982
985
|
const V = { ...m, command: "toggleLink" };
|
|
@@ -986,7 +989,7 @@ const x = (e) => {
|
|
|
986
989
|
goToAnchor: () => {
|
|
987
990
|
if (re(m), !e.activeEditor || !m.attributes.value?.href) return;
|
|
988
991
|
const A = m.attributes.value?.href?.slice(1), le = e.activeEditor.element.querySelector(`a[name='${A}']`);
|
|
989
|
-
le &&
|
|
992
|
+
le && Yt(le);
|
|
990
993
|
}
|
|
991
994
|
})
|
|
992
995
|
]);
|
|
@@ -1017,13 +1020,13 @@ const x = (e) => {
|
|
|
1017
1020
|
{
|
|
1018
1021
|
key: "table",
|
|
1019
1022
|
type: "render",
|
|
1020
|
-
render: () =>
|
|
1023
|
+
render: () => oe(W)
|
|
1021
1024
|
}
|
|
1022
1025
|
]
|
|
1023
1026
|
});
|
|
1024
|
-
function
|
|
1027
|
+
function oe(m) {
|
|
1025
1028
|
return $("div", {}, [
|
|
1026
|
-
$(
|
|
1029
|
+
$(Xn, {
|
|
1027
1030
|
onSelect: (A) => {
|
|
1028
1031
|
e.emitCommand({ item: m, argument: A }), re(m);
|
|
1029
1032
|
}
|
|
@@ -1114,7 +1117,7 @@ const x = (e) => {
|
|
|
1114
1117
|
}
|
|
1115
1118
|
];
|
|
1116
1119
|
function ge(m) {
|
|
1117
|
-
return $(
|
|
1120
|
+
return $(no, {
|
|
1118
1121
|
options: ve,
|
|
1119
1122
|
onSelect: (E) => {
|
|
1120
1123
|
re(m);
|
|
@@ -1137,7 +1140,7 @@ const x = (e) => {
|
|
|
1137
1140
|
{
|
|
1138
1141
|
type: "render",
|
|
1139
1142
|
render: () => $("div", {}, [
|
|
1140
|
-
$(
|
|
1143
|
+
$(sn, {
|
|
1141
1144
|
onSelect: (E) => {
|
|
1142
1145
|
re(Y);
|
|
1143
1146
|
const A = { ...Y, command: "setTextAlign" };
|
|
@@ -1162,13 +1165,13 @@ const x = (e) => {
|
|
|
1162
1165
|
justify: s.alignJustify
|
|
1163
1166
|
}, le = V[A] ?? V.left;
|
|
1164
1167
|
m.icon.value = le;
|
|
1165
|
-
},
|
|
1168
|
+
}, H = x({
|
|
1166
1169
|
type: "button",
|
|
1167
1170
|
name: "list",
|
|
1168
1171
|
command: "toggleBulletList",
|
|
1169
1172
|
icon: s.bulletList,
|
|
1170
1173
|
tooltip: "Bullet list"
|
|
1171
|
-
}),
|
|
1174
|
+
}), B = x({
|
|
1172
1175
|
type: "button",
|
|
1173
1176
|
name: "numberedlist",
|
|
1174
1177
|
command: "toggleOrderedList",
|
|
@@ -1349,7 +1352,7 @@ const x = (e) => {
|
|
|
1349
1352
|
];
|
|
1350
1353
|
function ye(m) {
|
|
1351
1354
|
const E = Se(i, ae);
|
|
1352
|
-
return $(
|
|
1355
|
+
return $(Tn, {
|
|
1353
1356
|
options: E,
|
|
1354
1357
|
onSelect: (A) => {
|
|
1355
1358
|
re(m);
|
|
@@ -1358,7 +1361,7 @@ const x = (e) => {
|
|
|
1358
1361
|
}
|
|
1359
1362
|
});
|
|
1360
1363
|
}
|
|
1361
|
-
const
|
|
1364
|
+
const mt = x({
|
|
1362
1365
|
type: "button",
|
|
1363
1366
|
name: "pageBreakTool",
|
|
1364
1367
|
command: "insertPageBreak",
|
|
@@ -1374,13 +1377,13 @@ const x = (e) => {
|
|
|
1374
1377
|
["documentMode", 47],
|
|
1375
1378
|
["ai", 32],
|
|
1376
1379
|
["default", 32]
|
|
1377
|
-
]),
|
|
1380
|
+
]), pt = x({
|
|
1378
1381
|
type: "button",
|
|
1379
1382
|
name: "ruler",
|
|
1380
1383
|
command: "toggleRuler",
|
|
1381
1384
|
icon: s.ruler,
|
|
1382
1385
|
tooltip: "Show or hide ruler"
|
|
1383
|
-
}), we = x({
|
|
1386
|
+
}), Ue = h(null), we = x({
|
|
1384
1387
|
type: "dropdown",
|
|
1385
1388
|
name: "linkedStyles",
|
|
1386
1389
|
command: "setLinkedStyle",
|
|
@@ -1403,12 +1406,13 @@ const x = (e) => {
|
|
|
1403
1406
|
const m = (E) => {
|
|
1404
1407
|
re(we);
|
|
1405
1408
|
const A = { ...we, command: "setLinkedStyle" };
|
|
1406
|
-
e.emitCommand({ item: A, argument: E });
|
|
1409
|
+
e.emitCommand({ item: A, argument: E }), Ue.value = E.id;
|
|
1407
1410
|
};
|
|
1408
1411
|
return $("div", {}, [
|
|
1409
|
-
$(
|
|
1412
|
+
$(Mn, {
|
|
1410
1413
|
editor: e.activeEditor,
|
|
1411
|
-
onSelect: m
|
|
1414
|
+
onSelect: m,
|
|
1415
|
+
selectedOption: Ue.value
|
|
1412
1416
|
})
|
|
1413
1417
|
]);
|
|
1414
1418
|
}
|
|
@@ -1422,7 +1426,7 @@ const x = (e) => {
|
|
|
1422
1426
|
}
|
|
1423
1427
|
}), me = (m, E) => {
|
|
1424
1428
|
if (E.value.toString() === m)
|
|
1425
|
-
return $("div", { innerHTML:
|
|
1429
|
+
return $("div", { innerHTML: oo, class: "dropdown-select-icon" });
|
|
1426
1430
|
}, de = x({
|
|
1427
1431
|
type: "dropdown",
|
|
1428
1432
|
name: "lineHeight",
|
|
@@ -1444,11 +1448,11 @@ const x = (e) => {
|
|
|
1444
1448
|
{ label: "2,5", key: "2.5", icon: () => me("2.5", de.selectedValue), props: { "data-item": "btn-lineHeight-option" } },
|
|
1445
1449
|
{ label: "3,0", key: "3", icon: () => me("3", de.selectedValue), props: { "data-item": "btn-lineHeight-option" } }
|
|
1446
1450
|
]
|
|
1447
|
-
}),
|
|
1451
|
+
}), He = {
|
|
1448
1452
|
sm: 768,
|
|
1449
1453
|
md: 1024,
|
|
1450
1454
|
xl: 1410
|
|
1451
|
-
},
|
|
1455
|
+
}, ft = 120, ht = 32, vt = ["linkedStyles", "clearFormatting", "copyFormat", "ruler"], gt = ["zoom", "fontFamily", "fontSize", "redo"];
|
|
1452
1456
|
let R = [
|
|
1453
1457
|
se,
|
|
1454
1458
|
ke,
|
|
@@ -1475,58 +1479,58 @@ const x = (e) => {
|
|
|
1475
1479
|
ue,
|
|
1476
1480
|
r,
|
|
1477
1481
|
Y,
|
|
1478
|
-
B,
|
|
1479
1482
|
H,
|
|
1483
|
+
B,
|
|
1480
1484
|
z,
|
|
1481
1485
|
G,
|
|
1482
1486
|
de,
|
|
1483
1487
|
r,
|
|
1484
1488
|
we,
|
|
1485
1489
|
r,
|
|
1490
|
+
pt,
|
|
1486
1491
|
mt,
|
|
1487
|
-
ut,
|
|
1488
1492
|
xe,
|
|
1489
1493
|
De,
|
|
1490
1494
|
d,
|
|
1491
1495
|
K,
|
|
1492
1496
|
X
|
|
1493
1497
|
];
|
|
1494
|
-
if (e.config?.superdoc?.config?.modules?.ai || (R = R.filter((m) => m.name.value !== "ai")), o <=
|
|
1498
|
+
if (e.config?.superdoc?.config?.modules?.ai || (R = R.filter((m) => m.name.value !== "ai")), o <= He.md && n && (R = R.filter((m) => m.type !== "separator")), e.config.pagination || (R = R.filter((m) => m.name.value !== "pageBreakTool")), e.config.mode !== "docx") {
|
|
1495
1499
|
const m = R.findIndex((A) => A.name.value === "linkedStyles");
|
|
1496
1500
|
R.splice(m - 1, 2);
|
|
1497
1501
|
const E = ["ruler", "zoom", "undo", "redo"];
|
|
1498
1502
|
R = R.filter((A) => !E.includes(A.name.value));
|
|
1499
1503
|
}
|
|
1500
|
-
const
|
|
1501
|
-
c || (i === "viewer" &&
|
|
1502
|
-
const
|
|
1503
|
-
let $e =
|
|
1504
|
+
const qe = [Ie, Le, Me];
|
|
1505
|
+
c || (i === "viewer" && qe.push(be, _e), R = R.filter((m) => !qe.includes(m)));
|
|
1506
|
+
const bt = [L, se, K, X].map((m) => m.name), yt = (m) => bt.includes(m.name), Ae = [], Be = [];
|
|
1507
|
+
let $e = ht + ft;
|
|
1504
1508
|
return R.forEach((m) => {
|
|
1505
1509
|
const E = je.get(m.name.value) || je.get("default");
|
|
1506
|
-
if (o <
|
|
1510
|
+
if (o < He.xl && vt.includes(m.name.value) && n) {
|
|
1507
1511
|
if (Ae.push(m), m.name.value === "linkedStyles") {
|
|
1508
1512
|
const A = R.findIndex((V) => V.name.value === "linkedStyles");
|
|
1509
1513
|
R.splice(A + 1, 1);
|
|
1510
1514
|
}
|
|
1511
1515
|
return;
|
|
1512
1516
|
}
|
|
1513
|
-
if (o <
|
|
1517
|
+
if (o < He.sm && gt.includes(m.name.value) && n) {
|
|
1514
1518
|
Ae.push(m);
|
|
1515
1519
|
return;
|
|
1516
1520
|
}
|
|
1517
|
-
if (
|
|
1518
|
-
|
|
1521
|
+
if (yt(m)) {
|
|
1522
|
+
Be.push(m), $e += E;
|
|
1519
1523
|
return;
|
|
1520
1524
|
}
|
|
1521
|
-
$e < o || !n ? (
|
|
1525
|
+
$e < o || !n ? (Be.push(m), $e += E) : Ae.push(m);
|
|
1522
1526
|
}), {
|
|
1523
|
-
defaultItems:
|
|
1527
|
+
defaultItems: Be,
|
|
1524
1528
|
overflowItems: Ae.filter((m) => m.type !== "separator")
|
|
1525
1529
|
};
|
|
1526
|
-
},
|
|
1530
|
+
}, mo = [".jpg", ".jpeg", ".png", "image/jpeg", "image/png"], po = () => {
|
|
1527
1531
|
let e = document.createElement("input");
|
|
1528
1532
|
e.type = "file";
|
|
1529
|
-
let s =
|
|
1533
|
+
let s = mo;
|
|
1530
1534
|
return e.accept = s.join(","), () => new Promise((n, o) => {
|
|
1531
1535
|
e.onchange = async () => {
|
|
1532
1536
|
const i = e.files;
|
|
@@ -1535,13 +1539,13 @@ const x = (e) => {
|
|
|
1535
1539
|
return n(c ? { file: c } : null);
|
|
1536
1540
|
}, e.oncancel = () => n(null), e.onerror = o, e.click();
|
|
1537
1541
|
});
|
|
1538
|
-
},
|
|
1542
|
+
}, fo = (e) => new Promise((s, t) => {
|
|
1539
1543
|
let n = new FileReader();
|
|
1540
1544
|
n.onload = (o) => s(o.target.result), n.onerror = t, setTimeout(() => n.readAsDataURL(e), 250);
|
|
1541
|
-
}),
|
|
1545
|
+
}), ho = (e, s) => new Promise((t, n) => {
|
|
1542
1546
|
const o = new window.Image();
|
|
1543
1547
|
o.onload = () => {
|
|
1544
|
-
const i = document.createElement("canvas"), { width: c, height: a } =
|
|
1548
|
+
const i = document.createElement("canvas"), { width: c, height: a } = vo(
|
|
1545
1549
|
o.width,
|
|
1546
1550
|
o.height,
|
|
1547
1551
|
s
|
|
@@ -1558,21 +1562,21 @@ const x = (e) => {
|
|
|
1558
1562
|
t({ file: u, width: c, height: a });
|
|
1559
1563
|
});
|
|
1560
1564
|
}, o.onerror = (i) => n(i), o.src = typeof e == "string" ? e : URL.createObjectURL(e);
|
|
1561
|
-
}),
|
|
1565
|
+
}), vo = (e, s, t) => {
|
|
1562
1566
|
const { width: n, height: o } = t.getMaxContentSize();
|
|
1563
1567
|
if (!n || !o) return { width: e, height: s };
|
|
1564
1568
|
let i = e, c = s;
|
|
1565
1569
|
const a = e / s;
|
|
1566
1570
|
return s > o && (c = o, i = Math.round(o * a)), i > n && (i = n, c = Math.round(n / a)), { width: i, height: c };
|
|
1567
|
-
},
|
|
1568
|
-
let n = typeof e.options.handleImageUpload == "function" ? e.options.handleImageUpload :
|
|
1571
|
+
}, go = async ({ editor: e, view: s, file: t }) => {
|
|
1572
|
+
let n = typeof e.options.handleImageUpload == "function" ? e.options.handleImageUpload : fo;
|
|
1569
1573
|
if ((t.size / (1024 * 1024)).toFixed(4) > 5) {
|
|
1570
1574
|
window.alert("Image size must be less than 5MB");
|
|
1571
1575
|
return;
|
|
1572
1576
|
}
|
|
1573
1577
|
let i, c;
|
|
1574
1578
|
try {
|
|
1575
|
-
const r = await
|
|
1579
|
+
const r = await ho(t, e);
|
|
1576
1580
|
i = r.width, c = r.height, t = r.file;
|
|
1577
1581
|
} catch (r) {
|
|
1578
1582
|
console.warn("Error processing image:", r);
|
|
@@ -1587,7 +1591,7 @@ const x = (e) => {
|
|
|
1587
1591
|
};
|
|
1588
1592
|
l.setMeta(Oe, u), s.dispatch(l), n(t).then(
|
|
1589
1593
|
(r) => {
|
|
1590
|
-
let w = t.name.replace(" ", "_"), v =
|
|
1594
|
+
let w = t.name.replace(" ", "_"), v = xt(s.state, a);
|
|
1591
1595
|
if (v == null)
|
|
1592
1596
|
return;
|
|
1593
1597
|
let b = { type: "remove", id: a }, y = `word/media/${w}`, g = d.nodes.image.create({
|
|
@@ -1604,8 +1608,8 @@ const x = (e) => {
|
|
|
1604
1608
|
}
|
|
1605
1609
|
);
|
|
1606
1610
|
};
|
|
1607
|
-
var I,
|
|
1608
|
-
class
|
|
1611
|
+
var I, rt, fe, Ve, ct, dt, Pe, ut, pe;
|
|
1612
|
+
class $o extends Xt {
|
|
1609
1613
|
/**
|
|
1610
1614
|
* Creates a new SuperToolbar instance
|
|
1611
1615
|
* @param {ToolbarConfig} config - The configuration for the toolbar
|
|
@@ -1730,8 +1734,8 @@ class Ho extends Kt {
|
|
|
1730
1734
|
* @returns {Promise<void>}
|
|
1731
1735
|
*/
|
|
1732
1736
|
startImageUpload: async (t = null) => {
|
|
1733
|
-
let o = await
|
|
1734
|
-
o?.file &&
|
|
1737
|
+
let o = await po()();
|
|
1738
|
+
o?.file && go({
|
|
1735
1739
|
editor: this.activeEditor,
|
|
1736
1740
|
view: this.activeEditor.view,
|
|
1737
1741
|
file: o.file
|
|
@@ -1746,7 +1750,7 @@ class Ho extends Kt {
|
|
|
1746
1750
|
*/
|
|
1747
1751
|
increaseTextIndent: ({ item: t, argument: n }) => {
|
|
1748
1752
|
let o = t.command, { state: i } = this.activeEditor;
|
|
1749
|
-
if (
|
|
1753
|
+
if (Xe((a) => a.type.name === "listItem")(i.selection))
|
|
1750
1754
|
return this.activeEditor.commands.increaseListIndent();
|
|
1751
1755
|
o in this.activeEditor.commands && this.activeEditor.commands[o](n);
|
|
1752
1756
|
},
|
|
@@ -1759,7 +1763,7 @@ class Ho extends Kt {
|
|
|
1759
1763
|
*/
|
|
1760
1764
|
decreaseTextIndent: ({ item: t, argument: n }) => {
|
|
1761
1765
|
let o = t.command, { state: i } = this.activeEditor;
|
|
1762
|
-
if (
|
|
1766
|
+
if (Xe((a) => a.type.name === "listItem")(i.selection))
|
|
1763
1767
|
return this.activeEditor.commands.decreaseListIndent();
|
|
1764
1768
|
o in this.activeEditor.commands && this.activeEditor.commands[o](n);
|
|
1765
1769
|
},
|
|
@@ -1807,8 +1811,11 @@ class Ho extends Kt {
|
|
|
1807
1811
|
let o = t.command;
|
|
1808
1812
|
if (o in this.activeEditor.commands) {
|
|
1809
1813
|
this.activeEditor.commands[o](n);
|
|
1810
|
-
const { view: i } = this.activeEditor
|
|
1811
|
-
|
|
1814
|
+
const { view: i } = this.activeEditor;
|
|
1815
|
+
let { selection: c } = i.state;
|
|
1816
|
+
this.activeEditor.options.isHeaderOrFooter && (c = this.activeEditor.options.lastSelection);
|
|
1817
|
+
const a = c.$to.pos, l = new Qe(i.state.doc.resolve(a)), d = i.state.tr.setSelection(l), u = i.state.apply(d);
|
|
1818
|
+
i.updateState(u), this.activeEditor.options.isHeaderOrFooter || setTimeout(() => {
|
|
1812
1819
|
i.focus();
|
|
1813
1820
|
}, 100);
|
|
1814
1821
|
}
|
|
@@ -1854,13 +1861,13 @@ class Ho extends Kt {
|
|
|
1854
1861
|
this.config = { ...this.config, ...t }, this.toolbarItems = [], this.overflowItems = [], this.documentMode = t.documentMode || "editing", this.isDev = t.isDev || !1, this.superdoc = t.superdoc, this.role = t.role || "editor", this.toolbarContainer = null, this.config.editor && (this.config.mode = this.config.editor.options.mode), this.config.icons = {
|
|
1855
1862
|
...Z,
|
|
1856
1863
|
...t.icons
|
|
1857
|
-
}, this.config.hideButtons = t.hideButtons ?? !0, this.config.responsiveToContainer = t.responsiveToContainer ?? !1, !this.config.selector && this.config.element && (this.config.selector = this.config.element), this.toolbarContainer = this.getElementBySelector(this.config.selector), this.toolbarContainer && (N(this, I,
|
|
1864
|
+
}, this.config.hideButtons = t.hideButtons ?? !0, this.config.responsiveToContainer = t.responsiveToContainer ?? !1, !this.config.selector && this.config.element && (this.config.selector = this.config.element), this.toolbarContainer = this.getElementBySelector(this.config.selector), this.toolbarContainer && (N(this, I, rt).call(this), N(this, I, Ve).call(this, {
|
|
1858
1865
|
superToolbar: this,
|
|
1859
1866
|
icons: this.config.icons,
|
|
1860
1867
|
fonts: this.config.fonts,
|
|
1861
1868
|
hideButtons: this.config.hideButtons,
|
|
1862
1869
|
isDev: t.isDev
|
|
1863
|
-
}), this.app =
|
|
1870
|
+
}), this.app = Vt(qt), this.app.directive("click-outside", Rt), this.app.config.globalProperties.$toolbar = this, this.toolbarContainer && (this.toolbar = this.app.mount(this.toolbarContainer)), this.activeEditor = t.editor || null, this.updateToolbarState());
|
|
1864
1871
|
}
|
|
1865
1872
|
getElementBySelector(t) {
|
|
1866
1873
|
let n = null;
|
|
@@ -1913,14 +1920,14 @@ class Ho extends Kt {
|
|
|
1913
1920
|
* @returns {void}
|
|
1914
1921
|
*/
|
|
1915
1922
|
updateToolbarState() {
|
|
1916
|
-
if (N(this, I,
|
|
1923
|
+
if (N(this, I, ut).call(this), N(this, I, ct).call(this), N(this, I, dt).call(this), !this.activeEditor || this.documentMode === "viewing") {
|
|
1917
1924
|
N(this, I, Pe).call(this);
|
|
1918
1925
|
return;
|
|
1919
1926
|
}
|
|
1920
|
-
const t =
|
|
1927
|
+
const t = St(this.activeEditor), n = Et(this.activeEditor.state);
|
|
1921
1928
|
this.toolbarItems.forEach((o) => {
|
|
1922
1929
|
if (o.resetDisabled(), o.name.value === "linkedStyles")
|
|
1923
|
-
return this.activeEditor && !
|
|
1930
|
+
return this.activeEditor && !Je(this.activeEditor).length ? o.deactivate() : o.activate();
|
|
1924
1931
|
const i = t.find((l) => l.name === o.name.value);
|
|
1925
1932
|
i ? o.activate(i.attrs) : o.deactivate();
|
|
1926
1933
|
const c = t.find((l) => l.name === "styleId");
|
|
@@ -1931,7 +1938,7 @@ class Ho extends Kt {
|
|
|
1931
1938
|
bold: "bold",
|
|
1932
1939
|
textAlign: "textAlign"
|
|
1933
1940
|
}, d = this.activeEditor.converter?.linkedStyles.find((u) => u.id === c.attrs.styleId);
|
|
1934
|
-
if (l[o.name.value] in d?.definition.styles) {
|
|
1941
|
+
if (d && l[o.name.value] in d?.definition.styles) {
|
|
1935
1942
|
const u = {
|
|
1936
1943
|
[o.name.value]: d?.definition.styles[l[o.name.value]]
|
|
1937
1944
|
};
|
|
@@ -1960,7 +1967,7 @@ class Ho extends Kt {
|
|
|
1960
1967
|
* @returns {*} The result of the executed command, undefined if no result is returned
|
|
1961
1968
|
*/
|
|
1962
1969
|
emitCommand({ item: t, argument: n, option: o }) {
|
|
1963
|
-
this.activeEditor
|
|
1970
|
+
this.activeEditor && !this.activeEditor.options.isHeaderOrFooter && this.activeEditor.focus();
|
|
1964
1971
|
const { command: i } = t;
|
|
1965
1972
|
if (i) {
|
|
1966
1973
|
if (this.log("(emmitCommand) Command:", i, `
|
|
@@ -1983,7 +1990,7 @@ I = new WeakSet(), /**
|
|
|
1983
1990
|
* @private
|
|
1984
1991
|
* @returns {void}
|
|
1985
1992
|
*/
|
|
1986
|
-
|
|
1993
|
+
rt = function() {
|
|
1987
1994
|
this.config.groups && !Array.isArray(this.config.groups) && Object.keys(this.config.groups).length && (this.config.toolbarGroups = Object.keys(this.config.groups));
|
|
1988
1995
|
}, fe = new WeakMap(), /**
|
|
1989
1996
|
* Create toolbar items based on configuration
|
|
@@ -2001,7 +2008,7 @@ Ve = function({
|
|
|
2001
2008
|
hideButtons: i,
|
|
2002
2009
|
isDev: c = !1
|
|
2003
2010
|
} = {}) {
|
|
2004
|
-
const a = document.documentElement.clientWidth, l = this.toolbarContainer.offsetWidth, d = this.config.responsiveToContainer ? l : a, { defaultItems: u, overflowItems: r } =
|
|
2011
|
+
const a = document.documentElement.clientWidth, l = this.toolbarContainer.offsetWidth, d = this.config.responsiveToContainer ? l : a, { defaultItems: u, overflowItems: r } = uo({
|
|
2005
2012
|
superToolbar: t,
|
|
2006
2013
|
toolbarIcons: n,
|
|
2007
2014
|
toolbarFonts: o,
|
|
@@ -2023,7 +2030,7 @@ Ve = function({
|
|
|
2023
2030
|
* @private
|
|
2024
2031
|
* @returns {void}
|
|
2025
2032
|
*/
|
|
2026
|
-
|
|
2033
|
+
ct = function() {
|
|
2027
2034
|
if (!this.activeEditor || !this.activeEditor.converter) return;
|
|
2028
2035
|
const { typeface: t = "Arial", fontSizePt: n = 12 } = this.activeEditor.converter.getDocumentDefaultStyles() ?? {}, o = this.toolbarItems.find((c) => c.name.value === "fontSize");
|
|
2029
2036
|
o && (o.defaultLabel.value = n);
|
|
@@ -2034,9 +2041,9 @@ rt = function() {
|
|
|
2034
2041
|
* @private
|
|
2035
2042
|
* @returns {void}
|
|
2036
2043
|
*/
|
|
2037
|
-
|
|
2044
|
+
dt = function() {
|
|
2038
2045
|
if (!this.activeEditor || !this.activeEditor.converter || !this.activeEditor.converter.docHiglightColors.size) return;
|
|
2039
|
-
const t = this.toolbarItems.find((a) => a.name.value === "highlight"), n =
|
|
2046
|
+
const t = this.toolbarItems.find((a) => a.name.value === "highlight"), n = jn(), o = 7, i = Array.from(this.activeEditor.converter.docHiglightColors).reduce((a, l, d) => {
|
|
2040
2047
|
const u = Math.floor(d / o);
|
|
2041
2048
|
return a[u] || (a[u] = []), n.includes(l) || a[u].push(f(l)), a;
|
|
2042
2049
|
}, []), c = {
|
|
@@ -2060,8 +2067,8 @@ Pe = function() {
|
|
|
2060
2067
|
* @private
|
|
2061
2068
|
* @returns {void}
|
|
2062
2069
|
*/
|
|
2063
|
-
|
|
2064
|
-
this.activeEditor && (this.undoDepth =
|
|
2070
|
+
ut = function() {
|
|
2071
|
+
this.activeEditor && (this.undoDepth = At(this.activeEditor.state), this.redoDepth = Tt(this.activeEditor.state));
|
|
2065
2072
|
}, /**
|
|
2066
2073
|
* Run a command that requires an argument
|
|
2067
2074
|
* @private
|
|
@@ -2082,7 +2089,7 @@ pe = function({ item: t, argument: n, noArgumentCallback: o = !1 }, i) {
|
|
|
2082
2089
|
}
|
|
2083
2090
|
c in this.activeEditor?.commands && (this.activeEditor.commands[c](n), typeof i == "function" && i(n), this.updateToolbarState());
|
|
2084
2091
|
};
|
|
2085
|
-
function
|
|
2092
|
+
function bo(e, s) {
|
|
2086
2093
|
if (!e.value || !s?.value?.options?.scale) return;
|
|
2087
2094
|
const t = s.value.options.scale, n = e.value.getBoundingClientRect(), o = e.value.querySelectorAll(".pagination-break-wrapper");
|
|
2088
2095
|
let i;
|
|
@@ -2094,7 +2101,7 @@ function go(e, s) {
|
|
|
2094
2101
|
}
|
|
2095
2102
|
});
|
|
2096
2103
|
}
|
|
2097
|
-
const
|
|
2104
|
+
const yo = (e, s) => {
|
|
2098
2105
|
const t = e.clientY, n = e.clientX, { view: o } = s, i = o.dom.getBoundingClientRect();
|
|
2099
2106
|
let c = {
|
|
2100
2107
|
left: 0,
|
|
@@ -2109,11 +2116,11 @@ const bo = (e, s) => {
|
|
|
2109
2116
|
d = v?.isText && y !== " " ? l - 1 : l;
|
|
2110
2117
|
}
|
|
2111
2118
|
const u = o.state.tr.setSelection(
|
|
2112
|
-
|
|
2119
|
+
Qe.create(o.state.doc, d)
|
|
2113
2120
|
);
|
|
2114
2121
|
o.dispatch(u), o.focus();
|
|
2115
2122
|
}
|
|
2116
|
-
},
|
|
2123
|
+
}, wo = { class: "numbering" }, Fe = 200, Co = "flex-end", ko = {
|
|
2117
2124
|
__name: "Ruler",
|
|
2118
2125
|
props: {
|
|
2119
2126
|
orientation: {
|
|
@@ -2131,22 +2138,22 @@ const bo = (e, s) => {
|
|
|
2131
2138
|
},
|
|
2132
2139
|
emits: ["margin-change"],
|
|
2133
2140
|
setup(e, { emit: s }) {
|
|
2134
|
-
const t = s, n = e, o = h(null), i = h([]), c = h("#CCCCCC"), a = h("#2563EB66"), l = h(null), d = h(null), u = h(!1), r = h(null), w =
|
|
2141
|
+
const t = s, n = e, o = h(null), i = h([]), c = h("#CCCCCC"), a = h("#2563EB66"), l = h(null), d = h(null), u = h(!1), r = h(null), w = Ze({ side: "left", x: 0 }), v = Ze({ side: "right", x: 0 }), b = h(!1), y = h(0);
|
|
2135
2142
|
let g = 0;
|
|
2136
2143
|
const L = () => {
|
|
2137
2144
|
if (n.editor.options.mode !== "docx") return;
|
|
2138
|
-
const T = [], { pageMargins:
|
|
2139
|
-
l.value =
|
|
2140
|
-
for (let z = 0; z <
|
|
2141
|
-
const K = `${5.5}px`, ce =
|
|
2145
|
+
const T = [], { pageMargins: H, pageSize: B } = n.editor.getPageStyles();
|
|
2146
|
+
l.value = B, d.value = H, v.x = B.width * 96 - H.right * 96, w.x = H.left * 96;
|
|
2147
|
+
for (let z = 0; z < B.width; z++) {
|
|
2148
|
+
const K = `${5.5}px`, ce = B.width - z;
|
|
2142
2149
|
if (T.push(...D(1, "main", "20%", K, z)), T.push(...D(3, "eighth", "10%", K)), T.push(...D(1, "half", "40%", K)), ce <= 0.5) break;
|
|
2143
2150
|
T.push(...D(3, "eighth", "10%", K));
|
|
2144
2151
|
}
|
|
2145
2152
|
return T;
|
|
2146
|
-
}, D = (T,
|
|
2153
|
+
}, D = (T, H, B, z, G) => Array.from({ length: T }, (K, ce) => {
|
|
2147
2154
|
const se = {
|
|
2148
|
-
className: `${
|
|
2149
|
-
height:
|
|
2155
|
+
className: `${H}-unit ruler-section`,
|
|
2156
|
+
height: B,
|
|
2150
2157
|
margin: z
|
|
2151
2158
|
};
|
|
2152
2159
|
return G !== void 0 && (se.numbering = G), se;
|
|
@@ -2162,20 +2169,20 @@ const bo = (e, s) => {
|
|
|
2162
2169
|
left: `${(T === "left" ? w : v).x}px`
|
|
2163
2170
|
})), F = j(() => {
|
|
2164
2171
|
if (!o.value) return;
|
|
2165
|
-
const
|
|
2172
|
+
const B = o.value.parentElement.querySelector(".super-editor").getBoundingClientRect();
|
|
2166
2173
|
return {
|
|
2167
2174
|
left: `${r.value.x}px`,
|
|
2168
|
-
minHeight: `${
|
|
2175
|
+
minHeight: `${B.height}px`
|
|
2169
2176
|
};
|
|
2170
2177
|
}), O = (T) => {
|
|
2171
2178
|
u.value = !0, ue();
|
|
2172
|
-
const
|
|
2173
|
-
r.value =
|
|
2179
|
+
const H = T.currentTarget.id;
|
|
2180
|
+
r.value = H === "left-margin-handle" ? w : v, y.value = r.value.x, g = T.clientX - r.value.x, b.value = !0;
|
|
2174
2181
|
}, W = (T) => {
|
|
2175
2182
|
if (!u.value) return;
|
|
2176
|
-
const
|
|
2177
|
-
r.value.x =
|
|
2178
|
-
},
|
|
2183
|
+
const H = T.clientX - g;
|
|
2184
|
+
r.value.x = H, r.value.side === "left" ? H <= 0 ? r.value.x = 0 : H >= v.x - Fe && (r.value.x = v.x - Fe) : H >= l.value.width * 96 ? r.value.x = l.value.width * 96 : H <= w.x + Fe && (r.value.x = w.x + Fe);
|
|
2185
|
+
}, oe = () => {
|
|
2179
2186
|
if (u.value = !1, b.value = !1, ve(), r.value && r.value.x !== y.value) {
|
|
2180
2187
|
const T = ge();
|
|
2181
2188
|
t("margin-change", {
|
|
@@ -2188,15 +2195,15 @@ const bo = (e, s) => {
|
|
|
2188
2195
|
}, ve = () => {
|
|
2189
2196
|
c.value = "#CCC";
|
|
2190
2197
|
}, ge = () => r.value.side === "left" ? r.value.x / 96 : (l.value.width * 96 - r.value.x) / 96, Y = j(() => ({
|
|
2191
|
-
"--alignment":
|
|
2198
|
+
"--alignment": Co,
|
|
2192
2199
|
"--ruler-handle-color": c.value,
|
|
2193
2200
|
"--ruler-handle-active-color": a.value
|
|
2194
2201
|
}));
|
|
2195
2202
|
return Ce(() => {
|
|
2196
|
-
i.value = L(), window.addEventListener("mousemove", W), window.addEventListener("mouseup",
|
|
2197
|
-
}),
|
|
2198
|
-
window.removeEventListener("mousemove", W), window.removeEventListener("mouseup",
|
|
2199
|
-
}), (T,
|
|
2203
|
+
i.value = L(), window.addEventListener("mousemove", W), window.addEventListener("mouseup", oe);
|
|
2204
|
+
}), Pt(() => {
|
|
2205
|
+
window.removeEventListener("mousemove", W), window.removeEventListener("mouseup", oe);
|
|
2206
|
+
}), (T, H) => (C(), k("div", {
|
|
2200
2207
|
class: "ruler",
|
|
2201
2208
|
ref_key: "ruler",
|
|
2202
2209
|
ref: o,
|
|
@@ -2219,27 +2226,27 @@ const bo = (e, s) => {
|
|
|
2219
2226
|
class: "vertical-indicator",
|
|
2220
2227
|
style: Q(F.value)
|
|
2221
2228
|
}, null, 4)) : ee("", !0),
|
|
2222
|
-
(C(!0), k(U, null,
|
|
2223
|
-
class:
|
|
2224
|
-
style: Q(p.value(
|
|
2229
|
+
(C(!0), k(U, null, ne(i.value, (B) => (C(), k("div", {
|
|
2230
|
+
class: te(B.className),
|
|
2231
|
+
style: Q(p.value(B))
|
|
2225
2232
|
}, [
|
|
2226
|
-
_("div",
|
|
2227
|
-
(C(!0), k(U, null,
|
|
2228
|
-
class:
|
|
2233
|
+
_("div", wo, ie(B.numbering), 1),
|
|
2234
|
+
(C(!0), k(U, null, ne(B.elements, (z) => (C(), k("div", {
|
|
2235
|
+
class: te(z.className),
|
|
2229
2236
|
style: Q(p.value(z))
|
|
2230
2237
|
}, [
|
|
2231
|
-
(C(!0), k(U, null,
|
|
2232
|
-
class:
|
|
2238
|
+
(C(!0), k(U, null, ne(z.elements, (G) => (C(), k("div", {
|
|
2239
|
+
class: te(G.className),
|
|
2233
2240
|
style: Q(p.value(G))
|
|
2234
2241
|
}, null, 6))), 256))
|
|
2235
2242
|
], 6))), 256))
|
|
2236
2243
|
], 6))), 256))
|
|
2237
2244
|
], 4));
|
|
2238
2245
|
}
|
|
2239
|
-
},
|
|
2246
|
+
}, _o = /* @__PURE__ */ q(ko, [["__scopeId", "data-v-ad77036c"]]), xo = { class: "super-editor-container" }, So = {
|
|
2240
2247
|
key: 1,
|
|
2241
2248
|
class: "placeholder-editor"
|
|
2242
|
-
},
|
|
2249
|
+
}, Eo = { class: "placeholder-title" }, Ao = {
|
|
2243
2250
|
__name: "SuperEditor",
|
|
2244
2251
|
props: {
|
|
2245
2252
|
documentId: {
|
|
@@ -2269,14 +2276,14 @@ const bo = (e, s) => {
|
|
|
2269
2276
|
"selection-update"
|
|
2270
2277
|
],
|
|
2271
2278
|
setup(e, { emit: s }) {
|
|
2272
|
-
const t = s, n = e, o = h(!1), i =
|
|
2279
|
+
const t = s, n = e, o = h(!1), i = it(null), c = h(null), a = h(null);
|
|
2273
2280
|
let l;
|
|
2274
2281
|
const d = () => {
|
|
2275
2282
|
clearTimeout(l);
|
|
2276
2283
|
}, u = (p, S = 10, F = 500) => {
|
|
2277
2284
|
const O = p.getMap("meta"), W = () => {
|
|
2278
|
-
const
|
|
2279
|
-
|
|
2285
|
+
const oe = O.get("docx");
|
|
2286
|
+
oe ? (d(), b({ content: oe })) : S > 0 ? (console.debug(`Waiting for 'docx' data... retries left: ${S}`), l = setTimeout(W, F), S--) : console.warn("Failed to load docx data from meta map.");
|
|
2280
2287
|
};
|
|
2281
2288
|
W();
|
|
2282
2289
|
}, r = async () => {
|
|
@@ -2298,7 +2305,7 @@ const bo = (e, s) => {
|
|
|
2298
2305
|
S.on("synced", F);
|
|
2299
2306
|
}
|
|
2300
2307
|
}, v = () => {
|
|
2301
|
-
const p =
|
|
2308
|
+
const p = Ft();
|
|
2302
2309
|
return n.options.pagination ? p : p.filter((S) => S.name !== "pagination");
|
|
2303
2310
|
}, b = async ({ content: p, media: S = {}, mediaFiles: F = {}, fonts: O = {} } = {}) => {
|
|
2304
2311
|
i.value = new Ne({
|
|
@@ -2314,7 +2321,7 @@ const bo = (e, s) => {
|
|
|
2314
2321
|
fonts: O,
|
|
2315
2322
|
...n.options
|
|
2316
2323
|
}), i.value.on("paginationUpdate", () => {
|
|
2317
|
-
|
|
2324
|
+
bo(a, i);
|
|
2318
2325
|
}), i.value.on("collaborationReady", () => {
|
|
2319
2326
|
setTimeout(() => {
|
|
2320
2327
|
o.value = !0;
|
|
@@ -2333,16 +2340,16 @@ const bo = (e, s) => {
|
|
|
2333
2340
|
w(), (n.options?.suppressSkeletonLoader || !n.options?.collaborationProvider) && (o.value = !0);
|
|
2334
2341
|
});
|
|
2335
2342
|
const L = (p) => {
|
|
2336
|
-
p.target.classList.contains("ProseMirror") ||
|
|
2343
|
+
p.target.classList.contains("ProseMirror") || yo(p, i.value);
|
|
2337
2344
|
}, D = ({ side: p, value: S }) => {
|
|
2338
2345
|
if (!i.value) return;
|
|
2339
2346
|
const F = i.value.getPageStyles(), { pageMargins: O } = F, W = { ...O, [p]: S };
|
|
2340
2347
|
i.value?.updatePageStyle({ pageMargins: W });
|
|
2341
2348
|
};
|
|
2342
|
-
return
|
|
2349
|
+
return st(() => {
|
|
2343
2350
|
d(), i.value?.destroy(), i.value = null;
|
|
2344
|
-
}), (p, S) => (C(), k("div",
|
|
2345
|
-
e.options.rulers && i.value ? (C(),
|
|
2351
|
+
}), (p, S) => (C(), k("div", xo, [
|
|
2352
|
+
e.options.rulers && i.value ? (C(), jt(_o, {
|
|
2346
2353
|
key: 0,
|
|
2347
2354
|
class: "ruler",
|
|
2348
2355
|
editor: i.value,
|
|
@@ -2362,8 +2369,8 @@ const bo = (e, s) => {
|
|
|
2362
2369
|
class: "editor-element super-editor__element"
|
|
2363
2370
|
}, null, 512)
|
|
2364
2371
|
], 544),
|
|
2365
|
-
o.value ? ee("", !0) : (C(), k("div",
|
|
2366
|
-
_("div",
|
|
2372
|
+
o.value ? ee("", !0) : (C(), k("div", So, [
|
|
2373
|
+
_("div", Eo, [
|
|
2367
2374
|
P(M(J), {
|
|
2368
2375
|
text: "",
|
|
2369
2376
|
style: { width: "60%" }
|
|
@@ -2409,7 +2416,7 @@ const bo = (e, s) => {
|
|
|
2409
2416
|
]))
|
|
2410
2417
|
]));
|
|
2411
2418
|
}
|
|
2412
|
-
},
|
|
2419
|
+
}, zo = /* @__PURE__ */ q(Ao, [["__scopeId", "data-v-ff8f86f4"]]), Ro = {
|
|
2413
2420
|
__name: "BasicUpload",
|
|
2414
2421
|
emits: ["file-change"],
|
|
2415
2422
|
setup(e, { emit: s }) {
|
|
@@ -2425,7 +2432,7 @@ const bo = (e, s) => {
|
|
|
2425
2432
|
}, null, 32)
|
|
2426
2433
|
]));
|
|
2427
2434
|
}
|
|
2428
|
-
},
|
|
2435
|
+
}, To = ["innerHTML"], Fo = {
|
|
2429
2436
|
__name: "SuperInput",
|
|
2430
2437
|
props: {
|
|
2431
2438
|
modelValue: {
|
|
@@ -2449,7 +2456,7 @@ const bo = (e, s) => {
|
|
|
2449
2456
|
},
|
|
2450
2457
|
emits: ["update:modelValue", "focus", "blur"],
|
|
2451
2458
|
setup(e, { emit: s }) {
|
|
2452
|
-
const t = s, n = e, o =
|
|
2459
|
+
const t = s, n = e, o = it(), i = h(null), c = h(!1), a = ({ editor: v, transaction: b }) => {
|
|
2453
2460
|
const y = v.getHTML();
|
|
2454
2461
|
t("update:modelValue", y);
|
|
2455
2462
|
}, l = ({ editor: v, transaction: b }) => {
|
|
@@ -2457,11 +2464,11 @@ const bo = (e, s) => {
|
|
|
2457
2464
|
}, d = ({ editor: v, transaction: b }) => {
|
|
2458
2465
|
c.value = !1, t("blur", { editor: v, transaction: b });
|
|
2459
2466
|
}, u = async () => {
|
|
2460
|
-
|
|
2467
|
+
It.options.placeholder = n.placeholder || "Type something...", n.options.onTransaction = a, n.options.onFocus = l, n.options.onBlur = d, o.value = new Ne({
|
|
2461
2468
|
mode: "text",
|
|
2462
2469
|
content: document.getElementById("currentContent"),
|
|
2463
2470
|
element: i.value,
|
|
2464
|
-
extensions:
|
|
2471
|
+
extensions: Lt(),
|
|
2465
2472
|
users: n.users,
|
|
2466
2473
|
...n.options
|
|
2467
2474
|
});
|
|
@@ -2472,17 +2479,17 @@ const bo = (e, s) => {
|
|
|
2472
2479
|
};
|
|
2473
2480
|
return Ce(() => {
|
|
2474
2481
|
u();
|
|
2475
|
-
}),
|
|
2482
|
+
}), st(() => {
|
|
2476
2483
|
o.value?.destroy(), o.value = null;
|
|
2477
2484
|
}), (v, b) => (C(), k("div", {
|
|
2478
|
-
class:
|
|
2485
|
+
class: te(["super-editor super-input", { "super-input-active": c.value }]),
|
|
2479
2486
|
onClick: he(r, ["stop", "prevent"])
|
|
2480
2487
|
}, [
|
|
2481
2488
|
_("div", {
|
|
2482
2489
|
id: "currentContent",
|
|
2483
2490
|
style: { display: "none" },
|
|
2484
2491
|
innerHTML: e.modelValue
|
|
2485
|
-
}, null, 8,
|
|
2492
|
+
}, null, 8, To),
|
|
2486
2493
|
_("div", {
|
|
2487
2494
|
ref_key: "editorElem",
|
|
2488
2495
|
ref: i,
|
|
@@ -2490,33 +2497,33 @@ const bo = (e, s) => {
|
|
|
2490
2497
|
}, null, 512)
|
|
2491
2498
|
], 2));
|
|
2492
2499
|
}
|
|
2493
|
-
},
|
|
2500
|
+
}, Oo = /* @__PURE__ */ q(Fo, [["__scopeId", "data-v-4d5cff52"]]), No = {
|
|
2494
2501
|
Node: Bt,
|
|
2495
|
-
Attribute:
|
|
2496
|
-
Extension:
|
|
2497
|
-
Plugin:
|
|
2498
|
-
Mark:
|
|
2502
|
+
Attribute: Ht,
|
|
2503
|
+
Extension: Dt,
|
|
2504
|
+
Plugin: Ot,
|
|
2505
|
+
Mark: Mt
|
|
2499
2506
|
};
|
|
2500
2507
|
export {
|
|
2501
|
-
|
|
2502
|
-
|
|
2503
|
-
|
|
2504
|
-
|
|
2508
|
+
Gt as AIWriter,
|
|
2509
|
+
Ro as BasicUpload,
|
|
2510
|
+
Po as CommentsPluginKey,
|
|
2511
|
+
Jo as DocxZipper,
|
|
2505
2512
|
Ne as Editor,
|
|
2506
|
-
|
|
2507
|
-
|
|
2508
|
-
|
|
2509
|
-
|
|
2510
|
-
|
|
2511
|
-
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
|
|
2519
|
-
|
|
2520
|
-
|
|
2521
|
-
|
|
2513
|
+
No as Extensions,
|
|
2514
|
+
Zo as SuperConverter,
|
|
2515
|
+
zo as SuperEditor,
|
|
2516
|
+
Oo as SuperInput,
|
|
2517
|
+
$o as SuperToolbar,
|
|
2518
|
+
qt as Toolbar,
|
|
2519
|
+
jo as TrackChangesBasePluginKey,
|
|
2520
|
+
ei as createZip,
|
|
2521
|
+
Uo as fieldAnnotationHelpers,
|
|
2522
|
+
St as getActiveFormatting,
|
|
2523
|
+
vo as getAllowedImageDimensions,
|
|
2524
|
+
qo as getMarksFromSelection,
|
|
2525
|
+
Lt as getRichTextExtensions,
|
|
2526
|
+
Ft as getStarterExtensions,
|
|
2527
|
+
Go as helpers,
|
|
2528
|
+
Ko as trackChangesHelpers
|
|
2522
2529
|
};
|