@templatical/editor 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AiChatSidebar-XBj5Rw2l.js +214 -0
- package/dist/AiFeatureMenu-my1mZ9DL.js +63 -0
- package/dist/CloudEditor-BVjgKwq3.js +940 -0
- package/dist/CollaboratorBar-BZq_Gv38.js +91 -0
- package/dist/CommentsSidebar-D9oxqO6l.js +439 -0
- package/dist/DesignReferenceSidebar-CyHq4SWt.js +272 -0
- package/dist/LoadingTrack-vK8W2PJf.js +10 -0
- package/dist/ModuleBrowserModal-Cus2Hdwl.js +205 -0
- package/dist/ModulePreviewCanvas-DaByXKY_.js +106 -0
- package/dist/ParagraphEditor-BSyk5B6S.js +670 -0
- package/dist/RichTextEditorContent-BRpjJ6SV.js +133 -0
- package/dist/SaveModuleDialog-BIZBQrd8.js +122 -0
- package/dist/SnapshotHistory-Ds1-QNbx.js +126 -0
- package/dist/TemplateScoringPanel-C8XSk_Ys.js +249 -0
- package/dist/TestEmailModal-CCVfaFgV.js +94 -0
- package/dist/TitleEditor-V4qaEULF.js +167 -0
- package/dist/TplModal-LT3FXlgs.js +44 -0
- package/dist/_plugin-vue_export-helper-B1-bu7yR.js +47 -0
- package/dist/blockTypeIcons-BujoY5Dl.js +126 -0
- package/dist/cdn/chunks/ParagraphEditor-BkJQO-ZW.js +3 -0
- package/dist/cdn/chunks/ParagraphEditor-BkJQO-ZW.js.map +1 -0
- package/dist/cdn/chunks/RichTextEditorContent-UGQorJm_.js +2 -0
- package/dist/cdn/chunks/RichTextEditorContent-UGQorJm_.js.map +1 -0
- package/dist/cdn/chunks/TitleEditor-CC3Adjai.js +3 -0
- package/dist/cdn/chunks/TitleEditor-CC3Adjai.js.map +1 -0
- package/dist/cdn/chunks/dist-0UheN8rK.js +1 -0
- package/dist/cdn/chunks/dist-55mmbGQ9.js +1 -0
- package/dist/cdn/chunks/dist-B31mxKyP.js +1 -0
- package/dist/cdn/chunks/dist-B5JI9nIg.js +1 -0
- package/dist/cdn/chunks/dist-B93vLKhU.js +1 -0
- package/dist/cdn/chunks/dist-BDt3FJvj.js +1 -0
- package/dist/cdn/chunks/dist-BJRuFHmi.js +1 -0
- package/dist/cdn/chunks/dist-BKSzrf0L.js +1 -0
- package/dist/cdn/chunks/dist-BL8c5gYQ.js +1 -0
- package/dist/cdn/chunks/dist-CYThWMP5.js +1 -0
- package/dist/cdn/chunks/dist-DxZbPJYt.js +1 -0
- package/dist/cdn/chunks/draggable-ClUwYCFL.js +17 -0
- package/dist/cdn/chunks/draggable-ClUwYCFL.js.map +1 -0
- package/dist/cdn/chunks/emojiData-6fVLNqeH.js +2 -0
- package/dist/cdn/chunks/emojiData-6fVLNqeH.js.map +1 -0
- package/dist/cdn/chunks/extensions-BfjbWqOx.js +2 -0
- package/dist/cdn/chunks/extensions-BfjbWqOx.js.map +1 -0
- package/dist/cdn/chunks/icons-vmLJTaJk.js +2 -0
- package/dist/cdn/chunks/icons-vmLJTaJk.js.map +1 -0
- package/dist/cdn/chunks/rolldown-runtime-BakkzWXw.js +1 -0
- package/dist/cdn/chunks/styleConstants-UTJ94gco.js +2 -0
- package/dist/cdn/chunks/styleConstants-UTJ94gco.js.map +1 -0
- package/dist/cdn/chunks/tiptap-Cya4P9CN.js +145 -0
- package/dist/cdn/chunks/tiptap-Cya4P9CN.js.map +1 -0
- package/dist/cdn/chunks/useEditorCore-DRhPKq_z.js +2 -0
- package/dist/cdn/chunks/useEditorCore-DRhPKq_z.js.map +1 -0
- package/dist/cdn/chunks/useMergeTag-CBSlcqnk.js +2 -0
- package/dist/cdn/chunks/useMergeTag-CBSlcqnk.js.map +1 -0
- package/dist/cdn/editor.css +1 -0
- package/dist/cdn/editor.js +2 -0
- package/dist/cdn/editor.js.map +1 -0
- package/dist/check-B7kDuZmP.js +7 -0
- package/dist/chevron-down-DJLW2Q9Z.js +7 -0
- package/dist/circle-alert-E2vYPs5r.js +25 -0
- package/dist/clock-lWIIQA3C.js +12 -0
- package/dist/de-B4Ob4vCo.js +682 -0
- package/dist/dist-4LiM9FDd.js +35 -0
- package/dist/dist-Bu7veieH.js +776 -0
- package/dist/dist-C1BIRHCQ.js +61 -0
- package/dist/dist-CG-vEqSU.js +314 -0
- package/dist/dist-C_ymrGFi.js +10625 -0
- package/dist/dist-ChAGLpWo.js +35 -0
- package/dist/dist-DNjZKe2Z.js +513 -0
- package/dist/dist-D_HQYSY-.js +189 -0
- package/dist/dist-DkypH7qG.js +5 -0
- package/dist/dist-DmOE-Ubp.js +74 -0
- package/dist/dist-DrvKRSU6.js +47 -0
- package/dist/dist-Dxnd0GRf.js +5 -0
- package/dist/dist-DysAFIPy.js +2054 -0
- package/dist/emojiData-BfWQS72m.js +17 -0
- package/dist/en-YXsspZJG.js +682 -0
- package/dist/extensions-BA4NshZQ.js +420 -0
- package/dist/formatRelativeTime-DX3FgqN9.js +8 -0
- package/dist/i18n-ikyi28RU.js +23 -0
- package/dist/image-up-X4xIq4ea.js +23 -0
- package/dist/keys-8B5MFafK.js +4 -0
- package/dist/liquid.browser-BemTg3sZ.js +3272 -0
- package/dist/loader-circle-BTQQxC3l.js +7 -0
- package/dist/message-circle-Blgm6V_h.js +7 -0
- package/dist/refresh-cw-Bb4PEeW1.js +44 -0
- package/dist/scan-line-7lZPfOdm.js +25 -0
- package/dist/send-C0ltAQrv.js +10 -0
- package/dist/shield-check-f-qv4RKs.js +10 -0
- package/dist/sparkles-KhBCGlqB.js +23 -0
- package/dist/styleConstants-CgtFM9hQ.js +43 -0
- package/dist/styles-hQgJKM4i.js +3406 -0
- package/dist/templatical-editor.css +2 -1
- package/dist/templatical-editor.js +242 -9
- package/dist/templatical-editor.umd.cjs +112 -524
- package/dist/timeouts-CmBrLeZA.js +4 -0
- package/dist/trash-2-OwjZ-guZ.js +25 -0
- package/dist/triangle-alert-DOSRIUYZ.js +17 -0
- package/dist/useEditorCore-DVp5qmtC.js +5552 -0
- package/dist/useI18n-DzH4KXDk.js +17 -0
- package/dist/useMergeTag-D9zQVE-e.js +33 -0
- package/dist/x-CGlq2XQe.js +10 -0
- package/package.json +30 -20
- package/dist/AiChatSidebar-0vx9TP5B.js +0 -305
- package/dist/AiFeatureMenu-CI-v74ND.js +0 -69
- package/dist/CloudEditor-Wdfv_9xn.js +0 -1132
- package/dist/CollaboratorBar-B3uV4Wtw.js +0 -89
- package/dist/CommentsSidebar-PVUlloyB.js +0 -655
- package/dist/DesignReferenceSidebar-DAlAWrxU.js +0 -351
- package/dist/ModuleBrowserModal-1JEcChd8.js +0 -323
- package/dist/ModulePreviewCanvas-Cdp484Ae.js +0 -169
- package/dist/SaveModuleDialog-eNyr3XKn.js +0 -168
- package/dist/SnapshotHistory-D-ZiIj1v.js +0 -169
- package/dist/TemplateScoringPanel-DSZPo15C.js +0 -385
- package/dist/TestEmailModal-Cwre5elw.js +0 -128
- package/dist/TextEditor-BuUOIByX.js +0 -780
- package/dist/de-BWIAblxs.js +0 -685
- package/dist/en-cYyUzNV1.js +0 -685
- package/dist/index-0tWUczNu.js +0 -47
- package/dist/index-4okvXjqk.js +0 -41
- package/dist/index-BSc6h5zo.js +0 -967
- package/dist/index-CrvwWlhN.js +0 -41
- package/dist/index-D-iD-7lO.js +0 -10961
- package/dist/index-D-ygXbc8.js +0 -2452
- package/dist/index-DbrWKz-e.js +0 -1415
- package/dist/index-DeUeHy6g.js +0 -422
- package/dist/index-Ude6e9RU.js +0 -41
- package/dist/index-ZQzHBwkr.js +0 -12767
- package/dist/liquid.browser-CeNxS2GL.js +0 -3493
- package/dist/loader-circle-tM9j2mRh.js +0 -13
- package/dist/shield-check-Ngi9jAQc.js +0 -20
package/dist/index-DeUeHy6g.js
DELETED
|
@@ -1,422 +0,0 @@
|
|
|
1
|
-
import { defineComponent as N, computed as T, ref as m, openBlock as d, createBlock as V, unref as R, normalizeStyle as z, normalizeClass as H, withCtx as E, withDirectives as C, createElementBlock as y, vModelText as L, withModifiers as x, toDisplayString as M, createElementVNode as g, createCommentVNode as I, nextTick as B } from "vue";
|
|
2
|
-
import { w as S } from "./index-D-iD-7lO.js";
|
|
3
|
-
import { isLogicMergeTagValue as w, getLogicMergeTagKeyword as h, SYNTAX_PRESETS as A, getMergeTagLabel as k } from "@templatical/types";
|
|
4
|
-
import { NodeViewWrapper as K, VueNodeViewRenderer as $ } from "./index-D-ygXbc8.js";
|
|
5
|
-
import { N as D, v as F, I as P, m as W } from "./index-ZQzHBwkr.js";
|
|
6
|
-
const j = ["data-tooltip"], q = /* @__PURE__ */ N({
|
|
7
|
-
__name: "LogicMergeTagNodeView",
|
|
8
|
-
props: {
|
|
9
|
-
node: {},
|
|
10
|
-
editor: {},
|
|
11
|
-
getPos: { type: Function },
|
|
12
|
-
deleteNode: { type: Function },
|
|
13
|
-
updateAttributes: { type: Function }
|
|
14
|
-
},
|
|
15
|
-
setup(t) {
|
|
16
|
-
const n = t, { syntax: e } = S(), s = T(
|
|
17
|
-
() => w(n.node.attrs.value, e)
|
|
18
|
-
), r = T(
|
|
19
|
-
() => h(n.node.attrs.value, e)
|
|
20
|
-
), o = m(!1), l = m(""), v = m(null);
|
|
21
|
-
let f = !1;
|
|
22
|
-
function b() {
|
|
23
|
-
l.value = n.node.attrs.value, f = !1, o.value = !0, B(() => {
|
|
24
|
-
var a, u;
|
|
25
|
-
(a = v.value) == null || a.focus(), (u = v.value) == null || u.select();
|
|
26
|
-
});
|
|
27
|
-
}
|
|
28
|
-
function i() {
|
|
29
|
-
if (f)
|
|
30
|
-
return;
|
|
31
|
-
f = !0;
|
|
32
|
-
const a = l.value.trim();
|
|
33
|
-
if (!a) {
|
|
34
|
-
o.value = !1;
|
|
35
|
-
return;
|
|
36
|
-
}
|
|
37
|
-
a !== n.node.attrs.value && n.updateAttributes({
|
|
38
|
-
value: a,
|
|
39
|
-
keyword: w(a, e) ? h(a, e) : ""
|
|
40
|
-
}), o.value = !1;
|
|
41
|
-
}
|
|
42
|
-
function p(a) {
|
|
43
|
-
a.key === "Enter" ? (a.preventDefault(), i()) : a.key === "Escape" && (o.value = !1);
|
|
44
|
-
}
|
|
45
|
-
return (a, u) => (d(), V(R(K), {
|
|
46
|
-
as: "span",
|
|
47
|
-
class: H(
|
|
48
|
-
s.value ? "tpl-logic-merge-tag-node tpl:group tpl:mx-0.5 tpl:inline-flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[0.8em] tpl:font-bold tpl:tracking-wide tpl:uppercase tpl:select-none" : ""
|
|
49
|
-
),
|
|
50
|
-
style: z(
|
|
51
|
-
s.value ? "background-color: transparent; border: 1.5px solid color-mix(in srgb, var(--tpl-primary) 50%, transparent); color: var(--tpl-primary);" : ""
|
|
52
|
-
),
|
|
53
|
-
contenteditable: "false"
|
|
54
|
-
}, {
|
|
55
|
-
default: E(() => [
|
|
56
|
-
o.value ? C((d(), y("input", {
|
|
57
|
-
key: 0,
|
|
58
|
-
ref_key: "inputRef",
|
|
59
|
-
ref: v,
|
|
60
|
-
"onUpdate:modelValue": u[0] || (u[0] = (c) => l.value = c),
|
|
61
|
-
type: "text",
|
|
62
|
-
class: "tpl:w-40 tpl:rounded tpl:border-none tpl:bg-transparent tpl:px-0.5 tpl:py-0 tpl:text-[1em] tpl:font-medium tpl:normal-case tpl:outline-none",
|
|
63
|
-
style: { color: "var(--tpl-primary)" },
|
|
64
|
-
onBlur: i,
|
|
65
|
-
onKeydown: p
|
|
66
|
-
}, null, 544)), [
|
|
67
|
-
[L, l.value]
|
|
68
|
-
]) : s.value ? (d(), y("span", {
|
|
69
|
-
key: 1,
|
|
70
|
-
class: "tpl-tooltip tpl:cursor-pointer",
|
|
71
|
-
"data-tooltip": t.node.attrs.value,
|
|
72
|
-
onClick: x(b, ["stop"])
|
|
73
|
-
}, M(r.value), 9, j)) : (d(), y("span", {
|
|
74
|
-
key: 2,
|
|
75
|
-
onClick: x(b, ["stop"])
|
|
76
|
-
}, M(t.node.attrs.value), 1)),
|
|
77
|
-
s.value ? (d(), y("button", {
|
|
78
|
-
key: 3,
|
|
79
|
-
type: "button",
|
|
80
|
-
class: "tpl:flex tpl:size-4 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-none tpl:bg-transparent tpl:p-0 tpl:opacity-60 tpl:transition-all hover:tpl:opacity-100",
|
|
81
|
-
style: { color: "var(--tpl-primary)" },
|
|
82
|
-
contenteditable: "false",
|
|
83
|
-
onClick: u[1] || (u[1] = x(
|
|
84
|
-
//@ts-ignore
|
|
85
|
-
(...c) => t.deleteNode && t.deleteNode(...c),
|
|
86
|
-
["stop", "prevent"]
|
|
87
|
-
)),
|
|
88
|
-
onMouseenter: u[2] || (u[2] = (c) => c.target.style.color = "var(--tpl-danger)"),
|
|
89
|
-
onMouseleave: u[3] || (u[3] = (c) => c.target.style.color = "var(--tpl-primary)")
|
|
90
|
-
}, [...u[4] || (u[4] = [
|
|
91
|
-
g("svg", {
|
|
92
|
-
width: "10",
|
|
93
|
-
height: "10",
|
|
94
|
-
viewBox: "0 0 24 24",
|
|
95
|
-
fill: "none",
|
|
96
|
-
stroke: "currentColor",
|
|
97
|
-
"stroke-width": "3"
|
|
98
|
-
}, [
|
|
99
|
-
g("line", {
|
|
100
|
-
x1: "18",
|
|
101
|
-
y1: "6",
|
|
102
|
-
x2: "6",
|
|
103
|
-
y2: "18"
|
|
104
|
-
}),
|
|
105
|
-
g("line", {
|
|
106
|
-
x1: "6",
|
|
107
|
-
y1: "6",
|
|
108
|
-
x2: "18",
|
|
109
|
-
y2: "18"
|
|
110
|
-
})
|
|
111
|
-
], -1)
|
|
112
|
-
])], 32)) : I("", !0)
|
|
113
|
-
]),
|
|
114
|
-
_: 1
|
|
115
|
-
}, 8, ["class", "style"]));
|
|
116
|
-
}
|
|
117
|
-
}), Z = D.create({
|
|
118
|
-
name: "logicMergeTagNode",
|
|
119
|
-
group: "inline",
|
|
120
|
-
inline: !0,
|
|
121
|
-
atom: !0,
|
|
122
|
-
addOptions() {
|
|
123
|
-
return {
|
|
124
|
-
syntax: A.liquid
|
|
125
|
-
};
|
|
126
|
-
},
|
|
127
|
-
addAttributes() {
|
|
128
|
-
return {
|
|
129
|
-
value: {
|
|
130
|
-
default: ""
|
|
131
|
-
},
|
|
132
|
-
keyword: {
|
|
133
|
-
default: ""
|
|
134
|
-
}
|
|
135
|
-
};
|
|
136
|
-
},
|
|
137
|
-
parseHTML() {
|
|
138
|
-
return [
|
|
139
|
-
{
|
|
140
|
-
tag: "span[data-logic-merge-tag]"
|
|
141
|
-
}
|
|
142
|
-
];
|
|
143
|
-
},
|
|
144
|
-
renderHTML({ node: t, HTMLAttributes: n }) {
|
|
145
|
-
if (!w(t.attrs.value, this.options.syntax))
|
|
146
|
-
return ["span", {}, t.attrs.value];
|
|
147
|
-
const e = h(
|
|
148
|
-
t.attrs.value,
|
|
149
|
-
this.options.syntax
|
|
150
|
-
);
|
|
151
|
-
return [
|
|
152
|
-
"span",
|
|
153
|
-
W(n, {
|
|
154
|
-
"data-logic-merge-tag": t.attrs.value,
|
|
155
|
-
"data-keyword": e
|
|
156
|
-
}),
|
|
157
|
-
e
|
|
158
|
-
];
|
|
159
|
-
},
|
|
160
|
-
addNodeView() {
|
|
161
|
-
return $(q);
|
|
162
|
-
},
|
|
163
|
-
addKeyboardShortcuts() {
|
|
164
|
-
const t = () => {
|
|
165
|
-
const { selection: n } = this.editor.state, { $from: e, $to: s } = n;
|
|
166
|
-
let r = !1;
|
|
167
|
-
if (this.editor.state.doc.nodesBetween(e.pos, s.pos, (l) => {
|
|
168
|
-
if (l.type.name === this.name)
|
|
169
|
-
return r = !0, !1;
|
|
170
|
-
}), r)
|
|
171
|
-
return !0;
|
|
172
|
-
if (e.pos > 0) {
|
|
173
|
-
const l = e.nodeBefore;
|
|
174
|
-
if ((l == null ? void 0 : l.type.name) === this.name)
|
|
175
|
-
return !0;
|
|
176
|
-
}
|
|
177
|
-
const o = e.nodeAfter;
|
|
178
|
-
return (o == null ? void 0 : o.type.name) === this.name;
|
|
179
|
-
};
|
|
180
|
-
return {
|
|
181
|
-
Backspace: () => t(),
|
|
182
|
-
Delete: () => t()
|
|
183
|
-
};
|
|
184
|
-
},
|
|
185
|
-
addInputRules() {
|
|
186
|
-
const t = new RegExp(this.options.syntax.logic.source + "$", "");
|
|
187
|
-
return [
|
|
188
|
-
new P({
|
|
189
|
-
find: t,
|
|
190
|
-
handler: ({ state: n, range: e, match: s }) => {
|
|
191
|
-
const r = s[0];
|
|
192
|
-
if (!w(r, this.options.syntax))
|
|
193
|
-
return;
|
|
194
|
-
const o = h(
|
|
195
|
-
r,
|
|
196
|
-
this.options.syntax
|
|
197
|
-
), l = this.type.create({
|
|
198
|
-
value: r,
|
|
199
|
-
keyword: o
|
|
200
|
-
});
|
|
201
|
-
n.tr.replaceWith(e.from, e.to, l);
|
|
202
|
-
}
|
|
203
|
-
})
|
|
204
|
-
];
|
|
205
|
-
},
|
|
206
|
-
addPasteRules() {
|
|
207
|
-
const t = new RegExp(this.options.syntax.logic.source, "g");
|
|
208
|
-
return [
|
|
209
|
-
new F({
|
|
210
|
-
find: t,
|
|
211
|
-
handler: ({ state: n, range: e, match: s }) => {
|
|
212
|
-
const r = s[0];
|
|
213
|
-
if (!w(r, this.options.syntax))
|
|
214
|
-
return;
|
|
215
|
-
const o = h(
|
|
216
|
-
r,
|
|
217
|
-
this.options.syntax
|
|
218
|
-
), l = this.type.create({
|
|
219
|
-
value: r,
|
|
220
|
-
keyword: o
|
|
221
|
-
});
|
|
222
|
-
n.tr.replaceWith(e.from, e.to, l);
|
|
223
|
-
}
|
|
224
|
-
})
|
|
225
|
-
];
|
|
226
|
-
}
|
|
227
|
-
}), O = ["data-tooltip"], U = /* @__PURE__ */ N({
|
|
228
|
-
__name: "MergeTagNodeView",
|
|
229
|
-
props: {
|
|
230
|
-
node: {},
|
|
231
|
-
deleteNode: { type: Function },
|
|
232
|
-
updateAttributes: { type: Function }
|
|
233
|
-
},
|
|
234
|
-
setup(t) {
|
|
235
|
-
const n = t, { getMergeTagLabel: e } = S(), s = T(() => e(n.node.attrs.value)), r = m(!1), o = m(""), l = m(null);
|
|
236
|
-
function v() {
|
|
237
|
-
o.value = n.node.attrs.value, r.value = !0, B(() => {
|
|
238
|
-
var i, p;
|
|
239
|
-
(i = l.value) == null || i.focus(), (p = l.value) == null || p.select();
|
|
240
|
-
});
|
|
241
|
-
}
|
|
242
|
-
function f() {
|
|
243
|
-
const i = o.value.trim();
|
|
244
|
-
i && i !== n.node.attrs.value && n.updateAttributes({
|
|
245
|
-
value: i,
|
|
246
|
-
label: e(i)
|
|
247
|
-
}), r.value = !1;
|
|
248
|
-
}
|
|
249
|
-
function b(i) {
|
|
250
|
-
i.key === "Enter" ? (i.preventDefault(), f()) : i.key === "Escape" && (r.value = !1);
|
|
251
|
-
}
|
|
252
|
-
return (i, p) => (d(), V(R(K), {
|
|
253
|
-
as: "span",
|
|
254
|
-
class: "tpl-merge-tag-node tpl:group tpl:mx-0.5 tpl:inline-flex tpl:items-center tpl:gap-1 tpl:rounded tpl:px-1.5 tpl:py-0.5 tpl:text-[0.9em] tpl:font-medium tpl:select-none",
|
|
255
|
-
style: { "background-color": "color-mix(in srgb, var(--tpl-primary) 20%, transparent)", color: "var(--tpl-primary)" },
|
|
256
|
-
contenteditable: "false"
|
|
257
|
-
}, {
|
|
258
|
-
default: E(() => [
|
|
259
|
-
r.value ? C((d(), y("input", {
|
|
260
|
-
key: 0,
|
|
261
|
-
ref_key: "inputRef",
|
|
262
|
-
ref: l,
|
|
263
|
-
"onUpdate:modelValue": p[0] || (p[0] = (a) => o.value = a),
|
|
264
|
-
type: "text",
|
|
265
|
-
class: "tpl:w-32 tpl:rounded tpl:border-none tpl:bg-transparent tpl:px-0.5 tpl:py-0 tpl:text-[1em] tpl:font-medium tpl:outline-none",
|
|
266
|
-
style: { color: "var(--tpl-primary)" },
|
|
267
|
-
onBlur: f,
|
|
268
|
-
onKeydown: b
|
|
269
|
-
}, null, 544)), [
|
|
270
|
-
[L, o.value]
|
|
271
|
-
]) : (d(), y("span", {
|
|
272
|
-
key: 1,
|
|
273
|
-
class: "tpl-tooltip tpl:cursor-pointer",
|
|
274
|
-
"data-tooltip": t.node.attrs.value,
|
|
275
|
-
onClick: x(v, ["stop"])
|
|
276
|
-
}, M(s.value), 9, O)),
|
|
277
|
-
g("button", {
|
|
278
|
-
type: "button",
|
|
279
|
-
class: "tpl:flex tpl:size-4 tpl:cursor-pointer tpl:items-center tpl:justify-center tpl:rounded-full tpl:border-none tpl:bg-transparent tpl:p-0 tpl:opacity-60 tpl:transition-all hover:tpl:opacity-100",
|
|
280
|
-
style: { color: "var(--tpl-primary)" },
|
|
281
|
-
contenteditable: "false",
|
|
282
|
-
onClick: p[1] || (p[1] = x(
|
|
283
|
-
//@ts-ignore
|
|
284
|
-
(...a) => t.deleteNode && t.deleteNode(...a),
|
|
285
|
-
["stop", "prevent"]
|
|
286
|
-
)),
|
|
287
|
-
onMouseenter: p[2] || (p[2] = (a) => a.target.style.color = "var(--tpl-danger)"),
|
|
288
|
-
onMouseleave: p[3] || (p[3] = (a) => a.target.style.color = "var(--tpl-primary)")
|
|
289
|
-
}, [...p[4] || (p[4] = [
|
|
290
|
-
g("svg", {
|
|
291
|
-
width: "10",
|
|
292
|
-
height: "10",
|
|
293
|
-
viewBox: "0 0 24 24",
|
|
294
|
-
fill: "none",
|
|
295
|
-
stroke: "currentColor",
|
|
296
|
-
"stroke-width": "3"
|
|
297
|
-
}, [
|
|
298
|
-
g("line", {
|
|
299
|
-
x1: "18",
|
|
300
|
-
y1: "6",
|
|
301
|
-
x2: "6",
|
|
302
|
-
y2: "18"
|
|
303
|
-
}),
|
|
304
|
-
g("line", {
|
|
305
|
-
x1: "6",
|
|
306
|
-
y1: "6",
|
|
307
|
-
x2: "18",
|
|
308
|
-
y2: "18"
|
|
309
|
-
})
|
|
310
|
-
], -1)
|
|
311
|
-
])], 32)
|
|
312
|
-
]),
|
|
313
|
-
_: 1
|
|
314
|
-
}));
|
|
315
|
-
}
|
|
316
|
-
}), _ = D.create({
|
|
317
|
-
name: "mergeTagNode",
|
|
318
|
-
group: "inline",
|
|
319
|
-
inline: !0,
|
|
320
|
-
atom: !0,
|
|
321
|
-
addOptions() {
|
|
322
|
-
return {
|
|
323
|
-
mergeTags: [],
|
|
324
|
-
syntax: A.liquid
|
|
325
|
-
};
|
|
326
|
-
},
|
|
327
|
-
addAttributes() {
|
|
328
|
-
return {
|
|
329
|
-
label: {
|
|
330
|
-
default: ""
|
|
331
|
-
},
|
|
332
|
-
value: {
|
|
333
|
-
default: ""
|
|
334
|
-
}
|
|
335
|
-
};
|
|
336
|
-
},
|
|
337
|
-
parseHTML() {
|
|
338
|
-
return [
|
|
339
|
-
{
|
|
340
|
-
tag: "span[data-merge-tag]"
|
|
341
|
-
}
|
|
342
|
-
];
|
|
343
|
-
},
|
|
344
|
-
renderHTML({ node: t, HTMLAttributes: n }) {
|
|
345
|
-
const e = k(t.attrs.value, this.options.mergeTags);
|
|
346
|
-
return [
|
|
347
|
-
"span",
|
|
348
|
-
W(n, {
|
|
349
|
-
"data-merge-tag": t.attrs.value,
|
|
350
|
-
"data-label": e
|
|
351
|
-
}),
|
|
352
|
-
e
|
|
353
|
-
];
|
|
354
|
-
},
|
|
355
|
-
addNodeView() {
|
|
356
|
-
return $(U);
|
|
357
|
-
},
|
|
358
|
-
addCommands() {
|
|
359
|
-
return {
|
|
360
|
-
insertMergeTag: (t) => ({ commands: n }) => n.insertContent({
|
|
361
|
-
type: this.name,
|
|
362
|
-
attrs: t
|
|
363
|
-
})
|
|
364
|
-
};
|
|
365
|
-
},
|
|
366
|
-
addKeyboardShortcuts() {
|
|
367
|
-
const t = () => {
|
|
368
|
-
const { selection: n } = this.editor.state, { $from: e, $to: s } = n;
|
|
369
|
-
let r = !1;
|
|
370
|
-
if (this.editor.state.doc.nodesBetween(e.pos, s.pos, (l) => {
|
|
371
|
-
if (l.type.name === this.name)
|
|
372
|
-
return r = !0, !1;
|
|
373
|
-
}), r)
|
|
374
|
-
return !0;
|
|
375
|
-
if (e.pos > 0) {
|
|
376
|
-
const l = e.nodeBefore;
|
|
377
|
-
if ((l == null ? void 0 : l.type.name) === this.name)
|
|
378
|
-
return !0;
|
|
379
|
-
}
|
|
380
|
-
const o = e.nodeAfter;
|
|
381
|
-
return (o == null ? void 0 : o.type.name) === this.name;
|
|
382
|
-
};
|
|
383
|
-
return {
|
|
384
|
-
Backspace: () => t(),
|
|
385
|
-
Delete: () => t()
|
|
386
|
-
};
|
|
387
|
-
},
|
|
388
|
-
addInputRules() {
|
|
389
|
-
const t = new RegExp(this.options.syntax.value.source + "$", "");
|
|
390
|
-
return [
|
|
391
|
-
new P({
|
|
392
|
-
find: t,
|
|
393
|
-
handler: ({ state: n, range: e, match: s }) => {
|
|
394
|
-
const r = s[0], o = k(r, this.options.mergeTags), l = this.type.create({
|
|
395
|
-
label: o,
|
|
396
|
-
value: r
|
|
397
|
-
});
|
|
398
|
-
n.tr.replaceWith(e.from, e.to, l);
|
|
399
|
-
}
|
|
400
|
-
})
|
|
401
|
-
];
|
|
402
|
-
},
|
|
403
|
-
addPasteRules() {
|
|
404
|
-
const t = new RegExp(this.options.syntax.value.source, "g");
|
|
405
|
-
return [
|
|
406
|
-
new F({
|
|
407
|
-
find: t,
|
|
408
|
-
handler: ({ state: n, range: e, match: s }) => {
|
|
409
|
-
const r = s[0], o = k(r, this.options.mergeTags), l = this.type.create({
|
|
410
|
-
label: o,
|
|
411
|
-
value: r
|
|
412
|
-
});
|
|
413
|
-
n.tr.replaceWith(e.from, e.to, l);
|
|
414
|
-
}
|
|
415
|
-
})
|
|
416
|
-
];
|
|
417
|
-
}
|
|
418
|
-
});
|
|
419
|
-
export {
|
|
420
|
-
Z as LogicMergeTagNode,
|
|
421
|
-
_ as MergeTagNode
|
|
422
|
-
};
|
package/dist/index-Ude6e9RU.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { M as t, m as e } from "./index-ZQzHBwkr.js";
|
|
2
|
-
const u = t.create({
|
|
3
|
-
name: "superscript",
|
|
4
|
-
addOptions() {
|
|
5
|
-
return {
|
|
6
|
-
HTMLAttributes: {}
|
|
7
|
-
};
|
|
8
|
-
},
|
|
9
|
-
parseHTML() {
|
|
10
|
-
return [
|
|
11
|
-
{
|
|
12
|
-
tag: "sup"
|
|
13
|
-
},
|
|
14
|
-
{
|
|
15
|
-
style: "vertical-align",
|
|
16
|
-
getAttrs(r) {
|
|
17
|
-
return r !== "super" ? !1 : null;
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
];
|
|
21
|
-
},
|
|
22
|
-
renderHTML({ HTMLAttributes: r }) {
|
|
23
|
-
return ["sup", e(this.options.HTMLAttributes, r), 0];
|
|
24
|
-
},
|
|
25
|
-
addCommands() {
|
|
26
|
-
return {
|
|
27
|
-
setSuperscript: () => ({ commands: r }) => r.setMark(this.name),
|
|
28
|
-
toggleSuperscript: () => ({ commands: r }) => r.toggleMark(this.name),
|
|
29
|
-
unsetSuperscript: () => ({ commands: r }) => r.unsetMark(this.name)
|
|
30
|
-
};
|
|
31
|
-
},
|
|
32
|
-
addKeyboardShortcuts() {
|
|
33
|
-
return {
|
|
34
|
-
"Mod-.": () => this.editor.commands.toggleSuperscript()
|
|
35
|
-
};
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
export {
|
|
39
|
-
u as Superscript,
|
|
40
|
-
u as default
|
|
41
|
-
};
|