@harbour-enterprises/superdoc 0.12.2 → 0.12.3
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/{index-C6SLw2ph.cjs → index-71EH9929.cjs} +1 -1
- package/dist/chunks/{index-CbUTRvRk.cjs → index-DJ2cGnRl.cjs} +1 -1
- package/dist/chunks/{index-kWwSELc2.es.js → index-DRzufgTV.es.js} +2 -2
- package/dist/chunks/{index-BTkgQgI7.es.js → index-kAA2CRkl.es.js} +1 -1
- package/dist/chunks/{super-editor.es-DUmGohIP.es.js → super-editor.es-DXcOd-nD.es.js} +4753 -4691
- package/dist/chunks/{super-editor.es-BMtJiQQ_.cjs → super-editor.es-Di7L9sdJ.cjs} +64 -64
- package/dist/chunks/{url-C29KYeaj.es.js → url-BcsmChMq.es.js} +1 -1
- package/dist/chunks/{url-DRGmEUtI.cjs → url-CHPOWQEe.cjs} +1 -1
- package/dist/chunks/{xml-js-CgHhGhcJ.es.js → xml-js-CiXFCQBs.es.js} +366 -355
- package/dist/chunks/xml-js-jS9zLULc.cjs +10 -0
- 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-v5qDAfvf.js → converter-BJtjyWXx.js} +2 -2
- package/dist/super-editor/chunks/{docx-zipper-B5_2puzu.js → docx-zipper-BVv8YIej.js} +1 -1
- package/dist/super-editor/chunks/{editor-DPsjxIiM.js → editor-C4x0LU8R.js} +3 -3
- package/dist/super-editor/chunks/{toolbar-Dgq1xcbs.js → toolbar-C3dMNXWg.js} +612 -611
- package/dist/super-editor/components/toolbar/constants.d.ts +12 -0
- package/dist/super-editor/components/toolbar/constants.d.ts.map +1 -0
- package/dist/super-editor/components/toolbar/defaultItems.d.ts +3 -1
- package/dist/super-editor/components/toolbar/defaultItems.d.ts.map +1 -1
- package/dist/super-editor/components/toolbar/super-toolbar.d.ts +2 -0
- 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/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 +1169 -1108
- 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 +4 -4
- package/dist/superdoc.es.js +10 -7
- package/dist/superdoc.umd.js +4130 -4065
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunks/xml-js-CMQ3QRee.cjs +0 -10
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
throw TypeError(
|
|
1
|
+
var wt = Object.defineProperty;
|
|
2
|
+
var qe = (e) => {
|
|
3
|
+
throw TypeError(e);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
import { _ as q, a as
|
|
10
|
-
import { C as
|
|
11
|
-
import { a1 as
|
|
12
|
-
import { O as
|
|
13
|
-
import { ref as
|
|
14
|
-
import { t as
|
|
15
|
-
import
|
|
16
|
-
import { D as
|
|
17
|
-
import { createZip as
|
|
18
|
-
var
|
|
19
|
-
(function(
|
|
20
|
-
var
|
|
5
|
+
var Ct = (e, s, t) => s in e ? wt(e, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[s] = t;
|
|
6
|
+
var ze = (e, s, t) => Ct(e, typeof s != "symbol" ? s + "" : s, t), Ge = (e, s, t) => s.has(e) || qe("Cannot " + t);
|
|
7
|
+
var Te = (e, s, t) => (Ge(e, s, "read from private field"), t ? t.call(e) : s.get(e)), Re = (e, s, t) => s.has(e) ? qe("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) => (Ge(e, s, "access private method"), t);
|
|
9
|
+
import { _ as q, a as Ye, b as kt, I as Oe, f as _t, c as Ke, d as xt, i as St, u as Et, r as At, E as Ne, e as Tt, P as Ft, h as It, M as Lt, j as Mt, A as Dt, N as Bt } from "./chunks/editor-C4x0LU8R.js";
|
|
10
|
+
import { C as Vo, T as Po, l as jo, n as Uo, k as qo, m as Go } from "./chunks/editor-C4x0LU8R.js";
|
|
11
|
+
import { a1 as Ht, E as $t, a4 as zt, T as Je, a as Rt } from "./chunks/converter-BJtjyWXx.js";
|
|
12
|
+
import { O as Xo } from "./chunks/converter-BJtjyWXx.js";
|
|
13
|
+
import { ref as h, createElementBlock as k, openBlock as C, createElementVNode as _, unref as M, getCurrentInstance as Ot, computed as j, watch as Nt, onMounted as Ce, createCommentVNode as ee, withDirectives as Qe, withKeys as et, normalizeClass as oe, withModifiers as he, vModelText as tt, createTextVNode as nt, toDisplayString as ie, Fragment as U, renderList as te, normalizeStyle as Q, createVNode as P, h as $, createApp as Wt, reactive as Xe, onUnmounted as Vt, shallowRef as ot, onBeforeUnmount as it, createBlock as Pt } from "vue";
|
|
14
|
+
import { t as Z, s as jt, T as Ut, N as J } from "./chunks/toolbar-C3dMNXWg.js";
|
|
15
|
+
import qt from "./ai-writer.es.js";
|
|
16
|
+
import { D as Yo } from "./chunks/docx-zipper-BVv8YIej.js";
|
|
17
|
+
import { createZip as Qo } from "./file-zipper.es.js";
|
|
18
|
+
var st = { exports: {} };
|
|
19
|
+
(function(e) {
|
|
20
|
+
var s = Object.prototype.hasOwnProperty, t = "~";
|
|
21
21
|
function n() {
|
|
22
22
|
}
|
|
23
|
-
Object.create && (n.prototype = /* @__PURE__ */ Object.create(null), new n().__proto__ || (
|
|
24
|
-
function
|
|
25
|
-
this.fn = l, this.context = d, this.once =
|
|
23
|
+
Object.create && (n.prototype = /* @__PURE__ */ Object.create(null), new n().__proto__ || (t = !1));
|
|
24
|
+
function o(l, d, u) {
|
|
25
|
+
this.fn = l, this.context = d, this.once = u || !1;
|
|
26
26
|
}
|
|
27
|
-
function i(l, d,
|
|
28
|
-
if (typeof
|
|
27
|
+
function i(l, d, u, r, w) {
|
|
28
|
+
if (typeof u != "function")
|
|
29
29
|
throw new TypeError("The listener must be a function");
|
|
30
|
-
var v = new
|
|
31
|
-
return l._events[
|
|
30
|
+
var v = new o(u, r || l, w), b = t ? t + d : d;
|
|
31
|
+
return l._events[b] ? l._events[b].fn ? l._events[b] = [l._events[b], v] : l._events[b].push(v) : (l._events[b] = v, l._eventsCount++), l;
|
|
32
32
|
}
|
|
33
33
|
function c(l, d) {
|
|
34
34
|
--l._eventsCount === 0 ? l._events = new n() : delete l._events[d];
|
|
@@ -37,225 +37,229 @@ var it = { exports: {} };
|
|
|
37
37
|
this._events = new n(), this._eventsCount = 0;
|
|
38
38
|
}
|
|
39
39
|
a.prototype.eventNames = function() {
|
|
40
|
-
var d = [],
|
|
40
|
+
var d = [], u, r;
|
|
41
41
|
if (this._eventsCount === 0) return d;
|
|
42
|
-
for (
|
|
43
|
-
|
|
44
|
-
return Object.getOwnPropertySymbols ? d.concat(Object.getOwnPropertySymbols(
|
|
42
|
+
for (r in u = this._events)
|
|
43
|
+
s.call(u, r) && d.push(t ? r.slice(1) : r);
|
|
44
|
+
return Object.getOwnPropertySymbols ? d.concat(Object.getOwnPropertySymbols(u)) : d;
|
|
45
45
|
}, a.prototype.listeners = function(d) {
|
|
46
|
-
var
|
|
47
|
-
if (!
|
|
48
|
-
if (
|
|
49
|
-
for (var
|
|
50
|
-
|
|
51
|
-
return
|
|
46
|
+
var u = t ? t + d : d, r = this._events[u];
|
|
47
|
+
if (!r) return [];
|
|
48
|
+
if (r.fn) return [r.fn];
|
|
49
|
+
for (var w = 0, v = r.length, b = new Array(v); w < v; w++)
|
|
50
|
+
b[w] = r[w].fn;
|
|
51
|
+
return b;
|
|
52
52
|
}, a.prototype.listenerCount = function(d) {
|
|
53
|
-
var
|
|
54
|
-
return
|
|
55
|
-
}, a.prototype.emit = function(d,
|
|
56
|
-
var
|
|
57
|
-
if (!this._events[
|
|
58
|
-
var g = this._events[
|
|
53
|
+
var u = t ? t + d : d, r = this._events[u];
|
|
54
|
+
return r ? r.fn ? 1 : r.length : 0;
|
|
55
|
+
}, a.prototype.emit = function(d, u, r, w, v, b) {
|
|
56
|
+
var y = t ? t + d : d;
|
|
57
|
+
if (!this._events[y]) return !1;
|
|
58
|
+
var g = this._events[y], L = arguments.length, D, p;
|
|
59
59
|
if (g.fn) {
|
|
60
|
-
switch (g.once && this.removeListener(d, g.fn, void 0, !0),
|
|
60
|
+
switch (g.once && this.removeListener(d, g.fn, void 0, !0), L) {
|
|
61
61
|
case 1:
|
|
62
62
|
return g.fn.call(g.context), !0;
|
|
63
63
|
case 2:
|
|
64
|
-
return g.fn.call(g.context,
|
|
64
|
+
return g.fn.call(g.context, u), !0;
|
|
65
65
|
case 3:
|
|
66
|
-
return g.fn.call(g.context,
|
|
66
|
+
return g.fn.call(g.context, u, r), !0;
|
|
67
67
|
case 4:
|
|
68
|
-
return g.fn.call(g.context,
|
|
68
|
+
return g.fn.call(g.context, u, r, w), !0;
|
|
69
69
|
case 5:
|
|
70
|
-
return g.fn.call(g.context,
|
|
70
|
+
return g.fn.call(g.context, u, r, w, v), !0;
|
|
71
71
|
case 6:
|
|
72
|
-
return g.fn.call(g.context,
|
|
72
|
+
return g.fn.call(g.context, u, r, w, v, b), !0;
|
|
73
73
|
}
|
|
74
|
-
for (p = 1,
|
|
75
|
-
|
|
76
|
-
g.fn.apply(g.context,
|
|
74
|
+
for (p = 1, D = new Array(L - 1); p < L; p++)
|
|
75
|
+
D[p - 1] = arguments[p];
|
|
76
|
+
g.fn.apply(g.context, D);
|
|
77
77
|
} else {
|
|
78
|
-
var
|
|
79
|
-
for (p = 0; p <
|
|
80
|
-
switch (g[p].once && this.removeListener(d, g[p].fn, void 0, !0),
|
|
78
|
+
var S = g.length, F;
|
|
79
|
+
for (p = 0; p < S; p++)
|
|
80
|
+
switch (g[p].once && this.removeListener(d, g[p].fn, void 0, !0), L) {
|
|
81
81
|
case 1:
|
|
82
82
|
g[p].fn.call(g[p].context);
|
|
83
83
|
break;
|
|
84
84
|
case 2:
|
|
85
|
-
g[p].fn.call(g[p].context,
|
|
85
|
+
g[p].fn.call(g[p].context, u);
|
|
86
86
|
break;
|
|
87
87
|
case 3:
|
|
88
|
-
g[p].fn.call(g[p].context,
|
|
88
|
+
g[p].fn.call(g[p].context, u, r);
|
|
89
89
|
break;
|
|
90
90
|
case 4:
|
|
91
|
-
g[p].fn.call(g[p].context,
|
|
91
|
+
g[p].fn.call(g[p].context, u, r, w);
|
|
92
92
|
break;
|
|
93
93
|
default:
|
|
94
|
-
if (
|
|
95
|
-
|
|
96
|
-
g[p].fn.apply(g[p].context,
|
|
94
|
+
if (!D) for (F = 1, D = new Array(L - 1); F < L; F++)
|
|
95
|
+
D[F - 1] = arguments[F];
|
|
96
|
+
g[p].fn.apply(g[p].context, D);
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
return !0;
|
|
100
|
-
}, a.prototype.on = function(d,
|
|
101
|
-
return i(this, d,
|
|
102
|
-
}, a.prototype.once = function(d,
|
|
103
|
-
return i(this, d,
|
|
104
|
-
}, a.prototype.removeListener = function(d,
|
|
105
|
-
var v =
|
|
100
|
+
}, a.prototype.on = function(d, u, r) {
|
|
101
|
+
return i(this, d, u, r, !1);
|
|
102
|
+
}, a.prototype.once = function(d, u, r) {
|
|
103
|
+
return i(this, d, u, r, !0);
|
|
104
|
+
}, a.prototype.removeListener = function(d, u, r, w) {
|
|
105
|
+
var v = t ? t + d : d;
|
|
106
106
|
if (!this._events[v]) return this;
|
|
107
|
-
if (!
|
|
107
|
+
if (!u)
|
|
108
108
|
return c(this, v), this;
|
|
109
|
-
var
|
|
110
|
-
if (
|
|
111
|
-
|
|
109
|
+
var b = this._events[v];
|
|
110
|
+
if (b.fn)
|
|
111
|
+
b.fn === u && (!w || b.once) && (!r || b.context === r) && c(this, v);
|
|
112
112
|
else {
|
|
113
|
-
for (var
|
|
114
|
-
(y
|
|
113
|
+
for (var y = 0, g = [], L = b.length; y < L; y++)
|
|
114
|
+
(b[y].fn !== u || w && !b[y].once || r && b[y].context !== r) && g.push(b[y]);
|
|
115
115
|
g.length ? this._events[v] = g.length === 1 ? g[0] : g : c(this, v);
|
|
116
116
|
}
|
|
117
117
|
return this;
|
|
118
118
|
}, a.prototype.removeAllListeners = function(d) {
|
|
119
|
-
var
|
|
120
|
-
return d ? (
|
|
121
|
-
}, a.prototype.off = a.prototype.removeListener, a.prototype.addListener = a.prototype.on, a.prefixed =
|
|
122
|
-
})(
|
|
123
|
-
var
|
|
124
|
-
const
|
|
125
|
-
function
|
|
126
|
-
let
|
|
127
|
-
for (;
|
|
128
|
-
const
|
|
129
|
-
if (/(auto|scroll)/.test(
|
|
130
|
-
return
|
|
131
|
-
|
|
119
|
+
var u;
|
|
120
|
+
return d ? (u = t ? t + d : d, this._events[u] && c(this, u)) : (this._events = new n(), this._eventsCount = 0), this;
|
|
121
|
+
}, a.prototype.off = a.prototype.removeListener, a.prototype.addListener = a.prototype.on, a.prefixed = t, a.EventEmitter = a, e.exports = a;
|
|
122
|
+
})(st);
|
|
123
|
+
var Gt = st.exports;
|
|
124
|
+
const Kt = /* @__PURE__ */ Ht(Gt);
|
|
125
|
+
function Xt(e) {
|
|
126
|
+
let s = e;
|
|
127
|
+
for (; s; ) {
|
|
128
|
+
const t = window.getComputedStyle(s).overflowY;
|
|
129
|
+
if (/(auto|scroll)/.test(t) && s.scrollHeight > s.clientHeight)
|
|
130
|
+
return s;
|
|
131
|
+
s = s.parentElement;
|
|
132
132
|
}
|
|
133
133
|
return document.scrollingElement || document.documentElement;
|
|
134
134
|
}
|
|
135
|
-
function
|
|
136
|
-
if (!
|
|
137
|
-
const
|
|
138
|
-
|
|
139
|
-
top:
|
|
140
|
-
behavior:
|
|
135
|
+
function Zt(e, s = { behavior: "smooth", block: "start" }) {
|
|
136
|
+
if (!e) return;
|
|
137
|
+
const t = Xt(e), n = t.getBoundingClientRect(), i = e.getBoundingClientRect().top - n.top + t.scrollTop;
|
|
138
|
+
t.scrollTo({
|
|
139
|
+
top: s.block === "start" ? i : i - t.clientHeight + e.offsetHeight,
|
|
140
|
+
behavior: s.behavior
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
|
-
const
|
|
144
|
-
if (!["button", "options", "separator", "dropdown", "overflow"].includes(
|
|
145
|
-
throw new Error("Invalid toolbar item type - " +
|
|
146
|
-
if (
|
|
147
|
-
throw new Error("Toolbar button item needs either icon or label - " +
|
|
148
|
-
if (!
|
|
149
|
-
throw new Error("Invalid toolbar item name - " +
|
|
150
|
-
const
|
|
151
|
-
if (
|
|
152
|
-
if (!Array.isArray(
|
|
153
|
-
|
|
143
|
+
const x = (e) => {
|
|
144
|
+
if (!["button", "options", "separator", "dropdown", "overflow"].includes(e.type))
|
|
145
|
+
throw new Error("Invalid toolbar item type - " + e.type);
|
|
146
|
+
if (e.type === "button" && !e.defaultLabel && !e.icon)
|
|
147
|
+
throw new Error("Toolbar button item needs either icon or label - " + e.name);
|
|
148
|
+
if (!e.name)
|
|
149
|
+
throw new Error("Invalid toolbar item name - " + e.name);
|
|
150
|
+
const t = h($t()), 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), ne = h(e.hasCaret), ue = h(e.dropdownStyles), ve = h(e.tooltip), ge = h(e.tooltipVisible), Y = h(e.tooltipTimeout), T = h(e.defaultLabel), B = h(e.label), H = 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
|
+
if (e.options) {
|
|
152
|
+
if (!Array.isArray(e.options)) throw new Error("Invalid toolbar item options - " + e.options);
|
|
153
|
+
be.value.push(...e.options);
|
|
154
154
|
}
|
|
155
|
-
const
|
|
156
|
-
|
|
157
|
-
},
|
|
158
|
-
|
|
159
|
-
},
|
|
160
|
-
|
|
161
|
-
},
|
|
162
|
-
|
|
163
|
-
},
|
|
164
|
-
const
|
|
165
|
-
return Object.keys(
|
|
166
|
-
|
|
167
|
-
}),
|
|
168
|
-
},
|
|
169
|
-
id:
|
|
170
|
-
name:
|
|
155
|
+
const _e = (ae) => {
|
|
156
|
+
xe(ae), !p.value && (v.value = !0);
|
|
157
|
+
}, Le = () => {
|
|
158
|
+
Se(), v.value = !1;
|
|
159
|
+
}, Me = (ae) => {
|
|
160
|
+
w.value = ae;
|
|
161
|
+
}, De = () => {
|
|
162
|
+
w.value = r;
|
|
163
|
+
}, xe = e.onActivate || (() => null), Se = e.onDeactivate || (() => null), Ee = () => {
|
|
164
|
+
const ae = {};
|
|
165
|
+
return Object.keys(X).forEach((ye) => {
|
|
166
|
+
X[ye].value !== void 0 && (ae[ye] = X[ye].value);
|
|
167
|
+
}), ae;
|
|
168
|
+
}, X = {
|
|
169
|
+
id: t,
|
|
170
|
+
name: o,
|
|
171
171
|
type: n,
|
|
172
172
|
command: i,
|
|
173
173
|
noArgumentCommand: c,
|
|
174
174
|
icon: a,
|
|
175
|
-
tooltip:
|
|
175
|
+
tooltip: ve,
|
|
176
176
|
group: l,
|
|
177
|
-
attributes:
|
|
178
|
-
disabled:
|
|
177
|
+
attributes: u,
|
|
178
|
+
disabled: w,
|
|
179
179
|
active: v,
|
|
180
|
-
expand:
|
|
181
|
-
nestedOptions:
|
|
182
|
-
style:
|
|
180
|
+
expand: b,
|
|
181
|
+
nestedOptions: be,
|
|
182
|
+
style: y,
|
|
183
183
|
isNarrow: g,
|
|
184
|
-
isWide:
|
|
185
|
-
minWidth:
|
|
186
|
-
argument:
|
|
187
|
-
parentItem:
|
|
188
|
-
iconColor:
|
|
189
|
-
hasCaret:
|
|
190
|
-
dropdownStyles:
|
|
191
|
-
tooltipVisible:
|
|
192
|
-
tooltipTimeout:
|
|
193
|
-
defaultLabel:
|
|
194
|
-
label:
|
|
184
|
+
isWide: L,
|
|
185
|
+
minWidth: D,
|
|
186
|
+
argument: S,
|
|
187
|
+
parentItem: O,
|
|
188
|
+
iconColor: W,
|
|
189
|
+
hasCaret: ne,
|
|
190
|
+
dropdownStyles: ue,
|
|
191
|
+
tooltipVisible: ge,
|
|
192
|
+
tooltipTimeout: Y,
|
|
193
|
+
defaultLabel: T,
|
|
194
|
+
label: B,
|
|
195
195
|
hideLabel: H,
|
|
196
|
-
inlineTextInputVisible:
|
|
196
|
+
inlineTextInputVisible: z,
|
|
197
197
|
hasInlineTextInput: G,
|
|
198
198
|
markName: K,
|
|
199
199
|
labelAttr: ce,
|
|
200
|
-
childItem:
|
|
200
|
+
childItem: F,
|
|
201
201
|
allowWithoutEditor: d,
|
|
202
|
-
dropdownValueKey:
|
|
203
|
-
selectedValue:
|
|
204
|
-
inputRef:
|
|
202
|
+
dropdownValueKey: ke,
|
|
203
|
+
selectedValue: se,
|
|
204
|
+
inputRef: Ie
|
|
205
205
|
};
|
|
206
206
|
return {
|
|
207
|
-
...
|
|
208
|
-
unref:
|
|
209
|
-
activate:
|
|
210
|
-
deactivate:
|
|
211
|
-
setDisabled:
|
|
212
|
-
resetDisabled:
|
|
213
|
-
onActivate:
|
|
214
|
-
onDeactivate:
|
|
207
|
+
...X,
|
|
208
|
+
unref: Ee,
|
|
209
|
+
activate: _e,
|
|
210
|
+
deactivate: Le,
|
|
211
|
+
setDisabled: Me,
|
|
212
|
+
resetDisabled: De,
|
|
213
|
+
onActivate: xe,
|
|
214
|
+
onDeactivate: Se
|
|
215
215
|
};
|
|
216
|
-
},
|
|
216
|
+
}, Yt = { class: "alignment-buttons" }, Jt = ["innerHTML"], Qt = ["innerHTML"], en = ["innerHTML"], tn = ["innerHTML"], nn = {
|
|
217
217
|
__name: "AlignmentButtons",
|
|
218
218
|
emits: ["select"],
|
|
219
|
-
setup(
|
|
220
|
-
const
|
|
221
|
-
|
|
219
|
+
setup(e, { emit: s }) {
|
|
220
|
+
const t = s, n = (o) => {
|
|
221
|
+
t("select", o);
|
|
222
222
|
};
|
|
223
|
-
return (
|
|
224
|
-
|
|
223
|
+
return (o, i) => (C(), k("div", Yt, [
|
|
224
|
+
_("div", {
|
|
225
225
|
class: "button-icon",
|
|
226
226
|
onClick: i[0] || (i[0] = (c) => n("left")),
|
|
227
|
-
innerHTML:
|
|
228
|
-
|
|
229
|
-
|
|
227
|
+
innerHTML: M(Z).alignLeft,
|
|
228
|
+
"data-item": "btn-textAlign-option"
|
|
229
|
+
}, null, 8, Jt),
|
|
230
|
+
_("div", {
|
|
230
231
|
class: "button-icon",
|
|
231
232
|
onClick: i[1] || (i[1] = (c) => n("center")),
|
|
232
|
-
innerHTML:
|
|
233
|
-
|
|
234
|
-
|
|
233
|
+
innerHTML: M(Z).alignCenter,
|
|
234
|
+
"data-item": "btn-textAlign-option"
|
|
235
|
+
}, null, 8, Qt),
|
|
236
|
+
_("div", {
|
|
235
237
|
class: "button-icon",
|
|
236
238
|
onClick: i[2] || (i[2] = (c) => n("right")),
|
|
237
|
-
innerHTML:
|
|
238
|
-
|
|
239
|
-
|
|
239
|
+
innerHTML: M(Z).alignRight,
|
|
240
|
+
"data-item": "btn-textAlign-option"
|
|
241
|
+
}, null, 8, en),
|
|
242
|
+
_("div", {
|
|
240
243
|
class: "button-icon",
|
|
241
244
|
onClick: i[3] || (i[3] = (c) => n("justify")),
|
|
242
|
-
innerHTML:
|
|
243
|
-
|
|
245
|
+
innerHTML: M(Z).alignJustify,
|
|
246
|
+
"data-item": "btn-textAlign-option"
|
|
247
|
+
}, null, 8, tn)
|
|
244
248
|
]));
|
|
245
249
|
}
|
|
246
|
-
},
|
|
250
|
+
}, on = /* @__PURE__ */ q(nn, [["__scopeId", "data-v-932a4937"]]), sn = { class: "link-input-ctn" }, an = {
|
|
247
251
|
key: 0,
|
|
248
252
|
class: "link-title"
|
|
249
|
-
},
|
|
253
|
+
}, ln = {
|
|
250
254
|
key: 1,
|
|
251
255
|
class: "link-title"
|
|
252
|
-
},
|
|
256
|
+
}, rn = {
|
|
253
257
|
key: 2,
|
|
254
258
|
class: "link-title"
|
|
255
|
-
},
|
|
259
|
+
}, cn = { key: 3 }, dn = { class: "input-row" }, un = ["innerHTML"], mn = ["onKeydown"], pn = ["innerHTML"], fn = { class: "input-row link-buttons" }, hn = ["innerHTML"], vn = {
|
|
256
260
|
key: 4,
|
|
257
261
|
class: "input-row go-to-anchor clickable"
|
|
258
|
-
},
|
|
262
|
+
}, gn = {
|
|
259
263
|
__name: "LinkInput",
|
|
260
264
|
props: {
|
|
261
265
|
initialText: {
|
|
@@ -281,88 +285,91 @@ const _ = (t) => {
|
|
|
281
285
|
}
|
|
282
286
|
},
|
|
283
287
|
emits: ["submit", "cancel"],
|
|
284
|
-
setup(
|
|
285
|
-
const
|
|
286
|
-
if (
|
|
287
|
-
|
|
288
|
+
setup(e, { emit: s }) {
|
|
289
|
+
const t = s, n = e, { proxy: o } = Ot(), i = () => {
|
|
290
|
+
if (o?.$submit instanceof Function && o.$submit(), d.value && r.value) {
|
|
291
|
+
t("submit", { text: l.value, href: u.value });
|
|
288
292
|
return;
|
|
289
293
|
} else if (!d.value) {
|
|
290
|
-
|
|
294
|
+
t("submit", { text: l.value, href: null });
|
|
291
295
|
return;
|
|
292
296
|
}
|
|
293
297
|
console.debug("[LinkInput] Invalid URL in handleSubmit"), a.value = !0;
|
|
294
298
|
}, c = () => {
|
|
295
|
-
|
|
296
|
-
}, a =
|
|
297
|
-
const p =
|
|
298
|
-
return
|
|
299
|
-
}),
|
|
300
|
-
window.open(
|
|
299
|
+
t("submit", { text: l.value, href: null });
|
|
300
|
+
}, a = h(!1), l = h(n.initialText), d = h(n.href), u = j(() => d.value?.startsWith("http") ? d.value : "http://" + d.value), r = j(() => {
|
|
301
|
+
const p = u.value.split(".").filter(Boolean);
|
|
302
|
+
return u.value.includes(".") && p.length > 1;
|
|
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
|
+
window.open(u.value, "_blank");
|
|
301
305
|
};
|
|
302
|
-
|
|
306
|
+
Nt(
|
|
303
307
|
() => n.href,
|
|
304
308
|
(p) => {
|
|
305
309
|
d.value = p;
|
|
306
310
|
}
|
|
307
311
|
);
|
|
308
|
-
const
|
|
312
|
+
const D = () => {
|
|
309
313
|
const p = document.querySelector(".link-input-ctn input");
|
|
310
314
|
p && p.focus();
|
|
311
315
|
};
|
|
312
|
-
return
|
|
313
|
-
n.showInput &&
|
|
314
|
-
}), (p,
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
316
|
+
return Ce(() => {
|
|
317
|
+
n.showInput && D();
|
|
318
|
+
}), (p, S) => (C(), k("div", sn, [
|
|
319
|
+
e.href ? g.value ? (C(), k("div", ln, "Page anchor")) : (C(), k("div", rn, "Edit link")) : (C(), k("div", an, "Add link")),
|
|
320
|
+
e.showInput && !g.value ? (C(), k("div", cn, [
|
|
321
|
+
_("div", dn, [
|
|
322
|
+
_("div", {
|
|
319
323
|
class: "input-icon",
|
|
320
|
-
innerHTML:
|
|
321
|
-
}, null, 8,
|
|
322
|
-
|
|
324
|
+
innerHTML: M(Z).linkInput
|
|
325
|
+
}, null, 8, un),
|
|
326
|
+
Qe(_("input", {
|
|
323
327
|
type: "text",
|
|
324
328
|
placeholder: "Type or paste a link",
|
|
325
329
|
class: oe({ error: a.value }),
|
|
326
|
-
"onUpdate:modelValue":
|
|
330
|
+
"onUpdate:modelValue": S[0] || (S[0] = (F) => d.value = F),
|
|
327
331
|
onKeydown: [
|
|
328
|
-
|
|
329
|
-
|
|
332
|
+
et(he(i, ["stop", "prevent"]), ["enter"]),
|
|
333
|
+
S[1] || (S[1] = (F) => a.value = !1)
|
|
330
334
|
]
|
|
331
|
-
}, null, 42,
|
|
332
|
-
[
|
|
335
|
+
}, null, 42, mn), [
|
|
336
|
+
[tt, d.value]
|
|
333
337
|
]),
|
|
334
|
-
|
|
335
|
-
class: oe(["open-link-icon", { disabled: !
|
|
336
|
-
innerHTML:
|
|
337
|
-
onClick:
|
|
338
|
-
|
|
338
|
+
_("div", {
|
|
339
|
+
class: oe(["open-link-icon", { disabled: !r.value }]),
|
|
340
|
+
innerHTML: M(Z).openLink,
|
|
341
|
+
onClick: L,
|
|
342
|
+
"data-item": "btn-link-open"
|
|
343
|
+
}, null, 10, pn)
|
|
339
344
|
]),
|
|
340
|
-
|
|
341
|
-
|
|
345
|
+
_("div", fn, [
|
|
346
|
+
e.href ? (C(), k("button", {
|
|
342
347
|
key: 0,
|
|
343
348
|
class: "remove-btn",
|
|
344
|
-
onClick: c
|
|
349
|
+
onClick: c,
|
|
350
|
+
"data-item": "btn-link-remove"
|
|
345
351
|
}, [
|
|
346
|
-
|
|
352
|
+
_("div", {
|
|
347
353
|
class: "remove-btn__icon",
|
|
348
|
-
innerHTML:
|
|
349
|
-
}, null, 8,
|
|
350
|
-
|
|
351
|
-
])) :
|
|
352
|
-
|
|
354
|
+
innerHTML: M(Z).removeLink
|
|
355
|
+
}, null, 8, hn),
|
|
356
|
+
S[3] || (S[3] = nt(" Remove "))
|
|
357
|
+
])) : ee("", !0),
|
|
358
|
+
b.value ? (C(), k("button", {
|
|
353
359
|
key: 1,
|
|
354
360
|
class: oe(["submit-btn", { "disable-btn": v.value }]),
|
|
355
|
-
onClick: i
|
|
356
|
-
|
|
361
|
+
onClick: i,
|
|
362
|
+
"data-item": "btn-link-apply"
|
|
363
|
+
}, ie(w.value), 3)) : ee("", !0)
|
|
357
364
|
])
|
|
358
|
-
])) : g.value ? (
|
|
359
|
-
|
|
360
|
-
onClick:
|
|
361
|
-
}, "Go to " + ie(
|
|
362
|
-
])) :
|
|
365
|
+
])) : g.value ? (C(), k("div", vn, [
|
|
366
|
+
_("a", {
|
|
367
|
+
onClick: S[2] || (S[2] = he((...F) => e.goToAnchor && e.goToAnchor(...F), ["stop", "prevent"]))
|
|
368
|
+
}, "Go to " + ie(e.href.startsWith("#_") ? e.href.substring(2) : e.href), 1)
|
|
369
|
+
])) : ee("", !0)
|
|
363
370
|
]));
|
|
364
371
|
}
|
|
365
|
-
},
|
|
372
|
+
}, bn = /* @__PURE__ */ q(gn, [["__scopeId", "data-v-04bac853"]]), yn = { class: "document-mode" }, wn = ["onClick"], Cn = { class: "document-mode-column icon-column" }, kn = ["innerHTML"], _n = { class: "document-mode-column text-column" }, xn = { class: "document-mode-type" }, Sn = { class: "document-mode-description" }, En = {
|
|
366
373
|
__name: "DocumentMode",
|
|
367
374
|
props: {
|
|
368
375
|
options: {
|
|
@@ -370,32 +377,33 @@ const _ = (t) => {
|
|
|
370
377
|
}
|
|
371
378
|
},
|
|
372
379
|
emits: ["select"],
|
|
373
|
-
setup(
|
|
374
|
-
const
|
|
375
|
-
|
|
380
|
+
setup(e, { emit: s }) {
|
|
381
|
+
const t = s, n = (o) => {
|
|
382
|
+
t("select", o);
|
|
376
383
|
};
|
|
377
|
-
return (
|
|
378
|
-
(
|
|
384
|
+
return (o, i) => (C(), k("div", yn, [
|
|
385
|
+
(C(!0), k(U, null, te(e.options, (c) => (C(), k("div", {
|
|
379
386
|
class: oe(["option-item", { disabled: c.disabled }]),
|
|
380
|
-
onClick: (a) => n(c)
|
|
387
|
+
onClick: (a) => n(c),
|
|
388
|
+
"data-item": "btn-documentMode-option"
|
|
381
389
|
}, [
|
|
382
|
-
|
|
383
|
-
|
|
390
|
+
_("div", Cn, [
|
|
391
|
+
_("div", {
|
|
384
392
|
class: "icon-column__icon",
|
|
385
393
|
innerHTML: c.icon
|
|
386
|
-
}, null, 8,
|
|
394
|
+
}, null, 8, kn)
|
|
387
395
|
]),
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
396
|
+
_("div", _n, [
|
|
397
|
+
_("div", xn, ie(c.label), 1),
|
|
398
|
+
_("div", Sn, ie(c.description), 1)
|
|
391
399
|
])
|
|
392
|
-
], 10,
|
|
400
|
+
], 10, wn))), 256))
|
|
393
401
|
]));
|
|
394
402
|
}
|
|
395
|
-
},
|
|
403
|
+
}, An = /* @__PURE__ */ q(En, [["__scopeId", "data-v-8afd7fbb"]]), Tn = {
|
|
396
404
|
key: 0,
|
|
397
405
|
class: "linked-style-buttons"
|
|
398
|
-
},
|
|
406
|
+
}, Fn = ["onClick"], In = {
|
|
399
407
|
__name: "LinkedStyle",
|
|
400
408
|
props: {
|
|
401
409
|
editor: {
|
|
@@ -404,23 +412,24 @@ const _ = (t) => {
|
|
|
404
412
|
}
|
|
405
413
|
},
|
|
406
414
|
emits: ["select"],
|
|
407
|
-
setup(
|
|
408
|
-
const
|
|
409
|
-
|
|
415
|
+
setup(e, { emit: s }) {
|
|
416
|
+
const t = s, n = e, o = (i) => {
|
|
417
|
+
t("select", i);
|
|
410
418
|
};
|
|
411
|
-
return (i, c) => n.editor ? (
|
|
412
|
-
(
|
|
419
|
+
return (i, c) => n.editor ? (C(), k("div", Tn, [
|
|
420
|
+
(C(!0), k(U, null, te(M(Ye)(e.editor), (a) => (C(), k("div", {
|
|
413
421
|
class: "style-item",
|
|
414
|
-
onClick: (l) =>
|
|
422
|
+
onClick: (l) => o(a)
|
|
415
423
|
}, [
|
|
416
|
-
|
|
424
|
+
_("div", {
|
|
417
425
|
class: "style-name",
|
|
418
|
-
style:
|
|
426
|
+
style: Q(M(kt)(a, null, !1)),
|
|
427
|
+
"data-item": "btn-linkedStyles-option"
|
|
419
428
|
}, ie(a.definition.attrs.name), 5)
|
|
420
|
-
], 8,
|
|
421
|
-
])) :
|
|
429
|
+
], 8, Fn))), 256))
|
|
430
|
+
])) : ee("", !0);
|
|
422
431
|
}
|
|
423
|
-
},
|
|
432
|
+
}, Ln = /* @__PURE__ */ q(In, [["__scopeId", "data-v-44b680e9"]]), Mn = ["onClick"], Dn = ["innerHTML"], Bn = ["innerHTML"], Hn = {
|
|
424
433
|
__name: "IconGridRow",
|
|
425
434
|
props: {
|
|
426
435
|
icons: {
|
|
@@ -433,37 +442,37 @@ const _ = (t) => {
|
|
|
433
442
|
}
|
|
434
443
|
},
|
|
435
444
|
emits: ["select"],
|
|
436
|
-
setup(
|
|
437
|
-
const
|
|
438
|
-
|
|
445
|
+
setup(e, { emit: s }) {
|
|
446
|
+
const t = s, n = e, o = j(() => (a) => n.activeColor.value ? n.activeColor.value.toUpperCase() === a.value : !1), i = (a, l) => l === 5 || ["#FFFFFF", "#FAFF09"].includes(a) ? { color: "#000" } : { color: "#FFF" }, c = (a) => {
|
|
447
|
+
t("select", a.value);
|
|
439
448
|
};
|
|
440
|
-
return
|
|
449
|
+
return Ce(() => {
|
|
441
450
|
if (!n.icons.every((l) => Array.isArray(l))) throw new Error("icon props must be 2d array");
|
|
442
|
-
}), (a, l) => (
|
|
451
|
+
}), (a, l) => (C(!0), k(U, null, te(e.icons, (d, u) => (C(), k("div", {
|
|
443
452
|
class: "option-row",
|
|
444
|
-
key:
|
|
453
|
+
key: u
|
|
445
454
|
}, [
|
|
446
|
-
(
|
|
455
|
+
(C(!0), k(U, null, te(d, (r, w) => (C(), k("div", {
|
|
447
456
|
class: "option",
|
|
448
|
-
key:
|
|
449
|
-
onClick:
|
|
457
|
+
key: w,
|
|
458
|
+
onClick: he((v) => c(r), ["stop", "prevent"])
|
|
450
459
|
}, [
|
|
451
|
-
|
|
460
|
+
_("div", {
|
|
452
461
|
class: "option__icon",
|
|
453
|
-
innerHTML:
|
|
454
|
-
style:
|
|
455
|
-
}, null, 12,
|
|
456
|
-
|
|
462
|
+
innerHTML: r.icon,
|
|
463
|
+
style: Q(r.style)
|
|
464
|
+
}, null, 12, Dn),
|
|
465
|
+
o.value(r) ? (C(), k("div", {
|
|
457
466
|
key: 0,
|
|
458
467
|
class: "option__check",
|
|
459
|
-
innerHTML:
|
|
460
|
-
style:
|
|
461
|
-
}, null, 12,
|
|
462
|
-
], 8,
|
|
468
|
+
innerHTML: M(Z).colorOptionCheck,
|
|
469
|
+
style: Q(i(r.value, w))
|
|
470
|
+
}, null, 12, Bn)) : ee("", !0)
|
|
471
|
+
], 8, Mn))), 128))
|
|
463
472
|
]))), 128));
|
|
464
473
|
}
|
|
465
|
-
},
|
|
466
|
-
`,
|
|
474
|
+
}, Ze = /* @__PURE__ */ q(Hn, [["__scopeId", "data-v-6a2a9a40"]]), $n = `<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>
|
|
475
|
+
`, zn = { class: "options-grid-wrap" }, Rn = ["innerHTML"], On = { class: "option-grid-ctn" }, Nn = {
|
|
467
476
|
__name: "IconGrid",
|
|
468
477
|
props: {
|
|
469
478
|
icons: {
|
|
@@ -484,174 +493,174 @@ const _ = (t) => {
|
|
|
484
493
|
}
|
|
485
494
|
},
|
|
486
495
|
emits: ["select", "clickoutside"],
|
|
487
|
-
setup(
|
|
488
|
-
const
|
|
489
|
-
|
|
496
|
+
setup(e, { emit: s }) {
|
|
497
|
+
const t = s, n = (o) => {
|
|
498
|
+
t("select", o);
|
|
490
499
|
};
|
|
491
|
-
return (
|
|
492
|
-
|
|
500
|
+
return (o, i) => (C(), k("div", zn, [
|
|
501
|
+
e.hasNoneIcon ? (C(), k("div", {
|
|
493
502
|
key: 0,
|
|
494
503
|
class: "none-option",
|
|
495
504
|
onClick: i[0] || (i[0] = (c) => n("none"))
|
|
496
505
|
}, [
|
|
497
|
-
|
|
498
|
-
innerHTML:
|
|
506
|
+
_("span", {
|
|
507
|
+
innerHTML: M($n),
|
|
499
508
|
class: "none-icon"
|
|
500
|
-
}, null, 8,
|
|
501
|
-
i[1] || (i[1] =
|
|
502
|
-
])) :
|
|
503
|
-
|
|
504
|
-
P(
|
|
505
|
-
icons:
|
|
506
|
-
"active-color":
|
|
509
|
+
}, null, 8, Rn),
|
|
510
|
+
i[1] || (i[1] = nt(" None "))
|
|
511
|
+
])) : ee("", !0),
|
|
512
|
+
_("div", On, [
|
|
513
|
+
P(Ze, {
|
|
514
|
+
icons: e.icons,
|
|
515
|
+
"active-color": e.activeColor,
|
|
507
516
|
onSelect: n
|
|
508
517
|
}, null, 8, ["icons", "active-color"]),
|
|
509
|
-
|
|
510
|
-
i[2] || (i[2] =
|
|
511
|
-
P(
|
|
512
|
-
icons:
|
|
513
|
-
"active-color":
|
|
518
|
+
e.customIcons.flat().length ? (C(), k(U, { key: 0 }, [
|
|
519
|
+
i[2] || (i[2] = _("span", { class: "option-grid-ctn__subtitle" }, "Custom colors", -1)),
|
|
520
|
+
P(Ze, {
|
|
521
|
+
icons: e.customIcons,
|
|
522
|
+
"active-color": e.activeColor,
|
|
514
523
|
onSelect: n
|
|
515
524
|
}, null, 8, ["icons", "active-color"])
|
|
516
|
-
], 64)) :
|
|
525
|
+
], 64)) : ee("", !0)
|
|
517
526
|
])
|
|
518
527
|
]));
|
|
519
528
|
}
|
|
520
|
-
},
|
|
521
|
-
|
|
522
|
-
},
|
|
523
|
-
label:
|
|
524
|
-
icon:
|
|
525
|
-
value:
|
|
529
|
+
}, Wn = /* @__PURE__ */ q(Nn, [["__scopeId", "data-v-47b783db"]]), Vn = (e) => {
|
|
530
|
+
e.expand.value = !1;
|
|
531
|
+
}, f = (e, s = null) => ({
|
|
532
|
+
label: s,
|
|
533
|
+
icon: Z.colorOption,
|
|
534
|
+
value: e,
|
|
526
535
|
style: {
|
|
527
|
-
color:
|
|
536
|
+
color: e,
|
|
528
537
|
boxShadow: "0 0 5px 1px rgba(0, 0, 0, 0.1)",
|
|
529
538
|
borderRadius: "50%"
|
|
530
539
|
}
|
|
531
|
-
}),
|
|
532
|
-
const
|
|
533
|
-
|
|
540
|
+
}), We = (e, s, t = [], n = !1) => {
|
|
541
|
+
const o = (i) => {
|
|
542
|
+
s.iconColor.value = i, e.emitCommand({ item: s, argument: i }), Vn(s);
|
|
534
543
|
};
|
|
535
|
-
return
|
|
536
|
-
|
|
537
|
-
icons:
|
|
538
|
-
customIcons:
|
|
539
|
-
activeColor:
|
|
544
|
+
return $("div", {}, [
|
|
545
|
+
$(Wn, {
|
|
546
|
+
icons: at,
|
|
547
|
+
customIcons: t,
|
|
548
|
+
activeColor: s.iconColor,
|
|
540
549
|
hasNoneIcon: n,
|
|
541
|
-
onSelect:
|
|
550
|
+
onSelect: o
|
|
542
551
|
})
|
|
543
552
|
]);
|
|
544
|
-
},
|
|
553
|
+
}, at = [
|
|
545
554
|
[
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
555
|
+
f("#111111"),
|
|
556
|
+
f("#333333"),
|
|
557
|
+
f("#5C5C5C"),
|
|
558
|
+
f("#858585"),
|
|
559
|
+
f("#ADADAD"),
|
|
560
|
+
f("#D6D6D6"),
|
|
561
|
+
f("#FFFFFF")
|
|
553
562
|
],
|
|
554
563
|
[
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
564
|
+
f("#860028"),
|
|
565
|
+
f("#D2003F"),
|
|
566
|
+
f("#DB3365"),
|
|
567
|
+
f("#E4668C"),
|
|
568
|
+
f("#ED99B2"),
|
|
569
|
+
f("#F6CCD9"),
|
|
570
|
+
f("#FF004D")
|
|
562
571
|
],
|
|
563
572
|
[
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
573
|
+
f("#83015E"),
|
|
574
|
+
f("#CD0194"),
|
|
575
|
+
f("#D734A9"),
|
|
576
|
+
f("#E167BF"),
|
|
577
|
+
f("#EB99D4"),
|
|
578
|
+
f("#F5CCEA"),
|
|
579
|
+
f("#FF00A8")
|
|
571
580
|
],
|
|
572
581
|
[
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
582
|
+
f("#8E220A"),
|
|
583
|
+
f("#DD340F"),
|
|
584
|
+
f("#E45C3F"),
|
|
585
|
+
f("#EB856F"),
|
|
586
|
+
f("#F1AE9F"),
|
|
587
|
+
f("#F8D6CF"),
|
|
588
|
+
f("#FF7A00")
|
|
580
589
|
],
|
|
581
590
|
[
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
591
|
+
f("#947D02"),
|
|
592
|
+
f("#E7C302"),
|
|
593
|
+
f("#ECCF35"),
|
|
594
|
+
f("#F1DB67"),
|
|
595
|
+
f("#F5E79A"),
|
|
596
|
+
f("#FAF3CC"),
|
|
597
|
+
f("#FAFF09")
|
|
589
598
|
],
|
|
590
599
|
[
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
600
|
+
f("#055432"),
|
|
601
|
+
f("#07834F"),
|
|
602
|
+
f("#399C72"),
|
|
603
|
+
f("#6AB595"),
|
|
604
|
+
f("#9CCDB9"),
|
|
605
|
+
f("#CDE6DC"),
|
|
606
|
+
f("#05F38F")
|
|
598
607
|
],
|
|
599
608
|
[
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
609
|
+
f("#063E7E"),
|
|
610
|
+
f("#0A60C5"),
|
|
611
|
+
f("#3B80D1"),
|
|
612
|
+
f("#6CA0DC"),
|
|
613
|
+
f("#9DBFE8"),
|
|
614
|
+
f("#CEDFF3"),
|
|
615
|
+
f("#21c8ce")
|
|
607
616
|
],
|
|
608
617
|
[
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
618
|
+
f("#3E027A"),
|
|
619
|
+
f("#6103BF"),
|
|
620
|
+
f("#8136CC"),
|
|
621
|
+
f("#A068D9"),
|
|
622
|
+
f("#C09AE6"),
|
|
623
|
+
f("#DFCDF2"),
|
|
624
|
+
f("#A91DFF")
|
|
616
625
|
]
|
|
617
|
-
],
|
|
626
|
+
], Pn = () => at.flat().map((e) => e.value), jn = { class: "toolbar-table-grid-wrapper" }, Un = ["data-cols", "data-rows", "onClick"], qn = { class: "toolbar-table-grid-value" }, Gn = {
|
|
618
627
|
__name: "TableGrid",
|
|
619
628
|
emits: ["select", "clickoutside"],
|
|
620
|
-
setup(
|
|
621
|
-
const
|
|
629
|
+
setup(e, { emit: s }) {
|
|
630
|
+
const t = s, n = h(0), o = h(0), i = (a) => {
|
|
622
631
|
let l = a.target;
|
|
623
632
|
if (!!l.dataset.grid)
|
|
624
633
|
return;
|
|
625
|
-
let
|
|
626
|
-
|
|
627
|
-
for (let
|
|
628
|
-
let
|
|
629
|
-
g <=
|
|
634
|
+
let r = [...l.parentElement.querySelectorAll("[data-item]")], w = parseInt(l.dataset.cols, 10), v = parseInt(l.dataset.rows, 10);
|
|
635
|
+
o.value = w, n.value = v;
|
|
636
|
+
for (let b = 0; b < r.length; b++) {
|
|
637
|
+
let y = r[b], g = parseInt(y.dataset.cols, 10), L = parseInt(y.dataset.rows, 10);
|
|
638
|
+
g <= w && L <= v ? y.classList.add("selected") : y.classList.remove("selected");
|
|
630
639
|
}
|
|
631
640
|
}, c = ({ cols: a, rows: l }) => {
|
|
632
|
-
|
|
641
|
+
t("select", { cols: a, rows: l });
|
|
633
642
|
};
|
|
634
|
-
return (a, l) => (
|
|
635
|
-
|
|
643
|
+
return (a, l) => (C(), k("div", jn, [
|
|
644
|
+
_("div", {
|
|
636
645
|
class: "toolbar-table-grid",
|
|
637
646
|
onMouseover: i,
|
|
638
647
|
"data-grid": "true"
|
|
639
648
|
}, [
|
|
640
|
-
(
|
|
641
|
-
(
|
|
649
|
+
(C(), k(U, null, te(5, (d) => (C(), k(U, { key: d }, [
|
|
650
|
+
(C(), k(U, null, te(5, (u) => _("div", {
|
|
642
651
|
class: "toolbar-table-grid__item",
|
|
643
|
-
key: `${d}_${
|
|
644
|
-
"data-cols":
|
|
652
|
+
key: `${d}_${u}`,
|
|
653
|
+
"data-cols": u,
|
|
645
654
|
"data-rows": d,
|
|
646
655
|
"data-item": "true",
|
|
647
|
-
onClick:
|
|
648
|
-
}, null, 8,
|
|
656
|
+
onClick: he((r) => c({ cols: u, rows: d }), ["stop", "prevent"])
|
|
657
|
+
}, null, 8, Un)), 64))
|
|
649
658
|
], 64))), 64))
|
|
650
659
|
], 32),
|
|
651
|
-
|
|
660
|
+
_("div", qn, ie(n.value) + " x " + ie(o.value), 1)
|
|
652
661
|
]));
|
|
653
662
|
}
|
|
654
|
-
},
|
|
663
|
+
}, Kn = /* @__PURE__ */ q(Gn, [["__scopeId", "data-v-06352ab9"]]), Xn = { class: "toolbar-table-actions" }, Zn = ["onClick", "data-item"], Yn = { class: "toolbar-table-actions__icon" }, Jn = ["innerHTML"], Qn = { class: "toolbar-table-actions__label" }, eo = {
|
|
655
664
|
__name: "TableActions",
|
|
656
665
|
props: {
|
|
657
666
|
options: {
|
|
@@ -659,27 +668,28 @@ const _ = (t) => {
|
|
|
659
668
|
}
|
|
660
669
|
},
|
|
661
670
|
emits: ["select"],
|
|
662
|
-
setup(
|
|
663
|
-
const
|
|
664
|
-
|
|
671
|
+
setup(e, { emit: s }) {
|
|
672
|
+
const t = s, n = (o) => {
|
|
673
|
+
t("select", { command: o.command });
|
|
665
674
|
};
|
|
666
|
-
return (
|
|
667
|
-
(
|
|
675
|
+
return (o, i) => (C(), k("div", Xn, [
|
|
676
|
+
(C(!0), k(U, null, te(e.options, (c) => (C(), k("div", {
|
|
668
677
|
class: oe(["toolbar-table-actions__item", { "toolbar-table-actions__item--border": c.bottomBorder }]),
|
|
669
|
-
onClick: (a) => n(c)
|
|
678
|
+
onClick: (a) => n(c),
|
|
679
|
+
"data-item": c.props?.["data-item"] || ""
|
|
670
680
|
}, [
|
|
671
|
-
|
|
672
|
-
|
|
681
|
+
_("div", Yn, [
|
|
682
|
+
_("div", {
|
|
673
683
|
class: "toolbar-table-actions__icon-wrapper",
|
|
674
684
|
innerHTML: c.icon
|
|
675
|
-
}, null, 8,
|
|
685
|
+
}, null, 8, Jn)
|
|
676
686
|
]),
|
|
677
|
-
|
|
678
|
-
], 10,
|
|
687
|
+
_("div", Qn, ie(c.label), 1)
|
|
688
|
+
], 10, Zn))), 256))
|
|
679
689
|
]));
|
|
680
690
|
}
|
|
681
|
-
},
|
|
682
|
-
`,
|
|
691
|
+
}, to = /* @__PURE__ */ q(eo, [["__scopeId", "data-v-fdbfb4b0"]]), no = `<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>
|
|
692
|
+
`, oo = { class: "search-input-ctn" }, io = { class: "row" }, so = ["onKeydown"], ao = {
|
|
683
693
|
__name: "SearchInput",
|
|
684
694
|
props: {
|
|
685
695
|
searchRef: {
|
|
@@ -687,42 +697,87 @@ const _ = (t) => {
|
|
|
687
697
|
}
|
|
688
698
|
},
|
|
689
699
|
emits: ["submit"],
|
|
690
|
-
setup(
|
|
691
|
-
const
|
|
692
|
-
n("submit", { value:
|
|
700
|
+
setup(e, { emit: s }) {
|
|
701
|
+
const t = h(""), n = s, o = () => {
|
|
702
|
+
n("submit", { value: t.value });
|
|
693
703
|
};
|
|
694
|
-
return (i, c) => (
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
ref:
|
|
698
|
-
"onUpdate:modelValue": c[0] || (c[0] = (a) =>
|
|
704
|
+
return (i, c) => (C(), k("div", oo, [
|
|
705
|
+
_("div", io, [
|
|
706
|
+
Qe(_("input", {
|
|
707
|
+
ref: e.searchRef,
|
|
708
|
+
"onUpdate:modelValue": c[0] || (c[0] = (a) => t.value = a),
|
|
699
709
|
class: "search-input",
|
|
700
710
|
type: "text",
|
|
701
711
|
name: "search",
|
|
702
712
|
placeholder: "Type search string",
|
|
703
|
-
onKeydown:
|
|
704
|
-
}, null, 40,
|
|
705
|
-
[
|
|
713
|
+
onKeydown: et(he(o, ["stop", "prevent"]), ["enter"])
|
|
714
|
+
}, null, 40, so), [
|
|
715
|
+
[tt, t.value]
|
|
706
716
|
])
|
|
707
717
|
]),
|
|
708
|
-
|
|
709
|
-
|
|
718
|
+
_("div", { class: "row submit" }, [
|
|
719
|
+
_("button", {
|
|
710
720
|
class: "submit-btn",
|
|
711
|
-
onClick:
|
|
721
|
+
onClick: o
|
|
712
722
|
}, " Apply ")
|
|
713
723
|
])
|
|
714
724
|
]));
|
|
715
725
|
}
|
|
716
|
-
},
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
726
|
+
}, lo = /* @__PURE__ */ q(ao, [["__scopeId", "data-v-af870fbd"]]), ro = [
|
|
727
|
+
{
|
|
728
|
+
label: "Georgia",
|
|
729
|
+
key: "Georgia, serif",
|
|
730
|
+
fontWeight: 400,
|
|
731
|
+
props: {
|
|
732
|
+
style: { fontFamily: "Georgia, serif" },
|
|
733
|
+
"data-item": "btn-fontFamily-option"
|
|
734
|
+
}
|
|
735
|
+
},
|
|
736
|
+
{
|
|
737
|
+
label: "Arial",
|
|
738
|
+
key: "Arial, sans-serif",
|
|
739
|
+
fontWeight: 400,
|
|
740
|
+
props: {
|
|
741
|
+
style: { fontFamily: "Arial, sans-serif" },
|
|
742
|
+
"data-item": "btn-fontFamily-option"
|
|
743
|
+
}
|
|
744
|
+
},
|
|
745
|
+
{
|
|
746
|
+
label: "Courier New",
|
|
747
|
+
key: "Courier New, monospace",
|
|
748
|
+
fontWeight: 400,
|
|
749
|
+
props: {
|
|
750
|
+
style: { fontFamily: "Courier New, monospace" },
|
|
751
|
+
"data-item": "btn-fontFamily-option"
|
|
752
|
+
}
|
|
753
|
+
},
|
|
754
|
+
{
|
|
755
|
+
label: "Times New Roman",
|
|
756
|
+
key: "Times New Roman, serif",
|
|
757
|
+
fontWeight: 400,
|
|
758
|
+
props: {
|
|
759
|
+
style: { fontFamily: "Times New Roman, serif" },
|
|
760
|
+
"data-item": "btn-fontFamily-option"
|
|
761
|
+
}
|
|
762
|
+
}
|
|
763
|
+
], re = (e) => {
|
|
764
|
+
e.expand.value = !1;
|
|
765
|
+
}, co = ({
|
|
766
|
+
superToolbar: e,
|
|
767
|
+
toolbarIcons: s,
|
|
768
|
+
toolbarFonts: t,
|
|
769
|
+
hideButtons: n,
|
|
770
|
+
availableWidth: o,
|
|
771
|
+
role: i,
|
|
772
|
+
isDev: c = !1
|
|
773
|
+
} = {}) => {
|
|
774
|
+
const a = x({
|
|
720
775
|
type: "button",
|
|
721
776
|
name: "bold",
|
|
722
777
|
command: "toggleBold",
|
|
723
|
-
icon:
|
|
778
|
+
icon: s.bold,
|
|
724
779
|
tooltip: "Bold"
|
|
725
|
-
}),
|
|
780
|
+
}), l = x({
|
|
726
781
|
type: "dropdown",
|
|
727
782
|
name: "fontFamily",
|
|
728
783
|
tooltip: "Font",
|
|
@@ -735,45 +790,12 @@ const _ = (t) => {
|
|
|
735
790
|
isWide: !0,
|
|
736
791
|
style: { width: "116px" },
|
|
737
792
|
suppressActiveHighlight: !0,
|
|
738
|
-
options: [
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
key: "Georgia, serif",
|
|
742
|
-
fontWeight: 400,
|
|
743
|
-
props: {
|
|
744
|
-
style: { fontFamily: "Georgia, serif" }
|
|
745
|
-
}
|
|
746
|
-
},
|
|
747
|
-
{
|
|
748
|
-
label: "Arial",
|
|
749
|
-
key: "Arial, sans-serif",
|
|
750
|
-
fontWeight: 400,
|
|
751
|
-
props: {
|
|
752
|
-
style: { fontFamily: "Arial, sans-serif" }
|
|
753
|
-
}
|
|
754
|
-
},
|
|
755
|
-
{
|
|
756
|
-
label: "Courier New",
|
|
757
|
-
key: "Courier New, monospace",
|
|
758
|
-
fontWeight: 400,
|
|
759
|
-
props: {
|
|
760
|
-
style: { fontFamily: "Courier New, monospace" }
|
|
761
|
-
}
|
|
762
|
-
},
|
|
763
|
-
{
|
|
764
|
-
label: "Times New Roman",
|
|
765
|
-
key: "Times New Roman, serif",
|
|
766
|
-
fontWeight: 400,
|
|
767
|
-
props: {
|
|
768
|
-
style: { fontFamily: "Times New Roman, serif" }
|
|
769
|
-
}
|
|
770
|
-
}
|
|
771
|
-
],
|
|
772
|
-
onActivate: ({ fontFamily: u }) => {
|
|
773
|
-
u && (c.label.value = u);
|
|
793
|
+
options: [...t || ro],
|
|
794
|
+
onActivate: ({ fontFamily: m }) => {
|
|
795
|
+
m && (l.label.value = m);
|
|
774
796
|
},
|
|
775
|
-
onDeactivate: () =>
|
|
776
|
-
}),
|
|
797
|
+
onDeactivate: () => l.label.value = l.defaultLabel.value
|
|
798
|
+
}), d = x({
|
|
777
799
|
type: "dropdown",
|
|
778
800
|
dropdownStyles: {
|
|
779
801
|
padding: 0,
|
|
@@ -781,7 +803,7 @@ const _ = (t) => {
|
|
|
781
803
|
},
|
|
782
804
|
name: "ai",
|
|
783
805
|
tooltip: "AI text generation",
|
|
784
|
-
icon:
|
|
806
|
+
icon: s.ai,
|
|
785
807
|
hideLabel: !0,
|
|
786
808
|
hasCaret: !1,
|
|
787
809
|
isWide: !0,
|
|
@@ -791,31 +813,31 @@ const _ = (t) => {
|
|
|
791
813
|
type: "render",
|
|
792
814
|
key: "ai",
|
|
793
815
|
render: () => {
|
|
794
|
-
let
|
|
795
|
-
if (
|
|
796
|
-
const { state: A } =
|
|
797
|
-
|
|
816
|
+
let m = "";
|
|
817
|
+
if (e.activeEditor) {
|
|
818
|
+
const { state: A } = e.activeEditor, { from: V, to: le, empty: yt } = A.selection;
|
|
819
|
+
m = yt ? "" : A.doc.textBetween(V, le);
|
|
798
820
|
}
|
|
799
|
-
return
|
|
821
|
+
return $(
|
|
800
822
|
"div",
|
|
801
823
|
{},
|
|
802
824
|
[
|
|
803
|
-
|
|
825
|
+
$(qt, {
|
|
804
826
|
handleClose: () => {
|
|
805
|
-
|
|
827
|
+
re(d);
|
|
806
828
|
},
|
|
807
|
-
selectedText:
|
|
808
|
-
editor:
|
|
809
|
-
apiKey:
|
|
810
|
-
endpoint:
|
|
811
|
-
superToolbar:
|
|
829
|
+
selectedText: m,
|
|
830
|
+
editor: e.activeEditor,
|
|
831
|
+
apiKey: e.config.aiApiKey,
|
|
832
|
+
endpoint: e.config.aiEndpoint,
|
|
833
|
+
superToolbar: e
|
|
812
834
|
})
|
|
813
835
|
]
|
|
814
836
|
);
|
|
815
837
|
}
|
|
816
838
|
}
|
|
817
839
|
]
|
|
818
|
-
}),
|
|
840
|
+
}), u = x({
|
|
819
841
|
type: "dropdown",
|
|
820
842
|
name: "fontSize",
|
|
821
843
|
defaultLabel: "12",
|
|
@@ -831,47 +853,47 @@ const _ = (t) => {
|
|
|
831
853
|
isWide: !0,
|
|
832
854
|
command: "setFontSize",
|
|
833
855
|
options: [
|
|
834
|
-
{ label: "8", key: "8pt" },
|
|
835
|
-
{ label: "9", key: "9pt" },
|
|
836
|
-
{ label: "10", key: "10pt" },
|
|
837
|
-
{ label: "11", key: "11pt" },
|
|
838
|
-
{ label: "12", key: "12pt" },
|
|
839
|
-
{ label: "14", key: "14pt" },
|
|
840
|
-
{ label: "18", key: "18pt" },
|
|
841
|
-
{ label: "24", key: "24pt" },
|
|
842
|
-
{ label: "30", key: "30pt" },
|
|
843
|
-
{ label: "36", key: "36pt" },
|
|
844
|
-
{ label: "48", key: "48pt" },
|
|
845
|
-
{ label: "60", key: "60pt" },
|
|
846
|
-
{ label: "72", key: "72pt" },
|
|
847
|
-
{ label: "96", key: "96pt" }
|
|
856
|
+
{ label: "8", key: "8pt", props: { "data-item": "btn-fontSize-option" } },
|
|
857
|
+
{ label: "9", key: "9pt", props: { "data-item": "btn-fontSize-option" } },
|
|
858
|
+
{ label: "10", key: "10pt", props: { "data-item": "btn-fontSize-option" } },
|
|
859
|
+
{ label: "11", key: "11pt", props: { "data-item": "btn-fontSize-option" } },
|
|
860
|
+
{ label: "12", key: "12pt", props: { "data-item": "btn-fontSize-option" } },
|
|
861
|
+
{ label: "14", key: "14pt", props: { "data-item": "btn-fontSize-option" } },
|
|
862
|
+
{ label: "18", key: "18pt", props: { "data-item": "btn-fontSize-option" } },
|
|
863
|
+
{ label: "24", key: "24pt", props: { "data-item": "btn-fontSize-option" } },
|
|
864
|
+
{ label: "30", key: "30pt", props: { "data-item": "btn-fontSize-option" } },
|
|
865
|
+
{ label: "36", key: "36pt", props: { "data-item": "btn-fontSize-option" } },
|
|
866
|
+
{ label: "48", key: "48pt", props: { "data-item": "btn-fontSize-option" } },
|
|
867
|
+
{ label: "60", key: "60pt", props: { "data-item": "btn-fontSize-option" } },
|
|
868
|
+
{ label: "72", key: "72pt", props: { "data-item": "btn-fontSize-option" } },
|
|
869
|
+
{ label: "96", key: "96pt", props: { "data-item": "btn-fontSize-option" } }
|
|
848
870
|
],
|
|
849
|
-
onActivate: ({ fontSize:
|
|
850
|
-
if (!
|
|
851
|
-
let
|
|
852
|
-
|
|
871
|
+
onActivate: ({ fontSize: m }) => {
|
|
872
|
+
if (!m) return u.label.value = u.defaultLabel.value;
|
|
873
|
+
let E = jt(m, 12);
|
|
874
|
+
E < 8 && (E = 8), E > 96 && (E = 96), u.label.value = String(E);
|
|
853
875
|
},
|
|
854
|
-
onDeactivate: () =>
|
|
855
|
-
}),
|
|
876
|
+
onDeactivate: () => u.label.value = u.defaultLabel.value
|
|
877
|
+
}), r = x({
|
|
856
878
|
type: "separator",
|
|
857
879
|
name: "separator",
|
|
858
880
|
isNarrow: !0
|
|
859
|
-
}),
|
|
881
|
+
}), w = x({
|
|
860
882
|
type: "button",
|
|
861
883
|
name: "italic",
|
|
862
884
|
command: "toggleItalic",
|
|
863
|
-
icon:
|
|
885
|
+
icon: s.italic,
|
|
864
886
|
tooltip: "Italic"
|
|
865
|
-
}),
|
|
887
|
+
}), v = x({
|
|
866
888
|
type: "button",
|
|
867
889
|
name: "underline",
|
|
868
890
|
command: "toggleUnderline",
|
|
869
|
-
icon:
|
|
891
|
+
icon: s.underline,
|
|
870
892
|
tooltip: "Underline"
|
|
871
|
-
}), b =
|
|
893
|
+
}), b = x({
|
|
872
894
|
type: "dropdown",
|
|
873
895
|
name: "highlight",
|
|
874
|
-
icon:
|
|
896
|
+
icon: s.highlight,
|
|
875
897
|
hideLabel: !0,
|
|
876
898
|
markName: "highlight",
|
|
877
899
|
labelAttr: "color",
|
|
@@ -883,17 +905,17 @@ const _ = (t) => {
|
|
|
883
905
|
{
|
|
884
906
|
key: "color",
|
|
885
907
|
type: "render",
|
|
886
|
-
render: () =>
|
|
908
|
+
render: () => We(e, b, [], !0)
|
|
887
909
|
}
|
|
888
910
|
],
|
|
889
|
-
onActivate: ({ color:
|
|
890
|
-
b.iconColor.value =
|
|
911
|
+
onActivate: ({ color: m }) => {
|
|
912
|
+
b.iconColor.value = m || "";
|
|
891
913
|
},
|
|
892
914
|
onDeactivate: () => b.iconColor.value = ""
|
|
893
|
-
}),
|
|
915
|
+
}), y = x({
|
|
894
916
|
type: "dropdown",
|
|
895
917
|
name: "color",
|
|
896
|
-
icon:
|
|
918
|
+
icon: s.color,
|
|
897
919
|
hideLabel: !0,
|
|
898
920
|
markName: "textStyle",
|
|
899
921
|
labelAttr: "color",
|
|
@@ -904,88 +926,88 @@ const _ = (t) => {
|
|
|
904
926
|
{
|
|
905
927
|
key: "color",
|
|
906
928
|
type: "render",
|
|
907
|
-
render: () =>
|
|
929
|
+
render: () => We(e, y)
|
|
908
930
|
}
|
|
909
931
|
],
|
|
910
|
-
onActivate: ({ color:
|
|
911
|
-
|
|
932
|
+
onActivate: ({ color: m }) => {
|
|
933
|
+
y.iconColor.value = m;
|
|
912
934
|
},
|
|
913
|
-
onDeactivate: () =>
|
|
914
|
-
}),
|
|
935
|
+
onDeactivate: () => y.iconColor.value = "#000"
|
|
936
|
+
}), g = h(null), L = x({
|
|
915
937
|
type: "dropdown",
|
|
916
938
|
name: "search",
|
|
917
|
-
icon:
|
|
939
|
+
icon: s.search,
|
|
918
940
|
tooltip: "Search",
|
|
919
941
|
group: "right",
|
|
920
|
-
inputRef:
|
|
942
|
+
inputRef: g,
|
|
921
943
|
options: [
|
|
922
944
|
{
|
|
923
945
|
type: "render",
|
|
924
946
|
key: "searchDropdown",
|
|
925
|
-
render: () =>
|
|
947
|
+
render: () => D()
|
|
926
948
|
}
|
|
927
949
|
]
|
|
928
|
-
}),
|
|
929
|
-
|
|
930
|
-
onSubmit: ({ value:
|
|
931
|
-
|
|
950
|
+
}), D = () => $("div", {}, [
|
|
951
|
+
$(lo, {
|
|
952
|
+
onSubmit: ({ value: E }) => {
|
|
953
|
+
e.activeEditor.commands.search(E);
|
|
932
954
|
},
|
|
933
|
-
searchRef:
|
|
955
|
+
searchRef: g
|
|
934
956
|
})
|
|
935
|
-
]),
|
|
957
|
+
]), p = x({
|
|
936
958
|
type: "dropdown",
|
|
937
959
|
name: "link",
|
|
938
960
|
markName: "link",
|
|
939
|
-
icon:
|
|
961
|
+
icon: s.link,
|
|
940
962
|
tooltip: "Link",
|
|
941
963
|
options: [
|
|
942
964
|
{
|
|
943
965
|
type: "render",
|
|
944
966
|
key: "linkDropdown",
|
|
945
|
-
render: () =>
|
|
967
|
+
render: () => S(p)
|
|
946
968
|
}
|
|
947
969
|
],
|
|
948
|
-
onActivate: ({ href:
|
|
949
|
-
|
|
970
|
+
onActivate: ({ href: m }) => {
|
|
971
|
+
m ? p.attributes.value = { href: m } : p.attributes.value = {}, p.expand.value = !0;
|
|
950
972
|
},
|
|
951
973
|
onDeactivate: () => {
|
|
952
|
-
|
|
974
|
+
p.attributes.value = {}, p.expand.value = !1;
|
|
953
975
|
}
|
|
954
976
|
});
|
|
955
|
-
function
|
|
956
|
-
return
|
|
957
|
-
|
|
977
|
+
function S(m) {
|
|
978
|
+
return $("div", {}, [
|
|
979
|
+
$(bn, {
|
|
958
980
|
onSubmit: ({ href: A }) => {
|
|
959
|
-
|
|
960
|
-
const
|
|
961
|
-
|
|
981
|
+
re(m), m.attributes.value.link = { href: A };
|
|
982
|
+
const V = { ...m, command: "toggleLink" };
|
|
983
|
+
e.emitCommand({ item: V, argument: { href: A, text: "" } }), A || (m.active.value = !1);
|
|
962
984
|
},
|
|
963
|
-
href:
|
|
985
|
+
href: m.attributes.value.href,
|
|
964
986
|
goToAnchor: () => {
|
|
965
|
-
if (
|
|
966
|
-
const A =
|
|
967
|
-
le &&
|
|
987
|
+
if (re(m), !e.activeEditor || !m.attributes.value?.href) return;
|
|
988
|
+
const A = m.attributes.value?.href?.slice(1), le = e.activeEditor.element.querySelector(`a[name='${A}']`);
|
|
989
|
+
le && Zt(le);
|
|
968
990
|
}
|
|
969
991
|
})
|
|
970
992
|
]);
|
|
971
993
|
}
|
|
972
|
-
const
|
|
994
|
+
const F = x({
|
|
973
995
|
type: "options",
|
|
974
996
|
name: "linkInput",
|
|
975
997
|
command: "toggleLink"
|
|
976
998
|
});
|
|
977
|
-
|
|
978
|
-
const
|
|
999
|
+
p.childItem = F, F.parentItem = p;
|
|
1000
|
+
const O = x({
|
|
979
1001
|
type: "button",
|
|
980
1002
|
name: "image",
|
|
981
1003
|
command: "startImageUpload",
|
|
982
|
-
icon:
|
|
1004
|
+
icon: s.image,
|
|
983
1005
|
tooltip: "Image",
|
|
984
1006
|
disabled: !1
|
|
985
|
-
}),
|
|
1007
|
+
}), W = x({
|
|
986
1008
|
type: "dropdown",
|
|
987
1009
|
name: "table",
|
|
988
|
-
icon:
|
|
1010
|
+
icon: s.table,
|
|
989
1011
|
hideLabel: !0,
|
|
990
1012
|
labelAttr: "table",
|
|
991
1013
|
tooltip: "Insert table",
|
|
@@ -995,106 +1017,117 @@ const _ = (t) => {
|
|
|
995
1017
|
{
|
|
996
1018
|
key: "table",
|
|
997
1019
|
type: "render",
|
|
998
|
-
render: () =>
|
|
1020
|
+
render: () => ne(W)
|
|
999
1021
|
}
|
|
1000
1022
|
]
|
|
1001
1023
|
});
|
|
1002
|
-
function
|
|
1003
|
-
return
|
|
1004
|
-
|
|
1024
|
+
function ne(m) {
|
|
1025
|
+
return $("div", {}, [
|
|
1026
|
+
$(Kn, {
|
|
1005
1027
|
onSelect: (A) => {
|
|
1006
|
-
|
|
1028
|
+
e.emitCommand({ item: m, argument: A }), re(m);
|
|
1007
1029
|
}
|
|
1008
1030
|
})
|
|
1009
1031
|
]);
|
|
1010
1032
|
}
|
|
1011
|
-
const
|
|
1033
|
+
const ue = x({
|
|
1012
1034
|
type: "dropdown",
|
|
1013
1035
|
name: "tableActions",
|
|
1014
1036
|
command: "executeTableCommand",
|
|
1015
|
-
icon:
|
|
1037
|
+
icon: s.tableActions,
|
|
1016
1038
|
hideLabel: !0,
|
|
1017
1039
|
disabled: !0,
|
|
1018
1040
|
options: [
|
|
1019
1041
|
{
|
|
1020
1042
|
type: "render",
|
|
1021
|
-
render: () =>
|
|
1043
|
+
render: () => ge(ue)
|
|
1022
1044
|
}
|
|
1023
1045
|
]
|
|
1024
|
-
}),
|
|
1046
|
+
}), ve = [
|
|
1025
1047
|
{
|
|
1026
1048
|
label: "Insert row above",
|
|
1027
1049
|
command: "addRowBefore",
|
|
1028
|
-
icon:
|
|
1050
|
+
icon: s.addRowBefore,
|
|
1051
|
+
props: { "data-item": "btn-tableActions-option" }
|
|
1029
1052
|
},
|
|
1030
1053
|
{
|
|
1031
1054
|
label: "Insert row below",
|
|
1032
1055
|
command: "addRowAfter",
|
|
1033
|
-
icon:
|
|
1056
|
+
icon: s.addRowAfter,
|
|
1057
|
+
props: { "data-item": "btn-tableActions-option" }
|
|
1034
1058
|
},
|
|
1035
1059
|
{
|
|
1036
1060
|
label: "Insert column left",
|
|
1037
1061
|
command: "addColumnBefore",
|
|
1038
|
-
icon:
|
|
1062
|
+
icon: s.addColumnBefore,
|
|
1063
|
+
props: { "data-item": "btn-tableActions-option" }
|
|
1039
1064
|
},
|
|
1040
1065
|
{
|
|
1041
1066
|
label: "Insert column right",
|
|
1042
1067
|
command: "addColumnAfter",
|
|
1043
|
-
icon:
|
|
1044
|
-
bottomBorder: !0
|
|
1068
|
+
icon: s.addColumnAfter,
|
|
1069
|
+
bottomBorder: !0,
|
|
1070
|
+
props: { "data-item": "btn-tableActions-option" }
|
|
1045
1071
|
},
|
|
1046
1072
|
{
|
|
1047
1073
|
label: "Delete row",
|
|
1048
1074
|
command: "deleteRow",
|
|
1049
|
-
icon:
|
|
1075
|
+
icon: s.deleteRow,
|
|
1076
|
+
props: { "data-item": "btn-tableActions-option" }
|
|
1050
1077
|
},
|
|
1051
1078
|
{
|
|
1052
1079
|
label: "Delete column",
|
|
1053
1080
|
command: "deleteColumn",
|
|
1054
|
-
icon:
|
|
1081
|
+
icon: s.deleteColumn,
|
|
1082
|
+
props: { "data-item": "btn-tableActions-option" }
|
|
1055
1083
|
},
|
|
1056
1084
|
{
|
|
1057
1085
|
label: "Delete table",
|
|
1058
1086
|
command: "deleteTable",
|
|
1059
|
-
icon:
|
|
1087
|
+
icon: s.deleteTable,
|
|
1088
|
+
props: { "data-item": "btn-tableActions-option" }
|
|
1060
1089
|
},
|
|
1061
1090
|
{
|
|
1062
1091
|
label: "Transparent borders",
|
|
1063
1092
|
command: "deleteCellAndTableBorders",
|
|
1064
|
-
icon:
|
|
1065
|
-
bottomBorder: !0
|
|
1093
|
+
icon: s.deleteBorders,
|
|
1094
|
+
bottomBorder: !0,
|
|
1095
|
+
props: { "data-item": "btn-tableActions-option" }
|
|
1066
1096
|
},
|
|
1067
1097
|
{
|
|
1068
1098
|
label: "Merge cells",
|
|
1069
1099
|
command: "mergeCells",
|
|
1070
|
-
icon:
|
|
1100
|
+
icon: s.mergeCells,
|
|
1101
|
+
props: { "data-item": "btn-tableActions-option" }
|
|
1071
1102
|
},
|
|
1072
1103
|
{
|
|
1073
1104
|
label: "Split cell",
|
|
1074
1105
|
command: "splitCell",
|
|
1075
|
-
icon:
|
|
1106
|
+
icon: s.splitCell,
|
|
1107
|
+
props: { "data-item": "btn-tableActions-option" }
|
|
1076
1108
|
},
|
|
1077
1109
|
{
|
|
1078
1110
|
label: "Fix tables",
|
|
1079
1111
|
command: "fixTables",
|
|
1080
|
-
icon:
|
|
1112
|
+
icon: s.fixTables,
|
|
1113
|
+
props: { "data-item": "btn-tableActions-option" }
|
|
1081
1114
|
}
|
|
1082
1115
|
];
|
|
1083
|
-
function
|
|
1084
|
-
return
|
|
1085
|
-
options:
|
|
1086
|
-
onSelect: (
|
|
1087
|
-
|
|
1088
|
-
const { command: A } =
|
|
1089
|
-
|
|
1116
|
+
function ge(m) {
|
|
1117
|
+
return $(to, {
|
|
1118
|
+
options: ve,
|
|
1119
|
+
onSelect: (E) => {
|
|
1120
|
+
re(m);
|
|
1121
|
+
const { command: A } = E;
|
|
1122
|
+
e.emitCommand({ item: m, argument: { command: A } });
|
|
1090
1123
|
}
|
|
1091
1124
|
});
|
|
1092
1125
|
}
|
|
1093
|
-
const
|
|
1126
|
+
const Y = x({
|
|
1094
1127
|
type: "dropdown",
|
|
1095
1128
|
name: "textAlign",
|
|
1096
1129
|
tooltip: "Alignment",
|
|
1097
|
-
icon:
|
|
1130
|
+
icon: s.alignLeft,
|
|
1098
1131
|
command: "setTextAlign",
|
|
1099
1132
|
hasCaret: !0,
|
|
1100
1133
|
markName: "textAlign",
|
|
@@ -1103,65 +1136,65 @@ const _ = (t) => {
|
|
|
1103
1136
|
options: [
|
|
1104
1137
|
{
|
|
1105
1138
|
type: "render",
|
|
1106
|
-
render: () =>
|
|
1107
|
-
|
|
1108
|
-
onSelect: (
|
|
1109
|
-
|
|
1110
|
-
const A = { ...
|
|
1111
|
-
A.command = "setTextAlign",
|
|
1139
|
+
render: () => $("div", {}, [
|
|
1140
|
+
$(on, {
|
|
1141
|
+
onSelect: (E) => {
|
|
1142
|
+
re(Y);
|
|
1143
|
+
const A = { ...Y, command: "setTextAlign" };
|
|
1144
|
+
A.command = "setTextAlign", e.emitCommand({ item: A, argument: E }), T(Y, E);
|
|
1112
1145
|
}
|
|
1113
1146
|
})
|
|
1114
1147
|
]),
|
|
1115
1148
|
key: "alignment"
|
|
1116
1149
|
}
|
|
1117
1150
|
],
|
|
1118
|
-
onActivate: ({ textAlign:
|
|
1119
|
-
|
|
1151
|
+
onActivate: ({ textAlign: m }) => {
|
|
1152
|
+
T(Y, m);
|
|
1120
1153
|
},
|
|
1121
1154
|
onDeactivate: () => {
|
|
1122
|
-
|
|
1155
|
+
T(Y, "left");
|
|
1123
1156
|
}
|
|
1124
|
-
}),
|
|
1125
|
-
let A =
|
|
1126
|
-
left:
|
|
1127
|
-
right:
|
|
1128
|
-
center:
|
|
1129
|
-
justify:
|
|
1130
|
-
}, le =
|
|
1131
|
-
|
|
1132
|
-
},
|
|
1157
|
+
}), T = (m, E) => {
|
|
1158
|
+
let A = E === "both" ? "justify" : E, V = {
|
|
1159
|
+
left: s.alignLeft,
|
|
1160
|
+
right: s.alignRight,
|
|
1161
|
+
center: s.alignCenter,
|
|
1162
|
+
justify: s.alignJustify
|
|
1163
|
+
}, le = V[A] ?? V.left;
|
|
1164
|
+
m.icon.value = le;
|
|
1165
|
+
}, B = x({
|
|
1133
1166
|
type: "button",
|
|
1134
1167
|
name: "list",
|
|
1135
1168
|
command: "toggleBulletList",
|
|
1136
|
-
icon:
|
|
1169
|
+
icon: s.bulletList,
|
|
1137
1170
|
tooltip: "Bullet list"
|
|
1138
|
-
}),
|
|
1171
|
+
}), H = x({
|
|
1139
1172
|
type: "button",
|
|
1140
1173
|
name: "numberedlist",
|
|
1141
1174
|
command: "toggleOrderedList",
|
|
1142
|
-
icon:
|
|
1175
|
+
icon: s.numberedList,
|
|
1143
1176
|
tooltip: "Numbered list"
|
|
1144
|
-
}),
|
|
1177
|
+
}), z = x({
|
|
1145
1178
|
type: "button",
|
|
1146
1179
|
name: "indentleft",
|
|
1147
1180
|
command: "decreaseTextIndent",
|
|
1148
|
-
icon:
|
|
1181
|
+
icon: s.indentLeft,
|
|
1149
1182
|
tooltip: "Left indent",
|
|
1150
1183
|
disabled: !1
|
|
1151
|
-
}),
|
|
1184
|
+
}), G = x({
|
|
1152
1185
|
type: "button",
|
|
1153
1186
|
name: "indentright",
|
|
1154
1187
|
command: "increaseTextIndent",
|
|
1155
|
-
icon:
|
|
1188
|
+
icon: s.indentRight,
|
|
1156
1189
|
tooltip: "Right indent",
|
|
1157
1190
|
disabled: !1
|
|
1158
|
-
}),
|
|
1191
|
+
}), K = x({
|
|
1159
1192
|
type: "overflow",
|
|
1160
1193
|
name: "overflow",
|
|
1161
1194
|
command: "toggleOverflow",
|
|
1162
|
-
icon:
|
|
1195
|
+
icon: s.overflow,
|
|
1163
1196
|
disabled: !1
|
|
1164
|
-
}),
|
|
1197
|
+
}), ce = x({
|
|
1165
1198
|
type: "dropdown",
|
|
1166
1199
|
name: "zoom",
|
|
1167
1200
|
allowWithoutEditor: !0,
|
|
@@ -1174,116 +1207,116 @@ const _ = (t) => {
|
|
|
1174
1207
|
inlineTextInputVisible: !1,
|
|
1175
1208
|
hasInlineTextInput: !0,
|
|
1176
1209
|
options: [
|
|
1177
|
-
{ label: "50%", key: 0.5 },
|
|
1178
|
-
{ label: "75%", key: 0.75 },
|
|
1179
|
-
{ label: "90%", key: 0.9 },
|
|
1180
|
-
{ label: "100%", key: 1 },
|
|
1181
|
-
{ label: "125%", key: 1.25 },
|
|
1182
|
-
{ label: "150%", key: 1.5 },
|
|
1183
|
-
{ label: "200%", key: 2 }
|
|
1210
|
+
{ label: "50%", key: 0.5, props: { "data-item": "btn-zoom-option" } },
|
|
1211
|
+
{ label: "75%", key: 0.75, props: { "data-item": "btn-zoom-option" } },
|
|
1212
|
+
{ label: "90%", key: 0.9, props: { "data-item": "btn-zoom-option" } },
|
|
1213
|
+
{ label: "100%", key: 1, props: { "data-item": "btn-zoom-option" } },
|
|
1214
|
+
{ label: "125%", key: 1.25, props: { "data-item": "btn-zoom-option" } },
|
|
1215
|
+
{ label: "150%", key: 1.5, props: { "data-item": "btn-zoom-option" } },
|
|
1216
|
+
{ label: "200%", key: 2, props: { "data-item": "btn-zoom-option" } }
|
|
1184
1217
|
],
|
|
1185
|
-
onActivate: ({ zoom:
|
|
1186
|
-
|
|
1218
|
+
onActivate: ({ zoom: m }) => {
|
|
1219
|
+
m && (ce.label.value = m);
|
|
1187
1220
|
}
|
|
1188
|
-
}),
|
|
1221
|
+
}), se = x({
|
|
1189
1222
|
type: "button",
|
|
1190
1223
|
name: "undo",
|
|
1191
1224
|
disabled: !0,
|
|
1192
1225
|
tooltip: "Undo",
|
|
1193
1226
|
command: "undo",
|
|
1194
|
-
icon:
|
|
1227
|
+
icon: s.undo,
|
|
1195
1228
|
group: "left",
|
|
1196
1229
|
onDeactivate: () => {
|
|
1197
|
-
|
|
1230
|
+
se.disabled.value = !e.undoDepth;
|
|
1198
1231
|
}
|
|
1199
|
-
}),
|
|
1232
|
+
}), ke = x({
|
|
1200
1233
|
type: "button",
|
|
1201
1234
|
disabled: !0,
|
|
1202
1235
|
name: "redo",
|
|
1203
1236
|
tooltip: "Redo",
|
|
1204
1237
|
command: "redo",
|
|
1205
|
-
icon:
|
|
1238
|
+
icon: s.redo,
|
|
1206
1239
|
group: "left",
|
|
1207
1240
|
onDeactivate: () => {
|
|
1208
|
-
|
|
1241
|
+
ke.disabled.value = !e.redoDepth;
|
|
1209
1242
|
}
|
|
1210
|
-
}),
|
|
1243
|
+
}), Ie = x({
|
|
1211
1244
|
type: "button",
|
|
1212
1245
|
disabled: !1,
|
|
1213
1246
|
name: "toggleTrackChanges",
|
|
1214
1247
|
tooltip: "Track Changes",
|
|
1215
1248
|
command: "toggleTrackChanges",
|
|
1216
|
-
icon:
|
|
1249
|
+
icon: s.trackChanges,
|
|
1217
1250
|
group: "left"
|
|
1218
|
-
}),
|
|
1251
|
+
}), be = x({
|
|
1219
1252
|
type: "button",
|
|
1220
1253
|
disabled: !1,
|
|
1221
1254
|
name: "acceptTrackedChangeBySelection",
|
|
1222
1255
|
tooltip: "Accept changes under selection",
|
|
1223
1256
|
command: "acceptTrackedChangeBySelection",
|
|
1224
|
-
icon:
|
|
1257
|
+
icon: s.trackChangesAccept,
|
|
1225
1258
|
group: "left"
|
|
1226
|
-
}),
|
|
1259
|
+
}), _e = x({
|
|
1227
1260
|
type: "button",
|
|
1228
1261
|
disabled: !1,
|
|
1229
1262
|
name: "rejectTrackedChangeOnSelection",
|
|
1230
1263
|
tooltip: "Reject changes under selection",
|
|
1231
1264
|
command: "rejectTrackedChangeOnSelection",
|
|
1232
|
-
icon:
|
|
1265
|
+
icon: s.trackChangesReject,
|
|
1233
1266
|
group: "left"
|
|
1234
|
-
}),
|
|
1267
|
+
}), Le = x({
|
|
1235
1268
|
type: "button",
|
|
1236
1269
|
disabled: !1,
|
|
1237
1270
|
name: "toggleTrackChangesShowOriginal",
|
|
1238
1271
|
tooltip: "Toggle Show Original",
|
|
1239
1272
|
command: "toggleTrackChangesShowOriginal",
|
|
1240
|
-
icon:
|
|
1273
|
+
icon: s.trackChangesOriginal,
|
|
1241
1274
|
group: "left"
|
|
1242
|
-
}),
|
|
1275
|
+
}), Me = x({
|
|
1243
1276
|
type: "button",
|
|
1244
1277
|
disabled: !1,
|
|
1245
1278
|
name: "toggleTrackChangesShowFinal",
|
|
1246
1279
|
tooltip: "Toggle Show Final",
|
|
1247
1280
|
command: "toggleTrackChangesShowFinal",
|
|
1248
|
-
icon:
|
|
1281
|
+
icon: s.trackChangesFinal,
|
|
1249
1282
|
group: "left"
|
|
1250
|
-
}),
|
|
1283
|
+
}), De = x({
|
|
1251
1284
|
type: "button",
|
|
1252
1285
|
name: "clearFormatting",
|
|
1253
1286
|
command: "clearFormat",
|
|
1254
1287
|
tooltip: "Clear formatting",
|
|
1255
|
-
icon:
|
|
1288
|
+
icon: s.clearFormatting
|
|
1256
1289
|
});
|
|
1257
1290
|
[
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
].map((
|
|
1266
|
-
const
|
|
1291
|
+
a,
|
|
1292
|
+
w,
|
|
1293
|
+
v,
|
|
1294
|
+
G,
|
|
1295
|
+
z,
|
|
1296
|
+
L,
|
|
1297
|
+
K
|
|
1298
|
+
].map((m) => m.name);
|
|
1299
|
+
const xe = x({
|
|
1267
1300
|
type: "button",
|
|
1268
1301
|
name: "copyFormat",
|
|
1269
1302
|
tooltip: "Format painter",
|
|
1270
|
-
icon:
|
|
1303
|
+
icon: s.copyFormat,
|
|
1271
1304
|
command: "copyFormat"
|
|
1272
|
-
}),
|
|
1305
|
+
}), Se = (m, E) => m === "editor" ? E : m === "suggester" ? E.filter((A) => A.value === "suggesting") : E.filter((A) => A.value === "viewing"), Ee = (m) => m === "editor" ? "Editing" : m === "suggester" ? "Suggesting" : "Viewing", X = x({
|
|
1273
1306
|
type: "dropdown",
|
|
1274
1307
|
name: "documentMode",
|
|
1275
1308
|
command: "setDocumentMode",
|
|
1276
1309
|
allowWithoutEditor: !0,
|
|
1277
|
-
icon:
|
|
1278
|
-
defaultLabel:
|
|
1279
|
-
label:
|
|
1280
|
-
hasCaret:
|
|
1310
|
+
icon: s.documentMode,
|
|
1311
|
+
defaultLabel: Ee(i),
|
|
1312
|
+
label: Ee(i),
|
|
1313
|
+
hasCaret: i === "editor",
|
|
1281
1314
|
isWide: !0,
|
|
1282
1315
|
style: { display: "flex", justifyContent: "flex-end" },
|
|
1283
1316
|
inlineTextInputVisible: !1,
|
|
1284
1317
|
hasInlineTextInput: !1,
|
|
1285
1318
|
group: "right",
|
|
1286
|
-
disabled:
|
|
1319
|
+
disabled: i !== "editor",
|
|
1287
1320
|
attributes: {
|
|
1288
1321
|
dropdownPosition: "right",
|
|
1289
1322
|
className: "toolbar-item--doc-mode"
|
|
@@ -1291,47 +1324,47 @@ const _ = (t) => {
|
|
|
1291
1324
|
options: [
|
|
1292
1325
|
{
|
|
1293
1326
|
type: "render",
|
|
1294
|
-
render: () =>
|
|
1327
|
+
render: () => ye(X)
|
|
1295
1328
|
}
|
|
1296
1329
|
]
|
|
1297
|
-
}),
|
|
1330
|
+
}), ae = [
|
|
1298
1331
|
{
|
|
1299
1332
|
label: "Editing",
|
|
1300
1333
|
value: "editing",
|
|
1301
|
-
icon:
|
|
1334
|
+
icon: s.documentEditingMode,
|
|
1302
1335
|
description: "Edit document directly"
|
|
1303
1336
|
},
|
|
1304
1337
|
{
|
|
1305
1338
|
label: "Suggesting",
|
|
1306
1339
|
value: "suggesting",
|
|
1307
|
-
icon:
|
|
1340
|
+
icon: s.documentSuggestingMode,
|
|
1308
1341
|
description: "Edits become suggestions"
|
|
1309
1342
|
},
|
|
1310
1343
|
{
|
|
1311
1344
|
label: "Viewing",
|
|
1312
1345
|
value: "viewing",
|
|
1313
|
-
icon:
|
|
1346
|
+
icon: s.documentViewingMode,
|
|
1314
1347
|
description: "View clean version of document only"
|
|
1315
1348
|
}
|
|
1316
1349
|
];
|
|
1317
|
-
function
|
|
1318
|
-
const
|
|
1319
|
-
return
|
|
1320
|
-
options:
|
|
1350
|
+
function ye(m) {
|
|
1351
|
+
const E = Se(i, ae);
|
|
1352
|
+
return $(An, {
|
|
1353
|
+
options: E,
|
|
1321
1354
|
onSelect: (A) => {
|
|
1322
|
-
|
|
1323
|
-
const { label:
|
|
1324
|
-
|
|
1355
|
+
re(m);
|
|
1356
|
+
const { label: V, icon: le } = A;
|
|
1357
|
+
X.label.value = V, X.icon.value = le, e.emitCommand({ item: X, argument: V });
|
|
1325
1358
|
}
|
|
1326
1359
|
});
|
|
1327
1360
|
}
|
|
1328
|
-
const
|
|
1361
|
+
const ut = x({
|
|
1329
1362
|
type: "button",
|
|
1330
1363
|
name: "pageBreakTool",
|
|
1331
1364
|
command: "insertPageBreak",
|
|
1332
|
-
icon:
|
|
1365
|
+
icon: s.pageBreak,
|
|
1333
1366
|
tooltip: "Insert page break"
|
|
1334
|
-
}),
|
|
1367
|
+
}), je = /* @__PURE__ */ new Map([
|
|
1335
1368
|
["separator", 20],
|
|
1336
1369
|
["zoom", 71],
|
|
1337
1370
|
["fontFamily", 118],
|
|
@@ -1341,17 +1374,17 @@ const _ = (t) => {
|
|
|
1341
1374
|
["documentMode", 47],
|
|
1342
1375
|
["ai", 32],
|
|
1343
1376
|
["default", 32]
|
|
1344
|
-
]),
|
|
1377
|
+
]), mt = x({
|
|
1345
1378
|
type: "button",
|
|
1346
1379
|
name: "ruler",
|
|
1347
1380
|
command: "toggleRuler",
|
|
1348
|
-
icon:
|
|
1381
|
+
icon: s.ruler,
|
|
1349
1382
|
tooltip: "Show or hide ruler"
|
|
1350
|
-
}),
|
|
1383
|
+
}), we = x({
|
|
1351
1384
|
type: "dropdown",
|
|
1352
1385
|
name: "linkedStyles",
|
|
1353
1386
|
command: "setLinkedStyle",
|
|
1354
|
-
icon:
|
|
1387
|
+
icon: s.paintbrush,
|
|
1355
1388
|
defaultLabel: "Format text",
|
|
1356
1389
|
label: "Format text",
|
|
1357
1390
|
hasCaret: !0,
|
|
@@ -1367,34 +1400,34 @@ const _ = (t) => {
|
|
|
1367
1400
|
type: "render",
|
|
1368
1401
|
key: "linkedStyle",
|
|
1369
1402
|
render: () => {
|
|
1370
|
-
const
|
|
1371
|
-
|
|
1372
|
-
const A = { ...
|
|
1373
|
-
|
|
1403
|
+
const m = (E) => {
|
|
1404
|
+
re(we);
|
|
1405
|
+
const A = { ...we, command: "setLinkedStyle" };
|
|
1406
|
+
e.emitCommand({ item: A, argument: E });
|
|
1374
1407
|
};
|
|
1375
|
-
return
|
|
1376
|
-
|
|
1377
|
-
editor:
|
|
1378
|
-
onSelect:
|
|
1408
|
+
return $("div", {}, [
|
|
1409
|
+
$(Ln, {
|
|
1410
|
+
editor: e.activeEditor,
|
|
1411
|
+
onSelect: m
|
|
1379
1412
|
})
|
|
1380
1413
|
]);
|
|
1381
1414
|
}
|
|
1382
1415
|
}
|
|
1383
1416
|
],
|
|
1384
1417
|
onActivate: () => {
|
|
1385
|
-
|
|
1418
|
+
we.disabled.value = !1;
|
|
1386
1419
|
},
|
|
1387
1420
|
onDeactivate: () => {
|
|
1388
|
-
|
|
1421
|
+
we.disabled.value = !0;
|
|
1389
1422
|
}
|
|
1390
|
-
}),
|
|
1391
|
-
if (
|
|
1392
|
-
return
|
|
1393
|
-
}, de =
|
|
1423
|
+
}), me = (m, E) => {
|
|
1424
|
+
if (E.value.toString() === m)
|
|
1425
|
+
return $("div", { innerHTML: no, class: "dropdown-select-icon" });
|
|
1426
|
+
}, de = x({
|
|
1394
1427
|
type: "dropdown",
|
|
1395
1428
|
name: "lineHeight",
|
|
1396
1429
|
tooltip: "Line height",
|
|
1397
|
-
icon:
|
|
1430
|
+
icon: s.lineHeight,
|
|
1398
1431
|
hasCaret: !1,
|
|
1399
1432
|
hasInlineTextInput: !1,
|
|
1400
1433
|
inlineTextInputVisible: !1,
|
|
@@ -1404,193 +1437,196 @@ const _ = (t) => {
|
|
|
1404
1437
|
dropdownValueKey: "key",
|
|
1405
1438
|
selectedValue: "1",
|
|
1406
1439
|
options: [
|
|
1407
|
-
{ label: "1,0", key: "1", icon: () =>
|
|
1408
|
-
{ label: "1,15", key: "1.15", icon: () =>
|
|
1409
|
-
{ label: "1,5", key: "1.5", icon: () =>
|
|
1410
|
-
{ label: "2,0", key: "2", icon: () =>
|
|
1411
|
-
{ label: "2,5", key: "2.5", icon: () =>
|
|
1412
|
-
{ label: "3,0", key: "3", icon: () =>
|
|
1440
|
+
{ label: "1,0", key: "1", icon: () => me("1", de.selectedValue), props: { "data-item": "btn-lineHeight-option" } },
|
|
1441
|
+
{ label: "1,15", key: "1.15", icon: () => me("1.15", de.selectedValue), props: { "data-item": "btn-lineHeight-option" } },
|
|
1442
|
+
{ label: "1,5", key: "1.5", icon: () => me("1.5", de.selectedValue), props: { "data-item": "btn-lineHeight-option" } },
|
|
1443
|
+
{ label: "2,0", key: "2", icon: () => me("2", de.selectedValue), props: { "data-item": "btn-lineHeight-option" } },
|
|
1444
|
+
{ label: "2,5", key: "2.5", icon: () => me("2.5", de.selectedValue), props: { "data-item": "btn-lineHeight-option" } },
|
|
1445
|
+
{ label: "3,0", key: "3", icon: () => me("3", de.selectedValue), props: { "data-item": "btn-lineHeight-option" } }
|
|
1413
1446
|
]
|
|
1414
|
-
}),
|
|
1447
|
+
}), Be = {
|
|
1415
1448
|
sm: 768,
|
|
1416
1449
|
md: 1024,
|
|
1417
1450
|
xl: 1410
|
|
1418
|
-
},
|
|
1419
|
-
let
|
|
1420
|
-
|
|
1421
|
-
|
|
1451
|
+
}, pt = 120, ft = 32, ht = ["linkedStyles", "clearFormatting", "copyFormat", "ruler"], vt = ["zoom", "fontFamily", "fontSize", "redo"];
|
|
1452
|
+
let R = [
|
|
1453
|
+
se,
|
|
1454
|
+
ke,
|
|
1422
1455
|
// Dev - tracked changes
|
|
1423
1456
|
// toggleTrackChanges,
|
|
1457
|
+
be,
|
|
1424
1458
|
_e,
|
|
1425
|
-
xe,
|
|
1426
1459
|
// toggleTrackChangesOriginal,
|
|
1427
1460
|
// toggleTrackChangesFinal,
|
|
1428
|
-
|
|
1429
|
-
c,
|
|
1430
|
-
d,
|
|
1461
|
+
ce,
|
|
1431
1462
|
l,
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1463
|
+
r,
|
|
1464
|
+
u,
|
|
1465
|
+
r,
|
|
1466
|
+
a,
|
|
1467
|
+
w,
|
|
1436
1468
|
v,
|
|
1469
|
+
y,
|
|
1437
1470
|
b,
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
I,
|
|
1447
|
-
M,
|
|
1471
|
+
r,
|
|
1472
|
+
p,
|
|
1473
|
+
O,
|
|
1474
|
+
W,
|
|
1475
|
+
ue,
|
|
1476
|
+
r,
|
|
1477
|
+
Y,
|
|
1478
|
+
B,
|
|
1448
1479
|
H,
|
|
1480
|
+
z,
|
|
1481
|
+
G,
|
|
1449
1482
|
de,
|
|
1483
|
+
r,
|
|
1484
|
+
we,
|
|
1485
|
+
r,
|
|
1486
|
+
mt,
|
|
1487
|
+
ut,
|
|
1488
|
+
xe,
|
|
1489
|
+
De,
|
|
1450
1490
|
d,
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
dt,
|
|
1454
|
-
se,
|
|
1455
|
-
Le,
|
|
1456
|
-
Ie,
|
|
1457
|
-
a,
|
|
1458
|
-
R,
|
|
1459
|
-
ne
|
|
1491
|
+
K,
|
|
1492
|
+
X
|
|
1460
1493
|
];
|
|
1461
|
-
if (
|
|
1462
|
-
const
|
|
1463
|
-
|
|
1464
|
-
const
|
|
1465
|
-
|
|
1494
|
+
if (e.config?.superdoc?.config?.modules?.ai || (R = R.filter((m) => m.name.value !== "ai")), o <= Be.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
|
+
const m = R.findIndex((A) => A.name.value === "linkedStyles");
|
|
1496
|
+
R.splice(m - 1, 2);
|
|
1497
|
+
const E = ["ruler", "zoom", "undo", "redo"];
|
|
1498
|
+
R = R.filter((A) => !E.includes(A.name.value));
|
|
1466
1499
|
}
|
|
1467
|
-
const
|
|
1468
|
-
|
|
1469
|
-
const
|
|
1470
|
-
let
|
|
1471
|
-
return
|
|
1472
|
-
const
|
|
1473
|
-
if (o <
|
|
1474
|
-
if (
|
|
1475
|
-
const A =
|
|
1476
|
-
|
|
1500
|
+
const Ue = [Ie, Le, Me];
|
|
1501
|
+
c || (i === "viewer" && Ue.push(be, _e), R = R.filter((m) => !Ue.includes(m)));
|
|
1502
|
+
const gt = [L, se, K, X].map((m) => m.name), bt = (m) => gt.includes(m.name), Ae = [], He = [];
|
|
1503
|
+
let $e = ft + pt;
|
|
1504
|
+
return R.forEach((m) => {
|
|
1505
|
+
const E = je.get(m.name.value) || je.get("default");
|
|
1506
|
+
if (o < Be.xl && ht.includes(m.name.value) && n) {
|
|
1507
|
+
if (Ae.push(m), m.name.value === "linkedStyles") {
|
|
1508
|
+
const A = R.findIndex((V) => V.name.value === "linkedStyles");
|
|
1509
|
+
R.splice(A + 1, 1);
|
|
1477
1510
|
}
|
|
1478
1511
|
return;
|
|
1479
1512
|
}
|
|
1480
|
-
if (o <
|
|
1481
|
-
|
|
1513
|
+
if (o < Be.sm && vt.includes(m.name.value) && n) {
|
|
1514
|
+
Ae.push(m);
|
|
1482
1515
|
return;
|
|
1483
1516
|
}
|
|
1484
|
-
if (
|
|
1485
|
-
He.push(
|
|
1517
|
+
if (bt(m)) {
|
|
1518
|
+
He.push(m), $e += E;
|
|
1486
1519
|
return;
|
|
1487
1520
|
}
|
|
1488
|
-
|
|
1521
|
+
$e < o || !n ? (He.push(m), $e += E) : Ae.push(m);
|
|
1489
1522
|
}), {
|
|
1490
1523
|
defaultItems: He,
|
|
1491
|
-
overflowItems:
|
|
1524
|
+
overflowItems: Ae.filter((m) => m.type !== "separator")
|
|
1492
1525
|
};
|
|
1493
|
-
},
|
|
1494
|
-
let
|
|
1495
|
-
|
|
1496
|
-
let
|
|
1497
|
-
return
|
|
1498
|
-
|
|
1499
|
-
const i =
|
|
1526
|
+
}, uo = [".jpg", ".jpeg", ".png", "image/jpeg", "image/png"], mo = () => {
|
|
1527
|
+
let e = document.createElement("input");
|
|
1528
|
+
e.type = "file";
|
|
1529
|
+
let s = uo;
|
|
1530
|
+
return e.accept = s.join(","), () => new Promise((n, o) => {
|
|
1531
|
+
e.onchange = async () => {
|
|
1532
|
+
const i = e.files;
|
|
1500
1533
|
if (!i) return n(null);
|
|
1501
1534
|
const c = i.item(0);
|
|
1502
1535
|
return n(c ? { file: c } : null);
|
|
1503
|
-
},
|
|
1536
|
+
}, e.oncancel = () => n(null), e.onerror = o, e.click();
|
|
1504
1537
|
});
|
|
1505
|
-
},
|
|
1538
|
+
}, po = (e) => new Promise((s, t) => {
|
|
1506
1539
|
let n = new FileReader();
|
|
1507
|
-
n.onload = (
|
|
1508
|
-
}),
|
|
1509
|
-
const
|
|
1510
|
-
|
|
1511
|
-
const i = document.createElement("canvas"), { width: c, height: a } =
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1540
|
+
n.onload = (o) => s(o.target.result), n.onerror = t, setTimeout(() => n.readAsDataURL(e), 250);
|
|
1541
|
+
}), fo = (e, s) => new Promise((t, n) => {
|
|
1542
|
+
const o = new window.Image();
|
|
1543
|
+
o.onload = () => {
|
|
1544
|
+
const i = document.createElement("canvas"), { width: c, height: a } = ho(
|
|
1545
|
+
o.width,
|
|
1546
|
+
o.height,
|
|
1547
|
+
s
|
|
1515
1548
|
);
|
|
1516
|
-
if (i.width = c, i.height = a, i.getContext("2d").drawImage(
|
|
1549
|
+
if (i.width = c, i.height = a, i.getContext("2d").drawImage(o, 0, 0, c, a), typeof e == "string") {
|
|
1517
1550
|
const d = i.toDataURL();
|
|
1518
|
-
|
|
1551
|
+
t(d);
|
|
1519
1552
|
} else
|
|
1520
1553
|
i.toBlob((d) => {
|
|
1521
|
-
const
|
|
1522
|
-
type:
|
|
1554
|
+
const u = new File([d], e.name, {
|
|
1555
|
+
type: e.type,
|
|
1523
1556
|
lastModified: Date.now()
|
|
1524
1557
|
});
|
|
1525
|
-
|
|
1558
|
+
t({ file: u, width: c, height: a });
|
|
1526
1559
|
});
|
|
1527
|
-
},
|
|
1528
|
-
}),
|
|
1529
|
-
const { width: n, height:
|
|
1530
|
-
if (!n || !
|
|
1531
|
-
let i =
|
|
1532
|
-
const a =
|
|
1533
|
-
return
|
|
1534
|
-
},
|
|
1535
|
-
let n = typeof
|
|
1536
|
-
if ((
|
|
1560
|
+
}, o.onerror = (i) => n(i), o.src = typeof e == "string" ? e : URL.createObjectURL(e);
|
|
1561
|
+
}), ho = (e, s, t) => {
|
|
1562
|
+
const { width: n, height: o } = t.getMaxContentSize();
|
|
1563
|
+
if (!n || !o) return { width: e, height: s };
|
|
1564
|
+
let i = e, c = s;
|
|
1565
|
+
const a = e / s;
|
|
1566
|
+
return s > o && (c = o, i = Math.round(o * a)), i > n && (i = n, c = Math.round(n / a)), { width: i, height: c };
|
|
1567
|
+
}, vo = async ({ editor: e, view: s, file: t }) => {
|
|
1568
|
+
let n = typeof e.options.handleImageUpload == "function" ? e.options.handleImageUpload : po;
|
|
1569
|
+
if ((t.size / (1024 * 1024)).toFixed(4) > 5) {
|
|
1537
1570
|
window.alert("Image size must be less than 5MB");
|
|
1538
1571
|
return;
|
|
1539
1572
|
}
|
|
1540
1573
|
let i, c;
|
|
1541
1574
|
try {
|
|
1542
|
-
const
|
|
1543
|
-
i =
|
|
1544
|
-
} catch (
|
|
1545
|
-
console.warn("Error processing image:",
|
|
1575
|
+
const r = await fo(t, e);
|
|
1576
|
+
i = r.width, c = r.height, t = r.file;
|
|
1577
|
+
} catch (r) {
|
|
1578
|
+
console.warn("Error processing image:", r);
|
|
1546
1579
|
return;
|
|
1547
1580
|
}
|
|
1548
|
-
let a = {}, { tr: l, schema: d } =
|
|
1581
|
+
let a = {}, { tr: l, schema: d } = s.state;
|
|
1549
1582
|
l.selection.empty || l.deleteSelection();
|
|
1550
|
-
let
|
|
1583
|
+
let u = {
|
|
1551
1584
|
type: "add",
|
|
1552
1585
|
pos: l.selection.from,
|
|
1553
1586
|
id: a
|
|
1554
1587
|
};
|
|
1555
|
-
l.setMeta(
|
|
1556
|
-
(
|
|
1557
|
-
let
|
|
1588
|
+
l.setMeta(Oe, u), s.dispatch(l), n(t).then(
|
|
1589
|
+
(r) => {
|
|
1590
|
+
let w = t.name.replace(" ", "_"), v = _t(s.state, a);
|
|
1558
1591
|
if (v == null)
|
|
1559
1592
|
return;
|
|
1560
|
-
let
|
|
1561
|
-
src:
|
|
1593
|
+
let b = { type: "remove", id: a }, y = `word/media/${w}`, g = d.nodes.image.create({
|
|
1594
|
+
src: y,
|
|
1562
1595
|
size: { width: i, height: c }
|
|
1563
1596
|
});
|
|
1564
|
-
|
|
1565
|
-
|
|
1597
|
+
e.storage.image.media = Object.assign(e.storage.image.media, { [y]: r }), e.options.ydoc && e.commands.addImageToCollaboration({ mediaPath: y, fileData: r }), s.dispatch(
|
|
1598
|
+
s.state.tr.replaceWith(v, v, g).setMeta(Oe, b)
|
|
1566
1599
|
);
|
|
1567
1600
|
},
|
|
1568
1601
|
() => {
|
|
1569
|
-
let
|
|
1570
|
-
|
|
1602
|
+
let r = { type: "remove", id: a };
|
|
1603
|
+
s.dispatch(l.setMeta(Oe, r));
|
|
1571
1604
|
}
|
|
1572
1605
|
);
|
|
1573
1606
|
};
|
|
1574
|
-
var
|
|
1575
|
-
class
|
|
1607
|
+
var I, lt, fe, Ve, rt, ct, Pe, dt, pe;
|
|
1608
|
+
class Ho extends Kt {
|
|
1576
1609
|
/**
|
|
1577
1610
|
* Creates a new SuperToolbar instance
|
|
1578
1611
|
* @param {ToolbarConfig} config - The configuration for the toolbar
|
|
1579
1612
|
* @returns {void}
|
|
1580
1613
|
*/
|
|
1581
|
-
constructor(
|
|
1614
|
+
constructor(t) {
|
|
1582
1615
|
super();
|
|
1583
|
-
|
|
1616
|
+
Re(this, I);
|
|
1584
1617
|
/**
|
|
1585
1618
|
* Default configuration for the toolbar
|
|
1586
1619
|
* @type {ToolbarConfig}
|
|
1587
1620
|
*/
|
|
1588
|
-
|
|
1621
|
+
ze(this, "config", {
|
|
1589
1622
|
selector: null,
|
|
1590
1623
|
toolbarGroups: ["left", "center", "right"],
|
|
1591
1624
|
role: "editor",
|
|
1592
1625
|
pagination: !1,
|
|
1593
|
-
icons: { ...
|
|
1626
|
+
icons: { ...Z },
|
|
1627
|
+
fonts: null,
|
|
1628
|
+
hideButtons: !0,
|
|
1629
|
+
responsiveToContainer: !1,
|
|
1594
1630
|
mode: "docx",
|
|
1595
1631
|
excludeItems: [],
|
|
1596
1632
|
groups: null,
|
|
@@ -1604,7 +1640,7 @@ class Mo extends qt {
|
|
|
1604
1640
|
* @private
|
|
1605
1641
|
* @type {Object.<string, function(CommandItem): void>}
|
|
1606
1642
|
*/
|
|
1607
|
-
|
|
1643
|
+
Re(this, fe, {
|
|
1608
1644
|
/**
|
|
1609
1645
|
* Handles zoom level changes
|
|
1610
1646
|
* @param {Object} params - Command parameters
|
|
@@ -1612,13 +1648,13 @@ class Mo extends qt {
|
|
|
1612
1648
|
* @param {string|number} params.argument - The zoom level (percentage)
|
|
1613
1649
|
* @returns {void}
|
|
1614
1650
|
*/
|
|
1615
|
-
setZoom: ({ item:
|
|
1651
|
+
setZoom: ({ item: t, argument: n }) => {
|
|
1616
1652
|
if (!n) return;
|
|
1617
|
-
|
|
1618
|
-
const
|
|
1619
|
-
if (!
|
|
1653
|
+
t.onActivate({ zoom: n }), this.emit("superdoc-command", { item: t, argument: n });
|
|
1654
|
+
const o = document.querySelector(this.superdoc.config.selector)?.querySelector(".layers");
|
|
1655
|
+
if (!o) return;
|
|
1620
1656
|
const i = typeof screen.orientation < "u", c = window.matchMedia("(max-width: 834px)").matches;
|
|
1621
|
-
i && c ? (
|
|
1657
|
+
i && c ? (o.style.transformOrigin = "0 0", o.style.transform = `scale(${parseInt(n) / 100})`) : o.style.zoom = parseInt(n) / 100, this.superdoc.superdocStore.activeZoom = parseInt(n);
|
|
1622
1658
|
},
|
|
1623
1659
|
/**
|
|
1624
1660
|
* Sets the document mode
|
|
@@ -1627,8 +1663,8 @@ class Mo extends qt {
|
|
|
1627
1663
|
* @param {string} params.argument - The document mode to set
|
|
1628
1664
|
* @returns {void}
|
|
1629
1665
|
*/
|
|
1630
|
-
setDocumentMode: ({ item:
|
|
1631
|
-
n && this.emit("superdoc-command", { item:
|
|
1666
|
+
setDocumentMode: ({ item: t, argument: n }) => {
|
|
1667
|
+
n && this.emit("superdoc-command", { item: t, argument: n });
|
|
1632
1668
|
},
|
|
1633
1669
|
/**
|
|
1634
1670
|
* Sets the font size for text
|
|
@@ -1637,8 +1673,8 @@ class Mo extends qt {
|
|
|
1637
1673
|
* @param {string|number} params.argument - The font size to set
|
|
1638
1674
|
* @returns {void}
|
|
1639
1675
|
*/
|
|
1640
|
-
setFontSize: ({ item:
|
|
1641
|
-
|
|
1676
|
+
setFontSize: ({ item: t, argument: n }) => {
|
|
1677
|
+
N(this, I, pe).call(this, { item: t, argument: n }, () => {
|
|
1642
1678
|
this.activeEditor?.commands.setFieldAnnotationsFontSize(n, !0);
|
|
1643
1679
|
});
|
|
1644
1680
|
},
|
|
@@ -1649,8 +1685,8 @@ class Mo extends qt {
|
|
|
1649
1685
|
* @param {string} params.argument - The font family to set
|
|
1650
1686
|
* @returns {void}
|
|
1651
1687
|
*/
|
|
1652
|
-
setFontFamily: ({ item:
|
|
1653
|
-
|
|
1688
|
+
setFontFamily: ({ item: t, argument: n }) => {
|
|
1689
|
+
N(this, I, pe).call(this, { item: t, argument: n }, () => {
|
|
1654
1690
|
this.activeEditor?.commands.setFieldAnnotationsFontFamily(n, !0);
|
|
1655
1691
|
});
|
|
1656
1692
|
},
|
|
@@ -1661,8 +1697,8 @@ class Mo extends qt {
|
|
|
1661
1697
|
* @param {string} params.argument - The color to set
|
|
1662
1698
|
* @returns {void}
|
|
1663
1699
|
*/
|
|
1664
|
-
setColor: ({ item:
|
|
1665
|
-
|
|
1700
|
+
setColor: ({ item: t, argument: n }) => {
|
|
1701
|
+
N(this, I, pe).call(this, { item: t, argument: n }, () => {
|
|
1666
1702
|
this.activeEditor?.commands.setFieldAnnotationsTextColor(n, !0);
|
|
1667
1703
|
});
|
|
1668
1704
|
},
|
|
@@ -1673,10 +1709,10 @@ class Mo extends qt {
|
|
|
1673
1709
|
* @param {string} params.argument - The highlight color to set
|
|
1674
1710
|
* @returns {void}
|
|
1675
1711
|
*/
|
|
1676
|
-
setHighlight: ({ item:
|
|
1677
|
-
|
|
1678
|
-
let
|
|
1679
|
-
this.activeEditor?.commands.setFieldAnnotationsTextHighlight(
|
|
1712
|
+
setHighlight: ({ item: t, argument: n }) => {
|
|
1713
|
+
N(this, I, pe).call(this, { item: t, argument: n, noArgumentCallback: !0 }, () => {
|
|
1714
|
+
let o = n !== "none" ? n : null;
|
|
1715
|
+
this.activeEditor?.commands.setFieldAnnotationsTextHighlight(o, !0), this.activeEditor?.commands.setCellBackground(o);
|
|
1680
1716
|
});
|
|
1681
1717
|
},
|
|
1682
1718
|
/**
|
|
@@ -1684,7 +1720,7 @@ class Mo extends qt {
|
|
|
1684
1720
|
* @param {Object} [_params=null] - Command parameters (not used)
|
|
1685
1721
|
* @returns {void}
|
|
1686
1722
|
*/
|
|
1687
|
-
toggleRuler: (
|
|
1723
|
+
toggleRuler: (t = null) => {
|
|
1688
1724
|
this.superdoc.toggleRuler();
|
|
1689
1725
|
},
|
|
1690
1726
|
/**
|
|
@@ -1693,12 +1729,12 @@ class Mo extends qt {
|
|
|
1693
1729
|
* @param {Object} [_params=null - Command parameters (not used)
|
|
1694
1730
|
* @returns {Promise<void>}
|
|
1695
1731
|
*/
|
|
1696
|
-
startImageUpload: async (
|
|
1697
|
-
let
|
|
1698
|
-
|
|
1732
|
+
startImageUpload: async (t = null) => {
|
|
1733
|
+
let o = await mo()();
|
|
1734
|
+
o?.file && vo({
|
|
1699
1735
|
editor: this.activeEditor,
|
|
1700
1736
|
view: this.activeEditor.view,
|
|
1701
|
-
file:
|
|
1737
|
+
file: o.file
|
|
1702
1738
|
});
|
|
1703
1739
|
},
|
|
1704
1740
|
/**
|
|
@@ -1708,11 +1744,11 @@ class Mo extends qt {
|
|
|
1708
1744
|
* @param {*} params.argument - Command arguments
|
|
1709
1745
|
* @returns {void}
|
|
1710
1746
|
*/
|
|
1711
|
-
increaseTextIndent: ({ item:
|
|
1712
|
-
let
|
|
1713
|
-
if (
|
|
1747
|
+
increaseTextIndent: ({ item: t, argument: n }) => {
|
|
1748
|
+
let o = t.command, { state: i } = this.activeEditor;
|
|
1749
|
+
if (Ke((a) => a.type.name === "listItem")(i.selection))
|
|
1714
1750
|
return this.activeEditor.commands.increaseListIndent();
|
|
1715
|
-
|
|
1751
|
+
o in this.activeEditor.commands && this.activeEditor.commands[o](n);
|
|
1716
1752
|
},
|
|
1717
1753
|
/**
|
|
1718
1754
|
* Decreases text indentation or list level
|
|
@@ -1721,11 +1757,11 @@ class Mo extends qt {
|
|
|
1721
1757
|
* @param {*} params.argument - Command arguments
|
|
1722
1758
|
* @returns {boolean}
|
|
1723
1759
|
*/
|
|
1724
|
-
decreaseTextIndent: ({ item:
|
|
1725
|
-
let
|
|
1726
|
-
if (
|
|
1760
|
+
decreaseTextIndent: ({ item: t, argument: n }) => {
|
|
1761
|
+
let o = t.command, { state: i } = this.activeEditor;
|
|
1762
|
+
if (Ke((a) => a.type.name === "listItem")(i.selection))
|
|
1727
1763
|
return this.activeEditor.commands.decreaseListIndent();
|
|
1728
|
-
|
|
1764
|
+
o in this.activeEditor.commands && this.activeEditor.commands[o](n);
|
|
1729
1765
|
},
|
|
1730
1766
|
/**
|
|
1731
1767
|
* Toggles bold formatting for text
|
|
@@ -1734,9 +1770,9 @@ class Mo extends qt {
|
|
|
1734
1770
|
* @param {*} params.argument - Command arguments
|
|
1735
1771
|
* @returns {void}
|
|
1736
1772
|
*/
|
|
1737
|
-
toggleBold: ({ item:
|
|
1738
|
-
let
|
|
1739
|
-
|
|
1773
|
+
toggleBold: ({ item: t, argument: n }) => {
|
|
1774
|
+
let o = t.command;
|
|
1775
|
+
o in this.activeEditor.commands && (this.activeEditor.commands[o](n), this.activeEditor.commands.toggleFieldAnnotationsFormat("bold", !0)), this.updateToolbarState();
|
|
1740
1776
|
},
|
|
1741
1777
|
/**
|
|
1742
1778
|
* Toggles italic formatting for text
|
|
@@ -1745,9 +1781,9 @@ class Mo extends qt {
|
|
|
1745
1781
|
* @param {*} params.argument - Command arguments
|
|
1746
1782
|
* @returns {void}
|
|
1747
1783
|
*/
|
|
1748
|
-
toggleItalic: ({ item:
|
|
1749
|
-
let
|
|
1750
|
-
|
|
1784
|
+
toggleItalic: ({ item: t, argument: n }) => {
|
|
1785
|
+
let o = t.command;
|
|
1786
|
+
o in this.activeEditor.commands && (this.activeEditor.commands[o](n), this.activeEditor.commands.toggleFieldAnnotationsFormat("italic", !0)), this.updateToolbarState();
|
|
1751
1787
|
},
|
|
1752
1788
|
/**
|
|
1753
1789
|
* Toggles underline formatting for text
|
|
@@ -1756,9 +1792,9 @@ class Mo extends qt {
|
|
|
1756
1792
|
* @param {*} params.argument - Command arguments
|
|
1757
1793
|
* @returns {void}
|
|
1758
1794
|
*/
|
|
1759
|
-
toggleUnderline: ({ item:
|
|
1760
|
-
let
|
|
1761
|
-
|
|
1795
|
+
toggleUnderline: ({ item: t, argument: n }) => {
|
|
1796
|
+
let o = t.command;
|
|
1797
|
+
o in this.activeEditor.commands && (this.activeEditor.commands[o](n), this.activeEditor.commands.toggleFieldAnnotationsFormat("underline", !0)), this.updateToolbarState();
|
|
1762
1798
|
},
|
|
1763
1799
|
/**
|
|
1764
1800
|
* Toggles link formatting and updates cursor position
|
|
@@ -1767,11 +1803,11 @@ class Mo extends qt {
|
|
|
1767
1803
|
* @param {*} params.argument - Command arguments
|
|
1768
1804
|
* @returns {void}
|
|
1769
1805
|
*/
|
|
1770
|
-
toggleLink: ({ item:
|
|
1771
|
-
let
|
|
1772
|
-
if (
|
|
1773
|
-
this.activeEditor.commands[
|
|
1774
|
-
const { view: i } = this.activeEditor, c = i.state.selection.$to.pos, a = new
|
|
1806
|
+
toggleLink: ({ item: t, argument: n }) => {
|
|
1807
|
+
let o = t.command;
|
|
1808
|
+
if (o in this.activeEditor.commands) {
|
|
1809
|
+
this.activeEditor.commands[o](n);
|
|
1810
|
+
const { view: i } = this.activeEditor, c = i.state.selection.$to.pos, a = new Je(i.state.doc.resolve(c)), l = i.state.tr.setSelection(a), d = i.state.apply(l);
|
|
1775
1811
|
i.updateState(d), setTimeout(() => {
|
|
1776
1812
|
i.focus();
|
|
1777
1813
|
}, 100);
|
|
@@ -1785,8 +1821,8 @@ class Mo extends qt {
|
|
|
1785
1821
|
* @param {Object} params.argument - Table configuration
|
|
1786
1822
|
* @returns {void}
|
|
1787
1823
|
*/
|
|
1788
|
-
insertTable: ({ item:
|
|
1789
|
-
|
|
1824
|
+
insertTable: ({ item: t, argument: n }) => {
|
|
1825
|
+
N(this, I, pe).call(this, { item: t, argument: n });
|
|
1790
1826
|
},
|
|
1791
1827
|
/**
|
|
1792
1828
|
* Executes a table-related command
|
|
@@ -1796,70 +1832,80 @@ class Mo extends qt {
|
|
|
1796
1832
|
* @param {string} params.argument.command - The specific table command to execute
|
|
1797
1833
|
* @returns {void}
|
|
1798
1834
|
*/
|
|
1799
|
-
executeTableCommand: ({ item:
|
|
1835
|
+
executeTableCommand: ({ item: t, argument: n }) => {
|
|
1800
1836
|
if (!n) return;
|
|
1801
|
-
let
|
|
1802
|
-
|
|
1837
|
+
let o = n.command;
|
|
1838
|
+
o in this.activeEditor.commands && this.activeEditor.commands[o](n), this.updateToolbarState();
|
|
1803
1839
|
}
|
|
1804
1840
|
});
|
|
1805
1841
|
/**
|
|
1806
1842
|
* Handler for toolbar resize events
|
|
1807
1843
|
* @returns {void}
|
|
1808
1844
|
*/
|
|
1809
|
-
|
|
1810
|
-
|
|
1845
|
+
ze(this, "onToolbarResize", () => {
|
|
1846
|
+
N(this, I, Ve).call(this, {
|
|
1847
|
+
superToolbar: this,
|
|
1848
|
+
icons: this.config.icons,
|
|
1849
|
+
fonts: this.config.fonts,
|
|
1850
|
+
hideButtons: this.config.hideButtons,
|
|
1851
|
+
isDev: this.isDev
|
|
1852
|
+
}), this.role === "viewer" && N(this, I, Pe).call(this);
|
|
1811
1853
|
});
|
|
1812
|
-
this.config = { ...this.config, ...
|
|
1813
|
-
...
|
|
1814
|
-
...
|
|
1815
|
-
}, !this.config.selector && this.config.element && (this.config.selector = this.config.element),
|
|
1854
|
+
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
|
+
...Z,
|
|
1856
|
+
...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, lt).call(this), N(this, I, Ve).call(this, {
|
|
1858
|
+
superToolbar: this,
|
|
1859
|
+
icons: this.config.icons,
|
|
1860
|
+
fonts: this.config.fonts,
|
|
1861
|
+
hideButtons: this.config.hideButtons,
|
|
1862
|
+
isDev: t.isDev
|
|
1863
|
+
}), this.app = Wt(Ut), this.app.directive("click-outside", zt), this.app.config.globalProperties.$toolbar = this, this.toolbarContainer && (this.toolbar = this.app.mount(this.toolbarContainer)), this.activeEditor = t.editor || null, this.updateToolbarState());
|
|
1864
|
+
}
|
|
1865
|
+
getElementBySelector(t) {
|
|
1816
1866
|
let n = null;
|
|
1817
|
-
|
|
1818
|
-
console.warn(`[super-toolbar 🎨] Element not found: ${this.config.selector}`);
|
|
1819
|
-
return;
|
|
1820
|
-
}
|
|
1821
|
-
this.app = Nt(Pt), this.app.directive("click-outside", Ht), this.app.config.globalProperties.$toolbar = this, n && (this.toolbar = this.app.mount(n)), this.activeEditor = o.editor || null, this.updateToolbarState();
|
|
1867
|
+
return t && (t.startsWith("#") || t.startsWith(".") ? n = document.querySelector(t) : n = document.getElementById(t), !n) ? (console.warn(`[super-toolbar 🎨] Element not found: ${t}`), null) : n;
|
|
1822
1868
|
}
|
|
1823
1869
|
/**
|
|
1824
1870
|
* Log debug information to the console
|
|
1825
1871
|
* @param {...*} args - Arguments to log
|
|
1826
1872
|
* @returns {void}
|
|
1827
1873
|
*/
|
|
1828
|
-
log(...
|
|
1829
|
-
console.debug("[🎨 super-toolbar]", ...
|
|
1874
|
+
log(...t) {
|
|
1875
|
+
console.debug("[🎨 super-toolbar]", ...t);
|
|
1830
1876
|
}
|
|
1831
1877
|
/**
|
|
1832
1878
|
* Set the zoom level
|
|
1833
1879
|
* @param {number} percent_int - The zoom percentage as an integer
|
|
1834
1880
|
* @returns {void}
|
|
1835
1881
|
*/
|
|
1836
|
-
setZoom(
|
|
1837
|
-
const
|
|
1838
|
-
|
|
1882
|
+
setZoom(t) {
|
|
1883
|
+
const o = [...this.toolbarItems, ...this.overflowItems].find((i) => i.name.value === "zoom");
|
|
1884
|
+
Te(this, fe).setZoom({ item: o, argument: t });
|
|
1839
1885
|
}
|
|
1840
1886
|
/**
|
|
1841
1887
|
* The toolbar expects an active Super Editor instance.
|
|
1842
1888
|
* @param {Object} editor - The editor instance to attach to the toolbar
|
|
1843
1889
|
* @returns {void}
|
|
1844
1890
|
*/
|
|
1845
|
-
setActiveEditor(
|
|
1846
|
-
this.activeEditor =
|
|
1891
|
+
setActiveEditor(t) {
|
|
1892
|
+
this.activeEditor = t, this.activeEditor.on("transaction", this.onEditorTransaction.bind(this));
|
|
1847
1893
|
}
|
|
1848
1894
|
/**
|
|
1849
1895
|
* Get toolbar items by group name
|
|
1850
1896
|
* @param {string} groupName - The name of the group
|
|
1851
1897
|
* @returns {ToolbarItem[]} An array of toolbar items in the specified group
|
|
1852
1898
|
*/
|
|
1853
|
-
getToolbarItemByGroup(
|
|
1854
|
-
return this.toolbarItems.filter((n) => (n.group?.value || "center") ===
|
|
1899
|
+
getToolbarItemByGroup(t) {
|
|
1900
|
+
return this.toolbarItems.filter((n) => (n.group?.value || "center") === t);
|
|
1855
1901
|
}
|
|
1856
1902
|
/**
|
|
1857
1903
|
* Get a toolbar item by name
|
|
1858
1904
|
* @param {string} name - The name of the toolbar item
|
|
1859
1905
|
* @returns {ToolbarItem|undefined} The toolbar item with the specified name or undefined if not found
|
|
1860
1906
|
*/
|
|
1861
|
-
getToolbarItemByName(
|
|
1862
|
-
return this.toolbarItems.find((n) => n.name.value ===
|
|
1907
|
+
getToolbarItemByName(t) {
|
|
1908
|
+
return this.toolbarItems.find((n) => n.name.value === t);
|
|
1863
1909
|
}
|
|
1864
1910
|
/**
|
|
1865
1911
|
* Update the toolbar state based on the current editor state
|
|
@@ -1867,33 +1913,33 @@ class Mo extends qt {
|
|
|
1867
1913
|
* @returns {void}
|
|
1868
1914
|
*/
|
|
1869
1915
|
updateToolbarState() {
|
|
1870
|
-
if (
|
|
1871
|
-
|
|
1916
|
+
if (N(this, I, dt).call(this), N(this, I, rt).call(this), N(this, I, ct).call(this), !this.activeEditor || this.documentMode === "viewing") {
|
|
1917
|
+
N(this, I, Pe).call(this);
|
|
1872
1918
|
return;
|
|
1873
1919
|
}
|
|
1874
|
-
const
|
|
1875
|
-
this.toolbarItems.forEach((
|
|
1876
|
-
if (
|
|
1877
|
-
return this.activeEditor && !
|
|
1878
|
-
const i =
|
|
1879
|
-
i ?
|
|
1880
|
-
const c =
|
|
1920
|
+
const t = xt(this.activeEditor), n = St(this.activeEditor.state);
|
|
1921
|
+
this.toolbarItems.forEach((o) => {
|
|
1922
|
+
if (o.resetDisabled(), o.name.value === "linkedStyles")
|
|
1923
|
+
return this.activeEditor && !Ye(this.activeEditor).length ? o.deactivate() : o.activate();
|
|
1924
|
+
const i = t.find((l) => l.name === o.name.value);
|
|
1925
|
+
i ? o.activate(i.attrs) : o.deactivate();
|
|
1926
|
+
const c = t.find((l) => l.name === "styleId");
|
|
1881
1927
|
if (c?.attrs.styleId) {
|
|
1882
1928
|
const l = {
|
|
1883
1929
|
fontSize: "font-size",
|
|
1884
1930
|
fontFamily: "font-family",
|
|
1885
1931
|
bold: "bold",
|
|
1886
1932
|
textAlign: "textAlign"
|
|
1887
|
-
}, d = this.activeEditor.converter?.linkedStyles.find((
|
|
1888
|
-
if (l[
|
|
1889
|
-
const
|
|
1890
|
-
[
|
|
1933
|
+
}, d = this.activeEditor.converter?.linkedStyles.find((u) => u.id === c.attrs.styleId);
|
|
1934
|
+
if (l[o.name.value] in d?.definition.styles) {
|
|
1935
|
+
const u = {
|
|
1936
|
+
[o.name.value]: d?.definition.styles[l[o.name.value]]
|
|
1891
1937
|
};
|
|
1892
|
-
|
|
1938
|
+
o.activate(u);
|
|
1893
1939
|
}
|
|
1894
1940
|
}
|
|
1895
|
-
const a =
|
|
1896
|
-
|
|
1941
|
+
const a = t.find((l) => l.name === "spacing");
|
|
1942
|
+
o.name.value === "lineHeight" && (i?.attrs?.lineHeight || a) && (o.selectedValue.value = i?.attrs?.lineHeight || a.attrs?.spacing?.line || ""), o.name.value === "tableActions" && (o.disabled.value = !n);
|
|
1897
1943
|
});
|
|
1898
1944
|
}
|
|
1899
1945
|
/**
|
|
@@ -1903,7 +1949,7 @@ class Mo extends qt {
|
|
|
1903
1949
|
* @param {Object} params.transaction - The transaction object
|
|
1904
1950
|
* @returns {void}
|
|
1905
1951
|
*/
|
|
1906
|
-
onEditorTransaction({ editor:
|
|
1952
|
+
onEditorTransaction({ editor: t, transaction: n }) {
|
|
1907
1953
|
!n.docChanged && !n.selectionSet || this.updateToolbarState();
|
|
1908
1954
|
}
|
|
1909
1955
|
/**
|
|
@@ -1913,94 +1959,109 @@ class Mo extends qt {
|
|
|
1913
1959
|
* @param {*} [params.argument] - The argument passed to the command
|
|
1914
1960
|
* @returns {*} The result of the executed command, undefined if no result is returned
|
|
1915
1961
|
*/
|
|
1916
|
-
emitCommand({ item:
|
|
1962
|
+
emitCommand({ item: t, argument: n, option: o }) {
|
|
1917
1963
|
this.activeEditor?.focus();
|
|
1918
|
-
const { command: i } =
|
|
1964
|
+
const { command: i } = t;
|
|
1919
1965
|
if (i) {
|
|
1920
1966
|
if (this.log("(emmitCommand) Command:", i, `
|
|
1921
|
-
item:`,
|
|
1967
|
+
item:`, t, `
|
|
1922
1968
|
argument:`, n, `
|
|
1923
|
-
option:`,
|
|
1924
|
-
return
|
|
1969
|
+
option:`, o), i in Te(this, fe))
|
|
1970
|
+
return Te(this, fe)[i]({ item: t, argument: n });
|
|
1925
1971
|
if (i in this.activeEditor?.commands)
|
|
1926
1972
|
this.activeEditor.commands[i](n);
|
|
1927
1973
|
else if (typeof i == "function")
|
|
1928
|
-
i({ item:
|
|
1974
|
+
i({ item: t, argument: n, option: o });
|
|
1929
1975
|
else
|
|
1930
1976
|
throw new Error(`[super-toolbar 🎨] Command not found: ${i}`);
|
|
1931
1977
|
this.updateToolbarState();
|
|
1932
1978
|
}
|
|
1933
1979
|
}
|
|
1934
1980
|
}
|
|
1935
|
-
|
|
1981
|
+
I = new WeakSet(), /**
|
|
1936
1982
|
* Initiate toolbar groups
|
|
1937
1983
|
* @private
|
|
1938
1984
|
* @returns {void}
|
|
1939
1985
|
*/
|
|
1940
1986
|
lt = function() {
|
|
1941
1987
|
this.config.groups && !Array.isArray(this.config.groups) && Object.keys(this.config.groups).length && (this.config.toolbarGroups = Object.keys(this.config.groups));
|
|
1942
|
-
},
|
|
1988
|
+
}, fe = new WeakMap(), /**
|
|
1943
1989
|
* Create toolbar items based on configuration
|
|
1944
1990
|
* @private
|
|
1945
|
-
* @param {SuperToolbar} superToolbar - The toolbar instance
|
|
1946
|
-
* @param {Object} icons - Icons to use for toolbar items
|
|
1947
|
-
* @param {
|
|
1991
|
+
* @param {SuperToolbar} options.superToolbar - The toolbar instance
|
|
1992
|
+
* @param {Object} options.icons - Icons to use for toolbar items
|
|
1993
|
+
* @param {Array} options.fonts - Fonts for the toolbar item
|
|
1994
|
+
* @param {boolean} options.isDev - Whether in development mode
|
|
1948
1995
|
* @returns {void}
|
|
1949
1996
|
*/
|
|
1950
|
-
|
|
1951
|
-
|
|
1952
|
-
|
|
1953
|
-
|
|
1954
|
-
|
|
1955
|
-
|
|
1997
|
+
Ve = function({
|
|
1998
|
+
superToolbar: t,
|
|
1999
|
+
icons: n,
|
|
2000
|
+
fonts: o,
|
|
2001
|
+
hideButtons: i,
|
|
2002
|
+
isDev: c = !1
|
|
2003
|
+
} = {}) {
|
|
2004
|
+
const a = document.documentElement.clientWidth, l = this.toolbarContainer.offsetWidth, d = this.config.responsiveToContainer ? l : a, { defaultItems: u, overflowItems: r } = co({
|
|
2005
|
+
superToolbar: t,
|
|
2006
|
+
toolbarIcons: n,
|
|
2007
|
+
toolbarFonts: o,
|
|
2008
|
+
hideButtons: i,
|
|
2009
|
+
availableWidth: d,
|
|
2010
|
+
role: this.role,
|
|
2011
|
+
isDev: c
|
|
2012
|
+
}), w = this.config.customButtons || [];
|
|
2013
|
+
w.length && u.push(...w.map((y) => x({ ...y })));
|
|
2014
|
+
let v = [
|
|
2015
|
+
...u.map((y) => y.name.value),
|
|
2016
|
+
...r.map((y) => y.name.value)
|
|
1956
2017
|
];
|
|
1957
|
-
this.config.groups && (
|
|
1958
|
-
const
|
|
1959
|
-
this.toolbarItems =
|
|
2018
|
+
this.config.groups && (v = Object.values(this.config.groups).flatMap((y) => y));
|
|
2019
|
+
const b = u.filter((y) => v.includes(y.name.value)).filter((y) => !this.config.excludeItems.includes(y.name.value));
|
|
2020
|
+
this.toolbarItems = b, this.overflowItems = r.filter((y) => v.includes(y.name.value));
|
|
1960
2021
|
}, /**
|
|
1961
2022
|
* Initialize default fonts from the editor
|
|
1962
2023
|
* @private
|
|
1963
2024
|
* @returns {void}
|
|
1964
2025
|
*/
|
|
1965
|
-
|
|
2026
|
+
rt = function() {
|
|
1966
2027
|
if (!this.activeEditor || !this.activeEditor.converter) return;
|
|
1967
|
-
const { typeface:
|
|
1968
|
-
|
|
2028
|
+
const { typeface: t = "Arial", fontSizePt: n = 12 } = this.activeEditor.converter.getDocumentDefaultStyles() ?? {}, o = this.toolbarItems.find((c) => c.name.value === "fontSize");
|
|
2029
|
+
o && (o.defaultLabel.value = n);
|
|
1969
2030
|
const i = this.toolbarItems.find((c) => c.name.value === "fontFamily");
|
|
1970
|
-
i && (i.defaultLabel.value =
|
|
2031
|
+
i && (i.defaultLabel.value = t);
|
|
1971
2032
|
}, /**
|
|
1972
2033
|
* Update highlight color options based on document colors
|
|
1973
2034
|
* @private
|
|
1974
2035
|
* @returns {void}
|
|
1975
2036
|
*/
|
|
1976
|
-
|
|
2037
|
+
ct = function() {
|
|
1977
2038
|
if (!this.activeEditor || !this.activeEditor.converter || !this.activeEditor.converter.docHiglightColors.size) return;
|
|
1978
|
-
const
|
|
1979
|
-
const
|
|
1980
|
-
return a[
|
|
2039
|
+
const t = this.toolbarItems.find((a) => a.name.value === "highlight"), n = Pn(), o = 7, i = Array.from(this.activeEditor.converter.docHiglightColors).reduce((a, l, d) => {
|
|
2040
|
+
const u = Math.floor(d / o);
|
|
2041
|
+
return a[u] || (a[u] = []), n.includes(l) || a[u].push(f(l)), a;
|
|
1981
2042
|
}, []), c = {
|
|
1982
2043
|
key: "color",
|
|
1983
2044
|
type: "render",
|
|
1984
|
-
render: () =>
|
|
2045
|
+
render: () => We(this, t, i, !0)
|
|
1985
2046
|
};
|
|
1986
|
-
|
|
2047
|
+
t.nestedOptions.value = [c];
|
|
1987
2048
|
}, /**
|
|
1988
2049
|
* Deactivate all toolbar items
|
|
1989
2050
|
* @private
|
|
1990
2051
|
* @returns {void}
|
|
1991
2052
|
*/
|
|
1992
2053
|
Pe = function() {
|
|
1993
|
-
this.activeEditor = null, this.toolbarItems.forEach((
|
|
1994
|
-
const { allowWithoutEditor: n } =
|
|
1995
|
-
n.value ||
|
|
2054
|
+
this.activeEditor = null, this.toolbarItems.forEach((t) => {
|
|
2055
|
+
const { allowWithoutEditor: n } = t;
|
|
2056
|
+
n.value || t.setDisabled(!0);
|
|
1996
2057
|
});
|
|
1997
2058
|
}, /**
|
|
1998
2059
|
* Update undo/redo history state in the toolbar
|
|
1999
2060
|
* @private
|
|
2000
2061
|
* @returns {void}
|
|
2001
2062
|
*/
|
|
2002
|
-
|
|
2003
|
-
this.activeEditor && (this.undoDepth =
|
|
2063
|
+
dt = function() {
|
|
2064
|
+
this.activeEditor && (this.undoDepth = Et(this.activeEditor.state), this.redoDepth = At(this.activeEditor.state));
|
|
2004
2065
|
}, /**
|
|
2005
2066
|
* Run a command that requires an argument
|
|
2006
2067
|
* @private
|
|
@@ -2011,48 +2072,48 @@ ct = function() {
|
|
|
2011
2072
|
* @param {Function} [callback] - Optional callback to run after the command
|
|
2012
2073
|
* @returns {void}
|
|
2013
2074
|
*/
|
|
2014
|
-
|
|
2075
|
+
pe = function({ item: t, argument: n, noArgumentCallback: o = !1 }, i) {
|
|
2015
2076
|
if (!n || !this.activeEditor) return;
|
|
2016
|
-
let c =
|
|
2017
|
-
const a =
|
|
2077
|
+
let c = t.command;
|
|
2078
|
+
const a = t.noArgumentCommand;
|
|
2018
2079
|
if (n === "none" && a in this.activeEditor?.commands) {
|
|
2019
|
-
this.activeEditor.commands[a](), typeof i == "function" &&
|
|
2080
|
+
this.activeEditor.commands[a](), typeof i == "function" && o && i(n), this.updateToolbarState();
|
|
2020
2081
|
return;
|
|
2021
2082
|
}
|
|
2022
2083
|
c in this.activeEditor?.commands && (this.activeEditor.commands[c](n), typeof i == "function" && i(n), this.updateToolbarState());
|
|
2023
2084
|
};
|
|
2024
|
-
function
|
|
2025
|
-
if (!
|
|
2026
|
-
const
|
|
2085
|
+
function go(e, s) {
|
|
2086
|
+
if (!e.value || !s?.value?.options?.scale) return;
|
|
2087
|
+
const t = s.value.options.scale, n = e.value.getBoundingClientRect(), o = e.value.querySelectorAll(".pagination-break-wrapper");
|
|
2027
2088
|
let i;
|
|
2028
|
-
|
|
2029
|
-
const l = (c.getBoundingClientRect().left - n.left) /
|
|
2089
|
+
o.forEach((c) => {
|
|
2090
|
+
const l = (c.getBoundingClientRect().left - n.left) / t * -1 + 1;
|
|
2030
2091
|
if (i || (i = l), l !== i) {
|
|
2031
2092
|
const d = l - i;
|
|
2032
2093
|
c.style.transform = `translateX(${d}px)`;
|
|
2033
2094
|
}
|
|
2034
2095
|
});
|
|
2035
2096
|
}
|
|
2036
|
-
const
|
|
2037
|
-
const
|
|
2097
|
+
const bo = (e, s) => {
|
|
2098
|
+
const t = e.clientY, n = e.clientX, { view: o } = s, i = o.dom.getBoundingClientRect();
|
|
2038
2099
|
let c = {
|
|
2039
2100
|
left: 0,
|
|
2040
|
-
top:
|
|
2101
|
+
top: t
|
|
2041
2102
|
}, a = !1;
|
|
2042
2103
|
n > i.right ? (c.left = i.left + i.width - 1, a = !0) : n < i.left && (c.left = i.left);
|
|
2043
|
-
const l =
|
|
2104
|
+
const l = o.posAtCoords(c)?.pos;
|
|
2044
2105
|
if (l) {
|
|
2045
2106
|
let d = l;
|
|
2046
2107
|
if (a) {
|
|
2047
|
-
const
|
|
2048
|
-
d = v?.isText &&
|
|
2108
|
+
const w = o.state.doc.resolve(l).textOffset, v = o.state.doc.nodeAt(l), y = v?.text?.charAt(w);
|
|
2109
|
+
d = v?.isText && y !== " " ? l - 1 : l;
|
|
2049
2110
|
}
|
|
2050
|
-
const
|
|
2051
|
-
|
|
2111
|
+
const u = o.state.tr.setSelection(
|
|
2112
|
+
Je.create(o.state.doc, d)
|
|
2052
2113
|
);
|
|
2053
|
-
|
|
2114
|
+
o.dispatch(u), o.focus();
|
|
2054
2115
|
}
|
|
2055
|
-
},
|
|
2116
|
+
}, yo = { class: "numbering" }, Fe = 200, wo = "flex-end", Co = {
|
|
2056
2117
|
__name: "Ruler",
|
|
2057
2118
|
props: {
|
|
2058
2119
|
orientation: {
|
|
@@ -2069,116 +2130,116 @@ const fo = (t, r) => {
|
|
|
2069
2130
|
}
|
|
2070
2131
|
},
|
|
2071
2132
|
emits: ["margin-change"],
|
|
2072
|
-
setup(
|
|
2073
|
-
const
|
|
2133
|
+
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 = Xe({ side: "left", x: 0 }), v = Xe({ side: "right", x: 0 }), b = h(!1), y = h(0);
|
|
2074
2135
|
let g = 0;
|
|
2075
|
-
const
|
|
2136
|
+
const L = () => {
|
|
2076
2137
|
if (n.editor.options.mode !== "docx") return;
|
|
2077
|
-
const
|
|
2078
|
-
l.value = H, d.value =
|
|
2079
|
-
for (let
|
|
2080
|
-
const K = `${5.5}px`, ce = H.width -
|
|
2081
|
-
if (
|
|
2082
|
-
|
|
2138
|
+
const T = [], { pageMargins: B, pageSize: H } = n.editor.getPageStyles();
|
|
2139
|
+
l.value = H, d.value = B, v.x = H.width * 96 - B.right * 96, w.x = B.left * 96;
|
|
2140
|
+
for (let z = 0; z < H.width; z++) {
|
|
2141
|
+
const K = `${5.5}px`, ce = H.width - z;
|
|
2142
|
+
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
|
+
T.push(...D(3, "eighth", "10%", K));
|
|
2083
2144
|
}
|
|
2084
|
-
return
|
|
2085
|
-
},
|
|
2086
|
-
const
|
|
2087
|
-
className: `${
|
|
2145
|
+
return T;
|
|
2146
|
+
}, D = (T, B, H, z, G) => Array.from({ length: T }, (K, ce) => {
|
|
2147
|
+
const se = {
|
|
2148
|
+
className: `${B}-unit ruler-section`,
|
|
2088
2149
|
height: H,
|
|
2089
|
-
margin:
|
|
2150
|
+
margin: z
|
|
2090
2151
|
};
|
|
2091
|
-
return G !== void 0 && (
|
|
2092
|
-
}), p = j(() => (
|
|
2152
|
+
return G !== void 0 && (se.numbering = G), se;
|
|
2153
|
+
}), p = j(() => (T) => ({
|
|
2093
2154
|
width: "1px",
|
|
2094
2155
|
minWidth: "1px",
|
|
2095
2156
|
maxWidth: "1px",
|
|
2096
|
-
height:
|
|
2097
|
-
backgroundColor:
|
|
2098
|
-
marginLeft:
|
|
2099
|
-
marginRight:
|
|
2100
|
-
})),
|
|
2101
|
-
left: `${(
|
|
2102
|
-
})),
|
|
2103
|
-
if (!
|
|
2104
|
-
const H =
|
|
2157
|
+
height: T.height,
|
|
2158
|
+
backgroundColor: T.color || "#666",
|
|
2159
|
+
marginLeft: T.numbering === 0 ? null : T.margin,
|
|
2160
|
+
marginRight: T.margin
|
|
2161
|
+
})), S = j(() => (T) => ({
|
|
2162
|
+
left: `${(T === "left" ? w : v).x}px`
|
|
2163
|
+
})), F = j(() => {
|
|
2164
|
+
if (!o.value) return;
|
|
2165
|
+
const H = o.value.parentElement.querySelector(".super-editor").getBoundingClientRect();
|
|
2105
2166
|
return {
|
|
2106
|
-
left: `${
|
|
2167
|
+
left: `${r.value.x}px`,
|
|
2107
2168
|
minHeight: `${H.height}px`
|
|
2108
2169
|
};
|
|
2109
|
-
}),
|
|
2110
|
-
|
|
2111
|
-
const
|
|
2112
|
-
|
|
2113
|
-
},
|
|
2114
|
-
if (!
|
|
2115
|
-
const
|
|
2116
|
-
|
|
2117
|
-
},
|
|
2118
|
-
if (
|
|
2119
|
-
const
|
|
2120
|
-
|
|
2121
|
-
side:
|
|
2122
|
-
value:
|
|
2170
|
+
}), O = (T) => {
|
|
2171
|
+
u.value = !0, ue();
|
|
2172
|
+
const B = T.currentTarget.id;
|
|
2173
|
+
r.value = B === "left-margin-handle" ? w : v, y.value = r.value.x, g = T.clientX - r.value.x, b.value = !0;
|
|
2174
|
+
}, W = (T) => {
|
|
2175
|
+
if (!u.value) return;
|
|
2176
|
+
const B = T.clientX - g;
|
|
2177
|
+
r.value.x = B, r.value.side === "left" ? B <= 0 ? r.value.x = 0 : B >= v.x - Fe && (r.value.x = v.x - Fe) : B >= l.value.width * 96 ? r.value.x = l.value.width * 96 : B <= w.x + Fe && (r.value.x = w.x + Fe);
|
|
2178
|
+
}, ne = () => {
|
|
2179
|
+
if (u.value = !1, b.value = !1, ve(), r.value && r.value.x !== y.value) {
|
|
2180
|
+
const T = ge();
|
|
2181
|
+
t("margin-change", {
|
|
2182
|
+
side: r.value.side,
|
|
2183
|
+
value: T
|
|
2123
2184
|
});
|
|
2124
2185
|
}
|
|
2125
|
-
},
|
|
2186
|
+
}, ue = () => {
|
|
2126
2187
|
c.value = a.value;
|
|
2127
|
-
},
|
|
2188
|
+
}, ve = () => {
|
|
2128
2189
|
c.value = "#CCC";
|
|
2129
|
-
},
|
|
2130
|
-
"--alignment":
|
|
2190
|
+
}, ge = () => r.value.side === "left" ? r.value.x / 96 : (l.value.width * 96 - r.value.x) / 96, Y = j(() => ({
|
|
2191
|
+
"--alignment": wo,
|
|
2131
2192
|
"--ruler-handle-color": c.value,
|
|
2132
2193
|
"--ruler-handle-active-color": a.value
|
|
2133
2194
|
}));
|
|
2134
|
-
return
|
|
2135
|
-
i.value =
|
|
2136
|
-
}),
|
|
2137
|
-
window.removeEventListener("mousemove",
|
|
2138
|
-
}), (
|
|
2195
|
+
return Ce(() => {
|
|
2196
|
+
i.value = L(), window.addEventListener("mousemove", W), window.addEventListener("mouseup", ne);
|
|
2197
|
+
}), Vt(() => {
|
|
2198
|
+
window.removeEventListener("mousemove", W), window.removeEventListener("mouseup", ne);
|
|
2199
|
+
}), (T, B) => (C(), k("div", {
|
|
2139
2200
|
class: "ruler",
|
|
2140
2201
|
ref_key: "ruler",
|
|
2141
|
-
ref:
|
|
2142
|
-
style:
|
|
2202
|
+
ref: o,
|
|
2203
|
+
style: Q(Y.value)
|
|
2143
2204
|
}, [
|
|
2144
|
-
|
|
2205
|
+
_("div", {
|
|
2145
2206
|
class: "margin-handle handle-left",
|
|
2146
2207
|
id: "left-margin-handle",
|
|
2147
|
-
onMousedown:
|
|
2148
|
-
style:
|
|
2208
|
+
onMousedown: O,
|
|
2209
|
+
style: Q(S.value("left"))
|
|
2149
2210
|
}, null, 36),
|
|
2150
|
-
|
|
2211
|
+
_("div", {
|
|
2151
2212
|
class: "margin-handle handle-right",
|
|
2152
2213
|
id: "right-margin-handle",
|
|
2153
|
-
onMousedown:
|
|
2154
|
-
style:
|
|
2214
|
+
onMousedown: O,
|
|
2215
|
+
style: Q(S.value("right"))
|
|
2155
2216
|
}, null, 36),
|
|
2156
|
-
|
|
2217
|
+
b.value ? (C(), k("div", {
|
|
2157
2218
|
key: 0,
|
|
2158
2219
|
class: "vertical-indicator",
|
|
2159
|
-
style:
|
|
2160
|
-
}, null, 4)) :
|
|
2161
|
-
(
|
|
2220
|
+
style: Q(F.value)
|
|
2221
|
+
}, null, 4)) : ee("", !0),
|
|
2222
|
+
(C(!0), k(U, null, te(i.value, (H) => (C(), k("div", {
|
|
2162
2223
|
class: oe(H.className),
|
|
2163
|
-
style:
|
|
2224
|
+
style: Q(p.value(H))
|
|
2164
2225
|
}, [
|
|
2165
|
-
|
|
2166
|
-
(
|
|
2167
|
-
class: oe(
|
|
2168
|
-
style:
|
|
2226
|
+
_("div", yo, ie(H.numbering), 1),
|
|
2227
|
+
(C(!0), k(U, null, te(H.elements, (z) => (C(), k("div", {
|
|
2228
|
+
class: oe(z.className),
|
|
2229
|
+
style: Q(p.value(z))
|
|
2169
2230
|
}, [
|
|
2170
|
-
(
|
|
2231
|
+
(C(!0), k(U, null, te(z.elements, (G) => (C(), k("div", {
|
|
2171
2232
|
class: oe(G.className),
|
|
2172
|
-
style:
|
|
2233
|
+
style: Q(p.value(G))
|
|
2173
2234
|
}, null, 6))), 256))
|
|
2174
2235
|
], 6))), 256))
|
|
2175
2236
|
], 6))), 256))
|
|
2176
2237
|
], 4));
|
|
2177
2238
|
}
|
|
2178
|
-
},
|
|
2239
|
+
}, ko = /* @__PURE__ */ q(Co, [["__scopeId", "data-v-ad77036c"]]), _o = { class: "super-editor-container" }, xo = {
|
|
2179
2240
|
key: 1,
|
|
2180
2241
|
class: "placeholder-editor"
|
|
2181
|
-
},
|
|
2242
|
+
}, So = { class: "placeholder-title" }, Eo = {
|
|
2182
2243
|
__name: "SuperEditor",
|
|
2183
2244
|
props: {
|
|
2184
2245
|
documentId: {
|
|
@@ -2207,40 +2268,40 @@ const fo = (t, r) => {
|
|
|
2207
2268
|
"comments-loaded",
|
|
2208
2269
|
"selection-update"
|
|
2209
2270
|
],
|
|
2210
|
-
setup(
|
|
2211
|
-
const
|
|
2271
|
+
setup(e, { emit: s }) {
|
|
2272
|
+
const t = s, n = e, o = h(!1), i = ot(null), c = h(null), a = h(null);
|
|
2212
2273
|
let l;
|
|
2213
2274
|
const d = () => {
|
|
2214
2275
|
clearTimeout(l);
|
|
2215
|
-
},
|
|
2216
|
-
const
|
|
2217
|
-
const
|
|
2218
|
-
|
|
2276
|
+
}, u = (p, S = 10, F = 500) => {
|
|
2277
|
+
const O = p.getMap("meta"), W = () => {
|
|
2278
|
+
const ne = O.get("docx");
|
|
2279
|
+
ne ? (d(), b({ content: ne })) : 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.");
|
|
2219
2280
|
};
|
|
2220
|
-
|
|
2221
|
-
},
|
|
2281
|
+
W();
|
|
2282
|
+
}, r = async () => {
|
|
2222
2283
|
try {
|
|
2223
|
-
const [p,
|
|
2224
|
-
return { content: p, media:
|
|
2284
|
+
const [p, S, F, O] = await Ne.loadXmlData(n.fileSource);
|
|
2285
|
+
return { content: p, media: S, mediaFiles: F, fonts: O };
|
|
2225
2286
|
} catch (p) {
|
|
2226
2287
|
console.debug("Error loading new file data:", p);
|
|
2227
2288
|
}
|
|
2228
|
-
},
|
|
2289
|
+
}, w = async () => {
|
|
2229
2290
|
if (n.fileSource) {
|
|
2230
|
-
const p = await
|
|
2231
|
-
return
|
|
2291
|
+
const p = await r();
|
|
2292
|
+
return b(p);
|
|
2232
2293
|
} else if (n.options.ydoc && n.options.collaborationProvider) {
|
|
2233
2294
|
delete n.options.content;
|
|
2234
|
-
const p = n.options.ydoc,
|
|
2235
|
-
|
|
2295
|
+
const p = n.options.ydoc, S = n.options.collaborationProvider, F = () => {
|
|
2296
|
+
u(p), S.off("synced", F);
|
|
2236
2297
|
};
|
|
2237
|
-
|
|
2298
|
+
S.on("synced", F);
|
|
2238
2299
|
}
|
|
2239
2300
|
}, v = () => {
|
|
2240
|
-
const p =
|
|
2241
|
-
return n.options.pagination ? p : p.filter((
|
|
2242
|
-
},
|
|
2243
|
-
i.value = new
|
|
2301
|
+
const p = Tt();
|
|
2302
|
+
return n.options.pagination ? p : p.filter((S) => S.name !== "pagination");
|
|
2303
|
+
}, b = async ({ content: p, media: S = {}, mediaFiles: F = {}, fonts: O = {} } = {}) => {
|
|
2304
|
+
i.value = new Ne({
|
|
2244
2305
|
mode: "docx",
|
|
2245
2306
|
element: a.value,
|
|
2246
2307
|
fileSource: n.fileSource,
|
|
@@ -2248,115 +2309,115 @@ const fo = (t, r) => {
|
|
|
2248
2309
|
externalExtensions: n.options.externalExtensions,
|
|
2249
2310
|
documentId: n.documentId,
|
|
2250
2311
|
content: p,
|
|
2251
|
-
media:
|
|
2252
|
-
mediaFiles:
|
|
2253
|
-
fonts:
|
|
2312
|
+
media: S,
|
|
2313
|
+
mediaFiles: F,
|
|
2314
|
+
fonts: O,
|
|
2254
2315
|
...n.options
|
|
2255
2316
|
}), i.value.on("paginationUpdate", () => {
|
|
2256
|
-
|
|
2317
|
+
go(a, i);
|
|
2257
2318
|
}), i.value.on("collaborationReady", () => {
|
|
2258
2319
|
setTimeout(() => {
|
|
2259
|
-
|
|
2320
|
+
o.value = !0;
|
|
2260
2321
|
}, 150);
|
|
2261
2322
|
});
|
|
2262
|
-
},
|
|
2263
|
-
|
|
2323
|
+
}, y = (p) => {
|
|
2324
|
+
t("editor-keydown", { editor: i.value });
|
|
2264
2325
|
}, g = (p) => {
|
|
2265
|
-
|
|
2266
|
-
let
|
|
2267
|
-
if (!
|
|
2326
|
+
t("editor-click", { editor: i.value });
|
|
2327
|
+
let S = a.value?.querySelector(".ProseMirror");
|
|
2328
|
+
if (!S || !i.value)
|
|
2268
2329
|
return;
|
|
2269
|
-
!
|
|
2330
|
+
!S.contains(p.target) && i.value.isEditable && i.value.view?.focus();
|
|
2270
2331
|
};
|
|
2271
|
-
|
|
2272
|
-
|
|
2332
|
+
Ce(() => {
|
|
2333
|
+
w(), (n.options?.suppressSkeletonLoader || !n.options?.collaborationProvider) && (o.value = !0);
|
|
2273
2334
|
});
|
|
2274
|
-
const
|
|
2275
|
-
p.target.classList.contains("ProseMirror") ||
|
|
2276
|
-
},
|
|
2335
|
+
const L = (p) => {
|
|
2336
|
+
p.target.classList.contains("ProseMirror") || bo(p, i.value);
|
|
2337
|
+
}, D = ({ side: p, value: S }) => {
|
|
2277
2338
|
if (!i.value) return;
|
|
2278
|
-
const
|
|
2279
|
-
i.value?.updatePageStyle({ pageMargins:
|
|
2339
|
+
const F = i.value.getPageStyles(), { pageMargins: O } = F, W = { ...O, [p]: S };
|
|
2340
|
+
i.value?.updatePageStyle({ pageMargins: W });
|
|
2280
2341
|
};
|
|
2281
|
-
return
|
|
2342
|
+
return it(() => {
|
|
2282
2343
|
d(), i.value?.destroy(), i.value = null;
|
|
2283
|
-
}), (p,
|
|
2284
|
-
|
|
2344
|
+
}), (p, S) => (C(), k("div", _o, [
|
|
2345
|
+
e.options.rulers && i.value ? (C(), Pt(ko, {
|
|
2285
2346
|
key: 0,
|
|
2286
2347
|
class: "ruler",
|
|
2287
2348
|
editor: i.value,
|
|
2288
|
-
onMarginChange:
|
|
2289
|
-
}, null, 8, ["editor"])) :
|
|
2290
|
-
|
|
2349
|
+
onMarginChange: D
|
|
2350
|
+
}, null, 8, ["editor"])) : ee("", !0),
|
|
2351
|
+
_("div", {
|
|
2291
2352
|
class: "super-editor",
|
|
2292
2353
|
ref_key: "editorWrapper",
|
|
2293
2354
|
ref: c,
|
|
2294
|
-
onKeydown:
|
|
2355
|
+
onKeydown: y,
|
|
2295
2356
|
onClick: g,
|
|
2296
|
-
onMousedown:
|
|
2357
|
+
onMousedown: L
|
|
2297
2358
|
}, [
|
|
2298
|
-
|
|
2359
|
+
_("div", {
|
|
2299
2360
|
ref_key: "editorElem",
|
|
2300
2361
|
ref: a,
|
|
2301
2362
|
class: "editor-element super-editor__element"
|
|
2302
2363
|
}, null, 512)
|
|
2303
2364
|
], 544),
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
P(
|
|
2365
|
+
o.value ? ee("", !0) : (C(), k("div", xo, [
|
|
2366
|
+
_("div", So, [
|
|
2367
|
+
P(M(J), {
|
|
2307
2368
|
text: "",
|
|
2308
2369
|
style: { width: "60%" }
|
|
2309
2370
|
})
|
|
2310
2371
|
]),
|
|
2311
|
-
P(
|
|
2372
|
+
P(M(J), {
|
|
2312
2373
|
text: "",
|
|
2313
2374
|
repeat: 6
|
|
2314
2375
|
}),
|
|
2315
|
-
P(
|
|
2376
|
+
P(M(J), {
|
|
2316
2377
|
text: "",
|
|
2317
2378
|
style: { width: "60%" }
|
|
2318
2379
|
}),
|
|
2319
|
-
P(
|
|
2380
|
+
P(M(J), {
|
|
2320
2381
|
text: "",
|
|
2321
2382
|
repeat: 6,
|
|
2322
2383
|
style: { width: "30%", display: "block", margin: "20px" }
|
|
2323
2384
|
}),
|
|
2324
|
-
P(
|
|
2385
|
+
P(M(J), {
|
|
2325
2386
|
text: "",
|
|
2326
2387
|
style: { width: "60%" }
|
|
2327
2388
|
}),
|
|
2328
|
-
P(
|
|
2389
|
+
P(M(J), {
|
|
2329
2390
|
text: "",
|
|
2330
2391
|
repeat: 5
|
|
2331
2392
|
}),
|
|
2332
|
-
P(
|
|
2393
|
+
P(M(J), {
|
|
2333
2394
|
text: "",
|
|
2334
2395
|
style: { width: "30%" }
|
|
2335
2396
|
}),
|
|
2336
|
-
P(
|
|
2397
|
+
P(M(J), {
|
|
2337
2398
|
text: "",
|
|
2338
2399
|
style: { "margin-top": "50px" }
|
|
2339
2400
|
}),
|
|
2340
|
-
P(
|
|
2401
|
+
P(M(J), {
|
|
2341
2402
|
text: "",
|
|
2342
2403
|
repeat: 6
|
|
2343
2404
|
}),
|
|
2344
|
-
P(
|
|
2405
|
+
P(M(J), {
|
|
2345
2406
|
text: "",
|
|
2346
2407
|
style: { width: "70%" }
|
|
2347
2408
|
})
|
|
2348
2409
|
]))
|
|
2349
2410
|
]));
|
|
2350
2411
|
}
|
|
2351
|
-
},
|
|
2412
|
+
}, $o = /* @__PURE__ */ q(Eo, [["__scopeId", "data-v-ff8f86f4"]]), zo = {
|
|
2352
2413
|
__name: "BasicUpload",
|
|
2353
2414
|
emits: ["file-change"],
|
|
2354
|
-
setup(
|
|
2355
|
-
const
|
|
2356
|
-
|
|
2415
|
+
setup(e, { emit: s }) {
|
|
2416
|
+
const t = s, n = (o) => {
|
|
2417
|
+
t("file-change", o.target.files[0]);
|
|
2357
2418
|
};
|
|
2358
|
-
return (
|
|
2359
|
-
|
|
2419
|
+
return (o, i) => (C(), k("div", null, [
|
|
2420
|
+
_("input", {
|
|
2360
2421
|
type: "file",
|
|
2361
2422
|
id: "fileInput",
|
|
2362
2423
|
onChange: n,
|
|
@@ -2364,7 +2425,7 @@ const fo = (t, r) => {
|
|
|
2364
2425
|
}, null, 32)
|
|
2365
2426
|
]));
|
|
2366
2427
|
}
|
|
2367
|
-
},
|
|
2428
|
+
}, Ao = ["innerHTML"], To = {
|
|
2368
2429
|
__name: "SuperInput",
|
|
2369
2430
|
props: {
|
|
2370
2431
|
modelValue: {
|
|
@@ -2387,75 +2448,75 @@ const fo = (t, r) => {
|
|
|
2387
2448
|
}
|
|
2388
2449
|
},
|
|
2389
2450
|
emits: ["update:modelValue", "focus", "blur"],
|
|
2390
|
-
setup(
|
|
2391
|
-
const
|
|
2392
|
-
const
|
|
2393
|
-
|
|
2394
|
-
}, l = ({ editor: v, transaction:
|
|
2395
|
-
c.value = !0,
|
|
2396
|
-
}, d = ({ editor: v, transaction:
|
|
2397
|
-
c.value = !1,
|
|
2398
|
-
},
|
|
2399
|
-
|
|
2451
|
+
setup(e, { emit: s }) {
|
|
2452
|
+
const t = s, n = e, o = ot(), i = h(null), c = h(!1), a = ({ editor: v, transaction: b }) => {
|
|
2453
|
+
const y = v.getHTML();
|
|
2454
|
+
t("update:modelValue", y);
|
|
2455
|
+
}, l = ({ editor: v, transaction: b }) => {
|
|
2456
|
+
c.value = !0, w(), t("focus", { editor: v, transaction: b });
|
|
2457
|
+
}, d = ({ editor: v, transaction: b }) => {
|
|
2458
|
+
c.value = !1, t("blur", { editor: v, transaction: b });
|
|
2459
|
+
}, u = async () => {
|
|
2460
|
+
Ft.options.placeholder = n.placeholder || "Type something...", n.options.onTransaction = a, n.options.onFocus = l, n.options.onBlur = d, o.value = new Ne({
|
|
2400
2461
|
mode: "text",
|
|
2401
2462
|
content: document.getElementById("currentContent"),
|
|
2402
2463
|
element: i.value,
|
|
2403
|
-
extensions:
|
|
2464
|
+
extensions: It(),
|
|
2404
2465
|
users: n.users,
|
|
2405
2466
|
...n.options
|
|
2406
2467
|
});
|
|
2407
|
-
},
|
|
2408
|
-
c.value = !0,
|
|
2409
|
-
},
|
|
2410
|
-
|
|
2468
|
+
}, r = () => {
|
|
2469
|
+
c.value = !0, o.value?.view?.focus();
|
|
2470
|
+
}, w = () => {
|
|
2471
|
+
o.value?.setOptions({ users: n.users });
|
|
2411
2472
|
};
|
|
2412
|
-
return
|
|
2413
|
-
|
|
2414
|
-
}),
|
|
2415
|
-
|
|
2416
|
-
}), (v,
|
|
2473
|
+
return Ce(() => {
|
|
2474
|
+
u();
|
|
2475
|
+
}), it(() => {
|
|
2476
|
+
o.value?.destroy(), o.value = null;
|
|
2477
|
+
}), (v, b) => (C(), k("div", {
|
|
2417
2478
|
class: oe(["super-editor super-input", { "super-input-active": c.value }]),
|
|
2418
|
-
onClick:
|
|
2479
|
+
onClick: he(r, ["stop", "prevent"])
|
|
2419
2480
|
}, [
|
|
2420
|
-
|
|
2481
|
+
_("div", {
|
|
2421
2482
|
id: "currentContent",
|
|
2422
2483
|
style: { display: "none" },
|
|
2423
|
-
innerHTML:
|
|
2424
|
-
}, null, 8,
|
|
2425
|
-
|
|
2484
|
+
innerHTML: e.modelValue
|
|
2485
|
+
}, null, 8, Ao),
|
|
2486
|
+
_("div", {
|
|
2426
2487
|
ref_key: "editorElem",
|
|
2427
2488
|
ref: i,
|
|
2428
2489
|
class: "editor-element super-editor__element"
|
|
2429
2490
|
}, null, 512)
|
|
2430
2491
|
], 2));
|
|
2431
2492
|
}
|
|
2432
|
-
},
|
|
2433
|
-
Node:
|
|
2434
|
-
Attribute:
|
|
2435
|
-
Extension:
|
|
2436
|
-
Plugin:
|
|
2437
|
-
Mark:
|
|
2493
|
+
}, Ro = /* @__PURE__ */ q(To, [["__scopeId", "data-v-4d5cff52"]]), Oo = {
|
|
2494
|
+
Node: Bt,
|
|
2495
|
+
Attribute: Dt,
|
|
2496
|
+
Extension: Mt,
|
|
2497
|
+
Plugin: Rt,
|
|
2498
|
+
Mark: Lt
|
|
2438
2499
|
};
|
|
2439
2500
|
export {
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2460
|
-
|
|
2501
|
+
qt as AIWriter,
|
|
2502
|
+
zo as BasicUpload,
|
|
2503
|
+
Vo as CommentsPluginKey,
|
|
2504
|
+
Yo as DocxZipper,
|
|
2505
|
+
Ne as Editor,
|
|
2506
|
+
Oo as Extensions,
|
|
2507
|
+
Xo as SuperConverter,
|
|
2508
|
+
$o as SuperEditor,
|
|
2509
|
+
Ro as SuperInput,
|
|
2510
|
+
Ho as SuperToolbar,
|
|
2511
|
+
Ut as Toolbar,
|
|
2512
|
+
Po as TrackChangesBasePluginKey,
|
|
2513
|
+
Qo as createZip,
|
|
2514
|
+
jo as fieldAnnotationHelpers,
|
|
2515
|
+
xt as getActiveFormatting,
|
|
2516
|
+
ho as getAllowedImageDimensions,
|
|
2517
|
+
Uo as getMarksFromSelection,
|
|
2518
|
+
It as getRichTextExtensions,
|
|
2519
|
+
Tt as getStarterExtensions,
|
|
2520
|
+
qo as helpers,
|
|
2521
|
+
Go as trackChangesHelpers
|
|
2461
2522
|
};
|