@harbour-enterprises/superdoc 0.10.34 → 0.10.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/dist/chunks/{super-editor.es-mU7XJaA2.cjs → super-editor.es-Br9TPTha.cjs} +5 -5
  2. package/dist/chunks/{super-editor.es-C8dsGkpp.es.js → super-editor.es-DJLcTCbA.es.js} +64 -45
  3. package/dist/super-editor/ai-writer.es.js +1 -1
  4. package/dist/super-editor/chunks/{converter-BoD3UL-D.js → converter-Dy0wP6Ge.js} +7 -6
  5. package/dist/super-editor/chunks/{docx-zipper-CdQcoemq.js → docx-zipper-CRYSc8LJ.js} +1 -1
  6. package/dist/super-editor/chunks/{editor-BOOEq-l-.js → editor-8EFMn0gI.js} +40 -37
  7. package/dist/super-editor/chunks/{toolbar-MODX2iiO.js → toolbar-Bz666WFS.js} +2 -2
  8. package/dist/super-editor/components/toolbar/super-toolbar.d.ts.map +1 -1
  9. package/dist/super-editor/converter.es.js +1 -1
  10. package/dist/super-editor/core/super-converter/helpers.d.ts +5 -1
  11. package/dist/super-editor/core/super-converter/helpers.d.ts.map +1 -1
  12. package/dist/super-editor/core/super-converter/v2/importer/listImporter.d.ts.map +1 -1
  13. package/dist/super-editor/docx-zipper.es.js +2 -2
  14. package/dist/super-editor/editor.es.js +3 -3
  15. package/dist/super-editor/extensions/line-height/line-height.d.ts.map +1 -1
  16. package/dist/super-editor/extensions/linked-styles/linked-styles.d.ts +2 -5
  17. package/dist/super-editor/extensions/linked-styles/linked-styles.d.ts.map +1 -1
  18. package/dist/super-editor/file-zipper.es.js +1 -1
  19. package/dist/super-editor/super-editor.es.js +396 -381
  20. package/dist/super-editor/toolbar.es.js +2 -2
  21. package/dist/super-editor.cjs +1 -1
  22. package/dist/super-editor.es.js +5 -5
  23. package/dist/superdoc.cjs +2 -2
  24. package/dist/superdoc.es.js +3 -3
  25. package/dist/superdoc.umd.js +421 -402
  26. package/dist/superdoc.umd.js.map +1 -1
  27. package/package.json +1 -1
@@ -2,142 +2,142 @@ var ut = Object.defineProperty;
2
2
  var Ve = (t) => {
3
3
  throw TypeError(t);
4
4
  };
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-BOOEq-l-.js";
10
- import { C as To, T as Fo, l as Io, n as Lo, k as Mo, m as Do } from "./chunks/editor-BOOEq-l-.js";
11
- import { a1 as St, y as At, a3 as Tt, T as Xe, a as Ft } from "./chunks/converter-BoD3UL-D.js";
12
- import { O as Ho } from "./chunks/converter-BoD3UL-D.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-MODX2iiO.js";
5
+ var mt = (t, l, o) => l in t ? ut(t, l, { enumerable: !0, configurable: !0, writable: !0, value: o }) : t[l] = o;
6
+ var He = (t, l, o) => mt(t, typeof l != "symbol" ? l + "" : l, o), je = (t, l, o) => l.has(t) || Ve("Cannot " + o);
7
+ var Se = (t, l, o) => (je(t, l, "read from private field"), o ? o.call(t) : l.get(t)), Be = (t, l, o) => l.has(t) ? Ve("Cannot add the same private member more than once") : l instanceof WeakSet ? l.add(t) : l.set(t, o);
8
+ var W = (t, l, o) => (je(t, l, "access private method"), o);
9
+ import { _ as K, a as Ke, b as pt, I as Re, f as ft, c as Ue, d as ht, i as vt, u as gt, r as yt, E as Oe, e as bt, P as kt, h as wt, M as Ct, j as _t, A as xt, N as Et } from "./chunks/editor-8EFMn0gI.js";
10
+ import { C as To, T as Fo, l as Io, n as Lo, k as Mo, m as Do } from "./chunks/editor-8EFMn0gI.js";
11
+ import { a1 as St, y as At, a3 as Tt, T as Xe, a as Ft } from "./chunks/converter-Dy0wP6Ge.js";
12
+ import { O as Ho } from "./chunks/converter-Dy0wP6Ge.js";
13
+ import { ref as g, createElementBlock as w, openBlock as k, createElementVNode as x, unref as $, getCurrentInstance as It, computed as j, watch as Lt, onMounted as we, createCommentVNode as ne, withDirectives as Mt, withKeys as Dt, normalizeClass as oe, withModifiers as ke, vModelText as $t, createTextVNode as Ht, toDisplayString as ie, Fragment as U, renderList as Q, normalizeStyle as J, createVNode as V, h as N, createApp as Bt, reactive as qe, onUnmounted as Rt, shallowRef as Ze, onBeforeUnmount as Ye, createBlock as Ot } from "vue";
14
+ import { t as G, s as Nt, T as zt, N as Y } from "./chunks/toolbar-Bz666WFS.js";
15
15
  import Wt from "./ai-writer.es.js";
16
- import { D as Ro } from "./chunks/docx-zipper-CdQcoemq.js";
16
+ import { D as Ro } from "./chunks/docx-zipper-CRYSc8LJ.js";
17
17
  import { createZip as No } from "./file-zipper.es.js";
18
18
  var Je = { exports: {} };
19
19
  (function(t) {
20
- var s = Object.prototype.hasOwnProperty, o = "~";
20
+ var l = Object.prototype.hasOwnProperty, o = "~";
21
21
  function n() {
22
22
  }
23
23
  Object.create && (n.prototype = /* @__PURE__ */ Object.create(null), new n().__proto__ || (o = !1));
24
- function e(a, c, u) {
25
- this.fn = a, this.context = c, this.once = u || !1;
24
+ function e(s, r, d) {
25
+ this.fn = s, this.context = r, this.once = d || !1;
26
26
  }
27
- function i(a, c, u, r, b) {
28
- if (typeof u != "function")
27
+ function i(s, r, d, c, b) {
28
+ if (typeof d != "function")
29
29
  throw new TypeError("The listener must be a function");
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;
30
+ var y = new e(d, c || s, b), h = o ? o + r : r;
31
+ return s._events[h] ? s._events[h].fn ? s._events[h] = [s._events[h], y] : s._events[h].push(y) : (s._events[h] = y, s._eventsCount++), s;
32
32
  }
33
- function d(a, c) {
34
- --a._eventsCount === 0 ? a._events = new n() : delete a._events[c];
33
+ function u(s, r) {
34
+ --s._eventsCount === 0 ? s._events = new n() : delete s._events[r];
35
35
  }
36
- function l() {
36
+ function a() {
37
37
  this._events = new n(), this._eventsCount = 0;
38
38
  }
39
- l.prototype.eventNames = function() {
40
- var c = [], u, r;
41
- if (this._eventsCount === 0) return c;
42
- for (r in u = this._events)
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];
47
- if (!r) return [];
48
- if (r.fn) return [r.fn];
49
- for (var b = 0, y = r.length, h = new Array(y); b < y; b++)
50
- h[b] = r[b].fn;
39
+ a.prototype.eventNames = function() {
40
+ var r = [], d, c;
41
+ if (this._eventsCount === 0) return r;
42
+ for (c in d = this._events)
43
+ l.call(d, c) && r.push(o ? c.slice(1) : c);
44
+ return Object.getOwnPropertySymbols ? r.concat(Object.getOwnPropertySymbols(d)) : r;
45
+ }, a.prototype.listeners = function(r) {
46
+ var d = o ? o + r : r, c = this._events[d];
47
+ if (!c) return [];
48
+ if (c.fn) return [c.fn];
49
+ for (var b = 0, y = c.length, h = new Array(y); b < y; b++)
50
+ h[b] = c[b].fn;
51
51
  return h;
52
- }, l.prototype.listenerCount = function(c) {
53
- var u = o ? o + c : c, r = this._events[u];
54
- return r ? r.fn ? 1 : r.length : 0;
55
- }, l.prototype.emit = function(c, u, r, b, y, h) {
56
- var E = o ? o + c : c;
52
+ }, a.prototype.listenerCount = function(r) {
53
+ var d = o ? o + r : r, c = this._events[d];
54
+ return c ? c.fn ? 1 : c.length : 0;
55
+ }, a.prototype.emit = function(r, d, c, b, y, h) {
56
+ var E = o ? o + r : r;
57
57
  if (!this._events[E]) return !1;
58
- var g = this._events[E], D = arguments.length, L, p;
59
- if (g.fn) {
60
- switch (g.once && this.removeListener(c, g.fn, void 0, !0), D) {
58
+ var v = this._events[E], D = arguments.length, L, p;
59
+ if (v.fn) {
60
+ switch (v.once && this.removeListener(r, v.fn, void 0, !0), D) {
61
61
  case 1:
62
- return g.fn.call(g.context), !0;
62
+ return v.fn.call(v.context), !0;
63
63
  case 2:
64
- return g.fn.call(g.context, u), !0;
64
+ return v.fn.call(v.context, d), !0;
65
65
  case 3:
66
- return g.fn.call(g.context, u, r), !0;
66
+ return v.fn.call(v.context, d, c), !0;
67
67
  case 4:
68
- return g.fn.call(g.context, u, r, b), !0;
68
+ return v.fn.call(v.context, d, c, b), !0;
69
69
  case 5:
70
- return g.fn.call(g.context, u, r, b, y), !0;
70
+ return v.fn.call(v.context, d, c, b, y), !0;
71
71
  case 6:
72
- return g.fn.call(g.context, u, r, b, y, h), !0;
72
+ return v.fn.call(v.context, d, c, b, y, h), !0;
73
73
  }
74
74
  for (p = 1, L = new Array(D - 1); p < D; p++)
75
75
  L[p - 1] = arguments[p];
76
- g.fn.apply(g.context, L);
76
+ v.fn.apply(v.context, L);
77
77
  } else {
78
- var C = g.length, F;
78
+ var C = v.length, F;
79
79
  for (p = 0; p < C; p++)
80
- switch (g[p].once && this.removeListener(c, g[p].fn, void 0, !0), D) {
80
+ switch (v[p].once && this.removeListener(r, v[p].fn, void 0, !0), D) {
81
81
  case 1:
82
- g[p].fn.call(g[p].context);
82
+ v[p].fn.call(v[p].context);
83
83
  break;
84
84
  case 2:
85
- g[p].fn.call(g[p].context, u);
85
+ v[p].fn.call(v[p].context, d);
86
86
  break;
87
87
  case 3:
88
- g[p].fn.call(g[p].context, u, r);
88
+ v[p].fn.call(v[p].context, d, c);
89
89
  break;
90
90
  case 4:
91
- g[p].fn.call(g[p].context, u, r, b);
91
+ v[p].fn.call(v[p].context, d, c, b);
92
92
  break;
93
93
  default:
94
94
  if (!L) for (F = 1, L = new Array(D - 1); F < D; F++)
95
95
  L[F - 1] = arguments[F];
96
- g[p].fn.apply(g[p].context, L);
96
+ v[p].fn.apply(v[p].context, L);
97
97
  }
98
98
  }
99
99
  return !0;
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;
100
+ }, a.prototype.on = function(r, d, c) {
101
+ return i(this, r, d, c, !1);
102
+ }, a.prototype.once = function(r, d, c) {
103
+ return i(this, r, d, c, !0);
104
+ }, a.prototype.removeListener = function(r, d, c, b) {
105
+ var y = o ? o + r : r;
106
106
  if (!this._events[y]) return this;
107
- if (!u)
108
- return d(this, y), this;
107
+ if (!d)
108
+ return u(this, y), this;
109
109
  var h = this._events[y];
110
110
  if (h.fn)
111
- h.fn === u && (!b || h.once) && (!r || h.context === r) && d(this, y);
111
+ h.fn === d && (!b || h.once) && (!c || h.context === c) && u(this, y);
112
112
  else {
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);
113
+ for (var E = 0, v = [], D = h.length; E < D; E++)
114
+ (h[E].fn !== d || b && !h[E].once || c && h[E].context !== c) && v.push(h[E]);
115
+ v.length ? this._events[y] = v.length === 1 ? v[0] : v : u(this, y);
116
116
  }
117
117
  return this;
118
- }, l.prototype.removeAllListeners = function(c) {
119
- var u;
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;
118
+ }, a.prototype.removeAllListeners = function(r) {
119
+ var d;
120
+ return r ? (d = o ? o + r : r, this._events[d] && u(this, d)) : (this._events = new n(), this._eventsCount = 0), this;
121
+ }, a.prototype.off = a.prototype.removeListener, a.prototype.addListener = a.prototype.on, a.prefixed = o, a.EventEmitter = a, t.exports = a;
122
122
  })(Je);
123
123
  var Pt = Je.exports;
124
124
  const Vt = /* @__PURE__ */ St(Pt);
125
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;
126
+ let l = t;
127
+ for (; l; ) {
128
+ const o = window.getComputedStyle(l).overflowY;
129
+ if (/(auto|scroll)/.test(o) && l.scrollHeight > l.clientHeight)
130
+ return l;
131
+ l = l.parentElement;
132
132
  }
133
133
  return document.scrollingElement || document.documentElement;
134
134
  }
135
- function Ut(t, s = { behavior: "smooth", block: "start" }) {
135
+ function Ut(t, l = { behavior: "smooth", block: "start" }) {
136
136
  if (!t) return;
137
137
  const o = jt(t), n = o.getBoundingClientRect(), i = t.getBoundingClientRect().top - n.top + o.scrollTop;
138
138
  o.scrollTo({
139
- top: s.block === "start" ? i : i - o.clientHeight + t.offsetHeight,
140
- behavior: s.behavior
139
+ top: l.block === "start" ? i : i - o.clientHeight + t.offsetHeight,
140
+ behavior: l.behavior
141
141
  });
142
142
  }
143
143
  const _ = (t) => {
@@ -147,7 +147,7 @@ const _ = (t) => {
147
147
  throw new Error("Toolbar button item needs either icon or label - " + t.name);
148
148
  if (!t.name)
149
149
  throw new Error("Invalid toolbar item name - " + t.name);
150
- const o = 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
+ const o = g(At()), n = t.type, e = g(t.name), i = t.command, u = g(t.icon), a = g(t.group || "center"), s = g(t.allowWithoutEditor), r = g(t.attributes || {}), d = t.disabled || !1, c = g(t.disabled), b = g(!1), y = g(!1), h = g(t.style), E = g(t.isNarrow), v = g(t.isWide), D = g(t.minWidth), L = g(t.suppressActiveHighlight || !1), p = g(t.argument), C = g(null), F = g(null), z = g(t.iconColor), B = g(t.hasCaret), q = g(t.dropdownStyles), ve = g(t.tooltip), ge = g(t.tooltipVisible), ce = g(t.tooltipTimeout), de = g(t.defaultLabel), T = g(t.label), M = g(t.hideLabel), H = g(t.inlineTextInputVisible), R = g(t.hasInlineTextInput), X = g(t.markName), Z = g(t.labelAttr), ae = g(t.selectedValue), ue = g(t.dropdownValueKey), Ce = g([]);
151
151
  if (t.options) {
152
152
  if (!Array.isArray(t.options)) throw new Error("Invalid toolbar item options - " + t.options);
153
153
  Ce.value.push(...t.options);
@@ -157,9 +157,9 @@ const _ = (t) => {
157
157
  }, Fe = () => {
158
158
  xe(), b.value = !1;
159
159
  }, Ie = (te) => {
160
- r.value = te;
160
+ c.value = te;
161
161
  }, _e = () => {
162
- r.value = u;
162
+ c.value = d;
163
163
  }, ee = t.onActivate || (() => null), xe = t.onDeactivate || (() => null), Le = () => {
164
164
  const te = {};
165
165
  return Object.keys(me).forEach((ye) => {
@@ -170,24 +170,24 @@ const _ = (t) => {
170
170
  name: e,
171
171
  type: n,
172
172
  command: i,
173
- icon: d,
174
- tooltip: ge,
175
- group: l,
176
- attributes: c,
177
- disabled: r,
173
+ icon: u,
174
+ tooltip: ve,
175
+ group: a,
176
+ attributes: r,
177
+ disabled: c,
178
178
  active: b,
179
179
  expand: y,
180
180
  nestedOptions: Ce,
181
181
  style: h,
182
182
  isNarrow: E,
183
- isWide: g,
183
+ isWide: v,
184
184
  minWidth: D,
185
185
  argument: p,
186
186
  parentItem: F,
187
187
  iconColor: z,
188
188
  hasCaret: B,
189
189
  dropdownStyles: q,
190
- tooltipVisible: ve,
190
+ tooltipVisible: ge,
191
191
  tooltipTimeout: ce,
192
192
  defaultLabel: de,
193
193
  label: T,
@@ -197,7 +197,7 @@ const _ = (t) => {
197
197
  markName: X,
198
198
  labelAttr: Z,
199
199
  childItem: C,
200
- allowWithoutEditor: a,
200
+ allowWithoutEditor: s,
201
201
  dropdownValueKey: ue,
202
202
  selectedValue: ae
203
203
  };
@@ -214,29 +214,29 @@ const _ = (t) => {
214
214
  }, qt = { class: "alignment-buttons" }, Gt = ["innerHTML"], Kt = ["innerHTML"], Xt = ["innerHTML"], Zt = ["innerHTML"], Yt = {
215
215
  __name: "AlignmentButtons",
216
216
  emits: ["select"],
217
- setup(t, { emit: s }) {
218
- const o = s, n = (e) => {
217
+ setup(t, { emit: l }) {
218
+ const o = l, n = (e) => {
219
219
  o("select", e);
220
220
  };
221
- return (e, i) => (w(), k("div", qt, [
221
+ return (e, i) => (k(), w("div", qt, [
222
222
  x("div", {
223
223
  class: "button-icon",
224
- onClick: i[0] || (i[0] = (d) => n("left")),
224
+ onClick: i[0] || (i[0] = (u) => n("left")),
225
225
  innerHTML: $(G).alignLeft
226
226
  }, null, 8, Gt),
227
227
  x("div", {
228
228
  class: "button-icon",
229
- onClick: i[1] || (i[1] = (d) => n("center")),
229
+ onClick: i[1] || (i[1] = (u) => n("center")),
230
230
  innerHTML: $(G).alignCenter
231
231
  }, null, 8, Kt),
232
232
  x("div", {
233
233
  class: "button-icon",
234
- onClick: i[2] || (i[2] = (d) => n("right")),
234
+ onClick: i[2] || (i[2] = (u) => n("right")),
235
235
  innerHTML: $(G).alignRight
236
236
  }, null, 8, Xt),
237
237
  x("div", {
238
238
  class: "button-icon",
239
- onClick: i[3] || (i[3] = (d) => n("justify")),
239
+ onClick: i[3] || (i[3] = (u) => n("justify")),
240
240
  innerHTML: $(G).alignJustify
241
241
  }, null, 8, Zt)
242
242
  ]));
@@ -279,39 +279,39 @@ const _ = (t) => {
279
279
  }
280
280
  },
281
281
  emits: ["submit", "cancel"],
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) {
285
- o("submit", { text: a.value, href: u.value });
282
+ setup(t, { emit: l }) {
283
+ const o = l, n = t, { proxy: e } = It(), i = () => {
284
+ if (e?.$submit instanceof Function && e.$submit(), r.value && c.value) {
285
+ o("submit", { text: s.value, href: d.value });
286
286
  return;
287
- } else if (!c.value) {
288
- o("submit", { text: a.value, href: null });
287
+ } else if (!r.value) {
288
+ o("submit", { text: s.value, href: null });
289
289
  return;
290
290
  }
291
- console.debug("[LinkInput] Invalid URL in handleSubmit"), l.value = !0;
292
- }, d = () => {
293
- o("submit", { text: a.value, href: null });
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(() => {
295
- const p = u.value.split(".").filter(Boolean);
296
- return u.value.includes(".") && p.length > 1;
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 = () => {
298
- window.open(u.value, "_blank");
291
+ console.debug("[LinkInput] Invalid URL in handleSubmit"), a.value = !0;
292
+ }, u = () => {
293
+ o("submit", { text: s.value, href: null });
294
+ }, a = g(!1), s = g(n.initialText), r = g(n.href), d = j(() => r.value?.startsWith("http") ? r.value : "http://" + r.value), c = j(() => {
295
+ const p = d.value.split(".").filter(Boolean);
296
+ return d.value.includes(".") && p.length > 1;
297
+ }), b = j(() => h.value ? "Apply" : "Remove"), y = j(() => !c.value), h = j(() => !E.value), E = j(() => n.href && !r.value), v = j(() => n.href.startsWith("#")), D = () => {
298
+ window.open(d.value, "_blank");
299
299
  };
300
300
  Lt(
301
301
  () => n.href,
302
302
  (p) => {
303
- c.value = p;
303
+ r.value = p;
304
304
  }
305
305
  );
306
306
  const L = () => {
307
307
  const p = document.querySelector(".link-input-ctn input");
308
308
  p && p.focus();
309
309
  };
310
- return ke(() => {
310
+ return we(() => {
311
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, [
312
+ }), (p, C) => (k(), w("div", Qt, [
313
+ t.href ? v.value ? (k(), w("div", tn, "Page anchor")) : (k(), w("div", nn, "Edit link")) : (k(), w("div", en, "Add link")),
314
+ t.showInput && !v.value ? (k(), w("div", on, [
315
315
  x("div", sn, [
316
316
  x("div", {
317
317
  class: "input-icon",
@@ -320,26 +320,26 @@ const _ = (t) => {
320
320
  Mt(x("input", {
321
321
  type: "text",
322
322
  placeholder: "Type or paste a link",
323
- class: oe({ error: l.value }),
324
- "onUpdate:modelValue": C[0] || (C[0] = (F) => c.value = F),
323
+ class: oe({ error: a.value }),
324
+ "onUpdate:modelValue": C[0] || (C[0] = (F) => r.value = F),
325
325
  onKeydown: [
326
- Dt(we(i, ["stop", "prevent"]), ["enter"]),
327
- C[1] || (C[1] = (F) => l.value = !1)
326
+ Dt(ke(i, ["stop", "prevent"]), ["enter"]),
327
+ C[1] || (C[1] = (F) => a.value = !1)
328
328
  ]
329
329
  }, null, 42, an), [
330
- [$t, c.value]
330
+ [$t, r.value]
331
331
  ]),
332
332
  x("div", {
333
- class: oe(["open-link-icon", { disabled: !r.value }]),
333
+ class: oe(["open-link-icon", { disabled: !c.value }]),
334
334
  innerHTML: $(G).openLink,
335
335
  onClick: D
336
336
  }, null, 10, rn)
337
337
  ]),
338
338
  x("div", cn, [
339
- t.href ? (w(), k("button", {
339
+ t.href ? (k(), w("button", {
340
340
  key: 0,
341
341
  class: "remove-btn",
342
- onClick: d
342
+ onClick: u
343
343
  }, [
344
344
  x("div", {
345
345
  class: "remove-btn__icon",
@@ -347,20 +347,20 @@ const _ = (t) => {
347
347
  }, null, 8, dn),
348
348
  C[3] || (C[3] = Ht(" Remove "))
349
349
  ])) : ne("", !0),
350
- h.value ? (w(), k("button", {
350
+ h.value ? (k(), w("button", {
351
351
  key: 1,
352
352
  class: oe(["submit-btn", { "disable-btn": y.value }]),
353
353
  onClick: i
354
354
  }, ie(b.value), 3)) : ne("", !0)
355
355
  ])
356
- ])) : g.value ? (w(), k("div", un, [
356
+ ])) : v.value ? (k(), w("div", un, [
357
357
  x("a", {
358
- onClick: C[2] || (C[2] = we((...F) => t.goToAnchor && t.goToAnchor(...F), ["stop", "prevent"]))
358
+ onClick: C[2] || (C[2] = ke((...F) => t.goToAnchor && t.goToAnchor(...F), ["stop", "prevent"]))
359
359
  }, "Go to " + ie(t.href.startsWith("#_") ? t.href.substring(2) : t.href), 1)
360
360
  ])) : ne("", !0)
361
361
  ]));
362
362
  }
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 = {
363
+ }, pn = /* @__PURE__ */ K(mn, [["__scopeId", "data-v-6990d5b2"]]), fn = { class: "document-mode" }, hn = ["onClick"], vn = { class: "document-mode-column icon-column" }, gn = ["innerHTML"], yn = { class: "document-mode-column text-column" }, bn = { class: "document-mode-type" }, kn = { class: "document-mode-description" }, wn = {
364
364
  __name: "DocumentMode",
365
365
  props: {
366
366
  options: {
@@ -368,29 +368,29 @@ const _ = (t) => {
368
368
  }
369
369
  },
370
370
  emits: ["select"],
371
- setup(t, { emit: s }) {
372
- const o = s, n = (e) => {
371
+ setup(t, { emit: l }) {
372
+ const o = l, n = (e) => {
373
373
  o("select", e);
374
374
  };
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)
375
+ return (e, i) => (k(), w("div", fn, [
376
+ (k(!0), w(U, null, Q(t.options, (u) => (k(), w("div", {
377
+ class: oe(["option-item", { disabled: u.disabled }]),
378
+ onClick: (a) => n(u)
379
379
  }, [
380
- x("div", gn, [
380
+ x("div", vn, [
381
381
  x("div", {
382
382
  class: "icon-column__icon",
383
- innerHTML: d.icon
384
- }, null, 8, vn)
383
+ innerHTML: u.icon
384
+ }, null, 8, gn)
385
385
  ]),
386
386
  x("div", yn, [
387
- x("div", bn, ie(d.label), 1),
388
- x("div", wn, ie(d.description), 1)
387
+ x("div", bn, ie(u.label), 1),
388
+ x("div", kn, ie(u.description), 1)
389
389
  ])
390
390
  ], 10, hn))), 256))
391
391
  ]));
392
392
  }
393
- }, Cn = /* @__PURE__ */ K(kn, [["__scopeId", "data-v-f86e1477"]]), _n = {
393
+ }, Cn = /* @__PURE__ */ K(wn, [["__scopeId", "data-v-f86e1477"]]), _n = {
394
394
  key: 0,
395
395
  class: "linked-style-buttons"
396
396
  }, xn = ["onClick"], En = {
@@ -402,19 +402,19 @@ const _ = (t) => {
402
402
  }
403
403
  },
404
404
  emits: ["select"],
405
- setup(t, { emit: s }) {
406
- const o = s, n = t, e = (i) => {
405
+ setup(t, { emit: l }) {
406
+ const o = l, n = t, e = (i) => {
407
407
  o("select", i);
408
408
  };
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
+ return (i, u) => n.editor ? (k(), w("div", _n, [
410
+ (k(!0), w(U, null, Q($(Ke)(t.editor), (a) => (k(), w("div", {
411
411
  class: "style-item",
412
- onClick: (a) => e(l)
412
+ onClick: (s) => e(a)
413
413
  }, [
414
414
  x("div", {
415
415
  class: "style-name",
416
- style: J($(pt)(l, null, !1))
417
- }, ie(l.definition.attrs.name), 5)
416
+ style: J($(pt)(a, null, !1))
417
+ }, ie(a.definition.attrs.name), 5)
418
418
  ], 8, xn))), 256))
419
419
  ])) : ne("", !0);
420
420
  }
@@ -431,31 +431,31 @@ const _ = (t) => {
431
431
  }
432
432
  },
433
433
  emits: ["select"],
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);
434
+ setup(t, { emit: l }) {
435
+ const o = l, n = t, e = j(() => (a) => n.activeColor.value ? n.activeColor.value.toUpperCase() === a.value : !1), i = (a, s) => s === 5 || ["#FFFFFF", "#FAFF09"].includes(a) ? { color: "#000" } : { color: "#FFF" }, u = (a) => {
436
+ o("select", a.value);
437
437
  };
438
- return ke(() => {
439
- if (!n.icons.every((a) => Array.isArray(a))) throw new Error("icon props must be 2d array");
440
- }), (l, a) => (w(!0), k(U, null, Q(t.icons, (c, u) => (w(), k("div", {
438
+ return we(() => {
439
+ if (!n.icons.every((s) => Array.isArray(s))) throw new Error("icon props must be 2d array");
440
+ }), (a, s) => (k(!0), w(U, null, Q(t.icons, (r, d) => (k(), w("div", {
441
441
  class: "option-row",
442
- key: u
442
+ key: d
443
443
  }, [
444
- (w(!0), k(U, null, Q(c, (r, b) => (w(), k("div", {
444
+ (k(!0), w(U, null, Q(r, (c, b) => (k(), w("div", {
445
445
  class: "option",
446
446
  key: b,
447
- onClick: we((y) => d(r), ["stop", "prevent"])
447
+ onClick: ke((y) => u(c), ["stop", "prevent"])
448
448
  }, [
449
449
  x("div", {
450
450
  class: "option__icon",
451
- innerHTML: r.icon,
452
- style: J(r.style)
451
+ innerHTML: c.icon,
452
+ style: J(c.style)
453
453
  }, null, 12, Tn),
454
- e.value(r) ? (w(), k("div", {
454
+ e.value(c) ? (k(), w("div", {
455
455
  key: 0,
456
456
  class: "option__check",
457
457
  innerHTML: $(G).colorOptionCheck,
458
- style: J(i(r.value, b))
458
+ style: J(i(c.value, b))
459
459
  }, null, 12, Fn)) : ne("", !0)
460
460
  ], 8, An))), 128))
461
461
  ]))), 128));
@@ -477,17 +477,17 @@ const _ = (t) => {
477
477
  }
478
478
  },
479
479
  emits: ["select", "clickoutside"],
480
- setup(t, { emit: s }) {
481
- const o = s, n = (e) => {
480
+ setup(t, { emit: l }) {
481
+ const o = l, n = (e) => {
482
482
  o("select", e);
483
483
  };
484
- return (e, i) => (w(), k("div", Ln, [
484
+ return (e, i) => (k(), w("div", Ln, [
485
485
  V(Ge, {
486
486
  icons: t.icons,
487
487
  "active-color": t.activeColor,
488
488
  onSelect: n
489
489
  }, null, 8, ["icons", "active-color"]),
490
- t.customIcons.flat().length ? (w(), k(U, { key: 0 }, [
490
+ t.customIcons.flat().length ? (k(), w(U, { key: 0 }, [
491
491
  i[0] || (i[0] = x("span", { class: "option-grid-ctn__subtitle" }, "Custom colors", -1)),
492
492
  V(Ge, {
493
493
  icons: t.customIcons,
@@ -499,8 +499,8 @@ const _ = (t) => {
499
499
  }
500
500
  }, Dn = /* @__PURE__ */ K(Mn, [["__scopeId", "data-v-fa2949d8"]]), $n = (t) => {
501
501
  t.expand.value = !1;
502
- }, f = (t, s = null) => ({
503
- label: s,
502
+ }, f = (t, l = null) => ({
503
+ label: l,
504
504
  icon: G.colorOption,
505
505
  value: t,
506
506
  style: {
@@ -508,15 +508,15 @@ const _ = (t) => {
508
508
  boxShadow: "0 0 5px 1px rgba(0, 0, 0, 0.1)",
509
509
  borderRadius: "50%"
510
510
  }
511
- }), Ne = (t, s, o = []) => {
511
+ }), Ne = (t, l, o = []) => {
512
512
  const n = (e) => {
513
- s.iconColor.value = e, t.emitCommand({ item: s, argument: e }), $n(s);
513
+ l.iconColor.value = e, t.emitCommand({ item: l, argument: e }), $n(l);
514
514
  };
515
515
  return N("div", {}, [
516
516
  N(Dn, {
517
517
  icons: Qe,
518
518
  customIcons: o,
519
- activeColor: s.iconColor,
519
+ activeColor: l.iconColor,
520
520
  onSelect: n
521
521
  })
522
522
  ]);
@@ -596,34 +596,34 @@ const _ = (t) => {
596
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 = {
597
597
  __name: "TableGrid",
598
598
  emits: ["select", "clickoutside"],
599
- setup(t, { emit: s }) {
600
- const o = s, n = v(0), e = v(0), i = (l) => {
601
- let a = l.target;
602
- if (!!a.dataset.grid)
599
+ setup(t, { emit: l }) {
600
+ const o = l, n = g(0), e = g(0), i = (a) => {
601
+ let s = a.target;
602
+ if (!!s.dataset.grid)
603
603
  return;
604
- let r = [...a.parentElement.querySelectorAll("[data-item]")], b = parseInt(a.dataset.cols, 10), y = parseInt(a.dataset.rows, 10);
604
+ let c = [...s.parentElement.querySelectorAll("[data-item]")], b = parseInt(s.dataset.cols, 10), y = parseInt(s.dataset.rows, 10);
605
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");
606
+ for (let h = 0; h < c.length; h++) {
607
+ let E = c[h], v = parseInt(E.dataset.cols, 10), D = parseInt(E.dataset.rows, 10);
608
+ v <= b && D <= y ? E.classList.add("selected") : E.classList.remove("selected");
609
609
  }
610
- }, d = ({ cols: l, rows: a }) => {
611
- o("select", { cols: l, rows: a });
610
+ }, u = ({ cols: a, rows: s }) => {
611
+ o("select", { cols: a, rows: s });
612
612
  };
613
- return (l, a) => (w(), k("div", Bn, [
613
+ return (a, s) => (k(), w("div", Bn, [
614
614
  x("div", {
615
615
  class: "toolbar-table-grid",
616
616
  onMouseover: i,
617
617
  "data-grid": "true"
618
618
  }, [
619
- (w(), k(U, null, Q(5, (c) => (w(), k(U, { key: c }, [
620
- (w(), k(U, null, Q(5, (u) => x("div", {
619
+ (k(), w(U, null, Q(5, (r) => (k(), w(U, { key: r }, [
620
+ (k(), w(U, null, Q(5, (d) => x("div", {
621
621
  class: "toolbar-table-grid__item",
622
- key: `${c}_${u}`,
623
- "data-cols": u,
624
- "data-rows": c,
622
+ key: `${r}_${d}`,
623
+ "data-cols": d,
624
+ "data-rows": r,
625
625
  "data-item": "true",
626
- onClick: we((r) => d({ cols: u, rows: c }), ["stop", "prevent"])
626
+ onClick: ke((c) => u({ cols: d, rows: r }), ["stop", "prevent"])
627
627
  }, null, 8, Rn)), 64))
628
628
  ], 64))), 64))
629
629
  ], 32),
@@ -638,36 +638,36 @@ const _ = (t) => {
638
638
  }
639
639
  },
640
640
  emits: ["select"],
641
- setup(t, { emit: s }) {
642
- const o = s, n = (e) => {
641
+ setup(t, { emit: l }) {
642
+ const o = l, n = (e) => {
643
643
  o("select", { command: e.command });
644
644
  };
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)
645
+ return (e, i) => (k(), w("div", Wn, [
646
+ (k(!0), w(U, null, Q(t.options, (u) => (k(), w("div", {
647
+ class: oe(["toolbar-table-actions__item", { "toolbar-table-actions__item--border": u.bottomBorder }]),
648
+ onClick: (a) => n(u)
649
649
  }, [
650
650
  x("div", Vn, [
651
651
  x("div", {
652
652
  class: "toolbar-table-actions__icon-wrapper",
653
- innerHTML: d.icon
653
+ innerHTML: u.icon
654
654
  }, null, 8, jn)
655
655
  ]),
656
- x("div", Un, ie(d.label), 1)
656
+ x("div", Un, ie(u.label), 1)
657
657
  ], 10, Pn))), 256))
658
658
  ]));
659
659
  }
660
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
661
  `, le = (t) => {
662
662
  t.expand.value = !1;
663
- }, Xn = (t, s = !1, o, n, e) => {
663
+ }, Xn = (t, l = !1, o, n, e) => {
664
664
  const i = _({
665
665
  type: "button",
666
666
  name: "bold",
667
667
  command: "toggleBold",
668
668
  icon: e.bold,
669
669
  tooltip: "Bold"
670
- }), d = _({
670
+ }), u = _({
671
671
  type: "dropdown",
672
672
  name: "fontFamily",
673
673
  tooltip: "Font",
@@ -715,10 +715,10 @@ const _ = (t) => {
715
715
  }
716
716
  ],
717
717
  onActivate: ({ fontFamily: m }) => {
718
- m && (d.label.value = m);
718
+ m && (u.label.value = m);
719
719
  },
720
- onDeactivate: () => d.label.value = d.defaultLabel.value
721
- }), l = _({
720
+ onDeactivate: () => u.label.value = u.defaultLabel.value
721
+ }), a = _({
722
722
  type: "dropdown",
723
723
  dropdownStyles: {
724
724
  padding: 0,
@@ -747,7 +747,7 @@ const _ = (t) => {
747
747
  [
748
748
  N(Wt, {
749
749
  handleClose: () => {
750
- le(l);
750
+ le(a);
751
751
  },
752
752
  selectedText: m,
753
753
  editor: t.activeEditor,
@@ -759,7 +759,7 @@ const _ = (t) => {
759
759
  }
760
760
  }
761
761
  ]
762
- }), a = _({
762
+ }), s = _({
763
763
  type: "dropdown",
764
764
  name: "fontSize",
765
765
  defaultLabel: "12",
@@ -791,22 +791,22 @@ const _ = (t) => {
791
791
  { label: "96", key: "96pt" }
792
792
  ],
793
793
  onActivate: ({ fontSize: m }) => {
794
- if (!m) return a.label.value = a.defaultLabel.value;
794
+ if (!m) return s.label.value = s.defaultLabel.value;
795
795
  let S = Nt(m, 12);
796
- S < 8 && (S = 8), S > 96 && (S = 96), a.label.value = String(S);
796
+ S < 8 && (S = 8), S > 96 && (S = 96), s.label.value = String(S);
797
797
  },
798
- onDeactivate: () => a.label.value = a.defaultLabel.value
799
- }), c = _({
798
+ onDeactivate: () => s.label.value = s.defaultLabel.value
799
+ }), r = _({
800
800
  type: "separator",
801
801
  name: "separator",
802
802
  isNarrow: !0
803
- }), u = _({
803
+ }), d = _({
804
804
  type: "button",
805
805
  name: "italic",
806
806
  command: "toggleItalic",
807
807
  icon: e.italic,
808
808
  tooltip: "Italic"
809
- }), r = _({
809
+ }), c = _({
810
810
  type: "button",
811
811
  name: "underline",
812
812
  command: "toggleUnderline",
@@ -891,12 +891,12 @@ const _ = (t) => {
891
891
  })
892
892
  ]);
893
893
  }
894
- const g = _({
894
+ const v = _({
895
895
  type: "options",
896
896
  name: "linkInput",
897
897
  command: "toggleLink"
898
898
  });
899
- h.childItem = g, g.parentItem = h;
899
+ h.childItem = v, v.parentItem = h;
900
900
  const D = _({
901
901
  type: "button",
902
902
  name: "image",
@@ -1051,13 +1051,13 @@ const _ = (t) => {
1051
1051
  justify: e.alignJustify
1052
1052
  }, se = P[A] ?? P.left;
1053
1053
  m.icon.value = se;
1054
- }, ge = _({
1054
+ }, ve = _({
1055
1055
  type: "button",
1056
1056
  name: "list",
1057
1057
  command: "toggleBulletList",
1058
1058
  icon: e.bulletList,
1059
1059
  tooltip: "Bullet list"
1060
- }), ve = _({
1060
+ }), ge = _({
1061
1061
  type: "button",
1062
1062
  name: "numberedlist",
1063
1063
  command: "toggleOrderedList",
@@ -1178,8 +1178,8 @@ const _ = (t) => {
1178
1178
  });
1179
1179
  [
1180
1180
  i,
1181
- u,
1182
- r,
1181
+ d,
1182
+ c,
1183
1183
  de,
1184
1184
  ce,
1185
1185
  // search,
@@ -1348,35 +1348,35 @@ const _ = (t) => {
1348
1348
  // toggleTrackChangesOriginal,
1349
1349
  // toggleTrackChangesFinal,
1350
1350
  M,
1351
- d,
1352
- c,
1353
- a,
1354
- c,
1355
- i,
1356
1351
  u,
1357
1352
  r,
1353
+ s,
1354
+ r,
1355
+ i,
1356
+ d,
1357
+ c,
1358
1358
  y,
1359
1359
  b,
1360
- c,
1360
+ r,
1361
1361
  h,
1362
1362
  D,
1363
1363
  L,
1364
1364
  C,
1365
- c,
1365
+ r,
1366
1366
  B,
1367
- ge,
1368
1367
  ve,
1368
+ ge,
1369
1369
  ce,
1370
1370
  de,
1371
1371
  re,
1372
- c,
1372
+ r,
1373
1373
  be,
1374
- c,
1374
+ r,
1375
1375
  me,
1376
1376
  Fe,
1377
1377
  Te,
1378
1378
  ye,
1379
- l,
1379
+ a,
1380
1380
  T,
1381
1381
  ee
1382
1382
  // search,
@@ -1388,7 +1388,7 @@ const _ = (t) => {
1388
1388
  O = O.filter((A) => !S.includes(A.name.value));
1389
1389
  }
1390
1390
  const Pe = [X, ue, Ce];
1391
- s || (n === "viewer" && Pe.push(Z, ae), O = O.filter((m) => !Pe.includes(m)));
1391
+ l || (n === "viewer" && Pe.push(Z, ae), O = O.filter((m) => !Pe.includes(m)));
1392
1392
  const rt = [H, T, ee].map((m) => m.name), ct = (m) => rt.includes(m.name), Ee = [], De = [];
1393
1393
  let $e = st + it;
1394
1394
  return O.forEach((m) => {
@@ -1416,86 +1416,86 @@ const _ = (t) => {
1416
1416
  }, Zn = [".jpg", ".jpeg", ".png", "image/jpeg", "image/png"], Yn = () => {
1417
1417
  let t = document.createElement("input");
1418
1418
  t.type = "file";
1419
- let s = Zn;
1420
- return t.accept = s.join(","), () => new Promise((n, e) => {
1419
+ let l = Zn;
1420
+ return t.accept = l.join(","), () => new Promise((n, e) => {
1421
1421
  t.onchange = async () => {
1422
1422
  const i = t.files;
1423
1423
  if (!i) return n(null);
1424
- const d = i.item(0);
1425
- return n(d ? { file: d } : null);
1424
+ const u = i.item(0);
1425
+ return n(u ? { file: u } : null);
1426
1426
  }, t.oncancel = () => n(null), t.onerror = e, t.click();
1427
1427
  });
1428
- }, Jn = (t) => new Promise((s, o) => {
1428
+ }, Jn = (t) => new Promise((l, o) => {
1429
1429
  let n = new FileReader();
1430
- n.onload = (e) => s(e.target.result), n.onerror = o, setTimeout(() => n.readAsDataURL(t), 250);
1431
- }), Qn = (t, s) => new Promise((o, n) => {
1430
+ n.onload = (e) => l(e.target.result), n.onerror = o, setTimeout(() => n.readAsDataURL(t), 250);
1431
+ }), Qn = (t, l) => new Promise((o, n) => {
1432
1432
  const e = new window.Image();
1433
1433
  e.onload = () => {
1434
- const i = document.createElement("canvas"), { width: d, height: l } = eo(
1434
+ const i = document.createElement("canvas"), { width: u, height: a } = eo(
1435
1435
  e.width,
1436
1436
  e.height,
1437
- s
1437
+ l
1438
1438
  );
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);
1439
+ if (i.width = u, i.height = a, i.getContext("2d").drawImage(e, 0, 0, u, a), typeof t == "string") {
1440
+ const r = i.toDataURL();
1441
+ o(r);
1442
1442
  } else
1443
- i.toBlob((c) => {
1444
- const u = new File([c], t.name, {
1443
+ i.toBlob((r) => {
1444
+ const d = new File([r], t.name, {
1445
1445
  type: t.type,
1446
1446
  lastModified: Date.now()
1447
1447
  });
1448
- o({ file: u, width: d, height: l });
1448
+ o({ file: d, width: u, height: a });
1449
1449
  });
1450
1450
  }, e.onerror = (i) => n(i), e.src = typeof t == "string" ? t : URL.createObjectURL(t);
1451
- }), eo = (t, s, o) => {
1451
+ }), eo = (t, l, o) => {
1452
1452
  const { width: n, height: e } = o.getMaxContentSize();
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 }) => {
1453
+ if (!n || !e) return { width: t, height: l };
1454
+ let i = t, u = l;
1455
+ const a = t / l;
1456
+ return l > e && (u = e, i = Math.round(e * a)), i > n && (i = n, u = Math.round(n / a)), { width: i, height: u };
1457
+ }, to = async ({ editor: t, view: l, file: o }) => {
1458
1458
  let n = typeof t.options.handleImageUpload == "function" ? t.options.handleImageUpload : Jn;
1459
1459
  if ((o.size / (1024 * 1024)).toFixed(4) > 5) {
1460
1460
  window.alert("Image size must be less than 5MB");
1461
1461
  return;
1462
1462
  }
1463
- let i, d;
1463
+ let i, u;
1464
1464
  try {
1465
- const r = await Qn(o, t);
1466
- i = r.width, d = r.height, o = r.file;
1467
- } catch (r) {
1468
- console.warn("Error processing image:", r);
1465
+ const c = await Qn(o, t);
1466
+ i = c.width, u = c.height, o = c.file;
1467
+ } catch (c) {
1468
+ console.warn("Error processing image:", c);
1469
1469
  return;
1470
1470
  }
1471
- let l = {}, { tr: a, schema: c } = s.state;
1472
- a.selection.empty || a.deleteSelection();
1473
- let u = {
1471
+ let a = {}, { tr: s, schema: r } = l.state;
1472
+ s.selection.empty || s.deleteSelection();
1473
+ let d = {
1474
1474
  type: "add",
1475
- pos: a.selection.from,
1476
- id: l
1475
+ pos: s.selection.from,
1476
+ id: a
1477
1477
  };
1478
- a.setMeta(Re, u), s.dispatch(a), n(o).then(
1479
- (r) => {
1480
- let b = o.name.replace(" ", "_"), y = ft(s.state, l);
1478
+ s.setMeta(Re, d), l.dispatch(s), n(o).then(
1479
+ (c) => {
1480
+ let b = o.name.replace(" ", "_"), y = ft(l.state, a);
1481
1481
  if (y == null)
1482
1482
  return;
1483
- let h = { type: "remove", id: l }, E = `word/media/${b}`, g = c.nodes.image.create({
1483
+ let h = { type: "remove", id: a }, E = `word/media/${b}`, v = r.nodes.image.create({
1484
1484
  src: E,
1485
- size: { width: i, height: d }
1485
+ size: { width: i, height: u }
1486
1486
  });
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)
1487
+ t.storage.image.media = Object.assign(t.storage.image.media, { [E]: c }), t.options.ydoc && t.commands.addImageToCollaboration({ mediaPath: E, fileData: c }), l.dispatch(
1488
+ l.state.tr.replaceWith(y, y, v).setMeta(Re, h)
1489
1489
  );
1490
1490
  },
1491
1491
  () => {
1492
- let r = { type: "remove", id: l };
1493
- s.dispatch(a.setMeta(Re, r));
1492
+ let c = { type: "remove", id: a };
1493
+ l.dispatch(s.setMeta(Re, c));
1494
1494
  }
1495
1495
  );
1496
1496
  };
1497
1497
  var I, et, he, ze, tt, nt, We, ot, fe;
1498
- class ko extends Vt {
1498
+ class wo extends Vt {
1499
1499
  constructor(o) {
1500
1500
  super();
1501
1501
  Be(this, I);
@@ -1517,8 +1517,8 @@ class ko extends Vt {
1517
1517
  o.onActivate({ zoom: n }), this.emit("superdoc-command", { item: o, argument: n });
1518
1518
  const e = document.querySelector(this.superdoc.config.selector)?.querySelector(".layers");
1519
1519
  if (!e) return;
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);
1520
+ const i = typeof screen.orientation < "u", u = window.matchMedia("(max-width: 834px)").matches;
1521
+ i && u ? (e.style.transformOrigin = "0 0", e.style.transform = `scale(${parseInt(n) / 100})`) : e.style.zoom = parseInt(n) / 100, this.superdoc.superdocStore.activeZoom = parseInt(n);
1522
1522
  },
1523
1523
  setDocumentMode: ({ item: o, argument: n }) => {
1524
1524
  n && this.emit("superdoc-command", { item: o, argument: n });
@@ -1552,13 +1552,13 @@ class ko extends Vt {
1552
1552
  },
1553
1553
  increaseTextIndent: ({ item: o, argument: n }) => {
1554
1554
  let e = o.command, { state: i } = this.activeEditor;
1555
- if (Ue((l) => l.type.name === "listItem")(i.selection))
1555
+ if (Ue((a) => a.type.name === "listItem")(i.selection))
1556
1556
  return this.activeEditor.commands.increaseListIndent();
1557
1557
  e in this.activeEditor.commands && this.activeEditor.commands[e](n);
1558
1558
  },
1559
1559
  decreaseTextIndent: ({ item: o, argument: n }) => {
1560
1560
  let e = o.command, { state: i } = this.activeEditor;
1561
- if (Ue((l) => l.type.name === "listItem")(i.selection))
1561
+ if (Ue((a) => a.type.name === "listItem")(i.selection))
1562
1562
  return this.activeEditor.commands.decreaseListIndent();
1563
1563
  e in this.activeEditor.commands && this.activeEditor.commands[e](n);
1564
1564
  },
@@ -1578,8 +1578,8 @@ class ko extends Vt {
1578
1578
  let e = o.command;
1579
1579
  if (e in this.activeEditor.commands) {
1580
1580
  this.activeEditor.commands[e](n);
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(() => {
1581
+ const { view: i } = this.activeEditor, u = i.state.selection.$to.pos, a = new Xe(i.state.doc.resolve(u)), s = i.state.tr.setSelection(a), r = i.state.apply(s);
1582
+ i.updateState(r), setTimeout(() => {
1583
1583
  i.focus();
1584
1584
  }, 100);
1585
1585
  }
@@ -1634,14 +1634,29 @@ class ko extends Vt {
1634
1634
  W(this, I, We).call(this);
1635
1635
  return;
1636
1636
  }
1637
- const o = ht(this.activeEditor), n = gt(this.activeEditor.state);
1637
+ const o = ht(this.activeEditor), n = vt(this.activeEditor.state);
1638
1638
  this.toolbarItems.forEach((e) => {
1639
1639
  if (e.resetDisabled(), e.name.value === "linkedStyles")
1640
1640
  return this.activeEditor && !Ke(this.activeEditor).length ? e.deactivate() : e.activate();
1641
- const i = o.find((l) => l.name === e.name.value);
1641
+ const i = o.find((s) => s.name === e.name.value);
1642
1642
  i ? e.activate(i.attrs) : e.deactivate();
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);
1643
+ const u = o.find((s) => s.name === "styleId");
1644
+ if (u?.attrs.styleId) {
1645
+ const s = {
1646
+ fontSize: "font-size",
1647
+ fontFamily: "font-family",
1648
+ bold: "bold",
1649
+ textAlign: "textAlign"
1650
+ }, r = this.activeEditor.converter?.linkedStyles.find((d) => d.id === u.attrs.styleId);
1651
+ if (s[e.name.value] in r?.definition.styles) {
1652
+ const d = {
1653
+ [e.name.value]: r?.definition.styles[s[e.name.value]]
1654
+ };
1655
+ e.activate(d);
1656
+ }
1657
+ }
1658
+ const a = o.find((s) => s.name === "spacing");
1659
+ e.name.value === "lineHeight" && (i?.attrs?.lineHeight || a) && (e.selectedValue.value = i?.attrs?.lineHeight || a.attrs?.spacing?.line || ""), e.name.value === "tableActions" && (e.disabled.value = !n);
1645
1660
  });
1646
1661
  }
1647
1662
  /**
@@ -1671,73 +1686,73 @@ class ko extends Vt {
1671
1686
  I = new WeakSet(), et = function() {
1672
1687
  this.config.groups && !Array.isArray(this.config.groups) && Object.keys(this.config.groups).length && (this.config.toolbarGroups = Object.keys(this.config.groups));
1673
1688
  }, 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);
1675
- let a = [
1676
- ...d.map((u) => u.name.value),
1677
- ...l.map((u) => u.name.value)
1689
+ const i = document.documentElement.clientWidth, { defaultItems: u, overflowItems: a } = Xn(o, e, i, this.role, n);
1690
+ let s = [
1691
+ ...u.map((d) => d.name.value),
1692
+ ...a.map((d) => d.name.value)
1678
1693
  ];
1679
- this.config.groups && (a = Object.values(this.config.groups).flatMap((u) => u));
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));
1694
+ this.config.groups && (s = Object.values(this.config.groups).flatMap((d) => d));
1695
+ const r = u.filter((d) => s.includes(d.name.value)).filter((d) => !this.config.excludeItems.includes(d.name.value));
1696
+ this.toolbarItems = r, this.overflowItems = a.filter((d) => s.includes(d.name.value));
1682
1697
  }, tt = function() {
1683
1698
  if (!this.activeEditor || !this.activeEditor.converter) return;
1684
- const { typeface: o = "Arial", fontSizePt: n = 12 } = this.activeEditor.converter.getDocumentDefaultStyles() ?? {}, e = this.toolbarItems.find((d) => d.name.value === "fontSize");
1699
+ const { typeface: o = "Arial", fontSizePt: n = 12 } = this.activeEditor.converter.getDocumentDefaultStyles() ?? {}, e = this.toolbarItems.find((u) => u.name.value === "fontSize");
1685
1700
  e && (e.defaultLabel.value = n);
1686
- const i = this.toolbarItems.find((d) => d.name.value === "fontFamily");
1701
+ const i = this.toolbarItems.find((u) => u.name.value === "fontFamily");
1687
1702
  i && (i.defaultLabel.value = o);
1688
1703
  }, nt = function() {
1689
1704
  if (!this.activeEditor || !this.activeEditor.converter || !this.activeEditor.converter.docHiglightColors.size) return;
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 = {
1705
+ const o = this.toolbarItems.find((a) => a.name.value === "highlight"), n = Hn(), e = 7, i = Array.from(this.activeEditor.converter.docHiglightColors).reduce((a, s, r) => {
1706
+ const d = Math.floor(r / e);
1707
+ return a[d] || (a[d] = []), n.includes(s) || a[d].push(f(s)), a;
1708
+ }, []), u = {
1694
1709
  key: "color",
1695
1710
  type: "render",
1696
1711
  render: () => Ne(this, o, i)
1697
1712
  };
1698
- o.nestedOptions.value = [d];
1713
+ o.nestedOptions.value = [u];
1699
1714
  }, We = function() {
1700
1715
  this.activeEditor = null, this.toolbarItems.forEach((o) => {
1701
1716
  const { allowWithoutEditor: n } = o;
1702
1717
  n.value || o.setDisabled(!0);
1703
1718
  });
1704
1719
  }, ot = function() {
1705
- this.activeEditor && (this.undoDepth = vt(this.activeEditor.state), this.redoDepth = yt(this.activeEditor.state));
1720
+ this.activeEditor && (this.undoDepth = gt(this.activeEditor.state), this.redoDepth = yt(this.activeEditor.state));
1706
1721
  }, fe = function({ item: o, argument: n }, e) {
1707
1722
  if (!n || !this.activeEditor) return;
1708
1723
  let i = o.command;
1709
1724
  i in this.activeEditor?.commands && (this.activeEditor.commands[i](n), typeof e == "function" && e(n), this.updateToolbarState());
1710
1725
  };
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");
1726
+ function no(t, l) {
1727
+ if (!t.value || !l?.value?.options?.scale) return;
1728
+ const o = l.value.options.scale, n = t.value.getBoundingClientRect(), e = t.value.querySelectorAll(".pagination-break-wrapper");
1714
1729
  let i;
1715
- e.forEach((d) => {
1716
- const a = (d.getBoundingClientRect().left - n.left) / o * -1 + 1;
1717
- if (i || (i = a), a !== i) {
1718
- const c = a - i;
1719
- d.style.transform = `translateX(${c}px)`;
1730
+ e.forEach((u) => {
1731
+ const s = (u.getBoundingClientRect().left - n.left) / o * -1 + 1;
1732
+ if (i || (i = s), s !== i) {
1733
+ const r = s - i;
1734
+ u.style.transform = `translateX(${r}px)`;
1720
1735
  }
1721
1736
  });
1722
1737
  }
1723
- const oo = (t, s) => {
1724
- const o = t.clientY, n = t.clientX, { view: e } = s, i = e.dom.getBoundingClientRect();
1725
- let d = {
1738
+ const oo = (t, l) => {
1739
+ const o = t.clientY, n = t.clientX, { view: e } = l, i = e.dom.getBoundingClientRect();
1740
+ let u = {
1726
1741
  left: 0,
1727
1742
  top: o
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;
1731
- if (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;
1743
+ }, a = !1;
1744
+ n > i.right ? (u.left = i.left + i.width - 1, a = !0) : n < i.left && (u.left = i.left);
1745
+ const s = e.posAtCoords(u)?.pos;
1746
+ if (s) {
1747
+ let r = s;
1748
+ if (a) {
1749
+ const b = e.state.doc.resolve(s).textOffset, y = e.state.doc.nodeAt(s), E = y?.text?.charAt(b);
1750
+ r = y?.isText && E !== " " ? s - 1 : s;
1736
1751
  }
1737
- const u = e.state.tr.setSelection(
1738
- Xe.create(e.state.doc, c)
1752
+ const d = e.state.tr.setSelection(
1753
+ Xe.create(e.state.doc, r)
1739
1754
  );
1740
- e.dispatch(u), e.focus();
1755
+ e.dispatch(d), e.focus();
1741
1756
  }
1742
1757
  }, io = { class: "numbering" }, Ae = 200, so = "flex-end", lo = {
1743
1758
  __name: "Ruler",
@@ -1756,13 +1771,13 @@ const oo = (t, s) => {
1756
1771
  }
1757
1772
  },
1758
1773
  emits: ["margin-change"],
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);
1761
- let g = 0;
1774
+ setup(t, { emit: l }) {
1775
+ const o = l, n = t, e = g(null), i = g([]), u = g("#CCCCCC"), a = g("#2563EB66"), s = g(null), r = g(null), d = g(!1), c = g(null), b = qe({ side: "left", x: 0 }), y = qe({ side: "right", x: 0 }), h = g(!1), E = g(0);
1776
+ let v = 0;
1762
1777
  const D = () => {
1763
1778
  if (n.editor.options.mode !== "docx") return;
1764
1779
  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;
1780
+ s.value = H, r.value = M, y.x = H.width * 96 - M.right * 96, b.x = M.left * 96;
1766
1781
  for (let R = 0; R < H.width; R++) {
1767
1782
  const Z = `${5.5}px`, ae = H.width - R;
1768
1783
  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;
@@ -1790,39 +1805,39 @@ const oo = (t, s) => {
1790
1805
  if (!e.value) return;
1791
1806
  const H = e.value.parentElement.querySelector(".super-editor").getBoundingClientRect();
1792
1807
  return {
1793
- left: `${r.value.x}px`,
1808
+ left: `${c.value.x}px`,
1794
1809
  minHeight: `${H.height}px`
1795
1810
  };
1796
1811
  }), z = (T) => {
1797
- u.value = !0, ge();
1812
+ d.value = !0, ve();
1798
1813
  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;
1814
+ c.value = M === "left-margin-handle" ? b : y, E.value = c.value.x, v = T.clientX - c.value.x, h.value = !0;
1800
1815
  }, B = (T) => {
1801
- if (!u.value) return;
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);
1816
+ if (!d.value) return;
1817
+ const M = T.clientX - v;
1818
+ c.value.x = M, c.value.side === "left" ? M <= 0 ? c.value.x = 0 : M >= y.x - Ae && (c.value.x = y.x - Ae) : M >= s.value.width * 96 ? c.value.x = s.value.width * 96 : M <= b.x + Ae && (c.value.x = b.x + Ae);
1804
1819
  }, q = () => {
1805
- if (u.value = !1, h.value = !1, ve(), r.value && r.value.x !== E.value) {
1820
+ if (d.value = !1, h.value = !1, ge(), c.value && c.value.x !== E.value) {
1806
1821
  const T = ce();
1807
1822
  o("margin-change", {
1808
- side: r.value.side,
1823
+ side: c.value.side,
1809
1824
  value: T
1810
1825
  });
1811
1826
  }
1812
- }, ge = () => {
1813
- d.value = l.value;
1814
1827
  }, ve = () => {
1815
- d.value = "#CCC";
1816
- }, ce = () => r.value.side === "left" ? r.value.x / 96 : (a.value.width * 96 - r.value.x) / 96, de = j(() => ({
1828
+ u.value = a.value;
1829
+ }, ge = () => {
1830
+ u.value = "#CCC";
1831
+ }, ce = () => c.value.side === "left" ? c.value.x / 96 : (s.value.width * 96 - c.value.x) / 96, de = j(() => ({
1817
1832
  "--alignment": so,
1818
- "--ruler-handle-color": d.value,
1819
- "--ruler-handle-active-color": l.value
1833
+ "--ruler-handle-color": u.value,
1834
+ "--ruler-handle-active-color": a.value
1820
1835
  }));
1821
- return ke(() => {
1836
+ return we(() => {
1822
1837
  i.value = D(), window.addEventListener("mousemove", B), window.addEventListener("mouseup", q);
1823
1838
  }), Rt(() => {
1824
1839
  window.removeEventListener("mousemove", B), window.removeEventListener("mouseup", q);
1825
- }), (T, M) => (w(), k("div", {
1840
+ }), (T, M) => (k(), w("div", {
1826
1841
  class: "ruler",
1827
1842
  ref_key: "ruler",
1828
1843
  ref: e,
@@ -1840,21 +1855,21 @@ const oo = (t, s) => {
1840
1855
  onMousedown: z,
1841
1856
  style: J(C.value("right"))
1842
1857
  }, null, 36),
1843
- h.value ? (w(), k("div", {
1858
+ h.value ? (k(), w("div", {
1844
1859
  key: 0,
1845
1860
  class: "vertical-indicator",
1846
1861
  style: J(F.value)
1847
1862
  }, null, 4)) : ne("", !0),
1848
- (w(!0), k(U, null, Q(i.value, (H) => (w(), k("div", {
1863
+ (k(!0), w(U, null, Q(i.value, (H) => (k(), w("div", {
1849
1864
  class: oe(H.className),
1850
1865
  style: J(p.value(H))
1851
1866
  }, [
1852
1867
  x("div", io, ie(H.numbering), 1),
1853
- (w(!0), k(U, null, Q(H.elements, (R) => (w(), k("div", {
1868
+ (k(!0), w(U, null, Q(H.elements, (R) => (k(), w("div", {
1854
1869
  class: oe(R.className),
1855
1870
  style: J(p.value(R))
1856
1871
  }, [
1857
- (w(!0), k(U, null, Q(R.elements, (X) => (w(), k("div", {
1872
+ (k(!0), w(U, null, Q(R.elements, (X) => (k(), w("div", {
1858
1873
  class: oe(X.className),
1859
1874
  style: J(p.value(X))
1860
1875
  }, null, 6))), 256))
@@ -1894,18 +1909,18 @@ const oo = (t, s) => {
1894
1909
  "comments-loaded",
1895
1910
  "selection-update"
1896
1911
  ],
1897
- setup(t, { emit: s }) {
1898
- const o = s, n = t, e = v(!1), i = Ze(null), d = v(null), l = v(null);
1899
- let a;
1900
- const c = () => {
1901
- clearTimeout(a);
1902
- }, u = (p, C = 10, F = 500) => {
1912
+ setup(t, { emit: l }) {
1913
+ const o = l, n = t, e = g(!1), i = Ze(null), u = g(null), a = g(null);
1914
+ let s;
1915
+ const r = () => {
1916
+ clearTimeout(s);
1917
+ }, d = (p, C = 10, F = 500) => {
1903
1918
  const z = p.getMap("meta"), B = () => {
1904
1919
  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.");
1920
+ q ? (r(), h({ content: q })) : C > 0 ? (console.debug(`Waiting for 'docx' data... retries left: ${C}`), s = setTimeout(B, F), C--) : console.warn("Failed to load docx data from meta map.");
1906
1921
  };
1907
1922
  B();
1908
- }, r = async () => {
1923
+ }, c = async () => {
1909
1924
  try {
1910
1925
  const [p, C, F, z] = await Oe.loadXmlData(n.fileSource);
1911
1926
  return { content: p, media: C, mediaFiles: F, fonts: z };
@@ -1914,12 +1929,12 @@ const oo = (t, s) => {
1914
1929
  }
1915
1930
  }, b = async () => {
1916
1931
  if (n.fileSource) {
1917
- const p = await r();
1932
+ const p = await c();
1918
1933
  return h(p);
1919
1934
  } else if (n.options.ydoc && n.options.collaborationProvider) {
1920
1935
  delete n.options.content;
1921
1936
  const p = n.options.ydoc, C = n.options.collaborationProvider, F = () => {
1922
- u(p), C.off("synced", F);
1937
+ d(p), C.off("synced", F);
1923
1938
  };
1924
1939
  C.on("synced", F);
1925
1940
  }
@@ -1929,7 +1944,7 @@ const oo = (t, s) => {
1929
1944
  }, h = async ({ content: p, media: C = {}, mediaFiles: F = {}, fonts: z = {} } = {}) => {
1930
1945
  i.value = new Oe({
1931
1946
  mode: "docx",
1932
- element: l.value,
1947
+ element: a.value,
1933
1948
  fileSource: n.fileSource,
1934
1949
  extensions: y(),
1935
1950
  externalExtensions: n.options.externalExtensions,
@@ -1940,7 +1955,7 @@ const oo = (t, s) => {
1940
1955
  fonts: z,
1941
1956
  ...n.options
1942
1957
  }), i.value.on("paginationUpdate", () => {
1943
- no(l, i);
1958
+ no(a, i);
1944
1959
  }), i.value.on("collaborationReady", () => {
1945
1960
  setTimeout(() => {
1946
1961
  e.value = !0;
@@ -1948,14 +1963,14 @@ const oo = (t, s) => {
1948
1963
  });
1949
1964
  }, E = (p) => {
1950
1965
  o("editor-keydown", { editor: i.value });
1951
- }, g = (p) => {
1966
+ }, v = (p) => {
1952
1967
  o("editor-click", { editor: i.value });
1953
- let C = l.value?.querySelector(".ProseMirror");
1968
+ let C = a.value?.querySelector(".ProseMirror");
1954
1969
  if (!C || !i.value)
1955
1970
  return;
1956
1971
  !C.contains(p.target) && i.value.isEditable && i.value.view?.focus();
1957
1972
  };
1958
- ke(() => {
1973
+ we(() => {
1959
1974
  b(), (n.options?.suppressSkeletonLoader || !n.options?.collaborationProvider) && (e.value = !0);
1960
1975
  });
1961
1976
  const D = (p) => {
@@ -1966,9 +1981,9 @@ const oo = (t, s) => {
1966
1981
  i.value?.updatePageStyle({ pageMargins: B });
1967
1982
  };
1968
1983
  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, {
1984
+ r(), i.value?.destroy(), i.value = null;
1985
+ }), (p, C) => (k(), w("div", ro, [
1986
+ t.options.rulers && i.value ? (k(), Ot(ao, {
1972
1987
  key: 0,
1973
1988
  class: "ruler",
1974
1989
  editor: i.value,
@@ -1977,18 +1992,18 @@ const oo = (t, s) => {
1977
1992
  x("div", {
1978
1993
  class: "super-editor",
1979
1994
  ref_key: "editorWrapper",
1980
- ref: d,
1995
+ ref: u,
1981
1996
  onKeydown: E,
1982
- onClick: g,
1997
+ onClick: v,
1983
1998
  onMousedown: D
1984
1999
  }, [
1985
2000
  x("div", {
1986
2001
  ref_key: "editorElem",
1987
- ref: l,
2002
+ ref: a,
1988
2003
  class: "editor-element super-editor__element"
1989
2004
  }, null, 512)
1990
2005
  ], 544),
1991
- e.value ? ne("", !0) : (w(), k("div", co, [
2006
+ e.value ? ne("", !0) : (k(), w("div", co, [
1992
2007
  x("div", uo, [
1993
2008
  V($(Y), {
1994
2009
  text: "",
@@ -2038,11 +2053,11 @@ const oo = (t, s) => {
2038
2053
  }, Co = /* @__PURE__ */ K(mo, [["__scopeId", "data-v-ff8f86f4"]]), _o = {
2039
2054
  __name: "BasicUpload",
2040
2055
  emits: ["file-change"],
2041
- setup(t, { emit: s }) {
2042
- const o = s, n = (e) => {
2056
+ setup(t, { emit: l }) {
2057
+ const o = l, n = (e) => {
2043
2058
  o("file-change", e.target.files[0]);
2044
2059
  };
2045
- return (e, i) => (w(), k("div", null, [
2060
+ return (e, i) => (k(), w("div", null, [
2046
2061
  x("input", {
2047
2062
  type: "file",
2048
2063
  id: "fileInput",
@@ -2074,35 +2089,35 @@ const oo = (t, s) => {
2074
2089
  }
2075
2090
  },
2076
2091
  emits: ["update:modelValue", "focus", "blur"],
2077
- setup(t, { emit: s }) {
2078
- const o = s, n = t, e = Ze(), i = v(null), d = v(!1), l = ({ editor: y, transaction: h }) => {
2092
+ setup(t, { emit: l }) {
2093
+ const o = l, n = t, e = Ze(), i = g(null), u = g(!1), a = ({ editor: y, transaction: h }) => {
2079
2094
  const E = y.getHTML();
2080
2095
  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 });
2085
- }, u = async () => {
2086
- wt.options.placeholder = n.placeholder || "Type something...", n.options.onTransaction = l, n.options.onFocus = a, n.options.onBlur = c, e.value = new Oe({
2096
+ }, s = ({ editor: y, transaction: h }) => {
2097
+ u.value = !0, b(), o("focus", { editor: y, transaction: h });
2098
+ }, r = ({ editor: y, transaction: h }) => {
2099
+ u.value = !1, o("blur", { editor: y, transaction: h });
2100
+ }, d = async () => {
2101
+ kt.options.placeholder = n.placeholder || "Type something...", n.options.onTransaction = a, n.options.onFocus = s, n.options.onBlur = r, e.value = new Oe({
2087
2102
  mode: "text",
2088
2103
  content: document.getElementById("currentContent"),
2089
2104
  element: i.value,
2090
- extensions: kt(),
2105
+ extensions: wt(),
2091
2106
  users: n.users,
2092
2107
  ...n.options
2093
2108
  });
2094
- }, r = () => {
2095
- d.value = !0, e.value?.view?.focus();
2109
+ }, c = () => {
2110
+ u.value = !0, e.value?.view?.focus();
2096
2111
  }, b = () => {
2097
2112
  e.value?.setOptions({ users: n.users });
2098
2113
  };
2099
- return ke(() => {
2100
- u();
2114
+ return we(() => {
2115
+ d();
2101
2116
  }), Ye(() => {
2102
2117
  e.value?.destroy(), e.value = null;
2103
- }), (y, h) => (w(), k("div", {
2104
- class: oe(["super-editor super-input", { "super-input-active": d.value }]),
2105
- onClick: we(r, ["stop", "prevent"])
2118
+ }), (y, h) => (k(), w("div", {
2119
+ class: oe(["super-editor super-input", { "super-input-active": u.value }]),
2120
+ onClick: ke(c, ["stop", "prevent"])
2106
2121
  }, [
2107
2122
  x("div", {
2108
2123
  id: "currentContent",
@@ -2133,7 +2148,7 @@ export {
2133
2148
  Ho as SuperConverter,
2134
2149
  Co as SuperEditor,
2135
2150
  xo as SuperInput,
2136
- ko as SuperToolbar,
2151
+ wo as SuperToolbar,
2137
2152
  zt as Toolbar,
2138
2153
  Fo as TrackChangesBasePluginKey,
2139
2154
  No as createZip,
@@ -2141,7 +2156,7 @@ export {
2141
2156
  ht as getActiveFormatting,
2142
2157
  eo as getAllowedImageDimensions,
2143
2158
  Lo as getMarksFromSelection,
2144
- kt as getRichTextExtensions,
2159
+ wt as getRichTextExtensions,
2145
2160
  bt as getStarterExtensions,
2146
2161
  Mo as helpers,
2147
2162
  Do as trackChangesHelpers