@bygga.dev/editor 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/{TextEditor-DGmHp-AF.js → TextEditor-DZmlpRNW.js} +401 -360
- package/bygga-editor.js +3527 -2787
- package/element.d.ts +32 -1
- package/package.json +1 -1
- package/{urls-C1-J3Og2.js → urls-Cw507ilt.js} +2915 -2653
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, H as s, I as c, J as l, K as u, L as d, M as f, O as p, R as m, S as h, T as ee, X as g, Z as _, _ as v, b as y, c as te, et as b, f as x, g as S, h as C, j as w, l as T, m as ne, p as E, r as D, rt as O, u as k, v as A, w as
|
|
2
|
-
import {
|
|
1
|
+
import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, H as s, I as c, J as l, K as u, L as d, M as f, O as p, R as m, S as h, T as ee, X as g, Z as _, _ as v, b as y, c as te, et as b, f as x, g as S, h as C, j as w, l as T, m as ne, p as E, r as D, rt as O, u as k, v as A, w as re, x as ie, z as j } from "./vue.runtime.esm-bundler-C8OyVIE3.js";
|
|
2
|
+
import { Ct as ae, D as oe, Et as M, O as N, Q as se, St as ce, T as P, Tt as F, Z as le, _t as I, an as ue, at as de, bt as L, c as fe, ct as pe, dn as me, dt as he, en as ge, f as _e, ft as ve, gt as R, h as ye, ht as z, in as be, it as xe, k as B, l as Se, lt as Ce, mt as V, n as H, nn as we, nt as Te, o as Ee, on as De, ot as Oe, pn as ke, pt as Ae, rn as je, rt as Me, s as Ne, sn as Pe, st as U, t as Fe, tn as Ie, ut as Le, vt as W, wt as Re, xt as G, yt as K } from "./urls-Cw507ilt.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 ze(e = {}) {
|
|
5
|
+
return new K({ view(t) {
|
|
6
|
+
return new Be(t, e);
|
|
7
7
|
} });
|
|
8
8
|
}
|
|
9
|
-
var
|
|
9
|
+
var Be = class {
|
|
10
10
|
constructor(e, t) {
|
|
11
11
|
this.editorView = e, this.cursorPos = null, this.element = null, this.timeout = -1, this.width = t.width ?? 1, this.color = t.color === !1 ? void 0 : t.color || "black", this.class = t.class, this.handlers = [
|
|
12
12
|
"dragover",
|
|
@@ -82,7 +82,7 @@ var He = class {
|
|
|
82
82
|
if (t && !i) {
|
|
83
83
|
let e = t.pos;
|
|
84
84
|
if (this.editorView.dragging && this.editorView.dragging.slice) {
|
|
85
|
-
let t =
|
|
85
|
+
let t = Re(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 He = class {
|
|
|
97
97
|
dragleave(e) {
|
|
98
98
|
this.editorView.dom.contains(e.relatedTarget) || this.setCursor(null);
|
|
99
99
|
}
|
|
100
|
-
},
|
|
100
|
+
}, q = class e extends G {
|
|
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) : G.near(r);
|
|
107
107
|
}
|
|
108
108
|
content() {
|
|
109
|
-
return
|
|
109
|
+
return M.empty;
|
|
110
110
|
}
|
|
111
111
|
eq(t) {
|
|
112
112
|
return t instanceof e && t.head == this.head;
|
|
@@ -122,11 +122,11 @@ var He = class {
|
|
|
122
122
|
return new e(t.resolve(n.pos));
|
|
123
123
|
}
|
|
124
124
|
getBookmark() {
|
|
125
|
-
return new
|
|
125
|
+
return new Ve(this.anchor);
|
|
126
126
|
}
|
|
127
127
|
static valid(e) {
|
|
128
128
|
let t = e.parent;
|
|
129
|
-
if (t.inlineContent || !
|
|
129
|
+
if (t.inlineContent || !Ue(e) || !We(e)) return !1;
|
|
130
130
|
let n = t.type.spec.allowGapCursor;
|
|
131
131
|
if (n != null) return n;
|
|
132
132
|
let r = t.contentMatchAt(e.index()).defaultType;
|
|
@@ -149,7 +149,7 @@ var He = class {
|
|
|
149
149
|
for (;;) {
|
|
150
150
|
let o = n > 0 ? a.firstChild : a.lastChild;
|
|
151
151
|
if (!o) {
|
|
152
|
-
if (a.isAtom && !a.isText && !
|
|
152
|
+
if (a.isAtom && !a.isText && !W.isSelectable(a)) {
|
|
153
153
|
t = t.doc.resolve(i + a.nodeSize * n), r = !1;
|
|
154
154
|
continue search;
|
|
155
155
|
}
|
|
@@ -163,8 +163,8 @@ var He = class {
|
|
|
163
163
|
}
|
|
164
164
|
}
|
|
165
165
|
};
|
|
166
|
-
|
|
167
|
-
var
|
|
166
|
+
q.prototype.visible = !1, q.findFrom = q.findGapCursorFrom, G.jsonID("gapcursor", q);
|
|
167
|
+
var Ve = class e {
|
|
168
168
|
constructor(e) {
|
|
169
169
|
this.pos = e;
|
|
170
170
|
}
|
|
@@ -173,13 +173,13 @@ var Ue = class e {
|
|
|
173
173
|
}
|
|
174
174
|
resolve(e) {
|
|
175
175
|
let t = e.resolve(this.pos);
|
|
176
|
-
return
|
|
176
|
+
return q.valid(t) ? new q(t) : G.near(t);
|
|
177
177
|
}
|
|
178
178
|
};
|
|
179
|
-
function
|
|
179
|
+
function He(e) {
|
|
180
180
|
return e.isAtom || e.spec.isolating || e.spec.createGapCursor;
|
|
181
181
|
}
|
|
182
|
-
function
|
|
182
|
+
function Ue(e) {
|
|
183
183
|
for (let t = e.depth; t >= 0; t--) {
|
|
184
184
|
let n = e.index(t), r = e.node(t);
|
|
185
185
|
if (n == 0) {
|
|
@@ -187,13 +187,13 @@ function Ge(e) {
|
|
|
187
187
|
continue;
|
|
188
188
|
}
|
|
189
189
|
for (let e = r.child(n - 1);; e = e.lastChild) {
|
|
190
|
-
if (e.childCount == 0 && !e.inlineContent ||
|
|
190
|
+
if (e.childCount == 0 && !e.inlineContent || He(e.type)) return !0;
|
|
191
191
|
if (e.inlineContent) return !1;
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
194
|
return !0;
|
|
195
195
|
}
|
|
196
|
-
function
|
|
196
|
+
function We(e) {
|
|
197
197
|
for (let t = e.depth; t >= 0; t--) {
|
|
198
198
|
let n = e.indexAfter(t), r = e.node(t);
|
|
199
199
|
if (n == r.childCount) {
|
|
@@ -201,88 +201,88 @@ function Ke(e) {
|
|
|
201
201
|
continue;
|
|
202
202
|
}
|
|
203
203
|
for (let e = r.child(n);; e = e.firstChild) {
|
|
204
|
-
if (e.childCount == 0 && !e.inlineContent ||
|
|
204
|
+
if (e.childCount == 0 && !e.inlineContent || He(e.type)) return !0;
|
|
205
205
|
if (e.inlineContent) return !1;
|
|
206
206
|
}
|
|
207
207
|
}
|
|
208
208
|
return !0;
|
|
209
209
|
}
|
|
210
|
-
function
|
|
211
|
-
return new
|
|
212
|
-
decorations:
|
|
210
|
+
function Ge() {
|
|
211
|
+
return new K({ props: {
|
|
212
|
+
decorations: Xe,
|
|
213
213
|
createSelectionBetween(e, t, n) {
|
|
214
|
-
return t.pos == n.pos &&
|
|
214
|
+
return t.pos == n.pos && q.valid(n) ? new q(n) : null;
|
|
215
215
|
},
|
|
216
|
-
handleClick:
|
|
217
|
-
handleKeyDown:
|
|
218
|
-
handleDOMEvents: { beforeinput:
|
|
216
|
+
handleClick: Je,
|
|
217
|
+
handleKeyDown: Ke,
|
|
218
|
+
handleDOMEvents: { beforeinput: Ye }
|
|
219
219
|
} });
|
|
220
220
|
}
|
|
221
|
-
var
|
|
222
|
-
ArrowLeft:
|
|
223
|
-
ArrowRight:
|
|
224
|
-
ArrowUp:
|
|
225
|
-
ArrowDown:
|
|
221
|
+
var Ke = z({
|
|
222
|
+
ArrowLeft: qe("horiz", -1),
|
|
223
|
+
ArrowRight: qe("horiz", 1),
|
|
224
|
+
ArrowUp: qe("vert", -1),
|
|
225
|
+
ArrowDown: qe("vert", 1)
|
|
226
226
|
});
|
|
227
|
-
function
|
|
227
|
+
function qe(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 ce) {
|
|
232
232
|
if (!i.endOfTextblock(n) || o.depth == 0) return !1;
|
|
233
233
|
s = !1, o = e.doc.resolve(t > 0 ? o.after() : o.before());
|
|
234
234
|
}
|
|
235
|
-
let c =
|
|
236
|
-
return c ? (r && r(e.tr.setSelection(new
|
|
235
|
+
let c = q.findGapCursorFrom(o, t, s);
|
|
236
|
+
return c ? (r && r(e.tr.setSelection(new q(c))), !0) : !1;
|
|
237
237
|
};
|
|
238
238
|
}
|
|
239
|
-
function
|
|
239
|
+
function Je(e, t, n) {
|
|
240
240
|
if (!e || !e.editable) return !1;
|
|
241
241
|
let r = e.state.doc.resolve(t);
|
|
242
|
-
if (!
|
|
242
|
+
if (!q.valid(r)) return !1;
|
|
243
243
|
let i = e.posAtCoords({
|
|
244
244
|
left: n.clientX,
|
|
245
245
|
top: n.clientY
|
|
246
246
|
});
|
|
247
|
-
return i && i.inside > -1 &&
|
|
247
|
+
return i && i.inside > -1 && W.isSelectable(e.state.doc.nodeAt(i.inside)) ? !1 : (e.dispatch(e.state.tr.setSelection(new q(r))), !0);
|
|
248
248
|
}
|
|
249
|
-
function
|
|
250
|
-
if (t.inputType != "insertCompositionText" || !(e.state.selection instanceof
|
|
249
|
+
function Ye(e, t) {
|
|
250
|
+
if (t.inputType != "insertCompositionText" || !(e.state.selection instanceof q)) 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 = F.empty;
|
|
254
|
+
for (let e = r.length - 1; e >= 0; e--) i = F.from(r[e].createAndFill(null, i));
|
|
255
|
+
let a = e.state.tr.replace(n.pos, n.pos, new M(i, 0, 0));
|
|
256
|
+
return a.setSelection(ce.near(a.doc.resolve(n.pos + 1))), e.dispatch(a), !1;
|
|
257
257
|
}
|
|
258
|
-
function
|
|
259
|
-
if (!(e.selection instanceof
|
|
258
|
+
function Xe(e) {
|
|
259
|
+
if (!(e.selection instanceof q)) return null;
|
|
260
260
|
let t = document.createElement("div");
|
|
261
|
-
return t.className = "ProseMirror-gapcursor",
|
|
261
|
+
return t.className = "ProseMirror-gapcursor", I.create(e.doc, [R.widget(e.selection.head, t, { key: "gapcursor" })]);
|
|
262
262
|
}
|
|
263
263
|
//#endregion
|
|
264
264
|
//#region ../../node_modules/.pnpm/rope-sequence@1.3.4/node_modules/rope-sequence/dist/index.js
|
|
265
|
-
var
|
|
266
|
-
|
|
267
|
-
return e.length ? (e =
|
|
268
|
-
},
|
|
269
|
-
return e.length ?
|
|
270
|
-
},
|
|
265
|
+
var Ze = 200, J = function() {};
|
|
266
|
+
J.prototype.append = function(e) {
|
|
267
|
+
return e.length ? (e = J.from(e), !this.length && e || e.length < Ze && this.leafAppend(e) || this.length < Ze && e.leafPrepend(this) || this.appendInner(e)) : this;
|
|
268
|
+
}, J.prototype.prepend = function(e) {
|
|
269
|
+
return e.length ? J.from(e).append(this) : this;
|
|
270
|
+
}, J.prototype.appendInner = function(e) {
|
|
271
271
|
return new $e(this, e);
|
|
272
|
-
},
|
|
273
|
-
return e === void 0 && (e = 0), t === void 0 && (t = this.length), e >= t ?
|
|
274
|
-
},
|
|
272
|
+
}, J.prototype.slice = function(e, t) {
|
|
273
|
+
return e === void 0 && (e = 0), t === void 0 && (t = this.length), e >= t ? J.empty : this.sliceInner(Math.max(0, e), Math.min(this.length, t));
|
|
274
|
+
}, J.prototype.get = function(e) {
|
|
275
275
|
if (!(e < 0 || e >= this.length)) return this.getInner(e);
|
|
276
|
-
},
|
|
276
|
+
}, J.prototype.forEach = function(e, t, n) {
|
|
277
277
|
t === void 0 && (t = 0), n === void 0 && (n = this.length), t <= n ? this.forEachInner(e, t, n, 0) : this.forEachInvertedInner(e, t, n, 0);
|
|
278
|
-
},
|
|
278
|
+
}, J.prototype.map = function(e, t, n) {
|
|
279
279
|
t === void 0 && (t = 0), n === void 0 && (n = this.length);
|
|
280
280
|
var r = [];
|
|
281
281
|
return this.forEach(function(t, n) {
|
|
282
282
|
return r.push(e(t, n));
|
|
283
283
|
}, t, n), r;
|
|
284
|
-
},
|
|
285
|
-
return e instanceof
|
|
284
|
+
}, J.from = function(e) {
|
|
285
|
+
return e instanceof J ? e : e && e.length ? new Qe(e) : J.empty;
|
|
286
286
|
};
|
|
287
287
|
var Qe = /* @__PURE__ */ function(e) {
|
|
288
288
|
function t(t) {
|
|
@@ -304,16 +304,16 @@ var Qe = /* @__PURE__ */ function(e) {
|
|
|
304
304
|
}, t.prototype.forEachInvertedInner = function(e, t, n, r) {
|
|
305
305
|
for (var i = t - 1; i >= n; i--) if (e(this.values[i], r + i) === !1) return !1;
|
|
306
306
|
}, t.prototype.leafAppend = function(e) {
|
|
307
|
-
if (this.length + e.length <=
|
|
307
|
+
if (this.length + e.length <= Ze) return new t(this.values.concat(e.flatten()));
|
|
308
308
|
}, t.prototype.leafPrepend = function(e) {
|
|
309
|
-
if (this.length + e.length <=
|
|
309
|
+
if (this.length + e.length <= Ze) return new t(e.flatten().concat(this.values));
|
|
310
310
|
}, n.length.get = function() {
|
|
311
311
|
return this.values.length;
|
|
312
312
|
}, n.depth.get = function() {
|
|
313
313
|
return 0;
|
|
314
314
|
}, Object.defineProperties(t.prototype, n), t;
|
|
315
|
-
}(
|
|
316
|
-
|
|
315
|
+
}(J);
|
|
316
|
+
J.empty = new Qe([]);
|
|
317
317
|
var $e = /* @__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;
|
|
@@ -341,7 +341,7 @@ var $e = /* @__PURE__ */ function(e) {
|
|
|
341
341
|
}, t.prototype.appendInner = function(e) {
|
|
342
342
|
return this.left.depth >= Math.max(this.right.depth, e.depth) + 1 ? new t(this.left, new t(this.right, e)) : new t(this, e);
|
|
343
343
|
}, t;
|
|
344
|
-
}(
|
|
344
|
+
}(J), et = 500, Y = class e {
|
|
345
345
|
constructor(e, t) {
|
|
346
346
|
this.items = e, this.eventCount = t;
|
|
347
347
|
}
|
|
@@ -361,9 +361,9 @@ var $e = /* @__PURE__ */ function(e) {
|
|
|
361
361
|
return;
|
|
362
362
|
}
|
|
363
363
|
if (i) {
|
|
364
|
-
u.push(new
|
|
364
|
+
u.push(new X(t.map));
|
|
365
365
|
let e = t.step.map(i.slice(a)), n;
|
|
366
|
-
e && o.maybeStep(e).doc && (n = o.mapping.maps[o.mapping.maps.length - 1], l.push(new
|
|
366
|
+
e && o.maybeStep(e).doc && (n = o.mapping.maps[o.mapping.maps.length - 1], l.push(new X(n, void 0, void 0, l.length + u.length))), a--, n && i.appendMap(n, a);
|
|
367
367
|
} else o.maybeStep(t.step);
|
|
368
368
|
if (t.selection) return s = i ? t.selection.map(i.slice(a)) : t.selection, c = new e(this.items.slice(0, r).append(u.reverse().concat(l)), this.eventCount - 1), !1;
|
|
369
369
|
}, this.items.length, 0), {
|
|
@@ -375,21 +375,21 @@ var $e = /* @__PURE__ */ function(e) {
|
|
|
375
375
|
addTransform(t, n, r, i) {
|
|
376
376
|
let a = [], o = this.eventCount, s = this.items, c = !i && s.length ? s.get(s.length - 1) : null;
|
|
377
377
|
for (let e = 0; e < t.steps.length; e++) {
|
|
378
|
-
let r = t.steps[e].invert(t.docs[e]), l = new
|
|
378
|
+
let r = t.steps[e].invert(t.docs[e]), l = new X(t.mapping.maps[e], r, n), u;
|
|
379
379
|
(u = c && c.merge(l)) && (l = u, e ? a.pop() : s = s.slice(0, s.length - 1)), a.push(l), n &&= (o++, void 0), i || (c = l);
|
|
380
380
|
}
|
|
381
381
|
let l = o - r.depth;
|
|
382
382
|
return l > nt && (s = tt(s, l), o -= l), new e(s.append(a), o);
|
|
383
383
|
}
|
|
384
384
|
remapping(e, t) {
|
|
385
|
-
let n = new
|
|
385
|
+
let n = new ae();
|
|
386
386
|
return this.items.forEach((t, r) => {
|
|
387
387
|
let i = t.mirrorOffset != null && r - t.mirrorOffset >= e ? n.maps.length - t.mirrorOffset : void 0;
|
|
388
388
|
n.appendMap(t.map, i);
|
|
389
389
|
}, e, t), n;
|
|
390
390
|
}
|
|
391
391
|
addMaps(t) {
|
|
392
|
-
return this.eventCount == 0 ? this : new e(this.items.append(t.map((e) => new
|
|
392
|
+
return this.eventCount == 0 ? this : new e(this.items.append(t.map((e) => new X(e))), this.eventCount);
|
|
393
393
|
}
|
|
394
394
|
rebased(t, n) {
|
|
395
395
|
if (!this.eventCount) return this;
|
|
@@ -405,11 +405,11 @@ var $e = /* @__PURE__ */ function(e) {
|
|
|
405
405
|
let i = a.maps[n];
|
|
406
406
|
if (e.step) {
|
|
407
407
|
let o = t.steps[n].invert(t.docs[n]), l = e.selection && e.selection.map(a.slice(c + 1, n));
|
|
408
|
-
l && s++, r.push(new
|
|
409
|
-
} else r.push(new
|
|
408
|
+
l && s++, r.push(new X(i, o, l));
|
|
409
|
+
} else r.push(new X(i));
|
|
410
410
|
}, i);
|
|
411
411
|
let l = [];
|
|
412
|
-
for (let e = n; e < o; e++) l.push(new
|
|
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
414
|
return u.emptyItemCount() > et && (u = u.compress(this.items.length - r.length)), u;
|
|
415
415
|
}
|
|
@@ -428,21 +428,21 @@ var $e = /* @__PURE__ */ function(e) {
|
|
|
428
428
|
if (r--, o && n.appendMap(o, r), t) {
|
|
429
429
|
let s = e.selection && e.selection.map(n.slice(r));
|
|
430
430
|
s && a++;
|
|
431
|
-
let c = new
|
|
431
|
+
let c = new X(o.invert(), t, s), l, u = i.length - 1;
|
|
432
432
|
(l = i.length && i[u].merge(c)) ? i[u] = l : i.push(c);
|
|
433
433
|
}
|
|
434
434
|
} else e.map && r--;
|
|
435
|
-
}, this.items.length, 0), new e(
|
|
435
|
+
}, this.items.length, 0), new e(J.from(i.reverse()), a);
|
|
436
436
|
}
|
|
437
437
|
};
|
|
438
|
-
|
|
438
|
+
Y.empty = new Y(J.empty, 0);
|
|
439
439
|
function tt(e, t) {
|
|
440
440
|
let n;
|
|
441
441
|
return e.forEach((e, r) => {
|
|
442
442
|
if (e.selection && t-- == 0) return n = r, !1;
|
|
443
443
|
}), e.slice(n);
|
|
444
444
|
}
|
|
445
|
-
var
|
|
445
|
+
var X = class e {
|
|
446
446
|
constructor(e, t, n, r) {
|
|
447
447
|
this.map = e, this.step = t, this.selection = n, this.mirrorOffset = r;
|
|
448
448
|
}
|
|
@@ -452,7 +452,7 @@ var Y = class e {
|
|
|
452
452
|
if (n) return new e(n.getMap().invert(), n, this.selection);
|
|
453
453
|
}
|
|
454
454
|
}
|
|
455
|
-
},
|
|
455
|
+
}, Z = class {
|
|
456
456
|
constructor(e, t, n, r, i) {
|
|
457
457
|
this.done = e, this.undone = t, this.prevRanges = n, this.prevTime = r, this.prevComposition = i;
|
|
458
458
|
}
|
|
@@ -460,15 +460,15 @@ var Y = class e {
|
|
|
460
460
|
function rt(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(dt) && (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
|
|
466
|
+
if (o && o.getMeta(Q)) return o.getMeta(Q).redo ? new Z(e.done.addTransform(n, void 0, r, ut(t)), e.undone, at(n.mapping.maps), e.prevTime, e.prevComposition) : new Z(e.done, e.undone.addTransform(n, void 0, r, ut(t)), null, e.prevTime, e.prevComposition);
|
|
467
467
|
if (n.getMeta("addToHistory") !== !1 && !(o && o.getMeta("addToHistory") === !1)) {
|
|
468
468
|
let i = n.getMeta("composition"), a = e.prevTime == 0 || !o && e.prevComposition != i && (e.prevTime < (n.time || 0) - r.newGroupDelay || !it(n, e.prevRanges)), s = o ? ot(e.prevRanges, n.mapping) : at(n.mapping.maps);
|
|
469
|
-
return new
|
|
470
|
-
} else if (a = n.getMeta("rebased")) return new
|
|
471
|
-
else return new
|
|
469
|
+
return new Z(e.done.addTransform(n, a ? t.selection.getBookmark() : void 0, r, ut(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), ot(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), ot(e.prevRanges, n.mapping), e.prevTime, e.prevComposition);
|
|
472
472
|
}
|
|
473
473
|
function it(e, t) {
|
|
474
474
|
if (!t) return !1;
|
|
@@ -493,16 +493,16 @@ function ot(e, t) {
|
|
|
493
493
|
return n;
|
|
494
494
|
}
|
|
495
495
|
function st(e, t, n) {
|
|
496
|
-
let r =
|
|
496
|
+
let r = ut(t), i = Q.get(t).spec.config, a = (n ? e.undone : e.done).popEvent(t, r);
|
|
497
497
|
if (!a) return null;
|
|
498
|
-
let o = a.selection.resolve(a.transform.doc), s = (n ? e.done : e.undone).addTransform(a.transform, t.selection.getBookmark(), i, r), c = new
|
|
498
|
+
let o = a.selection.resolve(a.transform.doc), s = (n ? e.done : e.undone).addTransform(a.transform, t.selection.getBookmark(), i, r), c = new Z(n ? s : a.remaining, n ? a.remaining : s, null, 0, -1);
|
|
499
499
|
return a.transform.setSelection(o).setMeta(Q, {
|
|
500
500
|
redo: n,
|
|
501
501
|
historyState: c
|
|
502
502
|
});
|
|
503
503
|
}
|
|
504
504
|
var ct = !1, lt = null;
|
|
505
|
-
function
|
|
505
|
+
function ut(e) {
|
|
506
506
|
let t = e.plugins;
|
|
507
507
|
if (lt != t) {
|
|
508
508
|
ct = !1, lt = t;
|
|
@@ -513,16 +513,16 @@ function Z(e) {
|
|
|
513
513
|
}
|
|
514
514
|
return ct;
|
|
515
515
|
}
|
|
516
|
-
var Q = new
|
|
517
|
-
function
|
|
516
|
+
var Q = new L("history"), dt = new L("closeHistory");
|
|
517
|
+
function ft(e = {}) {
|
|
518
518
|
return e = {
|
|
519
519
|
depth: e.depth || 100,
|
|
520
520
|
newGroupDelay: e.newGroupDelay || 500
|
|
521
|
-
}, new
|
|
521
|
+
}, new K({
|
|
522
522
|
key: Q,
|
|
523
523
|
state: {
|
|
524
524
|
init() {
|
|
525
|
-
return new
|
|
525
|
+
return new Z(Y.empty, Y.empty, null, 0, -1);
|
|
526
526
|
},
|
|
527
527
|
apply(t, n, r) {
|
|
528
528
|
return rt(n, r, t, e);
|
|
@@ -530,12 +530,12 @@ function dt(e = {}) {
|
|
|
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" ? mt : n == "historyRedo" ? ht : 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 pt(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;
|
|
@@ -546,8 +546,8 @@ function ft(e, t) {
|
|
|
546
546
|
return !0;
|
|
547
547
|
};
|
|
548
548
|
}
|
|
549
|
-
var
|
|
550
|
-
|
|
549
|
+
var mt = pt(!1, !0), ht = pt(!0, !0);
|
|
550
|
+
U.create({
|
|
551
551
|
name: "characterCount",
|
|
552
552
|
addOptions() {
|
|
553
553
|
return {
|
|
@@ -579,8 +579,8 @@ V.create({
|
|
|
579
579
|
},
|
|
580
580
|
addProseMirrorPlugins() {
|
|
581
581
|
let e = !1;
|
|
582
|
-
return [new
|
|
583
|
-
key: new
|
|
582
|
+
return [new K({
|
|
583
|
+
key: new L("characterCount"),
|
|
584
584
|
appendTransaction: (t, n, r) => {
|
|
585
585
|
if (e) return;
|
|
586
586
|
let i = this.options.limit, a = this.options.autoTrim;
|
|
@@ -608,7 +608,7 @@ V.create({
|
|
|
608
608
|
}
|
|
609
609
|
})];
|
|
610
610
|
}
|
|
611
|
-
}),
|
|
611
|
+
}), U.create({
|
|
612
612
|
name: "dropCursor",
|
|
613
613
|
addOptions() {
|
|
614
614
|
return {
|
|
@@ -618,9 +618,9 @@ V.create({
|
|
|
618
618
|
};
|
|
619
619
|
},
|
|
620
620
|
addProseMirrorPlugins() {
|
|
621
|
-
return [
|
|
621
|
+
return [ze(this.options)];
|
|
622
622
|
}
|
|
623
|
-
}),
|
|
623
|
+
}), U.create({
|
|
624
624
|
name: "focus",
|
|
625
625
|
addOptions() {
|
|
626
626
|
return {
|
|
@@ -629,11 +629,11 @@ V.create({
|
|
|
629
629
|
};
|
|
630
630
|
},
|
|
631
631
|
addProseMirrorPlugins() {
|
|
632
|
-
return [new
|
|
633
|
-
key: new
|
|
632
|
+
return [new K({
|
|
633
|
+
key: new L("focus"),
|
|
634
634
|
props: { decorations: ({ doc: e, selection: t }) => {
|
|
635
635
|
let { isEditable: n, isFocused: r } = this.editor, { anchor: i } = t, a = [];
|
|
636
|
-
if (!n || !r) return
|
|
636
|
+
if (!n || !r) return I.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 @@ V.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(R.node(t, t + e.nodeSize, { class: this.options.className }));
|
|
649
|
+
}), I.create(e, a);
|
|
650
650
|
} }
|
|
651
651
|
})];
|
|
652
652
|
}
|
|
653
|
-
}),
|
|
653
|
+
}), U.create({
|
|
654
654
|
name: "gapCursor",
|
|
655
655
|
addProseMirrorPlugins() {
|
|
656
|
-
return [
|
|
656
|
+
return [Ge()];
|
|
657
657
|
},
|
|
658
658
|
extendNodeSchema(e) {
|
|
659
|
-
return { allowGapCursor:
|
|
659
|
+
return { allowGapCursor: Ce(he(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 gt = "placeholder", $ = new L("tiptap__placeholder"), _t = 200;
|
|
667
|
+
function vt(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), R.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 _t(e) {
|
|
|
676
676
|
}) : n
|
|
677
677
|
});
|
|
678
678
|
}
|
|
679
|
-
function
|
|
679
|
+
function yt(e, t) {
|
|
680
680
|
return typeof e == "function" ? e(t) : e;
|
|
681
681
|
}
|
|
682
|
-
function
|
|
682
|
+
function bt({ 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 && ve(c)) {
|
|
688
688
|
let r = a >= l && a <= l + c.nodeSize;
|
|
689
|
-
o.push(
|
|
689
|
+
o.push(vt({
|
|
690
690
|
editor: e,
|
|
691
691
|
isEmptyDoc: s,
|
|
692
692
|
dataAttribute: n,
|
|
@@ -694,7 +694,7 @@ function yt({ 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: yt(t.emptyNodeClass, {
|
|
698
698
|
editor: e,
|
|
699
699
|
node: c,
|
|
700
700
|
pos: l,
|
|
@@ -708,8 +708,8 @@ function yt({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
|
|
|
708
708
|
} else {
|
|
709
709
|
let i = $.getState(e.state), c = i?.topPos ?? 0, l = i?.bottomPos ?? r.content.size;
|
|
710
710
|
r.nodesBetween(c, l, (r, i) => {
|
|
711
|
-
let c = a >= i && a <= i + r.nodeSize, l = !r.isLeaf &&
|
|
712
|
-
return r.type.isTextblock && (c || !t.showOnlyCurrent) && l && o.push(
|
|
711
|
+
let c = a >= i && a <= i + r.nodeSize, l = !r.isLeaf && ve(r);
|
|
712
|
+
return r.type.isTextblock && (c || !t.showOnlyCurrent) && l && o.push(vt({
|
|
713
713
|
editor: e,
|
|
714
714
|
isEmptyDoc: s,
|
|
715
715
|
dataAttribute: n,
|
|
@@ -717,7 +717,7 @@ function yt({ 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: yt(t.emptyNodeClass, {
|
|
721
721
|
editor: e,
|
|
722
722
|
node: r,
|
|
723
723
|
pos: i,
|
|
@@ -729,19 +729,19 @@ function yt({ editor: e, options: t, dataAttribute: n, doc: r, selection: i }) {
|
|
|
729
729
|
})), t.includeChildren;
|
|
730
730
|
});
|
|
731
731
|
}
|
|
732
|
-
return
|
|
732
|
+
return I.create(r, o);
|
|
733
733
|
}
|
|
734
|
-
function
|
|
734
|
+
function xt(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 St(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 Ct(e) {
|
|
742
742
|
let t = e;
|
|
743
743
|
for (; t;) {
|
|
744
|
-
if (
|
|
744
|
+
if (St(t)) return t;
|
|
745
745
|
let e = t.parentElement;
|
|
746
746
|
if (!e) {
|
|
747
747
|
let e = t.getRootNode();
|
|
@@ -755,19 +755,19 @@ function St(e) {
|
|
|
755
755
|
}
|
|
756
756
|
return window;
|
|
757
757
|
}
|
|
758
|
-
function
|
|
758
|
+
function wt(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 Tt({ 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 ? wt(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) - _t, a = Math.min(n.bottom, r.bottom) + _t;
|
|
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 wt({ view: e, scrollContainer: t }) {
|
|
|
785
785
|
bottom: p.pos
|
|
786
786
|
};
|
|
787
787
|
}
|
|
788
|
-
var
|
|
788
|
+
var Et = {
|
|
789
789
|
init() {
|
|
790
790
|
return {
|
|
791
791
|
topPos: null,
|
|
@@ -803,9 +803,9 @@ var Tt = {
|
|
|
803
803
|
} : t;
|
|
804
804
|
}
|
|
805
805
|
};
|
|
806
|
-
function
|
|
807
|
-
let t =
|
|
808
|
-
let n =
|
|
806
|
+
function Dt(e) {
|
|
807
|
+
let t = Ct(e.dom), n = () => {
|
|
808
|
+
let n = Tt({
|
|
809
809
|
view: e,
|
|
810
810
|
scrollContainer: t
|
|
811
811
|
});
|
|
@@ -834,13 +834,13 @@ function Et(e) {
|
|
|
834
834
|
}
|
|
835
835
|
};
|
|
836
836
|
}
|
|
837
|
-
function
|
|
838
|
-
let n = t.dataAttribute ? `data-${
|
|
839
|
-
return new
|
|
837
|
+
function Ot({ editor: e, options: t }) {
|
|
838
|
+
let n = t.dataAttribute ? `data-${xt(t.dataAttribute)}` : `data-${gt}`;
|
|
839
|
+
return new K({
|
|
840
840
|
key: $,
|
|
841
|
-
state:
|
|
842
|
-
view:
|
|
843
|
-
props: { decorations: ({ doc: r, selection: i }) =>
|
|
841
|
+
state: Et,
|
|
842
|
+
view: Dt,
|
|
843
|
+
props: { decorations: ({ doc: r, selection: i }) => bt({
|
|
844
844
|
editor: e,
|
|
845
845
|
options: t,
|
|
846
846
|
dataAttribute: n,
|
|
@@ -849,13 +849,13 @@ function Dt({ editor: e, options: t }) {
|
|
|
849
849
|
}) }
|
|
850
850
|
});
|
|
851
851
|
}
|
|
852
|
-
var
|
|
852
|
+
var kt = U.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: gt,
|
|
859
859
|
placeholder: "Write something …",
|
|
860
860
|
showOnlyWhenEditable: !0,
|
|
861
861
|
showOnlyCurrent: !0,
|
|
@@ -863,31 +863,31 @@ var Ot = V.create({
|
|
|
863
863
|
};
|
|
864
864
|
},
|
|
865
865
|
addProseMirrorPlugins() {
|
|
866
|
-
return [
|
|
866
|
+
return [Ot({
|
|
867
867
|
editor: this.editor,
|
|
868
868
|
options: this.options
|
|
869
869
|
})];
|
|
870
870
|
}
|
|
871
|
-
}),
|
|
872
|
-
|
|
871
|
+
}), At = ".ProseMirror:not(.ProseMirror-focused) *::selection {\n background: transparent;\n}\n\n.ProseMirror:not(.ProseMirror-focused) *::-moz-selection {\n background: transparent;\n}";
|
|
872
|
+
U.create({
|
|
873
873
|
name: "selection",
|
|
874
874
|
addOptions() {
|
|
875
875
|
return { className: "selection" };
|
|
876
876
|
},
|
|
877
877
|
addProseMirrorPlugins() {
|
|
878
878
|
let { editor: e, options: t } = this;
|
|
879
|
-
return e.options.injectCSS && typeof document < "u" &&
|
|
880
|
-
key: new
|
|
879
|
+
return e.options.injectCSS && typeof document < "u" && Le(At, e.options.injectNonce, "selection"), [new K({
|
|
880
|
+
key: new L("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 : I.create(n.doc, [R.inline(n.selection.from, n.selection.to, { class: t.className })]);
|
|
883
883
|
} }
|
|
884
884
|
})];
|
|
885
885
|
}
|
|
886
886
|
});
|
|
887
|
-
function
|
|
887
|
+
function jt({ types: e, node: t }) {
|
|
888
888
|
return t && Array.isArray(e) && e.includes(t.type) || t?.type === e;
|
|
889
889
|
}
|
|
890
|
-
|
|
890
|
+
U.create({
|
|
891
891
|
name: "trailingNode",
|
|
892
892
|
addOptions() {
|
|
893
893
|
return {
|
|
@@ -896,8 +896,8 @@ V.create({
|
|
|
896
896
|
};
|
|
897
897
|
},
|
|
898
898
|
addProseMirrorPlugins() {
|
|
899
|
-
let e = new
|
|
900
|
-
return [new
|
|
899
|
+
let e = new L(this.name), t = this.options.node || this.editor.schema.topNodeType.contentMatch.defaultType?.name || "paragraph", n = Object.entries(this.editor.schema.nodes).map(([, e]) => e).filter((e) => (this.options.notAfter || []).concat(t).includes(e.name));
|
|
900
|
+
return [new K({
|
|
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 @@ V.create({
|
|
|
906
906
|
state: {
|
|
907
907
|
init: (e, t) => {
|
|
908
908
|
let r = t.tr.doc.lastChild;
|
|
909
|
-
return !
|
|
909
|
+
return !jt({
|
|
910
910
|
node: r,
|
|
911
911
|
types: n
|
|
912
912
|
});
|
|
@@ -914,7 +914,7 @@ V.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 !jt({
|
|
918
918
|
node: r,
|
|
919
919
|
types: n
|
|
920
920
|
});
|
|
@@ -923,7 +923,7 @@ V.create({
|
|
|
923
923
|
})];
|
|
924
924
|
}
|
|
925
925
|
});
|
|
926
|
-
var
|
|
926
|
+
var Mt = U.create({
|
|
927
927
|
name: "undoRedo",
|
|
928
928
|
addOptions() {
|
|
929
929
|
return {
|
|
@@ -933,12 +933,12 @@ var jt = V.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 }) => mt(e, t),
|
|
937
|
+
redo: () => ({ state: e, dispatch: t }) => ht(e, t)
|
|
938
938
|
};
|
|
939
939
|
},
|
|
940
940
|
addProseMirrorPlugins() {
|
|
941
|
-
return [
|
|
941
|
+
return [ft(this.options)];
|
|
942
942
|
},
|
|
943
943
|
addKeyboardShortcuts() {
|
|
944
944
|
return {
|
|
@@ -952,7 +952,7 @@ var jt = V.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
|
|
955
|
+
function Nt(e) {
|
|
956
956
|
return s((t, n) => ({
|
|
957
957
|
get() {
|
|
958
958
|
return t(), e;
|
|
@@ -966,9 +966,9 @@ function Mt(e) {
|
|
|
966
966
|
}
|
|
967
967
|
}));
|
|
968
968
|
}
|
|
969
|
-
var
|
|
969
|
+
var Pt = class extends Oe {
|
|
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 = Nt(this.view.state), this.reactiveExtensionStorage = Nt(this.extensionStorage), this.on("beforeTransaction", ({ nextState: e }) => {
|
|
972
972
|
this.reactiveState.value = e, this.reactiveExtensionStorage.value = this.extensionStorage;
|
|
973
973
|
}), u(this);
|
|
974
974
|
}
|
|
@@ -986,15 +986,15 @@ var Nt = class extends Se {
|
|
|
986
986
|
let t = super.unregisterPlugin(e);
|
|
987
987
|
return this.reactiveState && t && (this.reactiveState.value = t), t;
|
|
988
988
|
}
|
|
989
|
-
},
|
|
989
|
+
}, Ft = y({
|
|
990
990
|
name: "EditorContent",
|
|
991
991
|
props: { editor: {
|
|
992
992
|
default: null,
|
|
993
993
|
type: Object
|
|
994
994
|
} },
|
|
995
995
|
setup(t) {
|
|
996
|
-
let n = g(), r =
|
|
997
|
-
return
|
|
996
|
+
let n = g(), r = ie();
|
|
997
|
+
return j(() => {
|
|
998
998
|
let i = t.editor;
|
|
999
999
|
i && i.options.element && n.value && a(() => {
|
|
1000
1000
|
if (!n.value || !i.view.dom?.parentNode) return;
|
|
@@ -1037,7 +1037,7 @@ y({
|
|
|
1037
1037
|
});
|
|
1038
1038
|
}
|
|
1039
1039
|
});
|
|
1040
|
-
var
|
|
1040
|
+
var It = y({
|
|
1041
1041
|
name: "NodeViewWrapper",
|
|
1042
1042
|
props: { as: {
|
|
1043
1043
|
type: String,
|
|
@@ -1053,15 +1053,15 @@ var Ft = y({
|
|
|
1053
1053
|
onDragstart: this.onDragStart
|
|
1054
1054
|
}, (e = this.$slots).default?.call(e));
|
|
1055
1055
|
}
|
|
1056
|
-
}),
|
|
1056
|
+
}), Lt = (e = {}) => {
|
|
1057
1057
|
let t = _();
|
|
1058
1058
|
return p(() => {
|
|
1059
|
-
t.value = new
|
|
1059
|
+
t.value = new Pt(e);
|
|
1060
1060
|
}), i(() => {
|
|
1061
1061
|
var e;
|
|
1062
1062
|
(e = t.value) == null || e.destroy();
|
|
1063
1063
|
}), t;
|
|
1064
|
-
},
|
|
1064
|
+
}, Rt = class {
|
|
1065
1065
|
constructor(e, { props: t = {}, editor: n }) {
|
|
1066
1066
|
this.destroyed = !1, this.editor = n, this.component = u(e), this.el = document.createElement("div"), this.props = l(t), this.renderedComponent = this.renderComponent();
|
|
1067
1067
|
}
|
|
@@ -1104,7 +1104,7 @@ y({
|
|
|
1104
1104
|
});
|
|
1105
1105
|
}
|
|
1106
1106
|
});
|
|
1107
|
-
var
|
|
1107
|
+
var zt = {
|
|
1108
1108
|
editor: {
|
|
1109
1109
|
type: Object,
|
|
1110
1110
|
required: !0
|
|
@@ -1149,7 +1149,7 @@ var Rt = {
|
|
|
1149
1149
|
type: Object,
|
|
1150
1150
|
required: !0
|
|
1151
1151
|
}
|
|
1152
|
-
},
|
|
1152
|
+
}, Bt = class extends pe {
|
|
1153
1153
|
constructor(e, t, n) {
|
|
1154
1154
|
super(e, t, n), this.cachedExtensionWithSyncedStorage = null, this.handlePositionUpdate = () => {
|
|
1155
1155
|
let e = this.getPos();
|
|
@@ -1195,7 +1195,7 @@ var Rt = {
|
|
|
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 Rt(r, {
|
|
1199
1199
|
editor: this.editor,
|
|
1200
1200
|
props: t
|
|
1201
1201
|
});
|
|
@@ -1209,7 +1209,7 @@ var Rt = {
|
|
|
1209
1209
|
}
|
|
1210
1210
|
handleSelectionUpdate() {
|
|
1211
1211
|
let e = this.getPos();
|
|
1212
|
-
if (typeof e == "number") if (
|
|
1212
|
+
if (typeof e == "number") if (V({
|
|
1213
1213
|
selection: this.editor.state.selection,
|
|
1214
1214
|
pos: e,
|
|
1215
1215
|
nodeSize: this.node.nodeSize,
|
|
@@ -1267,29 +1267,29 @@ var Rt = {
|
|
|
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 Vt(e, t) {
|
|
1271
|
+
return (n) => n.editor.contentComponent ? new Bt(typeof e == "function" && "__vccOpts" in e ? e.__vccOpts : e, n, t) : {};
|
|
1272
1272
|
}
|
|
1273
1273
|
//#endregion
|
|
1274
1274
|
//#region src/components/MergeTagPicker.vue?vue&type=script&setup=true&lang.ts
|
|
1275
|
-
var
|
|
1275
|
+
var Ht = [
|
|
1276
1276
|
"title",
|
|
1277
1277
|
"aria-label",
|
|
1278
1278
|
"popovertarget",
|
|
1279
1279
|
"aria-expanded"
|
|
1280
|
-
],
|
|
1280
|
+
], Ut = ["id", "aria-label"], Wt = {
|
|
1281
1281
|
key: 0,
|
|
1282
1282
|
class: "merge-tag-list"
|
|
1283
|
-
},
|
|
1283
|
+
}, Gt = ["onClick"], Kt = { class: "merge-tag-option-label" }, qt = { class: "merge-tag-option-id" }, Jt = {
|
|
1284
1284
|
key: 1,
|
|
1285
1285
|
class: "merge-tag-empty"
|
|
1286
|
-
},
|
|
1286
|
+
}, Yt = /*#__PURE__*/ B(/* @__PURE__ */ y({
|
|
1287
1287
|
__name: "MergeTagPicker",
|
|
1288
1288
|
emits: ["select"],
|
|
1289
1289
|
setup(n, { emit: i }) {
|
|
1290
|
-
let s = i, { t: c, locale: l } =
|
|
1290
|
+
let s = i, { t: c, locale: l } = oe(), u = r(P, x(() => ({}))), p = x(() => Object.keys(u.value).map((e) => ({
|
|
1291
1291
|
id: e,
|
|
1292
|
-
label:
|
|
1292
|
+
label: H(u.value, e, l.value)
|
|
1293
1293
|
}))), m = g(""), h = x(() => {
|
|
1294
1294
|
let e = m.value.trim().toLowerCase();
|
|
1295
1295
|
return e ? p.value.filter((t) => t.label.toLowerCase().includes(e) || t.id.toLowerCase().includes(e)) : p.value;
|
|
@@ -1307,7 +1307,7 @@ var Vt = [
|
|
|
1307
1307
|
let t = e.relatedTarget, n = y.value;
|
|
1308
1308
|
t instanceof Node && n?.contains(t) || n?.matches(":popover-open") && n.hidePopover();
|
|
1309
1309
|
}
|
|
1310
|
-
function
|
|
1310
|
+
function re(e) {
|
|
1311
1311
|
s("select", e), y.value?.hidePopover();
|
|
1312
1312
|
}
|
|
1313
1313
|
return (n, r) => (t(), S(k, null, [p.value.length ? (t(), S("button", {
|
|
@@ -1322,10 +1322,10 @@ var Vt = [
|
|
|
1322
1322
|
"aria-haspopup": "dialog",
|
|
1323
1323
|
"aria-expanded": _.value,
|
|
1324
1324
|
onMousedown: r[0] ||= T(() => {}, ["prevent"])
|
|
1325
|
-
}, [A(
|
|
1325
|
+
}, [A(N, {
|
|
1326
1326
|
name: "braces",
|
|
1327
1327
|
size: 16
|
|
1328
|
-
})], 42,
|
|
1328
|
+
})], 42, Ht)) : C("", !0), p.value.length ? (t(), S("div", {
|
|
1329
1329
|
key: 1,
|
|
1330
1330
|
id: e(ee),
|
|
1331
1331
|
ref_key: "popover",
|
|
@@ -1337,7 +1337,7 @@ var Vt = [
|
|
|
1337
1337
|
onBeforetoggle: w,
|
|
1338
1338
|
onToggle: ne,
|
|
1339
1339
|
onFocusout: D
|
|
1340
|
-
}, [A(
|
|
1340
|
+
}, [A(Se, {
|
|
1341
1341
|
ref_key: "filterInput",
|
|
1342
1342
|
ref: te,
|
|
1343
1343
|
modelValue: m.value,
|
|
@@ -1350,19 +1350,19 @@ var Vt = [
|
|
|
1350
1350
|
"modelValue",
|
|
1351
1351
|
"placeholder",
|
|
1352
1352
|
"aria-label"
|
|
1353
|
-
]), h.value.length ? (t(), S("ul",
|
|
1353
|
+
]), h.value.length ? (t(), S("ul", Wt, [(t(!0), S(k, null, f(h.value, (e) => (t(), S("li", { key: e.id }, [E("button", {
|
|
1354
1354
|
type: "button",
|
|
1355
1355
|
class: "merge-tag-option",
|
|
1356
|
-
onClick: (t) =>
|
|
1356
|
+
onClick: (t) => re(e.id),
|
|
1357
1357
|
onMousedown: r[2] ||= T(() => {}, ["prevent"])
|
|
1358
|
-
}, [E("span",
|
|
1358
|
+
}, [E("span", Kt, O(e.label), 1), E("span", qt, O(e.id), 1)], 40, Gt)]))), 128))])) : (t(), S("p", Jt, O(e(c)("blocks.text.mergeTagEmpty")), 1))], 40, Ut)) : C("", !0)], 64));
|
|
1359
1359
|
}
|
|
1360
|
-
}), [["styles", [".merge-tag-trigger[data-v-
|
|
1360
|
+
}), [["styles", [".merge-tag-trigger[data-v-d5670188]{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-d5670188]:hover{background:color-mix(in srgb, var(--bygga-color-text) 30%, transparent)}.merge-tag-trigger.active[data-v-d5670188]{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-d5670188]{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-d5670188]:popover-open{display:flex}.merge-tag-list[data-v-d5670188]{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-d5670188]{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-d5670188]:hover,.merge-tag-option[data-v-d5670188]:focus-visible{background:var(--bygga-color-track);color:var(--bygga-color-accent);outline:none}.merge-tag-option-id[data-v-d5670188]{color:var(--bygga-color-text-muted);font-variant-numeric:tabular-nums;font-size:.85em}.merge-tag-empty[data-v-d5670188]{color:var(--bygga-color-text-muted);margin:0;padding:.35em .5em}"]], ["__scopeId", "data-v-d5670188"]]), Xt = /* @__PURE__ */ y({
|
|
1361
1361
|
__name: "MergeTagView",
|
|
1362
|
-
props:
|
|
1362
|
+
props: zt,
|
|
1363
1363
|
setup(i) {
|
|
1364
|
-
let a = i, { t: o, locale: s } =
|
|
1365
|
-
return (r, i) => (t(), ne(e(
|
|
1364
|
+
let a = i, { t: o, locale: s } = oe(), c = r(P, x(() => ({}))), l = x(() => String(a.node.attrs.id ?? "")), u = x(() => c.value[l.value] !== void 0), d = x(() => H(c.value, l.value, s.value)), f = x(() => o("blocks.text.mergeTagChip", { name: d.value }));
|
|
1365
|
+
return (r, i) => (t(), ne(e(It), {
|
|
1366
1366
|
as: "span",
|
|
1367
1367
|
class: b(["merge-tag", { "is-unknown": !u.value }]),
|
|
1368
1368
|
"data-merge-tag": l.value,
|
|
@@ -1380,73 +1380,86 @@ var Vt = [
|
|
|
1380
1380
|
"title"
|
|
1381
1381
|
]));
|
|
1382
1382
|
}
|
|
1383
|
-
})
|
|
1383
|
+
});
|
|
1384
|
+
//#endregion
|
|
1385
|
+
//#region src/fontSizes.ts
|
|
1384
1386
|
function Zt(e) {
|
|
1385
|
-
|
|
1387
|
+
return `${e}px`;
|
|
1388
|
+
}
|
|
1389
|
+
var Qt = new Set(se.map(Zt));
|
|
1390
|
+
function $t(e) {
|
|
1391
|
+
let t = e.trim();
|
|
1392
|
+
return Qt.has(t) ? t : null;
|
|
1393
|
+
}
|
|
1394
|
+
function en(e) {
|
|
1395
|
+
return Qt.has(e);
|
|
1396
|
+
}
|
|
1397
|
+
//#endregion
|
|
1398
|
+
//#region src/panels/contentPanel/components/blocks/sanitizePastedFonts.ts
|
|
1399
|
+
var tn = "textStyle";
|
|
1400
|
+
function nn(e) {
|
|
1401
|
+
let t = be(e);
|
|
1386
1402
|
return !t || t.key === "verdana" ? null : t.stack;
|
|
1387
1403
|
}
|
|
1388
|
-
function
|
|
1389
|
-
if (e.type.name !==
|
|
1390
|
-
let
|
|
1391
|
-
|
|
1392
|
-
let n = Zt(t);
|
|
1393
|
-
if (n === t) return e;
|
|
1394
|
-
let r = {
|
|
1395
|
-
...e.attrs,
|
|
1396
|
-
fontFamily: n
|
|
1397
|
-
};
|
|
1398
|
-
return n === null ? Object.entries(r).some(([e, t]) => e !== "fontFamily" && t !== null) ? e.type.create(r) : void 0 : e.type.create(r);
|
|
1404
|
+
function rn(e) {
|
|
1405
|
+
if (e.type.name !== tn) return e;
|
|
1406
|
+
let t = { ...e.attrs };
|
|
1407
|
+
return typeof t.fontFamily == "string" && (t.fontFamily = nn(t.fontFamily)), typeof t.fontSize == "string" && (t.fontSize = $t(t.fontSize)), t.fontFamily === e.attrs.fontFamily && t.fontSize === e.attrs.fontSize ? e : Object.values(t).some((e) => e !== null) ? e.type.create(t) : void 0;
|
|
1399
1408
|
}
|
|
1400
|
-
function
|
|
1409
|
+
function an(e) {
|
|
1401
1410
|
return e.flatMap((e) => {
|
|
1402
|
-
let t =
|
|
1411
|
+
let t = rn(e);
|
|
1403
1412
|
return t ? [t] : [];
|
|
1404
1413
|
});
|
|
1405
1414
|
}
|
|
1406
|
-
function
|
|
1407
|
-
return e.isText ? e.mark(
|
|
1415
|
+
function on(e) {
|
|
1416
|
+
return e.isText ? e.mark(an(e.marks)) : e.copy(sn(e.content)).mark(an(e.marks));
|
|
1408
1417
|
}
|
|
1409
|
-
function
|
|
1418
|
+
function sn(e) {
|
|
1410
1419
|
let t = [];
|
|
1411
|
-
for (let n = 0; n < e.childCount; n++) t.push(
|
|
1412
|
-
return
|
|
1420
|
+
for (let n = 0; n < e.childCount; n++) t.push(on(e.child(n)));
|
|
1421
|
+
return F.fromArray(t);
|
|
1413
1422
|
}
|
|
1414
|
-
function
|
|
1415
|
-
return new
|
|
1423
|
+
function cn(e) {
|
|
1424
|
+
return new M(sn(e.content), e.openStart, e.openEnd);
|
|
1416
1425
|
}
|
|
1417
1426
|
//#endregion
|
|
1418
1427
|
//#region src/panels/contentPanel/components/blocks/TextEditor.vue?vue&type=script&setup=true&lang.ts
|
|
1419
|
-
var
|
|
1428
|
+
var ln = { class: "picker" }, un = ["aria-label", "value"], dn = { value: "paragraph" }, fn = ["value"], pn = { class: "picker" }, mn = ["aria-label", "value"], hn = {
|
|
1420
1429
|
value: "mixed",
|
|
1421
1430
|
disabled: "",
|
|
1422
1431
|
hidden: ""
|
|
1423
|
-
},
|
|
1432
|
+
}, gn = ["value"], _n = { class: "picker" }, vn = ["aria-label", "value"], yn = {
|
|
1433
|
+
value: "mixed",
|
|
1434
|
+
disabled: "",
|
|
1435
|
+
hidden: ""
|
|
1436
|
+
}, bn = { value: "" }, xn = ["value"], Sn = ["title", "aria-label"], Cn = ["title", "aria-label"], wn = ["title", "aria-label"], Tn = [
|
|
1424
1437
|
"title",
|
|
1425
1438
|
"popovertarget",
|
|
1426
1439
|
"aria-expanded"
|
|
1427
|
-
],
|
|
1440
|
+
], En = ["id", "aria-label"], Dn = { class: "link-field" }, On = {
|
|
1428
1441
|
key: 0,
|
|
1429
1442
|
class: "link-anchor"
|
|
1430
|
-
},
|
|
1443
|
+
}, kn = {
|
|
1431
1444
|
key: 0,
|
|
1432
1445
|
value: ""
|
|
1433
|
-
},
|
|
1446
|
+
}, An = {
|
|
1434
1447
|
key: 1,
|
|
1435
1448
|
value: "",
|
|
1436
1449
|
disabled: "",
|
|
1437
1450
|
hidden: ""
|
|
1438
|
-
},
|
|
1451
|
+
}, jn = ["value"], Mn = ["title", "aria-label"], Nn = ["title", "onClick"], Pn = {
|
|
1439
1452
|
"aria-hidden": "true",
|
|
1440
1453
|
height: "16",
|
|
1441
1454
|
viewBox: "0 0 16 16",
|
|
1442
1455
|
width: "16"
|
|
1443
|
-
},
|
|
1456
|
+
}, Fn = [
|
|
1444
1457
|
"width",
|
|
1445
1458
|
"x",
|
|
1446
1459
|
"y"
|
|
1447
|
-
],
|
|
1460
|
+
], In = 8, Ln = 220, Rn = /*#__PURE__*/ B(/* @__PURE__ */ y({
|
|
1448
1461
|
__name: "TextEditor",
|
|
1449
|
-
props: /*@__PURE__*/
|
|
1462
|
+
props: /*@__PURE__*/ re({
|
|
1450
1463
|
editable: {
|
|
1451
1464
|
type: Boolean,
|
|
1452
1465
|
default: !1
|
|
@@ -1463,82 +1476,60 @@ var rn = ["aria-label", "value"], an = { value: "paragraph" }, on = ["value"], s
|
|
|
1463
1476
|
}),
|
|
1464
1477
|
emits: ["update:text"],
|
|
1465
1478
|
setup(i) {
|
|
1466
|
-
let s = c(i, "text"), l = i, { t: u } =
|
|
1479
|
+
let s = c(i, "text"), l = i, { t: u } = oe(), p = [
|
|
1467
1480
|
"left",
|
|
1468
1481
|
"center",
|
|
1469
1482
|
"right",
|
|
1470
1483
|
"justify"
|
|
1471
|
-
], h = x(() => u("blocks.text.label")), _ =
|
|
1472
|
-
...
|
|
1484
|
+
], h = x(() => u("blocks.text.label")), _ = Lt({
|
|
1485
|
+
...Me,
|
|
1473
1486
|
editorProps: {
|
|
1474
1487
|
attributes: {
|
|
1475
1488
|
"aria-label": h.value,
|
|
1476
1489
|
"aria-multiline": "true",
|
|
1477
1490
|
role: "textbox"
|
|
1478
1491
|
},
|
|
1479
|
-
transformPasted: (e) =>
|
|
1492
|
+
transformPasted: (e) => cn(e)
|
|
1480
1493
|
},
|
|
1481
|
-
content:
|
|
1494
|
+
content: we(s.value),
|
|
1482
1495
|
editable: l.editable,
|
|
1483
1496
|
extensions: [
|
|
1484
|
-
...
|
|
1485
|
-
|
|
1486
|
-
|
|
1497
|
+
...xe.map((e) => e.name === "mergeTag" ? e.extend({ addNodeView: () => Vt(Xt) }) : e),
|
|
1498
|
+
Mt,
|
|
1499
|
+
kt.configure({ placeholder: () => u("blocks.text.placeholder") })
|
|
1487
1500
|
],
|
|
1488
1501
|
onUpdate({ editor: e }) {
|
|
1489
|
-
s.value =
|
|
1502
|
+
s.value = ge(e.getJSON()), D();
|
|
1490
1503
|
},
|
|
1491
1504
|
onSelectionUpdate() {
|
|
1492
|
-
|
|
1505
|
+
D();
|
|
1493
1506
|
}
|
|
1494
1507
|
});
|
|
1495
1508
|
m(h, (e) => {
|
|
1496
1509
|
_.value?.setOptions({ editorProps: { attributes: { "aria-label": e } } });
|
|
1497
1510
|
}), m(s, (e) => {
|
|
1498
1511
|
let t = _.value;
|
|
1499
|
-
!t ||
|
|
1512
|
+
!t || Ie(e, ge(t.getJSON())) || t.commands.setContent(we(e), { emitUpdate: !1 });
|
|
1500
1513
|
}), m(() => l.editable, (e) => _.value?.setEditable(e));
|
|
1501
1514
|
let v = d("root"), y = d("toolbar");
|
|
1502
1515
|
function w() {
|
|
1503
1516
|
let e = y.value;
|
|
1504
|
-
!e || e.matches(":popover-open") || (e.showPopover(),
|
|
1517
|
+
!e || e.matches(":popover-open") || (e.showPopover(), D());
|
|
1505
1518
|
}
|
|
1506
1519
|
function ne(e) {
|
|
1507
1520
|
let t = e.relatedTarget;
|
|
1508
1521
|
t instanceof Node && v.value?.contains(t) || y.value?.matches(":popover-open") && y.value.hidePopover();
|
|
1509
1522
|
}
|
|
1510
|
-
function D(
|
|
1511
|
-
let t = e.ownerDocument, n = e.getRootNode();
|
|
1512
|
-
if (!(n instanceof ShadowRoot)) {
|
|
1513
|
-
let e = t.getSelection();
|
|
1514
|
-
return e && e.rangeCount > 0 && !e.isCollapsed ? e.getRangeAt(0) : void 0;
|
|
1515
|
-
}
|
|
1516
|
-
let r = n.getSelection?.();
|
|
1517
|
-
if (r) return r.rangeCount > 0 && !r.isCollapsed ? r.getRangeAt(0) : void 0;
|
|
1518
|
-
let [i] = t.getSelection()?.getComposedRanges?.({ shadowRoots: [n] }) ?? [];
|
|
1519
|
-
if (!i || i.collapsed) return;
|
|
1520
|
-
let a = t.createRange();
|
|
1521
|
-
return a.setStart(i.startContainer, i.startOffset), a.setEnd(i.endContainer, i.endOffset), a;
|
|
1522
|
-
}
|
|
1523
|
-
function j() {
|
|
1523
|
+
function D() {
|
|
1524
1524
|
let e = _.value?.view, t = y.value, n = v.value;
|
|
1525
1525
|
if (!(e && t && n && t.matches(":popover-open"))) return;
|
|
1526
|
-
let r = n.
|
|
1527
|
-
|
|
1528
|
-
let t = e.coordsAtPos(e.state.selection.from);
|
|
1529
|
-
i = {
|
|
1530
|
-
left: t.left,
|
|
1531
|
-
right: t.left,
|
|
1532
|
-
top: t.top
|
|
1533
|
-
};
|
|
1534
|
-
}
|
|
1535
|
-
let a = t.offsetWidth / 2, o = (i.left + i.right) / 2;
|
|
1536
|
-
t.style.left = `${Math.min(Math.max(o, r.left + a), r.right - a)}px`, t.style.top = `${i.top}px`;
|
|
1526
|
+
let r = n.closest(".block-container"), i = (r?.querySelector(":scope > .block-label") ?? r ?? n).getBoundingClientRect(), a = Math.max(In, window.innerWidth - Ln - In), o = Math.min(Math.max(i.left, In), a);
|
|
1527
|
+
t.style.left = `${o}px`, t.style.maxWidth = `${window.innerWidth - o - In}px`, t.style.top = `${i.top}px`;
|
|
1537
1528
|
}
|
|
1538
1529
|
function re() {
|
|
1539
1530
|
let e = _.value;
|
|
1540
1531
|
if (!e) return "paragraph";
|
|
1541
|
-
let t =
|
|
1532
|
+
let t = Te.find((t) => e.isActive("heading", { level: t }));
|
|
1542
1533
|
return t ? `h${t}` : "paragraph";
|
|
1543
1534
|
}
|
|
1544
1535
|
function ie(e) {
|
|
@@ -1546,54 +1537,77 @@ var rn = ["aria-label", "value"], an = { value: "paragraph" }, on = ["value"], s
|
|
|
1546
1537
|
if (!(t instanceof HTMLSelectElement)) return;
|
|
1547
1538
|
let n = _.value?.chain().focus();
|
|
1548
1539
|
if (!n) return;
|
|
1549
|
-
let r =
|
|
1540
|
+
let r = Te.find((e) => `h${e}` === t.value);
|
|
1550
1541
|
r ? n.setHeading({ level: r }).run() : n.setParagraph().run();
|
|
1551
1542
|
}
|
|
1552
|
-
let
|
|
1553
|
-
function
|
|
1554
|
-
return typeof e == "string" ?
|
|
1543
|
+
let j = r(ye, x(() => je));
|
|
1544
|
+
function ae(e) {
|
|
1545
|
+
return typeof e == "string" ? be(e)?.key ?? j.value : j.value;
|
|
1555
1546
|
}
|
|
1556
|
-
function
|
|
1547
|
+
function M() {
|
|
1557
1548
|
let e = _.value;
|
|
1558
|
-
if (!e) return
|
|
1549
|
+
if (!e) return j.value;
|
|
1559
1550
|
let { from: t, to: n, empty: r } = e.state.selection;
|
|
1560
|
-
if (r) return
|
|
1551
|
+
if (r) return ae(e.getAttributes("textStyle").fontFamily);
|
|
1561
1552
|
let i = /* @__PURE__ */ new Set();
|
|
1562
1553
|
e.state.doc.nodesBetween(t, n, (e) => {
|
|
1563
1554
|
if (!e.isText) return;
|
|
1564
1555
|
let t = e.marks.find((e) => e.type.name === "textStyle");
|
|
1565
|
-
i.add(
|
|
1556
|
+
i.add(ae(t?.attrs.fontFamily));
|
|
1566
1557
|
});
|
|
1567
1558
|
let a = Array.from(i);
|
|
1568
|
-
return a.length > 1 ? "mixed" : a[0] ??
|
|
1559
|
+
return a.length > 1 ? "mixed" : a[0] ?? j.value;
|
|
1569
1560
|
}
|
|
1570
|
-
function
|
|
1561
|
+
function ce(e) {
|
|
1571
1562
|
let { target: t } = e;
|
|
1572
1563
|
if (!(t instanceof HTMLSelectElement)) return;
|
|
1573
1564
|
let n = t.value, r = _.value?.chain().focus();
|
|
1574
|
-
r &&
|
|
1565
|
+
r && De(n) && (n === j.value ? r.unsetFontFamily().run() : r.setFontFamily(ue(n)).run());
|
|
1566
|
+
}
|
|
1567
|
+
function P(e) {
|
|
1568
|
+
return typeof e == "string" && en(e) ? e : "";
|
|
1569
|
+
}
|
|
1570
|
+
function F() {
|
|
1571
|
+
let e = _.value;
|
|
1572
|
+
if (!e) return "";
|
|
1573
|
+
let { from: t, to: n, empty: r } = e.state.selection;
|
|
1574
|
+
if (r) return P(e.getAttributes("textStyle").fontSize);
|
|
1575
|
+
let i = /* @__PURE__ */ new Set();
|
|
1576
|
+
e.state.doc.nodesBetween(t, n, (e) => {
|
|
1577
|
+
if (!e.isText) return;
|
|
1578
|
+
let t = e.marks.find((e) => e.type.name === "textStyle");
|
|
1579
|
+
i.add(P(t?.attrs.fontSize));
|
|
1580
|
+
});
|
|
1581
|
+
let a = Array.from(i);
|
|
1582
|
+
return a.length > 1 ? "mixed" : a[0] ?? "";
|
|
1583
|
+
}
|
|
1584
|
+
function I(e) {
|
|
1585
|
+
let { target: t } = e;
|
|
1586
|
+
if (!(t instanceof HTMLSelectElement)) return;
|
|
1587
|
+
let n = _.value?.chain().focus();
|
|
1588
|
+
n && (t.value === "" ? n.unsetFontSize().run() : en(t.value) && n.setFontSize(t.value).run());
|
|
1575
1589
|
}
|
|
1576
|
-
let
|
|
1577
|
-
let e =
|
|
1590
|
+
let L = Ee(() => {
|
|
1591
|
+
let e = M();
|
|
1578
1592
|
return e === "mixed" ? void 0 : e;
|
|
1579
|
-
}),
|
|
1593
|
+
}), pe = x({
|
|
1580
1594
|
get: () => {
|
|
1581
|
-
let e = _.value?.getAttributes("textStyle").color, t = typeof e == "string" ?
|
|
1595
|
+
let e = _.value?.getAttributes("textStyle").color, t = typeof e == "string" ? me(e) : void 0;
|
|
1582
1596
|
return t ? {
|
|
1583
1597
|
type: "color",
|
|
1584
1598
|
...t
|
|
1585
|
-
} :
|
|
1599
|
+
} : Pe;
|
|
1586
1600
|
},
|
|
1587
1601
|
set: (e) => {
|
|
1588
|
-
e.type !== "transparent" && _.value?.chain().setColor(
|
|
1602
|
+
e.type !== "transparent" && _.value?.chain().setColor(ke(e)).run();
|
|
1589
1603
|
}
|
|
1590
|
-
}),
|
|
1604
|
+
}), he = {
|
|
1591
1605
|
left: "blocks.text.alignLeft",
|
|
1592
1606
|
center: "blocks.text.alignCenter",
|
|
1593
1607
|
right: "blocks.text.alignRight",
|
|
1594
1608
|
justify: "blocks.text.alignJustify"
|
|
1595
1609
|
};
|
|
1596
|
-
function
|
|
1610
|
+
function ve(e) {
|
|
1597
1611
|
return (e === "justify" ? [
|
|
1598
1612
|
14,
|
|
1599
1613
|
14,
|
|
@@ -1613,48 +1627,48 @@ var rn = ["aria-label", "value"], an = { value: "paragraph" }, on = ["value"], s
|
|
|
1613
1627
|
};
|
|
1614
1628
|
});
|
|
1615
1629
|
}
|
|
1616
|
-
let
|
|
1617
|
-
function
|
|
1630
|
+
let R = o(), z = d("linkPopover"), B = d("linkInput"), Ce = d("linkTrigger"), V = g(""), H = g(!1), Oe = g(!1);
|
|
1631
|
+
function Ae(e) {
|
|
1618
1632
|
if (e.newState !== "open") return;
|
|
1619
1633
|
let t = _.value?.getAttributes("link")?.href;
|
|
1620
|
-
|
|
1621
|
-
let n =
|
|
1634
|
+
V.value = typeof t == "string" ? t : "", Oe.value = V.value !== "";
|
|
1635
|
+
let n = z.value, r = Ce.value?.getBoundingClientRect();
|
|
1622
1636
|
n && r && (n.style.left = `${r.left}px`, n.style.top = `${r.bottom + 4}px`);
|
|
1623
1637
|
}
|
|
1624
|
-
function
|
|
1625
|
-
if (
|
|
1626
|
-
let t =
|
|
1638
|
+
function U(e) {
|
|
1639
|
+
if (H.value = e.newState === "open", e.newState !== "open") return;
|
|
1640
|
+
let t = z.value;
|
|
1627
1641
|
if (t) {
|
|
1628
1642
|
let e = window.innerWidth - t.offsetWidth - 8;
|
|
1629
1643
|
Number.parseFloat(t.style.left) > e && (t.style.left = `${Math.max(8, e)}px`);
|
|
1630
1644
|
}
|
|
1631
1645
|
a(() => {
|
|
1632
|
-
|
|
1646
|
+
B.value?.focus(), B.value?.select();
|
|
1633
1647
|
});
|
|
1634
1648
|
}
|
|
1635
|
-
function
|
|
1636
|
-
let t = e.relatedTarget, n =
|
|
1649
|
+
function Le(e) {
|
|
1650
|
+
let t = e.relatedTarget, n = z.value;
|
|
1637
1651
|
t instanceof Node && n?.contains(t) || n?.hidePopover();
|
|
1638
1652
|
}
|
|
1639
|
-
function
|
|
1653
|
+
function W() {
|
|
1640
1654
|
let e = _.value?.chain().focus();
|
|
1641
1655
|
if (!e) return;
|
|
1642
|
-
let t =
|
|
1656
|
+
let t = Fe(V.value);
|
|
1643
1657
|
t === "" ? e.unsetLink().run() : e.setLink({
|
|
1644
1658
|
href: t,
|
|
1645
1659
|
target: t.startsWith("#") ? null : "_blank"
|
|
1646
|
-
}).run(),
|
|
1660
|
+
}).run(), z.value?.hidePopover();
|
|
1647
1661
|
}
|
|
1648
|
-
let
|
|
1649
|
-
function
|
|
1650
|
-
e === "" ?
|
|
1662
|
+
let Re = r(_e, x(() => [])), G = x(() => V.value.startsWith("#") && Re.value.includes(V.value.slice(1)) ? V.value.slice(1) : "");
|
|
1663
|
+
function K(e) {
|
|
1664
|
+
e === "" ? V.value.startsWith("#") && (V.value = "") : V.value = `#${e}`;
|
|
1651
1665
|
}
|
|
1652
|
-
function
|
|
1653
|
-
_.value?.chain().focus().unsetLink().run(),
|
|
1666
|
+
function ze() {
|
|
1667
|
+
_.value?.chain().focus().unsetLink().run(), z.value?.hidePopover();
|
|
1654
1668
|
}
|
|
1655
|
-
function
|
|
1669
|
+
function Be(e) {
|
|
1656
1670
|
_.value?.chain().focus().insertContent({
|
|
1657
|
-
type:
|
|
1671
|
+
type: de,
|
|
1658
1672
|
attrs: { id: e }
|
|
1659
1673
|
}).run();
|
|
1660
1674
|
}
|
|
@@ -1667,7 +1681,7 @@ var rn = ["aria-label", "value"], an = { value: "paragraph" }, on = ["value"], s
|
|
|
1667
1681
|
},
|
|
1668
1682
|
onFocusin: w,
|
|
1669
1683
|
onFocusout: ne
|
|
1670
|
-
}, [A(e(
|
|
1684
|
+
}, [A(e(Ft), ee(l.editable ? { class: "text-input" } : {}, {
|
|
1671
1685
|
editor: e(_),
|
|
1672
1686
|
style: e(le)(l)
|
|
1673
1687
|
}), null, 16, ["editor", "style"]), l.editable ? (t(), S("div", {
|
|
@@ -1677,144 +1691,171 @@ var rn = ["aria-label", "value"], an = { value: "paragraph" }, on = ["value"], s
|
|
|
1677
1691
|
popover: "manual",
|
|
1678
1692
|
class: "toolbar"
|
|
1679
1693
|
}, [
|
|
1680
|
-
E("select", {
|
|
1694
|
+
E("span", ln, [E("select", {
|
|
1681
1695
|
"aria-label": e(u)("blocks.text.styleLabel"),
|
|
1682
1696
|
class: "style",
|
|
1683
1697
|
value: re(),
|
|
1684
1698
|
onChange: ie,
|
|
1685
1699
|
onMousedown: i[0] ||= T(() => {}, ["stop"])
|
|
1686
|
-
}, [E("option",
|
|
1700
|
+
}, [E("option", dn, O(e(u)("blocks.text.styleNormal")), 1), (t(!0), S(k, null, f(e(Te), (n) => (t(), S("option", {
|
|
1687
1701
|
key: n,
|
|
1688
1702
|
value: `h${n}`
|
|
1689
|
-
}, O(e(u)("blocks.text.styleHeading", { level: n })), 9,
|
|
1690
|
-
|
|
1691
|
-
|
|
1703
|
+
}, O(e(u)("blocks.text.styleHeading", { level: n })), 9, fn))), 128))], 40, un), A(N, {
|
|
1704
|
+
class: "picker-chevron",
|
|
1705
|
+
name: "chevron-down",
|
|
1706
|
+
size: 12
|
|
1707
|
+
})]),
|
|
1708
|
+
i[20] ||= E("span", { class: "divider" }, null, -1),
|
|
1709
|
+
E("span", pn, [E("select", {
|
|
1692
1710
|
"aria-label": e(u)("blocks.text.font"),
|
|
1693
1711
|
class: "font",
|
|
1694
|
-
value:
|
|
1695
|
-
onChange:
|
|
1712
|
+
value: M(),
|
|
1713
|
+
onChange: ce,
|
|
1696
1714
|
onMousedown: i[1] ||= T(() => {}, ["stop"])
|
|
1697
|
-
}, [E("option",
|
|
1715
|
+
}, [E("option", hn, O(e(u)("blocks.text.fontMixed")), 1), (t(!0), S(k, null, f(e(L), (e) => (t(), S("option", {
|
|
1698
1716
|
key: e.key,
|
|
1699
1717
|
value: e.key
|
|
1700
|
-
}, O(e.name), 9,
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1718
|
+
}, O(e.name), 9, gn))), 128))], 40, mn), A(N, {
|
|
1719
|
+
class: "picker-chevron",
|
|
1720
|
+
name: "chevron-down",
|
|
1721
|
+
size: 12
|
|
1722
|
+
})]),
|
|
1723
|
+
E("span", _n, [E("select", {
|
|
1724
|
+
"aria-label": e(u)("blocks.text.fontSize"),
|
|
1725
|
+
class: "size",
|
|
1726
|
+
value: F(),
|
|
1727
|
+
onChange: I,
|
|
1728
|
+
onMousedown: i[2] ||= T(() => {}, ["stop"])
|
|
1729
|
+
}, [
|
|
1730
|
+
E("option", yn, O(e(u)("blocks.text.fontMixed")), 1),
|
|
1731
|
+
E("option", bn, O(e(u)("blocks.text.fontSizeDefault")), 1),
|
|
1732
|
+
(t(!0), S(k, null, f(e(se), (n) => (t(), S("option", {
|
|
1733
|
+
key: n,
|
|
1734
|
+
value: e(Zt)(n)
|
|
1735
|
+
}, O(n), 9, xn))), 128))
|
|
1736
|
+
], 40, vn), A(N, {
|
|
1737
|
+
class: "picker-chevron",
|
|
1738
|
+
name: "chevron-down",
|
|
1739
|
+
size: 12
|
|
1740
|
+
})]),
|
|
1741
|
+
A(fe, {
|
|
1742
|
+
modelValue: pe.value,
|
|
1743
|
+
"onUpdate:modelValue": i[3] ||= (e) => pe.value = e,
|
|
1704
1744
|
"allow-transparent": !1,
|
|
1705
1745
|
label: e(u)("blocks.text.textColor"),
|
|
1706
|
-
|
|
1746
|
+
compact: "",
|
|
1747
|
+
onMousedown: i[4] ||= T(() => {}, ["stop"])
|
|
1707
1748
|
}, null, 8, ["modelValue", "label"]),
|
|
1708
|
-
i[
|
|
1749
|
+
i[21] ||= E("span", { class: "divider" }, null, -1),
|
|
1709
1750
|
E("button", {
|
|
1710
1751
|
class: b({ active: e(_)?.isActive("bold") }),
|
|
1711
1752
|
type: "button",
|
|
1712
1753
|
title: e(u)("blocks.text.bold"),
|
|
1713
1754
|
"aria-label": e(u)("blocks.text.bold"),
|
|
1714
|
-
onClick: i[
|
|
1715
|
-
onMousedown: i[
|
|
1716
|
-
}, [...i[
|
|
1755
|
+
onClick: i[5] ||= (t) => e(_)?.chain().focus().toggleBold().run(),
|
|
1756
|
+
onMousedown: i[6] ||= T(() => {}, ["prevent"])
|
|
1757
|
+
}, [...i[17] ||= [E("b", null, "B", -1)]], 42, Sn),
|
|
1717
1758
|
E("button", {
|
|
1718
1759
|
class: b({ active: e(_)?.isActive("italic") }),
|
|
1719
1760
|
type: "button",
|
|
1720
1761
|
title: e(u)("blocks.text.italic"),
|
|
1721
1762
|
"aria-label": e(u)("blocks.text.italic"),
|
|
1722
|
-
onClick: i[
|
|
1723
|
-
onMousedown: i[
|
|
1724
|
-
}, [...i[
|
|
1763
|
+
onClick: i[7] ||= (t) => e(_)?.chain().focus().toggleItalic().run(),
|
|
1764
|
+
onMousedown: i[8] ||= T(() => {}, ["prevent"])
|
|
1765
|
+
}, [...i[18] ||= [E("i", null, "I", -1)]], 42, Cn),
|
|
1725
1766
|
E("button", {
|
|
1726
1767
|
class: b({ active: e(_)?.isActive("underline") }),
|
|
1727
1768
|
type: "button",
|
|
1728
1769
|
title: e(u)("blocks.text.underline"),
|
|
1729
1770
|
"aria-label": e(u)("blocks.text.underline"),
|
|
1730
|
-
onClick: i[
|
|
1731
|
-
onMousedown: i[
|
|
1732
|
-
}, [...i[
|
|
1771
|
+
onClick: i[9] ||= (t) => e(_)?.chain().focus().toggleUnderline().run(),
|
|
1772
|
+
onMousedown: i[10] ||= T(() => {}, ["prevent"])
|
|
1773
|
+
}, [...i[19] ||= [E("u", null, "U", -1)]], 42, wn),
|
|
1733
1774
|
E("button", {
|
|
1734
1775
|
ref_key: "linkTrigger",
|
|
1735
|
-
ref:
|
|
1776
|
+
ref: Ce,
|
|
1736
1777
|
class: b({ active: e(_)?.isActive("link") }),
|
|
1737
1778
|
type: "button",
|
|
1738
1779
|
title: e(u)("blocks.text.link"),
|
|
1739
|
-
popovertarget: e(
|
|
1780
|
+
popovertarget: e(R),
|
|
1740
1781
|
"aria-haspopup": "dialog",
|
|
1741
|
-
"aria-expanded":
|
|
1742
|
-
onMousedown: i[
|
|
1743
|
-
}, [A(
|
|
1782
|
+
"aria-expanded": H.value,
|
|
1783
|
+
onMousedown: i[11] ||= T(() => {}, ["prevent"])
|
|
1784
|
+
}, [A(N, {
|
|
1744
1785
|
name: "link",
|
|
1745
1786
|
size: 16
|
|
1746
|
-
})], 42,
|
|
1787
|
+
})], 42, Tn),
|
|
1747
1788
|
l.editable ? (t(), S("div", {
|
|
1748
1789
|
key: 0,
|
|
1749
|
-
id: e(
|
|
1790
|
+
id: e(R),
|
|
1750
1791
|
ref_key: "linkPopover",
|
|
1751
|
-
ref:
|
|
1792
|
+
ref: z,
|
|
1752
1793
|
class: "link-popover",
|
|
1753
1794
|
popover: "",
|
|
1754
1795
|
role: "dialog",
|
|
1755
1796
|
"aria-label": e(u)("blocks.text.link"),
|
|
1756
|
-
onBeforetoggle:
|
|
1757
|
-
onToggle:
|
|
1758
|
-
onFocusout:
|
|
1797
|
+
onBeforetoggle: Ae,
|
|
1798
|
+
onToggle: U,
|
|
1799
|
+
onFocusout: Le
|
|
1759
1800
|
}, [
|
|
1760
|
-
E("span",
|
|
1801
|
+
E("span", Dn, [A(Se, {
|
|
1761
1802
|
ref_key: "linkInput",
|
|
1762
|
-
ref:
|
|
1763
|
-
modelValue:
|
|
1764
|
-
"onUpdate:modelValue": i[
|
|
1803
|
+
ref: B,
|
|
1804
|
+
modelValue: V.value,
|
|
1805
|
+
"onUpdate:modelValue": i[12] ||= (e) => V.value = e,
|
|
1765
1806
|
inputmode: "url",
|
|
1766
1807
|
spellcheck: "false",
|
|
1767
1808
|
autocomplete: "off",
|
|
1768
1809
|
placeholder: e(u)("blocks.text.linkPlaceholder"),
|
|
1769
1810
|
"aria-label": e(u)("blocks.text.linkPrompt"),
|
|
1770
|
-
onKeydown: te(T(
|
|
1811
|
+
onKeydown: te(T(W, ["prevent"]), ["enter"])
|
|
1771
1812
|
}, null, 8, [
|
|
1772
1813
|
"modelValue",
|
|
1773
1814
|
"placeholder",
|
|
1774
1815
|
"aria-label",
|
|
1775
1816
|
"onKeydown"
|
|
1776
1817
|
])]),
|
|
1777
|
-
e(
|
|
1818
|
+
e(Re).length ? (t(), S("span", On, [A(Ne, {
|
|
1778
1819
|
"aria-label": e(u)("blocks.common.anchorLink.label"),
|
|
1779
|
-
"model-value":
|
|
1780
|
-
"onUpdate:modelValue":
|
|
1781
|
-
onMousedown: i[
|
|
1820
|
+
"model-value": G.value,
|
|
1821
|
+
"onUpdate:modelValue": K,
|
|
1822
|
+
onMousedown: i[13] ||= T(() => {}, ["stop"])
|
|
1782
1823
|
}, {
|
|
1783
|
-
default: n(() => [
|
|
1824
|
+
default: n(() => [G.value ? (t(), S("option", kn, O(e(u)("blocks.common.anchorLink.none")), 1)) : (t(), S("option", An, O(e(u)("blocks.common.anchorLink.placeholder")), 1)), (t(!0), S(k, null, f(e(Re), (e) => (t(), S("option", {
|
|
1784
1825
|
key: e,
|
|
1785
1826
|
value: e
|
|
1786
|
-
}, " #" + O(e), 9,
|
|
1827
|
+
}, " #" + O(e), 9, jn))), 128))]),
|
|
1787
1828
|
_: 1
|
|
1788
1829
|
}, 8, ["aria-label", "model-value"])])) : C("", !0),
|
|
1789
1830
|
E("button", {
|
|
1790
1831
|
class: "link-apply",
|
|
1791
1832
|
type: "button",
|
|
1792
|
-
onClick:
|
|
1793
|
-
onMousedown: i[
|
|
1833
|
+
onClick: W,
|
|
1834
|
+
onMousedown: i[14] ||= T(() => {}, ["prevent"])
|
|
1794
1835
|
}, O(e(u)("blocks.text.linkApply")), 33),
|
|
1795
|
-
|
|
1836
|
+
Oe.value ? (t(), S("button", {
|
|
1796
1837
|
key: 1,
|
|
1797
1838
|
class: "link-remove",
|
|
1798
1839
|
type: "button",
|
|
1799
1840
|
title: e(u)("blocks.text.linkRemove"),
|
|
1800
1841
|
"aria-label": e(u)("blocks.text.linkRemove"),
|
|
1801
|
-
onClick:
|
|
1802
|
-
onMousedown: i[
|
|
1803
|
-
}, [A(
|
|
1842
|
+
onClick: ze,
|
|
1843
|
+
onMousedown: i[15] ||= T(() => {}, ["prevent"])
|
|
1844
|
+
}, [A(N, {
|
|
1804
1845
|
name: "trash",
|
|
1805
1846
|
size: 16
|
|
1806
|
-
})], 40,
|
|
1807
|
-
], 40,
|
|
1808
|
-
A(
|
|
1809
|
-
i[
|
|
1847
|
+
})], 40, Mn)) : C("", !0)
|
|
1848
|
+
], 40, En)) : C("", !0),
|
|
1849
|
+
A(Yt, { onSelect: Be }),
|
|
1850
|
+
i[22] ||= E("span", { class: "divider" }, null, -1),
|
|
1810
1851
|
(t(), S(k, null, f(p, (n) => E("button", {
|
|
1811
1852
|
key: n,
|
|
1812
1853
|
class: b({ active: e(_)?.isActive({ textAlign: n }) }),
|
|
1813
|
-
title: e(u)(
|
|
1854
|
+
title: e(u)(he[n]),
|
|
1814
1855
|
type: "button",
|
|
1815
1856
|
onClick: (t) => e(_)?.chain().focus().setTextAlign(n).run(),
|
|
1816
|
-
onMousedown: i[
|
|
1817
|
-
}, [(t(), S("svg",
|
|
1857
|
+
onMousedown: i[16] ||= T(() => {}, ["prevent"])
|
|
1858
|
+
}, [(t(), S("svg", Pn, [(t(!0), S(k, null, f(ve(n), (e, n) => (t(), S("rect", {
|
|
1818
1859
|
key: n,
|
|
1819
1860
|
fill: "currentColor",
|
|
1820
1861
|
height: "1.5",
|
|
@@ -1822,9 +1863,9 @@ var rn = ["aria-label", "value"], an = { value: "paragraph" }, on = ["value"], s
|
|
|
1822
1863
|
width: e.w,
|
|
1823
1864
|
x: e.x,
|
|
1824
1865
|
y: e.y
|
|
1825
|
-
}, null, 8,
|
|
1866
|
+
}, null, 8, Fn))), 128))]))], 42, Nn)), 64))
|
|
1826
1867
|
], 512)) : C("", !0)], 544));
|
|
1827
1868
|
}
|
|
1828
|
-
}), [["styles", [".tiptap{font-feature-settings:\"liga\" 0;font-variant-ligatures:none;overflow-wrap:break-word;white-space:pre-wrap;position:relative}.text-input .tiptap:focus,.text-input .tiptap:focus-visible{outline:none}.text-input .tiptap .is-editor-empty:first-child{position:relative}.text-input .tiptap .is-editor-empty:first-child:before{color:var(--bygga-color-text-muted);content:attr(data-placeholder);pointer-events:none;text-overflow:ellipsis;inset-inline:0;white-space:nowrap;position:absolute;top:0;overflow:hidden}.merge-tag{background:var(--bygga-color-track);border:1px solid var(--bygga-color-border);border-radius:var(--bygga-radius-sm);color:var(--bygga-color-accent);cursor:default;white-space:nowrap;-webkit-user-select:all;user-select:all;padding:0 .3em;font-size:.9em}.merge-tag.is-unknown{color:var(--bygga-color-text-muted);border-style:dashed}.merge-tag.ProseMirror-selectednode{outline:2px solid var(--bygga-color-accent);outline-offset:1px}", ".toolbar[data-v-
|
|
1869
|
+
}), [["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-8d26020b]{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-8d26020b]:popover-open{display:flex}.toolbar>button[data-v-8d26020b]{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-8d26020b]:hover{background:color-mix(in srgb, var(--bygga-color-text) 30%, transparent)}.toolbar>button.active[data-v-8d26020b]{background:var(--bygga-color-selected,var(--bygga-color-text));color:var(--bygga-color-selected-text,#fff);forced-color-adjust:none}.toolbar .picker[data-v-8d26020b]{align-items:center;display:inline-flex;position:relative}.toolbar .style[data-v-8d26020b],.toolbar .font[data-v-8d26020b],.toolbar .size[data-v-8d26020b]{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-8d26020b]:hover,.toolbar .font[data-v-8d26020b]:hover,.toolbar .size[data-v-8d26020b]:hover{background:color-mix(in srgb, var(--bygga-color-text) 7%, transparent)}.toolbar .picker-chevron[data-v-8d26020b]{color:var(--bygga-color-text);pointer-events:none;position:absolute;right:5px}.toolbar .divider[data-v-8d26020b]{background:var(--bygga-color-divider);width:1px;height:24px;margin:0 4px}.link-popover[data-v-8d26020b]{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-8d26020b]:popover-open{display:flex}.link-field[data-v-8d26020b]{width:18em}.link-anchor[data-v-8d26020b]{width:10em}.link-apply[data-v-8d26020b]{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-8d26020b]{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-8d26020b]:hover{background:var(--bygga-color-track);color:var(--bygga-color-accent)}"]], ["__scopeId", "data-v-8d26020b"]]);
|
|
1829
1870
|
//#endregion
|
|
1830
|
-
export {
|
|
1871
|
+
export { Rn as default };
|