@bygga.dev/editor 1.7.4 → 1.8.2
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-DHX4eYPZ.js → TextEditor-C4eFw8MM.js} +516 -511
- package/bygga-editor.js +2424 -2247
- package/element.d.ts +20 -0
- package/package.json +1 -1
- package/{providerKeys-BsADyfoz.js → providerKeys-D5U1FqVd.js} +2 -2
- package/{urls-DUOZKEPL.js → urls-IMcu_a3s.js} +1633 -1538
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { A as e, B as t, D as n, E as r, F as i, H as a, I as o, J as s, L 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 te, lt as ne, m as O, ot as re, q as ie, t as ae, w as k, x as A, y as oe, z as se } from "./providerKeys-D5U1FqVd.js";
|
|
2
|
+
import { C as j, Ct as M, D as N, Dt as ce, Et as P, Q as le, S as ue, St as F, Tt as de, Z as fe, _t as I, an as pe, at as me, b as he, bt as L, c as ge, cn as _e, ct as R, d as ve, dt as ye, ft as be, g as xe, gt as Se, hn as Ce, ht as we, in as Te, it as Ee, l as De, ln as Oe, lt as ke, mt as Ae, n as z, nn as je, nt as Me, on as Ne, ot as Pe, pn as Fe, pt as B, r as Ie, rn as Le, rt as Re, s as ze, sn as Be, st as V, t as Ve, u as He, ut as Ue, v as We, vt as H, wt as Ge, xt as U, yt as Ke } from "./urls-IMcu_a3s.js";
|
|
3
3
|
//#region ../../node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.js
|
|
4
|
-
function
|
|
5
|
-
return new
|
|
6
|
-
return new
|
|
4
|
+
function qe(e = {}) {
|
|
5
|
+
return new L({ view(t) {
|
|
6
|
+
return new Je(t, e);
|
|
7
7
|
} });
|
|
8
8
|
}
|
|
9
|
-
var
|
|
9
|
+
var Je = 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 qe = 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 =
|
|
85
|
+
let t = de(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,16 +97,16 @@ var qe = class {
|
|
|
97
97
|
dragleave(e) {
|
|
98
98
|
this.editorView.dom.contains(e.relatedTarget) || this.setCursor(null);
|
|
99
99
|
}
|
|
100
|
-
}, W = class e extends
|
|
100
|
+
}, W = class e extends F {
|
|
101
101
|
constructor(e) {
|
|
102
102
|
super(e, e);
|
|
103
103
|
}
|
|
104
104
|
map(t, n) {
|
|
105
105
|
let r = t.resolve(n.map(this.head));
|
|
106
|
-
return e.valid(r) ? new e(r) :
|
|
106
|
+
return e.valid(r) ? new e(r) : F.near(r);
|
|
107
107
|
}
|
|
108
108
|
content() {
|
|
109
|
-
return
|
|
109
|
+
return ce.empty;
|
|
110
110
|
}
|
|
111
111
|
eq(t) {
|
|
112
112
|
return t instanceof e && t.head == this.head;
|
|
@@ -122,11 +122,11 @@ var qe = class {
|
|
|
122
122
|
return new e(t.resolve(n.pos));
|
|
123
123
|
}
|
|
124
124
|
getBookmark() {
|
|
125
|
-
return new
|
|
125
|
+
return new Ye(this.anchor);
|
|
126
126
|
}
|
|
127
127
|
static valid(e) {
|
|
128
128
|
let t = e.parent;
|
|
129
|
-
if (t.inlineContent || !
|
|
129
|
+
if (t.inlineContent || !Ze(e) || !Qe(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 qe = class {
|
|
|
149
149
|
for (;;) {
|
|
150
150
|
let o = n > 0 ? a.firstChild : a.lastChild;
|
|
151
151
|
if (!o) {
|
|
152
|
-
if (a.isAtom && !a.isText && !
|
|
152
|
+
if (a.isAtom && !a.isText && !Ke.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 qe = class {
|
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
};
|
|
166
|
-
W.prototype.visible = !1, W.findFrom = W.findGapCursorFrom,
|
|
167
|
-
var
|
|
166
|
+
W.prototype.visible = !1, W.findFrom = W.findGapCursorFrom, F.jsonID("gapcursor", W);
|
|
167
|
+
var Ye = class e {
|
|
168
168
|
constructor(e) {
|
|
169
169
|
this.pos = e;
|
|
170
170
|
}
|
|
@@ -173,13 +173,13 @@ var Je = class e {
|
|
|
173
173
|
}
|
|
174
174
|
resolve(e) {
|
|
175
175
|
let t = e.resolve(this.pos);
|
|
176
|
-
return W.valid(t) ? new W(t) :
|
|
176
|
+
return W.valid(t) ? new W(t) : F.near(t);
|
|
177
177
|
}
|
|
178
178
|
};
|
|
179
|
-
function
|
|
179
|
+
function Xe(e) {
|
|
180
180
|
return e.isAtom || e.spec.isolating || e.spec.createGapCursor;
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function Ze(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 Xe(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 ||
|
|
190
|
+
if (e.childCount == 0 && !e.inlineContent || Xe(e.type)) return !0;
|
|
191
191
|
if (e.inlineContent) return !1;
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
return !0;
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function Qe(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,24 +201,24 @@ function Ze(e) {
|
|
|
201
201
|
continue;
|
|
202
202
|
}
|
|
203
203
|
for (let e = r.child(n);; e = e.firstChild) {
|
|
204
|
-
if (e.childCount == 0 && !e.inlineContent ||
|
|
204
|
+
if (e.childCount == 0 && !e.inlineContent || Xe(e.type)) return !0;
|
|
205
205
|
if (e.inlineContent) return !1;
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
return !0;
|
|
209
209
|
}
|
|
210
210
|
function G() {
|
|
211
|
-
return new
|
|
212
|
-
decorations:
|
|
211
|
+
return new L({ props: {
|
|
212
|
+
decorations: nt,
|
|
213
213
|
createSelectionBetween(e, t, n) {
|
|
214
214
|
return t.pos == n.pos && W.valid(n) ? new W(n) : null;
|
|
215
215
|
},
|
|
216
|
-
handleClick:
|
|
217
|
-
handleKeyDown:
|
|
218
|
-
handleDOMEvents: { beforeinput:
|
|
216
|
+
handleClick: et,
|
|
217
|
+
handleKeyDown: $e,
|
|
218
|
+
handleDOMEvents: { beforeinput: tt }
|
|
219
219
|
} });
|
|
220
220
|
}
|
|
221
|
-
var
|
|
221
|
+
var $e = Se({
|
|
222
222
|
ArrowLeft: K("horiz", -1),
|
|
223
223
|
ArrowRight: K("horiz", 1),
|
|
224
224
|
ArrowUp: K("vert", -1),
|
|
@@ -228,7 +228,7 @@ function K(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
|
|
231
|
+
if (a instanceof M) {
|
|
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
|
}
|
|
@@ -236,7 +236,7 @@ function K(e, t) {
|
|
|
236
236
|
return c ? (r && r(e.tr.setSelection(new W(c))), !0) : !1;
|
|
237
237
|
};
|
|
238
238
|
}
|
|
239
|
-
function
|
|
239
|
+
function et(e, t, n) {
|
|
240
240
|
if (!e || !e.editable) return !1;
|
|
241
241
|
let r = e.state.doc.resolve(t);
|
|
242
242
|
if (!W.valid(r)) return !1;
|
|
@@ -244,21 +244,21 @@ function $e(e, t, n) {
|
|
|
244
244
|
left: n.clientX,
|
|
245
245
|
top: n.clientY
|
|
246
246
|
});
|
|
247
|
-
return i && i.inside > -1 &&
|
|
247
|
+
return i && i.inside > -1 && Ke.isSelectable(e.state.doc.nodeAt(i.inside)) ? !1 : (e.dispatch(e.state.tr.setSelection(new W(r))), !0);
|
|
248
248
|
}
|
|
249
|
-
function
|
|
249
|
+
function tt(e, t) {
|
|
250
250
|
if (t.inputType != "insertCompositionText" || !(e.state.selection instanceof W)) 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 =
|
|
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(
|
|
253
|
+
let i = P.empty;
|
|
254
|
+
for (let e = r.length - 1; e >= 0; e--) i = P.from(r[e].createAndFill(null, i));
|
|
255
|
+
let a = e.state.tr.replace(n.pos, n.pos, new ce(i, 0, 0));
|
|
256
|
+
return a.setSelection(M.near(a.doc.resolve(n.pos + 1))), e.dispatch(a), !1;
|
|
257
257
|
}
|
|
258
|
-
function
|
|
258
|
+
function nt(e) {
|
|
259
259
|
if (!(e.selection instanceof W)) return null;
|
|
260
260
|
let t = document.createElement("div");
|
|
261
|
-
return t.className = "ProseMirror-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
|
|
@@ -268,7 +268,7 @@ J.prototype.append = function(e) {
|
|
|
268
268
|
}, J.prototype.prepend = function(e) {
|
|
269
269
|
return e.length ? J.from(e).append(this) : this;
|
|
270
270
|
}, J.prototype.appendInner = function(e) {
|
|
271
|
-
return new
|
|
271
|
+
return new it(this, e);
|
|
272
272
|
}, J.prototype.slice = function(e, t) {
|
|
273
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
274
|
}, J.prototype.get = function(e) {
|
|
@@ -282,9 +282,9 @@ J.prototype.append = function(e) {
|
|
|
282
282
|
return r.push(e(t, n));
|
|
283
283
|
}, t, n), r;
|
|
284
284
|
}, J.from = function(e) {
|
|
285
|
-
return e instanceof J ? e : e && e.length ? new
|
|
285
|
+
return e instanceof J ? e : e && e.length ? new rt(e) : J.empty;
|
|
286
286
|
};
|
|
287
|
-
var
|
|
287
|
+
var rt = /* @__PURE__ */ function(e) {
|
|
288
288
|
function t(t) {
|
|
289
289
|
e.call(this), this.values = t;
|
|
290
290
|
}
|
|
@@ -313,8 +313,8 @@ var nt = /* @__PURE__ */ function(e) {
|
|
|
313
313
|
return 0;
|
|
314
314
|
}, Object.defineProperties(t.prototype, n), t;
|
|
315
315
|
}(J);
|
|
316
|
-
J.empty = new
|
|
317
|
-
var
|
|
316
|
+
J.empty = new rt([]);
|
|
317
|
+
var it = /* @__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 rt = /* @__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
|
-
}(J),
|
|
344
|
+
}(J), at = 500, Y = class e {
|
|
345
345
|
constructor(e, t) {
|
|
346
346
|
this.items = e, this.eventCount = t;
|
|
347
347
|
}
|
|
@@ -379,7 +379,7 @@ var rt = /* @__PURE__ */ function(e) {
|
|
|
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 >
|
|
382
|
+
return l > st && (s = ot(s, l), o -= l), new e(s.append(a), o);
|
|
383
383
|
}
|
|
384
384
|
remapping(e, t) {
|
|
385
385
|
let n = new Ge();
|
|
@@ -411,7 +411,7 @@ var rt = /* @__PURE__ */ function(e) {
|
|
|
411
411
|
let l = [];
|
|
412
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() >
|
|
414
|
+
return u.emptyItemCount() > at && (u = u.compress(this.items.length - r.length)), u;
|
|
415
415
|
}
|
|
416
416
|
emptyItemCount() {
|
|
417
417
|
let e = 0;
|
|
@@ -436,7 +436,7 @@ var rt = /* @__PURE__ */ function(e) {
|
|
|
436
436
|
}
|
|
437
437
|
};
|
|
438
438
|
Y.empty = new Y(J.empty, 0);
|
|
439
|
-
function
|
|
439
|
+
function ot(e, t) {
|
|
440
440
|
let n;
|
|
441
441
|
return e.forEach((e, r) => {
|
|
442
442
|
if (e.selection && t-- == 0) return n = r, !1;
|
|
@@ -456,21 +456,21 @@ var X = class e {
|
|
|
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
|
-
},
|
|
460
|
-
function
|
|
459
|
+
}, st = 20;
|
|
460
|
+
function ct(e, t, n, r) {
|
|
461
461
|
let i = n.getMeta(Q), a;
|
|
462
462
|
if (i) return i.historyState;
|
|
463
|
-
n.getMeta(
|
|
463
|
+
n.getMeta(gt) && (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 Z(e.done.addTransform(n, void 0, r,
|
|
466
|
+
if (o && o.getMeta(Q)) return o.getMeta(Q).redo ? new Z(e.done.addTransform(n, void 0, r, ht(t)), e.undone, ut(n.mapping.maps), e.prevTime, e.prevComposition) : new Z(e.done, e.undone.addTransform(n, void 0, r, ht(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 || !
|
|
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),
|
|
468
|
+
let i = n.getMeta("composition"), a = e.prevTime == 0 || !o && e.prevComposition != i && (e.prevTime < (n.time || 0) - r.newGroupDelay || !lt(n, e.prevRanges)), s = o ? dt(e.prevRanges, n.mapping) : ut(n.mapping.maps);
|
|
469
|
+
return new Z(e.done.addTransform(n, a ? t.selection.getBookmark() : void 0, r, ht(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), dt(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), dt(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
|
|
472
472
|
}
|
|
473
|
-
function
|
|
473
|
+
function lt(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 ct(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
|
|
481
|
+
function ut(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
|
|
486
|
+
function dt(e, t) {
|
|
487
487
|
if (!e) return null;
|
|
488
488
|
let n = [];
|
|
489
489
|
for (let r = 0; r < e.length; r += 2) {
|
|
@@ -492,8 +492,8 @@ function ut(e, t) {
|
|
|
492
492
|
}
|
|
493
493
|
return n;
|
|
494
494
|
}
|
|
495
|
-
function
|
|
496
|
-
let r =
|
|
495
|
+
function ft(e, t, n) {
|
|
496
|
+
let r = ht(t), i = Q.get(t).spec.config, a = (n ? e.undone : e.done).popEvent(t, r);
|
|
497
497
|
if (!a) return null;
|
|
498
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, {
|
|
@@ -501,53 +501,53 @@ function dt(e, t, n) {
|
|
|
501
501
|
historyState: c
|
|
502
502
|
});
|
|
503
503
|
}
|
|
504
|
-
var
|
|
505
|
-
function
|
|
504
|
+
var pt = !1, mt = null;
|
|
505
|
+
function ht(e) {
|
|
506
506
|
let t = e.plugins;
|
|
507
|
-
if (
|
|
508
|
-
|
|
507
|
+
if (mt != t) {
|
|
508
|
+
pt = !1, mt = t;
|
|
509
509
|
for (let e = 0; e < t.length; e++) if (t[e].spec.historyPreserveItems) {
|
|
510
|
-
|
|
510
|
+
pt = !0;
|
|
511
511
|
break;
|
|
512
512
|
}
|
|
513
513
|
}
|
|
514
|
-
return
|
|
514
|
+
return pt;
|
|
515
515
|
}
|
|
516
|
-
var Q = new
|
|
517
|
-
function
|
|
516
|
+
var Q = new U("history"), gt = new U("closeHistory");
|
|
517
|
+
function _t(e = {}) {
|
|
518
518
|
return e = {
|
|
519
519
|
depth: e.depth || 100,
|
|
520
520
|
newGroupDelay: e.newGroupDelay || 500
|
|
521
|
-
}, new
|
|
521
|
+
}, new L({
|
|
522
522
|
key: Q,
|
|
523
523
|
state: {
|
|
524
524
|
init() {
|
|
525
525
|
return new Z(Y.empty, Y.empty, null, 0, -1);
|
|
526
526
|
},
|
|
527
527
|
apply(t, n, r) {
|
|
528
|
-
return
|
|
528
|
+
return ct(n, r, t, e);
|
|
529
529
|
}
|
|
530
530
|
},
|
|
531
531
|
config: e,
|
|
532
532
|
props: { handleDOMEvents: { beforeinput(e, t) {
|
|
533
|
-
let n = t.inputType, r = n == "historyUndo" ?
|
|
533
|
+
let n = t.inputType, r = n == "historyUndo" ? yt : n == "historyRedo" ? bt : null;
|
|
534
534
|
return !r || !e.editable ? !1 : (t.preventDefault(), r(e.state, e.dispatch));
|
|
535
535
|
} } }
|
|
536
536
|
});
|
|
537
537
|
}
|
|
538
|
-
function
|
|
538
|
+
function vt(e, t) {
|
|
539
539
|
return (n, r) => {
|
|
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 =
|
|
543
|
+
let a = ft(i, n, e);
|
|
544
544
|
a && r(t ? a.scrollIntoView() : a);
|
|
545
545
|
}
|
|
546
546
|
return !0;
|
|
547
547
|
};
|
|
548
548
|
}
|
|
549
|
-
var
|
|
550
|
-
|
|
549
|
+
var yt = vt(!1, !0), bt = vt(!0, !0);
|
|
550
|
+
R.create({
|
|
551
551
|
name: "characterCount",
|
|
552
552
|
addOptions() {
|
|
553
553
|
return {
|
|
@@ -579,8 +579,8 @@ F.create({
|
|
|
579
579
|
},
|
|
580
580
|
addProseMirrorPlugins() {
|
|
581
581
|
let e = !1;
|
|
582
|
-
return [new
|
|
583
|
-
key: new
|
|
582
|
+
return [new L({
|
|
583
|
+
key: new U("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 @@ F.create({
|
|
|
608
608
|
}
|
|
609
609
|
})];
|
|
610
610
|
}
|
|
611
|
-
}),
|
|
611
|
+
}), R.create({
|
|
612
612
|
name: "dropCursor",
|
|
613
613
|
addOptions() {
|
|
614
614
|
return {
|
|
@@ -618,9 +618,9 @@ F.create({
|
|
|
618
618
|
};
|
|
619
619
|
},
|
|
620
620
|
addProseMirrorPlugins() {
|
|
621
|
-
return [
|
|
621
|
+
return [qe(this.options)];
|
|
622
622
|
}
|
|
623
|
-
}),
|
|
623
|
+
}), R.create({
|
|
624
624
|
name: "focus",
|
|
625
625
|
addOptions() {
|
|
626
626
|
return {
|
|
@@ -629,11 +629,11 @@ F.create({
|
|
|
629
629
|
};
|
|
630
630
|
},
|
|
631
631
|
addProseMirrorPlugins() {
|
|
632
|
-
return [new
|
|
633
|
-
key: new
|
|
632
|
+
return [new L({
|
|
633
|
+
key: new U("focus"),
|
|
634
634
|
props: { decorations: ({ doc: e, selection: t }) => {
|
|
635
635
|
let { isEditable: n, isFocused: r } = this.editor, { anchor: i } = t, a = [];
|
|
636
|
-
if (!n || !r) return
|
|
636
|
+
if (!n || !r) return H.create(e, []);
|
|
637
637
|
let o = 0;
|
|
638
638
|
this.options.mode === "deepest" && e.descendants((e, t) => {
|
|
639
639
|
if (!e.isText) {
|
|
@@ -645,28 +645,28 @@ F.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(
|
|
649
|
-
}),
|
|
648
|
+
a.push(I.node(t, t + e.nodeSize, { class: this.options.className }));
|
|
649
|
+
}), H.create(e, a);
|
|
650
650
|
} }
|
|
651
651
|
})];
|
|
652
652
|
}
|
|
653
|
-
}),
|
|
653
|
+
}), R.create({
|
|
654
654
|
name: "gapCursor",
|
|
655
655
|
addProseMirrorPlugins() {
|
|
656
656
|
return [G()];
|
|
657
657
|
},
|
|
658
658
|
extendNodeSchema(e) {
|
|
659
|
-
return { allowGapCursor:
|
|
659
|
+
return { allowGapCursor: Ue(be(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
|
|
667
|
-
function
|
|
666
|
+
var xt = "placeholder", $ = new U("tiptap__placeholder"), St = 200;
|
|
667
|
+
function Ct(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),
|
|
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,
|
|
@@ -676,17 +676,17 @@ function St(e) {
|
|
|
676
676
|
}) : n
|
|
677
677
|
});
|
|
678
678
|
}
|
|
679
|
-
function
|
|
679
|
+
function wt(e, t) {
|
|
680
680
|
return typeof e == "function" ? e(t) : e;
|
|
681
681
|
}
|
|
682
|
-
function
|
|
682
|
+
function Tt({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
|
|
683
683
|
if (!(e.isEditable || !t.showOnlyWhenEditable)) return null;
|
|
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 &&
|
|
687
|
+
if (c && c.type.isTextblock && B(c)) {
|
|
688
688
|
let r = a >= l && a <= l + c.nodeSize;
|
|
689
|
-
o.push(
|
|
689
|
+
o.push(Ct({
|
|
690
690
|
editor: e,
|
|
691
691
|
isEmptyDoc: s,
|
|
692
692
|
dataAttribute: n,
|
|
@@ -694,7 +694,7 @@ function wt({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
|
|
|
694
694
|
placeholder: t.placeholder,
|
|
695
695
|
classes: {
|
|
696
696
|
emptyEditor: t.emptyEditorClass,
|
|
697
|
-
emptyNode:
|
|
697
|
+
emptyNode: wt(t.emptyNodeClass, {
|
|
698
698
|
editor: e,
|
|
699
699
|
node: c,
|
|
700
700
|
pos: l,
|
|
@@ -708,8 +708,8 @@ function wt({ 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 &&
|
|
712
|
-
return r.type.isTextblock && (c || !t.showOnlyCurrent) && l && o.push(
|
|
711
|
+
let c = a >= i && a <= i + r.nodeSize, l = !r.isLeaf && B(r);
|
|
712
|
+
return r.type.isTextblock && (c || !t.showOnlyCurrent) && l && o.push(Ct({
|
|
713
713
|
editor: e,
|
|
714
714
|
isEmptyDoc: s,
|
|
715
715
|
dataAttribute: n,
|
|
@@ -717,7 +717,7 @@ function wt({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
|
|
|
717
717
|
placeholder: t.placeholder,
|
|
718
718
|
classes: {
|
|
719
719
|
emptyEditor: t.emptyEditorClass,
|
|
720
|
-
emptyNode:
|
|
720
|
+
emptyNode: wt(t.emptyNodeClass, {
|
|
721
721
|
editor: e,
|
|
722
722
|
node: r,
|
|
723
723
|
pos: i,
|
|
@@ -729,19 +729,19 @@ function wt({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
|
|
|
729
729
|
})), t.includeChildren;
|
|
730
730
|
});
|
|
731
731
|
}
|
|
732
|
-
return
|
|
732
|
+
return H.create(r, o);
|
|
733
733
|
}
|
|
734
|
-
function
|
|
734
|
+
function Et(e) {
|
|
735
735
|
return e.replace(/\s+/g, "-").replace(/[^a-zA-Z0-9-]/g, "").replace(/^[0-9-]+/, "").replace(/^-+/, "").toLowerCase();
|
|
736
736
|
}
|
|
737
|
-
function
|
|
737
|
+
function Dt(e) {
|
|
738
738
|
let t = getComputedStyle(e), n = `${t.overflow} ${t.overflowY} ${t.overflowX}`;
|
|
739
739
|
return /auto|scroll|overlay/.test(n);
|
|
740
740
|
}
|
|
741
|
-
function
|
|
741
|
+
function Ot(e) {
|
|
742
742
|
let t = e;
|
|
743
743
|
for (; t;) {
|
|
744
|
-
if (
|
|
744
|
+
if (Dt(t)) return t;
|
|
745
745
|
let e = t.parentElement;
|
|
746
746
|
if (!e) {
|
|
747
747
|
let e = t.getRootNode();
|
|
@@ -755,19 +755,19 @@ function Dt(e) {
|
|
|
755
755
|
}
|
|
756
756
|
return window;
|
|
757
757
|
}
|
|
758
|
-
function
|
|
758
|
+
function kt(e) {
|
|
759
759
|
return e === window ? {
|
|
760
760
|
top: 0,
|
|
761
761
|
bottom: window.innerHeight
|
|
762
762
|
} : e.getBoundingClientRect();
|
|
763
763
|
}
|
|
764
|
-
function
|
|
764
|
+
function At({ view: e, scrollContainer: t }) {
|
|
765
765
|
let n = e.dom.getBoundingClientRect();
|
|
766
766
|
if (n.width <= 0 || n.height <= 0) return null;
|
|
767
|
-
let r = t ?
|
|
767
|
+
let r = t ? kt(t) : {
|
|
768
768
|
top: 0,
|
|
769
769
|
bottom: window.innerHeight
|
|
770
|
-
}, i = Math.max(n.top, r.top) -
|
|
770
|
+
}, i = Math.max(n.top, r.top) - St, a = Math.min(n.bottom, r.bottom) + St;
|
|
771
771
|
if (i >= a) return null;
|
|
772
772
|
let o = n.left + 1, s = n.right - 1;
|
|
773
773
|
if (o > s) return null;
|
|
@@ -785,7 +785,7 @@ function kt({ view: e, scrollContainer: t }) {
|
|
|
785
785
|
bottom: p.pos
|
|
786
786
|
};
|
|
787
787
|
}
|
|
788
|
-
var
|
|
788
|
+
var jt = {
|
|
789
789
|
init() {
|
|
790
790
|
return {
|
|
791
791
|
topPos: null,
|
|
@@ -803,9 +803,9 @@ var At = {
|
|
|
803
803
|
} : t;
|
|
804
804
|
}
|
|
805
805
|
};
|
|
806
|
-
function
|
|
807
|
-
let t =
|
|
808
|
-
let n =
|
|
806
|
+
function Mt(e) {
|
|
807
|
+
let t = Ot(e.dom), n = () => {
|
|
808
|
+
let n = At({
|
|
809
809
|
view: e,
|
|
810
810
|
scrollContainer: t
|
|
811
811
|
});
|
|
@@ -834,13 +834,13 @@ function jt(e) {
|
|
|
834
834
|
}
|
|
835
835
|
};
|
|
836
836
|
}
|
|
837
|
-
function
|
|
838
|
-
let n = t.dataAttribute ? `data-${
|
|
839
|
-
return new
|
|
837
|
+
function Nt({ editor: e, options: t }) {
|
|
838
|
+
let n = t.dataAttribute ? `data-${Et(t.dataAttribute)}` : `data-${xt}`;
|
|
839
|
+
return new L({
|
|
840
840
|
key: $,
|
|
841
|
-
state:
|
|
842
|
-
view:
|
|
843
|
-
props: { decorations: ({ doc: r, selection: i }) =>
|
|
841
|
+
state: jt,
|
|
842
|
+
view: Mt,
|
|
843
|
+
props: { decorations: ({ doc: r, selection: i }) => Tt({
|
|
844
844
|
editor: e,
|
|
845
845
|
options: t,
|
|
846
846
|
dataAttribute: n,
|
|
@@ -849,13 +849,13 @@ function Mt({ editor: e, options: t }) {
|
|
|
849
849
|
}) }
|
|
850
850
|
});
|
|
851
851
|
}
|
|
852
|
-
var
|
|
852
|
+
var Pt = R.create({
|
|
853
853
|
name: "placeholder",
|
|
854
854
|
addOptions() {
|
|
855
855
|
return {
|
|
856
856
|
emptyEditorClass: "is-editor-empty",
|
|
857
857
|
emptyNodeClass: "is-empty",
|
|
858
|
-
dataAttribute:
|
|
858
|
+
dataAttribute: xt,
|
|
859
859
|
placeholder: "Write something …",
|
|
860
860
|
showOnlyWhenEditable: !0,
|
|
861
861
|
showOnlyCurrent: !0,
|
|
@@ -863,31 +863,31 @@ var Nt = F.create({
|
|
|
863
863
|
};
|
|
864
864
|
},
|
|
865
865
|
addProseMirrorPlugins() {
|
|
866
|
-
return [
|
|
866
|
+
return [Nt({
|
|
867
867
|
editor: this.editor,
|
|
868
868
|
options: this.options
|
|
869
869
|
})];
|
|
870
870
|
}
|
|
871
|
-
}),
|
|
872
|
-
|
|
871
|
+
}), Ft = ".ProseMirror:not(.ProseMirror-focused) *::selection {\n background: transparent;\n}\n\n.ProseMirror:not(.ProseMirror-focused) *::-moz-selection {\n background: transparent;\n}";
|
|
872
|
+
R.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" &&
|
|
880
|
-
key: new
|
|
879
|
+
return e.options.injectCSS && typeof document < "u" && ye(Ft, e.options.injectNonce, "selection"), [new L({
|
|
880
|
+
key: new U("selection"),
|
|
881
881
|
props: { decorations(n) {
|
|
882
|
-
return n.selection.empty || e.isFocused || !e.isEditable ||
|
|
882
|
+
return n.selection.empty || e.isFocused || !e.isEditable || Ae(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
|
}
|
|
886
886
|
});
|
|
887
|
-
function
|
|
887
|
+
function It({ types: e, node: t }) {
|
|
888
888
|
return t && Array.isArray(e) && e.includes(t.type) || t?.type === e;
|
|
889
889
|
}
|
|
890
|
-
|
|
890
|
+
R.create({
|
|
891
891
|
name: "trailingNode",
|
|
892
892
|
addOptions() {
|
|
893
893
|
return {
|
|
@@ -896,8 +896,8 @@ F.create({
|
|
|
896
896
|
};
|
|
897
897
|
},
|
|
898
898
|
addProseMirrorPlugins() {
|
|
899
|
-
let e = new
|
|
900
|
-
return [new
|
|
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 L({
|
|
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];
|
|
@@ -906,7 +906,7 @@ F.create({
|
|
|
906
906
|
state: {
|
|
907
907
|
init: (e, t) => {
|
|
908
908
|
let r = t.tr.doc.lastChild;
|
|
909
|
-
return !
|
|
909
|
+
return !It({
|
|
910
910
|
node: r,
|
|
911
911
|
types: n
|
|
912
912
|
});
|
|
@@ -914,7 +914,7 @@ F.create({
|
|
|
914
914
|
apply: (e, t) => {
|
|
915
915
|
if (!e.docChanged || e.getMeta("__uniqueIDTransaction")) return t;
|
|
916
916
|
let r = e.doc.lastChild;
|
|
917
|
-
return !
|
|
917
|
+
return !It({
|
|
918
918
|
node: r,
|
|
919
919
|
types: n
|
|
920
920
|
});
|
|
@@ -923,7 +923,7 @@ F.create({
|
|
|
923
923
|
})];
|
|
924
924
|
}
|
|
925
925
|
});
|
|
926
|
-
var
|
|
926
|
+
var Lt = R.create({
|
|
927
927
|
name: "undoRedo",
|
|
928
928
|
addOptions() {
|
|
929
929
|
return {
|
|
@@ -933,12 +933,12 @@ var It = F.create({
|
|
|
933
933
|
},
|
|
934
934
|
addCommands() {
|
|
935
935
|
return {
|
|
936
|
-
undo: () => ({ state: e, dispatch: t }) =>
|
|
937
|
-
redo: () => ({ state: e, dispatch: t }) =>
|
|
936
|
+
undo: () => ({ state: e, dispatch: t }) => yt(e, t),
|
|
937
|
+
redo: () => ({ state: e, dispatch: t }) => bt(e, t)
|
|
938
938
|
};
|
|
939
939
|
},
|
|
940
940
|
addProseMirrorPlugins() {
|
|
941
|
-
return [
|
|
941
|
+
return [_t(this.options)];
|
|
942
942
|
},
|
|
943
943
|
addKeyboardShortcuts() {
|
|
944
944
|
return {
|
|
@@ -952,13 +952,13 @@ var It = F.create({
|
|
|
952
952
|
});
|
|
953
953
|
//#endregion
|
|
954
954
|
//#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
|
|
956
|
-
return
|
|
955
|
+
function Rt(e) {
|
|
956
|
+
return w((t, n) => ({
|
|
957
957
|
get() {
|
|
958
|
-
return
|
|
958
|
+
return t(), e;
|
|
959
959
|
},
|
|
960
|
-
set(
|
|
961
|
-
|
|
960
|
+
set(t) {
|
|
961
|
+
e = t, requestAnimationFrame(() => {
|
|
962
962
|
requestAnimationFrame(() => {
|
|
963
963
|
n();
|
|
964
964
|
});
|
|
@@ -966,11 +966,11 @@ function Lt(t) {
|
|
|
966
966
|
}
|
|
967
967
|
}));
|
|
968
968
|
}
|
|
969
|
-
var
|
|
969
|
+
var zt = class extends V {
|
|
970
970
|
constructor(e = {}) {
|
|
971
|
-
return super(e), this.contentComponent = null, this.appContext = null, this.reactiveState =
|
|
971
|
+
return super(e), this.contentComponent = null, this.appContext = null, this.reactiveState = Rt(this.view.state), this.reactiveExtensionStorage = Rt(this.extensionStorage), this.on("beforeTransaction", ({ nextState: e }) => {
|
|
972
972
|
this.reactiveState.value = e, this.reactiveExtensionStorage.value = this.extensionStorage;
|
|
973
|
-
}),
|
|
973
|
+
}), D(this);
|
|
974
974
|
}
|
|
975
975
|
get state() {
|
|
976
976
|
return this.reactiveState ? this.reactiveState.value : this.view.state;
|
|
@@ -986,36 +986,36 @@ var Rt = class extends Te {
|
|
|
986
986
|
let t = super.unregisterPlugin(e);
|
|
987
987
|
return this.reactiveState && t && (this.reactiveState.value = t), t;
|
|
988
988
|
}
|
|
989
|
-
},
|
|
989
|
+
}, Bt = l({
|
|
990
990
|
name: "EditorContent",
|
|
991
991
|
props: { editor: {
|
|
992
992
|
default: null,
|
|
993
993
|
type: Object
|
|
994
994
|
} },
|
|
995
995
|
setup(e) {
|
|
996
|
-
let t =
|
|
997
|
-
return
|
|
996
|
+
let t = S(), n = u();
|
|
997
|
+
return y(() => {
|
|
998
998
|
let r = e.editor;
|
|
999
|
-
r && r.options.element && t.value &&
|
|
999
|
+
r && r.options.element && t.value && ee(() => {
|
|
1000
1000
|
if (!t.value || !r.view.dom?.parentNode) return;
|
|
1001
|
-
let e =
|
|
1001
|
+
let e = C(t.value);
|
|
1002
1002
|
t.value.append(...r.view.dom.parentNode.childNodes), r.contentComponent = n.ctx._, n && (r.appContext = {
|
|
1003
1003
|
...n.appContext,
|
|
1004
1004
|
provides: n.provides
|
|
1005
1005
|
}), r.setOptions({ element: e }), r.createNodeViews();
|
|
1006
1006
|
});
|
|
1007
|
-
}),
|
|
1007
|
+
}), se(() => {
|
|
1008
1008
|
let t = e.editor;
|
|
1009
1009
|
t && (t.contentComponent = null, t.appContext = null);
|
|
1010
1010
|
}), { rootEl: t };
|
|
1011
1011
|
},
|
|
1012
1012
|
render() {
|
|
1013
|
-
return
|
|
1013
|
+
return f("div", { ref: (e) => {
|
|
1014
1014
|
this.rootEl = e;
|
|
1015
1015
|
} });
|
|
1016
1016
|
}
|
|
1017
1017
|
});
|
|
1018
|
-
|
|
1018
|
+
l({
|
|
1019
1019
|
name: "NodeViewContent",
|
|
1020
1020
|
props: { as: {
|
|
1021
1021
|
type: String,
|
|
@@ -1031,13 +1031,13 @@ C({
|
|
|
1031
1031
|
e && e(null);
|
|
1032
1032
|
},
|
|
1033
1033
|
render() {
|
|
1034
|
-
return
|
|
1034
|
+
return f(this.as, {
|
|
1035
1035
|
style: { whiteSpace: "pre-wrap" },
|
|
1036
1036
|
"data-node-view-content": ""
|
|
1037
1037
|
});
|
|
1038
1038
|
}
|
|
1039
1039
|
});
|
|
1040
|
-
var
|
|
1040
|
+
var Vt = l({
|
|
1041
1041
|
name: "NodeViewWrapper",
|
|
1042
1042
|
props: { as: {
|
|
1043
1043
|
type: String,
|
|
@@ -1046,24 +1046,24 @@ var Bt = C({
|
|
|
1046
1046
|
inject: ["onDragStart", "decorationClasses"],
|
|
1047
1047
|
render() {
|
|
1048
1048
|
var e;
|
|
1049
|
-
return
|
|
1049
|
+
return f(this.as, {
|
|
1050
1050
|
class: this.decorationClasses,
|
|
1051
1051
|
style: { whiteSpace: "normal" },
|
|
1052
1052
|
"data-node-view-wrapper": "",
|
|
1053
1053
|
onDragstart: this.onDragStart
|
|
1054
1054
|
}, (e = this.$slots).default?.call(e));
|
|
1055
1055
|
}
|
|
1056
|
-
}),
|
|
1057
|
-
let
|
|
1058
|
-
return
|
|
1059
|
-
|
|
1060
|
-
}),
|
|
1056
|
+
}), Ht = (e = {}) => {
|
|
1057
|
+
let n = ne();
|
|
1058
|
+
return t(() => {
|
|
1059
|
+
n.value = new zt(e);
|
|
1060
|
+
}), se(() => {
|
|
1061
1061
|
var e;
|
|
1062
|
-
(e =
|
|
1063
|
-
}),
|
|
1064
|
-
},
|
|
1062
|
+
(e = n.value) == null || e.destroy();
|
|
1063
|
+
}), n;
|
|
1064
|
+
}, Ut = class {
|
|
1065
1065
|
constructor(e, { props: t = {}, editor: n }) {
|
|
1066
|
-
this.destroyed = !1, this.editor = n, this.component =
|
|
1066
|
+
this.destroyed = !1, this.editor = n, this.component = D(e), this.el = document.createElement("div"), this.props = re(t), this.renderedComponent = this.renderComponent();
|
|
1067
1067
|
}
|
|
1068
1068
|
get element() {
|
|
1069
1069
|
return this.renderedComponent.el;
|
|
@@ -1073,11 +1073,11 @@ var Bt = C({
|
|
|
1073
1073
|
}
|
|
1074
1074
|
renderComponent() {
|
|
1075
1075
|
if (this.destroyed) return this.renderedComponent;
|
|
1076
|
-
let e =
|
|
1077
|
-
return this.editor.appContext && (e.appContext = this.editor.appContext), typeof document < "u" && this.el &&
|
|
1076
|
+
let e = f(this.component, this.props);
|
|
1077
|
+
return this.editor.appContext && (e.appContext = this.editor.appContext), typeof document < "u" && this.el && O(e, this.el), {
|
|
1078
1078
|
vNode: e,
|
|
1079
1079
|
destroy: () => {
|
|
1080
|
-
this.el &&
|
|
1080
|
+
this.el && O(null, this.el), this.el = null, e = null;
|
|
1081
1081
|
},
|
|
1082
1082
|
el: this.el ? this.el.firstElementChild : null
|
|
1083
1083
|
};
|
|
@@ -1091,20 +1091,20 @@ var Bt = C({
|
|
|
1091
1091
|
this.destroyed || (this.destroyed = !0, this.renderedComponent.destroy());
|
|
1092
1092
|
}
|
|
1093
1093
|
};
|
|
1094
|
-
|
|
1094
|
+
l({
|
|
1095
1095
|
name: "MarkViewContent",
|
|
1096
1096
|
props: { as: {
|
|
1097
1097
|
type: String,
|
|
1098
1098
|
default: "span"
|
|
1099
1099
|
} },
|
|
1100
1100
|
render() {
|
|
1101
|
-
return
|
|
1101
|
+
return f(this.as, {
|
|
1102
1102
|
style: { whiteSpace: "inherit" },
|
|
1103
1103
|
"data-mark-view-content": ""
|
|
1104
1104
|
});
|
|
1105
1105
|
}
|
|
1106
1106
|
});
|
|
1107
|
-
var
|
|
1107
|
+
var Wt = {
|
|
1108
1108
|
editor: {
|
|
1109
1109
|
type: Object,
|
|
1110
1110
|
required: !0
|
|
@@ -1149,7 +1149,7 @@ var Ut = {
|
|
|
1149
1149
|
type: Object,
|
|
1150
1150
|
required: !0
|
|
1151
1151
|
}
|
|
1152
|
-
},
|
|
1152
|
+
}, Gt = class extends ke {
|
|
1153
1153
|
constructor(e, t, n) {
|
|
1154
1154
|
super(e, t, n), this.cachedExtensionWithSyncedStorage = null, this.handlePositionUpdate = () => {
|
|
1155
1155
|
let e = this.getPos();
|
|
@@ -1179,14 +1179,14 @@ var Ut = {
|
|
|
1179
1179
|
updateAttributes: (e = {}) => this.updateAttributes(e),
|
|
1180
1180
|
deleteNode: () => this.deleteNode()
|
|
1181
1181
|
}, t = e, n = this.onDragStart.bind(this);
|
|
1182
|
-
this.decorationClasses =
|
|
1183
|
-
let r =
|
|
1182
|
+
this.decorationClasses = S(this.getDecorationClasses());
|
|
1183
|
+
let r = l({
|
|
1184
1184
|
extends: { ...this.component },
|
|
1185
1185
|
props: Object.keys(e),
|
|
1186
1186
|
template: this.component.template,
|
|
1187
1187
|
setup: (e) => {
|
|
1188
1188
|
var t;
|
|
1189
|
-
return
|
|
1189
|
+
return h("onDragStart", n), h("decorationClasses", this.decorationClasses), h("nodeViewContentRef", (e) => {
|
|
1190
1190
|
this.contentDOMElement && e && e.firstChild !== this.contentDOMElement && e.appendChild(this.contentDOMElement);
|
|
1191
1191
|
}), (t = this.component).setup?.call(t, e, { expose: () => void 0 });
|
|
1192
1192
|
},
|
|
@@ -1195,7 +1195,7 @@ var Ut = {
|
|
|
1195
1195
|
__name: this.component.__name,
|
|
1196
1196
|
__file: this.component.__file
|
|
1197
1197
|
});
|
|
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
|
|
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 Ut(r, {
|
|
1199
1199
|
editor: this.editor,
|
|
1200
1200
|
props: t
|
|
1201
1201
|
});
|
|
@@ -1209,7 +1209,7 @@ var Ut = {
|
|
|
1209
1209
|
}
|
|
1210
1210
|
handleSelectionUpdate() {
|
|
1211
1211
|
let e = this.getPos();
|
|
1212
|
-
if (typeof e == "number") if (
|
|
1212
|
+
if (typeof e == "number") if (we({
|
|
1213
1213
|
selection: this.editor.state.selection,
|
|
1214
1214
|
pos: e,
|
|
1215
1215
|
nodeSize: this.node.nodeSize,
|
|
@@ -1267,44 +1267,44 @@ var Ut = {
|
|
|
1267
1267
|
this.renderer.destroy(), this.editor.off("selectionUpdate", this.handleSelectionUpdate), this.options.trackNodeViewPosition && this.editor.off("update", this.handlePositionUpdate), this.contentDOMElement = null;
|
|
1268
1268
|
}
|
|
1269
1269
|
};
|
|
1270
|
-
function
|
|
1271
|
-
return (n) => n.editor.contentComponent ? new
|
|
1270
|
+
function Kt(e, t) {
|
|
1271
|
+
return (n) => n.editor.contentComponent ? new Gt(typeof e == "function" && "__vccOpts" in e ? e.__vccOpts : e, n, t) : {};
|
|
1272
1272
|
}
|
|
1273
1273
|
//#endregion
|
|
1274
1274
|
//#region src/ai.ts
|
|
1275
|
-
var
|
|
1275
|
+
var qt = [
|
|
1276
1276
|
"proofread",
|
|
1277
1277
|
"rewrite",
|
|
1278
1278
|
"shorten",
|
|
1279
1279
|
"expand"
|
|
1280
1280
|
];
|
|
1281
|
-
function
|
|
1281
|
+
function Jt(e) {
|
|
1282
1282
|
console.warn(`[bygga-editor] ${e}`);
|
|
1283
1283
|
}
|
|
1284
|
-
function
|
|
1284
|
+
function Yt(e) {
|
|
1285
1285
|
if (!e) return [];
|
|
1286
|
-
if (typeof e.run != "function") return
|
|
1287
|
-
if (!Array.isArray(e.actions)) return
|
|
1286
|
+
if (typeof e.run != "function") return Jt("config.ai: `run` must be a function — ignoring the AI configuration."), [];
|
|
1287
|
+
if (!Array.isArray(e.actions)) return Jt("config.ai: `actions` must be an array — offering no AI actions."), [];
|
|
1288
1288
|
let t = /* @__PURE__ */ new Set();
|
|
1289
1289
|
for (let n of e.actions) {
|
|
1290
|
-
if (!
|
|
1291
|
-
|
|
1290
|
+
if (!qt.includes(n)) {
|
|
1291
|
+
Jt(`config.ai: "${String(n)}" is not a known AI action — ignoring it.`);
|
|
1292
1292
|
continue;
|
|
1293
1293
|
}
|
|
1294
1294
|
t.add(n);
|
|
1295
1295
|
}
|
|
1296
|
-
return e.actions.length > 0 && t.size === 0 &&
|
|
1296
|
+
return e.actions.length > 0 && t.size === 0 && Jt("config.ai: no usable actions — offering no AI controls."), qt.filter((e) => t.has(e));
|
|
1297
1297
|
}
|
|
1298
1298
|
//#endregion
|
|
1299
1299
|
//#region src/components/AiActionPicker.vue?vue&type=script&setup=true&lang.ts
|
|
1300
|
-
var
|
|
1300
|
+
var Xt = [
|
|
1301
1301
|
"disabled",
|
|
1302
1302
|
"aria-busy",
|
|
1303
1303
|
"title",
|
|
1304
1304
|
"aria-label",
|
|
1305
1305
|
"popovertarget",
|
|
1306
1306
|
"aria-expanded"
|
|
1307
|
-
],
|
|
1307
|
+
], Zt = ["id", "aria-label"], Qt = { class: "ai-list" }, $t = ["onClick"], en = { class: "ai-option-label" }, tn = { class: "ai-option-hint" }, nn = /*#__PURE__*/ N(/* @__PURE__ */ l({
|
|
1308
1308
|
__name: "AiActionPicker",
|
|
1309
1309
|
props: {
|
|
1310
1310
|
actions: { type: Array },
|
|
@@ -1314,155 +1314,155 @@ var Yt = [
|
|
|
1314
1314
|
}
|
|
1315
1315
|
},
|
|
1316
1316
|
emits: ["select"],
|
|
1317
|
-
setup(
|
|
1318
|
-
let
|
|
1319
|
-
function
|
|
1317
|
+
setup(t, { emit: r }) {
|
|
1318
|
+
let i = r, { t: o } = he(), s = ie(), c = v("trigger"), l = v("popover"), u = k(() => l.value?.matches(":popover-open") ?? !1);
|
|
1319
|
+
function f(e) {
|
|
1320
1320
|
if (e.newState !== "open") return;
|
|
1321
|
-
let t =
|
|
1321
|
+
let t = l.value, n = c.value?.getBoundingClientRect();
|
|
1322
1322
|
t && n && (t.style.left = `${n.left}px`, t.style.top = `${n.bottom + 4}px`);
|
|
1323
1323
|
}
|
|
1324
|
-
function
|
|
1325
|
-
let t = e.relatedTarget, n =
|
|
1324
|
+
function p(e) {
|
|
1325
|
+
let t = e.relatedTarget, n = l.value;
|
|
1326
1326
|
t instanceof Node && n?.contains(t) || n?.matches(":popover-open") && n.hidePopover();
|
|
1327
1327
|
}
|
|
1328
|
-
function
|
|
1329
|
-
|
|
1328
|
+
function ee(e) {
|
|
1329
|
+
i("select", e), l.value?.hidePopover();
|
|
1330
1330
|
}
|
|
1331
|
-
return (
|
|
1331
|
+
return (r, i) => (a(), d(A, null, [t.actions.length ? (a(), d("button", {
|
|
1332
1332
|
key: 0,
|
|
1333
1333
|
ref_key: "trigger",
|
|
1334
|
-
ref:
|
|
1334
|
+
ref: c,
|
|
1335
1335
|
type: "button",
|
|
1336
|
-
class:
|
|
1337
|
-
disabled:
|
|
1338
|
-
"aria-busy":
|
|
1339
|
-
title:
|
|
1340
|
-
"aria-label":
|
|
1341
|
-
popovertarget:
|
|
1336
|
+
class: T(["ai-trigger", { active: u.value }]),
|
|
1337
|
+
disabled: t.pending,
|
|
1338
|
+
"aria-busy": t.pending,
|
|
1339
|
+
title: C(o)("blocks.text.ai.label"),
|
|
1340
|
+
"aria-label": C(o)("blocks.text.ai.label"),
|
|
1341
|
+
popovertarget: C(s),
|
|
1342
1342
|
"aria-haspopup": "dialog",
|
|
1343
|
-
"aria-expanded":
|
|
1344
|
-
onMousedown: i[0] ||=
|
|
1345
|
-
}, [
|
|
1343
|
+
"aria-expanded": u.value,
|
|
1344
|
+
onMousedown: i[0] ||= x(() => {}, ["prevent"])
|
|
1345
|
+
}, [e(j, {
|
|
1346
1346
|
name: "sparkles",
|
|
1347
1347
|
size: 16
|
|
1348
|
-
})], 42,
|
|
1348
|
+
})], 42, Xt)) : n("", !0), t.actions.length ? (a(), d("div", {
|
|
1349
1349
|
key: 1,
|
|
1350
|
-
id:
|
|
1350
|
+
id: C(s),
|
|
1351
1351
|
ref_key: "popover",
|
|
1352
|
-
ref:
|
|
1352
|
+
ref: l,
|
|
1353
1353
|
class: "ai-popover",
|
|
1354
1354
|
popover: "",
|
|
1355
1355
|
role: "dialog",
|
|
1356
|
-
"aria-label":
|
|
1357
|
-
onBeforetoggle:
|
|
1358
|
-
onFocusout:
|
|
1359
|
-
}, [
|
|
1356
|
+
"aria-label": C(o)("blocks.text.ai.label"),
|
|
1357
|
+
onBeforetoggle: f,
|
|
1358
|
+
onFocusout: p
|
|
1359
|
+
}, [m("ul", Qt, [(a(!0), d(A, null, g(t.actions, (e) => (a(), d("li", { key: e }, [m("button", {
|
|
1360
1360
|
type: "button",
|
|
1361
1361
|
class: "ai-option",
|
|
1362
|
-
onClick: (t) =>
|
|
1363
|
-
onMousedown: i[1] ||=
|
|
1364
|
-
}, [
|
|
1362
|
+
onClick: (t) => ee(e),
|
|
1363
|
+
onMousedown: i[1] ||= x(() => {}, ["prevent"])
|
|
1364
|
+
}, [m("span", en, E(C(o)(`blocks.text.ai.actions.${e}.label`)), 1), m("span", tn, E(C(o)(`blocks.text.ai.actions.${e}.hint`)), 1)], 40, $t)]))), 128))])], 40, Zt)) : n("", !0)], 64));
|
|
1365
1365
|
}
|
|
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"]]),
|
|
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"]]), rn = [
|
|
1367
1367
|
"title",
|
|
1368
1368
|
"aria-label",
|
|
1369
1369
|
"popovertarget",
|
|
1370
1370
|
"aria-expanded"
|
|
1371
|
-
],
|
|
1371
|
+
], an = ["id", "aria-label"], on = {
|
|
1372
1372
|
key: 0,
|
|
1373
1373
|
class: "merge-tag-list"
|
|
1374
|
-
},
|
|
1374
|
+
}, sn = ["onClick"], cn = { class: "merge-tag-option-label" }, ln = { class: "merge-tag-option-id" }, un = {
|
|
1375
1375
|
key: 1,
|
|
1376
1376
|
class: "merge-tag-empty"
|
|
1377
|
-
},
|
|
1377
|
+
}, dn = /*#__PURE__*/ N(/* @__PURE__ */ l({
|
|
1378
1378
|
__name: "MergeTagPicker",
|
|
1379
1379
|
emits: ["select"],
|
|
1380
|
-
setup(
|
|
1381
|
-
let
|
|
1380
|
+
setup(t, { emit: r }) {
|
|
1381
|
+
let o = r, { t: s, locale: c } = he(), l = i(We, k(() => ({}))), u = k(() => z(l.value).map((e) => ({
|
|
1382
1382
|
id: e,
|
|
1383
|
-
label:
|
|
1384
|
-
}))),
|
|
1385
|
-
let e =
|
|
1386
|
-
return e ?
|
|
1387
|
-
}),
|
|
1388
|
-
function
|
|
1383
|
+
label: Ie(l.value, e, c.value)
|
|
1384
|
+
}))), f = S(""), p = k(() => {
|
|
1385
|
+
let e = f.value.trim().toLowerCase();
|
|
1386
|
+
return e ? u.value.filter((t) => t.label.toLowerCase().includes(e) || t.id.toLowerCase().includes(e)) : u.value;
|
|
1387
|
+
}), h = ie(), _ = k(() => b.value?.matches(":popover-open") ?? !1), y = v("trigger"), b = v("popover"), w = v("filterInput");
|
|
1388
|
+
function D(e) {
|
|
1389
1389
|
if (e.newState !== "open") return;
|
|
1390
|
-
|
|
1391
|
-
let t = b.value, n =
|
|
1390
|
+
f.value = "";
|
|
1391
|
+
let t = b.value, n = y.value?.getBoundingClientRect();
|
|
1392
1392
|
t && n && (t.style.left = `${n.left}px`, t.style.top = `${n.bottom + 4}px`);
|
|
1393
1393
|
}
|
|
1394
|
-
function
|
|
1395
|
-
e.newState === "open" &&
|
|
1394
|
+
function te(e) {
|
|
1395
|
+
e.newState === "open" && ee(() => w.value?.focus());
|
|
1396
1396
|
}
|
|
1397
|
-
function
|
|
1397
|
+
function ne(e) {
|
|
1398
1398
|
let t = e.relatedTarget, n = b.value;
|
|
1399
1399
|
t instanceof Node && n?.contains(t) || n?.matches(":popover-open") && n.hidePopover();
|
|
1400
1400
|
}
|
|
1401
|
-
function
|
|
1402
|
-
|
|
1401
|
+
function O(e) {
|
|
1402
|
+
o("select", e), b.value?.hidePopover();
|
|
1403
1403
|
}
|
|
1404
|
-
return (
|
|
1404
|
+
return (t, r) => (a(), d(A, null, [u.value.length ? (a(), d("button", {
|
|
1405
1405
|
key: 0,
|
|
1406
1406
|
ref_key: "trigger",
|
|
1407
|
-
ref:
|
|
1407
|
+
ref: y,
|
|
1408
1408
|
type: "button",
|
|
1409
|
-
class:
|
|
1410
|
-
title:
|
|
1411
|
-
"aria-label":
|
|
1412
|
-
popovertarget:
|
|
1409
|
+
class: T(["merge-tag-trigger", { active: _.value }]),
|
|
1410
|
+
title: C(s)("blocks.text.mergeTag"),
|
|
1411
|
+
"aria-label": C(s)("blocks.text.mergeTag"),
|
|
1412
|
+
popovertarget: C(h),
|
|
1413
1413
|
"aria-haspopup": "dialog",
|
|
1414
|
-
"aria-expanded":
|
|
1415
|
-
onMousedown:
|
|
1416
|
-
}, [
|
|
1414
|
+
"aria-expanded": _.value,
|
|
1415
|
+
onMousedown: r[0] ||= x(() => {}, ["prevent"])
|
|
1416
|
+
}, [e(j, {
|
|
1417
1417
|
name: "braces",
|
|
1418
1418
|
size: 16
|
|
1419
|
-
})], 42,
|
|
1419
|
+
})], 42, rn)) : n("", !0), u.value.length ? (a(), d("div", {
|
|
1420
1420
|
key: 1,
|
|
1421
|
-
id:
|
|
1421
|
+
id: C(h),
|
|
1422
1422
|
ref_key: "popover",
|
|
1423
1423
|
ref: b,
|
|
1424
1424
|
class: "merge-tag-popover",
|
|
1425
1425
|
popover: "",
|
|
1426
1426
|
role: "dialog",
|
|
1427
|
-
"aria-label":
|
|
1428
|
-
onBeforetoggle:
|
|
1429
|
-
onToggle:
|
|
1430
|
-
onFocusout:
|
|
1431
|
-
}, [
|
|
1427
|
+
"aria-label": C(s)("blocks.text.mergeTag"),
|
|
1428
|
+
onBeforetoggle: D,
|
|
1429
|
+
onToggle: te,
|
|
1430
|
+
onFocusout: ne
|
|
1431
|
+
}, [e(ve, {
|
|
1432
1432
|
ref_key: "filterInput",
|
|
1433
|
-
ref:
|
|
1434
|
-
modelValue:
|
|
1435
|
-
"onUpdate:modelValue":
|
|
1433
|
+
ref: w,
|
|
1434
|
+
modelValue: f.value,
|
|
1435
|
+
"onUpdate:modelValue": r[1] ||= (e) => f.value = e,
|
|
1436
1436
|
autocomplete: "off",
|
|
1437
|
-
placeholder:
|
|
1438
|
-
"aria-label":
|
|
1437
|
+
placeholder: C(s)("blocks.text.mergeTagSearch"),
|
|
1438
|
+
"aria-label": C(s)("blocks.text.mergeTagSearch"),
|
|
1439
1439
|
spellcheck: "false"
|
|
1440
1440
|
}, null, 8, [
|
|
1441
1441
|
"modelValue",
|
|
1442
1442
|
"placeholder",
|
|
1443
1443
|
"aria-label"
|
|
1444
|
-
]),
|
|
1444
|
+
]), p.value.length ? (a(), d("ul", on, [(a(!0), d(A, null, g(p.value, (e) => (a(), d("li", { key: e.id }, [m("button", {
|
|
1445
1445
|
type: "button",
|
|
1446
1446
|
class: "merge-tag-option",
|
|
1447
|
-
onClick: (t) =>
|
|
1448
|
-
onMousedown:
|
|
1449
|
-
}, [
|
|
1447
|
+
onClick: (t) => O(e.id),
|
|
1448
|
+
onMousedown: r[2] ||= x(() => {}, ["prevent"])
|
|
1449
|
+
}, [m("span", cn, E(e.label), 1), m("span", ln, E(e.id), 1)], 40, sn)]))), 128))])) : (a(), d("p", un, E(C(s)("blocks.text.mergeTagEmpty")), 1))], 40, an)) : n("", !0)], 64));
|
|
1450
1450
|
}
|
|
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"]]),
|
|
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"]]), fn = /* @__PURE__ */ l({
|
|
1452
1452
|
__name: "MergeTagView",
|
|
1453
|
-
props:
|
|
1453
|
+
props: Wt,
|
|
1454
1454
|
setup(e) {
|
|
1455
|
-
let
|
|
1456
|
-
return (e, t) => (
|
|
1455
|
+
let t = e, { t: n, locale: o } = he(), s = i(We, k(() => ({}))), c = k(() => String(t.node.attrs.id ?? "")), l = k(() => s.value[c.value] !== void 0), u = k(() => Ie(s.value, c.value, o.value)), d = k(() => n("blocks.text.mergeTagChip", { name: u.value }));
|
|
1456
|
+
return (e, t) => (a(), r(C(Vt), {
|
|
1457
1457
|
as: "span",
|
|
1458
|
-
class:
|
|
1459
|
-
"data-merge-tag":
|
|
1458
|
+
class: T(["merge-tag", { "is-unknown": !l.value }]),
|
|
1459
|
+
"data-merge-tag": c.value,
|
|
1460
1460
|
contenteditable: "false",
|
|
1461
1461
|
role: "img",
|
|
1462
|
-
"aria-label":
|
|
1463
|
-
title:
|
|
1462
|
+
"aria-label": d.value,
|
|
1463
|
+
title: d.value
|
|
1464
1464
|
}, {
|
|
1465
|
-
default:
|
|
1465
|
+
default: p(() => [te(E(u.value), 1)]),
|
|
1466
1466
|
_: 1
|
|
1467
1467
|
}, 8, [
|
|
1468
1468
|
"class",
|
|
@@ -1474,83 +1474,86 @@ var Yt = [
|
|
|
1474
1474
|
});
|
|
1475
1475
|
//#endregion
|
|
1476
1476
|
//#region src/fontSizes.ts
|
|
1477
|
-
function
|
|
1477
|
+
function pn(e) {
|
|
1478
1478
|
return `${e}px`;
|
|
1479
1479
|
}
|
|
1480
|
-
var
|
|
1481
|
-
function
|
|
1480
|
+
var mn = new Set(le.map(pn));
|
|
1481
|
+
function hn(e) {
|
|
1482
1482
|
let t = e.trim();
|
|
1483
|
-
return
|
|
1483
|
+
return mn.has(t) ? t : null;
|
|
1484
1484
|
}
|
|
1485
|
-
function
|
|
1486
|
-
return
|
|
1485
|
+
function gn(e) {
|
|
1486
|
+
return mn.has(e);
|
|
1487
1487
|
}
|
|
1488
1488
|
//#endregion
|
|
1489
1489
|
//#region src/panels/contentPanel/components/blocks/sanitizePastedFonts.ts
|
|
1490
|
-
var
|
|
1491
|
-
function
|
|
1492
|
-
let t =
|
|
1490
|
+
var _n = "textStyle";
|
|
1491
|
+
function vn(e) {
|
|
1492
|
+
let t = Ne(e);
|
|
1493
1493
|
return !t || t.key === "verdana" ? null : t.stack;
|
|
1494
1494
|
}
|
|
1495
|
-
function
|
|
1496
|
-
if (e.type.name !==
|
|
1495
|
+
function yn(e, t) {
|
|
1496
|
+
if (e.type.name !== _n) return e;
|
|
1497
1497
|
let n = { ...e.attrs };
|
|
1498
|
-
return typeof n.fontFamily == "string" && !t?.has(n.fontFamily) && (n.fontFamily =
|
|
1498
|
+
return typeof n.fontFamily == "string" && !t?.has(n.fontFamily) && (n.fontFamily = vn(n.fontFamily)), typeof n.fontSize == "string" && (n.fontSize = hn(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
1499
|
}
|
|
1500
|
-
function
|
|
1500
|
+
function bn(e, t) {
|
|
1501
1501
|
return e.flatMap((e) => {
|
|
1502
|
-
let n =
|
|
1502
|
+
let n = yn(e, t);
|
|
1503
1503
|
return n ? [n] : [];
|
|
1504
1504
|
});
|
|
1505
1505
|
}
|
|
1506
|
-
function bn(e, t) {
|
|
1507
|
-
return e.isText ? e.mark(yn(e.marks, t)) : e.copy(xn(e.content, t)).mark(yn(e.marks, t));
|
|
1508
|
-
}
|
|
1509
1506
|
function xn(e, t) {
|
|
1510
|
-
|
|
1511
|
-
for (let r = 0; r < e.childCount; r++) n.push(bn(e.child(r), t));
|
|
1512
|
-
return M.fromArray(n);
|
|
1507
|
+
return e.isText ? e.mark(bn(e.marks, t)) : e.copy(Sn(e.content, t)).mark(bn(e.marks, t));
|
|
1513
1508
|
}
|
|
1514
1509
|
function Sn(e, t) {
|
|
1515
|
-
|
|
1510
|
+
let n = [];
|
|
1511
|
+
for (let r = 0; r < e.childCount; r++) n.push(xn(e.child(r), t));
|
|
1512
|
+
return P.fromArray(n);
|
|
1513
|
+
}
|
|
1514
|
+
function Cn(e, t) {
|
|
1515
|
+
return new ce(Sn(e.content, t), e.openStart, e.openEnd);
|
|
1516
1516
|
}
|
|
1517
1517
|
//#endregion
|
|
1518
1518
|
//#region src/panels/contentPanel/components/blocks/TextEditor.vue?vue&type=script&setup=true&lang.ts
|
|
1519
|
-
var
|
|
1519
|
+
var wn = { class: "picker" }, Tn = ["aria-label", "value"], En = {
|
|
1520
|
+
key: 0,
|
|
1521
|
+
value: "paragraph"
|
|
1522
|
+
}, Dn = ["value"], On = { class: "picker" }, kn = ["aria-label", "value"], An = {
|
|
1520
1523
|
value: "mixed",
|
|
1521
1524
|
disabled: "",
|
|
1522
1525
|
hidden: ""
|
|
1523
|
-
},
|
|
1526
|
+
}, jn = ["value"], Mn = ["value"], Nn = { class: "picker" }, Pn = ["aria-label", "value"], Fn = {
|
|
1524
1527
|
value: "mixed",
|
|
1525
1528
|
disabled: "",
|
|
1526
1529
|
hidden: ""
|
|
1527
|
-
},
|
|
1530
|
+
}, In = { value: "" }, Ln = ["value"], Rn = ["title", "aria-label"], zn = ["title", "aria-label"], Bn = ["title", "aria-label"], Vn = [
|
|
1528
1531
|
"title",
|
|
1529
1532
|
"popovertarget",
|
|
1530
1533
|
"aria-expanded"
|
|
1531
|
-
],
|
|
1534
|
+
], Hn = ["id", "aria-label"], Un = { class: "link-field" }, Wn = {
|
|
1532
1535
|
key: 0,
|
|
1533
1536
|
class: "link-anchor"
|
|
1534
|
-
},
|
|
1537
|
+
}, Gn = {
|
|
1535
1538
|
key: 0,
|
|
1536
1539
|
value: ""
|
|
1537
|
-
},
|
|
1540
|
+
}, Kn = {
|
|
1538
1541
|
key: 1,
|
|
1539
1542
|
value: "",
|
|
1540
1543
|
disabled: "",
|
|
1541
1544
|
hidden: ""
|
|
1542
|
-
},
|
|
1545
|
+
}, qn = ["value"], Jn = ["title", "aria-label"], Yn = ["title", "onClick"], Xn = {
|
|
1543
1546
|
"aria-hidden": "true",
|
|
1544
1547
|
height: "16",
|
|
1545
1548
|
viewBox: "0 0 16 16",
|
|
1546
1549
|
width: "16"
|
|
1547
|
-
},
|
|
1550
|
+
}, Zn = [
|
|
1548
1551
|
"width",
|
|
1549
1552
|
"x",
|
|
1550
1553
|
"y"
|
|
1551
|
-
],
|
|
1554
|
+
], Qn = 8, $n = 220, er = /*#__PURE__*/ N(/* @__PURE__ */ l({
|
|
1552
1555
|
__name: "TextEditor",
|
|
1553
|
-
props: /*@__PURE__*/
|
|
1556
|
+
props: /*@__PURE__*/ o({
|
|
1554
1557
|
editable: {
|
|
1555
1558
|
type: Boolean,
|
|
1556
1559
|
default: !1
|
|
@@ -1559,6 +1562,8 @@ var Cn = { class: "picker" }, wn = ["aria-label", "value"], Tn = { value: "parag
|
|
|
1559
1562
|
padding: { type: null },
|
|
1560
1563
|
borderRadius: { type: null },
|
|
1561
1564
|
border: { type: null },
|
|
1565
|
+
height: { type: Number },
|
|
1566
|
+
headerOnly: { type: Boolean },
|
|
1562
1567
|
availableWidth: { type: Number },
|
|
1563
1568
|
outerVmlBackground: { type: Boolean }
|
|
1564
1569
|
}, {
|
|
@@ -1566,82 +1571,82 @@ var Cn = { class: "picker" }, wn = ["aria-label", "value"], Tn = { value: "parag
|
|
|
1566
1571
|
textModifiers: {}
|
|
1567
1572
|
}),
|
|
1568
1573
|
emits: ["update:text"],
|
|
1569
|
-
setup(
|
|
1570
|
-
let
|
|
1574
|
+
setup(t) {
|
|
1575
|
+
let r = s(t, "text"), o = t, { t: l, locale: u } = he(), f = [
|
|
1571
1576
|
"left",
|
|
1572
1577
|
"center",
|
|
1573
1578
|
"right",
|
|
1574
1579
|
"justify"
|
|
1575
|
-
],
|
|
1576
|
-
...
|
|
1580
|
+
], h = k(() => l(o.headerOnly ? "blocks.header.label" : "blocks.text.label")), y = Ht({
|
|
1581
|
+
...Ee,
|
|
1577
1582
|
editorProps: {
|
|
1578
1583
|
attributes: {
|
|
1579
|
-
"aria-label":
|
|
1584
|
+
"aria-label": h.value,
|
|
1580
1585
|
"aria-multiline": "true",
|
|
1581
1586
|
role: "textbox"
|
|
1582
1587
|
},
|
|
1583
|
-
transformPasted: (e) =>
|
|
1588
|
+
transformPasted: (e) => Cn(e, ce.value)
|
|
1584
1589
|
},
|
|
1585
|
-
content:
|
|
1586
|
-
editable:
|
|
1590
|
+
content: Te(r.value),
|
|
1591
|
+
editable: o.editable,
|
|
1587
1592
|
extensions: [
|
|
1588
|
-
...
|
|
1589
|
-
|
|
1590
|
-
|
|
1593
|
+
...(o.headerOnly ? Re : me).map((e) => e.name === "mergeTag" ? e.extend({ addNodeView: () => Kt(fn) }) : e),
|
|
1594
|
+
Lt,
|
|
1595
|
+
Pt.configure({ placeholder: () => l(o.headerOnly ? "blocks.header.placeholder" : "blocks.text.placeholder") })
|
|
1591
1596
|
],
|
|
1592
1597
|
onUpdate({ editor: e }) {
|
|
1593
|
-
|
|
1598
|
+
r.value = je(e.getJSON()), O();
|
|
1594
1599
|
},
|
|
1595
1600
|
onSelectionUpdate() {
|
|
1596
|
-
|
|
1601
|
+
O();
|
|
1597
1602
|
}
|
|
1598
1603
|
});
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
}),
|
|
1602
|
-
let t =
|
|
1603
|
-
!t ||
|
|
1604
|
-
}),
|
|
1605
|
-
let
|
|
1604
|
+
_(h, (e) => {
|
|
1605
|
+
y.value?.setOptions({ editorProps: { attributes: { "aria-label": e } } });
|
|
1606
|
+
}), _(r, (e) => {
|
|
1607
|
+
let t = y.value;
|
|
1608
|
+
!t || Le(e, je(t.getJSON())) || t.commands.setContent(Te(e), { emitUpdate: !1 });
|
|
1609
|
+
}), _(() => o.editable, (e) => y.value?.setEditable(e));
|
|
1610
|
+
let w = v("root"), D = v("toolbar");
|
|
1606
1611
|
function te() {
|
|
1607
|
-
let e =
|
|
1608
|
-
!e || e.matches(":popover-open") || (e.showPopover(),
|
|
1612
|
+
let e = D.value;
|
|
1613
|
+
!e || e.matches(":popover-open") || (e.showPopover(), O());
|
|
1609
1614
|
}
|
|
1610
|
-
function
|
|
1615
|
+
function ne(e) {
|
|
1611
1616
|
let t = e.relatedTarget;
|
|
1612
|
-
t instanceof Node &&
|
|
1617
|
+
t instanceof Node && w.value?.contains(t) || D.value?.matches(":popover-open") && D.value.hidePopover();
|
|
1613
1618
|
}
|
|
1614
|
-
function
|
|
1615
|
-
let e =
|
|
1619
|
+
function O() {
|
|
1620
|
+
let e = y.value?.view, t = D.value, n = w.value;
|
|
1616
1621
|
if (!(e && t && n && t.matches(":popover-open"))) return;
|
|
1617
|
-
let r = n.closest(".block-container"), i = (r?.querySelector(":scope > .block-label") ?? r ?? n).getBoundingClientRect(), a = Math.max(
|
|
1618
|
-
t.style.left = `${o}px`, t.style.maxWidth = `${window.innerWidth - o -
|
|
1622
|
+
let r = n.closest(".block-container"), i = (r?.querySelector(":scope > .block-label") ?? r ?? n).getBoundingClientRect(), a = Math.max(Qn, window.innerWidth - $n - Qn), o = Math.min(Math.max(i.left, Qn), a);
|
|
1623
|
+
t.style.left = `${o}px`, t.style.maxWidth = `${window.innerWidth - o - Qn}px`, t.style.top = `${i.top}px`;
|
|
1619
1624
|
}
|
|
1620
|
-
function
|
|
1621
|
-
let e =
|
|
1622
|
-
if (!e) return "paragraph";
|
|
1623
|
-
let t =
|
|
1625
|
+
function re() {
|
|
1626
|
+
let e = y.value;
|
|
1627
|
+
if (!e) return o.headerOnly ? "h1" : "paragraph";
|
|
1628
|
+
let t = Me.find((t) => e.isActive("heading", { level: t }));
|
|
1624
1629
|
return t ? `h${t}` : "paragraph";
|
|
1625
1630
|
}
|
|
1626
1631
|
function se(e) {
|
|
1627
1632
|
let { target: t } = e;
|
|
1628
1633
|
if (!(t instanceof HTMLSelectElement)) return;
|
|
1629
|
-
let n =
|
|
1634
|
+
let n = y.value?.chain().focus();
|
|
1630
1635
|
if (!n) return;
|
|
1631
|
-
let r =
|
|
1632
|
-
r ? n.setHeading({ level: r }).run() : n.setParagraph().run();
|
|
1636
|
+
let r = Me.find((e) => `h${e}` === t.value);
|
|
1637
|
+
r ? n.setHeading({ level: r }).run() : o.headerOnly || n.setParagraph().run();
|
|
1633
1638
|
}
|
|
1634
|
-
let M =
|
|
1639
|
+
let M = i(b, k(() => pe)), N = ge(), ce = k(() => new Set(N.value.map((e) => e.stack)));
|
|
1635
1640
|
function P(e) {
|
|
1636
1641
|
return `custom:${e}`;
|
|
1637
1642
|
}
|
|
1638
1643
|
function F(e) {
|
|
1639
1644
|
if (typeof e != "string") return M.value;
|
|
1640
1645
|
let t = N.value.find((t) => t.stack === e);
|
|
1641
|
-
return t ? P(t.name) :
|
|
1646
|
+
return t ? P(t.name) : Ne(e)?.key ?? M.value;
|
|
1642
1647
|
}
|
|
1643
|
-
function
|
|
1644
|
-
let e =
|
|
1648
|
+
function de() {
|
|
1649
|
+
let e = y.value;
|
|
1645
1650
|
if (!e) return M.value;
|
|
1646
1651
|
let { from: t, to: n, empty: r } = e.state.selection;
|
|
1647
1652
|
if (r) return F(e.getAttributes("textStyle").fontFamily);
|
|
@@ -1654,62 +1659,62 @@ var Cn = { class: "picker" }, wn = ["aria-label", "value"], Tn = { value: "parag
|
|
|
1654
1659
|
let a = Array.from(i);
|
|
1655
1660
|
return a.length > 1 ? "mixed" : a[0] ?? M.value;
|
|
1656
1661
|
}
|
|
1657
|
-
function
|
|
1662
|
+
function I(e) {
|
|
1658
1663
|
let { target: t } = e;
|
|
1659
1664
|
if (!(t instanceof HTMLSelectElement)) return;
|
|
1660
|
-
let n = t.value, r =
|
|
1665
|
+
let n = t.value, r = y.value?.chain().focus();
|
|
1661
1666
|
if (!r) return;
|
|
1662
1667
|
let i = N.value.find((e) => P(e.name) === n);
|
|
1663
1668
|
if (i) {
|
|
1664
1669
|
r.setFontFamily(i.stack).run();
|
|
1665
1670
|
return;
|
|
1666
1671
|
}
|
|
1667
|
-
|
|
1672
|
+
_e(n) && (n === M.value ? r.unsetFontFamily().run() : r.setFontFamily(Be(n)).run());
|
|
1668
1673
|
}
|
|
1669
|
-
function
|
|
1670
|
-
return typeof e == "string" &&
|
|
1674
|
+
function L(e) {
|
|
1675
|
+
return typeof e == "string" && gn(e) ? e : "";
|
|
1671
1676
|
}
|
|
1672
|
-
function
|
|
1673
|
-
let e =
|
|
1677
|
+
function R() {
|
|
1678
|
+
let e = y.value;
|
|
1674
1679
|
if (!e) return "";
|
|
1675
1680
|
let { from: t, to: n, empty: r } = e.state.selection;
|
|
1676
|
-
if (r) return
|
|
1681
|
+
if (r) return L(e.getAttributes("textStyle").fontSize);
|
|
1677
1682
|
let i = /* @__PURE__ */ new Set();
|
|
1678
1683
|
e.state.doc.nodesBetween(t, n, (e) => {
|
|
1679
1684
|
if (!e.isText) return;
|
|
1680
1685
|
let t = e.marks.find((e) => e.type.name === "textStyle");
|
|
1681
|
-
i.add(
|
|
1686
|
+
i.add(L(t?.attrs.fontSize));
|
|
1682
1687
|
});
|
|
1683
1688
|
let a = Array.from(i);
|
|
1684
1689
|
return a.length > 1 ? "mixed" : a[0] ?? "";
|
|
1685
1690
|
}
|
|
1686
|
-
function
|
|
1691
|
+
function ye(e) {
|
|
1687
1692
|
let { target: t } = e;
|
|
1688
1693
|
if (!(t instanceof HTMLSelectElement)) return;
|
|
1689
|
-
let n =
|
|
1690
|
-
n && (t.value === "" ? n.unsetFontSize().run() :
|
|
1694
|
+
let n = y.value?.chain().focus();
|
|
1695
|
+
n && (t.value === "" ? n.unsetFontSize().run() : gn(t.value) && n.setFontSize(t.value).run());
|
|
1691
1696
|
}
|
|
1692
|
-
let
|
|
1693
|
-
let e =
|
|
1694
|
-
return
|
|
1695
|
-
}),
|
|
1697
|
+
let be = ze(() => {
|
|
1698
|
+
let e = de();
|
|
1699
|
+
return _e(e) ? e : void 0;
|
|
1700
|
+
}), Se = k({
|
|
1696
1701
|
get: () => {
|
|
1697
|
-
let e =
|
|
1702
|
+
let e = y.value?.getAttributes("textStyle").color, t = typeof e == "string" ? Fe(e) : void 0;
|
|
1698
1703
|
return t ? {
|
|
1699
1704
|
type: "color",
|
|
1700
1705
|
...t
|
|
1701
|
-
} :
|
|
1706
|
+
} : Oe;
|
|
1702
1707
|
},
|
|
1703
1708
|
set: (e) => {
|
|
1704
|
-
e.type !== "transparent" &&
|
|
1709
|
+
e.type !== "transparent" && y.value?.chain().setColor(Ce(e)).run();
|
|
1705
1710
|
}
|
|
1706
|
-
}),
|
|
1711
|
+
}), we = {
|
|
1707
1712
|
left: "blocks.text.alignLeft",
|
|
1708
1713
|
center: "blocks.text.alignCenter",
|
|
1709
1714
|
right: "blocks.text.alignRight",
|
|
1710
1715
|
justify: "blocks.text.alignJustify"
|
|
1711
1716
|
};
|
|
1712
|
-
function
|
|
1717
|
+
function ke(e) {
|
|
1713
1718
|
return (e === "justify" ? [
|
|
1714
1719
|
14,
|
|
1715
1720
|
14,
|
|
@@ -1729,47 +1734,47 @@ var Cn = { class: "picker" }, wn = ["aria-label", "value"], Tn = { value: "parag
|
|
|
1729
1734
|
};
|
|
1730
1735
|
});
|
|
1731
1736
|
}
|
|
1732
|
-
let
|
|
1737
|
+
let Ae = ie(), z = v("linkPopover"), B = v("linkInput"), Ie = v("linkTrigger"), V = S(""), Ue = S(!1), We = S(!1);
|
|
1733
1738
|
function H(e) {
|
|
1734
1739
|
if (e.newState !== "open") return;
|
|
1735
|
-
let t =
|
|
1736
|
-
V.value = typeof t == "string" ? t : "",
|
|
1737
|
-
let n =
|
|
1740
|
+
let t = y.value?.getAttributes("link")?.href;
|
|
1741
|
+
V.value = typeof t == "string" ? t : "", We.value = V.value !== "";
|
|
1742
|
+
let n = z.value, r = Ie.value?.getBoundingClientRect();
|
|
1738
1743
|
n && r && (n.style.left = `${r.left}px`, n.style.top = `${r.bottom + 4}px`);
|
|
1739
1744
|
}
|
|
1740
|
-
function
|
|
1741
|
-
if (
|
|
1742
|
-
let t =
|
|
1745
|
+
function Ge(e) {
|
|
1746
|
+
if (Ue.value = e.newState === "open", e.newState !== "open") return;
|
|
1747
|
+
let t = z.value;
|
|
1743
1748
|
if (t) {
|
|
1744
1749
|
let e = window.innerWidth - t.offsetWidth - 8;
|
|
1745
1750
|
Number.parseFloat(t.style.left) > e && (t.style.left = `${Math.max(8, e)}px`);
|
|
1746
1751
|
}
|
|
1747
|
-
|
|
1748
|
-
|
|
1752
|
+
ee(() => {
|
|
1753
|
+
B.value?.focus(), B.value?.select();
|
|
1749
1754
|
});
|
|
1750
1755
|
}
|
|
1751
|
-
function
|
|
1752
|
-
let t = e.relatedTarget, n =
|
|
1756
|
+
function U(e) {
|
|
1757
|
+
let t = e.relatedTarget, n = z.value;
|
|
1753
1758
|
t instanceof Node && n?.contains(t) || n?.hidePopover();
|
|
1754
1759
|
}
|
|
1755
|
-
function
|
|
1756
|
-
let e =
|
|
1760
|
+
function Ke() {
|
|
1761
|
+
let e = y.value?.chain().focus();
|
|
1757
1762
|
if (!e) return;
|
|
1758
|
-
let t =
|
|
1763
|
+
let t = Ve(V.value);
|
|
1759
1764
|
t === "" ? e.unsetLink().run() : e.setLink({
|
|
1760
1765
|
href: t,
|
|
1761
1766
|
target: t.startsWith("#") ? null : "_blank"
|
|
1762
|
-
}).run(),
|
|
1767
|
+
}).run(), z.value?.hidePopover();
|
|
1763
1768
|
}
|
|
1764
|
-
let
|
|
1769
|
+
let qe = i(ae, k(() => [])), Je = k(() => V.value.startsWith("#") && qe.value.includes(V.value.slice(1)) ? V.value.slice(1) : "");
|
|
1765
1770
|
function W(e) {
|
|
1766
1771
|
e === "" ? V.value.startsWith("#") && (V.value = "") : V.value = `#${e}`;
|
|
1767
1772
|
}
|
|
1768
|
-
function
|
|
1769
|
-
|
|
1773
|
+
function Ye() {
|
|
1774
|
+
y.value?.chain().focus().unsetLink().run(), z.value?.hidePopover();
|
|
1770
1775
|
}
|
|
1771
|
-
let
|
|
1772
|
-
function
|
|
1776
|
+
let Xe = i(xe), Ze = ue(), Qe = k(() => Yt(Xe?.value?.ai)), G = S(!1);
|
|
1777
|
+
function $e(e) {
|
|
1773
1778
|
let { from: t, to: n, empty: r } = e.state.selection;
|
|
1774
1779
|
if (!r) return {
|
|
1775
1780
|
from: t,
|
|
@@ -1781,16 +1786,16 @@ var Cn = { class: "picker" }, wn = ["aria-label", "value"], Tn = { value: "parag
|
|
|
1781
1786
|
to: i.content.size
|
|
1782
1787
|
};
|
|
1783
1788
|
}
|
|
1784
|
-
let K = (e, t, n) => e.state.doc.textBetween(t, n, " ", (e) => e.type.name === "mergeTag" ? `{{${e.attrs.id}}}` : ""),
|
|
1785
|
-
function
|
|
1789
|
+
let K = (e, t, n) => e.state.doc.textBetween(t, n, " ", (e) => e.type.name === "mergeTag" ? `{{${e.attrs.id}}}` : ""), et = /\{\{([A-Za-z0-9._-]+)\}\}/g;
|
|
1790
|
+
function tt(e) {
|
|
1786
1791
|
let t = [], n = 0;
|
|
1787
|
-
for (let r of e.matchAll(
|
|
1792
|
+
for (let r of e.matchAll(et)) {
|
|
1788
1793
|
let i = r[1];
|
|
1789
1794
|
i !== void 0 && (r.index > n && t.push({
|
|
1790
1795
|
type: "text",
|
|
1791
1796
|
text: e.slice(n, r.index)
|
|
1792
1797
|
}), t.push({
|
|
1793
|
-
type:
|
|
1798
|
+
type: Pe,
|
|
1794
1799
|
attrs: { id: i }
|
|
1795
1800
|
}), n = r.index + r[0].length);
|
|
1796
1801
|
}
|
|
@@ -1799,231 +1804,231 @@ var Cn = { class: "picker" }, wn = ["aria-label", "value"], Tn = { value: "parag
|
|
|
1799
1804
|
text: e.slice(n)
|
|
1800
1805
|
}), t;
|
|
1801
1806
|
}
|
|
1802
|
-
async function
|
|
1803
|
-
let t =
|
|
1807
|
+
async function nt(e) {
|
|
1808
|
+
let t = y.value, n = Xe?.value?.ai;
|
|
1804
1809
|
if (!(t && n) || G.value) return;
|
|
1805
|
-
let { from: r, to: i } =
|
|
1810
|
+
let { from: r, to: i } = $e(t), a = K(t, r, i);
|
|
1806
1811
|
if (a.trim() !== "") {
|
|
1807
1812
|
G.value = !0;
|
|
1808
1813
|
try {
|
|
1809
1814
|
let t = await n.run({
|
|
1810
1815
|
action: e,
|
|
1811
1816
|
text: a,
|
|
1812
|
-
locale:
|
|
1817
|
+
locale: u.value
|
|
1813
1818
|
});
|
|
1814
|
-
typeof t == "string" && t !== "" &&
|
|
1819
|
+
typeof t == "string" && t !== "" && y.value && y.value.chain().focus().insertContentAt({
|
|
1815
1820
|
from: r,
|
|
1816
1821
|
to: i
|
|
1817
|
-
},
|
|
1822
|
+
}, tt(t)).run();
|
|
1818
1823
|
} catch (e) {
|
|
1819
|
-
console.error("[bygga-editor] the AI action failed —", e),
|
|
1824
|
+
console.error("[bygga-editor] the AI action failed —", e), Ze?.show(l("blocks.text.ai.failed"));
|
|
1820
1825
|
} finally {
|
|
1821
1826
|
G.value = !1;
|
|
1822
1827
|
}
|
|
1823
1828
|
}
|
|
1824
1829
|
}
|
|
1825
1830
|
function q(e) {
|
|
1826
|
-
|
|
1827
|
-
type:
|
|
1831
|
+
y.value?.chain().focus().insertContent({
|
|
1832
|
+
type: Pe,
|
|
1828
1833
|
attrs: { id: e }
|
|
1829
1834
|
}).run();
|
|
1830
1835
|
}
|
|
1831
|
-
return (
|
|
1836
|
+
return (t, r) => (a(), d("div", {
|
|
1832
1837
|
ref_key: "root",
|
|
1833
|
-
ref:
|
|
1838
|
+
ref: w,
|
|
1834
1839
|
style: {
|
|
1835
1840
|
position: "relative",
|
|
1836
1841
|
width: "100%"
|
|
1837
1842
|
},
|
|
1838
1843
|
onFocusin: te,
|
|
1839
|
-
onFocusout:
|
|
1840
|
-
}, [
|
|
1841
|
-
editor:
|
|
1842
|
-
style:
|
|
1843
|
-
}), null, 16, ["editor", "style"]),
|
|
1844
|
+
onFocusout: ne
|
|
1845
|
+
}, [e(C(Bt), c(o.editable ? { class: "text-input" } : {}, {
|
|
1846
|
+
editor: C(y),
|
|
1847
|
+
style: C(fe)(o)
|
|
1848
|
+
}), null, 16, ["editor", "style"]), o.editable ? (a(), d("div", {
|
|
1844
1849
|
key: 0,
|
|
1845
1850
|
ref_key: "toolbar",
|
|
1846
|
-
ref:
|
|
1851
|
+
ref: D,
|
|
1847
1852
|
popover: "manual",
|
|
1848
1853
|
class: "toolbar"
|
|
1849
1854
|
}, [
|
|
1850
|
-
|
|
1851
|
-
"aria-label":
|
|
1855
|
+
m("span", wn, [m("select", {
|
|
1856
|
+
"aria-label": C(l)("blocks.text.styleLabel"),
|
|
1852
1857
|
class: "style",
|
|
1853
|
-
value:
|
|
1858
|
+
value: re(),
|
|
1854
1859
|
onChange: se,
|
|
1855
|
-
onMousedown:
|
|
1856
|
-
}, [
|
|
1860
|
+
onMousedown: r[0] ||= x(() => {}, ["stop"])
|
|
1861
|
+
}, [o.headerOnly ? n("", !0) : (a(), d("option", En, E(C(l)("blocks.text.styleNormal")), 1)), (a(!0), d(A, null, g(C(Me), (e) => (a(), d("option", {
|
|
1857
1862
|
key: e,
|
|
1858
1863
|
value: `h${e}`
|
|
1859
|
-
},
|
|
1864
|
+
}, E(C(l)("blocks.text.styleHeading", { level: e })), 9, Dn))), 128))], 40, Tn), e(j, {
|
|
1860
1865
|
class: "picker-chevron",
|
|
1861
1866
|
name: "chevron-down",
|
|
1862
1867
|
size: 12
|
|
1863
1868
|
})]),
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
"aria-label":
|
|
1869
|
+
r[20] ||= m("span", { class: "divider" }, null, -1),
|
|
1870
|
+
m("span", On, [m("select", {
|
|
1871
|
+
"aria-label": C(l)("blocks.text.font"),
|
|
1867
1872
|
class: "font",
|
|
1868
|
-
value:
|
|
1869
|
-
onChange:
|
|
1870
|
-
onMousedown:
|
|
1873
|
+
value: de(),
|
|
1874
|
+
onChange: I,
|
|
1875
|
+
onMousedown: r[1] ||= x(() => {}, ["stop"])
|
|
1871
1876
|
}, [
|
|
1872
|
-
|
|
1873
|
-
(
|
|
1877
|
+
m("option", An, E(C(l)("blocks.text.fontMixed")), 1),
|
|
1878
|
+
(a(!0), d(A, null, g(C(be), (e) => (a(), d("option", {
|
|
1874
1879
|
key: e.key,
|
|
1875
1880
|
value: e.key
|
|
1876
|
-
},
|
|
1877
|
-
(
|
|
1881
|
+
}, E(e.name), 9, jn))), 128)),
|
|
1882
|
+
(a(!0), d(A, null, g(C(N), (e) => (a(), d("option", {
|
|
1878
1883
|
key: P(e.name),
|
|
1879
1884
|
value: P(e.name)
|
|
1880
|
-
},
|
|
1881
|
-
], 40,
|
|
1885
|
+
}, E(e.name), 9, Mn))), 128))
|
|
1886
|
+
], 40, kn), e(j, {
|
|
1882
1887
|
class: "picker-chevron",
|
|
1883
1888
|
name: "chevron-down",
|
|
1884
1889
|
size: 12
|
|
1885
1890
|
})]),
|
|
1886
|
-
|
|
1887
|
-
"aria-label":
|
|
1891
|
+
m("span", Nn, [m("select", {
|
|
1892
|
+
"aria-label": C(l)("blocks.text.fontSize"),
|
|
1888
1893
|
class: "size",
|
|
1889
|
-
value:
|
|
1890
|
-
onChange:
|
|
1891
|
-
onMousedown:
|
|
1894
|
+
value: R(),
|
|
1895
|
+
onChange: ye,
|
|
1896
|
+
onMousedown: r[2] ||= x(() => {}, ["stop"])
|
|
1892
1897
|
}, [
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
(
|
|
1898
|
+
m("option", Fn, E(C(l)("blocks.text.fontMixed")), 1),
|
|
1899
|
+
m("option", In, E(C(l)("blocks.text.fontSizeDefault")), 1),
|
|
1900
|
+
(a(!0), d(A, null, g(C(le), (e) => (a(), d("option", {
|
|
1896
1901
|
key: e,
|
|
1897
|
-
value:
|
|
1898
|
-
},
|
|
1899
|
-
], 40,
|
|
1902
|
+
value: C(pn)(e)
|
|
1903
|
+
}, E(e), 9, Ln))), 128))
|
|
1904
|
+
], 40, Pn), e(j, {
|
|
1900
1905
|
class: "picker-chevron",
|
|
1901
1906
|
name: "chevron-down",
|
|
1902
1907
|
size: 12
|
|
1903
1908
|
})]),
|
|
1904
|
-
|
|
1905
|
-
modelValue:
|
|
1906
|
-
"onUpdate:modelValue":
|
|
1909
|
+
e(He, {
|
|
1910
|
+
modelValue: Se.value,
|
|
1911
|
+
"onUpdate:modelValue": r[3] ||= (e) => Se.value = e,
|
|
1907
1912
|
"allow-transparent": !1,
|
|
1908
|
-
label:
|
|
1913
|
+
label: C(l)("blocks.text.textColor"),
|
|
1909
1914
|
compact: "",
|
|
1910
|
-
onMousedown:
|
|
1915
|
+
onMousedown: r[4] ||= x(() => {}, ["stop"])
|
|
1911
1916
|
}, null, 8, ["modelValue", "label"]),
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
class:
|
|
1917
|
+
r[21] ||= m("span", { class: "divider" }, null, -1),
|
|
1918
|
+
m("button", {
|
|
1919
|
+
class: T({ active: C(y)?.isActive("bold") }),
|
|
1915
1920
|
type: "button",
|
|
1916
|
-
title:
|
|
1917
|
-
"aria-label":
|
|
1918
|
-
onClick:
|
|
1919
|
-
onMousedown:
|
|
1920
|
-
}, [...
|
|
1921
|
-
|
|
1922
|
-
class:
|
|
1921
|
+
title: C(l)("blocks.text.bold"),
|
|
1922
|
+
"aria-label": C(l)("blocks.text.bold"),
|
|
1923
|
+
onClick: r[5] ||= (e) => C(y)?.chain().focus().toggleBold().run(),
|
|
1924
|
+
onMousedown: r[6] ||= x(() => {}, ["prevent"])
|
|
1925
|
+
}, [...r[17] ||= [m("b", null, "B", -1)]], 42, Rn),
|
|
1926
|
+
m("button", {
|
|
1927
|
+
class: T({ active: C(y)?.isActive("italic") }),
|
|
1923
1928
|
type: "button",
|
|
1924
|
-
title:
|
|
1925
|
-
"aria-label":
|
|
1926
|
-
onClick:
|
|
1927
|
-
onMousedown:
|
|
1928
|
-
}, [...
|
|
1929
|
-
|
|
1930
|
-
class:
|
|
1929
|
+
title: C(l)("blocks.text.italic"),
|
|
1930
|
+
"aria-label": C(l)("blocks.text.italic"),
|
|
1931
|
+
onClick: r[7] ||= (e) => C(y)?.chain().focus().toggleItalic().run(),
|
|
1932
|
+
onMousedown: r[8] ||= x(() => {}, ["prevent"])
|
|
1933
|
+
}, [...r[18] ||= [m("i", null, "I", -1)]], 42, zn),
|
|
1934
|
+
m("button", {
|
|
1935
|
+
class: T({ active: C(y)?.isActive("underline") }),
|
|
1931
1936
|
type: "button",
|
|
1932
|
-
title:
|
|
1933
|
-
"aria-label":
|
|
1934
|
-
onClick:
|
|
1935
|
-
onMousedown:
|
|
1936
|
-
}, [...
|
|
1937
|
-
|
|
1937
|
+
title: C(l)("blocks.text.underline"),
|
|
1938
|
+
"aria-label": C(l)("blocks.text.underline"),
|
|
1939
|
+
onClick: r[9] ||= (e) => C(y)?.chain().focus().toggleUnderline().run(),
|
|
1940
|
+
onMousedown: r[10] ||= x(() => {}, ["prevent"])
|
|
1941
|
+
}, [...r[19] ||= [m("u", null, "U", -1)]], 42, Bn),
|
|
1942
|
+
m("button", {
|
|
1938
1943
|
ref_key: "linkTrigger",
|
|
1939
|
-
ref:
|
|
1940
|
-
class:
|
|
1944
|
+
ref: Ie,
|
|
1945
|
+
class: T({ active: C(y)?.isActive("link") }),
|
|
1941
1946
|
type: "button",
|
|
1942
|
-
title:
|
|
1943
|
-
popovertarget:
|
|
1947
|
+
title: C(l)("blocks.text.link"),
|
|
1948
|
+
popovertarget: C(Ae),
|
|
1944
1949
|
"aria-haspopup": "dialog",
|
|
1945
|
-
"aria-expanded":
|
|
1946
|
-
onMousedown:
|
|
1947
|
-
}, [
|
|
1950
|
+
"aria-expanded": Ue.value,
|
|
1951
|
+
onMousedown: r[11] ||= x(() => {}, ["prevent"])
|
|
1952
|
+
}, [e(j, {
|
|
1948
1953
|
name: "link",
|
|
1949
1954
|
size: 16
|
|
1950
|
-
})], 42,
|
|
1951
|
-
|
|
1955
|
+
})], 42, Vn),
|
|
1956
|
+
o.editable ? (a(), d("div", {
|
|
1952
1957
|
key: 0,
|
|
1953
|
-
id:
|
|
1958
|
+
id: C(Ae),
|
|
1954
1959
|
ref_key: "linkPopover",
|
|
1955
|
-
ref:
|
|
1960
|
+
ref: z,
|
|
1956
1961
|
class: "link-popover",
|
|
1957
1962
|
popover: "",
|
|
1958
1963
|
role: "dialog",
|
|
1959
|
-
"aria-label":
|
|
1964
|
+
"aria-label": C(l)("blocks.text.link"),
|
|
1960
1965
|
onBeforetoggle: H,
|
|
1961
|
-
onToggle:
|
|
1962
|
-
onFocusout:
|
|
1966
|
+
onToggle: Ge,
|
|
1967
|
+
onFocusout: U
|
|
1963
1968
|
}, [
|
|
1964
|
-
|
|
1969
|
+
m("span", Un, [e(ve, {
|
|
1965
1970
|
ref_key: "linkInput",
|
|
1966
|
-
ref:
|
|
1971
|
+
ref: B,
|
|
1967
1972
|
modelValue: V.value,
|
|
1968
|
-
"onUpdate:modelValue":
|
|
1973
|
+
"onUpdate:modelValue": r[12] ||= (e) => V.value = e,
|
|
1969
1974
|
inputmode: "url",
|
|
1970
1975
|
spellcheck: "false",
|
|
1971
1976
|
autocomplete: "off",
|
|
1972
|
-
placeholder:
|
|
1973
|
-
"aria-label":
|
|
1974
|
-
onKeydown: oe(
|
|
1977
|
+
placeholder: C(l)("blocks.text.linkPlaceholder"),
|
|
1978
|
+
"aria-label": C(l)("blocks.text.linkPrompt"),
|
|
1979
|
+
onKeydown: oe(x(Ke, ["prevent"]), ["enter"])
|
|
1975
1980
|
}, null, 8, [
|
|
1976
1981
|
"modelValue",
|
|
1977
1982
|
"placeholder",
|
|
1978
1983
|
"aria-label",
|
|
1979
1984
|
"onKeydown"
|
|
1980
1985
|
])]),
|
|
1981
|
-
|
|
1982
|
-
"aria-label":
|
|
1983
|
-
"model-value":
|
|
1986
|
+
C(qe).length ? (a(), d("span", Wn, [e(De, {
|
|
1987
|
+
"aria-label": C(l)("blocks.common.anchorLink.label"),
|
|
1988
|
+
"model-value": Je.value,
|
|
1984
1989
|
"onUpdate:modelValue": W,
|
|
1985
|
-
onMousedown:
|
|
1990
|
+
onMousedown: r[13] ||= x(() => {}, ["stop"])
|
|
1986
1991
|
}, {
|
|
1987
|
-
default:
|
|
1992
|
+
default: p(() => [Je.value ? (a(), d("option", Gn, E(C(l)("blocks.common.anchorLink.none")), 1)) : (a(), d("option", Kn, E(C(l)("blocks.common.anchorLink.placeholder")), 1)), (a(!0), d(A, null, g(C(qe), (e) => (a(), d("option", {
|
|
1988
1993
|
key: e,
|
|
1989
1994
|
value: e
|
|
1990
|
-
}, " #" +
|
|
1995
|
+
}, " #" + E(e), 9, qn))), 128))]),
|
|
1991
1996
|
_: 1
|
|
1992
|
-
}, 8, ["aria-label", "model-value"])])) :
|
|
1993
|
-
|
|
1997
|
+
}, 8, ["aria-label", "model-value"])])) : n("", !0),
|
|
1998
|
+
m("button", {
|
|
1994
1999
|
class: "link-apply",
|
|
1995
2000
|
type: "button",
|
|
1996
|
-
onClick:
|
|
1997
|
-
onMousedown:
|
|
1998
|
-
},
|
|
1999
|
-
|
|
2001
|
+
onClick: Ke,
|
|
2002
|
+
onMousedown: r[14] ||= x(() => {}, ["prevent"])
|
|
2003
|
+
}, E(C(l)("blocks.text.linkApply")), 33),
|
|
2004
|
+
We.value ? (a(), d("button", {
|
|
2000
2005
|
key: 1,
|
|
2001
2006
|
class: "link-remove",
|
|
2002
2007
|
type: "button",
|
|
2003
|
-
title:
|
|
2004
|
-
"aria-label":
|
|
2005
|
-
onClick:
|
|
2006
|
-
onMousedown:
|
|
2007
|
-
}, [
|
|
2008
|
+
title: C(l)("blocks.text.linkRemove"),
|
|
2009
|
+
"aria-label": C(l)("blocks.text.linkRemove"),
|
|
2010
|
+
onClick: Ye,
|
|
2011
|
+
onMousedown: r[15] ||= x(() => {}, ["prevent"])
|
|
2012
|
+
}, [e(j, {
|
|
2008
2013
|
name: "trash",
|
|
2009
2014
|
size: 16
|
|
2010
|
-
})], 40,
|
|
2011
|
-
], 40,
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
actions:
|
|
2015
|
+
})], 40, Jn)) : n("", !0)
|
|
2016
|
+
], 40, Hn)) : n("", !0),
|
|
2017
|
+
e(dn, { onSelect: q }),
|
|
2018
|
+
e(nn, {
|
|
2019
|
+
actions: Qe.value,
|
|
2015
2020
|
pending: G.value,
|
|
2016
|
-
onSelect:
|
|
2021
|
+
onSelect: nt
|
|
2017
2022
|
}, null, 8, ["actions", "pending"]),
|
|
2018
|
-
|
|
2019
|
-
(
|
|
2023
|
+
r[22] ||= m("span", { class: "divider" }, null, -1),
|
|
2024
|
+
(a(), d(A, null, g(f, (e) => m("button", {
|
|
2020
2025
|
key: e,
|
|
2021
|
-
class:
|
|
2022
|
-
title:
|
|
2026
|
+
class: T({ active: C(y)?.isActive({ textAlign: e }) }),
|
|
2027
|
+
title: C(l)(we[e]),
|
|
2023
2028
|
type: "button",
|
|
2024
|
-
onClick: (t) =>
|
|
2025
|
-
onMousedown:
|
|
2026
|
-
}, [(
|
|
2029
|
+
onClick: (t) => C(y)?.chain().focus().setTextAlign(e).run(),
|
|
2030
|
+
onMousedown: r[16] ||= x(() => {}, ["prevent"])
|
|
2031
|
+
}, [(a(), d("svg", Xn, [(a(!0), d(A, null, g(ke(e), (e, t) => (a(), d("rect", {
|
|
2027
2032
|
key: t,
|
|
2028
2033
|
fill: "currentColor",
|
|
2029
2034
|
height: "1.5",
|
|
@@ -2031,9 +2036,9 @@ var Cn = { class: "picker" }, wn = ["aria-label", "value"], Tn = { value: "parag
|
|
|
2031
2036
|
width: e.w,
|
|
2032
2037
|
x: e.x,
|
|
2033
2038
|
y: e.y
|
|
2034
|
-
}, null, 8,
|
|
2035
|
-
], 512)) :
|
|
2039
|
+
}, null, 8, Zn))), 128))]))], 42, Yn)), 64))
|
|
2040
|
+
], 512)) : n("", !0)], 544));
|
|
2036
2041
|
}
|
|
2037
|
-
}), [["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-
|
|
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-15bd2061]{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-15bd2061]:popover-open{display:flex}.toolbar>button[data-v-15bd2061]{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-15bd2061]:hover{background:color-mix(in srgb, var(--bygga-color-text) 30%, transparent)}.toolbar>button.active[data-v-15bd2061]{background:var(--bygga-color-selected,var(--bygga-color-text));color:var(--bygga-color-selected-text,#fff);forced-color-adjust:none}.toolbar .picker[data-v-15bd2061]{align-items:center;display:inline-flex;position:relative}.toolbar .style[data-v-15bd2061],.toolbar .font[data-v-15bd2061],.toolbar .size[data-v-15bd2061]{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-15bd2061]:hover,.toolbar .font[data-v-15bd2061]:hover,.toolbar .size[data-v-15bd2061]:hover{background:color-mix(in srgb, var(--bygga-color-text) 7%, transparent)}.toolbar .picker-chevron[data-v-15bd2061]{color:var(--bygga-color-text);pointer-events:none;position:absolute;right:5px}.toolbar .divider[data-v-15bd2061]{background:var(--bygga-color-divider);width:1px;height:24px;margin:0 4px}.link-popover[data-v-15bd2061]{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-15bd2061]:popover-open{display:flex}.link-field[data-v-15bd2061]{width:18em}.link-anchor[data-v-15bd2061]{width:10em}.link-apply[data-v-15bd2061]{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-15bd2061]{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-15bd2061]:hover{background:var(--bygga-color-track);color:var(--bygga-color-accent)}"]], ["__scopeId", "data-v-15bd2061"]]);
|
|
2038
2043
|
//#endregion
|
|
2039
|
-
export {
|
|
2044
|
+
export { er as default };
|