@harbour-enterprises/superdoc 0.12.0-RC1 → 0.12.0-RC2

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