@bygga.dev/editor 1.8.2 → 1.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{TextEditor-C4eFw8MM.js → TextEditor-BY5_EMzN.js} +536 -460
- package/bygga-editor.js +1782 -1423
- package/package.json +1 -1
- package/{urls-IMcu_a3s.js → urls-BsMrzVdc.js} +3312 -3144
|
@@ -1,12 +1,34 @@
|
|
|
1
|
-
import { A as e, B as t, D as n, E as r, F as i,
|
|
2
|
-
import { C as
|
|
1
|
+
import { A as e, B as t, D as n, E as r, F as i, G as a, H as o, I as s, J as c, M as l, N as u, O as d, P as f, Q as p, R as ee, T as m, U as h, W as g, X as _, Y as v, Z as y, a as b, b as x, ct as S, dt as C, et as w, ft as T, ht as E, it as D, k as O, lt as te, m as k, mt as ne, ot as A, q as re, t as ie, w as j, x as M, y as ae, z as oe } from "./providerKeys-D5U1FqVd.js";
|
|
2
|
+
import { At as N, C as P, Ct as F, D as I, Dt as se, Et as ce, G as le, K as ue, Ot as de, S as fe, Sn as pe, St as L, Tt as R, _t as me, at as he, b as ge, bn as _e, bt as z, c as ve, ct as ye, d as be, dn as xe, dt as B, et as Se, fn as Ce, ft as we, g as Te, gn as Ee, gt as De, hn as Oe, ht as ke, kt as Ae, l as je, ln as Me, lt as Ne, mn as Pe, mt as Fe, n as Ie, ot as Le, pn as Re, pt as ze, r as Be, s as Ve, st as He, t as Ue, tt as We, u as Ge, un as Ke, ut as qe, v as Je, vt as V, wt as H, xt as U, yt as W } from "./urls-BsMrzVdc.js";
|
|
3
|
+
//#region ../core/src/render/TextShell.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var Ye = ["align"], Xe = /* @__PURE__ */ l({
|
|
5
|
+
__name: "TextShell",
|
|
6
|
+
props: {
|
|
7
|
+
width: { type: null },
|
|
8
|
+
align: { type: null }
|
|
9
|
+
},
|
|
10
|
+
setup(e) {
|
|
11
|
+
let t = e;
|
|
12
|
+
return (e, n) => t.width === "fit" ? (o(), d("div", {
|
|
13
|
+
key: 0,
|
|
14
|
+
style: ne(C(le)(t.align ?? "left"))
|
|
15
|
+
}, [m("table", {
|
|
16
|
+
align: t.align ?? "left",
|
|
17
|
+
cellpadding: "0",
|
|
18
|
+
cellspacing: "0",
|
|
19
|
+
role: "presentation",
|
|
20
|
+
style: ne(C(ue)())
|
|
21
|
+
}, [m("tbody", null, [m("tr", null, [m("td", null, [a(e.$slots, "default")])])])], 12, Ye)], 4)) : a(e.$slots, "default", { key: 1 });
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
//#endregion
|
|
3
25
|
//#region ../../node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.js
|
|
4
|
-
function
|
|
5
|
-
return new
|
|
6
|
-
return new
|
|
26
|
+
function Ze(e = {}) {
|
|
27
|
+
return new F({ view(t) {
|
|
28
|
+
return new Qe(t, e);
|
|
7
29
|
} });
|
|
8
30
|
}
|
|
9
|
-
var
|
|
31
|
+
var Qe = class {
|
|
10
32
|
constructor(e, t) {
|
|
11
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 = [
|
|
12
34
|
"dragover",
|
|
@@ -97,16 +119,16 @@ var Je = class {
|
|
|
97
119
|
dragleave(e) {
|
|
98
120
|
this.editorView.dom.contains(e.relatedTarget) || this.setCursor(null);
|
|
99
121
|
}
|
|
100
|
-
},
|
|
122
|
+
}, G = class e extends R {
|
|
101
123
|
constructor(e) {
|
|
102
124
|
super(e, e);
|
|
103
125
|
}
|
|
104
126
|
map(t, n) {
|
|
105
127
|
let r = t.resolve(n.map(this.head));
|
|
106
|
-
return e.valid(r) ? new e(r) :
|
|
128
|
+
return e.valid(r) ? new e(r) : R.near(r);
|
|
107
129
|
}
|
|
108
130
|
content() {
|
|
109
|
-
return
|
|
131
|
+
return N.empty;
|
|
110
132
|
}
|
|
111
133
|
eq(t) {
|
|
112
134
|
return t instanceof e && t.head == this.head;
|
|
@@ -122,11 +144,11 @@ var Je = class {
|
|
|
122
144
|
return new e(t.resolve(n.pos));
|
|
123
145
|
}
|
|
124
146
|
getBookmark() {
|
|
125
|
-
return new
|
|
147
|
+
return new $e(this.anchor);
|
|
126
148
|
}
|
|
127
149
|
static valid(e) {
|
|
128
150
|
let t = e.parent;
|
|
129
|
-
if (t.inlineContent || !
|
|
151
|
+
if (t.inlineContent || !tt(e) || !nt(e)) return !1;
|
|
130
152
|
let n = t.type.spec.allowGapCursor;
|
|
131
153
|
if (n != null) return n;
|
|
132
154
|
let r = t.contentMatchAt(e.index()).defaultType;
|
|
@@ -149,7 +171,7 @@ var Je = class {
|
|
|
149
171
|
for (;;) {
|
|
150
172
|
let o = n > 0 ? a.firstChild : a.lastChild;
|
|
151
173
|
if (!o) {
|
|
152
|
-
if (a.isAtom && !a.isText && !
|
|
174
|
+
if (a.isAtom && !a.isText && !L.isSelectable(a)) {
|
|
153
175
|
t = t.doc.resolve(i + a.nodeSize * n), r = !1;
|
|
154
176
|
continue search;
|
|
155
177
|
}
|
|
@@ -163,8 +185,8 @@ var Je = class {
|
|
|
163
185
|
}
|
|
164
186
|
}
|
|
165
187
|
};
|
|
166
|
-
|
|
167
|
-
var
|
|
188
|
+
G.prototype.visible = !1, G.findFrom = G.findGapCursorFrom, R.jsonID("gapcursor", G);
|
|
189
|
+
var $e = class e {
|
|
168
190
|
constructor(e) {
|
|
169
191
|
this.pos = e;
|
|
170
192
|
}
|
|
@@ -173,13 +195,13 @@ var Ye = class e {
|
|
|
173
195
|
}
|
|
174
196
|
resolve(e) {
|
|
175
197
|
let t = e.resolve(this.pos);
|
|
176
|
-
return
|
|
198
|
+
return G.valid(t) ? new G(t) : R.near(t);
|
|
177
199
|
}
|
|
178
200
|
};
|
|
179
|
-
function
|
|
201
|
+
function et(e) {
|
|
180
202
|
return e.isAtom || e.spec.isolating || e.spec.createGapCursor;
|
|
181
203
|
}
|
|
182
|
-
function
|
|
204
|
+
function tt(e) {
|
|
183
205
|
for (let t = e.depth; t >= 0; t--) {
|
|
184
206
|
let n = e.index(t), r = e.node(t);
|
|
185
207
|
if (n == 0) {
|
|
@@ -187,13 +209,13 @@ function Ze(e) {
|
|
|
187
209
|
continue;
|
|
188
210
|
}
|
|
189
211
|
for (let e = r.child(n - 1);; e = e.lastChild) {
|
|
190
|
-
if (e.childCount == 0 && !e.inlineContent ||
|
|
212
|
+
if (e.childCount == 0 && !e.inlineContent || et(e.type)) return !0;
|
|
191
213
|
if (e.inlineContent) return !1;
|
|
192
214
|
}
|
|
193
215
|
}
|
|
194
216
|
return !0;
|
|
195
217
|
}
|
|
196
|
-
function
|
|
218
|
+
function nt(e) {
|
|
197
219
|
for (let t = e.depth; t >= 0; t--) {
|
|
198
220
|
let n = e.indexAfter(t), r = e.node(t);
|
|
199
221
|
if (n == r.childCount) {
|
|
@@ -201,24 +223,24 @@ function Qe(e) {
|
|
|
201
223
|
continue;
|
|
202
224
|
}
|
|
203
225
|
for (let e = r.child(n);; e = e.firstChild) {
|
|
204
|
-
if (e.childCount == 0 && !e.inlineContent ||
|
|
226
|
+
if (e.childCount == 0 && !e.inlineContent || et(e.type)) return !0;
|
|
205
227
|
if (e.inlineContent) return !1;
|
|
206
228
|
}
|
|
207
229
|
}
|
|
208
230
|
return !0;
|
|
209
231
|
}
|
|
210
|
-
function
|
|
211
|
-
return new
|
|
212
|
-
decorations:
|
|
232
|
+
function rt() {
|
|
233
|
+
return new F({ props: {
|
|
234
|
+
decorations: q,
|
|
213
235
|
createSelectionBetween(e, t, n) {
|
|
214
|
-
return t.pos == n.pos &&
|
|
236
|
+
return t.pos == n.pos && G.valid(n) ? new G(n) : null;
|
|
215
237
|
},
|
|
216
|
-
handleClick:
|
|
217
|
-
handleKeyDown:
|
|
218
|
-
handleDOMEvents: { beforeinput:
|
|
238
|
+
handleClick: at,
|
|
239
|
+
handleKeyDown: it,
|
|
240
|
+
handleDOMEvents: { beforeinput: ot }
|
|
219
241
|
} });
|
|
220
242
|
}
|
|
221
|
-
var
|
|
243
|
+
var it = W({
|
|
222
244
|
ArrowLeft: K("horiz", -1),
|
|
223
245
|
ArrowRight: K("horiz", 1),
|
|
224
246
|
ArrowUp: K("vert", -1),
|
|
@@ -228,47 +250,47 @@ function K(e, t) {
|
|
|
228
250
|
let n = e == "vert" ? t > 0 ? "down" : "up" : t > 0 ? "right" : "left";
|
|
229
251
|
return function(e, r, i) {
|
|
230
252
|
let a = e.selection, o = t > 0 ? a.$to : a.$from, s = a.empty;
|
|
231
|
-
if (a instanceof
|
|
253
|
+
if (a instanceof ce) {
|
|
232
254
|
if (!i.endOfTextblock(n) || o.depth == 0) return !1;
|
|
233
255
|
s = !1, o = e.doc.resolve(t > 0 ? o.after() : o.before());
|
|
234
256
|
}
|
|
235
|
-
let c =
|
|
236
|
-
return c ? (r && r(e.tr.setSelection(new
|
|
257
|
+
let c = G.findGapCursorFrom(o, t, s);
|
|
258
|
+
return c ? (r && r(e.tr.setSelection(new G(c))), !0) : !1;
|
|
237
259
|
};
|
|
238
260
|
}
|
|
239
|
-
function
|
|
261
|
+
function at(e, t, n) {
|
|
240
262
|
if (!e || !e.editable) return !1;
|
|
241
263
|
let r = e.state.doc.resolve(t);
|
|
242
|
-
if (!
|
|
264
|
+
if (!G.valid(r)) return !1;
|
|
243
265
|
let i = e.posAtCoords({
|
|
244
266
|
left: n.clientX,
|
|
245
267
|
top: n.clientY
|
|
246
268
|
});
|
|
247
|
-
return i && i.inside > -1 &&
|
|
269
|
+
return i && i.inside > -1 && L.isSelectable(e.state.doc.nodeAt(i.inside)) ? !1 : (e.dispatch(e.state.tr.setSelection(new G(r))), !0);
|
|
248
270
|
}
|
|
249
|
-
function
|
|
250
|
-
if (t.inputType != "insertCompositionText" || !(e.state.selection instanceof
|
|
271
|
+
function ot(e, t) {
|
|
272
|
+
if (t.inputType != "insertCompositionText" || !(e.state.selection instanceof G)) return !1;
|
|
251
273
|
let { $from: n } = e.state.selection, r = n.parent.contentMatchAt(n.index()).findWrapping(e.state.schema.nodes.text);
|
|
252
274
|
if (!r) return !1;
|
|
253
|
-
let i =
|
|
254
|
-
for (let e = r.length - 1; e >= 0; e--) i =
|
|
255
|
-
let a = e.state.tr.replace(n.pos, n.pos, new
|
|
256
|
-
return a.setSelection(
|
|
275
|
+
let i = Ae.empty;
|
|
276
|
+
for (let e = r.length - 1; e >= 0; e--) i = Ae.from(r[e].createAndFill(null, i));
|
|
277
|
+
let a = e.state.tr.replace(n.pos, n.pos, new N(i, 0, 0));
|
|
278
|
+
return a.setSelection(ce.near(a.doc.resolve(n.pos + 1))), e.dispatch(a), !1;
|
|
257
279
|
}
|
|
258
|
-
function
|
|
259
|
-
if (!(e.selection instanceof
|
|
280
|
+
function q(e) {
|
|
281
|
+
if (!(e.selection instanceof G)) return null;
|
|
260
282
|
let t = document.createElement("div");
|
|
261
|
-
return t.className = "ProseMirror-gapcursor",
|
|
283
|
+
return t.className = "ProseMirror-gapcursor", U.create(e.doc, [z.widget(e.selection.head, t, { key: "gapcursor" })]);
|
|
262
284
|
}
|
|
263
285
|
//#endregion
|
|
264
286
|
//#region ../../node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.js
|
|
265
|
-
var
|
|
287
|
+
var st = 200, J = function() {};
|
|
266
288
|
J.prototype.append = function(e) {
|
|
267
|
-
return e.length ? (e = J.from(e), !this.length && e || e.length <
|
|
289
|
+
return e.length ? (e = J.from(e), !this.length && e || e.length < st && this.leafAppend(e) || this.length < st && e.leafPrepend(this) || this.appendInner(e)) : this;
|
|
268
290
|
}, J.prototype.prepend = function(e) {
|
|
269
291
|
return e.length ? J.from(e).append(this) : this;
|
|
270
292
|
}, J.prototype.appendInner = function(e) {
|
|
271
|
-
return new
|
|
293
|
+
return new lt(this, e);
|
|
272
294
|
}, J.prototype.slice = function(e, t) {
|
|
273
295
|
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
296
|
}, J.prototype.get = function(e) {
|
|
@@ -282,9 +304,9 @@ J.prototype.append = function(e) {
|
|
|
282
304
|
return r.push(e(t, n));
|
|
283
305
|
}, t, n), r;
|
|
284
306
|
}, J.from = function(e) {
|
|
285
|
-
return e instanceof J ? e : e && e.length ? new
|
|
307
|
+
return e instanceof J ? e : e && e.length ? new ct(e) : J.empty;
|
|
286
308
|
};
|
|
287
|
-
var
|
|
309
|
+
var ct = /* @__PURE__ */ function(e) {
|
|
288
310
|
function t(t) {
|
|
289
311
|
e.call(this), this.values = t;
|
|
290
312
|
}
|
|
@@ -304,17 +326,17 @@ var rt = /* @__PURE__ */ function(e) {
|
|
|
304
326
|
}, t.prototype.forEachInvertedInner = function(e, t, n, r) {
|
|
305
327
|
for (var i = t - 1; i >= n; i--) if (e(this.values[i], r + i) === !1) return !1;
|
|
306
328
|
}, t.prototype.leafAppend = function(e) {
|
|
307
|
-
if (this.length + e.length <=
|
|
329
|
+
if (this.length + e.length <= st) return new t(this.values.concat(e.flatten()));
|
|
308
330
|
}, t.prototype.leafPrepend = function(e) {
|
|
309
|
-
if (this.length + e.length <=
|
|
331
|
+
if (this.length + e.length <= st) return new t(e.flatten().concat(this.values));
|
|
310
332
|
}, n.length.get = function() {
|
|
311
333
|
return this.values.length;
|
|
312
334
|
}, n.depth.get = function() {
|
|
313
335
|
return 0;
|
|
314
336
|
}, Object.defineProperties(t.prototype, n), t;
|
|
315
337
|
}(J);
|
|
316
|
-
J.empty = new
|
|
317
|
-
var
|
|
338
|
+
J.empty = new ct([]);
|
|
339
|
+
var lt = /* @__PURE__ */ function(e) {
|
|
318
340
|
function t(t, n) {
|
|
319
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;
|
|
320
342
|
}
|
|
@@ -341,7 +363,7 @@ var it = /* @__PURE__ */ function(e) {
|
|
|
341
363
|
}, t.prototype.appendInner = function(e) {
|
|
342
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);
|
|
343
365
|
}, t;
|
|
344
|
-
}(J),
|
|
366
|
+
}(J), ut = 500, Y = class e {
|
|
345
367
|
constructor(e, t) {
|
|
346
368
|
this.items = e, this.eventCount = t;
|
|
347
369
|
}
|
|
@@ -379,10 +401,10 @@ var it = /* @__PURE__ */ function(e) {
|
|
|
379
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);
|
|
380
402
|
}
|
|
381
403
|
let l = o - r.depth;
|
|
382
|
-
return l >
|
|
404
|
+
return l > ft && (s = dt(s, l), o -= l), new e(s.append(a), o);
|
|
383
405
|
}
|
|
384
406
|
remapping(e, t) {
|
|
385
|
-
let n = new
|
|
407
|
+
let n = new se();
|
|
386
408
|
return this.items.forEach((t, r) => {
|
|
387
409
|
let i = t.mirrorOffset != null && r - t.mirrorOffset >= e ? n.maps.length - t.mirrorOffset : void 0;
|
|
388
410
|
n.appendMap(t.map, i);
|
|
@@ -411,7 +433,7 @@ var it = /* @__PURE__ */ function(e) {
|
|
|
411
433
|
let l = [];
|
|
412
434
|
for (let e = n; e < o; e++) l.push(new X(a.maps[e]));
|
|
413
435
|
let u = new e(this.items.slice(0, i).append(l).append(r), s);
|
|
414
|
-
return u.emptyItemCount() >
|
|
436
|
+
return u.emptyItemCount() > ut && (u = u.compress(this.items.length - r.length)), u;
|
|
415
437
|
}
|
|
416
438
|
emptyItemCount() {
|
|
417
439
|
let e = 0;
|
|
@@ -436,7 +458,7 @@ var it = /* @__PURE__ */ function(e) {
|
|
|
436
458
|
}
|
|
437
459
|
};
|
|
438
460
|
Y.empty = new Y(J.empty, 0);
|
|
439
|
-
function
|
|
461
|
+
function dt(e, t) {
|
|
440
462
|
let n;
|
|
441
463
|
return e.forEach((e, r) => {
|
|
442
464
|
if (e.selection && t-- == 0) return n = r, !1;
|
|
@@ -456,21 +478,21 @@ var X = class e {
|
|
|
456
478
|
constructor(e, t, n, r, i) {
|
|
457
479
|
this.done = e, this.undone = t, this.prevRanges = n, this.prevTime = r, this.prevComposition = i;
|
|
458
480
|
}
|
|
459
|
-
},
|
|
460
|
-
function
|
|
481
|
+
}, ft = 20;
|
|
482
|
+
function pt(e, t, n, r) {
|
|
461
483
|
let i = n.getMeta(Q), a;
|
|
462
484
|
if (i) return i.historyState;
|
|
463
|
-
n.getMeta(
|
|
485
|
+
n.getMeta(xt) && (e = new Z(e.done, e.undone, null, 0, -1));
|
|
464
486
|
let o = n.getMeta("appendedTransaction");
|
|
465
487
|
if (n.steps.length == 0) return e;
|
|
466
|
-
if (o && o.getMeta(Q)) return o.getMeta(Q).redo ? new Z(e.done.addTransform(n, void 0, r,
|
|
488
|
+
if (o && o.getMeta(Q)) return o.getMeta(Q).redo ? new Z(e.done.addTransform(n, void 0, r, bt(t)), e.undone, ht(n.mapping.maps), e.prevTime, e.prevComposition) : new Z(e.done, e.undone.addTransform(n, void 0, r, bt(t)), null, e.prevTime, e.prevComposition);
|
|
467
489
|
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 || !
|
|
469
|
-
return new Z(e.done.addTransform(n, a ? t.selection.getBookmark() : void 0, r,
|
|
470
|
-
} else if (a = n.getMeta("rebased")) return new Z(e.done.rebased(n, a), e.undone.rebased(n, a),
|
|
471
|
-
else return new Z(e.done.addMaps(n.mapping.maps), e.undone.addMaps(n.mapping.maps),
|
|
490
|
+
let i = n.getMeta("composition"), a = e.prevTime == 0 || !o && e.prevComposition != i && (e.prevTime < (n.time || 0) - r.newGroupDelay || !mt(n, e.prevRanges)), s = o ? gt(e.prevRanges, n.mapping) : ht(n.mapping.maps);
|
|
491
|
+
return new Z(e.done.addTransform(n, a ? t.selection.getBookmark() : void 0, r, bt(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), gt(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), gt(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
|
|
472
494
|
}
|
|
473
|
-
function
|
|
495
|
+
function mt(e, t) {
|
|
474
496
|
if (!t) return !1;
|
|
475
497
|
if (!e.docChanged) return !0;
|
|
476
498
|
let n = !1;
|
|
@@ -478,12 +500,12 @@ function lt(e, t) {
|
|
|
478
500
|
for (let i = 0; i < t.length; i += 2) e <= t[i + 1] && r >= t[i] && (n = !0);
|
|
479
501
|
}), n;
|
|
480
502
|
}
|
|
481
|
-
function
|
|
503
|
+
function ht(e) {
|
|
482
504
|
let t = [];
|
|
483
505
|
for (let n = e.length - 1; n >= 0 && t.length == 0; n--) e[n].forEach((e, n, r, i) => t.push(r, i));
|
|
484
506
|
return t;
|
|
485
507
|
}
|
|
486
|
-
function
|
|
508
|
+
function gt(e, t) {
|
|
487
509
|
if (!e) return null;
|
|
488
510
|
let n = [];
|
|
489
511
|
for (let r = 0; r < e.length; r += 2) {
|
|
@@ -492,8 +514,8 @@ function dt(e, t) {
|
|
|
492
514
|
}
|
|
493
515
|
return n;
|
|
494
516
|
}
|
|
495
|
-
function
|
|
496
|
-
let r =
|
|
517
|
+
function _t(e, t, n) {
|
|
518
|
+
let r = bt(t), i = Q.get(t).spec.config, a = (n ? e.undone : e.done).popEvent(t, r);
|
|
497
519
|
if (!a) return null;
|
|
498
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);
|
|
499
521
|
return a.transform.setSelection(o).setMeta(Q, {
|
|
@@ -501,53 +523,53 @@ function ft(e, t, n) {
|
|
|
501
523
|
historyState: c
|
|
502
524
|
});
|
|
503
525
|
}
|
|
504
|
-
var
|
|
505
|
-
function
|
|
526
|
+
var vt = !1, yt = null;
|
|
527
|
+
function bt(e) {
|
|
506
528
|
let t = e.plugins;
|
|
507
|
-
if (
|
|
508
|
-
|
|
529
|
+
if (yt != t) {
|
|
530
|
+
vt = !1, yt = t;
|
|
509
531
|
for (let e = 0; e < t.length; e++) if (t[e].spec.historyPreserveItems) {
|
|
510
|
-
|
|
532
|
+
vt = !0;
|
|
511
533
|
break;
|
|
512
534
|
}
|
|
513
535
|
}
|
|
514
|
-
return
|
|
536
|
+
return vt;
|
|
515
537
|
}
|
|
516
|
-
var Q = new
|
|
517
|
-
function
|
|
538
|
+
var Q = new H("history"), xt = new H("closeHistory");
|
|
539
|
+
function St(e = {}) {
|
|
518
540
|
return e = {
|
|
519
541
|
depth: e.depth || 100,
|
|
520
542
|
newGroupDelay: e.newGroupDelay || 500
|
|
521
|
-
}, new
|
|
543
|
+
}, new F({
|
|
522
544
|
key: Q,
|
|
523
545
|
state: {
|
|
524
546
|
init() {
|
|
525
547
|
return new Z(Y.empty, Y.empty, null, 0, -1);
|
|
526
548
|
},
|
|
527
549
|
apply(t, n, r) {
|
|
528
|
-
return
|
|
550
|
+
return pt(n, r, t, e);
|
|
529
551
|
}
|
|
530
552
|
},
|
|
531
553
|
config: e,
|
|
532
554
|
props: { handleDOMEvents: { beforeinput(e, t) {
|
|
533
|
-
let n = t.inputType, r = n == "historyUndo" ?
|
|
555
|
+
let n = t.inputType, r = n == "historyUndo" ? wt : n == "historyRedo" ? Tt : null;
|
|
534
556
|
return !r || !e.editable ? !1 : (t.preventDefault(), r(e.state, e.dispatch));
|
|
535
557
|
} } }
|
|
536
558
|
});
|
|
537
559
|
}
|
|
538
|
-
function
|
|
560
|
+
function Ct(e, t) {
|
|
539
561
|
return (n, r) => {
|
|
540
562
|
let i = Q.getState(n);
|
|
541
563
|
if (!i || (e ? i.undone : i.done).eventCount == 0) return !1;
|
|
542
564
|
if (r) {
|
|
543
|
-
let a =
|
|
565
|
+
let a = _t(i, n, e);
|
|
544
566
|
a && r(t ? a.scrollIntoView() : a);
|
|
545
567
|
}
|
|
546
568
|
return !0;
|
|
547
569
|
};
|
|
548
570
|
}
|
|
549
|
-
var
|
|
550
|
-
|
|
571
|
+
var wt = Ct(!1, !0), Tt = Ct(!0, !0);
|
|
572
|
+
B.create({
|
|
551
573
|
name: "characterCount",
|
|
552
574
|
addOptions() {
|
|
553
575
|
return {
|
|
@@ -579,8 +601,8 @@ R.create({
|
|
|
579
601
|
},
|
|
580
602
|
addProseMirrorPlugins() {
|
|
581
603
|
let e = !1;
|
|
582
|
-
return [new
|
|
583
|
-
key: new
|
|
604
|
+
return [new F({
|
|
605
|
+
key: new H("characterCount"),
|
|
584
606
|
appendTransaction: (t, n, r) => {
|
|
585
607
|
if (e) return;
|
|
586
608
|
let i = this.options.limit, a = this.options.autoTrim;
|
|
@@ -608,7 +630,7 @@ R.create({
|
|
|
608
630
|
}
|
|
609
631
|
})];
|
|
610
632
|
}
|
|
611
|
-
}),
|
|
633
|
+
}), B.create({
|
|
612
634
|
name: "dropCursor",
|
|
613
635
|
addOptions() {
|
|
614
636
|
return {
|
|
@@ -618,9 +640,9 @@ R.create({
|
|
|
618
640
|
};
|
|
619
641
|
},
|
|
620
642
|
addProseMirrorPlugins() {
|
|
621
|
-
return [
|
|
643
|
+
return [Ze(this.options)];
|
|
622
644
|
}
|
|
623
|
-
}),
|
|
645
|
+
}), B.create({
|
|
624
646
|
name: "focus",
|
|
625
647
|
addOptions() {
|
|
626
648
|
return {
|
|
@@ -629,11 +651,11 @@ R.create({
|
|
|
629
651
|
};
|
|
630
652
|
},
|
|
631
653
|
addProseMirrorPlugins() {
|
|
632
|
-
return [new
|
|
633
|
-
key: new
|
|
654
|
+
return [new F({
|
|
655
|
+
key: new H("focus"),
|
|
634
656
|
props: { decorations: ({ doc: e, selection: t }) => {
|
|
635
657
|
let { isEditable: n, isFocused: r } = this.editor, { anchor: i } = t, a = [];
|
|
636
|
-
if (!n || !r) return
|
|
658
|
+
if (!n || !r) return U.create(e, []);
|
|
637
659
|
let o = 0;
|
|
638
660
|
this.options.mode === "deepest" && e.descendants((e, t) => {
|
|
639
661
|
if (!e.isText) {
|
|
@@ -645,28 +667,28 @@ R.create({
|
|
|
645
667
|
return e.descendants((e, t) => {
|
|
646
668
|
if (e.isText || !(i >= t && i <= t + e.nodeSize - 1)) return !1;
|
|
647
669
|
if (s += 1, this.options.mode === "deepest" && o - s > 0 || this.options.mode === "shallowest" && s > 1) return this.options.mode === "deepest";
|
|
648
|
-
a.push(
|
|
649
|
-
}),
|
|
670
|
+
a.push(z.node(t, t + e.nodeSize, { class: this.options.className }));
|
|
671
|
+
}), U.create(e, a);
|
|
650
672
|
} }
|
|
651
673
|
})];
|
|
652
674
|
}
|
|
653
|
-
}),
|
|
675
|
+
}), B.create({
|
|
654
676
|
name: "gapCursor",
|
|
655
677
|
addProseMirrorPlugins() {
|
|
656
|
-
return [
|
|
678
|
+
return [rt()];
|
|
657
679
|
},
|
|
658
680
|
extendNodeSchema(e) {
|
|
659
|
-
return { allowGapCursor:
|
|
681
|
+
return { allowGapCursor: ze(ke(e, "allowGapCursor", {
|
|
660
682
|
name: e.name,
|
|
661
683
|
options: e.options,
|
|
662
684
|
storage: e.storage
|
|
663
685
|
})) ?? null };
|
|
664
686
|
}
|
|
665
687
|
});
|
|
666
|
-
var
|
|
667
|
-
function
|
|
688
|
+
var Et = "placeholder", $ = new H("tiptap__placeholder"), Dt = 200;
|
|
689
|
+
function Ot(e) {
|
|
668
690
|
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),
|
|
691
|
+
return o && u.push(l), z.node(i, i + a.nodeSize, {
|
|
670
692
|
class: u.join(" "),
|
|
671
693
|
[r]: typeof n == "function" ? n({
|
|
672
694
|
editor: t,
|
|
@@ -676,17 +698,17 @@ function Ct(e) {
|
|
|
676
698
|
}) : n
|
|
677
699
|
});
|
|
678
700
|
}
|
|
679
|
-
function
|
|
701
|
+
function kt(e, t) {
|
|
680
702
|
return typeof e == "function" ? e(t) : e;
|
|
681
703
|
}
|
|
682
|
-
function
|
|
704
|
+
function At({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
|
|
683
705
|
if (!(e.isEditable || !t.showOnlyWhenEditable)) return null;
|
|
684
706
|
let { anchor: a } = i, o = [], s = e.isEmpty;
|
|
685
707
|
if (t.showOnlyCurrent && !t.includeChildren) {
|
|
686
708
|
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 &&
|
|
709
|
+
if (c && c.type.isTextblock && De(c)) {
|
|
688
710
|
let r = a >= l && a <= l + c.nodeSize;
|
|
689
|
-
o.push(
|
|
711
|
+
o.push(Ot({
|
|
690
712
|
editor: e,
|
|
691
713
|
isEmptyDoc: s,
|
|
692
714
|
dataAttribute: n,
|
|
@@ -694,7 +716,7 @@ function Tt({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
|
|
|
694
716
|
placeholder: t.placeholder,
|
|
695
717
|
classes: {
|
|
696
718
|
emptyEditor: t.emptyEditorClass,
|
|
697
|
-
emptyNode:
|
|
719
|
+
emptyNode: kt(t.emptyNodeClass, {
|
|
698
720
|
editor: e,
|
|
699
721
|
node: c,
|
|
700
722
|
pos: l,
|
|
@@ -708,8 +730,8 @@ function Tt({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
|
|
|
708
730
|
} else {
|
|
709
731
|
let i = $.getState(e.state), c = i?.topPos ?? 0, l = i?.bottomPos ?? r.content.size;
|
|
710
732
|
r.nodesBetween(c, l, (r, i) => {
|
|
711
|
-
let c = a >= i && a <= i + r.nodeSize, l = !r.isLeaf &&
|
|
712
|
-
return r.type.isTextblock && (c || !t.showOnlyCurrent) && l && o.push(
|
|
733
|
+
let c = a >= i && a <= i + r.nodeSize, l = !r.isLeaf && De(r);
|
|
734
|
+
return r.type.isTextblock && (c || !t.showOnlyCurrent) && l && o.push(Ot({
|
|
713
735
|
editor: e,
|
|
714
736
|
isEmptyDoc: s,
|
|
715
737
|
dataAttribute: n,
|
|
@@ -717,7 +739,7 @@ function Tt({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
|
|
|
717
739
|
placeholder: t.placeholder,
|
|
718
740
|
classes: {
|
|
719
741
|
emptyEditor: t.emptyEditorClass,
|
|
720
|
-
emptyNode:
|
|
742
|
+
emptyNode: kt(t.emptyNodeClass, {
|
|
721
743
|
editor: e,
|
|
722
744
|
node: r,
|
|
723
745
|
pos: i,
|
|
@@ -729,19 +751,19 @@ function Tt({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
|
|
|
729
751
|
})), t.includeChildren;
|
|
730
752
|
});
|
|
731
753
|
}
|
|
732
|
-
return
|
|
754
|
+
return U.create(r, o);
|
|
733
755
|
}
|
|
734
|
-
function
|
|
756
|
+
function jt(e) {
|
|
735
757
|
return e.replace(/\s+/g, "-").replace(/[^a-zA-Z0-9-]/g, "").replace(/^[0-9-]+/, "").replace(/^-+/, "").toLowerCase();
|
|
736
758
|
}
|
|
737
|
-
function
|
|
759
|
+
function Mt(e) {
|
|
738
760
|
let t = getComputedStyle(e), n = `${t.overflow} ${t.overflowY} ${t.overflowX}`;
|
|
739
761
|
return /auto|scroll|overlay/.test(n);
|
|
740
762
|
}
|
|
741
|
-
function
|
|
763
|
+
function Nt(e) {
|
|
742
764
|
let t = e;
|
|
743
765
|
for (; t;) {
|
|
744
|
-
if (
|
|
766
|
+
if (Mt(t)) return t;
|
|
745
767
|
let e = t.parentElement;
|
|
746
768
|
if (!e) {
|
|
747
769
|
let e = t.getRootNode();
|
|
@@ -755,19 +777,19 @@ function Ot(e) {
|
|
|
755
777
|
}
|
|
756
778
|
return window;
|
|
757
779
|
}
|
|
758
|
-
function
|
|
780
|
+
function Pt(e) {
|
|
759
781
|
return e === window ? {
|
|
760
782
|
top: 0,
|
|
761
783
|
bottom: window.innerHeight
|
|
762
784
|
} : e.getBoundingClientRect();
|
|
763
785
|
}
|
|
764
|
-
function
|
|
786
|
+
function Ft({ view: e, scrollContainer: t }) {
|
|
765
787
|
let n = e.dom.getBoundingClientRect();
|
|
766
788
|
if (n.width <= 0 || n.height <= 0) return null;
|
|
767
|
-
let r = t ?
|
|
789
|
+
let r = t ? Pt(t) : {
|
|
768
790
|
top: 0,
|
|
769
791
|
bottom: window.innerHeight
|
|
770
|
-
}, i = Math.max(n.top, r.top) -
|
|
792
|
+
}, i = Math.max(n.top, r.top) - Dt, a = Math.min(n.bottom, r.bottom) + Dt;
|
|
771
793
|
if (i >= a) return null;
|
|
772
794
|
let o = n.left + 1, s = n.right - 1;
|
|
773
795
|
if (o > s) return null;
|
|
@@ -785,7 +807,7 @@ function At({ view: e, scrollContainer: t }) {
|
|
|
785
807
|
bottom: p.pos
|
|
786
808
|
};
|
|
787
809
|
}
|
|
788
|
-
var
|
|
810
|
+
var It = {
|
|
789
811
|
init() {
|
|
790
812
|
return {
|
|
791
813
|
topPos: null,
|
|
@@ -803,9 +825,9 @@ var jt = {
|
|
|
803
825
|
} : t;
|
|
804
826
|
}
|
|
805
827
|
};
|
|
806
|
-
function
|
|
807
|
-
let t =
|
|
808
|
-
let n =
|
|
828
|
+
function Lt(e) {
|
|
829
|
+
let t = Nt(e.dom), n = () => {
|
|
830
|
+
let n = Ft({
|
|
809
831
|
view: e,
|
|
810
832
|
scrollContainer: t
|
|
811
833
|
});
|
|
@@ -834,13 +856,13 @@ function Mt(e) {
|
|
|
834
856
|
}
|
|
835
857
|
};
|
|
836
858
|
}
|
|
837
|
-
function
|
|
838
|
-
let n = t.dataAttribute ? `data-${
|
|
839
|
-
return new
|
|
859
|
+
function Rt({ editor: e, options: t }) {
|
|
860
|
+
let n = t.dataAttribute ? `data-${jt(t.dataAttribute)}` : `data-${Et}`;
|
|
861
|
+
return new F({
|
|
840
862
|
key: $,
|
|
841
|
-
state:
|
|
842
|
-
view:
|
|
843
|
-
props: { decorations: ({ doc: r, selection: i }) =>
|
|
863
|
+
state: It,
|
|
864
|
+
view: Lt,
|
|
865
|
+
props: { decorations: ({ doc: r, selection: i }) => At({
|
|
844
866
|
editor: e,
|
|
845
867
|
options: t,
|
|
846
868
|
dataAttribute: n,
|
|
@@ -849,13 +871,13 @@ function Nt({ editor: e, options: t }) {
|
|
|
849
871
|
}) }
|
|
850
872
|
});
|
|
851
873
|
}
|
|
852
|
-
var
|
|
874
|
+
var zt = B.create({
|
|
853
875
|
name: "placeholder",
|
|
854
876
|
addOptions() {
|
|
855
877
|
return {
|
|
856
878
|
emptyEditorClass: "is-editor-empty",
|
|
857
879
|
emptyNodeClass: "is-empty",
|
|
858
|
-
dataAttribute:
|
|
880
|
+
dataAttribute: Et,
|
|
859
881
|
placeholder: "Write something …",
|
|
860
882
|
showOnlyWhenEditable: !0,
|
|
861
883
|
showOnlyCurrent: !0,
|
|
@@ -863,31 +885,31 @@ var Pt = R.create({
|
|
|
863
885
|
};
|
|
864
886
|
},
|
|
865
887
|
addProseMirrorPlugins() {
|
|
866
|
-
return [
|
|
888
|
+
return [Rt({
|
|
867
889
|
editor: this.editor,
|
|
868
890
|
options: this.options
|
|
869
891
|
})];
|
|
870
892
|
}
|
|
871
|
-
}),
|
|
872
|
-
|
|
893
|
+
}), Bt = ".ProseMirror:not(.ProseMirror-focused) *::selection {\n background: transparent;\n}\n\n.ProseMirror:not(.ProseMirror-focused) *::-moz-selection {\n background: transparent;\n}";
|
|
894
|
+
B.create({
|
|
873
895
|
name: "selection",
|
|
874
896
|
addOptions() {
|
|
875
897
|
return { className: "selection" };
|
|
876
898
|
},
|
|
877
899
|
addProseMirrorPlugins() {
|
|
878
900
|
let { editor: e, options: t } = this;
|
|
879
|
-
return e.options.injectCSS && typeof document < "u" &&
|
|
880
|
-
key: new
|
|
901
|
+
return e.options.injectCSS && typeof document < "u" && Fe(Bt, e.options.injectNonce, "selection"), [new F({
|
|
902
|
+
key: new H("selection"),
|
|
881
903
|
props: { decorations(n) {
|
|
882
|
-
return n.selection.empty || e.isFocused || !e.isEditable ||
|
|
904
|
+
return n.selection.empty || e.isFocused || !e.isEditable || me(n.selection) || e.view.dragging ? null : U.create(n.doc, [z.inline(n.selection.from, n.selection.to, { class: t.className })]);
|
|
883
905
|
} }
|
|
884
906
|
})];
|
|
885
907
|
}
|
|
886
908
|
});
|
|
887
|
-
function
|
|
909
|
+
function Vt({ types: e, node: t }) {
|
|
888
910
|
return t && Array.isArray(e) && e.includes(t.type) || t?.type === e;
|
|
889
911
|
}
|
|
890
|
-
|
|
912
|
+
B.create({
|
|
891
913
|
name: "trailingNode",
|
|
892
914
|
addOptions() {
|
|
893
915
|
return {
|
|
@@ -896,8 +918,8 @@ R.create({
|
|
|
896
918
|
};
|
|
897
919
|
},
|
|
898
920
|
addProseMirrorPlugins() {
|
|
899
|
-
let e = new
|
|
900
|
-
return [new
|
|
921
|
+
let e = new H(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 F({
|
|
901
923
|
key: e,
|
|
902
924
|
appendTransaction: (n, r, i) => {
|
|
903
925
|
let { doc: a, tr: o, schema: s } = i, c = e.getState(i), l = a.content.size, u = s.nodes[t];
|
|
@@ -906,7 +928,7 @@ R.create({
|
|
|
906
928
|
state: {
|
|
907
929
|
init: (e, t) => {
|
|
908
930
|
let r = t.tr.doc.lastChild;
|
|
909
|
-
return !
|
|
931
|
+
return !Vt({
|
|
910
932
|
node: r,
|
|
911
933
|
types: n
|
|
912
934
|
});
|
|
@@ -914,7 +936,7 @@ R.create({
|
|
|
914
936
|
apply: (e, t) => {
|
|
915
937
|
if (!e.docChanged || e.getMeta("__uniqueIDTransaction")) return t;
|
|
916
938
|
let r = e.doc.lastChild;
|
|
917
|
-
return !
|
|
939
|
+
return !Vt({
|
|
918
940
|
node: r,
|
|
919
941
|
types: n
|
|
920
942
|
});
|
|
@@ -923,7 +945,7 @@ R.create({
|
|
|
923
945
|
})];
|
|
924
946
|
}
|
|
925
947
|
});
|
|
926
|
-
var
|
|
948
|
+
var Ht = B.create({
|
|
927
949
|
name: "undoRedo",
|
|
928
950
|
addOptions() {
|
|
929
951
|
return {
|
|
@@ -933,12 +955,12 @@ var Lt = R.create({
|
|
|
933
955
|
},
|
|
934
956
|
addCommands() {
|
|
935
957
|
return {
|
|
936
|
-
undo: () => ({ state: e, dispatch: t }) =>
|
|
937
|
-
redo: () => ({ state: e, dispatch: t }) =>
|
|
958
|
+
undo: () => ({ state: e, dispatch: t }) => wt(e, t),
|
|
959
|
+
redo: () => ({ state: e, dispatch: t }) => Tt(e, t)
|
|
938
960
|
};
|
|
939
961
|
},
|
|
940
962
|
addProseMirrorPlugins() {
|
|
941
|
-
return [
|
|
963
|
+
return [St(this.options)];
|
|
942
964
|
},
|
|
943
965
|
addKeyboardShortcuts() {
|
|
944
966
|
return {
|
|
@@ -952,7 +974,7 @@ var Lt = R.create({
|
|
|
952
974
|
});
|
|
953
975
|
//#endregion
|
|
954
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
|
|
955
|
-
function
|
|
977
|
+
function Ut(e) {
|
|
956
978
|
return w((t, n) => ({
|
|
957
979
|
get() {
|
|
958
980
|
return t(), e;
|
|
@@ -966,9 +988,9 @@ function Rt(e) {
|
|
|
966
988
|
}
|
|
967
989
|
}));
|
|
968
990
|
}
|
|
969
|
-
var
|
|
991
|
+
var Wt = class extends qe {
|
|
970
992
|
constructor(e = {}) {
|
|
971
|
-
return super(e), this.contentComponent = null, this.appContext = null, this.reactiveState =
|
|
993
|
+
return super(e), this.contentComponent = null, this.appContext = null, this.reactiveState = Ut(this.view.state), this.reactiveExtensionStorage = Ut(this.extensionStorage), this.on("beforeTransaction", ({ nextState: e }) => {
|
|
972
994
|
this.reactiveState.value = e, this.reactiveExtensionStorage.value = this.extensionStorage;
|
|
973
995
|
}), D(this);
|
|
974
996
|
}
|
|
@@ -986,7 +1008,7 @@ var zt = class extends V {
|
|
|
986
1008
|
let t = super.unregisterPlugin(e);
|
|
987
1009
|
return this.reactiveState && t && (this.reactiveState.value = t), t;
|
|
988
1010
|
}
|
|
989
|
-
},
|
|
1011
|
+
}, Gt = l({
|
|
990
1012
|
name: "EditorContent",
|
|
991
1013
|
props: { editor: {
|
|
992
1014
|
default: null,
|
|
@@ -1004,7 +1026,7 @@ var zt = class extends V {
|
|
|
1004
1026
|
provides: n.provides
|
|
1005
1027
|
}), r.setOptions({ element: e }), r.createNodeViews();
|
|
1006
1028
|
});
|
|
1007
|
-
}),
|
|
1029
|
+
}), oe(() => {
|
|
1008
1030
|
let t = e.editor;
|
|
1009
1031
|
t && (t.contentComponent = null, t.appContext = null);
|
|
1010
1032
|
}), { rootEl: t };
|
|
@@ -1037,7 +1059,7 @@ l({
|
|
|
1037
1059
|
});
|
|
1038
1060
|
}
|
|
1039
1061
|
});
|
|
1040
|
-
var
|
|
1062
|
+
var Kt = l({
|
|
1041
1063
|
name: "NodeViewWrapper",
|
|
1042
1064
|
props: { as: {
|
|
1043
1065
|
type: String,
|
|
@@ -1053,17 +1075,17 @@ var Vt = l({
|
|
|
1053
1075
|
onDragstart: this.onDragStart
|
|
1054
1076
|
}, (e = this.$slots).default?.call(e));
|
|
1055
1077
|
}
|
|
1056
|
-
}),
|
|
1057
|
-
let n =
|
|
1078
|
+
}), qt = (e = {}) => {
|
|
1079
|
+
let n = te();
|
|
1058
1080
|
return t(() => {
|
|
1059
|
-
n.value = new
|
|
1060
|
-
}),
|
|
1081
|
+
n.value = new Wt(e);
|
|
1082
|
+
}), oe(() => {
|
|
1061
1083
|
var e;
|
|
1062
1084
|
(e = n.value) == null || e.destroy();
|
|
1063
1085
|
}), n;
|
|
1064
|
-
},
|
|
1086
|
+
}, Jt = class {
|
|
1065
1087
|
constructor(e, { props: t = {}, editor: n }) {
|
|
1066
|
-
this.destroyed = !1, this.editor = n, this.component = D(e), this.el = document.createElement("div"), this.props =
|
|
1088
|
+
this.destroyed = !1, this.editor = n, this.component = D(e), this.el = document.createElement("div"), this.props = A(t), this.renderedComponent = this.renderComponent();
|
|
1067
1089
|
}
|
|
1068
1090
|
get element() {
|
|
1069
1091
|
return this.renderedComponent.el;
|
|
@@ -1074,10 +1096,10 @@ var Vt = l({
|
|
|
1074
1096
|
renderComponent() {
|
|
1075
1097
|
if (this.destroyed) return this.renderedComponent;
|
|
1076
1098
|
let e = f(this.component, this.props);
|
|
1077
|
-
return this.editor.appContext && (e.appContext = this.editor.appContext), typeof document < "u" && this.el &&
|
|
1099
|
+
return this.editor.appContext && (e.appContext = this.editor.appContext), typeof document < "u" && this.el && k(e, this.el), {
|
|
1078
1100
|
vNode: e,
|
|
1079
1101
|
destroy: () => {
|
|
1080
|
-
this.el &&
|
|
1102
|
+
this.el && k(null, this.el), this.el = null, e = null;
|
|
1081
1103
|
},
|
|
1082
1104
|
el: this.el ? this.el.firstElementChild : null
|
|
1083
1105
|
};
|
|
@@ -1104,7 +1126,7 @@ l({
|
|
|
1104
1126
|
});
|
|
1105
1127
|
}
|
|
1106
1128
|
});
|
|
1107
|
-
var
|
|
1129
|
+
var Yt = {
|
|
1108
1130
|
editor: {
|
|
1109
1131
|
type: Object,
|
|
1110
1132
|
required: !0
|
|
@@ -1149,7 +1171,7 @@ var Wt = {
|
|
|
1149
1171
|
type: Object,
|
|
1150
1172
|
required: !0
|
|
1151
1173
|
}
|
|
1152
|
-
},
|
|
1174
|
+
}, Xt = class extends we {
|
|
1153
1175
|
constructor(e, t, n) {
|
|
1154
1176
|
super(e, t, n), this.cachedExtensionWithSyncedStorage = null, this.handlePositionUpdate = () => {
|
|
1155
1177
|
let e = this.getPos();
|
|
@@ -1195,7 +1217,7 @@ var Wt = {
|
|
|
1195
1217
|
__name: this.component.__name,
|
|
1196
1218
|
__file: this.component.__file
|
|
1197
1219
|
});
|
|
1198
|
-
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
|
|
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 Jt(r, {
|
|
1199
1221
|
editor: this.editor,
|
|
1200
1222
|
props: t
|
|
1201
1223
|
});
|
|
@@ -1209,7 +1231,7 @@ var Wt = {
|
|
|
1209
1231
|
}
|
|
1210
1232
|
handleSelectionUpdate() {
|
|
1211
1233
|
let e = this.getPos();
|
|
1212
|
-
if (typeof e == "number") if (
|
|
1234
|
+
if (typeof e == "number") if (V({
|
|
1213
1235
|
selection: this.editor.state.selection,
|
|
1214
1236
|
pos: e,
|
|
1215
1237
|
nodeSize: this.node.nodeSize,
|
|
@@ -1267,44 +1289,44 @@ var Wt = {
|
|
|
1267
1289
|
this.renderer.destroy(), this.editor.off("selectionUpdate", this.handleSelectionUpdate), this.options.trackNodeViewPosition && this.editor.off("update", this.handlePositionUpdate), this.contentDOMElement = null;
|
|
1268
1290
|
}
|
|
1269
1291
|
};
|
|
1270
|
-
function
|
|
1271
|
-
return (n) => n.editor.contentComponent ? new
|
|
1292
|
+
function Zt(e, t) {
|
|
1293
|
+
return (n) => n.editor.contentComponent ? new Xt(typeof e == "function" && "__vccOpts" in e ? e.__vccOpts : e, n, t) : {};
|
|
1272
1294
|
}
|
|
1273
1295
|
//#endregion
|
|
1274
1296
|
//#region src/ai.ts
|
|
1275
|
-
var
|
|
1297
|
+
var Qt = [
|
|
1276
1298
|
"proofread",
|
|
1277
1299
|
"rewrite",
|
|
1278
1300
|
"shorten",
|
|
1279
1301
|
"expand"
|
|
1280
1302
|
];
|
|
1281
|
-
function
|
|
1303
|
+
function $t(e) {
|
|
1282
1304
|
console.warn(`[bygga-editor] ${e}`);
|
|
1283
1305
|
}
|
|
1284
|
-
function
|
|
1306
|
+
function en(e) {
|
|
1285
1307
|
if (!e) return [];
|
|
1286
|
-
if (typeof e.run != "function") return
|
|
1287
|
-
if (!Array.isArray(e.actions)) return
|
|
1308
|
+
if (typeof e.run != "function") return $t("config.ai: `run` must be a function — ignoring the AI configuration."), [];
|
|
1309
|
+
if (!Array.isArray(e.actions)) return $t("config.ai: `actions` must be an array — offering no AI actions."), [];
|
|
1288
1310
|
let t = /* @__PURE__ */ new Set();
|
|
1289
1311
|
for (let n of e.actions) {
|
|
1290
|
-
if (!
|
|
1291
|
-
|
|
1312
|
+
if (!Qt.includes(n)) {
|
|
1313
|
+
$t(`config.ai: "${String(n)}" is not a known AI action — ignoring it.`);
|
|
1292
1314
|
continue;
|
|
1293
1315
|
}
|
|
1294
1316
|
t.add(n);
|
|
1295
1317
|
}
|
|
1296
|
-
return e.actions.length > 0 && t.size === 0 &&
|
|
1318
|
+
return e.actions.length > 0 && t.size === 0 && $t("config.ai: no usable actions — offering no AI controls."), Qt.filter((e) => t.has(e));
|
|
1297
1319
|
}
|
|
1298
1320
|
//#endregion
|
|
1299
1321
|
//#region src/components/AiActionPicker.vue?vue&type=script&setup=true&lang.ts
|
|
1300
|
-
var
|
|
1322
|
+
var tn = [
|
|
1301
1323
|
"disabled",
|
|
1302
1324
|
"aria-busy",
|
|
1303
1325
|
"title",
|
|
1304
1326
|
"aria-label",
|
|
1305
1327
|
"popovertarget",
|
|
1306
1328
|
"aria-expanded"
|
|
1307
|
-
],
|
|
1329
|
+
], nn = ["id", "aria-label"], rn = { class: "ai-list" }, an = ["onClick"], on = { class: "ai-option-label" }, sn = { class: "ai-option-hint" }, cn = /*#__PURE__*/ I(/* @__PURE__ */ l({
|
|
1308
1330
|
__name: "AiActionPicker",
|
|
1309
1331
|
props: {
|
|
1310
1332
|
actions: { type: Array },
|
|
@@ -1315,7 +1337,7 @@ var Xt = [
|
|
|
1315
1337
|
},
|
|
1316
1338
|
emits: ["select"],
|
|
1317
1339
|
setup(t, { emit: r }) {
|
|
1318
|
-
let i = r, { t:
|
|
1340
|
+
let i = r, { t: a } = ge(), s = re(), c = v("trigger"), l = v("popover"), u = j(() => l.value?.matches(":popover-open") ?? !1);
|
|
1319
1341
|
function f(e) {
|
|
1320
1342
|
if (e.newState !== "open") return;
|
|
1321
1343
|
let t = l.value, n = c.value?.getBoundingClientRect();
|
|
@@ -1328,7 +1350,7 @@ var Xt = [
|
|
|
1328
1350
|
function ee(e) {
|
|
1329
1351
|
i("select", e), l.value?.hidePopover();
|
|
1330
1352
|
}
|
|
1331
|
-
return (r, i) => (
|
|
1353
|
+
return (r, i) => (o(), d(M, null, [t.actions.length ? (o(), d("button", {
|
|
1332
1354
|
key: 0,
|
|
1333
1355
|
ref_key: "trigger",
|
|
1334
1356
|
ref: c,
|
|
@@ -1336,16 +1358,16 @@ var Xt = [
|
|
|
1336
1358
|
class: T(["ai-trigger", { active: u.value }]),
|
|
1337
1359
|
disabled: t.pending,
|
|
1338
1360
|
"aria-busy": t.pending,
|
|
1339
|
-
title: C(
|
|
1340
|
-
"aria-label": C(
|
|
1361
|
+
title: C(a)("blocks.text.ai.label"),
|
|
1362
|
+
"aria-label": C(a)("blocks.text.ai.label"),
|
|
1341
1363
|
popovertarget: C(s),
|
|
1342
1364
|
"aria-haspopup": "dialog",
|
|
1343
1365
|
"aria-expanded": u.value,
|
|
1344
1366
|
onMousedown: i[0] ||= x(() => {}, ["prevent"])
|
|
1345
|
-
}, [e(
|
|
1367
|
+
}, [e(P, {
|
|
1346
1368
|
name: "sparkles",
|
|
1347
1369
|
size: 16
|
|
1348
|
-
})], 42,
|
|
1370
|
+
})], 42, tn)) : n("", !0), t.actions.length ? (o(), d("div", {
|
|
1349
1371
|
key: 1,
|
|
1350
1372
|
id: C(s),
|
|
1351
1373
|
ref_key: "popover",
|
|
@@ -1353,55 +1375,55 @@ var Xt = [
|
|
|
1353
1375
|
class: "ai-popover",
|
|
1354
1376
|
popover: "",
|
|
1355
1377
|
role: "dialog",
|
|
1356
|
-
"aria-label": C(
|
|
1378
|
+
"aria-label": C(a)("blocks.text.ai.label"),
|
|
1357
1379
|
onBeforetoggle: f,
|
|
1358
1380
|
onFocusout: p
|
|
1359
|
-
}, [m("ul",
|
|
1381
|
+
}, [m("ul", rn, [(o(!0), d(M, null, g(t.actions, (e) => (o(), d("li", { key: e }, [m("button", {
|
|
1360
1382
|
type: "button",
|
|
1361
1383
|
class: "ai-option",
|
|
1362
1384
|
onClick: (t) => ee(e),
|
|
1363
1385
|
onMousedown: i[1] ||= x(() => {}, ["prevent"])
|
|
1364
|
-
}, [m("span",
|
|
1386
|
+
}, [m("span", on, E(C(a)(`blocks.text.ai.actions.${e}.label`)), 1), m("span", sn, E(C(a)(`blocks.text.ai.actions.${e}.hint`)), 1)], 40, an)]))), 128))])], 40, nn)) : n("", !0)], 64));
|
|
1365
1387
|
}
|
|
1366
|
-
}), [["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"]]),
|
|
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"]]), ln = [
|
|
1367
1389
|
"title",
|
|
1368
1390
|
"aria-label",
|
|
1369
1391
|
"popovertarget",
|
|
1370
1392
|
"aria-expanded"
|
|
1371
|
-
],
|
|
1393
|
+
], un = ["id", "aria-label"], dn = {
|
|
1372
1394
|
key: 0,
|
|
1373
1395
|
class: "merge-tag-list"
|
|
1374
|
-
},
|
|
1396
|
+
}, fn = ["onClick"], pn = { class: "merge-tag-option-label" }, mn = { class: "merge-tag-option-id" }, hn = {
|
|
1375
1397
|
key: 1,
|
|
1376
1398
|
class: "merge-tag-empty"
|
|
1377
|
-
},
|
|
1399
|
+
}, gn = /*#__PURE__*/ I(/* @__PURE__ */ l({
|
|
1378
1400
|
__name: "MergeTagPicker",
|
|
1379
1401
|
emits: ["select"],
|
|
1380
1402
|
setup(t, { emit: r }) {
|
|
1381
|
-
let
|
|
1403
|
+
let a = r, { t: s, locale: c } = ge(), l = i(Je, j(() => ({}))), u = j(() => Ie(l.value).map((e) => ({
|
|
1382
1404
|
id: e,
|
|
1383
|
-
label:
|
|
1384
|
-
}))), f = S(""), p =
|
|
1405
|
+
label: Be(l.value, e, c.value)
|
|
1406
|
+
}))), f = S(""), p = j(() => {
|
|
1385
1407
|
let e = f.value.trim().toLowerCase();
|
|
1386
1408
|
return e ? u.value.filter((t) => t.label.toLowerCase().includes(e) || t.id.toLowerCase().includes(e)) : u.value;
|
|
1387
|
-
}), h =
|
|
1409
|
+
}), h = re(), _ = j(() => b.value?.matches(":popover-open") ?? !1), y = v("trigger"), b = v("popover"), w = v("filterInput");
|
|
1388
1410
|
function D(e) {
|
|
1389
1411
|
if (e.newState !== "open") return;
|
|
1390
1412
|
f.value = "";
|
|
1391
1413
|
let t = b.value, n = y.value?.getBoundingClientRect();
|
|
1392
1414
|
t && n && (t.style.left = `${n.left}px`, t.style.top = `${n.bottom + 4}px`);
|
|
1393
1415
|
}
|
|
1394
|
-
function
|
|
1416
|
+
function O(e) {
|
|
1395
1417
|
e.newState === "open" && ee(() => w.value?.focus());
|
|
1396
1418
|
}
|
|
1397
|
-
function
|
|
1419
|
+
function te(e) {
|
|
1398
1420
|
let t = e.relatedTarget, n = b.value;
|
|
1399
1421
|
t instanceof Node && n?.contains(t) || n?.matches(":popover-open") && n.hidePopover();
|
|
1400
1422
|
}
|
|
1401
|
-
function
|
|
1402
|
-
|
|
1423
|
+
function k(e) {
|
|
1424
|
+
a("select", e), b.value?.hidePopover();
|
|
1403
1425
|
}
|
|
1404
|
-
return (t, r) => (
|
|
1426
|
+
return (t, r) => (o(), d(M, null, [u.value.length ? (o(), d("button", {
|
|
1405
1427
|
key: 0,
|
|
1406
1428
|
ref_key: "trigger",
|
|
1407
1429
|
ref: y,
|
|
@@ -1413,10 +1435,10 @@ var Xt = [
|
|
|
1413
1435
|
"aria-haspopup": "dialog",
|
|
1414
1436
|
"aria-expanded": _.value,
|
|
1415
1437
|
onMousedown: r[0] ||= x(() => {}, ["prevent"])
|
|
1416
|
-
}, [e(
|
|
1438
|
+
}, [e(P, {
|
|
1417
1439
|
name: "braces",
|
|
1418
1440
|
size: 16
|
|
1419
|
-
})], 42,
|
|
1441
|
+
})], 42, ln)) : n("", !0), u.value.length ? (o(), d("div", {
|
|
1420
1442
|
key: 1,
|
|
1421
1443
|
id: C(h),
|
|
1422
1444
|
ref_key: "popover",
|
|
@@ -1426,9 +1448,9 @@ var Xt = [
|
|
|
1426
1448
|
role: "dialog",
|
|
1427
1449
|
"aria-label": C(s)("blocks.text.mergeTag"),
|
|
1428
1450
|
onBeforetoggle: D,
|
|
1429
|
-
onToggle:
|
|
1430
|
-
onFocusout:
|
|
1431
|
-
}, [e(
|
|
1451
|
+
onToggle: O,
|
|
1452
|
+
onFocusout: te
|
|
1453
|
+
}, [e(be, {
|
|
1432
1454
|
ref_key: "filterInput",
|
|
1433
1455
|
ref: w,
|
|
1434
1456
|
modelValue: f.value,
|
|
@@ -1441,19 +1463,19 @@ var Xt = [
|
|
|
1441
1463
|
"modelValue",
|
|
1442
1464
|
"placeholder",
|
|
1443
1465
|
"aria-label"
|
|
1444
|
-
]), p.value.length ? (
|
|
1466
|
+
]), p.value.length ? (o(), d("ul", dn, [(o(!0), d(M, null, g(p.value, (e) => (o(), d("li", { key: e.id }, [m("button", {
|
|
1445
1467
|
type: "button",
|
|
1446
1468
|
class: "merge-tag-option",
|
|
1447
|
-
onClick: (t) =>
|
|
1469
|
+
onClick: (t) => k(e.id),
|
|
1448
1470
|
onMousedown: r[2] ||= x(() => {}, ["prevent"])
|
|
1449
|
-
}, [m("span",
|
|
1471
|
+
}, [m("span", pn, E(e.label), 1), m("span", mn, E(e.id), 1)], 40, fn)]))), 128))])) : (o(), d("p", hn, E(C(s)("blocks.text.mergeTagEmpty")), 1))], 40, un)) : n("", !0)], 64));
|
|
1450
1472
|
}
|
|
1451
|
-
}), [["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"]]),
|
|
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"]]), _n = /* @__PURE__ */ l({
|
|
1452
1474
|
__name: "MergeTagView",
|
|
1453
|
-
props:
|
|
1475
|
+
props: Yt,
|
|
1454
1476
|
setup(e) {
|
|
1455
|
-
let t = e, { t: n, locale:
|
|
1456
|
-
return (e, t) => (
|
|
1477
|
+
let t = e, { t: n, locale: a } = ge(), s = i(Je, j(() => ({}))), c = j(() => String(t.node.attrs.id ?? "")), l = j(() => s.value[c.value] !== void 0), u = j(() => Be(s.value, c.value, a.value)), d = j(() => n("blocks.text.mergeTagChip", { name: u.value }));
|
|
1478
|
+
return (e, t) => (o(), r(C(Kt), {
|
|
1457
1479
|
as: "span",
|
|
1458
1480
|
class: T(["merge-tag", { "is-unknown": !l.value }]),
|
|
1459
1481
|
"data-merge-tag": c.value,
|
|
@@ -1462,7 +1484,7 @@ var Xt = [
|
|
|
1462
1484
|
"aria-label": d.value,
|
|
1463
1485
|
title: d.value
|
|
1464
1486
|
}, {
|
|
1465
|
-
default: p(() => [
|
|
1487
|
+
default: p(() => [O(E(u.value), 1)]),
|
|
1466
1488
|
_: 1
|
|
1467
1489
|
}, 8, [
|
|
1468
1490
|
"class",
|
|
@@ -1474,86 +1496,86 @@ var Xt = [
|
|
|
1474
1496
|
});
|
|
1475
1497
|
//#endregion
|
|
1476
1498
|
//#region src/fontSizes.ts
|
|
1477
|
-
function
|
|
1499
|
+
function vn(e) {
|
|
1478
1500
|
return `${e}px`;
|
|
1479
1501
|
}
|
|
1480
|
-
var
|
|
1481
|
-
function
|
|
1502
|
+
var yn = new Set(We.map(vn));
|
|
1503
|
+
function bn(e) {
|
|
1482
1504
|
let t = e.trim();
|
|
1483
|
-
return
|
|
1505
|
+
return yn.has(t) ? t : null;
|
|
1484
1506
|
}
|
|
1485
|
-
function
|
|
1486
|
-
return
|
|
1507
|
+
function xn(e) {
|
|
1508
|
+
return yn.has(e);
|
|
1487
1509
|
}
|
|
1488
1510
|
//#endregion
|
|
1489
1511
|
//#region src/panels/contentPanel/components/blocks/sanitizePastedFonts.ts
|
|
1490
|
-
var
|
|
1491
|
-
function
|
|
1492
|
-
let t =
|
|
1512
|
+
var Sn = "textStyle";
|
|
1513
|
+
function Cn(e) {
|
|
1514
|
+
let t = Re(e);
|
|
1493
1515
|
return !t || t.key === "verdana" ? null : t.stack;
|
|
1494
1516
|
}
|
|
1495
|
-
function
|
|
1496
|
-
if (e.type.name !==
|
|
1517
|
+
function wn(e, t) {
|
|
1518
|
+
if (e.type.name !== Sn) return e;
|
|
1497
1519
|
let n = { ...e.attrs };
|
|
1498
|
-
return typeof n.fontFamily == "string" && !t?.has(n.fontFamily) && (n.fontFamily =
|
|
1520
|
+
return typeof n.fontFamily == "string" && !t?.has(n.fontFamily) && (n.fontFamily = Cn(n.fontFamily)), typeof n.fontSize == "string" && (n.fontSize = bn(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;
|
|
1499
1521
|
}
|
|
1500
|
-
function
|
|
1522
|
+
function Tn(e, t) {
|
|
1501
1523
|
return e.flatMap((e) => {
|
|
1502
|
-
let n =
|
|
1524
|
+
let n = wn(e, t);
|
|
1503
1525
|
return n ? [n] : [];
|
|
1504
1526
|
});
|
|
1505
1527
|
}
|
|
1506
|
-
function
|
|
1507
|
-
return e.isText ? e.mark(
|
|
1528
|
+
function En(e, t) {
|
|
1529
|
+
return e.isText ? e.mark(Tn(e.marks, t)) : e.copy(Dn(e.content, t)).mark(Tn(e.marks, t));
|
|
1508
1530
|
}
|
|
1509
|
-
function
|
|
1531
|
+
function Dn(e, t) {
|
|
1510
1532
|
let n = [];
|
|
1511
|
-
for (let r = 0; r < e.childCount; r++) n.push(
|
|
1512
|
-
return
|
|
1533
|
+
for (let r = 0; r < e.childCount; r++) n.push(En(e.child(r), t));
|
|
1534
|
+
return Ae.fromArray(n);
|
|
1513
1535
|
}
|
|
1514
|
-
function
|
|
1515
|
-
return new
|
|
1536
|
+
function On(e, t) {
|
|
1537
|
+
return new N(Dn(e.content, t), e.openStart, e.openEnd);
|
|
1516
1538
|
}
|
|
1517
1539
|
//#endregion
|
|
1518
1540
|
//#region src/panels/contentPanel/components/blocks/TextEditor.vue?vue&type=script&setup=true&lang.ts
|
|
1519
|
-
var
|
|
1541
|
+
var kn = { class: "picker" }, An = ["aria-label", "value"], jn = {
|
|
1520
1542
|
key: 0,
|
|
1521
1543
|
value: "paragraph"
|
|
1522
|
-
},
|
|
1544
|
+
}, Mn = ["value"], Nn = { class: "picker" }, Pn = ["aria-label", "value"], Fn = {
|
|
1523
1545
|
value: "mixed",
|
|
1524
1546
|
disabled: "",
|
|
1525
1547
|
hidden: ""
|
|
1526
|
-
},
|
|
1548
|
+
}, In = ["value"], Ln = ["value"], Rn = { class: "picker" }, zn = ["aria-label", "value"], Bn = {
|
|
1527
1549
|
value: "mixed",
|
|
1528
1550
|
disabled: "",
|
|
1529
1551
|
hidden: ""
|
|
1530
|
-
},
|
|
1552
|
+
}, Vn = { value: "" }, Hn = ["value"], Un = ["title", "aria-label"], Wn = ["title", "aria-label"], Gn = ["title", "aria-label"], Kn = [
|
|
1531
1553
|
"title",
|
|
1532
1554
|
"popovertarget",
|
|
1533
1555
|
"aria-expanded"
|
|
1534
|
-
],
|
|
1556
|
+
], qn = ["id", "aria-label"], Jn = { class: "link-field" }, Yn = {
|
|
1535
1557
|
key: 0,
|
|
1536
1558
|
class: "link-anchor"
|
|
1537
|
-
},
|
|
1559
|
+
}, Xn = {
|
|
1538
1560
|
key: 0,
|
|
1539
1561
|
value: ""
|
|
1540
|
-
},
|
|
1562
|
+
}, Zn = {
|
|
1541
1563
|
key: 1,
|
|
1542
1564
|
value: "",
|
|
1543
1565
|
disabled: "",
|
|
1544
1566
|
hidden: ""
|
|
1545
|
-
},
|
|
1567
|
+
}, Qn = ["value"], $n = ["title", "aria-label"], er = ["title", "onClick"], tr = {
|
|
1546
1568
|
"aria-hidden": "true",
|
|
1547
1569
|
height: "16",
|
|
1548
1570
|
viewBox: "0 0 16 16",
|
|
1549
1571
|
width: "16"
|
|
1550
|
-
},
|
|
1572
|
+
}, nr = [
|
|
1551
1573
|
"width",
|
|
1552
1574
|
"x",
|
|
1553
1575
|
"y"
|
|
1554
|
-
],
|
|
1576
|
+
], rr = 8, ir = 220, ar = /*#__PURE__*/ I(/* @__PURE__ */ l({
|
|
1555
1577
|
__name: "TextEditor",
|
|
1556
|
-
props: /*@__PURE__*/
|
|
1578
|
+
props: /*@__PURE__*/ s({
|
|
1557
1579
|
editable: {
|
|
1558
1580
|
type: Boolean,
|
|
1559
1581
|
default: !1
|
|
@@ -1563,158 +1585,196 @@ var wn = { class: "picker" }, Tn = ["aria-label", "value"], En = {
|
|
|
1563
1585
|
borderRadius: { type: null },
|
|
1564
1586
|
border: { type: null },
|
|
1565
1587
|
height: { type: Number },
|
|
1588
|
+
width: { type: null },
|
|
1589
|
+
align: { type: null },
|
|
1590
|
+
paragraphSpacing: { type: Number },
|
|
1566
1591
|
headerOnly: { type: Boolean },
|
|
1567
1592
|
availableWidth: { type: Number },
|
|
1568
1593
|
outerVmlBackground: { type: Boolean }
|
|
1569
1594
|
}, {
|
|
1570
1595
|
text: { required: !0 },
|
|
1571
|
-
textModifiers: {}
|
|
1596
|
+
textModifiers: {},
|
|
1597
|
+
fitSize: {},
|
|
1598
|
+
fitSizeModifiers: {}
|
|
1572
1599
|
}),
|
|
1573
|
-
emits: ["update:text"],
|
|
1574
|
-
setup(
|
|
1575
|
-
let
|
|
1600
|
+
emits: ["update:text", "update:fitSize"],
|
|
1601
|
+
setup(r) {
|
|
1602
|
+
let a = c(r, "text"), s = c(r, "fitSize"), l = r, { t: u, locale: f } = ge(), h = [
|
|
1576
1603
|
"left",
|
|
1577
1604
|
"center",
|
|
1578
1605
|
"right",
|
|
1579
1606
|
"justify"
|
|
1580
|
-
],
|
|
1581
|
-
...
|
|
1607
|
+
], y = j(() => u(l.headerOnly ? "blocks.header.label" : "blocks.text.label")), w = qt({
|
|
1608
|
+
...He,
|
|
1582
1609
|
editorProps: {
|
|
1583
1610
|
attributes: {
|
|
1584
|
-
"aria-label":
|
|
1611
|
+
"aria-label": y.value,
|
|
1585
1612
|
"aria-multiline": "true",
|
|
1586
1613
|
role: "textbox"
|
|
1587
1614
|
},
|
|
1588
|
-
transformPasted: (e) =>
|
|
1615
|
+
transformPasted: (e) => On(e, me.value)
|
|
1589
1616
|
},
|
|
1590
|
-
content:
|
|
1591
|
-
editable:
|
|
1617
|
+
content: xe(a.value),
|
|
1618
|
+
editable: l.editable,
|
|
1592
1619
|
extensions: [
|
|
1593
|
-
...(
|
|
1594
|
-
|
|
1595
|
-
|
|
1620
|
+
...(l.headerOnly ? Le : ye).map((e) => e.name === "mergeTag" ? e.extend({ addNodeView: () => Zt(_n) }) : e),
|
|
1621
|
+
Ht,
|
|
1622
|
+
zt.configure({ placeholder: () => u(l.headerOnly ? "blocks.header.placeholder" : "blocks.text.placeholder") })
|
|
1596
1623
|
],
|
|
1597
1624
|
onUpdate({ editor: e }) {
|
|
1598
|
-
|
|
1625
|
+
a.value = Me(e.getJSON()), le();
|
|
1599
1626
|
},
|
|
1600
1627
|
onSelectionUpdate() {
|
|
1601
|
-
|
|
1628
|
+
le();
|
|
1602
1629
|
}
|
|
1603
1630
|
});
|
|
1604
|
-
_(
|
|
1605
|
-
|
|
1606
|
-
}), _(
|
|
1607
|
-
let t =
|
|
1608
|
-
!t ||
|
|
1609
|
-
}), _(() =>
|
|
1610
|
-
let
|
|
1611
|
-
function
|
|
1612
|
-
let e =
|
|
1613
|
-
!
|
|
1631
|
+
_(y, (e) => {
|
|
1632
|
+
w.value?.setOptions({ editorProps: { attributes: { "aria-label": e } } });
|
|
1633
|
+
}), _(a, (e) => {
|
|
1634
|
+
let t = w.value;
|
|
1635
|
+
!t || Ke(e, Me(t.getJSON())) || t.commands.setContent(xe(e), { emitUpdate: !1 });
|
|
1636
|
+
}), _(() => l.editable, (e) => w.value?.setEditable(e));
|
|
1637
|
+
let D = v("root"), O = v("toolbar"), te = v("content");
|
|
1638
|
+
function k() {
|
|
1639
|
+
let e = te.value?.$el;
|
|
1640
|
+
if (!(l.editable && e)) return;
|
|
1641
|
+
if (l.width !== "fit") {
|
|
1642
|
+
s.value !== void 0 && (s.value = void 0);
|
|
1643
|
+
return;
|
|
1644
|
+
}
|
|
1645
|
+
let t = e.getBoundingClientRect(), n = {
|
|
1646
|
+
width: Math.ceil(t.width),
|
|
1647
|
+
height: Math.ceil(t.height)
|
|
1648
|
+
};
|
|
1649
|
+
if (n.width < 1 || n.height < 1) return;
|
|
1650
|
+
let r = s.value;
|
|
1651
|
+
(r?.width !== n.width || r.height !== n.height) && (s.value = n);
|
|
1652
|
+
}
|
|
1653
|
+
let A, N;
|
|
1654
|
+
function F() {
|
|
1655
|
+
let e = te.value?.$el;
|
|
1656
|
+
!(A && e) || e === N || (N && A.unobserve(N), A.observe(e), N = e);
|
|
1657
|
+
}
|
|
1658
|
+
function I() {
|
|
1659
|
+
ee(() => {
|
|
1660
|
+
F(), k();
|
|
1661
|
+
});
|
|
1662
|
+
}
|
|
1663
|
+
t(() => {
|
|
1664
|
+
!l.editable || typeof ResizeObserver > "u" || (A = new ResizeObserver(k), I());
|
|
1665
|
+
}), oe(() => A?.disconnect()), _(() => [
|
|
1666
|
+
l.width,
|
|
1667
|
+
l.paragraphSpacing,
|
|
1668
|
+
l.padding,
|
|
1669
|
+
a.value
|
|
1670
|
+
], I);
|
|
1671
|
+
function se() {
|
|
1672
|
+
let e = O.value;
|
|
1673
|
+
!e || e.matches(":popover-open") || (e.showPopover(), le());
|
|
1614
1674
|
}
|
|
1615
|
-
function
|
|
1675
|
+
function ce(e) {
|
|
1616
1676
|
let t = e.relatedTarget;
|
|
1617
|
-
t instanceof Node &&
|
|
1677
|
+
t instanceof Node && D.value?.contains(t) || O.value?.matches(":popover-open") && O.value.hidePopover();
|
|
1618
1678
|
}
|
|
1619
|
-
function
|
|
1620
|
-
let e =
|
|
1679
|
+
function le() {
|
|
1680
|
+
let e = w.value?.view, t = O.value, n = D.value;
|
|
1621
1681
|
if (!(e && t && n && t.matches(":popover-open"))) return;
|
|
1622
|
-
let r = n.closest(".block-container"), i = (r?.querySelector(":scope > .block-label") ?? r ?? n).getBoundingClientRect(), a = Math.max(
|
|
1623
|
-
t.style.left = `${o}px`, t.style.maxWidth = `${window.innerWidth - o -
|
|
1682
|
+
let r = n.closest(".block-container"), i = (r?.querySelector(":scope > .block-label") ?? r ?? n).getBoundingClientRect(), a = Math.max(rr, window.innerWidth - ir - rr), o = Math.min(Math.max(i.left, rr), a);
|
|
1683
|
+
t.style.left = `${o}px`, t.style.maxWidth = `${window.innerWidth - o - rr}px`, t.style.top = `${i.top}px`;
|
|
1624
1684
|
}
|
|
1625
|
-
function
|
|
1626
|
-
let e =
|
|
1627
|
-
if (!e) return
|
|
1628
|
-
let t =
|
|
1685
|
+
function ue() {
|
|
1686
|
+
let e = w.value;
|
|
1687
|
+
if (!e) return l.headerOnly ? "h1" : "paragraph";
|
|
1688
|
+
let t = he.find((t) => e.isActive("heading", { level: t }));
|
|
1629
1689
|
return t ? `h${t}` : "paragraph";
|
|
1630
1690
|
}
|
|
1631
|
-
function
|
|
1691
|
+
function de(e) {
|
|
1632
1692
|
let { target: t } = e;
|
|
1633
1693
|
if (!(t instanceof HTMLSelectElement)) return;
|
|
1634
|
-
let n =
|
|
1694
|
+
let n = w.value?.chain().focus();
|
|
1635
1695
|
if (!n) return;
|
|
1636
|
-
let r =
|
|
1637
|
-
r ? n.setHeading({ level: r }).run() :
|
|
1696
|
+
let r = he.find((e) => `h${e}` === t.value);
|
|
1697
|
+
r ? n.setHeading({ level: r }).run() : l.headerOnly || n.setParagraph().run();
|
|
1638
1698
|
}
|
|
1639
|
-
let
|
|
1640
|
-
function
|
|
1699
|
+
let L = i(b, j(() => Ce)), R = ve(), me = j(() => new Set(R.value.map((e) => e.stack)));
|
|
1700
|
+
function z(e) {
|
|
1641
1701
|
return `custom:${e}`;
|
|
1642
1702
|
}
|
|
1643
|
-
function
|
|
1644
|
-
if (typeof e != "string") return
|
|
1645
|
-
let t =
|
|
1646
|
-
return t ?
|
|
1703
|
+
function B(e) {
|
|
1704
|
+
if (typeof e != "string") return L.value;
|
|
1705
|
+
let t = R.value.find((t) => t.stack === e);
|
|
1706
|
+
return t ? z(t.name) : Re(e)?.key ?? L.value;
|
|
1647
1707
|
}
|
|
1648
|
-
function
|
|
1649
|
-
let e =
|
|
1650
|
-
if (!e) return
|
|
1708
|
+
function we() {
|
|
1709
|
+
let e = w.value;
|
|
1710
|
+
if (!e) return L.value;
|
|
1651
1711
|
let { from: t, to: n, empty: r } = e.state.selection;
|
|
1652
|
-
if (r) return
|
|
1712
|
+
if (r) return B(e.getAttributes("textStyle").fontFamily);
|
|
1653
1713
|
let i = /* @__PURE__ */ new Set();
|
|
1654
1714
|
e.state.doc.nodesBetween(t, n, (e) => {
|
|
1655
1715
|
if (!e.isText) return;
|
|
1656
1716
|
let t = e.marks.find((e) => e.type.name === "textStyle");
|
|
1657
|
-
i.add(
|
|
1717
|
+
i.add(B(t?.attrs.fontFamily));
|
|
1658
1718
|
});
|
|
1659
1719
|
let a = Array.from(i);
|
|
1660
|
-
return a.length > 1 ? "mixed" : a[0] ??
|
|
1720
|
+
return a.length > 1 ? "mixed" : a[0] ?? L.value;
|
|
1661
1721
|
}
|
|
1662
|
-
function
|
|
1722
|
+
function De(e) {
|
|
1663
1723
|
let { target: t } = e;
|
|
1664
1724
|
if (!(t instanceof HTMLSelectElement)) return;
|
|
1665
|
-
let n = t.value, r =
|
|
1725
|
+
let n = t.value, r = w.value?.chain().focus();
|
|
1666
1726
|
if (!r) return;
|
|
1667
|
-
let i =
|
|
1727
|
+
let i = R.value.find((e) => z(e.name) === n);
|
|
1668
1728
|
if (i) {
|
|
1669
1729
|
r.setFontFamily(i.stack).run();
|
|
1670
1730
|
return;
|
|
1671
1731
|
}
|
|
1672
|
-
|
|
1732
|
+
Oe(n) && (n === L.value ? r.unsetFontFamily().run() : r.setFontFamily(Pe(n)).run());
|
|
1673
1733
|
}
|
|
1674
|
-
function
|
|
1675
|
-
return typeof e == "string" &&
|
|
1734
|
+
function ke(e) {
|
|
1735
|
+
return typeof e == "string" && xn(e) ? e : "";
|
|
1676
1736
|
}
|
|
1677
|
-
function
|
|
1678
|
-
let e =
|
|
1737
|
+
function Ae() {
|
|
1738
|
+
let e = w.value;
|
|
1679
1739
|
if (!e) return "";
|
|
1680
1740
|
let { from: t, to: n, empty: r } = e.state.selection;
|
|
1681
|
-
if (r) return
|
|
1741
|
+
if (r) return ke(e.getAttributes("textStyle").fontSize);
|
|
1682
1742
|
let i = /* @__PURE__ */ new Set();
|
|
1683
1743
|
e.state.doc.nodesBetween(t, n, (e) => {
|
|
1684
1744
|
if (!e.isText) return;
|
|
1685
1745
|
let t = e.marks.find((e) => e.type.name === "textStyle");
|
|
1686
|
-
i.add(
|
|
1746
|
+
i.add(ke(t?.attrs.fontSize));
|
|
1687
1747
|
});
|
|
1688
1748
|
let a = Array.from(i);
|
|
1689
1749
|
return a.length > 1 ? "mixed" : a[0] ?? "";
|
|
1690
1750
|
}
|
|
1691
|
-
function
|
|
1751
|
+
function Fe(e) {
|
|
1692
1752
|
let { target: t } = e;
|
|
1693
1753
|
if (!(t instanceof HTMLSelectElement)) return;
|
|
1694
|
-
let n =
|
|
1695
|
-
n && (t.value === "" ? n.unsetFontSize().run() :
|
|
1754
|
+
let n = w.value?.chain().focus();
|
|
1755
|
+
n && (t.value === "" ? n.unsetFontSize().run() : xn(t.value) && n.setFontSize(t.value).run());
|
|
1696
1756
|
}
|
|
1697
|
-
let
|
|
1698
|
-
let e =
|
|
1699
|
-
return
|
|
1700
|
-
}),
|
|
1757
|
+
let Ie = Ve(() => {
|
|
1758
|
+
let e = we();
|
|
1759
|
+
return Oe(e) ? e : void 0;
|
|
1760
|
+
}), ze = j({
|
|
1701
1761
|
get: () => {
|
|
1702
|
-
let e =
|
|
1762
|
+
let e = w.value?.getAttributes("textStyle").color, t = typeof e == "string" ? _e(e) : void 0;
|
|
1703
1763
|
return t ? {
|
|
1704
1764
|
type: "color",
|
|
1705
1765
|
...t
|
|
1706
|
-
} :
|
|
1766
|
+
} : Ee;
|
|
1707
1767
|
},
|
|
1708
1768
|
set: (e) => {
|
|
1709
|
-
e.type !== "transparent" &&
|
|
1769
|
+
e.type !== "transparent" && w.value?.chain().setColor(pe(e)).run();
|
|
1710
1770
|
}
|
|
1711
|
-
}),
|
|
1771
|
+
}), Be = {
|
|
1712
1772
|
left: "blocks.text.alignLeft",
|
|
1713
1773
|
center: "blocks.text.alignCenter",
|
|
1714
1774
|
right: "blocks.text.alignRight",
|
|
1715
1775
|
justify: "blocks.text.alignJustify"
|
|
1716
1776
|
};
|
|
1717
|
-
function
|
|
1777
|
+
function qe(e) {
|
|
1718
1778
|
return (e === "justify" ? [
|
|
1719
1779
|
14,
|
|
1720
1780
|
14,
|
|
@@ -1734,47 +1794,47 @@ var wn = { class: "picker" }, Tn = ["aria-label", "value"], En = {
|
|
|
1734
1794
|
};
|
|
1735
1795
|
});
|
|
1736
1796
|
}
|
|
1737
|
-
let
|
|
1738
|
-
function
|
|
1797
|
+
let Je = re(), V = v("linkPopover"), H = v("linkInput"), U = v("linkTrigger"), W = S(""), Ye = S(!1), Ze = S(!1);
|
|
1798
|
+
function Qe(e) {
|
|
1739
1799
|
if (e.newState !== "open") return;
|
|
1740
|
-
let t =
|
|
1741
|
-
|
|
1742
|
-
let n =
|
|
1800
|
+
let t = w.value?.getAttributes("link")?.href;
|
|
1801
|
+
W.value = typeof t == "string" ? t : "", Ze.value = W.value !== "";
|
|
1802
|
+
let n = V.value, r = U.value?.getBoundingClientRect();
|
|
1743
1803
|
n && r && (n.style.left = `${r.left}px`, n.style.top = `${r.bottom + 4}px`);
|
|
1744
1804
|
}
|
|
1745
|
-
function
|
|
1746
|
-
if (
|
|
1747
|
-
let t =
|
|
1805
|
+
function G(e) {
|
|
1806
|
+
if (Ye.value = e.newState === "open", e.newState !== "open") return;
|
|
1807
|
+
let t = V.value;
|
|
1748
1808
|
if (t) {
|
|
1749
1809
|
let e = window.innerWidth - t.offsetWidth - 8;
|
|
1750
1810
|
Number.parseFloat(t.style.left) > e && (t.style.left = `${Math.max(8, e)}px`);
|
|
1751
1811
|
}
|
|
1752
1812
|
ee(() => {
|
|
1753
|
-
|
|
1813
|
+
H.value?.focus(), H.value?.select();
|
|
1754
1814
|
});
|
|
1755
1815
|
}
|
|
1756
|
-
function
|
|
1757
|
-
let t = e.relatedTarget, n =
|
|
1816
|
+
function $e(e) {
|
|
1817
|
+
let t = e.relatedTarget, n = V.value;
|
|
1758
1818
|
t instanceof Node && n?.contains(t) || n?.hidePopover();
|
|
1759
1819
|
}
|
|
1760
|
-
function
|
|
1761
|
-
let e =
|
|
1820
|
+
function et() {
|
|
1821
|
+
let e = w.value?.chain().focus();
|
|
1762
1822
|
if (!e) return;
|
|
1763
|
-
let t =
|
|
1823
|
+
let t = Ue(W.value);
|
|
1764
1824
|
t === "" ? e.unsetLink().run() : e.setLink({
|
|
1765
1825
|
href: t,
|
|
1766
1826
|
target: t.startsWith("#") ? null : "_blank"
|
|
1767
|
-
}).run(),
|
|
1827
|
+
}).run(), V.value?.hidePopover();
|
|
1768
1828
|
}
|
|
1769
|
-
let
|
|
1770
|
-
function
|
|
1771
|
-
e === "" ?
|
|
1829
|
+
let tt = i(ie, j(() => [])), nt = j(() => W.value.startsWith("#") && tt.value.includes(W.value.slice(1)) ? W.value.slice(1) : "");
|
|
1830
|
+
function rt(e) {
|
|
1831
|
+
e === "" ? W.value.startsWith("#") && (W.value = "") : W.value = `#${e}`;
|
|
1772
1832
|
}
|
|
1773
|
-
function
|
|
1774
|
-
|
|
1833
|
+
function it() {
|
|
1834
|
+
w.value?.chain().focus().unsetLink().run(), V.value?.hidePopover();
|
|
1775
1835
|
}
|
|
1776
|
-
let
|
|
1777
|
-
function
|
|
1836
|
+
let K = i(Te), at = fe(), ot = j(() => en(K?.value?.ai)), q = S(!1);
|
|
1837
|
+
function st(e) {
|
|
1778
1838
|
let { from: t, to: n, empty: r } = e.state.selection;
|
|
1779
1839
|
if (!r) return {
|
|
1780
1840
|
from: t,
|
|
@@ -1786,16 +1846,16 @@ var wn = { class: "picker" }, Tn = ["aria-label", "value"], En = {
|
|
|
1786
1846
|
to: i.content.size
|
|
1787
1847
|
};
|
|
1788
1848
|
}
|
|
1789
|
-
let
|
|
1790
|
-
function
|
|
1849
|
+
let J = (e, t, n) => e.state.doc.textBetween(t, n, " ", (e) => e.type.name === "mergeTag" ? `{{${e.attrs.id}}}` : ""), ct = /\{\{([A-Za-z0-9._-]+)\}\}/g;
|
|
1850
|
+
function lt(e) {
|
|
1791
1851
|
let t = [], n = 0;
|
|
1792
|
-
for (let r of e.matchAll(
|
|
1852
|
+
for (let r of e.matchAll(ct)) {
|
|
1793
1853
|
let i = r[1];
|
|
1794
1854
|
i !== void 0 && (r.index > n && t.push({
|
|
1795
1855
|
type: "text",
|
|
1796
1856
|
text: e.slice(n, r.index)
|
|
1797
1857
|
}), t.push({
|
|
1798
|
-
type:
|
|
1858
|
+
type: Ne,
|
|
1799
1859
|
attrs: { id: i }
|
|
1800
1860
|
}), n = r.index + r[0].length);
|
|
1801
1861
|
}
|
|
@@ -1804,231 +1864,247 @@ var wn = { class: "picker" }, Tn = ["aria-label", "value"], En = {
|
|
|
1804
1864
|
text: e.slice(n)
|
|
1805
1865
|
}), t;
|
|
1806
1866
|
}
|
|
1807
|
-
async function
|
|
1808
|
-
let t =
|
|
1809
|
-
if (!(t && n) ||
|
|
1810
|
-
let { from: r, to: i } =
|
|
1867
|
+
async function ut(e) {
|
|
1868
|
+
let t = w.value, n = K?.value?.ai;
|
|
1869
|
+
if (!(t && n) || q.value) return;
|
|
1870
|
+
let { from: r, to: i } = st(t), a = J(t, r, i);
|
|
1811
1871
|
if (a.trim() !== "") {
|
|
1812
|
-
|
|
1872
|
+
q.value = !0;
|
|
1813
1873
|
try {
|
|
1814
1874
|
let t = await n.run({
|
|
1815
1875
|
action: e,
|
|
1816
1876
|
text: a,
|
|
1817
|
-
locale:
|
|
1877
|
+
locale: f.value
|
|
1818
1878
|
});
|
|
1819
|
-
typeof t == "string" && t !== "" &&
|
|
1879
|
+
typeof t == "string" && t !== "" && w.value && w.value.chain().focus().insertContentAt({
|
|
1820
1880
|
from: r,
|
|
1821
1881
|
to: i
|
|
1822
|
-
},
|
|
1882
|
+
}, lt(t)).run();
|
|
1823
1883
|
} catch (e) {
|
|
1824
|
-
console.error("[bygga-editor] the AI action failed —", e),
|
|
1884
|
+
console.error("[bygga-editor] the AI action failed —", e), at?.show(u("blocks.text.ai.failed"));
|
|
1825
1885
|
} finally {
|
|
1826
|
-
|
|
1886
|
+
q.value = !1;
|
|
1827
1887
|
}
|
|
1828
1888
|
}
|
|
1829
1889
|
}
|
|
1830
|
-
function
|
|
1831
|
-
|
|
1832
|
-
type:
|
|
1890
|
+
function Y(e) {
|
|
1891
|
+
w.value?.chain().focus().insertContent({
|
|
1892
|
+
type: Ne,
|
|
1833
1893
|
attrs: { id: e }
|
|
1834
1894
|
}).run();
|
|
1835
1895
|
}
|
|
1836
|
-
return (t, r) => (
|
|
1896
|
+
return (t, r) => (o(), d("div", {
|
|
1837
1897
|
ref_key: "root",
|
|
1838
|
-
ref:
|
|
1898
|
+
ref: D,
|
|
1839
1899
|
style: {
|
|
1840
1900
|
position: "relative",
|
|
1841
1901
|
width: "100%"
|
|
1842
1902
|
},
|
|
1843
|
-
onFocusin:
|
|
1844
|
-
onFocusout:
|
|
1845
|
-
}, [e(C(
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
}
|
|
1903
|
+
onFocusin: se,
|
|
1904
|
+
onFocusout: ce
|
|
1905
|
+
}, [e(C(Xe), {
|
|
1906
|
+
width: l.width,
|
|
1907
|
+
align: l.align
|
|
1908
|
+
}, {
|
|
1909
|
+
default: p(() => [e(C(Gt), {
|
|
1910
|
+
ref_key: "content",
|
|
1911
|
+
ref: te,
|
|
1912
|
+
class: T({
|
|
1913
|
+
"text-input": l.editable,
|
|
1914
|
+
"text-spaced": l.paragraphSpacing !== void 0
|
|
1915
|
+
}),
|
|
1916
|
+
editor: C(w),
|
|
1917
|
+
style: ne([C(Se)(l), l.paragraphSpacing === void 0 ? void 0 : { "--bygga-paragraph-spacing": `${l.paragraphSpacing}px` }])
|
|
1918
|
+
}, null, 8, [
|
|
1919
|
+
"class",
|
|
1920
|
+
"editor",
|
|
1921
|
+
"style"
|
|
1922
|
+
])]),
|
|
1923
|
+
_: 1
|
|
1924
|
+
}, 8, ["width", "align"]), l.editable ? (o(), d("div", {
|
|
1849
1925
|
key: 0,
|
|
1850
1926
|
ref_key: "toolbar",
|
|
1851
|
-
ref:
|
|
1927
|
+
ref: O,
|
|
1852
1928
|
popover: "manual",
|
|
1853
1929
|
class: "toolbar"
|
|
1854
1930
|
}, [
|
|
1855
|
-
m("span",
|
|
1856
|
-
"aria-label": C(
|
|
1931
|
+
m("span", kn, [m("select", {
|
|
1932
|
+
"aria-label": C(u)("blocks.text.styleLabel"),
|
|
1857
1933
|
class: "style",
|
|
1858
|
-
value:
|
|
1859
|
-
onChange:
|
|
1934
|
+
value: ue(),
|
|
1935
|
+
onChange: de,
|
|
1860
1936
|
onMousedown: r[0] ||= x(() => {}, ["stop"])
|
|
1861
|
-
}, [
|
|
1937
|
+
}, [l.headerOnly ? n("", !0) : (o(), d("option", jn, E(C(u)("blocks.text.styleNormal")), 1)), (o(!0), d(M, null, g(C(he), (e) => (o(), d("option", {
|
|
1862
1938
|
key: e,
|
|
1863
1939
|
value: `h${e}`
|
|
1864
|
-
}, E(C(
|
|
1940
|
+
}, E(C(u)("blocks.text.styleHeading", { level: e })), 9, Mn))), 128))], 40, An), e(P, {
|
|
1865
1941
|
class: "picker-chevron",
|
|
1866
1942
|
name: "chevron-down",
|
|
1867
1943
|
size: 12
|
|
1868
1944
|
})]),
|
|
1869
1945
|
r[20] ||= m("span", { class: "divider" }, null, -1),
|
|
1870
|
-
m("span",
|
|
1871
|
-
"aria-label": C(
|
|
1946
|
+
m("span", Nn, [m("select", {
|
|
1947
|
+
"aria-label": C(u)("blocks.text.font"),
|
|
1872
1948
|
class: "font",
|
|
1873
|
-
value:
|
|
1874
|
-
onChange:
|
|
1949
|
+
value: we(),
|
|
1950
|
+
onChange: De,
|
|
1875
1951
|
onMousedown: r[1] ||= x(() => {}, ["stop"])
|
|
1876
1952
|
}, [
|
|
1877
|
-
m("option",
|
|
1878
|
-
(
|
|
1953
|
+
m("option", Fn, E(C(u)("blocks.text.fontMixed")), 1),
|
|
1954
|
+
(o(!0), d(M, null, g(C(Ie), (e) => (o(), d("option", {
|
|
1879
1955
|
key: e.key,
|
|
1880
1956
|
value: e.key
|
|
1881
|
-
}, E(e.name), 9,
|
|
1882
|
-
(
|
|
1883
|
-
key:
|
|
1884
|
-
value:
|
|
1885
|
-
}, E(e.name), 9,
|
|
1886
|
-
], 40,
|
|
1957
|
+
}, E(e.name), 9, In))), 128)),
|
|
1958
|
+
(o(!0), d(M, null, g(C(R), (e) => (o(), d("option", {
|
|
1959
|
+
key: z(e.name),
|
|
1960
|
+
value: z(e.name)
|
|
1961
|
+
}, E(e.name), 9, Ln))), 128))
|
|
1962
|
+
], 40, Pn), e(P, {
|
|
1887
1963
|
class: "picker-chevron",
|
|
1888
1964
|
name: "chevron-down",
|
|
1889
1965
|
size: 12
|
|
1890
1966
|
})]),
|
|
1891
|
-
m("span",
|
|
1892
|
-
"aria-label": C(
|
|
1967
|
+
m("span", Rn, [m("select", {
|
|
1968
|
+
"aria-label": C(u)("blocks.text.fontSize"),
|
|
1893
1969
|
class: "size",
|
|
1894
|
-
value:
|
|
1895
|
-
onChange:
|
|
1970
|
+
value: Ae(),
|
|
1971
|
+
onChange: Fe,
|
|
1896
1972
|
onMousedown: r[2] ||= x(() => {}, ["stop"])
|
|
1897
1973
|
}, [
|
|
1898
|
-
m("option",
|
|
1899
|
-
m("option",
|
|
1900
|
-
(
|
|
1974
|
+
m("option", Bn, E(C(u)("blocks.text.fontMixed")), 1),
|
|
1975
|
+
m("option", Vn, E(C(u)("blocks.text.fontSizeDefault")), 1),
|
|
1976
|
+
(o(!0), d(M, null, g(C(We), (e) => (o(), d("option", {
|
|
1901
1977
|
key: e,
|
|
1902
|
-
value: C(
|
|
1903
|
-
}, E(e), 9,
|
|
1904
|
-
], 40,
|
|
1978
|
+
value: C(vn)(e)
|
|
1979
|
+
}, E(e), 9, Hn))), 128))
|
|
1980
|
+
], 40, zn), e(P, {
|
|
1905
1981
|
class: "picker-chevron",
|
|
1906
1982
|
name: "chevron-down",
|
|
1907
1983
|
size: 12
|
|
1908
1984
|
})]),
|
|
1909
|
-
e(
|
|
1910
|
-
modelValue:
|
|
1911
|
-
"onUpdate:modelValue": r[3] ||= (e) =>
|
|
1985
|
+
e(Ge, {
|
|
1986
|
+
modelValue: ze.value,
|
|
1987
|
+
"onUpdate:modelValue": r[3] ||= (e) => ze.value = e,
|
|
1912
1988
|
"allow-transparent": !1,
|
|
1913
|
-
label: C(
|
|
1989
|
+
label: C(u)("blocks.text.textColor"),
|
|
1914
1990
|
compact: "",
|
|
1915
1991
|
onMousedown: r[4] ||= x(() => {}, ["stop"])
|
|
1916
1992
|
}, null, 8, ["modelValue", "label"]),
|
|
1917
1993
|
r[21] ||= m("span", { class: "divider" }, null, -1),
|
|
1918
1994
|
m("button", {
|
|
1919
|
-
class: T({ active: C(
|
|
1995
|
+
class: T({ active: C(w)?.isActive("bold") }),
|
|
1920
1996
|
type: "button",
|
|
1921
|
-
title: C(
|
|
1922
|
-
"aria-label": C(
|
|
1923
|
-
onClick: r[5] ||= (e) => C(
|
|
1997
|
+
title: C(u)("blocks.text.bold"),
|
|
1998
|
+
"aria-label": C(u)("blocks.text.bold"),
|
|
1999
|
+
onClick: r[5] ||= (e) => C(w)?.chain().focus().toggleBold().run(),
|
|
1924
2000
|
onMousedown: r[6] ||= x(() => {}, ["prevent"])
|
|
1925
|
-
}, [...r[17] ||= [m("b", null, "B", -1)]], 42,
|
|
2001
|
+
}, [...r[17] ||= [m("b", null, "B", -1)]], 42, Un),
|
|
1926
2002
|
m("button", {
|
|
1927
|
-
class: T({ active: C(
|
|
2003
|
+
class: T({ active: C(w)?.isActive("italic") }),
|
|
1928
2004
|
type: "button",
|
|
1929
|
-
title: C(
|
|
1930
|
-
"aria-label": C(
|
|
1931
|
-
onClick: r[7] ||= (e) => C(
|
|
2005
|
+
title: C(u)("blocks.text.italic"),
|
|
2006
|
+
"aria-label": C(u)("blocks.text.italic"),
|
|
2007
|
+
onClick: r[7] ||= (e) => C(w)?.chain().focus().toggleItalic().run(),
|
|
1932
2008
|
onMousedown: r[8] ||= x(() => {}, ["prevent"])
|
|
1933
|
-
}, [...r[18] ||= [m("i", null, "I", -1)]], 42,
|
|
2009
|
+
}, [...r[18] ||= [m("i", null, "I", -1)]], 42, Wn),
|
|
1934
2010
|
m("button", {
|
|
1935
|
-
class: T({ active: C(
|
|
2011
|
+
class: T({ active: C(w)?.isActive("underline") }),
|
|
1936
2012
|
type: "button",
|
|
1937
|
-
title: C(
|
|
1938
|
-
"aria-label": C(
|
|
1939
|
-
onClick: r[9] ||= (e) => C(
|
|
2013
|
+
title: C(u)("blocks.text.underline"),
|
|
2014
|
+
"aria-label": C(u)("blocks.text.underline"),
|
|
2015
|
+
onClick: r[9] ||= (e) => C(w)?.chain().focus().toggleUnderline().run(),
|
|
1940
2016
|
onMousedown: r[10] ||= x(() => {}, ["prevent"])
|
|
1941
|
-
}, [...r[19] ||= [m("u", null, "U", -1)]], 42,
|
|
2017
|
+
}, [...r[19] ||= [m("u", null, "U", -1)]], 42, Gn),
|
|
1942
2018
|
m("button", {
|
|
1943
2019
|
ref_key: "linkTrigger",
|
|
1944
|
-
ref:
|
|
1945
|
-
class: T({ active: C(
|
|
2020
|
+
ref: U,
|
|
2021
|
+
class: T({ active: C(w)?.isActive("link") }),
|
|
1946
2022
|
type: "button",
|
|
1947
|
-
title: C(
|
|
1948
|
-
popovertarget: C(
|
|
2023
|
+
title: C(u)("blocks.text.link"),
|
|
2024
|
+
popovertarget: C(Je),
|
|
1949
2025
|
"aria-haspopup": "dialog",
|
|
1950
|
-
"aria-expanded":
|
|
2026
|
+
"aria-expanded": Ye.value,
|
|
1951
2027
|
onMousedown: r[11] ||= x(() => {}, ["prevent"])
|
|
1952
|
-
}, [e(
|
|
2028
|
+
}, [e(P, {
|
|
1953
2029
|
name: "link",
|
|
1954
2030
|
size: 16
|
|
1955
|
-
})], 42,
|
|
1956
|
-
|
|
2031
|
+
})], 42, Kn),
|
|
2032
|
+
l.editable ? (o(), d("div", {
|
|
1957
2033
|
key: 0,
|
|
1958
|
-
id: C(
|
|
2034
|
+
id: C(Je),
|
|
1959
2035
|
ref_key: "linkPopover",
|
|
1960
|
-
ref:
|
|
2036
|
+
ref: V,
|
|
1961
2037
|
class: "link-popover",
|
|
1962
2038
|
popover: "",
|
|
1963
2039
|
role: "dialog",
|
|
1964
|
-
"aria-label": C(
|
|
1965
|
-
onBeforetoggle:
|
|
1966
|
-
onToggle:
|
|
1967
|
-
onFocusout:
|
|
2040
|
+
"aria-label": C(u)("blocks.text.link"),
|
|
2041
|
+
onBeforetoggle: Qe,
|
|
2042
|
+
onToggle: G,
|
|
2043
|
+
onFocusout: $e
|
|
1968
2044
|
}, [
|
|
1969
|
-
m("span",
|
|
2045
|
+
m("span", Jn, [e(be, {
|
|
1970
2046
|
ref_key: "linkInput",
|
|
1971
|
-
ref:
|
|
1972
|
-
modelValue:
|
|
1973
|
-
"onUpdate:modelValue": r[12] ||= (e) =>
|
|
2047
|
+
ref: H,
|
|
2048
|
+
modelValue: W.value,
|
|
2049
|
+
"onUpdate:modelValue": r[12] ||= (e) => W.value = e,
|
|
1974
2050
|
inputmode: "url",
|
|
1975
2051
|
spellcheck: "false",
|
|
1976
2052
|
autocomplete: "off",
|
|
1977
|
-
placeholder: C(
|
|
1978
|
-
"aria-label": C(
|
|
1979
|
-
onKeydown:
|
|
2053
|
+
placeholder: C(u)("blocks.text.linkPlaceholder"),
|
|
2054
|
+
"aria-label": C(u)("blocks.text.linkPrompt"),
|
|
2055
|
+
onKeydown: ae(x(et, ["prevent"]), ["enter"])
|
|
1980
2056
|
}, null, 8, [
|
|
1981
2057
|
"modelValue",
|
|
1982
2058
|
"placeholder",
|
|
1983
2059
|
"aria-label",
|
|
1984
2060
|
"onKeydown"
|
|
1985
2061
|
])]),
|
|
1986
|
-
C(
|
|
1987
|
-
"aria-label": C(
|
|
1988
|
-
"model-value":
|
|
1989
|
-
"onUpdate:modelValue":
|
|
2062
|
+
C(tt).length ? (o(), d("span", Yn, [e(je, {
|
|
2063
|
+
"aria-label": C(u)("blocks.common.anchorLink.label"),
|
|
2064
|
+
"model-value": nt.value,
|
|
2065
|
+
"onUpdate:modelValue": rt,
|
|
1990
2066
|
onMousedown: r[13] ||= x(() => {}, ["stop"])
|
|
1991
2067
|
}, {
|
|
1992
|
-
default: p(() => [
|
|
2068
|
+
default: p(() => [nt.value ? (o(), d("option", Xn, E(C(u)("blocks.common.anchorLink.none")), 1)) : (o(), d("option", Zn, E(C(u)("blocks.common.anchorLink.placeholder")), 1)), (o(!0), d(M, null, g(C(tt), (e) => (o(), d("option", {
|
|
1993
2069
|
key: e,
|
|
1994
2070
|
value: e
|
|
1995
|
-
}, " #" + E(e), 9,
|
|
2071
|
+
}, " #" + E(e), 9, Qn))), 128))]),
|
|
1996
2072
|
_: 1
|
|
1997
2073
|
}, 8, ["aria-label", "model-value"])])) : n("", !0),
|
|
1998
2074
|
m("button", {
|
|
1999
2075
|
class: "link-apply",
|
|
2000
2076
|
type: "button",
|
|
2001
|
-
onClick:
|
|
2077
|
+
onClick: et,
|
|
2002
2078
|
onMousedown: r[14] ||= x(() => {}, ["prevent"])
|
|
2003
|
-
}, E(C(
|
|
2004
|
-
|
|
2079
|
+
}, E(C(u)("blocks.text.linkApply")), 33),
|
|
2080
|
+
Ze.value ? (o(), d("button", {
|
|
2005
2081
|
key: 1,
|
|
2006
2082
|
class: "link-remove",
|
|
2007
2083
|
type: "button",
|
|
2008
|
-
title: C(
|
|
2009
|
-
"aria-label": C(
|
|
2010
|
-
onClick:
|
|
2084
|
+
title: C(u)("blocks.text.linkRemove"),
|
|
2085
|
+
"aria-label": C(u)("blocks.text.linkRemove"),
|
|
2086
|
+
onClick: it,
|
|
2011
2087
|
onMousedown: r[15] ||= x(() => {}, ["prevent"])
|
|
2012
|
-
}, [e(
|
|
2088
|
+
}, [e(P, {
|
|
2013
2089
|
name: "trash",
|
|
2014
2090
|
size: 16
|
|
2015
|
-
})], 40,
|
|
2016
|
-
], 40,
|
|
2017
|
-
e(
|
|
2018
|
-
e(
|
|
2019
|
-
actions:
|
|
2020
|
-
pending:
|
|
2021
|
-
onSelect:
|
|
2091
|
+
})], 40, $n)) : n("", !0)
|
|
2092
|
+
], 40, qn)) : n("", !0),
|
|
2093
|
+
e(gn, { onSelect: Y }),
|
|
2094
|
+
e(cn, {
|
|
2095
|
+
actions: ot.value,
|
|
2096
|
+
pending: q.value,
|
|
2097
|
+
onSelect: ut
|
|
2022
2098
|
}, null, 8, ["actions", "pending"]),
|
|
2023
2099
|
r[22] ||= m("span", { class: "divider" }, null, -1),
|
|
2024
|
-
(
|
|
2100
|
+
(o(), d(M, null, g(h, (e) => m("button", {
|
|
2025
2101
|
key: e,
|
|
2026
|
-
class: T({ active: C(
|
|
2027
|
-
title: C(
|
|
2102
|
+
class: T({ active: C(w)?.isActive({ textAlign: e }) }),
|
|
2103
|
+
title: C(u)(Be[e]),
|
|
2028
2104
|
type: "button",
|
|
2029
|
-
onClick: (t) => C(
|
|
2105
|
+
onClick: (t) => C(w)?.chain().focus().setTextAlign(e).run(),
|
|
2030
2106
|
onMousedown: r[16] ||= x(() => {}, ["prevent"])
|
|
2031
|
-
}, [(
|
|
2107
|
+
}, [(o(), d("svg", tr, [(o(!0), d(M, null, g(qe(e), (e, t) => (o(), d("rect", {
|
|
2032
2108
|
key: t,
|
|
2033
2109
|
fill: "currentColor",
|
|
2034
2110
|
height: "1.5",
|
|
@@ -2036,9 +2112,9 @@ var wn = { class: "picker" }, Tn = ["aria-label", "value"], En = {
|
|
|
2036
2112
|
width: e.w,
|
|
2037
2113
|
x: e.x,
|
|
2038
2114
|
y: e.y
|
|
2039
|
-
}, null, 8,
|
|
2115
|
+
}, null, 8, nr))), 128))]))], 42, er)), 64))
|
|
2040
2116
|
], 512)) : n("", !0)], 544));
|
|
2041
2117
|
}
|
|
2042
|
-
}), [["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-
|
|
2118
|
+
}), [["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-9371cb9e]{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-9371cb9e]:popover-open{display:flex}.toolbar>button[data-v-9371cb9e]{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-9371cb9e]:hover{background:color-mix(in srgb, var(--bygga-color-text) 30%, transparent)}.toolbar>button.active[data-v-9371cb9e]{background:var(--bygga-color-selected,var(--bygga-color-text));color:var(--bygga-color-selected-text,#fff);forced-color-adjust:none}.toolbar .picker[data-v-9371cb9e]{align-items:center;display:inline-flex;position:relative}.toolbar .style[data-v-9371cb9e],.toolbar .font[data-v-9371cb9e],.toolbar .size[data-v-9371cb9e]{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-9371cb9e]:hover,.toolbar .font[data-v-9371cb9e]:hover,.toolbar .size[data-v-9371cb9e]:hover{background:color-mix(in srgb, var(--bygga-color-text) 7%, transparent)}.toolbar .picker-chevron[data-v-9371cb9e]{color:var(--bygga-color-text);pointer-events:none;position:absolute;right:5px}.toolbar .divider[data-v-9371cb9e]{background:var(--bygga-color-divider);width:1px;height:24px;margin:0 4px}.link-popover[data-v-9371cb9e]{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-9371cb9e]:popover-open{display:flex}.link-field[data-v-9371cb9e]{width:18em}.link-anchor[data-v-9371cb9e]{width:10em}.link-apply[data-v-9371cb9e]{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-9371cb9e]{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-9371cb9e]:hover{background:var(--bygga-color-track);color:var(--bygga-color-accent)}"]], ["__scopeId", "data-v-9371cb9e"]]);
|
|
2043
2119
|
//#endregion
|
|
2044
|
-
export {
|
|
2120
|
+
export { ar as default };
|