@templatical/editor 0.0.1 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/AiChatSidebar-busJk9hm.js +214 -0
- package/dist/AiFeatureMenu-DLGv_-pj.js +63 -0
- package/dist/CloudEditor-BDnHd6Um.js +919 -0
- package/dist/CollaboratorBar-Dv3l52vC.js +91 -0
- package/dist/CommentsSidebar-4tjp0VU5.js +439 -0
- package/dist/DesignReferenceSidebar-CmwXvltV.js +273 -0
- package/dist/LoadingTrack-vK8W2PJf.js +10 -0
- package/dist/ModuleBrowserModal-lrk3Fr0H.js +205 -0
- package/dist/ModulePreviewCanvas-BcBJLnwL.js +106 -0
- package/dist/ParagraphEditor-DH8cSC6m.js +625 -0
- package/dist/RichTextEditorContent-CQqodi7p.js +133 -0
- package/dist/SaveModuleDialog-Bmzi72td.js +122 -0
- package/dist/SnapshotHistory-AEgi9Xsn.js +126 -0
- package/dist/TemplateScoringPanel-CTgMtc0-.js +249 -0
- package/dist/TestEmailModal-Dpq1is9S.js +94 -0
- package/dist/TitleEditor-CLcDdcWI.js +167 -0
- package/dist/TplModal-CGzRjR96.js +44 -0
- package/dist/_plugin-vue_export-helper-B1-bu7yR.js +47 -0
- package/dist/blockTypeIcons-BpPTqcok.js +126 -0
- package/dist/cdn/chunks/ParagraphEditor-CCtWbGDv.js +3 -0
- package/dist/cdn/chunks/ParagraphEditor-CCtWbGDv.js.map +1 -0
- package/dist/cdn/chunks/RichTextEditorContent-BUD9veXd.js +2 -0
- package/dist/cdn/chunks/RichTextEditorContent-BUD9veXd.js.map +1 -0
- package/dist/cdn/chunks/TitleEditor-e_UTyxjd.js +3 -0
- package/dist/cdn/chunks/TitleEditor-e_UTyxjd.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-ea_ewKUl.js +2 -0
- package/dist/cdn/chunks/extensions-ea_ewKUl.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-CNejCb-L.js +2 -0
- package/dist/cdn/chunks/styleConstants-CNejCb-L.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-CwuxQuvh.js +2 -0
- package/dist/cdn/chunks/useEditorCore-CwuxQuvh.js.map +1 -0
- package/dist/cdn/chunks/useMergeTag-DVOz1v9p.js +2 -0
- package/dist/cdn/chunks/useMergeTag-DVOz1v9p.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-D_HQYSY-.js +189 -0
- package/dist/dist-DkypH7qG.js +5 -0
- package/dist/dist-DmOE-Ubp.js +74 -0
- package/dist/dist-DmpMJbmZ.js +513 -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-CKM99njP.js +420 -0
- package/dist/formatRelativeTime-DX3FgqN9.js +8 -0
- package/dist/i18n-CJsFtdbZ.js +23 -0
- package/dist/image-up-X4xIq4ea.js +23 -0
- package/dist/keys-Dwa2PmdD.js +10 -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-D4SOZGBV.js +94 -0
- package/dist/styles-DSw1VNU3.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-Cc4RCwWq.js +5556 -0
- package/dist/useI18n-DUirdXEX.js +17 -0
- package/dist/useMergeTag-DVnlvPYJ.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
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Wt as e, c as t } from "./dist-C_ymrGFi.js";
|
|
2
|
+
//#region ../../node_modules/.bun/@tiptap+extension-subscript@3.22.1+ea875cbca4543ce7/node_modules/@tiptap/extension-subscript/dist/index.js
|
|
3
|
+
var n = t.create({
|
|
4
|
+
name: "subscript",
|
|
5
|
+
addOptions() {
|
|
6
|
+
return { HTMLAttributes: {} };
|
|
7
|
+
},
|
|
8
|
+
parseHTML() {
|
|
9
|
+
return [{ tag: "sub" }, {
|
|
10
|
+
style: "vertical-align",
|
|
11
|
+
getAttrs(e) {
|
|
12
|
+
return e === "sub" ? null : !1;
|
|
13
|
+
}
|
|
14
|
+
}];
|
|
15
|
+
},
|
|
16
|
+
renderHTML({ HTMLAttributes: t }) {
|
|
17
|
+
return [
|
|
18
|
+
"sub",
|
|
19
|
+
e(this.options.HTMLAttributes, t),
|
|
20
|
+
0
|
|
21
|
+
];
|
|
22
|
+
},
|
|
23
|
+
addCommands() {
|
|
24
|
+
return {
|
|
25
|
+
setSubscript: () => ({ commands: e }) => e.setMark(this.name),
|
|
26
|
+
toggleSubscript: () => ({ commands: e }) => e.toggleMark(this.name),
|
|
27
|
+
unsetSubscript: () => ({ commands: e }) => e.unsetMark(this.name)
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
addKeyboardShortcuts() {
|
|
31
|
+
return { "Mod-,": () => this.editor.commands.toggleSubscript() };
|
|
32
|
+
}
|
|
33
|
+
}), r = n;
|
|
34
|
+
//#endregion
|
|
35
|
+
export { n as Subscript, r as default };
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
import { Wt as e, c as t, i as n } from "./dist-C_ymrGFi.js";
|
|
2
|
+
//#region ../../node_modules/.bun/@tiptap+extension-text-style@3.22.3+ea875cbca4543ce7/node_modules/@tiptap/extension-text-style/dist/index.js
|
|
3
|
+
var r = 20, i = (e, t = 0) => {
|
|
4
|
+
let n = [];
|
|
5
|
+
return !e.children.length || t > r || Array.from(e.children).forEach((e) => {
|
|
6
|
+
e.tagName === "SPAN" ? n.push(e) : e.children.length && n.push(...i(e, t + 1));
|
|
7
|
+
}), n;
|
|
8
|
+
}, a = (e) => {
|
|
9
|
+
if (!e.children.length) return;
|
|
10
|
+
let t = i(e);
|
|
11
|
+
t && t.forEach((e) => {
|
|
12
|
+
let t = e.getAttribute("style"), n = (e.parentElement?.closest("span"))?.getAttribute("style");
|
|
13
|
+
e.setAttribute("style", `${n};${t}`);
|
|
14
|
+
});
|
|
15
|
+
}, o = t.create({
|
|
16
|
+
name: "textStyle",
|
|
17
|
+
priority: 101,
|
|
18
|
+
addOptions() {
|
|
19
|
+
return {
|
|
20
|
+
HTMLAttributes: {},
|
|
21
|
+
mergeNestedSpanStyles: !0
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
parseHTML() {
|
|
25
|
+
return [{
|
|
26
|
+
tag: "span",
|
|
27
|
+
consuming: !1,
|
|
28
|
+
getAttrs: (e) => e.hasAttribute("style") ? (this.options.mergeNestedSpanStyles && a(e), {}) : !1
|
|
29
|
+
}];
|
|
30
|
+
},
|
|
31
|
+
renderHTML({ HTMLAttributes: t }) {
|
|
32
|
+
return [
|
|
33
|
+
"span",
|
|
34
|
+
e(this.options.HTMLAttributes, t),
|
|
35
|
+
0
|
|
36
|
+
];
|
|
37
|
+
},
|
|
38
|
+
addCommands() {
|
|
39
|
+
return {
|
|
40
|
+
toggleTextStyle: (e) => ({ commands: t }) => t.toggleMark(this.name, e),
|
|
41
|
+
removeEmptyTextStyle: () => ({ tr: e }) => {
|
|
42
|
+
let { selection: t } = e;
|
|
43
|
+
return e.doc.nodesBetween(t.from, t.to, (t, n) => {
|
|
44
|
+
if (t.isTextblock) return !0;
|
|
45
|
+
t.marks.filter((e) => e.type === this.type).some((e) => Object.values(e.attrs).some((e) => !!e)) || e.removeMark(n, n + t.nodeSize, this.type);
|
|
46
|
+
}), !0;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
}), s = n.create({
|
|
51
|
+
name: "backgroundColor",
|
|
52
|
+
addOptions() {
|
|
53
|
+
return { types: ["textStyle"] };
|
|
54
|
+
},
|
|
55
|
+
addGlobalAttributes() {
|
|
56
|
+
return [{
|
|
57
|
+
types: this.options.types,
|
|
58
|
+
attributes: { backgroundColor: {
|
|
59
|
+
default: null,
|
|
60
|
+
parseHTML: (e) => {
|
|
61
|
+
let t = e.getAttribute("style");
|
|
62
|
+
if (t) {
|
|
63
|
+
let e = t.split(";").map((e) => e.trim()).filter(Boolean);
|
|
64
|
+
for (let t = e.length - 1; t >= 0; --t) {
|
|
65
|
+
let n = e[t].split(":");
|
|
66
|
+
if (n.length >= 2) {
|
|
67
|
+
let e = n[0].trim().toLowerCase(), t = n.slice(1).join(":").trim();
|
|
68
|
+
if (e === "background-color") return t.replace(/['"]+/g, "");
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return e.style.backgroundColor?.replace(/['"]+/g, "");
|
|
73
|
+
},
|
|
74
|
+
renderHTML: (e) => e.backgroundColor ? { style: `background-color: ${e.backgroundColor}` } : {}
|
|
75
|
+
} }
|
|
76
|
+
}];
|
|
77
|
+
},
|
|
78
|
+
addCommands() {
|
|
79
|
+
return {
|
|
80
|
+
setBackgroundColor: (e) => ({ chain: t }) => t().setMark("textStyle", { backgroundColor: e }).run(),
|
|
81
|
+
unsetBackgroundColor: () => ({ chain: e }) => e().setMark("textStyle", { backgroundColor: null }).removeEmptyTextStyle().run()
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
}), c = n.create({
|
|
85
|
+
name: "color",
|
|
86
|
+
addOptions() {
|
|
87
|
+
return { types: ["textStyle"] };
|
|
88
|
+
},
|
|
89
|
+
addGlobalAttributes() {
|
|
90
|
+
return [{
|
|
91
|
+
types: this.options.types,
|
|
92
|
+
attributes: { color: {
|
|
93
|
+
default: null,
|
|
94
|
+
parseHTML: (e) => {
|
|
95
|
+
let t = e.getAttribute("style");
|
|
96
|
+
if (t) {
|
|
97
|
+
let e = t.split(";").map((e) => e.trim()).filter(Boolean);
|
|
98
|
+
for (let t = e.length - 1; t >= 0; --t) {
|
|
99
|
+
let n = e[t].split(":");
|
|
100
|
+
if (n.length >= 2) {
|
|
101
|
+
let e = n[0].trim().toLowerCase(), t = n.slice(1).join(":").trim();
|
|
102
|
+
if (e === "color") return t.replace(/['"]+/g, "");
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return e.style.color?.replace(/['"]+/g, "");
|
|
107
|
+
},
|
|
108
|
+
renderHTML: (e) => e.color ? { style: `color: ${e.color}` } : {}
|
|
109
|
+
} }
|
|
110
|
+
}];
|
|
111
|
+
},
|
|
112
|
+
addCommands() {
|
|
113
|
+
return {
|
|
114
|
+
setColor: (e) => ({ chain: t }) => t().setMark("textStyle", { color: e }).run(),
|
|
115
|
+
unsetColor: () => ({ chain: e }) => e().setMark("textStyle", { color: null }).removeEmptyTextStyle().run()
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
}), l = n.create({
|
|
119
|
+
name: "fontFamily",
|
|
120
|
+
addOptions() {
|
|
121
|
+
return { types: ["textStyle"] };
|
|
122
|
+
},
|
|
123
|
+
addGlobalAttributes() {
|
|
124
|
+
return [{
|
|
125
|
+
types: this.options.types,
|
|
126
|
+
attributes: { fontFamily: {
|
|
127
|
+
default: null,
|
|
128
|
+
parseHTML: (e) => e.style.fontFamily,
|
|
129
|
+
renderHTML: (e) => e.fontFamily ? { style: `font-family: ${e.fontFamily}` } : {}
|
|
130
|
+
} }
|
|
131
|
+
}];
|
|
132
|
+
},
|
|
133
|
+
addCommands() {
|
|
134
|
+
return {
|
|
135
|
+
setFontFamily: (e) => ({ chain: t }) => t().setMark("textStyle", { fontFamily: e }).run(),
|
|
136
|
+
unsetFontFamily: () => ({ chain: e }) => e().setMark("textStyle", { fontFamily: null }).removeEmptyTextStyle().run()
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
}), u = n.create({
|
|
140
|
+
name: "fontSize",
|
|
141
|
+
addOptions() {
|
|
142
|
+
return { types: ["textStyle"] };
|
|
143
|
+
},
|
|
144
|
+
addGlobalAttributes() {
|
|
145
|
+
return [{
|
|
146
|
+
types: this.options.types,
|
|
147
|
+
attributes: { fontSize: {
|
|
148
|
+
default: null,
|
|
149
|
+
parseHTML: (e) => e.style.fontSize,
|
|
150
|
+
renderHTML: (e) => e.fontSize ? { style: `font-size: ${e.fontSize}` } : {}
|
|
151
|
+
} }
|
|
152
|
+
}];
|
|
153
|
+
},
|
|
154
|
+
addCommands() {
|
|
155
|
+
return {
|
|
156
|
+
setFontSize: (e) => ({ chain: t }) => t().setMark("textStyle", { fontSize: e }).run(),
|
|
157
|
+
unsetFontSize: () => ({ chain: e }) => e().setMark("textStyle", { fontSize: null }).removeEmptyTextStyle().run()
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
}), d = n.create({
|
|
161
|
+
name: "lineHeight",
|
|
162
|
+
addOptions() {
|
|
163
|
+
return { types: ["textStyle"] };
|
|
164
|
+
},
|
|
165
|
+
addGlobalAttributes() {
|
|
166
|
+
return [{
|
|
167
|
+
types: this.options.types,
|
|
168
|
+
attributes: { lineHeight: {
|
|
169
|
+
default: null,
|
|
170
|
+
parseHTML: (e) => e.style.lineHeight,
|
|
171
|
+
renderHTML: (e) => e.lineHeight ? { style: `line-height: ${e.lineHeight}` } : {}
|
|
172
|
+
} }
|
|
173
|
+
}];
|
|
174
|
+
},
|
|
175
|
+
addCommands() {
|
|
176
|
+
return {
|
|
177
|
+
setLineHeight: (e) => ({ chain: t }) => t().setMark("textStyle", { lineHeight: e }).run(),
|
|
178
|
+
unsetLineHeight: () => ({ chain: e }) => e().setMark("textStyle", { lineHeight: null }).removeEmptyTextStyle().run()
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
}), f = n.create({
|
|
182
|
+
name: "textStyleKit",
|
|
183
|
+
addExtensions() {
|
|
184
|
+
let e = [];
|
|
185
|
+
return this.options.backgroundColor !== !1 && e.push(s.configure(this.options.backgroundColor)), this.options.color !== !1 && e.push(c.configure(this.options.color)), this.options.fontFamily !== !1 && e.push(l.configure(this.options.fontFamily)), this.options.fontSize !== !1 && e.push(u.configure(this.options.fontSize)), this.options.lineHeight !== !1 && e.push(d.configure(this.options.lineHeight)), this.options.textStyle !== !1 && e.push(o.configure(this.options.textStyle)), e;
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
//#endregion
|
|
189
|
+
export { s as BackgroundColor, c as Color, l as FontFamily, u as FontSize, d as LineHeight, o as TextStyle, f as TextStyleKit };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { FontFamily as e } from "./dist-D_HQYSY-.js";
|
|
2
|
+
//#region ../../node_modules/.bun/@tiptap+extension-font-family@3.22.3+6d8ea77516bd34fe/node_modules/@tiptap/extension-font-family/dist/index.js
|
|
3
|
+
var t = e;
|
|
4
|
+
//#endregion
|
|
5
|
+
export { e as FontFamily, t as default };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { Ht as e, Vt as t, Wt as n, c as r } from "./dist-C_ymrGFi.js";
|
|
2
|
+
//#region ../../node_modules/.bun/@tiptap+extension-highlight@3.22.1+ea875cbca4543ce7/node_modules/@tiptap/extension-highlight/dist/index.js
|
|
3
|
+
var i = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/, a = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g, o = r.create({
|
|
4
|
+
name: "highlight",
|
|
5
|
+
addOptions() {
|
|
6
|
+
return {
|
|
7
|
+
multicolor: !1,
|
|
8
|
+
HTMLAttributes: {}
|
|
9
|
+
};
|
|
10
|
+
},
|
|
11
|
+
addAttributes() {
|
|
12
|
+
return this.options.multicolor ? { color: {
|
|
13
|
+
default: null,
|
|
14
|
+
parseHTML: (e) => e.getAttribute("data-color") || e.style.backgroundColor,
|
|
15
|
+
renderHTML: (e) => e.color ? {
|
|
16
|
+
"data-color": e.color,
|
|
17
|
+
style: `background-color: ${e.color}; color: inherit`
|
|
18
|
+
} : {}
|
|
19
|
+
} } : {};
|
|
20
|
+
},
|
|
21
|
+
parseHTML() {
|
|
22
|
+
return [{ tag: "mark" }];
|
|
23
|
+
},
|
|
24
|
+
renderHTML({ HTMLAttributes: e }) {
|
|
25
|
+
return [
|
|
26
|
+
"mark",
|
|
27
|
+
n(this.options.HTMLAttributes, e),
|
|
28
|
+
0
|
|
29
|
+
];
|
|
30
|
+
},
|
|
31
|
+
renderMarkdown: (e, t) => `==${t.renderChildren(e)}==`,
|
|
32
|
+
parseMarkdown: (e, t) => t.applyMark("highlight", t.parseInline(e.tokens || [])),
|
|
33
|
+
markdownTokenizer: {
|
|
34
|
+
name: "highlight",
|
|
35
|
+
level: "inline",
|
|
36
|
+
start: (e) => e.indexOf("=="),
|
|
37
|
+
tokenize(e, t, n) {
|
|
38
|
+
let r = /^(==)([^=]+)(==)/.exec(e);
|
|
39
|
+
if (r) {
|
|
40
|
+
let e = r[2].trim(), t = n.inlineTokens(e);
|
|
41
|
+
return {
|
|
42
|
+
type: "highlight",
|
|
43
|
+
raw: r[0],
|
|
44
|
+
text: e,
|
|
45
|
+
tokens: t
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
addCommands() {
|
|
51
|
+
return {
|
|
52
|
+
setHighlight: (e) => ({ commands: t }) => t.setMark(this.name, e),
|
|
53
|
+
toggleHighlight: (e) => ({ commands: t }) => t.toggleMark(this.name, e),
|
|
54
|
+
unsetHighlight: () => ({ commands: e }) => e.unsetMark(this.name)
|
|
55
|
+
};
|
|
56
|
+
},
|
|
57
|
+
addKeyboardShortcuts() {
|
|
58
|
+
return { "Mod-Shift-h": () => this.editor.commands.toggleHighlight() };
|
|
59
|
+
},
|
|
60
|
+
addInputRules() {
|
|
61
|
+
return [t({
|
|
62
|
+
find: i,
|
|
63
|
+
type: this.type
|
|
64
|
+
})];
|
|
65
|
+
},
|
|
66
|
+
addPasteRules() {
|
|
67
|
+
return [e({
|
|
68
|
+
find: a,
|
|
69
|
+
type: this.type
|
|
70
|
+
})];
|
|
71
|
+
}
|
|
72
|
+
}), s = o;
|
|
73
|
+
//#endregion
|
|
74
|
+
export { o as Highlight, s as default, i as inputRegex, a as pasteRegex };
|