@harbour-enterprises/superdoc 0.10.59 → 0.10.60

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