@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/index7.js CHANGED
@@ -1,12 +1,11 @@
1
- import { Graphviz as H } from "@hpcc-js/wasm-graphviz";
2
- import { Node as G, mergeAttributes as S } from "@tiptap/core";
3
- import I from "mermaid";
4
- import { default as Q } from "mermaid";
5
- let $ = 0;
6
- function B() {
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 O = {
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 i = e.match(/^```dot\n([\s\S]*?)```/);
22
- if (i?.[1] !== void 0)
20
+ const r = e.match(/^```dot\n([\s\S]*?)```/);
21
+ if (r?.[1] !== void 0)
23
22
  return {
24
23
  type: "diagram",
25
- raw: i[0],
26
- code: i[1].trim(),
24
+ raw: r[0],
25
+ code: r[1].trim(),
27
26
  diagramType: "graphviz"
28
27
  };
29
- const r = e.match(/^```graphviz\n([\s\S]*?)```/);
30
- if (r?.[1] !== void 0)
28
+ const s = e.match(/^```graphviz\n([\s\S]*?)```/);
29
+ if (s?.[1] !== void 0)
31
30
  return {
32
31
  type: "diagram",
33
- raw: r[0],
34
- code: r[1].trim(),
32
+ raw: s[0],
33
+ code: s[1].trim(),
35
34
  diagramType: "graphviz"
36
35
  };
37
36
  }
38
37
  };
39
- let A = !1;
40
- function P(e) {
41
- A || (I.initialize({
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
- }), A = !0);
44
+ ...e,
45
+ securityLevel: e?.securityLevel ?? "strict"
46
+ }), a.mermaidInitialized = !0;
48
47
  }
49
- let L = null, C = !1, h = null;
50
- function R() {
51
- return L ? Promise.resolve(L) : (C && h || (C = !0, h = H.load().then((e) => (L = e, C = !1, e))), h);
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 V(e) {
55
+ async function N(e) {
54
56
  if (!e.trim())
55
57
  return { svg: "", error: null };
56
58
  try {
57
- const a = B(), { svg: i } = await I.render(a, e);
58
- return { svg: i, error: null };
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 K(e, a = "dot") {
68
+ async function _(e, a = "dot") {
67
69
  if (!e.trim())
68
70
  return { svg: "", error: null };
69
71
  try {
70
- return { svg: (await R()).layout(e, "svg", a), error: null };
71
- } catch (i) {
72
+ return { svg: (await K()).layout(e, "svg", a), error: null };
73
+ } catch (r) {
72
74
  return {
73
75
  svg: "",
74
- error: i instanceof Error ? i.message : "Invalid DOT syntax"
76
+ error: r instanceof Error ? r.message : "Invalid DOT syntax"
75
77
  };
76
78
  }
77
79
  }
78
- const _ = `flowchart TD
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`, F = `digraph G {
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 N = G.create({
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: F
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
- S(e, {
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: i }) => {
157
- P(this.options.mermaidConfig);
158
- const r = document.createElement("div");
159
- r.classList.add("vizel-diagram"), r.setAttribute("data-type", "diagram"), r.setAttribute("data-vizel-diagram", ""), r.setAttribute("contenteditable", "false");
160
- const m = document.createElement("div");
161
- m.classList.add("vizel-diagram-type"), m.textContent = x(e.attrs.type), r.appendChild(m);
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-render"), r.appendChild(l);
164
- const o = document.createElement("div");
165
- o.classList.add("vizel-diagram-edit-container"), o.style.display = "none";
166
- const n = document.createElement("textarea");
167
- n.classList.add("vizel-diagram-textarea"), n.value = e.attrs.code, n.placeholder = "Enter diagram code...", n.spellcheck = !1, o.appendChild(n);
168
- const f = document.createElement("div");
169
- f.classList.add("vizel-diagram-preview"), o.appendChild(f);
170
- const z = document.createElement("div");
171
- z.classList.add("vizel-diagram-error"), z.style.display = "none", o.appendChild(z), r.appendChild(o);
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
- g.innerHTML = '<div class="vizel-diagram-placeholder">Click to add diagram code</div>';
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 v;
179
- d === "graphviz" ? v = await K(t, this.options.graphvizEngine) : v = await V(t), v.error ? g.innerHTML = `<div class="vizel-diagram-error-display">${v.error}</div>` : g.innerHTML = v.svg;
180
- }, T = () => {
181
- i.isEditable && (u = !0, r.classList.add("vizel-diagram-editing"), l.style.display = "none", m.style.display = "none", o.style.display = "", n.value = s, y(s, c, f), n.focus());
182
- }, E = () => {
183
- if (!u) return;
184
- u = !1, r.classList.remove("vizel-diagram-editing"), l.style.display = "", m.style.display = "", o.style.display = "none";
185
- const t = n.value.trim(), d = typeof a == "function" ? a() : null;
186
- d != null && (t === "" && s !== "" ? i.chain().focus().deleteRange({ from: d, to: d + e.nodeSize }).run() : t !== s && (s = t, i.chain().focus().updateAttributes("diagram", { code: t }).run()));
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
- !u && t.target === r && (t.preventDefault(), t.stopPropagation(), T());
201
+ !v && t.target === n && (t.preventDefault(), t.stopPropagation(), w());
189
202
  }, D = (t) => {
190
- t.preventDefault(), t.stopPropagation(), T();
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
- t.key === "Escape" && (t.preventDefault(), n.value = s, E()), t.key === "Enter" && (t.ctrlKey || t.metaKey) && (t.preventDefault(), E());
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 p = null;
198
- const k = () => {
199
- p && clearTimeout(p), p = setTimeout(() => {
200
- y(n.value, c, f);
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 r.addEventListener("click", M), l.addEventListener("click", D), n.addEventListener("blur", w), n.addEventListener("keydown", b), n.addEventListener("input", k), y(s, c, l), {
204
- dom: r,
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 !== c, g = t.attrs.code !== s;
209
- return d && (c = t.attrs.type, m.textContent = x(c)), !u && (g || d) && (s = t.attrs.code, y(s, c, l)), !0;
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
- r.classList.add("vizel-diagram-selected");
225
+ n.classList.add("vizel-diagram-selected");
213
226
  },
214
227
  deselectNode() {
215
- r.classList.remove("vizel-diagram-selected");
228
+ n.classList.remove("vizel-diagram-selected");
216
229
  },
217
230
  destroy() {
218
- p && clearTimeout(p), r.removeEventListener("click", M), l.removeEventListener("click", D), n.removeEventListener("blur", w), n.removeEventListener("keydown", b), n.removeEventListener("input", k);
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: i }) => {
226
- const r = a === "graphviz" ? this.options.defaultGraphvizCode : this.options.defaultCode;
227
- return i.insertContent({
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 || r,
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: O,
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 || "", i = e.attrs?.type || "mermaid";
259
- return i === "mermaid" ? `\`\`\`mermaid
271
+ const a = e.attrs?.code || "", r = e.attrs?.type || "mermaid";
272
+ return r === "mermaid" ? `\`\`\`mermaid
260
273
  ${a}
261
- \`\`\`` : i === "graphviz" ? `\`\`\`dot
274
+ \`\`\`` : r === "graphviz" ? `\`\`\`dot
262
275
  ${a}
263
- \`\`\`` : `\`\`\`${i}
276
+ \`\`\`` : `\`\`\`${r}
264
277
  ${a}
265
278
  \`\`\``;
266
279
  }
267
280
  });
268
- function j(e = {}) {
269
- return N.configure(e);
281
+ function q(e = {}) {
282
+ return j.configure(e);
270
283
  }
271
284
  export {
272
- N as VizelDiagram,
273
- j as createVizelDiagramExtension,
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 e(t) {
2
- return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
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
- e as getDefaultExportFromCjs
99
+ p as default
6
100
  };
@@ -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
+ };
@@ -0,0 +1,6 @@
1
+ function e(t) {
2
+ return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
3
+ }
4
+ export {
5
+ e as getDefaultExportFromCjs
6
+ };
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 "./index38.js";
5
+ import { TextSelection as a } from "./index40.js";
6
6
  function v(e = {}) {
7
7
  const { enabled: o = !0 } = e;
8
8
  if (!o)