@harbour-enterprises/superdoc 0.10.5 → 0.10.6
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-C-0jzk6B.cjs → super-editor.es-7olJy4mN.cjs} +3 -3
- package/dist/chunks/{super-editor.es-C7VxrH4T.es.js → super-editor.es-C8XueA65.es.js} +7 -7
- package/dist/style.css +1 -1
- package/dist/super-editor/chunks/{converter-D8pLTGtP.js → converter-DCsYaMdA.js} +2 -2
- package/dist/super-editor/chunks/{docx-zipper-BEeS4FhN.js → docx-zipper-C9g7hQVX.js} +1 -1
- package/dist/super-editor/chunks/{editor-vcOlYDin.js → editor-6r7PwC_U.js} +4 -4
- package/dist/super-editor/chunks/{toolbar-CCw0S8RT.js → toolbar-7qxBOf0W.js} +2 -2
- 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.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/file-zipper.es.js +1 -1
- package/dist/super-editor/style.css +1 -1
- package/dist/super-editor/super-editor.es.js +71 -71
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +1 -1
- package/dist/super-editor.es.js +1 -1
- package/dist/superdoc.cjs +2 -2
- package/dist/superdoc.es.js +3 -3
- package/dist/superdoc.umd.js +132 -132
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +4 -1
|
@@ -6,13 +6,13 @@ var dt = (t, l, o) => l in t ? ct(t, l, { enumerable: !0, configurable: !0, writ
|
|
|
6
6
|
var $e = (t, l, o) => dt(t, typeof l != "symbol" ? l + "" : l, o), We = (t, l, o) => l.has(t) || Ve("Cannot " + o);
|
|
7
7
|
var Ee = (t, l, o) => (We(t, l, "read from private field"), o ? o.call(t) : l.get(t)), He = (t, l, o) => l.has(t) ? Ve("Cannot add the same private member more than once") : l instanceof WeakSet ? l.add(t) : l.set(t, o);
|
|
8
8
|
var O = (t, l, o) => (We(t, l, "access private method"), o);
|
|
9
|
-
import { _ as G, a as Ge, b as ut, I as Be, f as mt, c as je, d as pt, i as ft, u as ht, r as
|
|
10
|
-
import { C as _o, T as xo, l as Eo, n as So, k as To, m as Ao } from "./chunks/editor-
|
|
11
|
-
import { a1 as _t, y as xt, a3 as Et, T as Ke, a as St } from "./chunks/converter-
|
|
12
|
-
import { O as Io } from "./chunks/converter-
|
|
13
|
-
import { ref as
|
|
14
|
-
import { t as q, s as Bt, T as Rt, N as Z } from "./chunks/toolbar-
|
|
15
|
-
import { D as Mo } from "./chunks/docx-zipper-
|
|
9
|
+
import { _ as G, a as Ge, b as ut, I as Be, f as mt, c as je, d as pt, i as ft, u as ht, r as gt, E as Re, e as vt, P as yt, h as bt, j as kt, A as wt, N as Ct } from "./chunks/editor-6r7PwC_U.js";
|
|
10
|
+
import { C as _o, T as xo, l as Eo, n as So, k as To, m as Ao } from "./chunks/editor-6r7PwC_U.js";
|
|
11
|
+
import { a1 as _t, y as xt, a3 as Et, T as Ke, a as St } from "./chunks/converter-DCsYaMdA.js";
|
|
12
|
+
import { O as Io } from "./chunks/converter-DCsYaMdA.js";
|
|
13
|
+
import { ref as v, createElementBlock as w, openBlock as k, createElementVNode as E, unref as $, getCurrentInstance as Tt, computed as W, watch as At, onMounted as we, createCommentVNode as ne, withDirectives as Ft, withKeys as It, normalizeClass as oe, withModifiers as ke, vModelText as Lt, createTextVNode as Mt, toDisplayString as ie, Fragment as j, renderList as J, normalizeStyle as Y, createVNode as V, h as P, createApp as Dt, reactive as Ue, onUnmounted as $t, shallowRef as Xe, onBeforeUnmount as Ze, createBlock as Ht } from "vue";
|
|
14
|
+
import { t as q, s as Bt, T as Rt, N as Z } from "./chunks/toolbar-7qxBOf0W.js";
|
|
15
|
+
import { D as Mo } from "./chunks/docx-zipper-C9g7hQVX.js";
|
|
16
16
|
import { createZip as $o } from "./file-zipper.es.js";
|
|
17
17
|
var Ye = { exports: {} };
|
|
18
18
|
(function(t) {
|
|
@@ -54,45 +54,45 @@ var Ye = { exports: {} };
|
|
|
54
54
|
}, s.prototype.emit = function(d, u, r, b, h, y) {
|
|
55
55
|
var _ = o ? o + d : d;
|
|
56
56
|
if (!this._events[_]) return !1;
|
|
57
|
-
var
|
|
58
|
-
if (
|
|
59
|
-
switch (
|
|
57
|
+
var g = this._events[_], M = arguments.length, D, p;
|
|
58
|
+
if (g.fn) {
|
|
59
|
+
switch (g.once && this.removeListener(d, g.fn, void 0, !0), M) {
|
|
60
60
|
case 1:
|
|
61
|
-
return
|
|
61
|
+
return g.fn.call(g.context), !0;
|
|
62
62
|
case 2:
|
|
63
|
-
return
|
|
63
|
+
return g.fn.call(g.context, u), !0;
|
|
64
64
|
case 3:
|
|
65
|
-
return
|
|
65
|
+
return g.fn.call(g.context, u, r), !0;
|
|
66
66
|
case 4:
|
|
67
|
-
return
|
|
67
|
+
return g.fn.call(g.context, u, r, b), !0;
|
|
68
68
|
case 5:
|
|
69
|
-
return
|
|
69
|
+
return g.fn.call(g.context, u, r, b, h), !0;
|
|
70
70
|
case 6:
|
|
71
|
-
return
|
|
71
|
+
return g.fn.call(g.context, u, r, b, h, y), !0;
|
|
72
72
|
}
|
|
73
73
|
for (p = 1, D = new Array(M - 1); p < M; p++)
|
|
74
74
|
D[p - 1] = arguments[p];
|
|
75
|
-
|
|
75
|
+
g.fn.apply(g.context, D);
|
|
76
76
|
} else {
|
|
77
|
-
var C =
|
|
77
|
+
var C = g.length, A;
|
|
78
78
|
for (p = 0; p < C; p++)
|
|
79
|
-
switch (
|
|
79
|
+
switch (g[p].once && this.removeListener(d, g[p].fn, void 0, !0), M) {
|
|
80
80
|
case 1:
|
|
81
|
-
|
|
81
|
+
g[p].fn.call(g[p].context);
|
|
82
82
|
break;
|
|
83
83
|
case 2:
|
|
84
|
-
|
|
84
|
+
g[p].fn.call(g[p].context, u);
|
|
85
85
|
break;
|
|
86
86
|
case 3:
|
|
87
|
-
|
|
87
|
+
g[p].fn.call(g[p].context, u, r);
|
|
88
88
|
break;
|
|
89
89
|
case 4:
|
|
90
|
-
|
|
90
|
+
g[p].fn.call(g[p].context, u, r, b);
|
|
91
91
|
break;
|
|
92
92
|
default:
|
|
93
93
|
if (!D) for (A = 1, D = new Array(M - 1); A < M; A++)
|
|
94
94
|
D[A - 1] = arguments[A];
|
|
95
|
-
|
|
95
|
+
g[p].fn.apply(g[p].context, D);
|
|
96
96
|
}
|
|
97
97
|
}
|
|
98
98
|
return !0;
|
|
@@ -109,9 +109,9 @@ var Ye = { exports: {} };
|
|
|
109
109
|
if (y.fn)
|
|
110
110
|
y.fn === u && (!b || y.once) && (!r || y.context === r) && c(this, h);
|
|
111
111
|
else {
|
|
112
|
-
for (var _ = 0,
|
|
113
|
-
(y[_].fn !== u || b && !y[_].once || r && y[_].context !== r) &&
|
|
114
|
-
|
|
112
|
+
for (var _ = 0, g = [], M = y.length; _ < M; _++)
|
|
113
|
+
(y[_].fn !== u || b && !y[_].once || r && y[_].context !== r) && g.push(y[_]);
|
|
114
|
+
g.length ? this._events[h] = g.length === 1 ? g[0] : g : c(this, h);
|
|
115
115
|
}
|
|
116
116
|
return this;
|
|
117
117
|
}, s.prototype.removeAllListeners = function(d) {
|
|
@@ -146,7 +146,7 @@ const x = (t) => {
|
|
|
146
146
|
throw new Error("Toolbar button item needs either icon or label - " + t.name);
|
|
147
147
|
if (!t.name)
|
|
148
148
|
throw new Error("Invalid toolbar item name - " + t.name);
|
|
149
|
-
const o =
|
|
149
|
+
const o = v(xt()), n = t.type, e = v(t.name), i = t.command, c = v(t.icon), s = v(t.group || "center"), a = v(t.allowWithoutEditor), d = v(t.attributes || {}), u = t.disabled || !1, r = v(t.disabled), b = v(!1), h = v(!1), y = v(t.style), _ = v(t.isNarrow), g = v(t.isWide), M = v(t.minWidth), D = v(t.suppressActiveHighlight || !1), p = v(t.argument), C = v(null), A = v(null), H = v(t.iconColor), N = v(t.hasCaret), Q = v(t.tooltip), ve = v(t.tooltipVisible), ce = v(t.tooltipTimeout), de = v(t.defaultLabel), se = v(t.label), T = v(t.hideLabel), I = v(t.inlineTextInputVisible), B = v(t.hasInlineTextInput), R = v(t.markName), U = v(t.labelAttr), K = v(t.selectedValue), ue = v(t.dropdownValueKey), le = v([]);
|
|
150
150
|
if (t.options) {
|
|
151
151
|
if (!Array.isArray(t.options)) throw new Error("Invalid toolbar item options - " + t.options);
|
|
152
152
|
le.value.push(...t.options);
|
|
@@ -179,13 +179,13 @@ const x = (t) => {
|
|
|
179
179
|
nestedOptions: le,
|
|
180
180
|
style: y,
|
|
181
181
|
isNarrow: _,
|
|
182
|
-
isWide:
|
|
182
|
+
isWide: g,
|
|
183
183
|
minWidth: M,
|
|
184
184
|
argument: p,
|
|
185
185
|
parentItem: A,
|
|
186
186
|
iconColor: H,
|
|
187
187
|
hasCaret: N,
|
|
188
|
-
tooltipVisible:
|
|
188
|
+
tooltipVisible: ve,
|
|
189
189
|
tooltipTimeout: ce,
|
|
190
190
|
defaultLabel: de,
|
|
191
191
|
label: se,
|
|
@@ -289,10 +289,10 @@ const x = (t) => {
|
|
|
289
289
|
console.debug("[LinkInput] Invalid URL in handleSubmit"), s.value = !0;
|
|
290
290
|
}, c = () => {
|
|
291
291
|
o("submit", { text: a.value, href: null });
|
|
292
|
-
}, s =
|
|
292
|
+
}, s = v(!1), a = v(n.initialText), d = v(n.href), u = W(() => d.value?.startsWith("http") ? d.value : "http://" + d.value), r = W(() => {
|
|
293
293
|
const p = u.value.split(".").filter(Boolean);
|
|
294
294
|
return u.value.includes(".") && p.length > 1;
|
|
295
|
-
}), b = W(() => y.value ? "Apply" : "Remove"), h = W(() => !r.value), y = W(() => !_.value), _ = W(() => n.href && !d.value),
|
|
295
|
+
}), b = W(() => y.value ? "Apply" : "Remove"), h = W(() => !r.value), y = W(() => !_.value), _ = W(() => n.href && !d.value), g = W(() => n.href.startsWith("#")), M = () => {
|
|
296
296
|
window.open(u.value, "_blank");
|
|
297
297
|
};
|
|
298
298
|
At(
|
|
@@ -308,8 +308,8 @@ const x = (t) => {
|
|
|
308
308
|
return we(() => {
|
|
309
309
|
n.showInput && D();
|
|
310
310
|
}), (p, C) => (k(), w("div", Xt, [
|
|
311
|
-
t.href ?
|
|
312
|
-
t.showInput && !
|
|
311
|
+
t.href ? g.value ? (k(), w("div", Yt, "Page anchor")) : (k(), w("div", Jt, "Edit link")) : (k(), w("div", Zt, "Add link")),
|
|
312
|
+
t.showInput && !g.value ? (k(), w("div", Qt, [
|
|
313
313
|
E("div", en, [
|
|
314
314
|
E("div", {
|
|
315
315
|
class: "input-icon",
|
|
@@ -351,14 +351,14 @@ const x = (t) => {
|
|
|
351
351
|
onClick: i
|
|
352
352
|
}, ie(b.value), 3)) : ne("", !0)
|
|
353
353
|
])
|
|
354
|
-
])) :
|
|
354
|
+
])) : g.value ? (k(), w("div", an, [
|
|
355
355
|
E("a", {
|
|
356
356
|
onClick: C[2] || (C[2] = ke((...A) => t.goToAnchor && t.goToAnchor(...A), ["stop", "prevent"]))
|
|
357
357
|
}, "Go to " + ie(t.href.startsWith("#_") ? t.href.substring(2) : t.href), 1)
|
|
358
358
|
])) : ne("", !0)
|
|
359
359
|
]));
|
|
360
360
|
}
|
|
361
|
-
}, cn = /* @__PURE__ */ G(rn, [["__scopeId", "data-v-6990d5b2"]]), dn = { class: "document-mode" }, un = ["onClick"], mn = { class: "document-mode-column icon-column" }, pn = ["innerHTML"], fn = { class: "document-mode-column text-column" }, hn = { class: "document-mode-type" },
|
|
361
|
+
}, cn = /* @__PURE__ */ G(rn, [["__scopeId", "data-v-6990d5b2"]]), dn = { class: "document-mode" }, un = ["onClick"], mn = { class: "document-mode-column icon-column" }, pn = ["innerHTML"], fn = { class: "document-mode-column text-column" }, hn = { class: "document-mode-type" }, gn = { class: "document-mode-description" }, vn = {
|
|
362
362
|
__name: "DocumentMode",
|
|
363
363
|
props: {
|
|
364
364
|
options: {
|
|
@@ -383,12 +383,12 @@ const x = (t) => {
|
|
|
383
383
|
]),
|
|
384
384
|
E("div", fn, [
|
|
385
385
|
E("div", hn, ie(c.label), 1),
|
|
386
|
-
E("div",
|
|
386
|
+
E("div", gn, ie(c.description), 1)
|
|
387
387
|
])
|
|
388
388
|
], 10, un))), 256))
|
|
389
389
|
]));
|
|
390
390
|
}
|
|
391
|
-
}, yn = /* @__PURE__ */ G(
|
|
391
|
+
}, yn = /* @__PURE__ */ G(vn, [["__scopeId", "data-v-f86e1477"]]), bn = {
|
|
392
392
|
key: 0,
|
|
393
393
|
class: "linked-style-buttons"
|
|
394
394
|
}, kn = ["onClick"], wn = {
|
|
@@ -595,15 +595,15 @@ const x = (t) => {
|
|
|
595
595
|
__name: "TableGrid",
|
|
596
596
|
emits: ["select", "clickoutside"],
|
|
597
597
|
setup(t, { emit: l }) {
|
|
598
|
-
const o = l, n =
|
|
598
|
+
const o = l, n = v(0), e = v(0), i = (s) => {
|
|
599
599
|
let a = s.target;
|
|
600
600
|
if (!!a.dataset.grid)
|
|
601
601
|
return;
|
|
602
602
|
let r = [...a.parentElement.querySelectorAll("[data-item]")], b = parseInt(a.dataset.cols, 10), h = parseInt(a.dataset.rows, 10);
|
|
603
603
|
e.value = b, n.value = h;
|
|
604
604
|
for (let y = 0; y < r.length; y++) {
|
|
605
|
-
let _ = r[y],
|
|
606
|
-
|
|
605
|
+
let _ = r[y], g = parseInt(_.dataset.cols, 10), M = parseInt(_.dataset.rows, 10);
|
|
606
|
+
g <= b && M <= h ? _.classList.add("selected") : _.classList.remove("selected");
|
|
607
607
|
}
|
|
608
608
|
}, c = ({ cols: s, rows: a }) => {
|
|
609
609
|
o("select", { cols: s, rows: a });
|
|
@@ -854,7 +854,7 @@ const x = (t) => {
|
|
|
854
854
|
command: "toggleLink"
|
|
855
855
|
});
|
|
856
856
|
h.childItem = _, _.parentItem = h;
|
|
857
|
-
const
|
|
857
|
+
const g = x({
|
|
858
858
|
type: "button",
|
|
859
859
|
name: "image",
|
|
860
860
|
command: "startImageUpload",
|
|
@@ -1014,7 +1014,7 @@ const x = (t) => {
|
|
|
1014
1014
|
command: "toggleBulletList",
|
|
1015
1015
|
icon: e.bulletList,
|
|
1016
1016
|
tooltip: "Bullet list"
|
|
1017
|
-
}),
|
|
1017
|
+
}), ve = x({
|
|
1018
1018
|
type: "button",
|
|
1019
1019
|
name: "numberedlist",
|
|
1020
1020
|
command: "toggleOrderedList",
|
|
@@ -1315,13 +1315,13 @@ const x = (t) => {
|
|
|
1315
1315
|
r,
|
|
1316
1316
|
a,
|
|
1317
1317
|
h,
|
|
1318
|
-
|
|
1318
|
+
g,
|
|
1319
1319
|
M,
|
|
1320
1320
|
p,
|
|
1321
1321
|
a,
|
|
1322
1322
|
H,
|
|
1323
1323
|
Q,
|
|
1324
|
-
|
|
1324
|
+
ve,
|
|
1325
1325
|
ce,
|
|
1326
1326
|
de,
|
|
1327
1327
|
ae,
|
|
@@ -1435,12 +1435,12 @@ const x = (t) => {
|
|
|
1435
1435
|
let b = o.name.replace(" ", "_"), h = mt(l.state, s);
|
|
1436
1436
|
if (h == null)
|
|
1437
1437
|
return;
|
|
1438
|
-
let y = { type: "remove", id: s }, _ = `word/media/${b}`,
|
|
1438
|
+
let y = { type: "remove", id: s }, _ = `word/media/${b}`, g = d.nodes.image.create({
|
|
1439
1439
|
src: _,
|
|
1440
1440
|
size: { width: i, height: c }
|
|
1441
1441
|
});
|
|
1442
1442
|
t.storage.image.media = Object.assign(t.storage.image.media, { [_]: r }), t.options.ydoc && t.commands.addImageToCollaboration({ mediaPath: _, fileData: r }), l.dispatch(
|
|
1443
|
-
l.state.tr.replaceWith(h, h,
|
|
1443
|
+
l.state.tr.replaceWith(h, h, g).setMeta(Be, y)
|
|
1444
1444
|
);
|
|
1445
1445
|
},
|
|
1446
1446
|
() => {
|
|
@@ -1449,8 +1449,8 @@ const x = (t) => {
|
|
|
1449
1449
|
}
|
|
1450
1450
|
);
|
|
1451
1451
|
};
|
|
1452
|
-
var L, Qe,
|
|
1453
|
-
class
|
|
1452
|
+
var L, Qe, ge, Ne, et, tt, ze, nt, he;
|
|
1453
|
+
class go extends Nt {
|
|
1454
1454
|
constructor(o) {
|
|
1455
1455
|
super();
|
|
1456
1456
|
He(this, L);
|
|
@@ -1465,7 +1465,7 @@ class vo extends Nt {
|
|
|
1465
1465
|
groups: null,
|
|
1466
1466
|
editor: null
|
|
1467
1467
|
});
|
|
1468
|
-
He(this,
|
|
1468
|
+
He(this, ge, {
|
|
1469
1469
|
setZoom: ({ item: o, argument: n }) => {
|
|
1470
1470
|
if (!n) return;
|
|
1471
1471
|
o.onActivate({ zoom: n }), this.emit("superdoc-command", { item: o, argument: n });
|
|
@@ -1556,7 +1556,7 @@ class vo extends Nt {
|
|
|
1556
1556
|
...o.icons
|
|
1557
1557
|
}, !this.config.selector && this.config.element && (this.config.selector = this.config.element), O(this, L, Qe).call(this), O(this, L, Ne).call(this, this, this.config.icons, o.isDev);
|
|
1558
1558
|
let n = null;
|
|
1559
|
-
if (this.config.selector && (n = document.getElementById(this.config.selector), !n)) {
|
|
1559
|
+
if (this.config.selector && (this.config.selector.startsWith("#") || this.config.selector.startsWith(".") ? n = document.querySelector(this.config.selector) : n = document.getElementById(this.config.selector), !n)) {
|
|
1560
1560
|
console.warn(`[super-toolbar 🎨] Element not found: ${this.config.selector}`);
|
|
1561
1561
|
return;
|
|
1562
1562
|
}
|
|
@@ -1567,7 +1567,7 @@ class vo extends Nt {
|
|
|
1567
1567
|
}
|
|
1568
1568
|
setZoom(o) {
|
|
1569
1569
|
const e = [...this.toolbarItems, ...this.overflowItems].find((i) => i.name.value === "zoom");
|
|
1570
|
-
Ee(this,
|
|
1570
|
+
Ee(this, ge).setZoom({ item: e, argument: o });
|
|
1571
1571
|
}
|
|
1572
1572
|
/**
|
|
1573
1573
|
* The toolbar expects an active Super Editor instance.
|
|
@@ -1613,8 +1613,8 @@ class vo extends Nt {
|
|
|
1613
1613
|
emitCommand({ item: o, argument: n }) {
|
|
1614
1614
|
const { command: e } = o;
|
|
1615
1615
|
if (e) {
|
|
1616
|
-
if (this.log("(emmitCommand) Command:", e, o, n), e in Ee(this,
|
|
1617
|
-
return Ee(this,
|
|
1616
|
+
if (this.log("(emmitCommand) Command:", e, o, n), e in Ee(this, ge))
|
|
1617
|
+
return Ee(this, ge)[e]({ item: o, argument: n });
|
|
1618
1618
|
if (e in this.activeEditor?.commands)
|
|
1619
1619
|
this.activeEditor.commands[e](n), this.updateToolbarState();
|
|
1620
1620
|
else
|
|
@@ -1624,7 +1624,7 @@ class vo extends Nt {
|
|
|
1624
1624
|
}
|
|
1625
1625
|
L = new WeakSet(), Qe = function() {
|
|
1626
1626
|
this.config.groups && !Array.isArray(this.config.groups) && Object.keys(this.config.groups).length && (this.config.toolbarGroups = Object.keys(this.config.groups));
|
|
1627
|
-
},
|
|
1627
|
+
}, ge = new WeakMap(), Ne = function(o, n, e = !1) {
|
|
1628
1628
|
const i = document.documentElement.clientWidth, { defaultItems: c, overflowItems: s } = Un(o, e, i, this.role, n);
|
|
1629
1629
|
let a = [
|
|
1630
1630
|
...c.map((u) => u.name.value),
|
|
@@ -1656,7 +1656,7 @@ L = new WeakSet(), Qe = function() {
|
|
|
1656
1656
|
n.value || o.setDisabled(!0);
|
|
1657
1657
|
});
|
|
1658
1658
|
}, nt = function() {
|
|
1659
|
-
this.activeEditor && (this.undoDepth = ht(this.activeEditor.state), this.redoDepth =
|
|
1659
|
+
this.activeEditor && (this.undoDepth = ht(this.activeEditor.state), this.redoDepth = gt(this.activeEditor.state));
|
|
1660
1660
|
}, he = function({ item: o, argument: n }, e) {
|
|
1661
1661
|
if (!n || !this.activeEditor) return;
|
|
1662
1662
|
let i = o.command;
|
|
@@ -1711,8 +1711,8 @@ const Qn = (t, l) => {
|
|
|
1711
1711
|
},
|
|
1712
1712
|
emits: ["margin-change"],
|
|
1713
1713
|
setup(t, { emit: l }) {
|
|
1714
|
-
const o = l, n = t, e =
|
|
1715
|
-
let
|
|
1714
|
+
const o = l, n = t, e = v(null), i = v([]), c = v("#CCCCCC"), s = v("#2563EB66"), a = v(null), d = v(null), u = v(!1), r = v(null), b = Ue({ side: "left", x: 0 }), h = Ue({ side: "right", x: 0 }), y = v(!1), _ = v(0);
|
|
1715
|
+
let g = 0;
|
|
1716
1716
|
const M = () => {
|
|
1717
1717
|
if (n.editor.options.mode !== "docx") return;
|
|
1718
1718
|
const T = [], { pageMargins: I, pageSize: B } = n.editor.getPageStyles();
|
|
@@ -1748,12 +1748,12 @@ const Qn = (t, l) => {
|
|
|
1748
1748
|
minHeight: `${B.height}px`
|
|
1749
1749
|
};
|
|
1750
1750
|
}), H = (T) => {
|
|
1751
|
-
u.value = !0,
|
|
1751
|
+
u.value = !0, ve();
|
|
1752
1752
|
const I = T.currentTarget.id;
|
|
1753
|
-
r.value = I === "left-margin-handle" ? b : h, _.value = r.value.x,
|
|
1753
|
+
r.value = I === "left-margin-handle" ? b : h, _.value = r.value.x, g = T.clientX - r.value.x, y.value = !0;
|
|
1754
1754
|
}, N = (T) => {
|
|
1755
1755
|
if (!u.value) return;
|
|
1756
|
-
const I = T.clientX -
|
|
1756
|
+
const I = T.clientX - g;
|
|
1757
1757
|
r.value.x = I, r.value.side === "left" ? I <= 0 ? r.value.x = 0 : I >= h.x - Se && (r.value.x = h.x - Se) : I >= a.value.width * 96 ? r.value.x = a.value.width * 96 : I <= b.x + Se && (r.value.x = b.x + Se);
|
|
1758
1758
|
}, Q = () => {
|
|
1759
1759
|
if (u.value = !1, y.value = !1, ce(), r.value && r.value.x !== _.value) {
|
|
@@ -1763,7 +1763,7 @@ const Qn = (t, l) => {
|
|
|
1763
1763
|
value: T
|
|
1764
1764
|
});
|
|
1765
1765
|
}
|
|
1766
|
-
},
|
|
1766
|
+
}, ve = () => {
|
|
1767
1767
|
c.value = s.value;
|
|
1768
1768
|
}, ce = () => {
|
|
1769
1769
|
c.value = "#CCC";
|
|
@@ -1849,7 +1849,7 @@ const Qn = (t, l) => {
|
|
|
1849
1849
|
"selection-update"
|
|
1850
1850
|
],
|
|
1851
1851
|
setup(t, { emit: l }) {
|
|
1852
|
-
const o = l, n = t, e =
|
|
1852
|
+
const o = l, n = t, e = v(!1), i = Xe(null), c = v(null), s = v(null);
|
|
1853
1853
|
let a;
|
|
1854
1854
|
const d = () => {
|
|
1855
1855
|
clearTimeout(a);
|
|
@@ -1878,7 +1878,7 @@ const Qn = (t, l) => {
|
|
|
1878
1878
|
C.on("synced", A);
|
|
1879
1879
|
}
|
|
1880
1880
|
}, h = () => {
|
|
1881
|
-
const p =
|
|
1881
|
+
const p = vt();
|
|
1882
1882
|
return n.options.pagination ? p : p.filter((C) => C.name !== "pagination");
|
|
1883
1883
|
}, y = async ({ content: p, media: C = {}, mediaFiles: A = {}, fonts: H = {} } = {}) => {
|
|
1884
1884
|
i.value = new Re({
|
|
@@ -1902,7 +1902,7 @@ const Qn = (t, l) => {
|
|
|
1902
1902
|
});
|
|
1903
1903
|
}, _ = (p) => {
|
|
1904
1904
|
o("editor-keydown", { editor: i.value });
|
|
1905
|
-
},
|
|
1905
|
+
}, g = (p) => {
|
|
1906
1906
|
o("editor-click", { editor: i.value });
|
|
1907
1907
|
let C = s.value?.querySelector(".ProseMirror");
|
|
1908
1908
|
if (!C || !i.value)
|
|
@@ -1933,7 +1933,7 @@ const Qn = (t, l) => {
|
|
|
1933
1933
|
ref_key: "editorWrapper",
|
|
1934
1934
|
ref: c,
|
|
1935
1935
|
onKeydown: _,
|
|
1936
|
-
onClick:
|
|
1936
|
+
onClick: g,
|
|
1937
1937
|
onMousedown: M
|
|
1938
1938
|
}, [
|
|
1939
1939
|
E("div", {
|
|
@@ -1989,7 +1989,7 @@ const Qn = (t, l) => {
|
|
|
1989
1989
|
]))
|
|
1990
1990
|
]));
|
|
1991
1991
|
}
|
|
1992
|
-
},
|
|
1992
|
+
}, vo = /* @__PURE__ */ G(ao, [["__scopeId", "data-v-ff8f86f4"]]), yo = {
|
|
1993
1993
|
__name: "BasicUpload",
|
|
1994
1994
|
emits: ["file-change"],
|
|
1995
1995
|
setup(t, { emit: l }) {
|
|
@@ -2029,7 +2029,7 @@ const Qn = (t, l) => {
|
|
|
2029
2029
|
},
|
|
2030
2030
|
emits: ["update:modelValue", "focus", "blur"],
|
|
2031
2031
|
setup(t, { emit: l }) {
|
|
2032
|
-
const o = l, n = t, e = Xe(), i =
|
|
2032
|
+
const o = l, n = t, e = Xe(), i = v(null), c = v(!1), s = ({ editor: h, transaction: y }) => {
|
|
2033
2033
|
const _ = h.getHTML();
|
|
2034
2034
|
o("update:modelValue", _);
|
|
2035
2035
|
}, a = ({ editor: h, transaction: y }) => {
|
|
@@ -2083,9 +2083,9 @@ export {
|
|
|
2083
2083
|
Re as Editor,
|
|
2084
2084
|
ko as Extensions,
|
|
2085
2085
|
Io as SuperConverter,
|
|
2086
|
-
|
|
2086
|
+
vo as SuperEditor,
|
|
2087
2087
|
bo as SuperInput,
|
|
2088
|
-
|
|
2088
|
+
go as SuperToolbar,
|
|
2089
2089
|
Rt as Toolbar,
|
|
2090
2090
|
xo as TrackChangesBasePluginKey,
|
|
2091
2091
|
$o as createZip,
|
|
@@ -2094,7 +2094,7 @@ export {
|
|
|
2094
2094
|
Zn as getAllowedImageDimensions,
|
|
2095
2095
|
So as getMarksFromSelection,
|
|
2096
2096
|
bt as getRichTextExtensions,
|
|
2097
|
-
|
|
2097
|
+
vt as getStarterExtensions,
|
|
2098
2098
|
To as helpers,
|
|
2099
2099
|
Ao as trackChangesHelpers
|
|
2100
2100
|
};
|
package/dist/super-editor.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/super-editor.es-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./chunks/super-editor.es-7olJy4mN.cjs");require("./chunks/vue-Ckf0DkDN.cjs");exports.BasicUpload=e.yo;exports.CommentsPluginKey=e.he;exports.DocxZipper=e.Nt;exports.Editor=e.ji;exports.Extensions=e.ko;exports.SuperConverter=e.Nt$1;exports.SuperEditor=e.vo;exports.SuperInput=e.bo;exports.SuperToolbar=e.go;exports.Toolbar=e.Ip;exports.TrackChangesBasePluginKey=e.de;exports.createZip=e.c;exports.fieldAnnotationHelpers=e.Uk;exports.getActiveFormatting=e.Bf;exports.getAllowedImageDimensions=e.Zn;exports.getMarksFromSelection=e.No;exports.getRichTextExtensions=e.Pk;exports.getStarterExtensions=e.Rk;exports.helpers=e.Md;exports.trackChangesHelpers=e.Kk;
|
package/dist/super-editor.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { y as t, h as r, N as o, j as n, k as i, a as p, g, b as l,
|
|
1
|
+
import { y as t, h as r, N as o, j as n, k as i, a as p, v as g, b as l, g as c, I as m, d as u, c as d, U as x, B as S, Z as h, e as E, P as k, R as C, M as T, K as b } from "./chunks/super-editor.es-C8XueA65.es.js";
|
|
2
2
|
import "./chunks/vue-BDbTsTMu.es.js";
|
|
3
3
|
export {
|
|
4
4
|
t as BasicUpload,
|