@harbour-enterprises/superdoc 0.10.34 → 0.10.36
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-mU7XJaA2.cjs → super-editor.es-Br9TPTha.cjs} +5 -5
- package/dist/chunks/{super-editor.es-C8dsGkpp.es.js → super-editor.es-DJLcTCbA.es.js} +64 -45
- package/dist/super-editor/ai-writer.es.js +1 -1
- package/dist/super-editor/chunks/{converter-BoD3UL-D.js → converter-Dy0wP6Ge.js} +7 -6
- package/dist/super-editor/chunks/{docx-zipper-CdQcoemq.js → docx-zipper-CRYSc8LJ.js} +1 -1
- package/dist/super-editor/chunks/{editor-BOOEq-l-.js → editor-8EFMn0gI.js} +40 -37
- package/dist/super-editor/chunks/{toolbar-MODX2iiO.js → toolbar-Bz666WFS.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/super-converter/helpers.d.ts +5 -1
- package/dist/super-editor/core/super-converter/helpers.d.ts.map +1 -1
- package/dist/super-editor/core/super-converter/v2/importer/listImporter.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/line-height/line-height.d.ts.map +1 -1
- package/dist/super-editor/extensions/linked-styles/linked-styles.d.ts +2 -5
- package/dist/super-editor/extensions/linked-styles/linked-styles.d.ts.map +1 -1
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/super-editor.es.js +396 -381
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +1 -1
- package/dist/super-editor.es.js +5 -5
- package/dist/superdoc.cjs +2 -2
- package/dist/superdoc.es.js +3 -3
- package/dist/superdoc.umd.js +421 -402
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,142 +2,142 @@ var ut = Object.defineProperty;
|
|
|
2
2
|
var Ve = (t) => {
|
|
3
3
|
throw TypeError(t);
|
|
4
4
|
};
|
|
5
|
-
var mt = (t,
|
|
6
|
-
var He = (t,
|
|
7
|
-
var Se = (t,
|
|
8
|
-
var W = (t,
|
|
9
|
-
import { _ as K, a as Ke, b as pt, I as Re, f as ft, c as Ue, d as ht, i as
|
|
10
|
-
import { C as To, T as Fo, l as Io, n as Lo, k as Mo, m as Do } from "./chunks/editor-
|
|
11
|
-
import { a1 as St, y as At, a3 as Tt, T as Xe, a as Ft } from "./chunks/converter-
|
|
12
|
-
import { O as Ho } from "./chunks/converter-
|
|
13
|
-
import { ref as
|
|
14
|
-
import { t as G, s as Nt, T as zt, N as Y } from "./chunks/toolbar-
|
|
5
|
+
var mt = (t, l, o) => l in t ? ut(t, l, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[l] = o;
|
|
6
|
+
var He = (t, l, o) => mt(t, typeof l != "symbol" ? l + "" : l, o), je = (t, l, o) => l.has(t) || Ve("Cannot " + o);
|
|
7
|
+
var Se = (t, l, o) => (je(t, l, "read from private field"), o ? o.call(t) : l.get(t)), Be = (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
|
+
var W = (t, l, o) => (je(t, l, "access private method"), o);
|
|
9
|
+
import { _ as K, a as Ke, b as pt, I as Re, f as ft, c as Ue, d as ht, i as vt, u as gt, r as yt, E as Oe, e as bt, P as kt, h as wt, M as Ct, j as _t, A as xt, N as Et } from "./chunks/editor-8EFMn0gI.js";
|
|
10
|
+
import { C as To, T as Fo, l as Io, n as Lo, k as Mo, m as Do } from "./chunks/editor-8EFMn0gI.js";
|
|
11
|
+
import { a1 as St, y as At, a3 as Tt, T as Xe, a as Ft } from "./chunks/converter-Dy0wP6Ge.js";
|
|
12
|
+
import { O as Ho } from "./chunks/converter-Dy0wP6Ge.js";
|
|
13
|
+
import { ref as g, createElementBlock as w, openBlock as k, createElementVNode as x, unref as $, getCurrentInstance as It, computed as j, watch as Lt, onMounted as we, createCommentVNode as ne, withDirectives as Mt, withKeys as Dt, normalizeClass as oe, withModifiers as ke, vModelText as $t, createTextVNode as Ht, toDisplayString as ie, Fragment as U, renderList as Q, normalizeStyle as J, createVNode as V, h as N, createApp as Bt, reactive as qe, onUnmounted as Rt, shallowRef as Ze, onBeforeUnmount as Ye, createBlock as Ot } from "vue";
|
|
14
|
+
import { t as G, s as Nt, T as zt, N as Y } from "./chunks/toolbar-Bz666WFS.js";
|
|
15
15
|
import Wt from "./ai-writer.es.js";
|
|
16
|
-
import { D as Ro } from "./chunks/docx-zipper-
|
|
16
|
+
import { D as Ro } from "./chunks/docx-zipper-CRYSc8LJ.js";
|
|
17
17
|
import { createZip as No } from "./file-zipper.es.js";
|
|
18
18
|
var Je = { exports: {} };
|
|
19
19
|
(function(t) {
|
|
20
|
-
var
|
|
20
|
+
var l = Object.prototype.hasOwnProperty, o = "~";
|
|
21
21
|
function n() {
|
|
22
22
|
}
|
|
23
23
|
Object.create && (n.prototype = /* @__PURE__ */ Object.create(null), new n().__proto__ || (o = !1));
|
|
24
|
-
function e(
|
|
25
|
-
this.fn =
|
|
24
|
+
function e(s, r, d) {
|
|
25
|
+
this.fn = s, this.context = r, this.once = d || !1;
|
|
26
26
|
}
|
|
27
|
-
function i(
|
|
28
|
-
if (typeof
|
|
27
|
+
function i(s, r, d, c, b) {
|
|
28
|
+
if (typeof d != "function")
|
|
29
29
|
throw new TypeError("The listener must be a function");
|
|
30
|
-
var y = new e(
|
|
31
|
-
return
|
|
30
|
+
var y = new e(d, c || s, b), h = o ? o + r : r;
|
|
31
|
+
return s._events[h] ? s._events[h].fn ? s._events[h] = [s._events[h], y] : s._events[h].push(y) : (s._events[h] = y, s._eventsCount++), s;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
--
|
|
33
|
+
function u(s, r) {
|
|
34
|
+
--s._eventsCount === 0 ? s._events = new n() : delete s._events[r];
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function a() {
|
|
37
37
|
this._events = new n(), this._eventsCount = 0;
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
var
|
|
41
|
-
if (this._eventsCount === 0) return
|
|
42
|
-
for (
|
|
43
|
-
|
|
44
|
-
return Object.getOwnPropertySymbols ?
|
|
45
|
-
},
|
|
46
|
-
var
|
|
47
|
-
if (!
|
|
48
|
-
if (
|
|
49
|
-
for (var b = 0, y =
|
|
50
|
-
h[b] =
|
|
39
|
+
a.prototype.eventNames = function() {
|
|
40
|
+
var r = [], d, c;
|
|
41
|
+
if (this._eventsCount === 0) return r;
|
|
42
|
+
for (c in d = this._events)
|
|
43
|
+
l.call(d, c) && r.push(o ? c.slice(1) : c);
|
|
44
|
+
return Object.getOwnPropertySymbols ? r.concat(Object.getOwnPropertySymbols(d)) : r;
|
|
45
|
+
}, a.prototype.listeners = function(r) {
|
|
46
|
+
var d = o ? o + r : r, c = this._events[d];
|
|
47
|
+
if (!c) return [];
|
|
48
|
+
if (c.fn) return [c.fn];
|
|
49
|
+
for (var b = 0, y = c.length, h = new Array(y); b < y; b++)
|
|
50
|
+
h[b] = c[b].fn;
|
|
51
51
|
return h;
|
|
52
|
-
},
|
|
53
|
-
var
|
|
54
|
-
return
|
|
55
|
-
},
|
|
56
|
-
var E = o ? o +
|
|
52
|
+
}, a.prototype.listenerCount = function(r) {
|
|
53
|
+
var d = o ? o + r : r, c = this._events[d];
|
|
54
|
+
return c ? c.fn ? 1 : c.length : 0;
|
|
55
|
+
}, a.prototype.emit = function(r, d, c, b, y, h) {
|
|
56
|
+
var E = o ? o + r : r;
|
|
57
57
|
if (!this._events[E]) return !1;
|
|
58
|
-
var
|
|
59
|
-
if (
|
|
60
|
-
switch (
|
|
58
|
+
var v = this._events[E], D = arguments.length, L, p;
|
|
59
|
+
if (v.fn) {
|
|
60
|
+
switch (v.once && this.removeListener(r, v.fn, void 0, !0), D) {
|
|
61
61
|
case 1:
|
|
62
|
-
return
|
|
62
|
+
return v.fn.call(v.context), !0;
|
|
63
63
|
case 2:
|
|
64
|
-
return
|
|
64
|
+
return v.fn.call(v.context, d), !0;
|
|
65
65
|
case 3:
|
|
66
|
-
return
|
|
66
|
+
return v.fn.call(v.context, d, c), !0;
|
|
67
67
|
case 4:
|
|
68
|
-
return
|
|
68
|
+
return v.fn.call(v.context, d, c, b), !0;
|
|
69
69
|
case 5:
|
|
70
|
-
return
|
|
70
|
+
return v.fn.call(v.context, d, c, b, y), !0;
|
|
71
71
|
case 6:
|
|
72
|
-
return
|
|
72
|
+
return v.fn.call(v.context, d, c, b, y, h), !0;
|
|
73
73
|
}
|
|
74
74
|
for (p = 1, L = new Array(D - 1); p < D; p++)
|
|
75
75
|
L[p - 1] = arguments[p];
|
|
76
|
-
|
|
76
|
+
v.fn.apply(v.context, L);
|
|
77
77
|
} else {
|
|
78
|
-
var C =
|
|
78
|
+
var C = v.length, F;
|
|
79
79
|
for (p = 0; p < C; p++)
|
|
80
|
-
switch (
|
|
80
|
+
switch (v[p].once && this.removeListener(r, v[p].fn, void 0, !0), D) {
|
|
81
81
|
case 1:
|
|
82
|
-
|
|
82
|
+
v[p].fn.call(v[p].context);
|
|
83
83
|
break;
|
|
84
84
|
case 2:
|
|
85
|
-
|
|
85
|
+
v[p].fn.call(v[p].context, d);
|
|
86
86
|
break;
|
|
87
87
|
case 3:
|
|
88
|
-
|
|
88
|
+
v[p].fn.call(v[p].context, d, c);
|
|
89
89
|
break;
|
|
90
90
|
case 4:
|
|
91
|
-
|
|
91
|
+
v[p].fn.call(v[p].context, d, c, b);
|
|
92
92
|
break;
|
|
93
93
|
default:
|
|
94
94
|
if (!L) for (F = 1, L = new Array(D - 1); F < D; F++)
|
|
95
95
|
L[F - 1] = arguments[F];
|
|
96
|
-
|
|
96
|
+
v[p].fn.apply(v[p].context, L);
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
return !0;
|
|
100
|
-
},
|
|
101
|
-
return i(this,
|
|
102
|
-
},
|
|
103
|
-
return i(this,
|
|
104
|
-
},
|
|
105
|
-
var y = o ? o +
|
|
100
|
+
}, a.prototype.on = function(r, d, c) {
|
|
101
|
+
return i(this, r, d, c, !1);
|
|
102
|
+
}, a.prototype.once = function(r, d, c) {
|
|
103
|
+
return i(this, r, d, c, !0);
|
|
104
|
+
}, a.prototype.removeListener = function(r, d, c, b) {
|
|
105
|
+
var y = o ? o + r : r;
|
|
106
106
|
if (!this._events[y]) return this;
|
|
107
|
-
if (!
|
|
108
|
-
return
|
|
107
|
+
if (!d)
|
|
108
|
+
return u(this, y), this;
|
|
109
109
|
var h = this._events[y];
|
|
110
110
|
if (h.fn)
|
|
111
|
-
h.fn ===
|
|
111
|
+
h.fn === d && (!b || h.once) && (!c || h.context === c) && u(this, y);
|
|
112
112
|
else {
|
|
113
|
-
for (var E = 0,
|
|
114
|
-
(h[E].fn !==
|
|
115
|
-
|
|
113
|
+
for (var E = 0, v = [], D = h.length; E < D; E++)
|
|
114
|
+
(h[E].fn !== d || b && !h[E].once || c && h[E].context !== c) && v.push(h[E]);
|
|
115
|
+
v.length ? this._events[y] = v.length === 1 ? v[0] : v : u(this, y);
|
|
116
116
|
}
|
|
117
117
|
return this;
|
|
118
|
-
},
|
|
119
|
-
var
|
|
120
|
-
return
|
|
121
|
-
},
|
|
118
|
+
}, a.prototype.removeAllListeners = function(r) {
|
|
119
|
+
var d;
|
|
120
|
+
return r ? (d = o ? o + r : r, this._events[d] && u(this, d)) : (this._events = new n(), this._eventsCount = 0), this;
|
|
121
|
+
}, a.prototype.off = a.prototype.removeListener, a.prototype.addListener = a.prototype.on, a.prefixed = o, a.EventEmitter = a, t.exports = a;
|
|
122
122
|
})(Je);
|
|
123
123
|
var Pt = Je.exports;
|
|
124
124
|
const Vt = /* @__PURE__ */ St(Pt);
|
|
125
125
|
function jt(t) {
|
|
126
|
-
let
|
|
127
|
-
for (;
|
|
128
|
-
const o = window.getComputedStyle(
|
|
129
|
-
if (/(auto|scroll)/.test(o) &&
|
|
130
|
-
return
|
|
131
|
-
|
|
126
|
+
let l = t;
|
|
127
|
+
for (; l; ) {
|
|
128
|
+
const o = window.getComputedStyle(l).overflowY;
|
|
129
|
+
if (/(auto|scroll)/.test(o) && l.scrollHeight > l.clientHeight)
|
|
130
|
+
return l;
|
|
131
|
+
l = l.parentElement;
|
|
132
132
|
}
|
|
133
133
|
return document.scrollingElement || document.documentElement;
|
|
134
134
|
}
|
|
135
|
-
function Ut(t,
|
|
135
|
+
function Ut(t, l = { behavior: "smooth", block: "start" }) {
|
|
136
136
|
if (!t) return;
|
|
137
137
|
const o = jt(t), n = o.getBoundingClientRect(), i = t.getBoundingClientRect().top - n.top + o.scrollTop;
|
|
138
138
|
o.scrollTo({
|
|
139
|
-
top:
|
|
140
|
-
behavior:
|
|
139
|
+
top: l.block === "start" ? i : i - o.clientHeight + t.offsetHeight,
|
|
140
|
+
behavior: l.behavior
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
143
|
const _ = (t) => {
|
|
@@ -147,7 +147,7 @@ const _ = (t) => {
|
|
|
147
147
|
throw new Error("Toolbar button item needs either icon or label - " + t.name);
|
|
148
148
|
if (!t.name)
|
|
149
149
|
throw new Error("Invalid toolbar item name - " + t.name);
|
|
150
|
-
const o =
|
|
150
|
+
const o = g(At()), n = t.type, e = g(t.name), i = t.command, u = g(t.icon), a = g(t.group || "center"), s = g(t.allowWithoutEditor), r = g(t.attributes || {}), d = t.disabled || !1, c = g(t.disabled), b = g(!1), y = g(!1), h = g(t.style), E = g(t.isNarrow), v = g(t.isWide), D = g(t.minWidth), L = g(t.suppressActiveHighlight || !1), p = g(t.argument), C = g(null), F = g(null), z = g(t.iconColor), B = g(t.hasCaret), q = g(t.dropdownStyles), ve = g(t.tooltip), ge = g(t.tooltipVisible), ce = g(t.tooltipTimeout), de = g(t.defaultLabel), T = g(t.label), M = g(t.hideLabel), H = g(t.inlineTextInputVisible), R = g(t.hasInlineTextInput), X = g(t.markName), Z = g(t.labelAttr), ae = g(t.selectedValue), ue = g(t.dropdownValueKey), Ce = g([]);
|
|
151
151
|
if (t.options) {
|
|
152
152
|
if (!Array.isArray(t.options)) throw new Error("Invalid toolbar item options - " + t.options);
|
|
153
153
|
Ce.value.push(...t.options);
|
|
@@ -157,9 +157,9 @@ const _ = (t) => {
|
|
|
157
157
|
}, Fe = () => {
|
|
158
158
|
xe(), b.value = !1;
|
|
159
159
|
}, Ie = (te) => {
|
|
160
|
-
|
|
160
|
+
c.value = te;
|
|
161
161
|
}, _e = () => {
|
|
162
|
-
|
|
162
|
+
c.value = d;
|
|
163
163
|
}, ee = t.onActivate || (() => null), xe = t.onDeactivate || (() => null), Le = () => {
|
|
164
164
|
const te = {};
|
|
165
165
|
return Object.keys(me).forEach((ye) => {
|
|
@@ -170,24 +170,24 @@ const _ = (t) => {
|
|
|
170
170
|
name: e,
|
|
171
171
|
type: n,
|
|
172
172
|
command: i,
|
|
173
|
-
icon:
|
|
174
|
-
tooltip:
|
|
175
|
-
group:
|
|
176
|
-
attributes:
|
|
177
|
-
disabled:
|
|
173
|
+
icon: u,
|
|
174
|
+
tooltip: ve,
|
|
175
|
+
group: a,
|
|
176
|
+
attributes: r,
|
|
177
|
+
disabled: c,
|
|
178
178
|
active: b,
|
|
179
179
|
expand: y,
|
|
180
180
|
nestedOptions: Ce,
|
|
181
181
|
style: h,
|
|
182
182
|
isNarrow: E,
|
|
183
|
-
isWide:
|
|
183
|
+
isWide: v,
|
|
184
184
|
minWidth: D,
|
|
185
185
|
argument: p,
|
|
186
186
|
parentItem: F,
|
|
187
187
|
iconColor: z,
|
|
188
188
|
hasCaret: B,
|
|
189
189
|
dropdownStyles: q,
|
|
190
|
-
tooltipVisible:
|
|
190
|
+
tooltipVisible: ge,
|
|
191
191
|
tooltipTimeout: ce,
|
|
192
192
|
defaultLabel: de,
|
|
193
193
|
label: T,
|
|
@@ -197,7 +197,7 @@ const _ = (t) => {
|
|
|
197
197
|
markName: X,
|
|
198
198
|
labelAttr: Z,
|
|
199
199
|
childItem: C,
|
|
200
|
-
allowWithoutEditor:
|
|
200
|
+
allowWithoutEditor: s,
|
|
201
201
|
dropdownValueKey: ue,
|
|
202
202
|
selectedValue: ae
|
|
203
203
|
};
|
|
@@ -214,29 +214,29 @@ const _ = (t) => {
|
|
|
214
214
|
}, qt = { class: "alignment-buttons" }, Gt = ["innerHTML"], Kt = ["innerHTML"], Xt = ["innerHTML"], Zt = ["innerHTML"], Yt = {
|
|
215
215
|
__name: "AlignmentButtons",
|
|
216
216
|
emits: ["select"],
|
|
217
|
-
setup(t, { emit:
|
|
218
|
-
const o =
|
|
217
|
+
setup(t, { emit: l }) {
|
|
218
|
+
const o = l, n = (e) => {
|
|
219
219
|
o("select", e);
|
|
220
220
|
};
|
|
221
|
-
return (e, i) => (
|
|
221
|
+
return (e, i) => (k(), w("div", qt, [
|
|
222
222
|
x("div", {
|
|
223
223
|
class: "button-icon",
|
|
224
|
-
onClick: i[0] || (i[0] = (
|
|
224
|
+
onClick: i[0] || (i[0] = (u) => n("left")),
|
|
225
225
|
innerHTML: $(G).alignLeft
|
|
226
226
|
}, null, 8, Gt),
|
|
227
227
|
x("div", {
|
|
228
228
|
class: "button-icon",
|
|
229
|
-
onClick: i[1] || (i[1] = (
|
|
229
|
+
onClick: i[1] || (i[1] = (u) => n("center")),
|
|
230
230
|
innerHTML: $(G).alignCenter
|
|
231
231
|
}, null, 8, Kt),
|
|
232
232
|
x("div", {
|
|
233
233
|
class: "button-icon",
|
|
234
|
-
onClick: i[2] || (i[2] = (
|
|
234
|
+
onClick: i[2] || (i[2] = (u) => n("right")),
|
|
235
235
|
innerHTML: $(G).alignRight
|
|
236
236
|
}, null, 8, Xt),
|
|
237
237
|
x("div", {
|
|
238
238
|
class: "button-icon",
|
|
239
|
-
onClick: i[3] || (i[3] = (
|
|
239
|
+
onClick: i[3] || (i[3] = (u) => n("justify")),
|
|
240
240
|
innerHTML: $(G).alignJustify
|
|
241
241
|
}, null, 8, Zt)
|
|
242
242
|
]));
|
|
@@ -279,39 +279,39 @@ const _ = (t) => {
|
|
|
279
279
|
}
|
|
280
280
|
},
|
|
281
281
|
emits: ["submit", "cancel"],
|
|
282
|
-
setup(t, { emit:
|
|
283
|
-
const o =
|
|
284
|
-
if (e?.$submit instanceof Function && e.$submit(),
|
|
285
|
-
o("submit", { text:
|
|
282
|
+
setup(t, { emit: l }) {
|
|
283
|
+
const o = l, n = t, { proxy: e } = It(), i = () => {
|
|
284
|
+
if (e?.$submit instanceof Function && e.$submit(), r.value && c.value) {
|
|
285
|
+
o("submit", { text: s.value, href: d.value });
|
|
286
286
|
return;
|
|
287
|
-
} else if (!
|
|
288
|
-
o("submit", { text:
|
|
287
|
+
} else if (!r.value) {
|
|
288
|
+
o("submit", { text: s.value, href: null });
|
|
289
289
|
return;
|
|
290
290
|
}
|
|
291
|
-
console.debug("[LinkInput] Invalid URL in handleSubmit"),
|
|
292
|
-
},
|
|
293
|
-
o("submit", { text:
|
|
294
|
-
},
|
|
295
|
-
const p =
|
|
296
|
-
return
|
|
297
|
-
}), b = j(() => h.value ? "Apply" : "Remove"), y = j(() => !
|
|
298
|
-
window.open(
|
|
291
|
+
console.debug("[LinkInput] Invalid URL in handleSubmit"), a.value = !0;
|
|
292
|
+
}, u = () => {
|
|
293
|
+
o("submit", { text: s.value, href: null });
|
|
294
|
+
}, a = g(!1), s = g(n.initialText), r = g(n.href), d = j(() => r.value?.startsWith("http") ? r.value : "http://" + r.value), c = j(() => {
|
|
295
|
+
const p = d.value.split(".").filter(Boolean);
|
|
296
|
+
return d.value.includes(".") && p.length > 1;
|
|
297
|
+
}), b = j(() => h.value ? "Apply" : "Remove"), y = j(() => !c.value), h = j(() => !E.value), E = j(() => n.href && !r.value), v = j(() => n.href.startsWith("#")), D = () => {
|
|
298
|
+
window.open(d.value, "_blank");
|
|
299
299
|
};
|
|
300
300
|
Lt(
|
|
301
301
|
() => n.href,
|
|
302
302
|
(p) => {
|
|
303
|
-
|
|
303
|
+
r.value = p;
|
|
304
304
|
}
|
|
305
305
|
);
|
|
306
306
|
const L = () => {
|
|
307
307
|
const p = document.querySelector(".link-input-ctn input");
|
|
308
308
|
p && p.focus();
|
|
309
309
|
};
|
|
310
|
-
return
|
|
310
|
+
return we(() => {
|
|
311
311
|
n.showInput && L();
|
|
312
|
-
}), (p, C) => (
|
|
313
|
-
t.href ?
|
|
314
|
-
t.showInput && !
|
|
312
|
+
}), (p, C) => (k(), w("div", Qt, [
|
|
313
|
+
t.href ? v.value ? (k(), w("div", tn, "Page anchor")) : (k(), w("div", nn, "Edit link")) : (k(), w("div", en, "Add link")),
|
|
314
|
+
t.showInput && !v.value ? (k(), w("div", on, [
|
|
315
315
|
x("div", sn, [
|
|
316
316
|
x("div", {
|
|
317
317
|
class: "input-icon",
|
|
@@ -320,26 +320,26 @@ const _ = (t) => {
|
|
|
320
320
|
Mt(x("input", {
|
|
321
321
|
type: "text",
|
|
322
322
|
placeholder: "Type or paste a link",
|
|
323
|
-
class: oe({ error:
|
|
324
|
-
"onUpdate:modelValue": C[0] || (C[0] = (F) =>
|
|
323
|
+
class: oe({ error: a.value }),
|
|
324
|
+
"onUpdate:modelValue": C[0] || (C[0] = (F) => r.value = F),
|
|
325
325
|
onKeydown: [
|
|
326
|
-
Dt(
|
|
327
|
-
C[1] || (C[1] = (F) =>
|
|
326
|
+
Dt(ke(i, ["stop", "prevent"]), ["enter"]),
|
|
327
|
+
C[1] || (C[1] = (F) => a.value = !1)
|
|
328
328
|
]
|
|
329
329
|
}, null, 42, an), [
|
|
330
|
-
[$t,
|
|
330
|
+
[$t, r.value]
|
|
331
331
|
]),
|
|
332
332
|
x("div", {
|
|
333
|
-
class: oe(["open-link-icon", { disabled: !
|
|
333
|
+
class: oe(["open-link-icon", { disabled: !c.value }]),
|
|
334
334
|
innerHTML: $(G).openLink,
|
|
335
335
|
onClick: D
|
|
336
336
|
}, null, 10, rn)
|
|
337
337
|
]),
|
|
338
338
|
x("div", cn, [
|
|
339
|
-
t.href ? (
|
|
339
|
+
t.href ? (k(), w("button", {
|
|
340
340
|
key: 0,
|
|
341
341
|
class: "remove-btn",
|
|
342
|
-
onClick:
|
|
342
|
+
onClick: u
|
|
343
343
|
}, [
|
|
344
344
|
x("div", {
|
|
345
345
|
class: "remove-btn__icon",
|
|
@@ -347,20 +347,20 @@ const _ = (t) => {
|
|
|
347
347
|
}, null, 8, dn),
|
|
348
348
|
C[3] || (C[3] = Ht(" Remove "))
|
|
349
349
|
])) : ne("", !0),
|
|
350
|
-
h.value ? (
|
|
350
|
+
h.value ? (k(), w("button", {
|
|
351
351
|
key: 1,
|
|
352
352
|
class: oe(["submit-btn", { "disable-btn": y.value }]),
|
|
353
353
|
onClick: i
|
|
354
354
|
}, ie(b.value), 3)) : ne("", !0)
|
|
355
355
|
])
|
|
356
|
-
])) :
|
|
356
|
+
])) : v.value ? (k(), w("div", un, [
|
|
357
357
|
x("a", {
|
|
358
|
-
onClick: C[2] || (C[2] =
|
|
358
|
+
onClick: C[2] || (C[2] = ke((...F) => t.goToAnchor && t.goToAnchor(...F), ["stop", "prevent"]))
|
|
359
359
|
}, "Go to " + ie(t.href.startsWith("#_") ? t.href.substring(2) : t.href), 1)
|
|
360
360
|
])) : ne("", !0)
|
|
361
361
|
]));
|
|
362
362
|
}
|
|
363
|
-
}, pn = /* @__PURE__ */ K(mn, [["__scopeId", "data-v-6990d5b2"]]), fn = { class: "document-mode" }, hn = ["onClick"],
|
|
363
|
+
}, pn = /* @__PURE__ */ K(mn, [["__scopeId", "data-v-6990d5b2"]]), fn = { class: "document-mode" }, hn = ["onClick"], vn = { class: "document-mode-column icon-column" }, gn = ["innerHTML"], yn = { class: "document-mode-column text-column" }, bn = { class: "document-mode-type" }, kn = { class: "document-mode-description" }, wn = {
|
|
364
364
|
__name: "DocumentMode",
|
|
365
365
|
props: {
|
|
366
366
|
options: {
|
|
@@ -368,29 +368,29 @@ const _ = (t) => {
|
|
|
368
368
|
}
|
|
369
369
|
},
|
|
370
370
|
emits: ["select"],
|
|
371
|
-
setup(t, { emit:
|
|
372
|
-
const o =
|
|
371
|
+
setup(t, { emit: l }) {
|
|
372
|
+
const o = l, n = (e) => {
|
|
373
373
|
o("select", e);
|
|
374
374
|
};
|
|
375
|
-
return (e, i) => (
|
|
376
|
-
(
|
|
377
|
-
class: oe(["option-item", { disabled:
|
|
378
|
-
onClick: (
|
|
375
|
+
return (e, i) => (k(), w("div", fn, [
|
|
376
|
+
(k(!0), w(U, null, Q(t.options, (u) => (k(), w("div", {
|
|
377
|
+
class: oe(["option-item", { disabled: u.disabled }]),
|
|
378
|
+
onClick: (a) => n(u)
|
|
379
379
|
}, [
|
|
380
|
-
x("div",
|
|
380
|
+
x("div", vn, [
|
|
381
381
|
x("div", {
|
|
382
382
|
class: "icon-column__icon",
|
|
383
|
-
innerHTML:
|
|
384
|
-
}, null, 8,
|
|
383
|
+
innerHTML: u.icon
|
|
384
|
+
}, null, 8, gn)
|
|
385
385
|
]),
|
|
386
386
|
x("div", yn, [
|
|
387
|
-
x("div", bn, ie(
|
|
388
|
-
x("div",
|
|
387
|
+
x("div", bn, ie(u.label), 1),
|
|
388
|
+
x("div", kn, ie(u.description), 1)
|
|
389
389
|
])
|
|
390
390
|
], 10, hn))), 256))
|
|
391
391
|
]));
|
|
392
392
|
}
|
|
393
|
-
}, Cn = /* @__PURE__ */ K(
|
|
393
|
+
}, Cn = /* @__PURE__ */ K(wn, [["__scopeId", "data-v-f86e1477"]]), _n = {
|
|
394
394
|
key: 0,
|
|
395
395
|
class: "linked-style-buttons"
|
|
396
396
|
}, xn = ["onClick"], En = {
|
|
@@ -402,19 +402,19 @@ const _ = (t) => {
|
|
|
402
402
|
}
|
|
403
403
|
},
|
|
404
404
|
emits: ["select"],
|
|
405
|
-
setup(t, { emit:
|
|
406
|
-
const o =
|
|
405
|
+
setup(t, { emit: l }) {
|
|
406
|
+
const o = l, n = t, e = (i) => {
|
|
407
407
|
o("select", i);
|
|
408
408
|
};
|
|
409
|
-
return (i,
|
|
410
|
-
(
|
|
409
|
+
return (i, u) => n.editor ? (k(), w("div", _n, [
|
|
410
|
+
(k(!0), w(U, null, Q($(Ke)(t.editor), (a) => (k(), w("div", {
|
|
411
411
|
class: "style-item",
|
|
412
|
-
onClick: (
|
|
412
|
+
onClick: (s) => e(a)
|
|
413
413
|
}, [
|
|
414
414
|
x("div", {
|
|
415
415
|
class: "style-name",
|
|
416
|
-
style: J($(pt)(
|
|
417
|
-
}, ie(
|
|
416
|
+
style: J($(pt)(a, null, !1))
|
|
417
|
+
}, ie(a.definition.attrs.name), 5)
|
|
418
418
|
], 8, xn))), 256))
|
|
419
419
|
])) : ne("", !0);
|
|
420
420
|
}
|
|
@@ -431,31 +431,31 @@ const _ = (t) => {
|
|
|
431
431
|
}
|
|
432
432
|
},
|
|
433
433
|
emits: ["select"],
|
|
434
|
-
setup(t, { emit:
|
|
435
|
-
const o =
|
|
436
|
-
o("select",
|
|
434
|
+
setup(t, { emit: l }) {
|
|
435
|
+
const o = l, n = t, e = j(() => (a) => n.activeColor.value ? n.activeColor.value.toUpperCase() === a.value : !1), i = (a, s) => s === 5 || ["#FFFFFF", "#FAFF09"].includes(a) ? { color: "#000" } : { color: "#FFF" }, u = (a) => {
|
|
436
|
+
o("select", a.value);
|
|
437
437
|
};
|
|
438
|
-
return
|
|
439
|
-
if (!n.icons.every((
|
|
440
|
-
}), (
|
|
438
|
+
return we(() => {
|
|
439
|
+
if (!n.icons.every((s) => Array.isArray(s))) throw new Error("icon props must be 2d array");
|
|
440
|
+
}), (a, s) => (k(!0), w(U, null, Q(t.icons, (r, d) => (k(), w("div", {
|
|
441
441
|
class: "option-row",
|
|
442
|
-
key:
|
|
442
|
+
key: d
|
|
443
443
|
}, [
|
|
444
|
-
(
|
|
444
|
+
(k(!0), w(U, null, Q(r, (c, b) => (k(), w("div", {
|
|
445
445
|
class: "option",
|
|
446
446
|
key: b,
|
|
447
|
-
onClick:
|
|
447
|
+
onClick: ke((y) => u(c), ["stop", "prevent"])
|
|
448
448
|
}, [
|
|
449
449
|
x("div", {
|
|
450
450
|
class: "option__icon",
|
|
451
|
-
innerHTML:
|
|
452
|
-
style: J(
|
|
451
|
+
innerHTML: c.icon,
|
|
452
|
+
style: J(c.style)
|
|
453
453
|
}, null, 12, Tn),
|
|
454
|
-
e.value(
|
|
454
|
+
e.value(c) ? (k(), w("div", {
|
|
455
455
|
key: 0,
|
|
456
456
|
class: "option__check",
|
|
457
457
|
innerHTML: $(G).colorOptionCheck,
|
|
458
|
-
style: J(i(
|
|
458
|
+
style: J(i(c.value, b))
|
|
459
459
|
}, null, 12, Fn)) : ne("", !0)
|
|
460
460
|
], 8, An))), 128))
|
|
461
461
|
]))), 128));
|
|
@@ -477,17 +477,17 @@ const _ = (t) => {
|
|
|
477
477
|
}
|
|
478
478
|
},
|
|
479
479
|
emits: ["select", "clickoutside"],
|
|
480
|
-
setup(t, { emit:
|
|
481
|
-
const o =
|
|
480
|
+
setup(t, { emit: l }) {
|
|
481
|
+
const o = l, n = (e) => {
|
|
482
482
|
o("select", e);
|
|
483
483
|
};
|
|
484
|
-
return (e, i) => (
|
|
484
|
+
return (e, i) => (k(), w("div", Ln, [
|
|
485
485
|
V(Ge, {
|
|
486
486
|
icons: t.icons,
|
|
487
487
|
"active-color": t.activeColor,
|
|
488
488
|
onSelect: n
|
|
489
489
|
}, null, 8, ["icons", "active-color"]),
|
|
490
|
-
t.customIcons.flat().length ? (
|
|
490
|
+
t.customIcons.flat().length ? (k(), w(U, { key: 0 }, [
|
|
491
491
|
i[0] || (i[0] = x("span", { class: "option-grid-ctn__subtitle" }, "Custom colors", -1)),
|
|
492
492
|
V(Ge, {
|
|
493
493
|
icons: t.customIcons,
|
|
@@ -499,8 +499,8 @@ const _ = (t) => {
|
|
|
499
499
|
}
|
|
500
500
|
}, Dn = /* @__PURE__ */ K(Mn, [["__scopeId", "data-v-fa2949d8"]]), $n = (t) => {
|
|
501
501
|
t.expand.value = !1;
|
|
502
|
-
}, f = (t,
|
|
503
|
-
label:
|
|
502
|
+
}, f = (t, l = null) => ({
|
|
503
|
+
label: l,
|
|
504
504
|
icon: G.colorOption,
|
|
505
505
|
value: t,
|
|
506
506
|
style: {
|
|
@@ -508,15 +508,15 @@ const _ = (t) => {
|
|
|
508
508
|
boxShadow: "0 0 5px 1px rgba(0, 0, 0, 0.1)",
|
|
509
509
|
borderRadius: "50%"
|
|
510
510
|
}
|
|
511
|
-
}), Ne = (t,
|
|
511
|
+
}), Ne = (t, l, o = []) => {
|
|
512
512
|
const n = (e) => {
|
|
513
|
-
|
|
513
|
+
l.iconColor.value = e, t.emitCommand({ item: l, argument: e }), $n(l);
|
|
514
514
|
};
|
|
515
515
|
return N("div", {}, [
|
|
516
516
|
N(Dn, {
|
|
517
517
|
icons: Qe,
|
|
518
518
|
customIcons: o,
|
|
519
|
-
activeColor:
|
|
519
|
+
activeColor: l.iconColor,
|
|
520
520
|
onSelect: n
|
|
521
521
|
})
|
|
522
522
|
]);
|
|
@@ -596,34 +596,34 @@ const _ = (t) => {
|
|
|
596
596
|
], Hn = () => Qe.flat().map((t) => t.value), Bn = { class: "toolbar-table-grid-wrapper" }, Rn = ["data-cols", "data-rows", "onClick"], On = { class: "toolbar-table-grid-value" }, Nn = {
|
|
597
597
|
__name: "TableGrid",
|
|
598
598
|
emits: ["select", "clickoutside"],
|
|
599
|
-
setup(t, { emit:
|
|
600
|
-
const o =
|
|
601
|
-
let
|
|
602
|
-
if (!!
|
|
599
|
+
setup(t, { emit: l }) {
|
|
600
|
+
const o = l, n = g(0), e = g(0), i = (a) => {
|
|
601
|
+
let s = a.target;
|
|
602
|
+
if (!!s.dataset.grid)
|
|
603
603
|
return;
|
|
604
|
-
let
|
|
604
|
+
let c = [...s.parentElement.querySelectorAll("[data-item]")], b = parseInt(s.dataset.cols, 10), y = parseInt(s.dataset.rows, 10);
|
|
605
605
|
e.value = b, n.value = y;
|
|
606
|
-
for (let h = 0; h <
|
|
607
|
-
let E =
|
|
608
|
-
|
|
606
|
+
for (let h = 0; h < c.length; h++) {
|
|
607
|
+
let E = c[h], v = parseInt(E.dataset.cols, 10), D = parseInt(E.dataset.rows, 10);
|
|
608
|
+
v <= b && D <= y ? E.classList.add("selected") : E.classList.remove("selected");
|
|
609
609
|
}
|
|
610
|
-
},
|
|
611
|
-
o("select", { cols:
|
|
610
|
+
}, u = ({ cols: a, rows: s }) => {
|
|
611
|
+
o("select", { cols: a, rows: s });
|
|
612
612
|
};
|
|
613
|
-
return (
|
|
613
|
+
return (a, s) => (k(), w("div", Bn, [
|
|
614
614
|
x("div", {
|
|
615
615
|
class: "toolbar-table-grid",
|
|
616
616
|
onMouseover: i,
|
|
617
617
|
"data-grid": "true"
|
|
618
618
|
}, [
|
|
619
|
-
(
|
|
620
|
-
(
|
|
619
|
+
(k(), w(U, null, Q(5, (r) => (k(), w(U, { key: r }, [
|
|
620
|
+
(k(), w(U, null, Q(5, (d) => x("div", {
|
|
621
621
|
class: "toolbar-table-grid__item",
|
|
622
|
-
key: `${
|
|
623
|
-
"data-cols":
|
|
624
|
-
"data-rows":
|
|
622
|
+
key: `${r}_${d}`,
|
|
623
|
+
"data-cols": d,
|
|
624
|
+
"data-rows": r,
|
|
625
625
|
"data-item": "true",
|
|
626
|
-
onClick:
|
|
626
|
+
onClick: ke((c) => u({ cols: d, rows: r }), ["stop", "prevent"])
|
|
627
627
|
}, null, 8, Rn)), 64))
|
|
628
628
|
], 64))), 64))
|
|
629
629
|
], 32),
|
|
@@ -638,36 +638,36 @@ const _ = (t) => {
|
|
|
638
638
|
}
|
|
639
639
|
},
|
|
640
640
|
emits: ["select"],
|
|
641
|
-
setup(t, { emit:
|
|
642
|
-
const o =
|
|
641
|
+
setup(t, { emit: l }) {
|
|
642
|
+
const o = l, n = (e) => {
|
|
643
643
|
o("select", { command: e.command });
|
|
644
644
|
};
|
|
645
|
-
return (e, i) => (
|
|
646
|
-
(
|
|
647
|
-
class: oe(["toolbar-table-actions__item", { "toolbar-table-actions__item--border":
|
|
648
|
-
onClick: (
|
|
645
|
+
return (e, i) => (k(), w("div", Wn, [
|
|
646
|
+
(k(!0), w(U, null, Q(t.options, (u) => (k(), w("div", {
|
|
647
|
+
class: oe(["toolbar-table-actions__item", { "toolbar-table-actions__item--border": u.bottomBorder }]),
|
|
648
|
+
onClick: (a) => n(u)
|
|
649
649
|
}, [
|
|
650
650
|
x("div", Vn, [
|
|
651
651
|
x("div", {
|
|
652
652
|
class: "toolbar-table-actions__icon-wrapper",
|
|
653
|
-
innerHTML:
|
|
653
|
+
innerHTML: u.icon
|
|
654
654
|
}, null, 8, jn)
|
|
655
655
|
]),
|
|
656
|
-
x("div", Un, ie(
|
|
656
|
+
x("div", Un, ie(u.label), 1)
|
|
657
657
|
], 10, Pn))), 256))
|
|
658
658
|
]));
|
|
659
659
|
}
|
|
660
660
|
}, Gn = /* @__PURE__ */ K(qn, [["__scopeId", "data-v-9a702d7f"]]), Kn = `<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>
|
|
661
661
|
`, le = (t) => {
|
|
662
662
|
t.expand.value = !1;
|
|
663
|
-
}, Xn = (t,
|
|
663
|
+
}, Xn = (t, l = !1, o, n, e) => {
|
|
664
664
|
const i = _({
|
|
665
665
|
type: "button",
|
|
666
666
|
name: "bold",
|
|
667
667
|
command: "toggleBold",
|
|
668
668
|
icon: e.bold,
|
|
669
669
|
tooltip: "Bold"
|
|
670
|
-
}),
|
|
670
|
+
}), u = _({
|
|
671
671
|
type: "dropdown",
|
|
672
672
|
name: "fontFamily",
|
|
673
673
|
tooltip: "Font",
|
|
@@ -715,10 +715,10 @@ const _ = (t) => {
|
|
|
715
715
|
}
|
|
716
716
|
],
|
|
717
717
|
onActivate: ({ fontFamily: m }) => {
|
|
718
|
-
m && (
|
|
718
|
+
m && (u.label.value = m);
|
|
719
719
|
},
|
|
720
|
-
onDeactivate: () =>
|
|
721
|
-
}),
|
|
720
|
+
onDeactivate: () => u.label.value = u.defaultLabel.value
|
|
721
|
+
}), a = _({
|
|
722
722
|
type: "dropdown",
|
|
723
723
|
dropdownStyles: {
|
|
724
724
|
padding: 0,
|
|
@@ -747,7 +747,7 @@ const _ = (t) => {
|
|
|
747
747
|
[
|
|
748
748
|
N(Wt, {
|
|
749
749
|
handleClose: () => {
|
|
750
|
-
le(
|
|
750
|
+
le(a);
|
|
751
751
|
},
|
|
752
752
|
selectedText: m,
|
|
753
753
|
editor: t.activeEditor,
|
|
@@ -759,7 +759,7 @@ const _ = (t) => {
|
|
|
759
759
|
}
|
|
760
760
|
}
|
|
761
761
|
]
|
|
762
|
-
}),
|
|
762
|
+
}), s = _({
|
|
763
763
|
type: "dropdown",
|
|
764
764
|
name: "fontSize",
|
|
765
765
|
defaultLabel: "12",
|
|
@@ -791,22 +791,22 @@ const _ = (t) => {
|
|
|
791
791
|
{ label: "96", key: "96pt" }
|
|
792
792
|
],
|
|
793
793
|
onActivate: ({ fontSize: m }) => {
|
|
794
|
-
if (!m) return
|
|
794
|
+
if (!m) return s.label.value = s.defaultLabel.value;
|
|
795
795
|
let S = Nt(m, 12);
|
|
796
|
-
S < 8 && (S = 8), S > 96 && (S = 96),
|
|
796
|
+
S < 8 && (S = 8), S > 96 && (S = 96), s.label.value = String(S);
|
|
797
797
|
},
|
|
798
|
-
onDeactivate: () =>
|
|
799
|
-
}),
|
|
798
|
+
onDeactivate: () => s.label.value = s.defaultLabel.value
|
|
799
|
+
}), r = _({
|
|
800
800
|
type: "separator",
|
|
801
801
|
name: "separator",
|
|
802
802
|
isNarrow: !0
|
|
803
|
-
}),
|
|
803
|
+
}), d = _({
|
|
804
804
|
type: "button",
|
|
805
805
|
name: "italic",
|
|
806
806
|
command: "toggleItalic",
|
|
807
807
|
icon: e.italic,
|
|
808
808
|
tooltip: "Italic"
|
|
809
|
-
}),
|
|
809
|
+
}), c = _({
|
|
810
810
|
type: "button",
|
|
811
811
|
name: "underline",
|
|
812
812
|
command: "toggleUnderline",
|
|
@@ -891,12 +891,12 @@ const _ = (t) => {
|
|
|
891
891
|
})
|
|
892
892
|
]);
|
|
893
893
|
}
|
|
894
|
-
const
|
|
894
|
+
const v = _({
|
|
895
895
|
type: "options",
|
|
896
896
|
name: "linkInput",
|
|
897
897
|
command: "toggleLink"
|
|
898
898
|
});
|
|
899
|
-
h.childItem =
|
|
899
|
+
h.childItem = v, v.parentItem = h;
|
|
900
900
|
const D = _({
|
|
901
901
|
type: "button",
|
|
902
902
|
name: "image",
|
|
@@ -1051,13 +1051,13 @@ const _ = (t) => {
|
|
|
1051
1051
|
justify: e.alignJustify
|
|
1052
1052
|
}, se = P[A] ?? P.left;
|
|
1053
1053
|
m.icon.value = se;
|
|
1054
|
-
},
|
|
1054
|
+
}, ve = _({
|
|
1055
1055
|
type: "button",
|
|
1056
1056
|
name: "list",
|
|
1057
1057
|
command: "toggleBulletList",
|
|
1058
1058
|
icon: e.bulletList,
|
|
1059
1059
|
tooltip: "Bullet list"
|
|
1060
|
-
}),
|
|
1060
|
+
}), ge = _({
|
|
1061
1061
|
type: "button",
|
|
1062
1062
|
name: "numberedlist",
|
|
1063
1063
|
command: "toggleOrderedList",
|
|
@@ -1178,8 +1178,8 @@ const _ = (t) => {
|
|
|
1178
1178
|
});
|
|
1179
1179
|
[
|
|
1180
1180
|
i,
|
|
1181
|
-
|
|
1182
|
-
|
|
1181
|
+
d,
|
|
1182
|
+
c,
|
|
1183
1183
|
de,
|
|
1184
1184
|
ce,
|
|
1185
1185
|
// search,
|
|
@@ -1348,35 +1348,35 @@ const _ = (t) => {
|
|
|
1348
1348
|
// toggleTrackChangesOriginal,
|
|
1349
1349
|
// toggleTrackChangesFinal,
|
|
1350
1350
|
M,
|
|
1351
|
-
d,
|
|
1352
|
-
c,
|
|
1353
|
-
a,
|
|
1354
|
-
c,
|
|
1355
|
-
i,
|
|
1356
1351
|
u,
|
|
1357
1352
|
r,
|
|
1353
|
+
s,
|
|
1354
|
+
r,
|
|
1355
|
+
i,
|
|
1356
|
+
d,
|
|
1357
|
+
c,
|
|
1358
1358
|
y,
|
|
1359
1359
|
b,
|
|
1360
|
-
|
|
1360
|
+
r,
|
|
1361
1361
|
h,
|
|
1362
1362
|
D,
|
|
1363
1363
|
L,
|
|
1364
1364
|
C,
|
|
1365
|
-
|
|
1365
|
+
r,
|
|
1366
1366
|
B,
|
|
1367
|
-
ge,
|
|
1368
1367
|
ve,
|
|
1368
|
+
ge,
|
|
1369
1369
|
ce,
|
|
1370
1370
|
de,
|
|
1371
1371
|
re,
|
|
1372
|
-
|
|
1372
|
+
r,
|
|
1373
1373
|
be,
|
|
1374
|
-
|
|
1374
|
+
r,
|
|
1375
1375
|
me,
|
|
1376
1376
|
Fe,
|
|
1377
1377
|
Te,
|
|
1378
1378
|
ye,
|
|
1379
|
-
|
|
1379
|
+
a,
|
|
1380
1380
|
T,
|
|
1381
1381
|
ee
|
|
1382
1382
|
// search,
|
|
@@ -1388,7 +1388,7 @@ const _ = (t) => {
|
|
|
1388
1388
|
O = O.filter((A) => !S.includes(A.name.value));
|
|
1389
1389
|
}
|
|
1390
1390
|
const Pe = [X, ue, Ce];
|
|
1391
|
-
|
|
1391
|
+
l || (n === "viewer" && Pe.push(Z, ae), O = O.filter((m) => !Pe.includes(m)));
|
|
1392
1392
|
const rt = [H, T, ee].map((m) => m.name), ct = (m) => rt.includes(m.name), Ee = [], De = [];
|
|
1393
1393
|
let $e = st + it;
|
|
1394
1394
|
return O.forEach((m) => {
|
|
@@ -1416,86 +1416,86 @@ const _ = (t) => {
|
|
|
1416
1416
|
}, Zn = [".jpg", ".jpeg", ".png", "image/jpeg", "image/png"], Yn = () => {
|
|
1417
1417
|
let t = document.createElement("input");
|
|
1418
1418
|
t.type = "file";
|
|
1419
|
-
let
|
|
1420
|
-
return t.accept =
|
|
1419
|
+
let l = Zn;
|
|
1420
|
+
return t.accept = l.join(","), () => new Promise((n, e) => {
|
|
1421
1421
|
t.onchange = async () => {
|
|
1422
1422
|
const i = t.files;
|
|
1423
1423
|
if (!i) return n(null);
|
|
1424
|
-
const
|
|
1425
|
-
return n(
|
|
1424
|
+
const u = i.item(0);
|
|
1425
|
+
return n(u ? { file: u } : null);
|
|
1426
1426
|
}, t.oncancel = () => n(null), t.onerror = e, t.click();
|
|
1427
1427
|
});
|
|
1428
|
-
}, Jn = (t) => new Promise((
|
|
1428
|
+
}, Jn = (t) => new Promise((l, o) => {
|
|
1429
1429
|
let n = new FileReader();
|
|
1430
|
-
n.onload = (e) =>
|
|
1431
|
-
}), Qn = (t,
|
|
1430
|
+
n.onload = (e) => l(e.target.result), n.onerror = o, setTimeout(() => n.readAsDataURL(t), 250);
|
|
1431
|
+
}), Qn = (t, l) => new Promise((o, n) => {
|
|
1432
1432
|
const e = new window.Image();
|
|
1433
1433
|
e.onload = () => {
|
|
1434
|
-
const i = document.createElement("canvas"), { width:
|
|
1434
|
+
const i = document.createElement("canvas"), { width: u, height: a } = eo(
|
|
1435
1435
|
e.width,
|
|
1436
1436
|
e.height,
|
|
1437
|
-
|
|
1437
|
+
l
|
|
1438
1438
|
);
|
|
1439
|
-
if (i.width =
|
|
1440
|
-
const
|
|
1441
|
-
o(
|
|
1439
|
+
if (i.width = u, i.height = a, i.getContext("2d").drawImage(e, 0, 0, u, a), typeof t == "string") {
|
|
1440
|
+
const r = i.toDataURL();
|
|
1441
|
+
o(r);
|
|
1442
1442
|
} else
|
|
1443
|
-
i.toBlob((
|
|
1444
|
-
const
|
|
1443
|
+
i.toBlob((r) => {
|
|
1444
|
+
const d = new File([r], t.name, {
|
|
1445
1445
|
type: t.type,
|
|
1446
1446
|
lastModified: Date.now()
|
|
1447
1447
|
});
|
|
1448
|
-
o({ file:
|
|
1448
|
+
o({ file: d, width: u, height: a });
|
|
1449
1449
|
});
|
|
1450
1450
|
}, e.onerror = (i) => n(i), e.src = typeof t == "string" ? t : URL.createObjectURL(t);
|
|
1451
|
-
}), eo = (t,
|
|
1451
|
+
}), eo = (t, l, o) => {
|
|
1452
1452
|
const { width: n, height: e } = o.getMaxContentSize();
|
|
1453
|
-
if (!n || !e) return { width: t, height:
|
|
1454
|
-
let i = t,
|
|
1455
|
-
const
|
|
1456
|
-
return
|
|
1457
|
-
}, to = async ({ editor: t, view:
|
|
1453
|
+
if (!n || !e) return { width: t, height: l };
|
|
1454
|
+
let i = t, u = l;
|
|
1455
|
+
const a = t / l;
|
|
1456
|
+
return l > e && (u = e, i = Math.round(e * a)), i > n && (i = n, u = Math.round(n / a)), { width: i, height: u };
|
|
1457
|
+
}, to = async ({ editor: t, view: l, file: o }) => {
|
|
1458
1458
|
let n = typeof t.options.handleImageUpload == "function" ? t.options.handleImageUpload : Jn;
|
|
1459
1459
|
if ((o.size / (1024 * 1024)).toFixed(4) > 5) {
|
|
1460
1460
|
window.alert("Image size must be less than 5MB");
|
|
1461
1461
|
return;
|
|
1462
1462
|
}
|
|
1463
|
-
let i,
|
|
1463
|
+
let i, u;
|
|
1464
1464
|
try {
|
|
1465
|
-
const
|
|
1466
|
-
i =
|
|
1467
|
-
} catch (
|
|
1468
|
-
console.warn("Error processing image:",
|
|
1465
|
+
const c = await Qn(o, t);
|
|
1466
|
+
i = c.width, u = c.height, o = c.file;
|
|
1467
|
+
} catch (c) {
|
|
1468
|
+
console.warn("Error processing image:", c);
|
|
1469
1469
|
return;
|
|
1470
1470
|
}
|
|
1471
|
-
let
|
|
1472
|
-
|
|
1473
|
-
let
|
|
1471
|
+
let a = {}, { tr: s, schema: r } = l.state;
|
|
1472
|
+
s.selection.empty || s.deleteSelection();
|
|
1473
|
+
let d = {
|
|
1474
1474
|
type: "add",
|
|
1475
|
-
pos:
|
|
1476
|
-
id:
|
|
1475
|
+
pos: s.selection.from,
|
|
1476
|
+
id: a
|
|
1477
1477
|
};
|
|
1478
|
-
|
|
1479
|
-
(
|
|
1480
|
-
let b = o.name.replace(" ", "_"), y = ft(
|
|
1478
|
+
s.setMeta(Re, d), l.dispatch(s), n(o).then(
|
|
1479
|
+
(c) => {
|
|
1480
|
+
let b = o.name.replace(" ", "_"), y = ft(l.state, a);
|
|
1481
1481
|
if (y == null)
|
|
1482
1482
|
return;
|
|
1483
|
-
let h = { type: "remove", id:
|
|
1483
|
+
let h = { type: "remove", id: a }, E = `word/media/${b}`, v = r.nodes.image.create({
|
|
1484
1484
|
src: E,
|
|
1485
|
-
size: { width: i, height:
|
|
1485
|
+
size: { width: i, height: u }
|
|
1486
1486
|
});
|
|
1487
|
-
t.storage.image.media = Object.assign(t.storage.image.media, { [E]:
|
|
1488
|
-
|
|
1487
|
+
t.storage.image.media = Object.assign(t.storage.image.media, { [E]: c }), t.options.ydoc && t.commands.addImageToCollaboration({ mediaPath: E, fileData: c }), l.dispatch(
|
|
1488
|
+
l.state.tr.replaceWith(y, y, v).setMeta(Re, h)
|
|
1489
1489
|
);
|
|
1490
1490
|
},
|
|
1491
1491
|
() => {
|
|
1492
|
-
let
|
|
1493
|
-
|
|
1492
|
+
let c = { type: "remove", id: a };
|
|
1493
|
+
l.dispatch(s.setMeta(Re, c));
|
|
1494
1494
|
}
|
|
1495
1495
|
);
|
|
1496
1496
|
};
|
|
1497
1497
|
var I, et, he, ze, tt, nt, We, ot, fe;
|
|
1498
|
-
class
|
|
1498
|
+
class wo extends Vt {
|
|
1499
1499
|
constructor(o) {
|
|
1500
1500
|
super();
|
|
1501
1501
|
Be(this, I);
|
|
@@ -1517,8 +1517,8 @@ class ko extends Vt {
|
|
|
1517
1517
|
o.onActivate({ zoom: n }), this.emit("superdoc-command", { item: o, argument: n });
|
|
1518
1518
|
const e = document.querySelector(this.superdoc.config.selector)?.querySelector(".layers");
|
|
1519
1519
|
if (!e) return;
|
|
1520
|
-
const i = typeof screen.orientation < "u",
|
|
1521
|
-
i &&
|
|
1520
|
+
const i = typeof screen.orientation < "u", u = window.matchMedia("(max-width: 834px)").matches;
|
|
1521
|
+
i && u ? (e.style.transformOrigin = "0 0", e.style.transform = `scale(${parseInt(n) / 100})`) : e.style.zoom = parseInt(n) / 100, this.superdoc.superdocStore.activeZoom = parseInt(n);
|
|
1522
1522
|
},
|
|
1523
1523
|
setDocumentMode: ({ item: o, argument: n }) => {
|
|
1524
1524
|
n && this.emit("superdoc-command", { item: o, argument: n });
|
|
@@ -1552,13 +1552,13 @@ class ko extends Vt {
|
|
|
1552
1552
|
},
|
|
1553
1553
|
increaseTextIndent: ({ item: o, argument: n }) => {
|
|
1554
1554
|
let e = o.command, { state: i } = this.activeEditor;
|
|
1555
|
-
if (Ue((
|
|
1555
|
+
if (Ue((a) => a.type.name === "listItem")(i.selection))
|
|
1556
1556
|
return this.activeEditor.commands.increaseListIndent();
|
|
1557
1557
|
e in this.activeEditor.commands && this.activeEditor.commands[e](n);
|
|
1558
1558
|
},
|
|
1559
1559
|
decreaseTextIndent: ({ item: o, argument: n }) => {
|
|
1560
1560
|
let e = o.command, { state: i } = this.activeEditor;
|
|
1561
|
-
if (Ue((
|
|
1561
|
+
if (Ue((a) => a.type.name === "listItem")(i.selection))
|
|
1562
1562
|
return this.activeEditor.commands.decreaseListIndent();
|
|
1563
1563
|
e in this.activeEditor.commands && this.activeEditor.commands[e](n);
|
|
1564
1564
|
},
|
|
@@ -1578,8 +1578,8 @@ class ko extends Vt {
|
|
|
1578
1578
|
let e = o.command;
|
|
1579
1579
|
if (e in this.activeEditor.commands) {
|
|
1580
1580
|
this.activeEditor.commands[e](n);
|
|
1581
|
-
const { view: i } = this.activeEditor,
|
|
1582
|
-
i.updateState(
|
|
1581
|
+
const { view: i } = this.activeEditor, u = i.state.selection.$to.pos, a = new Xe(i.state.doc.resolve(u)), s = i.state.tr.setSelection(a), r = i.state.apply(s);
|
|
1582
|
+
i.updateState(r), setTimeout(() => {
|
|
1583
1583
|
i.focus();
|
|
1584
1584
|
}, 100);
|
|
1585
1585
|
}
|
|
@@ -1634,14 +1634,29 @@ class ko extends Vt {
|
|
|
1634
1634
|
W(this, I, We).call(this);
|
|
1635
1635
|
return;
|
|
1636
1636
|
}
|
|
1637
|
-
const o = ht(this.activeEditor), n =
|
|
1637
|
+
const o = ht(this.activeEditor), n = vt(this.activeEditor.state);
|
|
1638
1638
|
this.toolbarItems.forEach((e) => {
|
|
1639
1639
|
if (e.resetDisabled(), e.name.value === "linkedStyles")
|
|
1640
1640
|
return this.activeEditor && !Ke(this.activeEditor).length ? e.deactivate() : e.activate();
|
|
1641
|
-
const i = o.find((
|
|
1641
|
+
const i = o.find((s) => s.name === e.name.value);
|
|
1642
1642
|
i ? e.activate(i.attrs) : e.deactivate();
|
|
1643
|
-
const
|
|
1644
|
-
|
|
1643
|
+
const u = o.find((s) => s.name === "styleId");
|
|
1644
|
+
if (u?.attrs.styleId) {
|
|
1645
|
+
const s = {
|
|
1646
|
+
fontSize: "font-size",
|
|
1647
|
+
fontFamily: "font-family",
|
|
1648
|
+
bold: "bold",
|
|
1649
|
+
textAlign: "textAlign"
|
|
1650
|
+
}, r = this.activeEditor.converter?.linkedStyles.find((d) => d.id === u.attrs.styleId);
|
|
1651
|
+
if (s[e.name.value] in r?.definition.styles) {
|
|
1652
|
+
const d = {
|
|
1653
|
+
[e.name.value]: r?.definition.styles[s[e.name.value]]
|
|
1654
|
+
};
|
|
1655
|
+
e.activate(d);
|
|
1656
|
+
}
|
|
1657
|
+
}
|
|
1658
|
+
const a = o.find((s) => s.name === "spacing");
|
|
1659
|
+
e.name.value === "lineHeight" && (i?.attrs?.lineHeight || a) && (e.selectedValue.value = i?.attrs?.lineHeight || a.attrs?.spacing?.line || ""), e.name.value === "tableActions" && (e.disabled.value = !n);
|
|
1645
1660
|
});
|
|
1646
1661
|
}
|
|
1647
1662
|
/**
|
|
@@ -1671,73 +1686,73 @@ class ko extends Vt {
|
|
|
1671
1686
|
I = new WeakSet(), et = function() {
|
|
1672
1687
|
this.config.groups && !Array.isArray(this.config.groups) && Object.keys(this.config.groups).length && (this.config.toolbarGroups = Object.keys(this.config.groups));
|
|
1673
1688
|
}, he = new WeakMap(), ze = function(o, n, e = !1) {
|
|
1674
|
-
const i = document.documentElement.clientWidth, { defaultItems:
|
|
1675
|
-
let
|
|
1676
|
-
...
|
|
1677
|
-
...
|
|
1689
|
+
const i = document.documentElement.clientWidth, { defaultItems: u, overflowItems: a } = Xn(o, e, i, this.role, n);
|
|
1690
|
+
let s = [
|
|
1691
|
+
...u.map((d) => d.name.value),
|
|
1692
|
+
...a.map((d) => d.name.value)
|
|
1678
1693
|
];
|
|
1679
|
-
this.config.groups && (
|
|
1680
|
-
const
|
|
1681
|
-
this.toolbarItems =
|
|
1694
|
+
this.config.groups && (s = Object.values(this.config.groups).flatMap((d) => d));
|
|
1695
|
+
const r = u.filter((d) => s.includes(d.name.value)).filter((d) => !this.config.excludeItems.includes(d.name.value));
|
|
1696
|
+
this.toolbarItems = r, this.overflowItems = a.filter((d) => s.includes(d.name.value));
|
|
1682
1697
|
}, tt = function() {
|
|
1683
1698
|
if (!this.activeEditor || !this.activeEditor.converter) return;
|
|
1684
|
-
const { typeface: o = "Arial", fontSizePt: n = 12 } = this.activeEditor.converter.getDocumentDefaultStyles() ?? {}, e = this.toolbarItems.find((
|
|
1699
|
+
const { typeface: o = "Arial", fontSizePt: n = 12 } = this.activeEditor.converter.getDocumentDefaultStyles() ?? {}, e = this.toolbarItems.find((u) => u.name.value === "fontSize");
|
|
1685
1700
|
e && (e.defaultLabel.value = n);
|
|
1686
|
-
const i = this.toolbarItems.find((
|
|
1701
|
+
const i = this.toolbarItems.find((u) => u.name.value === "fontFamily");
|
|
1687
1702
|
i && (i.defaultLabel.value = o);
|
|
1688
1703
|
}, nt = function() {
|
|
1689
1704
|
if (!this.activeEditor || !this.activeEditor.converter || !this.activeEditor.converter.docHiglightColors.size) return;
|
|
1690
|
-
const o = this.toolbarItems.find((
|
|
1691
|
-
const
|
|
1692
|
-
return
|
|
1693
|
-
}, []),
|
|
1705
|
+
const o = this.toolbarItems.find((a) => a.name.value === "highlight"), n = Hn(), e = 7, i = Array.from(this.activeEditor.converter.docHiglightColors).reduce((a, s, r) => {
|
|
1706
|
+
const d = Math.floor(r / e);
|
|
1707
|
+
return a[d] || (a[d] = []), n.includes(s) || a[d].push(f(s)), a;
|
|
1708
|
+
}, []), u = {
|
|
1694
1709
|
key: "color",
|
|
1695
1710
|
type: "render",
|
|
1696
1711
|
render: () => Ne(this, o, i)
|
|
1697
1712
|
};
|
|
1698
|
-
o.nestedOptions.value = [
|
|
1713
|
+
o.nestedOptions.value = [u];
|
|
1699
1714
|
}, We = function() {
|
|
1700
1715
|
this.activeEditor = null, this.toolbarItems.forEach((o) => {
|
|
1701
1716
|
const { allowWithoutEditor: n } = o;
|
|
1702
1717
|
n.value || o.setDisabled(!0);
|
|
1703
1718
|
});
|
|
1704
1719
|
}, ot = function() {
|
|
1705
|
-
this.activeEditor && (this.undoDepth =
|
|
1720
|
+
this.activeEditor && (this.undoDepth = gt(this.activeEditor.state), this.redoDepth = yt(this.activeEditor.state));
|
|
1706
1721
|
}, fe = function({ item: o, argument: n }, e) {
|
|
1707
1722
|
if (!n || !this.activeEditor) return;
|
|
1708
1723
|
let i = o.command;
|
|
1709
1724
|
i in this.activeEditor?.commands && (this.activeEditor.commands[i](n), typeof e == "function" && e(n), this.updateToolbarState());
|
|
1710
1725
|
};
|
|
1711
|
-
function no(t,
|
|
1712
|
-
if (!t.value || !
|
|
1713
|
-
const o =
|
|
1726
|
+
function no(t, l) {
|
|
1727
|
+
if (!t.value || !l?.value?.options?.scale) return;
|
|
1728
|
+
const o = l.value.options.scale, n = t.value.getBoundingClientRect(), e = t.value.querySelectorAll(".pagination-break-wrapper");
|
|
1714
1729
|
let i;
|
|
1715
|
-
e.forEach((
|
|
1716
|
-
const
|
|
1717
|
-
if (i || (i =
|
|
1718
|
-
const
|
|
1719
|
-
|
|
1730
|
+
e.forEach((u) => {
|
|
1731
|
+
const s = (u.getBoundingClientRect().left - n.left) / o * -1 + 1;
|
|
1732
|
+
if (i || (i = s), s !== i) {
|
|
1733
|
+
const r = s - i;
|
|
1734
|
+
u.style.transform = `translateX(${r}px)`;
|
|
1720
1735
|
}
|
|
1721
1736
|
});
|
|
1722
1737
|
}
|
|
1723
|
-
const oo = (t,
|
|
1724
|
-
const o = t.clientY, n = t.clientX, { view: e } =
|
|
1725
|
-
let
|
|
1738
|
+
const oo = (t, l) => {
|
|
1739
|
+
const o = t.clientY, n = t.clientX, { view: e } = l, i = e.dom.getBoundingClientRect();
|
|
1740
|
+
let u = {
|
|
1726
1741
|
left: 0,
|
|
1727
1742
|
top: o
|
|
1728
|
-
},
|
|
1729
|
-
n > i.right ? (
|
|
1730
|
-
const
|
|
1731
|
-
if (
|
|
1732
|
-
let
|
|
1733
|
-
if (
|
|
1734
|
-
const b = e.state.doc.resolve(
|
|
1735
|
-
|
|
1743
|
+
}, a = !1;
|
|
1744
|
+
n > i.right ? (u.left = i.left + i.width - 1, a = !0) : n < i.left && (u.left = i.left);
|
|
1745
|
+
const s = e.posAtCoords(u)?.pos;
|
|
1746
|
+
if (s) {
|
|
1747
|
+
let r = s;
|
|
1748
|
+
if (a) {
|
|
1749
|
+
const b = e.state.doc.resolve(s).textOffset, y = e.state.doc.nodeAt(s), E = y?.text?.charAt(b);
|
|
1750
|
+
r = y?.isText && E !== " " ? s - 1 : s;
|
|
1736
1751
|
}
|
|
1737
|
-
const
|
|
1738
|
-
Xe.create(e.state.doc,
|
|
1752
|
+
const d = e.state.tr.setSelection(
|
|
1753
|
+
Xe.create(e.state.doc, r)
|
|
1739
1754
|
);
|
|
1740
|
-
e.dispatch(
|
|
1755
|
+
e.dispatch(d), e.focus();
|
|
1741
1756
|
}
|
|
1742
1757
|
}, io = { class: "numbering" }, Ae = 200, so = "flex-end", lo = {
|
|
1743
1758
|
__name: "Ruler",
|
|
@@ -1756,13 +1771,13 @@ const oo = (t, s) => {
|
|
|
1756
1771
|
}
|
|
1757
1772
|
},
|
|
1758
1773
|
emits: ["margin-change"],
|
|
1759
|
-
setup(t, { emit:
|
|
1760
|
-
const o =
|
|
1761
|
-
let
|
|
1774
|
+
setup(t, { emit: l }) {
|
|
1775
|
+
const o = l, n = t, e = g(null), i = g([]), u = g("#CCCCCC"), a = g("#2563EB66"), s = g(null), r = g(null), d = g(!1), c = g(null), b = qe({ side: "left", x: 0 }), y = qe({ side: "right", x: 0 }), h = g(!1), E = g(0);
|
|
1776
|
+
let v = 0;
|
|
1762
1777
|
const D = () => {
|
|
1763
1778
|
if (n.editor.options.mode !== "docx") return;
|
|
1764
1779
|
const T = [], { pageMargins: M, pageSize: H } = n.editor.getPageStyles();
|
|
1765
|
-
|
|
1780
|
+
s.value = H, r.value = M, y.x = H.width * 96 - M.right * 96, b.x = M.left * 96;
|
|
1766
1781
|
for (let R = 0; R < H.width; R++) {
|
|
1767
1782
|
const Z = `${5.5}px`, ae = H.width - R;
|
|
1768
1783
|
if (T.push(...L(1, "main", "20%", Z, R)), T.push(...L(3, "eighth", "10%", Z)), T.push(...L(1, "half", "40%", Z)), ae <= 0.5) break;
|
|
@@ -1790,39 +1805,39 @@ const oo = (t, s) => {
|
|
|
1790
1805
|
if (!e.value) return;
|
|
1791
1806
|
const H = e.value.parentElement.querySelector(".super-editor").getBoundingClientRect();
|
|
1792
1807
|
return {
|
|
1793
|
-
left: `${
|
|
1808
|
+
left: `${c.value.x}px`,
|
|
1794
1809
|
minHeight: `${H.height}px`
|
|
1795
1810
|
};
|
|
1796
1811
|
}), z = (T) => {
|
|
1797
|
-
|
|
1812
|
+
d.value = !0, ve();
|
|
1798
1813
|
const M = T.currentTarget.id;
|
|
1799
|
-
|
|
1814
|
+
c.value = M === "left-margin-handle" ? b : y, E.value = c.value.x, v = T.clientX - c.value.x, h.value = !0;
|
|
1800
1815
|
}, B = (T) => {
|
|
1801
|
-
if (!
|
|
1802
|
-
const M = T.clientX -
|
|
1803
|
-
|
|
1816
|
+
if (!d.value) return;
|
|
1817
|
+
const M = T.clientX - v;
|
|
1818
|
+
c.value.x = M, c.value.side === "left" ? M <= 0 ? c.value.x = 0 : M >= y.x - Ae && (c.value.x = y.x - Ae) : M >= s.value.width * 96 ? c.value.x = s.value.width * 96 : M <= b.x + Ae && (c.value.x = b.x + Ae);
|
|
1804
1819
|
}, q = () => {
|
|
1805
|
-
if (
|
|
1820
|
+
if (d.value = !1, h.value = !1, ge(), c.value && c.value.x !== E.value) {
|
|
1806
1821
|
const T = ce();
|
|
1807
1822
|
o("margin-change", {
|
|
1808
|
-
side:
|
|
1823
|
+
side: c.value.side,
|
|
1809
1824
|
value: T
|
|
1810
1825
|
});
|
|
1811
1826
|
}
|
|
1812
|
-
}, ge = () => {
|
|
1813
|
-
d.value = l.value;
|
|
1814
1827
|
}, ve = () => {
|
|
1815
|
-
|
|
1816
|
-
},
|
|
1828
|
+
u.value = a.value;
|
|
1829
|
+
}, ge = () => {
|
|
1830
|
+
u.value = "#CCC";
|
|
1831
|
+
}, ce = () => c.value.side === "left" ? c.value.x / 96 : (s.value.width * 96 - c.value.x) / 96, de = j(() => ({
|
|
1817
1832
|
"--alignment": so,
|
|
1818
|
-
"--ruler-handle-color":
|
|
1819
|
-
"--ruler-handle-active-color":
|
|
1833
|
+
"--ruler-handle-color": u.value,
|
|
1834
|
+
"--ruler-handle-active-color": a.value
|
|
1820
1835
|
}));
|
|
1821
|
-
return
|
|
1836
|
+
return we(() => {
|
|
1822
1837
|
i.value = D(), window.addEventListener("mousemove", B), window.addEventListener("mouseup", q);
|
|
1823
1838
|
}), Rt(() => {
|
|
1824
1839
|
window.removeEventListener("mousemove", B), window.removeEventListener("mouseup", q);
|
|
1825
|
-
}), (T, M) => (
|
|
1840
|
+
}), (T, M) => (k(), w("div", {
|
|
1826
1841
|
class: "ruler",
|
|
1827
1842
|
ref_key: "ruler",
|
|
1828
1843
|
ref: e,
|
|
@@ -1840,21 +1855,21 @@ const oo = (t, s) => {
|
|
|
1840
1855
|
onMousedown: z,
|
|
1841
1856
|
style: J(C.value("right"))
|
|
1842
1857
|
}, null, 36),
|
|
1843
|
-
h.value ? (
|
|
1858
|
+
h.value ? (k(), w("div", {
|
|
1844
1859
|
key: 0,
|
|
1845
1860
|
class: "vertical-indicator",
|
|
1846
1861
|
style: J(F.value)
|
|
1847
1862
|
}, null, 4)) : ne("", !0),
|
|
1848
|
-
(
|
|
1863
|
+
(k(!0), w(U, null, Q(i.value, (H) => (k(), w("div", {
|
|
1849
1864
|
class: oe(H.className),
|
|
1850
1865
|
style: J(p.value(H))
|
|
1851
1866
|
}, [
|
|
1852
1867
|
x("div", io, ie(H.numbering), 1),
|
|
1853
|
-
(
|
|
1868
|
+
(k(!0), w(U, null, Q(H.elements, (R) => (k(), w("div", {
|
|
1854
1869
|
class: oe(R.className),
|
|
1855
1870
|
style: J(p.value(R))
|
|
1856
1871
|
}, [
|
|
1857
|
-
(
|
|
1872
|
+
(k(!0), w(U, null, Q(R.elements, (X) => (k(), w("div", {
|
|
1858
1873
|
class: oe(X.className),
|
|
1859
1874
|
style: J(p.value(X))
|
|
1860
1875
|
}, null, 6))), 256))
|
|
@@ -1894,18 +1909,18 @@ const oo = (t, s) => {
|
|
|
1894
1909
|
"comments-loaded",
|
|
1895
1910
|
"selection-update"
|
|
1896
1911
|
],
|
|
1897
|
-
setup(t, { emit:
|
|
1898
|
-
const o =
|
|
1899
|
-
let
|
|
1900
|
-
const
|
|
1901
|
-
clearTimeout(
|
|
1902
|
-
},
|
|
1912
|
+
setup(t, { emit: l }) {
|
|
1913
|
+
const o = l, n = t, e = g(!1), i = Ze(null), u = g(null), a = g(null);
|
|
1914
|
+
let s;
|
|
1915
|
+
const r = () => {
|
|
1916
|
+
clearTimeout(s);
|
|
1917
|
+
}, d = (p, C = 10, F = 500) => {
|
|
1903
1918
|
const z = p.getMap("meta"), B = () => {
|
|
1904
1919
|
const q = z.get("docx");
|
|
1905
|
-
q ? (
|
|
1920
|
+
q ? (r(), h({ content: q })) : C > 0 ? (console.debug(`Waiting for 'docx' data... retries left: ${C}`), s = setTimeout(B, F), C--) : console.warn("Failed to load docx data from meta map.");
|
|
1906
1921
|
};
|
|
1907
1922
|
B();
|
|
1908
|
-
},
|
|
1923
|
+
}, c = async () => {
|
|
1909
1924
|
try {
|
|
1910
1925
|
const [p, C, F, z] = await Oe.loadXmlData(n.fileSource);
|
|
1911
1926
|
return { content: p, media: C, mediaFiles: F, fonts: z };
|
|
@@ -1914,12 +1929,12 @@ const oo = (t, s) => {
|
|
|
1914
1929
|
}
|
|
1915
1930
|
}, b = async () => {
|
|
1916
1931
|
if (n.fileSource) {
|
|
1917
|
-
const p = await
|
|
1932
|
+
const p = await c();
|
|
1918
1933
|
return h(p);
|
|
1919
1934
|
} else if (n.options.ydoc && n.options.collaborationProvider) {
|
|
1920
1935
|
delete n.options.content;
|
|
1921
1936
|
const p = n.options.ydoc, C = n.options.collaborationProvider, F = () => {
|
|
1922
|
-
|
|
1937
|
+
d(p), C.off("synced", F);
|
|
1923
1938
|
};
|
|
1924
1939
|
C.on("synced", F);
|
|
1925
1940
|
}
|
|
@@ -1929,7 +1944,7 @@ const oo = (t, s) => {
|
|
|
1929
1944
|
}, h = async ({ content: p, media: C = {}, mediaFiles: F = {}, fonts: z = {} } = {}) => {
|
|
1930
1945
|
i.value = new Oe({
|
|
1931
1946
|
mode: "docx",
|
|
1932
|
-
element:
|
|
1947
|
+
element: a.value,
|
|
1933
1948
|
fileSource: n.fileSource,
|
|
1934
1949
|
extensions: y(),
|
|
1935
1950
|
externalExtensions: n.options.externalExtensions,
|
|
@@ -1940,7 +1955,7 @@ const oo = (t, s) => {
|
|
|
1940
1955
|
fonts: z,
|
|
1941
1956
|
...n.options
|
|
1942
1957
|
}), i.value.on("paginationUpdate", () => {
|
|
1943
|
-
no(
|
|
1958
|
+
no(a, i);
|
|
1944
1959
|
}), i.value.on("collaborationReady", () => {
|
|
1945
1960
|
setTimeout(() => {
|
|
1946
1961
|
e.value = !0;
|
|
@@ -1948,14 +1963,14 @@ const oo = (t, s) => {
|
|
|
1948
1963
|
});
|
|
1949
1964
|
}, E = (p) => {
|
|
1950
1965
|
o("editor-keydown", { editor: i.value });
|
|
1951
|
-
},
|
|
1966
|
+
}, v = (p) => {
|
|
1952
1967
|
o("editor-click", { editor: i.value });
|
|
1953
|
-
let C =
|
|
1968
|
+
let C = a.value?.querySelector(".ProseMirror");
|
|
1954
1969
|
if (!C || !i.value)
|
|
1955
1970
|
return;
|
|
1956
1971
|
!C.contains(p.target) && i.value.isEditable && i.value.view?.focus();
|
|
1957
1972
|
};
|
|
1958
|
-
|
|
1973
|
+
we(() => {
|
|
1959
1974
|
b(), (n.options?.suppressSkeletonLoader || !n.options?.collaborationProvider) && (e.value = !0);
|
|
1960
1975
|
});
|
|
1961
1976
|
const D = (p) => {
|
|
@@ -1966,9 +1981,9 @@ const oo = (t, s) => {
|
|
|
1966
1981
|
i.value?.updatePageStyle({ pageMargins: B });
|
|
1967
1982
|
};
|
|
1968
1983
|
return Ye(() => {
|
|
1969
|
-
|
|
1970
|
-
}), (p, C) => (
|
|
1971
|
-
t.options.rulers && i.value ? (
|
|
1984
|
+
r(), i.value?.destroy(), i.value = null;
|
|
1985
|
+
}), (p, C) => (k(), w("div", ro, [
|
|
1986
|
+
t.options.rulers && i.value ? (k(), Ot(ao, {
|
|
1972
1987
|
key: 0,
|
|
1973
1988
|
class: "ruler",
|
|
1974
1989
|
editor: i.value,
|
|
@@ -1977,18 +1992,18 @@ const oo = (t, s) => {
|
|
|
1977
1992
|
x("div", {
|
|
1978
1993
|
class: "super-editor",
|
|
1979
1994
|
ref_key: "editorWrapper",
|
|
1980
|
-
ref:
|
|
1995
|
+
ref: u,
|
|
1981
1996
|
onKeydown: E,
|
|
1982
|
-
onClick:
|
|
1997
|
+
onClick: v,
|
|
1983
1998
|
onMousedown: D
|
|
1984
1999
|
}, [
|
|
1985
2000
|
x("div", {
|
|
1986
2001
|
ref_key: "editorElem",
|
|
1987
|
-
ref:
|
|
2002
|
+
ref: a,
|
|
1988
2003
|
class: "editor-element super-editor__element"
|
|
1989
2004
|
}, null, 512)
|
|
1990
2005
|
], 544),
|
|
1991
|
-
e.value ? ne("", !0) : (
|
|
2006
|
+
e.value ? ne("", !0) : (k(), w("div", co, [
|
|
1992
2007
|
x("div", uo, [
|
|
1993
2008
|
V($(Y), {
|
|
1994
2009
|
text: "",
|
|
@@ -2038,11 +2053,11 @@ const oo = (t, s) => {
|
|
|
2038
2053
|
}, Co = /* @__PURE__ */ K(mo, [["__scopeId", "data-v-ff8f86f4"]]), _o = {
|
|
2039
2054
|
__name: "BasicUpload",
|
|
2040
2055
|
emits: ["file-change"],
|
|
2041
|
-
setup(t, { emit:
|
|
2042
|
-
const o =
|
|
2056
|
+
setup(t, { emit: l }) {
|
|
2057
|
+
const o = l, n = (e) => {
|
|
2043
2058
|
o("file-change", e.target.files[0]);
|
|
2044
2059
|
};
|
|
2045
|
-
return (e, i) => (
|
|
2060
|
+
return (e, i) => (k(), w("div", null, [
|
|
2046
2061
|
x("input", {
|
|
2047
2062
|
type: "file",
|
|
2048
2063
|
id: "fileInput",
|
|
@@ -2074,35 +2089,35 @@ const oo = (t, s) => {
|
|
|
2074
2089
|
}
|
|
2075
2090
|
},
|
|
2076
2091
|
emits: ["update:modelValue", "focus", "blur"],
|
|
2077
|
-
setup(t, { emit:
|
|
2078
|
-
const o =
|
|
2092
|
+
setup(t, { emit: l }) {
|
|
2093
|
+
const o = l, n = t, e = Ze(), i = g(null), u = g(!1), a = ({ editor: y, transaction: h }) => {
|
|
2079
2094
|
const E = y.getHTML();
|
|
2080
2095
|
o("update:modelValue", E);
|
|
2081
|
-
},
|
|
2082
|
-
|
|
2083
|
-
},
|
|
2084
|
-
|
|
2085
|
-
},
|
|
2086
|
-
|
|
2096
|
+
}, s = ({ editor: y, transaction: h }) => {
|
|
2097
|
+
u.value = !0, b(), o("focus", { editor: y, transaction: h });
|
|
2098
|
+
}, r = ({ editor: y, transaction: h }) => {
|
|
2099
|
+
u.value = !1, o("blur", { editor: y, transaction: h });
|
|
2100
|
+
}, d = async () => {
|
|
2101
|
+
kt.options.placeholder = n.placeholder || "Type something...", n.options.onTransaction = a, n.options.onFocus = s, n.options.onBlur = r, e.value = new Oe({
|
|
2087
2102
|
mode: "text",
|
|
2088
2103
|
content: document.getElementById("currentContent"),
|
|
2089
2104
|
element: i.value,
|
|
2090
|
-
extensions:
|
|
2105
|
+
extensions: wt(),
|
|
2091
2106
|
users: n.users,
|
|
2092
2107
|
...n.options
|
|
2093
2108
|
});
|
|
2094
|
-
},
|
|
2095
|
-
|
|
2109
|
+
}, c = () => {
|
|
2110
|
+
u.value = !0, e.value?.view?.focus();
|
|
2096
2111
|
}, b = () => {
|
|
2097
2112
|
e.value?.setOptions({ users: n.users });
|
|
2098
2113
|
};
|
|
2099
|
-
return
|
|
2100
|
-
|
|
2114
|
+
return we(() => {
|
|
2115
|
+
d();
|
|
2101
2116
|
}), Ye(() => {
|
|
2102
2117
|
e.value?.destroy(), e.value = null;
|
|
2103
|
-
}), (y, h) => (
|
|
2104
|
-
class: oe(["super-editor super-input", { "super-input-active":
|
|
2105
|
-
onClick:
|
|
2118
|
+
}), (y, h) => (k(), w("div", {
|
|
2119
|
+
class: oe(["super-editor super-input", { "super-input-active": u.value }]),
|
|
2120
|
+
onClick: ke(c, ["stop", "prevent"])
|
|
2106
2121
|
}, [
|
|
2107
2122
|
x("div", {
|
|
2108
2123
|
id: "currentContent",
|
|
@@ -2133,7 +2148,7 @@ export {
|
|
|
2133
2148
|
Ho as SuperConverter,
|
|
2134
2149
|
Co as SuperEditor,
|
|
2135
2150
|
xo as SuperInput,
|
|
2136
|
-
|
|
2151
|
+
wo as SuperToolbar,
|
|
2137
2152
|
zt as Toolbar,
|
|
2138
2153
|
Fo as TrackChangesBasePluginKey,
|
|
2139
2154
|
No as createZip,
|
|
@@ -2141,7 +2156,7 @@ export {
|
|
|
2141
2156
|
ht as getActiveFormatting,
|
|
2142
2157
|
eo as getAllowedImageDimensions,
|
|
2143
2158
|
Lo as getMarksFromSelection,
|
|
2144
|
-
|
|
2159
|
+
wt as getRichTextExtensions,
|
|
2145
2160
|
bt as getStarterExtensions,
|
|
2146
2161
|
Mo as helpers,
|
|
2147
2162
|
Do as trackChangesHelpers
|