@harbour-enterprises/superdoc 0.10.22 → 0.10.23

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