@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.
- 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 +84 -55
- package/dist/index35.js +64 -4
- package/dist/index36.js +4 -123
- package/dist/index37.js +111 -315
- package/dist/index38.js +321 -481
- package/dist/index39.js +12 -47
- package/dist/index4.js +1 -1
- package/dist/index40.js +463 -655
- package/dist/index41.js +48 -4
- package/dist/index42.js +694 -4
- package/dist/index43.js +4 -238
- package/dist/index44.js +4 -82
- package/dist/index45.js +237 -16
- package/dist/index46.js +81 -57
- package/dist/index47.js +17 -15
- package/dist/index48.js +57 -285
- package/dist/index49.js +15 -202
- package/dist/index5.js +78 -68
- package/dist/index50.js +281 -1497
- package/dist/index51.js +202 -5
- package/dist/index52.js +1408 -1467
- package/dist/index53.js +5 -723
- package/dist/index54.js +1109 -81
- package/dist/index55.js +703 -226
- package/dist/index56.js +84 -3
- package/dist/index57.js +219 -1205
- package/dist/index58.js +3 -734
- package/dist/index59.js +1232 -21
- package/dist/index6.js +1 -1
- package/dist/index60.js +734 -10
- package/dist/index61.js +21 -7
- package/dist/index62.js +10 -8
- package/dist/index63.js +6 -13
- package/dist/index64.js +7 -18
- package/dist/index65.js +12 -23
- package/dist/index66.js +17 -53
- package/dist/index67.js +23 -1059
- package/dist/index68.js +54 -90
- package/dist/index69.js +1061 -98
- package/dist/index7.js +108 -96
- package/dist/index70.js +98 -4
- 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/index7.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
return `vizel-diagram-${Date.now()}-${++$}`;
|
|
1
|
+
import { Node as H, mergeAttributes as B } from "@tiptap/core";
|
|
2
|
+
import { createLazyLoader as I } from "./index39.js";
|
|
3
|
+
const G = I("mermaid", async () => (await import("mermaid")).default), $ = I("@hpcc-js/wasm-graphviz", async () => (await import("@hpcc-js/wasm-graphviz")).Graphviz);
|
|
4
|
+
let O = 0;
|
|
5
|
+
function P() {
|
|
6
|
+
return `vizel-diagram-${Date.now()}-${++O}`;
|
|
8
7
|
}
|
|
9
|
-
const
|
|
8
|
+
const R = {
|
|
10
9
|
name: "diagram",
|
|
11
10
|
start: "```",
|
|
12
11
|
tokenize(e) {
|
|
@@ -18,44 +17,47 @@ const O = {
|
|
|
18
17
|
code: a[1].trim(),
|
|
19
18
|
diagramType: "mermaid"
|
|
20
19
|
};
|
|
21
|
-
const
|
|
22
|
-
if (
|
|
20
|
+
const r = e.match(/^```dot\n([\s\S]*?)```/);
|
|
21
|
+
if (r?.[1] !== void 0)
|
|
23
22
|
return {
|
|
24
23
|
type: "diagram",
|
|
25
|
-
raw:
|
|
26
|
-
code:
|
|
24
|
+
raw: r[0],
|
|
25
|
+
code: r[1].trim(),
|
|
27
26
|
diagramType: "graphviz"
|
|
28
27
|
};
|
|
29
|
-
const
|
|
30
|
-
if (
|
|
28
|
+
const s = e.match(/^```graphviz\n([\s\S]*?)```/);
|
|
29
|
+
if (s?.[1] !== void 0)
|
|
31
30
|
return {
|
|
32
31
|
type: "diagram",
|
|
33
|
-
raw:
|
|
34
|
-
code:
|
|
32
|
+
raw: s[0],
|
|
33
|
+
code: s[1].trim(),
|
|
35
34
|
diagramType: "graphviz"
|
|
36
35
|
};
|
|
37
36
|
}
|
|
38
37
|
};
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
async function V(e, a) {
|
|
39
|
+
if (a.mermaidInitialized) return;
|
|
40
|
+
(await G()).initialize({
|
|
42
41
|
startOnLoad: !1,
|
|
43
|
-
securityLevel: "loose",
|
|
44
42
|
theme: "default",
|
|
45
43
|
fontFamily: "var(--vizel-font-sans)",
|
|
46
|
-
...e
|
|
47
|
-
|
|
44
|
+
...e,
|
|
45
|
+
securityLevel: e?.securityLevel ?? "strict"
|
|
46
|
+
}), a.mermaidInitialized = !0;
|
|
48
47
|
}
|
|
49
|
-
let
|
|
50
|
-
function
|
|
51
|
-
return
|
|
48
|
+
let T = null, C = null;
|
|
49
|
+
function K() {
|
|
50
|
+
return T ? Promise.resolve(T) : C || (C = (async () => {
|
|
51
|
+
const a = await (await $()).load();
|
|
52
|
+
return T = a, a;
|
|
53
|
+
})(), C);
|
|
52
54
|
}
|
|
53
|
-
async function
|
|
55
|
+
async function N(e) {
|
|
54
56
|
if (!e.trim())
|
|
55
57
|
return { svg: "", error: null };
|
|
56
58
|
try {
|
|
57
|
-
const a =
|
|
58
|
-
return { svg:
|
|
59
|
+
const a = await G(), r = P(), { svg: s } = await a.render(r, e);
|
|
60
|
+
return { svg: s, error: null };
|
|
59
61
|
} catch (a) {
|
|
60
62
|
return {
|
|
61
63
|
svg: "",
|
|
@@ -63,24 +65,24 @@ async function V(e) {
|
|
|
63
65
|
};
|
|
64
66
|
}
|
|
65
67
|
}
|
|
66
|
-
async function
|
|
68
|
+
async function _(e, a = "dot") {
|
|
67
69
|
if (!e.trim())
|
|
68
70
|
return { svg: "", error: null };
|
|
69
71
|
try {
|
|
70
|
-
return { svg: (await
|
|
71
|
-
} catch (
|
|
72
|
+
return { svg: (await K()).layout(e, "svg", a), error: null };
|
|
73
|
+
} catch (r) {
|
|
72
74
|
return {
|
|
73
75
|
svg: "",
|
|
74
|
-
error:
|
|
76
|
+
error: r instanceof Error ? r.message : "Invalid DOT syntax"
|
|
75
77
|
};
|
|
76
78
|
}
|
|
77
79
|
}
|
|
78
|
-
const
|
|
80
|
+
const F = `flowchart TD
|
|
79
81
|
A[Start] --> B{Decision}
|
|
80
82
|
B -->|Yes| C[Action 1]
|
|
81
83
|
B -->|No| D[Action 2]
|
|
82
84
|
C --> E[End]
|
|
83
|
-
D --> E`,
|
|
85
|
+
D --> E`, U = `digraph G {
|
|
84
86
|
rankdir=LR
|
|
85
87
|
node [shape=box, style=rounded]
|
|
86
88
|
|
|
@@ -100,7 +102,7 @@ function x(e) {
|
|
|
100
102
|
return "Diagram";
|
|
101
103
|
}
|
|
102
104
|
}
|
|
103
|
-
const
|
|
105
|
+
const j = H.create({
|
|
104
106
|
name: "diagram",
|
|
105
107
|
group: "block",
|
|
106
108
|
atom: !0,
|
|
@@ -113,8 +115,14 @@ const N = G.create({
|
|
|
113
115
|
mermaidConfig: {},
|
|
114
116
|
graphvizEngine: "dot",
|
|
115
117
|
defaultType: "mermaid",
|
|
116
|
-
defaultCode:
|
|
117
|
-
defaultGraphvizCode:
|
|
118
|
+
defaultCode: F,
|
|
119
|
+
defaultGraphvizCode: U
|
|
120
|
+
};
|
|
121
|
+
},
|
|
122
|
+
addStorage() {
|
|
123
|
+
return {
|
|
124
|
+
/** Whether mermaid has been initialized for this editor instance */
|
|
125
|
+
mermaidInitialized: !1
|
|
118
126
|
};
|
|
119
127
|
},
|
|
120
128
|
addAttributes() {
|
|
@@ -145,7 +153,7 @@ const N = G.create({
|
|
|
145
153
|
renderHTML({ HTMLAttributes: e }) {
|
|
146
154
|
return [
|
|
147
155
|
"div",
|
|
148
|
-
|
|
156
|
+
B(e, {
|
|
149
157
|
"data-type": "diagram",
|
|
150
158
|
"data-vizel-diagram": "",
|
|
151
159
|
class: "vizel-diagram"
|
|
@@ -153,81 +161,86 @@ const N = G.create({
|
|
|
153
161
|
];
|
|
154
162
|
},
|
|
155
163
|
addNodeView() {
|
|
156
|
-
return ({ node: e, getPos: a, editor:
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
164
|
+
return ({ node: e, getPos: a, editor: r }) => {
|
|
165
|
+
const s = this.options.mermaidConfig, S = this.storage, n = document.createElement("div");
|
|
166
|
+
n.classList.add("vizel-diagram"), n.setAttribute("data-type", "diagram"), n.setAttribute("data-vizel-diagram", ""), n.setAttribute("contenteditable", "false");
|
|
167
|
+
const p = document.createElement("div");
|
|
168
|
+
p.classList.add("vizel-diagram-type"), p.textContent = x(e.attrs.type), n.appendChild(p);
|
|
169
|
+
const c = document.createElement("div");
|
|
170
|
+
c.classList.add("vizel-diagram-render"), n.appendChild(c);
|
|
162
171
|
const l = document.createElement("div");
|
|
163
|
-
l.classList.add("vizel-diagram-
|
|
164
|
-
const
|
|
165
|
-
|
|
166
|
-
const
|
|
167
|
-
|
|
168
|
-
const
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
let u = !1, s = e.attrs.code, c = e.attrs.type;
|
|
173
|
-
const y = async (t, d, g) => {
|
|
172
|
+
l.classList.add("vizel-diagram-edit-container"), l.style.display = "none";
|
|
173
|
+
const i = document.createElement("textarea");
|
|
174
|
+
i.classList.add("vizel-diagram-textarea"), i.value = e.attrs.code, i.placeholder = "Enter diagram code...", i.spellcheck = !1, l.appendChild(i);
|
|
175
|
+
const h = document.createElement("div");
|
|
176
|
+
h.classList.add("vizel-diagram-preview"), l.appendChild(h);
|
|
177
|
+
const E = document.createElement("div");
|
|
178
|
+
E.classList.add("vizel-diagram-error"), E.style.display = "none", l.appendChild(E), n.appendChild(l);
|
|
179
|
+
let v = !1, o = e.attrs.code, m = e.attrs.type;
|
|
180
|
+
const z = async (t, d, g) => {
|
|
174
181
|
if (!t.trim()) {
|
|
175
|
-
|
|
182
|
+
const u = document.createElement("div");
|
|
183
|
+
u.className = "vizel-diagram-placeholder", u.textContent = "Click to add diagram code", g.replaceChildren(u);
|
|
176
184
|
return;
|
|
177
185
|
}
|
|
178
|
-
let
|
|
179
|
-
d === "graphviz" ?
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
186
|
+
let y;
|
|
187
|
+
if (d === "graphviz" ? y = await _(t, this.options.graphvizEngine) : (await V(s, S), y = await N(t)), y.error) {
|
|
188
|
+
g.textContent = "";
|
|
189
|
+
const u = document.createElement("div");
|
|
190
|
+
u.className = "vizel-diagram-error-display", u.textContent = y.error, g.appendChild(u);
|
|
191
|
+
} else
|
|
192
|
+
g.innerHTML = y.svg;
|
|
193
|
+
}, w = () => {
|
|
194
|
+
r.isEditable && (v = !0, n.classList.add("vizel-diagram-editing"), c.style.display = "none", p.style.display = "none", l.style.display = "", i.value = o, z(o, m, h), i.focus());
|
|
195
|
+
}, L = () => {
|
|
196
|
+
if (!v) return;
|
|
197
|
+
v = !1, n.classList.remove("vizel-diagram-editing"), c.style.display = "", p.style.display = "", l.style.display = "none";
|
|
198
|
+
const t = i.value.trim(), d = typeof a == "function" ? a() : null;
|
|
199
|
+
d != null && (t === "" && o !== "" ? r.chain().focus().deleteRange({ from: d, to: d + e.nodeSize }).run() : t !== o && (o = t, r.chain().focus().updateAttributes("diagram", { code: t }).run()));
|
|
187
200
|
}, M = (t) => {
|
|
188
|
-
!
|
|
201
|
+
!v && t.target === n && (t.preventDefault(), t.stopPropagation(), w());
|
|
189
202
|
}, D = (t) => {
|
|
190
|
-
t.preventDefault(), t.stopPropagation(),
|
|
191
|
-
}, w = (t) => {
|
|
192
|
-
const d = t.relatedTarget;
|
|
193
|
-
d instanceof HTMLElement && o.contains(d) || E();
|
|
203
|
+
t.preventDefault(), t.stopPropagation(), w();
|
|
194
204
|
}, b = (t) => {
|
|
195
|
-
|
|
205
|
+
const d = t.relatedTarget;
|
|
206
|
+
d instanceof HTMLElement && l.contains(d) || L();
|
|
207
|
+
}, k = (t) => {
|
|
208
|
+
t.key === "Escape" && (t.preventDefault(), i.value = o, L()), t.key === "Enter" && (t.ctrlKey || t.metaKey) && (t.preventDefault(), L());
|
|
196
209
|
};
|
|
197
|
-
let
|
|
198
|
-
const
|
|
199
|
-
|
|
200
|
-
|
|
210
|
+
let f = null;
|
|
211
|
+
const A = () => {
|
|
212
|
+
f && clearTimeout(f), f = setTimeout(() => {
|
|
213
|
+
z(i.value, m, h);
|
|
201
214
|
}, 300);
|
|
202
215
|
};
|
|
203
|
-
return
|
|
204
|
-
dom:
|
|
216
|
+
return n.addEventListener("click", M), c.addEventListener("click", D), i.addEventListener("blur", b), i.addEventListener("keydown", k), i.addEventListener("input", A), z(o, m, c), {
|
|
217
|
+
dom: n,
|
|
205
218
|
update(t) {
|
|
206
219
|
if (t.type.name !== "diagram")
|
|
207
220
|
return !1;
|
|
208
|
-
const d = t.attrs.type !==
|
|
209
|
-
return d && (
|
|
221
|
+
const d = t.attrs.type !== m, g = t.attrs.code !== o;
|
|
222
|
+
return d && (m = t.attrs.type, p.textContent = x(m)), !v && (g || d) && (o = t.attrs.code, z(o, m, c)), !0;
|
|
210
223
|
},
|
|
211
224
|
selectNode() {
|
|
212
|
-
|
|
225
|
+
n.classList.add("vizel-diagram-selected");
|
|
213
226
|
},
|
|
214
227
|
deselectNode() {
|
|
215
|
-
|
|
228
|
+
n.classList.remove("vizel-diagram-selected");
|
|
216
229
|
},
|
|
217
230
|
destroy() {
|
|
218
|
-
|
|
231
|
+
f && clearTimeout(f), n.removeEventListener("click", M), c.removeEventListener("click", D), i.removeEventListener("blur", b), i.removeEventListener("keydown", k), i.removeEventListener("input", A);
|
|
219
232
|
}
|
|
220
233
|
};
|
|
221
234
|
};
|
|
222
235
|
},
|
|
223
236
|
addCommands() {
|
|
224
237
|
return {
|
|
225
|
-
insertDiagram: ({ code: e, type: a = "mermaid" }) => ({ commands:
|
|
226
|
-
const
|
|
227
|
-
return
|
|
238
|
+
insertDiagram: ({ code: e, type: a = "mermaid" }) => ({ commands: r }) => {
|
|
239
|
+
const s = a === "graphviz" ? this.options.defaultGraphvizCode : this.options.defaultCode;
|
|
240
|
+
return r.insertContent({
|
|
228
241
|
type: this.name,
|
|
229
242
|
attrs: {
|
|
230
|
-
code: e ||
|
|
243
|
+
code: e || s,
|
|
231
244
|
type: a
|
|
232
245
|
}
|
|
233
246
|
});
|
|
@@ -244,7 +257,7 @@ const N = G.create({
|
|
|
244
257
|
},
|
|
245
258
|
// Markdown support (GitHub compatible)
|
|
246
259
|
// Single tokenizer handles mermaid, dot, and graphviz code blocks
|
|
247
|
-
markdownTokenizer:
|
|
260
|
+
markdownTokenizer: R,
|
|
248
261
|
parseMarkdown(e) {
|
|
249
262
|
return {
|
|
250
263
|
type: "diagram",
|
|
@@ -255,21 +268,20 @@ const N = G.create({
|
|
|
255
268
|
};
|
|
256
269
|
},
|
|
257
270
|
renderMarkdown(e) {
|
|
258
|
-
const a = e.attrs?.code || "",
|
|
259
|
-
return
|
|
271
|
+
const a = e.attrs?.code || "", r = e.attrs?.type || "mermaid";
|
|
272
|
+
return r === "mermaid" ? `\`\`\`mermaid
|
|
260
273
|
${a}
|
|
261
|
-
\`\`\`` :
|
|
274
|
+
\`\`\`` : r === "graphviz" ? `\`\`\`dot
|
|
262
275
|
${a}
|
|
263
|
-
\`\`\`` : `\`\`\`${
|
|
276
|
+
\`\`\`` : `\`\`\`${r}
|
|
264
277
|
${a}
|
|
265
278
|
\`\`\``;
|
|
266
279
|
}
|
|
267
280
|
});
|
|
268
|
-
function
|
|
269
|
-
return
|
|
281
|
+
function q(e = {}) {
|
|
282
|
+
return j.configure(e);
|
|
270
283
|
}
|
|
271
284
|
export {
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
Q as mermaid
|
|
285
|
+
j as VizelDiagram,
|
|
286
|
+
q as createVizelDiagramExtension
|
|
275
287
|
};
|
package/dist/index70.js
CHANGED
|
@@ -1,6 +1,100 @@
|
|
|
1
|
-
function
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
var l = 200, p = function() {
|
|
2
|
+
};
|
|
3
|
+
p.prototype.append = function(t) {
|
|
4
|
+
return t.length ? (t = p.from(t), !this.length && t || t.length < l && this.leafAppend(t) || this.length < l && t.leafPrepend(this) || this.appendInner(t)) : this;
|
|
5
|
+
};
|
|
6
|
+
p.prototype.prepend = function(t) {
|
|
7
|
+
return t.length ? p.from(t).append(this) : this;
|
|
8
|
+
};
|
|
9
|
+
p.prototype.appendInner = function(t) {
|
|
10
|
+
return new u(this, t);
|
|
11
|
+
};
|
|
12
|
+
p.prototype.slice = function(t, r) {
|
|
13
|
+
return t === void 0 && (t = 0), r === void 0 && (r = this.length), t >= r ? p.empty : this.sliceInner(Math.max(0, t), Math.min(this.length, r));
|
|
14
|
+
};
|
|
15
|
+
p.prototype.get = function(t) {
|
|
16
|
+
if (!(t < 0 || t >= this.length))
|
|
17
|
+
return this.getInner(t);
|
|
18
|
+
};
|
|
19
|
+
p.prototype.forEach = function(t, r, e) {
|
|
20
|
+
r === void 0 && (r = 0), e === void 0 && (e = this.length), r <= e ? this.forEachInner(t, r, e, 0) : this.forEachInvertedInner(t, r, e, 0);
|
|
21
|
+
};
|
|
22
|
+
p.prototype.map = function(t, r, e) {
|
|
23
|
+
r === void 0 && (r = 0), e === void 0 && (e = this.length);
|
|
24
|
+
var n = [];
|
|
25
|
+
return this.forEach(function(i, s) {
|
|
26
|
+
return n.push(t(i, s));
|
|
27
|
+
}, r, e), n;
|
|
28
|
+
};
|
|
29
|
+
p.from = function(t) {
|
|
30
|
+
return t instanceof p ? t : t && t.length ? new o(t) : p.empty;
|
|
31
|
+
};
|
|
32
|
+
var o = /* @__PURE__ */ (function(h) {
|
|
33
|
+
function t(e) {
|
|
34
|
+
h.call(this), this.values = e;
|
|
35
|
+
}
|
|
36
|
+
h && (t.__proto__ = h), t.prototype = Object.create(h && h.prototype), t.prototype.constructor = t;
|
|
37
|
+
var r = { length: { configurable: !0 }, depth: { configurable: !0 } };
|
|
38
|
+
return t.prototype.flatten = function() {
|
|
39
|
+
return this.values;
|
|
40
|
+
}, t.prototype.sliceInner = function(n, i) {
|
|
41
|
+
return n == 0 && i == this.length ? this : new t(this.values.slice(n, i));
|
|
42
|
+
}, t.prototype.getInner = function(n) {
|
|
43
|
+
return this.values[n];
|
|
44
|
+
}, t.prototype.forEachInner = function(n, i, s, f) {
|
|
45
|
+
for (var a = i; a < s; a++)
|
|
46
|
+
if (n(this.values[a], f + a) === !1)
|
|
47
|
+
return !1;
|
|
48
|
+
}, t.prototype.forEachInvertedInner = function(n, i, s, f) {
|
|
49
|
+
for (var a = i - 1; a >= s; a--)
|
|
50
|
+
if (n(this.values[a], f + a) === !1)
|
|
51
|
+
return !1;
|
|
52
|
+
}, t.prototype.leafAppend = function(n) {
|
|
53
|
+
if (this.length + n.length <= l)
|
|
54
|
+
return new t(this.values.concat(n.flatten()));
|
|
55
|
+
}, t.prototype.leafPrepend = function(n) {
|
|
56
|
+
if (this.length + n.length <= l)
|
|
57
|
+
return new t(n.flatten().concat(this.values));
|
|
58
|
+
}, r.length.get = function() {
|
|
59
|
+
return this.values.length;
|
|
60
|
+
}, r.depth.get = function() {
|
|
61
|
+
return 0;
|
|
62
|
+
}, Object.defineProperties(t.prototype, r), t;
|
|
63
|
+
})(p);
|
|
64
|
+
p.empty = new o([]);
|
|
65
|
+
var u = /* @__PURE__ */ (function(h) {
|
|
66
|
+
function t(r, e) {
|
|
67
|
+
h.call(this), this.left = r, this.right = e, this.length = r.length + e.length, this.depth = Math.max(r.depth, e.depth) + 1;
|
|
68
|
+
}
|
|
69
|
+
return h && (t.__proto__ = h), t.prototype = Object.create(h && h.prototype), t.prototype.constructor = t, t.prototype.flatten = function() {
|
|
70
|
+
return this.left.flatten().concat(this.right.flatten());
|
|
71
|
+
}, t.prototype.getInner = function(e) {
|
|
72
|
+
return e < this.left.length ? this.left.get(e) : this.right.get(e - this.left.length);
|
|
73
|
+
}, t.prototype.forEachInner = function(e, n, i, s) {
|
|
74
|
+
var f = this.left.length;
|
|
75
|
+
if (n < f && this.left.forEachInner(e, n, Math.min(i, f), s) === !1 || i > f && this.right.forEachInner(e, Math.max(n - f, 0), Math.min(this.length, i) - f, s + f) === !1)
|
|
76
|
+
return !1;
|
|
77
|
+
}, t.prototype.forEachInvertedInner = function(e, n, i, s) {
|
|
78
|
+
var f = this.left.length;
|
|
79
|
+
if (n > f && this.right.forEachInvertedInner(e, n - f, Math.max(i, f) - f, s + f) === !1 || i < f && this.left.forEachInvertedInner(e, Math.min(n, f), i, s) === !1)
|
|
80
|
+
return !1;
|
|
81
|
+
}, t.prototype.sliceInner = function(e, n) {
|
|
82
|
+
if (e == 0 && n == this.length)
|
|
83
|
+
return this;
|
|
84
|
+
var i = this.left.length;
|
|
85
|
+
return n <= i ? this.left.slice(e, n) : e >= i ? this.right.slice(e - i, n - i) : this.left.slice(e, i).append(this.right.slice(0, n - i));
|
|
86
|
+
}, t.prototype.leafAppend = function(e) {
|
|
87
|
+
var n = this.right.leafAppend(e);
|
|
88
|
+
if (n)
|
|
89
|
+
return new t(this.left, n);
|
|
90
|
+
}, t.prototype.leafPrepend = function(e) {
|
|
91
|
+
var n = this.left.leafPrepend(e);
|
|
92
|
+
if (n)
|
|
93
|
+
return new t(n, this.right);
|
|
94
|
+
}, t.prototype.appendInner = function(e) {
|
|
95
|
+
return this.left.depth >= Math.max(this.right.depth, e.depth) + 1 ? new t(this.left, new t(this.right, e)) : new t(this, e);
|
|
96
|
+
}, t;
|
|
97
|
+
})(p);
|
|
4
98
|
export {
|
|
5
|
-
|
|
99
|
+
p as default
|
|
6
100
|
};
|
package/dist/index71.js
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
var t = {
|
|
2
|
+
8: "Backspace",
|
|
3
|
+
9: "Tab",
|
|
4
|
+
10: "Enter",
|
|
5
|
+
12: "NumLock",
|
|
6
|
+
13: "Enter",
|
|
7
|
+
16: "Shift",
|
|
8
|
+
17: "Control",
|
|
9
|
+
18: "Alt",
|
|
10
|
+
20: "CapsLock",
|
|
11
|
+
27: "Escape",
|
|
12
|
+
32: " ",
|
|
13
|
+
33: "PageUp",
|
|
14
|
+
34: "PageDown",
|
|
15
|
+
35: "End",
|
|
16
|
+
36: "Home",
|
|
17
|
+
37: "ArrowLeft",
|
|
18
|
+
38: "ArrowUp",
|
|
19
|
+
39: "ArrowRight",
|
|
20
|
+
40: "ArrowDown",
|
|
21
|
+
44: "PrintScreen",
|
|
22
|
+
45: "Insert",
|
|
23
|
+
46: "Delete",
|
|
24
|
+
59: ";",
|
|
25
|
+
61: "=",
|
|
26
|
+
91: "Meta",
|
|
27
|
+
92: "Meta",
|
|
28
|
+
106: "*",
|
|
29
|
+
107: "+",
|
|
30
|
+
108: ",",
|
|
31
|
+
109: "-",
|
|
32
|
+
110: ".",
|
|
33
|
+
111: "/",
|
|
34
|
+
144: "NumLock",
|
|
35
|
+
145: "ScrollLock",
|
|
36
|
+
160: "Shift",
|
|
37
|
+
161: "Shift",
|
|
38
|
+
162: "Control",
|
|
39
|
+
163: "Control",
|
|
40
|
+
164: "Alt",
|
|
41
|
+
165: "Alt",
|
|
42
|
+
173: "-",
|
|
43
|
+
186: ";",
|
|
44
|
+
187: "=",
|
|
45
|
+
188: ",",
|
|
46
|
+
189: "-",
|
|
47
|
+
190: ".",
|
|
48
|
+
191: "/",
|
|
49
|
+
192: "`",
|
|
50
|
+
219: "[",
|
|
51
|
+
220: "\\",
|
|
52
|
+
221: "]",
|
|
53
|
+
222: "'"
|
|
54
|
+
}, a = {
|
|
55
|
+
48: ")",
|
|
56
|
+
49: "!",
|
|
57
|
+
50: "@",
|
|
58
|
+
51: "#",
|
|
59
|
+
52: "$",
|
|
60
|
+
53: "%",
|
|
61
|
+
54: "^",
|
|
62
|
+
55: "&",
|
|
63
|
+
56: "*",
|
|
64
|
+
57: "(",
|
|
65
|
+
59: ":",
|
|
66
|
+
61: "+",
|
|
67
|
+
173: "_",
|
|
68
|
+
186: ":",
|
|
69
|
+
187: "+",
|
|
70
|
+
188: "<",
|
|
71
|
+
189: "_",
|
|
72
|
+
190: ">",
|
|
73
|
+
191: "?",
|
|
74
|
+
192: "~",
|
|
75
|
+
219: "{",
|
|
76
|
+
220: "|",
|
|
77
|
+
221: "}",
|
|
78
|
+
222: '"'
|
|
79
|
+
}, n = typeof navigator < "u" && /Mac/.test(navigator.platform), y = typeof navigator < "u" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
|
|
80
|
+
for (var r = 0; r < 10; r++) t[48 + r] = t[96 + r] = String(r);
|
|
81
|
+
for (var r = 1; r <= 24; r++) t[r + 111] = "F" + r;
|
|
82
|
+
for (var r = 65; r <= 90; r++)
|
|
83
|
+
t[r] = String.fromCharCode(r + 32), a[r] = String.fromCharCode(r);
|
|
84
|
+
for (var i in t) a.hasOwnProperty(i) || (a[i] = t[i]);
|
|
85
|
+
function g(o) {
|
|
86
|
+
var f = n && o.metaKey && o.shiftKey && !o.ctrlKey && !o.altKey || y && o.shiftKey && o.key && o.key.length == 1 || o.key == "Unidentified", e = !f && o.key || (o.shiftKey ? a : t)[o.keyCode] || o.key || "Unidentified";
|
|
87
|
+
return e == "Esc" && (e = "Escape"), e == "Del" && (e = "Delete"), e == "Left" && (e = "ArrowLeft"), e == "Up" && (e = "ArrowUp"), e == "Right" && (e = "ArrowRight"), e == "Down" && (e = "ArrowDown"), e;
|
|
88
|
+
}
|
|
89
|
+
export {
|
|
90
|
+
t as base,
|
|
91
|
+
g as keyName,
|
|
92
|
+
a as shift
|
|
93
|
+
};
|
package/dist/index72.js
ADDED
package/dist/index8.js
CHANGED
|
@@ -2,7 +2,7 @@ import { Extension as f } from "@tiptap/core";
|
|
|
2
2
|
import p from "@tiptap/extension-drag-handle";
|
|
3
3
|
import { default as B } from "@tiptap/extension-drag-handle";
|
|
4
4
|
import { renderVizelIcon as m } from "./index22.js";
|
|
5
|
-
import { TextSelection as a } from "./
|
|
5
|
+
import { TextSelection as a } from "./index40.js";
|
|
6
6
|
function v(e = {}) {
|
|
7
7
|
const { enabled: o = !0 } = e;
|
|
8
8
|
if (!o)
|