@harbour-enterprises/superdoc 0.10.22 → 0.10.24-RC1
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-C2H8juPb.es.js → eventemitter3-Bj3oXrh_.es.js} +1 -1
- package/dist/chunks/{index-DjLrg1eZ.es.js → index-B_4G-Rse.es.js} +4 -4
- package/dist/chunks/{index-dZKHAFXF.es.js → index-C3fK1Y-u.es.js} +2 -2
- package/dist/chunks/{jszip-DSGi1sNe.es.js → jszip-ChtTJmXO.es.js} +1 -1
- package/dist/chunks/{super-editor.es-CdMJsMle.es.js → super-editor.es-C7FklFR7.es.js} +9403 -8892
- package/dist/chunks/{super-editor.es-TJy-CXJ0.cjs → super-editor.es-LVnq3DMw.cjs} +103 -74
- package/dist/chunks/{url-BxDGAI6E.es.js → url-D6ObD5O4.es.js} +2 -2
- package/dist/chunks/{vue-BDbTsTMu.es.js → vue-D254cI7X.es.js} +2 -2
- package/dist/chunks/{xml-js-BAML2_fM.es.js → xml-js-BYiAO46K.es.js} +2 -2
- package/dist/composables/use-ai.d.ts +13 -0
- package/dist/composables/use-ai.d.ts.map +1 -0
- package/dist/composables/use-selected-text.d.ts +8 -0
- package/dist/composables/use-selected-text.d.ts.map +1 -0
- package/dist/core/SuperDoc.d.ts +22 -2
- package/dist/core/SuperDoc.d.ts.map +1 -1
- package/dist/style.css +114 -20
- package/dist/super-editor/ai-writer.es.js +276 -0
- package/dist/super-editor/chunks/{converter-BQTTQHRA.js → converter-J9ViHxhj.js} +781 -728
- package/dist/super-editor/chunks/{docx-zipper-DFIgRSuf.js → docx-zipper-C1kMsjg4.js} +1 -1
- package/dist/super-editor/chunks/{editor-ChNkdwEF.js → editor-DwlgXynb.js} +2811 -2672
- package/dist/super-editor/chunks/{toolbar-u0YXjEp9.js → toolbar-Dtt8NSGy.js} +981 -979
- package/dist/super-editor/components/toolbar/ai-helpers.d.ts +65 -0
- package/dist/super-editor/components/toolbar/ai-helpers.d.ts.map +1 -0
- package/dist/super-editor/components/toolbar/defaultItems.d.ts.map +1 -1
- package/dist/super-editor/components/toolbar/super-toolbar.d.ts +2 -0
- package/dist/super-editor/components/toolbar/super-toolbar.d.ts.map +1 -1
- package/dist/super-editor/components/toolbar/toolbarIcons.d.ts +1 -0
- package/dist/super-editor/components/toolbar/use-toolbar-item.d.ts +1 -0
- package/dist/super-editor/components/toolbar/use-toolbar-item.d.ts.map +1 -1
- package/dist/super-editor/converter.es.js +1 -1
- package/dist/super-editor/core/Editor.d.ts.map +1 -1
- package/dist/super-editor/core/ExtensionService.d.ts.map +1 -1
- package/dist/super-editor/core/Mark.d.ts +1 -0
- package/dist/super-editor/core/Mark.d.ts.map +1 -1
- package/dist/super-editor/core/super-converter/SuperConverter.d.ts +3 -2
- 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/v2/importer/bookmarkNodeImporter.d.ts.map +1 -1
- package/dist/super-editor/core/super-converter/v2/importer/runNodeImporter.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/ai/ai-constants.d.ts +3 -0
- package/dist/super-editor/extensions/ai/ai-constants.d.ts.map +1 -0
- package/dist/super-editor/extensions/ai/ai-marks.d.ts +3 -0
- package/dist/super-editor/extensions/ai/ai-marks.d.ts.map +1 -0
- package/dist/super-editor/extensions/ai/ai-plugin.d.ts +4 -0
- package/dist/super-editor/extensions/ai/ai-plugin.d.ts.map +1 -0
- package/dist/super-editor/extensions/ai/index.d.ts +4 -0
- package/dist/super-editor/extensions/ai/index.d.ts.map +1 -0
- package/dist/super-editor/extensions/index.d.ts +5 -2
- package/dist/super-editor/extensions/index.d.ts.map +1 -1
- package/dist/super-editor/file-zipper.es.js +1 -1
- package/dist/super-editor/index.d.ts +1 -1
- package/dist/super-editor/index.d.ts.map +1 -1
- package/dist/super-editor/style.css +1 -1
- package/dist/super-editor/super-editor.es.js +761 -714
- package/dist/super-editor/tests/e2e/test-app/dist/assets/index-BTMvkUyI.d.ts +3 -0
- package/dist/super-editor/tests/e2e/test-app/dist/assets/index-BTMvkUyI.d.ts.map +1 -0
- package/dist/super-editor/tests/e2e/test-app/vite.config.d.ts +1 -1
- package/dist/super-editor/toolbar.es.js +2 -2
- package/dist/super-editor.cjs +1 -1
- package/dist/super-editor.es.js +17 -16
- package/dist/superdoc.cjs +164 -164
- package/dist/superdoc.es.js +4505 -4343
- package/dist/superdoc.umd.js +8361 -7639
- package/dist/superdoc.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,62 +1,63 @@
|
|
|
1
|
-
var
|
|
1
|
+
var ut = Object.defineProperty;
|
|
2
2
|
var Ve = (t) => {
|
|
3
3
|
throw TypeError(t);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
import { _ as
|
|
10
|
-
import { C as
|
|
11
|
-
import { a1 as
|
|
12
|
-
import { O as
|
|
13
|
-
import { ref as v, createElementBlock as
|
|
14
|
-
import { t as
|
|
15
|
-
import
|
|
16
|
-
import {
|
|
17
|
-
|
|
5
|
+
var mt = (t, s, o) => s in t ? ut(t, s, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[s] = o;
|
|
6
|
+
var He = (t, s, o) => mt(t, typeof s != "symbol" ? s + "" : s, o), je = (t, s, o) => s.has(t) || Ve("Cannot " + o);
|
|
7
|
+
var Se = (t, s, o) => (je(t, s, "read from private field"), o ? o.call(t) : s.get(t)), Be = (t, s, o) => s.has(t) ? Ve("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(t) : s.set(t, o);
|
|
8
|
+
var W = (t, s, o) => (je(t, s, "access private method"), o);
|
|
9
|
+
import { _ as K, a as Ke, b as pt, I as Re, f as ft, c as Ue, d as ht, i as gt, u as vt, r as yt, E as Oe, e as bt, P as wt, h as kt, M as Ct, j as _t, A as xt, N as Et } from "./chunks/editor-DwlgXynb.js";
|
|
10
|
+
import { C as To, T as Fo, l as Io, n as Lo, k as Mo, m as Do } from "./chunks/editor-DwlgXynb.js";
|
|
11
|
+
import { a1 as St, y as At, a3 as Tt, T as Xe, a as Ft } from "./chunks/converter-J9ViHxhj.js";
|
|
12
|
+
import { O as Ho } from "./chunks/converter-J9ViHxhj.js";
|
|
13
|
+
import { ref as v, createElementBlock as k, openBlock as w, createElementVNode as x, unref as $, getCurrentInstance as It, computed as j, watch as Lt, onMounted as ke, createCommentVNode as ne, withDirectives as Mt, withKeys as Dt, normalizeClass as oe, withModifiers as we, vModelText as $t, createTextVNode as Ht, toDisplayString as ie, Fragment as U, renderList as Q, normalizeStyle as J, createVNode as V, h as N, createApp as Bt, reactive as qe, onUnmounted as Rt, shallowRef as Ze, onBeforeUnmount as Ye, createBlock as Ot } from "vue";
|
|
14
|
+
import { t as G, s as Nt, T as zt, N as Y } from "./chunks/toolbar-Dtt8NSGy.js";
|
|
15
|
+
import Wt from "./ai-writer.es.js";
|
|
16
|
+
import { D as Ro } from "./chunks/docx-zipper-C1kMsjg4.js";
|
|
17
|
+
import { createZip as No } from "./file-zipper.es.js";
|
|
18
|
+
var Je = { exports: {} };
|
|
18
19
|
(function(t) {
|
|
19
|
-
var
|
|
20
|
+
var s = Object.prototype.hasOwnProperty, o = "~";
|
|
20
21
|
function n() {
|
|
21
22
|
}
|
|
22
23
|
Object.create && (n.prototype = /* @__PURE__ */ Object.create(null), new n().__proto__ || (o = !1));
|
|
23
|
-
function e(a,
|
|
24
|
-
this.fn = a, this.context =
|
|
24
|
+
function e(a, c, u) {
|
|
25
|
+
this.fn = a, this.context = c, this.once = u || !1;
|
|
25
26
|
}
|
|
26
|
-
function i(a,
|
|
27
|
+
function i(a, c, u, r, b) {
|
|
27
28
|
if (typeof u != "function")
|
|
28
29
|
throw new TypeError("The listener must be a function");
|
|
29
|
-
var
|
|
30
|
-
return a._events[
|
|
30
|
+
var y = new e(u, r || a, b), h = o ? o + c : c;
|
|
31
|
+
return a._events[h] ? a._events[h].fn ? a._events[h] = [a._events[h], y] : a._events[h].push(y) : (a._events[h] = y, a._eventsCount++), a;
|
|
31
32
|
}
|
|
32
|
-
function
|
|
33
|
-
--a._eventsCount === 0 ? a._events = new n() : delete a._events[
|
|
33
|
+
function d(a, c) {
|
|
34
|
+
--a._eventsCount === 0 ? a._events = new n() : delete a._events[c];
|
|
34
35
|
}
|
|
35
|
-
function
|
|
36
|
+
function l() {
|
|
36
37
|
this._events = new n(), this._eventsCount = 0;
|
|
37
38
|
}
|
|
38
|
-
|
|
39
|
-
var
|
|
40
|
-
if (this._eventsCount === 0) return
|
|
39
|
+
l.prototype.eventNames = function() {
|
|
40
|
+
var c = [], u, r;
|
|
41
|
+
if (this._eventsCount === 0) return c;
|
|
41
42
|
for (r in u = this._events)
|
|
42
|
-
|
|
43
|
-
return Object.getOwnPropertySymbols ?
|
|
44
|
-
},
|
|
45
|
-
var u = o ? o +
|
|
43
|
+
s.call(u, r) && c.push(o ? r.slice(1) : r);
|
|
44
|
+
return Object.getOwnPropertySymbols ? c.concat(Object.getOwnPropertySymbols(u)) : c;
|
|
45
|
+
}, l.prototype.listeners = function(c) {
|
|
46
|
+
var u = o ? o + c : c, r = this._events[u];
|
|
46
47
|
if (!r) return [];
|
|
47
48
|
if (r.fn) return [r.fn];
|
|
48
|
-
for (var b = 0,
|
|
49
|
-
|
|
50
|
-
return
|
|
51
|
-
},
|
|
52
|
-
var u = o ? o +
|
|
49
|
+
for (var b = 0, y = r.length, h = new Array(y); b < y; b++)
|
|
50
|
+
h[b] = r[b].fn;
|
|
51
|
+
return h;
|
|
52
|
+
}, l.prototype.listenerCount = function(c) {
|
|
53
|
+
var u = o ? o + c : c, r = this._events[u];
|
|
53
54
|
return r ? r.fn ? 1 : r.length : 0;
|
|
54
|
-
},
|
|
55
|
-
var
|
|
56
|
-
if (!this._events[
|
|
57
|
-
var g = this._events[
|
|
55
|
+
}, l.prototype.emit = function(c, u, r, b, y, h) {
|
|
56
|
+
var E = o ? o + c : c;
|
|
57
|
+
if (!this._events[E]) return !1;
|
|
58
|
+
var g = this._events[E], D = arguments.length, L, p;
|
|
58
59
|
if (g.fn) {
|
|
59
|
-
switch (g.once && this.removeListener(
|
|
60
|
+
switch (g.once && this.removeListener(c, g.fn, void 0, !0), D) {
|
|
60
61
|
case 1:
|
|
61
62
|
return g.fn.call(g.context), !0;
|
|
62
63
|
case 2:
|
|
@@ -66,17 +67,17 @@ var Ye = { exports: {} };
|
|
|
66
67
|
case 4:
|
|
67
68
|
return g.fn.call(g.context, u, r, b), !0;
|
|
68
69
|
case 5:
|
|
69
|
-
return g.fn.call(g.context, u, r, b,
|
|
70
|
+
return g.fn.call(g.context, u, r, b, y), !0;
|
|
70
71
|
case 6:
|
|
71
|
-
return g.fn.call(g.context, u, r, b,
|
|
72
|
+
return g.fn.call(g.context, u, r, b, y, h), !0;
|
|
72
73
|
}
|
|
73
|
-
for (p = 1,
|
|
74
|
-
|
|
75
|
-
g.fn.apply(g.context,
|
|
74
|
+
for (p = 1, L = new Array(D - 1); p < D; p++)
|
|
75
|
+
L[p - 1] = arguments[p];
|
|
76
|
+
g.fn.apply(g.context, L);
|
|
76
77
|
} else {
|
|
77
|
-
var C = g.length,
|
|
78
|
+
var C = g.length, F;
|
|
78
79
|
for (p = 0; p < C; p++)
|
|
79
|
-
switch (g[p].once && this.removeListener(
|
|
80
|
+
switch (g[p].once && this.removeListener(c, g[p].fn, void 0, !0), D) {
|
|
80
81
|
case 1:
|
|
81
82
|
g[p].fn.call(g[p].context);
|
|
82
83
|
break;
|
|
@@ -90,76 +91,76 @@ var Ye = { exports: {} };
|
|
|
90
91
|
g[p].fn.call(g[p].context, u, r, b);
|
|
91
92
|
break;
|
|
92
93
|
default:
|
|
93
|
-
if (!
|
|
94
|
-
|
|
95
|
-
g[p].fn.apply(g[p].context,
|
|
94
|
+
if (!L) for (F = 1, L = new Array(D - 1); F < D; F++)
|
|
95
|
+
L[F - 1] = arguments[F];
|
|
96
|
+
g[p].fn.apply(g[p].context, L);
|
|
96
97
|
}
|
|
97
98
|
}
|
|
98
99
|
return !0;
|
|
99
|
-
},
|
|
100
|
-
return i(this,
|
|
101
|
-
},
|
|
102
|
-
return i(this,
|
|
103
|
-
},
|
|
104
|
-
var
|
|
105
|
-
if (!this._events[
|
|
100
|
+
}, l.prototype.on = function(c, u, r) {
|
|
101
|
+
return i(this, c, u, r, !1);
|
|
102
|
+
}, l.prototype.once = function(c, u, r) {
|
|
103
|
+
return i(this, c, u, r, !0);
|
|
104
|
+
}, l.prototype.removeListener = function(c, u, r, b) {
|
|
105
|
+
var y = o ? o + c : c;
|
|
106
|
+
if (!this._events[y]) return this;
|
|
106
107
|
if (!u)
|
|
107
|
-
return
|
|
108
|
-
var
|
|
109
|
-
if (
|
|
110
|
-
|
|
108
|
+
return d(this, y), this;
|
|
109
|
+
var h = this._events[y];
|
|
110
|
+
if (h.fn)
|
|
111
|
+
h.fn === u && (!b || h.once) && (!r || h.context === r) && d(this, y);
|
|
111
112
|
else {
|
|
112
|
-
for (var
|
|
113
|
-
(
|
|
114
|
-
g.length ? this._events[
|
|
113
|
+
for (var E = 0, g = [], D = h.length; E < D; E++)
|
|
114
|
+
(h[E].fn !== u || b && !h[E].once || r && h[E].context !== r) && g.push(h[E]);
|
|
115
|
+
g.length ? this._events[y] = g.length === 1 ? g[0] : g : d(this, y);
|
|
115
116
|
}
|
|
116
117
|
return this;
|
|
117
|
-
},
|
|
118
|
+
}, l.prototype.removeAllListeners = function(c) {
|
|
118
119
|
var u;
|
|
119
|
-
return
|
|
120
|
-
},
|
|
121
|
-
})(
|
|
122
|
-
var
|
|
123
|
-
const
|
|
124
|
-
function
|
|
125
|
-
let
|
|
126
|
-
for (;
|
|
127
|
-
const o = window.getComputedStyle(
|
|
128
|
-
if (/(auto|scroll)/.test(o) &&
|
|
129
|
-
return
|
|
130
|
-
|
|
120
|
+
return c ? (u = o ? o + c : c, this._events[u] && d(this, u)) : (this._events = new n(), this._eventsCount = 0), this;
|
|
121
|
+
}, l.prototype.off = l.prototype.removeListener, l.prototype.addListener = l.prototype.on, l.prefixed = o, l.EventEmitter = l, t.exports = l;
|
|
122
|
+
})(Je);
|
|
123
|
+
var Pt = Je.exports;
|
|
124
|
+
const Vt = /* @__PURE__ */ St(Pt);
|
|
125
|
+
function jt(t) {
|
|
126
|
+
let s = t;
|
|
127
|
+
for (; s; ) {
|
|
128
|
+
const o = window.getComputedStyle(s).overflowY;
|
|
129
|
+
if (/(auto|scroll)/.test(o) && s.scrollHeight > s.clientHeight)
|
|
130
|
+
return s;
|
|
131
|
+
s = s.parentElement;
|
|
131
132
|
}
|
|
132
133
|
return document.scrollingElement || document.documentElement;
|
|
133
134
|
}
|
|
134
|
-
function
|
|
135
|
+
function Ut(t, s = { behavior: "smooth", block: "start" }) {
|
|
135
136
|
if (!t) return;
|
|
136
|
-
const o =
|
|
137
|
+
const o = jt(t), n = o.getBoundingClientRect(), i = t.getBoundingClientRect().top - n.top + o.scrollTop;
|
|
137
138
|
o.scrollTo({
|
|
138
|
-
top:
|
|
139
|
-
behavior:
|
|
139
|
+
top: s.block === "start" ? i : i - o.clientHeight + t.offsetHeight,
|
|
140
|
+
behavior: s.behavior
|
|
140
141
|
});
|
|
141
142
|
}
|
|
142
|
-
const
|
|
143
|
+
const _ = (t) => {
|
|
143
144
|
if (!["button", "options", "separator", "dropdown", "overflow"].includes(t.type))
|
|
144
145
|
throw new Error("Invalid toolbar item type - " + t.type);
|
|
145
146
|
if (t.type === "button" && !t.defaultLabel && !t.icon)
|
|
146
147
|
throw new Error("Toolbar button item needs either icon or label - " + t.name);
|
|
147
148
|
if (!t.name)
|
|
148
149
|
throw new Error("Invalid toolbar item name - " + t.name);
|
|
149
|
-
const o = v(
|
|
150
|
+
const o = v(At()), n = t.type, e = v(t.name), i = t.command, d = v(t.icon), l = v(t.group || "center"), a = v(t.allowWithoutEditor), c = v(t.attributes || {}), u = t.disabled || !1, r = v(t.disabled), b = v(!1), y = v(!1), h = v(t.style), E = v(t.isNarrow), g = v(t.isWide), D = v(t.minWidth), L = v(t.suppressActiveHighlight || !1), p = v(t.argument), C = v(null), F = v(null), z = v(t.iconColor), B = v(t.hasCaret), q = v(t.dropdownStyles), ge = v(t.tooltip), ve = v(t.tooltipVisible), ce = v(t.tooltipTimeout), de = v(t.defaultLabel), T = v(t.label), M = v(t.hideLabel), H = v(t.inlineTextInputVisible), R = v(t.hasInlineTextInput), X = v(t.markName), Z = v(t.labelAttr), ae = v(t.selectedValue), ue = v(t.dropdownValueKey), Ce = v([]);
|
|
150
151
|
if (t.options) {
|
|
151
152
|
if (!Array.isArray(t.options)) throw new Error("Invalid toolbar item options - " + t.options);
|
|
152
|
-
|
|
153
|
+
Ce.value.push(...t.options);
|
|
153
154
|
}
|
|
154
155
|
const Te = (te) => {
|
|
155
|
-
ee(te), !
|
|
156
|
-
},
|
|
157
|
-
|
|
158
|
-
},
|
|
156
|
+
ee(te), !L.value && (b.value = !0);
|
|
157
|
+
}, Fe = () => {
|
|
158
|
+
xe(), b.value = !1;
|
|
159
|
+
}, Ie = (te) => {
|
|
159
160
|
r.value = te;
|
|
160
|
-
},
|
|
161
|
+
}, _e = () => {
|
|
161
162
|
r.value = u;
|
|
162
|
-
}, ee = t.onActivate || (() => null),
|
|
163
|
+
}, ee = t.onActivate || (() => null), xe = t.onDeactivate || (() => null), Le = () => {
|
|
163
164
|
const te = {};
|
|
164
165
|
return Object.keys(me).forEach((ye) => {
|
|
165
166
|
me[ye].value !== void 0 && (te[ye] = me[ye].value);
|
|
@@ -169,89 +170,90 @@ const x = (t) => {
|
|
|
169
170
|
name: e,
|
|
170
171
|
type: n,
|
|
171
172
|
command: i,
|
|
172
|
-
icon:
|
|
173
|
-
tooltip:
|
|
174
|
-
group:
|
|
175
|
-
attributes:
|
|
173
|
+
icon: d,
|
|
174
|
+
tooltip: ge,
|
|
175
|
+
group: l,
|
|
176
|
+
attributes: c,
|
|
176
177
|
disabled: r,
|
|
177
178
|
active: b,
|
|
178
|
-
expand:
|
|
179
|
-
nestedOptions:
|
|
180
|
-
style:
|
|
181
|
-
isNarrow:
|
|
179
|
+
expand: y,
|
|
180
|
+
nestedOptions: Ce,
|
|
181
|
+
style: h,
|
|
182
|
+
isNarrow: E,
|
|
182
183
|
isWide: g,
|
|
183
|
-
minWidth:
|
|
184
|
+
minWidth: D,
|
|
184
185
|
argument: p,
|
|
185
|
-
parentItem:
|
|
186
|
-
iconColor:
|
|
187
|
-
hasCaret:
|
|
186
|
+
parentItem: F,
|
|
187
|
+
iconColor: z,
|
|
188
|
+
hasCaret: B,
|
|
189
|
+
dropdownStyles: q,
|
|
188
190
|
tooltipVisible: ve,
|
|
189
191
|
tooltipTimeout: ce,
|
|
190
192
|
defaultLabel: de,
|
|
191
|
-
label:
|
|
192
|
-
hideLabel:
|
|
193
|
-
inlineTextInputVisible:
|
|
194
|
-
hasInlineTextInput:
|
|
195
|
-
markName:
|
|
196
|
-
labelAttr:
|
|
193
|
+
label: T,
|
|
194
|
+
hideLabel: M,
|
|
195
|
+
inlineTextInputVisible: H,
|
|
196
|
+
hasInlineTextInput: R,
|
|
197
|
+
markName: X,
|
|
198
|
+
labelAttr: Z,
|
|
197
199
|
childItem: C,
|
|
198
200
|
allowWithoutEditor: a,
|
|
199
201
|
dropdownValueKey: ue,
|
|
200
|
-
selectedValue:
|
|
202
|
+
selectedValue: ae
|
|
201
203
|
};
|
|
202
204
|
return {
|
|
203
205
|
...me,
|
|
204
|
-
unref:
|
|
206
|
+
unref: Le,
|
|
205
207
|
activate: Te,
|
|
206
|
-
deactivate:
|
|
207
|
-
setDisabled:
|
|
208
|
-
resetDisabled:
|
|
208
|
+
deactivate: Fe,
|
|
209
|
+
setDisabled: Ie,
|
|
210
|
+
resetDisabled: _e,
|
|
209
211
|
onActivate: ee,
|
|
210
|
-
onDeactivate:
|
|
212
|
+
onDeactivate: xe
|
|
211
213
|
};
|
|
212
|
-
},
|
|
214
|
+
}, qt = { class: "alignment-buttons" }, Gt = ["innerHTML"], Kt = ["innerHTML"], Xt = ["innerHTML"], Zt = ["innerHTML"], Yt = {
|
|
213
215
|
__name: "AlignmentButtons",
|
|
214
216
|
emits: ["select"],
|
|
215
|
-
setup(t, { emit:
|
|
216
|
-
const o =
|
|
217
|
+
setup(t, { emit: s }) {
|
|
218
|
+
const o = s, n = (e) => {
|
|
217
219
|
o("select", e);
|
|
218
220
|
};
|
|
219
|
-
return (e, i) => (
|
|
220
|
-
|
|
221
|
+
return (e, i) => (w(), k("div", qt, [
|
|
222
|
+
x("div", {
|
|
221
223
|
class: "button-icon",
|
|
222
|
-
onClick: i[0] || (i[0] = (
|
|
223
|
-
innerHTML: $(
|
|
224
|
-
}, null, 8,
|
|
225
|
-
|
|
224
|
+
onClick: i[0] || (i[0] = (d) => n("left")),
|
|
225
|
+
innerHTML: $(G).alignLeft
|
|
226
|
+
}, null, 8, Gt),
|
|
227
|
+
x("div", {
|
|
226
228
|
class: "button-icon",
|
|
227
|
-
onClick: i[1] || (i[1] = (
|
|
228
|
-
innerHTML: $(
|
|
229
|
-
}, null, 8,
|
|
230
|
-
|
|
229
|
+
onClick: i[1] || (i[1] = (d) => n("center")),
|
|
230
|
+
innerHTML: $(G).alignCenter
|
|
231
|
+
}, null, 8, Kt),
|
|
232
|
+
x("div", {
|
|
231
233
|
class: "button-icon",
|
|
232
|
-
onClick: i[2] || (i[2] = (
|
|
233
|
-
innerHTML: $(
|
|
234
|
-
}, null, 8,
|
|
235
|
-
|
|
234
|
+
onClick: i[2] || (i[2] = (d) => n("right")),
|
|
235
|
+
innerHTML: $(G).alignRight
|
|
236
|
+
}, null, 8, Xt),
|
|
237
|
+
x("div", {
|
|
236
238
|
class: "button-icon",
|
|
237
|
-
onClick: i[3] || (i[3] = (
|
|
238
|
-
innerHTML: $(
|
|
239
|
-
}, null, 8,
|
|
239
|
+
onClick: i[3] || (i[3] = (d) => n("justify")),
|
|
240
|
+
innerHTML: $(G).alignJustify
|
|
241
|
+
}, null, 8, Zt)
|
|
240
242
|
]));
|
|
241
243
|
}
|
|
242
|
-
},
|
|
244
|
+
}, Jt = /* @__PURE__ */ K(Yt, [["__scopeId", "data-v-d6fae878"]]), Qt = { class: "link-input-ctn" }, en = {
|
|
243
245
|
key: 0,
|
|
244
246
|
class: "link-title"
|
|
245
|
-
},
|
|
247
|
+
}, tn = {
|
|
246
248
|
key: 1,
|
|
247
249
|
class: "link-title"
|
|
248
|
-
},
|
|
250
|
+
}, nn = {
|
|
249
251
|
key: 2,
|
|
250
252
|
class: "link-title"
|
|
251
|
-
},
|
|
253
|
+
}, on = { key: 3 }, sn = { class: "input-row" }, ln = ["innerHTML"], an = ["onKeydown"], rn = ["innerHTML"], cn = { class: "input-row link-buttons" }, dn = ["innerHTML"], un = {
|
|
252
254
|
key: 4,
|
|
253
255
|
class: "input-row go-to-anchor clickable"
|
|
254
|
-
},
|
|
256
|
+
}, mn = {
|
|
255
257
|
__name: "LinkInput",
|
|
256
258
|
props: {
|
|
257
259
|
initialText: {
|
|
@@ -277,88 +279,88 @@ const x = (t) => {
|
|
|
277
279
|
}
|
|
278
280
|
},
|
|
279
281
|
emits: ["submit", "cancel"],
|
|
280
|
-
setup(t, { emit:
|
|
281
|
-
const o =
|
|
282
|
-
if (e?.$submit instanceof Function && e.$submit(),
|
|
282
|
+
setup(t, { emit: s }) {
|
|
283
|
+
const o = s, n = t, { proxy: e } = It(), i = () => {
|
|
284
|
+
if (e?.$submit instanceof Function && e.$submit(), c.value && r.value) {
|
|
283
285
|
o("submit", { text: a.value, href: u.value });
|
|
284
286
|
return;
|
|
285
|
-
} else if (!
|
|
287
|
+
} else if (!c.value) {
|
|
286
288
|
o("submit", { text: a.value, href: null });
|
|
287
289
|
return;
|
|
288
290
|
}
|
|
289
|
-
console.debug("[LinkInput] Invalid URL in handleSubmit"),
|
|
290
|
-
},
|
|
291
|
+
console.debug("[LinkInput] Invalid URL in handleSubmit"), l.value = !0;
|
|
292
|
+
}, d = () => {
|
|
291
293
|
o("submit", { text: a.value, href: null });
|
|
292
|
-
},
|
|
294
|
+
}, l = v(!1), a = v(n.initialText), c = v(n.href), u = j(() => c.value?.startsWith("http") ? c.value : "http://" + c.value), r = j(() => {
|
|
293
295
|
const p = u.value.split(".").filter(Boolean);
|
|
294
296
|
return u.value.includes(".") && p.length > 1;
|
|
295
|
-
}), b =
|
|
297
|
+
}), b = j(() => h.value ? "Apply" : "Remove"), y = j(() => !r.value), h = j(() => !E.value), E = j(() => n.href && !c.value), g = j(() => n.href.startsWith("#")), D = () => {
|
|
296
298
|
window.open(u.value, "_blank");
|
|
297
299
|
};
|
|
298
|
-
|
|
300
|
+
Lt(
|
|
299
301
|
() => n.href,
|
|
300
302
|
(p) => {
|
|
301
|
-
|
|
303
|
+
c.value = p;
|
|
302
304
|
}
|
|
303
305
|
);
|
|
304
|
-
const
|
|
306
|
+
const L = () => {
|
|
305
307
|
const p = document.querySelector(".link-input-ctn input");
|
|
306
308
|
p && p.focus();
|
|
307
309
|
};
|
|
308
|
-
return
|
|
309
|
-
n.showInput &&
|
|
310
|
-
}), (p, C) => (
|
|
311
|
-
t.href ? g.value ? (
|
|
312
|
-
t.showInput && !g.value ? (
|
|
313
|
-
|
|
314
|
-
|
|
310
|
+
return ke(() => {
|
|
311
|
+
n.showInput && L();
|
|
312
|
+
}), (p, C) => (w(), k("div", Qt, [
|
|
313
|
+
t.href ? g.value ? (w(), k("div", tn, "Page anchor")) : (w(), k("div", nn, "Edit link")) : (w(), k("div", en, "Add link")),
|
|
314
|
+
t.showInput && !g.value ? (w(), k("div", on, [
|
|
315
|
+
x("div", sn, [
|
|
316
|
+
x("div", {
|
|
315
317
|
class: "input-icon",
|
|
316
|
-
innerHTML: $(
|
|
317
|
-
}, null, 8,
|
|
318
|
-
|
|
318
|
+
innerHTML: $(G).linkInput
|
|
319
|
+
}, null, 8, ln),
|
|
320
|
+
Mt(x("input", {
|
|
319
321
|
type: "text",
|
|
320
322
|
placeholder: "Type or paste a link",
|
|
321
|
-
class: oe({ error:
|
|
322
|
-
"onUpdate:modelValue": C[0] || (C[0] = (
|
|
323
|
+
class: oe({ error: l.value }),
|
|
324
|
+
"onUpdate:modelValue": C[0] || (C[0] = (F) => c.value = F),
|
|
323
325
|
onKeydown: [
|
|
324
|
-
|
|
325
|
-
C[1] || (C[1] = (
|
|
326
|
+
Dt(we(i, ["stop", "prevent"]), ["enter"]),
|
|
327
|
+
C[1] || (C[1] = (F) => l.value = !1)
|
|
326
328
|
]
|
|
327
|
-
}, null, 42,
|
|
328
|
-
[
|
|
329
|
+
}, null, 42, an), [
|
|
330
|
+
[$t, c.value]
|
|
329
331
|
]),
|
|
330
|
-
|
|
332
|
+
x("div", {
|
|
331
333
|
class: oe(["open-link-icon", { disabled: !r.value }]),
|
|
332
|
-
innerHTML: $(
|
|
333
|
-
onClick:
|
|
334
|
-
}, null, 10,
|
|
334
|
+
innerHTML: $(G).openLink,
|
|
335
|
+
onClick: D
|
|
336
|
+
}, null, 10, rn)
|
|
335
337
|
]),
|
|
336
|
-
|
|
337
|
-
t.href ? (
|
|
338
|
+
x("div", cn, [
|
|
339
|
+
t.href ? (w(), k("button", {
|
|
338
340
|
key: 0,
|
|
339
341
|
class: "remove-btn",
|
|
340
|
-
onClick:
|
|
342
|
+
onClick: d
|
|
341
343
|
}, [
|
|
342
|
-
|
|
344
|
+
x("div", {
|
|
343
345
|
class: "remove-btn__icon",
|
|
344
|
-
innerHTML: $(
|
|
345
|
-
}, null, 8,
|
|
346
|
-
C[3] || (C[3] =
|
|
346
|
+
innerHTML: $(G).removeLink
|
|
347
|
+
}, null, 8, dn),
|
|
348
|
+
C[3] || (C[3] = Ht(" Remove "))
|
|
347
349
|
])) : ne("", !0),
|
|
348
|
-
|
|
350
|
+
h.value ? (w(), k("button", {
|
|
349
351
|
key: 1,
|
|
350
|
-
class: oe(["submit-btn", { "disable-btn":
|
|
352
|
+
class: oe(["submit-btn", { "disable-btn": y.value }]),
|
|
351
353
|
onClick: i
|
|
352
354
|
}, ie(b.value), 3)) : ne("", !0)
|
|
353
355
|
])
|
|
354
|
-
])) : g.value ? (
|
|
355
|
-
|
|
356
|
-
onClick: C[2] || (C[2] =
|
|
356
|
+
])) : g.value ? (w(), k("div", un, [
|
|
357
|
+
x("a", {
|
|
358
|
+
onClick: C[2] || (C[2] = we((...F) => t.goToAnchor && t.goToAnchor(...F), ["stop", "prevent"]))
|
|
357
359
|
}, "Go to " + ie(t.href.startsWith("#_") ? t.href.substring(2) : t.href), 1)
|
|
358
360
|
])) : ne("", !0)
|
|
359
361
|
]));
|
|
360
362
|
}
|
|
361
|
-
},
|
|
363
|
+
}, pn = /* @__PURE__ */ K(mn, [["__scopeId", "data-v-6990d5b2"]]), fn = { class: "document-mode" }, hn = ["onClick"], gn = { class: "document-mode-column icon-column" }, vn = ["innerHTML"], yn = { class: "document-mode-column text-column" }, bn = { class: "document-mode-type" }, wn = { class: "document-mode-description" }, kn = {
|
|
362
364
|
__name: "DocumentMode",
|
|
363
365
|
props: {
|
|
364
366
|
options: {
|
|
@@ -366,32 +368,32 @@ const x = (t) => {
|
|
|
366
368
|
}
|
|
367
369
|
},
|
|
368
370
|
emits: ["select"],
|
|
369
|
-
setup(t, { emit:
|
|
370
|
-
const o =
|
|
371
|
+
setup(t, { emit: s }) {
|
|
372
|
+
const o = s, n = (e) => {
|
|
371
373
|
o("select", e);
|
|
372
374
|
};
|
|
373
|
-
return (e, i) => (
|
|
374
|
-
(
|
|
375
|
-
class: oe(["option-item", { disabled:
|
|
376
|
-
onClick: (
|
|
375
|
+
return (e, i) => (w(), k("div", fn, [
|
|
376
|
+
(w(!0), k(U, null, Q(t.options, (d) => (w(), k("div", {
|
|
377
|
+
class: oe(["option-item", { disabled: d.disabled }]),
|
|
378
|
+
onClick: (l) => n(d)
|
|
377
379
|
}, [
|
|
378
|
-
|
|
379
|
-
|
|
380
|
+
x("div", gn, [
|
|
381
|
+
x("div", {
|
|
380
382
|
class: "icon-column__icon",
|
|
381
|
-
innerHTML:
|
|
382
|
-
}, null, 8,
|
|
383
|
+
innerHTML: d.icon
|
|
384
|
+
}, null, 8, vn)
|
|
383
385
|
]),
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
386
|
+
x("div", yn, [
|
|
387
|
+
x("div", bn, ie(d.label), 1),
|
|
388
|
+
x("div", wn, ie(d.description), 1)
|
|
387
389
|
])
|
|
388
|
-
], 10,
|
|
390
|
+
], 10, hn))), 256))
|
|
389
391
|
]));
|
|
390
392
|
}
|
|
391
|
-
},
|
|
393
|
+
}, Cn = /* @__PURE__ */ K(kn, [["__scopeId", "data-v-f86e1477"]]), _n = {
|
|
392
394
|
key: 0,
|
|
393
395
|
class: "linked-style-buttons"
|
|
394
|
-
},
|
|
396
|
+
}, xn = ["onClick"], En = {
|
|
395
397
|
__name: "LinkedStyle",
|
|
396
398
|
props: {
|
|
397
399
|
editor: {
|
|
@@ -400,23 +402,23 @@ const x = (t) => {
|
|
|
400
402
|
}
|
|
401
403
|
},
|
|
402
404
|
emits: ["select"],
|
|
403
|
-
setup(t, { emit:
|
|
404
|
-
const o =
|
|
405
|
+
setup(t, { emit: s }) {
|
|
406
|
+
const o = s, n = t, e = (i) => {
|
|
405
407
|
o("select", i);
|
|
406
408
|
};
|
|
407
|
-
return (i,
|
|
408
|
-
(
|
|
409
|
+
return (i, d) => n.editor ? (w(), k("div", _n, [
|
|
410
|
+
(w(!0), k(U, null, Q($(Ke)(t.editor), (l) => (w(), k("div", {
|
|
409
411
|
class: "style-item",
|
|
410
|
-
onClick: (a) => e(
|
|
412
|
+
onClick: (a) => e(l)
|
|
411
413
|
}, [
|
|
412
|
-
|
|
414
|
+
x("div", {
|
|
413
415
|
class: "style-name",
|
|
414
|
-
style:
|
|
415
|
-
}, ie(
|
|
416
|
-
], 8,
|
|
416
|
+
style: J($(pt)(l, null, !1))
|
|
417
|
+
}, ie(l.definition.attrs.name), 5)
|
|
418
|
+
], 8, xn))), 256))
|
|
417
419
|
])) : ne("", !0);
|
|
418
420
|
}
|
|
419
|
-
},
|
|
421
|
+
}, Sn = /* @__PURE__ */ K(En, [["__scopeId", "data-v-97e3296a"]]), An = ["onClick"], Tn = ["innerHTML"], Fn = ["innerHTML"], In = {
|
|
420
422
|
__name: "IconGridRow",
|
|
421
423
|
props: {
|
|
422
424
|
icons: {
|
|
@@ -429,36 +431,36 @@ const x = (t) => {
|
|
|
429
431
|
}
|
|
430
432
|
},
|
|
431
433
|
emits: ["select"],
|
|
432
|
-
setup(t, { emit:
|
|
433
|
-
const o =
|
|
434
|
-
o("select",
|
|
434
|
+
setup(t, { emit: s }) {
|
|
435
|
+
const o = s, n = t, e = j(() => (l) => n.activeColor.value ? n.activeColor.value.toUpperCase() === l.value : !1), i = (l, a) => a === 5 || ["#FFFFFF", "#FAFF09"].includes(l) ? { color: "#000" } : { color: "#FFF" }, d = (l) => {
|
|
436
|
+
o("select", l.value);
|
|
435
437
|
};
|
|
436
|
-
return
|
|
438
|
+
return ke(() => {
|
|
437
439
|
if (!n.icons.every((a) => Array.isArray(a))) throw new Error("icon props must be 2d array");
|
|
438
|
-
}), (
|
|
440
|
+
}), (l, a) => (w(!0), k(U, null, Q(t.icons, (c, u) => (w(), k("div", {
|
|
439
441
|
class: "option-row",
|
|
440
442
|
key: u
|
|
441
443
|
}, [
|
|
442
|
-
(
|
|
444
|
+
(w(!0), k(U, null, Q(c, (r, b) => (w(), k("div", {
|
|
443
445
|
class: "option",
|
|
444
446
|
key: b,
|
|
445
|
-
onClick:
|
|
447
|
+
onClick: we((y) => d(r), ["stop", "prevent"])
|
|
446
448
|
}, [
|
|
447
|
-
|
|
449
|
+
x("div", {
|
|
448
450
|
class: "option__icon",
|
|
449
451
|
innerHTML: r.icon,
|
|
450
|
-
style:
|
|
451
|
-
}, null, 12,
|
|
452
|
-
e.value(r) ? (
|
|
452
|
+
style: J(r.style)
|
|
453
|
+
}, null, 12, Tn),
|
|
454
|
+
e.value(r) ? (w(), k("div", {
|
|
453
455
|
key: 0,
|
|
454
456
|
class: "option__check",
|
|
455
|
-
innerHTML: $(
|
|
456
|
-
style:
|
|
457
|
-
}, null, 12,
|
|
458
|
-
], 8,
|
|
457
|
+
innerHTML: $(G).colorOptionCheck,
|
|
458
|
+
style: J(i(r.value, b))
|
|
459
|
+
}, null, 12, Fn)) : ne("", !0)
|
|
460
|
+
], 8, An))), 128))
|
|
459
461
|
]))), 128));
|
|
460
462
|
}
|
|
461
|
-
},
|
|
463
|
+
}, Ge = /* @__PURE__ */ K(In, [["__scopeId", "data-v-6a2a9a40"]]), Ln = { class: "option-grid-ctn" }, Mn = {
|
|
462
464
|
__name: "IconGrid",
|
|
463
465
|
props: {
|
|
464
466
|
icons: {
|
|
@@ -475,19 +477,19 @@ const x = (t) => {
|
|
|
475
477
|
}
|
|
476
478
|
},
|
|
477
479
|
emits: ["select", "clickoutside"],
|
|
478
|
-
setup(t, { emit:
|
|
479
|
-
const o =
|
|
480
|
+
setup(t, { emit: s }) {
|
|
481
|
+
const o = s, n = (e) => {
|
|
480
482
|
o("select", e);
|
|
481
483
|
};
|
|
482
|
-
return (e, i) => (
|
|
483
|
-
V(
|
|
484
|
+
return (e, i) => (w(), k("div", Ln, [
|
|
485
|
+
V(Ge, {
|
|
484
486
|
icons: t.icons,
|
|
485
487
|
"active-color": t.activeColor,
|
|
486
488
|
onSelect: n
|
|
487
489
|
}, null, 8, ["icons", "active-color"]),
|
|
488
|
-
t.customIcons.flat().length ? (
|
|
489
|
-
i[0] || (i[0] =
|
|
490
|
-
V(
|
|
490
|
+
t.customIcons.flat().length ? (w(), k(U, { key: 0 }, [
|
|
491
|
+
i[0] || (i[0] = x("span", { class: "option-grid-ctn__subtitle" }, "Custom colors", -1)),
|
|
492
|
+
V(Ge, {
|
|
491
493
|
icons: t.customIcons,
|
|
492
494
|
"active-color": t.activeColor,
|
|
493
495
|
onSelect: n
|
|
@@ -495,30 +497,30 @@ const x = (t) => {
|
|
|
495
497
|
], 64)) : ne("", !0)
|
|
496
498
|
]));
|
|
497
499
|
}
|
|
498
|
-
},
|
|
500
|
+
}, Dn = /* @__PURE__ */ K(Mn, [["__scopeId", "data-v-fa2949d8"]]), $n = (t) => {
|
|
499
501
|
t.expand.value = !1;
|
|
500
|
-
}, f = (t,
|
|
501
|
-
label:
|
|
502
|
-
icon:
|
|
502
|
+
}, f = (t, s = null) => ({
|
|
503
|
+
label: s,
|
|
504
|
+
icon: G.colorOption,
|
|
503
505
|
value: t,
|
|
504
506
|
style: {
|
|
505
507
|
color: t,
|
|
506
508
|
boxShadow: "0 0 5px 1px rgba(0, 0, 0, 0.1)",
|
|
507
509
|
borderRadius: "50%"
|
|
508
510
|
}
|
|
509
|
-
}),
|
|
511
|
+
}), Ne = (t, s, o = []) => {
|
|
510
512
|
const n = (e) => {
|
|
511
|
-
|
|
513
|
+
s.iconColor.value = e, t.emitCommand({ item: s, argument: e }), $n(s);
|
|
512
514
|
};
|
|
513
|
-
return
|
|
514
|
-
|
|
515
|
-
icons:
|
|
515
|
+
return N("div", {}, [
|
|
516
|
+
N(Dn, {
|
|
517
|
+
icons: Qe,
|
|
516
518
|
customIcons: o,
|
|
517
|
-
activeColor:
|
|
519
|
+
activeColor: s.iconColor,
|
|
518
520
|
onSelect: n
|
|
519
521
|
})
|
|
520
522
|
]);
|
|
521
|
-
},
|
|
523
|
+
}, Qe = [
|
|
522
524
|
[
|
|
523
525
|
f("#111111"),
|
|
524
526
|
f("#333333"),
|
|
@@ -591,44 +593,44 @@ const x = (t) => {
|
|
|
591
593
|
f("#DFCDF2"),
|
|
592
594
|
f("#A91DFF")
|
|
593
595
|
]
|
|
594
|
-
],
|
|
596
|
+
], Hn = () => Qe.flat().map((t) => t.value), Bn = { class: "toolbar-table-grid-wrapper" }, Rn = ["data-cols", "data-rows", "onClick"], On = { class: "toolbar-table-grid-value" }, Nn = {
|
|
595
597
|
__name: "TableGrid",
|
|
596
598
|
emits: ["select", "clickoutside"],
|
|
597
|
-
setup(t, { emit:
|
|
598
|
-
const o =
|
|
599
|
-
let a =
|
|
599
|
+
setup(t, { emit: s }) {
|
|
600
|
+
const o = s, n = v(0), e = v(0), i = (l) => {
|
|
601
|
+
let a = l.target;
|
|
600
602
|
if (!!a.dataset.grid)
|
|
601
603
|
return;
|
|
602
|
-
let r = [...a.parentElement.querySelectorAll("[data-item]")], b = parseInt(a.dataset.cols, 10),
|
|
603
|
-
e.value = b, n.value =
|
|
604
|
-
for (let
|
|
605
|
-
let
|
|
606
|
-
g <= b &&
|
|
604
|
+
let r = [...a.parentElement.querySelectorAll("[data-item]")], b = parseInt(a.dataset.cols, 10), y = parseInt(a.dataset.rows, 10);
|
|
605
|
+
e.value = b, n.value = y;
|
|
606
|
+
for (let h = 0; h < r.length; h++) {
|
|
607
|
+
let E = r[h], g = parseInt(E.dataset.cols, 10), D = parseInt(E.dataset.rows, 10);
|
|
608
|
+
g <= b && D <= y ? E.classList.add("selected") : E.classList.remove("selected");
|
|
607
609
|
}
|
|
608
|
-
},
|
|
609
|
-
o("select", { cols:
|
|
610
|
+
}, d = ({ cols: l, rows: a }) => {
|
|
611
|
+
o("select", { cols: l, rows: a });
|
|
610
612
|
};
|
|
611
|
-
return (
|
|
612
|
-
|
|
613
|
+
return (l, a) => (w(), k("div", Bn, [
|
|
614
|
+
x("div", {
|
|
613
615
|
class: "toolbar-table-grid",
|
|
614
616
|
onMouseover: i,
|
|
615
617
|
"data-grid": "true"
|
|
616
618
|
}, [
|
|
617
|
-
(
|
|
618
|
-
(
|
|
619
|
+
(w(), k(U, null, Q(5, (c) => (w(), k(U, { key: c }, [
|
|
620
|
+
(w(), k(U, null, Q(5, (u) => x("div", {
|
|
619
621
|
class: "toolbar-table-grid__item",
|
|
620
|
-
key: `${
|
|
622
|
+
key: `${c}_${u}`,
|
|
621
623
|
"data-cols": u,
|
|
622
|
-
"data-rows":
|
|
624
|
+
"data-rows": c,
|
|
623
625
|
"data-item": "true",
|
|
624
|
-
onClick:
|
|
625
|
-
}, null, 8,
|
|
626
|
+
onClick: we((r) => d({ cols: u, rows: c }), ["stop", "prevent"])
|
|
627
|
+
}, null, 8, Rn)), 64))
|
|
626
628
|
], 64))), 64))
|
|
627
629
|
], 32),
|
|
628
|
-
|
|
630
|
+
x("div", On, ie(n.value) + " x " + ie(e.value), 1)
|
|
629
631
|
]));
|
|
630
632
|
}
|
|
631
|
-
},
|
|
633
|
+
}, zn = /* @__PURE__ */ K(Nn, [["__scopeId", "data-v-06352ab9"]]), Wn = { class: "toolbar-table-actions" }, Pn = ["onClick"], Vn = { class: "toolbar-table-actions__icon" }, jn = ["innerHTML"], Un = { class: "toolbar-table-actions__label" }, qn = {
|
|
632
634
|
__name: "TableActions",
|
|
633
635
|
props: {
|
|
634
636
|
options: {
|
|
@@ -636,36 +638,36 @@ const x = (t) => {
|
|
|
636
638
|
}
|
|
637
639
|
},
|
|
638
640
|
emits: ["select"],
|
|
639
|
-
setup(t, { emit:
|
|
640
|
-
const o =
|
|
641
|
+
setup(t, { emit: s }) {
|
|
642
|
+
const o = s, n = (e) => {
|
|
641
643
|
o("select", { command: e.command });
|
|
642
644
|
};
|
|
643
|
-
return (e, i) => (
|
|
644
|
-
(
|
|
645
|
-
class: oe(["toolbar-table-actions__item", { "toolbar-table-actions__item--border":
|
|
646
|
-
onClick: (
|
|
645
|
+
return (e, i) => (w(), k("div", Wn, [
|
|
646
|
+
(w(!0), k(U, null, Q(t.options, (d) => (w(), k("div", {
|
|
647
|
+
class: oe(["toolbar-table-actions__item", { "toolbar-table-actions__item--border": d.bottomBorder }]),
|
|
648
|
+
onClick: (l) => n(d)
|
|
647
649
|
}, [
|
|
648
|
-
|
|
649
|
-
|
|
650
|
+
x("div", Vn, [
|
|
651
|
+
x("div", {
|
|
650
652
|
class: "toolbar-table-actions__icon-wrapper",
|
|
651
|
-
innerHTML:
|
|
652
|
-
}, null, 8,
|
|
653
|
+
innerHTML: d.icon
|
|
654
|
+
}, null, 8, jn)
|
|
653
655
|
]),
|
|
654
|
-
|
|
655
|
-
], 10,
|
|
656
|
+
x("div", Un, ie(d.label), 1)
|
|
657
|
+
], 10, Pn))), 256))
|
|
656
658
|
]));
|
|
657
659
|
}
|
|
658
|
-
},
|
|
659
|
-
`,
|
|
660
|
+
}, Gn = /* @__PURE__ */ K(qn, [["__scopeId", "data-v-9a702d7f"]]), Kn = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"/></svg>
|
|
661
|
+
`, le = (t) => {
|
|
660
662
|
t.expand.value = !1;
|
|
661
|
-
},
|
|
662
|
-
const i =
|
|
663
|
+
}, Xn = (t, s = !1, o, n, e) => {
|
|
664
|
+
const i = _({
|
|
663
665
|
type: "button",
|
|
664
666
|
name: "bold",
|
|
665
667
|
command: "toggleBold",
|
|
666
668
|
icon: e.bold,
|
|
667
669
|
tooltip: "Bold"
|
|
668
|
-
}),
|
|
670
|
+
}), d = _({
|
|
669
671
|
type: "dropdown",
|
|
670
672
|
name: "fontFamily",
|
|
671
673
|
tooltip: "Font",
|
|
@@ -713,10 +715,51 @@ const x = (t) => {
|
|
|
713
715
|
}
|
|
714
716
|
],
|
|
715
717
|
onActivate: ({ fontFamily: m }) => {
|
|
716
|
-
m && (
|
|
718
|
+
m && (d.label.value = m);
|
|
717
719
|
},
|
|
718
|
-
onDeactivate: () =>
|
|
719
|
-
}),
|
|
720
|
+
onDeactivate: () => d.label.value = d.defaultLabel.value
|
|
721
|
+
}), l = _({
|
|
722
|
+
type: "dropdown",
|
|
723
|
+
dropdownStyles: {
|
|
724
|
+
padding: 0,
|
|
725
|
+
outline: "none"
|
|
726
|
+
},
|
|
727
|
+
name: "ai",
|
|
728
|
+
tooltip: "AI Insights",
|
|
729
|
+
icon: e.ai,
|
|
730
|
+
hideLabel: !0,
|
|
731
|
+
hasCaret: !1,
|
|
732
|
+
isWide: !0,
|
|
733
|
+
suppressActiveHighlight: !0,
|
|
734
|
+
options: [
|
|
735
|
+
{
|
|
736
|
+
type: "render",
|
|
737
|
+
key: "ai",
|
|
738
|
+
render: () => {
|
|
739
|
+
let m = "";
|
|
740
|
+
if (t.activeEditor) {
|
|
741
|
+
const { state: A } = t.activeEditor, { from: P, to: se, empty: dt } = A.selection;
|
|
742
|
+
m = dt ? "" : A.doc.textBetween(P, se);
|
|
743
|
+
}
|
|
744
|
+
return N(
|
|
745
|
+
"div",
|
|
746
|
+
{},
|
|
747
|
+
[
|
|
748
|
+
N(Wt, {
|
|
749
|
+
handleClose: () => {
|
|
750
|
+
le(l);
|
|
751
|
+
},
|
|
752
|
+
selectedText: m,
|
|
753
|
+
editor: t.activeEditor,
|
|
754
|
+
key: t.config.aiApiKey,
|
|
755
|
+
superToolbar: t
|
|
756
|
+
})
|
|
757
|
+
]
|
|
758
|
+
);
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
]
|
|
762
|
+
}), a = _({
|
|
720
763
|
type: "dropdown",
|
|
721
764
|
name: "fontSize",
|
|
722
765
|
defaultLabel: "12",
|
|
@@ -748,28 +791,28 @@ const x = (t) => {
|
|
|
748
791
|
{ label: "96", key: "96pt" }
|
|
749
792
|
],
|
|
750
793
|
onActivate: ({ fontSize: m }) => {
|
|
751
|
-
if (!m) return
|
|
752
|
-
let S =
|
|
753
|
-
S < 8 && (S = 8), S > 96 && (S = 96),
|
|
794
|
+
if (!m) return a.label.value = a.defaultLabel.value;
|
|
795
|
+
let S = Nt(m, 12);
|
|
796
|
+
S < 8 && (S = 8), S > 96 && (S = 96), a.label.value = String(S);
|
|
754
797
|
},
|
|
755
|
-
onDeactivate: () =>
|
|
756
|
-
}),
|
|
798
|
+
onDeactivate: () => a.label.value = a.defaultLabel.value
|
|
799
|
+
}), c = _({
|
|
757
800
|
type: "separator",
|
|
758
801
|
name: "separator",
|
|
759
802
|
isNarrow: !0
|
|
760
|
-
}),
|
|
803
|
+
}), u = _({
|
|
761
804
|
type: "button",
|
|
762
805
|
name: "italic",
|
|
763
806
|
command: "toggleItalic",
|
|
764
807
|
icon: e.italic,
|
|
765
808
|
tooltip: "Italic"
|
|
766
|
-
}),
|
|
809
|
+
}), r = _({
|
|
767
810
|
type: "button",
|
|
768
811
|
name: "underline",
|
|
769
812
|
command: "toggleUnderline",
|
|
770
813
|
icon: e.underline,
|
|
771
814
|
tooltip: "Underline"
|
|
772
|
-
}),
|
|
815
|
+
}), b = _({
|
|
773
816
|
type: "dropdown",
|
|
774
817
|
name: "highlight",
|
|
775
818
|
icon: e.highlight,
|
|
@@ -783,14 +826,14 @@ const x = (t) => {
|
|
|
783
826
|
{
|
|
784
827
|
key: "color",
|
|
785
828
|
type: "render",
|
|
786
|
-
render: () =>
|
|
829
|
+
render: () => Ne(t, b)
|
|
787
830
|
}
|
|
788
831
|
],
|
|
789
832
|
onActivate: ({ color: m }) => {
|
|
790
|
-
|
|
833
|
+
b.iconColor.value = m || "";
|
|
791
834
|
},
|
|
792
|
-
onDeactivate: () =>
|
|
793
|
-
}),
|
|
835
|
+
onDeactivate: () => b.iconColor.value = ""
|
|
836
|
+
}), y = _({
|
|
794
837
|
type: "dropdown",
|
|
795
838
|
name: "color",
|
|
796
839
|
icon: e.color,
|
|
@@ -804,14 +847,14 @@ const x = (t) => {
|
|
|
804
847
|
{
|
|
805
848
|
key: "color",
|
|
806
849
|
type: "render",
|
|
807
|
-
render: () =>
|
|
850
|
+
render: () => Ne(t, y)
|
|
808
851
|
}
|
|
809
852
|
],
|
|
810
853
|
onActivate: ({ color: m }) => {
|
|
811
|
-
|
|
854
|
+
y.iconColor.value = m;
|
|
812
855
|
},
|
|
813
|
-
onDeactivate: () =>
|
|
814
|
-
}), h =
|
|
856
|
+
onDeactivate: () => y.iconColor.value = "#000"
|
|
857
|
+
}), h = _({
|
|
815
858
|
type: "dropdown",
|
|
816
859
|
name: "link",
|
|
817
860
|
markName: "link",
|
|
@@ -821,7 +864,7 @@ const x = (t) => {
|
|
|
821
864
|
{
|
|
822
865
|
type: "render",
|
|
823
866
|
key: "linkDropdown",
|
|
824
|
-
render: () =>
|
|
867
|
+
render: () => E(h)
|
|
825
868
|
}
|
|
826
869
|
],
|
|
827
870
|
onActivate: ({ href: m }) => {
|
|
@@ -831,37 +874,37 @@ const x = (t) => {
|
|
|
831
874
|
h.attributes.value = {}, h.expand.value = !1;
|
|
832
875
|
}
|
|
833
876
|
});
|
|
834
|
-
function
|
|
835
|
-
return
|
|
836
|
-
|
|
837
|
-
onSubmit: ({ href:
|
|
838
|
-
|
|
839
|
-
const
|
|
840
|
-
t.emitCommand({ item:
|
|
877
|
+
function E(m) {
|
|
878
|
+
return N("div", {}, [
|
|
879
|
+
N(pn, {
|
|
880
|
+
onSubmit: ({ href: A }) => {
|
|
881
|
+
le(m), m.attributes.value.link = { href: A };
|
|
882
|
+
const P = { ...m, command: "toggleLink" };
|
|
883
|
+
t.emitCommand({ item: P, argument: { href: A, text: "" } }), A || (m.active.value = !1);
|
|
841
884
|
},
|
|
842
885
|
href: m.attributes.value.href,
|
|
843
886
|
goToAnchor: () => {
|
|
844
|
-
if (
|
|
845
|
-
const
|
|
846
|
-
|
|
887
|
+
if (le(m), !t.activeEditor || !m.attributes.value?.href) return;
|
|
888
|
+
const A = m.attributes.value?.href?.slice(1), se = t.activeEditor.element.querySelector(`a[name='${A}']`);
|
|
889
|
+
se && Ut(se);
|
|
847
890
|
}
|
|
848
891
|
})
|
|
849
892
|
]);
|
|
850
893
|
}
|
|
851
|
-
const
|
|
894
|
+
const g = _({
|
|
852
895
|
type: "options",
|
|
853
896
|
name: "linkInput",
|
|
854
897
|
command: "toggleLink"
|
|
855
898
|
});
|
|
856
|
-
h.childItem =
|
|
857
|
-
const
|
|
899
|
+
h.childItem = g, g.parentItem = h;
|
|
900
|
+
const D = _({
|
|
858
901
|
type: "button",
|
|
859
902
|
name: "image",
|
|
860
903
|
command: "startImageUpload",
|
|
861
904
|
icon: e.image,
|
|
862
905
|
tooltip: "Image",
|
|
863
906
|
disabled: !1
|
|
864
|
-
}),
|
|
907
|
+
}), L = _({
|
|
865
908
|
type: "dropdown",
|
|
866
909
|
name: "table",
|
|
867
910
|
icon: e.table,
|
|
@@ -874,20 +917,20 @@ const x = (t) => {
|
|
|
874
917
|
{
|
|
875
918
|
key: "table",
|
|
876
919
|
type: "render",
|
|
877
|
-
render: () =>
|
|
920
|
+
render: () => p(L)
|
|
878
921
|
}
|
|
879
922
|
]
|
|
880
923
|
});
|
|
881
|
-
function
|
|
882
|
-
return
|
|
883
|
-
|
|
884
|
-
onSelect: (
|
|
885
|
-
t.emitCommand({ item: m, argument:
|
|
924
|
+
function p(m) {
|
|
925
|
+
return N("div", {}, [
|
|
926
|
+
N(zn, {
|
|
927
|
+
onSelect: (A) => {
|
|
928
|
+
t.emitCommand({ item: m, argument: A }), le(m);
|
|
886
929
|
}
|
|
887
930
|
})
|
|
888
931
|
]);
|
|
889
932
|
}
|
|
890
|
-
const
|
|
933
|
+
const C = _({
|
|
891
934
|
type: "dropdown",
|
|
892
935
|
name: "tableActions",
|
|
893
936
|
command: "executeTableCommand",
|
|
@@ -897,10 +940,10 @@ const x = (t) => {
|
|
|
897
940
|
options: [
|
|
898
941
|
{
|
|
899
942
|
type: "render",
|
|
900
|
-
render: () =>
|
|
943
|
+
render: () => z(C)
|
|
901
944
|
}
|
|
902
945
|
]
|
|
903
|
-
}),
|
|
946
|
+
}), F = [
|
|
904
947
|
{
|
|
905
948
|
label: "Insert row above",
|
|
906
949
|
command: "addRowBefore",
|
|
@@ -959,17 +1002,17 @@ const x = (t) => {
|
|
|
959
1002
|
icon: e.fixTables
|
|
960
1003
|
}
|
|
961
1004
|
];
|
|
962
|
-
function
|
|
963
|
-
return
|
|
964
|
-
options:
|
|
1005
|
+
function z(m) {
|
|
1006
|
+
return N(Gn, {
|
|
1007
|
+
options: F,
|
|
965
1008
|
onSelect: (S) => {
|
|
966
|
-
|
|
967
|
-
const { command:
|
|
968
|
-
t.emitCommand({ item: m, argument: { command:
|
|
1009
|
+
le(m);
|
|
1010
|
+
const { command: A } = S;
|
|
1011
|
+
t.emitCommand({ item: m, argument: { command: A } });
|
|
969
1012
|
}
|
|
970
1013
|
});
|
|
971
1014
|
}
|
|
972
|
-
const
|
|
1015
|
+
const B = _({
|
|
973
1016
|
type: "dropdown",
|
|
974
1017
|
name: "textAlign",
|
|
975
1018
|
tooltip: "Alignment",
|
|
@@ -982,12 +1025,12 @@ const x = (t) => {
|
|
|
982
1025
|
options: [
|
|
983
1026
|
{
|
|
984
1027
|
type: "render",
|
|
985
|
-
render: () =>
|
|
986
|
-
|
|
1028
|
+
render: () => N("div", {}, [
|
|
1029
|
+
N(Jt, {
|
|
987
1030
|
onSelect: (S) => {
|
|
988
|
-
|
|
989
|
-
const
|
|
990
|
-
|
|
1031
|
+
le(B);
|
|
1032
|
+
const A = { ...B, command: "setTextAlign" };
|
|
1033
|
+
A.command = "setTextAlign", t.emitCommand({ item: A, argument: S }), q(B, S);
|
|
991
1034
|
}
|
|
992
1035
|
})
|
|
993
1036
|
]),
|
|
@@ -995,52 +1038,52 @@ const x = (t) => {
|
|
|
995
1038
|
}
|
|
996
1039
|
],
|
|
997
1040
|
onActivate: ({ textAlign: m }) => {
|
|
998
|
-
|
|
1041
|
+
q(B, m);
|
|
999
1042
|
},
|
|
1000
1043
|
onDeactivate: () => {
|
|
1001
|
-
|
|
1044
|
+
q(B, "left");
|
|
1002
1045
|
}
|
|
1003
|
-
}),
|
|
1004
|
-
let
|
|
1046
|
+
}), q = (m, S) => {
|
|
1047
|
+
let A = S === "both" ? "justify" : S, P = {
|
|
1005
1048
|
left: e.alignLeft,
|
|
1006
1049
|
right: e.alignRight,
|
|
1007
1050
|
center: e.alignCenter,
|
|
1008
1051
|
justify: e.alignJustify
|
|
1009
|
-
},
|
|
1010
|
-
m.icon.value =
|
|
1011
|
-
},
|
|
1052
|
+
}, se = P[A] ?? P.left;
|
|
1053
|
+
m.icon.value = se;
|
|
1054
|
+
}, ge = _({
|
|
1012
1055
|
type: "button",
|
|
1013
1056
|
name: "list",
|
|
1014
1057
|
command: "toggleBulletList",
|
|
1015
1058
|
icon: e.bulletList,
|
|
1016
1059
|
tooltip: "Bullet list"
|
|
1017
|
-
}), ve =
|
|
1060
|
+
}), ve = _({
|
|
1018
1061
|
type: "button",
|
|
1019
1062
|
name: "numberedlist",
|
|
1020
1063
|
command: "toggleOrderedList",
|
|
1021
1064
|
icon: e.numberedList,
|
|
1022
1065
|
tooltip: "Numbered list"
|
|
1023
|
-
}), ce =
|
|
1066
|
+
}), ce = _({
|
|
1024
1067
|
type: "button",
|
|
1025
1068
|
name: "indentleft",
|
|
1026
1069
|
command: "decreaseTextIndent",
|
|
1027
1070
|
icon: e.indentLeft,
|
|
1028
1071
|
tooltip: "Left indent",
|
|
1029
1072
|
disabled: !1
|
|
1030
|
-
}), de =
|
|
1073
|
+
}), de = _({
|
|
1031
1074
|
type: "button",
|
|
1032
1075
|
name: "indentright",
|
|
1033
1076
|
command: "increaseTextIndent",
|
|
1034
1077
|
icon: e.indentRight,
|
|
1035
1078
|
tooltip: "Right indent",
|
|
1036
1079
|
disabled: !1
|
|
1037
|
-
}),
|
|
1080
|
+
}), T = _({
|
|
1038
1081
|
type: "overflow",
|
|
1039
1082
|
name: "overflow",
|
|
1040
1083
|
command: "toggleOverflow",
|
|
1041
1084
|
icon: e.overflow,
|
|
1042
1085
|
disabled: !1
|
|
1043
|
-
}),
|
|
1086
|
+
}), M = _({
|
|
1044
1087
|
type: "dropdown",
|
|
1045
1088
|
name: "zoom",
|
|
1046
1089
|
allowWithoutEditor: !0,
|
|
@@ -1062,9 +1105,9 @@ const x = (t) => {
|
|
|
1062
1105
|
{ label: "200%", key: 2 }
|
|
1063
1106
|
],
|
|
1064
1107
|
onActivate: ({ zoom: m }) => {
|
|
1065
|
-
m && (
|
|
1108
|
+
m && (M.label.value = m);
|
|
1066
1109
|
}
|
|
1067
|
-
}),
|
|
1110
|
+
}), H = _({
|
|
1068
1111
|
type: "button",
|
|
1069
1112
|
name: "undo",
|
|
1070
1113
|
disabled: !0,
|
|
@@ -1073,9 +1116,9 @@ const x = (t) => {
|
|
|
1073
1116
|
icon: e.undo,
|
|
1074
1117
|
group: "left",
|
|
1075
1118
|
onDeactivate: () => {
|
|
1076
|
-
|
|
1119
|
+
H.disabled.value = !t.undoDepth;
|
|
1077
1120
|
}
|
|
1078
|
-
}),
|
|
1121
|
+
}), R = _({
|
|
1079
1122
|
type: "button",
|
|
1080
1123
|
disabled: !0,
|
|
1081
1124
|
name: "redo",
|
|
@@ -1084,9 +1127,9 @@ const x = (t) => {
|
|
|
1084
1127
|
icon: e.redo,
|
|
1085
1128
|
group: "left",
|
|
1086
1129
|
onDeactivate: () => {
|
|
1087
|
-
|
|
1130
|
+
R.disabled.value = !t.redoDepth;
|
|
1088
1131
|
}
|
|
1089
|
-
}),
|
|
1132
|
+
}), X = _({
|
|
1090
1133
|
type: "button",
|
|
1091
1134
|
disabled: !1,
|
|
1092
1135
|
name: "toggleTrackChanges",
|
|
@@ -1094,7 +1137,7 @@ const x = (t) => {
|
|
|
1094
1137
|
command: "toggleTrackChanges",
|
|
1095
1138
|
icon: e.trackChanges,
|
|
1096
1139
|
group: "left"
|
|
1097
|
-
}),
|
|
1140
|
+
}), Z = _({
|
|
1098
1141
|
type: "button",
|
|
1099
1142
|
disabled: !1,
|
|
1100
1143
|
name: "acceptTrackedChangeBySelection",
|
|
@@ -1102,7 +1145,7 @@ const x = (t) => {
|
|
|
1102
1145
|
command: "acceptTrackedChangeBySelection",
|
|
1103
1146
|
icon: e.trackChangesAccept,
|
|
1104
1147
|
group: "left"
|
|
1105
|
-
}),
|
|
1148
|
+
}), ae = _({
|
|
1106
1149
|
type: "button",
|
|
1107
1150
|
disabled: !1,
|
|
1108
1151
|
name: "rejectTrackedChangeOnSelection",
|
|
@@ -1110,7 +1153,7 @@ const x = (t) => {
|
|
|
1110
1153
|
command: "rejectTrackedChangeOnSelection",
|
|
1111
1154
|
icon: e.trackChangesReject,
|
|
1112
1155
|
group: "left"
|
|
1113
|
-
}), ue =
|
|
1156
|
+
}), ue = _({
|
|
1114
1157
|
type: "button",
|
|
1115
1158
|
disabled: !1,
|
|
1116
1159
|
name: "toggleTrackChangesShowOriginal",
|
|
@@ -1118,7 +1161,7 @@ const x = (t) => {
|
|
|
1118
1161
|
command: "toggleTrackChangesShowOriginal",
|
|
1119
1162
|
icon: e.trackChangesOriginal,
|
|
1120
1163
|
group: "left"
|
|
1121
|
-
}),
|
|
1164
|
+
}), Ce = _({
|
|
1122
1165
|
type: "button",
|
|
1123
1166
|
disabled: !1,
|
|
1124
1167
|
name: "toggleTrackChangesShowFinal",
|
|
@@ -1126,7 +1169,7 @@ const x = (t) => {
|
|
|
1126
1169
|
command: "toggleTrackChangesShowFinal",
|
|
1127
1170
|
icon: e.trackChangesFinal,
|
|
1128
1171
|
group: "left"
|
|
1129
|
-
}), Te =
|
|
1172
|
+
}), Te = _({
|
|
1130
1173
|
type: "button",
|
|
1131
1174
|
name: "clearFormatting",
|
|
1132
1175
|
command: "clearFormat",
|
|
@@ -1135,27 +1178,27 @@ const x = (t) => {
|
|
|
1135
1178
|
});
|
|
1136
1179
|
[
|
|
1137
1180
|
i,
|
|
1138
|
-
d,
|
|
1139
1181
|
u,
|
|
1182
|
+
r,
|
|
1140
1183
|
de,
|
|
1141
1184
|
ce,
|
|
1142
1185
|
// search,
|
|
1143
|
-
|
|
1186
|
+
T
|
|
1144
1187
|
].map((m) => m.name);
|
|
1145
|
-
const
|
|
1188
|
+
const Fe = _({
|
|
1146
1189
|
type: "button",
|
|
1147
1190
|
name: "copyFormat",
|
|
1148
1191
|
tooltip: "Format painter",
|
|
1149
1192
|
icon: e.copyFormat,
|
|
1150
1193
|
command: "copyFormat"
|
|
1151
|
-
}),
|
|
1194
|
+
}), Ie = (m, S) => m === "editor" ? S : m === "suggester" ? S.filter((A) => A.value === "suggesting") : S.filter((A) => A.value === "viewing"), _e = (m) => m === "editor" ? "Editing" : m === "suggester" ? "Suggesting" : "Viewing", ee = _({
|
|
1152
1195
|
type: "dropdown",
|
|
1153
1196
|
name: "documentMode",
|
|
1154
1197
|
command: "setDocumentMode",
|
|
1155
1198
|
allowWithoutEditor: !0,
|
|
1156
1199
|
icon: e.documentMode,
|
|
1157
|
-
defaultLabel:
|
|
1158
|
-
label:
|
|
1200
|
+
defaultLabel: _e(n),
|
|
1201
|
+
label: _e(n),
|
|
1159
1202
|
hasCaret: n === "editor",
|
|
1160
1203
|
isWide: !0,
|
|
1161
1204
|
style: { display: "flex", justifyContent: "flex-end" },
|
|
@@ -1170,10 +1213,10 @@ const x = (t) => {
|
|
|
1170
1213
|
options: [
|
|
1171
1214
|
{
|
|
1172
1215
|
type: "render",
|
|
1173
|
-
render: () =>
|
|
1216
|
+
render: () => Le(ee)
|
|
1174
1217
|
}
|
|
1175
1218
|
]
|
|
1176
|
-
}),
|
|
1219
|
+
}), xe = [
|
|
1177
1220
|
{
|
|
1178
1221
|
label: "Editing",
|
|
1179
1222
|
value: "editing",
|
|
@@ -1193,18 +1236,18 @@ const x = (t) => {
|
|
|
1193
1236
|
description: "View clean version of document only"
|
|
1194
1237
|
}
|
|
1195
1238
|
];
|
|
1196
|
-
function
|
|
1197
|
-
const S =
|
|
1198
|
-
return
|
|
1239
|
+
function Le(m) {
|
|
1240
|
+
const S = Ie(n, xe);
|
|
1241
|
+
return N(Cn, {
|
|
1199
1242
|
options: S,
|
|
1200
|
-
onSelect: (
|
|
1201
|
-
|
|
1202
|
-
const { label:
|
|
1203
|
-
ee.label.value =
|
|
1243
|
+
onSelect: (A) => {
|
|
1244
|
+
le(m);
|
|
1245
|
+
const { label: P, icon: se } = A;
|
|
1246
|
+
ee.label.value = P, ee.icon.value = se, t.emitCommand({ item: ee, argument: P });
|
|
1204
1247
|
}
|
|
1205
1248
|
});
|
|
1206
1249
|
}
|
|
1207
|
-
const me =
|
|
1250
|
+
const me = _({
|
|
1208
1251
|
type: "button",
|
|
1209
1252
|
name: "pageBreakTool",
|
|
1210
1253
|
command: "insertPageBreak",
|
|
@@ -1218,14 +1261,15 @@ const x = (t) => {
|
|
|
1218
1261
|
["textAlign", 40],
|
|
1219
1262
|
["linkedStyles", 142],
|
|
1220
1263
|
["documentMode", 47],
|
|
1264
|
+
["ai", 32],
|
|
1221
1265
|
["default", 32]
|
|
1222
|
-
]), ye =
|
|
1266
|
+
]), ye = _({
|
|
1223
1267
|
type: "button",
|
|
1224
1268
|
name: "ruler",
|
|
1225
1269
|
command: "toggleRuler",
|
|
1226
1270
|
icon: e.ruler,
|
|
1227
1271
|
tooltip: "Show or hide ruler"
|
|
1228
|
-
}), be =
|
|
1272
|
+
}), be = _({
|
|
1229
1273
|
type: "dropdown",
|
|
1230
1274
|
name: "linkedStyles",
|
|
1231
1275
|
command: "setLinkedStyle",
|
|
@@ -1246,12 +1290,12 @@ const x = (t) => {
|
|
|
1246
1290
|
key: "linkedStyle",
|
|
1247
1291
|
render: () => {
|
|
1248
1292
|
const m = (S) => {
|
|
1249
|
-
|
|
1250
|
-
const
|
|
1251
|
-
t.emitCommand({ item:
|
|
1293
|
+
le(be);
|
|
1294
|
+
const A = { ...be, command: "setLinkedStyle" };
|
|
1295
|
+
t.emitCommand({ item: A, argument: S });
|
|
1252
1296
|
};
|
|
1253
|
-
return
|
|
1254
|
-
|
|
1297
|
+
return N("div", {}, [
|
|
1298
|
+
N(Sn, {
|
|
1255
1299
|
editor: t.activeEditor,
|
|
1256
1300
|
onSelect: m
|
|
1257
1301
|
})
|
|
@@ -1267,8 +1311,8 @@ const x = (t) => {
|
|
|
1267
1311
|
}
|
|
1268
1312
|
}), pe = (m, S) => {
|
|
1269
1313
|
if (S.value.toString() === m)
|
|
1270
|
-
return
|
|
1271
|
-
},
|
|
1314
|
+
return N("div", { innerHTML: Kn, class: "dropdown-select-icon" });
|
|
1315
|
+
}, re = _({
|
|
1272
1316
|
type: "dropdown",
|
|
1273
1317
|
name: "lineHeight",
|
|
1274
1318
|
tooltip: "Line height",
|
|
@@ -1282,223 +1326,225 @@ const x = (t) => {
|
|
|
1282
1326
|
dropdownValueKey: "key",
|
|
1283
1327
|
selectedValue: "1",
|
|
1284
1328
|
options: [
|
|
1285
|
-
{ label: "1,0", key: "1", icon: () => pe("1",
|
|
1286
|
-
{ label: "1,15", key: "1.15", icon: () => pe("1.15",
|
|
1287
|
-
{ label: "1,5", key: "1.5", icon: () => pe("1.5",
|
|
1288
|
-
{ label: "2,0", key: "2", icon: () => pe("2",
|
|
1289
|
-
{ label: "2,5", key: "2.5", icon: () => pe("2.5",
|
|
1290
|
-
{ label: "3,0", key: "3", icon: () => pe("3",
|
|
1329
|
+
{ label: "1,0", key: "1", icon: () => pe("1", re.selectedValue) },
|
|
1330
|
+
{ label: "1,15", key: "1.15", icon: () => pe("1.15", re.selectedValue) },
|
|
1331
|
+
{ label: "1,5", key: "1.5", icon: () => pe("1.5", re.selectedValue) },
|
|
1332
|
+
{ label: "2,0", key: "2", icon: () => pe("2", re.selectedValue) },
|
|
1333
|
+
{ label: "2,5", key: "2.5", icon: () => pe("2.5", re.selectedValue) },
|
|
1334
|
+
{ label: "3,0", key: "3", icon: () => pe("3", re.selectedValue) }
|
|
1291
1335
|
]
|
|
1292
|
-
}),
|
|
1336
|
+
}), Me = {
|
|
1293
1337
|
sm: 768,
|
|
1294
1338
|
md: 1024,
|
|
1295
1339
|
xl: 1410
|
|
1296
|
-
},
|
|
1297
|
-
let
|
|
1298
|
-
|
|
1299
|
-
|
|
1340
|
+
}, it = 120, st = 32, lt = ["linkedStyles", "clearFormatting", "copyFormat", "ruler"], at = ["zoom", "fontFamily", "fontSize", "redo"];
|
|
1341
|
+
let O = [
|
|
1342
|
+
H,
|
|
1343
|
+
R,
|
|
1300
1344
|
// Dev - tracked changes
|
|
1301
1345
|
// toggleTrackChanges,
|
|
1302
|
-
|
|
1303
|
-
|
|
1346
|
+
Z,
|
|
1347
|
+
ae,
|
|
1304
1348
|
// toggleTrackChangesOriginal,
|
|
1305
1349
|
// toggleTrackChangesFinal,
|
|
1306
|
-
|
|
1350
|
+
M,
|
|
1351
|
+
d,
|
|
1307
1352
|
c,
|
|
1308
1353
|
a,
|
|
1309
|
-
|
|
1310
|
-
a,
|
|
1354
|
+
c,
|
|
1311
1355
|
i,
|
|
1312
|
-
d,
|
|
1313
1356
|
u,
|
|
1314
|
-
b,
|
|
1315
1357
|
r,
|
|
1316
|
-
|
|
1358
|
+
y,
|
|
1359
|
+
b,
|
|
1360
|
+
c,
|
|
1317
1361
|
h,
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1362
|
+
D,
|
|
1363
|
+
l,
|
|
1364
|
+
L,
|
|
1365
|
+
C,
|
|
1366
|
+
c,
|
|
1367
|
+
B,
|
|
1368
|
+
ge,
|
|
1324
1369
|
ve,
|
|
1325
1370
|
ce,
|
|
1326
1371
|
de,
|
|
1327
|
-
|
|
1328
|
-
|
|
1372
|
+
re,
|
|
1373
|
+
c,
|
|
1329
1374
|
be,
|
|
1330
|
-
|
|
1375
|
+
c,
|
|
1331
1376
|
me,
|
|
1332
|
-
|
|
1377
|
+
Fe,
|
|
1333
1378
|
Te,
|
|
1334
1379
|
ye,
|
|
1335
|
-
|
|
1380
|
+
T,
|
|
1336
1381
|
ee
|
|
1337
1382
|
// search,
|
|
1338
1383
|
];
|
|
1339
|
-
if (o <=
|
|
1340
|
-
const m =
|
|
1341
|
-
|
|
1384
|
+
if (t.config.aiApiKey || (O = O.filter((m) => m.name.value !== "ai")), o <= Me.md && (O = O.filter((m) => m.type !== "separator")), t.config.pagination || (O = O.filter((m) => m.name.value !== "pageBreakTool")), t.config.mode !== "docx") {
|
|
1385
|
+
const m = O.findIndex((A) => A.name.value === "linkedStyles");
|
|
1386
|
+
O.splice(m - 1, 2);
|
|
1342
1387
|
const S = ["ruler", "zoom", "undo", "redo"];
|
|
1343
|
-
|
|
1388
|
+
O = O.filter((A) => !S.includes(A.name.value));
|
|
1344
1389
|
}
|
|
1345
|
-
const Pe = [
|
|
1346
|
-
|
|
1347
|
-
const
|
|
1348
|
-
let
|
|
1349
|
-
return
|
|
1390
|
+
const Pe = [X, ue, Ce];
|
|
1391
|
+
s || (n === "viewer" && Pe.push(Z, ae), O = O.filter((m) => !Pe.includes(m)));
|
|
1392
|
+
const rt = [H, T, ee].map((m) => m.name), ct = (m) => rt.includes(m.name), Ee = [], De = [];
|
|
1393
|
+
let $e = st + it;
|
|
1394
|
+
return O.forEach((m) => {
|
|
1350
1395
|
const S = te.get(m.name.value) || te.get("default");
|
|
1351
|
-
if (o <
|
|
1352
|
-
if (
|
|
1353
|
-
const
|
|
1354
|
-
|
|
1396
|
+
if (o < Me.xl && lt.includes(m.name.value)) {
|
|
1397
|
+
if (Ee.push(m), m.name.value === "linkedStyles") {
|
|
1398
|
+
const A = O.findIndex((P) => P.name.value === "linkedStyles");
|
|
1399
|
+
O.splice(A + 1, 1);
|
|
1355
1400
|
}
|
|
1356
1401
|
return;
|
|
1357
1402
|
}
|
|
1358
|
-
if (o <
|
|
1359
|
-
|
|
1403
|
+
if (o < Me.sm && at.includes(m.name.value)) {
|
|
1404
|
+
Ee.push(m);
|
|
1360
1405
|
return;
|
|
1361
1406
|
}
|
|
1362
|
-
if (
|
|
1363
|
-
|
|
1407
|
+
if (ct(m)) {
|
|
1408
|
+
De.push(m), $e += S;
|
|
1364
1409
|
return;
|
|
1365
1410
|
}
|
|
1366
|
-
|
|
1411
|
+
$e < o ? (De.push(m), $e += S) : Ee.push(m);
|
|
1367
1412
|
}), {
|
|
1368
|
-
defaultItems:
|
|
1369
|
-
overflowItems:
|
|
1413
|
+
defaultItems: De,
|
|
1414
|
+
overflowItems: Ee.filter((m) => m.type !== "separator")
|
|
1370
1415
|
};
|
|
1371
|
-
},
|
|
1416
|
+
}, Zn = [".jpg", ".jpeg", ".png", "image/jpeg", "image/png"], Yn = () => {
|
|
1372
1417
|
let t = document.createElement("input");
|
|
1373
1418
|
t.type = "file";
|
|
1374
|
-
let
|
|
1375
|
-
return t.accept =
|
|
1419
|
+
let s = Zn;
|
|
1420
|
+
return t.accept = s.join(","), () => new Promise((n, e) => {
|
|
1376
1421
|
t.onchange = async () => {
|
|
1377
1422
|
const i = t.files;
|
|
1378
1423
|
if (!i) return n(null);
|
|
1379
|
-
const
|
|
1380
|
-
return n(
|
|
1424
|
+
const d = i.item(0);
|
|
1425
|
+
return n(d ? { file: d } : null);
|
|
1381
1426
|
}, t.oncancel = () => n(null), t.onerror = e, t.click();
|
|
1382
1427
|
});
|
|
1383
|
-
},
|
|
1428
|
+
}, Jn = (t) => new Promise((s, o) => {
|
|
1384
1429
|
let n = new FileReader();
|
|
1385
|
-
n.onload = (e) =>
|
|
1386
|
-
}),
|
|
1430
|
+
n.onload = (e) => s(e.target.result), n.onerror = o, setTimeout(() => n.readAsDataURL(t), 250);
|
|
1431
|
+
}), Qn = (t, s) => new Promise((o, n) => {
|
|
1387
1432
|
const e = new window.Image();
|
|
1388
1433
|
e.onload = () => {
|
|
1389
|
-
const i = document.createElement("canvas"), { width:
|
|
1434
|
+
const i = document.createElement("canvas"), { width: d, height: l } = eo(
|
|
1390
1435
|
e.width,
|
|
1391
1436
|
e.height,
|
|
1392
|
-
|
|
1437
|
+
s
|
|
1393
1438
|
);
|
|
1394
|
-
if (i.width =
|
|
1395
|
-
const
|
|
1396
|
-
o(
|
|
1439
|
+
if (i.width = d, i.height = l, i.getContext("2d").drawImage(e, 0, 0, d, l), typeof t == "string") {
|
|
1440
|
+
const c = i.toDataURL();
|
|
1441
|
+
o(c);
|
|
1397
1442
|
} else
|
|
1398
|
-
i.toBlob((
|
|
1399
|
-
const u = new File([
|
|
1443
|
+
i.toBlob((c) => {
|
|
1444
|
+
const u = new File([c], t.name, {
|
|
1400
1445
|
type: t.type,
|
|
1401
1446
|
lastModified: Date.now()
|
|
1402
1447
|
});
|
|
1403
|
-
o({ file: u, width:
|
|
1448
|
+
o({ file: u, width: d, height: l });
|
|
1404
1449
|
});
|
|
1405
1450
|
}, e.onerror = (i) => n(i), e.src = typeof t == "string" ? t : URL.createObjectURL(t);
|
|
1406
|
-
}),
|
|
1451
|
+
}), eo = (t, s, o) => {
|
|
1407
1452
|
const { width: n, height: e } = o.getMaxContentSize();
|
|
1408
|
-
if (!n || !e) return { width: t, height:
|
|
1409
|
-
let i = t,
|
|
1410
|
-
const
|
|
1411
|
-
return
|
|
1412
|
-
},
|
|
1413
|
-
let n = typeof t.options.handleImageUpload == "function" ? t.options.handleImageUpload :
|
|
1453
|
+
if (!n || !e) return { width: t, height: s };
|
|
1454
|
+
let i = t, d = s;
|
|
1455
|
+
const l = t / s;
|
|
1456
|
+
return s > e && (d = e, i = Math.round(e * l)), i > n && (i = n, d = Math.round(n / l)), { width: i, height: d };
|
|
1457
|
+
}, to = async ({ editor: t, view: s, file: o }) => {
|
|
1458
|
+
let n = typeof t.options.handleImageUpload == "function" ? t.options.handleImageUpload : Jn;
|
|
1414
1459
|
if ((o.size / (1024 * 1024)).toFixed(4) > 5) {
|
|
1415
1460
|
window.alert("Image size must be less than 5MB");
|
|
1416
1461
|
return;
|
|
1417
1462
|
}
|
|
1418
|
-
let i,
|
|
1463
|
+
let i, d;
|
|
1419
1464
|
try {
|
|
1420
|
-
const r = await
|
|
1421
|
-
i = r.width,
|
|
1465
|
+
const r = await Qn(o, t);
|
|
1466
|
+
i = r.width, d = r.height, o = r.file;
|
|
1422
1467
|
} catch (r) {
|
|
1423
1468
|
console.warn("Error processing image:", r);
|
|
1424
1469
|
return;
|
|
1425
1470
|
}
|
|
1426
|
-
let
|
|
1471
|
+
let l = {}, { tr: a, schema: c } = s.state;
|
|
1427
1472
|
a.selection.empty || a.deleteSelection();
|
|
1428
1473
|
let u = {
|
|
1429
1474
|
type: "add",
|
|
1430
1475
|
pos: a.selection.from,
|
|
1431
|
-
id:
|
|
1476
|
+
id: l
|
|
1432
1477
|
};
|
|
1433
|
-
a.setMeta(
|
|
1478
|
+
a.setMeta(Re, u), s.dispatch(a), n(o).then(
|
|
1434
1479
|
(r) => {
|
|
1435
|
-
let b = o.name.replace(" ", "_"),
|
|
1436
|
-
if (
|
|
1480
|
+
let b = o.name.replace(" ", "_"), y = ft(s.state, l);
|
|
1481
|
+
if (y == null)
|
|
1437
1482
|
return;
|
|
1438
|
-
let
|
|
1439
|
-
src:
|
|
1440
|
-
size: { width: i, height:
|
|
1483
|
+
let h = { type: "remove", id: l }, E = `word/media/${b}`, g = c.nodes.image.create({
|
|
1484
|
+
src: E,
|
|
1485
|
+
size: { width: i, height: d }
|
|
1441
1486
|
});
|
|
1442
|
-
t.storage.image.media = Object.assign(t.storage.image.media, { [
|
|
1443
|
-
|
|
1487
|
+
t.storage.image.media = Object.assign(t.storage.image.media, { [E]: r }), t.options.ydoc && t.commands.addImageToCollaboration({ mediaPath: E, fileData: r }), s.dispatch(
|
|
1488
|
+
s.state.tr.replaceWith(y, y, g).setMeta(Re, h)
|
|
1444
1489
|
);
|
|
1445
1490
|
},
|
|
1446
1491
|
() => {
|
|
1447
|
-
let r = { type: "remove", id:
|
|
1448
|
-
|
|
1492
|
+
let r = { type: "remove", id: l };
|
|
1493
|
+
s.dispatch(a.setMeta(Re, r));
|
|
1449
1494
|
}
|
|
1450
1495
|
);
|
|
1451
1496
|
};
|
|
1452
|
-
var
|
|
1453
|
-
class
|
|
1497
|
+
var I, et, he, ze, tt, nt, We, ot, fe;
|
|
1498
|
+
class ko extends Vt {
|
|
1454
1499
|
constructor(o) {
|
|
1455
1500
|
super();
|
|
1456
|
-
|
|
1457
|
-
|
|
1501
|
+
Be(this, I);
|
|
1502
|
+
He(this, "config", {
|
|
1458
1503
|
selector: null,
|
|
1459
1504
|
toolbarGroups: ["left", "center", "right"],
|
|
1460
1505
|
role: "editor",
|
|
1461
1506
|
pagination: !1,
|
|
1462
|
-
icons: { ...
|
|
1507
|
+
icons: { ...G },
|
|
1463
1508
|
mode: "docx",
|
|
1464
1509
|
excludeItems: [],
|
|
1465
1510
|
groups: null,
|
|
1466
|
-
editor: null
|
|
1511
|
+
editor: null,
|
|
1512
|
+
aiApiKey: null
|
|
1467
1513
|
});
|
|
1468
|
-
|
|
1514
|
+
Be(this, he, {
|
|
1469
1515
|
setZoom: ({ item: o, argument: n }) => {
|
|
1470
1516
|
if (!n) return;
|
|
1471
1517
|
o.onActivate({ zoom: n }), this.emit("superdoc-command", { item: o, argument: n });
|
|
1472
1518
|
const e = document.querySelector(this.superdoc.config.selector)?.querySelector(".layers");
|
|
1473
1519
|
if (!e) return;
|
|
1474
|
-
const i = typeof screen.orientation < "u",
|
|
1475
|
-
i &&
|
|
1520
|
+
const i = typeof screen.orientation < "u", d = window.matchMedia("(max-width: 834px)").matches;
|
|
1521
|
+
i && d ? (e.style.transformOrigin = "0 0", e.style.transform = `scale(${parseInt(n) / 100})`) : e.style.zoom = parseInt(n) / 100, this.superdoc.superdocStore.activeZoom = parseInt(n);
|
|
1476
1522
|
},
|
|
1477
1523
|
setDocumentMode: ({ item: o, argument: n }) => {
|
|
1478
1524
|
n && this.emit("superdoc-command", { item: o, argument: n });
|
|
1479
1525
|
},
|
|
1480
1526
|
setFontSize: ({ item: o, argument: n }) => {
|
|
1481
|
-
|
|
1527
|
+
W(this, I, fe).call(this, { item: o, argument: n }, () => {
|
|
1482
1528
|
this.activeEditor?.commands.setFieldAnnotationsFontSize(n, !0);
|
|
1483
1529
|
});
|
|
1484
1530
|
},
|
|
1485
1531
|
setFontFamily: ({ item: o, argument: n }) => {
|
|
1486
|
-
|
|
1532
|
+
W(this, I, fe).call(this, { item: o, argument: n }, () => {
|
|
1487
1533
|
this.activeEditor?.commands.setFieldAnnotationsFontFamily(n, !0);
|
|
1488
1534
|
});
|
|
1489
1535
|
},
|
|
1490
1536
|
setColor: ({ item: o, argument: n }) => {
|
|
1491
|
-
|
|
1537
|
+
W(this, I, fe).call(this, { item: o, argument: n });
|
|
1492
1538
|
},
|
|
1493
1539
|
setHighlight: ({ item: o, argument: n }) => {
|
|
1494
|
-
|
|
1540
|
+
W(this, I, fe).call(this, { item: o, argument: n });
|
|
1495
1541
|
},
|
|
1496
1542
|
toggleRuler: ({ item: o, argument: n }) => {
|
|
1497
1543
|
this.superdoc.toggleRuler();
|
|
1498
1544
|
},
|
|
1499
1545
|
startImageUpload: async ({ item: o, argument: n }) => {
|
|
1500
|
-
let i = await
|
|
1501
|
-
i?.file &&
|
|
1546
|
+
let i = await Yn()();
|
|
1547
|
+
i?.file && to({
|
|
1502
1548
|
editor: this.activeEditor,
|
|
1503
1549
|
view: this.activeEditor.view,
|
|
1504
1550
|
file: i.file
|
|
@@ -1506,13 +1552,13 @@ class vo extends zt {
|
|
|
1506
1552
|
},
|
|
1507
1553
|
increaseTextIndent: ({ item: o, argument: n }) => {
|
|
1508
1554
|
let e = o.command, { state: i } = this.activeEditor;
|
|
1509
|
-
if (
|
|
1555
|
+
if (Ue((l) => l.type.name === "listItem")(i.selection))
|
|
1510
1556
|
return this.activeEditor.commands.increaseListIndent();
|
|
1511
1557
|
e in this.activeEditor.commands && this.activeEditor.commands[e](n);
|
|
1512
1558
|
},
|
|
1513
1559
|
decreaseTextIndent: ({ item: o, argument: n }) => {
|
|
1514
1560
|
let e = o.command, { state: i } = this.activeEditor;
|
|
1515
|
-
if (
|
|
1561
|
+
if (Ue((l) => l.type.name === "listItem")(i.selection))
|
|
1516
1562
|
return this.activeEditor.commands.decreaseListIndent();
|
|
1517
1563
|
e in this.activeEditor.commands && this.activeEditor.commands[e](n);
|
|
1518
1564
|
},
|
|
@@ -1532,15 +1578,15 @@ class vo extends zt {
|
|
|
1532
1578
|
let e = o.command;
|
|
1533
1579
|
if (e in this.activeEditor.commands) {
|
|
1534
1580
|
this.activeEditor.commands[e](n);
|
|
1535
|
-
const { view: i } = this.activeEditor,
|
|
1536
|
-
i.updateState(
|
|
1581
|
+
const { view: i } = this.activeEditor, d = i.state.selection.$to.pos, l = new Xe(i.state.doc.resolve(d)), a = i.state.tr.setSelection(l), c = i.state.apply(a);
|
|
1582
|
+
i.updateState(c), setTimeout(() => {
|
|
1537
1583
|
i.focus();
|
|
1538
1584
|
}, 100);
|
|
1539
1585
|
}
|
|
1540
1586
|
this.updateToolbarState();
|
|
1541
1587
|
},
|
|
1542
1588
|
insertTable: ({ item: o, argument: n }) => {
|
|
1543
|
-
|
|
1589
|
+
W(this, I, fe).call(this, { item: o, argument: n });
|
|
1544
1590
|
},
|
|
1545
1591
|
executeTableCommand: ({ item: o, argument: n }) => {
|
|
1546
1592
|
if (!n) return;
|
|
@@ -1548,26 +1594,26 @@ class vo extends zt {
|
|
|
1548
1594
|
e in this.activeEditor.commands && this.activeEditor.commands[e](n), this.updateToolbarState();
|
|
1549
1595
|
}
|
|
1550
1596
|
});
|
|
1551
|
-
|
|
1552
|
-
|
|
1597
|
+
He(this, "onToolbarResize", () => {
|
|
1598
|
+
W(this, I, ze).call(this, this, this.config.icons, this.isDev), this.role === "viewer" && W(this, I, We).call(this);
|
|
1553
1599
|
});
|
|
1554
1600
|
this.config = { ...this.config, ...o }, this.toolbarItems = [], this.overflowItems = [], this.documentMode = o.documentMode || "editing", this.isDev = o.isDev || !1, this.superdoc = o.superdoc, this.role = o.role || "editor", this.config.editor && (this.config.mode = this.config.editor.options.mode), this.config.icons = {
|
|
1555
|
-
...
|
|
1601
|
+
...G,
|
|
1556
1602
|
...o.icons
|
|
1557
|
-
}, !this.config.selector && this.config.element && (this.config.selector = this.config.element),
|
|
1603
|
+
}, !this.config.selector && this.config.element && (this.config.selector = this.config.element), W(this, I, et).call(this), W(this, I, ze).call(this, this, this.config.icons, o.isDev);
|
|
1558
1604
|
let n = null;
|
|
1559
1605
|
if (this.config.selector && (this.config.selector.startsWith("#") || this.config.selector.startsWith(".") ? n = document.querySelector(this.config.selector) : n = document.getElementById(this.config.selector), !n)) {
|
|
1560
1606
|
console.warn(`[super-toolbar 🎨] Element not found: ${this.config.selector}`);
|
|
1561
1607
|
return;
|
|
1562
1608
|
}
|
|
1563
|
-
this.app =
|
|
1609
|
+
this.app = Bt(zt), this.app.directive("click-outside", Tt), this.app.config.globalProperties.$toolbar = this, n && (this.toolbar = this.app.mount(n)), this.activeEditor = o.editor || null, this.updateToolbarState();
|
|
1564
1610
|
}
|
|
1565
1611
|
log(...o) {
|
|
1566
1612
|
console.debug("[🎨 super-toolbar]", ...o);
|
|
1567
1613
|
}
|
|
1568
1614
|
setZoom(o) {
|
|
1569
1615
|
const e = [...this.toolbarItems, ...this.overflowItems].find((i) => i.name.value === "zoom");
|
|
1570
|
-
|
|
1616
|
+
Se(this, he).setZoom({ item: e, argument: o });
|
|
1571
1617
|
}
|
|
1572
1618
|
/**
|
|
1573
1619
|
* The toolbar expects an active Super Editor instance.
|
|
@@ -1584,18 +1630,18 @@ class vo extends zt {
|
|
|
1584
1630
|
* @param {Object} marks
|
|
1585
1631
|
*/
|
|
1586
1632
|
updateToolbarState() {
|
|
1587
|
-
if (
|
|
1588
|
-
|
|
1633
|
+
if (W(this, I, ot).call(this), W(this, I, tt).call(this), W(this, I, nt).call(this), !this.activeEditor || this.documentMode === "viewing") {
|
|
1634
|
+
W(this, I, We).call(this);
|
|
1589
1635
|
return;
|
|
1590
1636
|
}
|
|
1591
|
-
const o =
|
|
1637
|
+
const o = ht(this.activeEditor), n = gt(this.activeEditor.state);
|
|
1592
1638
|
this.toolbarItems.forEach((e) => {
|
|
1593
1639
|
if (e.resetDisabled(), e.name.value === "linkedStyles")
|
|
1594
|
-
return this.activeEditor && !
|
|
1595
|
-
const i = o.find((
|
|
1640
|
+
return this.activeEditor && !Ke(this.activeEditor).length ? e.deactivate() : e.activate();
|
|
1641
|
+
const i = o.find((l) => l.name === e.name.value);
|
|
1596
1642
|
i ? e.activate(i.attrs) : e.deactivate();
|
|
1597
|
-
const
|
|
1598
|
-
e.name.value === "lineHeight" && (i?.attrs?.lineHeight ||
|
|
1643
|
+
const d = o.find((l) => l.name === "spacing");
|
|
1644
|
+
e.name.value === "lineHeight" && (i?.attrs?.lineHeight || d) && (e.selectedValue.value = i?.attrs?.lineHeight || d.attrs?.spacing?.line || ""), e.name.value === "tableActions" && (n ? e.disabled.value = !1 : e.disabled.value = !0);
|
|
1599
1645
|
});
|
|
1600
1646
|
}
|
|
1601
1647
|
/**
|
|
@@ -1613,8 +1659,8 @@ class vo extends zt {
|
|
|
1613
1659
|
emitCommand({ item: o, argument: n }) {
|
|
1614
1660
|
const { command: e } = o;
|
|
1615
1661
|
if (e) {
|
|
1616
|
-
if (this.log("(emmitCommand) Command:", e, o, n), e in
|
|
1617
|
-
return
|
|
1662
|
+
if (this.log("(emmitCommand) Command:", e, o, n), e in Se(this, he))
|
|
1663
|
+
return Se(this, he)[e]({ item: o, argument: n });
|
|
1618
1664
|
if (e in this.activeEditor?.commands)
|
|
1619
1665
|
this.activeEditor.commands[e](n), this.updateToolbarState();
|
|
1620
1666
|
else
|
|
@@ -1622,78 +1668,78 @@ class vo extends zt {
|
|
|
1622
1668
|
}
|
|
1623
1669
|
}
|
|
1624
1670
|
}
|
|
1625
|
-
|
|
1671
|
+
I = new WeakSet(), et = function() {
|
|
1626
1672
|
this.config.groups && !Array.isArray(this.config.groups) && Object.keys(this.config.groups).length && (this.config.toolbarGroups = Object.keys(this.config.groups));
|
|
1627
|
-
},
|
|
1628
|
-
const i = document.documentElement.clientWidth, { defaultItems:
|
|
1673
|
+
}, he = new WeakMap(), ze = function(o, n, e = !1) {
|
|
1674
|
+
const i = document.documentElement.clientWidth, { defaultItems: d, overflowItems: l } = Xn(o, e, i, this.role, n);
|
|
1629
1675
|
let a = [
|
|
1630
|
-
...
|
|
1631
|
-
...
|
|
1676
|
+
...d.map((u) => u.name.value),
|
|
1677
|
+
...l.map((u) => u.name.value)
|
|
1632
1678
|
];
|
|
1633
1679
|
this.config.groups && (a = Object.values(this.config.groups).flatMap((u) => u));
|
|
1634
|
-
const
|
|
1635
|
-
this.toolbarItems =
|
|
1636
|
-
},
|
|
1680
|
+
const c = d.filter((u) => a.includes(u.name.value)).filter((u) => !this.config.excludeItems.includes(u.name.value));
|
|
1681
|
+
this.toolbarItems = c, this.overflowItems = l.filter((u) => a.includes(u.name.value));
|
|
1682
|
+
}, tt = function() {
|
|
1637
1683
|
if (!this.activeEditor || !this.activeEditor.converter) return;
|
|
1638
|
-
const { typeface: o = "Arial", fontSizePt: n = 12 } = this.activeEditor.converter.getDocumentDefaultStyles() ?? {}, e = this.toolbarItems.find((
|
|
1684
|
+
const { typeface: o = "Arial", fontSizePt: n = 12 } = this.activeEditor.converter.getDocumentDefaultStyles() ?? {}, e = this.toolbarItems.find((d) => d.name.value === "fontSize");
|
|
1639
1685
|
e && (e.defaultLabel.value = n);
|
|
1640
|
-
const i = this.toolbarItems.find((
|
|
1686
|
+
const i = this.toolbarItems.find((d) => d.name.value === "fontFamily");
|
|
1641
1687
|
i && (i.defaultLabel.value = o);
|
|
1642
|
-
},
|
|
1688
|
+
}, nt = function() {
|
|
1643
1689
|
if (!this.activeEditor || !this.activeEditor.converter || !this.activeEditor.converter.docHiglightColors.size) return;
|
|
1644
|
-
const o = this.toolbarItems.find((
|
|
1645
|
-
const u = Math.floor(
|
|
1646
|
-
return
|
|
1647
|
-
}, []),
|
|
1690
|
+
const o = this.toolbarItems.find((l) => l.name.value === "highlight"), n = Hn(), e = 7, i = Array.from(this.activeEditor.converter.docHiglightColors).reduce((l, a, c) => {
|
|
1691
|
+
const u = Math.floor(c / e);
|
|
1692
|
+
return l[u] || (l[u] = []), n.includes(a) || l[u].push(f(a)), l;
|
|
1693
|
+
}, []), d = {
|
|
1648
1694
|
key: "color",
|
|
1649
1695
|
type: "render",
|
|
1650
|
-
render: () =>
|
|
1696
|
+
render: () => Ne(this, o, i)
|
|
1651
1697
|
};
|
|
1652
|
-
o.nestedOptions.value = [
|
|
1653
|
-
},
|
|
1698
|
+
o.nestedOptions.value = [d];
|
|
1699
|
+
}, We = function() {
|
|
1654
1700
|
this.activeEditor = null, this.toolbarItems.forEach((o) => {
|
|
1655
1701
|
const { allowWithoutEditor: n } = o;
|
|
1656
1702
|
n.value || o.setDisabled(!0);
|
|
1657
1703
|
});
|
|
1658
|
-
},
|
|
1659
|
-
this.activeEditor && (this.undoDepth =
|
|
1660
|
-
},
|
|
1704
|
+
}, ot = function() {
|
|
1705
|
+
this.activeEditor && (this.undoDepth = vt(this.activeEditor.state), this.redoDepth = yt(this.activeEditor.state));
|
|
1706
|
+
}, fe = function({ item: o, argument: n }, e) {
|
|
1661
1707
|
if (!n || !this.activeEditor) return;
|
|
1662
1708
|
let i = o.command;
|
|
1663
1709
|
i in this.activeEditor?.commands && (this.activeEditor.commands[i](n), typeof e == "function" && e(n), this.updateToolbarState());
|
|
1664
1710
|
};
|
|
1665
|
-
function
|
|
1666
|
-
if (!t.value || !
|
|
1667
|
-
const o =
|
|
1711
|
+
function no(t, s) {
|
|
1712
|
+
if (!t.value || !s?.value?.options?.scale) return;
|
|
1713
|
+
const o = s.value.options.scale, n = t.value.getBoundingClientRect(), e = t.value.querySelectorAll(".pagination-break-wrapper");
|
|
1668
1714
|
let i;
|
|
1669
|
-
e.forEach((
|
|
1670
|
-
const a = (
|
|
1715
|
+
e.forEach((d) => {
|
|
1716
|
+
const a = (d.getBoundingClientRect().left - n.left) / o * -1 + 1;
|
|
1671
1717
|
if (i || (i = a), a !== i) {
|
|
1672
|
-
const
|
|
1673
|
-
|
|
1718
|
+
const c = a - i;
|
|
1719
|
+
d.style.transform = `translateX(${c}px)`;
|
|
1674
1720
|
}
|
|
1675
1721
|
});
|
|
1676
1722
|
}
|
|
1677
|
-
const
|
|
1678
|
-
const o = t.clientY, n = t.clientX, { view: e } =
|
|
1679
|
-
let
|
|
1723
|
+
const oo = (t, s) => {
|
|
1724
|
+
const o = t.clientY, n = t.clientX, { view: e } = s, i = e.dom.getBoundingClientRect();
|
|
1725
|
+
let d = {
|
|
1680
1726
|
left: 0,
|
|
1681
1727
|
top: o
|
|
1682
|
-
},
|
|
1683
|
-
n > i.right ? (
|
|
1684
|
-
const a = e.posAtCoords(
|
|
1728
|
+
}, l = !1;
|
|
1729
|
+
n > i.right ? (d.left = i.left + i.width - 1, l = !0) : n < i.left && (d.left = i.left);
|
|
1730
|
+
const a = e.posAtCoords(d)?.pos;
|
|
1685
1731
|
if (a) {
|
|
1686
|
-
let
|
|
1687
|
-
if (
|
|
1688
|
-
const b = e.state.doc.resolve(a).textOffset,
|
|
1689
|
-
|
|
1732
|
+
let c = a;
|
|
1733
|
+
if (l) {
|
|
1734
|
+
const b = e.state.doc.resolve(a).textOffset, y = e.state.doc.nodeAt(a), E = y?.text?.charAt(b);
|
|
1735
|
+
c = y?.isText && E !== " " ? a - 1 : a;
|
|
1690
1736
|
}
|
|
1691
1737
|
const u = e.state.tr.setSelection(
|
|
1692
|
-
|
|
1738
|
+
Xe.create(e.state.doc, c)
|
|
1693
1739
|
);
|
|
1694
1740
|
e.dispatch(u), e.focus();
|
|
1695
1741
|
}
|
|
1696
|
-
},
|
|
1742
|
+
}, io = { class: "numbering" }, Ae = 200, so = "flex-end", lo = {
|
|
1697
1743
|
__name: "Ruler",
|
|
1698
1744
|
props: {
|
|
1699
1745
|
orientation: {
|
|
@@ -1710,27 +1756,27 @@ const eo = (t, l) => {
|
|
|
1710
1756
|
}
|
|
1711
1757
|
},
|
|
1712
1758
|
emits: ["margin-change"],
|
|
1713
|
-
setup(t, { emit:
|
|
1714
|
-
const o =
|
|
1759
|
+
setup(t, { emit: s }) {
|
|
1760
|
+
const o = s, n = t, e = v(null), i = v([]), d = v("#CCCCCC"), l = v("#2563EB66"), a = v(null), c = v(null), u = v(!1), r = v(null), b = qe({ side: "left", x: 0 }), y = qe({ side: "right", x: 0 }), h = v(!1), E = v(0);
|
|
1715
1761
|
let g = 0;
|
|
1716
|
-
const
|
|
1762
|
+
const D = () => {
|
|
1717
1763
|
if (n.editor.options.mode !== "docx") return;
|
|
1718
|
-
const T = [], { pageMargins:
|
|
1719
|
-
a.value =
|
|
1720
|
-
for (let R = 0; R <
|
|
1721
|
-
const
|
|
1722
|
-
if (T.push(...
|
|
1723
|
-
T.push(...
|
|
1764
|
+
const T = [], { pageMargins: M, pageSize: H } = n.editor.getPageStyles();
|
|
1765
|
+
a.value = H, c.value = M, y.x = H.width * 96 - M.right * 96, b.x = M.left * 96;
|
|
1766
|
+
for (let R = 0; R < H.width; R++) {
|
|
1767
|
+
const Z = `${5.5}px`, ae = H.width - R;
|
|
1768
|
+
if (T.push(...L(1, "main", "20%", Z, R)), T.push(...L(3, "eighth", "10%", Z)), T.push(...L(1, "half", "40%", Z)), ae <= 0.5) break;
|
|
1769
|
+
T.push(...L(3, "eighth", "10%", Z));
|
|
1724
1770
|
}
|
|
1725
1771
|
return T;
|
|
1726
|
-
},
|
|
1727
|
-
const
|
|
1728
|
-
className: `${
|
|
1729
|
-
height:
|
|
1772
|
+
}, L = (T, M, H, R, X) => Array.from({ length: T }, (Z, ae) => {
|
|
1773
|
+
const ue = {
|
|
1774
|
+
className: `${M}-unit ruler-section`,
|
|
1775
|
+
height: H,
|
|
1730
1776
|
margin: R
|
|
1731
1777
|
};
|
|
1732
|
-
return
|
|
1733
|
-
}), p =
|
|
1778
|
+
return X !== void 0 && (ue.numbering = X), ue;
|
|
1779
|
+
}), p = j(() => (T) => ({
|
|
1734
1780
|
width: "1px",
|
|
1735
1781
|
minWidth: "1px",
|
|
1736
1782
|
maxWidth: "1px",
|
|
@@ -1738,88 +1784,88 @@ const eo = (t, l) => {
|
|
|
1738
1784
|
backgroundColor: T.color || "#666",
|
|
1739
1785
|
marginLeft: T.numbering === 0 ? null : T.margin,
|
|
1740
1786
|
marginRight: T.margin
|
|
1741
|
-
})), C =
|
|
1742
|
-
left: `${(T === "left" ? b :
|
|
1743
|
-
})),
|
|
1787
|
+
})), C = j(() => (T) => ({
|
|
1788
|
+
left: `${(T === "left" ? b : y).x}px`
|
|
1789
|
+
})), F = j(() => {
|
|
1744
1790
|
if (!e.value) return;
|
|
1745
|
-
const
|
|
1791
|
+
const H = e.value.parentElement.querySelector(".super-editor").getBoundingClientRect();
|
|
1746
1792
|
return {
|
|
1747
1793
|
left: `${r.value.x}px`,
|
|
1748
|
-
minHeight: `${
|
|
1794
|
+
minHeight: `${H.height}px`
|
|
1749
1795
|
};
|
|
1750
|
-
}),
|
|
1751
|
-
u.value = !0,
|
|
1752
|
-
const
|
|
1753
|
-
r.value =
|
|
1754
|
-
},
|
|
1796
|
+
}), z = (T) => {
|
|
1797
|
+
u.value = !0, ge();
|
|
1798
|
+
const M = T.currentTarget.id;
|
|
1799
|
+
r.value = M === "left-margin-handle" ? b : y, E.value = r.value.x, g = T.clientX - r.value.x, h.value = !0;
|
|
1800
|
+
}, B = (T) => {
|
|
1755
1801
|
if (!u.value) return;
|
|
1756
|
-
const
|
|
1757
|
-
r.value.x =
|
|
1758
|
-
},
|
|
1759
|
-
if (u.value = !1,
|
|
1760
|
-
const T =
|
|
1802
|
+
const M = T.clientX - g;
|
|
1803
|
+
r.value.x = M, r.value.side === "left" ? M <= 0 ? r.value.x = 0 : M >= y.x - Ae && (r.value.x = y.x - Ae) : M >= a.value.width * 96 ? r.value.x = a.value.width * 96 : M <= b.x + Ae && (r.value.x = b.x + Ae);
|
|
1804
|
+
}, q = () => {
|
|
1805
|
+
if (u.value = !1, h.value = !1, ve(), r.value && r.value.x !== E.value) {
|
|
1806
|
+
const T = ce();
|
|
1761
1807
|
o("margin-change", {
|
|
1762
1808
|
side: r.value.side,
|
|
1763
1809
|
value: T
|
|
1764
1810
|
});
|
|
1765
1811
|
}
|
|
1812
|
+
}, ge = () => {
|
|
1813
|
+
d.value = l.value;
|
|
1766
1814
|
}, ve = () => {
|
|
1767
|
-
|
|
1768
|
-
}, ce = () => {
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
"--
|
|
1772
|
-
"--ruler-handle-color": c.value,
|
|
1773
|
-
"--ruler-handle-active-color": s.value
|
|
1815
|
+
d.value = "#CCC";
|
|
1816
|
+
}, ce = () => r.value.side === "left" ? r.value.x / 96 : (a.value.width * 96 - r.value.x) / 96, de = j(() => ({
|
|
1817
|
+
"--alignment": so,
|
|
1818
|
+
"--ruler-handle-color": d.value,
|
|
1819
|
+
"--ruler-handle-active-color": l.value
|
|
1774
1820
|
}));
|
|
1775
|
-
return
|
|
1776
|
-
i.value =
|
|
1777
|
-
}),
|
|
1778
|
-
window.removeEventListener("mousemove",
|
|
1779
|
-
}), (T,
|
|
1821
|
+
return ke(() => {
|
|
1822
|
+
i.value = D(), window.addEventListener("mousemove", B), window.addEventListener("mouseup", q);
|
|
1823
|
+
}), Rt(() => {
|
|
1824
|
+
window.removeEventListener("mousemove", B), window.removeEventListener("mouseup", q);
|
|
1825
|
+
}), (T, M) => (w(), k("div", {
|
|
1780
1826
|
class: "ruler",
|
|
1781
1827
|
ref_key: "ruler",
|
|
1782
1828
|
ref: e,
|
|
1783
|
-
style:
|
|
1829
|
+
style: J(de.value)
|
|
1784
1830
|
}, [
|
|
1785
|
-
|
|
1831
|
+
x("div", {
|
|
1786
1832
|
class: "margin-handle handle-left",
|
|
1787
1833
|
id: "left-margin-handle",
|
|
1788
|
-
onMousedown:
|
|
1789
|
-
style:
|
|
1834
|
+
onMousedown: z,
|
|
1835
|
+
style: J(C.value("left"))
|
|
1790
1836
|
}, null, 36),
|
|
1791
|
-
|
|
1837
|
+
x("div", {
|
|
1792
1838
|
class: "margin-handle handle-right",
|
|
1793
1839
|
id: "right-margin-handle",
|
|
1794
|
-
onMousedown:
|
|
1795
|
-
style:
|
|
1840
|
+
onMousedown: z,
|
|
1841
|
+
style: J(C.value("right"))
|
|
1796
1842
|
}, null, 36),
|
|
1797
|
-
|
|
1843
|
+
h.value ? (w(), k("div", {
|
|
1798
1844
|
key: 0,
|
|
1799
1845
|
class: "vertical-indicator",
|
|
1800
|
-
style:
|
|
1846
|
+
style: J(F.value)
|
|
1801
1847
|
}, null, 4)) : ne("", !0),
|
|
1802
|
-
(
|
|
1803
|
-
class: oe(
|
|
1804
|
-
style:
|
|
1848
|
+
(w(!0), k(U, null, Q(i.value, (H) => (w(), k("div", {
|
|
1849
|
+
class: oe(H.className),
|
|
1850
|
+
style: J(p.value(H))
|
|
1805
1851
|
}, [
|
|
1806
|
-
|
|
1807
|
-
(
|
|
1852
|
+
x("div", io, ie(H.numbering), 1),
|
|
1853
|
+
(w(!0), k(U, null, Q(H.elements, (R) => (w(), k("div", {
|
|
1808
1854
|
class: oe(R.className),
|
|
1809
|
-
style:
|
|
1855
|
+
style: J(p.value(R))
|
|
1810
1856
|
}, [
|
|
1811
|
-
(
|
|
1812
|
-
class: oe(
|
|
1813
|
-
style:
|
|
1857
|
+
(w(!0), k(U, null, Q(R.elements, (X) => (w(), k("div", {
|
|
1858
|
+
class: oe(X.className),
|
|
1859
|
+
style: J(p.value(X))
|
|
1814
1860
|
}, null, 6))), 256))
|
|
1815
1861
|
], 6))), 256))
|
|
1816
1862
|
], 6))), 256))
|
|
1817
1863
|
], 4));
|
|
1818
1864
|
}
|
|
1819
|
-
},
|
|
1865
|
+
}, ao = /* @__PURE__ */ K(lo, [["__scopeId", "data-v-ad77036c"]]), ro = { class: "super-editor-container" }, co = {
|
|
1820
1866
|
key: 1,
|
|
1821
1867
|
class: "placeholder-editor"
|
|
1822
|
-
},
|
|
1868
|
+
}, uo = { class: "placeholder-title" }, mo = {
|
|
1823
1869
|
__name: "SuperEditor",
|
|
1824
1870
|
props: {
|
|
1825
1871
|
documentId: {
|
|
@@ -1848,156 +1894,156 @@ const eo = (t, l) => {
|
|
|
1848
1894
|
"comments-loaded",
|
|
1849
1895
|
"selection-update"
|
|
1850
1896
|
],
|
|
1851
|
-
setup(t, { emit:
|
|
1852
|
-
const o =
|
|
1897
|
+
setup(t, { emit: s }) {
|
|
1898
|
+
const o = s, n = t, e = v(!1), i = Ze(null), d = v(null), l = v(null);
|
|
1853
1899
|
let a;
|
|
1854
|
-
const
|
|
1900
|
+
const c = () => {
|
|
1855
1901
|
clearTimeout(a);
|
|
1856
|
-
}, u = (p, C = 10,
|
|
1857
|
-
const
|
|
1858
|
-
const
|
|
1859
|
-
|
|
1902
|
+
}, u = (p, C = 10, F = 500) => {
|
|
1903
|
+
const z = p.getMap("meta"), B = () => {
|
|
1904
|
+
const q = z.get("docx");
|
|
1905
|
+
q ? (c(), h({ content: q })) : C > 0 ? (console.debug(`Waiting for 'docx' data... retries left: ${C}`), a = setTimeout(B, F), C--) : console.warn("Failed to load docx data from meta map.");
|
|
1860
1906
|
};
|
|
1861
|
-
|
|
1907
|
+
B();
|
|
1862
1908
|
}, r = async () => {
|
|
1863
1909
|
try {
|
|
1864
|
-
const [p, C,
|
|
1865
|
-
return { content: p, media: C, mediaFiles:
|
|
1910
|
+
const [p, C, F, z] = await Oe.loadXmlData(n.fileSource);
|
|
1911
|
+
return { content: p, media: C, mediaFiles: F, fonts: z };
|
|
1866
1912
|
} catch (p) {
|
|
1867
1913
|
console.debug("Error loading new file data:", p);
|
|
1868
1914
|
}
|
|
1869
1915
|
}, b = async () => {
|
|
1870
1916
|
if (n.fileSource) {
|
|
1871
1917
|
const p = await r();
|
|
1872
|
-
return
|
|
1918
|
+
return h(p);
|
|
1873
1919
|
} else if (n.options.ydoc && n.options.collaborationProvider) {
|
|
1874
1920
|
delete n.options.content;
|
|
1875
|
-
const p = n.options.ydoc, C = n.options.collaborationProvider,
|
|
1876
|
-
u(p), C.off("synced",
|
|
1921
|
+
const p = n.options.ydoc, C = n.options.collaborationProvider, F = () => {
|
|
1922
|
+
u(p), C.off("synced", F);
|
|
1877
1923
|
};
|
|
1878
|
-
C.on("synced",
|
|
1924
|
+
C.on("synced", F);
|
|
1879
1925
|
}
|
|
1880
|
-
},
|
|
1881
|
-
const p =
|
|
1926
|
+
}, y = () => {
|
|
1927
|
+
const p = bt();
|
|
1882
1928
|
return n.options.pagination ? p : p.filter((C) => C.name !== "pagination");
|
|
1883
|
-
},
|
|
1884
|
-
i.value = new
|
|
1929
|
+
}, h = async ({ content: p, media: C = {}, mediaFiles: F = {}, fonts: z = {} } = {}) => {
|
|
1930
|
+
i.value = new Oe({
|
|
1885
1931
|
mode: "docx",
|
|
1886
|
-
element:
|
|
1932
|
+
element: l.value,
|
|
1887
1933
|
fileSource: n.fileSource,
|
|
1888
|
-
extensions:
|
|
1934
|
+
extensions: y(),
|
|
1889
1935
|
externalExtensions: n.options.externalExtensions,
|
|
1890
1936
|
documentId: n.documentId,
|
|
1891
1937
|
content: p,
|
|
1892
1938
|
media: C,
|
|
1893
|
-
mediaFiles:
|
|
1894
|
-
fonts:
|
|
1939
|
+
mediaFiles: F,
|
|
1940
|
+
fonts: z,
|
|
1895
1941
|
...n.options
|
|
1896
1942
|
}), i.value.on("paginationUpdate", () => {
|
|
1897
|
-
|
|
1943
|
+
no(l, i);
|
|
1898
1944
|
}), i.value.on("collaborationReady", () => {
|
|
1899
1945
|
setTimeout(() => {
|
|
1900
1946
|
e.value = !0;
|
|
1901
1947
|
}, 150);
|
|
1902
1948
|
});
|
|
1903
|
-
},
|
|
1949
|
+
}, E = (p) => {
|
|
1904
1950
|
o("editor-keydown", { editor: i.value });
|
|
1905
1951
|
}, g = (p) => {
|
|
1906
1952
|
o("editor-click", { editor: i.value });
|
|
1907
|
-
let C =
|
|
1953
|
+
let C = l.value?.querySelector(".ProseMirror");
|
|
1908
1954
|
if (!C || !i.value)
|
|
1909
1955
|
return;
|
|
1910
1956
|
!C.contains(p.target) && i.value.isEditable && i.value.view?.focus();
|
|
1911
1957
|
};
|
|
1912
|
-
|
|
1958
|
+
ke(() => {
|
|
1913
1959
|
b(), (n.options?.suppressSkeletonLoader || !n.options?.collaborationProvider) && (e.value = !0);
|
|
1914
1960
|
});
|
|
1915
|
-
const
|
|
1916
|
-
p.target.classList.contains("ProseMirror") ||
|
|
1917
|
-
},
|
|
1961
|
+
const D = (p) => {
|
|
1962
|
+
p.target.classList.contains("ProseMirror") || oo(p, i.value);
|
|
1963
|
+
}, L = ({ side: p, value: C }) => {
|
|
1918
1964
|
if (!i.value) return;
|
|
1919
|
-
const
|
|
1920
|
-
i.value?.updatePageStyle({ pageMargins:
|
|
1965
|
+
const F = i.value.getPageStyles(), { pageMargins: z } = F, B = { ...z, [p]: C };
|
|
1966
|
+
i.value?.updatePageStyle({ pageMargins: B });
|
|
1921
1967
|
};
|
|
1922
|
-
return
|
|
1923
|
-
|
|
1924
|
-
}), (p, C) => (
|
|
1925
|
-
t.options.rulers && i.value ? (
|
|
1968
|
+
return Ye(() => {
|
|
1969
|
+
c(), i.value?.destroy(), i.value = null;
|
|
1970
|
+
}), (p, C) => (w(), k("div", ro, [
|
|
1971
|
+
t.options.rulers && i.value ? (w(), Ot(ao, {
|
|
1926
1972
|
key: 0,
|
|
1927
1973
|
class: "ruler",
|
|
1928
1974
|
editor: i.value,
|
|
1929
|
-
onMarginChange:
|
|
1975
|
+
onMarginChange: L
|
|
1930
1976
|
}, null, 8, ["editor"])) : ne("", !0),
|
|
1931
|
-
|
|
1977
|
+
x("div", {
|
|
1932
1978
|
class: "super-editor",
|
|
1933
1979
|
ref_key: "editorWrapper",
|
|
1934
|
-
ref:
|
|
1935
|
-
onKeydown:
|
|
1980
|
+
ref: d,
|
|
1981
|
+
onKeydown: E,
|
|
1936
1982
|
onClick: g,
|
|
1937
|
-
onMousedown:
|
|
1983
|
+
onMousedown: D
|
|
1938
1984
|
}, [
|
|
1939
|
-
|
|
1985
|
+
x("div", {
|
|
1940
1986
|
ref_key: "editorElem",
|
|
1941
|
-
ref:
|
|
1987
|
+
ref: l,
|
|
1942
1988
|
class: "editor-element super-editor__element"
|
|
1943
1989
|
}, null, 512)
|
|
1944
1990
|
], 544),
|
|
1945
|
-
e.value ? ne("", !0) : (
|
|
1946
|
-
|
|
1947
|
-
V($(
|
|
1991
|
+
e.value ? ne("", !0) : (w(), k("div", co, [
|
|
1992
|
+
x("div", uo, [
|
|
1993
|
+
V($(Y), {
|
|
1948
1994
|
text: "",
|
|
1949
1995
|
style: { width: "60%" }
|
|
1950
1996
|
})
|
|
1951
1997
|
]),
|
|
1952
|
-
V($(
|
|
1998
|
+
V($(Y), {
|
|
1953
1999
|
text: "",
|
|
1954
2000
|
repeat: 6
|
|
1955
2001
|
}),
|
|
1956
|
-
V($(
|
|
2002
|
+
V($(Y), {
|
|
1957
2003
|
text: "",
|
|
1958
2004
|
style: { width: "60%" }
|
|
1959
2005
|
}),
|
|
1960
|
-
V($(
|
|
2006
|
+
V($(Y), {
|
|
1961
2007
|
text: "",
|
|
1962
2008
|
repeat: 6,
|
|
1963
2009
|
style: { width: "30%", display: "block", margin: "20px" }
|
|
1964
2010
|
}),
|
|
1965
|
-
V($(
|
|
2011
|
+
V($(Y), {
|
|
1966
2012
|
text: "",
|
|
1967
2013
|
style: { width: "60%" }
|
|
1968
2014
|
}),
|
|
1969
|
-
V($(
|
|
2015
|
+
V($(Y), {
|
|
1970
2016
|
text: "",
|
|
1971
2017
|
repeat: 5
|
|
1972
2018
|
}),
|
|
1973
|
-
V($(
|
|
2019
|
+
V($(Y), {
|
|
1974
2020
|
text: "",
|
|
1975
2021
|
style: { width: "30%" }
|
|
1976
2022
|
}),
|
|
1977
|
-
V($(
|
|
2023
|
+
V($(Y), {
|
|
1978
2024
|
text: "",
|
|
1979
2025
|
style: { "margin-top": "50px" }
|
|
1980
2026
|
}),
|
|
1981
|
-
V($(
|
|
2027
|
+
V($(Y), {
|
|
1982
2028
|
text: "",
|
|
1983
2029
|
repeat: 6
|
|
1984
2030
|
}),
|
|
1985
|
-
V($(
|
|
2031
|
+
V($(Y), {
|
|
1986
2032
|
text: "",
|
|
1987
2033
|
style: { width: "70%" }
|
|
1988
2034
|
})
|
|
1989
2035
|
]))
|
|
1990
2036
|
]));
|
|
1991
2037
|
}
|
|
1992
|
-
},
|
|
2038
|
+
}, Co = /* @__PURE__ */ K(mo, [["__scopeId", "data-v-ff8f86f4"]]), _o = {
|
|
1993
2039
|
__name: "BasicUpload",
|
|
1994
2040
|
emits: ["file-change"],
|
|
1995
|
-
setup(t, { emit:
|
|
1996
|
-
const o =
|
|
2041
|
+
setup(t, { emit: s }) {
|
|
2042
|
+
const o = s, n = (e) => {
|
|
1997
2043
|
o("file-change", e.target.files[0]);
|
|
1998
2044
|
};
|
|
1999
|
-
return (e, i) => (
|
|
2000
|
-
|
|
2045
|
+
return (e, i) => (w(), k("div", null, [
|
|
2046
|
+
x("input", {
|
|
2001
2047
|
type: "file",
|
|
2002
2048
|
id: "fileInput",
|
|
2003
2049
|
onChange: n,
|
|
@@ -2005,7 +2051,7 @@ const eo = (t, l) => {
|
|
|
2005
2051
|
}, null, 32)
|
|
2006
2052
|
]));
|
|
2007
2053
|
}
|
|
2008
|
-
},
|
|
2054
|
+
}, po = ["innerHTML"], fo = {
|
|
2009
2055
|
__name: "SuperInput",
|
|
2010
2056
|
props: {
|
|
2011
2057
|
modelValue: {
|
|
@@ -2028,74 +2074,75 @@ const eo = (t, l) => {
|
|
|
2028
2074
|
}
|
|
2029
2075
|
},
|
|
2030
2076
|
emits: ["update:modelValue", "focus", "blur"],
|
|
2031
|
-
setup(t, { emit:
|
|
2032
|
-
const o =
|
|
2033
|
-
const
|
|
2034
|
-
o("update:modelValue",
|
|
2035
|
-
}, a = ({ editor:
|
|
2036
|
-
|
|
2037
|
-
},
|
|
2038
|
-
|
|
2077
|
+
setup(t, { emit: s }) {
|
|
2078
|
+
const o = s, n = t, e = Ze(), i = v(null), d = v(!1), l = ({ editor: y, transaction: h }) => {
|
|
2079
|
+
const E = y.getHTML();
|
|
2080
|
+
o("update:modelValue", E);
|
|
2081
|
+
}, a = ({ editor: y, transaction: h }) => {
|
|
2082
|
+
d.value = !0, b(), o("focus", { editor: y, transaction: h });
|
|
2083
|
+
}, c = ({ editor: y, transaction: h }) => {
|
|
2084
|
+
d.value = !1, o("blur", { editor: y, transaction: h });
|
|
2039
2085
|
}, u = async () => {
|
|
2040
|
-
|
|
2086
|
+
wt.options.placeholder = n.placeholder || "Type something...", n.options.onTransaction = l, n.options.onFocus = a, n.options.onBlur = c, e.value = new Oe({
|
|
2041
2087
|
mode: "text",
|
|
2042
2088
|
content: document.getElementById("currentContent"),
|
|
2043
2089
|
element: i.value,
|
|
2044
|
-
extensions:
|
|
2090
|
+
extensions: kt(),
|
|
2045
2091
|
users: n.users,
|
|
2046
2092
|
...n.options
|
|
2047
2093
|
});
|
|
2048
2094
|
}, r = () => {
|
|
2049
|
-
|
|
2095
|
+
d.value = !0, e.value?.view?.focus();
|
|
2050
2096
|
}, b = () => {
|
|
2051
2097
|
e.value?.setOptions({ users: n.users });
|
|
2052
2098
|
};
|
|
2053
|
-
return
|
|
2099
|
+
return ke(() => {
|
|
2054
2100
|
u();
|
|
2055
|
-
}),
|
|
2101
|
+
}), Ye(() => {
|
|
2056
2102
|
e.value?.destroy(), e.value = null;
|
|
2057
|
-
}), (
|
|
2058
|
-
class: oe(["super-editor super-input", { "super-input-active":
|
|
2059
|
-
onClick:
|
|
2103
|
+
}), (y, h) => (w(), k("div", {
|
|
2104
|
+
class: oe(["super-editor super-input", { "super-input-active": d.value }]),
|
|
2105
|
+
onClick: we(r, ["stop", "prevent"])
|
|
2060
2106
|
}, [
|
|
2061
|
-
|
|
2107
|
+
x("div", {
|
|
2062
2108
|
id: "currentContent",
|
|
2063
2109
|
style: { display: "none" },
|
|
2064
2110
|
innerHTML: t.modelValue
|
|
2065
|
-
}, null, 8,
|
|
2066
|
-
|
|
2111
|
+
}, null, 8, po),
|
|
2112
|
+
x("div", {
|
|
2067
2113
|
ref_key: "editorElem",
|
|
2068
2114
|
ref: i,
|
|
2069
2115
|
class: "editor-element super-editor__element"
|
|
2070
2116
|
}, null, 512)
|
|
2071
2117
|
], 2));
|
|
2072
2118
|
}
|
|
2073
|
-
},
|
|
2074
|
-
Node:
|
|
2075
|
-
Attribute:
|
|
2076
|
-
Extension:
|
|
2077
|
-
Plugin:
|
|
2078
|
-
Mark:
|
|
2119
|
+
}, xo = /* @__PURE__ */ K(fo, [["__scopeId", "data-v-4d5cff52"]]), Eo = {
|
|
2120
|
+
Node: Et,
|
|
2121
|
+
Attribute: xt,
|
|
2122
|
+
Extension: _t,
|
|
2123
|
+
Plugin: Ft,
|
|
2124
|
+
Mark: Ct
|
|
2079
2125
|
};
|
|
2080
2126
|
export {
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2127
|
+
Wt as AIWriter,
|
|
2128
|
+
_o as BasicUpload,
|
|
2129
|
+
To as CommentsPluginKey,
|
|
2130
|
+
Ro as DocxZipper,
|
|
2131
|
+
Oe as Editor,
|
|
2132
|
+
Eo as Extensions,
|
|
2133
|
+
Ho as SuperConverter,
|
|
2134
|
+
Co as SuperEditor,
|
|
2135
|
+
xo as SuperInput,
|
|
2136
|
+
ko as SuperToolbar,
|
|
2137
|
+
zt as Toolbar,
|
|
2138
|
+
Fo as TrackChangesBasePluginKey,
|
|
2139
|
+
No as createZip,
|
|
2140
|
+
Io as fieldAnnotationHelpers,
|
|
2141
|
+
ht as getActiveFormatting,
|
|
2142
|
+
eo as getAllowedImageDimensions,
|
|
2143
|
+
Lo as getMarksFromSelection,
|
|
2144
|
+
kt as getRichTextExtensions,
|
|
2145
|
+
bt as getStarterExtensions,
|
|
2146
|
+
Mo as helpers,
|
|
2147
|
+
Do as trackChangesHelpers
|
|
2101
2148
|
};
|