@harbour-enterprises/superdoc 0.12.2 → 0.12.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/chunks/{index-C6SLw2ph.cjs → index-71EH9929.cjs} +1 -1
  2. package/dist/chunks/{index-CbUTRvRk.cjs → index-DJ2cGnRl.cjs} +1 -1
  3. package/dist/chunks/{index-kWwSELc2.es.js → index-DRzufgTV.es.js} +2 -2
  4. package/dist/chunks/{index-BTkgQgI7.es.js → index-kAA2CRkl.es.js} +1 -1
  5. package/dist/chunks/{super-editor.es-DUmGohIP.es.js → super-editor.es-DXcOd-nD.es.js} +4753 -4691
  6. package/dist/chunks/{super-editor.es-BMtJiQQ_.cjs → super-editor.es-Di7L9sdJ.cjs} +64 -64
  7. package/dist/chunks/{url-C29KYeaj.es.js → url-BcsmChMq.es.js} +1 -1
  8. package/dist/chunks/{url-DRGmEUtI.cjs → url-CHPOWQEe.cjs} +1 -1
  9. package/dist/chunks/{xml-js-CgHhGhcJ.es.js → xml-js-CiXFCQBs.es.js} +366 -355
  10. package/dist/chunks/xml-js-jS9zLULc.cjs +10 -0
  11. package/dist/core/SuperDoc.d.ts.map +1 -1
  12. package/dist/style.css +1 -1
  13. package/dist/super-editor/ai-writer.es.js +2 -2
  14. package/dist/super-editor/chunks/{converter-v5qDAfvf.js → converter-BJtjyWXx.js} +2 -2
  15. package/dist/super-editor/chunks/{docx-zipper-B5_2puzu.js → docx-zipper-BVv8YIej.js} +1 -1
  16. package/dist/super-editor/chunks/{editor-DPsjxIiM.js → editor-C4x0LU8R.js} +3 -3
  17. package/dist/super-editor/chunks/{toolbar-Dgq1xcbs.js → toolbar-C3dMNXWg.js} +612 -611
  18. package/dist/super-editor/components/toolbar/constants.d.ts +12 -0
  19. package/dist/super-editor/components/toolbar/constants.d.ts.map +1 -0
  20. package/dist/super-editor/components/toolbar/defaultItems.d.ts +3 -1
  21. package/dist/super-editor/components/toolbar/defaultItems.d.ts.map +1 -1
  22. package/dist/super-editor/components/toolbar/super-toolbar.d.ts +2 -0
  23. package/dist/super-editor/components/toolbar/super-toolbar.d.ts.map +1 -1
  24. package/dist/super-editor/converter.es.js +1 -1
  25. package/dist/super-editor/docx-zipper.es.js +2 -2
  26. package/dist/super-editor/editor.es.js +3 -3
  27. package/dist/super-editor/file-zipper.es.js +1 -1
  28. package/dist/super-editor/style.css +1 -1
  29. package/dist/super-editor/super-editor.es.js +1169 -1108
  30. package/dist/super-editor/toolbar.es.js +2 -2
  31. package/dist/super-editor.cjs +1 -1
  32. package/dist/super-editor.es.js +5 -5
  33. package/dist/superdoc.cjs +4 -4
  34. package/dist/superdoc.es.js +10 -7
  35. package/dist/superdoc.umd.js +4130 -4065
  36. package/dist/superdoc.umd.js.map +1 -1
  37. package/package.json +1 -1
  38. package/dist/chunks/xml-js-CMQ3QRee.cjs +0 -10
@@ -1,34 +1,34 @@
1
- var yt = Object.defineProperty;
2
- var Ue = (t) => {
3
- throw TypeError(t);
1
+ var wt = Object.defineProperty;
2
+ var qe = (e) => {
3
+ throw TypeError(e);
4
4
  };
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-DPsjxIiM.js";
10
- import { C as No, T as zo, l as Vo, n as Wo, k as Po, m as jo } from "./chunks/editor-DPsjxIiM.js";
11
- import { a1 as Dt, E as $t, a4 as Ht, T as Ye, a as Bt } from "./chunks/converter-v5qDAfvf.js";
12
- import { O as qo } from "./chunks/converter-v5qDAfvf.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-Dgq1xcbs.js";
15
- import jt from "./ai-writer.es.js";
16
- import { D as Ko } from "./chunks/docx-zipper-B5_2puzu.js";
17
- import { createZip as Zo } from "./file-zipper.es.js";
18
- var it = { exports: {} };
19
- (function(t) {
20
- var r = Object.prototype.hasOwnProperty, o = "~";
5
+ var Ct = (e, s, t) => s in e ? wt(e, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[s] = t;
6
+ var ze = (e, s, t) => Ct(e, typeof s != "symbol" ? s + "" : s, t), Ge = (e, s, t) => s.has(e) || qe("Cannot " + t);
7
+ var Te = (e, s, t) => (Ge(e, s, "read from private field"), t ? t.call(e) : s.get(e)), Re = (e, s, t) => s.has(e) ? qe("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(e) : s.set(e, t);
8
+ var N = (e, s, t) => (Ge(e, s, "access private method"), t);
9
+ import { _ as q, a as Ye, b as kt, I as Oe, f as _t, c as Ke, d as xt, i as St, u as Et, r as At, E as Ne, e as Tt, P as Ft, h as It, M as Lt, j as Mt, A as Dt, N as Bt } from "./chunks/editor-C4x0LU8R.js";
10
+ import { C as Vo, T as Po, l as jo, n as Uo, k as qo, m as Go } from "./chunks/editor-C4x0LU8R.js";
11
+ import { a1 as Ht, E as $t, a4 as zt, T as Je, a as Rt } from "./chunks/converter-BJtjyWXx.js";
12
+ import { O as Xo } from "./chunks/converter-BJtjyWXx.js";
13
+ import { ref as h, createElementBlock as k, openBlock as C, createElementVNode as _, unref as M, getCurrentInstance as Ot, computed as j, watch as Nt, onMounted as Ce, createCommentVNode as ee, withDirectives as Qe, withKeys as et, normalizeClass as oe, withModifiers as he, vModelText as tt, createTextVNode as nt, toDisplayString as ie, Fragment as U, renderList as te, normalizeStyle as Q, createVNode as P, h as $, createApp as Wt, reactive as Xe, onUnmounted as Vt, shallowRef as ot, onBeforeUnmount as it, createBlock as Pt } from "vue";
14
+ import { t as Z, s as jt, T as Ut, N as J } from "./chunks/toolbar-C3dMNXWg.js";
15
+ import qt from "./ai-writer.es.js";
16
+ import { D as Yo } from "./chunks/docx-zipper-BVv8YIej.js";
17
+ import { createZip as Qo } from "./file-zipper.es.js";
18
+ var st = { exports: {} };
19
+ (function(e) {
20
+ var s = Object.prototype.hasOwnProperty, t = "~";
21
21
  function n() {
22
22
  }
23
- Object.create && (n.prototype = /* @__PURE__ */ Object.create(null), new n().__proto__ || (o = !1));
24
- function e(l, d, m) {
25
- this.fn = l, this.context = d, this.once = m || !1;
23
+ Object.create && (n.prototype = /* @__PURE__ */ Object.create(null), new n().__proto__ || (t = !1));
24
+ function o(l, d, u) {
25
+ this.fn = l, this.context = d, this.once = u || !1;
26
26
  }
27
- function i(l, d, m, s, b) {
28
- if (typeof m != "function")
27
+ function i(l, d, u, r, w) {
28
+ if (typeof u != "function")
29
29
  throw new TypeError("The listener must be a function");
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;
30
+ var v = new o(u, r || l, w), b = t ? t + d : d;
31
+ return l._events[b] ? l._events[b].fn ? l._events[b] = [l._events[b], v] : l._events[b].push(v) : (l._events[b] = v, l._eventsCount++), l;
32
32
  }
33
33
  function c(l, d) {
34
34
  --l._eventsCount === 0 ? l._events = new n() : delete l._events[d];
@@ -37,225 +37,229 @@ var it = { exports: {} };
37
37
  this._events = new n(), this._eventsCount = 0;
38
38
  }
39
39
  a.prototype.eventNames = function() {
40
- var d = [], m, s;
40
+ var d = [], u, r;
41
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;
42
+ for (r in u = this._events)
43
+ s.call(u, r) && d.push(t ? r.slice(1) : r);
44
+ return Object.getOwnPropertySymbols ? d.concat(Object.getOwnPropertySymbols(u)) : d;
45
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
- return y;
46
+ var u = t ? t + d : d, r = this._events[u];
47
+ if (!r) return [];
48
+ if (r.fn) return [r.fn];
49
+ for (var w = 0, v = r.length, b = new Array(v); w < v; w++)
50
+ b[w] = r[w].fn;
51
+ return b;
52
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;
53
+ var u = t ? t + d : d, r = this._events[u];
54
+ return r ? r.fn ? 1 : r.length : 0;
55
+ }, a.prototype.emit = function(d, u, r, w, v, b) {
56
+ var y = t ? t + d : d;
57
+ if (!this._events[y]) return !1;
58
+ var g = this._events[y], L = arguments.length, D, p;
59
59
  if (g.fn) {
60
- switch (g.once && this.removeListener(d, g.fn, void 0, !0), F) {
60
+ switch (g.once && this.removeListener(d, g.fn, void 0, !0), L) {
61
61
  case 1:
62
62
  return g.fn.call(g.context), !0;
63
63
  case 2:
64
- return g.fn.call(g.context, m), !0;
64
+ return g.fn.call(g.context, u), !0;
65
65
  case 3:
66
- return g.fn.call(g.context, m, s), !0;
66
+ return g.fn.call(g.context, u, r), !0;
67
67
  case 4:
68
- return g.fn.call(g.context, m, s, b), !0;
68
+ return g.fn.call(g.context, u, r, w), !0;
69
69
  case 5:
70
- return g.fn.call(g.context, m, s, b, v), !0;
70
+ return g.fn.call(g.context, u, r, w, v), !0;
71
71
  case 6:
72
- return g.fn.call(g.context, m, s, b, v, y), !0;
72
+ return g.fn.call(g.context, u, r, w, v, b), !0;
73
73
  }
74
- for (p = 1, $ = new Array(F - 1); p < F; p++)
75
- $[p - 1] = arguments[p];
76
- g.fn.apply(g.context, $);
74
+ for (p = 1, D = new Array(L - 1); p < L; p++)
75
+ D[p - 1] = arguments[p];
76
+ g.fn.apply(g.context, D);
77
77
  } else {
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) {
78
+ var S = g.length, F;
79
+ for (p = 0; p < S; p++)
80
+ switch (g[p].once && this.removeListener(d, g[p].fn, void 0, !0), L) {
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, m);
85
+ g[p].fn.call(g[p].context, u);
86
86
  break;
87
87
  case 3:
88
- g[p].fn.call(g[p].context, m, s);
88
+ g[p].fn.call(g[p].context, u, r);
89
89
  break;
90
90
  case 4:
91
- g[p].fn.call(g[p].context, m, s, b);
91
+ g[p].fn.call(g[p].context, u, r, w);
92
92
  break;
93
93
  default:
94
- if (!$) for (T = 1, $ = new Array(F - 1); T < F; T++)
95
- $[T - 1] = arguments[T];
96
- g[p].fn.apply(g[p].context, $);
94
+ if (!D) for (F = 1, D = new Array(L - 1); F < L; F++)
95
+ D[F - 1] = arguments[F];
96
+ g[p].fn.apply(g[p].context, D);
97
97
  }
98
98
  }
99
99
  return !0;
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;
100
+ }, a.prototype.on = function(d, u, r) {
101
+ return i(this, d, u, r, !1);
102
+ }, a.prototype.once = function(d, u, r) {
103
+ return i(this, d, u, r, !0);
104
+ }, a.prototype.removeListener = function(d, u, r, w) {
105
+ var v = t ? t + d : d;
106
106
  if (!this._events[v]) return this;
107
- if (!m)
107
+ if (!u)
108
108
  return c(this, v), this;
109
- var y = this._events[v];
110
- if (y.fn)
111
- y.fn === m && (!b || y.once) && (!s || y.context === s) && c(this, v);
109
+ var b = this._events[v];
110
+ if (b.fn)
111
+ b.fn === u && (!w || b.once) && (!r || b.context === r) && c(this, v);
112
112
  else {
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]);
113
+ for (var y = 0, g = [], L = b.length; y < L; y++)
114
+ (b[y].fn !== u || w && !b[y].once || r && b[y].context !== r) && g.push(b[y]);
115
115
  g.length ? this._events[v] = g.length === 1 ? g[0] : g : c(this, v);
116
116
  }
117
117
  return this;
118
118
  }, a.prototype.removeAllListeners = function(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
- })(it);
123
- var Ut = it.exports;
124
- const qt = /* @__PURE__ */ Dt(Ut);
125
- function Gt(t) {
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;
119
+ var u;
120
+ return d ? (u = t ? t + d : d, this._events[u] && c(this, u)) : (this._events = new n(), this._eventsCount = 0), this;
121
+ }, a.prototype.off = a.prototype.removeListener, a.prototype.addListener = a.prototype.on, a.prefixed = t, a.EventEmitter = a, e.exports = a;
122
+ })(st);
123
+ var Gt = st.exports;
124
+ const Kt = /* @__PURE__ */ Ht(Gt);
125
+ function Xt(e) {
126
+ let s = e;
127
+ for (; s; ) {
128
+ const t = window.getComputedStyle(s).overflowY;
129
+ if (/(auto|scroll)/.test(t) && s.scrollHeight > s.clientHeight)
130
+ return s;
131
+ s = s.parentElement;
132
132
  }
133
133
  return document.scrollingElement || document.documentElement;
134
134
  }
135
- function Kt(t, r = { behavior: "smooth", block: "start" }) {
136
- if (!t) return;
137
- const o = Gt(t), n = o.getBoundingClientRect(), i = t.getBoundingClientRect().top - n.top + o.scrollTop;
138
- o.scrollTo({
139
- top: r.block === "start" ? i : i - o.clientHeight + t.offsetHeight,
140
- behavior: r.behavior
135
+ function Zt(e, s = { behavior: "smooth", block: "start" }) {
136
+ if (!e) return;
137
+ const t = Xt(e), n = t.getBoundingClientRect(), i = e.getBoundingClientRect().top - n.top + t.scrollTop;
138
+ t.scrollTo({
139
+ top: s.block === "start" ? i : i - t.clientHeight + e.offsetHeight,
140
+ behavior: s.behavior
141
141
  });
142
142
  }
143
- const _ = (t) => {
144
- if (!["button", "options", "separator", "dropdown", "overflow"].includes(t.type))
145
- throw new Error("Invalid toolbar item type - " + t.type);
146
- if (t.type === "button" && !t.defaultLabel && !t.icon)
147
- throw new Error("Toolbar button item needs either icon or label - " + t.name);
148
- if (!t.name)
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, 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
- if (t.options) {
152
- if (!Array.isArray(t.options)) throw new Error("Invalid toolbar item options - " + t.options);
153
- Ee.value.push(...t.options);
143
+ const x = (e) => {
144
+ if (!["button", "options", "separator", "dropdown", "overflow"].includes(e.type))
145
+ throw new Error("Invalid toolbar item type - " + e.type);
146
+ if (e.type === "button" && !e.defaultLabel && !e.icon)
147
+ throw new Error("Toolbar button item needs either icon or label - " + e.name);
148
+ if (!e.name)
149
+ throw new Error("Invalid toolbar item name - " + e.name);
150
+ const t = h($t()), n = e.type, o = h(e.name), i = e.command, c = e.noArgumentCommand, a = h(e.icon), l = h(e.group || "center"), d = h(e.allowWithoutEditor), u = h(e.attributes || {}), r = e.disabled || !1, w = h(e.disabled), v = h(!1), b = h(!1), y = h(e.style), g = h(e.isNarrow), L = h(e.isWide), D = h(e.minWidth), p = h(e.suppressActiveHighlight || !1), S = h(e.argument), F = h(null), O = h(null), W = h(e.iconColor), ne = h(e.hasCaret), ue = h(e.dropdownStyles), ve = h(e.tooltip), ge = h(e.tooltipVisible), Y = h(e.tooltipTimeout), T = h(e.defaultLabel), B = h(e.label), H = h(e.hideLabel), z = h(e.inlineTextInputVisible), G = h(e.hasInlineTextInput), K = h(e.markName), ce = h(e.labelAttr), se = h(e.selectedValue), ke = h(e.dropdownValueKey), Ie = h(e.inputRef || null), be = h([]);
151
+ if (e.options) {
152
+ if (!Array.isArray(e.options)) throw new Error("Invalid toolbar item options - " + e.options);
153
+ be.value.push(...e.options);
154
154
  }
155
- const Fe = (se) => {
156
- we(se), !p.value && (v.value = !0);
157
- }, Ie = () => {
158
- ne(), v.value = !1;
159
- }, Le = (se) => {
160
- b.value = se;
161
- }, Me = () => {
162
- b.value = s;
163
- }, we = t.onActivate || (() => null), ne = t.onDeactivate || (() => null), De = () => {
164
- const se = {};
165
- return Object.keys(me).forEach((pe) => {
166
- me[pe].value !== void 0 && (se[pe] = me[pe].value);
167
- }), se;
168
- }, me = {
169
- id: o,
170
- name: e,
155
+ const _e = (ae) => {
156
+ xe(ae), !p.value && (v.value = !0);
157
+ }, Le = () => {
158
+ Se(), v.value = !1;
159
+ }, Me = (ae) => {
160
+ w.value = ae;
161
+ }, De = () => {
162
+ w.value = r;
163
+ }, xe = e.onActivate || (() => null), Se = e.onDeactivate || (() => null), Ee = () => {
164
+ const ae = {};
165
+ return Object.keys(X).forEach((ye) => {
166
+ X[ye].value !== void 0 && (ae[ye] = X[ye].value);
167
+ }), ae;
168
+ }, X = {
169
+ id: t,
170
+ name: o,
171
171
  type: n,
172
172
  command: i,
173
173
  noArgumentCommand: c,
174
174
  icon: a,
175
- tooltip: Z,
175
+ tooltip: ve,
176
176
  group: l,
177
- attributes: m,
178
- disabled: b,
177
+ attributes: u,
178
+ disabled: w,
179
179
  active: v,
180
- expand: y,
181
- nestedOptions: Ee,
182
- style: E,
180
+ expand: b,
181
+ nestedOptions: be,
182
+ style: y,
183
183
  isNarrow: g,
184
- isWide: F,
185
- minWidth: $,
186
- argument: x,
187
- parentItem: N,
188
- iconColor: V,
189
- hasCaret: te,
190
- dropdownStyles: ye,
191
- tooltipVisible: re,
192
- tooltipTimeout: be,
193
- defaultLabel: I,
194
- label: M,
184
+ isWide: L,
185
+ minWidth: D,
186
+ argument: S,
187
+ parentItem: O,
188
+ iconColor: W,
189
+ hasCaret: ne,
190
+ dropdownStyles: ue,
191
+ tooltipVisible: ge,
192
+ tooltipTimeout: Y,
193
+ defaultLabel: T,
194
+ label: B,
195
195
  hideLabel: H,
196
- inlineTextInputVisible: R,
196
+ inlineTextInputVisible: z,
197
197
  hasInlineTextInput: G,
198
198
  markName: K,
199
199
  labelAttr: ce,
200
- childItem: T,
200
+ childItem: F,
201
201
  allowWithoutEditor: d,
202
- dropdownValueKey: _e,
203
- selectedValue: ue,
204
- inputRef: xe
202
+ dropdownValueKey: ke,
203
+ selectedValue: se,
204
+ inputRef: Ie
205
205
  };
206
206
  return {
207
- ...me,
208
- unref: De,
209
- activate: Fe,
210
- deactivate: Ie,
211
- setDisabled: Le,
212
- resetDisabled: Me,
213
- onActivate: we,
214
- onDeactivate: ne
207
+ ...X,
208
+ unref: Ee,
209
+ activate: _e,
210
+ deactivate: Le,
211
+ setDisabled: Me,
212
+ resetDisabled: De,
213
+ onActivate: xe,
214
+ onDeactivate: Se
215
215
  };
216
- }, Xt = { class: "alignment-buttons" }, Zt = ["innerHTML"], Yt = ["innerHTML"], Jt = ["innerHTML"], Qt = ["innerHTML"], en = {
216
+ }, Yt = { class: "alignment-buttons" }, Jt = ["innerHTML"], Qt = ["innerHTML"], en = ["innerHTML"], tn = ["innerHTML"], nn = {
217
217
  __name: "AlignmentButtons",
218
218
  emits: ["select"],
219
- setup(t, { emit: r }) {
220
- const o = r, n = (e) => {
221
- o("select", e);
219
+ setup(e, { emit: s }) {
220
+ const t = s, n = (o) => {
221
+ t("select", o);
222
222
  };
223
- return (e, i) => (w(), C("div", Xt, [
224
- k("div", {
223
+ return (o, i) => (C(), k("div", Yt, [
224
+ _("div", {
225
225
  class: "button-icon",
226
226
  onClick: i[0] || (i[0] = (c) => n("left")),
227
- innerHTML: D(X).alignLeft
228
- }, null, 8, Zt),
229
- k("div", {
227
+ innerHTML: M(Z).alignLeft,
228
+ "data-item": "btn-textAlign-option"
229
+ }, null, 8, Jt),
230
+ _("div", {
230
231
  class: "button-icon",
231
232
  onClick: i[1] || (i[1] = (c) => n("center")),
232
- innerHTML: D(X).alignCenter
233
- }, null, 8, Yt),
234
- k("div", {
233
+ innerHTML: M(Z).alignCenter,
234
+ "data-item": "btn-textAlign-option"
235
+ }, null, 8, Qt),
236
+ _("div", {
235
237
  class: "button-icon",
236
238
  onClick: i[2] || (i[2] = (c) => n("right")),
237
- innerHTML: D(X).alignRight
238
- }, null, 8, Jt),
239
- k("div", {
239
+ innerHTML: M(Z).alignRight,
240
+ "data-item": "btn-textAlign-option"
241
+ }, null, 8, en),
242
+ _("div", {
240
243
  class: "button-icon",
241
244
  onClick: i[3] || (i[3] = (c) => n("justify")),
242
- innerHTML: D(X).alignJustify
243
- }, null, 8, Qt)
245
+ innerHTML: M(Z).alignJustify,
246
+ "data-item": "btn-textAlign-option"
247
+ }, null, 8, tn)
244
248
  ]));
245
249
  }
246
- }, tn = /* @__PURE__ */ q(en, [["__scopeId", "data-v-d6fae878"]]), nn = { class: "link-input-ctn" }, on = {
250
+ }, on = /* @__PURE__ */ q(nn, [["__scopeId", "data-v-932a4937"]]), sn = { class: "link-input-ctn" }, an = {
247
251
  key: 0,
248
252
  class: "link-title"
249
- }, sn = {
253
+ }, ln = {
250
254
  key: 1,
251
255
  class: "link-title"
252
- }, ln = {
256
+ }, rn = {
253
257
  key: 2,
254
258
  class: "link-title"
255
- }, an = { key: 3 }, rn = { class: "input-row" }, cn = ["innerHTML"], dn = ["onKeydown"], un = ["innerHTML"], mn = { class: "input-row link-buttons" }, pn = ["innerHTML"], hn = {
259
+ }, cn = { key: 3 }, dn = { class: "input-row" }, un = ["innerHTML"], mn = ["onKeydown"], pn = ["innerHTML"], fn = { class: "input-row link-buttons" }, hn = ["innerHTML"], vn = {
256
260
  key: 4,
257
261
  class: "input-row go-to-anchor clickable"
258
- }, fn = {
262
+ }, gn = {
259
263
  __name: "LinkInput",
260
264
  props: {
261
265
  initialText: {
@@ -281,88 +285,91 @@ const _ = (t) => {
281
285
  }
282
286
  },
283
287
  emits: ["submit", "cancel"],
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
+ setup(e, { emit: s }) {
289
+ const t = s, n = e, { proxy: o } = Ot(), i = () => {
290
+ if (o?.$submit instanceof Function && o.$submit(), d.value && r.value) {
291
+ t("submit", { text: l.value, href: u.value });
288
292
  return;
289
293
  } else if (!d.value) {
290
- o("submit", { text: l.value, href: null });
294
+ t("submit", { text: l.value, href: null });
291
295
  return;
292
296
  }
293
297
  console.debug("[LinkInput] Invalid URL in handleSubmit"), a.value = !0;
294
298
  }, 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");
299
+ t("submit", { text: l.value, href: null });
300
+ }, a = h(!1), l = h(n.initialText), d = h(n.href), u = j(() => d.value?.startsWith("http") ? d.value : "http://" + d.value), r = j(() => {
301
+ const p = u.value.split(".").filter(Boolean);
302
+ return u.value.includes(".") && p.length > 1;
303
+ }), w = j(() => b.value ? "Apply" : "Remove"), v = j(() => !r.value), b = j(() => !y.value), y = j(() => n.href && !d.value), g = j(() => n.href.startsWith("#")), L = () => {
304
+ window.open(u.value, "_blank");
301
305
  };
302
- Ot(
306
+ Nt(
303
307
  () => n.href,
304
308
  (p) => {
305
309
  d.value = p;
306
310
  }
307
311
  );
308
- const $ = () => {
312
+ const D = () => {
309
313
  const p = document.querySelector(".link-input-ctn input");
310
314
  p && p.focus();
311
315
  };
312
- return ke(() => {
313
- n.showInput && $();
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", {
316
+ return Ce(() => {
317
+ n.showInput && D();
318
+ }), (p, S) => (C(), k("div", sn, [
319
+ e.href ? g.value ? (C(), k("div", ln, "Page anchor")) : (C(), k("div", rn, "Edit link")) : (C(), k("div", an, "Add link")),
320
+ e.showInput && !g.value ? (C(), k("div", cn, [
321
+ _("div", dn, [
322
+ _("div", {
319
323
  class: "input-icon",
320
- innerHTML: D(X).linkInput
321
- }, null, 8, cn),
322
- Je(k("input", {
324
+ innerHTML: M(Z).linkInput
325
+ }, null, 8, un),
326
+ Qe(_("input", {
323
327
  type: "text",
324
328
  placeholder: "Type or paste a link",
325
329
  class: oe({ error: a.value }),
326
- "onUpdate:modelValue": x[0] || (x[0] = (T) => d.value = T),
330
+ "onUpdate:modelValue": S[0] || (S[0] = (F) => d.value = F),
327
331
  onKeydown: [
328
- Qe(ge(i, ["stop", "prevent"]), ["enter"]),
329
- x[1] || (x[1] = (T) => a.value = !1)
332
+ et(he(i, ["stop", "prevent"]), ["enter"]),
333
+ S[1] || (S[1] = (F) => a.value = !1)
330
334
  ]
331
- }, null, 42, dn), [
332
- [et, d.value]
335
+ }, null, 42, mn), [
336
+ [tt, d.value]
333
337
  ]),
334
- k("div", {
335
- class: oe(["open-link-icon", { disabled: !s.value }]),
336
- innerHTML: D(X).openLink,
337
- onClick: F
338
- }, null, 10, un)
338
+ _("div", {
339
+ class: oe(["open-link-icon", { disabled: !r.value }]),
340
+ innerHTML: M(Z).openLink,
341
+ onClick: L,
342
+ "data-item": "btn-link-open"
343
+ }, null, 10, pn)
339
344
  ]),
340
- k("div", mn, [
341
- t.href ? (w(), C("button", {
345
+ _("div", fn, [
346
+ e.href ? (C(), k("button", {
342
347
  key: 0,
343
348
  class: "remove-btn",
344
- onClick: c
349
+ onClick: c,
350
+ "data-item": "btn-link-remove"
345
351
  }, [
346
- k("div", {
352
+ _("div", {
347
353
  class: "remove-btn__icon",
348
- innerHTML: D(X).removeLink
349
- }, null, 8, pn),
350
- x[3] || (x[3] = tt(" Remove "))
351
- ])) : Q("", !0),
352
- y.value ? (w(), C("button", {
354
+ innerHTML: M(Z).removeLink
355
+ }, null, 8, hn),
356
+ S[3] || (S[3] = nt(" Remove "))
357
+ ])) : ee("", !0),
358
+ b.value ? (C(), k("button", {
353
359
  key: 1,
354
360
  class: oe(["submit-btn", { "disable-btn": v.value }]),
355
- onClick: i
356
- }, ie(b.value), 3)) : Q("", !0)
361
+ onClick: i,
362
+ "data-item": "btn-link-apply"
363
+ }, ie(w.value), 3)) : ee("", !0)
357
364
  ])
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
- }, "Go to " + ie(t.href.startsWith("#_") ? t.href.substring(2) : t.href), 1)
362
- ])) : Q("", !0)
365
+ ])) : g.value ? (C(), k("div", vn, [
366
+ _("a", {
367
+ onClick: S[2] || (S[2] = he((...F) => e.goToAnchor && e.goToAnchor(...F), ["stop", "prevent"]))
368
+ }, "Go to " + ie(e.href.startsWith("#_") ? e.href.substring(2) : e.href), 1)
369
+ ])) : ee("", !0)
363
370
  ]));
364
371
  }
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 = {
372
+ }, bn = /* @__PURE__ */ q(gn, [["__scopeId", "data-v-04bac853"]]), yn = { class: "document-mode" }, wn = ["onClick"], Cn = { class: "document-mode-column icon-column" }, kn = ["innerHTML"], _n = { class: "document-mode-column text-column" }, xn = { class: "document-mode-type" }, Sn = { class: "document-mode-description" }, En = {
366
373
  __name: "DocumentMode",
367
374
  props: {
368
375
  options: {
@@ -370,32 +377,33 @@ const _ = (t) => {
370
377
  }
371
378
  },
372
379
  emits: ["select"],
373
- setup(t, { emit: r }) {
374
- const o = r, n = (e) => {
375
- o("select", e);
380
+ setup(e, { emit: s }) {
381
+ const t = s, n = (o) => {
382
+ t("select", o);
376
383
  };
377
- return (e, i) => (w(), C("div", gn, [
378
- (w(!0), C(U, null, ee(t.options, (c) => (w(), C("div", {
384
+ return (o, i) => (C(), k("div", yn, [
385
+ (C(!0), k(U, null, te(e.options, (c) => (C(), k("div", {
379
386
  class: oe(["option-item", { disabled: c.disabled }]),
380
- onClick: (a) => n(c)
387
+ onClick: (a) => n(c),
388
+ "data-item": "btn-documentMode-option"
381
389
  }, [
382
- k("div", bn, [
383
- k("div", {
390
+ _("div", Cn, [
391
+ _("div", {
384
392
  class: "icon-column__icon",
385
393
  innerHTML: c.icon
386
- }, null, 8, wn)
394
+ }, null, 8, kn)
387
395
  ]),
388
- k("div", Cn, [
389
- k("div", kn, ie(c.label), 1),
390
- k("div", _n, ie(c.description), 1)
396
+ _("div", _n, [
397
+ _("div", xn, ie(c.label), 1),
398
+ _("div", Sn, ie(c.description), 1)
391
399
  ])
392
- ], 10, yn))), 256))
400
+ ], 10, wn))), 256))
393
401
  ]));
394
402
  }
395
- }, En = /* @__PURE__ */ q(xn, [["__scopeId", "data-v-f86e1477"]]), Sn = {
403
+ }, An = /* @__PURE__ */ q(En, [["__scopeId", "data-v-8afd7fbb"]]), Tn = {
396
404
  key: 0,
397
405
  class: "linked-style-buttons"
398
- }, An = ["onClick"], Tn = {
406
+ }, Fn = ["onClick"], In = {
399
407
  __name: "LinkedStyle",
400
408
  props: {
401
409
  editor: {
@@ -404,23 +412,24 @@ const _ = (t) => {
404
412
  }
405
413
  },
406
414
  emits: ["select"],
407
- setup(t, { emit: r }) {
408
- const o = r, n = t, e = (i) => {
409
- o("select", i);
415
+ setup(e, { emit: s }) {
416
+ const t = s, n = e, o = (i) => {
417
+ t("select", i);
410
418
  };
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", {
419
+ return (i, c) => n.editor ? (C(), k("div", Tn, [
420
+ (C(!0), k(U, null, te(M(Ye)(e.editor), (a) => (C(), k("div", {
413
421
  class: "style-item",
414
- onClick: (l) => e(a)
422
+ onClick: (l) => o(a)
415
423
  }, [
416
- k("div", {
424
+ _("div", {
417
425
  class: "style-name",
418
- style: J(D(wt)(a, null, !1))
426
+ style: Q(M(kt)(a, null, !1)),
427
+ "data-item": "btn-linkedStyles-option"
419
428
  }, ie(a.definition.attrs.name), 5)
420
- ], 8, An))), 256))
421
- ])) : Q("", !0);
429
+ ], 8, Fn))), 256))
430
+ ])) : ee("", !0);
422
431
  }
423
- }, Fn = /* @__PURE__ */ q(Tn, [["__scopeId", "data-v-97e3296a"]]), In = ["onClick"], Ln = ["innerHTML"], Mn = ["innerHTML"], Dn = {
432
+ }, Ln = /* @__PURE__ */ q(In, [["__scopeId", "data-v-44b680e9"]]), Mn = ["onClick"], Dn = ["innerHTML"], Bn = ["innerHTML"], Hn = {
424
433
  __name: "IconGridRow",
425
434
  props: {
426
435
  icons: {
@@ -433,37 +442,37 @@ const _ = (t) => {
433
442
  }
434
443
  },
435
444
  emits: ["select"],
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);
445
+ setup(e, { emit: s }) {
446
+ const t = s, n = e, o = 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) => {
447
+ t("select", a.value);
439
448
  };
440
- return ke(() => {
449
+ return Ce(() => {
441
450
  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", {
451
+ }), (a, l) => (C(!0), k(U, null, te(e.icons, (d, u) => (C(), k("div", {
443
452
  class: "option-row",
444
- key: m
453
+ key: u
445
454
  }, [
446
- (w(!0), C(U, null, ee(d, (s, b) => (w(), C("div", {
455
+ (C(!0), k(U, null, te(d, (r, w) => (C(), k("div", {
447
456
  class: "option",
448
- key: b,
449
- onClick: ge((v) => c(s), ["stop", "prevent"])
457
+ key: w,
458
+ onClick: he((v) => c(r), ["stop", "prevent"])
450
459
  }, [
451
- k("div", {
460
+ _("div", {
452
461
  class: "option__icon",
453
- innerHTML: s.icon,
454
- style: J(s.style)
455
- }, null, 12, Ln),
456
- e.value(s) ? (w(), C("div", {
462
+ innerHTML: r.icon,
463
+ style: Q(r.style)
464
+ }, null, 12, Dn),
465
+ o.value(r) ? (C(), k("div", {
457
466
  key: 0,
458
467
  class: "option__check",
459
- innerHTML: D(X).colorOptionCheck,
460
- style: J(i(s.value, b))
461
- }, null, 12, Mn)) : Q("", !0)
462
- ], 8, In))), 128))
468
+ innerHTML: M(Z).colorOptionCheck,
469
+ style: Q(i(r.value, w))
470
+ }, null, 12, Bn)) : ee("", !0)
471
+ ], 8, Mn))), 128))
463
472
  ]))), 128));
464
473
  }
465
- }, Xe = /* @__PURE__ */ q(Dn, [["__scopeId", "data-v-6a2a9a40"]]), $n = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M320 512c53.2 0 101.4-21.6 136.1-56.6l-298.3-235C140 257.1 128 292.3 128 320c0 106 86 192 192 192zM505.2 370.7c4.4-16.2 6.8-33.1 6.8-50.7c0-91.2-130.2-262.3-166.6-308.3C339.4 4.2 330.5 0 320.9 0l-1.8 0c-9.6 0-18.5 4.2-24.5 11.7C277.8 33 240.7 81.3 205.8 136L38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L505.2 370.7zM224 336c0 44.2 35.8 80 80 80c8.8 0 16 7.2 16 16s-7.2 16-16 16c-61.9 0-112-50.1-112-112c0-8.8 7.2-16 16-16s16 7.2 16 16z"/></svg>
466
- `, Hn = { class: "options-grid-wrap" }, Bn = ["innerHTML"], Rn = { class: "option-grid-ctn" }, On = {
474
+ }, Ze = /* @__PURE__ */ q(Hn, [["__scopeId", "data-v-6a2a9a40"]]), $n = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M320 512c53.2 0 101.4-21.6 136.1-56.6l-298.3-235C140 257.1 128 292.3 128 320c0 106 86 192 192 192zM505.2 370.7c4.4-16.2 6.8-33.1 6.8-50.7c0-91.2-130.2-262.3-166.6-308.3C339.4 4.2 330.5 0 320.9 0l-1.8 0c-9.6 0-18.5 4.2-24.5 11.7C277.8 33 240.7 81.3 205.8 136L38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L505.2 370.7zM224 336c0 44.2 35.8 80 80 80c8.8 0 16 7.2 16 16s-7.2 16-16 16c-61.9 0-112-50.1-112-112c0-8.8 7.2-16 16-16s16 7.2 16 16z"/></svg>
475
+ `, zn = { class: "options-grid-wrap" }, Rn = ["innerHTML"], On = { class: "option-grid-ctn" }, Nn = {
467
476
  __name: "IconGrid",
468
477
  props: {
469
478
  icons: {
@@ -484,174 +493,174 @@ const _ = (t) => {
484
493
  }
485
494
  },
486
495
  emits: ["select", "clickoutside"],
487
- setup(t, { emit: r }) {
488
- const o = r, n = (e) => {
489
- o("select", e);
496
+ setup(e, { emit: s }) {
497
+ const t = s, n = (o) => {
498
+ t("select", o);
490
499
  };
491
- return (e, i) => (w(), C("div", Hn, [
492
- t.hasNoneIcon ? (w(), C("div", {
500
+ return (o, i) => (C(), k("div", zn, [
501
+ e.hasNoneIcon ? (C(), k("div", {
493
502
  key: 0,
494
503
  class: "none-option",
495
504
  onClick: i[0] || (i[0] = (c) => n("none"))
496
505
  }, [
497
- k("span", {
498
- innerHTML: D($n),
506
+ _("span", {
507
+ innerHTML: M($n),
499
508
  class: "none-icon"
500
- }, null, 8, Bn),
501
- i[1] || (i[1] = tt(" None "))
502
- ])) : Q("", !0),
503
- k("div", Rn, [
504
- P(Xe, {
505
- icons: t.icons,
506
- "active-color": t.activeColor,
509
+ }, null, 8, Rn),
510
+ i[1] || (i[1] = nt(" None "))
511
+ ])) : ee("", !0),
512
+ _("div", On, [
513
+ P(Ze, {
514
+ icons: e.icons,
515
+ "active-color": e.activeColor,
507
516
  onSelect: n
508
517
  }, null, 8, ["icons", "active-color"]),
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
- P(Xe, {
512
- icons: t.customIcons,
513
- "active-color": t.activeColor,
518
+ e.customIcons.flat().length ? (C(), k(U, { key: 0 }, [
519
+ i[2] || (i[2] = _("span", { class: "option-grid-ctn__subtitle" }, "Custom colors", -1)),
520
+ P(Ze, {
521
+ icons: e.customIcons,
522
+ "active-color": e.activeColor,
514
523
  onSelect: n
515
524
  }, null, 8, ["icons", "active-color"])
516
- ], 64)) : Q("", !0)
525
+ ], 64)) : ee("", !0)
517
526
  ])
518
527
  ]));
519
528
  }
520
- }, Nn = /* @__PURE__ */ q(On, [["__scopeId", "data-v-47b783db"]]), zn = (t) => {
521
- t.expand.value = !1;
522
- }, h = (t, r = null) => ({
523
- label: r,
524
- icon: X.colorOption,
525
- value: t,
529
+ }, Wn = /* @__PURE__ */ q(Nn, [["__scopeId", "data-v-47b783db"]]), Vn = (e) => {
530
+ e.expand.value = !1;
531
+ }, f = (e, s = null) => ({
532
+ label: s,
533
+ icon: Z.colorOption,
534
+ value: e,
526
535
  style: {
527
- color: t,
536
+ color: e,
528
537
  boxShadow: "0 0 5px 1px rgba(0, 0, 0, 0.1)",
529
538
  borderRadius: "50%"
530
539
  }
531
- }), Ve = (t, r, o = [], n = !1) => {
532
- const e = (i) => {
533
- r.iconColor.value = i, t.emitCommand({ item: r, argument: i }), zn(r);
540
+ }), We = (e, s, t = [], n = !1) => {
541
+ const o = (i) => {
542
+ s.iconColor.value = i, e.emitCommand({ item: s, argument: i }), Vn(s);
534
543
  };
535
- return B("div", {}, [
536
- B(Nn, {
537
- icons: st,
538
- customIcons: o,
539
- activeColor: r.iconColor,
544
+ return $("div", {}, [
545
+ $(Wn, {
546
+ icons: at,
547
+ customIcons: t,
548
+ activeColor: s.iconColor,
540
549
  hasNoneIcon: n,
541
- onSelect: e
550
+ onSelect: o
542
551
  })
543
552
  ]);
544
- }, st = [
553
+ }, at = [
545
554
  [
546
- h("#111111"),
547
- h("#333333"),
548
- h("#5C5C5C"),
549
- h("#858585"),
550
- h("#ADADAD"),
551
- h("#D6D6D6"),
552
- h("#FFFFFF")
555
+ f("#111111"),
556
+ f("#333333"),
557
+ f("#5C5C5C"),
558
+ f("#858585"),
559
+ f("#ADADAD"),
560
+ f("#D6D6D6"),
561
+ f("#FFFFFF")
553
562
  ],
554
563
  [
555
- h("#860028"),
556
- h("#D2003F"),
557
- h("#DB3365"),
558
- h("#E4668C"),
559
- h("#ED99B2"),
560
- h("#F6CCD9"),
561
- h("#FF004D")
564
+ f("#860028"),
565
+ f("#D2003F"),
566
+ f("#DB3365"),
567
+ f("#E4668C"),
568
+ f("#ED99B2"),
569
+ f("#F6CCD9"),
570
+ f("#FF004D")
562
571
  ],
563
572
  [
564
- h("#83015E"),
565
- h("#CD0194"),
566
- h("#D734A9"),
567
- h("#E167BF"),
568
- h("#EB99D4"),
569
- h("#F5CCEA"),
570
- h("#FF00A8")
573
+ f("#83015E"),
574
+ f("#CD0194"),
575
+ f("#D734A9"),
576
+ f("#E167BF"),
577
+ f("#EB99D4"),
578
+ f("#F5CCEA"),
579
+ f("#FF00A8")
571
580
  ],
572
581
  [
573
- h("#8E220A"),
574
- h("#DD340F"),
575
- h("#E45C3F"),
576
- h("#EB856F"),
577
- h("#F1AE9F"),
578
- h("#F8D6CF"),
579
- h("#FF7A00")
582
+ f("#8E220A"),
583
+ f("#DD340F"),
584
+ f("#E45C3F"),
585
+ f("#EB856F"),
586
+ f("#F1AE9F"),
587
+ f("#F8D6CF"),
588
+ f("#FF7A00")
580
589
  ],
581
590
  [
582
- h("#947D02"),
583
- h("#E7C302"),
584
- h("#ECCF35"),
585
- h("#F1DB67"),
586
- h("#F5E79A"),
587
- h("#FAF3CC"),
588
- h("#FAFF09")
591
+ f("#947D02"),
592
+ f("#E7C302"),
593
+ f("#ECCF35"),
594
+ f("#F1DB67"),
595
+ f("#F5E79A"),
596
+ f("#FAF3CC"),
597
+ f("#FAFF09")
589
598
  ],
590
599
  [
591
- h("#055432"),
592
- h("#07834F"),
593
- h("#399C72"),
594
- h("#6AB595"),
595
- h("#9CCDB9"),
596
- h("#CDE6DC"),
597
- h("#05F38F")
600
+ f("#055432"),
601
+ f("#07834F"),
602
+ f("#399C72"),
603
+ f("#6AB595"),
604
+ f("#9CCDB9"),
605
+ f("#CDE6DC"),
606
+ f("#05F38F")
598
607
  ],
599
608
  [
600
- h("#063E7E"),
601
- h("#0A60C5"),
602
- h("#3B80D1"),
603
- h("#6CA0DC"),
604
- h("#9DBFE8"),
605
- h("#CEDFF3"),
606
- h("#21c8ce")
609
+ f("#063E7E"),
610
+ f("#0A60C5"),
611
+ f("#3B80D1"),
612
+ f("#6CA0DC"),
613
+ f("#9DBFE8"),
614
+ f("#CEDFF3"),
615
+ f("#21c8ce")
607
616
  ],
608
617
  [
609
- h("#3E027A"),
610
- h("#6103BF"),
611
- h("#8136CC"),
612
- h("#A068D9"),
613
- h("#C09AE6"),
614
- h("#DFCDF2"),
615
- h("#A91DFF")
618
+ f("#3E027A"),
619
+ f("#6103BF"),
620
+ f("#8136CC"),
621
+ f("#A068D9"),
622
+ f("#C09AE6"),
623
+ f("#DFCDF2"),
624
+ f("#A91DFF")
616
625
  ]
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 = {
626
+ ], Pn = () => at.flat().map((e) => e.value), jn = { class: "toolbar-table-grid-wrapper" }, Un = ["data-cols", "data-rows", "onClick"], qn = { class: "toolbar-table-grid-value" }, Gn = {
618
627
  __name: "TableGrid",
619
628
  emits: ["select", "clickoutside"],
620
- setup(t, { emit: r }) {
621
- const o = r, n = f(0), e = f(0), i = (a) => {
629
+ setup(e, { emit: s }) {
630
+ const t = s, n = h(0), o = h(0), i = (a) => {
622
631
  let l = a.target;
623
632
  if (!!l.dataset.grid)
624
633
  return;
625
- let s = [...l.parentElement.querySelectorAll("[data-item]")], b = parseInt(l.dataset.cols, 10), v = parseInt(l.dataset.rows, 10);
626
- e.value = b, n.value = v;
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");
634
+ let r = [...l.parentElement.querySelectorAll("[data-item]")], w = parseInt(l.dataset.cols, 10), v = parseInt(l.dataset.rows, 10);
635
+ o.value = w, n.value = v;
636
+ for (let b = 0; b < r.length; b++) {
637
+ let y = r[b], g = parseInt(y.dataset.cols, 10), L = parseInt(y.dataset.rows, 10);
638
+ g <= w && L <= v ? y.classList.add("selected") : y.classList.remove("selected");
630
639
  }
631
640
  }, c = ({ cols: a, rows: l }) => {
632
- o("select", { cols: a, rows: l });
641
+ t("select", { cols: a, rows: l });
633
642
  };
634
- return (a, l) => (w(), C("div", Wn, [
635
- k("div", {
643
+ return (a, l) => (C(), k("div", jn, [
644
+ _("div", {
636
645
  class: "toolbar-table-grid",
637
646
  onMouseover: i,
638
647
  "data-grid": "true"
639
648
  }, [
640
- (w(), C(U, null, ee(5, (d) => (w(), C(U, { key: d }, [
641
- (w(), C(U, null, ee(5, (m) => k("div", {
649
+ (C(), k(U, null, te(5, (d) => (C(), k(U, { key: d }, [
650
+ (C(), k(U, null, te(5, (u) => _("div", {
642
651
  class: "toolbar-table-grid__item",
643
- key: `${d}_${m}`,
644
- "data-cols": m,
652
+ key: `${d}_${u}`,
653
+ "data-cols": u,
645
654
  "data-rows": d,
646
655
  "data-item": "true",
647
- onClick: ge((s) => c({ cols: m, rows: d }), ["stop", "prevent"])
648
- }, null, 8, Pn)), 64))
656
+ onClick: he((r) => c({ cols: u, rows: d }), ["stop", "prevent"])
657
+ }, null, 8, Un)), 64))
649
658
  ], 64))), 64))
650
659
  ], 32),
651
- k("div", jn, ie(n.value) + " x " + ie(e.value), 1)
660
+ _("div", qn, ie(n.value) + " x " + ie(o.value), 1)
652
661
  ]));
653
662
  }
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 = {
663
+ }, Kn = /* @__PURE__ */ q(Gn, [["__scopeId", "data-v-06352ab9"]]), Xn = { class: "toolbar-table-actions" }, Zn = ["onClick", "data-item"], Yn = { class: "toolbar-table-actions__icon" }, Jn = ["innerHTML"], Qn = { class: "toolbar-table-actions__label" }, eo = {
655
664
  __name: "TableActions",
656
665
  props: {
657
666
  options: {
@@ -659,27 +668,28 @@ const _ = (t) => {
659
668
  }
660
669
  },
661
670
  emits: ["select"],
662
- setup(t, { emit: r }) {
663
- const o = r, n = (e) => {
664
- o("select", { command: e.command });
671
+ setup(e, { emit: s }) {
672
+ const t = s, n = (o) => {
673
+ t("select", { command: o.command });
665
674
  };
666
- return (e, i) => (w(), C("div", Gn, [
667
- (w(!0), C(U, null, ee(t.options, (c) => (w(), C("div", {
675
+ return (o, i) => (C(), k("div", Xn, [
676
+ (C(!0), k(U, null, te(e.options, (c) => (C(), k("div", {
668
677
  class: oe(["toolbar-table-actions__item", { "toolbar-table-actions__item--border": c.bottomBorder }]),
669
- onClick: (a) => n(c)
678
+ onClick: (a) => n(c),
679
+ "data-item": c.props?.["data-item"] || ""
670
680
  }, [
671
- k("div", Xn, [
672
- k("div", {
681
+ _("div", Yn, [
682
+ _("div", {
673
683
  class: "toolbar-table-actions__icon-wrapper",
674
684
  innerHTML: c.icon
675
- }, null, 8, Zn)
685
+ }, null, 8, Jn)
676
686
  ]),
677
- k("div", Yn, ie(c.label), 1)
678
- ], 10, Kn))), 256))
687
+ _("div", Qn, ie(c.label), 1)
688
+ ], 10, Zn))), 256))
679
689
  ]));
680
690
  }
681
- }, Qn = /* @__PURE__ */ q(Jn, [["__scopeId", "data-v-9a702d7f"]]), eo = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"/></svg>
682
- `, to = { class: "search-input-ctn" }, no = { class: "row" }, oo = ["onKeydown"], io = {
691
+ }, to = /* @__PURE__ */ q(eo, [["__scopeId", "data-v-fdbfb4b0"]]), no = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"/></svg>
692
+ `, oo = { class: "search-input-ctn" }, io = { class: "row" }, so = ["onKeydown"], ao = {
683
693
  __name: "SearchInput",
684
694
  props: {
685
695
  searchRef: {
@@ -687,42 +697,87 @@ const _ = (t) => {
687
697
  }
688
698
  },
689
699
  emits: ["submit"],
690
- setup(t, { emit: r }) {
691
- const o = f(""), n = r, e = () => {
692
- n("submit", { value: o.value });
700
+ setup(e, { emit: s }) {
701
+ const t = h(""), n = s, o = () => {
702
+ n("submit", { value: t.value });
693
703
  };
694
- return (i, c) => (w(), C("div", to, [
695
- k("div", no, [
696
- Je(k("input", {
697
- ref: t.searchRef,
698
- "onUpdate:modelValue": c[0] || (c[0] = (a) => o.value = a),
704
+ return (i, c) => (C(), k("div", oo, [
705
+ _("div", io, [
706
+ Qe(_("input", {
707
+ ref: e.searchRef,
708
+ "onUpdate:modelValue": c[0] || (c[0] = (a) => t.value = a),
699
709
  class: "search-input",
700
710
  type: "text",
701
711
  name: "search",
702
712
  placeholder: "Type search string",
703
- onKeydown: Qe(ge(e, ["stop", "prevent"]), ["enter"])
704
- }, null, 40, oo), [
705
- [et, o.value]
713
+ onKeydown: et(he(o, ["stop", "prevent"]), ["enter"])
714
+ }, null, 40, so), [
715
+ [tt, t.value]
706
716
  ])
707
717
  ]),
708
- k("div", { class: "row submit" }, [
709
- k("button", {
718
+ _("div", { class: "row submit" }, [
719
+ _("button", {
710
720
  class: "submit-btn",
711
- onClick: e
721
+ onClick: o
712
722
  }, " Apply ")
713
723
  ])
714
724
  ]));
715
725
  }
716
- }, so = /* @__PURE__ */ q(io, [["__scopeId", "data-v-af870fbd"]]), ae = (t) => {
717
- t.expand.value = !1;
718
- }, lo = (t, r = !1, o, n, e) => {
719
- const i = _({
726
+ }, lo = /* @__PURE__ */ q(ao, [["__scopeId", "data-v-af870fbd"]]), ro = [
727
+ {
728
+ label: "Georgia",
729
+ key: "Georgia, serif",
730
+ fontWeight: 400,
731
+ props: {
732
+ style: { fontFamily: "Georgia, serif" },
733
+ "data-item": "btn-fontFamily-option"
734
+ }
735
+ },
736
+ {
737
+ label: "Arial",
738
+ key: "Arial, sans-serif",
739
+ fontWeight: 400,
740
+ props: {
741
+ style: { fontFamily: "Arial, sans-serif" },
742
+ "data-item": "btn-fontFamily-option"
743
+ }
744
+ },
745
+ {
746
+ label: "Courier New",
747
+ key: "Courier New, monospace",
748
+ fontWeight: 400,
749
+ props: {
750
+ style: { fontFamily: "Courier New, monospace" },
751
+ "data-item": "btn-fontFamily-option"
752
+ }
753
+ },
754
+ {
755
+ label: "Times New Roman",
756
+ key: "Times New Roman, serif",
757
+ fontWeight: 400,
758
+ props: {
759
+ style: { fontFamily: "Times New Roman, serif" },
760
+ "data-item": "btn-fontFamily-option"
761
+ }
762
+ }
763
+ ], re = (e) => {
764
+ e.expand.value = !1;
765
+ }, co = ({
766
+ superToolbar: e,
767
+ toolbarIcons: s,
768
+ toolbarFonts: t,
769
+ hideButtons: n,
770
+ availableWidth: o,
771
+ role: i,
772
+ isDev: c = !1
773
+ } = {}) => {
774
+ const a = x({
720
775
  type: "button",
721
776
  name: "bold",
722
777
  command: "toggleBold",
723
- icon: e.bold,
778
+ icon: s.bold,
724
779
  tooltip: "Bold"
725
- }), c = _({
780
+ }), l = x({
726
781
  type: "dropdown",
727
782
  name: "fontFamily",
728
783
  tooltip: "Font",
@@ -735,45 +790,12 @@ const _ = (t) => {
735
790
  isWide: !0,
736
791
  style: { width: "116px" },
737
792
  suppressActiveHighlight: !0,
738
- options: [
739
- {
740
- label: "Georgia",
741
- key: "Georgia, serif",
742
- fontWeight: 400,
743
- props: {
744
- style: { fontFamily: "Georgia, serif" }
745
- }
746
- },
747
- {
748
- label: "Arial",
749
- key: "Arial, sans-serif",
750
- fontWeight: 400,
751
- props: {
752
- style: { fontFamily: "Arial, sans-serif" }
753
- }
754
- },
755
- {
756
- label: "Courier New",
757
- key: "Courier New, monospace",
758
- fontWeight: 400,
759
- props: {
760
- style: { fontFamily: "Courier New, monospace" }
761
- }
762
- },
763
- {
764
- label: "Times New Roman",
765
- key: "Times New Roman, serif",
766
- fontWeight: 400,
767
- props: {
768
- style: { fontFamily: "Times New Roman, serif" }
769
- }
770
- }
771
- ],
772
- onActivate: ({ fontFamily: u }) => {
773
- u && (c.label.value = u);
793
+ options: [...t || ro],
794
+ onActivate: ({ fontFamily: m }) => {
795
+ m && (l.label.value = m);
774
796
  },
775
- onDeactivate: () => c.label.value = c.defaultLabel.value
776
- }), a = _({
797
+ onDeactivate: () => l.label.value = l.defaultLabel.value
798
+ }), d = x({
777
799
  type: "dropdown",
778
800
  dropdownStyles: {
779
801
  padding: 0,
@@ -781,7 +803,7 @@ const _ = (t) => {
781
803
  },
782
804
  name: "ai",
783
805
  tooltip: "AI text generation",
784
- icon: e.ai,
806
+ icon: s.ai,
785
807
  hideLabel: !0,
786
808
  hasCaret: !1,
787
809
  isWide: !0,
@@ -791,31 +813,31 @@ const _ = (t) => {
791
813
  type: "render",
792
814
  key: "ai",
793
815
  render: () => {
794
- let u = "";
795
- if (t.activeEditor) {
796
- const { state: A } = t.activeEditor, { from: W, to: le, empty: gt } = A.selection;
797
- u = gt ? "" : A.doc.textBetween(W, le);
816
+ let m = "";
817
+ if (e.activeEditor) {
818
+ const { state: A } = e.activeEditor, { from: V, to: le, empty: yt } = A.selection;
819
+ m = yt ? "" : A.doc.textBetween(V, le);
798
820
  }
799
- return B(
821
+ return $(
800
822
  "div",
801
823
  {},
802
824
  [
803
- B(jt, {
825
+ $(qt, {
804
826
  handleClose: () => {
805
- ae(a);
827
+ re(d);
806
828
  },
807
- selectedText: u,
808
- editor: t.activeEditor,
809
- apiKey: t.config.aiApiKey,
810
- endpoint: t.config.aiEndpoint,
811
- superToolbar: t
829
+ selectedText: m,
830
+ editor: e.activeEditor,
831
+ apiKey: e.config.aiApiKey,
832
+ endpoint: e.config.aiEndpoint,
833
+ superToolbar: e
812
834
  })
813
835
  ]
814
836
  );
815
837
  }
816
838
  }
817
839
  ]
818
- }), l = _({
840
+ }), u = x({
819
841
  type: "dropdown",
820
842
  name: "fontSize",
821
843
  defaultLabel: "12",
@@ -831,47 +853,47 @@ const _ = (t) => {
831
853
  isWide: !0,
832
854
  command: "setFontSize",
833
855
  options: [
834
- { label: "8", key: "8pt" },
835
- { label: "9", key: "9pt" },
836
- { label: "10", key: "10pt" },
837
- { label: "11", key: "11pt" },
838
- { label: "12", key: "12pt" },
839
- { label: "14", key: "14pt" },
840
- { label: "18", key: "18pt" },
841
- { label: "24", key: "24pt" },
842
- { label: "30", key: "30pt" },
843
- { label: "36", key: "36pt" },
844
- { label: "48", key: "48pt" },
845
- { label: "60", key: "60pt" },
846
- { label: "72", key: "72pt" },
847
- { label: "96", key: "96pt" }
856
+ { label: "8", key: "8pt", props: { "data-item": "btn-fontSize-option" } },
857
+ { label: "9", key: "9pt", props: { "data-item": "btn-fontSize-option" } },
858
+ { label: "10", key: "10pt", props: { "data-item": "btn-fontSize-option" } },
859
+ { label: "11", key: "11pt", props: { "data-item": "btn-fontSize-option" } },
860
+ { label: "12", key: "12pt", props: { "data-item": "btn-fontSize-option" } },
861
+ { label: "14", key: "14pt", props: { "data-item": "btn-fontSize-option" } },
862
+ { label: "18", key: "18pt", props: { "data-item": "btn-fontSize-option" } },
863
+ { label: "24", key: "24pt", props: { "data-item": "btn-fontSize-option" } },
864
+ { label: "30", key: "30pt", props: { "data-item": "btn-fontSize-option" } },
865
+ { label: "36", key: "36pt", props: { "data-item": "btn-fontSize-option" } },
866
+ { label: "48", key: "48pt", props: { "data-item": "btn-fontSize-option" } },
867
+ { label: "60", key: "60pt", props: { "data-item": "btn-fontSize-option" } },
868
+ { label: "72", key: "72pt", props: { "data-item": "btn-fontSize-option" } },
869
+ { label: "96", key: "96pt", props: { "data-item": "btn-fontSize-option" } }
848
870
  ],
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);
871
+ onActivate: ({ fontSize: m }) => {
872
+ if (!m) return u.label.value = u.defaultLabel.value;
873
+ let E = jt(m, 12);
874
+ E < 8 && (E = 8), E > 96 && (E = 96), u.label.value = String(E);
853
875
  },
854
- onDeactivate: () => l.label.value = l.defaultLabel.value
855
- }), d = _({
876
+ onDeactivate: () => u.label.value = u.defaultLabel.value
877
+ }), r = x({
856
878
  type: "separator",
857
879
  name: "separator",
858
880
  isNarrow: !0
859
- }), m = _({
881
+ }), w = x({
860
882
  type: "button",
861
883
  name: "italic",
862
884
  command: "toggleItalic",
863
- icon: e.italic,
885
+ icon: s.italic,
864
886
  tooltip: "Italic"
865
- }), s = _({
887
+ }), v = x({
866
888
  type: "button",
867
889
  name: "underline",
868
890
  command: "toggleUnderline",
869
- icon: e.underline,
891
+ icon: s.underline,
870
892
  tooltip: "Underline"
871
- }), b = _({
893
+ }), b = x({
872
894
  type: "dropdown",
873
895
  name: "highlight",
874
- icon: e.highlight,
896
+ icon: s.highlight,
875
897
  hideLabel: !0,
876
898
  markName: "highlight",
877
899
  labelAttr: "color",
@@ -883,17 +905,17 @@ const _ = (t) => {
883
905
  {
884
906
  key: "color",
885
907
  type: "render",
886
- render: () => Ve(t, b, [], !0)
908
+ render: () => We(e, b, [], !0)
887
909
  }
888
910
  ],
889
- onActivate: ({ color: u }) => {
890
- b.iconColor.value = u || "";
911
+ onActivate: ({ color: m }) => {
912
+ b.iconColor.value = m || "";
891
913
  },
892
914
  onDeactivate: () => b.iconColor.value = ""
893
- }), v = _({
915
+ }), y = x({
894
916
  type: "dropdown",
895
917
  name: "color",
896
- icon: e.color,
918
+ icon: s.color,
897
919
  hideLabel: !0,
898
920
  markName: "textStyle",
899
921
  labelAttr: "color",
@@ -904,88 +926,88 @@ const _ = (t) => {
904
926
  {
905
927
  key: "color",
906
928
  type: "render",
907
- render: () => Ve(t, v)
929
+ render: () => We(e, y)
908
930
  }
909
931
  ],
910
- onActivate: ({ color: u }) => {
911
- v.iconColor.value = u;
932
+ onActivate: ({ color: m }) => {
933
+ y.iconColor.value = m;
912
934
  },
913
- onDeactivate: () => v.iconColor.value = "#000"
914
- }), y = f(null), E = _({
935
+ onDeactivate: () => y.iconColor.value = "#000"
936
+ }), g = h(null), L = x({
915
937
  type: "dropdown",
916
938
  name: "search",
917
- icon: e.search,
939
+ icon: s.search,
918
940
  tooltip: "Search",
919
941
  group: "right",
920
- inputRef: y,
942
+ inputRef: g,
921
943
  options: [
922
944
  {
923
945
  type: "render",
924
946
  key: "searchDropdown",
925
- render: () => g()
947
+ render: () => D()
926
948
  }
927
949
  ]
928
- }), g = () => B("div", {}, [
929
- B(so, {
930
- onSubmit: ({ value: S }) => {
931
- t.activeEditor.commands.search(S);
950
+ }), D = () => $("div", {}, [
951
+ $(lo, {
952
+ onSubmit: ({ value: E }) => {
953
+ e.activeEditor.commands.search(E);
932
954
  },
933
- searchRef: y
955
+ searchRef: g
934
956
  })
935
- ]), F = _({
957
+ ]), p = x({
936
958
  type: "dropdown",
937
959
  name: "link",
938
960
  markName: "link",
939
- icon: e.link,
961
+ icon: s.link,
940
962
  tooltip: "Link",
941
963
  options: [
942
964
  {
943
965
  type: "render",
944
966
  key: "linkDropdown",
945
- render: () => $(F)
967
+ render: () => S(p)
946
968
  }
947
969
  ],
948
- onActivate: ({ href: u }) => {
949
- u ? F.attributes.value = { href: u } : F.attributes.value = {}, F.expand.value = !0;
970
+ onActivate: ({ href: m }) => {
971
+ m ? p.attributes.value = { href: m } : p.attributes.value = {}, p.expand.value = !0;
950
972
  },
951
973
  onDeactivate: () => {
952
- F.attributes.value = {}, F.expand.value = !1;
974
+ p.attributes.value = {}, p.expand.value = !1;
953
975
  }
954
976
  });
955
- function $(u) {
956
- return B("div", {}, [
957
- B(vn, {
977
+ function S(m) {
978
+ return $("div", {}, [
979
+ $(bn, {
958
980
  onSubmit: ({ href: A }) => {
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);
981
+ re(m), m.attributes.value.link = { href: A };
982
+ const V = { ...m, command: "toggleLink" };
983
+ e.emitCommand({ item: V, argument: { href: A, text: "" } }), A || (m.active.value = !1);
962
984
  },
963
- href: u.attributes.value.href,
985
+ href: m.attributes.value.href,
964
986
  goToAnchor: () => {
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
- le && Kt(le);
987
+ if (re(m), !e.activeEditor || !m.attributes.value?.href) return;
988
+ const A = m.attributes.value?.href?.slice(1), le = e.activeEditor.element.querySelector(`a[name='${A}']`);
989
+ le && Zt(le);
968
990
  }
969
991
  })
970
992
  ]);
971
993
  }
972
- const p = _({
994
+ const F = x({
973
995
  type: "options",
974
996
  name: "linkInput",
975
997
  command: "toggleLink"
976
998
  });
977
- F.childItem = p, p.parentItem = F;
978
- const x = _({
999
+ p.childItem = F, F.parentItem = p;
1000
+ const O = x({
979
1001
  type: "button",
980
1002
  name: "image",
981
1003
  command: "startImageUpload",
982
- icon: e.image,
1004
+ icon: s.image,
983
1005
  tooltip: "Image",
984
1006
  disabled: !1
985
- }), T = _({
1007
+ }), W = x({
986
1008
  type: "dropdown",
987
1009
  name: "table",
988
- icon: e.table,
1010
+ icon: s.table,
989
1011
  hideLabel: !0,
990
1012
  labelAttr: "table",
991
1013
  tooltip: "Insert table",
@@ -995,106 +1017,117 @@ const _ = (t) => {
995
1017
  {
996
1018
  key: "table",
997
1019
  type: "render",
998
- render: () => N(T)
1020
+ render: () => ne(W)
999
1021
  }
1000
1022
  ]
1001
1023
  });
1002
- function N(u) {
1003
- return B("div", {}, [
1004
- B(qn, {
1024
+ function ne(m) {
1025
+ return $("div", {}, [
1026
+ $(Kn, {
1005
1027
  onSelect: (A) => {
1006
- t.emitCommand({ item: u, argument: A }), ae(u);
1028
+ e.emitCommand({ item: m, argument: A }), re(m);
1007
1029
  }
1008
1030
  })
1009
1031
  ]);
1010
1032
  }
1011
- const V = _({
1033
+ const ue = x({
1012
1034
  type: "dropdown",
1013
1035
  name: "tableActions",
1014
1036
  command: "executeTableCommand",
1015
- icon: e.tableActions,
1037
+ icon: s.tableActions,
1016
1038
  hideLabel: !0,
1017
1039
  disabled: !0,
1018
1040
  options: [
1019
1041
  {
1020
1042
  type: "render",
1021
- render: () => ye(V)
1043
+ render: () => ge(ue)
1022
1044
  }
1023
1045
  ]
1024
- }), te = [
1046
+ }), ve = [
1025
1047
  {
1026
1048
  label: "Insert row above",
1027
1049
  command: "addRowBefore",
1028
- icon: e.addRowBefore
1050
+ icon: s.addRowBefore,
1051
+ props: { "data-item": "btn-tableActions-option" }
1029
1052
  },
1030
1053
  {
1031
1054
  label: "Insert row below",
1032
1055
  command: "addRowAfter",
1033
- icon: e.addRowAfter
1056
+ icon: s.addRowAfter,
1057
+ props: { "data-item": "btn-tableActions-option" }
1034
1058
  },
1035
1059
  {
1036
1060
  label: "Insert column left",
1037
1061
  command: "addColumnBefore",
1038
- icon: e.addColumnBefore
1062
+ icon: s.addColumnBefore,
1063
+ props: { "data-item": "btn-tableActions-option" }
1039
1064
  },
1040
1065
  {
1041
1066
  label: "Insert column right",
1042
1067
  command: "addColumnAfter",
1043
- icon: e.addColumnAfter,
1044
- bottomBorder: !0
1068
+ icon: s.addColumnAfter,
1069
+ bottomBorder: !0,
1070
+ props: { "data-item": "btn-tableActions-option" }
1045
1071
  },
1046
1072
  {
1047
1073
  label: "Delete row",
1048
1074
  command: "deleteRow",
1049
- icon: e.deleteRow
1075
+ icon: s.deleteRow,
1076
+ props: { "data-item": "btn-tableActions-option" }
1050
1077
  },
1051
1078
  {
1052
1079
  label: "Delete column",
1053
1080
  command: "deleteColumn",
1054
- icon: e.deleteColumn
1081
+ icon: s.deleteColumn,
1082
+ props: { "data-item": "btn-tableActions-option" }
1055
1083
  },
1056
1084
  {
1057
1085
  label: "Delete table",
1058
1086
  command: "deleteTable",
1059
- icon: e.deleteTable
1087
+ icon: s.deleteTable,
1088
+ props: { "data-item": "btn-tableActions-option" }
1060
1089
  },
1061
1090
  {
1062
1091
  label: "Transparent borders",
1063
1092
  command: "deleteCellAndTableBorders",
1064
- icon: e.deleteBorders,
1065
- bottomBorder: !0
1093
+ icon: s.deleteBorders,
1094
+ bottomBorder: !0,
1095
+ props: { "data-item": "btn-tableActions-option" }
1066
1096
  },
1067
1097
  {
1068
1098
  label: "Merge cells",
1069
1099
  command: "mergeCells",
1070
- icon: e.mergeCells
1100
+ icon: s.mergeCells,
1101
+ props: { "data-item": "btn-tableActions-option" }
1071
1102
  },
1072
1103
  {
1073
1104
  label: "Split cell",
1074
1105
  command: "splitCell",
1075
- icon: e.splitCell
1106
+ icon: s.splitCell,
1107
+ props: { "data-item": "btn-tableActions-option" }
1076
1108
  },
1077
1109
  {
1078
1110
  label: "Fix tables",
1079
1111
  command: "fixTables",
1080
- icon: e.fixTables
1112
+ icon: s.fixTables,
1113
+ props: { "data-item": "btn-tableActions-option" }
1081
1114
  }
1082
1115
  ];
1083
- function ye(u) {
1084
- return B(Qn, {
1085
- options: te,
1086
- onSelect: (S) => {
1087
- ae(u);
1088
- const { command: A } = S;
1089
- t.emitCommand({ item: u, argument: { command: A } });
1116
+ function ge(m) {
1117
+ return $(to, {
1118
+ options: ve,
1119
+ onSelect: (E) => {
1120
+ re(m);
1121
+ const { command: A } = E;
1122
+ e.emitCommand({ item: m, argument: { command: A } });
1090
1123
  }
1091
1124
  });
1092
1125
  }
1093
- const Z = _({
1126
+ const Y = x({
1094
1127
  type: "dropdown",
1095
1128
  name: "textAlign",
1096
1129
  tooltip: "Alignment",
1097
- icon: e.alignLeft,
1130
+ icon: s.alignLeft,
1098
1131
  command: "setTextAlign",
1099
1132
  hasCaret: !0,
1100
1133
  markName: "textAlign",
@@ -1103,65 +1136,65 @@ const _ = (t) => {
1103
1136
  options: [
1104
1137
  {
1105
1138
  type: "render",
1106
- render: () => B("div", {}, [
1107
- B(tn, {
1108
- onSelect: (S) => {
1109
- ae(Z);
1110
- const A = { ...Z, command: "setTextAlign" };
1111
- A.command = "setTextAlign", t.emitCommand({ item: A, argument: S }), re(Z, S);
1139
+ render: () => $("div", {}, [
1140
+ $(on, {
1141
+ onSelect: (E) => {
1142
+ re(Y);
1143
+ const A = { ...Y, command: "setTextAlign" };
1144
+ A.command = "setTextAlign", e.emitCommand({ item: A, argument: E }), T(Y, E);
1112
1145
  }
1113
1146
  })
1114
1147
  ]),
1115
1148
  key: "alignment"
1116
1149
  }
1117
1150
  ],
1118
- onActivate: ({ textAlign: u }) => {
1119
- re(Z, u);
1151
+ onActivate: ({ textAlign: m }) => {
1152
+ T(Y, m);
1120
1153
  },
1121
1154
  onDeactivate: () => {
1122
- re(Z, "left");
1155
+ T(Y, "left");
1123
1156
  }
1124
- }), re = (u, S) => {
1125
- let A = S === "both" ? "justify" : S, W = {
1126
- left: e.alignLeft,
1127
- right: e.alignRight,
1128
- center: e.alignCenter,
1129
- justify: e.alignJustify
1130
- }, le = W[A] ?? W.left;
1131
- u.icon.value = le;
1132
- }, be = _({
1157
+ }), T = (m, E) => {
1158
+ let A = E === "both" ? "justify" : E, V = {
1159
+ left: s.alignLeft,
1160
+ right: s.alignRight,
1161
+ center: s.alignCenter,
1162
+ justify: s.alignJustify
1163
+ }, le = V[A] ?? V.left;
1164
+ m.icon.value = le;
1165
+ }, B = x({
1133
1166
  type: "button",
1134
1167
  name: "list",
1135
1168
  command: "toggleBulletList",
1136
- icon: e.bulletList,
1169
+ icon: s.bulletList,
1137
1170
  tooltip: "Bullet list"
1138
- }), I = _({
1171
+ }), H = x({
1139
1172
  type: "button",
1140
1173
  name: "numberedlist",
1141
1174
  command: "toggleOrderedList",
1142
- icon: e.numberedList,
1175
+ icon: s.numberedList,
1143
1176
  tooltip: "Numbered list"
1144
- }), M = _({
1177
+ }), z = x({
1145
1178
  type: "button",
1146
1179
  name: "indentleft",
1147
1180
  command: "decreaseTextIndent",
1148
- icon: e.indentLeft,
1181
+ icon: s.indentLeft,
1149
1182
  tooltip: "Left indent",
1150
1183
  disabled: !1
1151
- }), H = _({
1184
+ }), G = x({
1152
1185
  type: "button",
1153
1186
  name: "indentright",
1154
1187
  command: "increaseTextIndent",
1155
- icon: e.indentRight,
1188
+ icon: s.indentRight,
1156
1189
  tooltip: "Right indent",
1157
1190
  disabled: !1
1158
- }), R = _({
1191
+ }), K = x({
1159
1192
  type: "overflow",
1160
1193
  name: "overflow",
1161
1194
  command: "toggleOverflow",
1162
- icon: e.overflow,
1195
+ icon: s.overflow,
1163
1196
  disabled: !1
1164
- }), G = _({
1197
+ }), ce = x({
1165
1198
  type: "dropdown",
1166
1199
  name: "zoom",
1167
1200
  allowWithoutEditor: !0,
@@ -1174,116 +1207,116 @@ const _ = (t) => {
1174
1207
  inlineTextInputVisible: !1,
1175
1208
  hasInlineTextInput: !0,
1176
1209
  options: [
1177
- { label: "50%", key: 0.5 },
1178
- { label: "75%", key: 0.75 },
1179
- { label: "90%", key: 0.9 },
1180
- { label: "100%", key: 1 },
1181
- { label: "125%", key: 1.25 },
1182
- { label: "150%", key: 1.5 },
1183
- { label: "200%", key: 2 }
1210
+ { label: "50%", key: 0.5, props: { "data-item": "btn-zoom-option" } },
1211
+ { label: "75%", key: 0.75, props: { "data-item": "btn-zoom-option" } },
1212
+ { label: "90%", key: 0.9, props: { "data-item": "btn-zoom-option" } },
1213
+ { label: "100%", key: 1, props: { "data-item": "btn-zoom-option" } },
1214
+ { label: "125%", key: 1.25, props: { "data-item": "btn-zoom-option" } },
1215
+ { label: "150%", key: 1.5, props: { "data-item": "btn-zoom-option" } },
1216
+ { label: "200%", key: 2, props: { "data-item": "btn-zoom-option" } }
1184
1217
  ],
1185
- onActivate: ({ zoom: u }) => {
1186
- u && (G.label.value = u);
1218
+ onActivate: ({ zoom: m }) => {
1219
+ m && (ce.label.value = m);
1187
1220
  }
1188
- }), K = _({
1221
+ }), se = x({
1189
1222
  type: "button",
1190
1223
  name: "undo",
1191
1224
  disabled: !0,
1192
1225
  tooltip: "Undo",
1193
1226
  command: "undo",
1194
- icon: e.undo,
1227
+ icon: s.undo,
1195
1228
  group: "left",
1196
1229
  onDeactivate: () => {
1197
- K.disabled.value = !t.undoDepth;
1230
+ se.disabled.value = !e.undoDepth;
1198
1231
  }
1199
- }), ce = _({
1232
+ }), ke = x({
1200
1233
  type: "button",
1201
1234
  disabled: !0,
1202
1235
  name: "redo",
1203
1236
  tooltip: "Redo",
1204
1237
  command: "redo",
1205
- icon: e.redo,
1238
+ icon: s.redo,
1206
1239
  group: "left",
1207
1240
  onDeactivate: () => {
1208
- ce.disabled.value = !t.redoDepth;
1241
+ ke.disabled.value = !e.redoDepth;
1209
1242
  }
1210
- }), ue = _({
1243
+ }), Ie = x({
1211
1244
  type: "button",
1212
1245
  disabled: !1,
1213
1246
  name: "toggleTrackChanges",
1214
1247
  tooltip: "Track Changes",
1215
1248
  command: "toggleTrackChanges",
1216
- icon: e.trackChanges,
1249
+ icon: s.trackChanges,
1217
1250
  group: "left"
1218
- }), _e = _({
1251
+ }), be = x({
1219
1252
  type: "button",
1220
1253
  disabled: !1,
1221
1254
  name: "acceptTrackedChangeBySelection",
1222
1255
  tooltip: "Accept changes under selection",
1223
1256
  command: "acceptTrackedChangeBySelection",
1224
- icon: e.trackChangesAccept,
1257
+ icon: s.trackChangesAccept,
1225
1258
  group: "left"
1226
- }), xe = _({
1259
+ }), _e = x({
1227
1260
  type: "button",
1228
1261
  disabled: !1,
1229
1262
  name: "rejectTrackedChangeOnSelection",
1230
1263
  tooltip: "Reject changes under selection",
1231
1264
  command: "rejectTrackedChangeOnSelection",
1232
- icon: e.trackChangesReject,
1265
+ icon: s.trackChangesReject,
1233
1266
  group: "left"
1234
- }), Ee = _({
1267
+ }), Le = x({
1235
1268
  type: "button",
1236
1269
  disabled: !1,
1237
1270
  name: "toggleTrackChangesShowOriginal",
1238
1271
  tooltip: "Toggle Show Original",
1239
1272
  command: "toggleTrackChangesShowOriginal",
1240
- icon: e.trackChangesOriginal,
1273
+ icon: s.trackChangesOriginal,
1241
1274
  group: "left"
1242
- }), Fe = _({
1275
+ }), Me = x({
1243
1276
  type: "button",
1244
1277
  disabled: !1,
1245
1278
  name: "toggleTrackChangesShowFinal",
1246
1279
  tooltip: "Toggle Show Final",
1247
1280
  command: "toggleTrackChangesShowFinal",
1248
- icon: e.trackChangesFinal,
1281
+ icon: s.trackChangesFinal,
1249
1282
  group: "left"
1250
- }), Ie = _({
1283
+ }), De = x({
1251
1284
  type: "button",
1252
1285
  name: "clearFormatting",
1253
1286
  command: "clearFormat",
1254
1287
  tooltip: "Clear formatting",
1255
- icon: e.clearFormatting
1288
+ icon: s.clearFormatting
1256
1289
  });
1257
1290
  [
1258
- i,
1259
- m,
1260
- s,
1261
- H,
1262
- M,
1263
- E,
1264
- R
1265
- ].map((u) => u.name);
1266
- const Le = _({
1291
+ a,
1292
+ w,
1293
+ v,
1294
+ G,
1295
+ z,
1296
+ L,
1297
+ K
1298
+ ].map((m) => m.name);
1299
+ const xe = x({
1267
1300
  type: "button",
1268
1301
  name: "copyFormat",
1269
1302
  tooltip: "Format painter",
1270
- icon: e.copyFormat,
1303
+ icon: s.copyFormat,
1271
1304
  command: "copyFormat"
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 = _({
1305
+ }), Se = (m, E) => m === "editor" ? E : m === "suggester" ? E.filter((A) => A.value === "suggesting") : E.filter((A) => A.value === "viewing"), Ee = (m) => m === "editor" ? "Editing" : m === "suggester" ? "Suggesting" : "Viewing", X = x({
1273
1306
  type: "dropdown",
1274
1307
  name: "documentMode",
1275
1308
  command: "setDocumentMode",
1276
1309
  allowWithoutEditor: !0,
1277
- icon: e.documentMode,
1278
- defaultLabel: we(n),
1279
- label: we(n),
1280
- hasCaret: n === "editor",
1310
+ icon: s.documentMode,
1311
+ defaultLabel: Ee(i),
1312
+ label: Ee(i),
1313
+ hasCaret: i === "editor",
1281
1314
  isWide: !0,
1282
1315
  style: { display: "flex", justifyContent: "flex-end" },
1283
1316
  inlineTextInputVisible: !1,
1284
1317
  hasInlineTextInput: !1,
1285
1318
  group: "right",
1286
- disabled: n !== "editor",
1319
+ disabled: i !== "editor",
1287
1320
  attributes: {
1288
1321
  dropdownPosition: "right",
1289
1322
  className: "toolbar-item--doc-mode"
@@ -1291,47 +1324,47 @@ const _ = (t) => {
1291
1324
  options: [
1292
1325
  {
1293
1326
  type: "render",
1294
- render: () => me(ne)
1327
+ render: () => ye(X)
1295
1328
  }
1296
1329
  ]
1297
- }), De = [
1330
+ }), ae = [
1298
1331
  {
1299
1332
  label: "Editing",
1300
1333
  value: "editing",
1301
- icon: e.documentEditingMode,
1334
+ icon: s.documentEditingMode,
1302
1335
  description: "Edit document directly"
1303
1336
  },
1304
1337
  {
1305
1338
  label: "Suggesting",
1306
1339
  value: "suggesting",
1307
- icon: e.documentSuggestingMode,
1340
+ icon: s.documentSuggestingMode,
1308
1341
  description: "Edits become suggestions"
1309
1342
  },
1310
1343
  {
1311
1344
  label: "Viewing",
1312
1345
  value: "viewing",
1313
- icon: e.documentViewingMode,
1346
+ icon: s.documentViewingMode,
1314
1347
  description: "View clean version of document only"
1315
1348
  }
1316
1349
  ];
1317
- function me(u) {
1318
- const S = Me(n, De);
1319
- return B(En, {
1320
- options: S,
1350
+ function ye(m) {
1351
+ const E = Se(i, ae);
1352
+ return $(An, {
1353
+ options: E,
1321
1354
  onSelect: (A) => {
1322
- ae(u);
1323
- const { label: W, icon: le } = A;
1324
- ne.label.value = W, ne.icon.value = le, t.emitCommand({ item: ne, argument: W });
1355
+ re(m);
1356
+ const { label: V, icon: le } = A;
1357
+ X.label.value = V, X.icon.value = le, e.emitCommand({ item: X, argument: V });
1325
1358
  }
1326
1359
  });
1327
1360
  }
1328
- const se = _({
1361
+ const ut = x({
1329
1362
  type: "button",
1330
1363
  name: "pageBreakTool",
1331
1364
  command: "insertPageBreak",
1332
- icon: e.pageBreak,
1365
+ icon: s.pageBreak,
1333
1366
  tooltip: "Insert page break"
1334
- }), pe = /* @__PURE__ */ new Map([
1367
+ }), je = /* @__PURE__ */ new Map([
1335
1368
  ["separator", 20],
1336
1369
  ["zoom", 71],
1337
1370
  ["fontFamily", 118],
@@ -1341,17 +1374,17 @@ const _ = (t) => {
1341
1374
  ["documentMode", 47],
1342
1375
  ["ai", 32],
1343
1376
  ["default", 32]
1344
- ]), dt = _({
1377
+ ]), mt = x({
1345
1378
  type: "button",
1346
1379
  name: "ruler",
1347
1380
  command: "toggleRuler",
1348
- icon: e.ruler,
1381
+ icon: s.ruler,
1349
1382
  tooltip: "Show or hide ruler"
1350
- }), Ce = _({
1383
+ }), we = x({
1351
1384
  type: "dropdown",
1352
1385
  name: "linkedStyles",
1353
1386
  command: "setLinkedStyle",
1354
- icon: e.paintbrush,
1387
+ icon: s.paintbrush,
1355
1388
  defaultLabel: "Format text",
1356
1389
  label: "Format text",
1357
1390
  hasCaret: !0,
@@ -1367,34 +1400,34 @@ const _ = (t) => {
1367
1400
  type: "render",
1368
1401
  key: "linkedStyle",
1369
1402
  render: () => {
1370
- const u = (S) => {
1371
- ae(Ce);
1372
- const A = { ...Ce, command: "setLinkedStyle" };
1373
- t.emitCommand({ item: A, argument: S });
1403
+ const m = (E) => {
1404
+ re(we);
1405
+ const A = { ...we, command: "setLinkedStyle" };
1406
+ e.emitCommand({ item: A, argument: E });
1374
1407
  };
1375
- return B("div", {}, [
1376
- B(Fn, {
1377
- editor: t.activeEditor,
1378
- onSelect: u
1408
+ return $("div", {}, [
1409
+ $(Ln, {
1410
+ editor: e.activeEditor,
1411
+ onSelect: m
1379
1412
  })
1380
1413
  ]);
1381
1414
  }
1382
1415
  }
1383
1416
  ],
1384
1417
  onActivate: () => {
1385
- Ce.disabled.value = !1;
1418
+ we.disabled.value = !1;
1386
1419
  },
1387
1420
  onDeactivate: () => {
1388
- Ce.disabled.value = !0;
1421
+ we.disabled.value = !0;
1389
1422
  }
1390
- }), he = (u, S) => {
1391
- if (S.value.toString() === u)
1392
- return B("div", { innerHTML: eo, class: "dropdown-select-icon" });
1393
- }, de = _({
1423
+ }), me = (m, E) => {
1424
+ if (E.value.toString() === m)
1425
+ return $("div", { innerHTML: no, class: "dropdown-select-icon" });
1426
+ }, de = x({
1394
1427
  type: "dropdown",
1395
1428
  name: "lineHeight",
1396
1429
  tooltip: "Line height",
1397
- icon: e.lineHeight,
1430
+ icon: s.lineHeight,
1398
1431
  hasCaret: !1,
1399
1432
  hasInlineTextInput: !1,
1400
1433
  inlineTextInputVisible: !1,
@@ -1404,193 +1437,196 @@ const _ = (t) => {
1404
1437
  dropdownValueKey: "key",
1405
1438
  selectedValue: "1",
1406
1439
  options: [
1407
- { label: "1,0", key: "1", icon: () => he("1", de.selectedValue) },
1408
- { label: "1,15", key: "1.15", icon: () => he("1.15", de.selectedValue) },
1409
- { label: "1,5", key: "1.5", icon: () => he("1.5", de.selectedValue) },
1410
- { label: "2,0", key: "2", icon: () => he("2", de.selectedValue) },
1411
- { label: "2,5", key: "2.5", icon: () => he("2.5", de.selectedValue) },
1412
- { label: "3,0", key: "3", icon: () => he("3", de.selectedValue) }
1440
+ { label: "1,0", key: "1", icon: () => me("1", de.selectedValue), props: { "data-item": "btn-lineHeight-option" } },
1441
+ { label: "1,15", key: "1.15", icon: () => me("1.15", de.selectedValue), props: { "data-item": "btn-lineHeight-option" } },
1442
+ { label: "1,5", key: "1.5", icon: () => me("1.5", de.selectedValue), props: { "data-item": "btn-lineHeight-option" } },
1443
+ { label: "2,0", key: "2", icon: () => me("2", de.selectedValue), props: { "data-item": "btn-lineHeight-option" } },
1444
+ { label: "2,5", key: "2.5", icon: () => me("2.5", de.selectedValue), props: { "data-item": "btn-lineHeight-option" } },
1445
+ { label: "3,0", key: "3", icon: () => me("3", de.selectedValue), props: { "data-item": "btn-lineHeight-option" } }
1413
1446
  ]
1414
- }), $e = {
1447
+ }), Be = {
1415
1448
  sm: 768,
1416
1449
  md: 1024,
1417
1450
  xl: 1410
1418
- }, ut = 120, mt = 32, pt = ["linkedStyles", "clearFormatting", "copyFormat", "ruler"], ht = ["zoom", "fontFamily", "fontSize", "redo"];
1419
- let O = [
1420
- K,
1421
- ce,
1451
+ }, pt = 120, ft = 32, ht = ["linkedStyles", "clearFormatting", "copyFormat", "ruler"], vt = ["zoom", "fontFamily", "fontSize", "redo"];
1452
+ let R = [
1453
+ se,
1454
+ ke,
1422
1455
  // Dev - tracked changes
1423
1456
  // toggleTrackChanges,
1457
+ be,
1424
1458
  _e,
1425
- xe,
1426
1459
  // toggleTrackChangesOriginal,
1427
1460
  // toggleTrackChangesFinal,
1428
- G,
1429
- c,
1430
- d,
1461
+ ce,
1431
1462
  l,
1432
- d,
1433
- i,
1434
- m,
1435
- s,
1463
+ r,
1464
+ u,
1465
+ r,
1466
+ a,
1467
+ w,
1436
1468
  v,
1469
+ y,
1437
1470
  b,
1438
- d,
1439
- F,
1440
- x,
1441
- T,
1442
- V,
1443
- d,
1444
- Z,
1445
- be,
1446
- I,
1447
- M,
1471
+ r,
1472
+ p,
1473
+ O,
1474
+ W,
1475
+ ue,
1476
+ r,
1477
+ Y,
1478
+ B,
1448
1479
  H,
1480
+ z,
1481
+ G,
1449
1482
  de,
1483
+ r,
1484
+ we,
1485
+ r,
1486
+ mt,
1487
+ ut,
1488
+ xe,
1489
+ De,
1450
1490
  d,
1451
- Ce,
1452
- d,
1453
- dt,
1454
- se,
1455
- Le,
1456
- Ie,
1457
- a,
1458
- R,
1459
- ne
1491
+ K,
1492
+ X
1460
1493
  ];
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));
1494
+ if (e.config?.superdoc?.config?.modules?.ai || (R = R.filter((m) => m.name.value !== "ai")), o <= Be.md && n && (R = R.filter((m) => m.type !== "separator")), e.config.pagination || (R = R.filter((m) => m.name.value !== "pageBreakTool")), e.config.mode !== "docx") {
1495
+ const m = R.findIndex((A) => A.name.value === "linkedStyles");
1496
+ R.splice(m - 1, 2);
1497
+ const E = ["ruler", "zoom", "undo", "redo"];
1498
+ R = R.filter((A) => !E.includes(A.name.value));
1466
1499
  }
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
- let Be = mt + ut;
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
- const A = O.findIndex((W) => W.name.value === "linkedStyles");
1476
- O.splice(A + 1, 1);
1500
+ const Ue = [Ie, Le, Me];
1501
+ c || (i === "viewer" && Ue.push(be, _e), R = R.filter((m) => !Ue.includes(m)));
1502
+ const gt = [L, se, K, X].map((m) => m.name), bt = (m) => gt.includes(m.name), Ae = [], He = [];
1503
+ let $e = ft + pt;
1504
+ return R.forEach((m) => {
1505
+ const E = je.get(m.name.value) || je.get("default");
1506
+ if (o < Be.xl && ht.includes(m.name.value) && n) {
1507
+ if (Ae.push(m), m.name.value === "linkedStyles") {
1508
+ const A = R.findIndex((V) => V.name.value === "linkedStyles");
1509
+ R.splice(A + 1, 1);
1477
1510
  }
1478
1511
  return;
1479
1512
  }
1480
- if (o < $e.sm && ht.includes(u.name.value)) {
1481
- Se.push(u);
1513
+ if (o < Be.sm && vt.includes(m.name.value) && n) {
1514
+ Ae.push(m);
1482
1515
  return;
1483
1516
  }
1484
- if (vt(u)) {
1485
- He.push(u), Be += S;
1517
+ if (bt(m)) {
1518
+ He.push(m), $e += E;
1486
1519
  return;
1487
1520
  }
1488
- Be < o ? (He.push(u), Be += S) : Se.push(u);
1521
+ $e < o || !n ? (He.push(m), $e += E) : Ae.push(m);
1489
1522
  }), {
1490
1523
  defaultItems: He,
1491
- overflowItems: Se.filter((u) => u.type !== "separator")
1524
+ overflowItems: Ae.filter((m) => m.type !== "separator")
1492
1525
  };
1493
- }, ao = [".jpg", ".jpeg", ".png", "image/jpeg", "image/png"], ro = () => {
1494
- let t = document.createElement("input");
1495
- t.type = "file";
1496
- let r = ao;
1497
- return t.accept = r.join(","), () => new Promise((n, e) => {
1498
- t.onchange = async () => {
1499
- const i = t.files;
1526
+ }, uo = [".jpg", ".jpeg", ".png", "image/jpeg", "image/png"], mo = () => {
1527
+ let e = document.createElement("input");
1528
+ e.type = "file";
1529
+ let s = uo;
1530
+ return e.accept = s.join(","), () => new Promise((n, o) => {
1531
+ e.onchange = async () => {
1532
+ const i = e.files;
1500
1533
  if (!i) return n(null);
1501
1534
  const c = i.item(0);
1502
1535
  return n(c ? { file: c } : null);
1503
- }, t.oncancel = () => n(null), t.onerror = e, t.click();
1536
+ }, e.oncancel = () => n(null), e.onerror = o, e.click();
1504
1537
  });
1505
- }, co = (t) => new Promise((r, o) => {
1538
+ }, po = (e) => new Promise((s, t) => {
1506
1539
  let n = new FileReader();
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
- const e = new window.Image();
1510
- e.onload = () => {
1511
- const i = document.createElement("canvas"), { width: c, height: a } = mo(
1512
- e.width,
1513
- e.height,
1514
- r
1540
+ n.onload = (o) => s(o.target.result), n.onerror = t, setTimeout(() => n.readAsDataURL(e), 250);
1541
+ }), fo = (e, s) => new Promise((t, n) => {
1542
+ const o = new window.Image();
1543
+ o.onload = () => {
1544
+ const i = document.createElement("canvas"), { width: c, height: a } = ho(
1545
+ o.width,
1546
+ o.height,
1547
+ s
1515
1548
  );
1516
- if (i.width = c, i.height = a, i.getContext("2d").drawImage(e, 0, 0, c, a), typeof t == "string") {
1549
+ if (i.width = c, i.height = a, i.getContext("2d").drawImage(o, 0, 0, c, a), typeof e == "string") {
1517
1550
  const d = i.toDataURL();
1518
- o(d);
1551
+ t(d);
1519
1552
  } else
1520
1553
  i.toBlob((d) => {
1521
- const m = new File([d], t.name, {
1522
- type: t.type,
1554
+ const u = new File([d], e.name, {
1555
+ type: e.type,
1523
1556
  lastModified: Date.now()
1524
1557
  });
1525
- o({ file: m, width: c, height: a });
1558
+ t({ file: u, width: c, height: a });
1526
1559
  });
1527
- }, e.onerror = (i) => n(i), e.src = typeof t == "string" ? t : URL.createObjectURL(t);
1528
- }), mo = (t, r, o) => {
1529
- const { width: n, height: e } = o.getMaxContentSize();
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
- let n = typeof t.options.handleImageUpload == "function" ? t.options.handleImageUpload : co;
1536
- if ((o.size / (1024 * 1024)).toFixed(4) > 5) {
1560
+ }, o.onerror = (i) => n(i), o.src = typeof e == "string" ? e : URL.createObjectURL(e);
1561
+ }), ho = (e, s, t) => {
1562
+ const { width: n, height: o } = t.getMaxContentSize();
1563
+ if (!n || !o) return { width: e, height: s };
1564
+ let i = e, c = s;
1565
+ const a = e / s;
1566
+ return s > o && (c = o, i = Math.round(o * a)), i > n && (i = n, c = Math.round(n / a)), { width: i, height: c };
1567
+ }, vo = async ({ editor: e, view: s, file: t }) => {
1568
+ let n = typeof e.options.handleImageUpload == "function" ? e.options.handleImageUpload : po;
1569
+ if ((t.size / (1024 * 1024)).toFixed(4) > 5) {
1537
1570
  window.alert("Image size must be less than 5MB");
1538
1571
  return;
1539
1572
  }
1540
1573
  let i, c;
1541
1574
  try {
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);
1575
+ const r = await fo(t, e);
1576
+ i = r.width, c = r.height, t = r.file;
1577
+ } catch (r) {
1578
+ console.warn("Error processing image:", r);
1546
1579
  return;
1547
1580
  }
1548
- let a = {}, { tr: l, schema: d } = r.state;
1581
+ let a = {}, { tr: l, schema: d } = s.state;
1549
1582
  l.selection.empty || l.deleteSelection();
1550
- let m = {
1583
+ let u = {
1551
1584
  type: "add",
1552
1585
  pos: l.selection.from,
1553
1586
  id: a
1554
1587
  };
1555
- l.setMeta(Ne, m), r.dispatch(l), n(o).then(
1556
- (s) => {
1557
- let b = o.name.replace(" ", "_"), v = Ct(r.state, a);
1588
+ l.setMeta(Oe, u), s.dispatch(l), n(t).then(
1589
+ (r) => {
1590
+ let w = t.name.replace(" ", "_"), v = _t(s.state, a);
1558
1591
  if (v == null)
1559
1592
  return;
1560
- let y = { type: "remove", id: a }, E = `word/media/${b}`, g = d.nodes.image.create({
1561
- src: E,
1593
+ let b = { type: "remove", id: a }, y = `word/media/${w}`, g = d.nodes.image.create({
1594
+ src: y,
1562
1595
  size: { width: i, height: c }
1563
1596
  });
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)
1597
+ e.storage.image.media = Object.assign(e.storage.image.media, { [y]: r }), e.options.ydoc && e.commands.addImageToCollaboration({ mediaPath: y, fileData: r }), s.dispatch(
1598
+ s.state.tr.replaceWith(v, v, g).setMeta(Oe, b)
1566
1599
  );
1567
1600
  },
1568
1601
  () => {
1569
- let s = { type: "remove", id: a };
1570
- r.dispatch(l.setMeta(Ne, s));
1602
+ let r = { type: "remove", id: a };
1603
+ s.dispatch(l.setMeta(Oe, r));
1571
1604
  }
1572
1605
  );
1573
1606
  };
1574
- var L, lt, ve, We, at, rt, Pe, ct, fe;
1575
- class Mo extends qt {
1607
+ var I, lt, fe, Ve, rt, ct, Pe, dt, pe;
1608
+ class Ho extends Kt {
1576
1609
  /**
1577
1610
  * Creates a new SuperToolbar instance
1578
1611
  * @param {ToolbarConfig} config - The configuration for the toolbar
1579
1612
  * @returns {void}
1580
1613
  */
1581
- constructor(o) {
1614
+ constructor(t) {
1582
1615
  super();
1583
- Oe(this, L);
1616
+ Re(this, I);
1584
1617
  /**
1585
1618
  * Default configuration for the toolbar
1586
1619
  * @type {ToolbarConfig}
1587
1620
  */
1588
- Re(this, "config", {
1621
+ ze(this, "config", {
1589
1622
  selector: null,
1590
1623
  toolbarGroups: ["left", "center", "right"],
1591
1624
  role: "editor",
1592
1625
  pagination: !1,
1593
- icons: { ...X },
1626
+ icons: { ...Z },
1627
+ fonts: null,
1628
+ hideButtons: !0,
1629
+ responsiveToContainer: !1,
1594
1630
  mode: "docx",
1595
1631
  excludeItems: [],
1596
1632
  groups: null,
@@ -1604,7 +1640,7 @@ class Mo extends qt {
1604
1640
  * @private
1605
1641
  * @type {Object.<string, function(CommandItem): void>}
1606
1642
  */
1607
- Oe(this, ve, {
1643
+ Re(this, fe, {
1608
1644
  /**
1609
1645
  * Handles zoom level changes
1610
1646
  * @param {Object} params - Command parameters
@@ -1612,13 +1648,13 @@ class Mo extends qt {
1612
1648
  * @param {string|number} params.argument - The zoom level (percentage)
1613
1649
  * @returns {void}
1614
1650
  */
1615
- setZoom: ({ item: o, argument: n }) => {
1651
+ setZoom: ({ item: t, argument: n }) => {
1616
1652
  if (!n) return;
1617
- o.onActivate({ zoom: n }), this.emit("superdoc-command", { item: o, argument: n });
1618
- const e = document.querySelector(this.superdoc.config.selector)?.querySelector(".layers");
1619
- if (!e) return;
1653
+ t.onActivate({ zoom: n }), this.emit("superdoc-command", { item: t, argument: n });
1654
+ const o = document.querySelector(this.superdoc.config.selector)?.querySelector(".layers");
1655
+ if (!o) return;
1620
1656
  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);
1657
+ i && c ? (o.style.transformOrigin = "0 0", o.style.transform = `scale(${parseInt(n) / 100})`) : o.style.zoom = parseInt(n) / 100, this.superdoc.superdocStore.activeZoom = parseInt(n);
1622
1658
  },
1623
1659
  /**
1624
1660
  * Sets the document mode
@@ -1627,8 +1663,8 @@ class Mo extends qt {
1627
1663
  * @param {string} params.argument - The document mode to set
1628
1664
  * @returns {void}
1629
1665
  */
1630
- setDocumentMode: ({ item: o, argument: n }) => {
1631
- n && this.emit("superdoc-command", { item: o, argument: n });
1666
+ setDocumentMode: ({ item: t, argument: n }) => {
1667
+ n && this.emit("superdoc-command", { item: t, argument: n });
1632
1668
  },
1633
1669
  /**
1634
1670
  * Sets the font size for text
@@ -1637,8 +1673,8 @@ class Mo extends qt {
1637
1673
  * @param {string|number} params.argument - The font size to set
1638
1674
  * @returns {void}
1639
1675
  */
1640
- setFontSize: ({ item: o, argument: n }) => {
1641
- z(this, L, fe).call(this, { item: o, argument: n }, () => {
1676
+ setFontSize: ({ item: t, argument: n }) => {
1677
+ N(this, I, pe).call(this, { item: t, argument: n }, () => {
1642
1678
  this.activeEditor?.commands.setFieldAnnotationsFontSize(n, !0);
1643
1679
  });
1644
1680
  },
@@ -1649,8 +1685,8 @@ class Mo extends qt {
1649
1685
  * @param {string} params.argument - The font family to set
1650
1686
  * @returns {void}
1651
1687
  */
1652
- setFontFamily: ({ item: o, argument: n }) => {
1653
- z(this, L, fe).call(this, { item: o, argument: n }, () => {
1688
+ setFontFamily: ({ item: t, argument: n }) => {
1689
+ N(this, I, pe).call(this, { item: t, argument: n }, () => {
1654
1690
  this.activeEditor?.commands.setFieldAnnotationsFontFamily(n, !0);
1655
1691
  });
1656
1692
  },
@@ -1661,8 +1697,8 @@ class Mo extends qt {
1661
1697
  * @param {string} params.argument - The color to set
1662
1698
  * @returns {void}
1663
1699
  */
1664
- setColor: ({ item: o, argument: n }) => {
1665
- z(this, L, fe).call(this, { item: o, argument: n }, () => {
1700
+ setColor: ({ item: t, argument: n }) => {
1701
+ N(this, I, pe).call(this, { item: t, argument: n }, () => {
1666
1702
  this.activeEditor?.commands.setFieldAnnotationsTextColor(n, !0);
1667
1703
  });
1668
1704
  },
@@ -1673,10 +1709,10 @@ class Mo extends qt {
1673
1709
  * @param {string} params.argument - The highlight color to set
1674
1710
  * @returns {void}
1675
1711
  */
1676
- setHighlight: ({ 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);
1712
+ setHighlight: ({ item: t, argument: n }) => {
1713
+ N(this, I, pe).call(this, { item: t, argument: n, noArgumentCallback: !0 }, () => {
1714
+ let o = n !== "none" ? n : null;
1715
+ this.activeEditor?.commands.setFieldAnnotationsTextHighlight(o, !0), this.activeEditor?.commands.setCellBackground(o);
1680
1716
  });
1681
1717
  },
1682
1718
  /**
@@ -1684,7 +1720,7 @@ class Mo extends qt {
1684
1720
  * @param {Object} [_params=null] - Command parameters (not used)
1685
1721
  * @returns {void}
1686
1722
  */
1687
- toggleRuler: (o = null) => {
1723
+ toggleRuler: (t = null) => {
1688
1724
  this.superdoc.toggleRuler();
1689
1725
  },
1690
1726
  /**
@@ -1693,12 +1729,12 @@ class Mo extends qt {
1693
1729
  * @param {Object} [_params=null - Command parameters (not used)
1694
1730
  * @returns {Promise<void>}
1695
1731
  */
1696
- startImageUpload: async (o = null) => {
1697
- let e = await ro()();
1698
- e?.file && po({
1732
+ startImageUpload: async (t = null) => {
1733
+ let o = await mo()();
1734
+ o?.file && vo({
1699
1735
  editor: this.activeEditor,
1700
1736
  view: this.activeEditor.view,
1701
- file: e.file
1737
+ file: o.file
1702
1738
  });
1703
1739
  },
1704
1740
  /**
@@ -1708,11 +1744,11 @@ class Mo extends qt {
1708
1744
  * @param {*} params.argument - Command arguments
1709
1745
  * @returns {void}
1710
1746
  */
1711
- increaseTextIndent: ({ item: o, argument: n }) => {
1712
- let e = o.command, { state: i } = this.activeEditor;
1713
- if (Ge((a) => a.type.name === "listItem")(i.selection))
1747
+ increaseTextIndent: ({ item: t, argument: n }) => {
1748
+ let o = t.command, { state: i } = this.activeEditor;
1749
+ if (Ke((a) => a.type.name === "listItem")(i.selection))
1714
1750
  return this.activeEditor.commands.increaseListIndent();
1715
- e in this.activeEditor.commands && this.activeEditor.commands[e](n);
1751
+ o in this.activeEditor.commands && this.activeEditor.commands[o](n);
1716
1752
  },
1717
1753
  /**
1718
1754
  * Decreases text indentation or list level
@@ -1721,11 +1757,11 @@ class Mo extends qt {
1721
1757
  * @param {*} params.argument - Command arguments
1722
1758
  * @returns {boolean}
1723
1759
  */
1724
- decreaseTextIndent: ({ item: o, argument: n }) => {
1725
- let e = o.command, { state: i } = this.activeEditor;
1726
- if (Ge((a) => a.type.name === "listItem")(i.selection))
1760
+ decreaseTextIndent: ({ item: t, argument: n }) => {
1761
+ let o = t.command, { state: i } = this.activeEditor;
1762
+ if (Ke((a) => a.type.name === "listItem")(i.selection))
1727
1763
  return this.activeEditor.commands.decreaseListIndent();
1728
- e in this.activeEditor.commands && this.activeEditor.commands[e](n);
1764
+ o in this.activeEditor.commands && this.activeEditor.commands[o](n);
1729
1765
  },
1730
1766
  /**
1731
1767
  * Toggles bold formatting for text
@@ -1734,9 +1770,9 @@ class Mo extends qt {
1734
1770
  * @param {*} params.argument - Command arguments
1735
1771
  * @returns {void}
1736
1772
  */
1737
- toggleBold: ({ item: o, argument: n }) => {
1738
- let e = o.command;
1739
- e in this.activeEditor.commands && (this.activeEditor.commands[e](n), this.activeEditor.commands.toggleFieldAnnotationsFormat("bold", !0)), this.updateToolbarState();
1773
+ toggleBold: ({ item: t, argument: n }) => {
1774
+ let o = t.command;
1775
+ o in this.activeEditor.commands && (this.activeEditor.commands[o](n), this.activeEditor.commands.toggleFieldAnnotationsFormat("bold", !0)), this.updateToolbarState();
1740
1776
  },
1741
1777
  /**
1742
1778
  * Toggles italic formatting for text
@@ -1745,9 +1781,9 @@ class Mo extends qt {
1745
1781
  * @param {*} params.argument - Command arguments
1746
1782
  * @returns {void}
1747
1783
  */
1748
- toggleItalic: ({ item: o, argument: n }) => {
1749
- let e = o.command;
1750
- e in this.activeEditor.commands && (this.activeEditor.commands[e](n), this.activeEditor.commands.toggleFieldAnnotationsFormat("italic", !0)), this.updateToolbarState();
1784
+ toggleItalic: ({ item: t, argument: n }) => {
1785
+ let o = t.command;
1786
+ o in this.activeEditor.commands && (this.activeEditor.commands[o](n), this.activeEditor.commands.toggleFieldAnnotationsFormat("italic", !0)), this.updateToolbarState();
1751
1787
  },
1752
1788
  /**
1753
1789
  * Toggles underline formatting for text
@@ -1756,9 +1792,9 @@ class Mo extends qt {
1756
1792
  * @param {*} params.argument - Command arguments
1757
1793
  * @returns {void}
1758
1794
  */
1759
- toggleUnderline: ({ item: o, argument: n }) => {
1760
- let e = o.command;
1761
- e in this.activeEditor.commands && (this.activeEditor.commands[e](n), this.activeEditor.commands.toggleFieldAnnotationsFormat("underline", !0)), this.updateToolbarState();
1795
+ toggleUnderline: ({ item: t, argument: n }) => {
1796
+ let o = t.command;
1797
+ o in this.activeEditor.commands && (this.activeEditor.commands[o](n), this.activeEditor.commands.toggleFieldAnnotationsFormat("underline", !0)), this.updateToolbarState();
1762
1798
  },
1763
1799
  /**
1764
1800
  * Toggles link formatting and updates cursor position
@@ -1767,11 +1803,11 @@ class Mo extends qt {
1767
1803
  * @param {*} params.argument - Command arguments
1768
1804
  * @returns {void}
1769
1805
  */
1770
- toggleLink: ({ item: o, argument: n }) => {
1771
- let e = o.command;
1772
- if (e in this.activeEditor.commands) {
1773
- this.activeEditor.commands[e](n);
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);
1806
+ toggleLink: ({ item: t, argument: n }) => {
1807
+ let o = t.command;
1808
+ if (o in this.activeEditor.commands) {
1809
+ this.activeEditor.commands[o](n);
1810
+ const { view: i } = this.activeEditor, c = i.state.selection.$to.pos, a = new Je(i.state.doc.resolve(c)), l = i.state.tr.setSelection(a), d = i.state.apply(l);
1775
1811
  i.updateState(d), setTimeout(() => {
1776
1812
  i.focus();
1777
1813
  }, 100);
@@ -1785,8 +1821,8 @@ class Mo extends qt {
1785
1821
  * @param {Object} params.argument - Table configuration
1786
1822
  * @returns {void}
1787
1823
  */
1788
- insertTable: ({ item: o, argument: n }) => {
1789
- z(this, L, fe).call(this, { item: o, argument: n });
1824
+ insertTable: ({ item: t, argument: n }) => {
1825
+ N(this, I, pe).call(this, { item: t, argument: n });
1790
1826
  },
1791
1827
  /**
1792
1828
  * Executes a table-related command
@@ -1796,70 +1832,80 @@ class Mo extends qt {
1796
1832
  * @param {string} params.argument.command - The specific table command to execute
1797
1833
  * @returns {void}
1798
1834
  */
1799
- executeTableCommand: ({ item: o, argument: n }) => {
1835
+ executeTableCommand: ({ item: t, argument: n }) => {
1800
1836
  if (!n) return;
1801
- let e = n.command;
1802
- e in this.activeEditor.commands && this.activeEditor.commands[e](n), this.updateToolbarState();
1837
+ let o = n.command;
1838
+ o in this.activeEditor.commands && this.activeEditor.commands[o](n), this.updateToolbarState();
1803
1839
  }
1804
1840
  });
1805
1841
  /**
1806
1842
  * Handler for toolbar resize events
1807
1843
  * @returns {void}
1808
1844
  */
1809
- Re(this, "onToolbarResize", () => {
1810
- z(this, L, We).call(this, this, this.config.icons, this.isDev), this.role === "viewer" && z(this, L, Pe).call(this);
1845
+ ze(this, "onToolbarResize", () => {
1846
+ N(this, I, Ve).call(this, {
1847
+ superToolbar: this,
1848
+ icons: this.config.icons,
1849
+ fonts: this.config.fonts,
1850
+ hideButtons: this.config.hideButtons,
1851
+ isDev: this.isDev
1852
+ }), this.role === "viewer" && N(this, I, Pe).call(this);
1811
1853
  });
1812
- this.config = { ...this.config, ...o }, this.toolbarItems = [], this.overflowItems = [], this.documentMode = o.documentMode || "editing", this.isDev = o.isDev || !1, this.superdoc = o.superdoc, this.role = o.role || "editor", this.config.editor && (this.config.mode = this.config.editor.options.mode), this.config.icons = {
1813
- ...X,
1814
- ...o.icons
1815
- }, !this.config.selector && this.config.element && (this.config.selector = this.config.element), z(this, L, lt).call(this), z(this, L, We).call(this, this, this.config.icons, o.isDev);
1854
+ this.config = { ...this.config, ...t }, this.toolbarItems = [], this.overflowItems = [], this.documentMode = t.documentMode || "editing", this.isDev = t.isDev || !1, this.superdoc = t.superdoc, this.role = t.role || "editor", this.toolbarContainer = null, this.config.editor && (this.config.mode = this.config.editor.options.mode), this.config.icons = {
1855
+ ...Z,
1856
+ ...t.icons
1857
+ }, this.config.hideButtons = t.hideButtons ?? !0, this.config.responsiveToContainer = t.responsiveToContainer ?? !1, !this.config.selector && this.config.element && (this.config.selector = this.config.element), this.toolbarContainer = this.getElementBySelector(this.config.selector), this.toolbarContainer && (N(this, I, lt).call(this), N(this, I, Ve).call(this, {
1858
+ superToolbar: this,
1859
+ icons: this.config.icons,
1860
+ fonts: this.config.fonts,
1861
+ hideButtons: this.config.hideButtons,
1862
+ isDev: t.isDev
1863
+ }), this.app = Wt(Ut), this.app.directive("click-outside", zt), this.app.config.globalProperties.$toolbar = this, this.toolbarContainer && (this.toolbar = this.app.mount(this.toolbarContainer)), this.activeEditor = t.editor || null, this.updateToolbarState());
1864
+ }
1865
+ getElementBySelector(t) {
1816
1866
  let n = null;
1817
- if (this.config.selector && (this.config.selector.startsWith("#") || this.config.selector.startsWith(".") ? n = document.querySelector(this.config.selector) : n = document.getElementById(this.config.selector), !n)) {
1818
- console.warn(`[super-toolbar 🎨] Element not found: ${this.config.selector}`);
1819
- return;
1820
- }
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();
1867
+ return t && (t.startsWith("#") || t.startsWith(".") ? n = document.querySelector(t) : n = document.getElementById(t), !n) ? (console.warn(`[super-toolbar 🎨] Element not found: ${t}`), null) : n;
1822
1868
  }
1823
1869
  /**
1824
1870
  * Log debug information to the console
1825
1871
  * @param {...*} args - Arguments to log
1826
1872
  * @returns {void}
1827
1873
  */
1828
- log(...o) {
1829
- console.debug("[🎨 super-toolbar]", ...o);
1874
+ log(...t) {
1875
+ console.debug("[🎨 super-toolbar]", ...t);
1830
1876
  }
1831
1877
  /**
1832
1878
  * Set the zoom level
1833
1879
  * @param {number} percent_int - The zoom percentage as an integer
1834
1880
  * @returns {void}
1835
1881
  */
1836
- setZoom(o) {
1837
- const e = [...this.toolbarItems, ...this.overflowItems].find((i) => i.name.value === "zoom");
1838
- Ae(this, ve).setZoom({ item: e, argument: o });
1882
+ setZoom(t) {
1883
+ const o = [...this.toolbarItems, ...this.overflowItems].find((i) => i.name.value === "zoom");
1884
+ Te(this, fe).setZoom({ item: o, argument: t });
1839
1885
  }
1840
1886
  /**
1841
1887
  * The toolbar expects an active Super Editor instance.
1842
1888
  * @param {Object} editor - The editor instance to attach to the toolbar
1843
1889
  * @returns {void}
1844
1890
  */
1845
- setActiveEditor(o) {
1846
- this.activeEditor = o, this.activeEditor.on("transaction", this.onEditorTransaction.bind(this));
1891
+ setActiveEditor(t) {
1892
+ this.activeEditor = t, this.activeEditor.on("transaction", this.onEditorTransaction.bind(this));
1847
1893
  }
1848
1894
  /**
1849
1895
  * Get toolbar items by group name
1850
1896
  * @param {string} groupName - The name of the group
1851
1897
  * @returns {ToolbarItem[]} An array of toolbar items in the specified group
1852
1898
  */
1853
- getToolbarItemByGroup(o) {
1854
- return this.toolbarItems.filter((n) => (n.group?.value || "center") === o);
1899
+ getToolbarItemByGroup(t) {
1900
+ return this.toolbarItems.filter((n) => (n.group?.value || "center") === t);
1855
1901
  }
1856
1902
  /**
1857
1903
  * Get a toolbar item by name
1858
1904
  * @param {string} name - The name of the toolbar item
1859
1905
  * @returns {ToolbarItem|undefined} The toolbar item with the specified name or undefined if not found
1860
1906
  */
1861
- getToolbarItemByName(o) {
1862
- return this.toolbarItems.find((n) => n.name.value === o);
1907
+ getToolbarItemByName(t) {
1908
+ return this.toolbarItems.find((n) => n.name.value === t);
1863
1909
  }
1864
1910
  /**
1865
1911
  * Update the toolbar state based on the current editor state
@@ -1867,33 +1913,33 @@ class Mo extends qt {
1867
1913
  * @returns {void}
1868
1914
  */
1869
1915
  updateToolbarState() {
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") {
1871
- z(this, L, Pe).call(this);
1916
+ if (N(this, I, dt).call(this), N(this, I, rt).call(this), N(this, I, ct).call(this), !this.activeEditor || this.documentMode === "viewing") {
1917
+ N(this, I, Pe).call(this);
1872
1918
  return;
1873
1919
  }
1874
- const o = kt(this.activeEditor), n = _t(this.activeEditor.state);
1875
- this.toolbarItems.forEach((e) => {
1876
- if (e.resetDisabled(), e.name.value === "linkedStyles")
1877
- return this.activeEditor && !Ze(this.activeEditor).length ? e.deactivate() : e.activate();
1878
- const i = o.find((l) => l.name === e.name.value);
1879
- i ? e.activate(i.attrs) : e.deactivate();
1880
- const c = o.find((l) => l.name === "styleId");
1920
+ const t = xt(this.activeEditor), n = St(this.activeEditor.state);
1921
+ this.toolbarItems.forEach((o) => {
1922
+ if (o.resetDisabled(), o.name.value === "linkedStyles")
1923
+ return this.activeEditor && !Ye(this.activeEditor).length ? o.deactivate() : o.activate();
1924
+ const i = t.find((l) => l.name === o.name.value);
1925
+ i ? o.activate(i.attrs) : o.deactivate();
1926
+ const c = t.find((l) => l.name === "styleId");
1881
1927
  if (c?.attrs.styleId) {
1882
1928
  const l = {
1883
1929
  fontSize: "font-size",
1884
1930
  fontFamily: "font-family",
1885
1931
  bold: "bold",
1886
1932
  textAlign: "textAlign"
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]]
1933
+ }, d = this.activeEditor.converter?.linkedStyles.find((u) => u.id === c.attrs.styleId);
1934
+ if (l[o.name.value] in d?.definition.styles) {
1935
+ const u = {
1936
+ [o.name.value]: d?.definition.styles[l[o.name.value]]
1891
1937
  };
1892
- e.activate(m);
1938
+ o.activate(u);
1893
1939
  }
1894
1940
  }
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);
1941
+ const a = t.find((l) => l.name === "spacing");
1942
+ o.name.value === "lineHeight" && (i?.attrs?.lineHeight || a) && (o.selectedValue.value = i?.attrs?.lineHeight || a.attrs?.spacing?.line || ""), o.name.value === "tableActions" && (o.disabled.value = !n);
1897
1943
  });
1898
1944
  }
1899
1945
  /**
@@ -1903,7 +1949,7 @@ class Mo extends qt {
1903
1949
  * @param {Object} params.transaction - The transaction object
1904
1950
  * @returns {void}
1905
1951
  */
1906
- onEditorTransaction({ editor: o, transaction: n }) {
1952
+ onEditorTransaction({ editor: t, transaction: n }) {
1907
1953
  !n.docChanged && !n.selectionSet || this.updateToolbarState();
1908
1954
  }
1909
1955
  /**
@@ -1913,94 +1959,109 @@ class Mo extends qt {
1913
1959
  * @param {*} [params.argument] - The argument passed to the command
1914
1960
  * @returns {*} The result of the executed command, undefined if no result is returned
1915
1961
  */
1916
- emitCommand({ item: o, argument: n, option: e }) {
1962
+ emitCommand({ item: t, argument: n, option: o }) {
1917
1963
  this.activeEditor?.focus();
1918
- const { command: i } = o;
1964
+ const { command: i } = t;
1919
1965
  if (i) {
1920
1966
  if (this.log("(emmitCommand) Command:", i, `
1921
- item:`, o, `
1967
+ item:`, t, `
1922
1968
  argument:`, n, `
1923
- option:`, e), i in Ae(this, ve))
1924
- return Ae(this, ve)[i]({ item: o, argument: n });
1969
+ option:`, o), i in Te(this, fe))
1970
+ return Te(this, fe)[i]({ item: t, argument: n });
1925
1971
  if (i in this.activeEditor?.commands)
1926
1972
  this.activeEditor.commands[i](n);
1927
1973
  else if (typeof i == "function")
1928
- i({ item: o, argument: n, option: e });
1974
+ i({ item: t, argument: n, option: o });
1929
1975
  else
1930
1976
  throw new Error(`[super-toolbar 🎨] Command not found: ${i}`);
1931
1977
  this.updateToolbarState();
1932
1978
  }
1933
1979
  }
1934
1980
  }
1935
- L = new WeakSet(), /**
1981
+ I = new WeakSet(), /**
1936
1982
  * Initiate toolbar groups
1937
1983
  * @private
1938
1984
  * @returns {void}
1939
1985
  */
1940
1986
  lt = function() {
1941
1987
  this.config.groups && !Array.isArray(this.config.groups) && Object.keys(this.config.groups).length && (this.config.toolbarGroups = Object.keys(this.config.groups));
1942
- }, ve = new WeakMap(), /**
1988
+ }, fe = new WeakMap(), /**
1943
1989
  * Create toolbar items based on configuration
1944
1990
  * @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
1991
+ * @param {SuperToolbar} options.superToolbar - The toolbar instance
1992
+ * @param {Object} options.icons - Icons to use for toolbar items
1993
+ * @param {Array} options.fonts - Fonts for the toolbar item
1994
+ * @param {boolean} options.isDev - Whether in development mode
1948
1995
  * @returns {void}
1949
1996
  */
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)
1997
+ Ve = function({
1998
+ superToolbar: t,
1999
+ icons: n,
2000
+ fonts: o,
2001
+ hideButtons: i,
2002
+ isDev: c = !1
2003
+ } = {}) {
2004
+ const a = document.documentElement.clientWidth, l = this.toolbarContainer.offsetWidth, d = this.config.responsiveToContainer ? l : a, { defaultItems: u, overflowItems: r } = co({
2005
+ superToolbar: t,
2006
+ toolbarIcons: n,
2007
+ toolbarFonts: o,
2008
+ hideButtons: i,
2009
+ availableWidth: d,
2010
+ role: this.role,
2011
+ isDev: c
2012
+ }), w = this.config.customButtons || [];
2013
+ w.length && u.push(...w.map((y) => x({ ...y })));
2014
+ let v = [
2015
+ ...u.map((y) => y.name.value),
2016
+ ...r.map((y) => y.name.value)
1956
2017
  ];
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));
2018
+ this.config.groups && (v = Object.values(this.config.groups).flatMap((y) => y));
2019
+ const b = u.filter((y) => v.includes(y.name.value)).filter((y) => !this.config.excludeItems.includes(y.name.value));
2020
+ this.toolbarItems = b, this.overflowItems = r.filter((y) => v.includes(y.name.value));
1960
2021
  }, /**
1961
2022
  * Initialize default fonts from the editor
1962
2023
  * @private
1963
2024
  * @returns {void}
1964
2025
  */
1965
- at = function() {
2026
+ rt = function() {
1966
2027
  if (!this.activeEditor || !this.activeEditor.converter) return;
1967
- const { typeface: o = "Arial", fontSizePt: n = 12 } = this.activeEditor.converter.getDocumentDefaultStyles() ?? {}, e = this.toolbarItems.find((c) => c.name.value === "fontSize");
1968
- e && (e.defaultLabel.value = n);
2028
+ const { typeface: t = "Arial", fontSizePt: n = 12 } = this.activeEditor.converter.getDocumentDefaultStyles() ?? {}, o = this.toolbarItems.find((c) => c.name.value === "fontSize");
2029
+ o && (o.defaultLabel.value = n);
1969
2030
  const i = this.toolbarItems.find((c) => c.name.value === "fontFamily");
1970
- i && (i.defaultLabel.value = o);
2031
+ i && (i.defaultLabel.value = t);
1971
2032
  }, /**
1972
2033
  * Update highlight color options based on document colors
1973
2034
  * @private
1974
2035
  * @returns {void}
1975
2036
  */
1976
- rt = function() {
2037
+ ct = function() {
1977
2038
  if (!this.activeEditor || !this.activeEditor.converter || !this.activeEditor.converter.docHiglightColors.size) return;
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;
2039
+ const t = this.toolbarItems.find((a) => a.name.value === "highlight"), n = Pn(), o = 7, i = Array.from(this.activeEditor.converter.docHiglightColors).reduce((a, l, d) => {
2040
+ const u = Math.floor(d / o);
2041
+ return a[u] || (a[u] = []), n.includes(l) || a[u].push(f(l)), a;
1981
2042
  }, []), c = {
1982
2043
  key: "color",
1983
2044
  type: "render",
1984
- render: () => Ve(this, o, i, !0)
2045
+ render: () => We(this, t, i, !0)
1985
2046
  };
1986
- o.nestedOptions.value = [c];
2047
+ t.nestedOptions.value = [c];
1987
2048
  }, /**
1988
2049
  * Deactivate all toolbar items
1989
2050
  * @private
1990
2051
  * @returns {void}
1991
2052
  */
1992
2053
  Pe = function() {
1993
- this.activeEditor = null, this.toolbarItems.forEach((o) => {
1994
- const { allowWithoutEditor: n } = o;
1995
- n.value || o.setDisabled(!0);
2054
+ this.activeEditor = null, this.toolbarItems.forEach((t) => {
2055
+ const { allowWithoutEditor: n } = t;
2056
+ n.value || t.setDisabled(!0);
1996
2057
  });
1997
2058
  }, /**
1998
2059
  * Update undo/redo history state in the toolbar
1999
2060
  * @private
2000
2061
  * @returns {void}
2001
2062
  */
2002
- ct = function() {
2003
- this.activeEditor && (this.undoDepth = xt(this.activeEditor.state), this.redoDepth = Et(this.activeEditor.state));
2063
+ dt = function() {
2064
+ this.activeEditor && (this.undoDepth = Et(this.activeEditor.state), this.redoDepth = At(this.activeEditor.state));
2004
2065
  }, /**
2005
2066
  * Run a command that requires an argument
2006
2067
  * @private
@@ -2011,48 +2072,48 @@ ct = function() {
2011
2072
  * @param {Function} [callback] - Optional callback to run after the command
2012
2073
  * @returns {void}
2013
2074
  */
2014
- fe = function({ item: o, argument: n, noArgumentCallback: e = !1 }, i) {
2075
+ pe = function({ item: t, argument: n, noArgumentCallback: o = !1 }, i) {
2015
2076
  if (!n || !this.activeEditor) return;
2016
- let c = o.command;
2017
- const a = o.noArgumentCommand;
2077
+ let c = t.command;
2078
+ const a = t.noArgumentCommand;
2018
2079
  if (n === "none" && a in this.activeEditor?.commands) {
2019
- this.activeEditor.commands[a](), typeof i == "function" && e && i(n), this.updateToolbarState();
2080
+ this.activeEditor.commands[a](), typeof i == "function" && o && i(n), this.updateToolbarState();
2020
2081
  return;
2021
2082
  }
2022
2083
  c in this.activeEditor?.commands && (this.activeEditor.commands[c](n), typeof i == "function" && i(n), this.updateToolbarState());
2023
2084
  };
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");
2085
+ function go(e, s) {
2086
+ if (!e.value || !s?.value?.options?.scale) return;
2087
+ const t = s.value.options.scale, n = e.value.getBoundingClientRect(), o = e.value.querySelectorAll(".pagination-break-wrapper");
2027
2088
  let i;
2028
- e.forEach((c) => {
2029
- const l = (c.getBoundingClientRect().left - n.left) / o * -1 + 1;
2089
+ o.forEach((c) => {
2090
+ const l = (c.getBoundingClientRect().left - n.left) / t * -1 + 1;
2030
2091
  if (i || (i = l), l !== i) {
2031
2092
  const d = l - i;
2032
2093
  c.style.transform = `translateX(${d}px)`;
2033
2094
  }
2034
2095
  });
2035
2096
  }
2036
- const fo = (t, r) => {
2037
- const o = t.clientY, n = t.clientX, { view: e } = r, i = e.dom.getBoundingClientRect();
2097
+ const bo = (e, s) => {
2098
+ const t = e.clientY, n = e.clientX, { view: o } = s, i = o.dom.getBoundingClientRect();
2038
2099
  let c = {
2039
2100
  left: 0,
2040
- top: o
2101
+ top: t
2041
2102
  }, a = !1;
2042
2103
  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;
2104
+ const l = o.posAtCoords(c)?.pos;
2044
2105
  if (l) {
2045
2106
  let d = l;
2046
2107
  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;
2108
+ const w = o.state.doc.resolve(l).textOffset, v = o.state.doc.nodeAt(l), y = v?.text?.charAt(w);
2109
+ d = v?.isText && y !== " " ? l - 1 : l;
2049
2110
  }
2050
- const m = e.state.tr.setSelection(
2051
- Ye.create(e.state.doc, d)
2111
+ const u = o.state.tr.setSelection(
2112
+ Je.create(o.state.doc, d)
2052
2113
  );
2053
- e.dispatch(m), e.focus();
2114
+ o.dispatch(u), o.focus();
2054
2115
  }
2055
- }, vo = { class: "numbering" }, Te = 200, go = "flex-end", yo = {
2116
+ }, yo = { class: "numbering" }, Fe = 200, wo = "flex-end", Co = {
2056
2117
  __name: "Ruler",
2057
2118
  props: {
2058
2119
  orientation: {
@@ -2069,116 +2130,116 @@ const fo = (t, r) => {
2069
2130
  }
2070
2131
  },
2071
2132
  emits: ["margin-change"],
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);
2133
+ setup(e, { emit: s }) {
2134
+ const t = s, n = e, o = h(null), i = h([]), c = h("#CCCCCC"), a = h("#2563EB66"), l = h(null), d = h(null), u = h(!1), r = h(null), w = Xe({ side: "left", x: 0 }), v = Xe({ side: "right", x: 0 }), b = h(!1), y = h(0);
2074
2135
  let g = 0;
2075
- const F = () => {
2136
+ const L = () => {
2076
2137
  if (n.editor.options.mode !== "docx") return;
2077
- const I = [], { pageMargins: M, pageSize: H } = n.editor.getPageStyles();
2078
- l.value = H, d.value = M, v.x = H.width * 96 - M.right * 96, b.x = M.left * 96;
2079
- for (let R = 0; R < H.width; R++) {
2080
- const K = `${5.5}px`, ce = H.width - R;
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;
2082
- I.push(...$(3, "eighth", "10%", K));
2138
+ const T = [], { pageMargins: B, pageSize: H } = n.editor.getPageStyles();
2139
+ l.value = H, d.value = B, v.x = H.width * 96 - B.right * 96, w.x = B.left * 96;
2140
+ for (let z = 0; z < H.width; z++) {
2141
+ const K = `${5.5}px`, ce = H.width - z;
2142
+ if (T.push(...D(1, "main", "20%", K, z)), T.push(...D(3, "eighth", "10%", K)), T.push(...D(1, "half", "40%", K)), ce <= 0.5) break;
2143
+ T.push(...D(3, "eighth", "10%", K));
2083
2144
  }
2084
- return I;
2085
- }, $ = (I, M, H, R, G) => Array.from({ length: I }, (K, ce) => {
2086
- const ue = {
2087
- className: `${M}-unit ruler-section`,
2145
+ return T;
2146
+ }, D = (T, B, H, z, G) => Array.from({ length: T }, (K, ce) => {
2147
+ const se = {
2148
+ className: `${B}-unit ruler-section`,
2088
2149
  height: H,
2089
- margin: R
2150
+ margin: z
2090
2151
  };
2091
- return G !== void 0 && (ue.numbering = G), ue;
2092
- }), p = j(() => (I) => ({
2152
+ return G !== void 0 && (se.numbering = G), se;
2153
+ }), p = j(() => (T) => ({
2093
2154
  width: "1px",
2094
2155
  minWidth: "1px",
2095
2156
  maxWidth: "1px",
2096
- height: I.height,
2097
- backgroundColor: I.color || "#666",
2098
- marginLeft: I.numbering === 0 ? null : I.margin,
2099
- marginRight: I.margin
2100
- })), x = j(() => (I) => ({
2101
- left: `${(I === "left" ? b : v).x}px`
2102
- })), T = j(() => {
2103
- if (!e.value) return;
2104
- const H = e.value.parentElement.querySelector(".super-editor").getBoundingClientRect();
2157
+ height: T.height,
2158
+ backgroundColor: T.color || "#666",
2159
+ marginLeft: T.numbering === 0 ? null : T.margin,
2160
+ marginRight: T.margin
2161
+ })), S = j(() => (T) => ({
2162
+ left: `${(T === "left" ? w : v).x}px`
2163
+ })), F = j(() => {
2164
+ if (!o.value) return;
2165
+ const H = o.value.parentElement.querySelector(".super-editor").getBoundingClientRect();
2105
2166
  return {
2106
- left: `${s.value.x}px`,
2167
+ left: `${r.value.x}px`,
2107
2168
  minHeight: `${H.height}px`
2108
2169
  };
2109
- }), N = (I) => {
2110
- m.value = !0, ye();
2111
- const M = I.currentTarget.id;
2112
- s.value = M === "left-margin-handle" ? b : v, E.value = s.value.x, g = I.clientX - s.value.x, y.value = !0;
2113
- }, V = (I) => {
2114
- if (!m.value) return;
2115
- const M = I.clientX - g;
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);
2117
- }, te = () => {
2118
- if (m.value = !1, y.value = !1, Z(), s.value && s.value.x !== E.value) {
2119
- const I = re();
2120
- o("margin-change", {
2121
- side: s.value.side,
2122
- value: I
2170
+ }), O = (T) => {
2171
+ u.value = !0, ue();
2172
+ const B = T.currentTarget.id;
2173
+ r.value = B === "left-margin-handle" ? w : v, y.value = r.value.x, g = T.clientX - r.value.x, b.value = !0;
2174
+ }, W = (T) => {
2175
+ if (!u.value) return;
2176
+ const B = T.clientX - g;
2177
+ r.value.x = B, r.value.side === "left" ? B <= 0 ? r.value.x = 0 : B >= v.x - Fe && (r.value.x = v.x - Fe) : B >= l.value.width * 96 ? r.value.x = l.value.width * 96 : B <= w.x + Fe && (r.value.x = w.x + Fe);
2178
+ }, ne = () => {
2179
+ if (u.value = !1, b.value = !1, ve(), r.value && r.value.x !== y.value) {
2180
+ const T = ge();
2181
+ t("margin-change", {
2182
+ side: r.value.side,
2183
+ value: T
2123
2184
  });
2124
2185
  }
2125
- }, ye = () => {
2186
+ }, ue = () => {
2126
2187
  c.value = a.value;
2127
- }, Z = () => {
2188
+ }, ve = () => {
2128
2189
  c.value = "#CCC";
2129
- }, re = () => s.value.side === "left" ? s.value.x / 96 : (l.value.width * 96 - s.value.x) / 96, be = j(() => ({
2130
- "--alignment": go,
2190
+ }, ge = () => r.value.side === "left" ? r.value.x / 96 : (l.value.width * 96 - r.value.x) / 96, Y = j(() => ({
2191
+ "--alignment": wo,
2131
2192
  "--ruler-handle-color": c.value,
2132
2193
  "--ruler-handle-active-color": a.value
2133
2194
  }));
2134
- return ke(() => {
2135
- i.value = F(), window.addEventListener("mousemove", V), window.addEventListener("mouseup", te);
2136
- }), zt(() => {
2137
- window.removeEventListener("mousemove", V), window.removeEventListener("mouseup", te);
2138
- }), (I, M) => (w(), C("div", {
2195
+ return Ce(() => {
2196
+ i.value = L(), window.addEventListener("mousemove", W), window.addEventListener("mouseup", ne);
2197
+ }), Vt(() => {
2198
+ window.removeEventListener("mousemove", W), window.removeEventListener("mouseup", ne);
2199
+ }), (T, B) => (C(), k("div", {
2139
2200
  class: "ruler",
2140
2201
  ref_key: "ruler",
2141
- ref: e,
2142
- style: J(be.value)
2202
+ ref: o,
2203
+ style: Q(Y.value)
2143
2204
  }, [
2144
- k("div", {
2205
+ _("div", {
2145
2206
  class: "margin-handle handle-left",
2146
2207
  id: "left-margin-handle",
2147
- onMousedown: N,
2148
- style: J(x.value("left"))
2208
+ onMousedown: O,
2209
+ style: Q(S.value("left"))
2149
2210
  }, null, 36),
2150
- k("div", {
2211
+ _("div", {
2151
2212
  class: "margin-handle handle-right",
2152
2213
  id: "right-margin-handle",
2153
- onMousedown: N,
2154
- style: J(x.value("right"))
2214
+ onMousedown: O,
2215
+ style: Q(S.value("right"))
2155
2216
  }, null, 36),
2156
- y.value ? (w(), C("div", {
2217
+ b.value ? (C(), k("div", {
2157
2218
  key: 0,
2158
2219
  class: "vertical-indicator",
2159
- style: J(T.value)
2160
- }, null, 4)) : Q("", !0),
2161
- (w(!0), C(U, null, ee(i.value, (H) => (w(), C("div", {
2220
+ style: Q(F.value)
2221
+ }, null, 4)) : ee("", !0),
2222
+ (C(!0), k(U, null, te(i.value, (H) => (C(), k("div", {
2162
2223
  class: oe(H.className),
2163
- style: J(p.value(H))
2224
+ style: Q(p.value(H))
2164
2225
  }, [
2165
- k("div", vo, ie(H.numbering), 1),
2166
- (w(!0), C(U, null, ee(H.elements, (R) => (w(), C("div", {
2167
- class: oe(R.className),
2168
- style: J(p.value(R))
2226
+ _("div", yo, ie(H.numbering), 1),
2227
+ (C(!0), k(U, null, te(H.elements, (z) => (C(), k("div", {
2228
+ class: oe(z.className),
2229
+ style: Q(p.value(z))
2169
2230
  }, [
2170
- (w(!0), C(U, null, ee(R.elements, (G) => (w(), C("div", {
2231
+ (C(!0), k(U, null, te(z.elements, (G) => (C(), k("div", {
2171
2232
  class: oe(G.className),
2172
- style: J(p.value(G))
2233
+ style: Q(p.value(G))
2173
2234
  }, null, 6))), 256))
2174
2235
  ], 6))), 256))
2175
2236
  ], 6))), 256))
2176
2237
  ], 4));
2177
2238
  }
2178
- }, bo = /* @__PURE__ */ q(yo, [["__scopeId", "data-v-ad77036c"]]), wo = { class: "super-editor-container" }, Co = {
2239
+ }, ko = /* @__PURE__ */ q(Co, [["__scopeId", "data-v-ad77036c"]]), _o = { class: "super-editor-container" }, xo = {
2179
2240
  key: 1,
2180
2241
  class: "placeholder-editor"
2181
- }, ko = { class: "placeholder-title" }, _o = {
2242
+ }, So = { class: "placeholder-title" }, Eo = {
2182
2243
  __name: "SuperEditor",
2183
2244
  props: {
2184
2245
  documentId: {
@@ -2207,40 +2268,40 @@ const fo = (t, r) => {
2207
2268
  "comments-loaded",
2208
2269
  "selection-update"
2209
2270
  ],
2210
- setup(t, { emit: r }) {
2211
- const o = r, n = t, e = f(!1), i = nt(null), c = f(null), a = f(null);
2271
+ setup(e, { emit: s }) {
2272
+ const t = s, n = e, o = h(!1), i = ot(null), c = h(null), a = h(null);
2212
2273
  let l;
2213
2274
  const d = () => {
2214
2275
  clearTimeout(l);
2215
- }, m = (p, x = 10, T = 500) => {
2216
- const N = p.getMap("meta"), V = () => {
2217
- const te = N.get("docx");
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.");
2276
+ }, u = (p, S = 10, F = 500) => {
2277
+ const O = p.getMap("meta"), W = () => {
2278
+ const ne = O.get("docx");
2279
+ ne ? (d(), b({ content: ne })) : S > 0 ? (console.debug(`Waiting for 'docx' data... retries left: ${S}`), l = setTimeout(W, F), S--) : console.warn("Failed to load docx data from meta map.");
2219
2280
  };
2220
- V();
2221
- }, s = async () => {
2281
+ W();
2282
+ }, r = async () => {
2222
2283
  try {
2223
- const [p, x, T, N] = await ze.loadXmlData(n.fileSource);
2224
- return { content: p, media: x, mediaFiles: T, fonts: N };
2284
+ const [p, S, F, O] = await Ne.loadXmlData(n.fileSource);
2285
+ return { content: p, media: S, mediaFiles: F, fonts: O };
2225
2286
  } catch (p) {
2226
2287
  console.debug("Error loading new file data:", p);
2227
2288
  }
2228
- }, b = async () => {
2289
+ }, w = async () => {
2229
2290
  if (n.fileSource) {
2230
- const p = await s();
2231
- return y(p);
2291
+ const p = await r();
2292
+ return b(p);
2232
2293
  } else if (n.options.ydoc && n.options.collaborationProvider) {
2233
2294
  delete n.options.content;
2234
- const p = n.options.ydoc, x = n.options.collaborationProvider, T = () => {
2235
- m(p), x.off("synced", T);
2295
+ const p = n.options.ydoc, S = n.options.collaborationProvider, F = () => {
2296
+ u(p), S.off("synced", F);
2236
2297
  };
2237
- x.on("synced", T);
2298
+ S.on("synced", F);
2238
2299
  }
2239
2300
  }, v = () => {
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 = {} } = {}) => {
2243
- i.value = new ze({
2301
+ const p = Tt();
2302
+ return n.options.pagination ? p : p.filter((S) => S.name !== "pagination");
2303
+ }, b = async ({ content: p, media: S = {}, mediaFiles: F = {}, fonts: O = {} } = {}) => {
2304
+ i.value = new Ne({
2244
2305
  mode: "docx",
2245
2306
  element: a.value,
2246
2307
  fileSource: n.fileSource,
@@ -2248,115 +2309,115 @@ const fo = (t, r) => {
2248
2309
  externalExtensions: n.options.externalExtensions,
2249
2310
  documentId: n.documentId,
2250
2311
  content: p,
2251
- media: x,
2252
- mediaFiles: T,
2253
- fonts: N,
2312
+ media: S,
2313
+ mediaFiles: F,
2314
+ fonts: O,
2254
2315
  ...n.options
2255
2316
  }), i.value.on("paginationUpdate", () => {
2256
- ho(a, i);
2317
+ go(a, i);
2257
2318
  }), i.value.on("collaborationReady", () => {
2258
2319
  setTimeout(() => {
2259
- e.value = !0;
2320
+ o.value = !0;
2260
2321
  }, 150);
2261
2322
  });
2262
- }, E = (p) => {
2263
- o("editor-keydown", { editor: i.value });
2323
+ }, y = (p) => {
2324
+ t("editor-keydown", { editor: i.value });
2264
2325
  }, g = (p) => {
2265
- o("editor-click", { editor: i.value });
2266
- let x = a.value?.querySelector(".ProseMirror");
2267
- if (!x || !i.value)
2326
+ t("editor-click", { editor: i.value });
2327
+ let S = a.value?.querySelector(".ProseMirror");
2328
+ if (!S || !i.value)
2268
2329
  return;
2269
- !x.contains(p.target) && i.value.isEditable && i.value.view?.focus();
2330
+ !S.contains(p.target) && i.value.isEditable && i.value.view?.focus();
2270
2331
  };
2271
- ke(() => {
2272
- b(), (n.options?.suppressSkeletonLoader || !n.options?.collaborationProvider) && (e.value = !0);
2332
+ Ce(() => {
2333
+ w(), (n.options?.suppressSkeletonLoader || !n.options?.collaborationProvider) && (o.value = !0);
2273
2334
  });
2274
- const F = (p) => {
2275
- p.target.classList.contains("ProseMirror") || fo(p, i.value);
2276
- }, $ = ({ side: p, value: x }) => {
2335
+ const L = (p) => {
2336
+ p.target.classList.contains("ProseMirror") || bo(p, i.value);
2337
+ }, D = ({ side: p, value: S }) => {
2277
2338
  if (!i.value) return;
2278
- const T = i.value.getPageStyles(), { pageMargins: N } = T, V = { ...N, [p]: x };
2279
- i.value?.updatePageStyle({ pageMargins: V });
2339
+ const F = i.value.getPageStyles(), { pageMargins: O } = F, W = { ...O, [p]: S };
2340
+ i.value?.updatePageStyle({ pageMargins: W });
2280
2341
  };
2281
- return ot(() => {
2342
+ return it(() => {
2282
2343
  d(), i.value?.destroy(), i.value = null;
2283
- }), (p, x) => (w(), C("div", wo, [
2284
- t.options.rulers && i.value ? (w(), Vt(bo, {
2344
+ }), (p, S) => (C(), k("div", _o, [
2345
+ e.options.rulers && i.value ? (C(), Pt(ko, {
2285
2346
  key: 0,
2286
2347
  class: "ruler",
2287
2348
  editor: i.value,
2288
- onMarginChange: $
2289
- }, null, 8, ["editor"])) : Q("", !0),
2290
- k("div", {
2349
+ onMarginChange: D
2350
+ }, null, 8, ["editor"])) : ee("", !0),
2351
+ _("div", {
2291
2352
  class: "super-editor",
2292
2353
  ref_key: "editorWrapper",
2293
2354
  ref: c,
2294
- onKeydown: E,
2355
+ onKeydown: y,
2295
2356
  onClick: g,
2296
- onMousedown: F
2357
+ onMousedown: L
2297
2358
  }, [
2298
- k("div", {
2359
+ _("div", {
2299
2360
  ref_key: "editorElem",
2300
2361
  ref: a,
2301
2362
  class: "editor-element super-editor__element"
2302
2363
  }, null, 512)
2303
2364
  ], 544),
2304
- e.value ? Q("", !0) : (w(), C("div", Co, [
2305
- k("div", ko, [
2306
- P(D(Y), {
2365
+ o.value ? ee("", !0) : (C(), k("div", xo, [
2366
+ _("div", So, [
2367
+ P(M(J), {
2307
2368
  text: "",
2308
2369
  style: { width: "60%" }
2309
2370
  })
2310
2371
  ]),
2311
- P(D(Y), {
2372
+ P(M(J), {
2312
2373
  text: "",
2313
2374
  repeat: 6
2314
2375
  }),
2315
- P(D(Y), {
2376
+ P(M(J), {
2316
2377
  text: "",
2317
2378
  style: { width: "60%" }
2318
2379
  }),
2319
- P(D(Y), {
2380
+ P(M(J), {
2320
2381
  text: "",
2321
2382
  repeat: 6,
2322
2383
  style: { width: "30%", display: "block", margin: "20px" }
2323
2384
  }),
2324
- P(D(Y), {
2385
+ P(M(J), {
2325
2386
  text: "",
2326
2387
  style: { width: "60%" }
2327
2388
  }),
2328
- P(D(Y), {
2389
+ P(M(J), {
2329
2390
  text: "",
2330
2391
  repeat: 5
2331
2392
  }),
2332
- P(D(Y), {
2393
+ P(M(J), {
2333
2394
  text: "",
2334
2395
  style: { width: "30%" }
2335
2396
  }),
2336
- P(D(Y), {
2397
+ P(M(J), {
2337
2398
  text: "",
2338
2399
  style: { "margin-top": "50px" }
2339
2400
  }),
2340
- P(D(Y), {
2401
+ P(M(J), {
2341
2402
  text: "",
2342
2403
  repeat: 6
2343
2404
  }),
2344
- P(D(Y), {
2405
+ P(M(J), {
2345
2406
  text: "",
2346
2407
  style: { width: "70%" }
2347
2408
  })
2348
2409
  ]))
2349
2410
  ]));
2350
2411
  }
2351
- }, Do = /* @__PURE__ */ q(_o, [["__scopeId", "data-v-ff8f86f4"]]), $o = {
2412
+ }, $o = /* @__PURE__ */ q(Eo, [["__scopeId", "data-v-ff8f86f4"]]), zo = {
2352
2413
  __name: "BasicUpload",
2353
2414
  emits: ["file-change"],
2354
- setup(t, { emit: r }) {
2355
- const o = r, n = (e) => {
2356
- o("file-change", e.target.files[0]);
2415
+ setup(e, { emit: s }) {
2416
+ const t = s, n = (o) => {
2417
+ t("file-change", o.target.files[0]);
2357
2418
  };
2358
- return (e, i) => (w(), C("div", null, [
2359
- k("input", {
2419
+ return (o, i) => (C(), k("div", null, [
2420
+ _("input", {
2360
2421
  type: "file",
2361
2422
  id: "fileInput",
2362
2423
  onChange: n,
@@ -2364,7 +2425,7 @@ const fo = (t, r) => {
2364
2425
  }, null, 32)
2365
2426
  ]));
2366
2427
  }
2367
- }, xo = ["innerHTML"], Eo = {
2428
+ }, Ao = ["innerHTML"], To = {
2368
2429
  __name: "SuperInput",
2369
2430
  props: {
2370
2431
  modelValue: {
@@ -2387,75 +2448,75 @@ const fo = (t, r) => {
2387
2448
  }
2388
2449
  },
2389
2450
  emits: ["update:modelValue", "focus", "blur"],
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({
2451
+ setup(e, { emit: s }) {
2452
+ const t = s, n = e, o = ot(), i = h(null), c = h(!1), a = ({ editor: v, transaction: b }) => {
2453
+ const y = v.getHTML();
2454
+ t("update:modelValue", y);
2455
+ }, l = ({ editor: v, transaction: b }) => {
2456
+ c.value = !0, w(), t("focus", { editor: v, transaction: b });
2457
+ }, d = ({ editor: v, transaction: b }) => {
2458
+ c.value = !1, t("blur", { editor: v, transaction: b });
2459
+ }, u = async () => {
2460
+ Ft.options.placeholder = n.placeholder || "Type something...", n.options.onTransaction = a, n.options.onFocus = l, n.options.onBlur = d, o.value = new Ne({
2400
2461
  mode: "text",
2401
2462
  content: document.getElementById("currentContent"),
2402
2463
  element: i.value,
2403
- extensions: Tt(),
2464
+ extensions: It(),
2404
2465
  users: n.users,
2405
2466
  ...n.options
2406
2467
  });
2407
- }, s = () => {
2408
- c.value = !0, e.value?.view?.focus();
2409
- }, b = () => {
2410
- e.value?.setOptions({ users: n.users });
2468
+ }, r = () => {
2469
+ c.value = !0, o.value?.view?.focus();
2470
+ }, w = () => {
2471
+ o.value?.setOptions({ users: n.users });
2411
2472
  };
2412
- return ke(() => {
2413
- m();
2414
- }), ot(() => {
2415
- e.value?.destroy(), e.value = null;
2416
- }), (v, y) => (w(), C("div", {
2473
+ return Ce(() => {
2474
+ u();
2475
+ }), it(() => {
2476
+ o.value?.destroy(), o.value = null;
2477
+ }), (v, b) => (C(), k("div", {
2417
2478
  class: oe(["super-editor super-input", { "super-input-active": c.value }]),
2418
- onClick: ge(s, ["stop", "prevent"])
2479
+ onClick: he(r, ["stop", "prevent"])
2419
2480
  }, [
2420
- k("div", {
2481
+ _("div", {
2421
2482
  id: "currentContent",
2422
2483
  style: { display: "none" },
2423
- innerHTML: t.modelValue
2424
- }, null, 8, xo),
2425
- k("div", {
2484
+ innerHTML: e.modelValue
2485
+ }, null, 8, Ao),
2486
+ _("div", {
2426
2487
  ref_key: "editorElem",
2427
2488
  ref: i,
2428
2489
  class: "editor-element super-editor__element"
2429
2490
  }, null, 512)
2430
2491
  ], 2));
2431
2492
  }
2432
- }, Ho = /* @__PURE__ */ q(Eo, [["__scopeId", "data-v-4d5cff52"]]), Bo = {
2433
- Node: Mt,
2434
- Attribute: Lt,
2435
- Extension: It,
2436
- Plugin: Bt,
2437
- Mark: Ft
2493
+ }, Ro = /* @__PURE__ */ q(To, [["__scopeId", "data-v-4d5cff52"]]), Oo = {
2494
+ Node: Bt,
2495
+ Attribute: Dt,
2496
+ Extension: Mt,
2497
+ Plugin: Rt,
2498
+ Mark: Lt
2438
2499
  };
2439
2500
  export {
2440
- jt as AIWriter,
2441
- $o as BasicUpload,
2442
- No as CommentsPluginKey,
2443
- Ko as DocxZipper,
2444
- ze as Editor,
2445
- Bo as Extensions,
2446
- qo as SuperConverter,
2447
- Do as SuperEditor,
2448
- Ho as SuperInput,
2449
- Mo as SuperToolbar,
2450
- Pt as Toolbar,
2451
- zo as TrackChangesBasePluginKey,
2452
- Zo as createZip,
2453
- Vo as fieldAnnotationHelpers,
2454
- kt as getActiveFormatting,
2455
- mo as getAllowedImageDimensions,
2456
- Wo as getMarksFromSelection,
2457
- Tt as getRichTextExtensions,
2458
- St as getStarterExtensions,
2459
- Po as helpers,
2460
- jo as trackChangesHelpers
2501
+ qt as AIWriter,
2502
+ zo as BasicUpload,
2503
+ Vo as CommentsPluginKey,
2504
+ Yo as DocxZipper,
2505
+ Ne as Editor,
2506
+ Oo as Extensions,
2507
+ Xo as SuperConverter,
2508
+ $o as SuperEditor,
2509
+ Ro as SuperInput,
2510
+ Ho as SuperToolbar,
2511
+ Ut as Toolbar,
2512
+ Po as TrackChangesBasePluginKey,
2513
+ Qo as createZip,
2514
+ jo as fieldAnnotationHelpers,
2515
+ xt as getActiveFormatting,
2516
+ ho as getAllowedImageDimensions,
2517
+ Uo as getMarksFromSelection,
2518
+ It as getRichTextExtensions,
2519
+ Tt as getStarterExtensions,
2520
+ qo as helpers,
2521
+ Go as trackChangesHelpers
2461
2522
  };