@harbour-enterprises/superdoc 0.12.0-RC1 → 0.12.0-RC2
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/{eventemitter3-CRfwKE7Z.es.js → eventemitter3-C9iBZY5R.es.js} +1 -1
- package/dist/chunks/{eventemitter3-D38HWRLP.cjs → eventemitter3-Cj9ZwxFw.cjs} +1 -1
- package/dist/chunks/{index-CPZ-IxHT.es.js → index-BTkgQgI7.es.js} +2 -2
- package/dist/chunks/{index-BXKGjuVW.cjs → index-C6SLw2ph.cjs} +1 -1
- package/dist/chunks/{index-CqRwYOdx.cjs → index-CbUTRvRk.cjs} +1 -1
- package/dist/chunks/{index-Y7BlAr93.es.js → index-kWwSELc2.es.js} +4 -4
- package/dist/chunks/{jszip-ChlzEvf9.cjs → jszip-D9YbjC4E.cjs} +1 -1
- package/dist/chunks/{jszip-DO3il9iI.es.js → jszip-OpmRHhd4.es.js} +1 -1
- package/dist/chunks/super-editor.es-VeFFgSyB.cjs +451 -0
- package/dist/chunks/{super-editor.es-jxkEOua-.es.js → super-editor.es-jrBL9mdr.es.js} +16776 -16177
- package/dist/chunks/{url-t15h9onH.es.js → url-C29KYeaj.es.js} +2 -2
- package/dist/chunks/{url-6Xu7gR4T.cjs → url-DRGmEUtI.cjs} +1 -1
- package/dist/chunks/vue-BQCc2YbW.cjs +13 -0
- package/dist/chunks/{vue-DXpzqXur.es.js → vue-DKS68Dra.es.js} +1159 -1140
- package/dist/chunks/{xml-js-zhwNEV5e.cjs → xml-js-CMQ3QRee.cjs} +1 -1
- package/dist/chunks/{xml-js-kwrvzyhm.es.js → xml-js-CgHhGhcJ.es.js} +2 -2
- package/dist/components/CommentsLayer/commentsList/super-comments-list.d.ts +1 -2
- package/dist/components/CommentsLayer/commentsList/super-comments-list.d.ts.map +1 -1
- package/dist/core/SuperDoc.d.ts +264 -41
- package/dist/core/SuperDoc.d.ts.map +1 -1
- package/dist/stores/superdoc-store.d.ts +6 -744
- package/dist/stores/superdoc-store.d.ts.map +1 -1
- package/dist/style.css +29 -29
- package/dist/super-editor/ai-writer.es.js +208 -121
- package/dist/super-editor/chunks/{converter-B_CnsyBe.js → converter-D1a6grDV.js} +2494 -2424
- package/dist/super-editor/chunks/{docx-zipper-CmQ11kAl.js → docx-zipper-L7BeJRax.js} +1 -1
- package/dist/super-editor/chunks/{editor-D_W26AM3.js → editor-BY7pz5xQ.js} +11524 -11250
- package/dist/super-editor/chunks/{toolbar-DgpDtH5C.js → toolbar-DEvjPuNj.js} +132 -132
- package/dist/super-editor/components/toolbar/ai-helpers.d.ts +12 -0
- package/dist/super-editor/components/toolbar/ai-helpers.d.ts.map +1 -1
- package/dist/super-editor/components/toolbar/super-toolbar.d.ts +460 -84
- package/dist/super-editor/components/toolbar/super-toolbar.d.ts.map +1 -1
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/core/Editor.d.ts +507 -48
- package/dist/super-editor/core/Editor.d.ts.map +1 -1
- package/dist/super-editor/core/helpers/annotator.d.ts +10 -3
- package/dist/super-editor/core/helpers/annotator.d.ts.map +1 -1
- package/dist/super-editor/core/helpers/getActiveFormatting.d.ts.map +1 -1
- package/dist/super-editor/core/index.d.ts +3 -3
- package/dist/super-editor/core/super-converter/SuperConverter.d.ts +1 -1
- package/dist/super-editor/core/super-converter/SuperConverter.d.ts.map +1 -1
- package/dist/super-editor/core/super-converter/exporter.d.ts.map +1 -1
- package/dist/super-editor/core/super-converter/helpers.d.ts +1 -1
- package/dist/super-editor/core/super-converter/helpers.d.ts.map +1 -1
- package/dist/super-editor/core/super-converter/v2/importer/annotationImporter.d.ts.map +1 -1
- package/dist/super-editor/core/super-converter/v2/importer/listImporter.d.ts +25 -0
- package/dist/super-editor/core/super-converter/v2/importer/listImporter.d.ts.map +1 -1
- package/dist/super-editor/docx-zipper.es.js +2 -2
- package/dist/super-editor/editor.es.js +3 -3
- package/dist/super-editor/extensions/field-annotation/field-annotation.d.ts.map +1 -1
- package/dist/super-editor/extensions/field-annotation/fieldAnnotationHelpers/trackFieldAnnotationsDeletion.d.ts.map +1 -1
- package/dist/super-editor/extensions/linked-styles/linked-styles.d.ts.map +1 -1
- package/dist/super-editor/extensions/list-item/ListItemNodeView.d.ts +56 -0
- package/dist/super-editor/extensions/list-item/ListItemNodeView.d.ts.map +1 -0
- package/dist/super-editor/extensions/list-item/list-item.d.ts +0 -11
- package/dist/super-editor/extensions/list-item/list-item.d.ts.map +1 -1
- package/dist/super-editor/extensions/table/table.d.ts.map +1 -1
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/style.css +1 -1
- package/dist/super-editor/super-editor.es.js +768 -557
- package/dist/super-editor/tests/editor/listItemHelpers.test.d.ts +2 -0
- package/dist/super-editor/tests/editor/listItemHelpers.test.d.ts.map +1 -0
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +1 -1
- package/dist/super-editor.d.ts +3 -0
- package/dist/super-editor.es.js +6 -6
- package/dist/superdoc.cjs +26 -26
- package/dist/superdoc.es.js +1114 -1011
- package/dist/superdoc.umd.js +16304 -15571
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunks/super-editor.es-D2_UqVSP.cjs +0 -452
- package/dist/chunks/vue-Ckf0DkDN.cjs +0 -13
|
@@ -2,93 +2,93 @@ var yt = Object.defineProperty;
|
|
|
2
2
|
var Ue = (t) => {
|
|
3
3
|
throw TypeError(t);
|
|
4
4
|
};
|
|
5
|
-
var bt = (t,
|
|
6
|
-
var Re = (t,
|
|
7
|
-
var Ae = (t,
|
|
8
|
-
var z = (t,
|
|
9
|
-
import { _ as q, a as Ze, b as wt, I as Ne, f as
|
|
10
|
-
import { C as No, T as zo, l as Vo, n as Wo, k as Po, m as jo } from "./chunks/editor-
|
|
11
|
-
import {
|
|
12
|
-
import { O as qo } from "./chunks/converter-
|
|
13
|
-
import { ref as f, createElementBlock as
|
|
14
|
-
import { t as X, s as Wt, T as Pt, N as Y } from "./chunks/toolbar-
|
|
5
|
+
var bt = (t, r, o) => r in t ? yt(t, r, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[r] = o;
|
|
6
|
+
var Re = (t, r, o) => bt(t, typeof r != "symbol" ? r + "" : r, o), qe = (t, r, o) => r.has(t) || Ue("Cannot " + o);
|
|
7
|
+
var Ae = (t, r, o) => (qe(t, r, "read from private field"), o ? o.call(t) : r.get(t)), Oe = (t, r, o) => r.has(t) ? Ue("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(t) : r.set(t, o);
|
|
8
|
+
var z = (t, r, o) => (qe(t, r, "access private method"), o);
|
|
9
|
+
import { _ as q, a as Ze, b as wt, I as Ne, f as Ct, c as Ge, d as kt, i as _t, u as xt, r as Et, E as ze, e as St, P as At, h as Tt, M as Ft, j as It, A as Lt, N as Mt } from "./chunks/editor-BY7pz5xQ.js";
|
|
10
|
+
import { C as No, T as zo, l as Vo, n as Wo, k as Po, m as jo } from "./chunks/editor-BY7pz5xQ.js";
|
|
11
|
+
import { a6 as Dt, E as $t, a8 as Ht, T as Ye, a as Bt } from "./chunks/converter-D1a6grDV.js";
|
|
12
|
+
import { O as qo } from "./chunks/converter-D1a6grDV.js";
|
|
13
|
+
import { ref as f, createElementBlock as C, openBlock as w, createElementVNode as k, unref as D, getCurrentInstance as Rt, computed as j, watch as Ot, onMounted as ke, createCommentVNode as Q, withDirectives as Je, withKeys as Qe, normalizeClass as oe, withModifiers as ge, vModelText as et, createTextVNode as tt, toDisplayString as ie, Fragment as U, renderList as ee, normalizeStyle as J, createVNode as P, h as B, createApp as Nt, reactive as Ke, onUnmounted as zt, shallowRef as nt, onBeforeUnmount as ot, createBlock as Vt } from "vue";
|
|
14
|
+
import { t as X, s as Wt, T as Pt, N as Y } from "./chunks/toolbar-DEvjPuNj.js";
|
|
15
15
|
import jt from "./ai-writer.es.js";
|
|
16
|
-
import { D as Ko } from "./chunks/docx-zipper-
|
|
16
|
+
import { D as Ko } from "./chunks/docx-zipper-L7BeJRax.js";
|
|
17
17
|
import { createZip as Zo } from "./file-zipper.es.js";
|
|
18
18
|
var it = { exports: {} };
|
|
19
19
|
(function(t) {
|
|
20
|
-
var
|
|
20
|
+
var r = Object.prototype.hasOwnProperty, o = "~";
|
|
21
21
|
function n() {
|
|
22
22
|
}
|
|
23
23
|
Object.create && (n.prototype = /* @__PURE__ */ Object.create(null), new n().__proto__ || (o = !1));
|
|
24
|
-
function e(
|
|
25
|
-
this.fn =
|
|
24
|
+
function e(l, d, m) {
|
|
25
|
+
this.fn = l, this.context = d, this.once = m || !1;
|
|
26
26
|
}
|
|
27
|
-
function i(
|
|
28
|
-
if (typeof
|
|
27
|
+
function i(l, d, m, s, b) {
|
|
28
|
+
if (typeof m != "function")
|
|
29
29
|
throw new TypeError("The listener must be a function");
|
|
30
|
-
var v = new e(
|
|
31
|
-
return
|
|
30
|
+
var v = new e(m, s || l, b), y = o ? o + d : d;
|
|
31
|
+
return l._events[y] ? l._events[y].fn ? l._events[y] = [l._events[y], v] : l._events[y].push(v) : (l._events[y] = v, l._eventsCount++), l;
|
|
32
32
|
}
|
|
33
|
-
function
|
|
34
|
-
--
|
|
33
|
+
function c(l, d) {
|
|
34
|
+
--l._eventsCount === 0 ? l._events = new n() : delete l._events[d];
|
|
35
35
|
}
|
|
36
36
|
function a() {
|
|
37
37
|
this._events = new n(), this._eventsCount = 0;
|
|
38
38
|
}
|
|
39
39
|
a.prototype.eventNames = function() {
|
|
40
|
-
var
|
|
41
|
-
if (this._eventsCount === 0) return
|
|
42
|
-
for (
|
|
43
|
-
|
|
44
|
-
return Object.getOwnPropertySymbols ?
|
|
45
|
-
}, a.prototype.listeners = function(
|
|
46
|
-
var
|
|
47
|
-
if (!
|
|
48
|
-
if (
|
|
49
|
-
for (var b = 0, v =
|
|
50
|
-
y[b] =
|
|
40
|
+
var d = [], m, s;
|
|
41
|
+
if (this._eventsCount === 0) return d;
|
|
42
|
+
for (s in m = this._events)
|
|
43
|
+
r.call(m, s) && d.push(o ? s.slice(1) : s);
|
|
44
|
+
return Object.getOwnPropertySymbols ? d.concat(Object.getOwnPropertySymbols(m)) : d;
|
|
45
|
+
}, a.prototype.listeners = function(d) {
|
|
46
|
+
var m = o ? o + d : d, s = this._events[m];
|
|
47
|
+
if (!s) return [];
|
|
48
|
+
if (s.fn) return [s.fn];
|
|
49
|
+
for (var b = 0, v = s.length, y = new Array(v); b < v; b++)
|
|
50
|
+
y[b] = s[b].fn;
|
|
51
51
|
return y;
|
|
52
|
-
}, a.prototype.listenerCount = function(
|
|
53
|
-
var
|
|
54
|
-
return
|
|
55
|
-
}, a.prototype.emit = function(
|
|
56
|
-
var
|
|
57
|
-
if (!this._events[
|
|
58
|
-
var g = this._events[
|
|
52
|
+
}, a.prototype.listenerCount = function(d) {
|
|
53
|
+
var m = o ? o + d : d, s = this._events[m];
|
|
54
|
+
return s ? s.fn ? 1 : s.length : 0;
|
|
55
|
+
}, a.prototype.emit = function(d, m, s, b, v, y) {
|
|
56
|
+
var E = o ? o + d : d;
|
|
57
|
+
if (!this._events[E]) return !1;
|
|
58
|
+
var g = this._events[E], F = arguments.length, $, p;
|
|
59
59
|
if (g.fn) {
|
|
60
|
-
switch (g.once && this.removeListener(
|
|
60
|
+
switch (g.once && this.removeListener(d, g.fn, void 0, !0), F) {
|
|
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, m), !0;
|
|
65
65
|
case 3:
|
|
66
|
-
return g.fn.call(g.context,
|
|
66
|
+
return g.fn.call(g.context, m, s), !0;
|
|
67
67
|
case 4:
|
|
68
|
-
return g.fn.call(g.context,
|
|
68
|
+
return g.fn.call(g.context, m, s, b), !0;
|
|
69
69
|
case 5:
|
|
70
|
-
return g.fn.call(g.context,
|
|
70
|
+
return g.fn.call(g.context, m, s, b, v), !0;
|
|
71
71
|
case 6:
|
|
72
|
-
return g.fn.call(g.context,
|
|
72
|
+
return g.fn.call(g.context, m, s, b, v, y), !0;
|
|
73
73
|
}
|
|
74
74
|
for (p = 1, $ = new Array(F - 1); p < F; p++)
|
|
75
75
|
$[p - 1] = arguments[p];
|
|
76
76
|
g.fn.apply(g.context, $);
|
|
77
77
|
} else {
|
|
78
|
-
var
|
|
79
|
-
for (p = 0; p <
|
|
80
|
-
switch (g[p].once && this.removeListener(
|
|
78
|
+
var x = g.length, T;
|
|
79
|
+
for (p = 0; p < x; p++)
|
|
80
|
+
switch (g[p].once && this.removeListener(d, g[p].fn, void 0, !0), F) {
|
|
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, m);
|
|
86
86
|
break;
|
|
87
87
|
case 3:
|
|
88
|
-
g[p].fn.call(g[p].context,
|
|
88
|
+
g[p].fn.call(g[p].context, m, s);
|
|
89
89
|
break;
|
|
90
90
|
case 4:
|
|
91
|
-
g[p].fn.call(g[p].context,
|
|
91
|
+
g[p].fn.call(g[p].context, m, s, b);
|
|
92
92
|
break;
|
|
93
93
|
default:
|
|
94
94
|
if (!$) for (T = 1, $ = new Array(F - 1); T < F; T++)
|
|
@@ -97,60 +97,60 @@ var it = { exports: {} };
|
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
99
|
return !0;
|
|
100
|
-
}, a.prototype.on = function(
|
|
101
|
-
return i(this,
|
|
102
|
-
}, a.prototype.once = function(
|
|
103
|
-
return i(this,
|
|
104
|
-
}, a.prototype.removeListener = function(
|
|
105
|
-
var v = o ? o +
|
|
100
|
+
}, a.prototype.on = function(d, m, s) {
|
|
101
|
+
return i(this, d, m, s, !1);
|
|
102
|
+
}, a.prototype.once = function(d, m, s) {
|
|
103
|
+
return i(this, d, m, s, !0);
|
|
104
|
+
}, a.prototype.removeListener = function(d, m, s, b) {
|
|
105
|
+
var v = o ? o + d : d;
|
|
106
106
|
if (!this._events[v]) return this;
|
|
107
|
-
if (!
|
|
108
|
-
return
|
|
107
|
+
if (!m)
|
|
108
|
+
return c(this, v), this;
|
|
109
109
|
var y = this._events[v];
|
|
110
110
|
if (y.fn)
|
|
111
|
-
y.fn ===
|
|
111
|
+
y.fn === m && (!b || y.once) && (!s || y.context === s) && c(this, v);
|
|
112
112
|
else {
|
|
113
|
-
for (var
|
|
114
|
-
(y[
|
|
115
|
-
g.length ? this._events[v] = g.length === 1 ? g[0] : g :
|
|
113
|
+
for (var E = 0, g = [], F = y.length; E < F; E++)
|
|
114
|
+
(y[E].fn !== m || b && !y[E].once || s && y[E].context !== s) && g.push(y[E]);
|
|
115
|
+
g.length ? this._events[v] = g.length === 1 ? g[0] : g : c(this, v);
|
|
116
116
|
}
|
|
117
117
|
return this;
|
|
118
|
-
}, a.prototype.removeAllListeners = function(
|
|
119
|
-
var
|
|
120
|
-
return
|
|
118
|
+
}, a.prototype.removeAllListeners = function(d) {
|
|
119
|
+
var m;
|
|
120
|
+
return d ? (m = o ? o + d : d, this._events[m] && c(this, m)) : (this._events = new n(), this._eventsCount = 0), this;
|
|
121
121
|
}, a.prototype.off = a.prototype.removeListener, a.prototype.addListener = a.prototype.on, a.prefixed = o, a.EventEmitter = a, t.exports = a;
|
|
122
122
|
})(it);
|
|
123
123
|
var Ut = it.exports;
|
|
124
124
|
const qt = /* @__PURE__ */ Dt(Ut);
|
|
125
125
|
function Gt(t) {
|
|
126
|
-
let
|
|
127
|
-
for (;
|
|
128
|
-
const o = window.getComputedStyle(
|
|
129
|
-
if (/(auto|scroll)/.test(o) &&
|
|
130
|
-
return
|
|
131
|
-
|
|
126
|
+
let r = t;
|
|
127
|
+
for (; r; ) {
|
|
128
|
+
const o = window.getComputedStyle(r).overflowY;
|
|
129
|
+
if (/(auto|scroll)/.test(o) && r.scrollHeight > r.clientHeight)
|
|
130
|
+
return r;
|
|
131
|
+
r = r.parentElement;
|
|
132
132
|
}
|
|
133
133
|
return document.scrollingElement || document.documentElement;
|
|
134
134
|
}
|
|
135
|
-
function Kt(t,
|
|
135
|
+
function Kt(t, r = { behavior: "smooth", block: "start" }) {
|
|
136
136
|
if (!t) return;
|
|
137
137
|
const o = Gt(t), n = o.getBoundingClientRect(), i = t.getBoundingClientRect().top - n.top + o.scrollTop;
|
|
138
138
|
o.scrollTo({
|
|
139
|
-
top:
|
|
140
|
-
behavior:
|
|
139
|
+
top: r.block === "start" ? i : i - o.clientHeight + t.offsetHeight,
|
|
140
|
+
behavior: r.behavior
|
|
141
141
|
});
|
|
142
142
|
}
|
|
143
|
-
const
|
|
143
|
+
const _ = (t) => {
|
|
144
144
|
if (!["button", "options", "separator", "dropdown", "overflow"].includes(t.type))
|
|
145
145
|
throw new Error("Invalid toolbar item type - " + t.type);
|
|
146
146
|
if (t.type === "button" && !t.defaultLabel && !t.icon)
|
|
147
147
|
throw new Error("Toolbar button item needs either icon or label - " + t.name);
|
|
148
148
|
if (!t.name)
|
|
149
149
|
throw new Error("Invalid toolbar item name - " + t.name);
|
|
150
|
-
const o = f($t()), n = t.type, e = f(t.name), i = t.command,
|
|
150
|
+
const o = f($t()), n = t.type, e = f(t.name), i = t.command, c = t.noArgumentCommand, a = f(t.icon), l = f(t.group || "center"), d = f(t.allowWithoutEditor), m = f(t.attributes || {}), s = t.disabled || !1, b = f(t.disabled), v = f(!1), y = f(!1), E = f(t.style), g = f(t.isNarrow), F = f(t.isWide), $ = f(t.minWidth), p = f(t.suppressActiveHighlight || !1), x = f(t.argument), T = f(null), N = f(null), V = f(t.iconColor), te = f(t.hasCaret), ye = f(t.dropdownStyles), Z = f(t.tooltip), re = f(t.tooltipVisible), be = f(t.tooltipTimeout), I = f(t.defaultLabel), M = f(t.label), H = f(t.hideLabel), R = f(t.inlineTextInputVisible), G = f(t.hasInlineTextInput), K = f(t.markName), ce = f(t.labelAttr), ue = f(t.selectedValue), _e = f(t.dropdownValueKey), xe = f(t.inputRef || null), Ee = f([]);
|
|
151
151
|
if (t.options) {
|
|
152
152
|
if (!Array.isArray(t.options)) throw new Error("Invalid toolbar item options - " + t.options);
|
|
153
|
-
|
|
153
|
+
Ee.value.push(...t.options);
|
|
154
154
|
}
|
|
155
155
|
const Fe = (se) => {
|
|
156
156
|
we(se), !p.value && (v.value = !0);
|
|
@@ -159,7 +159,7 @@ const x = (t) => {
|
|
|
159
159
|
}, Le = (se) => {
|
|
160
160
|
b.value = se;
|
|
161
161
|
}, Me = () => {
|
|
162
|
-
b.value =
|
|
162
|
+
b.value = s;
|
|
163
163
|
}, we = t.onActivate || (() => null), ne = t.onDeactivate || (() => null), De = () => {
|
|
164
164
|
const se = {};
|
|
165
165
|
return Object.keys(me).forEach((pe) => {
|
|
@@ -170,20 +170,20 @@ const x = (t) => {
|
|
|
170
170
|
name: e,
|
|
171
171
|
type: n,
|
|
172
172
|
command: i,
|
|
173
|
-
noArgumentCommand:
|
|
173
|
+
noArgumentCommand: c,
|
|
174
174
|
icon: a,
|
|
175
175
|
tooltip: Z,
|
|
176
|
-
group:
|
|
177
|
-
attributes:
|
|
176
|
+
group: l,
|
|
177
|
+
attributes: m,
|
|
178
178
|
disabled: b,
|
|
179
179
|
active: v,
|
|
180
180
|
expand: y,
|
|
181
|
-
nestedOptions:
|
|
182
|
-
style:
|
|
181
|
+
nestedOptions: Ee,
|
|
182
|
+
style: E,
|
|
183
183
|
isNarrow: g,
|
|
184
184
|
isWide: F,
|
|
185
185
|
minWidth: $,
|
|
186
|
-
argument:
|
|
186
|
+
argument: x,
|
|
187
187
|
parentItem: N,
|
|
188
188
|
iconColor: V,
|
|
189
189
|
hasCaret: te,
|
|
@@ -198,7 +198,7 @@ const x = (t) => {
|
|
|
198
198
|
markName: K,
|
|
199
199
|
labelAttr: ce,
|
|
200
200
|
childItem: T,
|
|
201
|
-
allowWithoutEditor:
|
|
201
|
+
allowWithoutEditor: d,
|
|
202
202
|
dropdownValueKey: _e,
|
|
203
203
|
selectedValue: ue,
|
|
204
204
|
inputRef: xe
|
|
@@ -216,29 +216,29 @@ const x = (t) => {
|
|
|
216
216
|
}, Xt = { class: "alignment-buttons" }, Zt = ["innerHTML"], Yt = ["innerHTML"], Jt = ["innerHTML"], Qt = ["innerHTML"], en = {
|
|
217
217
|
__name: "AlignmentButtons",
|
|
218
218
|
emits: ["select"],
|
|
219
|
-
setup(t, { emit:
|
|
220
|
-
const o =
|
|
219
|
+
setup(t, { emit: r }) {
|
|
220
|
+
const o = r, n = (e) => {
|
|
221
221
|
o("select", e);
|
|
222
222
|
};
|
|
223
|
-
return (e, i) => (w(),
|
|
224
|
-
|
|
223
|
+
return (e, i) => (w(), C("div", Xt, [
|
|
224
|
+
k("div", {
|
|
225
225
|
class: "button-icon",
|
|
226
|
-
onClick: i[0] || (i[0] = (
|
|
226
|
+
onClick: i[0] || (i[0] = (c) => n("left")),
|
|
227
227
|
innerHTML: D(X).alignLeft
|
|
228
228
|
}, null, 8, Zt),
|
|
229
|
-
|
|
229
|
+
k("div", {
|
|
230
230
|
class: "button-icon",
|
|
231
|
-
onClick: i[1] || (i[1] = (
|
|
231
|
+
onClick: i[1] || (i[1] = (c) => n("center")),
|
|
232
232
|
innerHTML: D(X).alignCenter
|
|
233
233
|
}, null, 8, Yt),
|
|
234
|
-
|
|
234
|
+
k("div", {
|
|
235
235
|
class: "button-icon",
|
|
236
|
-
onClick: i[2] || (i[2] = (
|
|
236
|
+
onClick: i[2] || (i[2] = (c) => n("right")),
|
|
237
237
|
innerHTML: D(X).alignRight
|
|
238
238
|
}, null, 8, Jt),
|
|
239
|
-
|
|
239
|
+
k("div", {
|
|
240
240
|
class: "button-icon",
|
|
241
|
-
onClick: i[3] || (i[3] = (
|
|
241
|
+
onClick: i[3] || (i[3] = (c) => n("justify")),
|
|
242
242
|
innerHTML: D(X).alignJustify
|
|
243
243
|
}, null, 8, Qt)
|
|
244
244
|
]));
|
|
@@ -281,88 +281,88 @@ const x = (t) => {
|
|
|
281
281
|
}
|
|
282
282
|
},
|
|
283
283
|
emits: ["submit", "cancel"],
|
|
284
|
-
setup(t, { emit:
|
|
285
|
-
const o =
|
|
286
|
-
if (e?.$submit instanceof Function && e.$submit(),
|
|
287
|
-
o("submit", { text:
|
|
284
|
+
setup(t, { emit: r }) {
|
|
285
|
+
const o = r, n = t, { proxy: e } = Rt(), i = () => {
|
|
286
|
+
if (e?.$submit instanceof Function && e.$submit(), d.value && s.value) {
|
|
287
|
+
o("submit", { text: l.value, href: m.value });
|
|
288
288
|
return;
|
|
289
|
-
} else if (!
|
|
290
|
-
o("submit", { text:
|
|
289
|
+
} else if (!d.value) {
|
|
290
|
+
o("submit", { text: l.value, href: null });
|
|
291
291
|
return;
|
|
292
292
|
}
|
|
293
293
|
console.debug("[LinkInput] Invalid URL in handleSubmit"), a.value = !0;
|
|
294
|
-
},
|
|
295
|
-
o("submit", { text:
|
|
296
|
-
}, a = f(!1),
|
|
297
|
-
const p =
|
|
298
|
-
return
|
|
299
|
-
}), b = j(() => y.value ? "Apply" : "Remove"), v = j(() => !
|
|
300
|
-
window.open(
|
|
294
|
+
}, c = () => {
|
|
295
|
+
o("submit", { text: l.value, href: null });
|
|
296
|
+
}, a = f(!1), l = f(n.initialText), d = f(n.href), m = j(() => d.value?.startsWith("http") ? d.value : "http://" + d.value), s = j(() => {
|
|
297
|
+
const p = m.value.split(".").filter(Boolean);
|
|
298
|
+
return m.value.includes(".") && p.length > 1;
|
|
299
|
+
}), b = j(() => y.value ? "Apply" : "Remove"), v = j(() => !s.value), y = j(() => !E.value), E = j(() => n.href && !d.value), g = j(() => n.href.startsWith("#")), F = () => {
|
|
300
|
+
window.open(m.value, "_blank");
|
|
301
301
|
};
|
|
302
302
|
Ot(
|
|
303
303
|
() => n.href,
|
|
304
304
|
(p) => {
|
|
305
|
-
|
|
305
|
+
d.value = p;
|
|
306
306
|
}
|
|
307
307
|
);
|
|
308
308
|
const $ = () => {
|
|
309
309
|
const p = document.querySelector(".link-input-ctn input");
|
|
310
310
|
p && p.focus();
|
|
311
311
|
};
|
|
312
|
-
return
|
|
312
|
+
return ke(() => {
|
|
313
313
|
n.showInput && $();
|
|
314
|
-
}), (p,
|
|
315
|
-
t.href ? g.value ? (w(),
|
|
316
|
-
t.showInput && !g.value ? (w(),
|
|
317
|
-
|
|
318
|
-
|
|
314
|
+
}), (p, x) => (w(), C("div", nn, [
|
|
315
|
+
t.href ? g.value ? (w(), C("div", sn, "Page anchor")) : (w(), C("div", ln, "Edit link")) : (w(), C("div", on, "Add link")),
|
|
316
|
+
t.showInput && !g.value ? (w(), C("div", an, [
|
|
317
|
+
k("div", rn, [
|
|
318
|
+
k("div", {
|
|
319
319
|
class: "input-icon",
|
|
320
320
|
innerHTML: D(X).linkInput
|
|
321
321
|
}, null, 8, cn),
|
|
322
|
-
Je(
|
|
322
|
+
Je(k("input", {
|
|
323
323
|
type: "text",
|
|
324
324
|
placeholder: "Type or paste a link",
|
|
325
325
|
class: oe({ error: a.value }),
|
|
326
|
-
"onUpdate:modelValue":
|
|
326
|
+
"onUpdate:modelValue": x[0] || (x[0] = (T) => d.value = T),
|
|
327
327
|
onKeydown: [
|
|
328
328
|
Qe(ge(i, ["stop", "prevent"]), ["enter"]),
|
|
329
|
-
|
|
329
|
+
x[1] || (x[1] = (T) => a.value = !1)
|
|
330
330
|
]
|
|
331
331
|
}, null, 42, dn), [
|
|
332
|
-
[et,
|
|
332
|
+
[et, d.value]
|
|
333
333
|
]),
|
|
334
|
-
|
|
335
|
-
class: oe(["open-link-icon", { disabled: !
|
|
334
|
+
k("div", {
|
|
335
|
+
class: oe(["open-link-icon", { disabled: !s.value }]),
|
|
336
336
|
innerHTML: D(X).openLink,
|
|
337
337
|
onClick: F
|
|
338
338
|
}, null, 10, un)
|
|
339
339
|
]),
|
|
340
|
-
|
|
341
|
-
t.href ? (w(),
|
|
340
|
+
k("div", mn, [
|
|
341
|
+
t.href ? (w(), C("button", {
|
|
342
342
|
key: 0,
|
|
343
343
|
class: "remove-btn",
|
|
344
|
-
onClick:
|
|
344
|
+
onClick: c
|
|
345
345
|
}, [
|
|
346
|
-
|
|
346
|
+
k("div", {
|
|
347
347
|
class: "remove-btn__icon",
|
|
348
348
|
innerHTML: D(X).removeLink
|
|
349
349
|
}, null, 8, pn),
|
|
350
|
-
|
|
350
|
+
x[3] || (x[3] = tt(" Remove "))
|
|
351
351
|
])) : Q("", !0),
|
|
352
|
-
y.value ? (w(),
|
|
352
|
+
y.value ? (w(), C("button", {
|
|
353
353
|
key: 1,
|
|
354
354
|
class: oe(["submit-btn", { "disable-btn": v.value }]),
|
|
355
355
|
onClick: i
|
|
356
356
|
}, ie(b.value), 3)) : Q("", !0)
|
|
357
357
|
])
|
|
358
|
-
])) : g.value ? (w(),
|
|
359
|
-
|
|
360
|
-
onClick:
|
|
358
|
+
])) : g.value ? (w(), C("div", hn, [
|
|
359
|
+
k("a", {
|
|
360
|
+
onClick: x[2] || (x[2] = ge((...T) => t.goToAnchor && t.goToAnchor(...T), ["stop", "prevent"]))
|
|
361
361
|
}, "Go to " + ie(t.href.startsWith("#_") ? t.href.substring(2) : t.href), 1)
|
|
362
362
|
])) : Q("", !0)
|
|
363
363
|
]));
|
|
364
364
|
}
|
|
365
|
-
}, vn = /* @__PURE__ */ q(fn, [["__scopeId", "data-v-6990d5b2"]]), gn = { class: "document-mode" }, yn = ["onClick"], bn = { class: "document-mode-column icon-column" }, wn = ["innerHTML"],
|
|
365
|
+
}, vn = /* @__PURE__ */ q(fn, [["__scopeId", "data-v-6990d5b2"]]), gn = { class: "document-mode" }, yn = ["onClick"], bn = { class: "document-mode-column icon-column" }, wn = ["innerHTML"], Cn = { class: "document-mode-column text-column" }, kn = { class: "document-mode-type" }, _n = { class: "document-mode-description" }, xn = {
|
|
366
366
|
__name: "DocumentMode",
|
|
367
367
|
props: {
|
|
368
368
|
options: {
|
|
@@ -370,29 +370,29 @@ const x = (t) => {
|
|
|
370
370
|
}
|
|
371
371
|
},
|
|
372
372
|
emits: ["select"],
|
|
373
|
-
setup(t, { emit:
|
|
374
|
-
const o =
|
|
373
|
+
setup(t, { emit: r }) {
|
|
374
|
+
const o = r, n = (e) => {
|
|
375
375
|
o("select", e);
|
|
376
376
|
};
|
|
377
|
-
return (e, i) => (w(),
|
|
378
|
-
(w(!0),
|
|
379
|
-
class: oe(["option-item", { disabled:
|
|
380
|
-
onClick: (a) => n(
|
|
377
|
+
return (e, i) => (w(), C("div", gn, [
|
|
378
|
+
(w(!0), C(U, null, ee(t.options, (c) => (w(), C("div", {
|
|
379
|
+
class: oe(["option-item", { disabled: c.disabled }]),
|
|
380
|
+
onClick: (a) => n(c)
|
|
381
381
|
}, [
|
|
382
|
-
|
|
383
|
-
|
|
382
|
+
k("div", bn, [
|
|
383
|
+
k("div", {
|
|
384
384
|
class: "icon-column__icon",
|
|
385
|
-
innerHTML:
|
|
385
|
+
innerHTML: c.icon
|
|
386
386
|
}, null, 8, wn)
|
|
387
387
|
]),
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
388
|
+
k("div", Cn, [
|
|
389
|
+
k("div", kn, ie(c.label), 1),
|
|
390
|
+
k("div", _n, ie(c.description), 1)
|
|
391
391
|
])
|
|
392
392
|
], 10, yn))), 256))
|
|
393
393
|
]));
|
|
394
394
|
}
|
|
395
|
-
},
|
|
395
|
+
}, En = /* @__PURE__ */ q(xn, [["__scopeId", "data-v-f86e1477"]]), Sn = {
|
|
396
396
|
key: 0,
|
|
397
397
|
class: "linked-style-buttons"
|
|
398
398
|
}, An = ["onClick"], Tn = {
|
|
@@ -404,16 +404,16 @@ const x = (t) => {
|
|
|
404
404
|
}
|
|
405
405
|
},
|
|
406
406
|
emits: ["select"],
|
|
407
|
-
setup(t, { emit:
|
|
408
|
-
const o =
|
|
407
|
+
setup(t, { emit: r }) {
|
|
408
|
+
const o = r, n = t, e = (i) => {
|
|
409
409
|
o("select", i);
|
|
410
410
|
};
|
|
411
|
-
return (i,
|
|
412
|
-
(w(!0),
|
|
411
|
+
return (i, c) => n.editor ? (w(), C("div", Sn, [
|
|
412
|
+
(w(!0), C(U, null, ee(D(Ze)(t.editor), (a) => (w(), C("div", {
|
|
413
413
|
class: "style-item",
|
|
414
|
-
onClick: (
|
|
414
|
+
onClick: (l) => e(a)
|
|
415
415
|
}, [
|
|
416
|
-
|
|
416
|
+
k("div", {
|
|
417
417
|
class: "style-name",
|
|
418
418
|
style: J(D(wt)(a, null, !1))
|
|
419
419
|
}, ie(a.definition.attrs.name), 5)
|
|
@@ -433,31 +433,31 @@ const x = (t) => {
|
|
|
433
433
|
}
|
|
434
434
|
},
|
|
435
435
|
emits: ["select"],
|
|
436
|
-
setup(t, { emit:
|
|
437
|
-
const o =
|
|
436
|
+
setup(t, { emit: r }) {
|
|
437
|
+
const o = r, n = t, e = 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) => {
|
|
438
438
|
o("select", a.value);
|
|
439
439
|
};
|
|
440
|
-
return
|
|
441
|
-
if (!n.icons.every((
|
|
442
|
-
}), (a,
|
|
440
|
+
return ke(() => {
|
|
441
|
+
if (!n.icons.every((l) => Array.isArray(l))) throw new Error("icon props must be 2d array");
|
|
442
|
+
}), (a, l) => (w(!0), C(U, null, ee(t.icons, (d, m) => (w(), C("div", {
|
|
443
443
|
class: "option-row",
|
|
444
|
-
key:
|
|
444
|
+
key: m
|
|
445
445
|
}, [
|
|
446
|
-
(w(!0),
|
|
446
|
+
(w(!0), C(U, null, ee(d, (s, b) => (w(), C("div", {
|
|
447
447
|
class: "option",
|
|
448
448
|
key: b,
|
|
449
|
-
onClick: ge((v) =>
|
|
449
|
+
onClick: ge((v) => c(s), ["stop", "prevent"])
|
|
450
450
|
}, [
|
|
451
|
-
|
|
451
|
+
k("div", {
|
|
452
452
|
class: "option__icon",
|
|
453
|
-
innerHTML:
|
|
454
|
-
style: J(
|
|
453
|
+
innerHTML: s.icon,
|
|
454
|
+
style: J(s.style)
|
|
455
455
|
}, null, 12, Ln),
|
|
456
|
-
e.value(
|
|
456
|
+
e.value(s) ? (w(), C("div", {
|
|
457
457
|
key: 0,
|
|
458
458
|
class: "option__check",
|
|
459
459
|
innerHTML: D(X).colorOptionCheck,
|
|
460
|
-
style: J(i(
|
|
460
|
+
style: J(i(s.value, b))
|
|
461
461
|
}, null, 12, Mn)) : Q("", !0)
|
|
462
462
|
], 8, In))), 128))
|
|
463
463
|
]))), 128));
|
|
@@ -484,30 +484,30 @@ const x = (t) => {
|
|
|
484
484
|
}
|
|
485
485
|
},
|
|
486
486
|
emits: ["select", "clickoutside"],
|
|
487
|
-
setup(t, { emit:
|
|
488
|
-
const o =
|
|
487
|
+
setup(t, { emit: r }) {
|
|
488
|
+
const o = r, n = (e) => {
|
|
489
489
|
o("select", e);
|
|
490
490
|
};
|
|
491
|
-
return (e, i) => (w(),
|
|
492
|
-
t.hasNoneIcon ? (w(),
|
|
491
|
+
return (e, i) => (w(), C("div", Hn, [
|
|
492
|
+
t.hasNoneIcon ? (w(), C("div", {
|
|
493
493
|
key: 0,
|
|
494
494
|
class: "none-option",
|
|
495
|
-
onClick: i[0] || (i[0] = (
|
|
495
|
+
onClick: i[0] || (i[0] = (c) => n("none"))
|
|
496
496
|
}, [
|
|
497
|
-
|
|
497
|
+
k("span", {
|
|
498
498
|
innerHTML: D($n),
|
|
499
499
|
class: "none-icon"
|
|
500
500
|
}, null, 8, Bn),
|
|
501
501
|
i[1] || (i[1] = tt(" None "))
|
|
502
502
|
])) : Q("", !0),
|
|
503
|
-
|
|
503
|
+
k("div", Rn, [
|
|
504
504
|
P(Xe, {
|
|
505
505
|
icons: t.icons,
|
|
506
506
|
"active-color": t.activeColor,
|
|
507
507
|
onSelect: n
|
|
508
508
|
}, null, 8, ["icons", "active-color"]),
|
|
509
|
-
t.customIcons.flat().length ? (w(),
|
|
510
|
-
i[2] || (i[2] =
|
|
509
|
+
t.customIcons.flat().length ? (w(), C(U, { key: 0 }, [
|
|
510
|
+
i[2] || (i[2] = k("span", { class: "option-grid-ctn__subtitle" }, "Custom colors", -1)),
|
|
511
511
|
P(Xe, {
|
|
512
512
|
icons: t.customIcons,
|
|
513
513
|
"active-color": t.activeColor,
|
|
@@ -519,8 +519,8 @@ const x = (t) => {
|
|
|
519
519
|
}
|
|
520
520
|
}, Nn = /* @__PURE__ */ q(On, [["__scopeId", "data-v-47b783db"]]), zn = (t) => {
|
|
521
521
|
t.expand.value = !1;
|
|
522
|
-
}, h = (t,
|
|
523
|
-
label:
|
|
522
|
+
}, h = (t, r = null) => ({
|
|
523
|
+
label: r,
|
|
524
524
|
icon: X.colorOption,
|
|
525
525
|
value: t,
|
|
526
526
|
style: {
|
|
@@ -528,15 +528,15 @@ const x = (t) => {
|
|
|
528
528
|
boxShadow: "0 0 5px 1px rgba(0, 0, 0, 0.1)",
|
|
529
529
|
borderRadius: "50%"
|
|
530
530
|
}
|
|
531
|
-
}), Ve = (t,
|
|
531
|
+
}), Ve = (t, r, o = [], n = !1) => {
|
|
532
532
|
const e = (i) => {
|
|
533
|
-
|
|
533
|
+
r.iconColor.value = i, t.emitCommand({ item: r, argument: i }), zn(r);
|
|
534
534
|
};
|
|
535
535
|
return B("div", {}, [
|
|
536
536
|
B(Nn, {
|
|
537
537
|
icons: st,
|
|
538
538
|
customIcons: o,
|
|
539
|
-
activeColor:
|
|
539
|
+
activeColor: r.iconColor,
|
|
540
540
|
hasNoneIcon: n,
|
|
541
541
|
onSelect: e
|
|
542
542
|
})
|
|
@@ -603,7 +603,7 @@ const x = (t) => {
|
|
|
603
603
|
h("#6CA0DC"),
|
|
604
604
|
h("#9DBFE8"),
|
|
605
605
|
h("#CEDFF3"),
|
|
606
|
-
h("#
|
|
606
|
+
h("#21c8ce")
|
|
607
607
|
],
|
|
608
608
|
[
|
|
609
609
|
h("#3E027A"),
|
|
@@ -617,38 +617,38 @@ const x = (t) => {
|
|
|
617
617
|
], Vn = () => st.flat().map((t) => t.value), Wn = { class: "toolbar-table-grid-wrapper" }, Pn = ["data-cols", "data-rows", "onClick"], jn = { class: "toolbar-table-grid-value" }, Un = {
|
|
618
618
|
__name: "TableGrid",
|
|
619
619
|
emits: ["select", "clickoutside"],
|
|
620
|
-
setup(t, { emit:
|
|
621
|
-
const o =
|
|
622
|
-
let
|
|
623
|
-
if (!!
|
|
620
|
+
setup(t, { emit: r }) {
|
|
621
|
+
const o = r, n = f(0), e = f(0), i = (a) => {
|
|
622
|
+
let l = a.target;
|
|
623
|
+
if (!!l.dataset.grid)
|
|
624
624
|
return;
|
|
625
|
-
let
|
|
625
|
+
let s = [...l.parentElement.querySelectorAll("[data-item]")], b = parseInt(l.dataset.cols, 10), v = parseInt(l.dataset.rows, 10);
|
|
626
626
|
e.value = b, n.value = v;
|
|
627
|
-
for (let y = 0; y <
|
|
628
|
-
let
|
|
629
|
-
g <= b && F <= v ?
|
|
627
|
+
for (let y = 0; y < s.length; y++) {
|
|
628
|
+
let E = s[y], g = parseInt(E.dataset.cols, 10), F = parseInt(E.dataset.rows, 10);
|
|
629
|
+
g <= b && F <= v ? E.classList.add("selected") : E.classList.remove("selected");
|
|
630
630
|
}
|
|
631
|
-
},
|
|
632
|
-
o("select", { cols: a, rows:
|
|
631
|
+
}, c = ({ cols: a, rows: l }) => {
|
|
632
|
+
o("select", { cols: a, rows: l });
|
|
633
633
|
};
|
|
634
|
-
return (a,
|
|
635
|
-
|
|
634
|
+
return (a, l) => (w(), C("div", Wn, [
|
|
635
|
+
k("div", {
|
|
636
636
|
class: "toolbar-table-grid",
|
|
637
637
|
onMouseover: i,
|
|
638
638
|
"data-grid": "true"
|
|
639
639
|
}, [
|
|
640
|
-
(w(),
|
|
641
|
-
(w(),
|
|
640
|
+
(w(), C(U, null, ee(5, (d) => (w(), C(U, { key: d }, [
|
|
641
|
+
(w(), C(U, null, ee(5, (m) => k("div", {
|
|
642
642
|
class: "toolbar-table-grid__item",
|
|
643
|
-
key: `${
|
|
644
|
-
"data-cols":
|
|
645
|
-
"data-rows":
|
|
643
|
+
key: `${d}_${m}`,
|
|
644
|
+
"data-cols": m,
|
|
645
|
+
"data-rows": d,
|
|
646
646
|
"data-item": "true",
|
|
647
|
-
onClick: ge((
|
|
647
|
+
onClick: ge((s) => c({ cols: m, rows: d }), ["stop", "prevent"])
|
|
648
648
|
}, null, 8, Pn)), 64))
|
|
649
649
|
], 64))), 64))
|
|
650
650
|
], 32),
|
|
651
|
-
|
|
651
|
+
k("div", jn, ie(n.value) + " x " + ie(e.value), 1)
|
|
652
652
|
]));
|
|
653
653
|
}
|
|
654
654
|
}, qn = /* @__PURE__ */ q(Un, [["__scopeId", "data-v-06352ab9"]]), Gn = { class: "toolbar-table-actions" }, Kn = ["onClick"], Xn = { class: "toolbar-table-actions__icon" }, Zn = ["innerHTML"], Yn = { class: "toolbar-table-actions__label" }, Jn = {
|
|
@@ -659,22 +659,22 @@ const x = (t) => {
|
|
|
659
659
|
}
|
|
660
660
|
},
|
|
661
661
|
emits: ["select"],
|
|
662
|
-
setup(t, { emit:
|
|
663
|
-
const o =
|
|
662
|
+
setup(t, { emit: r }) {
|
|
663
|
+
const o = r, n = (e) => {
|
|
664
664
|
o("select", { command: e.command });
|
|
665
665
|
};
|
|
666
|
-
return (e, i) => (w(),
|
|
667
|
-
(w(!0),
|
|
668
|
-
class: oe(["toolbar-table-actions__item", { "toolbar-table-actions__item--border":
|
|
669
|
-
onClick: (a) => n(
|
|
666
|
+
return (e, i) => (w(), C("div", Gn, [
|
|
667
|
+
(w(!0), C(U, null, ee(t.options, (c) => (w(), C("div", {
|
|
668
|
+
class: oe(["toolbar-table-actions__item", { "toolbar-table-actions__item--border": c.bottomBorder }]),
|
|
669
|
+
onClick: (a) => n(c)
|
|
670
670
|
}, [
|
|
671
|
-
|
|
672
|
-
|
|
671
|
+
k("div", Xn, [
|
|
672
|
+
k("div", {
|
|
673
673
|
class: "toolbar-table-actions__icon-wrapper",
|
|
674
|
-
innerHTML:
|
|
674
|
+
innerHTML: c.icon
|
|
675
675
|
}, null, 8, Zn)
|
|
676
676
|
]),
|
|
677
|
-
|
|
677
|
+
k("div", Yn, ie(c.label), 1)
|
|
678
678
|
], 10, Kn))), 256))
|
|
679
679
|
]));
|
|
680
680
|
}
|
|
@@ -687,15 +687,15 @@ const x = (t) => {
|
|
|
687
687
|
}
|
|
688
688
|
},
|
|
689
689
|
emits: ["submit"],
|
|
690
|
-
setup(t, { emit:
|
|
691
|
-
const o = f(""), n =
|
|
690
|
+
setup(t, { emit: r }) {
|
|
691
|
+
const o = f(""), n = r, e = () => {
|
|
692
692
|
n("submit", { value: o.value });
|
|
693
693
|
};
|
|
694
|
-
return (i,
|
|
695
|
-
|
|
696
|
-
Je(
|
|
694
|
+
return (i, c) => (w(), C("div", to, [
|
|
695
|
+
k("div", no, [
|
|
696
|
+
Je(k("input", {
|
|
697
697
|
ref: t.searchRef,
|
|
698
|
-
"onUpdate:modelValue":
|
|
698
|
+
"onUpdate:modelValue": c[0] || (c[0] = (a) => o.value = a),
|
|
699
699
|
class: "search-input",
|
|
700
700
|
type: "text",
|
|
701
701
|
name: "search",
|
|
@@ -705,8 +705,8 @@ const x = (t) => {
|
|
|
705
705
|
[et, o.value]
|
|
706
706
|
])
|
|
707
707
|
]),
|
|
708
|
-
|
|
709
|
-
|
|
708
|
+
k("div", { class: "row submit" }, [
|
|
709
|
+
k("button", {
|
|
710
710
|
class: "submit-btn",
|
|
711
711
|
onClick: e
|
|
712
712
|
}, " Apply ")
|
|
@@ -715,14 +715,14 @@ const x = (t) => {
|
|
|
715
715
|
}
|
|
716
716
|
}, so = /* @__PURE__ */ q(io, [["__scopeId", "data-v-af870fbd"]]), ae = (t) => {
|
|
717
717
|
t.expand.value = !1;
|
|
718
|
-
}, lo = (t,
|
|
719
|
-
const i =
|
|
718
|
+
}, lo = (t, r = !1, o, n, e) => {
|
|
719
|
+
const i = _({
|
|
720
720
|
type: "button",
|
|
721
721
|
name: "bold",
|
|
722
722
|
command: "toggleBold",
|
|
723
723
|
icon: e.bold,
|
|
724
724
|
tooltip: "Bold"
|
|
725
|
-
}),
|
|
725
|
+
}), c = _({
|
|
726
726
|
type: "dropdown",
|
|
727
727
|
name: "fontFamily",
|
|
728
728
|
tooltip: "Font",
|
|
@@ -769,11 +769,11 @@ const x = (t) => {
|
|
|
769
769
|
}
|
|
770
770
|
}
|
|
771
771
|
],
|
|
772
|
-
onActivate: ({ fontFamily:
|
|
773
|
-
|
|
772
|
+
onActivate: ({ fontFamily: u }) => {
|
|
773
|
+
u && (c.label.value = u);
|
|
774
774
|
},
|
|
775
|
-
onDeactivate: () =>
|
|
776
|
-
}), a =
|
|
775
|
+
onDeactivate: () => c.label.value = c.defaultLabel.value
|
|
776
|
+
}), a = _({
|
|
777
777
|
type: "dropdown",
|
|
778
778
|
dropdownStyles: {
|
|
779
779
|
padding: 0,
|
|
@@ -791,10 +791,10 @@ const x = (t) => {
|
|
|
791
791
|
type: "render",
|
|
792
792
|
key: "ai",
|
|
793
793
|
render: () => {
|
|
794
|
-
let
|
|
794
|
+
let u = "";
|
|
795
795
|
if (t.activeEditor) {
|
|
796
796
|
const { state: A } = t.activeEditor, { from: W, to: le, empty: gt } = A.selection;
|
|
797
|
-
|
|
797
|
+
u = gt ? "" : A.doc.textBetween(W, le);
|
|
798
798
|
}
|
|
799
799
|
return B(
|
|
800
800
|
"div",
|
|
@@ -804,7 +804,7 @@ const x = (t) => {
|
|
|
804
804
|
handleClose: () => {
|
|
805
805
|
ae(a);
|
|
806
806
|
},
|
|
807
|
-
selectedText:
|
|
807
|
+
selectedText: u,
|
|
808
808
|
editor: t.activeEditor,
|
|
809
809
|
apiKey: t.config.aiApiKey,
|
|
810
810
|
endpoint: t.config.aiEndpoint,
|
|
@@ -815,7 +815,7 @@ const x = (t) => {
|
|
|
815
815
|
}
|
|
816
816
|
}
|
|
817
817
|
]
|
|
818
|
-
}),
|
|
818
|
+
}), l = _({
|
|
819
819
|
type: "dropdown",
|
|
820
820
|
name: "fontSize",
|
|
821
821
|
defaultLabel: "12",
|
|
@@ -846,29 +846,29 @@ const x = (t) => {
|
|
|
846
846
|
{ label: "72", key: "72pt" },
|
|
847
847
|
{ label: "96", key: "96pt" }
|
|
848
848
|
],
|
|
849
|
-
onActivate: ({ fontSize:
|
|
850
|
-
if (!
|
|
851
|
-
let
|
|
852
|
-
|
|
849
|
+
onActivate: ({ fontSize: u }) => {
|
|
850
|
+
if (!u) return l.label.value = l.defaultLabel.value;
|
|
851
|
+
let S = Wt(u, 12);
|
|
852
|
+
S < 8 && (S = 8), S > 96 && (S = 96), l.label.value = String(S);
|
|
853
853
|
},
|
|
854
|
-
onDeactivate: () =>
|
|
855
|
-
}),
|
|
854
|
+
onDeactivate: () => l.label.value = l.defaultLabel.value
|
|
855
|
+
}), d = _({
|
|
856
856
|
type: "separator",
|
|
857
857
|
name: "separator",
|
|
858
858
|
isNarrow: !0
|
|
859
|
-
}),
|
|
859
|
+
}), m = _({
|
|
860
860
|
type: "button",
|
|
861
861
|
name: "italic",
|
|
862
862
|
command: "toggleItalic",
|
|
863
863
|
icon: e.italic,
|
|
864
864
|
tooltip: "Italic"
|
|
865
|
-
}),
|
|
865
|
+
}), s = _({
|
|
866
866
|
type: "button",
|
|
867
867
|
name: "underline",
|
|
868
868
|
command: "toggleUnderline",
|
|
869
869
|
icon: e.underline,
|
|
870
870
|
tooltip: "Underline"
|
|
871
|
-
}), b =
|
|
871
|
+
}), b = _({
|
|
872
872
|
type: "dropdown",
|
|
873
873
|
name: "highlight",
|
|
874
874
|
icon: e.highlight,
|
|
@@ -886,11 +886,11 @@ const x = (t) => {
|
|
|
886
886
|
render: () => Ve(t, b, [], !0)
|
|
887
887
|
}
|
|
888
888
|
],
|
|
889
|
-
onActivate: ({ color:
|
|
890
|
-
b.iconColor.value =
|
|
889
|
+
onActivate: ({ color: u }) => {
|
|
890
|
+
b.iconColor.value = u || "";
|
|
891
891
|
},
|
|
892
892
|
onDeactivate: () => b.iconColor.value = ""
|
|
893
|
-
}), v =
|
|
893
|
+
}), v = _({
|
|
894
894
|
type: "dropdown",
|
|
895
895
|
name: "color",
|
|
896
896
|
icon: e.color,
|
|
@@ -907,11 +907,11 @@ const x = (t) => {
|
|
|
907
907
|
render: () => Ve(t, v)
|
|
908
908
|
}
|
|
909
909
|
],
|
|
910
|
-
onActivate: ({ color:
|
|
911
|
-
v.iconColor.value =
|
|
910
|
+
onActivate: ({ color: u }) => {
|
|
911
|
+
v.iconColor.value = u;
|
|
912
912
|
},
|
|
913
913
|
onDeactivate: () => v.iconColor.value = "#000"
|
|
914
|
-
}), y = f(null),
|
|
914
|
+
}), y = f(null), E = _({
|
|
915
915
|
type: "dropdown",
|
|
916
916
|
name: "search",
|
|
917
917
|
icon: e.search,
|
|
@@ -927,12 +927,12 @@ const x = (t) => {
|
|
|
927
927
|
]
|
|
928
928
|
}), g = () => B("div", {}, [
|
|
929
929
|
B(so, {
|
|
930
|
-
onSubmit: ({ value:
|
|
931
|
-
t.activeEditor.commands.search(
|
|
930
|
+
onSubmit: ({ value: S }) => {
|
|
931
|
+
t.activeEditor.commands.search(S);
|
|
932
932
|
},
|
|
933
933
|
searchRef: y
|
|
934
934
|
})
|
|
935
|
-
]), F =
|
|
935
|
+
]), F = _({
|
|
936
936
|
type: "dropdown",
|
|
937
937
|
name: "link",
|
|
938
938
|
markName: "link",
|
|
@@ -945,44 +945,44 @@ const x = (t) => {
|
|
|
945
945
|
render: () => $(F)
|
|
946
946
|
}
|
|
947
947
|
],
|
|
948
|
-
onActivate: ({ href:
|
|
949
|
-
|
|
948
|
+
onActivate: ({ href: u }) => {
|
|
949
|
+
u ? F.attributes.value = { href: u } : F.attributes.value = {}, F.expand.value = !0;
|
|
950
950
|
},
|
|
951
951
|
onDeactivate: () => {
|
|
952
952
|
F.attributes.value = {}, F.expand.value = !1;
|
|
953
953
|
}
|
|
954
954
|
});
|
|
955
|
-
function $(
|
|
955
|
+
function $(u) {
|
|
956
956
|
return B("div", {}, [
|
|
957
957
|
B(vn, {
|
|
958
958
|
onSubmit: ({ href: A }) => {
|
|
959
|
-
ae(
|
|
960
|
-
const W = { ...
|
|
961
|
-
t.emitCommand({ item: W, argument: { href: A, text: "" } }), A || (
|
|
959
|
+
ae(u), u.attributes.value.link = { href: A };
|
|
960
|
+
const W = { ...u, command: "toggleLink" };
|
|
961
|
+
t.emitCommand({ item: W, argument: { href: A, text: "" } }), A || (u.active.value = !1);
|
|
962
962
|
},
|
|
963
|
-
href:
|
|
963
|
+
href: u.attributes.value.href,
|
|
964
964
|
goToAnchor: () => {
|
|
965
|
-
if (ae(
|
|
966
|
-
const A =
|
|
965
|
+
if (ae(u), !t.activeEditor || !u.attributes.value?.href) return;
|
|
966
|
+
const A = u.attributes.value?.href?.slice(1), le = t.activeEditor.element.querySelector(`a[name='${A}']`);
|
|
967
967
|
le && Kt(le);
|
|
968
968
|
}
|
|
969
969
|
})
|
|
970
970
|
]);
|
|
971
971
|
}
|
|
972
|
-
const p =
|
|
972
|
+
const p = _({
|
|
973
973
|
type: "options",
|
|
974
974
|
name: "linkInput",
|
|
975
975
|
command: "toggleLink"
|
|
976
976
|
});
|
|
977
977
|
F.childItem = p, p.parentItem = F;
|
|
978
|
-
const
|
|
978
|
+
const x = _({
|
|
979
979
|
type: "button",
|
|
980
980
|
name: "image",
|
|
981
981
|
command: "startImageUpload",
|
|
982
982
|
icon: e.image,
|
|
983
983
|
tooltip: "Image",
|
|
984
984
|
disabled: !1
|
|
985
|
-
}), T =
|
|
985
|
+
}), T = _({
|
|
986
986
|
type: "dropdown",
|
|
987
987
|
name: "table",
|
|
988
988
|
icon: e.table,
|
|
@@ -999,16 +999,16 @@ const x = (t) => {
|
|
|
999
999
|
}
|
|
1000
1000
|
]
|
|
1001
1001
|
});
|
|
1002
|
-
function N(
|
|
1002
|
+
function N(u) {
|
|
1003
1003
|
return B("div", {}, [
|
|
1004
1004
|
B(qn, {
|
|
1005
1005
|
onSelect: (A) => {
|
|
1006
|
-
t.emitCommand({ item:
|
|
1006
|
+
t.emitCommand({ item: u, argument: A }), ae(u);
|
|
1007
1007
|
}
|
|
1008
1008
|
})
|
|
1009
1009
|
]);
|
|
1010
1010
|
}
|
|
1011
|
-
const V =
|
|
1011
|
+
const V = _({
|
|
1012
1012
|
type: "dropdown",
|
|
1013
1013
|
name: "tableActions",
|
|
1014
1014
|
command: "executeTableCommand",
|
|
@@ -1080,17 +1080,17 @@ const x = (t) => {
|
|
|
1080
1080
|
icon: e.fixTables
|
|
1081
1081
|
}
|
|
1082
1082
|
];
|
|
1083
|
-
function ye(
|
|
1083
|
+
function ye(u) {
|
|
1084
1084
|
return B(Qn, {
|
|
1085
1085
|
options: te,
|
|
1086
|
-
onSelect: (
|
|
1087
|
-
ae(
|
|
1088
|
-
const { command: A } =
|
|
1089
|
-
t.emitCommand({ item:
|
|
1086
|
+
onSelect: (S) => {
|
|
1087
|
+
ae(u);
|
|
1088
|
+
const { command: A } = S;
|
|
1089
|
+
t.emitCommand({ item: u, argument: { command: A } });
|
|
1090
1090
|
}
|
|
1091
1091
|
});
|
|
1092
1092
|
}
|
|
1093
|
-
const Z =
|
|
1093
|
+
const Z = _({
|
|
1094
1094
|
type: "dropdown",
|
|
1095
1095
|
name: "textAlign",
|
|
1096
1096
|
tooltip: "Alignment",
|
|
@@ -1105,63 +1105,63 @@ const x = (t) => {
|
|
|
1105
1105
|
type: "render",
|
|
1106
1106
|
render: () => B("div", {}, [
|
|
1107
1107
|
B(tn, {
|
|
1108
|
-
onSelect: (
|
|
1108
|
+
onSelect: (S) => {
|
|
1109
1109
|
ae(Z);
|
|
1110
1110
|
const A = { ...Z, command: "setTextAlign" };
|
|
1111
|
-
A.command = "setTextAlign", t.emitCommand({ item: A, argument:
|
|
1111
|
+
A.command = "setTextAlign", t.emitCommand({ item: A, argument: S }), re(Z, S);
|
|
1112
1112
|
}
|
|
1113
1113
|
})
|
|
1114
1114
|
]),
|
|
1115
1115
|
key: "alignment"
|
|
1116
1116
|
}
|
|
1117
1117
|
],
|
|
1118
|
-
onActivate: ({ textAlign:
|
|
1119
|
-
re(Z,
|
|
1118
|
+
onActivate: ({ textAlign: u }) => {
|
|
1119
|
+
re(Z, u);
|
|
1120
1120
|
},
|
|
1121
1121
|
onDeactivate: () => {
|
|
1122
1122
|
re(Z, "left");
|
|
1123
1123
|
}
|
|
1124
|
-
}), re = (
|
|
1125
|
-
let A =
|
|
1124
|
+
}), re = (u, S) => {
|
|
1125
|
+
let A = S === "both" ? "justify" : S, W = {
|
|
1126
1126
|
left: e.alignLeft,
|
|
1127
1127
|
right: e.alignRight,
|
|
1128
1128
|
center: e.alignCenter,
|
|
1129
1129
|
justify: e.alignJustify
|
|
1130
1130
|
}, le = W[A] ?? W.left;
|
|
1131
|
-
|
|
1132
|
-
}, be =
|
|
1131
|
+
u.icon.value = le;
|
|
1132
|
+
}, be = _({
|
|
1133
1133
|
type: "button",
|
|
1134
1134
|
name: "list",
|
|
1135
1135
|
command: "toggleBulletList",
|
|
1136
1136
|
icon: e.bulletList,
|
|
1137
1137
|
tooltip: "Bullet list"
|
|
1138
|
-
}), I =
|
|
1138
|
+
}), I = _({
|
|
1139
1139
|
type: "button",
|
|
1140
1140
|
name: "numberedlist",
|
|
1141
1141
|
command: "toggleOrderedList",
|
|
1142
1142
|
icon: e.numberedList,
|
|
1143
1143
|
tooltip: "Numbered list"
|
|
1144
|
-
}), M =
|
|
1144
|
+
}), M = _({
|
|
1145
1145
|
type: "button",
|
|
1146
1146
|
name: "indentleft",
|
|
1147
1147
|
command: "decreaseTextIndent",
|
|
1148
1148
|
icon: e.indentLeft,
|
|
1149
1149
|
tooltip: "Left indent",
|
|
1150
1150
|
disabled: !1
|
|
1151
|
-
}), H =
|
|
1151
|
+
}), H = _({
|
|
1152
1152
|
type: "button",
|
|
1153
1153
|
name: "indentright",
|
|
1154
1154
|
command: "increaseTextIndent",
|
|
1155
1155
|
icon: e.indentRight,
|
|
1156
1156
|
tooltip: "Right indent",
|
|
1157
1157
|
disabled: !1
|
|
1158
|
-
}), R =
|
|
1158
|
+
}), R = _({
|
|
1159
1159
|
type: "overflow",
|
|
1160
1160
|
name: "overflow",
|
|
1161
1161
|
command: "toggleOverflow",
|
|
1162
1162
|
icon: e.overflow,
|
|
1163
1163
|
disabled: !1
|
|
1164
|
-
}), G =
|
|
1164
|
+
}), G = _({
|
|
1165
1165
|
type: "dropdown",
|
|
1166
1166
|
name: "zoom",
|
|
1167
1167
|
allowWithoutEditor: !0,
|
|
@@ -1182,10 +1182,10 @@ const x = (t) => {
|
|
|
1182
1182
|
{ label: "150%", key: 1.5 },
|
|
1183
1183
|
{ label: "200%", key: 2 }
|
|
1184
1184
|
],
|
|
1185
|
-
onActivate: ({ zoom:
|
|
1186
|
-
|
|
1185
|
+
onActivate: ({ zoom: u }) => {
|
|
1186
|
+
u && (G.label.value = u);
|
|
1187
1187
|
}
|
|
1188
|
-
}), K =
|
|
1188
|
+
}), K = _({
|
|
1189
1189
|
type: "button",
|
|
1190
1190
|
name: "undo",
|
|
1191
1191
|
disabled: !0,
|
|
@@ -1196,7 +1196,7 @@ const x = (t) => {
|
|
|
1196
1196
|
onDeactivate: () => {
|
|
1197
1197
|
K.disabled.value = !t.undoDepth;
|
|
1198
1198
|
}
|
|
1199
|
-
}), ce =
|
|
1199
|
+
}), ce = _({
|
|
1200
1200
|
type: "button",
|
|
1201
1201
|
disabled: !0,
|
|
1202
1202
|
name: "redo",
|
|
@@ -1207,7 +1207,7 @@ const x = (t) => {
|
|
|
1207
1207
|
onDeactivate: () => {
|
|
1208
1208
|
ce.disabled.value = !t.redoDepth;
|
|
1209
1209
|
}
|
|
1210
|
-
}), ue =
|
|
1210
|
+
}), ue = _({
|
|
1211
1211
|
type: "button",
|
|
1212
1212
|
disabled: !1,
|
|
1213
1213
|
name: "toggleTrackChanges",
|
|
@@ -1215,7 +1215,7 @@ const x = (t) => {
|
|
|
1215
1215
|
command: "toggleTrackChanges",
|
|
1216
1216
|
icon: e.trackChanges,
|
|
1217
1217
|
group: "left"
|
|
1218
|
-
}), _e =
|
|
1218
|
+
}), _e = _({
|
|
1219
1219
|
type: "button",
|
|
1220
1220
|
disabled: !1,
|
|
1221
1221
|
name: "acceptTrackedChangeBySelection",
|
|
@@ -1223,7 +1223,7 @@ const x = (t) => {
|
|
|
1223
1223
|
command: "acceptTrackedChangeBySelection",
|
|
1224
1224
|
icon: e.trackChangesAccept,
|
|
1225
1225
|
group: "left"
|
|
1226
|
-
}), xe =
|
|
1226
|
+
}), xe = _({
|
|
1227
1227
|
type: "button",
|
|
1228
1228
|
disabled: !1,
|
|
1229
1229
|
name: "rejectTrackedChangeOnSelection",
|
|
@@ -1231,7 +1231,7 @@ const x = (t) => {
|
|
|
1231
1231
|
command: "rejectTrackedChangeOnSelection",
|
|
1232
1232
|
icon: e.trackChangesReject,
|
|
1233
1233
|
group: "left"
|
|
1234
|
-
}),
|
|
1234
|
+
}), Ee = _({
|
|
1235
1235
|
type: "button",
|
|
1236
1236
|
disabled: !1,
|
|
1237
1237
|
name: "toggleTrackChangesShowOriginal",
|
|
@@ -1239,7 +1239,7 @@ const x = (t) => {
|
|
|
1239
1239
|
command: "toggleTrackChangesShowOriginal",
|
|
1240
1240
|
icon: e.trackChangesOriginal,
|
|
1241
1241
|
group: "left"
|
|
1242
|
-
}), Fe =
|
|
1242
|
+
}), Fe = _({
|
|
1243
1243
|
type: "button",
|
|
1244
1244
|
disabled: !1,
|
|
1245
1245
|
name: "toggleTrackChangesShowFinal",
|
|
@@ -1247,7 +1247,7 @@ const x = (t) => {
|
|
|
1247
1247
|
command: "toggleTrackChangesShowFinal",
|
|
1248
1248
|
icon: e.trackChangesFinal,
|
|
1249
1249
|
group: "left"
|
|
1250
|
-
}), Ie =
|
|
1250
|
+
}), Ie = _({
|
|
1251
1251
|
type: "button",
|
|
1252
1252
|
name: "clearFormatting",
|
|
1253
1253
|
command: "clearFormat",
|
|
@@ -1256,20 +1256,20 @@ const x = (t) => {
|
|
|
1256
1256
|
});
|
|
1257
1257
|
[
|
|
1258
1258
|
i,
|
|
1259
|
-
|
|
1260
|
-
|
|
1259
|
+
m,
|
|
1260
|
+
s,
|
|
1261
1261
|
H,
|
|
1262
1262
|
M,
|
|
1263
|
-
|
|
1263
|
+
E,
|
|
1264
1264
|
R
|
|
1265
|
-
].map((
|
|
1266
|
-
const Le =
|
|
1265
|
+
].map((u) => u.name);
|
|
1266
|
+
const Le = _({
|
|
1267
1267
|
type: "button",
|
|
1268
1268
|
name: "copyFormat",
|
|
1269
1269
|
tooltip: "Format painter",
|
|
1270
1270
|
icon: e.copyFormat,
|
|
1271
1271
|
command: "copyFormat"
|
|
1272
|
-
}), Me = (
|
|
1272
|
+
}), Me = (u, S) => u === "editor" ? S : u === "suggester" ? S.filter((A) => A.value === "suggesting") : S.filter((A) => A.value === "viewing"), we = (u) => u === "editor" ? "Editing" : u === "suggester" ? "Suggesting" : "Viewing", ne = _({
|
|
1273
1273
|
type: "dropdown",
|
|
1274
1274
|
name: "documentMode",
|
|
1275
1275
|
command: "setDocumentMode",
|
|
@@ -1314,18 +1314,18 @@ const x = (t) => {
|
|
|
1314
1314
|
description: "View clean version of document only"
|
|
1315
1315
|
}
|
|
1316
1316
|
];
|
|
1317
|
-
function me(
|
|
1318
|
-
const
|
|
1319
|
-
return B(
|
|
1320
|
-
options:
|
|
1317
|
+
function me(u) {
|
|
1318
|
+
const S = Me(n, De);
|
|
1319
|
+
return B(En, {
|
|
1320
|
+
options: S,
|
|
1321
1321
|
onSelect: (A) => {
|
|
1322
|
-
ae(
|
|
1322
|
+
ae(u);
|
|
1323
1323
|
const { label: W, icon: le } = A;
|
|
1324
1324
|
ne.label.value = W, ne.icon.value = le, t.emitCommand({ item: ne, argument: W });
|
|
1325
1325
|
}
|
|
1326
1326
|
});
|
|
1327
1327
|
}
|
|
1328
|
-
const se =
|
|
1328
|
+
const se = _({
|
|
1329
1329
|
type: "button",
|
|
1330
1330
|
name: "pageBreakTool",
|
|
1331
1331
|
command: "insertPageBreak",
|
|
@@ -1341,13 +1341,13 @@ const x = (t) => {
|
|
|
1341
1341
|
["documentMode", 47],
|
|
1342
1342
|
["ai", 32],
|
|
1343
1343
|
["default", 32]
|
|
1344
|
-
]), dt =
|
|
1344
|
+
]), dt = _({
|
|
1345
1345
|
type: "button",
|
|
1346
1346
|
name: "ruler",
|
|
1347
1347
|
command: "toggleRuler",
|
|
1348
1348
|
icon: e.ruler,
|
|
1349
1349
|
tooltip: "Show or hide ruler"
|
|
1350
|
-
}),
|
|
1350
|
+
}), Ce = _({
|
|
1351
1351
|
type: "dropdown",
|
|
1352
1352
|
name: "linkedStyles",
|
|
1353
1353
|
command: "setLinkedStyle",
|
|
@@ -1367,30 +1367,30 @@ const x = (t) => {
|
|
|
1367
1367
|
type: "render",
|
|
1368
1368
|
key: "linkedStyle",
|
|
1369
1369
|
render: () => {
|
|
1370
|
-
const
|
|
1371
|
-
ae(
|
|
1372
|
-
const A = { ...
|
|
1373
|
-
t.emitCommand({ item: A, argument:
|
|
1370
|
+
const u = (S) => {
|
|
1371
|
+
ae(Ce);
|
|
1372
|
+
const A = { ...Ce, command: "setLinkedStyle" };
|
|
1373
|
+
t.emitCommand({ item: A, argument: S });
|
|
1374
1374
|
};
|
|
1375
1375
|
return B("div", {}, [
|
|
1376
1376
|
B(Fn, {
|
|
1377
1377
|
editor: t.activeEditor,
|
|
1378
|
-
onSelect:
|
|
1378
|
+
onSelect: u
|
|
1379
1379
|
})
|
|
1380
1380
|
]);
|
|
1381
1381
|
}
|
|
1382
1382
|
}
|
|
1383
1383
|
],
|
|
1384
1384
|
onActivate: () => {
|
|
1385
|
-
|
|
1385
|
+
Ce.disabled.value = !1;
|
|
1386
1386
|
},
|
|
1387
1387
|
onDeactivate: () => {
|
|
1388
|
-
|
|
1388
|
+
Ce.disabled.value = !0;
|
|
1389
1389
|
}
|
|
1390
|
-
}), he = (
|
|
1391
|
-
if (
|
|
1390
|
+
}), he = (u, S) => {
|
|
1391
|
+
if (S.value.toString() === u)
|
|
1392
1392
|
return B("div", { innerHTML: eo, class: "dropdown-select-icon" });
|
|
1393
|
-
}, de =
|
|
1393
|
+
}, de = _({
|
|
1394
1394
|
type: "dropdown",
|
|
1395
1395
|
name: "lineHeight",
|
|
1396
1396
|
tooltip: "Line height",
|
|
@@ -1426,30 +1426,30 @@ const x = (t) => {
|
|
|
1426
1426
|
// toggleTrackChangesOriginal,
|
|
1427
1427
|
// toggleTrackChangesFinal,
|
|
1428
1428
|
G,
|
|
1429
|
-
r,
|
|
1430
|
-
c,
|
|
1431
|
-
s,
|
|
1432
1429
|
c,
|
|
1433
|
-
i,
|
|
1434
1430
|
d,
|
|
1435
|
-
|
|
1431
|
+
l,
|
|
1432
|
+
d,
|
|
1433
|
+
i,
|
|
1434
|
+
m,
|
|
1435
|
+
s,
|
|
1436
1436
|
v,
|
|
1437
1437
|
b,
|
|
1438
|
-
|
|
1438
|
+
d,
|
|
1439
1439
|
F,
|
|
1440
|
-
|
|
1440
|
+
x,
|
|
1441
1441
|
T,
|
|
1442
1442
|
V,
|
|
1443
|
-
|
|
1443
|
+
d,
|
|
1444
1444
|
Z,
|
|
1445
1445
|
be,
|
|
1446
1446
|
I,
|
|
1447
1447
|
M,
|
|
1448
1448
|
H,
|
|
1449
1449
|
de,
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1450
|
+
d,
|
|
1451
|
+
Ce,
|
|
1452
|
+
d,
|
|
1453
1453
|
dt,
|
|
1454
1454
|
se,
|
|
1455
1455
|
Le,
|
|
@@ -1458,124 +1458,133 @@ const x = (t) => {
|
|
|
1458
1458
|
R,
|
|
1459
1459
|
ne
|
|
1460
1460
|
];
|
|
1461
|
-
if (t.config?.superdoc?.config?.modules?.ai || (O = O.filter((
|
|
1462
|
-
const
|
|
1463
|
-
O.splice(
|
|
1464
|
-
const
|
|
1465
|
-
O = O.filter((A) => !
|
|
1461
|
+
if (t.config?.superdoc?.config?.modules?.ai || (O = O.filter((u) => u.name.value !== "ai")), o <= $e.md && (O = O.filter((u) => u.type !== "separator")), t.config.pagination || (O = O.filter((u) => u.name.value !== "pageBreakTool")), t.config.mode !== "docx") {
|
|
1462
|
+
const u = O.findIndex((A) => A.name.value === "linkedStyles");
|
|
1463
|
+
O.splice(u - 1, 2);
|
|
1464
|
+
const S = ["ruler", "zoom", "undo", "redo"];
|
|
1465
|
+
O = O.filter((A) => !S.includes(A.name.value));
|
|
1466
1466
|
}
|
|
1467
|
-
const je = [ue,
|
|
1468
|
-
|
|
1469
|
-
const ft = [
|
|
1467
|
+
const je = [ue, Ee, Fe];
|
|
1468
|
+
r || (n === "viewer" && je.push(_e, xe), O = O.filter((u) => !je.includes(u)));
|
|
1469
|
+
const ft = [E, K, R, ne].map((u) => u.name), vt = (u) => ft.includes(u.name), Se = [], He = [];
|
|
1470
1470
|
let Be = mt + ut;
|
|
1471
|
-
return O.forEach((
|
|
1472
|
-
const
|
|
1473
|
-
if (o < $e.xl && pt.includes(
|
|
1474
|
-
if (
|
|
1471
|
+
return O.forEach((u) => {
|
|
1472
|
+
const S = pe.get(u.name.value) || pe.get("default");
|
|
1473
|
+
if (o < $e.xl && pt.includes(u.name.value)) {
|
|
1474
|
+
if (Se.push(u), u.name.value === "linkedStyles") {
|
|
1475
1475
|
const A = O.findIndex((W) => W.name.value === "linkedStyles");
|
|
1476
1476
|
O.splice(A + 1, 1);
|
|
1477
1477
|
}
|
|
1478
1478
|
return;
|
|
1479
1479
|
}
|
|
1480
|
-
if (o < $e.sm && ht.includes(
|
|
1481
|
-
|
|
1480
|
+
if (o < $e.sm && ht.includes(u.name.value)) {
|
|
1481
|
+
Se.push(u);
|
|
1482
1482
|
return;
|
|
1483
1483
|
}
|
|
1484
|
-
if (vt(
|
|
1485
|
-
He.push(
|
|
1484
|
+
if (vt(u)) {
|
|
1485
|
+
He.push(u), Be += S;
|
|
1486
1486
|
return;
|
|
1487
1487
|
}
|
|
1488
|
-
Be < o ? (He.push(
|
|
1488
|
+
Be < o ? (He.push(u), Be += S) : Se.push(u);
|
|
1489
1489
|
}), {
|
|
1490
1490
|
defaultItems: He,
|
|
1491
|
-
overflowItems:
|
|
1491
|
+
overflowItems: Se.filter((u) => u.type !== "separator")
|
|
1492
1492
|
};
|
|
1493
1493
|
}, ao = [".jpg", ".jpeg", ".png", "image/jpeg", "image/png"], ro = () => {
|
|
1494
1494
|
let t = document.createElement("input");
|
|
1495
1495
|
t.type = "file";
|
|
1496
|
-
let
|
|
1497
|
-
return t.accept =
|
|
1496
|
+
let r = ao;
|
|
1497
|
+
return t.accept = r.join(","), () => new Promise((n, e) => {
|
|
1498
1498
|
t.onchange = async () => {
|
|
1499
1499
|
const i = t.files;
|
|
1500
1500
|
if (!i) return n(null);
|
|
1501
|
-
const
|
|
1502
|
-
return n(
|
|
1501
|
+
const c = i.item(0);
|
|
1502
|
+
return n(c ? { file: c } : null);
|
|
1503
1503
|
}, t.oncancel = () => n(null), t.onerror = e, t.click();
|
|
1504
1504
|
});
|
|
1505
|
-
}, co = (t) => new Promise((
|
|
1505
|
+
}, co = (t) => new Promise((r, o) => {
|
|
1506
1506
|
let n = new FileReader();
|
|
1507
|
-
n.onload = (e) =>
|
|
1508
|
-
}), uo = (t,
|
|
1507
|
+
n.onload = (e) => r(e.target.result), n.onerror = o, setTimeout(() => n.readAsDataURL(t), 250);
|
|
1508
|
+
}), uo = (t, r) => new Promise((o, n) => {
|
|
1509
1509
|
const e = new window.Image();
|
|
1510
1510
|
e.onload = () => {
|
|
1511
|
-
const i = document.createElement("canvas"), { width:
|
|
1511
|
+
const i = document.createElement("canvas"), { width: c, height: a } = mo(
|
|
1512
1512
|
e.width,
|
|
1513
1513
|
e.height,
|
|
1514
|
-
|
|
1514
|
+
r
|
|
1515
1515
|
);
|
|
1516
|
-
if (i.width =
|
|
1517
|
-
const
|
|
1518
|
-
o(
|
|
1516
|
+
if (i.width = c, i.height = a, i.getContext("2d").drawImage(e, 0, 0, c, a), typeof t == "string") {
|
|
1517
|
+
const d = i.toDataURL();
|
|
1518
|
+
o(d);
|
|
1519
1519
|
} else
|
|
1520
|
-
i.toBlob((
|
|
1521
|
-
const
|
|
1520
|
+
i.toBlob((d) => {
|
|
1521
|
+
const m = new File([d], t.name, {
|
|
1522
1522
|
type: t.type,
|
|
1523
1523
|
lastModified: Date.now()
|
|
1524
1524
|
});
|
|
1525
|
-
o({ file:
|
|
1525
|
+
o({ file: m, width: c, height: a });
|
|
1526
1526
|
});
|
|
1527
1527
|
}, e.onerror = (i) => n(i), e.src = typeof t == "string" ? t : URL.createObjectURL(t);
|
|
1528
|
-
}), mo = (t,
|
|
1528
|
+
}), mo = (t, r, o) => {
|
|
1529
1529
|
const { width: n, height: e } = o.getMaxContentSize();
|
|
1530
|
-
if (!n || !e) return { width: t, height:
|
|
1531
|
-
let i = t,
|
|
1532
|
-
const a = t /
|
|
1533
|
-
return
|
|
1534
|
-
}, po = async ({ editor: t, view:
|
|
1530
|
+
if (!n || !e) return { width: t, height: r };
|
|
1531
|
+
let i = t, c = r;
|
|
1532
|
+
const a = t / r;
|
|
1533
|
+
return r > e && (c = e, i = Math.round(e * a)), i > n && (i = n, c = Math.round(n / a)), { width: i, height: c };
|
|
1534
|
+
}, po = async ({ editor: t, view: r, file: o }) => {
|
|
1535
1535
|
let n = typeof t.options.handleImageUpload == "function" ? t.options.handleImageUpload : co;
|
|
1536
1536
|
if ((o.size / (1024 * 1024)).toFixed(4) > 5) {
|
|
1537
1537
|
window.alert("Image size must be less than 5MB");
|
|
1538
1538
|
return;
|
|
1539
1539
|
}
|
|
1540
|
-
let i,
|
|
1540
|
+
let i, c;
|
|
1541
1541
|
try {
|
|
1542
|
-
const
|
|
1543
|
-
i =
|
|
1544
|
-
} catch (
|
|
1545
|
-
console.warn("Error processing image:",
|
|
1542
|
+
const s = await uo(o, t);
|
|
1543
|
+
i = s.width, c = s.height, o = s.file;
|
|
1544
|
+
} catch (s) {
|
|
1545
|
+
console.warn("Error processing image:", s);
|
|
1546
1546
|
return;
|
|
1547
1547
|
}
|
|
1548
|
-
let a = {}, { tr:
|
|
1549
|
-
|
|
1550
|
-
let
|
|
1548
|
+
let a = {}, { tr: l, schema: d } = r.state;
|
|
1549
|
+
l.selection.empty || l.deleteSelection();
|
|
1550
|
+
let m = {
|
|
1551
1551
|
type: "add",
|
|
1552
|
-
pos:
|
|
1552
|
+
pos: l.selection.from,
|
|
1553
1553
|
id: a
|
|
1554
1554
|
};
|
|
1555
|
-
|
|
1556
|
-
(
|
|
1557
|
-
let b = o.name.replace(" ", "_"), v =
|
|
1555
|
+
l.setMeta(Ne, m), r.dispatch(l), n(o).then(
|
|
1556
|
+
(s) => {
|
|
1557
|
+
let b = o.name.replace(" ", "_"), v = Ct(r.state, a);
|
|
1558
1558
|
if (v == null)
|
|
1559
1559
|
return;
|
|
1560
|
-
let y = { type: "remove", id: a },
|
|
1561
|
-
src:
|
|
1562
|
-
size: { width: i, height:
|
|
1560
|
+
let y = { type: "remove", id: a }, E = `word/media/${b}`, g = d.nodes.image.create({
|
|
1561
|
+
src: E,
|
|
1562
|
+
size: { width: i, height: c }
|
|
1563
1563
|
});
|
|
1564
|
-
t.storage.image.media = Object.assign(t.storage.image.media, { [
|
|
1565
|
-
|
|
1564
|
+
t.storage.image.media = Object.assign(t.storage.image.media, { [E]: s }), t.options.ydoc && t.commands.addImageToCollaboration({ mediaPath: E, fileData: s }), r.dispatch(
|
|
1565
|
+
r.state.tr.replaceWith(v, v, g).setMeta(Ne, y)
|
|
1566
1566
|
);
|
|
1567
1567
|
},
|
|
1568
1568
|
() => {
|
|
1569
|
-
let
|
|
1570
|
-
|
|
1569
|
+
let s = { type: "remove", id: a };
|
|
1570
|
+
r.dispatch(l.setMeta(Ne, s));
|
|
1571
1571
|
}
|
|
1572
1572
|
);
|
|
1573
1573
|
};
|
|
1574
1574
|
var L, lt, ve, We, at, rt, Pe, ct, fe;
|
|
1575
1575
|
class Mo extends qt {
|
|
1576
|
+
/**
|
|
1577
|
+
* Creates a new SuperToolbar instance
|
|
1578
|
+
* @param {ToolbarConfig} config - The configuration for the toolbar
|
|
1579
|
+
* @returns {void}
|
|
1580
|
+
*/
|
|
1576
1581
|
constructor(o) {
|
|
1577
1582
|
super();
|
|
1578
1583
|
Oe(this, L);
|
|
1584
|
+
/**
|
|
1585
|
+
* Default configuration for the toolbar
|
|
1586
|
+
* @type {ToolbarConfig}
|
|
1587
|
+
*/
|
|
1579
1588
|
Re(this, "config", {
|
|
1580
1589
|
selector: null,
|
|
1581
1590
|
toolbarGroups: ["left", "center", "right"],
|
|
@@ -1587,91 +1596,216 @@ class Mo extends qt {
|
|
|
1587
1596
|
groups: null,
|
|
1588
1597
|
editor: null,
|
|
1589
1598
|
aiApiKey: null,
|
|
1590
|
-
aiEndpoint: null
|
|
1599
|
+
aiEndpoint: null,
|
|
1600
|
+
customButtons: []
|
|
1591
1601
|
});
|
|
1602
|
+
/**
|
|
1603
|
+
* Custom commands that override default behavior
|
|
1604
|
+
* @private
|
|
1605
|
+
* @type {Object.<string, function(CommandItem): void>}
|
|
1606
|
+
*/
|
|
1592
1607
|
Oe(this, ve, {
|
|
1608
|
+
/**
|
|
1609
|
+
* Handles zoom level changes
|
|
1610
|
+
* @param {Object} params - Command parameters
|
|
1611
|
+
* @param {CommandItem} params.item - The command item
|
|
1612
|
+
* @param {string|number} params.argument - The zoom level (percentage)
|
|
1613
|
+
* @returns {void}
|
|
1614
|
+
*/
|
|
1593
1615
|
setZoom: ({ item: o, argument: n }) => {
|
|
1594
1616
|
if (!n) return;
|
|
1595
1617
|
o.onActivate({ zoom: n }), this.emit("superdoc-command", { item: o, argument: n });
|
|
1596
1618
|
const e = document.querySelector(this.superdoc.config.selector)?.querySelector(".layers");
|
|
1597
1619
|
if (!e) return;
|
|
1598
|
-
const i = typeof screen.orientation < "u",
|
|
1599
|
-
i &&
|
|
1620
|
+
const i = typeof screen.orientation < "u", c = window.matchMedia("(max-width: 834px)").matches;
|
|
1621
|
+
i && c ? (e.style.transformOrigin = "0 0", e.style.transform = `scale(${parseInt(n) / 100})`) : e.style.zoom = parseInt(n) / 100, this.superdoc.superdocStore.activeZoom = parseInt(n);
|
|
1600
1622
|
},
|
|
1623
|
+
/**
|
|
1624
|
+
* Sets the document mode
|
|
1625
|
+
* @param {Object} params - Command parameters
|
|
1626
|
+
* @param {CommandItem} params.item - The command item
|
|
1627
|
+
* @param {string} params.argument - The document mode to set
|
|
1628
|
+
* @returns {void}
|
|
1629
|
+
*/
|
|
1601
1630
|
setDocumentMode: ({ item: o, argument: n }) => {
|
|
1602
1631
|
n && this.emit("superdoc-command", { item: o, argument: n });
|
|
1603
1632
|
},
|
|
1633
|
+
/**
|
|
1634
|
+
* Sets the font size for text
|
|
1635
|
+
* @param {Object} params - Command parameters
|
|
1636
|
+
* @param {CommandItem} params.item - The command item
|
|
1637
|
+
* @param {string|number} params.argument - The font size to set
|
|
1638
|
+
* @returns {void}
|
|
1639
|
+
*/
|
|
1604
1640
|
setFontSize: ({ item: o, argument: n }) => {
|
|
1605
1641
|
z(this, L, fe).call(this, { item: o, argument: n }, () => {
|
|
1606
1642
|
this.activeEditor?.commands.setFieldAnnotationsFontSize(n, !0);
|
|
1607
1643
|
});
|
|
1608
1644
|
},
|
|
1645
|
+
/**
|
|
1646
|
+
* Sets the font family for text
|
|
1647
|
+
* @param {Object} params - Command parameters
|
|
1648
|
+
* @param {CommandItem} params.item - The command item
|
|
1649
|
+
* @param {string} params.argument - The font family to set
|
|
1650
|
+
* @returns {void}
|
|
1651
|
+
*/
|
|
1609
1652
|
setFontFamily: ({ item: o, argument: n }) => {
|
|
1610
1653
|
z(this, L, fe).call(this, { item: o, argument: n }, () => {
|
|
1611
1654
|
this.activeEditor?.commands.setFieldAnnotationsFontFamily(n, !0);
|
|
1612
1655
|
});
|
|
1613
1656
|
},
|
|
1657
|
+
/**
|
|
1658
|
+
* Sets the text color
|
|
1659
|
+
* @param {Object} params - Command parameters
|
|
1660
|
+
* @param {CommandItem} params.item - The command item
|
|
1661
|
+
* @param {string} params.argument - The color to set
|
|
1662
|
+
* @returns {void}
|
|
1663
|
+
*/
|
|
1614
1664
|
setColor: ({ item: o, argument: n }) => {
|
|
1615
|
-
z(this, L, fe).call(this, { item: o, argument: n })
|
|
1665
|
+
z(this, L, fe).call(this, { item: o, argument: n }, () => {
|
|
1666
|
+
this.activeEditor?.commands.setFieldAnnotationsTextColor(n, !0);
|
|
1667
|
+
});
|
|
1616
1668
|
},
|
|
1669
|
+
/**
|
|
1670
|
+
* Sets the highlight color for text
|
|
1671
|
+
* @param {Object} params - Command parameters
|
|
1672
|
+
* @param {CommandItem} params.item - The command item
|
|
1673
|
+
* @param {string} params.argument - The highlight color to set
|
|
1674
|
+
* @returns {void}
|
|
1675
|
+
*/
|
|
1617
1676
|
setHighlight: ({ item: o, argument: n }) => {
|
|
1618
|
-
z(this, L, fe).call(this, { item: o, argument: n })
|
|
1677
|
+
z(this, L, fe).call(this, { item: o, argument: n, noArgumentCallback: !0 }, () => {
|
|
1678
|
+
let e = n !== "none" ? n : null;
|
|
1679
|
+
this.activeEditor?.commands.setFieldAnnotationsTextHighlight(e, !0), this.activeEditor?.commands.setCellBackground(e);
|
|
1680
|
+
});
|
|
1619
1681
|
},
|
|
1620
|
-
|
|
1682
|
+
/**
|
|
1683
|
+
* Toggles the ruler visibility
|
|
1684
|
+
* @param {Object} [_params=null] - Command parameters (not used)
|
|
1685
|
+
* @returns {void}
|
|
1686
|
+
*/
|
|
1687
|
+
toggleRuler: (o = null) => {
|
|
1621
1688
|
this.superdoc.toggleRuler();
|
|
1622
1689
|
},
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1690
|
+
/**
|
|
1691
|
+
* Initiates the image upload process
|
|
1692
|
+
* @async
|
|
1693
|
+
* @param {Object} [_params=null - Command parameters (not used)
|
|
1694
|
+
* @returns {Promise<void>}
|
|
1695
|
+
*/
|
|
1696
|
+
startImageUpload: async (o = null) => {
|
|
1697
|
+
let e = await ro()();
|
|
1698
|
+
e?.file && po({
|
|
1626
1699
|
editor: this.activeEditor,
|
|
1627
1700
|
view: this.activeEditor.view,
|
|
1628
|
-
file:
|
|
1701
|
+
file: e.file
|
|
1629
1702
|
});
|
|
1630
1703
|
},
|
|
1704
|
+
/**
|
|
1705
|
+
* Increases text indentation or list level
|
|
1706
|
+
* @param {Object} params - Command parameters
|
|
1707
|
+
* @param {CommandItem} params.item - The command item
|
|
1708
|
+
* @param {*} params.argument - Command arguments
|
|
1709
|
+
* @returns {void}
|
|
1710
|
+
*/
|
|
1631
1711
|
increaseTextIndent: ({ item: o, argument: n }) => {
|
|
1632
1712
|
let e = o.command, { state: i } = this.activeEditor;
|
|
1633
1713
|
if (Ge((a) => a.type.name === "listItem")(i.selection))
|
|
1634
1714
|
return this.activeEditor.commands.increaseListIndent();
|
|
1635
1715
|
e in this.activeEditor.commands && this.activeEditor.commands[e](n);
|
|
1636
1716
|
},
|
|
1717
|
+
/**
|
|
1718
|
+
* Decreases text indentation or list level
|
|
1719
|
+
* @param {Object} params - Command parameters
|
|
1720
|
+
* @param {CommandItem} params.item - The command item
|
|
1721
|
+
* @param {*} params.argument - Command arguments
|
|
1722
|
+
* @returns {boolean}
|
|
1723
|
+
*/
|
|
1637
1724
|
decreaseTextIndent: ({ item: o, argument: n }) => {
|
|
1638
1725
|
let e = o.command, { state: i } = this.activeEditor;
|
|
1639
1726
|
if (Ge((a) => a.type.name === "listItem")(i.selection))
|
|
1640
1727
|
return this.activeEditor.commands.decreaseListIndent();
|
|
1641
1728
|
e in this.activeEditor.commands && this.activeEditor.commands[e](n);
|
|
1642
1729
|
},
|
|
1730
|
+
/**
|
|
1731
|
+
* Toggles bold formatting for text
|
|
1732
|
+
* @param {Object} params - Command parameters
|
|
1733
|
+
* @param {CommandItem} params.item - The command item
|
|
1734
|
+
* @param {*} params.argument - Command arguments
|
|
1735
|
+
* @returns {void}
|
|
1736
|
+
*/
|
|
1643
1737
|
toggleBold: ({ item: o, argument: n }) => {
|
|
1644
1738
|
let e = o.command;
|
|
1645
1739
|
e in this.activeEditor.commands && (this.activeEditor.commands[e](n), this.activeEditor.commands.toggleFieldAnnotationsFormat("bold", !0)), this.updateToolbarState();
|
|
1646
1740
|
},
|
|
1741
|
+
/**
|
|
1742
|
+
* Toggles italic formatting for text
|
|
1743
|
+
* @param {Object} params - Command parameters
|
|
1744
|
+
* @param {CommandItem} params.item - The command item
|
|
1745
|
+
* @param {*} params.argument - Command arguments
|
|
1746
|
+
* @returns {void}
|
|
1747
|
+
*/
|
|
1647
1748
|
toggleItalic: ({ item: o, argument: n }) => {
|
|
1648
1749
|
let e = o.command;
|
|
1649
1750
|
e in this.activeEditor.commands && (this.activeEditor.commands[e](n), this.activeEditor.commands.toggleFieldAnnotationsFormat("italic", !0)), this.updateToolbarState();
|
|
1650
1751
|
},
|
|
1752
|
+
/**
|
|
1753
|
+
* Toggles underline formatting for text
|
|
1754
|
+
* @param {Object} params - Command parameters
|
|
1755
|
+
* @param {CommandItem} params.item - The command item
|
|
1756
|
+
* @param {*} params.argument - Command arguments
|
|
1757
|
+
* @returns {void}
|
|
1758
|
+
*/
|
|
1651
1759
|
toggleUnderline: ({ item: o, argument: n }) => {
|
|
1652
1760
|
let e = o.command;
|
|
1653
1761
|
e in this.activeEditor.commands && (this.activeEditor.commands[e](n), this.activeEditor.commands.toggleFieldAnnotationsFormat("underline", !0)), this.updateToolbarState();
|
|
1654
1762
|
},
|
|
1763
|
+
/**
|
|
1764
|
+
* Toggles link formatting and updates cursor position
|
|
1765
|
+
* @param {Object} params - Command parameters
|
|
1766
|
+
* @param {CommandItem} params.item - The command item
|
|
1767
|
+
* @param {*} params.argument - Command arguments
|
|
1768
|
+
* @returns {void}
|
|
1769
|
+
*/
|
|
1655
1770
|
toggleLink: ({ item: o, argument: n }) => {
|
|
1656
1771
|
let e = o.command;
|
|
1657
1772
|
if (e in this.activeEditor.commands) {
|
|
1658
1773
|
this.activeEditor.commands[e](n);
|
|
1659
|
-
const { view: i } = this.activeEditor,
|
|
1660
|
-
i.updateState(
|
|
1774
|
+
const { view: i } = this.activeEditor, c = i.state.selection.$to.pos, a = new Ye(i.state.doc.resolve(c)), l = i.state.tr.setSelection(a), d = i.state.apply(l);
|
|
1775
|
+
i.updateState(d), setTimeout(() => {
|
|
1661
1776
|
i.focus();
|
|
1662
1777
|
}, 100);
|
|
1663
1778
|
}
|
|
1664
1779
|
this.updateToolbarState();
|
|
1665
1780
|
},
|
|
1781
|
+
/**
|
|
1782
|
+
* Inserts a table into the document
|
|
1783
|
+
* @param {Object} params - Command parameters
|
|
1784
|
+
* @param {CommandItem} params.item - The command item
|
|
1785
|
+
* @param {Object} params.argument - Table configuration
|
|
1786
|
+
* @returns {void}
|
|
1787
|
+
*/
|
|
1666
1788
|
insertTable: ({ item: o, argument: n }) => {
|
|
1667
1789
|
z(this, L, fe).call(this, { item: o, argument: n });
|
|
1668
1790
|
},
|
|
1791
|
+
/**
|
|
1792
|
+
* Executes a table-related command
|
|
1793
|
+
* @param {Object} params - Command parameters
|
|
1794
|
+
* @param {CommandItem} params.item - The command item
|
|
1795
|
+
* @param {Object} params.argument - The table command and its parameters
|
|
1796
|
+
* @param {string} params.argument.command - The specific table command to execute
|
|
1797
|
+
* @returns {void}
|
|
1798
|
+
*/
|
|
1669
1799
|
executeTableCommand: ({ item: o, argument: n }) => {
|
|
1670
1800
|
if (!n) return;
|
|
1671
1801
|
let e = n.command;
|
|
1672
1802
|
e in this.activeEditor.commands && this.activeEditor.commands[e](n), this.updateToolbarState();
|
|
1673
1803
|
}
|
|
1674
1804
|
});
|
|
1805
|
+
/**
|
|
1806
|
+
* Handler for toolbar resize events
|
|
1807
|
+
* @returns {void}
|
|
1808
|
+
*/
|
|
1675
1809
|
Re(this, "onToolbarResize", () => {
|
|
1676
1810
|
z(this, L, We).call(this, this, this.config.icons, this.isDev), this.role === "viewer" && z(this, L, Pe).call(this);
|
|
1677
1811
|
});
|
|
@@ -1686,160 +1820,237 @@ class Mo extends qt {
|
|
|
1686
1820
|
}
|
|
1687
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();
|
|
1688
1822
|
}
|
|
1823
|
+
/**
|
|
1824
|
+
* Log debug information to the console
|
|
1825
|
+
* @param {...*} args - Arguments to log
|
|
1826
|
+
* @returns {void}
|
|
1827
|
+
*/
|
|
1689
1828
|
log(...o) {
|
|
1690
1829
|
console.debug("[🎨 super-toolbar]", ...o);
|
|
1691
1830
|
}
|
|
1831
|
+
/**
|
|
1832
|
+
* Set the zoom level
|
|
1833
|
+
* @param {number} percent_int - The zoom percentage as an integer
|
|
1834
|
+
* @returns {void}
|
|
1835
|
+
*/
|
|
1692
1836
|
setZoom(o) {
|
|
1693
1837
|
const e = [...this.toolbarItems, ...this.overflowItems].find((i) => i.name.value === "zoom");
|
|
1694
1838
|
Ae(this, ve).setZoom({ item: e, argument: o });
|
|
1695
1839
|
}
|
|
1696
1840
|
/**
|
|
1697
1841
|
* The toolbar expects an active Super Editor instance.
|
|
1698
|
-
* @param {
|
|
1842
|
+
* @param {Object} editor - The editor instance to attach to the toolbar
|
|
1843
|
+
* @returns {void}
|
|
1699
1844
|
*/
|
|
1700
1845
|
setActiveEditor(o) {
|
|
1701
1846
|
this.activeEditor = o, this.activeEditor.on("transaction", this.onEditorTransaction.bind(this));
|
|
1702
1847
|
}
|
|
1848
|
+
/**
|
|
1849
|
+
* Get toolbar items by group name
|
|
1850
|
+
* @param {string} groupName - The name of the group
|
|
1851
|
+
* @returns {ToolbarItem[]} An array of toolbar items in the specified group
|
|
1852
|
+
*/
|
|
1703
1853
|
getToolbarItemByGroup(o) {
|
|
1704
|
-
return this.toolbarItems.filter((n) => n.group
|
|
1854
|
+
return this.toolbarItems.filter((n) => (n.group?.value || "center") === o);
|
|
1705
1855
|
}
|
|
1856
|
+
/**
|
|
1857
|
+
* Get a toolbar item by name
|
|
1858
|
+
* @param {string} name - The name of the toolbar item
|
|
1859
|
+
* @returns {ToolbarItem|undefined} The toolbar item with the specified name or undefined if not found
|
|
1860
|
+
*/
|
|
1706
1861
|
getToolbarItemByName(o) {
|
|
1707
1862
|
return this.toolbarItems.find((n) => n.name.value === o);
|
|
1708
1863
|
}
|
|
1709
1864
|
/**
|
|
1710
|
-
* Update the toolbar state
|
|
1711
|
-
*
|
|
1865
|
+
* Update the toolbar state based on the current editor state
|
|
1866
|
+
* Updates active/inactive state of all toolbar items
|
|
1867
|
+
* @returns {void}
|
|
1712
1868
|
*/
|
|
1713
1869
|
updateToolbarState() {
|
|
1714
1870
|
if (z(this, L, ct).call(this), z(this, L, at).call(this), z(this, L, rt).call(this), !this.activeEditor || this.documentMode === "viewing") {
|
|
1715
1871
|
z(this, L, Pe).call(this);
|
|
1716
1872
|
return;
|
|
1717
1873
|
}
|
|
1718
|
-
const o =
|
|
1874
|
+
const o = kt(this.activeEditor), n = _t(this.activeEditor.state);
|
|
1719
1875
|
this.toolbarItems.forEach((e) => {
|
|
1720
1876
|
if (e.resetDisabled(), e.name.value === "linkedStyles")
|
|
1721
1877
|
return this.activeEditor && !Ze(this.activeEditor).length ? e.deactivate() : e.activate();
|
|
1722
|
-
const i = o.find((
|
|
1878
|
+
const i = o.find((l) => l.name === e.name.value);
|
|
1723
1879
|
i ? e.activate(i.attrs) : e.deactivate();
|
|
1724
|
-
const
|
|
1725
|
-
if (
|
|
1726
|
-
const
|
|
1880
|
+
const c = o.find((l) => l.name === "styleId");
|
|
1881
|
+
if (c?.attrs.styleId) {
|
|
1882
|
+
const l = {
|
|
1727
1883
|
fontSize: "font-size",
|
|
1728
1884
|
fontFamily: "font-family",
|
|
1729
1885
|
bold: "bold",
|
|
1730
1886
|
textAlign: "textAlign"
|
|
1731
|
-
},
|
|
1732
|
-
if (
|
|
1733
|
-
const
|
|
1734
|
-
[e.name.value]:
|
|
1887
|
+
}, d = this.activeEditor.converter?.linkedStyles.find((m) => m.id === c.attrs.styleId);
|
|
1888
|
+
if (l[e.name.value] in d?.definition.styles) {
|
|
1889
|
+
const m = {
|
|
1890
|
+
[e.name.value]: d?.definition.styles[l[e.name.value]]
|
|
1735
1891
|
};
|
|
1736
|
-
e.activate(
|
|
1892
|
+
e.activate(m);
|
|
1737
1893
|
}
|
|
1738
1894
|
}
|
|
1739
|
-
const a = o.find((
|
|
1895
|
+
const a = o.find((l) => l.name === "spacing");
|
|
1740
1896
|
e.name.value === "lineHeight" && (i?.attrs?.lineHeight || a) && (e.selectedValue.value = i?.attrs?.lineHeight || a.attrs?.spacing?.line || ""), e.name.value === "tableActions" && (e.disabled.value = !n);
|
|
1741
1897
|
});
|
|
1742
1898
|
}
|
|
1743
1899
|
/**
|
|
1744
1900
|
* React to editor transactions. Might want to debounce this.
|
|
1901
|
+
* @param {Object} params - Transaction parameters
|
|
1902
|
+
* @param {Object} params.editor - The editor instance (not used)
|
|
1903
|
+
* @param {Object} params.transaction - The transaction object
|
|
1904
|
+
* @returns {void}
|
|
1745
1905
|
*/
|
|
1746
1906
|
onEditorTransaction({ editor: o, transaction: n }) {
|
|
1747
1907
|
!n.docChanged && !n.selectionSet || this.updateToolbarState();
|
|
1748
1908
|
}
|
|
1749
1909
|
/**
|
|
1750
|
-
* Main handler for toolbar commands
|
|
1751
|
-
*
|
|
1752
|
-
* @param {
|
|
1753
|
-
* @param {
|
|
1754
|
-
|
|
1755
|
-
|
|
1910
|
+
* Main handler for toolbar commands
|
|
1911
|
+
* @param {CommandItem} params - Command parameters
|
|
1912
|
+
* @param {ToolbarItem} params.item - An instance of the useToolbarItem composable
|
|
1913
|
+
* @param {*} [params.argument] - The argument passed to the command
|
|
1914
|
+
* @returns {*} The result of the executed command, undefined if no result is returned
|
|
1915
|
+
*/
|
|
1916
|
+
emitCommand({ item: o, argument: n, option: e }) {
|
|
1756
1917
|
this.activeEditor?.focus();
|
|
1757
|
-
const { command:
|
|
1758
|
-
if (
|
|
1759
|
-
if (this.log("(emmitCommand) Command:",
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1918
|
+
const { command: i } = o;
|
|
1919
|
+
if (i) {
|
|
1920
|
+
if (this.log("(emmitCommand) Command:", i, `
|
|
1921
|
+
item:`, o, `
|
|
1922
|
+
argument:`, n, `
|
|
1923
|
+
option:`, e), i in Ae(this, ve))
|
|
1924
|
+
return Ae(this, ve)[i]({ item: o, argument: n });
|
|
1925
|
+
if (i in this.activeEditor?.commands)
|
|
1926
|
+
this.activeEditor.commands[i](n);
|
|
1927
|
+
else if (typeof i == "function")
|
|
1928
|
+
i({ item: o, argument: n, option: e });
|
|
1763
1929
|
else
|
|
1764
|
-
throw new Error(`[super-toolbar 🎨] Command not found: ${
|
|
1930
|
+
throw new Error(`[super-toolbar 🎨] Command not found: ${i}`);
|
|
1931
|
+
this.updateToolbarState();
|
|
1765
1932
|
}
|
|
1766
1933
|
}
|
|
1767
1934
|
}
|
|
1768
|
-
L = new WeakSet(),
|
|
1935
|
+
L = new WeakSet(), /**
|
|
1936
|
+
* Initiate toolbar groups
|
|
1937
|
+
* @private
|
|
1938
|
+
* @returns {void}
|
|
1939
|
+
*/
|
|
1940
|
+
lt = function() {
|
|
1769
1941
|
this.config.groups && !Array.isArray(this.config.groups) && Object.keys(this.config.groups).length && (this.config.toolbarGroups = Object.keys(this.config.groups));
|
|
1770
|
-
}, ve = new WeakMap(),
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1942
|
+
}, ve = new WeakMap(), /**
|
|
1943
|
+
* Create toolbar items based on configuration
|
|
1944
|
+
* @private
|
|
1945
|
+
* @param {SuperToolbar} superToolbar - The toolbar instance
|
|
1946
|
+
* @param {Object} icons - Icons to use for toolbar items
|
|
1947
|
+
* @param {boolean} [isDev=false] - Whether in development mode
|
|
1948
|
+
* @returns {void}
|
|
1949
|
+
*/
|
|
1950
|
+
We = function(o, n, e = !1) {
|
|
1951
|
+
const i = document.documentElement.clientWidth, { defaultItems: c, overflowItems: a } = lo(o, e, i, this.role, n), l = this.config.customButtons || [];
|
|
1952
|
+
l.length && c.push(...l.map((s) => _({ ...s })));
|
|
1953
|
+
let d = [
|
|
1954
|
+
...c.map((s) => s.name.value),
|
|
1955
|
+
...a.map((s) => s.name.value)
|
|
1775
1956
|
];
|
|
1776
|
-
this.config.groups && (
|
|
1777
|
-
const
|
|
1778
|
-
this.toolbarItems =
|
|
1779
|
-
},
|
|
1957
|
+
this.config.groups && (d = Object.values(this.config.groups).flatMap((s) => s));
|
|
1958
|
+
const m = c.filter((s) => d.includes(s.name.value)).filter((s) => !this.config.excludeItems.includes(s.name.value));
|
|
1959
|
+
this.toolbarItems = m, this.overflowItems = a.filter((s) => d.includes(s.name.value));
|
|
1960
|
+
}, /**
|
|
1961
|
+
* Initialize default fonts from the editor
|
|
1962
|
+
* @private
|
|
1963
|
+
* @returns {void}
|
|
1964
|
+
*/
|
|
1965
|
+
at = function() {
|
|
1780
1966
|
if (!this.activeEditor || !this.activeEditor.converter) return;
|
|
1781
|
-
const { typeface: o = "Arial", fontSizePt: n = 12 } = this.activeEditor.converter.getDocumentDefaultStyles() ?? {}, e = this.toolbarItems.find((
|
|
1967
|
+
const { typeface: o = "Arial", fontSizePt: n = 12 } = this.activeEditor.converter.getDocumentDefaultStyles() ?? {}, e = this.toolbarItems.find((c) => c.name.value === "fontSize");
|
|
1782
1968
|
e && (e.defaultLabel.value = n);
|
|
1783
|
-
const i = this.toolbarItems.find((
|
|
1969
|
+
const i = this.toolbarItems.find((c) => c.name.value === "fontFamily");
|
|
1784
1970
|
i && (i.defaultLabel.value = o);
|
|
1785
|
-
},
|
|
1971
|
+
}, /**
|
|
1972
|
+
* Update highlight color options based on document colors
|
|
1973
|
+
* @private
|
|
1974
|
+
* @returns {void}
|
|
1975
|
+
*/
|
|
1976
|
+
rt = function() {
|
|
1786
1977
|
if (!this.activeEditor || !this.activeEditor.converter || !this.activeEditor.converter.docHiglightColors.size) return;
|
|
1787
|
-
const o = this.toolbarItems.find((a) => a.name.value === "highlight"), n = Vn(), e = 7, i = Array.from(this.activeEditor.converter.docHiglightColors).reduce((a,
|
|
1788
|
-
const
|
|
1789
|
-
return a[
|
|
1790
|
-
}, []),
|
|
1978
|
+
const o = this.toolbarItems.find((a) => a.name.value === "highlight"), n = Vn(), e = 7, i = Array.from(this.activeEditor.converter.docHiglightColors).reduce((a, l, d) => {
|
|
1979
|
+
const m = Math.floor(d / e);
|
|
1980
|
+
return a[m] || (a[m] = []), n.includes(l) || a[m].push(h(l)), a;
|
|
1981
|
+
}, []), c = {
|
|
1791
1982
|
key: "color",
|
|
1792
1983
|
type: "render",
|
|
1793
1984
|
render: () => Ve(this, o, i, !0)
|
|
1794
1985
|
};
|
|
1795
|
-
o.nestedOptions.value = [
|
|
1796
|
-
},
|
|
1986
|
+
o.nestedOptions.value = [c];
|
|
1987
|
+
}, /**
|
|
1988
|
+
* Deactivate all toolbar items
|
|
1989
|
+
* @private
|
|
1990
|
+
* @returns {void}
|
|
1991
|
+
*/
|
|
1992
|
+
Pe = function() {
|
|
1797
1993
|
this.activeEditor = null, this.toolbarItems.forEach((o) => {
|
|
1798
1994
|
const { allowWithoutEditor: n } = o;
|
|
1799
1995
|
n.value || o.setDisabled(!0);
|
|
1800
1996
|
});
|
|
1801
|
-
},
|
|
1802
|
-
|
|
1803
|
-
|
|
1997
|
+
}, /**
|
|
1998
|
+
* Update undo/redo history state in the toolbar
|
|
1999
|
+
* @private
|
|
2000
|
+
* @returns {void}
|
|
2001
|
+
*/
|
|
2002
|
+
ct = function() {
|
|
2003
|
+
this.activeEditor && (this.undoDepth = xt(this.activeEditor.state), this.redoDepth = Et(this.activeEditor.state));
|
|
2004
|
+
}, /**
|
|
2005
|
+
* Run a command that requires an argument
|
|
2006
|
+
* @private
|
|
2007
|
+
* @param {CommandItem} params - Command parameters
|
|
2008
|
+
* @param {ToolbarItem} params.item - The toolbar item
|
|
2009
|
+
* @param {*} params.argument - The argument for the command
|
|
2010
|
+
* @param {boolean} params.noArgumentCallback - Whether to call callback even if argument === 'none'
|
|
2011
|
+
* @param {Function} [callback] - Optional callback to run after the command
|
|
2012
|
+
* @returns {void}
|
|
2013
|
+
*/
|
|
2014
|
+
fe = function({ item: o, argument: n, noArgumentCallback: e = !1 }, i) {
|
|
1804
2015
|
if (!n || !this.activeEditor) return;
|
|
1805
|
-
let
|
|
1806
|
-
const
|
|
1807
|
-
if (n === "none" &&
|
|
1808
|
-
this.activeEditor.commands[
|
|
2016
|
+
let c = o.command;
|
|
2017
|
+
const a = o.noArgumentCommand;
|
|
2018
|
+
if (n === "none" && a in this.activeEditor?.commands) {
|
|
2019
|
+
this.activeEditor.commands[a](), typeof i == "function" && e && i(n), this.updateToolbarState();
|
|
1809
2020
|
return;
|
|
1810
2021
|
}
|
|
1811
|
-
|
|
2022
|
+
c in this.activeEditor?.commands && (this.activeEditor.commands[c](n), typeof i == "function" && i(n), this.updateToolbarState());
|
|
1812
2023
|
};
|
|
1813
|
-
function ho(t,
|
|
1814
|
-
if (!t.value || !
|
|
1815
|
-
const o =
|
|
2024
|
+
function ho(t, r) {
|
|
2025
|
+
if (!t.value || !r?.value?.options?.scale) return;
|
|
2026
|
+
const o = r.value.options.scale, n = t.value.getBoundingClientRect(), e = t.value.querySelectorAll(".pagination-break-wrapper");
|
|
1816
2027
|
let i;
|
|
1817
|
-
e.forEach((
|
|
1818
|
-
const
|
|
1819
|
-
if (i || (i =
|
|
1820
|
-
const
|
|
1821
|
-
|
|
2028
|
+
e.forEach((c) => {
|
|
2029
|
+
const l = (c.getBoundingClientRect().left - n.left) / o * -1 + 1;
|
|
2030
|
+
if (i || (i = l), l !== i) {
|
|
2031
|
+
const d = l - i;
|
|
2032
|
+
c.style.transform = `translateX(${d}px)`;
|
|
1822
2033
|
}
|
|
1823
2034
|
});
|
|
1824
2035
|
}
|
|
1825
|
-
const fo = (t,
|
|
1826
|
-
const o = t.clientY, n = t.clientX, { view: e } =
|
|
1827
|
-
let
|
|
2036
|
+
const fo = (t, r) => {
|
|
2037
|
+
const o = t.clientY, n = t.clientX, { view: e } = r, i = e.dom.getBoundingClientRect();
|
|
2038
|
+
let c = {
|
|
1828
2039
|
left: 0,
|
|
1829
2040
|
top: o
|
|
1830
2041
|
}, a = !1;
|
|
1831
|
-
n > i.right ? (
|
|
1832
|
-
const
|
|
1833
|
-
if (
|
|
1834
|
-
let
|
|
2042
|
+
n > i.right ? (c.left = i.left + i.width - 1, a = !0) : n < i.left && (c.left = i.left);
|
|
2043
|
+
const l = e.posAtCoords(c)?.pos;
|
|
2044
|
+
if (l) {
|
|
2045
|
+
let d = l;
|
|
1835
2046
|
if (a) {
|
|
1836
|
-
const b = e.state.doc.resolve(
|
|
1837
|
-
|
|
2047
|
+
const b = e.state.doc.resolve(l).textOffset, v = e.state.doc.nodeAt(l), E = v?.text?.charAt(b);
|
|
2048
|
+
d = v?.isText && E !== " " ? l - 1 : l;
|
|
1838
2049
|
}
|
|
1839
|
-
const
|
|
1840
|
-
Ye.create(e.state.doc,
|
|
2050
|
+
const m = e.state.tr.setSelection(
|
|
2051
|
+
Ye.create(e.state.doc, d)
|
|
1841
2052
|
);
|
|
1842
|
-
e.dispatch(
|
|
2053
|
+
e.dispatch(m), e.focus();
|
|
1843
2054
|
}
|
|
1844
2055
|
}, vo = { class: "numbering" }, Te = 200, go = "flex-end", yo = {
|
|
1845
2056
|
__name: "Ruler",
|
|
@@ -1858,13 +2069,13 @@ const fo = (t, l) => {
|
|
|
1858
2069
|
}
|
|
1859
2070
|
},
|
|
1860
2071
|
emits: ["margin-change"],
|
|
1861
|
-
setup(t, { emit:
|
|
1862
|
-
const o =
|
|
2072
|
+
setup(t, { emit: r }) {
|
|
2073
|
+
const o = r, n = t, e = f(null), i = f([]), c = f("#CCCCCC"), a = f("#2563EB66"), l = f(null), d = f(null), m = f(!1), s = f(null), b = Ke({ side: "left", x: 0 }), v = Ke({ side: "right", x: 0 }), y = f(!1), E = f(0);
|
|
1863
2074
|
let g = 0;
|
|
1864
2075
|
const F = () => {
|
|
1865
2076
|
if (n.editor.options.mode !== "docx") return;
|
|
1866
2077
|
const I = [], { pageMargins: M, pageSize: H } = n.editor.getPageStyles();
|
|
1867
|
-
|
|
2078
|
+
l.value = H, d.value = M, v.x = H.width * 96 - M.right * 96, b.x = M.left * 96;
|
|
1868
2079
|
for (let R = 0; R < H.width; R++) {
|
|
1869
2080
|
const K = `${5.5}px`, ce = H.width - R;
|
|
1870
2081
|
if (I.push(...$(1, "main", "20%", K, R)), I.push(...$(3, "eighth", "10%", K)), I.push(...$(1, "half", "40%", K)), ce <= 0.5) break;
|
|
@@ -1886,77 +2097,77 @@ const fo = (t, l) => {
|
|
|
1886
2097
|
backgroundColor: I.color || "#666",
|
|
1887
2098
|
marginLeft: I.numbering === 0 ? null : I.margin,
|
|
1888
2099
|
marginRight: I.margin
|
|
1889
|
-
})),
|
|
2100
|
+
})), x = j(() => (I) => ({
|
|
1890
2101
|
left: `${(I === "left" ? b : v).x}px`
|
|
1891
2102
|
})), T = j(() => {
|
|
1892
2103
|
if (!e.value) return;
|
|
1893
2104
|
const H = e.value.parentElement.querySelector(".super-editor").getBoundingClientRect();
|
|
1894
2105
|
return {
|
|
1895
|
-
left: `${
|
|
2106
|
+
left: `${s.value.x}px`,
|
|
1896
2107
|
minHeight: `${H.height}px`
|
|
1897
2108
|
};
|
|
1898
2109
|
}), N = (I) => {
|
|
1899
|
-
|
|
2110
|
+
m.value = !0, ye();
|
|
1900
2111
|
const M = I.currentTarget.id;
|
|
1901
|
-
|
|
2112
|
+
s.value = M === "left-margin-handle" ? b : v, E.value = s.value.x, g = I.clientX - s.value.x, y.value = !0;
|
|
1902
2113
|
}, V = (I) => {
|
|
1903
|
-
if (!
|
|
2114
|
+
if (!m.value) return;
|
|
1904
2115
|
const M = I.clientX - g;
|
|
1905
|
-
|
|
2116
|
+
s.value.x = M, s.value.side === "left" ? M <= 0 ? s.value.x = 0 : M >= v.x - Te && (s.value.x = v.x - Te) : M >= l.value.width * 96 ? s.value.x = l.value.width * 96 : M <= b.x + Te && (s.value.x = b.x + Te);
|
|
1906
2117
|
}, te = () => {
|
|
1907
|
-
if (
|
|
2118
|
+
if (m.value = !1, y.value = !1, Z(), s.value && s.value.x !== E.value) {
|
|
1908
2119
|
const I = re();
|
|
1909
2120
|
o("margin-change", {
|
|
1910
|
-
side:
|
|
2121
|
+
side: s.value.side,
|
|
1911
2122
|
value: I
|
|
1912
2123
|
});
|
|
1913
2124
|
}
|
|
1914
2125
|
}, ye = () => {
|
|
1915
|
-
|
|
2126
|
+
c.value = a.value;
|
|
1916
2127
|
}, Z = () => {
|
|
1917
|
-
|
|
1918
|
-
}, re = () =>
|
|
2128
|
+
c.value = "#CCC";
|
|
2129
|
+
}, re = () => s.value.side === "left" ? s.value.x / 96 : (l.value.width * 96 - s.value.x) / 96, be = j(() => ({
|
|
1919
2130
|
"--alignment": go,
|
|
1920
|
-
"--ruler-handle-color":
|
|
2131
|
+
"--ruler-handle-color": c.value,
|
|
1921
2132
|
"--ruler-handle-active-color": a.value
|
|
1922
2133
|
}));
|
|
1923
|
-
return
|
|
2134
|
+
return ke(() => {
|
|
1924
2135
|
i.value = F(), window.addEventListener("mousemove", V), window.addEventListener("mouseup", te);
|
|
1925
2136
|
}), zt(() => {
|
|
1926
2137
|
window.removeEventListener("mousemove", V), window.removeEventListener("mouseup", te);
|
|
1927
|
-
}), (I, M) => (w(),
|
|
2138
|
+
}), (I, M) => (w(), C("div", {
|
|
1928
2139
|
class: "ruler",
|
|
1929
2140
|
ref_key: "ruler",
|
|
1930
2141
|
ref: e,
|
|
1931
2142
|
style: J(be.value)
|
|
1932
2143
|
}, [
|
|
1933
|
-
|
|
2144
|
+
k("div", {
|
|
1934
2145
|
class: "margin-handle handle-left",
|
|
1935
2146
|
id: "left-margin-handle",
|
|
1936
2147
|
onMousedown: N,
|
|
1937
|
-
style: J(
|
|
2148
|
+
style: J(x.value("left"))
|
|
1938
2149
|
}, null, 36),
|
|
1939
|
-
|
|
2150
|
+
k("div", {
|
|
1940
2151
|
class: "margin-handle handle-right",
|
|
1941
2152
|
id: "right-margin-handle",
|
|
1942
2153
|
onMousedown: N,
|
|
1943
|
-
style: J(
|
|
2154
|
+
style: J(x.value("right"))
|
|
1944
2155
|
}, null, 36),
|
|
1945
|
-
y.value ? (w(),
|
|
2156
|
+
y.value ? (w(), C("div", {
|
|
1946
2157
|
key: 0,
|
|
1947
2158
|
class: "vertical-indicator",
|
|
1948
2159
|
style: J(T.value)
|
|
1949
2160
|
}, null, 4)) : Q("", !0),
|
|
1950
|
-
(w(!0),
|
|
2161
|
+
(w(!0), C(U, null, ee(i.value, (H) => (w(), C("div", {
|
|
1951
2162
|
class: oe(H.className),
|
|
1952
2163
|
style: J(p.value(H))
|
|
1953
2164
|
}, [
|
|
1954
|
-
|
|
1955
|
-
(w(!0),
|
|
2165
|
+
k("div", vo, ie(H.numbering), 1),
|
|
2166
|
+
(w(!0), C(U, null, ee(H.elements, (R) => (w(), C("div", {
|
|
1956
2167
|
class: oe(R.className),
|
|
1957
2168
|
style: J(p.value(R))
|
|
1958
2169
|
}, [
|
|
1959
|
-
(w(!0),
|
|
2170
|
+
(w(!0), C(U, null, ee(R.elements, (G) => (w(), C("div", {
|
|
1960
2171
|
class: oe(G.className),
|
|
1961
2172
|
style: J(p.value(G))
|
|
1962
2173
|
}, null, 6))), 256))
|
|
@@ -1964,10 +2175,10 @@ const fo = (t, l) => {
|
|
|
1964
2175
|
], 6))), 256))
|
|
1965
2176
|
], 4));
|
|
1966
2177
|
}
|
|
1967
|
-
}, bo = /* @__PURE__ */ q(yo, [["__scopeId", "data-v-ad77036c"]]), wo = { class: "super-editor-container" },
|
|
2178
|
+
}, bo = /* @__PURE__ */ q(yo, [["__scopeId", "data-v-ad77036c"]]), wo = { class: "super-editor-container" }, Co = {
|
|
1968
2179
|
key: 1,
|
|
1969
2180
|
class: "placeholder-editor"
|
|
1970
|
-
},
|
|
2181
|
+
}, ko = { class: "placeholder-title" }, _o = {
|
|
1971
2182
|
__name: "SuperEditor",
|
|
1972
2183
|
props: {
|
|
1973
2184
|
documentId: {
|
|
@@ -1996,39 +2207,39 @@ const fo = (t, l) => {
|
|
|
1996
2207
|
"comments-loaded",
|
|
1997
2208
|
"selection-update"
|
|
1998
2209
|
],
|
|
1999
|
-
setup(t, { emit:
|
|
2000
|
-
const o =
|
|
2001
|
-
let
|
|
2002
|
-
const
|
|
2003
|
-
clearTimeout(
|
|
2004
|
-
},
|
|
2210
|
+
setup(t, { emit: r }) {
|
|
2211
|
+
const o = r, n = t, e = f(!1), i = nt(null), c = f(null), a = f(null);
|
|
2212
|
+
let l;
|
|
2213
|
+
const d = () => {
|
|
2214
|
+
clearTimeout(l);
|
|
2215
|
+
}, m = (p, x = 10, T = 500) => {
|
|
2005
2216
|
const N = p.getMap("meta"), V = () => {
|
|
2006
2217
|
const te = N.get("docx");
|
|
2007
|
-
te ? (
|
|
2218
|
+
te ? (d(), y({ content: te })) : x > 0 ? (console.debug(`Waiting for 'docx' data... retries left: ${x}`), l = setTimeout(V, T), x--) : console.warn("Failed to load docx data from meta map.");
|
|
2008
2219
|
};
|
|
2009
2220
|
V();
|
|
2010
|
-
},
|
|
2221
|
+
}, s = async () => {
|
|
2011
2222
|
try {
|
|
2012
|
-
const [p,
|
|
2013
|
-
return { content: p, media:
|
|
2223
|
+
const [p, x, T, N] = await ze.loadXmlData(n.fileSource);
|
|
2224
|
+
return { content: p, media: x, mediaFiles: T, fonts: N };
|
|
2014
2225
|
} catch (p) {
|
|
2015
2226
|
console.debug("Error loading new file data:", p);
|
|
2016
2227
|
}
|
|
2017
2228
|
}, b = async () => {
|
|
2018
2229
|
if (n.fileSource) {
|
|
2019
|
-
const p = await
|
|
2230
|
+
const p = await s();
|
|
2020
2231
|
return y(p);
|
|
2021
2232
|
} else if (n.options.ydoc && n.options.collaborationProvider) {
|
|
2022
2233
|
delete n.options.content;
|
|
2023
|
-
const p = n.options.ydoc,
|
|
2024
|
-
|
|
2234
|
+
const p = n.options.ydoc, x = n.options.collaborationProvider, T = () => {
|
|
2235
|
+
m(p), x.off("synced", T);
|
|
2025
2236
|
};
|
|
2026
|
-
|
|
2237
|
+
x.on("synced", T);
|
|
2027
2238
|
}
|
|
2028
2239
|
}, v = () => {
|
|
2029
|
-
const p =
|
|
2030
|
-
return n.options.pagination ? p : p.filter((
|
|
2031
|
-
}, y = async ({ content: p, media:
|
|
2240
|
+
const p = St();
|
|
2241
|
+
return n.options.pagination ? p : p.filter((x) => x.name !== "pagination");
|
|
2242
|
+
}, y = async ({ content: p, media: x = {}, mediaFiles: T = {}, fonts: N = {} } = {}) => {
|
|
2032
2243
|
i.value = new ze({
|
|
2033
2244
|
mode: "docx",
|
|
2034
2245
|
element: a.value,
|
|
@@ -2037,7 +2248,7 @@ const fo = (t, l) => {
|
|
|
2037
2248
|
externalExtensions: n.options.externalExtensions,
|
|
2038
2249
|
documentId: n.documentId,
|
|
2039
2250
|
content: p,
|
|
2040
|
-
media:
|
|
2251
|
+
media: x,
|
|
2041
2252
|
mediaFiles: T,
|
|
2042
2253
|
fonts: N,
|
|
2043
2254
|
...n.options
|
|
@@ -2048,50 +2259,50 @@ const fo = (t, l) => {
|
|
|
2048
2259
|
e.value = !0;
|
|
2049
2260
|
}, 150);
|
|
2050
2261
|
});
|
|
2051
|
-
},
|
|
2262
|
+
}, E = (p) => {
|
|
2052
2263
|
o("editor-keydown", { editor: i.value });
|
|
2053
2264
|
}, g = (p) => {
|
|
2054
2265
|
o("editor-click", { editor: i.value });
|
|
2055
|
-
let
|
|
2056
|
-
if (!
|
|
2266
|
+
let x = a.value?.querySelector(".ProseMirror");
|
|
2267
|
+
if (!x || !i.value)
|
|
2057
2268
|
return;
|
|
2058
|
-
!
|
|
2269
|
+
!x.contains(p.target) && i.value.isEditable && i.value.view?.focus();
|
|
2059
2270
|
};
|
|
2060
|
-
|
|
2271
|
+
ke(() => {
|
|
2061
2272
|
b(), (n.options?.suppressSkeletonLoader || !n.options?.collaborationProvider) && (e.value = !0);
|
|
2062
2273
|
});
|
|
2063
2274
|
const F = (p) => {
|
|
2064
2275
|
p.target.classList.contains("ProseMirror") || fo(p, i.value);
|
|
2065
|
-
}, $ = ({ side: p, value:
|
|
2276
|
+
}, $ = ({ side: p, value: x }) => {
|
|
2066
2277
|
if (!i.value) return;
|
|
2067
|
-
const T = i.value.getPageStyles(), { pageMargins: N } = T, V = { ...N, [p]:
|
|
2278
|
+
const T = i.value.getPageStyles(), { pageMargins: N } = T, V = { ...N, [p]: x };
|
|
2068
2279
|
i.value?.updatePageStyle({ pageMargins: V });
|
|
2069
2280
|
};
|
|
2070
2281
|
return ot(() => {
|
|
2071
|
-
|
|
2072
|
-
}), (p,
|
|
2282
|
+
d(), i.value?.destroy(), i.value = null;
|
|
2283
|
+
}), (p, x) => (w(), C("div", wo, [
|
|
2073
2284
|
t.options.rulers && i.value ? (w(), Vt(bo, {
|
|
2074
2285
|
key: 0,
|
|
2075
2286
|
class: "ruler",
|
|
2076
2287
|
editor: i.value,
|
|
2077
2288
|
onMarginChange: $
|
|
2078
2289
|
}, null, 8, ["editor"])) : Q("", !0),
|
|
2079
|
-
|
|
2290
|
+
k("div", {
|
|
2080
2291
|
class: "super-editor",
|
|
2081
2292
|
ref_key: "editorWrapper",
|
|
2082
|
-
ref:
|
|
2083
|
-
onKeydown:
|
|
2293
|
+
ref: c,
|
|
2294
|
+
onKeydown: E,
|
|
2084
2295
|
onClick: g,
|
|
2085
2296
|
onMousedown: F
|
|
2086
2297
|
}, [
|
|
2087
|
-
|
|
2298
|
+
k("div", {
|
|
2088
2299
|
ref_key: "editorElem",
|
|
2089
2300
|
ref: a,
|
|
2090
2301
|
class: "editor-element super-editor__element"
|
|
2091
2302
|
}, null, 512)
|
|
2092
2303
|
], 544),
|
|
2093
|
-
e.value ? Q("", !0) : (w(),
|
|
2094
|
-
|
|
2304
|
+
e.value ? Q("", !0) : (w(), C("div", Co, [
|
|
2305
|
+
k("div", ko, [
|
|
2095
2306
|
P(D(Y), {
|
|
2096
2307
|
text: "",
|
|
2097
2308
|
style: { width: "60%" }
|
|
@@ -2140,12 +2351,12 @@ const fo = (t, l) => {
|
|
|
2140
2351
|
}, Do = /* @__PURE__ */ q(_o, [["__scopeId", "data-v-ff8f86f4"]]), $o = {
|
|
2141
2352
|
__name: "BasicUpload",
|
|
2142
2353
|
emits: ["file-change"],
|
|
2143
|
-
setup(t, { emit:
|
|
2144
|
-
const o =
|
|
2354
|
+
setup(t, { emit: r }) {
|
|
2355
|
+
const o = r, n = (e) => {
|
|
2145
2356
|
o("file-change", e.target.files[0]);
|
|
2146
2357
|
};
|
|
2147
|
-
return (e, i) => (w(),
|
|
2148
|
-
|
|
2358
|
+
return (e, i) => (w(), C("div", null, [
|
|
2359
|
+
k("input", {
|
|
2149
2360
|
type: "file",
|
|
2150
2361
|
id: "fileInput",
|
|
2151
2362
|
onChange: n,
|
|
@@ -2153,7 +2364,7 @@ const fo = (t, l) => {
|
|
|
2153
2364
|
}, null, 32)
|
|
2154
2365
|
]));
|
|
2155
2366
|
}
|
|
2156
|
-
}, xo = ["innerHTML"],
|
|
2367
|
+
}, xo = ["innerHTML"], Eo = {
|
|
2157
2368
|
__name: "SuperInput",
|
|
2158
2369
|
props: {
|
|
2159
2370
|
modelValue: {
|
|
@@ -2176,16 +2387,16 @@ const fo = (t, l) => {
|
|
|
2176
2387
|
}
|
|
2177
2388
|
},
|
|
2178
2389
|
emits: ["update:modelValue", "focus", "blur"],
|
|
2179
|
-
setup(t, { emit:
|
|
2180
|
-
const o =
|
|
2181
|
-
const
|
|
2182
|
-
o("update:modelValue",
|
|
2183
|
-
},
|
|
2184
|
-
|
|
2185
|
-
},
|
|
2186
|
-
|
|
2187
|
-
},
|
|
2188
|
-
At.options.placeholder = n.placeholder || "Type something...", n.options.onTransaction = a, n.options.onFocus =
|
|
2390
|
+
setup(t, { emit: r }) {
|
|
2391
|
+
const o = r, n = t, e = nt(), i = f(null), c = f(!1), a = ({ editor: v, transaction: y }) => {
|
|
2392
|
+
const E = v.getHTML();
|
|
2393
|
+
o("update:modelValue", E);
|
|
2394
|
+
}, l = ({ editor: v, transaction: y }) => {
|
|
2395
|
+
c.value = !0, b(), o("focus", { editor: v, transaction: y });
|
|
2396
|
+
}, d = ({ editor: v, transaction: y }) => {
|
|
2397
|
+
c.value = !1, o("blur", { editor: v, transaction: y });
|
|
2398
|
+
}, m = async () => {
|
|
2399
|
+
At.options.placeholder = n.placeholder || "Type something...", n.options.onTransaction = a, n.options.onFocus = l, n.options.onBlur = d, e.value = new ze({
|
|
2189
2400
|
mode: "text",
|
|
2190
2401
|
content: document.getElementById("currentContent"),
|
|
2191
2402
|
element: i.value,
|
|
@@ -2193,32 +2404,32 @@ const fo = (t, l) => {
|
|
|
2193
2404
|
users: n.users,
|
|
2194
2405
|
...n.options
|
|
2195
2406
|
});
|
|
2196
|
-
},
|
|
2197
|
-
|
|
2407
|
+
}, s = () => {
|
|
2408
|
+
c.value = !0, e.value?.view?.focus();
|
|
2198
2409
|
}, b = () => {
|
|
2199
2410
|
e.value?.setOptions({ users: n.users });
|
|
2200
2411
|
};
|
|
2201
|
-
return
|
|
2202
|
-
|
|
2412
|
+
return ke(() => {
|
|
2413
|
+
m();
|
|
2203
2414
|
}), ot(() => {
|
|
2204
2415
|
e.value?.destroy(), e.value = null;
|
|
2205
|
-
}), (v, y) => (w(),
|
|
2206
|
-
class: oe(["super-editor super-input", { "super-input-active":
|
|
2207
|
-
onClick: ge(
|
|
2416
|
+
}), (v, y) => (w(), C("div", {
|
|
2417
|
+
class: oe(["super-editor super-input", { "super-input-active": c.value }]),
|
|
2418
|
+
onClick: ge(s, ["stop", "prevent"])
|
|
2208
2419
|
}, [
|
|
2209
|
-
|
|
2420
|
+
k("div", {
|
|
2210
2421
|
id: "currentContent",
|
|
2211
2422
|
style: { display: "none" },
|
|
2212
2423
|
innerHTML: t.modelValue
|
|
2213
2424
|
}, null, 8, xo),
|
|
2214
|
-
|
|
2425
|
+
k("div", {
|
|
2215
2426
|
ref_key: "editorElem",
|
|
2216
2427
|
ref: i,
|
|
2217
2428
|
class: "editor-element super-editor__element"
|
|
2218
2429
|
}, null, 512)
|
|
2219
2430
|
], 2));
|
|
2220
2431
|
}
|
|
2221
|
-
}, Ho = /* @__PURE__ */ q(
|
|
2432
|
+
}, Ho = /* @__PURE__ */ q(Eo, [["__scopeId", "data-v-4d5cff52"]]), Bo = {
|
|
2222
2433
|
Node: Mt,
|
|
2223
2434
|
Attribute: Lt,
|
|
2224
2435
|
Extension: It,
|
|
@@ -2240,11 +2451,11 @@ export {
|
|
|
2240
2451
|
zo as TrackChangesBasePluginKey,
|
|
2241
2452
|
Zo as createZip,
|
|
2242
2453
|
Vo as fieldAnnotationHelpers,
|
|
2243
|
-
|
|
2454
|
+
kt as getActiveFormatting,
|
|
2244
2455
|
mo as getAllowedImageDimensions,
|
|
2245
2456
|
Wo as getMarksFromSelection,
|
|
2246
2457
|
Tt as getRichTextExtensions,
|
|
2247
|
-
|
|
2458
|
+
St as getStarterExtensions,
|
|
2248
2459
|
Po as helpers,
|
|
2249
2460
|
jo as trackChangesHelpers
|
|
2250
2461
|
};
|