@bygga.dev/editor 1.7.0 → 1.7.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { $t as
|
|
1
|
+
import { $ as e, C as t, D as n, E as r, F as i, H as a, I as o, J as s, K as c, L as l, M as u, N as d, O as f, P as p, R as m, T as h, U as g, V as _, X as v, Y as y, Z as ee, at as b, b as x, ct as te, dt as S, i as ne, j as C, k as w, mt as T, p as E, q as re, rt as ie, st as D, t as ae, ut as O, v as oe, w as k, y as A, z as se } from "./providerKeys-BsADyfoz.js";
|
|
2
|
+
import { $t as ce, C as j, Ct as M, D as N, S as le, St as ue, X as de, Y as fe, _t as P, an as pe, at as F, b as I, bt as L, c as me, ct as he, d as ge, dt as _e, en as ve, et as ye, fn as be, ft as xe, g as Se, gt as Ce, ht as R, in as we, it as Te, l as Ee, lt as De, mt as z, n as Oe, nn as ke, nt as Ae, on as je, ot as B, pt as Me, r as Ne, rn as Pe, rt as Fe, s as Ie, st as V, t as Le, tn as Re, tt as ze, u as Be, un as Ve, ut as He, v as Ue, vt as H, wt as We, xt as Ge, yt as U } from "./urls-DUOZKEPL.js";
|
|
3
3
|
//#region ../../node_modules/.pnpm/prosemirror-dropcursor@1.8.2/node_modules/prosemirror-dropcursor/dist/index.js
|
|
4
4
|
function Ke(e = {}) {
|
|
5
|
-
return new
|
|
5
|
+
return new P({ view(t) {
|
|
6
6
|
return new qe(t, e);
|
|
7
7
|
} });
|
|
8
8
|
}
|
|
@@ -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 = ue(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);
|
|
@@ -208,7 +208,7 @@ function Ze(e) {
|
|
|
208
208
|
return !0;
|
|
209
209
|
}
|
|
210
210
|
function G() {
|
|
211
|
-
return new
|
|
211
|
+
return new P({ props: {
|
|
212
212
|
decorations: tt,
|
|
213
213
|
createSelectionBetween(e, t, n) {
|
|
214
214
|
return t.pos == n.pos && W.valid(n) ? new W(n) : null;
|
|
@@ -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 L) {
|
|
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
|
}
|
|
@@ -250,10 +250,10 @@ function et(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 =
|
|
253
|
+
let i = M.empty;
|
|
254
|
+
for (let e = r.length - 1; e >= 0; e--) i = M.from(r[e].createAndFill(null, i));
|
|
255
255
|
let a = e.state.tr.replace(n.pos, n.pos, new We(i, 0, 0));
|
|
256
|
-
return a.setSelection(
|
|
256
|
+
return a.setSelection(L.near(a.doc.resolve(n.pos + 1))), e.dispatch(a), !1;
|
|
257
257
|
}
|
|
258
258
|
function tt(e) {
|
|
259
259
|
if (!(e.selection instanceof W)) return null;
|
|
@@ -518,7 +518,7 @@ function gt(e = {}) {
|
|
|
518
518
|
return e = {
|
|
519
519
|
depth: e.depth || 100,
|
|
520
520
|
newGroupDelay: e.newGroupDelay || 500
|
|
521
|
-
}, new
|
|
521
|
+
}, new P({
|
|
522
522
|
key: Q,
|
|
523
523
|
state: {
|
|
524
524
|
init() {
|
|
@@ -547,7 +547,7 @@ function _t(e, t) {
|
|
|
547
547
|
};
|
|
548
548
|
}
|
|
549
549
|
var vt = _t(!1, !0), yt = _t(!0, !0);
|
|
550
|
-
|
|
550
|
+
F.create({
|
|
551
551
|
name: "characterCount",
|
|
552
552
|
addOptions() {
|
|
553
553
|
return {
|
|
@@ -579,7 +579,7 @@ I.create({
|
|
|
579
579
|
},
|
|
580
580
|
addProseMirrorPlugins() {
|
|
581
581
|
let e = !1;
|
|
582
|
-
return [new
|
|
582
|
+
return [new P({
|
|
583
583
|
key: new H("characterCount"),
|
|
584
584
|
appendTransaction: (t, n, r) => {
|
|
585
585
|
if (e) return;
|
|
@@ -608,7 +608,7 @@ I.create({
|
|
|
608
608
|
}
|
|
609
609
|
})];
|
|
610
610
|
}
|
|
611
|
-
}),
|
|
611
|
+
}), F.create({
|
|
612
612
|
name: "dropCursor",
|
|
613
613
|
addOptions() {
|
|
614
614
|
return {
|
|
@@ -620,7 +620,7 @@ I.create({
|
|
|
620
620
|
addProseMirrorPlugins() {
|
|
621
621
|
return [Ke(this.options)];
|
|
622
622
|
}
|
|
623
|
-
}),
|
|
623
|
+
}), F.create({
|
|
624
624
|
name: "focus",
|
|
625
625
|
addOptions() {
|
|
626
626
|
return {
|
|
@@ -629,7 +629,7 @@ I.create({
|
|
|
629
629
|
};
|
|
630
630
|
},
|
|
631
631
|
addProseMirrorPlugins() {
|
|
632
|
-
return [new
|
|
632
|
+
return [new P({
|
|
633
633
|
key: new H("focus"),
|
|
634
634
|
props: { decorations: ({ doc: e, selection: t }) => {
|
|
635
635
|
let { isEditable: n, isFocused: r } = this.editor, { anchor: i } = t, a = [];
|
|
@@ -650,7 +650,7 @@ I.create({
|
|
|
650
650
|
} }
|
|
651
651
|
})];
|
|
652
652
|
}
|
|
653
|
-
}),
|
|
653
|
+
}), F.create({
|
|
654
654
|
name: "gapCursor",
|
|
655
655
|
addProseMirrorPlugins() {
|
|
656
656
|
return [G()];
|
|
@@ -836,7 +836,7 @@ function jt(e) {
|
|
|
836
836
|
}
|
|
837
837
|
function Mt({ editor: e, options: t }) {
|
|
838
838
|
let n = t.dataAttribute ? `data-${Tt(t.dataAttribute)}` : `data-${bt}`;
|
|
839
|
-
return new
|
|
839
|
+
return new P({
|
|
840
840
|
key: $,
|
|
841
841
|
state: At,
|
|
842
842
|
view: jt,
|
|
@@ -849,7 +849,7 @@ function Mt({ editor: e, options: t }) {
|
|
|
849
849
|
}) }
|
|
850
850
|
});
|
|
851
851
|
}
|
|
852
|
-
var Nt =
|
|
852
|
+
var Nt = F.create({
|
|
853
853
|
name: "placeholder",
|
|
854
854
|
addOptions() {
|
|
855
855
|
return {
|
|
@@ -869,14 +869,14 @@ var Nt = I.create({
|
|
|
869
869
|
})];
|
|
870
870
|
}
|
|
871
871
|
}), Pt = ".ProseMirror:not(.ProseMirror-focused) *::selection {\n background: transparent;\n}\n\n.ProseMirror:not(.ProseMirror-focused) *::-moz-selection {\n background: transparent;\n}";
|
|
872
|
-
|
|
872
|
+
F.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" && he(Pt, e.options.injectNonce, "selection"), [new
|
|
879
|
+
return e.options.injectCSS && typeof document < "u" && he(Pt, e.options.injectNonce, "selection"), [new P({
|
|
880
880
|
key: new H("selection"),
|
|
881
881
|
props: { decorations(n) {
|
|
882
882
|
return n.selection.empty || e.isFocused || !e.isEditable || _e(n.selection) || e.view.dragging ? null : R.create(n.doc, [z.inline(n.selection.from, n.selection.to, { class: t.className })]);
|
|
@@ -887,7 +887,7 @@ I.create({
|
|
|
887
887
|
function Ft({ types: e, node: t }) {
|
|
888
888
|
return t && Array.isArray(e) && e.includes(t.type) || t?.type === e;
|
|
889
889
|
}
|
|
890
|
-
|
|
890
|
+
F.create({
|
|
891
891
|
name: "trailingNode",
|
|
892
892
|
addOptions() {
|
|
893
893
|
return {
|
|
@@ -897,7 +897,7 @@ I.create({
|
|
|
897
897
|
},
|
|
898
898
|
addProseMirrorPlugins() {
|
|
899
899
|
let e = new H(this.name), t = this.options.node || this.editor.schema.topNodeType.contentMatch.defaultType?.name || "paragraph", n = Object.entries(this.editor.schema.nodes).map(([, e]) => e).filter((e) => (this.options.notAfter || []).concat(t).includes(e.name));
|
|
900
|
-
return [new
|
|
900
|
+
return [new P({
|
|
901
901
|
key: e,
|
|
902
902
|
appendTransaction: (n, r, i) => {
|
|
903
903
|
let { doc: a, tr: o, schema: s } = i, c = e.getState(i), l = a.content.size, u = s.nodes[t];
|
|
@@ -923,7 +923,7 @@ I.create({
|
|
|
923
923
|
})];
|
|
924
924
|
}
|
|
925
925
|
});
|
|
926
|
-
var It =
|
|
926
|
+
var It = F.create({
|
|
927
927
|
name: "undoRedo",
|
|
928
928
|
addOptions() {
|
|
929
929
|
return {
|
|
@@ -952,13 +952,13 @@ var It = I.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 Lt(
|
|
956
|
-
return
|
|
955
|
+
function Lt(t) {
|
|
956
|
+
return e((e, n) => ({
|
|
957
957
|
get() {
|
|
958
|
-
return
|
|
958
|
+
return e(), t;
|
|
959
959
|
},
|
|
960
|
-
set(
|
|
961
|
-
|
|
960
|
+
set(e) {
|
|
961
|
+
t = e, requestAnimationFrame(() => {
|
|
962
962
|
requestAnimationFrame(() => {
|
|
963
963
|
n();
|
|
964
964
|
});
|
|
@@ -970,7 +970,7 @@ var Rt = class extends Te {
|
|
|
970
970
|
constructor(e = {}) {
|
|
971
971
|
return super(e), this.contentComponent = null, this.appContext = null, this.reactiveState = Lt(this.view.state), this.reactiveExtensionStorage = Lt(this.extensionStorage), this.on("beforeTransaction", ({ nextState: e }) => {
|
|
972
972
|
this.reactiveState.value = e, this.reactiveExtensionStorage.value = this.extensionStorage;
|
|
973
|
-
}),
|
|
973
|
+
}), ie(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
|
-
}, zt =
|
|
989
|
+
}, zt = C({
|
|
990
990
|
name: "EditorContent",
|
|
991
991
|
props: { editor: {
|
|
992
992
|
default: null,
|
|
993
993
|
type: Object
|
|
994
994
|
} },
|
|
995
|
-
setup(
|
|
996
|
-
let
|
|
997
|
-
return
|
|
998
|
-
let
|
|
999
|
-
|
|
1000
|
-
if (!
|
|
1001
|
-
let
|
|
1002
|
-
|
|
1003
|
-
...
|
|
1004
|
-
provides:
|
|
1005
|
-
}),
|
|
995
|
+
setup(e) {
|
|
996
|
+
let t = D(), n = u();
|
|
997
|
+
return v(() => {
|
|
998
|
+
let r = e.editor;
|
|
999
|
+
r && r.options.element && t.value && l(() => {
|
|
1000
|
+
if (!t.value || !r.view.dom?.parentNode) return;
|
|
1001
|
+
let e = O(t.value);
|
|
1002
|
+
t.value.append(...r.view.dom.parentNode.childNodes), r.contentComponent = n.ctx._, n && (r.appContext = {
|
|
1003
|
+
...n.appContext,
|
|
1004
|
+
provides: n.provides
|
|
1005
|
+
}), r.setOptions({ element: e }), r.createNodeViews();
|
|
1006
1006
|
});
|
|
1007
|
-
}),
|
|
1008
|
-
let
|
|
1009
|
-
|
|
1010
|
-
}), { rootEl:
|
|
1007
|
+
}), m(() => {
|
|
1008
|
+
let t = e.editor;
|
|
1009
|
+
t && (t.contentComponent = null, t.appContext = null);
|
|
1010
|
+
}), { rootEl: t };
|
|
1011
1011
|
},
|
|
1012
1012
|
render() {
|
|
1013
|
-
return
|
|
1013
|
+
return d("div", { ref: (e) => {
|
|
1014
1014
|
this.rootEl = e;
|
|
1015
1015
|
} });
|
|
1016
1016
|
}
|
|
1017
1017
|
});
|
|
1018
|
-
|
|
1018
|
+
C({
|
|
1019
1019
|
name: "NodeViewContent",
|
|
1020
1020
|
props: { as: {
|
|
1021
1021
|
type: String,
|
|
@@ -1031,13 +1031,13 @@ w({
|
|
|
1031
1031
|
e && e(null);
|
|
1032
1032
|
},
|
|
1033
1033
|
render() {
|
|
1034
|
-
return
|
|
1034
|
+
return d(this.as, {
|
|
1035
1035
|
style: { whiteSpace: "pre-wrap" },
|
|
1036
1036
|
"data-node-view-content": ""
|
|
1037
1037
|
});
|
|
1038
1038
|
}
|
|
1039
1039
|
});
|
|
1040
|
-
var Bt =
|
|
1040
|
+
var Bt = C({
|
|
1041
1041
|
name: "NodeViewWrapper",
|
|
1042
1042
|
props: { as: {
|
|
1043
1043
|
type: String,
|
|
@@ -1046,7 +1046,7 @@ var Bt = w({
|
|
|
1046
1046
|
inject: ["onDragStart", "decorationClasses"],
|
|
1047
1047
|
render() {
|
|
1048
1048
|
var e;
|
|
1049
|
-
return
|
|
1049
|
+
return d(this.as, {
|
|
1050
1050
|
class: this.decorationClasses,
|
|
1051
1051
|
style: { whiteSpace: "normal" },
|
|
1052
1052
|
"data-node-view-wrapper": "",
|
|
@@ -1054,16 +1054,16 @@ var Bt = w({
|
|
|
1054
1054
|
}, (e = this.$slots).default?.call(e));
|
|
1055
1055
|
}
|
|
1056
1056
|
}), Vt = (e = {}) => {
|
|
1057
|
-
let t =
|
|
1058
|
-
return
|
|
1057
|
+
let t = te();
|
|
1058
|
+
return se(() => {
|
|
1059
1059
|
t.value = new Rt(e);
|
|
1060
|
-
}),
|
|
1060
|
+
}), m(() => {
|
|
1061
1061
|
var e;
|
|
1062
1062
|
(e = t.value) == null || e.destroy();
|
|
1063
1063
|
}), t;
|
|
1064
1064
|
}, Ht = 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 = ie(e), this.el = document.createElement("div"), this.props = b(t), this.renderedComponent = this.renderComponent();
|
|
1067
1067
|
}
|
|
1068
1068
|
get element() {
|
|
1069
1069
|
return this.renderedComponent.el;
|
|
@@ -1073,11 +1073,11 @@ var Bt = w({
|
|
|
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 = d(this.component, this.props);
|
|
1077
|
+
return this.editor.appContext && (e.appContext = this.editor.appContext), typeof document < "u" && this.el && E(e, this.el), {
|
|
1078
1078
|
vNode: e,
|
|
1079
1079
|
destroy: () => {
|
|
1080
|
-
this.el &&
|
|
1080
|
+
this.el && E(null, this.el), this.el = null, e = null;
|
|
1081
1081
|
},
|
|
1082
1082
|
el: this.el ? this.el.firstElementChild : null
|
|
1083
1083
|
};
|
|
@@ -1091,14 +1091,14 @@ var Bt = w({
|
|
|
1091
1091
|
this.destroyed || (this.destroyed = !0, this.renderedComponent.destroy());
|
|
1092
1092
|
}
|
|
1093
1093
|
};
|
|
1094
|
-
|
|
1094
|
+
C({
|
|
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 d(this.as, {
|
|
1102
1102
|
style: { whiteSpace: "inherit" },
|
|
1103
1103
|
"data-mark-view-content": ""
|
|
1104
1104
|
});
|
|
@@ -1178,26 +1178,26 @@ var Ut = {
|
|
|
1178
1178
|
getPos: () => this.getPos(),
|
|
1179
1179
|
updateAttributes: (e = {}) => this.updateAttributes(e),
|
|
1180
1180
|
deleteNode: () => this.deleteNode()
|
|
1181
|
-
},
|
|
1182
|
-
this.decorationClasses =
|
|
1183
|
-
let
|
|
1181
|
+
}, t = e, n = this.onDragStart.bind(this);
|
|
1182
|
+
this.decorationClasses = D(this.getDecorationClasses());
|
|
1183
|
+
let r = C({
|
|
1184
1184
|
extends: { ...this.component },
|
|
1185
1185
|
props: Object.keys(e),
|
|
1186
1186
|
template: this.component.template,
|
|
1187
1187
|
setup: (e) => {
|
|
1188
|
-
var
|
|
1189
|
-
return
|
|
1188
|
+
var t;
|
|
1189
|
+
return a("onDragStart", n), a("decorationClasses", this.decorationClasses), a("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
|
},
|
|
1193
1193
|
__scopeId: this.component.__scopeId,
|
|
1194
1194
|
__cssModules: this.component.__cssModules,
|
|
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 Ht(
|
|
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 Ht(r, {
|
|
1199
1199
|
editor: this.editor,
|
|
1200
|
-
props:
|
|
1200
|
+
props: t
|
|
1201
1201
|
});
|
|
1202
1202
|
}
|
|
1203
1203
|
get dom() {
|
|
@@ -1304,7 +1304,7 @@ var Yt = [
|
|
|
1304
1304
|
"aria-label",
|
|
1305
1305
|
"popovertarget",
|
|
1306
1306
|
"aria-expanded"
|
|
1307
|
-
], Xt = ["id", "aria-label"], Zt = { class: "ai-list" }, Qt = ["onClick"], $t = { class: "ai-option-label" }, en = { class: "ai-option-hint" }, tn = /*#__PURE__*/
|
|
1307
|
+
], Xt = ["id", "aria-label"], Zt = { class: "ai-list" }, Qt = ["onClick"], $t = { class: "ai-option-label" }, en = { class: "ai-option-hint" }, tn = /*#__PURE__*/ N(/* @__PURE__ */ C({
|
|
1308
1308
|
__name: "AiActionPicker",
|
|
1309
1309
|
props: {
|
|
1310
1310
|
actions: { type: Array },
|
|
@@ -1314,54 +1314,54 @@ var Yt = [
|
|
|
1314
1314
|
}
|
|
1315
1315
|
},
|
|
1316
1316
|
emits: ["select"],
|
|
1317
|
-
setup(e, { emit:
|
|
1318
|
-
let
|
|
1319
|
-
function
|
|
1317
|
+
setup(e, { emit: i }) {
|
|
1318
|
+
let a = i, { t: o } = I(), l = c(), u = s("trigger"), d = s("popover"), f = t(() => d.value?.matches(":popover-open") ?? !1);
|
|
1319
|
+
function p(e) {
|
|
1320
1320
|
if (e.newState !== "open") return;
|
|
1321
|
-
let t =
|
|
1321
|
+
let t = d.value, n = u.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 m(e) {
|
|
1325
|
+
let t = e.relatedTarget, n = d.value;
|
|
1326
1326
|
t instanceof Node && n?.contains(t) || n?.matches(":popover-open") && n.hidePopover();
|
|
1327
1327
|
}
|
|
1328
|
-
function
|
|
1329
|
-
|
|
1328
|
+
function h(e) {
|
|
1329
|
+
a("select", e), d.value?.hidePopover();
|
|
1330
1330
|
}
|
|
1331
|
-
return (t,
|
|
1331
|
+
return (t, i) => (_(), n(x, null, [e.actions.length ? (_(), n("button", {
|
|
1332
1332
|
key: 0,
|
|
1333
1333
|
ref_key: "trigger",
|
|
1334
|
-
ref:
|
|
1334
|
+
ref: u,
|
|
1335
1335
|
type: "button",
|
|
1336
|
-
class:
|
|
1336
|
+
class: S(["ai-trigger", { active: f.value }]),
|
|
1337
1337
|
disabled: e.pending,
|
|
1338
1338
|
"aria-busy": e.pending,
|
|
1339
|
-
title:
|
|
1340
|
-
"aria-label":
|
|
1341
|
-
popovertarget:
|
|
1339
|
+
title: O(o)("blocks.text.ai.label"),
|
|
1340
|
+
"aria-label": O(o)("blocks.text.ai.label"),
|
|
1341
|
+
popovertarget: O(l),
|
|
1342
1342
|
"aria-haspopup": "dialog",
|
|
1343
|
-
"aria-expanded":
|
|
1344
|
-
onMousedown:
|
|
1345
|
-
}, [
|
|
1343
|
+
"aria-expanded": f.value,
|
|
1344
|
+
onMousedown: i[0] ||= A(() => {}, ["prevent"])
|
|
1345
|
+
}, [w(j, {
|
|
1346
1346
|
name: "sparkles",
|
|
1347
1347
|
size: 16
|
|
1348
|
-
})], 42, Yt)) :
|
|
1348
|
+
})], 42, Yt)) : r("", !0), e.actions.length ? (_(), n("div", {
|
|
1349
1349
|
key: 1,
|
|
1350
|
-
id:
|
|
1350
|
+
id: O(l),
|
|
1351
1351
|
ref_key: "popover",
|
|
1352
|
-
ref:
|
|
1352
|
+
ref: d,
|
|
1353
1353
|
class: "ai-popover",
|
|
1354
1354
|
popover: "",
|
|
1355
1355
|
role: "dialog",
|
|
1356
|
-
"aria-label":
|
|
1357
|
-
onBeforetoggle:
|
|
1358
|
-
onFocusout:
|
|
1359
|
-
}, [
|
|
1356
|
+
"aria-label": O(o)("blocks.text.ai.label"),
|
|
1357
|
+
onBeforetoggle: p,
|
|
1358
|
+
onFocusout: m
|
|
1359
|
+
}, [k("ul", Zt, [(_(!0), n(x, null, g(e.actions, (e) => (_(), n("li", { key: e }, [k("button", {
|
|
1360
1360
|
type: "button",
|
|
1361
1361
|
class: "ai-option",
|
|
1362
|
-
onClick: (t) =>
|
|
1363
|
-
onMousedown:
|
|
1364
|
-
}, [
|
|
1362
|
+
onClick: (t) => h(e),
|
|
1363
|
+
onMousedown: i[1] ||= A(() => {}, ["prevent"])
|
|
1364
|
+
}, [k("span", $t, T(O(o)(`blocks.text.ai.actions.${e}.label`)), 1), k("span", en, T(O(o)(`blocks.text.ai.actions.${e}.hint`)), 1)], 40, Qt)]))), 128))])], 40, Xt)) : r("", !0)], 64));
|
|
1365
1365
|
}
|
|
1366
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"]]), nn = [
|
|
1367
1367
|
"title",
|
|
@@ -1374,95 +1374,95 @@ var Yt = [
|
|
|
1374
1374
|
}, on = ["onClick"], sn = { class: "merge-tag-option-label" }, cn = { class: "merge-tag-option-id" }, ln = {
|
|
1375
1375
|
key: 1,
|
|
1376
1376
|
class: "merge-tag-empty"
|
|
1377
|
-
}, un = /*#__PURE__*/
|
|
1377
|
+
}, un = /*#__PURE__*/ N(/* @__PURE__ */ C({
|
|
1378
1378
|
__name: "MergeTagPicker",
|
|
1379
1379
|
emits: ["select"],
|
|
1380
|
-
setup(e, { emit:
|
|
1381
|
-
let
|
|
1380
|
+
setup(e, { emit: i }) {
|
|
1381
|
+
let a = i, { t: o, locale: u } = I(), d = p(Ue, t(() => ({}))), f = t(() => Oe(d.value).map((e) => ({
|
|
1382
1382
|
id: e,
|
|
1383
|
-
label: Ne(
|
|
1384
|
-
}))),
|
|
1385
|
-
let e =
|
|
1386
|
-
return e ?
|
|
1387
|
-
}),
|
|
1383
|
+
label: Ne(d.value, e, u.value)
|
|
1384
|
+
}))), m = D(""), h = t(() => {
|
|
1385
|
+
let e = m.value.trim().toLowerCase();
|
|
1386
|
+
return e ? f.value.filter((t) => t.label.toLowerCase().includes(e) || t.id.toLowerCase().includes(e)) : f.value;
|
|
1387
|
+
}), v = c(), y = t(() => b.value?.matches(":popover-open") ?? !1), ee = s("trigger"), b = s("popover"), te = s("filterInput");
|
|
1388
1388
|
function ne(e) {
|
|
1389
1389
|
if (e.newState !== "open") return;
|
|
1390
|
-
|
|
1391
|
-
let t =
|
|
1390
|
+
m.value = "";
|
|
1391
|
+
let t = b.value, n = ee.value?.getBoundingClientRect();
|
|
1392
1392
|
t && n && (t.style.left = `${n.left}px`, t.style.top = `${n.bottom + 4}px`);
|
|
1393
1393
|
}
|
|
1394
1394
|
function C(e) {
|
|
1395
|
-
e.newState === "open" &&
|
|
1395
|
+
e.newState === "open" && l(() => te.value?.focus());
|
|
1396
1396
|
}
|
|
1397
|
-
function
|
|
1398
|
-
let t = e.relatedTarget, n =
|
|
1397
|
+
function E(e) {
|
|
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 re(e) {
|
|
1402
|
+
a("select", e), b.value?.hidePopover();
|
|
1403
1403
|
}
|
|
1404
|
-
return (e, t) => (
|
|
1404
|
+
return (e, t) => (_(), n(x, null, [f.value.length ? (_(), n("button", {
|
|
1405
1405
|
key: 0,
|
|
1406
1406
|
ref_key: "trigger",
|
|
1407
|
-
ref:
|
|
1407
|
+
ref: ee,
|
|
1408
1408
|
type: "button",
|
|
1409
|
-
class:
|
|
1410
|
-
title:
|
|
1411
|
-
"aria-label":
|
|
1412
|
-
popovertarget:
|
|
1409
|
+
class: S(["merge-tag-trigger", { active: y.value }]),
|
|
1410
|
+
title: O(o)("blocks.text.mergeTag"),
|
|
1411
|
+
"aria-label": O(o)("blocks.text.mergeTag"),
|
|
1412
|
+
popovertarget: O(v),
|
|
1413
1413
|
"aria-haspopup": "dialog",
|
|
1414
|
-
"aria-expanded":
|
|
1415
|
-
onMousedown: t[0] ||=
|
|
1416
|
-
}, [
|
|
1414
|
+
"aria-expanded": y.value,
|
|
1415
|
+
onMousedown: t[0] ||= A(() => {}, ["prevent"])
|
|
1416
|
+
}, [w(j, {
|
|
1417
1417
|
name: "braces",
|
|
1418
1418
|
size: 16
|
|
1419
|
-
})], 42, nn)) :
|
|
1419
|
+
})], 42, nn)) : r("", !0), f.value.length ? (_(), n("div", {
|
|
1420
1420
|
key: 1,
|
|
1421
|
-
id:
|
|
1421
|
+
id: O(v),
|
|
1422
1422
|
ref_key: "popover",
|
|
1423
|
-
ref:
|
|
1423
|
+
ref: b,
|
|
1424
1424
|
class: "merge-tag-popover",
|
|
1425
1425
|
popover: "",
|
|
1426
1426
|
role: "dialog",
|
|
1427
|
-
"aria-label":
|
|
1427
|
+
"aria-label": O(o)("blocks.text.mergeTag"),
|
|
1428
1428
|
onBeforetoggle: ne,
|
|
1429
1429
|
onToggle: C,
|
|
1430
|
-
onFocusout:
|
|
1431
|
-
}, [
|
|
1430
|
+
onFocusout: E
|
|
1431
|
+
}, [w(ge, {
|
|
1432
1432
|
ref_key: "filterInput",
|
|
1433
|
-
ref:
|
|
1434
|
-
modelValue:
|
|
1435
|
-
"onUpdate:modelValue": t[1] ||= (e) =>
|
|
1433
|
+
ref: te,
|
|
1434
|
+
modelValue: m.value,
|
|
1435
|
+
"onUpdate:modelValue": t[1] ||= (e) => m.value = e,
|
|
1436
1436
|
autocomplete: "off",
|
|
1437
|
-
placeholder:
|
|
1438
|
-
"aria-label":
|
|
1437
|
+
placeholder: O(o)("blocks.text.mergeTagSearch"),
|
|
1438
|
+
"aria-label": O(o)("blocks.text.mergeTagSearch"),
|
|
1439
1439
|
spellcheck: "false"
|
|
1440
1440
|
}, null, 8, [
|
|
1441
1441
|
"modelValue",
|
|
1442
1442
|
"placeholder",
|
|
1443
1443
|
"aria-label"
|
|
1444
|
-
]),
|
|
1444
|
+
]), h.value.length ? (_(), n("ul", an, [(_(!0), n(x, null, g(h.value, (e) => (_(), n("li", { key: e.id }, [k("button", {
|
|
1445
1445
|
type: "button",
|
|
1446
1446
|
class: "merge-tag-option",
|
|
1447
|
-
onClick: (t) =>
|
|
1448
|
-
onMousedown: t[2] ||=
|
|
1449
|
-
}, [
|
|
1447
|
+
onClick: (t) => re(e.id),
|
|
1448
|
+
onMousedown: t[2] ||= A(() => {}, ["prevent"])
|
|
1449
|
+
}, [k("span", sn, T(e.label), 1), k("span", cn, T(e.id), 1)], 40, on)]))), 128))])) : (_(), n("p", ln, T(O(o)("blocks.text.mergeTagEmpty")), 1))], 40, rn)) : r("", !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"]]), dn = /* @__PURE__ */
|
|
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"]]), dn = /* @__PURE__ */ C({
|
|
1452
1452
|
__name: "MergeTagView",
|
|
1453
1453
|
props: Ut,
|
|
1454
1454
|
setup(e) {
|
|
1455
|
-
let
|
|
1456
|
-
return (e, t) => (
|
|
1455
|
+
let n = e, { t: r, locale: i } = I(), a = p(Ue, t(() => ({}))), o = t(() => String(n.node.attrs.id ?? "")), s = t(() => a.value[o.value] !== void 0), c = t(() => Ne(a.value, o.value, i.value)), l = t(() => r("blocks.text.mergeTagChip", { name: c.value }));
|
|
1456
|
+
return (e, t) => (_(), h(O(Bt), {
|
|
1457
1457
|
as: "span",
|
|
1458
|
-
class:
|
|
1459
|
-
"data-merge-tag":
|
|
1458
|
+
class: S(["merge-tag", { "is-unknown": !s.value }]),
|
|
1459
|
+
"data-merge-tag": o.value,
|
|
1460
1460
|
contenteditable: "false",
|
|
1461
1461
|
role: "img",
|
|
1462
|
-
"aria-label":
|
|
1463
|
-
title:
|
|
1462
|
+
"aria-label": l.value,
|
|
1463
|
+
title: l.value
|
|
1464
1464
|
}, {
|
|
1465
|
-
default:
|
|
1465
|
+
default: ee(() => [f(T(c.value), 1)]),
|
|
1466
1466
|
_: 1
|
|
1467
1467
|
}, 8, [
|
|
1468
1468
|
"class",
|
|
@@ -1477,7 +1477,7 @@ var Yt = [
|
|
|
1477
1477
|
function fn(e) {
|
|
1478
1478
|
return `${e}px`;
|
|
1479
1479
|
}
|
|
1480
|
-
var pn = new Set(
|
|
1480
|
+
var pn = new Set(de.map(fn));
|
|
1481
1481
|
function mn(e) {
|
|
1482
1482
|
let t = e.trim();
|
|
1483
1483
|
return pn.has(t) ? t : null;
|
|
@@ -1509,7 +1509,7 @@ function bn(e, t) {
|
|
|
1509
1509
|
function xn(e, t) {
|
|
1510
1510
|
let n = [];
|
|
1511
1511
|
for (let r = 0; r < e.childCount; r++) n.push(bn(e.child(r), t));
|
|
1512
|
-
return
|
|
1512
|
+
return M.fromArray(n);
|
|
1513
1513
|
}
|
|
1514
1514
|
function Sn(e, t) {
|
|
1515
1515
|
return new We(xn(e.content, t), e.openStart, e.openEnd);
|
|
@@ -1548,9 +1548,9 @@ var Cn = { class: "picker" }, wn = ["aria-label", "value"], Tn = { value: "parag
|
|
|
1548
1548
|
"width",
|
|
1549
1549
|
"x",
|
|
1550
1550
|
"y"
|
|
1551
|
-
], Zn = 8, Qn = 220, $n = /*#__PURE__*/
|
|
1551
|
+
], Zn = 8, Qn = 220, $n = /*#__PURE__*/ N(/* @__PURE__ */ C({
|
|
1552
1552
|
__name: "TextEditor",
|
|
1553
|
-
props: /*@__PURE__*/
|
|
1553
|
+
props: /*@__PURE__*/ i({
|
|
1554
1554
|
editable: {
|
|
1555
1555
|
type: Boolean,
|
|
1556
1556
|
default: !1
|
|
@@ -1567,110 +1567,110 @@ var Cn = { class: "picker" }, wn = ["aria-label", "value"], Tn = { value: "parag
|
|
|
1567
1567
|
}),
|
|
1568
1568
|
emits: ["update:text"],
|
|
1569
1569
|
setup(e) {
|
|
1570
|
-
let
|
|
1570
|
+
let i = re(e, "text"), a = e, { t: u, locale: d } = I(), f = [
|
|
1571
1571
|
"left",
|
|
1572
1572
|
"center",
|
|
1573
1573
|
"right",
|
|
1574
1574
|
"justify"
|
|
1575
|
-
],
|
|
1575
|
+
], m = t(() => u("blocks.text.label")), h = Vt({
|
|
1576
1576
|
...ze,
|
|
1577
1577
|
editorProps: {
|
|
1578
1578
|
attributes: {
|
|
1579
|
-
"aria-label":
|
|
1579
|
+
"aria-label": m.value,
|
|
1580
1580
|
"aria-multiline": "true",
|
|
1581
1581
|
role: "textbox"
|
|
1582
1582
|
},
|
|
1583
|
-
transformPasted: (e) => Sn(e,
|
|
1583
|
+
transformPasted: (e) => Sn(e, ue.value)
|
|
1584
1584
|
},
|
|
1585
|
-
content: Re(
|
|
1586
|
-
editable:
|
|
1585
|
+
content: Re(i.value),
|
|
1586
|
+
editable: a.editable,
|
|
1587
1587
|
extensions: [
|
|
1588
1588
|
...Ae.map((e) => e.name === "mergeTag" ? e.extend({ addNodeView: () => Gt(dn) }) : e),
|
|
1589
1589
|
It,
|
|
1590
|
-
Nt.configure({ placeholder: () =>
|
|
1590
|
+
Nt.configure({ placeholder: () => u("blocks.text.placeholder") })
|
|
1591
1591
|
],
|
|
1592
1592
|
onUpdate({ editor: e }) {
|
|
1593
|
-
|
|
1593
|
+
i.value = ce(e.getJSON()), E();
|
|
1594
1594
|
},
|
|
1595
1595
|
onSelectionUpdate() {
|
|
1596
1596
|
E();
|
|
1597
1597
|
}
|
|
1598
1598
|
});
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
}),
|
|
1602
|
-
let t =
|
|
1603
|
-
!t || ve(e,
|
|
1604
|
-
}),
|
|
1605
|
-
let
|
|
1606
|
-
function
|
|
1607
|
-
let e =
|
|
1599
|
+
y(m, (e) => {
|
|
1600
|
+
h.value?.setOptions({ editorProps: { attributes: { "aria-label": e } } });
|
|
1601
|
+
}), y(i, (e) => {
|
|
1602
|
+
let t = h.value;
|
|
1603
|
+
!t || ve(e, ce(t.getJSON())) || t.commands.setContent(Re(e), { emitUpdate: !1 });
|
|
1604
|
+
}), y(() => a.editable, (e) => h.value?.setEditable(e));
|
|
1605
|
+
let v = s("root"), b = s("toolbar");
|
|
1606
|
+
function te() {
|
|
1607
|
+
let e = b.value;
|
|
1608
1608
|
!e || e.matches(":popover-open") || (e.showPopover(), E());
|
|
1609
1609
|
}
|
|
1610
|
-
function
|
|
1610
|
+
function C(e) {
|
|
1611
1611
|
let t = e.relatedTarget;
|
|
1612
|
-
t instanceof Node &&
|
|
1612
|
+
t instanceof Node && v.value?.contains(t) || b.value?.matches(":popover-open") && b.value.hidePopover();
|
|
1613
1613
|
}
|
|
1614
1614
|
function E() {
|
|
1615
|
-
let e =
|
|
1615
|
+
let e = h.value?.view, t = b.value, n = v.value;
|
|
1616
1616
|
if (!(e && t && n && t.matches(":popover-open"))) return;
|
|
1617
1617
|
let r = n.closest(".block-container"), i = (r?.querySelector(":scope > .block-label") ?? r ?? n).getBoundingClientRect(), a = Math.max(Zn, window.innerWidth - Qn - Zn), o = Math.min(Math.max(i.left, Zn), a);
|
|
1618
1618
|
t.style.left = `${o}px`, t.style.maxWidth = `${window.innerWidth - o - Zn}px`, t.style.top = `${i.top}px`;
|
|
1619
1619
|
}
|
|
1620
1620
|
function ie() {
|
|
1621
|
-
let e =
|
|
1621
|
+
let e = h.value;
|
|
1622
1622
|
if (!e) return "paragraph";
|
|
1623
1623
|
let t = ye.find((t) => e.isActive("heading", { level: t }));
|
|
1624
1624
|
return t ? `h${t}` : "paragraph";
|
|
1625
1625
|
}
|
|
1626
|
-
function
|
|
1626
|
+
function se(e) {
|
|
1627
1627
|
let { target: t } = e;
|
|
1628
1628
|
if (!(t instanceof HTMLSelectElement)) return;
|
|
1629
|
-
let n =
|
|
1629
|
+
let n = h.value?.chain().focus();
|
|
1630
1630
|
if (!n) return;
|
|
1631
1631
|
let r = ye.find((e) => `h${e}` === t.value);
|
|
1632
1632
|
r ? n.setHeading({ level: r }).run() : n.setParagraph().run();
|
|
1633
1633
|
}
|
|
1634
|
-
let
|
|
1635
|
-
function
|
|
1634
|
+
let M = p(ne, t(() => ke)), N = me(), ue = t(() => new Set(N.value.map((e) => e.stack)));
|
|
1635
|
+
function P(e) {
|
|
1636
1636
|
return `custom:${e}`;
|
|
1637
1637
|
}
|
|
1638
|
-
function
|
|
1639
|
-
if (typeof e != "string") return
|
|
1640
|
-
let t =
|
|
1641
|
-
return t ?
|
|
1638
|
+
function F(e) {
|
|
1639
|
+
if (typeof e != "string") return M.value;
|
|
1640
|
+
let t = N.value.find((t) => t.stack === e);
|
|
1641
|
+
return t ? P(t.name) : Pe(e)?.key ?? M.value;
|
|
1642
1642
|
}
|
|
1643
|
-
function
|
|
1644
|
-
let e =
|
|
1645
|
-
if (!e) return
|
|
1643
|
+
function L() {
|
|
1644
|
+
let e = h.value;
|
|
1645
|
+
if (!e) return M.value;
|
|
1646
1646
|
let { from: t, to: n, empty: r } = e.state.selection;
|
|
1647
|
-
if (r) return
|
|
1647
|
+
if (r) return F(e.getAttributes("textStyle").fontFamily);
|
|
1648
1648
|
let i = /* @__PURE__ */ new Set();
|
|
1649
1649
|
e.state.doc.nodesBetween(t, n, (e) => {
|
|
1650
1650
|
if (!e.isText) return;
|
|
1651
1651
|
let t = e.marks.find((e) => e.type.name === "textStyle");
|
|
1652
|
-
i.add(
|
|
1652
|
+
i.add(F(t?.attrs.fontFamily));
|
|
1653
1653
|
});
|
|
1654
1654
|
let a = Array.from(i);
|
|
1655
|
-
return a.length > 1 ? "mixed" : a[0] ??
|
|
1655
|
+
return a.length > 1 ? "mixed" : a[0] ?? M.value;
|
|
1656
1656
|
}
|
|
1657
1657
|
function he(e) {
|
|
1658
1658
|
let { target: t } = e;
|
|
1659
1659
|
if (!(t instanceof HTMLSelectElement)) return;
|
|
1660
|
-
let n = t.value, r =
|
|
1660
|
+
let n = t.value, r = h.value?.chain().focus();
|
|
1661
1661
|
if (!r) return;
|
|
1662
|
-
let i =
|
|
1662
|
+
let i = N.value.find((e) => P(e.name) === n);
|
|
1663
1663
|
if (i) {
|
|
1664
1664
|
r.setFontFamily(i.stack).run();
|
|
1665
1665
|
return;
|
|
1666
1666
|
}
|
|
1667
|
-
|
|
1667
|
+
pe(n) && (n === M.value ? r.unsetFontFamily().run() : r.setFontFamily(we(n)).run());
|
|
1668
1668
|
}
|
|
1669
1669
|
function _e(e) {
|
|
1670
1670
|
return typeof e == "string" && hn(e) ? e : "";
|
|
1671
1671
|
}
|
|
1672
1672
|
function xe() {
|
|
1673
|
-
let e =
|
|
1673
|
+
let e = h.value;
|
|
1674
1674
|
if (!e) return "";
|
|
1675
1675
|
let { from: t, to: n, empty: r } = e.state.selection;
|
|
1676
1676
|
if (r) return _e(e.getAttributes("textStyle").fontSize);
|
|
@@ -1686,22 +1686,22 @@ var Cn = { class: "picker" }, wn = ["aria-label", "value"], Tn = { value: "parag
|
|
|
1686
1686
|
function Ce(e) {
|
|
1687
1687
|
let { target: t } = e;
|
|
1688
1688
|
if (!(t instanceof HTMLSelectElement)) return;
|
|
1689
|
-
let n =
|
|
1689
|
+
let n = h.value?.chain().focus();
|
|
1690
1690
|
n && (t.value === "" ? n.unsetFontSize().run() : hn(t.value) && n.setFontSize(t.value).run());
|
|
1691
1691
|
}
|
|
1692
1692
|
let R = Ie(() => {
|
|
1693
|
-
let e =
|
|
1694
|
-
return
|
|
1695
|
-
}), Te =
|
|
1693
|
+
let e = L();
|
|
1694
|
+
return pe(e) ? e : void 0;
|
|
1695
|
+
}), Te = t({
|
|
1696
1696
|
get: () => {
|
|
1697
|
-
let e =
|
|
1697
|
+
let e = h.value?.getAttributes("textStyle").color, t = typeof e == "string" ? Ve(e) : void 0;
|
|
1698
1698
|
return t ? {
|
|
1699
1699
|
type: "color",
|
|
1700
1700
|
...t
|
|
1701
1701
|
} : je;
|
|
1702
1702
|
},
|
|
1703
1703
|
set: (e) => {
|
|
1704
|
-
e.type !== "transparent" &&
|
|
1704
|
+
e.type !== "transparent" && h.value?.chain().setColor(be(e)).run();
|
|
1705
1705
|
}
|
|
1706
1706
|
}), De = {
|
|
1707
1707
|
left: "blocks.text.alignLeft",
|
|
@@ -1729,10 +1729,10 @@ var Cn = { class: "picker" }, wn = ["aria-label", "value"], Tn = { value: "parag
|
|
|
1729
1729
|
};
|
|
1730
1730
|
});
|
|
1731
1731
|
}
|
|
1732
|
-
let Oe =
|
|
1732
|
+
let Oe = c(), B = s("linkPopover"), Me = s("linkInput"), Ne = s("linkTrigger"), V = D(""), He = D(!1), Ue = D(!1);
|
|
1733
1733
|
function H(e) {
|
|
1734
1734
|
if (e.newState !== "open") return;
|
|
1735
|
-
let t =
|
|
1735
|
+
let t = h.value?.getAttributes("link")?.href;
|
|
1736
1736
|
V.value = typeof t == "string" ? t : "", Ue.value = V.value !== "";
|
|
1737
1737
|
let n = B.value, r = Ne.value?.getBoundingClientRect();
|
|
1738
1738
|
n && r && (n.style.left = `${r.left}px`, n.style.top = `${r.bottom + 4}px`);
|
|
@@ -1744,7 +1744,7 @@ var Cn = { class: "picker" }, wn = ["aria-label", "value"], Tn = { value: "parag
|
|
|
1744
1744
|
let e = window.innerWidth - t.offsetWidth - 8;
|
|
1745
1745
|
Number.parseFloat(t.style.left) > e && (t.style.left = `${Math.max(8, e)}px`);
|
|
1746
1746
|
}
|
|
1747
|
-
|
|
1747
|
+
l(() => {
|
|
1748
1748
|
Me.value?.focus(), Me.value?.select();
|
|
1749
1749
|
});
|
|
1750
1750
|
}
|
|
@@ -1753,7 +1753,7 @@ var Cn = { class: "picker" }, wn = ["aria-label", "value"], Tn = { value: "parag
|
|
|
1753
1753
|
t instanceof Node && n?.contains(t) || n?.hidePopover();
|
|
1754
1754
|
}
|
|
1755
1755
|
function U() {
|
|
1756
|
-
let e =
|
|
1756
|
+
let e = h.value?.chain().focus();
|
|
1757
1757
|
if (!e) return;
|
|
1758
1758
|
let t = Le(V.value);
|
|
1759
1759
|
t === "" ? e.unsetLink().run() : e.setLink({
|
|
@@ -1761,14 +1761,14 @@ var Cn = { class: "picker" }, wn = ["aria-label", "value"], Tn = { value: "parag
|
|
|
1761
1761
|
target: t.startsWith("#") ? null : "_blank"
|
|
1762
1762
|
}).run(), B.value?.hidePopover();
|
|
1763
1763
|
}
|
|
1764
|
-
let Ke =
|
|
1764
|
+
let Ke = p(ae, t(() => [])), qe = t(() => V.value.startsWith("#") && Ke.value.includes(V.value.slice(1)) ? V.value.slice(1) : "");
|
|
1765
1765
|
function W(e) {
|
|
1766
1766
|
e === "" ? V.value.startsWith("#") && (V.value = "") : V.value = `#${e}`;
|
|
1767
1767
|
}
|
|
1768
1768
|
function Je() {
|
|
1769
|
-
|
|
1769
|
+
h.value?.chain().focus().unsetLink().run(), B.value?.hidePopover();
|
|
1770
1770
|
}
|
|
1771
|
-
let Ye =
|
|
1771
|
+
let Ye = p(Se), Xe = le(), Ze = t(() => Jt(Ye?.value?.ai)), G = D(!1);
|
|
1772
1772
|
function Qe(e) {
|
|
1773
1773
|
let { from: t, to: n, empty: r } = e.state.selection;
|
|
1774
1774
|
if (!r) return {
|
|
@@ -1800,168 +1800,168 @@ var Cn = { class: "picker" }, wn = ["aria-label", "value"], Tn = { value: "parag
|
|
|
1800
1800
|
}), t;
|
|
1801
1801
|
}
|
|
1802
1802
|
async function tt(e) {
|
|
1803
|
-
let t =
|
|
1803
|
+
let t = h.value, n = Ye?.value?.ai;
|
|
1804
1804
|
if (!(t && n) || G.value) return;
|
|
1805
|
-
let { from: r, to:
|
|
1806
|
-
if (
|
|
1805
|
+
let { from: r, to: i } = Qe(t), a = K(t, r, i);
|
|
1806
|
+
if (a.trim() !== "") {
|
|
1807
1807
|
G.value = !0;
|
|
1808
1808
|
try {
|
|
1809
1809
|
let t = await n.run({
|
|
1810
1810
|
action: e,
|
|
1811
|
-
text:
|
|
1812
|
-
locale:
|
|
1811
|
+
text: a,
|
|
1812
|
+
locale: d.value
|
|
1813
1813
|
});
|
|
1814
|
-
typeof t == "string" && t !== "" &&
|
|
1814
|
+
typeof t == "string" && t !== "" && h.value && h.value.chain().focus().insertContentAt({
|
|
1815
1815
|
from: r,
|
|
1816
|
-
to:
|
|
1816
|
+
to: i
|
|
1817
1817
|
}, et(t)).run();
|
|
1818
1818
|
} catch (e) {
|
|
1819
|
-
console.error("[bygga-editor] the AI action failed —", e), Xe?.show(
|
|
1819
|
+
console.error("[bygga-editor] the AI action failed —", e), Xe?.show(u("blocks.text.ai.failed"));
|
|
1820
1820
|
} finally {
|
|
1821
1821
|
G.value = !1;
|
|
1822
1822
|
}
|
|
1823
1823
|
}
|
|
1824
1824
|
}
|
|
1825
1825
|
function q(e) {
|
|
1826
|
-
|
|
1826
|
+
h.value?.chain().focus().insertContent({
|
|
1827
1827
|
type: Fe,
|
|
1828
1828
|
attrs: { id: e }
|
|
1829
1829
|
}).run();
|
|
1830
1830
|
}
|
|
1831
|
-
return (e, t) => (
|
|
1831
|
+
return (e, t) => (_(), n("div", {
|
|
1832
1832
|
ref_key: "root",
|
|
1833
|
-
ref:
|
|
1833
|
+
ref: v,
|
|
1834
1834
|
style: {
|
|
1835
1835
|
position: "relative",
|
|
1836
1836
|
width: "100%"
|
|
1837
1837
|
},
|
|
1838
|
-
onFocusin:
|
|
1839
|
-
onFocusout:
|
|
1840
|
-
}, [
|
|
1841
|
-
editor:
|
|
1842
|
-
style:
|
|
1843
|
-
}), null, 16, ["editor", "style"]),
|
|
1838
|
+
onFocusin: te,
|
|
1839
|
+
onFocusout: C
|
|
1840
|
+
}, [w(O(zt), o(a.editable ? { class: "text-input" } : {}, {
|
|
1841
|
+
editor: O(h),
|
|
1842
|
+
style: O(fe)(a)
|
|
1843
|
+
}), null, 16, ["editor", "style"]), a.editable ? (_(), n("div", {
|
|
1844
1844
|
key: 0,
|
|
1845
1845
|
ref_key: "toolbar",
|
|
1846
|
-
ref:
|
|
1846
|
+
ref: b,
|
|
1847
1847
|
popover: "manual",
|
|
1848
1848
|
class: "toolbar"
|
|
1849
1849
|
}, [
|
|
1850
|
-
|
|
1851
|
-
"aria-label":
|
|
1850
|
+
k("span", Cn, [k("select", {
|
|
1851
|
+
"aria-label": O(u)("blocks.text.styleLabel"),
|
|
1852
1852
|
class: "style",
|
|
1853
1853
|
value: ie(),
|
|
1854
|
-
onChange:
|
|
1855
|
-
onMousedown: t[0] ||=
|
|
1856
|
-
}, [
|
|
1854
|
+
onChange: se,
|
|
1855
|
+
onMousedown: t[0] ||= A(() => {}, ["stop"])
|
|
1856
|
+
}, [k("option", Tn, T(O(u)("blocks.text.styleNormal")), 1), (_(!0), n(x, null, g(O(ye), (e) => (_(), n("option", {
|
|
1857
1857
|
key: e,
|
|
1858
1858
|
value: `h${e}`
|
|
1859
|
-
},
|
|
1859
|
+
}, T(O(u)("blocks.text.styleHeading", { level: e })), 9, En))), 128))], 40, wn), w(j, {
|
|
1860
1860
|
class: "picker-chevron",
|
|
1861
1861
|
name: "chevron-down",
|
|
1862
1862
|
size: 12
|
|
1863
1863
|
})]),
|
|
1864
|
-
t[20] ||=
|
|
1865
|
-
|
|
1866
|
-
"aria-label":
|
|
1864
|
+
t[20] ||= k("span", { class: "divider" }, null, -1),
|
|
1865
|
+
k("span", Dn, [k("select", {
|
|
1866
|
+
"aria-label": O(u)("blocks.text.font"),
|
|
1867
1867
|
class: "font",
|
|
1868
|
-
value:
|
|
1868
|
+
value: L(),
|
|
1869
1869
|
onChange: he,
|
|
1870
|
-
onMousedown: t[1] ||=
|
|
1870
|
+
onMousedown: t[1] ||= A(() => {}, ["stop"])
|
|
1871
1871
|
}, [
|
|
1872
|
-
|
|
1873
|
-
(
|
|
1872
|
+
k("option", kn, T(O(u)("blocks.text.fontMixed")), 1),
|
|
1873
|
+
(_(!0), n(x, null, g(O(R), (e) => (_(), n("option", {
|
|
1874
1874
|
key: e.key,
|
|
1875
1875
|
value: e.key
|
|
1876
|
-
},
|
|
1877
|
-
(
|
|
1878
|
-
key:
|
|
1879
|
-
value:
|
|
1880
|
-
},
|
|
1881
|
-
], 40, On),
|
|
1876
|
+
}, T(e.name), 9, An))), 128)),
|
|
1877
|
+
(_(!0), n(x, null, g(O(N), (e) => (_(), n("option", {
|
|
1878
|
+
key: P(e.name),
|
|
1879
|
+
value: P(e.name)
|
|
1880
|
+
}, T(e.name), 9, jn))), 128))
|
|
1881
|
+
], 40, On), w(j, {
|
|
1882
1882
|
class: "picker-chevron",
|
|
1883
1883
|
name: "chevron-down",
|
|
1884
1884
|
size: 12
|
|
1885
1885
|
})]),
|
|
1886
|
-
|
|
1887
|
-
"aria-label":
|
|
1886
|
+
k("span", Mn, [k("select", {
|
|
1887
|
+
"aria-label": O(u)("blocks.text.fontSize"),
|
|
1888
1888
|
class: "size",
|
|
1889
1889
|
value: xe(),
|
|
1890
1890
|
onChange: Ce,
|
|
1891
|
-
onMousedown: t[2] ||=
|
|
1891
|
+
onMousedown: t[2] ||= A(() => {}, ["stop"])
|
|
1892
1892
|
}, [
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
(
|
|
1893
|
+
k("option", Pn, T(O(u)("blocks.text.fontMixed")), 1),
|
|
1894
|
+
k("option", Fn, T(O(u)("blocks.text.fontSizeDefault")), 1),
|
|
1895
|
+
(_(!0), n(x, null, g(O(de), (e) => (_(), n("option", {
|
|
1896
1896
|
key: e,
|
|
1897
|
-
value:
|
|
1898
|
-
},
|
|
1899
|
-
], 40, Nn),
|
|
1897
|
+
value: O(fn)(e)
|
|
1898
|
+
}, T(e), 9, In))), 128))
|
|
1899
|
+
], 40, Nn), w(j, {
|
|
1900
1900
|
class: "picker-chevron",
|
|
1901
1901
|
name: "chevron-down",
|
|
1902
1902
|
size: 12
|
|
1903
1903
|
})]),
|
|
1904
|
-
|
|
1904
|
+
w(Be, {
|
|
1905
1905
|
modelValue: Te.value,
|
|
1906
1906
|
"onUpdate:modelValue": t[3] ||= (e) => Te.value = e,
|
|
1907
1907
|
"allow-transparent": !1,
|
|
1908
|
-
label:
|
|
1908
|
+
label: O(u)("blocks.text.textColor"),
|
|
1909
1909
|
compact: "",
|
|
1910
|
-
onMousedown: t[4] ||=
|
|
1910
|
+
onMousedown: t[4] ||= A(() => {}, ["stop"])
|
|
1911
1911
|
}, null, 8, ["modelValue", "label"]),
|
|
1912
|
-
t[21] ||=
|
|
1913
|
-
|
|
1914
|
-
class:
|
|
1912
|
+
t[21] ||= k("span", { class: "divider" }, null, -1),
|
|
1913
|
+
k("button", {
|
|
1914
|
+
class: S({ active: O(h)?.isActive("bold") }),
|
|
1915
1915
|
type: "button",
|
|
1916
|
-
title:
|
|
1917
|
-
"aria-label":
|
|
1918
|
-
onClick: t[5] ||= (e) =>
|
|
1919
|
-
onMousedown: t[6] ||=
|
|
1920
|
-
}, [...t[17] ||= [
|
|
1921
|
-
|
|
1922
|
-
class:
|
|
1916
|
+
title: O(u)("blocks.text.bold"),
|
|
1917
|
+
"aria-label": O(u)("blocks.text.bold"),
|
|
1918
|
+
onClick: t[5] ||= (e) => O(h)?.chain().focus().toggleBold().run(),
|
|
1919
|
+
onMousedown: t[6] ||= A(() => {}, ["prevent"])
|
|
1920
|
+
}, [...t[17] ||= [k("b", null, "B", -1)]], 42, Ln),
|
|
1921
|
+
k("button", {
|
|
1922
|
+
class: S({ active: O(h)?.isActive("italic") }),
|
|
1923
1923
|
type: "button",
|
|
1924
|
-
title:
|
|
1925
|
-
"aria-label":
|
|
1926
|
-
onClick: t[7] ||= (e) =>
|
|
1927
|
-
onMousedown: t[8] ||=
|
|
1928
|
-
}, [...t[18] ||= [
|
|
1929
|
-
|
|
1930
|
-
class:
|
|
1924
|
+
title: O(u)("blocks.text.italic"),
|
|
1925
|
+
"aria-label": O(u)("blocks.text.italic"),
|
|
1926
|
+
onClick: t[7] ||= (e) => O(h)?.chain().focus().toggleItalic().run(),
|
|
1927
|
+
onMousedown: t[8] ||= A(() => {}, ["prevent"])
|
|
1928
|
+
}, [...t[18] ||= [k("i", null, "I", -1)]], 42, Rn),
|
|
1929
|
+
k("button", {
|
|
1930
|
+
class: S({ active: O(h)?.isActive("underline") }),
|
|
1931
1931
|
type: "button",
|
|
1932
|
-
title:
|
|
1933
|
-
"aria-label":
|
|
1934
|
-
onClick: t[9] ||= (e) =>
|
|
1935
|
-
onMousedown: t[10] ||=
|
|
1936
|
-
}, [...t[19] ||= [
|
|
1937
|
-
|
|
1932
|
+
title: O(u)("blocks.text.underline"),
|
|
1933
|
+
"aria-label": O(u)("blocks.text.underline"),
|
|
1934
|
+
onClick: t[9] ||= (e) => O(h)?.chain().focus().toggleUnderline().run(),
|
|
1935
|
+
onMousedown: t[10] ||= A(() => {}, ["prevent"])
|
|
1936
|
+
}, [...t[19] ||= [k("u", null, "U", -1)]], 42, zn),
|
|
1937
|
+
k("button", {
|
|
1938
1938
|
ref_key: "linkTrigger",
|
|
1939
1939
|
ref: Ne,
|
|
1940
|
-
class:
|
|
1940
|
+
class: S({ active: O(h)?.isActive("link") }),
|
|
1941
1941
|
type: "button",
|
|
1942
|
-
title:
|
|
1943
|
-
popovertarget:
|
|
1942
|
+
title: O(u)("blocks.text.link"),
|
|
1943
|
+
popovertarget: O(Oe),
|
|
1944
1944
|
"aria-haspopup": "dialog",
|
|
1945
1945
|
"aria-expanded": He.value,
|
|
1946
|
-
onMousedown: t[11] ||=
|
|
1947
|
-
}, [
|
|
1946
|
+
onMousedown: t[11] ||= A(() => {}, ["prevent"])
|
|
1947
|
+
}, [w(j, {
|
|
1948
1948
|
name: "link",
|
|
1949
1949
|
size: 16
|
|
1950
1950
|
})], 42, Bn),
|
|
1951
|
-
|
|
1951
|
+
a.editable ? (_(), n("div", {
|
|
1952
1952
|
key: 0,
|
|
1953
|
-
id:
|
|
1953
|
+
id: O(Oe),
|
|
1954
1954
|
ref_key: "linkPopover",
|
|
1955
1955
|
ref: B,
|
|
1956
1956
|
class: "link-popover",
|
|
1957
1957
|
popover: "",
|
|
1958
1958
|
role: "dialog",
|
|
1959
|
-
"aria-label":
|
|
1959
|
+
"aria-label": O(u)("blocks.text.link"),
|
|
1960
1960
|
onBeforetoggle: H,
|
|
1961
1961
|
onToggle: We,
|
|
1962
1962
|
onFocusout: Ge
|
|
1963
1963
|
}, [
|
|
1964
|
-
|
|
1964
|
+
k("span", Hn, [w(ge, {
|
|
1965
1965
|
ref_key: "linkInput",
|
|
1966
1966
|
ref: Me,
|
|
1967
1967
|
modelValue: V.value,
|
|
@@ -1969,61 +1969,61 @@ var Cn = { class: "picker" }, wn = ["aria-label", "value"], Tn = { value: "parag
|
|
|
1969
1969
|
inputmode: "url",
|
|
1970
1970
|
spellcheck: "false",
|
|
1971
1971
|
autocomplete: "off",
|
|
1972
|
-
placeholder:
|
|
1973
|
-
"aria-label":
|
|
1974
|
-
onKeydown:
|
|
1972
|
+
placeholder: O(u)("blocks.text.linkPlaceholder"),
|
|
1973
|
+
"aria-label": O(u)("blocks.text.linkPrompt"),
|
|
1974
|
+
onKeydown: oe(A(U, ["prevent"]), ["enter"])
|
|
1975
1975
|
}, null, 8, [
|
|
1976
1976
|
"modelValue",
|
|
1977
1977
|
"placeholder",
|
|
1978
1978
|
"aria-label",
|
|
1979
1979
|
"onKeydown"
|
|
1980
1980
|
])]),
|
|
1981
|
-
|
|
1982
|
-
"aria-label":
|
|
1981
|
+
O(Ke).length ? (_(), n("span", Un, [w(Ee, {
|
|
1982
|
+
"aria-label": O(u)("blocks.common.anchorLink.label"),
|
|
1983
1983
|
"model-value": qe.value,
|
|
1984
1984
|
"onUpdate:modelValue": W,
|
|
1985
|
-
onMousedown: t[13] ||=
|
|
1985
|
+
onMousedown: t[13] ||= A(() => {}, ["stop"])
|
|
1986
1986
|
}, {
|
|
1987
|
-
default:
|
|
1987
|
+
default: ee(() => [qe.value ? (_(), n("option", Wn, T(O(u)("blocks.common.anchorLink.none")), 1)) : (_(), n("option", Gn, T(O(u)("blocks.common.anchorLink.placeholder")), 1)), (_(!0), n(x, null, g(O(Ke), (e) => (_(), n("option", {
|
|
1988
1988
|
key: e,
|
|
1989
1989
|
value: e
|
|
1990
|
-
}, " #" +
|
|
1990
|
+
}, " #" + T(e), 9, Kn))), 128))]),
|
|
1991
1991
|
_: 1
|
|
1992
|
-
}, 8, ["aria-label", "model-value"])])) :
|
|
1993
|
-
|
|
1992
|
+
}, 8, ["aria-label", "model-value"])])) : r("", !0),
|
|
1993
|
+
k("button", {
|
|
1994
1994
|
class: "link-apply",
|
|
1995
1995
|
type: "button",
|
|
1996
1996
|
onClick: U,
|
|
1997
|
-
onMousedown: t[14] ||=
|
|
1998
|
-
},
|
|
1999
|
-
Ue.value ? (
|
|
1997
|
+
onMousedown: t[14] ||= A(() => {}, ["prevent"])
|
|
1998
|
+
}, T(O(u)("blocks.text.linkApply")), 33),
|
|
1999
|
+
Ue.value ? (_(), n("button", {
|
|
2000
2000
|
key: 1,
|
|
2001
2001
|
class: "link-remove",
|
|
2002
2002
|
type: "button",
|
|
2003
|
-
title:
|
|
2004
|
-
"aria-label":
|
|
2003
|
+
title: O(u)("blocks.text.linkRemove"),
|
|
2004
|
+
"aria-label": O(u)("blocks.text.linkRemove"),
|
|
2005
2005
|
onClick: Je,
|
|
2006
|
-
onMousedown: t[15] ||=
|
|
2007
|
-
}, [
|
|
2006
|
+
onMousedown: t[15] ||= A(() => {}, ["prevent"])
|
|
2007
|
+
}, [w(j, {
|
|
2008
2008
|
name: "trash",
|
|
2009
2009
|
size: 16
|
|
2010
|
-
})], 40, qn)) :
|
|
2011
|
-
], 40, Vn)) :
|
|
2012
|
-
|
|
2013
|
-
|
|
2010
|
+
})], 40, qn)) : r("", !0)
|
|
2011
|
+
], 40, Vn)) : r("", !0),
|
|
2012
|
+
w(un, { onSelect: q }),
|
|
2013
|
+
w(tn, {
|
|
2014
2014
|
actions: Ze.value,
|
|
2015
2015
|
pending: G.value,
|
|
2016
2016
|
onSelect: tt
|
|
2017
2017
|
}, null, 8, ["actions", "pending"]),
|
|
2018
|
-
t[22] ||=
|
|
2019
|
-
(
|
|
2018
|
+
t[22] ||= k("span", { class: "divider" }, null, -1),
|
|
2019
|
+
(_(), n(x, null, g(f, (e) => k("button", {
|
|
2020
2020
|
key: e,
|
|
2021
|
-
class:
|
|
2022
|
-
title:
|
|
2021
|
+
class: S({ active: O(h)?.isActive({ textAlign: e }) }),
|
|
2022
|
+
title: O(u)(De[e]),
|
|
2023
2023
|
type: "button",
|
|
2024
|
-
onClick: (t) =>
|
|
2025
|
-
onMousedown: t[16] ||=
|
|
2026
|
-
}, [(
|
|
2024
|
+
onClick: (t) => O(h)?.chain().focus().setTextAlign(e).run(),
|
|
2025
|
+
onMousedown: t[16] ||= A(() => {}, ["prevent"])
|
|
2026
|
+
}, [(_(), n("svg", Yn, [(_(!0), n(x, null, g(z(e), (e, t) => (_(), n("rect", {
|
|
2027
2027
|
key: t,
|
|
2028
2028
|
fill: "currentColor",
|
|
2029
2029
|
height: "1.5",
|
|
@@ -2032,7 +2032,7 @@ var Cn = { class: "picker" }, wn = ["aria-label", "value"], Tn = { value: "parag
|
|
|
2032
2032
|
x: e.x,
|
|
2033
2033
|
y: e.y
|
|
2034
2034
|
}, null, 8, Xn))), 128))]))], 42, Jn)), 64))
|
|
2035
|
-
], 512)) :
|
|
2035
|
+
], 512)) : r("", !0)], 544));
|
|
2036
2036
|
}
|
|
2037
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-969bc5ae]{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-969bc5ae]:popover-open{display:flex}.toolbar>button[data-v-969bc5ae]{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-969bc5ae]:hover{background:color-mix(in srgb, var(--bygga-color-text) 30%, transparent)}.toolbar>button.active[data-v-969bc5ae]{background:var(--bygga-color-selected,var(--bygga-color-text));color:var(--bygga-color-selected-text,#fff);forced-color-adjust:none}.toolbar .picker[data-v-969bc5ae]{align-items:center;display:inline-flex;position:relative}.toolbar .style[data-v-969bc5ae],.toolbar .font[data-v-969bc5ae],.toolbar .size[data-v-969bc5ae]{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-969bc5ae]:hover,.toolbar .font[data-v-969bc5ae]:hover,.toolbar .size[data-v-969bc5ae]:hover{background:color-mix(in srgb, var(--bygga-color-text) 7%, transparent)}.toolbar .picker-chevron[data-v-969bc5ae]{color:var(--bygga-color-text);pointer-events:none;position:absolute;right:5px}.toolbar .divider[data-v-969bc5ae]{background:var(--bygga-color-divider);width:1px;height:24px;margin:0 4px}.link-popover[data-v-969bc5ae]{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-969bc5ae]:popover-open{display:flex}.link-field[data-v-969bc5ae]{width:18em}.link-anchor[data-v-969bc5ae]{width:10em}.link-apply[data-v-969bc5ae]{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-969bc5ae]{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-969bc5ae]:hover{background:var(--bygga-color-track);color:var(--bygga-color-accent)}"]], ["__scopeId", "data-v-969bc5ae"]]);
|
|
2038
2038
|
//#endregion
|