@vizel/core 0.0.1-alpha.6 → 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.
- package/dist/components.css +1 -1
- package/dist/components.css.map +1 -1
- package/dist/index.d.ts +230 -15
- package/dist/index.js +78 -75
- package/dist/index10.js +1 -1
- package/dist/index11.js +4 -4
- package/dist/index14.js +1 -1
- package/dist/index15.js +134 -127
- package/dist/index17.js +2 -2
- package/dist/index18.js +1 -1
- package/dist/index19.js +86 -86
- package/dist/index20.js +2 -2
- package/dist/index21.js +2 -2
- package/dist/index22.js +16 -13
- package/dist/index24.js +164 -11
- package/dist/index25.js +12 -53
- package/dist/index26.js +49 -136
- package/dist/index27.js +132 -59
- package/dist/index28.js +66 -32
- package/dist/index29.js +35 -21
- package/dist/index3.js +91 -90
- package/dist/index30.js +23 -9
- package/dist/index31.js +9 -147
- package/dist/index32.js +138 -256
- package/dist/index33.js +258 -85
- package/dist/index34.js +91 -15
- package/dist/index35.js +63 -57
- package/dist/index36.js +4 -15
- package/dist/index37.js +115 -56
- package/dist/index38.js +327 -4
- package/dist/index39.js +11 -121
- package/dist/index4.js +1 -1
- package/dist/index40.js +481 -321
- package/dist/index41.js +42 -481
- package/dist/index42.js +683 -37
- package/dist/index43.js +4 -679
- package/dist/index44.js +4 -4
- package/dist/index45.js +238 -4
- package/dist/index46.js +54 -210
- package/dist/index47.js +16 -81
- package/dist/index48.js +57 -285
- package/dist/index49.js +14 -1501
- package/dist/index5.js +78 -68
- package/dist/index50.js +286 -5
- package/dist/index51.js +4 -4
- package/dist/index52.js +1408 -1467
- package/dist/index53.js +5 -723
- package/dist/index54.js +1112 -21
- package/dist/index55.js +722 -9
- package/dist/index56.js +83 -6
- package/dist/index57.js +245 -7
- package/dist/index58.js +3 -14
- package/dist/index59.js +1230 -17
- package/dist/index6.js +1 -1
- package/dist/index60.js +733 -24
- package/dist/index61.js +21 -84
- package/dist/index62.js +10 -246
- package/dist/index63.js +7 -3
- package/dist/index64.js +7 -1231
- package/dist/index65.js +11 -731
- package/dist/index66.js +17 -1059
- package/dist/index67.js +21 -51
- package/dist/index68.js +54 -3
- package/dist/index69.js +1061 -98
- package/dist/index7.js +108 -96
- package/dist/index70.js +98 -91
- package/dist/index71.js +93 -0
- package/dist/index72.js +6 -0
- package/dist/index8.js +1 -1
- package/dist/index9.js +75 -65
- package/dist/mathematics.css +1 -0
- package/dist/mathematics.css.map +1 -0
- package/dist/styles.css +1 -1
- package/dist/styles.css.map +1 -1
- package/package.json +90 -52
package/dist/index33.js
CHANGED
|
@@ -1,95 +1,268 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
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
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
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
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
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
|
-
|
|
69
|
-
|
|
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
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
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
|
-
|
|
93
|
-
|
|
94
|
-
|
|
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,19 +1,95 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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]);
|
|
10
20
|
}
|
|
11
|
-
function
|
|
12
|
-
if (
|
|
13
|
-
|
|
14
|
-
|
|
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
|
+
`);
|
|
15
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
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
},
|
|
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);
|
|
62
|
+
},
|
|
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() {
|
|
70
|
+
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
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}
|
|
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
|
+
};
|
|
89
|
+
}
|
|
90
|
+
});
|
|
16
91
|
export {
|
|
17
|
-
|
|
18
|
-
|
|
92
|
+
C as VizelTable,
|
|
93
|
+
M as VizelTableCell,
|
|
94
|
+
N as VizelTableHeader
|
|
19
95
|
};
|
package/dist/index35.js
CHANGED
|
@@ -1,60 +1,66 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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
|
+
};
|
|
35
47
|
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
return d.viewBox = m.join(" "), {
|
|
52
|
-
attributes: d,
|
|
53
|
-
viewBox: m,
|
|
54
|
-
body: u
|
|
55
|
-
};
|
|
56
|
-
}
|
|
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;
|
|
57
63
|
export {
|
|
58
|
-
|
|
59
|
-
|
|
64
|
+
s as Underline,
|
|
65
|
+
l as default
|
|
60
66
|
};
|