@bygga.dev/editor 1.9.4 → 1.9.7

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.
@@ -1,34 +1,34 @@
1
- import { $ as e, A as t, B as n, D as r, E as i, F as a, G as o, I as s, J as c, K as l, L as u, N as d, O as f, P as p, Q as m, S as h, T as g, U as _, V as ee, W as v, X as y, Y as b, Z as x, a as te, at as S, b as ne, ft as C, gt as w, h as T, ht as re, j as E, k as D, lt as O, pt as k, st as ie, t as ae, tt as oe, ut as A, x as j, z as se } from "./providerKeys-ZibeU1i6.js";
2
- import { At as M, Cn as ce, Ct as le, Dt as N, Et as P, Ft as F, It as I, M as ue, Mt as de, Nt as fe, Ot as pe, Pt as L, S as me, Sn as he, St as ge, T as R, Tn as _e, Tt as ve, X as z, Z as ye, _ as be, _t as B, at as xe, bn as Se, bt as Ce, c as we, d as Te, dt as Ee, ft as De, gt as Oe, h as ke, ht as Ae, j as je, jn as Me, jt as V, k as Ne, kn as Pe, kt as H, l as Fe, mt as Ie, n as Le, ot as Re, pt as ze, r as Be, s as Ve, t as He, u as Ue, ut as We, vn as Ge, vt as Ke, w as qe, wn as Je, wt as Ye, xn as Xe, xt as U, y as W, yn as Ze, yt as Qe } from "./urls-CVNpNWrl.js";
1
+ import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, K as u, L as d, M as f, O as p, P as m, Q as h, R as g, S as _, V as v, W as y, X as ee, Y as te, Z as b, _t as x, ct as ne, dt as S, et as C, g as w, gt as re, j as T, k as E, mt as D, n as ie, nt as ae, o as oe, ot as se, pt as O, q as k, t as ce, ut as A, x as le } from "./providerKeys-ZUO3LJ3M.js";
2
+ import { $ as ue, At as j, Cn as de, Ct as fe, D as M, Dn as pe, Dt as me, E as he, En as ge, Et as _e, F as ve, Ft as ye, It as be, Lt as xe, Mn as Se, Mt as N, N as Ce, Nt as P, On as we, Ot as Te, Pn as Ee, Pt as F, Rt as I, Sn as De, St as Oe, Tn as ke, Tt as Ae, _ as je, _t as L, bt as R, c as Me, ct as Ne, d as Pe, et as z, gt as Fe, h as Ie, ht as Le, j as B, jt as Re, kt as V, l as ze, lt as Be, m as Ve, mt as He, n as Ue, pt as We, r as Ge, s as Ke, t as qe, u as Je, vt as Ye, w as Xe, wn as Ze, wt as Qe, x as $e, xn as et, xt as tt, y as nt, yt as rt, zt as H } from "./urls-BY2YcayU.js";
3
3
  //#region ../core/src/render/TextShell.vue?vue&type=script&setup=true&lang.ts
4
- var G = ["align"], $e = /* @__PURE__ */ d({
4
+ var it = ["align"], at = /* @__PURE__ */ m({
5
5
  __name: "TextShell",
6
6
  props: {
7
7
  width: { type: null },
8
8
  align: { type: null }
9
9
  },
10
10
  setup(e) {
11
- let t = e;
12
- return (e, n) => t.width === "fit" ? (_(), D("div", {
11
+ let n = e;
12
+ return (e, r) => n.width === "fit" ? (y(), t("div", {
13
13
  key: 0,
14
- style: re(C(z)(t.align ?? "left"))
14
+ style: re(O(ue)(n.align ?? "left"))
15
15
  }, [i("table", {
16
- align: t.align ?? "left",
16
+ align: n.align ?? "left",
17
17
  cellpadding: "0",
18
18
  cellspacing: "0",
19
19
  role: "presentation",
20
- style: re(C(ye)())
21
- }, [i("tbody", null, [i("tr", null, [i("td", null, [l(e.$slots, "default")])])])], 12, G)], 4)) : l(e.$slots, "default", { key: 1 });
20
+ style: re(O(z)())
21
+ }, [i("tbody", null, [i("tr", null, [i("td", null, [k(e.$slots, "default")])])])], 12, it)], 4)) : k(e.$slots, "default", { key: 1 });
22
22
  }
23
23
  });
24
24
  //#endregion
25
25
  //#region ../../node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.js
26
- function et(e = {}) {
27
- return new H({ view(t) {
28
- return new tt(t, e);
26
+ function U(e = {}) {
27
+ return new N({ view(t) {
28
+ return new ot(t, e);
29
29
  } });
30
30
  }
31
- var tt = class {
31
+ var ot = class {
32
32
  constructor(e, t) {
33
33
  this.editorView = e, this.cursorPos = null, this.element = null, this.timeout = -1, this.width = t.width ?? 1, this.color = t.color === !1 ? void 0 : t.color || "black", this.class = t.class, this.handlers = [
34
34
  "dragover",
@@ -104,7 +104,7 @@ var tt = class {
104
104
  if (t && !i) {
105
105
  let e = t.pos;
106
106
  if (this.editorView.dragging && this.editorView.dragging.slice) {
107
- let t = L(this.editorView.state.doc, e, this.editorView.dragging.slice);
107
+ let t = xe(this.editorView.state.doc, e, this.editorView.dragging.slice);
108
108
  t != null && (e = t);
109
109
  }
110
110
  this.setCursor(e), this.scheduleRemoval(5e3);
@@ -119,16 +119,16 @@ var tt = class {
119
119
  dragleave(e) {
120
120
  this.editorView.dom.contains(e.relatedTarget) || this.setCursor(null);
121
121
  }
122
- }, K = class e extends V {
122
+ }, W = class e extends F {
123
123
  constructor(e) {
124
124
  super(e, e);
125
125
  }
126
126
  map(t, n) {
127
127
  let r = t.resolve(n.map(this.head));
128
- return e.valid(r) ? new e(r) : V.near(r);
128
+ return e.valid(r) ? new e(r) : F.near(r);
129
129
  }
130
130
  content() {
131
- return I.empty;
131
+ return H.empty;
132
132
  }
133
133
  eq(t) {
134
134
  return t instanceof e && t.head == this.head;
@@ -144,11 +144,11 @@ var tt = class {
144
144
  return new e(t.resolve(n.pos));
145
145
  }
146
146
  getBookmark() {
147
- return new nt(this.anchor);
147
+ return new G(this.anchor);
148
148
  }
149
149
  static valid(e) {
150
150
  let t = e.parent;
151
- if (t.inlineContent || !it(e) || !at(e)) return !1;
151
+ if (t.inlineContent || !ct(e) || !lt(e)) return !1;
152
152
  let n = t.type.spec.allowGapCursor;
153
153
  if (n != null) return n;
154
154
  let r = t.contentMatchAt(e.index()).defaultType;
@@ -171,7 +171,7 @@ var tt = class {
171
171
  for (;;) {
172
172
  let o = n > 0 ? a.firstChild : a.lastChild;
173
173
  if (!o) {
174
- if (a.isAtom && !a.isText && !pe.isSelectable(a)) {
174
+ if (a.isAtom && !a.isText && !Re.isSelectable(a)) {
175
175
  t = t.doc.resolve(i + a.nodeSize * n), r = !1;
176
176
  continue search;
177
177
  }
@@ -185,8 +185,8 @@ var tt = class {
185
185
  }
186
186
  }
187
187
  };
188
- K.prototype.visible = !1, K.findFrom = K.findGapCursorFrom, V.jsonID("gapcursor", K);
189
- var nt = class e {
188
+ W.prototype.visible = !1, W.findFrom = W.findGapCursorFrom, F.jsonID("gapcursor", W);
189
+ var G = class e {
190
190
  constructor(e) {
191
191
  this.pos = e;
192
192
  }
@@ -195,13 +195,13 @@ var nt = class e {
195
195
  }
196
196
  resolve(e) {
197
197
  let t = e.resolve(this.pos);
198
- return K.valid(t) ? new K(t) : V.near(t);
198
+ return W.valid(t) ? new W(t) : F.near(t);
199
199
  }
200
200
  };
201
- function rt(e) {
201
+ function st(e) {
202
202
  return e.isAtom || e.spec.isolating || e.spec.createGapCursor;
203
203
  }
204
- function it(e) {
204
+ function ct(e) {
205
205
  for (let t = e.depth; t >= 0; t--) {
206
206
  let n = e.index(t), r = e.node(t);
207
207
  if (n == 0) {
@@ -209,13 +209,13 @@ function it(e) {
209
209
  continue;
210
210
  }
211
211
  for (let e = r.child(n - 1);; e = e.lastChild) {
212
- if (e.childCount == 0 && !e.inlineContent || rt(e.type)) return !0;
212
+ if (e.childCount == 0 && !e.inlineContent || st(e.type)) return !0;
213
213
  if (e.inlineContent) return !1;
214
214
  }
215
215
  }
216
216
  return !0;
217
217
  }
218
- function at(e) {
218
+ function lt(e) {
219
219
  for (let t = e.depth; t >= 0; t--) {
220
220
  let n = e.indexAfter(t), r = e.node(t);
221
221
  if (n == r.childCount) {
@@ -223,90 +223,90 @@ function at(e) {
223
223
  continue;
224
224
  }
225
225
  for (let e = r.child(n);; e = e.firstChild) {
226
- if (e.childCount == 0 && !e.inlineContent || rt(e.type)) return !0;
226
+ if (e.childCount == 0 && !e.inlineContent || st(e.type)) return !0;
227
227
  if (e.inlineContent) return !1;
228
228
  }
229
229
  }
230
230
  return !0;
231
231
  }
232
- function ot() {
233
- return new H({ props: {
234
- decorations: ut,
232
+ function ut() {
233
+ return new N({ props: {
234
+ decorations: mt,
235
235
  createSelectionBetween(e, t, n) {
236
- return t.pos == n.pos && K.valid(n) ? new K(n) : null;
236
+ return t.pos == n.pos && W.valid(n) ? new W(n) : null;
237
237
  },
238
- handleClick: ct,
239
- handleKeyDown: st,
240
- handleDOMEvents: { beforeinput: lt }
238
+ handleClick: ft,
239
+ handleKeyDown: dt,
240
+ handleDOMEvents: { beforeinput: pt }
241
241
  } });
242
242
  }
243
- var st = ve({
244
- ArrowLeft: q("horiz", -1),
245
- ArrowRight: q("horiz", 1),
246
- ArrowUp: q("vert", -1),
247
- ArrowDown: q("vert", 1)
243
+ var dt = Te({
244
+ ArrowLeft: K("horiz", -1),
245
+ ArrowRight: K("horiz", 1),
246
+ ArrowUp: K("vert", -1),
247
+ ArrowDown: K("vert", 1)
248
248
  });
249
- function q(e, t) {
249
+ function K(e, t) {
250
250
  let n = e == "vert" ? t > 0 ? "down" : "up" : t > 0 ? "right" : "left";
251
251
  return function(e, r, i) {
252
252
  let a = e.selection, o = t > 0 ? a.$to : a.$from, s = a.empty;
253
- if (a instanceof de) {
253
+ if (a instanceof ye) {
254
254
  if (!i.endOfTextblock(n) || o.depth == 0) return !1;
255
255
  s = !1, o = e.doc.resolve(t > 0 ? o.after() : o.before());
256
256
  }
257
- let c = K.findGapCursorFrom(o, t, s);
258
- return c ? (r && r(e.tr.setSelection(new K(c))), !0) : !1;
257
+ let c = W.findGapCursorFrom(o, t, s);
258
+ return c ? (r && r(e.tr.setSelection(new W(c))), !0) : !1;
259
259
  };
260
260
  }
261
- function ct(e, t, n) {
261
+ function ft(e, t, n) {
262
262
  if (!e || !e.editable) return !1;
263
263
  let r = e.state.doc.resolve(t);
264
- if (!K.valid(r)) return !1;
264
+ if (!W.valid(r)) return !1;
265
265
  let i = e.posAtCoords({
266
266
  left: n.clientX,
267
267
  top: n.clientY
268
268
  });
269
- return i && i.inside > -1 && pe.isSelectable(e.state.doc.nodeAt(i.inside)) ? !1 : (e.dispatch(e.state.tr.setSelection(new K(r))), !0);
269
+ return i && i.inside > -1 && Re.isSelectable(e.state.doc.nodeAt(i.inside)) ? !1 : (e.dispatch(e.state.tr.setSelection(new W(r))), !0);
270
270
  }
271
- function lt(e, t) {
272
- if (t.inputType != "insertCompositionText" || !(e.state.selection instanceof K)) return !1;
271
+ function pt(e, t) {
272
+ if (t.inputType != "insertCompositionText" || !(e.state.selection instanceof W)) return !1;
273
273
  let { $from: n } = e.state.selection, r = n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);
274
274
  if (!r) return !1;
275
- let i = F.empty;
276
- for (let e = r.length - 1; e >= 0; e--) i = F.from(r[e].createAndFill(null, i));
277
- let a = e.state.tr.replace(n.pos, n.pos, new I(i, 0, 0));
278
- return a.setSelection(de.near(a.doc.resolve(n.pos + 1))), e.dispatch(a), !1;
275
+ let i = I.empty;
276
+ for (let e = r.length - 1; e >= 0; e--) i = I.from(r[e].createAndFill(null, i));
277
+ let a = e.state.tr.replace(n.pos, n.pos, new H(i, 0, 0));
278
+ return a.setSelection(ye.near(a.doc.resolve(n.pos + 1))), e.dispatch(a), !1;
279
279
  }
280
- function ut(e) {
281
- if (!(e.selection instanceof K)) return null;
280
+ function mt(e) {
281
+ if (!(e.selection instanceof W)) return null;
282
282
  let t = document.createElement("div");
283
- return t.className = "ProseMirror-gapcursor", N.create(e.doc, [P.widget(e.selection.head, t, { key: "gapcursor" })]);
283
+ return t.className = "ProseMirror-gapcursor", j.create(e.doc, [V.widget(e.selection.head, t, { key: "gapcursor" })]);
284
284
  }
285
285
  //#endregion
286
286
  //#region ../../node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.js
287
- var J = 200, Y = function() {};
288
- Y.prototype.append = function(e) {
289
- return e.length ? (e = Y.from(e), !this.length && e || e.length < J && this.leafAppend(e) || this.length < J && e.leafPrepend(this) || this.appendInner(e)) : this;
290
- }, Y.prototype.prepend = function(e) {
291
- return e.length ? Y.from(e).append(this) : this;
292
- }, Y.prototype.appendInner = function(e) {
293
- return new ft(this, e);
294
- }, Y.prototype.slice = function(e, t) {
295
- return e === void 0 && (e = 0), t === void 0 && (t = this.length), e >= t ? Y.empty : this.sliceInner(Math.max(0, e), Math.min(this.length, t));
296
- }, Y.prototype.get = function(e) {
287
+ var ht = 200, q = function() {};
288
+ q.prototype.append = function(e) {
289
+ return e.length ? (e = q.from(e), !this.length && e || e.length < ht && this.leafAppend(e) || this.length < ht && e.leafPrepend(this) || this.appendInner(e)) : this;
290
+ }, q.prototype.prepend = function(e) {
291
+ return e.length ? q.from(e).append(this) : this;
292
+ }, q.prototype.appendInner = function(e) {
293
+ return new _t(this, e);
294
+ }, q.prototype.slice = function(e, t) {
295
+ return e === void 0 && (e = 0), t === void 0 && (t = this.length), e >= t ? q.empty : this.sliceInner(Math.max(0, e), Math.min(this.length, t));
296
+ }, q.prototype.get = function(e) {
297
297
  if (!(e < 0 || e >= this.length)) return this.getInner(e);
298
- }, Y.prototype.forEach = function(e, t, n) {
298
+ }, q.prototype.forEach = function(e, t, n) {
299
299
  t === void 0 && (t = 0), n === void 0 && (n = this.length), t <= n ? this.forEachInner(e, t, n, 0) : this.forEachInvertedInner(e, t, n, 0);
300
- }, Y.prototype.map = function(e, t, n) {
300
+ }, q.prototype.map = function(e, t, n) {
301
301
  t === void 0 && (t = 0), n === void 0 && (n = this.length);
302
302
  var r = [];
303
303
  return this.forEach(function(t, n) {
304
304
  return r.push(e(t, n));
305
305
  }, t, n), r;
306
- }, Y.from = function(e) {
307
- return e instanceof Y ? e : e && e.length ? new dt(e) : Y.empty;
306
+ }, q.from = function(e) {
307
+ return e instanceof q ? e : e && e.length ? new gt(e) : q.empty;
308
308
  };
309
- var dt = /* @__PURE__ */ function(e) {
309
+ var gt = /* @__PURE__ */ function(e) {
310
310
  function t(t) {
311
311
  e.call(this), this.values = t;
312
312
  }
@@ -326,17 +326,17 @@ var dt = /* @__PURE__ */ function(e) {
326
326
  }, t.prototype.forEachInvertedInner = function(e, t, n, r) {
327
327
  for (var i = t - 1; i >= n; i--) if (e(this.values[i], r + i) === !1) return !1;
328
328
  }, t.prototype.leafAppend = function(e) {
329
- if (this.length + e.length <= J) return new t(this.values.concat(e.flatten()));
329
+ if (this.length + e.length <= ht) return new t(this.values.concat(e.flatten()));
330
330
  }, t.prototype.leafPrepend = function(e) {
331
- if (this.length + e.length <= J) return new t(e.flatten().concat(this.values));
331
+ if (this.length + e.length <= ht) return new t(e.flatten().concat(this.values));
332
332
  }, n.length.get = function() {
333
333
  return this.values.length;
334
334
  }, n.depth.get = function() {
335
335
  return 0;
336
336
  }, Object.defineProperties(t.prototype, n), t;
337
- }(Y);
338
- Y.empty = new dt([]);
339
- var ft = /* @__PURE__ */ function(e) {
337
+ }(q);
338
+ q.empty = new gt([]);
339
+ var _t = /* @__PURE__ */ function(e) {
340
340
  function t(t, n) {
341
341
  e.call(this), this.left = t, this.right = n, this.length = t.length + n.length, this.depth = Math.max(t.depth, n.depth) + 1;
342
342
  }
@@ -363,7 +363,7 @@ var ft = /* @__PURE__ */ function(e) {
363
363
  }, t.prototype.appendInner = function(e) {
364
364
  return this.left.depth >= Math.max(this.right.depth, e.depth) + 1 ? new t(this.left, new t(this.right, e)) : new t(this, e);
365
365
  }, t;
366
- }(Y), pt = 500, X = class e {
366
+ }(q), J = 500, Y = class e {
367
367
  constructor(e, t) {
368
368
  this.items = e, this.eventCount = t;
369
369
  }
@@ -383,9 +383,9 @@ var ft = /* @__PURE__ */ function(e) {
383
383
  return;
384
384
  }
385
385
  if (i) {
386
- u.push(new Z(t.map));
386
+ u.push(new X(t.map));
387
387
  let e = t.step.map(i.slice(a)), n;
388
- e && o.maybeStep(e).doc && (n = o.mapping.maps[o.mapping.maps.length - 1], l.push(new Z(n, void 0, void 0, l.length + u.length))), a--, n && i.appendMap(n, a);
388
+ e && o.maybeStep(e).doc && (n = o.mapping.maps[o.mapping.maps.length - 1], l.push(new X(n, void 0, void 0, l.length + u.length))), a--, n && i.appendMap(n, a);
389
389
  } else o.maybeStep(t.step);
390
390
  if (t.selection) return s = i ? t.selection.map(i.slice(a)) : t.selection, c = new e(this.items.slice(0, r).append(u.reverse().concat(l)), this.eventCount - 1), !1;
391
391
  }, this.items.length, 0), {
@@ -397,21 +397,21 @@ var ft = /* @__PURE__ */ function(e) {
397
397
  addTransform(t, n, r, i) {
398
398
  let a = [], o = this.eventCount, s = this.items, c = !i && s.length ? s.get(s.length - 1) : null;
399
399
  for (let e = 0; e < t.steps.length; e++) {
400
- let r = t.steps[e].invert(t.docs[e]), l = new Z(t.mapping.maps[e], r, n), u;
400
+ let r = t.steps[e].invert(t.docs[e]), l = new X(t.mapping.maps[e], r, n), u;
401
401
  (u = c && c.merge(l)) && (l = u, e ? a.pop() : s = s.slice(0, s.length - 1)), a.push(l), n &&= (o++, void 0), i || (c = l);
402
402
  }
403
403
  let l = o - r.depth;
404
- return l > ht && (s = mt(s, l), o -= l), new e(s.append(a), o);
404
+ return l > yt && (s = vt(s, l), o -= l), new e(s.append(a), o);
405
405
  }
406
406
  remapping(e, t) {
407
- let n = new fe();
407
+ let n = new be();
408
408
  return this.items.forEach((t, r) => {
409
409
  let i = t.mirrorOffset != null && r - t.mirrorOffset >= e ? n.maps.length - t.mirrorOffset : void 0;
410
410
  n.appendMap(t.map, i);
411
411
  }, e, t), n;
412
412
  }
413
413
  addMaps(t) {
414
- return this.eventCount == 0 ? this : new e(this.items.append(t.map((e) => new Z(e))), this.eventCount);
414
+ return this.eventCount == 0 ? this : new e(this.items.append(t.map((e) => new X(e))), this.eventCount);
415
415
  }
416
416
  rebased(t, n) {
417
417
  if (!this.eventCount) return this;
@@ -427,13 +427,13 @@ var ft = /* @__PURE__ */ function(e) {
427
427
  let i = a.maps[n];
428
428
  if (e.step) {
429
429
  let o = t.steps[n].invert(t.docs[n]), l = e.selection && e.selection.map(a.slice(c + 1, n));
430
- l && s++, r.push(new Z(i, o, l));
431
- } else r.push(new Z(i));
430
+ l && s++, r.push(new X(i, o, l));
431
+ } else r.push(new X(i));
432
432
  }, i);
433
433
  let l = [];
434
- for (let e = n; e < o; e++) l.push(new Z(a.maps[e]));
434
+ for (let e = n; e < o; e++) l.push(new X(a.maps[e]));
435
435
  let u = new e(this.items.slice(0, i).append(l).append(r), s);
436
- return u.emptyItemCount() > pt && (u = u.compress(this.items.length - r.length)), u;
436
+ return u.emptyItemCount() > J && (u = u.compress(this.items.length - r.length)), u;
437
437
  }
438
438
  emptyItemCount() {
439
439
  let e = 0;
@@ -450,21 +450,21 @@ var ft = /* @__PURE__ */ function(e) {
450
450
  if (r--, o && n.appendMap(o, r), t) {
451
451
  let s = e.selection && e.selection.map(n.slice(r));
452
452
  s && a++;
453
- let c = new Z(o.invert(), t, s), l, u = i.length - 1;
453
+ let c = new X(o.invert(), t, s), l, u = i.length - 1;
454
454
  (l = i.length && i[u].merge(c)) ? i[u] = l : i.push(c);
455
455
  }
456
456
  } else e.map && r--;
457
- }, this.items.length, 0), new e(Y.from(i.reverse()), a);
457
+ }, this.items.length, 0), new e(q.from(i.reverse()), a);
458
458
  }
459
459
  };
460
- X.empty = new X(Y.empty, 0);
461
- function mt(e, t) {
460
+ Y.empty = new Y(q.empty, 0);
461
+ function vt(e, t) {
462
462
  let n;
463
463
  return e.forEach((e, r) => {
464
464
  if (e.selection && t-- == 0) return n = r, !1;
465
465
  }), e.slice(n);
466
466
  }
467
- var Z = class e {
467
+ var X = class e {
468
468
  constructor(e, t, n, r) {
469
469
  this.map = e, this.step = t, this.selection = n, this.mirrorOffset = r;
470
470
  }
@@ -474,25 +474,25 @@ var Z = class e {
474
474
  if (n) return new e(n.getMap().invert(), n, this.selection);
475
475
  }
476
476
  }
477
- }, Q = class {
477
+ }, Z = class {
478
478
  constructor(e, t, n, r, i) {
479
479
  this.done = e, this.undone = t, this.prevRanges = n, this.prevTime = r, this.prevComposition = i;
480
480
  }
481
- }, ht = 20;
482
- function gt(e, t, n, r) {
483
- let i = n.getMeta($), a;
481
+ }, yt = 20;
482
+ function bt(e, t, n, r) {
483
+ let i = n.getMeta(Q), a;
484
484
  if (i) return i.historyState;
485
- n.getMeta(wt) && (e = new Q(e.done, e.undone, null, 0, -1));
485
+ n.getMeta(Ot) && (e = new Z(e.done, e.undone, null, 0, -1));
486
486
  let o = n.getMeta("appendedTransaction");
487
487
  if (n.steps.length == 0) return e;
488
- if (o && o.getMeta($)) return o.getMeta($).redo ? new Q(e.done.addTransform(n, void 0, r, Ct(t)), e.undone, vt(n.mapping.maps), e.prevTime, e.prevComposition) : new Q(e.done, e.undone.addTransform(n, void 0, r, Ct(t)), null, e.prevTime, e.prevComposition);
488
+ if (o && o.getMeta(Q)) return o.getMeta(Q).redo ? new Z(e.done.addTransform(n, void 0, r, Dt(t)), e.undone, St(n.mapping.maps), e.prevTime, e.prevComposition) : new Z(e.done, e.undone.addTransform(n, void 0, r, Dt(t)), null, e.prevTime, e.prevComposition);
489
489
  if (n.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
490
- let i = n.getMeta("composition"), a = e.prevTime == 0 || !o && e.prevComposition != i && (e.prevTime < (n.time || 0) - r.newGroupDelay || !_t(n, e.prevRanges)), s = o ? yt(e.prevRanges, n.mapping) : vt(n.mapping.maps);
491
- return new Q(e.done.addTransform(n, a ? t.selection.getBookmark() : void 0, r, Ct(t)), X.empty, s, n.time, i ?? e.prevComposition);
492
- } else if (a = n.getMeta("rebased")) return new Q(e.done.rebased(n, a), e.undone.rebased(n, a), yt(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
493
- else return new Q(e.done.addMaps(n.mapping.maps), e.undone.addMaps(n.mapping.maps), yt(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
490
+ let i = n.getMeta("composition"), a = e.prevTime == 0 || !o && e.prevComposition != i && (e.prevTime < (n.time || 0) - r.newGroupDelay || !xt(n, e.prevRanges)), s = o ? Ct(e.prevRanges, n.mapping) : St(n.mapping.maps);
491
+ return new Z(e.done.addTransform(n, a ? t.selection.getBookmark() : void 0, r, Dt(t)), Y.empty, s, n.time, i ?? e.prevComposition);
492
+ } else if (a = n.getMeta("rebased")) return new Z(e.done.rebased(n, a), e.undone.rebased(n, a), Ct(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
493
+ else return new Z(e.done.addMaps(n.mapping.maps), e.undone.addMaps(n.mapping.maps), Ct(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
494
494
  }
495
- function _t(e, t) {
495
+ function xt(e, t) {
496
496
  if (!t) return !1;
497
497
  if (!e.docChanged) return !0;
498
498
  let n = !1;
@@ -500,12 +500,12 @@ function _t(e, t) {
500
500
  for (let i = 0; i < t.length; i += 2) e <= t[i + 1] && r >= t[i] && (n = !0);
501
501
  }), n;
502
502
  }
503
- function vt(e) {
503
+ function St(e) {
504
504
  let t = [];
505
505
  for (let n = e.length - 1; n >= 0 && t.length == 0; n--) e[n].forEach((e, n, r, i) => t.push(r, i));
506
506
  return t;
507
507
  }
508
- function yt(e, t) {
508
+ function Ct(e, t) {
509
509
  if (!e) return null;
510
510
  let n = [];
511
511
  for (let r = 0; r < e.length; r += 2) {
@@ -514,62 +514,62 @@ function yt(e, t) {
514
514
  }
515
515
  return n;
516
516
  }
517
- function bt(e, t, n) {
518
- let r = Ct(t), i = $.get(t).spec.config, a = (n ? e.undone : e.done).popEvent(t, r);
517
+ function wt(e, t, n) {
518
+ let r = Dt(t), i = Q.get(t).spec.config, a = (n ? e.undone : e.done).popEvent(t, r);
519
519
  if (!a) return null;
520
- let o = a.selection.resolve(a.transform.doc), s = (n ? e.done : e.undone).addTransform(a.transform, t.selection.getBookmark(), i, r), c = new Q(n ? s : a.remaining, n ? a.remaining : s, null, 0, -1);
521
- return a.transform.setSelection(o).setMeta($, {
520
+ let o = a.selection.resolve(a.transform.doc), s = (n ? e.done : e.undone).addTransform(a.transform, t.selection.getBookmark(), i, r), c = new Z(n ? s : a.remaining, n ? a.remaining : s, null, 0, -1);
521
+ return a.transform.setSelection(o).setMeta(Q, {
522
522
  redo: n,
523
523
  historyState: c
524
524
  });
525
525
  }
526
- var xt = !1, St = null;
527
- function Ct(e) {
526
+ var Tt = !1, Et = null;
527
+ function Dt(e) {
528
528
  let t = e.plugins;
529
- if (St != t) {
530
- xt = !1, St = t;
529
+ if (Et != t) {
530
+ Tt = !1, Et = t;
531
531
  for (let e = 0; e < t.length; e++) if (t[e].spec.historyPreserveItems) {
532
- xt = !0;
532
+ Tt = !0;
533
533
  break;
534
534
  }
535
535
  }
536
- return xt;
536
+ return Tt;
537
537
  }
538
- var $ = new M("history"), wt = new M("closeHistory");
539
- function Tt(e = {}) {
538
+ var Q = new P("history"), Ot = new P("closeHistory");
539
+ function kt(e = {}) {
540
540
  return e = {
541
541
  depth: e.depth || 100,
542
542
  newGroupDelay: e.newGroupDelay || 500
543
- }, new H({
544
- key: $,
543
+ }, new N({
544
+ key: Q,
545
545
  state: {
546
546
  init() {
547
- return new Q(X.empty, X.empty, null, 0, -1);
547
+ return new Z(Y.empty, Y.empty, null, 0, -1);
548
548
  },
549
549
  apply(t, n, r) {
550
- return gt(n, r, t, e);
550
+ return bt(n, r, t, e);
551
551
  }
552
552
  },
553
553
  config: e,
554
554
  props: { handleDOMEvents: { beforeinput(e, t) {
555
- let n = t.inputType, r = n == "historyUndo" ? Dt : n == "historyRedo" ? Ot : null;
555
+ let n = t.inputType, r = n == "historyUndo" ? jt : n == "historyRedo" ? Mt : null;
556
556
  return !r || !e.editable ? !1 : (t.preventDefault(), r(e.state, e.dispatch));
557
557
  } } }
558
558
  });
559
559
  }
560
- function Et(e, t) {
560
+ function At(e, t) {
561
561
  return (n, r) => {
562
- let i = $.getState(n);
562
+ let i = Q.getState(n);
563
563
  if (!i || (e ? i.undone : i.done).eventCount == 0) return !1;
564
564
  if (r) {
565
- let a = bt(i, n, e);
565
+ let a = wt(i, n, e);
566
566
  a && r(t ? a.scrollIntoView() : a);
567
567
  }
568
568
  return !0;
569
569
  };
570
570
  }
571
- var Dt = Et(!1, !0), Ot = Et(!0, !0);
572
- B.create({
571
+ var jt = At(!1, !0), Mt = At(!0, !0);
572
+ R.create({
573
573
  name: "characterCount",
574
574
  addOptions() {
575
575
  return {
@@ -601,8 +601,8 @@ B.create({
601
601
  },
602
602
  addProseMirrorPlugins() {
603
603
  let e = !1;
604
- return [new H({
605
- key: new M("characterCount"),
604
+ return [new N({
605
+ key: new P("characterCount"),
606
606
  appendTransaction: (t, n, r) => {
607
607
  if (e) return;
608
608
  let i = this.options.limit, a = this.options.autoTrim;
@@ -630,7 +630,7 @@ B.create({
630
630
  }
631
631
  })];
632
632
  }
633
- }), B.create({
633
+ }), R.create({
634
634
  name: "dropCursor",
635
635
  addOptions() {
636
636
  return {
@@ -640,9 +640,9 @@ B.create({
640
640
  };
641
641
  },
642
642
  addProseMirrorPlugins() {
643
- return [et(this.options)];
643
+ return [U(this.options)];
644
644
  }
645
- }), B.create({
645
+ }), R.create({
646
646
  name: "focus",
647
647
  addOptions() {
648
648
  return {
@@ -651,11 +651,11 @@ B.create({
651
651
  };
652
652
  },
653
653
  addProseMirrorPlugins() {
654
- return [new H({
655
- key: new M("focus"),
654
+ return [new N({
655
+ key: new P("focus"),
656
656
  props: { decorations: ({ doc: e, selection: t }) => {
657
657
  let { isEditable: n, isFocused: r } = this.editor, { anchor: i } = t, a = [];
658
- if (!n || !r) return N.create(e, []);
658
+ if (!n || !r) return j.create(e, []);
659
659
  let o = 0;
660
660
  this.options.mode === "deepest" && e.descendants((e, t) => {
661
661
  if (!e.isText) {
@@ -667,28 +667,28 @@ B.create({
667
667
  return e.descendants((e, t) => {
668
668
  if (e.isText || !(i >= t && i <= t + e.nodeSize - 1)) return !1;
669
669
  if (s += 1, this.options.mode === "deepest" && o - s > 0 || this.options.mode === "shallowest" && s > 1) return this.options.mode === "deepest";
670
- a.push(P.node(t, t + e.nodeSize, { class: this.options.className }));
671
- }), N.create(e, a);
670
+ a.push(V.node(t, t + e.nodeSize, { class: this.options.className }));
671
+ }), j.create(e, a);
672
672
  } }
673
673
  })];
674
674
  }
675
- }), B.create({
675
+ }), R.create({
676
676
  name: "gapCursor",
677
677
  addProseMirrorPlugins() {
678
- return [ot()];
678
+ return [ut()];
679
679
  },
680
680
  extendNodeSchema(e) {
681
- return { allowGapCursor: Qe(U(e, "allowGapCursor", {
681
+ return { allowGapCursor: Oe(Qe(e, "allowGapCursor", {
682
682
  name: e.name,
683
683
  options: e.options,
684
684
  storage: e.storage
685
685
  })) ?? null };
686
686
  }
687
687
  });
688
- var kt = "placeholder", At = new M("tiptap__placeholder"), jt = 200;
689
- function Mt(e) {
688
+ var Nt = "placeholder", $ = new P("tiptap__placeholder"), Pt = 200;
689
+ function Ft(e) {
690
690
  let { editor: t, placeholder: n, dataAttribute: r, pos: i, node: a, isEmptyDoc: o, hasAnchor: s, classes: { emptyNode: c, emptyEditor: l } } = e, u = [c];
691
- return o && u.push(l), P.node(i, i + a.nodeSize, {
691
+ return o && u.push(l), V.node(i, i + a.nodeSize, {
692
692
  class: u.join(" "),
693
693
  [r]: typeof n == "function" ? n({
694
694
  editor: t,
@@ -698,17 +698,17 @@ function Mt(e) {
698
698
  }) : n
699
699
  });
700
700
  }
701
- function Nt(e, t) {
701
+ function It(e, t) {
702
702
  return typeof e == "function" ? e(t) : e;
703
703
  }
704
- function Pt({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
704
+ function Lt({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
705
705
  if (!(e.isEditable || !t.showOnlyWhenEditable)) return null;
706
706
  let { anchor: a } = i, o = [], s = e.isEmpty;
707
707
  if (t.showOnlyCurrent && !t.includeChildren) {
708
708
  let i = r.resolve(a), c = i.depth > 0 ? i.node(1) : i.nodeAfter, l = i.depth > 0 ? i.before(1) : a;
709
- if (c && c.type.isTextblock && ge(c)) {
709
+ if (c && c.type.isTextblock && Ae(c)) {
710
710
  let r = a >= l && a <= l + c.nodeSize;
711
- o.push(Mt({
711
+ o.push(Ft({
712
712
  editor: e,
713
713
  isEmptyDoc: s,
714
714
  dataAttribute: n,
@@ -716,7 +716,7 @@ function Pt({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
716
716
  placeholder: t.placeholder,
717
717
  classes: {
718
718
  emptyEditor: t.emptyEditorClass,
719
- emptyNode: Nt(t.emptyNodeClass, {
719
+ emptyNode: It(t.emptyNodeClass, {
720
720
  editor: e,
721
721
  node: c,
722
722
  pos: l,
@@ -728,10 +728,10 @@ function Pt({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
728
728
  }));
729
729
  }
730
730
  } else {
731
- let i = At.getState(e.state), c = i?.topPos ?? 0, l = i?.bottomPos ?? r.content.size;
731
+ let i = $.getState(e.state), c = i?.topPos ?? 0, l = i?.bottomPos ?? r.content.size;
732
732
  r.nodesBetween(c, l, (r, i) => {
733
- let c = a >= i && a <= i + r.nodeSize, l = !r.isLeaf && ge(r);
734
- return r.type.isTextblock && (c || !t.showOnlyCurrent) && l && o.push(Mt({
733
+ let c = a >= i && a <= i + r.nodeSize, l = !r.isLeaf && Ae(r);
734
+ return r.type.isTextblock && (c || !t.showOnlyCurrent) && l && o.push(Ft({
735
735
  editor: e,
736
736
  isEmptyDoc: s,
737
737
  dataAttribute: n,
@@ -739,7 +739,7 @@ function Pt({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
739
739
  placeholder: t.placeholder,
740
740
  classes: {
741
741
  emptyEditor: t.emptyEditorClass,
742
- emptyNode: Nt(t.emptyNodeClass, {
742
+ emptyNode: It(t.emptyNodeClass, {
743
743
  editor: e,
744
744
  node: r,
745
745
  pos: i,
@@ -751,19 +751,19 @@ function Pt({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
751
751
  })), t.includeChildren;
752
752
  });
753
753
  }
754
- return N.create(r, o);
754
+ return j.create(r, o);
755
755
  }
756
- function Ft(e) {
756
+ function Rt(e) {
757
757
  return e.replace(/\s+/g, "-").replace(/[^a-zA-Z0-9-]/g, "").replace(/^[0-9-]+/, "").replace(/^-+/, "").toLowerCase();
758
758
  }
759
- function It(e) {
759
+ function zt(e) {
760
760
  let t = getComputedStyle(e), n = `${t.overflow} ${t.overflowY} ${t.overflowX}`;
761
761
  return /auto|scroll|overlay/.test(n);
762
762
  }
763
- function Lt(e) {
763
+ function Bt(e) {
764
764
  let t = e;
765
765
  for (; t;) {
766
- if (It(t)) return t;
766
+ if (zt(t)) return t;
767
767
  let e = t.parentElement;
768
768
  if (!e) {
769
769
  let e = t.getRootNode();
@@ -777,19 +777,19 @@ function Lt(e) {
777
777
  }
778
778
  return window;
779
779
  }
780
- function Rt(e) {
780
+ function Vt(e) {
781
781
  return e === window ? {
782
782
  top: 0,
783
783
  bottom: window.innerHeight
784
784
  } : e.getBoundingClientRect();
785
785
  }
786
- function zt({ view: e, scrollContainer: t }) {
786
+ function Ht({ view: e, scrollContainer: t }) {
787
787
  let n = e.dom.getBoundingClientRect();
788
788
  if (n.width <= 0 || n.height <= 0) return null;
789
- let r = t ? Rt(t) : {
789
+ let r = t ? Vt(t) : {
790
790
  top: 0,
791
791
  bottom: window.innerHeight
792
- }, i = Math.max(n.top, r.top) - jt, a = Math.min(n.bottom, r.bottom) + jt;
792
+ }, i = Math.max(n.top, r.top) - Pt, a = Math.min(n.bottom, r.bottom) + Pt;
793
793
  if (i >= a) return null;
794
794
  let o = n.left + 1, s = n.right - 1;
795
795
  if (o > s) return null;
@@ -807,7 +807,7 @@ function zt({ view: e, scrollContainer: t }) {
807
807
  bottom: p.pos
808
808
  };
809
809
  }
810
- var Bt = {
810
+ var Ut = {
811
811
  init() {
812
812
  return {
813
813
  topPos: null,
@@ -815,7 +815,7 @@ var Bt = {
815
815
  };
816
816
  },
817
817
  apply(e, t) {
818
- let n = e.getMeta(At);
818
+ let n = e.getMeta($);
819
819
  return n?.positions ? {
820
820
  topPos: n.positions.top,
821
821
  bottomPos: n.positions.bottom
@@ -825,16 +825,16 @@ var Bt = {
825
825
  } : t;
826
826
  }
827
827
  };
828
- function Vt(e) {
829
- let t = Lt(e.dom), n = () => {
830
- let n = zt({
828
+ function Wt(e) {
829
+ let t = Bt(e.dom), n = () => {
830
+ let n = Ht({
831
831
  view: e,
832
832
  scrollContainer: t
833
833
  });
834
834
  if (n === null) return;
835
- let r = At.getState(e.state);
835
+ let r = $.getState(e.state);
836
836
  if (r?.topPos === n.top && r?.bottomPos === n.bottom) return;
837
- let i = e.state.tr.setMeta(At, { positions: n });
837
+ let i = e.state.tr.setMeta($, { positions: n });
838
838
  e.dispatch(i);
839
839
  }, r = null, i = 0, a = () => {
840
840
  r === null && (r = requestAnimationFrame(() => {
@@ -856,13 +856,13 @@ function Vt(e) {
856
856
  }
857
857
  };
858
858
  }
859
- function Ht({ editor: e, options: t }) {
860
- let n = t.dataAttribute ? `data-${Ft(t.dataAttribute)}` : `data-${kt}`;
861
- return new H({
862
- key: At,
863
- state: Bt,
864
- view: Vt,
865
- props: { decorations: ({ doc: r, selection: i }) => Pt({
859
+ function Gt({ editor: e, options: t }) {
860
+ let n = t.dataAttribute ? `data-${Rt(t.dataAttribute)}` : `data-${Nt}`;
861
+ return new N({
862
+ key: $,
863
+ state: Ut,
864
+ view: Wt,
865
+ props: { decorations: ({ doc: r, selection: i }) => Lt({
866
866
  editor: e,
867
867
  options: t,
868
868
  dataAttribute: n,
@@ -871,13 +871,13 @@ function Ht({ editor: e, options: t }) {
871
871
  }) }
872
872
  });
873
873
  }
874
- var Ut = B.create({
874
+ var Kt = R.create({
875
875
  name: "placeholder",
876
876
  addOptions() {
877
877
  return {
878
878
  emptyEditorClass: "is-editor-empty",
879
879
  emptyNodeClass: "is-empty",
880
- dataAttribute: kt,
880
+ dataAttribute: Nt,
881
881
  placeholder: "Write something …",
882
882
  showOnlyWhenEditable: !0,
883
883
  showOnlyCurrent: !0,
@@ -885,31 +885,31 @@ var Ut = B.create({
885
885
  };
886
886
  },
887
887
  addProseMirrorPlugins() {
888
- return [Ht({
888
+ return [Gt({
889
889
  editor: this.editor,
890
890
  options: this.options
891
891
  })];
892
892
  }
893
- }), Wt = ".ProseMirror:not(.ProseMirror-focused) *::selection {\n background: transparent;\n}\n\n.ProseMirror:not(.ProseMirror-focused) *::-moz-selection {\n background: transparent;\n}";
894
- B.create({
893
+ }), qt = ".ProseMirror:not(.ProseMirror-focused) *::selection {\n background: transparent;\n}\n\n.ProseMirror:not(.ProseMirror-focused) *::-moz-selection {\n background: transparent;\n}";
894
+ R.create({
895
895
  name: "selection",
896
896
  addOptions() {
897
897
  return { className: "selection" };
898
898
  },
899
899
  addProseMirrorPlugins() {
900
900
  let { editor: e, options: t } = this;
901
- return e.options.injectCSS && typeof document < "u" && Ce(Wt, e.options.injectNonce, "selection"), [new H({
902
- key: new M("selection"),
901
+ return e.options.injectCSS && typeof document < "u" && fe(qt, e.options.injectNonce, "selection"), [new N({
902
+ key: new P("selection"),
903
903
  props: { decorations(n) {
904
- return n.selection.empty || e.isFocused || !e.isEditable || le(n.selection) || e.view.dragging ? null : N.create(n.doc, [P.inline(n.selection.from, n.selection.to, { class: t.className })]);
904
+ return n.selection.empty || e.isFocused || !e.isEditable || _e(n.selection) || e.view.dragging ? null : j.create(n.doc, [V.inline(n.selection.from, n.selection.to, { class: t.className })]);
905
905
  } }
906
906
  })];
907
907
  }
908
908
  });
909
- function Gt({ types: e, node: t }) {
909
+ function Jt({ types: e, node: t }) {
910
910
  return t && Array.isArray(e) && e.includes(t.type) || t?.type === e;
911
911
  }
912
- B.create({
912
+ R.create({
913
913
  name: "trailingNode",
914
914
  addOptions() {
915
915
  return {
@@ -918,8 +918,8 @@ B.create({
918
918
  };
919
919
  },
920
920
  addProseMirrorPlugins() {
921
- let e = new M(this.name), t = this.options.node || this.editor.schema.topNodeType.contentMatch.defaultType?.name || "paragraph", n = Object.entries(this.editor.schema.nodes).map(([, e]) => e).filter((e) => (this.options.notAfter || []).concat(t).includes(e.name));
922
- return [new H({
921
+ let e = new P(this.name), t = this.options.node || this.editor.schema.topNodeType.contentMatch.defaultType?.name || "paragraph", n = Object.entries(this.editor.schema.nodes).map(([, e]) => e).filter((e) => (this.options.notAfter || []).concat(t).includes(e.name));
922
+ return [new N({
923
923
  key: e,
924
924
  appendTransaction: (n, r, i) => {
925
925
  let { doc: a, tr: o, schema: s } = i, c = e.getState(i), l = a.content.size, u = s.nodes[t];
@@ -928,7 +928,7 @@ B.create({
928
928
  state: {
929
929
  init: (e, t) => {
930
930
  let r = t.tr.doc.lastChild;
931
- return !Gt({
931
+ return !Jt({
932
932
  node: r,
933
933
  types: n
934
934
  });
@@ -936,7 +936,7 @@ B.create({
936
936
  apply: (e, t) => {
937
937
  if (!e.docChanged || e.getMeta("__uniqueIDTransaction")) return t;
938
938
  let r = e.doc.lastChild;
939
- return !Gt({
939
+ return !Jt({
940
940
  node: r,
941
941
  types: n
942
942
  });
@@ -945,7 +945,7 @@ B.create({
945
945
  })];
946
946
  }
947
947
  });
948
- var Kt = B.create({
948
+ var Yt = R.create({
949
949
  name: "undoRedo",
950
950
  addOptions() {
951
951
  return {
@@ -955,12 +955,12 @@ var Kt = B.create({
955
955
  },
956
956
  addCommands() {
957
957
  return {
958
- undo: () => ({ state: e, dispatch: t }) => Dt(e, t),
959
- redo: () => ({ state: e, dispatch: t }) => Ot(e, t)
958
+ undo: () => ({ state: e, dispatch: t }) => jt(e, t),
959
+ redo: () => ({ state: e, dispatch: t }) => Mt(e, t)
960
960
  };
961
961
  },
962
962
  addProseMirrorPlugins() {
963
- return [Tt(this.options)];
963
+ return [kt(this.options)];
964
964
  },
965
965
  addKeyboardShortcuts() {
966
966
  return {
@@ -974,8 +974,8 @@ var Kt = B.create({
974
974
  });
975
975
  //#endregion
976
976
  //#region ../../node_modules/.pnpm/@tiptap+vue-3@3.27.1_@floating-ui+dom@1.7.6_@tiptap+core@3.27.1_@tiptap+pm@3.27.1__@tip_533afe27a0e41f53f3674ff5bfd0331c/node_modules/@tiptap/vue-3/dist/index.js
977
- function qt(e) {
978
- return oe((t, n) => ({
977
+ function Xt(e) {
978
+ return ae((t, n) => ({
979
979
  get() {
980
980
  return t(), e;
981
981
  },
@@ -988,11 +988,11 @@ function qt(e) {
988
988
  }
989
989
  }));
990
990
  }
991
- var Jt = class extends Oe {
991
+ var Zt = class extends rt {
992
992
  constructor(e = {}) {
993
- return super(e), this.contentComponent = null, this.appContext = null, this.reactiveState = qt(this.view.state), this.reactiveExtensionStorage = qt(this.extensionStorage), this.on("beforeTransaction", ({ nextState: e }) => {
993
+ return super(e), this.contentComponent = null, this.appContext = null, this.reactiveState = Xt(this.view.state), this.reactiveExtensionStorage = Xt(this.extensionStorage), this.on("beforeTransaction", ({ nextState: e }) => {
994
994
  this.reactiveState.value = e, this.reactiveExtensionStorage.value = this.extensionStorage;
995
- }), S(this);
995
+ }), se(this);
996
996
  }
997
997
  get state() {
998
998
  return this.reactiveState ? this.reactiveState.value : this.view.state;
@@ -1008,36 +1008,36 @@ var Jt = class extends Oe {
1008
1008
  let t = super.unregisterPlugin(e);
1009
1009
  return this.reactiveState && t && (this.reactiveState.value = t), t;
1010
1010
  }
1011
- }, Yt = d({
1011
+ }, Qt = m({
1012
1012
  name: "EditorContent",
1013
1013
  props: { editor: {
1014
1014
  default: null,
1015
1015
  type: Object
1016
1016
  } },
1017
- setup(e) {
1018
- let t = O(), r = p();
1019
- return m(() => {
1020
- let n = e.editor;
1021
- n && n.options.element && t.value && se(() => {
1022
- if (!t.value || !n.view.dom?.parentNode) return;
1023
- let e = C(t.value);
1024
- t.value.append(...n.view.dom.parentNode.childNodes), n.contentComponent = r.ctx._, r && (n.appContext = {
1025
- ...r.appContext,
1026
- provides: r.provides
1027
- }), n.setOptions({ element: e }), n.createNodeViews();
1017
+ setup(t) {
1018
+ let r = A(), i = o();
1019
+ return e(() => {
1020
+ let e = t.editor;
1021
+ e && e.options.element && r.value && n(() => {
1022
+ if (!r.value || !e.view.dom?.parentNode) return;
1023
+ let t = O(r.value);
1024
+ r.value.append(...e.view.dom.parentNode.childNodes), e.contentComponent = i.ctx._, i && (e.appContext = {
1025
+ ...i.appContext,
1026
+ provides: i.provides
1027
+ }), e.setOptions({ element: t }), e.createNodeViews();
1028
1028
  });
1029
- }), n(() => {
1030
- let t = e.editor;
1031
- t && (t.contentComponent = null, t.appContext = null);
1032
- }), { rootEl: t };
1029
+ }), v(() => {
1030
+ let e = t.editor;
1031
+ e && (e.contentComponent = null, e.appContext = null);
1032
+ }), { rootEl: r };
1033
1033
  },
1034
1034
  render() {
1035
- return a("div", { ref: (e) => {
1035
+ return l("div", { ref: (e) => {
1036
1036
  this.rootEl = e;
1037
1037
  } });
1038
1038
  }
1039
1039
  });
1040
- d({
1040
+ m({
1041
1041
  name: "NodeViewContent",
1042
1042
  props: { as: {
1043
1043
  type: String,
@@ -1053,13 +1053,13 @@ d({
1053
1053
  e && e(null);
1054
1054
  },
1055
1055
  render() {
1056
- return a(this.as, {
1056
+ return l(this.as, {
1057
1057
  style: { whiteSpace: "pre-wrap" },
1058
1058
  "data-node-view-content": ""
1059
1059
  });
1060
1060
  }
1061
1061
  });
1062
- var Xt = d({
1062
+ var $t = m({
1063
1063
  name: "NodeViewWrapper",
1064
1064
  props: { as: {
1065
1065
  type: String,
@@ -1068,24 +1068,24 @@ var Xt = d({
1068
1068
  inject: ["onDragStart", "decorationClasses"],
1069
1069
  render() {
1070
1070
  var e;
1071
- return a(this.as, {
1071
+ return l(this.as, {
1072
1072
  class: this.decorationClasses,
1073
1073
  style: { whiteSpace: "normal" },
1074
1074
  "data-node-view-wrapper": "",
1075
1075
  onDragstart: this.onDragStart
1076
1076
  }, (e = this.$slots).default?.call(e));
1077
1077
  }
1078
- }), Zt = (e = {}) => {
1079
- let t = A();
1080
- return ee(() => {
1081
- t.value = new Jt(e);
1082
- }), n(() => {
1078
+ }), en = (e = {}) => {
1079
+ let t = S();
1080
+ return c(() => {
1081
+ t.value = new Zt(e);
1082
+ }), v(() => {
1083
1083
  var e;
1084
1084
  (e = t.value) == null || e.destroy();
1085
1085
  }), t;
1086
- }, Qt = class {
1086
+ }, tn = class {
1087
1087
  constructor(e, { props: t = {}, editor: n }) {
1088
- this.destroyed = !1, this.editor = n, this.component = S(e), this.el = document.createElement("div"), this.props = ie(t), this.renderedComponent = this.renderComponent();
1088
+ this.destroyed = !1, this.editor = n, this.component = se(e), this.el = document.createElement("div"), this.props = ne(t), this.renderedComponent = this.renderComponent();
1089
1089
  }
1090
1090
  get element() {
1091
1091
  return this.renderedComponent.el;
@@ -1095,11 +1095,11 @@ var Xt = d({
1095
1095
  }
1096
1096
  renderComponent() {
1097
1097
  if (this.destroyed) return this.renderedComponent;
1098
- let e = a(this.component, this.props);
1099
- return this.editor.appContext && (e.appContext = this.editor.appContext), typeof document < "u" && this.el && T(e, this.el), {
1098
+ let e = l(this.component, this.props);
1099
+ return this.editor.appContext && (e.appContext = this.editor.appContext), typeof document < "u" && this.el && w(e, this.el), {
1100
1100
  vNode: e,
1101
1101
  destroy: () => {
1102
- this.el && T(null, this.el), this.el = null, e = null;
1102
+ this.el && w(null, this.el), this.el = null, e = null;
1103
1103
  },
1104
1104
  el: this.el ? this.el.firstElementChild : null
1105
1105
  };
@@ -1113,20 +1113,20 @@ var Xt = d({
1113
1113
  this.destroyed || (this.destroyed = !0, this.renderedComponent.destroy());
1114
1114
  }
1115
1115
  };
1116
- d({
1116
+ m({
1117
1117
  name: "MarkViewContent",
1118
1118
  props: { as: {
1119
1119
  type: String,
1120
1120
  default: "span"
1121
1121
  } },
1122
1122
  render() {
1123
- return a(this.as, {
1123
+ return l(this.as, {
1124
1124
  style: { whiteSpace: "inherit" },
1125
1125
  "data-mark-view-content": ""
1126
1126
  });
1127
1127
  }
1128
1128
  });
1129
- var $t = {
1129
+ var nn = {
1130
1130
  editor: {
1131
1131
  type: Object,
1132
1132
  required: !0
@@ -1171,7 +1171,7 @@ var $t = {
1171
1171
  type: Object,
1172
1172
  required: !0
1173
1173
  }
1174
- }, en = class extends Ke {
1174
+ }, rn = class extends tt {
1175
1175
  constructor(e, t, n) {
1176
1176
  super(e, t, n), this.cachedExtensionWithSyncedStorage = null, this.handlePositionUpdate = () => {
1177
1177
  let e = this.getPos();
@@ -1201,14 +1201,14 @@ var $t = {
1201
1201
  updateAttributes: (e = {}) => this.updateAttributes(e),
1202
1202
  deleteNode: () => this.deleteNode()
1203
1203
  }, t = e, n = this.onDragStart.bind(this);
1204
- this.decorationClasses = O(this.getDecorationClasses());
1205
- let r = d({
1204
+ this.decorationClasses = A(this.getDecorationClasses());
1205
+ let r = m({
1206
1206
  extends: { ...this.component },
1207
1207
  props: Object.keys(e),
1208
1208
  template: this.component.template,
1209
1209
  setup: (e) => {
1210
1210
  var t;
1211
- return v("onDragStart", n), v("decorationClasses", this.decorationClasses), v("nodeViewContentRef", (e) => {
1211
+ return s("onDragStart", n), s("decorationClasses", this.decorationClasses), s("nodeViewContentRef", (e) => {
1212
1212
  this.contentDOMElement && e && e.firstChild !== this.contentDOMElement && e.appendChild(this.contentDOMElement);
1213
1213
  }), (t = this.component).setup?.call(t, e, { expose: () => void 0 });
1214
1214
  },
@@ -1217,7 +1217,7 @@ var $t = {
1217
1217
  __name: this.component.__name,
1218
1218
  __file: this.component.__file
1219
1219
  });
1220
- this.handleSelectionUpdate = this.handleSelectionUpdate.bind(this), this.editor.on("selectionUpdate", this.handleSelectionUpdate), this.currentPos = this.getPos(), this.node.isLeaf || (this.contentDOMElement = document.createElement(this.node.isInline ? "span" : "div"), this.contentDOMElement.style.whiteSpace = "inherit", this.contentDOMElement.dataset.nodeViewContentVue = ""), this.renderer = new Qt(r, {
1220
+ this.handleSelectionUpdate = this.handleSelectionUpdate.bind(this), this.editor.on("selectionUpdate", this.handleSelectionUpdate), this.currentPos = this.getPos(), this.node.isLeaf || (this.contentDOMElement = document.createElement(this.node.isInline ? "span" : "div"), this.contentDOMElement.style.whiteSpace = "inherit", this.contentDOMElement.dataset.nodeViewContentVue = ""), this.renderer = new tn(r, {
1221
1221
  editor: this.editor,
1222
1222
  props: t
1223
1223
  });
@@ -1231,7 +1231,7 @@ var $t = {
1231
1231
  }
1232
1232
  handleSelectionUpdate() {
1233
1233
  let e = this.getPos();
1234
- if (typeof e == "number") if (Ye({
1234
+ if (typeof e == "number") if (me({
1235
1235
  selection: this.editor.state.selection,
1236
1236
  pos: e,
1237
1237
  nodeSize: this.node.nodeSize,
@@ -1289,44 +1289,44 @@ var $t = {
1289
1289
  this.renderer.destroy(), this.editor.off("selectionUpdate", this.handleSelectionUpdate), this.options.trackNodeViewPosition && this.editor.off("update", this.handlePositionUpdate), this.contentDOMElement = null;
1290
1290
  }
1291
1291
  };
1292
- function tn(e, t) {
1293
- return (n) => n.editor.contentComponent ? new en(typeof e == "function" && "__vccOpts" in e ? e.__vccOpts : e, n, t) : {};
1292
+ function an(e, t) {
1293
+ return (n) => n.editor.contentComponent ? new rn(typeof e == "function" && "__vccOpts" in e ? e.__vccOpts : e, n, t) : {};
1294
1294
  }
1295
1295
  //#endregion
1296
1296
  //#region src/ai.ts
1297
- var nn = [
1297
+ var on = [
1298
1298
  "proofread",
1299
1299
  "rewrite",
1300
1300
  "shorten",
1301
1301
  "expand"
1302
1302
  ];
1303
- function rn(e) {
1303
+ function sn(e) {
1304
1304
  console.warn(`[bygga-editor] ${e}`);
1305
1305
  }
1306
- function an(e) {
1306
+ function cn(e) {
1307
1307
  if (!e) return [];
1308
- if (typeof e.run != "function") return rn("config.ai: `run` must be a function — ignoring the AI configuration."), [];
1309
- if (!Array.isArray(e.actions)) return rn("config.ai: `actions` must be an array — offering no AI actions."), [];
1308
+ if (typeof e.run != "function") return sn("config.ai: `run` must be a function — ignoring the AI configuration."), [];
1309
+ if (!Array.isArray(e.actions)) return sn("config.ai: `actions` must be an array — offering no AI actions."), [];
1310
1310
  let t = /* @__PURE__ */ new Set();
1311
1311
  for (let n of e.actions) {
1312
- if (!nn.includes(n)) {
1313
- rn(`config.ai: "${String(n)}" is not a known AI action — ignoring it.`);
1312
+ if (!on.includes(n)) {
1313
+ sn(`config.ai: "${String(n)}" is not a known AI action — ignoring it.`);
1314
1314
  continue;
1315
1315
  }
1316
1316
  t.add(n);
1317
1317
  }
1318
- return e.actions.length > 0 && t.size === 0 && rn("config.ai: no usable actions — offering no AI controls."), nn.filter((e) => t.has(e));
1318
+ return e.actions.length > 0 && t.size === 0 && sn("config.ai: no usable actions — offering no AI controls."), on.filter((e) => t.has(e));
1319
1319
  }
1320
1320
  //#endregion
1321
1321
  //#region src/components/AiActionPicker.vue?vue&type=script&setup=true&lang.ts
1322
- var on = [
1322
+ var ln = [
1323
1323
  "disabled",
1324
1324
  "aria-busy",
1325
1325
  "title",
1326
1326
  "aria-label",
1327
1327
  "popovertarget",
1328
1328
  "aria-expanded"
1329
- ], sn = ["id", "aria-label"], cn = { class: "ai-list" }, ln = ["onClick"], un = { class: "ai-option-label" }, dn = { class: "ai-option-hint" }, fn = /*#__PURE__*/ Ne(/* @__PURE__ */ d({
1329
+ ], un = ["id", "aria-label"], dn = { class: "ai-list" }, fn = ["onClick"], pn = { class: "ai-option-label" }, mn = { class: "ai-option-hint" }, hn = /*#__PURE__*/ B(/* @__PURE__ */ m({
1330
1330
  __name: "AiActionPicker",
1331
1331
  props: {
1332
1332
  actions: { type: Array },
@@ -1336,155 +1336,155 @@ var on = [
1336
1336
  }
1337
1337
  },
1338
1338
  emits: ["select"],
1339
- setup(e, { emit: t }) {
1340
- let n = t, { t: r } = me(), a = c(), s = y("trigger"), l = y("popover"), u = g(() => l.value?.matches(":popover-open") ?? !1);
1341
- function d(e) {
1339
+ setup(e, { emit: n }) {
1340
+ let o = n, { t: s } = Xe(), c = te(), l = b("trigger"), d = b("popover"), p = a(() => d.value?.matches(":popover-open") ?? !1);
1341
+ function m(e) {
1342
1342
  if (e.newState !== "open") return;
1343
- let t = l.value, n = s.value?.getBoundingClientRect();
1343
+ let t = d.value, n = l.value?.getBoundingClientRect();
1344
1344
  t && n && (t.style.left = `${n.left}px`, t.style.top = `${n.bottom + 4}px`);
1345
1345
  }
1346
- function p(e) {
1347
- let t = e.relatedTarget, n = l.value;
1346
+ function h(e) {
1347
+ let t = e.relatedTarget, n = d.value;
1348
1348
  t instanceof Node && n?.contains(t) || n?.matches(":popover-open") && n.hidePopover();
1349
1349
  }
1350
- function m(e) {
1351
- n("select", e), l.value?.hidePopover();
1350
+ function g(e) {
1351
+ o("select", e), d.value?.hidePopover();
1352
1352
  }
1353
- return (t, n) => (_(), D(h, null, [e.actions.length ? (_(), D("button", {
1353
+ return (n, a) => (y(), t(r, null, [e.actions.length ? (y(), t("button", {
1354
1354
  key: 0,
1355
1355
  ref_key: "trigger",
1356
- ref: s,
1356
+ ref: l,
1357
1357
  type: "button",
1358
- class: k(["ai-trigger", { active: u.value }]),
1358
+ class: D(["ai-trigger", { active: p.value }]),
1359
1359
  disabled: e.pending,
1360
1360
  "aria-busy": e.pending,
1361
- title: C(r)("blocks.text.ai.label"),
1362
- "aria-label": C(r)("blocks.text.ai.label"),
1363
- popovertarget: C(a),
1361
+ title: O(s)("blocks.text.ai.label"),
1362
+ "aria-label": O(s)("blocks.text.ai.label"),
1363
+ popovertarget: O(c),
1364
1364
  "aria-haspopup": "dialog",
1365
- "aria-expanded": u.value,
1366
- onMousedown: n[0] ||= j(() => {}, ["prevent"])
1367
- }, [E(R, {
1365
+ "aria-expanded": p.value,
1366
+ onMousedown: a[0] ||= _(() => {}, ["prevent"])
1367
+ }, [f(M, {
1368
1368
  name: "sparkles",
1369
1369
  size: 16
1370
- })], 42, on)) : f("", !0), e.actions.length ? (_(), D("div", {
1370
+ })], 42, ln)) : E("", !0), e.actions.length ? (y(), t("div", {
1371
1371
  key: 1,
1372
- id: C(a),
1372
+ id: O(c),
1373
1373
  ref_key: "popover",
1374
- ref: l,
1374
+ ref: d,
1375
1375
  class: "ai-popover",
1376
1376
  popover: "",
1377
1377
  role: "dialog",
1378
- "aria-label": C(r)("blocks.text.ai.label"),
1379
- onBeforetoggle: d,
1380
- onFocusout: p
1381
- }, [i("ul", cn, [(_(!0), D(h, null, o(e.actions, (e) => (_(), D("li", { key: e }, [i("button", {
1378
+ "aria-label": O(s)("blocks.text.ai.label"),
1379
+ onBeforetoggle: m,
1380
+ onFocusout: h
1381
+ }, [i("ul", dn, [(y(!0), t(r, null, u(e.actions, (e) => (y(), t("li", { key: e }, [i("button", {
1382
1382
  type: "button",
1383
1383
  class: "ai-option",
1384
- onClick: (t) => m(e),
1385
- onMousedown: n[1] ||= j(() => {}, ["prevent"])
1386
- }, [i("span", un, w(C(r)(`blocks.text.ai.actions.${e}.label`)), 1), i("span", dn, w(C(r)(`blocks.text.ai.actions.${e}.hint`)), 1)], 40, ln)]))), 128))])], 40, sn)) : f("", !0)], 64));
1384
+ onClick: (t) => g(e),
1385
+ onMousedown: a[1] ||= _(() => {}, ["prevent"])
1386
+ }, [i("span", pn, x(O(s)(`blocks.text.ai.actions.${e}.label`)), 1), i("span", mn, x(O(s)(`blocks.text.ai.actions.${e}.hint`)), 1)], 40, fn)]))), 128))])], 40, un)) : E("", !0)], 64));
1387
1387
  }
1388
- }), [["styles", [".ai-trigger[data-v-abcd3caa]{color:var(--bygga-color-text);cursor:pointer;background:0 0;border:none;border-radius:4px;justify-content:center;align-items:center;min-width:30px;height:30px;padding:0;display:inline-flex}.ai-trigger[data-v-abcd3caa]:hover:not(:disabled){background:color-mix(in srgb, var(--bygga-color-text) 30%, transparent)}.ai-trigger.active[data-v-abcd3caa]{background:var(--bygga-color-selected,var(--bygga-color-text));color:var(--bygga-color-selected-text,#fff);forced-color-adjust:none}.ai-trigger[data-v-abcd3caa]:disabled{cursor:default;opacity:.5}.ai-popover[data-v-abcd3caa]{background:var(--bygga-color-surface);border:1px solid var(--bygga-color-border);border-radius:var(--bygga-radius-sm);box-shadow:var(--bygga-shadow-card);box-sizing:border-box;flex-direction:column;width:16em;margin:0;padding:.4em;position:fixed;inset:auto}.ai-popover[data-v-abcd3caa]:popover-open{display:flex}.ai-list[data-v-abcd3caa]{flex-direction:column;gap:.15em;margin:0;padding:0;list-style:none;display:flex}.ai-option[data-v-abcd3caa]{border-radius:var(--bygga-radius-sm);color:var(--bygga-color-text);cursor:pointer;text-align:start;background:0 0;border:none;flex-direction:column;gap:.1em;width:100%;padding:.35em .5em;display:flex}.ai-option[data-v-abcd3caa]:hover,.ai-option[data-v-abcd3caa]:focus-visible{background:var(--bygga-color-track);color:var(--bygga-color-accent);outline:none}.ai-option-hint[data-v-abcd3caa]{color:var(--bygga-color-text-muted);font-size:.85em}"]], ["__scopeId", "data-v-abcd3caa"]]), pn = [
1388
+ }), [["styles", [".ai-trigger[data-v-abcd3caa]{color:var(--bygga-color-text);cursor:pointer;background:0 0;border:none;border-radius:4px;justify-content:center;align-items:center;min-width:30px;height:30px;padding:0;display:inline-flex}.ai-trigger[data-v-abcd3caa]:hover:not(:disabled){background:color-mix(in srgb, var(--bygga-color-text) 30%, transparent)}.ai-trigger.active[data-v-abcd3caa]{background:var(--bygga-color-selected,var(--bygga-color-text));color:var(--bygga-color-selected-text,#fff);forced-color-adjust:none}.ai-trigger[data-v-abcd3caa]:disabled{cursor:default;opacity:.5}.ai-popover[data-v-abcd3caa]{background:var(--bygga-color-surface);border:1px solid var(--bygga-color-border);border-radius:var(--bygga-radius-sm);box-shadow:var(--bygga-shadow-card);box-sizing:border-box;flex-direction:column;width:16em;margin:0;padding:.4em;position:fixed;inset:auto}.ai-popover[data-v-abcd3caa]:popover-open{display:flex}.ai-list[data-v-abcd3caa]{flex-direction:column;gap:.15em;margin:0;padding:0;list-style:none;display:flex}.ai-option[data-v-abcd3caa]{border-radius:var(--bygga-radius-sm);color:var(--bygga-color-text);cursor:pointer;text-align:start;background:0 0;border:none;flex-direction:column;gap:.1em;width:100%;padding:.35em .5em;display:flex}.ai-option[data-v-abcd3caa]:hover,.ai-option[data-v-abcd3caa]:focus-visible{background:var(--bygga-color-track);color:var(--bygga-color-accent);outline:none}.ai-option-hint[data-v-abcd3caa]{color:var(--bygga-color-text-muted);font-size:.85em}"]], ["__scopeId", "data-v-abcd3caa"]]), gn = [
1389
1389
  "title",
1390
1390
  "aria-label",
1391
1391
  "popovertarget",
1392
1392
  "aria-expanded"
1393
- ], mn = ["id", "aria-label"], hn = {
1393
+ ], _n = ["id", "aria-label"], vn = {
1394
1394
  key: 0,
1395
1395
  class: "merge-tag-list"
1396
- }, gn = ["onClick"], _n = { class: "merge-tag-option-label" }, vn = { class: "merge-tag-option-id" }, yn = {
1396
+ }, yn = ["onClick"], bn = { class: "merge-tag-option-label" }, xn = { class: "merge-tag-option-id" }, Sn = {
1397
1397
  key: 1,
1398
1398
  class: "merge-tag-empty"
1399
- }, bn = /*#__PURE__*/ Ne(/* @__PURE__ */ d({
1399
+ }, Cn = /*#__PURE__*/ B(/* @__PURE__ */ m({
1400
1400
  __name: "MergeTagPicker",
1401
1401
  emits: ["select"],
1402
- setup(e, { emit: t }) {
1403
- let n = t, { t: r, locale: a } = me(), l = s(W, g(() => ({}))), u = g(() => Le(l.value).map((e) => ({
1402
+ setup(e, { emit: o }) {
1403
+ let s = o, { t: c, locale: l } = Xe(), p = d($e, a(() => ({}))), m = a(() => Ue(p.value).map((e) => ({
1404
1404
  id: e,
1405
- label: Be(l.value, e, a.value)
1406
- }))), d = O(""), p = g(() => {
1407
- let e = d.value.trim().toLowerCase();
1408
- return e ? u.value.filter((t) => t.label.toLowerCase().includes(e) || t.id.toLowerCase().includes(e)) : u.value;
1409
- }), m = c(), ee = g(() => b.value?.matches(":popover-open") ?? !1), v = y("trigger"), b = y("popover"), x = y("filterInput");
1410
- function te(e) {
1405
+ label: Ge(p.value, e, l.value)
1406
+ }))), h = A(""), g = a(() => {
1407
+ let e = h.value.trim().toLowerCase();
1408
+ return e ? m.value.filter((t) => t.label.toLowerCase().includes(e) || t.id.toLowerCase().includes(e)) : m.value;
1409
+ }), v = te(), ee = a(() => S.value?.matches(":popover-open") ?? !1), ne = b("trigger"), S = b("popover"), C = b("filterInput");
1410
+ function w(e) {
1411
1411
  if (e.newState !== "open") return;
1412
- d.value = "";
1413
- let t = b.value, n = v.value?.getBoundingClientRect();
1412
+ h.value = "";
1413
+ let t = S.value, n = ne.value?.getBoundingClientRect();
1414
1414
  t && n && (t.style.left = `${n.left}px`, t.style.top = `${n.bottom + 4}px`);
1415
1415
  }
1416
- function S(e) {
1417
- e.newState === "open" && se(() => x.value?.focus());
1416
+ function re(e) {
1417
+ e.newState === "open" && n(() => C.value?.focus());
1418
1418
  }
1419
- function ne(e) {
1420
- let t = e.relatedTarget, n = b.value;
1419
+ function T(e) {
1420
+ let t = e.relatedTarget, n = S.value;
1421
1421
  t instanceof Node && n?.contains(t) || n?.matches(":popover-open") && n.hidePopover();
1422
1422
  }
1423
- function T(e) {
1424
- n("select", e), b.value?.hidePopover();
1423
+ function ie(e) {
1424
+ s("select", e), S.value?.hidePopover();
1425
1425
  }
1426
- return (e, t) => (_(), D(h, null, [u.value.length ? (_(), D("button", {
1426
+ return (e, n) => (y(), t(r, null, [m.value.length ? (y(), t("button", {
1427
1427
  key: 0,
1428
1428
  ref_key: "trigger",
1429
- ref: v,
1429
+ ref: ne,
1430
1430
  type: "button",
1431
- class: k(["merge-tag-trigger", { active: ee.value }]),
1432
- title: C(r)("blocks.text.mergeTag"),
1433
- "aria-label": C(r)("blocks.text.mergeTag"),
1434
- popovertarget: C(m),
1431
+ class: D(["merge-tag-trigger", { active: ee.value }]),
1432
+ title: O(c)("blocks.text.mergeTag"),
1433
+ "aria-label": O(c)("blocks.text.mergeTag"),
1434
+ popovertarget: O(v),
1435
1435
  "aria-haspopup": "dialog",
1436
1436
  "aria-expanded": ee.value,
1437
- onMousedown: t[0] ||= j(() => {}, ["prevent"])
1438
- }, [E(R, {
1437
+ onMousedown: n[0] ||= _(() => {}, ["prevent"])
1438
+ }, [f(M, {
1439
1439
  name: "braces",
1440
1440
  size: 16
1441
- })], 42, pn)) : f("", !0), u.value.length ? (_(), D("div", {
1441
+ })], 42, gn)) : E("", !0), m.value.length ? (y(), t("div", {
1442
1442
  key: 1,
1443
- id: C(m),
1443
+ id: O(v),
1444
1444
  ref_key: "popover",
1445
- ref: b,
1445
+ ref: S,
1446
1446
  class: "merge-tag-popover",
1447
1447
  popover: "",
1448
1448
  role: "dialog",
1449
- "aria-label": C(r)("blocks.text.mergeTag"),
1450
- onBeforetoggle: te,
1451
- onToggle: S,
1452
- onFocusout: ne
1453
- }, [E(Te, {
1449
+ "aria-label": O(c)("blocks.text.mergeTag"),
1450
+ onBeforetoggle: w,
1451
+ onToggle: re,
1452
+ onFocusout: T
1453
+ }, [f(Pe, {
1454
1454
  ref_key: "filterInput",
1455
- ref: x,
1456
- modelValue: d.value,
1457
- "onUpdate:modelValue": t[1] ||= (e) => d.value = e,
1455
+ ref: C,
1456
+ modelValue: h.value,
1457
+ "onUpdate:modelValue": n[1] ||= (e) => h.value = e,
1458
1458
  autocomplete: "off",
1459
- placeholder: C(r)("blocks.text.mergeTagSearch"),
1460
- "aria-label": C(r)("blocks.text.mergeTagSearch"),
1459
+ placeholder: O(c)("blocks.text.mergeTagSearch"),
1460
+ "aria-label": O(c)("blocks.text.mergeTagSearch"),
1461
1461
  spellcheck: "false"
1462
1462
  }, null, 8, [
1463
1463
  "modelValue",
1464
1464
  "placeholder",
1465
1465
  "aria-label"
1466
- ]), p.value.length ? (_(), D("ul", hn, [(_(!0), D(h, null, o(p.value, (e) => (_(), D("li", { key: e.id }, [i("button", {
1466
+ ]), g.value.length ? (y(), t("ul", vn, [(y(!0), t(r, null, u(g.value, (e) => (y(), t("li", { key: e.id }, [i("button", {
1467
1467
  type: "button",
1468
1468
  class: "merge-tag-option",
1469
- onClick: (t) => T(e.id),
1470
- onMousedown: t[2] ||= j(() => {}, ["prevent"])
1471
- }, [i("span", _n, w(e.label), 1), i("span", vn, w(e.id), 1)], 40, gn)]))), 128))])) : (_(), D("p", yn, w(C(r)("blocks.text.mergeTagEmpty")), 1))], 40, mn)) : f("", !0)], 64));
1469
+ onClick: (t) => ie(e.id),
1470
+ onMousedown: n[2] ||= _(() => {}, ["prevent"])
1471
+ }, [i("span", bn, x(e.label), 1), i("span", xn, x(e.id), 1)], 40, yn)]))), 128))])) : (y(), t("p", Sn, x(O(c)("blocks.text.mergeTagEmpty")), 1))], 40, _n)) : E("", !0)], 64));
1472
1472
  }
1473
- }), [["styles", [".merge-tag-trigger[data-v-72cf1690]{color:var(--bygga-color-text);cursor:pointer;background:0 0;border:none;border-radius:4px;justify-content:center;align-items:center;min-width:30px;height:30px;padding:0;display:inline-flex}.merge-tag-trigger[data-v-72cf1690]:hover{background:color-mix(in srgb, var(--bygga-color-text) 30%, transparent)}.merge-tag-trigger.active[data-v-72cf1690]{background:var(--bygga-color-selected,var(--bygga-color-text));color:var(--bygga-color-selected-text,#fff);forced-color-adjust:none}.merge-tag-popover[data-v-72cf1690]{background:var(--bygga-color-surface);border:1px solid var(--bygga-color-border);border-radius:var(--bygga-radius-sm);box-shadow:var(--bygga-shadow-card);box-sizing:border-box;flex-direction:column;gap:.35em;width:15em;margin:0;padding:.4em;position:fixed;inset:auto}.merge-tag-popover[data-v-72cf1690]:popover-open{display:flex}.merge-tag-list[data-v-72cf1690]{flex-direction:column;gap:.15em;max-height:14em;margin:0;padding:0;list-style:none;display:flex;overflow-y:auto}.merge-tag-option[data-v-72cf1690]{border-radius:var(--bygga-radius-sm);color:var(--bygga-color-text);cursor:pointer;text-align:start;background:0 0;border:none;justify-content:space-between;align-items:baseline;gap:.5em;width:100%;padding:.35em .5em;display:flex}.merge-tag-option[data-v-72cf1690]:hover,.merge-tag-option[data-v-72cf1690]:focus-visible{background:var(--bygga-color-track);color:var(--bygga-color-accent);outline:none}.merge-tag-option-id[data-v-72cf1690]{color:var(--bygga-color-text-muted);font-variant-numeric:tabular-nums;font-size:.85em}.merge-tag-empty[data-v-72cf1690]{color:var(--bygga-color-text-muted);margin:0;padding:.35em .5em}"]], ["__scopeId", "data-v-72cf1690"]]), xn = /* @__PURE__ */ d({
1473
+ }), [["styles", [".merge-tag-trigger[data-v-72cf1690]{color:var(--bygga-color-text);cursor:pointer;background:0 0;border:none;border-radius:4px;justify-content:center;align-items:center;min-width:30px;height:30px;padding:0;display:inline-flex}.merge-tag-trigger[data-v-72cf1690]:hover{background:color-mix(in srgb, var(--bygga-color-text) 30%, transparent)}.merge-tag-trigger.active[data-v-72cf1690]{background:var(--bygga-color-selected,var(--bygga-color-text));color:var(--bygga-color-selected-text,#fff);forced-color-adjust:none}.merge-tag-popover[data-v-72cf1690]{background:var(--bygga-color-surface);border:1px solid var(--bygga-color-border);border-radius:var(--bygga-radius-sm);box-shadow:var(--bygga-shadow-card);box-sizing:border-box;flex-direction:column;gap:.35em;width:15em;margin:0;padding:.4em;position:fixed;inset:auto}.merge-tag-popover[data-v-72cf1690]:popover-open{display:flex}.merge-tag-list[data-v-72cf1690]{flex-direction:column;gap:.15em;max-height:14em;margin:0;padding:0;list-style:none;display:flex;overflow-y:auto}.merge-tag-option[data-v-72cf1690]{border-radius:var(--bygga-radius-sm);color:var(--bygga-color-text);cursor:pointer;text-align:start;background:0 0;border:none;justify-content:space-between;align-items:baseline;gap:.5em;width:100%;padding:.35em .5em;display:flex}.merge-tag-option[data-v-72cf1690]:hover,.merge-tag-option[data-v-72cf1690]:focus-visible{background:var(--bygga-color-track);color:var(--bygga-color-accent);outline:none}.merge-tag-option-id[data-v-72cf1690]{color:var(--bygga-color-text-muted);font-variant-numeric:tabular-nums;font-size:.85em}.merge-tag-empty[data-v-72cf1690]{color:var(--bygga-color-text-muted);margin:0;padding:.35em .5em}"]], ["__scopeId", "data-v-72cf1690"]]), wn = /* @__PURE__ */ m({
1474
1474
  __name: "MergeTagView",
1475
- props: $t,
1476
- setup(n) {
1477
- let i = n, { t: a, locale: o } = me(), c = s(W, g(() => ({}))), l = g(() => String(i.node.attrs.id ?? "")), u = g(() => c.value[l.value] !== void 0), d = g(() => Be(c.value, l.value, o.value)), f = g(() => a("blocks.text.mergeTagChip", { name: d.value }));
1478
- return (n, i) => (_(), r(C(Xt), {
1475
+ props: nn,
1476
+ setup(e) {
1477
+ let t = e, { t: n, locale: r } = Xe(), i = d($e, a(() => ({}))), o = a(() => String(t.node.attrs.id ?? "")), s = a(() => i.value[o.value] !== void 0), c = a(() => Ge(i.value, o.value, r.value)), l = a(() => n("blocks.text.mergeTagChip", { name: c.value }));
1478
+ return (e, t) => (y(), p(O($t), {
1479
1479
  as: "span",
1480
- class: k(["merge-tag", { "is-unknown": !u.value }]),
1481
- "data-merge-tag": l.value,
1480
+ class: D(["merge-tag", { "is-unknown": !s.value }]),
1481
+ "data-merge-tag": o.value,
1482
1482
  contenteditable: "false",
1483
1483
  role: "img",
1484
- "aria-label": f.value,
1485
- title: f.value
1484
+ "aria-label": l.value,
1485
+ title: l.value
1486
1486
  }, {
1487
- default: e(() => [t(w(d.value), 1)]),
1487
+ default: C(() => [T(x(c.value), 1)]),
1488
1488
  _: 1
1489
1489
  }, 8, [
1490
1490
  "class",
@@ -1496,53 +1496,53 @@ var on = [
1496
1496
  });
1497
1497
  //#endregion
1498
1498
  //#region src/fontSizes.ts
1499
- function Sn(e) {
1500
- return je(e);
1499
+ function Tn(e) {
1500
+ return Ce(e);
1501
1501
  }
1502
- var Cn = new Set(Re.map(Sn));
1503
- function wn(e) {
1502
+ var En = new Set(Be.map(Tn));
1503
+ function Dn(e) {
1504
1504
  let t = e.trim();
1505
- return Cn.has(t) ? t : null;
1505
+ return En.has(t) ? t : null;
1506
1506
  }
1507
- function Tn(e) {
1508
- return Cn.has(e);
1507
+ function On(e) {
1508
+ return En.has(e);
1509
1509
  }
1510
1510
  //#endregion
1511
1511
  //#region src/panels/contentPanel/components/blocks/aiEdit.ts
1512
- var En = "hardBreak", Dn = "link", On = /\{\{([^{}]*)\}\}/g, kn = /\r\n?/g, An = /\s*\n\s*/g;
1513
- function jn(e, t, n) {
1514
- return e.textBetween(t, n, "", Mn);
1512
+ var kn = "hardBreak", An = "link", jn = /\{\{([^{}]*)\}\}/g, Mn = /\r\n?/g, Nn = /\s*\n\s*/g;
1513
+ function Pn(e, t, n) {
1514
+ return e.textBetween(t, n, "", Fn);
1515
1515
  }
1516
- function Mn(e) {
1517
- return e.type.name === "mergeTag" ? `{{${e.attrs.id}}}` : e.type.name === En ? "\n" : "";
1516
+ function Fn(e) {
1517
+ return e.type.name === "mergeTag" ? `{{${e.attrs.id}}}` : e.type.name === kn ? "\n" : "";
1518
1518
  }
1519
- function Nn(e, t) {
1519
+ function In(e, t) {
1520
1520
  let { from: n, to: r } = t.empty ? {
1521
1521
  from: 0,
1522
1522
  to: e.content.size
1523
1523
  } : t, i = [];
1524
1524
  return e.nodesBetween(n, r, (t, a) => {
1525
1525
  if (!t.isTextblock) return !0;
1526
- let o = Pn(e, Math.max(n, a + 1), Math.min(r, a + 1 + t.content.size));
1526
+ let o = Ln(e, Math.max(n, a + 1), Math.min(r, a + 1 + t.content.size));
1527
1527
  return o && i.push(o), !1;
1528
1528
  }), i;
1529
1529
  }
1530
- function Pn(e, t, n) {
1531
- let r = jn(e, t, n), i = r.trim();
1530
+ function Ln(e, t, n) {
1531
+ let r = Pn(e, t, n), i = r.trim();
1532
1532
  if (i === "") return;
1533
1533
  let a = t + r.length - r.trimStart().length, o = n - (r.length - r.trimEnd().length);
1534
1534
  return {
1535
1535
  from: a,
1536
1536
  to: o,
1537
1537
  text: i,
1538
- ...Fn(e, a, o)
1538
+ ...Rn(e, a, o)
1539
1539
  };
1540
1540
  }
1541
- function Fn(e, t, n) {
1541
+ function Rn(e, t, n) {
1542
1542
  let r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Map(), a = [];
1543
1543
  e.nodesBetween(t, n, (e, o) => {
1544
1544
  if (e.isText) {
1545
- let i = e.marks.filter((e) => e.type.name !== Dn), a = JSON.stringify(i.map((e) => e.toJSON())), s = Math.min(n, o + e.nodeSize) - Math.max(t, o);
1545
+ let i = e.marks.filter((e) => e.type.name !== An), a = JSON.stringify(i.map((e) => e.toJSON())), s = Math.min(n, o + e.nodeSize) - Math.max(t, o);
1546
1546
  r.set(a, {
1547
1547
  marks: i,
1548
1548
  chars: (r.get(a)?.chars ?? 0) + s
@@ -1551,7 +1551,7 @@ function Fn(e, t, n) {
1551
1551
  let t = String(e.attrs.id);
1552
1552
  i.set(t, i.get(t) ?? e.marks);
1553
1553
  } else return !0;
1554
- return a.push(e.marks.find((e) => e.type.name === Dn)), !1;
1554
+ return a.push(e.marks.find((e) => e.type.name === An)), !1;
1555
1555
  });
1556
1556
  let o = [], s = 0;
1557
1557
  for (let { marks: e, chars: t } of r.values()) t > s && (o = e, s = t);
@@ -1561,45 +1561,45 @@ function Fn(e, t, n) {
1561
1561
  tagMarks: i
1562
1562
  };
1563
1563
  }
1564
- function In(e, t, n) {
1565
- let r = n.replace(kn, "\n").trim();
1564
+ function zn(e, t, n) {
1565
+ let r = n.replace(Mn, "\n").trim();
1566
1566
  if (r === "" || r === t.text) return;
1567
- let i = e.nodes[En], a = i ? r.split("\n") : [r.replace(An, " ")], o = [];
1568
- for (let [n, r] of a.entries()) i && n > 0 && o.push(i.create()), o.push(...Ln(e, t, r));
1569
- return F.from(o);
1567
+ let i = e.nodes[kn], a = i ? r.split("\n") : [r.replace(Nn, " ")], o = [];
1568
+ for (let [n, r] of a.entries()) i && n > 0 && o.push(i.create()), o.push(...Bn(e, t, r));
1569
+ return I.from(o);
1570
1570
  }
1571
- function Ln(e, t, n) {
1572
- let r = e.nodes[Ae], i = [], a = 0;
1573
- for (let o of n.matchAll(On)) {
1571
+ function Bn(e, t, n) {
1572
+ let r = e.nodes[Ye], i = [], a = 0;
1573
+ for (let o of n.matchAll(jn)) {
1574
1574
  let s = o[1] ?? "";
1575
- r && Ie.test(s) && (o.index > a && i.push(e.text(n.slice(a, o.index), t.marks)), i.push(r.create({ id: s }, null, t.tagMarks.get(s) ?? t.marks)), a = o.index + o[0].length);
1575
+ r && L.test(s) && (o.index > a && i.push(e.text(n.slice(a, o.index), t.marks)), i.push(r.create({ id: s }, null, t.tagMarks.get(s) ?? t.marks)), a = o.index + o[0].length);
1576
1576
  }
1577
1577
  return a < n.length && i.push(e.text(n.slice(a), t.marks)), i;
1578
1578
  }
1579
- function Rn(e, t, n, r) {
1579
+ function Vn(e, t, n, r) {
1580
1580
  let { tr: i } = e;
1581
1581
  for (let [a, o] of [...t.entries()].reverse()) {
1582
- let t = n[a], s = r.map(o.from, 1), c = r.map(o.to, -1), l = typeof t == "string" && zn(e.doc, s, c, o.text) ? In(e.schema, o, t) : void 0;
1582
+ let t = n[a], s = r.map(o.from, 1), c = r.map(o.to, -1), l = typeof t == "string" && Hn(e.doc, s, c, o.text) ? zn(e.schema, o, t) : void 0;
1583
1583
  l && i.replaceWith(s, c, l);
1584
1584
  }
1585
1585
  return i.docChanged ? i : void 0;
1586
1586
  }
1587
- function zn(e, t, n, r) {
1587
+ function Hn(e, t, n, r) {
1588
1588
  if (t >= n || n > e.content.size) return !1;
1589
1589
  let i = e.resolve(t);
1590
- return i.parent.isTextblock && i.sameParent(e.resolve(n)) && jn(e, t, n) === r;
1590
+ return i.parent.isTextblock && i.sameParent(e.resolve(n)) && Pn(e, t, n) === r;
1591
1591
  }
1592
1592
  //#endregion
1593
1593
  //#region src/panels/contentPanel/components/blocks/brandTypingStyle.ts
1594
- var Bn = B.create({
1594
+ var Un = R.create({
1595
1595
  name: "brandTypingStyle",
1596
1596
  addOptions() {
1597
1597
  return { marks: () => [] };
1598
1598
  },
1599
1599
  addProseMirrorPlugins() {
1600
1600
  let { marks: e } = this.options;
1601
- return [new H({
1602
- key: new M("brandTypingStyle"),
1601
+ return [new N({
1602
+ key: new P("brandTypingStyle"),
1603
1603
  appendTransaction(t, n, r) {
1604
1604
  let { selection: i, storedMarks: a, schema: o } = r;
1605
1605
  if (a !== null || !i.empty) return null;
@@ -1610,95 +1610,125 @@ var Bn = B.create({
1610
1610
  }
1611
1611
  })];
1612
1612
  }
1613
- }), Vn = "textStyle";
1614
- function Hn(e) {
1615
- let t = he(e);
1613
+ });
1614
+ //#endregion
1615
+ //#region src/panels/contentPanel/components/blocks/pasteFormatting.ts
1616
+ function Wn(e) {
1617
+ let { paragraph: t } = e.schema.nodes;
1618
+ if (t) return {
1619
+ type: t,
1620
+ attrs: t.create().attrs
1621
+ };
1622
+ let { parent: n } = e.selection.$from;
1623
+ return {
1624
+ type: n.type,
1625
+ attrs: n.attrs
1626
+ };
1627
+ }
1628
+ function Gn(e, t) {
1629
+ let n = Wn(e), r = !1;
1630
+ return t.content.descendants((e) => r ? !1 : (e.isText ? r = e.marks.length > 0 : e.isTextblock ? r = !e.hasMarkup(n.type, n.attrs) : e.isInline && (r = e.type.name !== "hardBreak"), !r)), r;
1631
+ }
1632
+ function Kn(e, t) {
1633
+ let n = t.openStart === 0 && t.openEnd === 0 && t.content.childCount === 1 ? t.content.firstChild : null;
1634
+ return (n ? e.tr.replaceSelectionWith(n, !1) : e.tr.replaceSelection(t)).scrollIntoView().setMeta("paste", !0).setMeta("uiEvent", "paste");
1635
+ }
1636
+ var qn = /(?:\r\n?|\n)+/;
1637
+ function Jn(e, t) {
1638
+ let { schema: n, selection: r, storedMarks: i } = e, a = i ?? r.$from.marks(), o = Wn(e), s = t.split(qn).map((e) => o.type.create(o.attrs, e ? n.text(e, a) : null));
1639
+ return new H(I.from(s), 1, 1);
1640
+ }
1641
+ //#endregion
1642
+ //#region src/panels/contentPanel/components/blocks/sanitizePastedFonts.ts
1643
+ var Yn = "textStyle";
1644
+ function Xn(e) {
1645
+ let t = ke(e);
1616
1646
  return !t || t.key === "verdana" ? null : t.stack;
1617
1647
  }
1618
- function Un(e, t) {
1619
- if (e.type.name !== Vn) return e;
1648
+ function Zn(e, t) {
1649
+ if (e.type.name !== Yn) return e;
1620
1650
  let n = { ...e.attrs };
1621
- return typeof n.fontFamily == "string" && !t?.has(n.fontFamily) && (n.fontFamily = Hn(n.fontFamily)), typeof n.fontSize == "string" && (n.fontSize = wn(n.fontSize)), n.fontFamily === e.attrs.fontFamily && n.fontSize === e.attrs.fontSize ? e : Object.values(n).some((e) => e !== null) ? e.type.create(n) : void 0;
1651
+ return typeof n.fontFamily == "string" && !t?.has(n.fontFamily) && (n.fontFamily = Xn(n.fontFamily)), typeof n.fontSize == "string" && (n.fontSize = Dn(n.fontSize)), n.fontFamily === e.attrs.fontFamily && n.fontSize === e.attrs.fontSize ? e : Object.values(n).some((e) => e !== null) ? e.type.create(n) : void 0;
1622
1652
  }
1623
- function Wn(e, t) {
1653
+ function Qn(e, t) {
1624
1654
  return e.flatMap((e) => {
1625
- let n = Un(e, t);
1655
+ let n = Zn(e, t);
1626
1656
  return n ? [n] : [];
1627
1657
  });
1628
1658
  }
1629
- function Gn(e, t) {
1630
- return e.isText ? e.mark(Wn(e.marks, t)) : e.copy(Kn(e.content, t)).mark(Wn(e.marks, t));
1659
+ function $n(e, t) {
1660
+ return e.isText ? e.mark(Qn(e.marks, t)) : e.copy(er(e.content, t)).mark(Qn(e.marks, t));
1631
1661
  }
1632
- function Kn(e, t) {
1662
+ function er(e, t) {
1633
1663
  let n = [];
1634
- for (let r = 0; r < e.childCount; r++) n.push(Gn(e.child(r), t));
1635
- return F.fromArray(n);
1664
+ for (let r = 0; r < e.childCount; r++) n.push($n(e.child(r), t));
1665
+ return I.fromArray(n);
1636
1666
  }
1637
- function qn(e, t) {
1638
- return new I(Kn(e.content, t), e.openStart, e.openEnd);
1667
+ function tr(e, t) {
1668
+ return new H(er(e.content, t), e.openStart, e.openEnd);
1639
1669
  }
1640
1670
  //#endregion
1641
1671
  //#region src/panels/contentPanel/components/blocks/selectAllText.ts
1642
- var Jn = B.create({
1672
+ var nr = R.create({
1643
1673
  name: "selectAllText",
1644
1674
  priority: 1e3,
1645
1675
  addKeyboardShortcuts() {
1646
1676
  return { "Mod-a": ({ editor: e }) => {
1647
1677
  let { doc: t } = e.state;
1648
1678
  return e.commands.setTextSelection({
1649
- from: V.atStart(t).from,
1650
- to: V.atEnd(t).to
1679
+ from: F.atStart(t).from,
1680
+ to: F.atEnd(t).to
1651
1681
  });
1652
1682
  } };
1653
1683
  }
1654
- }), Yn = B.create({
1684
+ }), rr = R.create({
1655
1685
  name: "keepEmptiedBlock",
1656
1686
  addProseMirrorPlugins() {
1657
- return [new H({
1658
- key: new M("keepEmptiedBlock"),
1687
+ return [new N({
1688
+ key: new P("keepEmptiedBlock"),
1659
1689
  filterTransaction(e) {
1660
1690
  return e.docChanged && e.setMeta("preventClearDocument", !0), !0;
1661
1691
  }
1662
1692
  })];
1663
1693
  }
1664
- }), Xn = { class: "picker" }, Zn = ["aria-label", "value"], Qn = {
1694
+ }), ir = { class: "picker" }, ar = ["aria-label", "value"], or = {
1665
1695
  key: 0,
1666
1696
  value: "paragraph"
1667
- }, $n = ["value"], er = { class: "picker" }, tr = ["aria-label", "value"], nr = {
1697
+ }, sr = ["value"], cr = { class: "picker" }, lr = ["aria-label", "value"], ur = {
1668
1698
  value: "mixed",
1669
1699
  disabled: "",
1670
1700
  hidden: ""
1671
- }, rr = ["value"], ir = ["value"], ar = { class: "picker" }, or = ["aria-label", "value"], sr = {
1701
+ }, dr = ["value"], fr = ["value"], pr = { class: "picker" }, mr = ["aria-label", "value"], hr = {
1672
1702
  value: "mixed",
1673
1703
  disabled: "",
1674
1704
  hidden: ""
1675
- }, cr = { value: "" }, lr = ["value"], ur = ["title", "aria-label"], dr = ["title", "aria-label"], fr = ["title", "aria-label"], pr = [
1705
+ }, gr = { value: "" }, _r = ["value"], vr = ["title", "aria-label"], yr = ["title", "aria-label"], br = ["title", "aria-label"], xr = [
1676
1706
  "title",
1677
1707
  "popovertarget",
1678
1708
  "aria-expanded"
1679
- ], mr = ["id", "aria-label"], hr = { class: "link-field" }, gr = {
1709
+ ], Sr = ["id", "aria-label"], Cr = { class: "link-field" }, wr = {
1680
1710
  key: 0,
1681
1711
  class: "link-anchor"
1682
- }, _r = {
1712
+ }, Tr = {
1683
1713
  key: 0,
1684
1714
  value: ""
1685
- }, vr = {
1715
+ }, Er = {
1686
1716
  key: 1,
1687
1717
  value: "",
1688
1718
  disabled: "",
1689
1719
  hidden: ""
1690
- }, yr = ["value"], br = ["title", "aria-label"], xr = ["title", "onClick"], Sr = {
1720
+ }, Dr = ["value"], Or = ["title", "aria-label"], kr = ["title", "onClick"], Ar = {
1691
1721
  "aria-hidden": "true",
1692
1722
  height: "16",
1693
1723
  viewBox: "0 0 16 16",
1694
1724
  width: "16"
1695
- }, Cr = [
1725
+ }, jr = [
1696
1726
  "width",
1697
1727
  "x",
1698
1728
  "y"
1699
- ], wr = 8, Tr = 220, Er = /*#__PURE__*/ Ne(/* @__PURE__ */ d({
1729
+ ], Mr = ["aria-labelledby", "onKeydown"], Nr = ["id"], Pr = 8, Fr = 220, Ir = /*#__PURE__*/ B(/* @__PURE__ */ m({
1700
1730
  __name: "TextEditor",
1701
- props: /*@__PURE__*/ u({
1731
+ props: /*@__PURE__*/ g({
1702
1732
  editable: {
1703
1733
  type: Boolean,
1704
1734
  default: !1
@@ -1721,51 +1751,52 @@ var Jn = B.create({
1721
1751
  fitSizeModifiers: {}
1722
1752
  }),
1723
1753
  emits: ["update:text", "update:fitSize"],
1724
- setup(t) {
1725
- let r = b(t, "text"), a = b(t, "fitSize"), l = t, { t: u, locale: d } = me(), p = [
1754
+ setup(e) {
1755
+ let o = ee(e, "text"), s = ee(e, "fitSize"), l = e, { t: p, locale: m } = Xe(), g = [
1726
1756
  "left",
1727
1757
  "center",
1728
1758
  "right",
1729
1759
  "justify"
1730
- ], m = g(() => u(l.headerOnly ? "blocks.header.label" : "blocks.text.label")), v = Zt({
1731
- ...De,
1760
+ ], ne = a(() => p(l.headerOnly ? "blocks.header.label" : "blocks.text.label")), S = en({
1761
+ ...Le,
1732
1762
  editorProps: {
1733
1763
  attributes: {
1734
- "aria-label": m.value,
1764
+ "aria-label": ne.value,
1735
1765
  "aria-multiline": "true",
1736
1766
  role: "textbox"
1737
1767
  },
1738
- transformPasted: (e) => qn(e, ye.value)
1768
+ transformPasted: (e) => tr(e, R.value),
1769
+ handlePaste: (e, t, n) => Y(t, n)
1739
1770
  },
1740
- content: Se(r.value),
1771
+ content: de(o.value),
1741
1772
  editable: l.editable,
1742
1773
  extensions: [
1743
- ...(l.headerOnly ? Ee : ze).map((e) => e.name === "mergeTag" ? e.extend({ addNodeView: () => tn(xn) }) : e),
1744
- Kt,
1745
- Jn,
1746
- Yn,
1747
- Bn.configure({ marks: ve }),
1748
- Ut.configure({ placeholder: () => u(l.headerOnly ? "blocks.header.placeholder" : "blocks.text.placeholder") })
1774
+ ...(l.headerOnly ? He : Fe).map((e) => e.name === "mergeTag" ? e.extend({ addNodeView: () => an(wn) }) : e),
1775
+ Yt,
1776
+ nr,
1777
+ rr,
1778
+ Un.configure({ marks: Ae }),
1779
+ Kt.configure({ placeholder: () => p(l.headerOnly ? "blocks.header.placeholder" : "blocks.text.placeholder") })
1749
1780
  ],
1750
1781
  onUpdate({ editor: e }) {
1751
- r.value = Ge(e.getJSON()), I();
1782
+ o.value = et(e.getJSON()), N();
1752
1783
  },
1753
1784
  onSelectionUpdate() {
1754
- I();
1785
+ N();
1755
1786
  }
1756
1787
  });
1757
- x(m, (e) => {
1758
- v.value?.setOptions({ editorProps: { attributes: { "aria-label": e } } });
1759
- }), x(r, (e) => {
1760
- let t = v.value;
1761
- !t || Ze(e, Ge(t.getJSON())) || t.commands.setContent(Se(e), { emitUpdate: !1 });
1762
- }), x(() => l.editable, (e) => v.value?.setEditable(e));
1763
- let S = y("root"), T = y("toolbar"), ie = y("content");
1764
- function oe() {
1765
- let e = ie.value?.$el;
1788
+ h(ne, (e) => {
1789
+ S.value?.setOptions({ editorProps: { attributes: { "aria-label": e } } });
1790
+ }), h(o, (e) => {
1791
+ let t = S.value;
1792
+ !t || De(e, et(t.getJSON())) || t.commands.setContent(de(e), { emitUpdate: !1 });
1793
+ }), h(() => l.editable, (e) => S.value?.setEditable(e));
1794
+ let w = b("root"), T = b("toolbar"), ae = b("content");
1795
+ function se() {
1796
+ let e = ae.value?.$el;
1766
1797
  if (!(l.editable && e)) return;
1767
1798
  if (l.width !== "fit") {
1768
- a.value !== void 0 && (a.value = void 0);
1799
+ s.value !== void 0 && (s.value = void 0);
1769
1800
  return;
1770
1801
  }
1771
1802
  let t = e.getBoundingClientRect(), n = {
@@ -1773,139 +1804,159 @@ var Jn = B.create({
1773
1804
  height: Math.ceil(t.height)
1774
1805
  };
1775
1806
  if (n.width < 1 || n.height < 1) return;
1776
- let r = a.value;
1777
- (r?.width !== n.width || r.height !== n.height) && (a.value = n);
1807
+ let r = s.value;
1808
+ (r?.width !== n.width || r.height !== n.height) && (s.value = n);
1778
1809
  }
1779
- let A, M;
1780
- function le() {
1781
- let e = ie.value?.$el;
1782
- !(A && e) || e === M || (M && A.unobserve(M), A.observe(e), M = e);
1810
+ let k, ue;
1811
+ function j() {
1812
+ let e = ae.value?.$el;
1813
+ !(k && e) || e === ue || (ue && k.unobserve(ue), k.observe(e), ue = e);
1783
1814
  }
1784
- function N() {
1785
- se(() => {
1786
- le(), oe();
1815
+ function fe() {
1816
+ n(() => {
1817
+ j(), se();
1787
1818
  });
1788
1819
  }
1789
- ee(() => {
1790
- !l.editable || typeof ResizeObserver > "u" || (A = new ResizeObserver(oe), N());
1791
- }), n(() => A?.disconnect()), x(() => [
1820
+ c(() => {
1821
+ !l.editable || typeof ResizeObserver > "u" || (k = new ResizeObserver(se), fe());
1822
+ }), v(() => k?.disconnect()), h(() => [
1792
1823
  l.width,
1793
1824
  l.paragraphSpacing,
1794
1825
  l.padding,
1795
- r.value
1796
- ], N);
1797
- function P() {
1826
+ o.value
1827
+ ], fe);
1828
+ function me() {
1798
1829
  let e = T.value;
1799
- !e || e.matches(":popover-open") || (e.showPopover(), I());
1830
+ !e || e.matches(":popover-open") || (e.showPopover(), N());
1800
1831
  }
1801
- function F(e) {
1832
+ function _e(e) {
1802
1833
  let t = e.relatedTarget;
1803
- t instanceof Node && S.value?.contains(t) || T.value?.matches(":popover-open") && T.value.hidePopover();
1834
+ t instanceof Node && w.value?.contains(t) || T.value?.matches(":popover-open") && T.value.hidePopover();
1835
+ }
1836
+ let ye = d(ie, void 0);
1837
+ function xe() {
1838
+ let e = ye?.value?.getBoundingClientRect();
1839
+ return {
1840
+ top: Math.max(e?.top ?? 0, 0),
1841
+ bottom: Math.min(e?.bottom ?? window.innerHeight, window.innerHeight)
1842
+ };
1804
1843
  }
1805
- function I() {
1806
- let e = v.value?.view, t = T.value, n = S.value;
1844
+ function N() {
1845
+ let e = S.value?.view, t = T.value, n = w.value;
1807
1846
  if (!(e && t && n && t.matches(":popover-open"))) return;
1808
- let r = n.closest(".block-container"), i = (r?.querySelector(":scope > .block-label") ?? r ?? n).getBoundingClientRect(), a = Math.max(wr, window.innerWidth - Tr - wr), o = Math.min(Math.max(i.left, wr), a);
1809
- t.style.left = `${o}px`, t.style.maxWidth = `${window.innerWidth - o - wr}px`, t.style.top = `${i.top}px`;
1847
+ let r = n.closest(".block-container"), i = (r?.querySelector(":scope > .block-label") ?? r ?? n).getBoundingClientRect(), a = Math.max(Pr, window.innerWidth - Fr - Pr), o = Math.min(Math.max(i.left, Pr), a);
1848
+ t.style.left = `${o}px`, t.style.maxWidth = `${window.innerWidth - o - Pr}px`, t.style.top = `${Ve(i.top, t.offsetHeight, xe())}px`;
1849
+ }
1850
+ function Ce(e) {
1851
+ let t = {
1852
+ capture: !0,
1853
+ passive: !0
1854
+ }, n = w.value?.getRootNode();
1855
+ for (let r of [window, n instanceof ShadowRoot ? n : null]) e ? r?.addEventListener("scroll", N, t) : r?.removeEventListener("scroll", N, t);
1856
+ e ? window.addEventListener("resize", N) : window.removeEventListener("resize", N);
1810
1857
  }
1811
- function de() {
1812
- let e = v.value;
1858
+ function P(e) {
1859
+ Ce(e.newState === "open");
1860
+ }
1861
+ v(() => Ce(!1));
1862
+ function Te() {
1863
+ let e = S.value;
1813
1864
  if (!e) return l.headerOnly ? "h1" : "paragraph";
1814
1865
  let t = We.find((t) => e.isActive("heading", { level: t }));
1815
1866
  return t ? `h${t}` : "paragraph";
1816
1867
  }
1817
- function pe(e) {
1868
+ function F(e) {
1818
1869
  let { target: t } = e;
1819
1870
  if (!(t instanceof HTMLSelectElement)) return;
1820
- let n = v.value?.chain().focus();
1871
+ let n = S.value?.chain().focus();
1821
1872
  if (!n) return;
1822
1873
  let r = We.find((e) => `h${e}` === t.value);
1823
1874
  r ? n.setHeading({ level: r }).run() : l.headerOnly || n.setParagraph().run();
1824
1875
  }
1825
- let L = s(te, g(() => Xe)), ge = s(ke, void 0);
1826
- function ve() {
1827
- let e = ge?.value;
1828
- return ue(l.headerOnly ? e?.header : e?.text, L.value);
1876
+ let I = d(oe, a(() => Ze)), Oe = d(je, void 0);
1877
+ function Ae() {
1878
+ let e = Oe?.value;
1879
+ return ve(l.headerOnly ? e?.header : e?.text, I.value);
1829
1880
  }
1830
- let z = we(), ye = g(() => new Set(z.value.map((e) => e.stack)));
1831
- function B(e) {
1881
+ let L = Me(), R = a(() => new Set(L.value.map((e) => e.stack)));
1882
+ function z(e) {
1832
1883
  return `custom:${e}`;
1833
1884
  }
1834
- function Ce(e) {
1835
- if (typeof e != "string") return L.value;
1836
- let t = z.value.find((t) => t.stack === e);
1837
- return t ? B(t.name) : he(e)?.key ?? L.value;
1885
+ function B(e) {
1886
+ if (typeof e != "string") return I.value;
1887
+ let t = L.value.find((t) => t.stack === e);
1888
+ return t ? z(t.name) : ke(e)?.key ?? I.value;
1838
1889
  }
1839
- function Oe() {
1840
- let e = v.value;
1841
- if (!e) return L.value;
1890
+ function Re() {
1891
+ let e = S.value;
1892
+ if (!e) return I.value;
1842
1893
  let { from: t, to: n, empty: r } = e.state.selection;
1843
- if (r) return Ce(e.getAttributes("textStyle").fontFamily);
1894
+ if (r) return B(e.getAttributes("textStyle").fontFamily);
1844
1895
  let i = /* @__PURE__ */ new Set();
1845
1896
  e.state.doc.nodesBetween(t, n, (e) => {
1846
1897
  if (!e.isText) return;
1847
1898
  let t = e.marks.find((e) => e.type.name === "textStyle");
1848
- i.add(Ce(t?.attrs.fontFamily));
1899
+ i.add(B(t?.attrs.fontFamily));
1849
1900
  });
1850
1901
  let a = Array.from(i);
1851
- return a.length > 1 ? "mixed" : a[0] ?? L.value;
1902
+ return a.length > 1 ? "mixed" : a[0] ?? I.value;
1852
1903
  }
1853
- function je(e) {
1904
+ function V(e) {
1854
1905
  let { target: t } = e;
1855
1906
  if (!(t instanceof HTMLSelectElement)) return;
1856
- let n = t.value, r = v.value?.chain().focus();
1907
+ let n = t.value, r = S.value?.chain().focus();
1857
1908
  if (!r) return;
1858
- let i = z.value.find((e) => B(e.name) === n);
1909
+ let i = L.value.find((e) => z(e.name) === n);
1859
1910
  if (i) {
1860
1911
  r.setFontFamily(i.stack).run();
1861
1912
  return;
1862
1913
  }
1863
- Je(n) && (n === L.value ? r.unsetFontFamily().run() : r.setFontFamily(ce(n)).run());
1914
+ pe(n) && (n === I.value ? r.unsetFontFamily().run() : r.setFontFamily(ge(n)).run());
1864
1915
  }
1865
- function V(e) {
1866
- return typeof e == "string" && Tn(e) ? e : "";
1916
+ function Ue(e) {
1917
+ return typeof e == "string" && On(e) ? e : "";
1867
1918
  }
1868
- function Ne() {
1869
- let e = v.value;
1919
+ function Ge() {
1920
+ let e = S.value;
1870
1921
  if (!e) return "";
1871
1922
  let { from: t, to: n, empty: r } = e.state.selection;
1872
- if (r) return V(e.getAttributes("textStyle").fontSize);
1923
+ if (r) return Ue(e.getAttributes("textStyle").fontSize);
1873
1924
  let i = /* @__PURE__ */ new Set();
1874
1925
  e.state.doc.nodesBetween(t, n, (e) => {
1875
1926
  if (!e.isText) return;
1876
1927
  let t = e.marks.find((e) => e.type.name === "textStyle");
1877
- i.add(V(t?.attrs.fontSize));
1928
+ i.add(Ue(t?.attrs.fontSize));
1878
1929
  });
1879
1930
  let a = Array.from(i);
1880
1931
  return a.length > 1 ? "mixed" : a[0] ?? "";
1881
1932
  }
1882
- function H(e) {
1933
+ function Qe(e) {
1883
1934
  let { target: t } = e;
1884
1935
  if (!(t instanceof HTMLSelectElement)) return;
1885
- let n = v.value?.chain().focus();
1886
- n && (t.value === "" ? n.unsetFontSize().run() : Tn(t.value) && n.setFontSize(t.value).run());
1936
+ let n = S.value?.chain().focus();
1937
+ n && (t.value === "" ? n.unsetFontSize().run() : On(t.value) && n.setFontSize(t.value).run());
1887
1938
  }
1888
- let Ie = Ve(() => {
1889
- let e = Oe();
1890
- return Je(e) ? e : void 0;
1891
- }), Le = g({
1939
+ let $e = Ke(() => {
1940
+ let e = Re();
1941
+ return pe(e) ? e : void 0;
1942
+ }), tt = a({
1892
1943
  get: () => {
1893
- let e = v.value?.getAttributes("textStyle").color, t = typeof e == "string" ? Pe(e) : void 0;
1944
+ let e = S.value?.getAttributes("textStyle").color, t = typeof e == "string" ? Se(e) : void 0;
1894
1945
  return t ? {
1895
1946
  type: "color",
1896
1947
  ...t
1897
- } : _e;
1948
+ } : we;
1898
1949
  },
1899
1950
  set: (e) => {
1900
- e.type !== "transparent" && v.value?.chain().setColor(Me(e)).run();
1951
+ e.type !== "transparent" && S.value?.chain().setColor(Ee(e)).run();
1901
1952
  }
1902
- }), Be = {
1953
+ }), rt = {
1903
1954
  left: "blocks.text.alignLeft",
1904
1955
  center: "blocks.text.alignCenter",
1905
1956
  right: "blocks.text.alignRight",
1906
1957
  justify: "blocks.text.alignJustify"
1907
1958
  };
1908
- function Ke(e) {
1959
+ function H(e) {
1909
1960
  return (e === "justify" ? [
1910
1961
  14,
1911
1962
  14,
@@ -1925,53 +1976,85 @@ var Jn = B.create({
1925
1976
  };
1926
1977
  });
1927
1978
  }
1928
- let Ye = c(), U = y("linkPopover"), W = y("linkInput"), Qe = y("linkTrigger"), G = O(""), et = O(!1), tt = O(!1);
1929
- function K(e) {
1979
+ let it = te(), U = b("linkPopover"), ot = b("linkInput"), W = b("linkTrigger"), G = A(""), st = A(!1), ct = A(!1);
1980
+ function lt(e) {
1930
1981
  if (e.newState !== "open") return;
1931
- let t = v.value?.getAttributes("link")?.href;
1932
- G.value = typeof t == "string" ? t : "", tt.value = G.value !== "";
1933
- let n = U.value, r = Qe.value?.getBoundingClientRect();
1982
+ let t = S.value?.getAttributes("link")?.href;
1983
+ G.value = typeof t == "string" ? t : "", ct.value = G.value !== "";
1984
+ let n = U.value, r = W.value?.getBoundingClientRect();
1934
1985
  n && r && (n.style.left = `${r.left}px`, n.style.top = `${r.bottom + 4}px`);
1935
1986
  }
1936
- function nt(e) {
1937
- if (et.value = e.newState === "open", e.newState !== "open") return;
1987
+ function ut(e) {
1988
+ if (st.value = e.newState === "open", e.newState !== "open") return;
1938
1989
  let t = U.value;
1939
1990
  if (t) {
1940
1991
  let e = window.innerWidth - t.offsetWidth - 8;
1941
1992
  Number.parseFloat(t.style.left) > e && (t.style.left = `${Math.max(8, e)}px`);
1942
1993
  }
1943
- se(() => {
1944
- W.value?.focus(), W.value?.select();
1994
+ n(() => {
1995
+ ot.value?.focus(), ot.value?.select();
1945
1996
  });
1946
1997
  }
1947
- function rt(e) {
1998
+ function dt(e) {
1948
1999
  let t = e.relatedTarget, n = U.value;
1949
2000
  t instanceof Node && n?.contains(t) || n?.hidePopover();
1950
2001
  }
1951
- function it() {
1952
- let e = v.value?.chain().focus();
2002
+ function K() {
2003
+ let e = S.value?.chain().focus();
1953
2004
  if (!e) return;
1954
- let t = He(G.value);
2005
+ let t = qe(G.value);
1955
2006
  t === "" ? e.unsetLink().run() : e.setLink({
1956
2007
  href: t,
1957
2008
  target: t.startsWith("#") ? null : "_blank"
1958
2009
  }).run(), U.value?.hidePopover();
1959
2010
  }
1960
- let at = s(ae, g(() => [])), ot = g(() => G.value.startsWith("#") && at.value.includes(G.value.slice(1)) ? G.value.slice(1) : "");
1961
- function st(e) {
2011
+ let ft = d(ce, a(() => [])), pt = a(() => G.value.startsWith("#") && ft.value.includes(G.value.slice(1)) ? G.value.slice(1) : "");
2012
+ function mt(e) {
1962
2013
  e === "" ? G.value.startsWith("#") && (G.value = "") : G.value = `#${e}`;
1963
2014
  }
1964
- function q() {
1965
- v.value?.chain().focus().unsetLink().run(), U.value?.hidePopover();
2015
+ function ht() {
2016
+ S.value?.chain().focus().unsetLink().run(), U.value?.hidePopover();
2017
+ }
2018
+ let q = b("pastePrompt"), gt = b("pasteKeep"), _t = te(), J;
2019
+ function Y(e, t) {
2020
+ let n = S.value, r = q.value, i = e.clipboardData?.getData("text/plain") ?? "";
2021
+ return n && r && i && Gn(n.state, t) ? (J = {
2022
+ slice: t,
2023
+ text: i
2024
+ }, r.showPopover(), vt(n.view, r), gt.value?.focus(), !0) : !1;
2025
+ }
2026
+ function vt(e, t) {
2027
+ let n = e.coordsAtPos(e.state.selection.from), r = Ie(n, window.innerHeight), i = window.innerWidth - t.offsetWidth - 8;
2028
+ t.style.left = `${Math.max(8, Math.min(n.left, i))}px`, t.style.top = r.side === "below" ? `${r.offset + 4}px` : "auto", t.style.bottom = r.side === "above" ? `${r.offset + 4}px` : "auto";
1966
2029
  }
1967
- let ct = s(be), lt = qe(), ut = g(() => an(ct?.value?.ai)), J = O(!1);
1968
- async function Y(e) {
1969
- let t = v.value, n = ct?.value?.ai;
1970
- if (!(t && n) || J.value) return;
1971
- let r = Nn(t.state.doc, t.state.selection);
2030
+ function X(e) {
2031
+ let t = J;
2032
+ J = void 0;
2033
+ let n = S.value;
2034
+ if (t && n && !n.isDestroyed) {
2035
+ let { view: r } = n;
2036
+ r.focus(), r.dispatch(Kn(r.state, e ? t.slice : Jn(r.state, t.text)));
2037
+ }
2038
+ yt();
2039
+ }
2040
+ function Z() {
2041
+ J = void 0, S.value?.view.focus(), yt();
2042
+ }
2043
+ function yt() {
2044
+ q.value?.matches(":popover-open") && q.value.hidePopover();
2045
+ }
2046
+ function bt(e) {
2047
+ let t = e.relatedTarget;
2048
+ t instanceof Node && q.value?.contains(t) || (J = void 0, yt());
2049
+ }
2050
+ let xt = d(nt), St = he(), Ct = a(() => cn(xt?.value?.ai)), wt = A(!1);
2051
+ async function Tt(e) {
2052
+ let t = S.value, n = xt?.value?.ai;
2053
+ if (!(t && n) || wt.value) return;
2054
+ let r = In(t.state.doc, t.state.selection);
1972
2055
  if (r.length === 0) return;
1973
- J.value = !0;
1974
- let i = new fe(), a = ({ transaction: e, appendedTransactions: t }) => {
2056
+ wt.value = !0;
2057
+ let i = new be(), a = ({ transaction: e, appendedTransactions: t }) => {
1975
2058
  for (let n of [e, ...t]) i.appendMapping(n.mapping);
1976
2059
  };
1977
2060
  t.on("transaction", a);
@@ -1979,246 +2062,279 @@ var Jn = B.create({
1979
2062
  let a = await Promise.all(r.map(({ text: t }) => n.run({
1980
2063
  action: e,
1981
2064
  text: t,
1982
- locale: d.value
2065
+ locale: m.value
1983
2066
  })));
1984
2067
  if (!t.isDestroyed) {
1985
- let e = Rn(t.state, r, a, i);
2068
+ let e = Vn(t.state, r, a, i);
1986
2069
  e && t.view.dispatch(e);
1987
2070
  }
1988
2071
  } catch (e) {
1989
- console.error("[bygga-editor] the AI action failed —", e), lt?.show(u("blocks.text.ai.failed"));
2072
+ console.error("[bygga-editor] the AI action failed —", e), St?.show(p("blocks.text.ai.failed"));
1990
2073
  } finally {
1991
- t.off("transaction", a), J.value = !1;
2074
+ t.off("transaction", a), wt.value = !1;
1992
2075
  }
1993
2076
  }
1994
- function dt(e) {
1995
- v.value?.chain().focus().insertContent({
1996
- type: Ae,
2077
+ function Et(e) {
2078
+ S.value?.chain().focus().insertContent({
2079
+ type: Ye,
1997
2080
  attrs: { id: e }
1998
2081
  }).run();
1999
2082
  }
2000
- return (t, n) => (_(), D("div", {
2083
+ return (e, n) => (y(), t("div", {
2001
2084
  ref_key: "root",
2002
- ref: S,
2085
+ ref: w,
2003
2086
  style: {
2004
2087
  position: "relative",
2005
2088
  width: "100%"
2006
2089
  },
2007
- onFocusin: P,
2008
- onFocusout: F
2009
- }, [E(C($e), {
2010
- width: l.width,
2011
- align: l.align
2012
- }, {
2013
- default: e(() => [E(C(Yt), {
2014
- ref_key: "content",
2015
- ref: ie,
2016
- class: k({
2017
- "text-input": l.editable,
2018
- "text-spaced": l.paragraphSpacing !== void 0
2019
- }),
2020
- editor: C(v),
2021
- style: re([C(xe)(l), l.paragraphSpacing === void 0 ? void 0 : { "--bygga-paragraph-spacing": `${l.paragraphSpacing}px` }])
2022
- }, null, 8, [
2023
- "class",
2024
- "editor",
2025
- "style"
2026
- ])]),
2027
- _: 1
2028
- }, 8, ["width", "align"]), l.editable ? (_(), D("div", {
2029
- key: 0,
2030
- ref_key: "toolbar",
2031
- ref: T,
2032
- popover: "manual",
2033
- class: "toolbar"
2090
+ onFocusin: me,
2091
+ onFocusout: _e
2034
2092
  }, [
2035
- i("span", Xn, [i("select", {
2036
- "aria-label": C(u)("blocks.text.styleLabel"),
2037
- class: "style",
2038
- value: de(),
2039
- onChange: pe,
2040
- onMousedown: n[0] ||= j(() => {}, ["stop"])
2041
- }, [l.headerOnly ? f("", !0) : (_(), D("option", Qn, w(C(u)("blocks.text.styleNormal")), 1)), (_(!0), D(h, null, o(C(We), (e) => (_(), D("option", {
2042
- key: e,
2043
- value: `h${e}`
2044
- }, w(C(u)("blocks.text.styleHeading", { level: e })), 9, $n))), 128))], 40, Zn), E(R, {
2045
- class: "picker-chevron",
2046
- name: "chevron-down",
2047
- size: 12
2048
- })]),
2049
- n[20] ||= i("span", { class: "divider" }, null, -1),
2050
- i("span", er, [i("select", {
2051
- "aria-label": C(u)("blocks.text.font"),
2052
- class: "font",
2053
- value: Oe(),
2054
- onChange: je,
2055
- onMousedown: n[1] ||= j(() => {}, ["stop"])
2056
- }, [
2057
- i("option", nr, w(C(u)("blocks.text.fontMixed")), 1),
2058
- (_(!0), D(h, null, o(C(Ie), (e) => (_(), D("option", {
2059
- key: e.key,
2060
- value: e.key
2061
- }, w(e.name), 9, rr))), 128)),
2062
- (_(!0), D(h, null, o(C(z), (e) => (_(), D("option", {
2063
- key: B(e.name),
2064
- value: B(e.name)
2065
- }, w(e.name), 9, ir))), 128))
2066
- ], 40, tr), E(R, {
2067
- class: "picker-chevron",
2068
- name: "chevron-down",
2069
- size: 12
2070
- })]),
2071
- i("span", ar, [i("select", {
2072
- "aria-label": C(u)("blocks.text.fontSize"),
2073
- class: "size",
2074
- value: Ne(),
2075
- onChange: H,
2076
- onMousedown: n[2] ||= j(() => {}, ["stop"])
2077
- }, [
2078
- i("option", sr, w(C(u)("blocks.text.fontMixed")), 1),
2079
- i("option", cr, w(C(u)("blocks.text.fontSizeDefault")), 1),
2080
- (_(!0), D(h, null, o(C(Re), (e) => (_(), D("option", {
2081
- key: e,
2082
- value: C(Sn)(e)
2083
- }, w(e), 9, lr))), 128))
2084
- ], 40, or), E(R, {
2085
- class: "picker-chevron",
2086
- name: "chevron-down",
2087
- size: 12
2088
- })]),
2089
- E(Ue, {
2090
- modelValue: Le.value,
2091
- "onUpdate:modelValue": n[3] ||= (e) => Le.value = e,
2092
- "allow-transparent": !1,
2093
- label: C(u)("blocks.text.textColor"),
2094
- compact: "",
2095
- onMousedown: n[4] ||= j(() => {}, ["stop"])
2096
- }, null, 8, ["modelValue", "label"]),
2097
- n[21] ||= i("span", { class: "divider" }, null, -1),
2098
- i("button", {
2099
- class: k({ active: C(v)?.isActive("bold") }),
2100
- type: "button",
2101
- title: C(u)("blocks.text.bold"),
2102
- "aria-label": C(u)("blocks.text.bold"),
2103
- onClick: n[5] ||= (e) => C(v)?.chain().focus().toggleBold().run(),
2104
- onMousedown: n[6] ||= j(() => {}, ["prevent"])
2105
- }, [...n[17] ||= [i("b", null, "B", -1)]], 42, ur),
2106
- i("button", {
2107
- class: k({ active: C(v)?.isActive("italic") }),
2108
- type: "button",
2109
- title: C(u)("blocks.text.italic"),
2110
- "aria-label": C(u)("blocks.text.italic"),
2111
- onClick: n[7] ||= (e) => C(v)?.chain().focus().toggleItalic().run(),
2112
- onMousedown: n[8] ||= j(() => {}, ["prevent"])
2113
- }, [...n[18] ||= [i("i", null, "I", -1)]], 42, dr),
2114
- i("button", {
2115
- class: k({ active: C(v)?.isActive("underline") }),
2116
- type: "button",
2117
- title: C(u)("blocks.text.underline"),
2118
- "aria-label": C(u)("blocks.text.underline"),
2119
- onClick: n[9] ||= (e) => C(v)?.chain().focus().toggleUnderline().run(),
2120
- onMousedown: n[10] ||= j(() => {}, ["prevent"])
2121
- }, [...n[19] ||= [i("u", null, "U", -1)]], 42, fr),
2122
- i("button", {
2123
- ref_key: "linkTrigger",
2124
- ref: Qe,
2125
- class: k({ active: C(v)?.isActive("link") }),
2126
- type: "button",
2127
- title: C(u)("blocks.text.link"),
2128
- popovertarget: C(Ye),
2129
- "aria-haspopup": "dialog",
2130
- "aria-expanded": et.value,
2131
- onMousedown: n[11] ||= j(() => {}, ["prevent"])
2132
- }, [E(R, {
2133
- name: "link",
2134
- size: 16
2135
- })], 42, pr),
2136
- l.editable ? (_(), D("div", {
2137
- key: 0,
2138
- id: C(Ye),
2139
- ref_key: "linkPopover",
2140
- ref: U,
2141
- class: "link-popover",
2142
- popover: "",
2143
- role: "dialog",
2144
- "aria-label": C(u)("blocks.text.link"),
2145
- onBeforetoggle: K,
2146
- onToggle: nt,
2147
- onFocusout: rt
2148
- }, [
2149
- i("span", hr, [E(Te, {
2150
- ref_key: "linkInput",
2151
- ref: W,
2152
- modelValue: G.value,
2153
- "onUpdate:modelValue": n[12] ||= (e) => G.value = e,
2154
- inputmode: "url",
2155
- spellcheck: "false",
2156
- autocomplete: "off",
2157
- placeholder: C(u)("blocks.text.linkPlaceholder"),
2158
- "aria-label": C(u)("blocks.text.linkPrompt"),
2159
- onKeydown: ne(j(it, ["prevent"]), ["enter"])
2093
+ f(O(at), {
2094
+ width: l.width,
2095
+ align: l.align
2096
+ }, {
2097
+ default: C(() => [f(O(Qt), {
2098
+ ref_key: "content",
2099
+ ref: ae,
2100
+ class: D({
2101
+ "text-input": l.editable,
2102
+ "text-spaced": l.paragraphSpacing !== void 0
2103
+ }),
2104
+ editor: O(S),
2105
+ style: re([O(Ne)(l), l.paragraphSpacing === void 0 ? void 0 : { "--bygga-paragraph-spacing": `${l.paragraphSpacing}px` }])
2160
2106
  }, null, 8, [
2161
- "modelValue",
2162
- "placeholder",
2163
- "aria-label",
2164
- "onKeydown"
2107
+ "class",
2108
+ "editor",
2109
+ "style"
2165
2110
  ])]),
2166
- C(at).length ? (_(), D("span", gr, [E(Fe, {
2167
- "aria-label": C(u)("blocks.common.anchorLink.label"),
2168
- "model-value": ot.value,
2169
- "onUpdate:modelValue": st,
2170
- onMousedown: n[13] ||= j(() => {}, ["stop"])
2171
- }, {
2172
- default: e(() => [ot.value ? (_(), D("option", _r, w(C(u)("blocks.common.anchorLink.none")), 1)) : (_(), D("option", vr, w(C(u)("blocks.common.anchorLink.placeholder")), 1)), (_(!0), D(h, null, o(C(at), (e) => (_(), D("option", {
2111
+ _: 1
2112
+ }, 8, ["width", "align"]),
2113
+ l.editable ? (y(), t("div", {
2114
+ key: 0,
2115
+ ref_key: "toolbar",
2116
+ ref: T,
2117
+ popover: "manual",
2118
+ class: "toolbar",
2119
+ onToggle: P
2120
+ }, [
2121
+ i("span", ir, [i("select", {
2122
+ "aria-label": O(p)("blocks.text.styleLabel"),
2123
+ class: "style",
2124
+ value: Te(),
2125
+ onChange: F,
2126
+ onMousedown: n[0] ||= _(() => {}, ["stop"])
2127
+ }, [l.headerOnly ? E("", !0) : (y(), t("option", or, x(O(p)("blocks.text.styleNormal")), 1)), (y(!0), t(r, null, u(O(We), (e) => (y(), t("option", {
2128
+ key: e,
2129
+ value: `h${e}`
2130
+ }, x(O(p)("blocks.text.styleHeading", { level: e })), 9, sr))), 128))], 40, ar), f(M, {
2131
+ class: "picker-chevron",
2132
+ name: "chevron-down",
2133
+ size: 12
2134
+ })]),
2135
+ n[24] ||= i("span", { class: "divider" }, null, -1),
2136
+ i("span", cr, [i("select", {
2137
+ "aria-label": O(p)("blocks.text.font"),
2138
+ class: "font",
2139
+ value: Re(),
2140
+ onChange: V,
2141
+ onMousedown: n[1] ||= _(() => {}, ["stop"])
2142
+ }, [
2143
+ i("option", ur, x(O(p)("blocks.text.fontMixed")), 1),
2144
+ (y(!0), t(r, null, u(O($e), (e) => (y(), t("option", {
2145
+ key: e.key,
2146
+ value: e.key
2147
+ }, x(e.name), 9, dr))), 128)),
2148
+ (y(!0), t(r, null, u(O(L), (e) => (y(), t("option", {
2149
+ key: z(e.name),
2150
+ value: z(e.name)
2151
+ }, x(e.name), 9, fr))), 128))
2152
+ ], 40, lr), f(M, {
2153
+ class: "picker-chevron",
2154
+ name: "chevron-down",
2155
+ size: 12
2156
+ })]),
2157
+ i("span", pr, [i("select", {
2158
+ "aria-label": O(p)("blocks.text.fontSize"),
2159
+ class: "size",
2160
+ value: Ge(),
2161
+ onChange: Qe,
2162
+ onMousedown: n[2] ||= _(() => {}, ["stop"])
2163
+ }, [
2164
+ i("option", hr, x(O(p)("blocks.text.fontMixed")), 1),
2165
+ i("option", gr, x(O(p)("blocks.text.fontSizeDefault")), 1),
2166
+ (y(!0), t(r, null, u(O(Be), (e) => (y(), t("option", {
2173
2167
  key: e,
2174
- value: e
2175
- }, " #" + w(e), 9, yr))), 128))]),
2176
- _: 1
2177
- }, 8, ["aria-label", "model-value"])])) : f("", !0),
2168
+ value: O(Tn)(e)
2169
+ }, x(e), 9, _r))), 128))
2170
+ ], 40, mr), f(M, {
2171
+ class: "picker-chevron",
2172
+ name: "chevron-down",
2173
+ size: 12
2174
+ })]),
2175
+ f(Je, {
2176
+ modelValue: tt.value,
2177
+ "onUpdate:modelValue": n[3] ||= (e) => tt.value = e,
2178
+ "allow-transparent": !1,
2179
+ label: O(p)("blocks.text.textColor"),
2180
+ compact: "",
2181
+ "keep-focus": "",
2182
+ onMousedown: n[4] ||= _(() => {}, ["stop"])
2183
+ }, null, 8, ["modelValue", "label"]),
2184
+ n[25] ||= i("span", { class: "divider" }, null, -1),
2185
+ i("button", {
2186
+ class: D({ active: O(S)?.isActive("bold") }),
2187
+ type: "button",
2188
+ title: O(p)("blocks.text.bold"),
2189
+ "aria-label": O(p)("blocks.text.bold"),
2190
+ onClick: n[5] ||= (e) => O(S)?.chain().focus().toggleBold().run(),
2191
+ onMousedown: n[6] ||= _(() => {}, ["prevent"])
2192
+ }, [...n[21] ||= [i("b", null, "B", -1)]], 42, vr),
2193
+ i("button", {
2194
+ class: D({ active: O(S)?.isActive("italic") }),
2195
+ type: "button",
2196
+ title: O(p)("blocks.text.italic"),
2197
+ "aria-label": O(p)("blocks.text.italic"),
2198
+ onClick: n[7] ||= (e) => O(S)?.chain().focus().toggleItalic().run(),
2199
+ onMousedown: n[8] ||= _(() => {}, ["prevent"])
2200
+ }, [...n[22] ||= [i("i", null, "I", -1)]], 42, yr),
2178
2201
  i("button", {
2179
- class: "link-apply",
2202
+ class: D({ active: O(S)?.isActive("underline") }),
2180
2203
  type: "button",
2181
- onClick: it,
2182
- onMousedown: n[14] ||= j(() => {}, ["prevent"])
2183
- }, w(C(u)("blocks.text.linkApply")), 33),
2184
- tt.value ? (_(), D("button", {
2185
- key: 1,
2186
- class: "link-remove",
2204
+ title: O(p)("blocks.text.underline"),
2205
+ "aria-label": O(p)("blocks.text.underline"),
2206
+ onClick: n[9] ||= (e) => O(S)?.chain().focus().toggleUnderline().run(),
2207
+ onMousedown: n[10] ||= _(() => {}, ["prevent"])
2208
+ }, [...n[23] ||= [i("u", null, "U", -1)]], 42, br),
2209
+ i("button", {
2210
+ ref_key: "linkTrigger",
2211
+ ref: W,
2212
+ class: D({ active: O(S)?.isActive("link") }),
2187
2213
  type: "button",
2188
- title: C(u)("blocks.text.linkRemove"),
2189
- "aria-label": C(u)("blocks.text.linkRemove"),
2190
- onClick: q,
2191
- onMousedown: n[15] ||= j(() => {}, ["prevent"])
2192
- }, [E(R, {
2193
- name: "trash",
2214
+ title: O(p)("blocks.text.link"),
2215
+ popovertarget: O(it),
2216
+ "aria-haspopup": "dialog",
2217
+ "aria-expanded": st.value,
2218
+ onMousedown: n[11] ||= _(() => {}, ["prevent"])
2219
+ }, [f(M, {
2220
+ name: "link",
2194
2221
  size: 16
2195
- })], 40, br)) : f("", !0)
2196
- ], 40, mr)) : f("", !0),
2197
- E(bn, { onSelect: dt }),
2198
- E(fn, {
2199
- actions: ut.value,
2200
- pending: J.value,
2201
- onSelect: Y
2202
- }, null, 8, ["actions", "pending"]),
2203
- n[22] ||= i("span", { class: "divider" }, null, -1),
2204
- (_(), D(h, null, o(p, (e) => i("button", {
2205
- key: e,
2206
- class: k({ active: C(v)?.isActive({ textAlign: e }) }),
2207
- title: C(u)(Be[e]),
2208
- type: "button",
2209
- onClick: (t) => C(v)?.chain().focus().setTextAlign(e).run(),
2210
- onMousedown: n[16] ||= j(() => {}, ["prevent"])
2211
- }, [(_(), D("svg", Sr, [(_(!0), D(h, null, o(Ke(e), (e, t) => (_(), D("rect", {
2212
- key: t,
2213
- fill: "currentColor",
2214
- height: "1.5",
2215
- rx: "0.5",
2216
- width: e.w,
2217
- x: e.x,
2218
- y: e.y
2219
- }, null, 8, Cr))), 128))]))], 42, xr)), 64))
2220
- ], 512)) : f("", !0)], 544));
2221
- }
2222
- }), [["styles", [".text-spaced .tiptap :is(p,h1,h2,h3,h4,h5,h6){margin:var(--bygga-paragraph-spacing) 0}.tiptap{font-feature-settings:\"liga\" 0;font-variant-ligatures:none;overflow-wrap:break-word;white-space:pre-wrap;position:relative}.text-input .tiptap:focus,.text-input .tiptap:focus-visible{outline:none}.text-input .tiptap .is-editor-empty:first-child{position:relative}.text-input .tiptap .is-editor-empty:first-child:before{color:var(--bygga-color-text-muted);content:attr(data-placeholder);pointer-events:none;text-overflow:ellipsis;inset-inline:0;white-space:nowrap;position:absolute;top:0;overflow:hidden}.merge-tag{background:var(--bygga-color-track);border:1px solid var(--bygga-color-border);border-radius:var(--bygga-radius-sm);color:var(--bygga-color-accent);cursor:default;white-space:nowrap;-webkit-user-select:all;user-select:all;padding:0 .3em;font-size:.9em}.merge-tag.is-unknown{color:var(--bygga-color-text-muted);border-style:dashed}.merge-tag.ProseMirror-selectednode{outline:2px solid var(--bygga-color-accent);outline-offset:1px}", ".toolbar[data-v-8d51711e]{background:var(--bygga-color-surface);border:1px solid var(--bygga-color-border-subtle);box-shadow:var(--bygga-shadow-card);white-space:nowrap;font-family:var(--bygga-font-family);direction:ltr;border-radius:0;flex-wrap:wrap;align-items:center;gap:3px;margin:0;padding:6px 4px;font-size:13px;font-weight:400;position:fixed;inset:auto;transform:translateY(-100%)}.toolbar[data-v-8d51711e]:popover-open{display:flex}.toolbar>button[data-v-8d51711e]{color:var(--bygga-color-text);cursor:pointer;background:0 0;border:none;border-radius:4px;justify-content:center;align-items:center;min-width:30px;height:30px;padding:0;display:inline-flex}.toolbar>button[data-v-8d51711e]:hover{background:color-mix(in srgb, var(--bygga-color-text) 30%, transparent)}.toolbar>button.active[data-v-8d51711e]{background:var(--bygga-color-selected,var(--bygga-color-text));color:var(--bygga-color-selected-text,#fff);forced-color-adjust:none}.toolbar .picker[data-v-8d51711e]{align-items:center;display:inline-flex;position:relative}.toolbar .style[data-v-8d51711e],.toolbar .font[data-v-8d51711e],.toolbar .size[data-v-8d51711e]{appearance:none;color:var(--bygga-color-text);cursor:pointer;font:inherit;text-align-last:right;background:0 0;border:none;border-radius:4px;height:30px;padding:0 21px 0 6px}.toolbar .style[data-v-8d51711e]:hover,.toolbar .font[data-v-8d51711e]:hover,.toolbar .size[data-v-8d51711e]:hover{background:color-mix(in srgb, var(--bygga-color-text) 7%, transparent)}.toolbar .picker-chevron[data-v-8d51711e]{color:var(--bygga-color-text);pointer-events:none;position:absolute;right:5px}.toolbar .divider[data-v-8d51711e]{background:var(--bygga-color-divider);width:1px;height:24px;margin:0 4px}.link-popover[data-v-8d51711e]{background:var(--bygga-color-surface);border:1px solid var(--bygga-color-border);border-radius:var(--bygga-radius-sm);box-shadow:var(--bygga-shadow-card);align-items:center;gap:.25em;margin:0;padding:.25em;position:fixed;inset:auto}.link-popover[data-v-8d51711e]:popover-open{display:flex}.link-field[data-v-8d51711e]{width:18em}.link-anchor[data-v-8d51711e]{width:10em}.link-apply[data-v-8d51711e]{background:var(--bygga-color-accent);border-radius:var(--bygga-radius-sm);color:var(--bygga-color-surface);cursor:pointer;border:none;padding:.4em .8em}.link-remove[data-v-8d51711e]{border-radius:var(--bygga-radius-sm);color:var(--bygga-color-text-muted);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;min-width:1.8em;height:1.8em;padding:0;display:inline-flex}.link-remove[data-v-8d51711e]:hover{background:var(--bygga-color-track);color:var(--bygga-color-accent)}"]], ["__scopeId", "data-v-8d51711e"]]);
2222
+ })], 42, xr),
2223
+ l.editable ? (y(), t("div", {
2224
+ key: 0,
2225
+ id: O(it),
2226
+ ref_key: "linkPopover",
2227
+ ref: U,
2228
+ class: "link-popover",
2229
+ popover: "",
2230
+ role: "dialog",
2231
+ "aria-label": O(p)("blocks.text.link"),
2232
+ onBeforetoggle: lt,
2233
+ onToggle: ut,
2234
+ onFocusout: dt
2235
+ }, [
2236
+ i("span", Cr, [f(Pe, {
2237
+ ref_key: "linkInput",
2238
+ ref: ot,
2239
+ modelValue: G.value,
2240
+ "onUpdate:modelValue": n[12] ||= (e) => G.value = e,
2241
+ inputmode: "url",
2242
+ spellcheck: "false",
2243
+ autocomplete: "off",
2244
+ placeholder: O(p)("blocks.text.linkPlaceholder"),
2245
+ "aria-label": O(p)("blocks.text.linkPrompt"),
2246
+ onKeydown: le(_(K, ["prevent"]), ["enter"])
2247
+ }, null, 8, [
2248
+ "modelValue",
2249
+ "placeholder",
2250
+ "aria-label",
2251
+ "onKeydown"
2252
+ ])]),
2253
+ O(ft).length ? (y(), t("span", wr, [f(ze, {
2254
+ "aria-label": O(p)("blocks.common.anchorLink.label"),
2255
+ "model-value": pt.value,
2256
+ "onUpdate:modelValue": mt,
2257
+ onMousedown: n[13] ||= _(() => {}, ["stop"])
2258
+ }, {
2259
+ default: C(() => [pt.value ? (y(), t("option", Tr, x(O(p)("blocks.common.anchorLink.none")), 1)) : (y(), t("option", Er, x(O(p)("blocks.common.anchorLink.placeholder")), 1)), (y(!0), t(r, null, u(O(ft), (e) => (y(), t("option", {
2260
+ key: e,
2261
+ value: e
2262
+ }, " #" + x(e), 9, Dr))), 128))]),
2263
+ _: 1
2264
+ }, 8, ["aria-label", "model-value"])])) : E("", !0),
2265
+ i("button", {
2266
+ class: "link-apply",
2267
+ type: "button",
2268
+ onClick: K,
2269
+ onMousedown: n[14] ||= _(() => {}, ["prevent"])
2270
+ }, x(O(p)("blocks.text.linkApply")), 33),
2271
+ ct.value ? (y(), t("button", {
2272
+ key: 1,
2273
+ class: "link-remove",
2274
+ type: "button",
2275
+ title: O(p)("blocks.text.linkRemove"),
2276
+ "aria-label": O(p)("blocks.text.linkRemove"),
2277
+ onClick: ht,
2278
+ onMousedown: n[15] ||= _(() => {}, ["prevent"])
2279
+ }, [f(M, {
2280
+ name: "trash",
2281
+ size: 16
2282
+ })], 40, Or)) : E("", !0)
2283
+ ], 40, Sr)) : E("", !0),
2284
+ f(Cn, { onSelect: Et }),
2285
+ f(hn, {
2286
+ actions: Ct.value,
2287
+ pending: wt.value,
2288
+ onSelect: Tt
2289
+ }, null, 8, ["actions", "pending"]),
2290
+ n[26] ||= i("span", { class: "divider" }, null, -1),
2291
+ (y(), t(r, null, u(g, (e) => i("button", {
2292
+ key: e,
2293
+ class: D({ active: O(S)?.isActive({ textAlign: e }) }),
2294
+ title: O(p)(rt[e]),
2295
+ type: "button",
2296
+ onClick: (t) => O(S)?.chain().focus().setTextAlign(e).run(),
2297
+ onMousedown: n[16] ||= _(() => {}, ["prevent"])
2298
+ }, [(y(), t("svg", Ar, [(y(!0), t(r, null, u(H(e), (e, n) => (y(), t("rect", {
2299
+ key: n,
2300
+ fill: "currentColor",
2301
+ height: "1.5",
2302
+ rx: "0.5",
2303
+ width: e.w,
2304
+ x: e.x,
2305
+ y: e.y
2306
+ }, null, 8, jr))), 128))]))], 42, kr)), 64))
2307
+ ], 544)) : E("", !0),
2308
+ l.editable ? (y(), t("div", {
2309
+ key: 1,
2310
+ ref_key: "pastePrompt",
2311
+ ref: q,
2312
+ popover: "manual",
2313
+ class: "paste-prompt",
2314
+ role: "dialog",
2315
+ tabindex: "-1",
2316
+ "aria-labelledby": O(_t),
2317
+ onKeydown: le(_(Z, ["stop", "prevent"]), ["esc"]),
2318
+ onFocusout: bt
2319
+ }, [
2320
+ i("span", { id: O(_t) }, x(O(p)("blocks.text.pastePrompt.question")), 9, Nr),
2321
+ i("button", {
2322
+ ref_key: "pasteKeep",
2323
+ ref: gt,
2324
+ class: "paste-keep",
2325
+ type: "button",
2326
+ onClick: n[17] ||= (e) => X(!0),
2327
+ onMousedown: n[18] ||= _(() => {}, ["prevent"])
2328
+ }, x(O(p)("blocks.text.pastePrompt.keep")), 545),
2329
+ i("button", {
2330
+ class: "paste-plain",
2331
+ type: "button",
2332
+ onClick: n[19] ||= (e) => X(!1),
2333
+ onMousedown: n[20] ||= _(() => {}, ["prevent"])
2334
+ }, x(O(p)("blocks.text.pastePrompt.plain")), 33)
2335
+ ], 40, Mr)) : E("", !0)
2336
+ ], 544));
2337
+ }
2338
+ }), [["styles", [".text-spaced .tiptap :is(p,h1,h2,h3,h4,h5,h6){margin:var(--bygga-paragraph-spacing) 0}.tiptap{font-feature-settings:\"liga\" 0;font-variant-ligatures:none;overflow-wrap:break-word;white-space:pre-wrap;position:relative}.text-input .tiptap:focus,.text-input .tiptap:focus-visible{outline:none}.text-input .tiptap .is-editor-empty:first-child{position:relative}.text-input .tiptap .is-editor-empty:first-child:before{color:var(--bygga-color-text-muted);content:attr(data-placeholder);pointer-events:none;text-overflow:ellipsis;inset-inline:0;white-space:nowrap;position:absolute;top:0;overflow:hidden}.merge-tag{background:var(--bygga-color-track);border:1px solid var(--bygga-color-border);border-radius:var(--bygga-radius-sm);color:var(--bygga-color-accent);cursor:default;white-space:nowrap;-webkit-user-select:all;user-select:all;padding:0 .3em;font-size:.9em}.merge-tag.is-unknown{color:var(--bygga-color-text-muted);border-style:dashed}.merge-tag.ProseMirror-selectednode{outline:2px solid var(--bygga-color-accent);outline-offset:1px}", ".toolbar[data-v-7fc8d0cb]{background:var(--bygga-color-surface);border:1px solid var(--bygga-color-border-subtle);box-shadow:var(--bygga-shadow-card);white-space:nowrap;font-family:var(--bygga-font-family);direction:ltr;border-radius:0;flex-wrap:wrap;align-items:center;gap:3px;margin:0;padding:6px 4px;font-size:13px;font-weight:400;position:fixed;inset:auto;transform:translateY(-100%)}.toolbar[data-v-7fc8d0cb]:popover-open{display:flex}.toolbar>button[data-v-7fc8d0cb]{color:var(--bygga-color-text);cursor:pointer;background:0 0;border:none;border-radius:4px;justify-content:center;align-items:center;min-width:30px;height:30px;padding:0;display:inline-flex}.toolbar>button[data-v-7fc8d0cb]:hover{background:color-mix(in srgb, var(--bygga-color-text) 30%, transparent)}.toolbar>button.active[data-v-7fc8d0cb]{background:var(--bygga-color-selected,var(--bygga-color-text));color:var(--bygga-color-selected-text,#fff);forced-color-adjust:none}.toolbar .picker[data-v-7fc8d0cb]{align-items:center;display:inline-flex;position:relative}.toolbar .style[data-v-7fc8d0cb],.toolbar .font[data-v-7fc8d0cb],.toolbar .size[data-v-7fc8d0cb]{appearance:none;color:var(--bygga-color-text);cursor:pointer;font:inherit;text-align-last:right;background:0 0;border:none;border-radius:4px;height:30px;padding:0 21px 0 6px}.toolbar .style[data-v-7fc8d0cb]:hover,.toolbar .font[data-v-7fc8d0cb]:hover,.toolbar .size[data-v-7fc8d0cb]:hover{background:color-mix(in srgb, var(--bygga-color-text) 7%, transparent)}.toolbar .picker-chevron[data-v-7fc8d0cb]{color:var(--bygga-color-text);pointer-events:none;position:absolute;right:5px}.toolbar .divider[data-v-7fc8d0cb]{background:var(--bygga-color-divider);width:1px;height:24px;margin:0 4px}.link-popover[data-v-7fc8d0cb]{background:var(--bygga-color-surface);border:1px solid var(--bygga-color-border);border-radius:var(--bygga-radius-sm);box-shadow:var(--bygga-shadow-card);align-items:center;gap:.25em;margin:0;padding:.25em;position:fixed;inset:auto}.link-popover[data-v-7fc8d0cb]:popover-open{display:flex}.link-field[data-v-7fc8d0cb]{width:18em}.link-anchor[data-v-7fc8d0cb]{width:10em}.link-apply[data-v-7fc8d0cb]{background:var(--bygga-color-accent);border-radius:var(--bygga-radius-sm);color:var(--bygga-color-surface);cursor:pointer;border:none;padding:.4em .8em}.link-remove[data-v-7fc8d0cb]{border-radius:var(--bygga-radius-sm);color:var(--bygga-color-text-muted);cursor:pointer;background:0 0;border:none;justify-content:center;align-items:center;min-width:1.8em;height:1.8em;padding:0;display:inline-flex}.link-remove[data-v-7fc8d0cb]:hover{background:var(--bygga-color-track);color:var(--bygga-color-accent)}.paste-prompt[data-v-7fc8d0cb]{background:var(--bygga-color-surface);border:1px solid var(--bygga-color-border);border-radius:var(--bygga-radius-sm);box-shadow:var(--bygga-shadow-card);color:var(--bygga-color-text);font-family:var(--bygga-font-family);white-space:nowrap;direction:ltr;align-items:center;gap:8px;margin:0;padding:6px 6px 6px 10px;font-size:13px;font-weight:400;position:fixed;inset:auto}.paste-prompt[data-v-7fc8d0cb]:popover-open{display:flex}.paste-keep[data-v-7fc8d0cb],.paste-plain[data-v-7fc8d0cb]{border-radius:var(--bygga-radius-sm);cursor:pointer;font:inherit;padding:.4em .8em}.paste-keep[data-v-7fc8d0cb]{background:var(--bygga-color-accent);border:1px solid var(--bygga-color-accent);color:var(--bygga-color-surface)}.paste-plain[data-v-7fc8d0cb]{border:1px solid var(--bygga-color-border);color:var(--bygga-color-text);background:0 0}"]], ["__scopeId", "data-v-7fc8d0cb"]]);
2223
2339
  //#endregion
2224
- export { Er as default };
2340
+ export { Ir as default };