@vizel/core 0.0.1-alpha.1 → 0.0.1-alpha.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/LICENSE +21 -0
- package/dist/index.d.ts +13 -13
- package/dist/index.js +141 -141
- package/dist/index10.js +70 -110
- package/dist/index11.js +135 -168
- package/dist/index12.js +83 -74
- package/dist/index13.js +13 -134
- package/dist/index14.js +13 -146
- package/dist/index15.js +303 -15
- package/dist/index16.js +69 -14
- package/dist/index17.js +26 -295
- package/dist/index18.js +2 -2
- package/dist/index19.js +355 -24
- package/dist/index20.js +25 -264
- package/dist/index21.js +85 -68
- package/dist/index22.js +97 -353
- package/dist/index23.js +66 -84
- package/dist/index24.js +12 -36
- package/dist/index25.js +53 -92
- package/dist/index26.js +132 -96
- package/dist/index27.js +59 -126
- package/dist/index28.js +37 -53
- package/dist/index29.js +19 -62
- package/dist/index3.js +165 -60
- package/dist/index30.js +9 -37
- package/dist/index31.js +143 -19
- package/dist/index32.js +264 -11
- package/dist/index33.js +92 -9
- package/dist/index34.js +63 -16
- package/dist/index35.js +4 -58
- package/dist/index36.js +123 -15
- package/dist/index37.js +305 -42
- package/dist/index38.js +487 -4
- package/dist/index39.js +37 -112
- package/dist/index4.js +10 -86
- package/dist/index40.js +653 -301
- package/dist/index41.js +4 -487
- package/dist/index42.js +4 -48
- package/dist/index43.js +206 -642
- package/dist/index44.js +82 -4
- package/dist/index45.js +17 -4
- package/dist/index46.js +57 -237
- package/dist/index47.js +15 -82
- package/dist/index48.js +190 -274
- package/dist/index49.js +281 -1497
- package/dist/index5.js +132 -10
- package/dist/index50.js +1502 -5
- package/dist/index51.js +5 -1561
- package/dist/index52.js +1551 -192
- package/dist/index53.js +1 -1
- package/dist/index54.js +84 -21
- package/dist/index55.js +246 -10
- package/dist/index56.js +3 -7
- package/dist/index57.js +1231 -7
- package/dist/index58.js +731 -11
- package/dist/index59.js +21 -19
- package/dist/index6.js +48 -131
- package/dist/index60.js +10 -25
- package/dist/index61.js +6 -83
- package/dist/index62.js +7 -245
- package/dist/index63.js +11 -1229
- package/dist/index64.js +17 -732
- package/dist/index65.js +25 -3
- package/dist/index66.js +53 -1059
- package/dist/index67.js +1059 -53
- package/dist/index69.js +90 -3
- package/dist/index7.js +228 -409
- package/dist/index70.js +3 -90
- package/dist/index8.js +111 -45
- package/dist/index9.js +409 -228
- package/package.json +54 -80
package/dist/index27.js
CHANGED
|
@@ -1,136 +1,69 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
return {
|
|
6
|
-
slashCommand: {
|
|
7
|
-
suggestion: a()
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
if (t.slashCommand === !1)
|
|
11
|
-
return t;
|
|
12
|
-
const o = typeof t.slashCommand == "object" ? t.slashCommand : {};
|
|
13
|
-
return o.suggestion ? t : {
|
|
14
|
-
...t,
|
|
15
|
-
slashCommand: {
|
|
16
|
-
...o,
|
|
17
|
-
suggestion: a()
|
|
18
|
-
}
|
|
19
|
-
};
|
|
1
|
+
import { transformVizelDiagramCodeBlocks as c, convertVizelCodeBlocksToDiagrams as d } from "./index26.js";
|
|
2
|
+
const m = 300;
|
|
3
|
+
function u(n) {
|
|
4
|
+
return typeof n.getMarkdown == "function";
|
|
20
5
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
if (!a || !f(t)) return;
|
|
26
|
-
const { file: o } = t.detail, n = a.state.selection.from, r = e.getImageOptions();
|
|
27
|
-
p({
|
|
28
|
-
onUpload: r.onUpload ?? ((i) => new Promise((l) => {
|
|
29
|
-
const s = new FileReader();
|
|
30
|
-
s.onload = () => {
|
|
31
|
-
typeof s.result == "string" && l(s.result);
|
|
32
|
-
}, s.readAsDataURL(i);
|
|
33
|
-
})),
|
|
34
|
-
...r.maxFileSize !== void 0 && { maxFileSize: r.maxFileSize },
|
|
35
|
-
...r.allowedTypes !== void 0 && { allowedTypes: r.allowedTypes },
|
|
36
|
-
...r.onValidationError !== void 0 && {
|
|
37
|
-
onValidationError: r.onValidationError
|
|
38
|
-
},
|
|
39
|
-
...r.onUploadError !== void 0 && {
|
|
40
|
-
onUploadError: r.onUploadError
|
|
41
|
-
}
|
|
42
|
-
})(o, a.view, n);
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
const u = "vizel:upload-image";
|
|
46
|
-
function z(e) {
|
|
47
|
-
const t = g(e);
|
|
48
|
-
return document.addEventListener(u, t), () => {
|
|
49
|
-
document.removeEventListener(u, t);
|
|
50
|
-
};
|
|
6
|
+
function s(n) {
|
|
7
|
+
return n ? u(n) ? n.getMarkdown() : (console.warn(
|
|
8
|
+
"[Vizel] Markdown extension is not enabled. Enable it via features.markdown option."
|
|
9
|
+
), "") : "";
|
|
51
10
|
}
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
11
|
+
function f(n, r, a = {}) {
|
|
12
|
+
if (!n) return;
|
|
13
|
+
const { transformDiagrams: t = !0 } = a;
|
|
14
|
+
if (!u(n)) {
|
|
15
|
+
console.warn(
|
|
16
|
+
"[Vizel] Markdown extension is not enabled. Enable it via features.markdown option."
|
|
17
|
+
);
|
|
18
|
+
return;
|
|
55
19
|
}
|
|
56
|
-
};
|
|
57
|
-
function h(e) {
|
|
58
|
-
return "characterCount" in e && typeof e.characterCount == "object" && e.characterCount !== null && "characters" in e.characterCount && "words" in e.characterCount;
|
|
20
|
+
n.commands.setContent(r, { contentType: "markdown" }), t && d(n);
|
|
59
21
|
}
|
|
60
|
-
function
|
|
61
|
-
if (!
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
};
|
|
70
|
-
const t = e.storage;
|
|
71
|
-
let a = 0, o = 0;
|
|
72
|
-
return h(t) && (a = t.characterCount.characters(), o = t.characterCount.words()), {
|
|
73
|
-
isFocused: e.isFocused,
|
|
74
|
-
isEmpty: e.isEmpty,
|
|
75
|
-
canUndo: e.can().undo(),
|
|
76
|
-
canRedo: e.can().redo(),
|
|
77
|
-
characterCount: a,
|
|
78
|
-
wordCount: o
|
|
79
|
-
};
|
|
22
|
+
function g(n, r, a = {}) {
|
|
23
|
+
if (!n) return null;
|
|
24
|
+
const { transformDiagrams: t = !0 } = a, o = n.markdown;
|
|
25
|
+
if (!o?.parse)
|
|
26
|
+
return console.warn(
|
|
27
|
+
"[Vizel] Markdown extension is not enabled. Enable it via features.markdown option."
|
|
28
|
+
), null;
|
|
29
|
+
const e = o.parse(r);
|
|
30
|
+
return t && e?.type ? c(e) : e;
|
|
80
31
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
graphviz: "graphviz"
|
|
85
|
-
};
|
|
86
|
-
function E(e) {
|
|
87
|
-
if (!e) return e;
|
|
88
|
-
const t = e.attrs?.language;
|
|
89
|
-
return e.type === "codeBlock" && t && t in d ? {
|
|
90
|
-
type: "diagram",
|
|
91
|
-
attrs: {
|
|
92
|
-
code: e.content?.map((o) => o.text || "").join("").trim() || "",
|
|
93
|
-
type: d[t]
|
|
94
|
-
}
|
|
95
|
-
} : e.content && Array.isArray(e.content) ? {
|
|
96
|
-
...e,
|
|
97
|
-
content: e.content.map(E)
|
|
98
|
-
} : e;
|
|
32
|
+
function z(n, r, a = {}) {
|
|
33
|
+
const { transformDiagrams: t = !0 } = a;
|
|
34
|
+
f(n, r, { transformDiagrams: t });
|
|
99
35
|
}
|
|
100
|
-
function V(
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
36
|
+
function V(n = {}) {
|
|
37
|
+
const { debounceMs: r = m, transformDiagrams: a = !0 } = n;
|
|
38
|
+
let t = "", o = !1, e = null;
|
|
39
|
+
return {
|
|
40
|
+
handleUpdate: (i) => {
|
|
41
|
+
if (r === 0) {
|
|
42
|
+
t = s(i);
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
o = !0, e && clearTimeout(e), e = setTimeout(() => {
|
|
46
|
+
t = s(i), o = !1, e = null;
|
|
47
|
+
}, r);
|
|
48
|
+
},
|
|
49
|
+
getMarkdown: () => t,
|
|
50
|
+
setMarkdown: (i, l) => {
|
|
51
|
+
e && (clearTimeout(e), e = null), o = !1, f(i, l, { transformDiagrams: a }), t = l;
|
|
52
|
+
},
|
|
53
|
+
isPending: () => o,
|
|
54
|
+
flush: (i) => {
|
|
55
|
+
e && (clearTimeout(e), e = null), t = s(i), o = !1;
|
|
56
|
+
},
|
|
57
|
+
destroy: () => {
|
|
58
|
+
e && (clearTimeout(e), e = null);
|
|
113
59
|
}
|
|
114
|
-
}
|
|
115
|
-
let { tr: o } = e.state;
|
|
116
|
-
for (let n = a.length - 1; n >= 0; n--) {
|
|
117
|
-
const r = a[n];
|
|
118
|
-
if (!r) continue;
|
|
119
|
-
const { from: c, to: i, code: l, type: s } = r, m = t.create({
|
|
120
|
-
code: l,
|
|
121
|
-
type: s
|
|
122
|
-
});
|
|
123
|
-
o = o.replaceWith(c, i, m);
|
|
124
|
-
}
|
|
125
|
-
e.view.dispatch(o);
|
|
60
|
+
};
|
|
126
61
|
}
|
|
127
62
|
export {
|
|
128
|
-
|
|
129
|
-
V as
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
E as transformVizelDiagramCodeBlocks,
|
|
135
|
-
v as vizelDefaultEditorProps
|
|
63
|
+
m as VIZEL_DEFAULT_MARKDOWN_DEBOUNCE_MS,
|
|
64
|
+
V as createVizelMarkdownSyncHandlers,
|
|
65
|
+
s as getVizelMarkdown,
|
|
66
|
+
z as initializeVizelMarkdownContent,
|
|
67
|
+
g as parseVizelMarkdown,
|
|
68
|
+
f as setVizelMarkdown
|
|
136
69
|
};
|
package/dist/index28.js
CHANGED
|
@@ -1,56 +1,40 @@
|
|
|
1
|
-
|
|
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
|
-
return {
|
|
31
|
-
editor: new E({
|
|
32
|
-
extensions: [
|
|
33
|
-
...w({
|
|
34
|
-
...r !== void 0 && { placeholder: r },
|
|
35
|
-
...c !== void 0 && { features: c }
|
|
36
|
-
}),
|
|
37
|
-
...g
|
|
38
|
-
],
|
|
39
|
-
// Only set initialContent if initialMarkdown is not provided
|
|
40
|
-
...!t && o !== void 0 && { content: o },
|
|
41
|
-
editable: v,
|
|
42
|
-
autofocus: z,
|
|
43
|
-
editorProps: V,
|
|
44
|
-
...n && { onUpdate: n },
|
|
45
|
-
...m && { onCreate: m },
|
|
46
|
-
...a && { onDestroy: a },
|
|
47
|
-
...s && { onSelectionUpdate: s },
|
|
48
|
-
...d && { onFocus: d },
|
|
49
|
-
...l && { onBlur: l }
|
|
50
|
-
}),
|
|
51
|
-
imageOptions: C
|
|
52
|
-
};
|
|
1
|
+
const o = "vizel-portal-root", i = {
|
|
2
|
+
/** Base layer for dropdowns and menus */
|
|
3
|
+
dropdown: 50,
|
|
4
|
+
/** Layer for modals and dialogs */
|
|
5
|
+
modal: 100,
|
|
6
|
+
/** Layer for tooltips (highest priority) */
|
|
7
|
+
tooltip: 150
|
|
8
|
+
};
|
|
9
|
+
function a() {
|
|
10
|
+
let e = document.getElementById(o);
|
|
11
|
+
return e || (e = document.createElement("div"), e.id = o, e.setAttribute("data-vizel-portal", ""), document.body.appendChild(e)), e;
|
|
12
|
+
}
|
|
13
|
+
function c() {
|
|
14
|
+
return document.getElementById(o) !== null;
|
|
15
|
+
}
|
|
16
|
+
function u() {
|
|
17
|
+
const e = document.getElementById(o);
|
|
18
|
+
e?.parentNode && e.parentNode.removeChild(e);
|
|
19
|
+
}
|
|
20
|
+
function d(e = "dropdown") {
|
|
21
|
+
const t = document.createElement("div");
|
|
22
|
+
return t.setAttribute("data-vizel-portal-layer", e), t.style.position = "absolute", t.style.top = "0", t.style.left = "0", t.style.zIndex = String(i[e]), t;
|
|
23
|
+
}
|
|
24
|
+
function m(e, t = {}) {
|
|
25
|
+
const { layer: r = "dropdown", className: l } = t, n = d(r);
|
|
26
|
+
return l && (n.className = l), n.appendChild(e), a().appendChild(n), n;
|
|
27
|
+
}
|
|
28
|
+
function s(e) {
|
|
29
|
+
e.parentNode && e.parentNode.removeChild(e);
|
|
53
30
|
}
|
|
54
31
|
export {
|
|
55
|
-
|
|
32
|
+
o as VIZEL_PORTAL_ID,
|
|
33
|
+
i as VIZEL_PORTAL_Z_INDEX,
|
|
34
|
+
d as createVizelPortalElement,
|
|
35
|
+
a as getVizelPortalContainer,
|
|
36
|
+
c as hasVizelPortalContainer,
|
|
37
|
+
m as mountToVizelPortal,
|
|
38
|
+
u as removeVizelPortalContainer,
|
|
39
|
+
s as unmountFromVizelPortal
|
|
56
40
|
};
|
package/dist/index29.js
CHANGED
|
@@ -1,69 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
const { transformDiagrams: t = !0 } = a;
|
|
14
|
-
if (!u(n)) {
|
|
15
|
-
console.warn(
|
|
16
|
-
"[Vizel] Markdown extension is not enabled. Enable it via features.markdown option."
|
|
17
|
-
);
|
|
18
|
-
return;
|
|
19
|
-
}
|
|
20
|
-
n.commands.setContent(r, { contentType: "markdown" }), t && d(n);
|
|
21
|
-
}
|
|
22
|
-
function g(n, r, a = {}) {
|
|
23
|
-
if (!n) return null;
|
|
24
|
-
const { transformDiagrams: t = !0 } = a, o = n.markdown;
|
|
25
|
-
if (!o?.parse)
|
|
26
|
-
return console.warn(
|
|
27
|
-
"[Vizel] Markdown extension is not enabled. Enable it via features.markdown option."
|
|
28
|
-
), null;
|
|
29
|
-
const e = o.parse(r);
|
|
30
|
-
return t && e?.type ? c(e) : e;
|
|
31
|
-
}
|
|
32
|
-
function z(n, r, a = {}) {
|
|
33
|
-
const { transformDiagrams: t = !0 } = a;
|
|
34
|
-
f(n, r, { transformDiagrams: t });
|
|
35
|
-
}
|
|
36
|
-
function V(n = {}) {
|
|
37
|
-
const { debounceMs: r = m, transformDiagrams: a = !0 } = n;
|
|
38
|
-
let t = "", o = !1, e = null;
|
|
39
|
-
return {
|
|
40
|
-
handleUpdate: (i) => {
|
|
41
|
-
if (r === 0) {
|
|
42
|
-
t = s(i);
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
o = !0, e && clearTimeout(e), e = setTimeout(() => {
|
|
46
|
-
t = s(i), o = !1, e = null;
|
|
47
|
-
}, r);
|
|
48
|
-
},
|
|
49
|
-
getMarkdown: () => t,
|
|
50
|
-
setMarkdown: (i, l) => {
|
|
51
|
-
e && (clearTimeout(e), e = null), o = !1, f(i, l, { transformDiagrams: a }), t = l;
|
|
52
|
-
},
|
|
53
|
-
isPending: () => o,
|
|
54
|
-
flush: (i) => {
|
|
55
|
-
e && (clearTimeout(e), e = null), t = s(i), o = !1;
|
|
1
|
+
const r = "50";
|
|
2
|
+
function c() {
|
|
3
|
+
const e = document.createElement("div");
|
|
4
|
+
e.style.position = "absolute", e.style.zIndex = "50", document.body.appendChild(e);
|
|
5
|
+
const n = document.createElement("div");
|
|
6
|
+
return e.appendChild(n), {
|
|
7
|
+
container: e,
|
|
8
|
+
menuContainer: n,
|
|
9
|
+
updatePosition: (o) => {
|
|
10
|
+
if (!o) return;
|
|
11
|
+
const t = o();
|
|
12
|
+
t && (e.style.top = `${t.bottom + window.scrollY}px`, e.style.left = `${t.left + window.scrollX}px`);
|
|
56
13
|
},
|
|
57
14
|
destroy: () => {
|
|
58
|
-
e
|
|
15
|
+
e.remove();
|
|
59
16
|
}
|
|
60
17
|
};
|
|
61
18
|
}
|
|
19
|
+
function d(e) {
|
|
20
|
+
return e.key === "Escape";
|
|
21
|
+
}
|
|
62
22
|
export {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
z as initializeVizelMarkdownContent,
|
|
67
|
-
g as parseVizelMarkdown,
|
|
68
|
-
f as setVizelMarkdown
|
|
23
|
+
r as VIZEL_SUGGESTION_Z_INDEX,
|
|
24
|
+
c as createVizelSuggestionContainer,
|
|
25
|
+
d as handleVizelSuggestionEscape
|
|
69
26
|
};
|
package/dist/index3.js
CHANGED
|
@@ -1,69 +1,174 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import s from "@tiptap/extension-blockquote";
|
|
2
|
+
import m from "@tiptap/extension-bold";
|
|
3
|
+
import l from "@tiptap/extension-bullet-list";
|
|
4
|
+
import d from "@tiptap/extension-code";
|
|
5
|
+
import c from "@tiptap/extension-document";
|
|
6
|
+
import p from "@tiptap/extension-dropcursor";
|
|
7
|
+
import f from "@tiptap/extension-gapcursor";
|
|
8
|
+
import u from "@tiptap/extension-hard-break";
|
|
9
|
+
import h from "@tiptap/extension-heading";
|
|
10
|
+
import x from "@tiptap/extension-history";
|
|
11
|
+
import E from "@tiptap/extension-horizontal-rule";
|
|
12
|
+
import g from "@tiptap/extension-italic";
|
|
13
|
+
import b from "@tiptap/extension-list-item";
|
|
14
|
+
import k from "@tiptap/extension-list-keymap";
|
|
15
|
+
import z from "@tiptap/extension-ordered-list";
|
|
16
|
+
import y from "@tiptap/extension-paragraph";
|
|
17
|
+
import C from "@tiptap/extension-placeholder";
|
|
18
|
+
import V from "@tiptap/extension-strike";
|
|
19
|
+
import O from "@tiptap/extension-text";
|
|
20
|
+
import j from "./index34.js";
|
|
21
|
+
import { createVizelCharacterCountExtension as B } from "./index4.js";
|
|
22
|
+
import { createVizelCodeBlockExtension as a } from "./index5.js";
|
|
23
|
+
import { createVizelDetailsExtensions as L } from "./index6.js";
|
|
24
|
+
import { createVizelDiagramExtension as v } from "./index7.js";
|
|
25
|
+
import { createVizelDragHandleExtensions as w } from "./index8.js";
|
|
26
|
+
import { createVizelEmbedExtension as H } from "./index9.js";
|
|
27
|
+
import { vizelDefaultBase64Upload as T, createVizelImageUploadExtensions as D, defaultImageResizeOptions as S } from "./index11.js";
|
|
28
|
+
import { createVizelLinkExtension as U } from "./index13.js";
|
|
29
|
+
import { createVizelMarkdownExtension as I } from "./index14.js";
|
|
30
|
+
import { createVizelMathematicsExtensions as M } from "./index15.js";
|
|
31
|
+
import { VizelSlashCommand as F } from "./index17.js";
|
|
32
|
+
import { createVizelTableExtensions as P } from "./index18.js";
|
|
33
|
+
import { createVizelTaskListExtensions as R } from "./index20.js";
|
|
34
|
+
import { createVizelTextColorExtensions as q } from "./index21.js";
|
|
35
|
+
import { defaultSlashCommands as G } from "./index32.js";
|
|
36
|
+
function K(e = {}) {
|
|
37
|
+
const { headingLevels: o = [1, 2, 3] } = e;
|
|
38
|
+
return [
|
|
39
|
+
// Nodes
|
|
40
|
+
c,
|
|
41
|
+
y,
|
|
42
|
+
O,
|
|
43
|
+
h.configure({ levels: o }),
|
|
44
|
+
s,
|
|
45
|
+
l,
|
|
46
|
+
z,
|
|
47
|
+
b,
|
|
48
|
+
// CodeBlock is added separately based on feature options
|
|
49
|
+
u,
|
|
50
|
+
E,
|
|
51
|
+
// Marks
|
|
52
|
+
m,
|
|
53
|
+
d,
|
|
54
|
+
g,
|
|
55
|
+
V,
|
|
56
|
+
j,
|
|
57
|
+
// Functionality
|
|
58
|
+
p.configure({ color: "#3b82f6", width: 2 }),
|
|
59
|
+
f,
|
|
60
|
+
x,
|
|
61
|
+
k
|
|
62
|
+
];
|
|
4
63
|
}
|
|
5
|
-
function
|
|
6
|
-
|
|
64
|
+
function N(e, o) {
|
|
65
|
+
if (o.slashCommand === !1) return;
|
|
66
|
+
const t = typeof o.slashCommand == "object" ? o.slashCommand : {}, i = t.items ?? G;
|
|
67
|
+
e.push(
|
|
68
|
+
F.configure({
|
|
69
|
+
items: i,
|
|
70
|
+
...t.suggestion !== void 0 && {
|
|
71
|
+
suggestion: t.suggestion
|
|
72
|
+
}
|
|
73
|
+
})
|
|
74
|
+
);
|
|
7
75
|
}
|
|
8
|
-
function
|
|
9
|
-
if (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
76
|
+
function _(e, o) {
|
|
77
|
+
if (o.image === !1) return;
|
|
78
|
+
const t = typeof o.image == "object" ? o.image : {}, i = t.onUpload ?? T, n = t.resize !== !1;
|
|
79
|
+
e.push(
|
|
80
|
+
...D({
|
|
81
|
+
upload: {
|
|
82
|
+
onUpload: i,
|
|
83
|
+
...t.maxFileSize !== void 0 && { maxFileSize: t.maxFileSize },
|
|
84
|
+
...t.allowedTypes !== void 0 && { allowedTypes: t.allowedTypes },
|
|
85
|
+
...t.onValidationError !== void 0 && {
|
|
86
|
+
onValidationError: t.onValidationError
|
|
87
|
+
},
|
|
88
|
+
...t.onUploadError !== void 0 && {
|
|
89
|
+
onUploadError: t.onUploadError
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
resize: n ? S : !1
|
|
93
|
+
})
|
|
94
|
+
);
|
|
18
95
|
}
|
|
19
|
-
function
|
|
20
|
-
if (
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
} catch {
|
|
24
|
-
}
|
|
96
|
+
function A(e, o) {
|
|
97
|
+
if (o.markdown === !1) return;
|
|
98
|
+
const t = typeof o.markdown == "object" ? o.markdown : {};
|
|
99
|
+
e.push(I(t));
|
|
25
100
|
}
|
|
26
|
-
function
|
|
27
|
-
if (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
101
|
+
function J(e, o) {
|
|
102
|
+
if (o.taskList === !1) return;
|
|
103
|
+
const t = typeof o.taskList == "object" ? o.taskList : {};
|
|
104
|
+
e.push(...R(t));
|
|
105
|
+
}
|
|
106
|
+
function Q(e, o) {
|
|
107
|
+
if (o.characterCount === !1) return;
|
|
108
|
+
const t = typeof o.characterCount == "object" ? o.characterCount : {};
|
|
109
|
+
e.push(B(t));
|
|
110
|
+
}
|
|
111
|
+
function W(e, o) {
|
|
112
|
+
if (o.textColor === !1) return;
|
|
113
|
+
const t = typeof o.textColor == "object" ? o.textColor : {};
|
|
114
|
+
e.push(...q(t));
|
|
115
|
+
}
|
|
116
|
+
function X(e, o) {
|
|
117
|
+
if (o.codeBlock !== !1)
|
|
118
|
+
if (o.codeBlock === !0 || typeof o.codeBlock == "object") {
|
|
119
|
+
const t = typeof o.codeBlock == "object" ? o.codeBlock : {};
|
|
120
|
+
e.push(...a(t));
|
|
121
|
+
} else
|
|
122
|
+
e.push(...a());
|
|
123
|
+
}
|
|
124
|
+
function Y(e, o) {
|
|
125
|
+
if (o.mathematics === !1) return;
|
|
126
|
+
const t = typeof o.mathematics == "object" ? o.mathematics : {};
|
|
127
|
+
e.push(...M(t));
|
|
43
128
|
}
|
|
44
|
-
function
|
|
45
|
-
if (
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const e = window.matchMedia("(prefers-color-scheme: dark)"), n = (r) => {
|
|
49
|
-
t(r.matches ? "dark" : "light");
|
|
50
|
-
};
|
|
51
|
-
return e.addEventListener("change", n), () => {
|
|
52
|
-
e.removeEventListener("change", n);
|
|
53
|
-
};
|
|
129
|
+
function Z(e, o) {
|
|
130
|
+
if (o.dragHandle === !1) return;
|
|
131
|
+
const t = typeof o.dragHandle == "object" ? o.dragHandle : {};
|
|
132
|
+
e.push(...w(t));
|
|
54
133
|
}
|
|
55
|
-
function
|
|
56
|
-
|
|
134
|
+
function $(e, o) {
|
|
135
|
+
if (o.details === !1) return;
|
|
136
|
+
const t = typeof o.details == "object" ? o.details : {};
|
|
137
|
+
e.push(...L(t));
|
|
138
|
+
}
|
|
139
|
+
function oo(e, o) {
|
|
140
|
+
if (o.embed === !1) return;
|
|
141
|
+
const t = typeof o.embed == "object" ? o.embed : {};
|
|
142
|
+
e.push(H(t));
|
|
143
|
+
}
|
|
144
|
+
function to(e, o) {
|
|
145
|
+
if (o.diagram === !1) return;
|
|
146
|
+
const t = typeof o.diagram == "object" ? o.diagram : {};
|
|
147
|
+
e.push(v(t));
|
|
148
|
+
}
|
|
149
|
+
function Fo(e = {}) {
|
|
150
|
+
const {
|
|
151
|
+
placeholder: o = "Type '/' for commands...",
|
|
152
|
+
headingLevels: t = [1, 2, 3],
|
|
153
|
+
features: i = {}
|
|
154
|
+
} = e, n = [
|
|
155
|
+
...K({ headingLevels: t }),
|
|
156
|
+
C.configure({
|
|
157
|
+
placeholder: o,
|
|
158
|
+
emptyEditorClass: "vizel-editor-empty",
|
|
159
|
+
emptyNodeClass: "vizel-node-empty"
|
|
160
|
+
})
|
|
161
|
+
];
|
|
162
|
+
if (N(n, i), i.table !== !1) {
|
|
163
|
+
const r = typeof i.table == "object" ? i.table : {};
|
|
164
|
+
n.push(...P(r));
|
|
165
|
+
}
|
|
166
|
+
if (i.link !== !1) {
|
|
167
|
+
const r = typeof i.link == "object" ? i.link : {};
|
|
168
|
+
n.push(U(r));
|
|
169
|
+
}
|
|
170
|
+
return _(n, i), A(n, i), J(n, i), Q(n, i), W(n, i), X(n, i), Y(n, i), Z(n, i), $(n, i), oo(n, i), to(n, i), n;
|
|
57
171
|
}
|
|
58
172
|
export {
|
|
59
|
-
|
|
60
|
-
d as VIZEL_DEFAULT_THEME_STORAGE_KEY,
|
|
61
|
-
i as VIZEL_THEME_DATA_ATTRIBUTE,
|
|
62
|
-
l as applyVizelTheme,
|
|
63
|
-
h as createVizelSystemThemeListener,
|
|
64
|
-
s as getStoredVizelTheme,
|
|
65
|
-
c as getVizelSystemTheme,
|
|
66
|
-
f as getVizelThemeInitScript,
|
|
67
|
-
m as resolveVizelTheme,
|
|
68
|
-
u as storeVizelTheme
|
|
173
|
+
Fo as createVizelExtensions
|
|
69
174
|
};
|
package/dist/index30.js
CHANGED
|
@@ -1,40 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
};
|
|
9
|
-
function a() {
|
|
10
|
-
let e = document.getElementById(o);
|
|
11
|
-
return e || (e = document.createElement("div"), e.id = o, e.setAttribute("data-vizel-portal", ""), document.body.appendChild(e)), e;
|
|
12
|
-
}
|
|
13
|
-
function c() {
|
|
14
|
-
return document.getElementById(o) !== null;
|
|
15
|
-
}
|
|
16
|
-
function u() {
|
|
17
|
-
const e = document.getElementById(o);
|
|
18
|
-
e?.parentNode && e.parentNode.removeChild(e);
|
|
19
|
-
}
|
|
20
|
-
function d(e = "dropdown") {
|
|
21
|
-
const t = document.createElement("div");
|
|
22
|
-
return t.setAttribute("data-vizel-portal-layer", e), t.style.position = "absolute", t.style.top = "0", t.style.left = "0", t.style.zIndex = String(i[e]), t;
|
|
23
|
-
}
|
|
24
|
-
function m(e, t = {}) {
|
|
25
|
-
const { layer: r = "dropdown", className: l } = t, n = d(r);
|
|
26
|
-
return l && (n.className = l), n.appendChild(e), a().appendChild(n), n;
|
|
27
|
-
}
|
|
28
|
-
function s(e) {
|
|
29
|
-
e.parentNode && e.parentNode.removeChild(e);
|
|
1
|
+
function g(i, e) {
|
|
2
|
+
if (!e || e.length === 0)
|
|
3
|
+
return [{ text: i, highlight: !1 }];
|
|
4
|
+
const t = [];
|
|
5
|
+
let l = 0;
|
|
6
|
+
for (const [h, s] of e)
|
|
7
|
+
h > l && t.push({ text: i.slice(l, h), highlight: !1 }), t.push({ text: i.slice(h, s + 1), highlight: !0 }), l = s + 1;
|
|
8
|
+
return l < i.length && t.push({ text: i.slice(l), highlight: !1 }), t;
|
|
30
9
|
}
|
|
31
10
|
export {
|
|
32
|
-
|
|
33
|
-
i as VIZEL_PORTAL_Z_INDEX,
|
|
34
|
-
d as createVizelPortalElement,
|
|
35
|
-
a as getVizelPortalContainer,
|
|
36
|
-
c as hasVizelPortalContainer,
|
|
37
|
-
m as mountToVizelPortal,
|
|
38
|
-
u as removeVizelPortalContainer,
|
|
39
|
-
s as unmountFromVizelPortal
|
|
11
|
+
g as splitVizelTextByMatches
|
|
40
12
|
};
|