@harbour-enterprises/superdoc 0.11.40 → 0.11.42

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 (27) hide show
  1. package/dist/chunks/{super-editor.es-RKwdWGC7.es.js → super-editor.es-B_EX0CMY.es.js} +33 -25
  2. package/dist/chunks/{super-editor.es-DZzKZJLy.cjs → super-editor.es-CEU22lZX.cjs} +46 -43
  3. package/dist/style.css +1 -1
  4. package/dist/super-editor/ai-writer.es.js +2 -2
  5. package/dist/super-editor/chunks/{converter-DQ7oe9jd.js → converter-adJM2cRp.js} +2 -2
  6. package/dist/super-editor/chunks/{docx-zipper-Bu4tz-qv.js → docx-zipper-DgXLizYT.js} +1 -1
  7. package/dist/super-editor/chunks/{editor--E_CT98k.js → editor-Di7QIxzf.js} +3 -3
  8. package/dist/super-editor/chunks/{toolbar-H6KJEcQT.js → toolbar-DOQF8N-8.js} +132 -132
  9. package/dist/super-editor/components/toolbar/super-toolbar.d.ts +6 -1
  10. package/dist/super-editor/components/toolbar/super-toolbar.d.ts.map +1 -1
  11. package/dist/super-editor/converter.es.js +1 -1
  12. package/dist/super-editor/docx-zipper.es.js +2 -2
  13. package/dist/super-editor/editor.es.js +3 -3
  14. package/dist/super-editor/file-zipper.es.js +1 -1
  15. package/dist/super-editor/style.css +1 -1
  16. package/dist/super-editor/super-editor.es.js +459 -451
  17. package/dist/super-editor/tests/e2e/test-app/vite.config.d.ts +1 -1
  18. package/dist/super-editor/toolbar.es.js +2 -2
  19. package/dist/super-editor.cjs +1 -1
  20. package/dist/super-editor.es.js +1 -1
  21. package/dist/superdoc.cjs +3 -3
  22. package/dist/superdoc.es.js +4 -4
  23. package/dist/superdoc.umd.js +1245 -1237
  24. package/dist/superdoc.umd.js.map +1 -1
  25. package/package.json +1 -1
  26. package/dist/super-editor/tests/e2e/test-app/dist/assets/index-BTMvkUyI.d.ts +0 -3
  27. package/dist/super-editor/tests/e2e/test-app/dist/assets/index-BTMvkUyI.d.ts.map +0 -1
@@ -2,93 +2,93 @@ var yt = Object.defineProperty;
2
2
  var Ue = (t) => {
3
3
  throw TypeError(t);
4
4
  };
5
- var bt = (t, a, o) => a in t ? yt(t, a, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[a] = o;
6
- var Re = (t, a, o) => bt(t, typeof a != "symbol" ? a + "" : a, o), qe = (t, a, o) => a.has(t) || Ue("Cannot " + o);
7
- var Ae = (t, a, o) => (qe(t, a, "read from private field"), o ? o.call(t) : a.get(t)), Oe = (t, a, o) => a.has(t) ? Ue("Cannot add the same private member more than once") : a instanceof WeakSet ? a.add(t) : a.set(t, o);
8
- var z = (t, a, o) => (qe(t, a, "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--E_CT98k.js";
10
- import { C as No, T as zo, l as Vo, n as Wo, k as Po, m as jo } from "./chunks/editor--E_CT98k.js";
11
- import { a1 as Dt, E as $t, a3 as Ht, T as Ye, a as Bt } from "./chunks/converter-DQ7oe9jd.js";
12
- import { O as qo } from "./chunks/converter-DQ7oe9jd.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-Di7QIxzf.js";
10
+ import { C as No, T as zo, l as Vo, n as Wo, k as Po, m as jo } from "./chunks/editor-Di7QIxzf.js";
11
+ import { a1 as Dt, E as $t, a3 as Ht, T as Ye, a as Bt } from "./chunks/converter-adJM2cRp.js";
12
+ import { O as qo } from "./chunks/converter-adJM2cRp.js";
13
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-H6KJEcQT.js";
14
+ import { t as X, s as Wt, T as Pt, N as Y } from "./chunks/toolbar-DOQF8N-8.js";
15
15
  import jt from "./ai-writer.es.js";
16
- import { D as Ko } from "./chunks/docx-zipper-Bu4tz-qv.js";
16
+ import { D as Ko } from "./chunks/docx-zipper-DgXLizYT.js";
17
17
  import { createZip as Zo } from "./file-zipper.es.js";
18
18
  var it = { exports: {} };
19
19
  (function(t) {
20
- var a = 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
- function l() {
36
+ function a() {
37
37
  this._events = new n(), this._eventsCount = 0;
38
38
  }
39
- l.prototype.eventNames = function() {
40
- var c = [], d, u;
41
- if (this._eventsCount === 0) return c;
42
- for (u in d = this._events)
43
- a.call(d, u) && c.push(o ? u.slice(1) : u);
44
- return Object.getOwnPropertySymbols ? c.concat(Object.getOwnPropertySymbols(d)) : c;
45
- }, l.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;
39
+ a.prototype.eventNames = function() {
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
- }, l.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
- }, l.prototype.emit = function(c, d, u, b, v, y) {
56
- var E = o ? o + c : c;
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
57
  if (!this._events[E]) return !1;
58
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,57 +97,57 @@ var it = { exports: {} };
97
97
  }
98
98
  }
99
99
  return !0;
100
- }, l.prototype.on = function(c, d, u) {
101
- return i(this, c, d, u, !1);
102
- }, l.prototype.once = function(c, d, u) {
103
- return i(this, c, d, u, !0);
104
- }, l.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
113
  for (var E = 0, g = [], F = y.length; E < F; E++)
114
- (y[E].fn !== d || b && !y[E].once || u && y[E].context !== u) && g.push(y[E]);
115
- g.length ? this._events[v] = g.length === 1 ? g[0] : g : r(this, v);
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
- }, l.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;
121
- }, l.prototype.off = l.prototype.removeListener, l.prototype.addListener = l.prototype.on, l.prefixed = o, l.EventEmitter = l, t.exports = l;
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
+ }, 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 a = t;
127
- for (; a; ) {
128
- const o = window.getComputedStyle(a).overflowY;
129
- if (/(auto|scroll)/.test(o) && a.scrollHeight > a.clientHeight)
130
- return a;
131
- a = a.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, a = { 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: a.block === "start" ? i : i - o.clientHeight + t.offsetHeight,
140
- behavior: a.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, l = 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), E = 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), Ee = 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
153
  Ee.value.push(...t.options);
@@ -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,11 +170,11 @@ const x = (t) => {
170
170
  name: e,
171
171
  type: n,
172
172
  command: i,
173
- noArgumentCommand: r,
174
- icon: l,
173
+ noArgumentCommand: c,
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,
@@ -183,7 +183,7 @@ const x = (t) => {
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: a }) {
220
- const o = a, n = (e) => {
219
+ setup(t, { emit: r }) {
220
+ const o = r, n = (e) => {
221
221
  o("select", e);
222
222
  };
223
223
  return (e, i) => (w(), C("div", Xt, [
224
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
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
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
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,28 +281,28 @@ const x = (t) => {
281
281
  }
282
282
  },
283
283
  emits: ["submit", "cancel"],
284
- setup(t, { emit: a }) {
285
- const o = a, 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
- console.debug("[LinkInput] Invalid URL in handleSubmit"), l.value = !0;
294
- }, r = () => {
295
- o("submit", { text: s.value, href: null });
296
- }, l = 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(() => !E.value), E = j(() => n.href && !c.value), g = j(() => n.href.startsWith("#")), F = () => {
300
- window.open(d.value, "_blank");
293
+ console.debug("[LinkInput] Invalid URL in handleSubmit"), a.value = !0;
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 $ = () => {
@@ -311,7 +311,7 @@ const x = (t) => {
311
311
  };
312
312
  return ke(() => {
313
313
  n.showInput && $();
314
- }), (p, _) => (w(), C("div", nn, [
314
+ }), (p, x) => (w(), C("div", nn, [
315
315
  t.href ? g.value ? (w(), C("div", sn, "Page anchor")) : (w(), C("div", ln, "Edit link")) : (w(), C("div", on, "Add link")),
316
316
  t.showInput && !g.value ? (w(), C("div", an, [
317
317
  k("div", rn, [
@@ -322,17 +322,17 @@ const x = (t) => {
322
322
  Je(k("input", {
323
323
  type: "text",
324
324
  placeholder: "Type or paste a link",
325
- class: oe({ error: l.value }),
326
- "onUpdate:modelValue": _[0] || (_[0] = (T) => c.value = T),
325
+ class: oe({ error: a.value }),
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) => l.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
334
  k("div", {
335
- class: oe(["open-link-icon", { disabled: !u.value }]),
335
+ class: oe(["open-link-icon", { disabled: !s.value }]),
336
336
  innerHTML: D(X).openLink,
337
337
  onClick: F
338
338
  }, null, 10, un)
@@ -341,13 +341,13 @@ const x = (t) => {
341
341
  t.href ? (w(), C("button", {
342
342
  key: 0,
343
343
  class: "remove-btn",
344
- onClick: r
344
+ onClick: c
345
345
  }, [
346
346
  k("div", {
347
347
  class: "remove-btn__icon",
348
348
  innerHTML: D(X).removeLink
349
349
  }, null, 8, pn),
350
- _[3] || (_[3] = tt(" Remove "))
350
+ x[3] || (x[3] = tt(" Remove "))
351
351
  ])) : Q("", !0),
352
352
  y.value ? (w(), C("button", {
353
353
  key: 1,
@@ -357,7 +357,7 @@ const x = (t) => {
357
357
  ])
358
358
  ])) : g.value ? (w(), C("div", hn, [
359
359
  k("a", {
360
- onClick: _[2] || (_[2] = ge((...T) => t.goToAnchor && t.goToAnchor(...T), ["stop", "prevent"]))
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
  ]));
@@ -370,24 +370,24 @@ const x = (t) => {
370
370
  }
371
371
  },
372
372
  emits: ["select"],
373
- setup(t, { emit: a }) {
374
- const o = a, n = (e) => {
373
+ setup(t, { emit: r }) {
374
+ const o = r, n = (e) => {
375
375
  o("select", e);
376
376
  };
377
377
  return (e, i) => (w(), C("div", gn, [
378
- (w(!0), C(U, null, ee(t.options, (r) => (w(), C("div", {
379
- class: oe(["option-item", { disabled: r.disabled }]),
380
- onClick: (l) => n(r)
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
382
  k("div", bn, [
383
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
388
  k("div", Cn, [
389
- k("div", kn, ie(r.label), 1),
390
- k("div", _n, ie(r.description), 1)
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
  ]));
@@ -404,19 +404,19 @@ const x = (t) => {
404
404
  }
405
405
  },
406
406
  emits: ["select"],
407
- setup(t, { emit: a }) {
408
- const o = a, 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(), C("div", Sn, [
412
- (w(!0), C(U, null, ee(D(Ze)(t.editor), (l) => (w(), C("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(l)
414
+ onClick: (l) => e(a)
415
415
  }, [
416
416
  k("div", {
417
417
  class: "style-name",
418
- style: J(D(wt)(l, null, !1))
419
- }, ie(l.definition.attrs.name), 5)
418
+ style: J(D(wt)(a, null, !1))
419
+ }, ie(a.definition.attrs.name), 5)
420
420
  ], 8, An))), 256))
421
421
  ])) : Q("", !0);
422
422
  }
@@ -433,31 +433,31 @@ const x = (t) => {
433
433
  }
434
434
  },
435
435
  emits: ["select"],
436
- setup(t, { emit: a }) {
437
- const o = a, n = t, e = j(() => (l) => n.activeColor.value ? n.activeColor.value.toUpperCase() === l.value : !1), i = (l, s) => s === 5 || ["#FFFFFF", "#FAFF09"].includes(l) ? { color: "#000" } : { color: "#FFF" }, r = (l) => {
438
- o("select", l.value);
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
+ o("select", a.value);
439
439
  };
440
440
  return ke(() => {
441
- if (!n.icons.every((s) => Array.isArray(s))) throw new Error("icon props must be 2d array");
442
- }), (l, s) => (w(!0), C(U, null, ee(t.icons, (c, d) => (w(), C("div", {
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), C(U, null, ee(c, (u, b) => (w(), C("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
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(), C("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,15 +484,15 @@ const x = (t) => {
484
484
  }
485
485
  },
486
486
  emits: ["select", "clickoutside"],
487
- setup(t, { emit: a }) {
488
- const o = a, n = (e) => {
487
+ setup(t, { emit: r }) {
488
+ const o = r, n = (e) => {
489
489
  o("select", e);
490
490
  };
491
491
  return (e, i) => (w(), C("div", Hn, [
492
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
497
  k("span", {
498
498
  innerHTML: D($n),
@@ -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, a = null) => ({
523
- label: a,
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, a, o = [], n = !1) => {
531
+ }), Ve = (t, r, o = [], n = !1) => {
532
532
  const e = (i) => {
533
- a.iconColor.value = i, t.emitCommand({ item: a, argument: i }), zn(a);
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: a.iconColor,
539
+ activeColor: r.iconColor,
540
540
  hasNoneIcon: n,
541
541
  onSelect: e
542
542
  })
@@ -617,34 +617,34 @@ 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: a }) {
621
- const o = a, n = f(0), e = f(0), i = (l) => {
622
- let s = l.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 E = u[y], g = parseInt(E.dataset.cols, 10), F = parseInt(E.dataset.rows, 10);
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
629
  g <= b && F <= v ? E.classList.add("selected") : E.classList.remove("selected");
630
630
  }
631
- }, r = ({ cols: l, rows: s }) => {
632
- o("select", { cols: l, rows: s });
631
+ }, c = ({ cols: a, rows: l }) => {
632
+ o("select", { cols: a, rows: l });
633
633
  };
634
- return (l, s) => (w(), C("div", Wn, [
634
+ return (a, l) => (w(), C("div", Wn, [
635
635
  k("div", {
636
636
  class: "toolbar-table-grid",
637
637
  onMouseover: i,
638
638
  "data-grid": "true"
639
639
  }, [
640
- (w(), C(U, null, ee(5, (c) => (w(), C(U, { key: c }, [
641
- (w(), C(U, null, ee(5, (d) => k("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),
@@ -659,22 +659,22 @@ const x = (t) => {
659
659
  }
660
660
  },
661
661
  emits: ["select"],
662
- setup(t, { emit: a }) {
663
- const o = a, n = (e) => {
662
+ setup(t, { emit: r }) {
663
+ const o = r, n = (e) => {
664
664
  o("select", { command: e.command });
665
665
  };
666
666
  return (e, i) => (w(), C("div", Gn, [
667
- (w(!0), C(U, null, ee(t.options, (r) => (w(), C("div", {
668
- class: oe(["toolbar-table-actions__item", { "toolbar-table-actions__item--border": r.bottomBorder }]),
669
- onClick: (l) => n(r)
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
671
  k("div", Xn, [
672
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
- k("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: a }) {
691
- const o = f(""), n = a, 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(), C("div", to, [
694
+ return (i, c) => (w(), C("div", to, [
695
695
  k("div", no, [
696
696
  Je(k("input", {
697
697
  ref: t.searchRef,
698
- "onUpdate:modelValue": r[0] || (r[0] = (l) => o.value = l),
698
+ "onUpdate:modelValue": c[0] || (c[0] = (a) => o.value = a),
699
699
  class: "search-input",
700
700
  type: "text",
701
701
  name: "search",
@@ -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, a = !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
- }), l = 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",
@@ -802,9 +802,9 @@ const x = (t) => {
802
802
  [
803
803
  B(jt, {
804
804
  handleClose: () => {
805
- ae(l);
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 S = Wt(m, 12);
852
- S < 8 && (S = 8), S > 96 && (S = 96), s.label.value = String(S);
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), E = x({
914
+ }), y = f(null), E = _({
915
915
  type: "dropdown",
916
916
  name: "search",
917
917
  icon: e.search,
@@ -932,7 +932,7 @@ const x = (t) => {
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
1086
  onSelect: (S) => {
1087
- ae(m);
1087
+ ae(u);
1088
1088
  const { command: A } = S;
1089
- t.emitCommand({ item: m, argument: { command: A } });
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",
@@ -1115,53 +1115,53 @@ const x = (t) => {
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, S) => {
1124
+ }), re = (u, S) => {
1125
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
- }), Ee = 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
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, S) => m === "editor" ? S : m === "suggester" ? S.filter((A) => A.value === "suggesting") : S.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) {
1317
+ function me(u) {
1318
1318
  const S = Me(n, De);
1319
1319
  return B(En, {
1320
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
- }), Ce = x({
1350
+ }), Ce = _({
1351
1351
  type: "dropdown",
1352
1352
  name: "linkedStyles",
1353
1353
  command: "setLinkedStyle",
@@ -1367,7 +1367,7 @@ const x = (t) => {
1367
1367
  type: "render",
1368
1368
  key: "linkedStyle",
1369
1369
  render: () => {
1370
- const m = (S) => {
1370
+ const u = (S) => {
1371
1371
  ae(Ce);
1372
1372
  const A = { ...Ce, command: "setLinkedStyle" };
1373
1373
  t.emitCommand({ item: A, argument: S });
@@ -1375,7 +1375,7 @@ const x = (t) => {
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
  }
@@ -1387,10 +1387,10 @@ const x = (t) => {
1387
1387
  onDeactivate: () => {
1388
1388
  Ce.disabled.value = !0;
1389
1389
  }
1390
- }), he = (m, S) => {
1391
- if (S.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,148 +1426,148 @@ const x = (t) => {
1426
1426
  // toggleTrackChangesOriginal,
1427
1427
  // toggleTrackChangesFinal,
1428
1428
  G,
1429
- r,
1430
1429
  c,
1431
- s,
1432
- 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,
1450
+ d,
1451
1451
  Ce,
1452
- c,
1452
+ d,
1453
1453
  dt,
1454
1454
  se,
1455
1455
  Le,
1456
1456
  Ie,
1457
- l,
1457
+ a,
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);
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
1464
  const S = ["ruler", "zoom", "undo", "redo"];
1465
1465
  O = O.filter((A) => !S.includes(A.name.value));
1466
1466
  }
1467
1467
  const je = [ue, Ee, Fe];
1468
- a || (n === "viewer" && je.push(_e, xe), O = O.filter((m) => !je.includes(m)));
1469
- const ft = [E, K, R, ne].map((m) => m.name), vt = (m) => ft.includes(m.name), Se = [], He = [];
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 S = pe.get(m.name.value) || pe.get("default");
1473
- if (o < $e.xl && pt.includes(m.name.value)) {
1474
- if (Se.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
- Se.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 += S;
1484
+ if (vt(u)) {
1485
+ He.push(u), Be += S;
1486
1486
  return;
1487
1487
  }
1488
- Be < o ? (He.push(m), Be += S) : Se.push(m);
1488
+ Be < o ? (He.push(u), Be += S) : Se.push(u);
1489
1489
  }), {
1490
1490
  defaultItems: He,
1491
- overflowItems: Se.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 a = ao;
1497
- return t.accept = a.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((a, o) => {
1505
+ }, co = (t) => new Promise((r, o) => {
1506
1506
  let n = new FileReader();
1507
- n.onload = (e) => a(e.target.result), n.onerror = o, setTimeout(() => n.readAsDataURL(t), 250);
1508
- }), uo = (t, a) => 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: l } = mo(
1511
+ const i = document.createElement("canvas"), { width: c, height: a } = mo(
1512
1512
  e.width,
1513
1513
  e.height,
1514
- a
1514
+ r
1515
1515
  );
1516
- if (i.width = r, i.height = l, i.getContext("2d").drawImage(e, 0, 0, r, l), 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: l });
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, a, o) => {
1528
+ }), mo = (t, r, o) => {
1529
1529
  const { width: n, height: e } = o.getMaxContentSize();
1530
- if (!n || !e) return { width: t, height: a };
1531
- let i = t, r = a;
1532
- const l = t / a;
1533
- return a > e && (r = e, i = Math.round(e * l)), i > n && (i = n, r = Math.round(n / l)), { width: i, height: r };
1534
- }, po = async ({ editor: t, view: a, 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 l = {}, { tr: s, schema: c } = a.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,
1553
- id: l
1552
+ pos: l.selection.from,
1553
+ id: a
1554
1554
  };
1555
- s.setMeta(Ne, d), a.dispatch(s), n(o).then(
1556
- (u) => {
1557
- let b = o.name.replace(" ", "_"), v = Ct(a.state, l);
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: l }, E = `word/media/${b}`, g = c.nodes.image.create({
1560
+ let y = { type: "remove", id: a }, E = `word/media/${b}`, g = d.nodes.image.create({
1561
1561
  src: E,
1562
- size: { width: i, height: r }
1562
+ size: { width: i, height: c }
1563
1563
  });
1564
- t.storage.image.media = Object.assign(t.storage.image.media, { [E]: u }), t.options.ydoc && t.commands.addImageToCollaboration({ mediaPath: E, fileData: u }), a.dispatch(
1565
- a.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: l };
1570
- a.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
  };
@@ -1596,7 +1596,8 @@ class Mo extends qt {
1596
1596
  groups: null,
1597
1597
  editor: null,
1598
1598
  aiApiKey: null,
1599
- aiEndpoint: null
1599
+ aiEndpoint: null,
1600
+ customButtons: []
1600
1601
  });
1601
1602
  /**
1602
1603
  * Custom commands that override default behavior
@@ -1616,8 +1617,8 @@ class Mo extends qt {
1616
1617
  o.onActivate({ zoom: n }), this.emit("superdoc-command", { item: o, argument: n });
1617
1618
  const e = document.querySelector(this.superdoc.config.selector)?.querySelector(".layers");
1618
1619
  if (!e) return;
1619
- const i = typeof screen.orientation < "u", r = window.matchMedia("(max-width: 834px)").matches;
1620
- 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);
1621
1622
  },
1622
1623
  /**
1623
1624
  * Sets the document mode
@@ -1709,7 +1710,7 @@ class Mo extends qt {
1709
1710
  */
1710
1711
  increaseTextIndent: ({ item: o, argument: n }) => {
1711
1712
  let e = o.command, { state: i } = this.activeEditor;
1712
- if (Ge((l) => l.type.name === "listItem")(i.selection))
1713
+ if (Ge((a) => a.type.name === "listItem")(i.selection))
1713
1714
  return this.activeEditor.commands.increaseListIndent();
1714
1715
  e in this.activeEditor.commands && this.activeEditor.commands[e](n);
1715
1716
  },
@@ -1722,7 +1723,7 @@ class Mo extends qt {
1722
1723
  */
1723
1724
  decreaseTextIndent: ({ item: o, argument: n }) => {
1724
1725
  let e = o.command, { state: i } = this.activeEditor;
1725
- if (Ge((l) => l.type.name === "listItem")(i.selection))
1726
+ if (Ge((a) => a.type.name === "listItem")(i.selection))
1726
1727
  return this.activeEditor.commands.decreaseListIndent();
1727
1728
  e in this.activeEditor.commands && this.activeEditor.commands[e](n);
1728
1729
  },
@@ -1770,8 +1771,8 @@ class Mo extends qt {
1770
1771
  let e = o.command;
1771
1772
  if (e in this.activeEditor.commands) {
1772
1773
  this.activeEditor.commands[e](n);
1773
- const { view: i } = this.activeEditor, r = i.state.selection.$to.pos, l = new Ye(i.state.doc.resolve(r)), s = i.state.tr.setSelection(l), c = i.state.apply(s);
1774
- 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(() => {
1775
1776
  i.focus();
1776
1777
  }, 100);
1777
1778
  }
@@ -1850,7 +1851,7 @@ class Mo extends qt {
1850
1851
  * @returns {ToolbarItem[]} An array of toolbar items in the specified group
1851
1852
  */
1852
1853
  getToolbarItemByGroup(o) {
1853
- return this.toolbarItems.filter((n) => n.group.value === o);
1854
+ return this.toolbarItems.filter((n) => (n.group?.value || "center") === o);
1854
1855
  }
1855
1856
  /**
1856
1857
  * Get a toolbar item by name
@@ -1874,25 +1875,25 @@ class Mo extends qt {
1874
1875
  this.toolbarItems.forEach((e) => {
1875
1876
  if (e.resetDisabled(), e.name.value === "linkedStyles")
1876
1877
  return this.activeEditor && !Ze(this.activeEditor).length ? e.deactivate() : e.activate();
1877
- const i = o.find((s) => s.name === e.name.value);
1878
+ const i = o.find((l) => l.name === e.name.value);
1878
1879
  i ? e.activate(i.attrs) : e.deactivate();
1879
- const r = o.find((s) => s.name === "styleId");
1880
- if (r?.attrs.styleId) {
1881
- const s = {
1880
+ const c = o.find((l) => l.name === "styleId");
1881
+ if (c?.attrs.styleId) {
1882
+ const l = {
1882
1883
  fontSize: "font-size",
1883
1884
  fontFamily: "font-family",
1884
1885
  bold: "bold",
1885
1886
  textAlign: "textAlign"
1886
- }, c = this.activeEditor.converter?.linkedStyles.find((d) => d.id === r.attrs.styleId);
1887
- if (s[e.name.value] in c?.definition.styles) {
1888
- const d = {
1889
- [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]]
1890
1891
  };
1891
- e.activate(d);
1892
+ e.activate(m);
1892
1893
  }
1893
1894
  }
1894
- const l = o.find((s) => s.name === "spacing");
1895
- e.name.value === "lineHeight" && (i?.attrs?.lineHeight || l) && (e.selectedValue.value = i?.attrs?.lineHeight || l.attrs?.spacing?.line || ""), e.name.value === "tableActions" && (e.disabled.value = !n);
1895
+ const a = o.find((l) => l.name === "spacing");
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);
1896
1897
  });
1897
1898
  }
1898
1899
  /**
@@ -1912,16 +1913,22 @@ class Mo extends qt {
1912
1913
  * @param {*} [params.argument] - The argument passed to the command
1913
1914
  * @returns {*} The result of the executed command, undefined if no result is returned
1914
1915
  */
1915
- emitCommand({ item: o, argument: n }) {
1916
+ emitCommand({ item: o, argument: n, option: e }) {
1916
1917
  this.activeEditor?.focus();
1917
- const { command: e } = o;
1918
- if (e) {
1919
- if (this.log("(emmitCommand) Command:", e, o, n), e in Ae(this, ve))
1920
- return Ae(this, ve)[e]({ item: o, argument: n });
1921
- if (e in this.activeEditor?.commands)
1922
- 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 });
1923
1929
  else
1924
- throw new Error(`[super-toolbar 🎨] Command not found: ${e}`);
1930
+ throw new Error(`[super-toolbar 🎨] Command not found: ${i}`);
1931
+ this.updateToolbarState();
1925
1932
  }
1926
1933
  }
1927
1934
  }
@@ -1941,14 +1948,15 @@ lt = function() {
1941
1948
  * @returns {void}
1942
1949
  */
1943
1950
  We = function(o, n, e = !1) {
1944
- const i = document.documentElement.clientWidth, { defaultItems: r, overflowItems: l } = lo(o, e, i, this.role, n);
1945
- let s = [
1946
- ...r.map((d) => d.name.value),
1947
- ...l.map((d) => d.name.value)
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)
1948
1956
  ];
1949
- this.config.groups && (s = Object.values(this.config.groups).flatMap((d) => d));
1950
- const c = r.filter((d) => s.includes(d.name.value)).filter((d) => !this.config.excludeItems.includes(d.name.value));
1951
- this.toolbarItems = c, this.overflowItems = l.filter((d) => s.includes(d.name.value));
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));
1952
1960
  }, /**
1953
1961
  * Initialize default fonts from the editor
1954
1962
  * @private
@@ -1956,9 +1964,9 @@ We = function(o, n, e = !1) {
1956
1964
  */
1957
1965
  at = function() {
1958
1966
  if (!this.activeEditor || !this.activeEditor.converter) return;
1959
- 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");
1960
1968
  e && (e.defaultLabel.value = n);
1961
- const i = this.toolbarItems.find((r) => r.name.value === "fontFamily");
1969
+ const i = this.toolbarItems.find((c) => c.name.value === "fontFamily");
1962
1970
  i && (i.defaultLabel.value = o);
1963
1971
  }, /**
1964
1972
  * Update highlight color options based on document colors
@@ -1967,15 +1975,15 @@ at = function() {
1967
1975
  */
1968
1976
  rt = function() {
1969
1977
  if (!this.activeEditor || !this.activeEditor.converter || !this.activeEditor.converter.docHiglightColors.size) return;
1970
- const o = this.toolbarItems.find((l) => l.name.value === "highlight"), n = Vn(), e = 7, i = Array.from(this.activeEditor.converter.docHiglightColors).reduce((l, s, c) => {
1971
- const d = Math.floor(c / e);
1972
- return l[d] || (l[d] = []), n.includes(s) || l[d].push(h(s)), l;
1973
- }, []), 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 = {
1974
1982
  key: "color",
1975
1983
  type: "render",
1976
1984
  render: () => Ve(this, o, i, !0)
1977
1985
  };
1978
- o.nestedOptions.value = [r];
1986
+ o.nestedOptions.value = [c];
1979
1987
  }, /**
1980
1988
  * Deactivate all toolbar items
1981
1989
  * @private
@@ -2005,44 +2013,44 @@ ct = function() {
2005
2013
  */
2006
2014
  fe = function({ item: o, argument: n, noArgumentCallback: e = !1 }, i) {
2007
2015
  if (!n || !this.activeEditor) return;
2008
- let r = o.command;
2009
- const l = o.noArgumentCommand;
2010
- if (n === "none" && l in this.activeEditor?.commands) {
2011
- this.activeEditor.commands[l](), typeof i == "function" && e && i(n), 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();
2012
2020
  return;
2013
2021
  }
2014
- r in this.activeEditor?.commands && (this.activeEditor.commands[r](n), typeof i == "function" && i(n), this.updateToolbarState());
2022
+ c in this.activeEditor?.commands && (this.activeEditor.commands[c](n), typeof i == "function" && i(n), this.updateToolbarState());
2015
2023
  };
2016
- function ho(t, a) {
2017
- if (!t.value || !a?.value?.options?.scale) return;
2018
- const o = a.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");
2019
2027
  let i;
2020
- e.forEach((r) => {
2021
- const s = (r.getBoundingClientRect().left - n.left) / o * -1 + 1;
2022
- if (i || (i = s), s !== i) {
2023
- const c = s - i;
2024
- 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)`;
2025
2033
  }
2026
2034
  });
2027
2035
  }
2028
- const fo = (t, a) => {
2029
- const o = t.clientY, n = t.clientX, { view: e } = a, i = e.dom.getBoundingClientRect();
2030
- 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 = {
2031
2039
  left: 0,
2032
2040
  top: o
2033
- }, l = !1;
2034
- n > i.right ? (r.left = i.left + i.width - 1, l = !0) : n < i.left && (r.left = i.left);
2035
- const s = e.posAtCoords(r)?.pos;
2036
- if (s) {
2037
- let c = s;
2038
- if (l) {
2039
- const b = e.state.doc.resolve(s).textOffset, v = e.state.doc.nodeAt(s), E = v?.text?.charAt(b);
2040
- c = v?.isText && E !== " " ? s - 1 : s;
2041
+ }, a = !1;
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;
2046
+ if (a) {
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;
2041
2049
  }
2042
- const d = e.state.tr.setSelection(
2043
- Ye.create(e.state.doc, c)
2050
+ const m = e.state.tr.setSelection(
2051
+ Ye.create(e.state.doc, d)
2044
2052
  );
2045
- e.dispatch(d), e.focus();
2053
+ e.dispatch(m), e.focus();
2046
2054
  }
2047
2055
  }, vo = { class: "numbering" }, Te = 200, go = "flex-end", yo = {
2048
2056
  __name: "Ruler",
@@ -2061,13 +2069,13 @@ const fo = (t, a) => {
2061
2069
  }
2062
2070
  },
2063
2071
  emits: ["margin-change"],
2064
- setup(t, { emit: a }) {
2065
- const o = a, n = t, e = f(null), i = f([]), r = f("#CCCCCC"), l = 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), E = 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);
2066
2074
  let g = 0;
2067
2075
  const F = () => {
2068
2076
  if (n.editor.options.mode !== "docx") return;
2069
2077
  const I = [], { pageMargins: M, pageSize: H } = n.editor.getPageStyles();
2070
- 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;
2071
2079
  for (let R = 0; R < H.width; R++) {
2072
2080
  const K = `${5.5}px`, ce = H.width - R;
2073
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;
@@ -2089,39 +2097,39 @@ const fo = (t, a) => {
2089
2097
  backgroundColor: I.color || "#666",
2090
2098
  marginLeft: I.numbering === 0 ? null : I.margin,
2091
2099
  marginRight: I.margin
2092
- })), _ = j(() => (I) => ({
2100
+ })), x = j(() => (I) => ({
2093
2101
  left: `${(I === "left" ? b : v).x}px`
2094
2102
  })), T = j(() => {
2095
2103
  if (!e.value) return;
2096
2104
  const H = e.value.parentElement.querySelector(".super-editor").getBoundingClientRect();
2097
2105
  return {
2098
- left: `${u.value.x}px`,
2106
+ left: `${s.value.x}px`,
2099
2107
  minHeight: `${H.height}px`
2100
2108
  };
2101
2109
  }), N = (I) => {
2102
- d.value = !0, ye();
2110
+ m.value = !0, ye();
2103
2111
  const M = I.currentTarget.id;
2104
- u.value = M === "left-margin-handle" ? b : v, E.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;
2105
2113
  }, V = (I) => {
2106
- if (!d.value) return;
2114
+ if (!m.value) return;
2107
2115
  const M = I.clientX - g;
2108
- 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);
2109
2117
  }, te = () => {
2110
- if (d.value = !1, y.value = !1, Z(), u.value && u.value.x !== E.value) {
2118
+ if (m.value = !1, y.value = !1, Z(), s.value && s.value.x !== E.value) {
2111
2119
  const I = re();
2112
2120
  o("margin-change", {
2113
- side: u.value.side,
2121
+ side: s.value.side,
2114
2122
  value: I
2115
2123
  });
2116
2124
  }
2117
2125
  }, ye = () => {
2118
- r.value = l.value;
2126
+ c.value = a.value;
2119
2127
  }, Z = () => {
2120
- r.value = "#CCC";
2121
- }, 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(() => ({
2122
2130
  "--alignment": go,
2123
- "--ruler-handle-color": r.value,
2124
- "--ruler-handle-active-color": l.value
2131
+ "--ruler-handle-color": c.value,
2132
+ "--ruler-handle-active-color": a.value
2125
2133
  }));
2126
2134
  return ke(() => {
2127
2135
  i.value = F(), window.addEventListener("mousemove", V), window.addEventListener("mouseup", te);
@@ -2137,13 +2145,13 @@ const fo = (t, a) => {
2137
2145
  class: "margin-handle handle-left",
2138
2146
  id: "left-margin-handle",
2139
2147
  onMousedown: N,
2140
- style: J(_.value("left"))
2148
+ style: J(x.value("left"))
2141
2149
  }, null, 36),
2142
2150
  k("div", {
2143
2151
  class: "margin-handle handle-right",
2144
2152
  id: "right-margin-handle",
2145
2153
  onMousedown: N,
2146
- style: J(_.value("right"))
2154
+ style: J(x.value("right"))
2147
2155
  }, null, 36),
2148
2156
  y.value ? (w(), C("div", {
2149
2157
  key: 0,
@@ -2199,53 +2207,53 @@ const fo = (t, a) => {
2199
2207
  "comments-loaded",
2200
2208
  "selection-update"
2201
2209
  ],
2202
- setup(t, { emit: a }) {
2203
- const o = a, n = t, e = f(!1), i = nt(null), r = f(null), l = f(null);
2204
- let s;
2205
- const c = () => {
2206
- clearTimeout(s);
2207
- }, 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) => {
2208
2216
  const N = p.getMap("meta"), V = () => {
2209
2217
  const te = N.get("docx");
2210
- 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.");
2211
2219
  };
2212
2220
  V();
2213
- }, u = async () => {
2221
+ }, s = async () => {
2214
2222
  try {
2215
- const [p, _, T, N] = await ze.loadXmlData(n.fileSource);
2216
- 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 };
2217
2225
  } catch (p) {
2218
2226
  console.debug("Error loading new file data:", p);
2219
2227
  }
2220
2228
  }, b = async () => {
2221
2229
  if (n.fileSource) {
2222
- const p = await u();
2230
+ const p = await s();
2223
2231
  return y(p);
2224
2232
  } else if (n.options.ydoc && n.options.collaborationProvider) {
2225
2233
  delete n.options.content;
2226
- const p = n.options.ydoc, _ = n.options.collaborationProvider, T = () => {
2227
- d(p), _.off("synced", T);
2234
+ const p = n.options.ydoc, x = n.options.collaborationProvider, T = () => {
2235
+ m(p), x.off("synced", T);
2228
2236
  };
2229
- _.on("synced", T);
2237
+ x.on("synced", T);
2230
2238
  }
2231
2239
  }, v = () => {
2232
2240
  const p = St();
2233
- return n.options.pagination ? p : p.filter((_) => _.name !== "pagination");
2234
- }, y = async ({ content: p, media: _ = {}, mediaFiles: T = {}, fonts: N = {} } = {}) => {
2241
+ return n.options.pagination ? p : p.filter((x) => x.name !== "pagination");
2242
+ }, y = async ({ content: p, media: x = {}, mediaFiles: T = {}, fonts: N = {} } = {}) => {
2235
2243
  i.value = new ze({
2236
2244
  mode: "docx",
2237
- element: l.value,
2245
+ element: a.value,
2238
2246
  fileSource: n.fileSource,
2239
2247
  extensions: v(),
2240
2248
  externalExtensions: n.options.externalExtensions,
2241
2249
  documentId: n.documentId,
2242
2250
  content: p,
2243
- media: _,
2251
+ media: x,
2244
2252
  mediaFiles: T,
2245
2253
  fonts: N,
2246
2254
  ...n.options
2247
2255
  }), i.value.on("paginationUpdate", () => {
2248
- ho(l, i);
2256
+ ho(a, i);
2249
2257
  }), i.value.on("collaborationReady", () => {
2250
2258
  setTimeout(() => {
2251
2259
  e.value = !0;
@@ -2255,24 +2263,24 @@ const fo = (t, a) => {
2255
2263
  o("editor-keydown", { editor: i.value });
2256
2264
  }, g = (p) => {
2257
2265
  o("editor-click", { editor: i.value });
2258
- let _ = l.value?.querySelector(".ProseMirror");
2259
- if (!_ || !i.value)
2266
+ let x = a.value?.querySelector(".ProseMirror");
2267
+ if (!x || !i.value)
2260
2268
  return;
2261
- !_.contains(p.target) && i.value.isEditable && i.value.view?.focus();
2269
+ !x.contains(p.target) && i.value.isEditable && i.value.view?.focus();
2262
2270
  };
2263
2271
  ke(() => {
2264
2272
  b(), (n.options?.suppressSkeletonLoader || !n.options?.collaborationProvider) && (e.value = !0);
2265
2273
  });
2266
2274
  const F = (p) => {
2267
2275
  p.target.classList.contains("ProseMirror") || fo(p, i.value);
2268
- }, $ = ({ side: p, value: _ }) => {
2276
+ }, $ = ({ side: p, value: x }) => {
2269
2277
  if (!i.value) return;
2270
- const T = i.value.getPageStyles(), { pageMargins: N } = T, V = { ...N, [p]: _ };
2278
+ const T = i.value.getPageStyles(), { pageMargins: N } = T, V = { ...N, [p]: x };
2271
2279
  i.value?.updatePageStyle({ pageMargins: V });
2272
2280
  };
2273
2281
  return ot(() => {
2274
- c(), i.value?.destroy(), i.value = null;
2275
- }), (p, _) => (w(), C("div", wo, [
2282
+ d(), i.value?.destroy(), i.value = null;
2283
+ }), (p, x) => (w(), C("div", wo, [
2276
2284
  t.options.rulers && i.value ? (w(), Vt(bo, {
2277
2285
  key: 0,
2278
2286
  class: "ruler",
@@ -2282,14 +2290,14 @@ const fo = (t, a) => {
2282
2290
  k("div", {
2283
2291
  class: "super-editor",
2284
2292
  ref_key: "editorWrapper",
2285
- ref: r,
2293
+ ref: c,
2286
2294
  onKeydown: E,
2287
2295
  onClick: g,
2288
2296
  onMousedown: F
2289
2297
  }, [
2290
2298
  k("div", {
2291
2299
  ref_key: "editorElem",
2292
- ref: l,
2300
+ ref: a,
2293
2301
  class: "editor-element super-editor__element"
2294
2302
  }, null, 512)
2295
2303
  ], 544),
@@ -2343,8 +2351,8 @@ const fo = (t, a) => {
2343
2351
  }, Do = /* @__PURE__ */ q(_o, [["__scopeId", "data-v-ff8f86f4"]]), $o = {
2344
2352
  __name: "BasicUpload",
2345
2353
  emits: ["file-change"],
2346
- setup(t, { emit: a }) {
2347
- const o = a, n = (e) => {
2354
+ setup(t, { emit: r }) {
2355
+ const o = r, n = (e) => {
2348
2356
  o("file-change", e.target.files[0]);
2349
2357
  };
2350
2358
  return (e, i) => (w(), C("div", null, [
@@ -2379,16 +2387,16 @@ const fo = (t, a) => {
2379
2387
  }
2380
2388
  },
2381
2389
  emits: ["update:modelValue", "focus", "blur"],
2382
- setup(t, { emit: a }) {
2383
- const o = a, n = t, e = nt(), i = f(null), r = f(!1), l = ({ editor: v, transaction: y }) => {
2390
+ setup(t, { emit: r }) {
2391
+ const o = r, n = t, e = nt(), i = f(null), c = f(!1), a = ({ editor: v, transaction: y }) => {
2384
2392
  const E = v.getHTML();
2385
2393
  o("update:modelValue", E);
2386
- }, s = ({ editor: v, transaction: y }) => {
2387
- r.value = !0, b(), o("focus", { editor: v, transaction: y });
2388
- }, c = ({ editor: v, transaction: y }) => {
2389
- r.value = !1, o("blur", { editor: v, transaction: y });
2390
- }, d = async () => {
2391
- At.options.placeholder = n.placeholder || "Type something...", n.options.onTransaction = l, n.options.onFocus = s, n.options.onBlur = c, e.value = new ze({
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({
2392
2400
  mode: "text",
2393
2401
  content: document.getElementById("currentContent"),
2394
2402
  element: i.value,
@@ -2396,18 +2404,18 @@ const fo = (t, a) => {
2396
2404
  users: n.users,
2397
2405
  ...n.options
2398
2406
  });
2399
- }, u = () => {
2400
- r.value = !0, e.value?.view?.focus();
2407
+ }, s = () => {
2408
+ c.value = !0, e.value?.view?.focus();
2401
2409
  }, b = () => {
2402
2410
  e.value?.setOptions({ users: n.users });
2403
2411
  };
2404
2412
  return ke(() => {
2405
- d();
2413
+ m();
2406
2414
  }), ot(() => {
2407
2415
  e.value?.destroy(), e.value = null;
2408
2416
  }), (v, y) => (w(), C("div", {
2409
- class: oe(["super-editor super-input", { "super-input-active": r.value }]),
2410
- onClick: ge(u, ["stop", "prevent"])
2417
+ class: oe(["super-editor super-input", { "super-input-active": c.value }]),
2418
+ onClick: ge(s, ["stop", "prevent"])
2411
2419
  }, [
2412
2420
  k("div", {
2413
2421
  id: "currentContent",