@bygga.dev/editor 0.3.1 → 1.1.0

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,12 +1,12 @@
1
1
  import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, H as s, I as c, J as l, K as u, L as d, M as f, O as p, R as m, S as h, T as ee, X as g, Z as _, _ as v, b as y, c as te, et as b, f as x, g as S, h as C, j as w, l as T, m as ne, p as E, r as D, rt as O, u as k, v as A, w as j, x as re, z as ie } from "./vue.runtime.esm-bundler-C8OyVIE3.js";
2
- import { $ as M, Bt as ae, Gt as oe, Ht as se, J as ce, K as le, Q as ue, Rt as de, U as fe, Ut as pe, Vt as me, Wt as he, X as ge, Y as _e, Yt as ve, Z as N, Zt as ye, _ as be, at as xe, b as Se, c as Ce, ct as P, dt as F, et as we, ft as I, gt as L, h as Te, ht as R, it as Ee, l as De, lt as z, m as Oe, mt as ke, n as Ae, nt as je, o as Me, ot as B, pt as Ne, q as Pe, rt as V, s as Fe, st as H, t as Ie, tt as Le, ut as U, x as Re, y as ze, zt as Be } from "./urls-CVvXdmlR.js";
2
+ import { $ as ae, $t as oe, E as M, J as se, Jt as ce, Q as le, Qt as ue, S as N, St as P, T as de, Xt as fe, Yt as pe, Zt as me, _t as F, an as he, at as ge, bt as _e, c as ve, ct as ye, dt as be, en as xe, et as Se, f as Ce, ft as I, gt as L, ht as R, it as we, l as Te, lt as z, m as Ee, mt as B, n as V, nt as De, o as Oe, ot as ke, pt as H, rt as U, s as Ae, sn as je, st as W, t as Me, tn as Ne, tt as Pe, ut as Fe, vt as Ie, w as Le, xt as G, yt as Re } from "./urls-BO2HiDHB.js";
3
3
  //#region ../../node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.js
4
- function Ve(e = {}) {
5
- return new z({ view(t) {
6
- return new He(t, e);
4
+ function ze(e = {}) {
5
+ return new R({ view(t) {
6
+ return new Be(t, e);
7
7
  } });
8
8
  }
9
- var He = class {
9
+ var Be = class {
10
10
  constructor(e, t) {
11
11
  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 = [
12
12
  "dragover",
@@ -82,7 +82,7 @@ var He = class {
82
82
  if (t && !i) {
83
83
  let e = t.pos;
84
84
  if (this.editorView.dragging && this.editorView.dragging.slice) {
85
- let t = ke(this.editorView.state.doc, e, this.editorView.dragging.slice);
85
+ let t = _e(this.editorView.state.doc, e, this.editorView.dragging.slice);
86
86
  t != null && (e = t);
87
87
  }
88
88
  this.setCursor(e), this.scheduleRemoval(5e3);
@@ -97,7 +97,7 @@ var He = class {
97
97
  dragleave(e) {
98
98
  this.editorView.dom.contains(e.relatedTarget) || this.setCursor(null);
99
99
  }
100
- }, W = class e extends F {
100
+ }, K = class e extends F {
101
101
  constructor(e) {
102
102
  super(e, e);
103
103
  }
@@ -106,7 +106,7 @@ var He = class {
106
106
  return e.valid(r) ? new e(r) : F.near(r);
107
107
  }
108
108
  content() {
109
- return L.empty;
109
+ return P.empty;
110
110
  }
111
111
  eq(t) {
112
112
  return t instanceof e && t.head == this.head;
@@ -122,11 +122,11 @@ var He = class {
122
122
  return new e(t.resolve(n.pos));
123
123
  }
124
124
  getBookmark() {
125
- return new Ue(this.anchor);
125
+ return new Ve(this.anchor);
126
126
  }
127
127
  static valid(e) {
128
128
  let t = e.parent;
129
- if (t.inlineContent || !Ge(e) || !Ke(e)) return !1;
129
+ if (t.inlineContent || !Ue(e) || !We(e)) return !1;
130
130
  let n = t.type.spec.allowGapCursor;
131
131
  if (n != null) return n;
132
132
  let r = t.contentMatchAt(e.index()).defaultType;
@@ -149,7 +149,7 @@ var He = class {
149
149
  for (;;) {
150
150
  let o = n > 0 ? a.firstChild : a.lastChild;
151
151
  if (!o) {
152
- if (a.isAtom && !a.isText && !P.isSelectable(a)) {
152
+ if (a.isAtom && !a.isText && !B.isSelectable(a)) {
153
153
  t = t.doc.resolve(i + a.nodeSize * n), r = !1;
154
154
  continue search;
155
155
  }
@@ -163,8 +163,8 @@ var He = class {
163
163
  }
164
164
  }
165
165
  };
166
- W.prototype.visible = !1, W.findFrom = W.findGapCursorFrom, F.jsonID("gapcursor", W);
167
- var Ue = class e {
166
+ K.prototype.visible = !1, K.findFrom = K.findGapCursorFrom, F.jsonID("gapcursor", K);
167
+ var Ve = class e {
168
168
  constructor(e) {
169
169
  this.pos = e;
170
170
  }
@@ -173,13 +173,13 @@ var Ue = class e {
173
173
  }
174
174
  resolve(e) {
175
175
  let t = e.resolve(this.pos);
176
- return W.valid(t) ? new W(t) : F.near(t);
176
+ return K.valid(t) ? new K(t) : F.near(t);
177
177
  }
178
178
  };
179
- function We(e) {
179
+ function He(e) {
180
180
  return e.isAtom || e.spec.isolating || e.spec.createGapCursor;
181
181
  }
182
- function Ge(e) {
182
+ function Ue(e) {
183
183
  for (let t = e.depth; t >= 0; t--) {
184
184
  let n = e.index(t), r = e.node(t);
185
185
  if (n == 0) {
@@ -187,13 +187,13 @@ function Ge(e) {
187
187
  continue;
188
188
  }
189
189
  for (let e = r.child(n - 1);; e = e.lastChild) {
190
- if (e.childCount == 0 && !e.inlineContent || We(e.type)) return !0;
190
+ if (e.childCount == 0 && !e.inlineContent || He(e.type)) return !0;
191
191
  if (e.inlineContent) return !1;
192
192
  }
193
193
  }
194
194
  return !0;
195
195
  }
196
- function Ke(e) {
196
+ function We(e) {
197
197
  for (let t = e.depth; t >= 0; t--) {
198
198
  let n = e.indexAfter(t), r = e.node(t);
199
199
  if (n == r.childCount) {
@@ -201,90 +201,90 @@ function Ke(e) {
201
201
  continue;
202
202
  }
203
203
  for (let e = r.child(n);; e = e.firstChild) {
204
- if (e.childCount == 0 && !e.inlineContent || We(e.type)) return !0;
204
+ if (e.childCount == 0 && !e.inlineContent || He(e.type)) return !0;
205
205
  if (e.inlineContent) return !1;
206
206
  }
207
207
  }
208
208
  return !0;
209
209
  }
210
- function qe() {
211
- return new z({ props: {
212
- decorations: Ze,
210
+ function Ge() {
211
+ return new R({ props: {
212
+ decorations: Ye,
213
213
  createSelectionBetween(e, t, n) {
214
- return t.pos == n.pos && W.valid(n) ? new W(n) : null;
214
+ return t.pos == n.pos && K.valid(n) ? new K(n) : null;
215
215
  },
216
- handleClick: Ye,
217
- handleKeyDown: Je,
218
- handleDOMEvents: { beforeinput: Xe }
216
+ handleClick: qe,
217
+ handleKeyDown: Ke,
218
+ handleDOMEvents: { beforeinput: Je }
219
219
  } });
220
220
  }
221
- var Je = xe({
222
- ArrowLeft: G("horiz", -1),
223
- ArrowRight: G("horiz", 1),
224
- ArrowUp: G("vert", -1),
225
- ArrowDown: G("vert", 1)
221
+ var Ke = be({
222
+ ArrowLeft: q("horiz", -1),
223
+ ArrowRight: q("horiz", 1),
224
+ ArrowUp: q("vert", -1),
225
+ ArrowDown: q("vert", 1)
226
226
  });
227
- function G(e, t) {
227
+ function q(e, t) {
228
228
  let n = e == "vert" ? t > 0 ? "down" : "up" : t > 0 ? "right" : "left";
229
229
  return function(e, r, i) {
230
230
  let a = e.selection, o = t > 0 ? a.$to : a.$from, s = a.empty;
231
- if (a instanceof I) {
231
+ if (a instanceof Ie) {
232
232
  if (!i.endOfTextblock(n) || o.depth == 0) return !1;
233
233
  s = !1, o = e.doc.resolve(t > 0 ? o.after() : o.before());
234
234
  }
235
- let c = W.findGapCursorFrom(o, t, s);
236
- return c ? (r && r(e.tr.setSelection(new W(c))), !0) : !1;
235
+ let c = K.findGapCursorFrom(o, t, s);
236
+ return c ? (r && r(e.tr.setSelection(new K(c))), !0) : !1;
237
237
  };
238
238
  }
239
- function Ye(e, t, n) {
239
+ function qe(e, t, n) {
240
240
  if (!e || !e.editable) return !1;
241
241
  let r = e.state.doc.resolve(t);
242
- if (!W.valid(r)) return !1;
242
+ if (!K.valid(r)) return !1;
243
243
  let i = e.posAtCoords({
244
244
  left: n.clientX,
245
245
  top: n.clientY
246
246
  });
247
- return i && i.inside > -1 && P.isSelectable(e.state.doc.nodeAt(i.inside)) ? !1 : (e.dispatch(e.state.tr.setSelection(new W(r))), !0);
247
+ return i && i.inside > -1 && B.isSelectable(e.state.doc.nodeAt(i.inside)) ? !1 : (e.dispatch(e.state.tr.setSelection(new K(r))), !0);
248
248
  }
249
- function Xe(e, t) {
250
- if (t.inputType != "insertCompositionText" || !(e.state.selection instanceof W)) return !1;
249
+ function Je(e, t) {
250
+ if (t.inputType != "insertCompositionText" || !(e.state.selection instanceof K)) return !1;
251
251
  let { $from: n } = e.state.selection, r = n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);
252
252
  if (!r) return !1;
253
- let i = R.empty;
254
- for (let e = r.length - 1; e >= 0; e--) i = R.from(r[e].createAndFill(null, i));
255
- let a = e.state.tr.replace(n.pos, n.pos, new L(i, 0, 0));
256
- return a.setSelection(I.near(a.doc.resolve(n.pos + 1))), e.dispatch(a), !1;
253
+ let i = G.empty;
254
+ for (let e = r.length - 1; e >= 0; e--) i = G.from(r[e].createAndFill(null, i));
255
+ let a = e.state.tr.replace(n.pos, n.pos, new P(i, 0, 0));
256
+ return a.setSelection(Ie.near(a.doc.resolve(n.pos + 1))), e.dispatch(a), !1;
257
257
  }
258
- function Ze(e) {
259
- if (!(e.selection instanceof W)) return null;
258
+ function Ye(e) {
259
+ if (!(e.selection instanceof K)) return null;
260
260
  let t = document.createElement("div");
261
- return t.className = "ProseMirror-gapcursor", H.create(e.doc, [B.widget(e.selection.head, t, { key: "gapcursor" })]);
261
+ return t.className = "ProseMirror-gapcursor", H.create(e.doc, [I.widget(e.selection.head, t, { key: "gapcursor" })]);
262
262
  }
263
263
  //#endregion
264
264
  //#region ../../node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.js
265
- var K = 200, q = function() {};
266
- q.prototype.append = function(e) {
267
- return e.length ? (e = q.from(e), !this.length && e || e.length < K && this.leafAppend(e) || this.length < K && e.leafPrepend(this) || this.appendInner(e)) : this;
268
- }, q.prototype.prepend = function(e) {
269
- return e.length ? q.from(e).append(this) : this;
270
- }, q.prototype.appendInner = function(e) {
271
- return new $e(this, e);
272
- }, q.prototype.slice = function(e, t) {
273
- 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));
274
- }, q.prototype.get = function(e) {
265
+ var Xe = 200, J = function() {};
266
+ J.prototype.append = function(e) {
267
+ return e.length ? (e = J.from(e), !this.length && e || e.length < Xe && this.leafAppend(e) || this.length < Xe && e.leafPrepend(this) || this.appendInner(e)) : this;
268
+ }, J.prototype.prepend = function(e) {
269
+ return e.length ? J.from(e).append(this) : this;
270
+ }, J.prototype.appendInner = function(e) {
271
+ return new Qe(this, e);
272
+ }, J.prototype.slice = function(e, t) {
273
+ return e === void 0 && (e = 0), t === void 0 && (t = this.length), e >= t ? J.empty : this.sliceInner(Math.max(0, e), Math.min(this.length, t));
274
+ }, J.prototype.get = function(e) {
275
275
  if (!(e < 0 || e >= this.length)) return this.getInner(e);
276
- }, q.prototype.forEach = function(e, t, n) {
276
+ }, J.prototype.forEach = function(e, t, n) {
277
277
  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);
278
- }, q.prototype.map = function(e, t, n) {
278
+ }, J.prototype.map = function(e, t, n) {
279
279
  t === void 0 && (t = 0), n === void 0 && (n = this.length);
280
280
  var r = [];
281
281
  return this.forEach(function(t, n) {
282
282
  return r.push(e(t, n));
283
283
  }, t, n), r;
284
- }, q.from = function(e) {
285
- return e instanceof q ? e : e && e.length ? new Qe(e) : q.empty;
284
+ }, J.from = function(e) {
285
+ return e instanceof J ? e : e && e.length ? new Ze(e) : J.empty;
286
286
  };
287
- var Qe = /* @__PURE__ */ function(e) {
287
+ var Ze = /* @__PURE__ */ function(e) {
288
288
  function t(t) {
289
289
  e.call(this), this.values = t;
290
290
  }
@@ -304,17 +304,17 @@ var Qe = /* @__PURE__ */ function(e) {
304
304
  }, t.prototype.forEachInvertedInner = function(e, t, n, r) {
305
305
  for (var i = t - 1; i >= n; i--) if (e(this.values[i], r + i) === !1) return !1;
306
306
  }, t.prototype.leafAppend = function(e) {
307
- if (this.length + e.length <= K) return new t(this.values.concat(e.flatten()));
307
+ if (this.length + e.length <= Xe) return new t(this.values.concat(e.flatten()));
308
308
  }, t.prototype.leafPrepend = function(e) {
309
- if (this.length + e.length <= K) return new t(e.flatten().concat(this.values));
309
+ if (this.length + e.length <= Xe) return new t(e.flatten().concat(this.values));
310
310
  }, n.length.get = function() {
311
311
  return this.values.length;
312
312
  }, n.depth.get = function() {
313
313
  return 0;
314
314
  }, Object.defineProperties(t.prototype, n), t;
315
- }(q);
316
- q.empty = new Qe([]);
317
- var $e = /* @__PURE__ */ function(e) {
315
+ }(J);
316
+ J.empty = new Ze([]);
317
+ var Qe = /* @__PURE__ */ function(e) {
318
318
  function t(t, n) {
319
319
  e.call(this), this.left = t, this.right = n, this.length = t.length + n.length, this.depth = Math.max(t.depth, n.depth) + 1;
320
320
  }
@@ -341,7 +341,7 @@ var $e = /* @__PURE__ */ function(e) {
341
341
  }, t.prototype.appendInner = function(e) {
342
342
  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);
343
343
  }, t;
344
- }(q), et = 500, J = class e {
344
+ }(J), $e = 500, Y = class e {
345
345
  constructor(e, t) {
346
346
  this.items = e, this.eventCount = t;
347
347
  }
@@ -361,9 +361,9 @@ var $e = /* @__PURE__ */ function(e) {
361
361
  return;
362
362
  }
363
363
  if (i) {
364
- u.push(new Y(t.map));
364
+ u.push(new X(t.map));
365
365
  let e = t.step.map(i.slice(a)), n;
366
- e && o.maybeStep(e).doc && (n = o.mapping.maps[o.mapping.maps.length - 1], l.push(new Y(n, void 0, void 0, l.length + u.length))), a--, n && i.appendMap(n, a);
366
+ 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);
367
367
  } else o.maybeStep(t.step);
368
368
  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;
369
369
  }, this.items.length, 0), {
@@ -375,21 +375,21 @@ var $e = /* @__PURE__ */ function(e) {
375
375
  addTransform(t, n, r, i) {
376
376
  let a = [], o = this.eventCount, s = this.items, c = !i && s.length ? s.get(s.length - 1) : null;
377
377
  for (let e = 0; e < t.steps.length; e++) {
378
- let r = t.steps[e].invert(t.docs[e]), l = new Y(t.mapping.maps[e], r, n), u;
378
+ let r = t.steps[e].invert(t.docs[e]), l = new X(t.mapping.maps[e], r, n), u;
379
379
  (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);
380
380
  }
381
381
  let l = o - r.depth;
382
- return l > nt && (s = tt(s, l), o -= l), new e(s.append(a), o);
382
+ return l > tt && (s = et(s, l), o -= l), new e(s.append(a), o);
383
383
  }
384
384
  remapping(e, t) {
385
- let n = new Ne();
385
+ let n = new Re();
386
386
  return this.items.forEach((t, r) => {
387
387
  let i = t.mirrorOffset != null && r - t.mirrorOffset >= e ? n.maps.length - t.mirrorOffset : void 0;
388
388
  n.appendMap(t.map, i);
389
389
  }, e, t), n;
390
390
  }
391
391
  addMaps(t) {
392
- return this.eventCount == 0 ? this : new e(this.items.append(t.map((e) => new Y(e))), this.eventCount);
392
+ return this.eventCount == 0 ? this : new e(this.items.append(t.map((e) => new X(e))), this.eventCount);
393
393
  }
394
394
  rebased(t, n) {
395
395
  if (!this.eventCount) return this;
@@ -405,13 +405,13 @@ var $e = /* @__PURE__ */ function(e) {
405
405
  let i = a.maps[n];
406
406
  if (e.step) {
407
407
  let o = t.steps[n].invert(t.docs[n]), l = e.selection && e.selection.map(a.slice(c + 1, n));
408
- l && s++, r.push(new Y(i, o, l));
409
- } else r.push(new Y(i));
408
+ l && s++, r.push(new X(i, o, l));
409
+ } else r.push(new X(i));
410
410
  }, i);
411
411
  let l = [];
412
- for (let e = n; e < o; e++) l.push(new Y(a.maps[e]));
412
+ for (let e = n; e < o; e++) l.push(new X(a.maps[e]));
413
413
  let u = new e(this.items.slice(0, i).append(l).append(r), s);
414
- return u.emptyItemCount() > et && (u = u.compress(this.items.length - r.length)), u;
414
+ return u.emptyItemCount() > $e && (u = u.compress(this.items.length - r.length)), u;
415
415
  }
416
416
  emptyItemCount() {
417
417
  let e = 0;
@@ -428,21 +428,21 @@ var $e = /* @__PURE__ */ function(e) {
428
428
  if (r--, o && n.appendMap(o, r), t) {
429
429
  let s = e.selection && e.selection.map(n.slice(r));
430
430
  s && a++;
431
- let c = new Y(o.invert(), t, s), l, u = i.length - 1;
431
+ let c = new X(o.invert(), t, s), l, u = i.length - 1;
432
432
  (l = i.length && i[u].merge(c)) ? i[u] = l : i.push(c);
433
433
  }
434
434
  } else e.map && r--;
435
- }, this.items.length, 0), new e(q.from(i.reverse()), a);
435
+ }, this.items.length, 0), new e(J.from(i.reverse()), a);
436
436
  }
437
437
  };
438
- J.empty = new J(q.empty, 0);
439
- function tt(e, t) {
438
+ Y.empty = new Y(J.empty, 0);
439
+ function et(e, t) {
440
440
  let n;
441
441
  return e.forEach((e, r) => {
442
442
  if (e.selection && t-- == 0) return n = r, !1;
443
443
  }), e.slice(n);
444
444
  }
445
- var Y = class e {
445
+ var X = class e {
446
446
  constructor(e, t, n, r) {
447
447
  this.map = e, this.step = t, this.selection = n, this.mirrorOffset = r;
448
448
  }
@@ -452,25 +452,25 @@ var Y = class e {
452
452
  if (n) return new e(n.getMap().invert(), n, this.selection);
453
453
  }
454
454
  }
455
- }, X = class {
455
+ }, Z = class {
456
456
  constructor(e, t, n, r, i) {
457
457
  this.done = e, this.undone = t, this.prevRanges = n, this.prevTime = r, this.prevComposition = i;
458
458
  }
459
- }, nt = 20;
460
- function rt(e, t, n, r) {
459
+ }, tt = 20;
460
+ function nt(e, t, n, r) {
461
461
  let i = n.getMeta(Q), a;
462
462
  if (i) return i.historyState;
463
- n.getMeta(ut) && (e = new X(e.done, e.undone, null, 0, -1));
463
+ n.getMeta(ut) && (e = new Z(e.done, e.undone, null, 0, -1));
464
464
  let o = n.getMeta("appendedTransaction");
465
465
  if (n.steps.length == 0) return e;
466
- if (o && o.getMeta(Q)) return o.getMeta(Q).redo ? new X(e.done.addTransform(n, void 0, r, Z(t)), e.undone, at(n.mapping.maps), e.prevTime, e.prevComposition) : new X(e.done, e.undone.addTransform(n, void 0, r, Z(t)), null, e.prevTime, e.prevComposition);
466
+ if (o && o.getMeta(Q)) return o.getMeta(Q).redo ? new Z(e.done.addTransform(n, void 0, r, lt(t)), e.undone, it(n.mapping.maps), e.prevTime, e.prevComposition) : new Z(e.done, e.undone.addTransform(n, void 0, r, lt(t)), null, e.prevTime, e.prevComposition);
467
467
  if (n.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
468
- let i = n.getMeta("composition"), a = e.prevTime == 0 || !o && e.prevComposition != i && (e.prevTime < (n.time || 0) - r.newGroupDelay || !it(n, e.prevRanges)), s = o ? ot(e.prevRanges, n.mapping) : at(n.mapping.maps);
469
- return new X(e.done.addTransform(n, a ? t.selection.getBookmark() : void 0, r, Z(t)), J.empty, s, n.time, i ?? e.prevComposition);
470
- } else if (a = n.getMeta("rebased")) return new X(e.done.rebased(n, a), e.undone.rebased(n, a), ot(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
471
- else return new X(e.done.addMaps(n.mapping.maps), e.undone.addMaps(n.mapping.maps), ot(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
468
+ let i = n.getMeta("composition"), a = e.prevTime == 0 || !o && e.prevComposition != i && (e.prevTime < (n.time || 0) - r.newGroupDelay || !rt(n, e.prevRanges)), s = o ? at(e.prevRanges, n.mapping) : it(n.mapping.maps);
469
+ return new Z(e.done.addTransform(n, a ? t.selection.getBookmark() : void 0, r, lt(t)), Y.empty, s, n.time, i ?? e.prevComposition);
470
+ } else if (a = n.getMeta("rebased")) return new Z(e.done.rebased(n, a), e.undone.rebased(n, a), at(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
471
+ else return new Z(e.done.addMaps(n.mapping.maps), e.undone.addMaps(n.mapping.maps), at(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
472
472
  }
473
- function it(e, t) {
473
+ function rt(e, t) {
474
474
  if (!t) return !1;
475
475
  if (!e.docChanged) return !0;
476
476
  let n = !1;
@@ -478,12 +478,12 @@ function it(e, t) {
478
478
  for (let i = 0; i < t.length; i += 2) e <= t[i + 1] && r >= t[i] && (n = !0);
479
479
  }), n;
480
480
  }
481
- function at(e) {
481
+ function it(e) {
482
482
  let t = [];
483
483
  for (let n = e.length - 1; n >= 0 && t.length == 0; n--) e[n].forEach((e, n, r, i) => t.push(r, i));
484
484
  return t;
485
485
  }
486
- function ot(e, t) {
486
+ function at(e, t) {
487
487
  if (!e) return null;
488
488
  let n = [];
489
489
  for (let r = 0; r < e.length; r += 2) {
@@ -492,40 +492,40 @@ function ot(e, t) {
492
492
  }
493
493
  return n;
494
494
  }
495
- function st(e, t, n) {
496
- let r = Z(t), i = Q.get(t).spec.config, a = (n ? e.undone : e.done).popEvent(t, r);
495
+ function ot(e, t, n) {
496
+ let r = lt(t), i = Q.get(t).spec.config, a = (n ? e.undone : e.done).popEvent(t, r);
497
497
  if (!a) return null;
498
- let o = a.selection.resolve(a.transform.doc), s = (n ? e.done : e.undone).addTransform(a.transform, t.selection.getBookmark(), i, r), c = new X(n ? s : a.remaining, n ? a.remaining : s, null, 0, -1);
498
+ 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);
499
499
  return a.transform.setSelection(o).setMeta(Q, {
500
500
  redo: n,
501
501
  historyState: c
502
502
  });
503
503
  }
504
- var ct = !1, lt = null;
505
- function Z(e) {
504
+ var st = !1, ct = null;
505
+ function lt(e) {
506
506
  let t = e.plugins;
507
- if (lt != t) {
508
- ct = !1, lt = t;
507
+ if (ct != t) {
508
+ st = !1, ct = t;
509
509
  for (let e = 0; e < t.length; e++) if (t[e].spec.historyPreserveItems) {
510
- ct = !0;
510
+ st = !0;
511
511
  break;
512
512
  }
513
513
  }
514
- return ct;
514
+ return st;
515
515
  }
516
- var Q = new U("history"), ut = new U("closeHistory");
516
+ var Q = new L("history"), ut = new L("closeHistory");
517
517
  function dt(e = {}) {
518
518
  return e = {
519
519
  depth: e.depth || 100,
520
520
  newGroupDelay: e.newGroupDelay || 500
521
- }, new z({
521
+ }, new R({
522
522
  key: Q,
523
523
  state: {
524
524
  init() {
525
- return new X(J.empty, J.empty, null, 0, -1);
525
+ return new Z(Y.empty, Y.empty, null, 0, -1);
526
526
  },
527
527
  apply(t, n, r) {
528
- return rt(n, r, t, e);
528
+ return nt(n, r, t, e);
529
529
  }
530
530
  },
531
531
  config: e,
@@ -540,14 +540,14 @@ function ft(e, t) {
540
540
  let i = Q.getState(n);
541
541
  if (!i || (e ? i.undone : i.done).eventCount == 0) return !1;
542
542
  if (r) {
543
- let a = st(i, n, e);
543
+ let a = ot(i, n, e);
544
544
  a && r(t ? a.scrollIntoView() : a);
545
545
  }
546
546
  return !0;
547
547
  };
548
548
  }
549
549
  var pt = ft(!1, !0), mt = ft(!0, !0);
550
- N.create({
550
+ U.create({
551
551
  name: "characterCount",
552
552
  addOptions() {
553
553
  return {
@@ -579,8 +579,8 @@ N.create({
579
579
  },
580
580
  addProseMirrorPlugins() {
581
581
  let e = !1;
582
- return [new z({
583
- key: new U("characterCount"),
582
+ return [new R({
583
+ key: new L("characterCount"),
584
584
  appendTransaction: (t, n, r) => {
585
585
  if (e) return;
586
586
  let i = this.options.limit, a = this.options.autoTrim;
@@ -608,7 +608,7 @@ N.create({
608
608
  }
609
609
  })];
610
610
  }
611
- }), N.create({
611
+ }), U.create({
612
612
  name: "dropCursor",
613
613
  addOptions() {
614
614
  return {
@@ -618,9 +618,9 @@ N.create({
618
618
  };
619
619
  },
620
620
  addProseMirrorPlugins() {
621
- return [Ve(this.options)];
621
+ return [ze(this.options)];
622
622
  }
623
- }), N.create({
623
+ }), U.create({
624
624
  name: "focus",
625
625
  addOptions() {
626
626
  return {
@@ -629,8 +629,8 @@ N.create({
629
629
  };
630
630
  },
631
631
  addProseMirrorPlugins() {
632
- return [new z({
633
- key: new U("focus"),
632
+ return [new R({
633
+ key: new L("focus"),
634
634
  props: { decorations: ({ doc: e, selection: t }) => {
635
635
  let { isEditable: n, isFocused: r } = this.editor, { anchor: i } = t, a = [];
636
636
  if (!n || !r) return H.create(e, []);
@@ -645,28 +645,28 @@ N.create({
645
645
  return e.descendants((e, t) => {
646
646
  if (e.isText || !(i >= t && i <= t + e.nodeSize - 1)) return !1;
647
647
  if (s += 1, this.options.mode === "deepest" && o - s > 0 || this.options.mode === "shallowest" && s > 1) return this.options.mode === "deepest";
648
- a.push(B.node(t, t + e.nodeSize, { class: this.options.className }));
648
+ a.push(I.node(t, t + e.nodeSize, { class: this.options.className }));
649
649
  }), H.create(e, a);
650
650
  } }
651
651
  })];
652
652
  }
653
- }), N.create({
653
+ }), U.create({
654
654
  name: "gapCursor",
655
655
  addProseMirrorPlugins() {
656
- return [qe()];
656
+ return [Ge()];
657
657
  },
658
658
  extendNodeSchema(e) {
659
- return { allowGapCursor: M(Le(e, "allowGapCursor", {
659
+ return { allowGapCursor: ge(W(e, "allowGapCursor", {
660
660
  name: e.name,
661
661
  options: e.options,
662
662
  storage: e.storage
663
663
  })) ?? null };
664
664
  }
665
665
  });
666
- var ht = "placeholder", $ = new U("tiptap__placeholder"), gt = 200;
666
+ var ht = "placeholder", $ = new L("tiptap__placeholder"), gt = 200;
667
667
  function _t(e) {
668
668
  let { editor: t, placeholder: n, dataAttribute: r, pos: i, node: a, isEmptyDoc: o, hasAnchor: s, classes: { emptyNode: c, emptyEditor: l } } = e, u = [c];
669
- return o && u.push(l), B.node(i, i + a.nodeSize, {
669
+ return o && u.push(l), I.node(i, i + a.nodeSize, {
670
670
  class: u.join(" "),
671
671
  [r]: typeof n == "function" ? n({
672
672
  editor: t,
@@ -684,7 +684,7 @@ function yt({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
684
684
  let { anchor: a } = i, o = [], s = e.isEmpty;
685
685
  if (t.showOnlyCurrent && !t.includeChildren) {
686
686
  let i = r.resolve(a), c = i.depth > 0 ? i.node(1) : i.nodeAfter, l = i.depth > 0 ? i.before(1) : a;
687
- if (c && c.type.isTextblock && je(c)) {
687
+ if (c && c.type.isTextblock && ye(c)) {
688
688
  let r = a >= l && a <= l + c.nodeSize;
689
689
  o.push(_t({
690
690
  editor: e,
@@ -708,7 +708,7 @@ function yt({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
708
708
  } else {
709
709
  let i = $.getState(e.state), c = i?.topPos ?? 0, l = i?.bottomPos ?? r.content.size;
710
710
  r.nodesBetween(c, l, (r, i) => {
711
- let c = a >= i && a <= i + r.nodeSize, l = !r.isLeaf && je(r);
711
+ let c = a >= i && a <= i + r.nodeSize, l = !r.isLeaf && ye(r);
712
712
  return r.type.isTextblock && (c || !t.showOnlyCurrent) && l && o.push(_t({
713
713
  editor: e,
714
714
  isEmptyDoc: s,
@@ -836,7 +836,7 @@ function Et(e) {
836
836
  }
837
837
  function Dt({ editor: e, options: t }) {
838
838
  let n = t.dataAttribute ? `data-${bt(t.dataAttribute)}` : `data-${ht}`;
839
- return new z({
839
+ return new R({
840
840
  key: $,
841
841
  state: Tt,
842
842
  view: Et,
@@ -849,7 +849,7 @@ function Dt({ editor: e, options: t }) {
849
849
  }) }
850
850
  });
851
851
  }
852
- var Ot = N.create({
852
+ var Ot = U.create({
853
853
  name: "placeholder",
854
854
  addOptions() {
855
855
  return {
@@ -869,17 +869,17 @@ var Ot = N.create({
869
869
  })];
870
870
  }
871
871
  }), kt = ".ProseMirror:not(.ProseMirror-focused) *::selection {\n background: transparent;\n}\n\n.ProseMirror:not(.ProseMirror-focused) *::-moz-selection {\n background: transparent;\n}";
872
- N.create({
872
+ U.create({
873
873
  name: "selection",
874
874
  addOptions() {
875
875
  return { className: "selection" };
876
876
  },
877
877
  addProseMirrorPlugins() {
878
878
  let { editor: e, options: t } = this;
879
- return e.options.injectCSS && typeof document < "u" && we(kt, e.options.injectNonce, "selection"), [new z({
880
- key: new U("selection"),
879
+ return e.options.injectCSS && typeof document < "u" && ke(kt, e.options.injectNonce, "selection"), [new R({
880
+ key: new L("selection"),
881
881
  props: { decorations(n) {
882
- return n.selection.empty || e.isFocused || !e.isEditable || V(n.selection) || e.view.dragging ? null : H.create(n.doc, [B.inline(n.selection.from, n.selection.to, { class: t.className })]);
882
+ return n.selection.empty || e.isFocused || !e.isEditable || z(n.selection) || e.view.dragging ? null : H.create(n.doc, [I.inline(n.selection.from, n.selection.to, { class: t.className })]);
883
883
  } }
884
884
  })];
885
885
  }
@@ -887,7 +887,7 @@ N.create({
887
887
  function At({ types: e, node: t }) {
888
888
  return t && Array.isArray(e) && e.includes(t.type) || t?.type === e;
889
889
  }
890
- N.create({
890
+ U.create({
891
891
  name: "trailingNode",
892
892
  addOptions() {
893
893
  return {
@@ -896,8 +896,8 @@ N.create({
896
896
  };
897
897
  },
898
898
  addProseMirrorPlugins() {
899
- let e = new U(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));
900
- return [new z({
899
+ let e = new L(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));
900
+ return [new R({
901
901
  key: e,
902
902
  appendTransaction: (n, r, i) => {
903
903
  let { doc: a, tr: o, schema: s } = i, c = e.getState(i), l = a.content.size, u = s.nodes[t];
@@ -923,7 +923,7 @@ N.create({
923
923
  })];
924
924
  }
925
925
  });
926
- var jt = N.create({
926
+ var jt = U.create({
927
927
  name: "undoRedo",
928
928
  addOptions() {
929
929
  return {
@@ -966,7 +966,7 @@ function Mt(e) {
966
966
  }
967
967
  }));
968
968
  }
969
- var Nt = class extends ge {
969
+ var Nt = class extends De {
970
970
  constructor(e = {}) {
971
971
  return super(e), this.contentComponent = null, this.appContext = null, this.reactiveState = Mt(this.view.state), this.reactiveExtensionStorage = Mt(this.extensionStorage), this.on("beforeTransaction", ({ nextState: e }) => {
972
972
  this.reactiveState.value = e, this.reactiveExtensionStorage.value = this.extensionStorage;
@@ -1149,7 +1149,7 @@ var Rt = {
1149
1149
  type: Object,
1150
1150
  required: !0
1151
1151
  }
1152
- }, zt = class extends ue {
1152
+ }, zt = class extends we {
1153
1153
  constructor(e, t, n) {
1154
1154
  super(e, t, n), this.cachedExtensionWithSyncedStorage = null, this.handlePositionUpdate = () => {
1155
1155
  let e = this.getPos();
@@ -1209,7 +1209,7 @@ var Rt = {
1209
1209
  }
1210
1210
  handleSelectionUpdate() {
1211
1211
  let e = this.getPos();
1212
- if (typeof e == "number") if (Ee({
1212
+ if (typeof e == "number") if (Fe({
1213
1213
  selection: this.editor.state.selection,
1214
1214
  pos: e,
1215
1215
  nodeSize: this.node.nodeSize,
@@ -1283,13 +1283,13 @@ var Vt = [
1283
1283
  }, Wt = ["onClick"], Gt = { class: "merge-tag-option-label" }, Kt = { class: "merge-tag-option-id" }, qt = {
1284
1284
  key: 1,
1285
1285
  class: "merge-tag-empty"
1286
- }, Jt = /*#__PURE__*/ Re(/* @__PURE__ */ y({
1286
+ }, Jt = /*#__PURE__*/ M(/* @__PURE__ */ y({
1287
1287
  __name: "MergeTagPicker",
1288
1288
  emits: ["select"],
1289
1289
  setup(n, { emit: i }) {
1290
- let s = i, { t: c, locale: l } = ze(), u = r(Oe, x(() => ({}))), p = x(() => Object.keys(u.value).map((e) => ({
1290
+ let s = i, { t: c, locale: l } = Le(), u = r(N, x(() => ({}))), p = x(() => Object.keys(u.value).map((e) => ({
1291
1291
  id: e,
1292
- label: Ae(u.value, e, l.value)
1292
+ label: V(u.value, e, l.value)
1293
1293
  }))), m = g(""), h = x(() => {
1294
1294
  let e = m.value.trim().toLowerCase();
1295
1295
  return e ? p.value.filter((t) => t.label.toLowerCase().includes(e) || t.id.toLowerCase().includes(e)) : p.value;
@@ -1322,7 +1322,7 @@ var Vt = [
1322
1322
  "aria-haspopup": "dialog",
1323
1323
  "aria-expanded": _.value,
1324
1324
  onMousedown: r[0] ||= T(() => {}, ["prevent"])
1325
- }, [A(Se, {
1325
+ }, [A(de, {
1326
1326
  name: "braces",
1327
1327
  size: 16
1328
1328
  })], 42, Vt)) : C("", !0), p.value.length ? (t(), S("div", {
@@ -1337,7 +1337,7 @@ var Vt = [
1337
1337
  onBeforetoggle: w,
1338
1338
  onToggle: ne,
1339
1339
  onFocusout: D
1340
- }, [A(De, {
1340
+ }, [A(Te, {
1341
1341
  ref_key: "filterInput",
1342
1342
  ref: te,
1343
1343
  modelValue: m.value,
@@ -1345,7 +1345,6 @@ var Vt = [
1345
1345
  autocomplete: "off",
1346
1346
  placeholder: e(c)("blocks.text.mergeTagSearch"),
1347
1347
  "aria-label": e(c)("blocks.text.mergeTagSearch"),
1348
- size: "compact",
1349
1348
  spellcheck: "false"
1350
1349
  }, null, 8, [
1351
1350
  "modelValue",
@@ -1358,11 +1357,11 @@ var Vt = [
1358
1357
  onMousedown: r[2] ||= T(() => {}, ["prevent"])
1359
1358
  }, [E("span", Gt, O(e.label), 1), E("span", Kt, O(e.id), 1)], 40, Wt)]))), 128))])) : (t(), S("p", qt, O(e(c)("blocks.text.mergeTagEmpty")), 1))], 40, Ht)) : C("", !0)], 64));
1360
1359
  }
1361
- }), [["styles", [".merge-tag-trigger[data-v-847c7f49]{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}.merge-tag-trigger[data-v-847c7f49]:hover{background:var(--bygga-color-track);color:var(--bygga-color-accent)}.merge-tag-trigger.active[data-v-847c7f49]{background:var(--bygga-color-selected,var(--bygga-color-track));color:var(--bygga-color-selected-text,var(--bygga-color-accent));forced-color-adjust:none}.merge-tag-popover[data-v-847c7f49]{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-847c7f49]:popover-open{display:flex}.merge-tag-list[data-v-847c7f49]{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-847c7f49]{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-847c7f49]:hover,.merge-tag-option[data-v-847c7f49]:focus-visible{background:var(--bygga-color-track);color:var(--bygga-color-accent);outline:none}.merge-tag-option-id[data-v-847c7f49]{color:var(--bygga-color-text-muted);font-variant-numeric:tabular-nums;font-size:.85em}.merge-tag-empty[data-v-847c7f49]{color:var(--bygga-color-text-muted);margin:0;padding:.35em .5em}"]], ["__scopeId", "data-v-847c7f49"]]), Yt = /* @__PURE__ */ y({
1360
+ }), [["styles", [".merge-tag-trigger[data-v-809b7ac9]{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}.merge-tag-trigger[data-v-809b7ac9]:hover{background:var(--bygga-color-track);color:var(--bygga-color-accent)}.merge-tag-trigger.active[data-v-809b7ac9]{background:var(--bygga-color-selected,var(--bygga-color-track));color:var(--bygga-color-selected-text,var(--bygga-color-accent));forced-color-adjust:none}.merge-tag-popover[data-v-809b7ac9]{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-809b7ac9]:popover-open{display:flex}.merge-tag-list[data-v-809b7ac9]{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-809b7ac9]{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-809b7ac9]:hover,.merge-tag-option[data-v-809b7ac9]:focus-visible{background:var(--bygga-color-track);color:var(--bygga-color-accent);outline:none}.merge-tag-option-id[data-v-809b7ac9]{color:var(--bygga-color-text-muted);font-variant-numeric:tabular-nums;font-size:.85em}.merge-tag-empty[data-v-809b7ac9]{color:var(--bygga-color-text-muted);margin:0;padding:.35em .5em}"]], ["__scopeId", "data-v-809b7ac9"]]), Yt = /* @__PURE__ */ y({
1362
1361
  __name: "MergeTagView",
1363
1362
  props: Rt,
1364
1363
  setup(i) {
1365
- let a = i, { t: o, locale: s } = ze(), c = r(Oe, x(() => ({}))), l = x(() => String(a.node.attrs.id ?? "")), u = x(() => c.value[l.value] !== void 0), d = x(() => Ae(c.value, l.value, s.value)), f = x(() => o("blocks.text.mergeTagChip", { name: d.value }));
1364
+ let a = i, { t: o, locale: s } = Le(), c = r(N, x(() => ({}))), l = x(() => String(a.node.attrs.id ?? "")), u = x(() => c.value[l.value] !== void 0), d = x(() => V(c.value, l.value, s.value)), f = x(() => o("blocks.text.mergeTagChip", { name: d.value }));
1366
1365
  return (r, i) => (t(), ne(e(Ft), {
1367
1366
  as: "span",
1368
1367
  class: b(["merge-tag", { "is-unknown": !u.value }]),
@@ -1383,7 +1382,7 @@ var Vt = [
1383
1382
  }
1384
1383
  }), Xt = "textStyle";
1385
1384
  function Zt(e) {
1386
- let t = se(e);
1385
+ let t = ue(e);
1387
1386
  return !t || t.key === "verdana" ? null : t.stack;
1388
1387
  }
1389
1388
  function Qt(e) {
@@ -1410,10 +1409,10 @@ function en(e) {
1410
1409
  function tn(e) {
1411
1410
  let t = [];
1412
1411
  for (let n = 0; n < e.childCount; n++) t.push(en(e.child(n)));
1413
- return R.fromArray(t);
1412
+ return G.fromArray(t);
1414
1413
  }
1415
1414
  function nn(e) {
1416
- return new L(tn(e.content), e.openStart, e.openEnd);
1415
+ return new P(tn(e.content), e.openStart, e.openEnd);
1417
1416
  }
1418
1417
  //#endregion
1419
1418
  //#region src/panels/contentPanel/components/blocks/TextEditor.vue?vue&type=script&setup=true&lang.ts
@@ -1445,7 +1444,7 @@ var rn = ["aria-label", "value"], an = { value: "paragraph" }, on = ["value"], s
1445
1444
  "width",
1446
1445
  "x",
1447
1446
  "y"
1448
- ], wn = /*#__PURE__*/ Re(/* @__PURE__ */ y({
1447
+ ], wn = /*#__PURE__*/ M(/* @__PURE__ */ y({
1449
1448
  __name: "TextEditor",
1450
1449
  props: /*@__PURE__*/ j({
1451
1450
  editable: {
@@ -1464,13 +1463,13 @@ var rn = ["aria-label", "value"], an = { value: "paragraph" }, on = ["value"], s
1464
1463
  }),
1465
1464
  emits: ["update:text"],
1466
1465
  setup(i) {
1467
- let s = c(i, "text"), l = i, { t: u } = ze(), p = [
1466
+ let s = c(i, "text"), l = i, { t: u } = Le(), p = [
1468
1467
  "left",
1469
1468
  "center",
1470
1469
  "right",
1471
1470
  "justify"
1472
1471
  ], h = x(() => u("blocks.text.label")), _ = It({
1473
- ...Pe,
1472
+ ...ae,
1474
1473
  editorProps: {
1475
1474
  attributes: {
1476
1475
  "aria-label": h.value,
@@ -1479,15 +1478,15 @@ var rn = ["aria-label", "value"], an = { value: "paragraph" }, on = ["value"], s
1479
1478
  },
1480
1479
  transformPasted: (e) => nn(e)
1481
1480
  },
1482
- content: ae(s.value),
1481
+ content: fe(s.value),
1483
1482
  editable: l.editable,
1484
1483
  extensions: [
1485
- ...ce.map((e) => e.name === "mergeTag" ? e.extend({ addNodeView: () => Bt(Yt) }) : e),
1484
+ ...Se.map((e) => e.name === "mergeTag" ? e.extend({ addNodeView: () => Bt(Yt) }) : e),
1486
1485
  jt,
1487
1486
  Ot.configure({ placeholder: () => u("blocks.text.placeholder") })
1488
1487
  ],
1489
1488
  onUpdate({ editor: e }) {
1490
- s.value = de(e.getJSON()), j();
1489
+ s.value = ce(e.getJSON()), j();
1491
1490
  },
1492
1491
  onSelectionUpdate() {
1493
1492
  j();
@@ -1497,7 +1496,7 @@ var rn = ["aria-label", "value"], an = { value: "paragraph" }, on = ["value"], s
1497
1496
  _.value?.setOptions({ editorProps: { attributes: { "aria-label": e } } });
1498
1497
  }), m(s, (e) => {
1499
1498
  let t = _.value;
1500
- !t || Be(e, de(t.getJSON())) || t.commands.setContent(ae(e), { emitUpdate: !1 });
1499
+ !t || pe(e, ce(t.getJSON())) || t.commands.setContent(fe(e), { emitUpdate: !1 });
1501
1500
  }), m(() => l.editable, (e) => _.value?.setEditable(e));
1502
1501
  let v = d("root"), y = d("toolbar");
1503
1502
  function w() {
@@ -1550,51 +1549,51 @@ var rn = ["aria-label", "value"], an = { value: "paragraph" }, on = ["value"], s
1550
1549
  let r = le.find((e) => `h${e}` === t.value);
1551
1550
  r ? n.setHeading({ level: r }).run() : n.setParagraph().run();
1552
1551
  }
1553
- let M = r(be, x(() => me));
1554
- function ue(e) {
1555
- return typeof e == "string" ? se(e)?.key ?? M.value : M.value;
1552
+ let M = r(Ee, x(() => me));
1553
+ function N(e) {
1554
+ return typeof e == "string" ? ue(e)?.key ?? M.value : M.value;
1556
1555
  }
1557
- function ge() {
1556
+ function P() {
1558
1557
  let e = _.value;
1559
1558
  if (!e) return M.value;
1560
1559
  let { from: t, to: n, empty: r } = e.state.selection;
1561
- if (r) return ue(e.getAttributes("textStyle").fontFamily);
1560
+ if (r) return N(e.getAttributes("textStyle").fontFamily);
1562
1561
  let i = /* @__PURE__ */ new Set();
1563
1562
  e.state.doc.nodesBetween(t, n, (e) => {
1564
1563
  if (!e.isText) return;
1565
1564
  let t = e.marks.find((e) => e.type.name === "textStyle");
1566
- i.add(ue(t?.attrs.fontFamily));
1565
+ i.add(N(t?.attrs.fontFamily));
1567
1566
  });
1568
1567
  let a = Array.from(i);
1569
1568
  return a.length > 1 ? "mixed" : a[0] ?? M.value;
1570
1569
  }
1571
- function N(e) {
1570
+ function F(e) {
1572
1571
  let { target: t } = e;
1573
1572
  if (!(t instanceof HTMLSelectElement)) return;
1574
1573
  let n = t.value, r = _.value?.chain().focus();
1575
- r && he(n) && (n === M.value ? r.unsetFontFamily().run() : r.setFontFamily(pe(n)).run());
1574
+ r && xe(n) && (n === M.value ? r.unsetFontFamily().run() : r.setFontFamily(oe(n)).run());
1576
1575
  }
1577
- let xe = Me(() => {
1578
- let e = ge();
1576
+ let ge = Oe(() => {
1577
+ let e = P();
1579
1578
  return e === "mixed" ? void 0 : e;
1580
- }), P = x({
1579
+ }), _e = x({
1581
1580
  get: () => {
1582
- let e = _.value?.getAttributes("textStyle").color, t = typeof e == "string" ? ve(e) : void 0;
1581
+ let e = _.value?.getAttributes("textStyle").color, t = typeof e == "string" ? he(e) : void 0;
1583
1582
  return t ? {
1584
1583
  type: "color",
1585
1584
  ...t
1586
- } : oe;
1585
+ } : Ne;
1587
1586
  },
1588
1587
  set: (e) => {
1589
- e.type !== "transparent" && _.value?.chain().setColor(ye(e)).run();
1588
+ e.type !== "transparent" && _.value?.chain().setColor(je(e)).run();
1590
1589
  }
1591
- }), F = {
1590
+ }), ye = {
1592
1591
  left: "blocks.text.alignLeft",
1593
1592
  center: "blocks.text.alignCenter",
1594
1593
  right: "blocks.text.alignRight",
1595
1594
  justify: "blocks.text.alignJustify"
1596
1595
  };
1597
- function we(e) {
1596
+ function be(e) {
1598
1597
  return (e === "justify" ? [
1599
1598
  14,
1600
1599
  14,
@@ -1614,16 +1613,16 @@ var rn = ["aria-label", "value"], an = { value: "paragraph" }, on = ["value"], s
1614
1613
  };
1615
1614
  });
1616
1615
  }
1617
- let I = o(), L = d("linkPopover"), R = d("linkInput"), Ee = d("linkTrigger"), z = g(""), Oe = g(!1), ke = g(!1);
1618
- function Ae(e) {
1616
+ let I = o(), L = d("linkPopover"), R = d("linkInput"), we = d("linkTrigger"), z = g(""), B = g(!1), V = g(!1);
1617
+ function De(e) {
1619
1618
  if (e.newState !== "open") return;
1620
1619
  let t = _.value?.getAttributes("link")?.href;
1621
- z.value = typeof t == "string" ? t : "", ke.value = z.value !== "";
1622
- let n = L.value, r = Ee.value?.getBoundingClientRect();
1620
+ z.value = typeof t == "string" ? t : "", V.value = z.value !== "";
1621
+ let n = L.value, r = we.value?.getBoundingClientRect();
1623
1622
  n && r && (n.style.left = `${r.left}px`, n.style.top = `${r.bottom + 4}px`);
1624
1623
  }
1625
- function je(e) {
1626
- if (Oe.value = e.newState === "open", e.newState !== "open") return;
1624
+ function ke(e) {
1625
+ if (B.value = e.newState === "open", e.newState !== "open") return;
1627
1626
  let t = L.value;
1628
1627
  if (t) {
1629
1628
  let e = window.innerWidth - t.offsetWidth - 8;
@@ -1633,29 +1632,29 @@ var rn = ["aria-label", "value"], an = { value: "paragraph" }, on = ["value"], s
1633
1632
  R.value?.focus(), R.value?.select();
1634
1633
  });
1635
1634
  }
1636
- function B(e) {
1635
+ function H(e) {
1637
1636
  let t = e.relatedTarget, n = L.value;
1638
1637
  t instanceof Node && n?.contains(t) || n?.hidePopover();
1639
1638
  }
1640
- function Ne() {
1639
+ function U() {
1641
1640
  let e = _.value?.chain().focus();
1642
1641
  if (!e) return;
1643
- let t = Ie(z.value);
1642
+ let t = Me(z.value);
1644
1643
  t === "" ? e.unsetLink().run() : e.setLink({
1645
1644
  href: t,
1646
1645
  target: t.startsWith("#") ? null : "_blank"
1647
1646
  }).run(), L.value?.hidePopover();
1648
1647
  }
1649
- let V = r(Te, x(() => [])), H = x(() => z.value.startsWith("#") && V.value.includes(z.value.slice(1)) ? z.value.slice(1) : "");
1650
- function Le(e) {
1648
+ let W = r(Ce, x(() => [])), Fe = x(() => z.value.startsWith("#") && W.value.includes(z.value.slice(1)) ? z.value.slice(1) : "");
1649
+ function Ie(e) {
1651
1650
  e === "" ? z.value.startsWith("#") && (z.value = "") : z.value = `#${e}`;
1652
1651
  }
1653
- function U() {
1652
+ function G() {
1654
1653
  _.value?.chain().focus().unsetLink().run(), L.value?.hidePopover();
1655
1654
  }
1656
1655
  function Re(e) {
1657
1656
  _.value?.chain().focus().insertContent({
1658
- type: _e,
1657
+ type: Pe,
1659
1658
  attrs: { id: e }
1660
1659
  }).run();
1661
1660
  }
@@ -1670,7 +1669,7 @@ var rn = ["aria-label", "value"], an = { value: "paragraph" }, on = ["value"], s
1670
1669
  onFocusout: ne
1671
1670
  }, [A(e(Pt), ee(l.editable ? { class: "text-input" } : {}, {
1672
1671
  editor: e(_),
1673
- style: e(fe)(l)
1672
+ style: e(se)(l)
1674
1673
  }), null, 16, ["editor", "style"]), l.editable ? (t(), S("div", {
1675
1674
  key: 0,
1676
1675
  ref_key: "toolbar",
@@ -1692,18 +1691,17 @@ var rn = ["aria-label", "value"], an = { value: "paragraph" }, on = ["value"], s
1692
1691
  E("select", {
1693
1692
  "aria-label": e(u)("blocks.text.font"),
1694
1693
  class: "font",
1695
- value: ge(),
1696
- onChange: N,
1694
+ value: P(),
1695
+ onChange: F,
1697
1696
  onMousedown: i[1] ||= T(() => {}, ["stop"])
1698
- }, [E("option", cn, O(e(u)("blocks.text.fontMixed")), 1), (t(!0), S(k, null, f(e(xe), (e) => (t(), S("option", {
1697
+ }, [E("option", cn, O(e(u)("blocks.text.fontMixed")), 1), (t(!0), S(k, null, f(e(ge), (e) => (t(), S("option", {
1699
1698
  key: e.key,
1700
1699
  value: e.key
1701
1700
  }, O(e.name), 9, ln))), 128))], 40, sn),
1702
- A(Ce, {
1703
- modelValue: P.value,
1704
- "onUpdate:modelValue": i[2] ||= (e) => P.value = e,
1701
+ A(ve, {
1702
+ modelValue: _e.value,
1703
+ "onUpdate:modelValue": i[2] ||= (e) => _e.value = e,
1705
1704
  "allow-transparent": !1,
1706
- compact: "",
1707
1705
  label: e(u)("blocks.text.textColor"),
1708
1706
  onMousedown: i[3] ||= T(() => {}, ["stop"])
1709
1707
  }, null, 8, ["modelValue", "label"]),
@@ -1734,15 +1732,15 @@ var rn = ["aria-label", "value"], an = { value: "paragraph" }, on = ["value"], s
1734
1732
  }, [...i[18] ||= [E("u", null, "U", -1)]], 42, fn),
1735
1733
  E("button", {
1736
1734
  ref_key: "linkTrigger",
1737
- ref: Ee,
1735
+ ref: we,
1738
1736
  class: b({ active: e(_)?.isActive("link") }),
1739
1737
  type: "button",
1740
1738
  title: e(u)("blocks.text.link"),
1741
1739
  popovertarget: e(I),
1742
1740
  "aria-haspopup": "dialog",
1743
- "aria-expanded": Oe.value,
1741
+ "aria-expanded": B.value,
1744
1742
  onMousedown: i[10] ||= T(() => {}, ["prevent"])
1745
- }, [A(Se, {
1743
+ }, [A(de, {
1746
1744
  name: "link",
1747
1745
  size: 16
1748
1746
  })], 42, pn),
@@ -1755,36 +1753,34 @@ var rn = ["aria-label", "value"], an = { value: "paragraph" }, on = ["value"], s
1755
1753
  popover: "",
1756
1754
  role: "dialog",
1757
1755
  "aria-label": e(u)("blocks.text.link"),
1758
- onBeforetoggle: Ae,
1759
- onToggle: je,
1760
- onFocusout: B
1756
+ onBeforetoggle: De,
1757
+ onToggle: ke,
1758
+ onFocusout: H
1761
1759
  }, [
1762
- E("span", hn, [A(De, {
1760
+ E("span", hn, [A(Te, {
1763
1761
  ref_key: "linkInput",
1764
1762
  ref: R,
1765
1763
  modelValue: z.value,
1766
1764
  "onUpdate:modelValue": i[11] ||= (e) => z.value = e,
1767
- size: "compact",
1768
1765
  inputmode: "url",
1769
1766
  spellcheck: "false",
1770
1767
  autocomplete: "off",
1771
1768
  placeholder: e(u)("blocks.text.linkPlaceholder"),
1772
1769
  "aria-label": e(u)("blocks.text.linkPrompt"),
1773
- onKeydown: te(T(Ne, ["prevent"]), ["enter"])
1770
+ onKeydown: te(T(U, ["prevent"]), ["enter"])
1774
1771
  }, null, 8, [
1775
1772
  "modelValue",
1776
1773
  "placeholder",
1777
1774
  "aria-label",
1778
1775
  "onKeydown"
1779
1776
  ])]),
1780
- e(V).length ? (t(), S("span", gn, [A(Fe, {
1781
- size: "compact",
1777
+ e(W).length ? (t(), S("span", gn, [A(Ae, {
1782
1778
  "aria-label": e(u)("blocks.common.anchorLink.label"),
1783
- "model-value": H.value,
1784
- "onUpdate:modelValue": Le,
1779
+ "model-value": Fe.value,
1780
+ "onUpdate:modelValue": Ie,
1785
1781
  onMousedown: i[12] ||= T(() => {}, ["stop"])
1786
1782
  }, {
1787
- default: n(() => [H.value ? (t(), S("option", _n, O(e(u)("blocks.common.anchorLink.none")), 1)) : (t(), S("option", vn, O(e(u)("blocks.common.anchorLink.placeholder")), 1)), (t(!0), S(k, null, f(e(V), (e) => (t(), S("option", {
1783
+ default: n(() => [Fe.value ? (t(), S("option", _n, O(e(u)("blocks.common.anchorLink.none")), 1)) : (t(), S("option", vn, O(e(u)("blocks.common.anchorLink.placeholder")), 1)), (t(!0), S(k, null, f(e(W), (e) => (t(), S("option", {
1788
1784
  key: e,
1789
1785
  value: e
1790
1786
  }, " #" + O(e), 9, yn))), 128))]),
@@ -1793,18 +1789,18 @@ var rn = ["aria-label", "value"], an = { value: "paragraph" }, on = ["value"], s
1793
1789
  E("button", {
1794
1790
  class: "link-apply",
1795
1791
  type: "button",
1796
- onClick: Ne,
1792
+ onClick: U,
1797
1793
  onMousedown: i[13] ||= T(() => {}, ["prevent"])
1798
1794
  }, O(e(u)("blocks.text.linkApply")), 33),
1799
- ke.value ? (t(), S("button", {
1795
+ V.value ? (t(), S("button", {
1800
1796
  key: 1,
1801
1797
  class: "link-remove",
1802
1798
  type: "button",
1803
1799
  title: e(u)("blocks.text.linkRemove"),
1804
1800
  "aria-label": e(u)("blocks.text.linkRemove"),
1805
- onClick: U,
1801
+ onClick: G,
1806
1802
  onMousedown: i[14] ||= T(() => {}, ["prevent"])
1807
- }, [A(Se, {
1803
+ }, [A(de, {
1808
1804
  name: "trash",
1809
1805
  size: 16
1810
1806
  })], 40, bn)) : C("", !0)
@@ -1814,11 +1810,11 @@ var rn = ["aria-label", "value"], an = { value: "paragraph" }, on = ["value"], s
1814
1810
  (t(), S(k, null, f(p, (n) => E("button", {
1815
1811
  key: n,
1816
1812
  class: b({ active: e(_)?.isActive({ textAlign: n }) }),
1817
- title: e(u)(F[n]),
1813
+ title: e(u)(ye[n]),
1818
1814
  type: "button",
1819
1815
  onClick: (t) => e(_)?.chain().focus().setTextAlign(n).run(),
1820
1816
  onMousedown: i[15] ||= T(() => {}, ["prevent"])
1821
- }, [(t(), S("svg", Sn, [(t(!0), S(k, null, f(we(n), (e, n) => (t(), S("rect", {
1817
+ }, [(t(), S("svg", Sn, [(t(!0), S(k, null, f(be(n), (e, n) => (t(), S("rect", {
1822
1818
  key: n,
1823
1819
  fill: "currentColor",
1824
1820
  height: "1.5",
@@ -1829,6 +1825,6 @@ var rn = ["aria-label", "value"], an = { value: "paragraph" }, on = ["value"], s
1829
1825
  }, null, 8, Cn))), 128))]))], 42, xn)), 64))
1830
1826
  ], 512)) : C("", !0)], 544));
1831
1827
  }
1832
- }), [["styles", [".tiptap{font-feature-settings:\"liga\" 0;font-variant-ligatures:none;overflow-wrap:break-word;white-space:pre-wrap;position:relative}.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-f337d1e6]{background:var(--bygga-color-surface);border:1px solid var(--bygga-color-border);border-radius:var(--bygga-radius-sm);box-shadow:var(--bygga-shadow-card);white-space:nowrap;font-family:var(--bygga-font-family);align-items:center;gap:.25em;margin:0;padding:.25em;position:fixed;inset:auto;transform:translate(-50%,calc(-100% - .4em))}.toolbar[data-v-f337d1e6]:popover-open{display:flex}.toolbar>button[data-v-f337d1e6]{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}.toolbar>button[data-v-f337d1e6]:hover{background:var(--bygga-color-track);color:var(--bygga-color-accent)}.toolbar>button.active[data-v-f337d1e6]{background:var(--bygga-color-selected,var(--bygga-color-track));color:var(--bygga-color-selected-text,var(--bygga-color-accent));forced-color-adjust:none}.toolbar .style[data-v-f337d1e6],.toolbar .font[data-v-f337d1e6]{background:var(--bygga-color-surface);border:1px solid var(--bygga-color-border);border-radius:var(--bygga-radius-sm);color:var(--bygga-color-text-muted);cursor:pointer;height:1.8em}.toolbar .divider[data-v-f337d1e6]{background:var(--bygga-color-border);width:1px;height:1.4em}.link-popover[data-v-f337d1e6]{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-f337d1e6]:popover-open{display:flex}.link-field[data-v-f337d1e6]{width:18em}.link-anchor[data-v-f337d1e6]{width:10em}.link-apply[data-v-f337d1e6]{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-f337d1e6]{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-f337d1e6]:hover{background:var(--bygga-color-track);color:var(--bygga-color-accent)}"]], ["__scopeId", "data-v-f337d1e6"]]);
1828
+ }), [["styles", [".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-8210eaaf]{background:var(--bygga-color-surface);border:1px solid var(--bygga-color-border);border-radius:var(--bygga-radius-sm);box-shadow:var(--bygga-shadow-card);white-space:nowrap;font-family:var(--bygga-font-family);direction:ltr;align-items:center;gap:.25em;margin:0;padding:.25em;position:fixed;inset:auto;transform:translate(-50%,calc(-100% - .4em))}.toolbar[data-v-8210eaaf]:popover-open{display:flex}.toolbar>button[data-v-8210eaaf]{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}.toolbar>button[data-v-8210eaaf]:hover{background:var(--bygga-color-track);color:var(--bygga-color-accent)}.toolbar>button.active[data-v-8210eaaf]{background:var(--bygga-color-selected,var(--bygga-color-track));color:var(--bygga-color-selected-text,var(--bygga-color-accent));forced-color-adjust:none}.toolbar .style[data-v-8210eaaf],.toolbar .font[data-v-8210eaaf]{background:var(--bygga-color-surface);border:1px solid var(--bygga-color-border);border-radius:var(--bygga-radius-sm);color:var(--bygga-color-text-muted);cursor:pointer;height:1.8em}.toolbar .divider[data-v-8210eaaf]{background:var(--bygga-color-border);width:1px;height:1.4em}.link-popover[data-v-8210eaaf]{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-8210eaaf]:popover-open{display:flex}.link-field[data-v-8210eaaf]{width:18em}.link-anchor[data-v-8210eaaf]{width:10em}.link-apply[data-v-8210eaaf]{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-8210eaaf]{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-8210eaaf]:hover{background:var(--bygga-color-track);color:var(--bygga-color-accent)}"]], ["__scopeId", "data-v-8210eaaf"]]);
1833
1829
  //#endregion
1834
1830
  export { wn as default };