@vizel/core 0.0.1-alpha.5 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/components.css +1 -1
  2. package/dist/components.css.map +1 -1
  3. package/dist/index.d.ts +230 -15
  4. package/dist/index.js +78 -75
  5. package/dist/index10.js +1 -1
  6. package/dist/index11.js +4 -4
  7. package/dist/index14.js +1 -1
  8. package/dist/index15.js +134 -127
  9. package/dist/index17.js +2 -2
  10. package/dist/index18.js +1 -1
  11. package/dist/index19.js +86 -86
  12. package/dist/index20.js +2 -2
  13. package/dist/index21.js +2 -2
  14. package/dist/index22.js +16 -13
  15. package/dist/index24.js +164 -11
  16. package/dist/index25.js +12 -53
  17. package/dist/index26.js +49 -136
  18. package/dist/index27.js +132 -59
  19. package/dist/index28.js +66 -32
  20. package/dist/index29.js +35 -21
  21. package/dist/index3.js +91 -90
  22. package/dist/index30.js +23 -9
  23. package/dist/index31.js +9 -147
  24. package/dist/index32.js +138 -256
  25. package/dist/index33.js +258 -85
  26. package/dist/index34.js +84 -55
  27. package/dist/index35.js +64 -4
  28. package/dist/index36.js +4 -123
  29. package/dist/index37.js +111 -315
  30. package/dist/index38.js +321 -481
  31. package/dist/index39.js +12 -47
  32. package/dist/index4.js +1 -1
  33. package/dist/index40.js +463 -655
  34. package/dist/index41.js +48 -4
  35. package/dist/index42.js +694 -4
  36. package/dist/index43.js +4 -238
  37. package/dist/index44.js +4 -82
  38. package/dist/index45.js +237 -16
  39. package/dist/index46.js +81 -57
  40. package/dist/index47.js +17 -15
  41. package/dist/index48.js +57 -285
  42. package/dist/index49.js +15 -202
  43. package/dist/index5.js +78 -68
  44. package/dist/index50.js +281 -1497
  45. package/dist/index51.js +202 -5
  46. package/dist/index52.js +1408 -1467
  47. package/dist/index53.js +5 -723
  48. package/dist/index54.js +1109 -81
  49. package/dist/index55.js +703 -226
  50. package/dist/index56.js +84 -3
  51. package/dist/index57.js +219 -1205
  52. package/dist/index58.js +3 -734
  53. package/dist/index59.js +1232 -21
  54. package/dist/index6.js +1 -1
  55. package/dist/index60.js +734 -10
  56. package/dist/index61.js +21 -7
  57. package/dist/index62.js +10 -8
  58. package/dist/index63.js +6 -13
  59. package/dist/index64.js +7 -18
  60. package/dist/index65.js +12 -23
  61. package/dist/index66.js +17 -53
  62. package/dist/index67.js +23 -1059
  63. package/dist/index68.js +54 -90
  64. package/dist/index69.js +1061 -98
  65. package/dist/index7.js +108 -96
  66. package/dist/index70.js +98 -4
  67. package/dist/index71.js +93 -0
  68. package/dist/index72.js +6 -0
  69. package/dist/index8.js +1 -1
  70. package/dist/index9.js +75 -65
  71. package/dist/mathematics.css +1 -0
  72. package/dist/mathematics.css.map +1 -0
  73. package/dist/styles.css +1 -1
  74. package/dist/styles.css.map +1 -1
  75. package/package.json +90 -52
package/dist/index33.js CHANGED
@@ -1,95 +1,268 @@
1
- import { Table as w, TableCell as A, TableHeader as T } from "@tiptap/extension-table";
2
- function g(t, e) {
3
- return t.tokens ? e.parseInline(t.tokens) : t.text ? [e.createTextNode(t.text)] : [];
4
- }
5
- function f(t, e) {
6
- return t.length > 0 ? [e.createNode("paragraph", void 0, t)] : [e.createNode("paragraph")];
7
- }
8
- function x(t, e) {
9
- const { header: l, align: r, rows: s } = t, a = l.map((n, i) => {
10
- const o = g(n, e), c = r[i] ? { textAlign: r[i] } : void 0;
11
- return e.createNode("tableHeader", c, f(o, e));
12
- }), d = e.createNode("tableRow", void 0, a), u = s.map((n) => {
13
- const i = n.map((o, c) => {
14
- const m = g(o, e), p = r[c] ? { textAlign: r[c] } : void 0;
15
- return e.createNode("tableCell", p, f(m, e));
16
- });
17
- return e.createNode("tableRow", void 0, i);
18
- });
19
- return e.createNode("table", void 0, [d, ...u]);
20
- }
21
- function b(t, e) {
22
- if (!t.content || t.content.length === 0)
23
- return "";
24
- const l = t.content, r = l[0];
25
- if (!r?.content)
26
- return "";
27
- const s = r.content.map(
28
- (n) => n.attrs?.textAlign || null
29
- ), a = l.map((n) => n.content ? `| ${n.content.map((o) => (o.content ? e.renderChildren(o.content, "") : "").replace(/\n/g, " ").trim()).join(" | ")} |` : "|"), u = `| ${s.map((n) => {
30
- switch (n) {
31
- case "left":
32
- return ":---";
33
- case "center":
34
- return ":---:";
35
- case "right":
36
- return "---:";
37
- default:
38
- return "---";
39
- }
40
- }).join(" | ")} |`;
41
- return a.length > 0 ? [a[0], u, ...a.slice(1)].join(`
42
- `) : a.join(`
43
- `);
44
- }
45
- const C = w.extend({
46
- // Register markdown name for token matching
47
- name: "table",
48
- addStorage() {
49
- return {
50
- ...this.parent?.(),
51
- // Mark this extension as markdown-aware
52
- markdown: {
53
- parse: x,
54
- serialize: b
1
+ import l from "fuse.js";
2
+ const h = [
3
+ // Text group
4
+ {
5
+ title: "Heading 1",
6
+ description: "Large section heading",
7
+ icon: "heading1",
8
+ group: "Text",
9
+ keywords: ["h1", "title", "header", "big"],
10
+ shortcut: "⌘⌥1",
11
+ command: ({ editor: e, range: t }) => {
12
+ e.chain().focus().deleteRange(t).setNode("heading", { level: 1 }).run();
13
+ }
14
+ },
15
+ {
16
+ title: "Heading 2",
17
+ description: "Medium section heading",
18
+ icon: "heading2",
19
+ group: "Text",
20
+ keywords: ["h2", "subtitle", "header"],
21
+ shortcut: "⌘⌥2",
22
+ command: ({ editor: e, range: t }) => {
23
+ e.chain().focus().deleteRange(t).setNode("heading", { level: 2 }).run();
24
+ }
25
+ },
26
+ {
27
+ title: "Heading 3",
28
+ description: "Small section heading",
29
+ icon: "heading3",
30
+ group: "Text",
31
+ keywords: ["h3", "header", "section"],
32
+ shortcut: "⌘⌥3",
33
+ command: ({ editor: e, range: t }) => {
34
+ e.chain().focus().deleteRange(t).setNode("heading", { level: 3 }).run();
35
+ }
36
+ },
37
+ // Lists group
38
+ {
39
+ title: "Bullet List",
40
+ description: "Create a simple bullet list",
41
+ icon: "bulletList",
42
+ group: "Lists",
43
+ keywords: ["ul", "unordered", "bullets", "points"],
44
+ shortcut: "⌘⇧8",
45
+ command: ({ editor: e, range: t }) => {
46
+ e.chain().focus().deleteRange(t).toggleBulletList().run();
47
+ }
48
+ },
49
+ {
50
+ title: "Numbered List",
51
+ description: "Create a numbered list",
52
+ icon: "orderedList",
53
+ group: "Lists",
54
+ keywords: ["ol", "ordered", "numbers", "steps"],
55
+ shortcut: "⌘⇧7",
56
+ command: ({ editor: e, range: t }) => {
57
+ e.chain().focus().deleteRange(t).toggleOrderedList().run();
58
+ }
59
+ },
60
+ {
61
+ title: "Task List",
62
+ description: "Create a task list with checkboxes",
63
+ icon: "taskList",
64
+ group: "Lists",
65
+ keywords: ["todo", "checkbox", "checklist", "tasks"],
66
+ command: ({ editor: e, range: t }) => {
67
+ e.chain().focus().deleteRange(t).toggleTaskList().run();
68
+ }
69
+ },
70
+ // Blocks group
71
+ {
72
+ title: "Quote",
73
+ description: "Capture a quote",
74
+ icon: "blockquote",
75
+ group: "Blocks",
76
+ keywords: ["blockquote", "citation", "cite"],
77
+ shortcut: "⌘⇧B",
78
+ command: ({ editor: e, range: t }) => {
79
+ e.chain().focus().deleteRange(t).toggleBlockquote().run();
80
+ }
81
+ },
82
+ {
83
+ title: "Divider",
84
+ description: "Insert a horizontal divider",
85
+ icon: "horizontalRule",
86
+ group: "Blocks",
87
+ keywords: ["hr", "horizontal", "line", "separator", "break"],
88
+ command: ({ editor: e, range: t }) => {
89
+ e.chain().focus().deleteRange(t).setHorizontalRule().run();
90
+ }
91
+ },
92
+ {
93
+ title: "Details",
94
+ description: "Collapsible content block",
95
+ icon: "details",
96
+ group: "Blocks",
97
+ keywords: ["accordion", "toggle", "collapse", "expand", "summary", "details"],
98
+ command: ({ editor: e, range: t }) => {
99
+ e.can().setDetails?.() && e.chain().focus().deleteRange(t).setDetails().run();
100
+ }
101
+ },
102
+ {
103
+ title: "Code Block",
104
+ description: "Insert a code snippet",
105
+ icon: "codeBlock",
106
+ group: "Blocks",
107
+ keywords: ["pre", "code", "programming", "syntax", "snippet"],
108
+ shortcut: "⌘⌥C",
109
+ command: ({ editor: e, range: t }) => {
110
+ e.chain().focus().deleteRange(t).toggleCodeBlock().run();
111
+ }
112
+ },
113
+ {
114
+ title: "Table",
115
+ description: "Insert a table",
116
+ icon: "table",
117
+ group: "Blocks",
118
+ keywords: ["grid", "spreadsheet", "columns", "rows"],
119
+ command: ({ editor: e, range: t }) => {
120
+ e.chain().focus().deleteRange(t).insertTable({ rows: 3, cols: 3, withHeaderRow: !0 }).run();
121
+ }
122
+ },
123
+ // Media group
124
+ {
125
+ title: "Image",
126
+ description: "Insert an image from URL",
127
+ icon: "image",
128
+ group: "Media",
129
+ keywords: ["picture", "photo", "img", "url"],
130
+ command: ({ editor: e, range: t }) => {
131
+ const o = window.prompt("Enter image URL:");
132
+ o && e.chain().focus().deleteRange(t).setImage({ src: o }).run();
133
+ }
134
+ },
135
+ {
136
+ title: "Upload Image",
137
+ description: "Upload an image from your device",
138
+ icon: "imageUpload",
139
+ group: "Media",
140
+ keywords: ["picture", "photo", "upload", "file"],
141
+ command: ({ editor: e, range: t }) => {
142
+ try {
143
+ e.chain().focus().deleteRange(t).run();
144
+ } catch {
55
145
  }
56
- };
146
+ const o = document.createElement("input");
147
+ o.type = "file", o.accept = "image/*", o.onchange = () => {
148
+ const i = o.files?.[0];
149
+ if (i) {
150
+ const n = new CustomEvent("vizel:upload-image", {
151
+ detail: { file: i, editor: e }
152
+ });
153
+ document.dispatchEvent(n);
154
+ }
155
+ }, o.click();
156
+ }
157
+ },
158
+ {
159
+ title: "Embed",
160
+ description: "Embed a URL (YouTube, Twitter, etc.)",
161
+ icon: "embed",
162
+ group: "Media",
163
+ keywords: ["link", "url", "youtube", "video", "twitter", "embed", "iframe", "oembed"],
164
+ command: ({ editor: e, range: t }) => {
165
+ if (!(typeof e.commands.setEmbed == "function")) {
166
+ const n = window.prompt("Enter URL:");
167
+ n && e.chain().focus().deleteRange(t).setLink({ href: n }).run();
168
+ return;
169
+ }
170
+ const i = window.prompt("Enter URL to embed:");
171
+ i && e.chain().focus().deleteRange(t).setEmbed({ url: i }).run();
172
+ }
173
+ },
174
+ // Advanced group
175
+ {
176
+ title: "Math Equation",
177
+ description: "Insert a mathematical expression",
178
+ icon: "mathBlock",
179
+ group: "Advanced",
180
+ keywords: ["latex", "formula", "equation", "katex", "math"],
181
+ command: ({ editor: e, range: t }) => {
182
+ e.can().insertMathBlock?.({ latex: "" }) && e.chain().focus().deleteRange(t).insertMathBlock({ latex: "" }).run();
183
+ }
184
+ },
185
+ {
186
+ title: "Inline Math",
187
+ description: "Insert an inline math expression",
188
+ icon: "mathInline",
189
+ group: "Advanced",
190
+ keywords: ["latex", "formula", "inline", "katex", "math"],
191
+ command: ({ editor: e, range: t }) => {
192
+ e.can().insertMath?.({ latex: "" }) && e.chain().focus().deleteRange(t).insertMath({ latex: "" }).run();
193
+ }
57
194
  },
58
- // Add markdown parsing support
59
- // @ts-expect-error - parseMarkdown is a @tiptap/markdown extension point
60
- parseMarkdown(t, e) {
61
- return t.type !== "table" ? null : x(t, e);
195
+ {
196
+ title: "Mermaid Diagram",
197
+ description: "Insert a Mermaid diagram",
198
+ icon: "mermaid",
199
+ group: "Advanced",
200
+ keywords: ["diagram", "chart", "flowchart", "mermaid", "sequence", "graph", "uml"],
201
+ command: ({ editor: e, range: t }) => {
202
+ e.can().insertDiagram?.({ code: "" }) && e.chain().focus().deleteRange(t).insertDiagram({ code: "", type: "mermaid" }).run();
203
+ }
62
204
  },
63
- // Add markdown rendering support
64
- // @ts-expect-error - renderMarkdown is a @tiptap/markdown extension point
65
- renderMarkdown(t, e, l) {
66
- return b(t, e);
205
+ {
206
+ title: "GraphViz Diagram",
207
+ description: "Insert a GraphViz (DOT) diagram",
208
+ icon: "graphviz",
209
+ group: "Advanced",
210
+ keywords: ["diagram", "graphviz", "dot", "graph", "network", "nodes", "edges"],
211
+ command: ({ editor: e, range: t }) => {
212
+ e.can().insertDiagram?.({ code: "" }) && e.chain().focus().deleteRange(t).insertDiagram({ code: "", type: "graphviz" }).run();
213
+ }
67
214
  }
68
- }), M = A.extend({
69
- addAttributes() {
215
+ ], u = ["Text", "Lists", "Blocks", "Media", "Advanced"], m = {
216
+ keys: [
217
+ { name: "title", weight: 0.4 },
218
+ { name: "description", weight: 0.2 },
219
+ { name: "keywords", weight: 0.4 }
220
+ ],
221
+ threshold: 0.4,
222
+ includeScore: !0,
223
+ includeMatches: !0,
224
+ minMatchCharLength: 1
225
+ }, s = /* @__PURE__ */ new WeakMap();
226
+ function c(e) {
227
+ let t = s.get(e);
228
+ return t || (t = new l(e, m), s.set(e, t)), t;
229
+ }
230
+ function p(e, t) {
231
+ return t.trim() ? c(e).search(t).map((n) => n.item) : e;
232
+ }
233
+ function f(e, t) {
234
+ return t.trim() ? c(e).search(t).map((n) => {
235
+ const r = n.matches?.find((d) => d.key === "title")?.indices;
70
236
  return {
71
- ...this.parent?.(),
72
- textAlign: {
73
- default: null,
74
- parseHTML: (t) => t.style.textAlign || null,
75
- renderHTML: (t) => t.textAlign ? { style: `text-align: ${t.textAlign}` } : {}
76
- }
237
+ item: n.item,
238
+ score: n.score ?? 0,
239
+ titleMatches: r
77
240
  };
241
+ }) : e.map((n) => ({ item: n, score: 0 }));
242
+ }
243
+ function k(e, t = u) {
244
+ const o = /* @__PURE__ */ new Map();
245
+ for (const n of e) {
246
+ const a = n.group ?? "Other", r = o.get(a) ?? [];
247
+ r.push(n), o.set(a, r);
78
248
  }
79
- }), N = T.extend({
80
- addAttributes() {
81
- return {
82
- ...this.parent?.(),
83
- textAlign: {
84
- default: null,
85
- parseHTML: (t) => t.style.textAlign || null,
86
- renderHTML: (t) => t.textAlign ? { style: `text-align: ${t.textAlign}` } : {}
87
- }
88
- };
249
+ const i = [];
250
+ for (const n of t) {
251
+ const a = o.get(n);
252
+ a && a.length > 0 && (i.push({ name: n, items: a }), o.delete(n));
89
253
  }
90
- });
254
+ for (const [n, a] of o)
255
+ a.length > 0 && i.push({ name: n, items: a });
256
+ return i;
257
+ }
258
+ function w(e) {
259
+ return e.flatMap((t) => t.items);
260
+ }
91
261
  export {
92
- C as VizelTable,
93
- M as VizelTableCell,
94
- N as VizelTableHeader
262
+ u as defaultGroupOrder,
263
+ h as defaultSlashCommands,
264
+ p as filterSlashCommands,
265
+ w as flattenSlashCommandGroups,
266
+ k as groupSlashCommands,
267
+ f as searchSlashCommands
95
268
  };
package/dist/index34.js CHANGED
@@ -1,66 +1,95 @@
1
- import { Mark as d, mergeAttributes as a } from "@tiptap/core";
2
- var s = d.create({
3
- name: "underline",
4
- addOptions() {
1
+ import { Table as w, TableCell as A, TableHeader as T } from "@tiptap/extension-table";
2
+ function g(t, e) {
3
+ return t.tokens ? e.parseInline(t.tokens) : t.text ? [e.createTextNode(t.text)] : [];
4
+ }
5
+ function f(t, e) {
6
+ return t.length > 0 ? [e.createNode("paragraph", void 0, t)] : [e.createNode("paragraph")];
7
+ }
8
+ function x(t, e) {
9
+ const { header: l, align: r, rows: s } = t, a = l.map((n, i) => {
10
+ const o = g(n, e), c = r[i] ? { textAlign: r[i] } : void 0;
11
+ return e.createNode("tableHeader", c, f(o, e));
12
+ }), d = e.createNode("tableRow", void 0, a), u = s.map((n) => {
13
+ const i = n.map((o, c) => {
14
+ const m = g(o, e), p = r[c] ? { textAlign: r[c] } : void 0;
15
+ return e.createNode("tableCell", p, f(m, e));
16
+ });
17
+ return e.createNode("tableRow", void 0, i);
18
+ });
19
+ return e.createNode("table", void 0, [d, ...u]);
20
+ }
21
+ function b(t, e) {
22
+ if (!t.content || t.content.length === 0)
23
+ return "";
24
+ const l = t.content, r = l[0];
25
+ if (!r?.content)
26
+ return "";
27
+ const s = r.content.map(
28
+ (n) => n.attrs?.textAlign || null
29
+ ), a = l.map((n) => n.content ? `| ${n.content.map((o) => (o.content ? e.renderChildren(o.content, "") : "").replace(/\n/g, " ").trim()).join(" | ")} |` : "|"), u = `| ${s.map((n) => {
30
+ switch (n) {
31
+ case "left":
32
+ return ":---";
33
+ case "center":
34
+ return ":---:";
35
+ case "right":
36
+ return "---:";
37
+ default:
38
+ return "---";
39
+ }
40
+ }).join(" | ")} |`;
41
+ return a.length > 0 ? [a[0], u, ...a.slice(1)].join(`
42
+ `) : a.join(`
43
+ `);
44
+ }
45
+ const C = w.extend({
46
+ // Register markdown name for token matching
47
+ name: "table",
48
+ addStorage() {
5
49
  return {
6
- HTMLAttributes: {}
7
- };
8
- },
9
- parseHTML() {
10
- return [
11
- {
12
- tag: "u"
13
- },
14
- {
15
- style: "text-decoration",
16
- consuming: !1,
17
- getAttrs: (e) => e.includes("underline") ? {} : !1
50
+ ...this.parent?.(),
51
+ // Mark this extension as markdown-aware
52
+ markdown: {
53
+ parse: x,
54
+ serialize: b
18
55
  }
19
- ];
20
- },
21
- renderHTML({ HTMLAttributes: e }) {
22
- return ["u", a(this.options.HTMLAttributes, e), 0];
23
- },
24
- parseMarkdown(e, n) {
25
- return n.applyMark(this.name || "underline", n.parseInline(e.tokens || []));
56
+ };
26
57
  },
27
- renderMarkdown(e, n) {
28
- return `++${n.renderChildren(e)}++`;
58
+ // Add markdown parsing support
59
+ // @ts-expect-error - parseMarkdown is a @tiptap/markdown extension point
60
+ parseMarkdown(t, e) {
61
+ return t.type !== "table" ? null : x(t, e);
29
62
  },
30
- markdownTokenizer: {
31
- name: "underline",
32
- level: "inline",
33
- start(e) {
34
- return e.indexOf("++");
35
- },
36
- tokenize(e, n, i) {
37
- const r = /^(\+\+)([\s\S]+?)(\+\+)/.exec(e);
38
- if (!r)
39
- return;
40
- const t = r[2].trim();
41
- return {
42
- type: "underline",
43
- raw: r[0],
44
- text: t,
45
- tokens: i.inlineTokens(t)
46
- };
47
- }
48
- },
49
- addCommands() {
63
+ // Add markdown rendering support
64
+ // @ts-expect-error - renderMarkdown is a @tiptap/markdown extension point
65
+ renderMarkdown(t, e, l) {
66
+ return b(t, e);
67
+ }
68
+ }), M = A.extend({
69
+ addAttributes() {
50
70
  return {
51
- setUnderline: () => ({ commands: e }) => e.setMark(this.name),
52
- toggleUnderline: () => ({ commands: e }) => e.toggleMark(this.name),
53
- unsetUnderline: () => ({ commands: e }) => e.unsetMark(this.name)
71
+ ...this.parent?.(),
72
+ textAlign: {
73
+ default: null,
74
+ parseHTML: (t) => t.style.textAlign || null,
75
+ renderHTML: (t) => t.textAlign ? { style: `text-align: ${t.textAlign}` } : {}
76
+ }
54
77
  };
55
- },
56
- addKeyboardShortcuts() {
78
+ }
79
+ }), N = T.extend({
80
+ addAttributes() {
57
81
  return {
58
- "Mod-u": () => this.editor.commands.toggleUnderline(),
59
- "Mod-U": () => this.editor.commands.toggleUnderline()
82
+ ...this.parent?.(),
83
+ textAlign: {
84
+ default: null,
85
+ parseHTML: (t) => t.style.textAlign || null,
86
+ renderHTML: (t) => t.textAlign ? { style: `text-align: ${t.textAlign}` } : {}
87
+ }
60
88
  };
61
89
  }
62
- }), l = s;
90
+ });
63
91
  export {
64
- s as Underline,
65
- l as default
92
+ C as VizelTable,
93
+ M as VizelTableCell,
94
+ N as VizelTableHeader
66
95
  };
package/dist/index35.js CHANGED
@@ -1,6 +1,66 @@
1
- import { CharacterCount as a } from "./index48.js";
2
- var t = a;
1
+ import { Mark as d, mergeAttributes as a } from "@tiptap/core";
2
+ var s = d.create({
3
+ name: "underline",
4
+ addOptions() {
5
+ return {
6
+ HTMLAttributes: {}
7
+ };
8
+ },
9
+ parseHTML() {
10
+ return [
11
+ {
12
+ tag: "u"
13
+ },
14
+ {
15
+ style: "text-decoration",
16
+ consuming: !1,
17
+ getAttrs: (e) => e.includes("underline") ? {} : !1
18
+ }
19
+ ];
20
+ },
21
+ renderHTML({ HTMLAttributes: e }) {
22
+ return ["u", a(this.options.HTMLAttributes, e), 0];
23
+ },
24
+ parseMarkdown(e, n) {
25
+ return n.applyMark(this.name || "underline", n.parseInline(e.tokens || []));
26
+ },
27
+ renderMarkdown(e, n) {
28
+ return `++${n.renderChildren(e)}++`;
29
+ },
30
+ markdownTokenizer: {
31
+ name: "underline",
32
+ level: "inline",
33
+ start(e) {
34
+ return e.indexOf("++");
35
+ },
36
+ tokenize(e, n, i) {
37
+ const r = /^(\+\+)([\s\S]+?)(\+\+)/.exec(e);
38
+ if (!r)
39
+ return;
40
+ const t = r[2].trim();
41
+ return {
42
+ type: "underline",
43
+ raw: r[0],
44
+ text: t,
45
+ tokens: i.inlineTokens(t)
46
+ };
47
+ }
48
+ },
49
+ addCommands() {
50
+ return {
51
+ setUnderline: () => ({ commands: e }) => e.setMark(this.name),
52
+ toggleUnderline: () => ({ commands: e }) => e.toggleMark(this.name),
53
+ unsetUnderline: () => ({ commands: e }) => e.unsetMark(this.name)
54
+ };
55
+ },
56
+ addKeyboardShortcuts() {
57
+ return {
58
+ "Mod-u": () => this.editor.commands.toggleUnderline(),
59
+ "Mod-U": () => this.editor.commands.toggleUnderline()
60
+ };
61
+ }
62
+ }), l = s;
3
63
  export {
4
- a as CharacterCount,
5
- t as default
64
+ s as Underline,
65
+ l as default
6
66
  };