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