@clevertask/scribe 0.1.18 → 0.1.20

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 (53) hide show
  1. package/README.md +29 -1
  2. package/dist/{BarMenu-C9tCdvyV.js → BarMenu-sZGqMjQr.js} +1 -1
  3. package/dist/components/Menu/BarMenu.js +1 -1
  4. package/dist/components/Menu/BubbleMenu.js +2 -2
  5. package/dist/components/Menu/CalloutBubbleMenu.js +64 -64
  6. package/dist/components/Menu/LinkBubbleMenu.js +16 -16
  7. package/dist/components/Menu/Mobile/ListOptionBar.js +1 -1
  8. package/dist/components/Menu/TableBubbleMenu.js +2 -2
  9. package/dist/components/Menu/linkBubbleMenuPlugin.js +1 -1
  10. package/dist/components/Scribe/extension/callout.js +2 -5
  11. package/dist/components/Scribe/extension/emoji/suggest.js +1 -1
  12. package/dist/components/Scribe/extension/extension-link.js +1 -1
  13. package/dist/components/Scribe/extension/extension-markdown-paste.js +2 -2
  14. package/dist/components/Scribe/extension/extension-selectedText.js +1 -1
  15. package/dist/components/Scribe/extension/external-link-preview/commands.js +38 -38
  16. package/dist/components/Scribe/extension/external-link-preview/index.d.ts +1 -2
  17. package/dist/components/Scribe/extension/external-link-preview/index.d.ts.map +1 -1
  18. package/dist/components/Scribe/extension/external-link-preview/index.js +20 -113
  19. package/dist/components/Scribe/extension/external-link-preview/node-view.js +6 -6
  20. package/dist/components/Scribe/extension/external-link-preview/paste.js +5 -5
  21. package/dist/components/Scribe/extension/external-link-preview/render-html.js +1 -1
  22. package/dist/components/Scribe/extension/external-link-preview/schema.d.ts +8 -0
  23. package/dist/components/Scribe/extension/external-link-preview/schema.d.ts.map +1 -0
  24. package/dist/components/Scribe/extension/external-link-preview/schema.js +100 -0
  25. package/dist/components/Scribe/extension/index.d.ts +2 -2
  26. package/dist/components/Scribe/extension/index.d.ts.map +1 -1
  27. package/dist/components/Scribe/extension/index.js +1 -1
  28. package/dist/components/Scribe/extension/resizable-table.js +1 -1
  29. package/dist/components/Scribe/extension/slashCommand/index.js +32 -2
  30. package/dist/components/Scribe/extension/slashCommand/renderItems.js +1 -1
  31. package/dist/components/Scribe/extension/tableOfContents.js +1 -1
  32. package/dist/components/Scribe/index.js +4 -4
  33. package/dist/{slashCommand-D35jcSNp.js → dist-Bm6rBIf2.js} +101 -110
  34. package/dist/{dist-DRPH9MfF.js → dist-BrbZZTdj.js} +21 -9
  35. package/dist/{dist-CkWsQ5Lj.js → dist-jjH04EIX.js} +585 -798
  36. package/dist/extension-BNjzWzJi.js +57 -0
  37. package/dist/{extension-link-yMrg9JOz.js → extension-link-7ta0X4tP.js} +2 -2
  38. package/dist/{html-to-markdown-CnlA8pb8.js → html-to-markdown-pY8ngCXa.js} +14 -14
  39. package/dist/main.js +6 -6
  40. package/dist/{markdown-to-html-BLzYd3Fu.js → markdown-to-html-BSuSwB4B.js} +42 -14
  41. package/dist/{menus-Dy2dj4QT.js → menus-i0cEakC3.js} +137 -135
  42. package/dist/{resizable-table-D0mls3aB.js → resizable-table-DFTyMlVu.js} +27 -30
  43. package/dist/{extension-DOo9QT6U.js → schema-extensions-B-U6SbYg.js} +51922 -51962
  44. package/dist/schema-extensions.d.ts +20 -0
  45. package/dist/schema-extensions.d.ts.map +1 -0
  46. package/dist/schema-extensions.js +2 -0
  47. package/dist/schema.d.ts +17 -0
  48. package/dist/schema.d.ts.map +1 -0
  49. package/dist/schema.js +5 -0
  50. package/dist/utils/html-to-markdown.js +1 -1
  51. package/dist/utils/index.js +4 -4
  52. package/dist/utils/markdown-to-html.js +1 -1
  53. package/package.json +57 -51
@@ -1,17 +1,48 @@
1
- import { a as e } from "./dist-DRPH9MfF.js";
2
- import { B as t, E as n, P as r, T as i, n as a } from "./dist-CkWsQ5Lj.js";
3
- import { a as o, c as s, i as c, l, n as u, o as d, s as f, t as p, u as m } from "./floating-ui.dom-CmJ6iBdh.js";
4
- import h, { useEffect as g, useLayoutEffect as _, useRef as v, useState as y } from "react";
5
- import { createPortal as b } from "react-dom";
6
- import { NodeSelection as x, Plugin as S, PluginKey as C } from "@tiptap/pm/state";
7
- import { CellSelection as w } from "@tiptap/pm/tables";
8
- //#region node_modules/.pnpm/@tiptap+extension-bubble-menu@3.30.2_@tiptap+core@3.30.2_@tiptap+pm@3.30.2__@tiptap+pm@3.30.2/node_modules/@tiptap/extension-bubble-menu/dist/index.js
1
+ import { B as e, E as t, P as n, T as r, n as i } from "./dist-jjH04EIX.js";
2
+ import { a, c as o, i as s, l as c, n as l, o as u, s as d, t as f, u as p } from "./floating-ui.dom-CmJ6iBdh.js";
3
+ import { a as m } from "./dist-BrbZZTdj.js";
4
+ import { NodeSelection as h, Plugin as g, PluginKey as _ } from "@tiptap/pm/state";
5
+ import { CellSelection as v } from "@tiptap/pm/tables";
6
+ import y, { useEffect as b, useLayoutEffect as x, useRef as S, useState as C } from "react";
7
+ import { createPortal as w } from "react-dom";
8
+ //#region node_modules/.pnpm/@tiptap+extension-bubble-menu@3.30.5_@tiptap+core@3.30.5_@tiptap+pm@3.30.5__@tiptap+pm@3.30.5/node_modules/@tiptap/extension-bubble-menu/dist/index.js
9
9
  function T(e, t) {
10
10
  let n = Math.min(e.top, t.top), r = Math.max(e.bottom, t.bottom), i = Math.min(e.left, t.left), a = Math.max(e.right, t.right) - i, o = r - n;
11
11
  return new DOMRect(i, n, a, o);
12
12
  }
13
13
  var E = class {
14
- constructor({ editor: e, element: t, view: n, pluginKey: i = "bubbleMenu", updateDelay: a = 250, resizeDelay: o = 60, shouldShow: s, appendTo: c, getReferencedVirtualElement: l, options: u }) {
14
+ get middlewares() {
15
+ let e = [];
16
+ return this.floatingUIOptions.flip && e.push(a(typeof this.floatingUIOptions.flip == "boolean" ? void 0 : this.floatingUIOptions.flip)), this.floatingUIOptions.shift && e.push(c(typeof this.floatingUIOptions.shift == "boolean" ? void 0 : this.floatingUIOptions.shift)), this.floatingUIOptions.offset && e.push(o(typeof this.floatingUIOptions.offset == "boolean" ? void 0 : this.floatingUIOptions.offset)), this.floatingUIOptions.arrow && e.push(f(this.floatingUIOptions.arrow)), this.floatingUIOptions.size && e.push(p(typeof this.floatingUIOptions.size == "boolean" ? void 0 : this.floatingUIOptions.size)), this.floatingUIOptions.autoPlacement && e.push(l(typeof this.floatingUIOptions.autoPlacement == "boolean" ? void 0 : this.floatingUIOptions.autoPlacement)), this.floatingUIOptions.hide && e.push(u(typeof this.floatingUIOptions.hide == "boolean" ? void 0 : this.floatingUIOptions.hide)), this.floatingUIOptions.inline && e.push(d(typeof this.floatingUIOptions.inline == "boolean" ? void 0 : this.floatingUIOptions.inline)), e;
17
+ }
18
+ get virtualElement() {
19
+ var t;
20
+ let { selection: n } = this.editor.state, r = this.getReferencedVirtualElement?.call(this);
21
+ if (r) return r;
22
+ if (!((t = this.view) != null && (t = t.dom) != null && t.parentNode)) return;
23
+ let i = e(this.view, n.from, n.to), a = {
24
+ getBoundingClientRect: () => i,
25
+ getClientRects: () => [i]
26
+ };
27
+ if (n instanceof h) {
28
+ let e = this.view.nodeDOM(n.from), t = e.dataset.nodeViewWrapper ? e : e.querySelector("[data-node-view-wrapper]");
29
+ t && (e = t), e && (a = {
30
+ getBoundingClientRect: () => e.getBoundingClientRect(),
31
+ getClientRects: () => [e.getBoundingClientRect()]
32
+ });
33
+ }
34
+ if (n instanceof v) {
35
+ let { $anchorCell: e, $headCell: t } = n, r = e ? e.pos : t.pos, i = t ? t.pos : e.pos, o = this.view.nodeDOM(r), s = this.view.nodeDOM(i);
36
+ if (!o || !s) return;
37
+ let c = o === s ? o.getBoundingClientRect() : T(o.getBoundingClientRect(), s.getBoundingClientRect());
38
+ a = {
39
+ getBoundingClientRect: () => c,
40
+ getClientRects: () => [c]
41
+ };
42
+ }
43
+ return a;
44
+ }
45
+ constructor({ editor: e, element: t, view: r, pluginKey: i = "bubbleMenu", updateDelay: a = 250, resizeDelay: o = 60, shouldShow: s, appendTo: c, getReferencedVirtualElement: l, options: u }) {
15
46
  this.preventHide = !1, this.isVisible = !1, this.scrollTarget = window, this.floatingUIOptions = {
16
47
  strategy: "absolute",
17
48
  placement: "top",
@@ -27,8 +58,8 @@ var E = class {
27
58
  onHide: void 0,
28
59
  onUpdate: void 0,
29
60
  onDestroy: void 0
30
- }, this.shouldShow = ({ view: e, state: t, from: n, to: i }) => {
31
- let { doc: a, selection: o } = t, { empty: s } = o, c = !a.textBetween(n, i).length && r(t.selection), l = this.element.contains(document.activeElement);
61
+ }, this.shouldShow = ({ view: e, state: t, from: r, to: i }) => {
62
+ let { doc: a, selection: o } = t, { empty: s } = o, c = !a.textBetween(r, i).length && n(t.selection), l = this.element.contains(document.activeElement);
32
63
  return !(!(e.hasFocus() || l) || s || c || !this.editor.isEditable);
33
64
  }, this.mousedownHandler = () => {
34
65
  this.preventHide = !0;
@@ -67,45 +98,15 @@ var E = class {
67
98
  }, this.transactionHandler = ({ transaction: e }) => {
68
99
  let t = e.getMeta(this.pluginKey);
69
100
  t === "updatePosition" ? this.updatePosition() : t && typeof t == "object" && t.type === "updateOptions" ? this.updateOptions(t.options) : t === "hide" ? this.hide() : t === "show" && (this.updatePosition(), this.show());
70
- }, this.editor = e, this.element = t, this.view = n, this.pluginKey = i, this.updateDelay = a, this.resizeDelay = o, this.appendTo = c, this.scrollTarget = u?.scrollTarget ?? window, this.getReferencedVirtualElement = l, this.floatingUIOptions = {
101
+ }, this.editor = e, this.element = t, this.view = r, this.pluginKey = i, this.updateDelay = a, this.resizeDelay = o, this.appendTo = c, this.scrollTarget = u?.scrollTarget ?? window, this.getReferencedVirtualElement = l, this.floatingUIOptions = {
71
102
  ...this.floatingUIOptions,
72
103
  ...u
73
- }, this.element.tabIndex = 0, s && (this.shouldShow = s), this.element.addEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.view.dom.addEventListener("dragstart", this.dragstartHandler), this.editor.on("focus", this.focusHandler), this.editor.on("blur", this.blurHandler), this.editor.on("transaction", this.transactionHandler), window.addEventListener("resize", this.resizeHandler), this.scrollTarget.addEventListener("scroll", this.resizeHandler), this.update(n, n.state), this.getShouldShow() && (this.show(), this.updatePosition());
74
- }
75
- get middlewares() {
76
- let e = [];
77
- return this.floatingUIOptions.flip && e.push(o(typeof this.floatingUIOptions.flip == "boolean" ? void 0 : this.floatingUIOptions.flip)), this.floatingUIOptions.shift && e.push(l(typeof this.floatingUIOptions.shift == "boolean" ? void 0 : this.floatingUIOptions.shift)), this.floatingUIOptions.offset && e.push(s(typeof this.floatingUIOptions.offset == "boolean" ? void 0 : this.floatingUIOptions.offset)), this.floatingUIOptions.arrow && e.push(p(this.floatingUIOptions.arrow)), this.floatingUIOptions.size && e.push(m(typeof this.floatingUIOptions.size == "boolean" ? void 0 : this.floatingUIOptions.size)), this.floatingUIOptions.autoPlacement && e.push(u(typeof this.floatingUIOptions.autoPlacement == "boolean" ? void 0 : this.floatingUIOptions.autoPlacement)), this.floatingUIOptions.hide && e.push(d(typeof this.floatingUIOptions.hide == "boolean" ? void 0 : this.floatingUIOptions.hide)), this.floatingUIOptions.inline && e.push(f(typeof this.floatingUIOptions.inline == "boolean" ? void 0 : this.floatingUIOptions.inline)), e;
78
- }
79
- get virtualElement() {
80
- let { selection: e } = this.editor.state, n = this.getReferencedVirtualElement?.call(this);
81
- if (n) return n;
82
- if (!this.view?.dom?.parentNode) return;
83
- let r = t(this.view, e.from, e.to), i = {
84
- getBoundingClientRect: () => r,
85
- getClientRects: () => [r]
86
- };
87
- if (e instanceof x) {
88
- let t = this.view.nodeDOM(e.from), n = t.dataset.nodeViewWrapper ? t : t.querySelector("[data-node-view-wrapper]");
89
- n && (t = n), t && (i = {
90
- getBoundingClientRect: () => t.getBoundingClientRect(),
91
- getClientRects: () => [t.getBoundingClientRect()]
92
- });
93
- }
94
- if (e instanceof w) {
95
- let { $anchorCell: t, $headCell: n } = e, r = t ? t.pos : n.pos, a = n ? n.pos : t.pos, o = this.view.nodeDOM(r), s = this.view.nodeDOM(a);
96
- if (!o || !s) return;
97
- let c = o === s ? o.getBoundingClientRect() : T(o.getBoundingClientRect(), s.getBoundingClientRect());
98
- i = {
99
- getBoundingClientRect: () => c,
100
- getClientRects: () => [c]
101
- };
102
- }
103
- return i;
104
+ }, this.element.tabIndex = 0, s && (this.shouldShow = s), this.element.addEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.view.dom.addEventListener("dragstart", this.dragstartHandler), this.editor.on("focus", this.focusHandler), this.editor.on("blur", this.blurHandler), this.editor.on("transaction", this.transactionHandler), window.addEventListener("resize", this.resizeHandler), this.scrollTarget.addEventListener("scroll", this.resizeHandler), this.update(r, r.state), this.getShouldShow() && (this.show(), this.updatePosition());
104
105
  }
105
106
  updatePosition() {
106
107
  if (!this.isVisible) return;
107
108
  let e = this.virtualElement;
108
- e && c(e, this.element, {
109
+ e && s(e, this.element, {
109
110
  placement: this.floatingUIOptions.placement,
110
111
  strategy: this.floatingUIOptions.strategy,
111
112
  middleware: this.middlewares
@@ -159,14 +160,14 @@ var E = class {
159
160
  destroy() {
160
161
  this.hide(), this.element.removeEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.view.dom.removeEventListener("dragstart", this.dragstartHandler), window.removeEventListener("resize", this.resizeHandler), this.scrollTarget.removeEventListener("scroll", this.resizeHandler), this.editor.off("focus", this.focusHandler), this.editor.off("blur", this.blurHandler), this.editor.off("transaction", this.transactionHandler), this.floatingUIOptions.onDestroy && this.floatingUIOptions.onDestroy();
161
162
  }
162
- }, D = (e) => new S({
163
- key: typeof e.pluginKey == "string" ? new C(e.pluginKey) : e.pluginKey,
163
+ }, D = (e) => new g({
164
+ key: typeof e.pluginKey == "string" ? new _(e.pluginKey) : e.pluginKey,
164
165
  view: (t) => new E({
165
166
  view: t,
166
167
  ...e
167
168
  })
168
169
  });
169
- a.create({
170
+ i.create({
170
171
  name: "bubbleMenu",
171
172
  addOptions() {
172
173
  return {
@@ -191,8 +192,15 @@ a.create({
191
192
  }
192
193
  });
193
194
  //#endregion
194
- //#region node_modules/.pnpm/@tiptap+extension-floating-menu@3.30.2_@floating-ui+dom@1.8.0_@tiptap+core@3.30.2_@tiptap+pm@3.30.2__@tiptap+pm@3.30.2/node_modules/@tiptap/extension-floating-menu/dist/index.js
195
+ //#region node_modules/.pnpm/@tiptap+extension-floating-menu@3.30.5_@floating-ui+dom@1.8.0_@tiptap+core@3.30.5_@tiptap+pm@3.30.5__@tiptap+pm@3.30.5/node_modules/@tiptap/extension-floating-menu/dist/index.js
195
196
  var O = class {
197
+ getTextContent(e) {
198
+ return r(e, { textSerializers: t(this.editor.schema) });
199
+ }
200
+ get middlewares() {
201
+ let e = [];
202
+ return this.floatingUIOptions.flip && e.push(a(typeof this.floatingUIOptions.flip == "boolean" ? void 0 : this.floatingUIOptions.flip)), this.floatingUIOptions.shift && e.push(c(typeof this.floatingUIOptions.shift == "boolean" ? void 0 : this.floatingUIOptions.shift)), this.floatingUIOptions.offset && e.push(o(typeof this.floatingUIOptions.offset == "boolean" ? void 0 : this.floatingUIOptions.offset)), this.floatingUIOptions.arrow && e.push(f(this.floatingUIOptions.arrow)), this.floatingUIOptions.size && e.push(p(typeof this.floatingUIOptions.size == "boolean" ? void 0 : this.floatingUIOptions.size)), this.floatingUIOptions.autoPlacement && e.push(l(typeof this.floatingUIOptions.autoPlacement == "boolean" ? void 0 : this.floatingUIOptions.autoPlacement)), this.floatingUIOptions.hide && e.push(u(typeof this.floatingUIOptions.hide == "boolean" ? void 0 : this.floatingUIOptions.hide)), this.floatingUIOptions.inline && e.push(d(typeof this.floatingUIOptions.inline == "boolean" ? void 0 : this.floatingUIOptions.inline)), e;
203
+ }
196
204
  constructor({ editor: e, element: t, view: n, pluginKey: r = "floatingMenu", updateDelay: i = 250, resizeDelay: a = 60, options: o, appendTo: s, shouldShow: c }) {
197
205
  this.preventHide = !1, this.isVisible = !1, this.scrollTarget = window, this.shouldShow = ({ view: e, state: t }) => {
198
206
  let { selection: n } = t, { $anchor: r, empty: i } = n, a = r.depth === 1, o = r.parent.isTextblock && !r.parent.type.spec.code && !r.parent.textContent && r.parent.childCount === 0 && !this.getTextContent(r.parent);
@@ -239,13 +247,6 @@ var O = class {
239
247
  ...o
240
248
  }, this.element.tabIndex = 0, c && (this.shouldShow = c), this.element.addEventListener("mousedown", this.mousedownHandler, { capture: !0 }), this.editor.on("focus", this.focusHandler), this.editor.on("blur", this.blurHandler), this.editor.on("transaction", this.transactionHandler), window.addEventListener("resize", this.resizeHandler), this.scrollTarget.addEventListener("scroll", this.resizeHandler), this.update(n, n.state), this.getShouldShow() && (this.show(), this.updatePosition());
241
249
  }
242
- getTextContent(e) {
243
- return i(e, { textSerializers: n(this.editor.schema) });
244
- }
245
- get middlewares() {
246
- let e = [];
247
- return this.floatingUIOptions.flip && e.push(o(typeof this.floatingUIOptions.flip == "boolean" ? void 0 : this.floatingUIOptions.flip)), this.floatingUIOptions.shift && e.push(l(typeof this.floatingUIOptions.shift == "boolean" ? void 0 : this.floatingUIOptions.shift)), this.floatingUIOptions.offset && e.push(s(typeof this.floatingUIOptions.offset == "boolean" ? void 0 : this.floatingUIOptions.offset)), this.floatingUIOptions.arrow && e.push(p(this.floatingUIOptions.arrow)), this.floatingUIOptions.size && e.push(m(typeof this.floatingUIOptions.size == "boolean" ? void 0 : this.floatingUIOptions.size)), this.floatingUIOptions.autoPlacement && e.push(u(typeof this.floatingUIOptions.autoPlacement == "boolean" ? void 0 : this.floatingUIOptions.autoPlacement)), this.floatingUIOptions.hide && e.push(d(typeof this.floatingUIOptions.hide == "boolean" ? void 0 : this.floatingUIOptions.hide)), this.floatingUIOptions.inline && e.push(f(typeof this.floatingUIOptions.inline == "boolean" ? void 0 : this.floatingUIOptions.inline)), e;
248
- }
249
250
  getShouldShow(e) {
250
251
  let { state: t } = this.view, { selection: n } = t, { ranges: r } = n, i = Math.min(...r.map((e) => e.$from.pos)), a = Math.max(...r.map((e) => e.$to.pos));
251
252
  return this.shouldShow?.call(this, {
@@ -267,11 +268,12 @@ var O = class {
267
268
  }
268
269
  }
269
270
  updatePosition() {
270
- if (!this.view?.dom?.parentNode) return;
271
- let { selection: e } = this.editor.state, n = t(this.view, e.from, e.to);
272
- c({
273
- getBoundingClientRect: () => n,
274
- getClientRects: () => [n]
271
+ var t;
272
+ if (!((t = this.view) != null && (t = t.dom) != null && t.parentNode)) return;
273
+ let { selection: n } = this.editor.state, r = e(this.view, n.from, n.to);
274
+ s({
275
+ getBoundingClientRect: () => r,
276
+ getClientRects: () => [r]
275
277
  }, this.element, {
276
278
  placement: this.floatingUIOptions.placement,
277
279
  strategy: this.floatingUIOptions.strategy,
@@ -298,14 +300,14 @@ var O = class {
298
300
  destroy() {
299
301
  this.hide(), this.element.removeEventListener("mousedown", this.mousedownHandler, { capture: !0 }), window.removeEventListener("resize", this.resizeHandler), this.scrollTarget.removeEventListener("scroll", this.resizeHandler), this.editor.off("focus", this.focusHandler), this.editor.off("blur", this.blurHandler), this.editor.off("transaction", this.transactionHandler), this.floatingUIOptions.onDestroy && this.floatingUIOptions.onDestroy();
300
302
  }
301
- }, k = (e) => new S({
302
- key: typeof e.pluginKey == "string" ? new C(e.pluginKey) : e.pluginKey,
303
+ }, k = (e) => new g({
304
+ key: typeof e.pluginKey == "string" ? new _(e.pluginKey) : e.pluginKey,
303
305
  view: (t) => new O({
304
306
  view: t,
305
307
  ...e
306
308
  })
307
309
  });
308
- a.create({
310
+ i.create({
309
311
  name: "floatingMenu",
310
312
  addOptions() {
311
313
  return {
@@ -335,11 +337,11 @@ a.create({
335
337
  }
336
338
  });
337
339
  //#endregion
338
- //#region node_modules/.pnpm/@tiptap+react@3.30.2_@floating-ui+dom@1.8.0_@tiptap+core@3.30.2_@tiptap+pm@3.30.2__@tip_864597464ea99af6963241e56e6f20f3/node_modules/@tiptap/react/dist/menus/index.js
340
+ //#region node_modules/.pnpm/@tiptap+react@3.30.5_@floating-ui+dom@1.8.0_@tiptap+core@3.30.5_@tiptap+pm@3.30.5__@tip_f1a3a0af408a84792a1625eaf41c3e23/node_modules/@tiptap/react/dist/menus/index.js
339
341
  function A(e, t) {
340
- return e ?? new C(t);
342
+ return e ?? new _(t);
341
343
  }
342
- var j = typeof window < "u" ? _ : g, M = /* @__PURE__ */ new Set([
344
+ var j = typeof window < "u" ? x : b, M = /* @__PURE__ */ new Set([
343
345
  "left",
344
346
  "opacity",
345
347
  "position",
@@ -507,7 +509,7 @@ function Q(e, t, n) {
507
509
  }), r;
508
510
  }
509
511
  function $(e, t) {
510
- let n = v({}), r = v([]);
512
+ let n = S({}), r = S([]);
511
513
  j(() => {
512
514
  let i = n.current;
513
515
  return X(e, i.className, t.className), Z(e, i.style, t.style), Y(e, i, t), r.current = Q(e, r.current, t), n.current = t, () => {
@@ -517,117 +519,117 @@ function $(e, t) {
517
519
  };
518
520
  }, [e, t]);
519
521
  }
520
- var te = h.forwardRef(({ pluginKey: t, editor: n, updateDelay: r, resizeDelay: i, appendTo: a, shouldShow: o = null, getReferencedVirtualElement: s, options: c, children: l, ...u }, d) => {
521
- let f = v(document.createElement("div")), p = v(A(t, "bubbleMenu")).current;
522
- $(f.current, u), typeof d == "function" ? d(f.current) : d && (d.current = f.current);
523
- let { editor: m } = e(), h = n || m, _ = {
524
- updateDelay: r,
525
- resizeDelay: i,
526
- appendTo: a,
527
- pluginKey: p,
528
- shouldShow: o,
529
- getReferencedVirtualElement: s,
530
- options: c
531
- }, x = v(_);
532
- x.current = _;
533
- let [S, C] = y(!1), w = v(!0);
534
- return g(() => {
522
+ var te = y.forwardRef(({ pluginKey: e, editor: t, updateDelay: n, resizeDelay: r, appendTo: i, shouldShow: a = null, getReferencedVirtualElement: o, options: s, children: c, ...l }, u) => {
523
+ let d = S(document.createElement("div")), f = S(A(e, "bubbleMenu")).current;
524
+ $(d.current, l), typeof u == "function" ? u(d.current) : u && (u.current = d.current);
525
+ let { editor: p } = m(), h = t || p, g = {
526
+ updateDelay: n,
527
+ resizeDelay: r,
528
+ appendTo: i,
529
+ pluginKey: f,
530
+ shouldShow: a,
531
+ getReferencedVirtualElement: o,
532
+ options: s
533
+ }, _ = S(g);
534
+ _.current = g;
535
+ let [v, y] = C(!1), x = S(!0);
536
+ return b(() => {
535
537
  if (h?.isDestroyed) return;
536
538
  if (!h) {
537
539
  console.warn("BubbleMenu component is not rendered inside of an editor component or does not have editor prop.");
538
540
  return;
539
541
  }
540
- let e = f.current;
542
+ let e = d.current;
541
543
  e.style.visibility = "hidden", e.style.position = "absolute";
542
544
  let t = D({
543
- ...x.current,
545
+ ..._.current,
544
546
  editor: h,
545
547
  element: e
546
548
  });
547
549
  h.registerPlugin(t);
548
- let n = x.current.pluginKey;
549
- return w.current = !0, C(!0), () => {
550
- C(!1), h.unregisterPlugin(n), window.requestAnimationFrame(() => {
550
+ let n = _.current.pluginKey;
551
+ return x.current = !0, y(!0), () => {
552
+ y(!1), h.unregisterPlugin(n), window.requestAnimationFrame(() => {
551
553
  e.parentNode && e.parentNode.removeChild(e);
552
554
  });
553
555
  };
554
- }, [h]), g(() => {
555
- if (!(!S || !h || h.isDestroyed)) {
556
- if (w.current) {
557
- w.current = !1;
556
+ }, [h]), b(() => {
557
+ if (!(!v || !h || h.isDestroyed)) {
558
+ if (x.current) {
559
+ x.current = !1;
558
560
  return;
559
561
  }
560
- h.view.dispatch(h.state.tr.setMeta(p, {
562
+ h.view.dispatch(h.state.tr.setMeta(f, {
561
563
  type: "updateOptions",
562
- options: x.current
564
+ options: _.current
563
565
  }));
564
566
  }
565
567
  }, [
566
- S,
568
+ v,
567
569
  h,
570
+ n,
568
571
  r,
569
- i,
570
- o,
571
- c,
572
572
  a,
573
573
  s,
574
- p
575
- ]), b(l, f.current);
574
+ i,
575
+ o,
576
+ f
577
+ ]), w(c, d.current);
576
578
  });
577
- h.forwardRef(({ pluginKey: t, editor: n, updateDelay: r, resizeDelay: i, appendTo: a, shouldShow: o = null, options: s, children: c, ...l }, u) => {
578
- let d = v(document.createElement("div")), f = v(A(t, "floatingMenu")).current;
579
- $(d.current, l), typeof u == "function" ? u(d.current) : u && (u.current = d.current);
580
- let { editor: p } = e(), m = n || p, h = {
581
- updateDelay: r,
582
- resizeDelay: i,
583
- appendTo: a,
584
- pluginKey: f,
585
- shouldShow: o,
586
- options: s
587
- }, _ = v(h);
588
- _.current = h;
589
- let [x, S] = y(!1), C = v(!0);
590
- return g(() => {
591
- if (m?.isDestroyed) return;
592
- if (!m) {
579
+ y.forwardRef(({ pluginKey: e, editor: t, updateDelay: n, resizeDelay: r, appendTo: i, shouldShow: a = null, options: o, children: s, ...c }, l) => {
580
+ let u = S(document.createElement("div")), d = S(A(e, "floatingMenu")).current;
581
+ $(u.current, c), typeof l == "function" ? l(u.current) : l && (l.current = u.current);
582
+ let { editor: f } = m(), p = t || f, h = {
583
+ updateDelay: n,
584
+ resizeDelay: r,
585
+ appendTo: i,
586
+ pluginKey: d,
587
+ shouldShow: a,
588
+ options: o
589
+ }, g = S(h);
590
+ g.current = h;
591
+ let [_, v] = C(!1), y = S(!0);
592
+ return b(() => {
593
+ if (p?.isDestroyed) return;
594
+ if (!p) {
593
595
  console.warn("FloatingMenu component is not rendered inside of an editor component or does not have editor prop.");
594
596
  return;
595
597
  }
596
- let e = d.current;
598
+ let e = u.current;
597
599
  e.style.visibility = "hidden", e.style.position = "absolute";
598
600
  let t = k({
599
- ..._.current,
600
- editor: m,
601
+ ...g.current,
602
+ editor: p,
601
603
  element: e
602
604
  });
603
- m.registerPlugin(t);
604
- let n = _.current.pluginKey;
605
- return C.current = !0, S(!0), () => {
606
- S(!1), m.unregisterPlugin(n), window.requestAnimationFrame(() => {
605
+ p.registerPlugin(t);
606
+ let n = g.current.pluginKey;
607
+ return y.current = !0, v(!0), () => {
608
+ v(!1), p.unregisterPlugin(n), window.requestAnimationFrame(() => {
607
609
  e.parentNode && e.parentNode.removeChild(e);
608
610
  });
609
611
  };
610
- }, [m]), g(() => {
611
- if (!(!x || !m || m.isDestroyed)) {
612
- if (C.current) {
613
- C.current = !1;
612
+ }, [p]), b(() => {
613
+ if (!(!_ || !p || p.isDestroyed)) {
614
+ if (y.current) {
615
+ y.current = !1;
614
616
  return;
615
617
  }
616
- m.view.dispatch(m.state.tr.setMeta(f, {
618
+ p.view.dispatch(p.state.tr.setMeta(d, {
617
619
  type: "updateOptions",
618
- options: _.current
620
+ options: g.current
619
621
  }));
620
622
  }
621
623
  }, [
622
- x,
623
- m,
624
+ _,
625
+ p,
626
+ n,
624
627
  r,
625
- i,
626
- o,
627
- s,
628
628
  a,
629
- f
630
- ]), b(c, d.current);
629
+ o,
630
+ i,
631
+ d
632
+ ]), w(s, u.current);
631
633
  });
632
634
  //#endregion
633
635
  export { te as t };
@@ -1,7 +1,7 @@
1
- import { L as e, _ as t, a as n, l as r, m as i, n as a } from "./dist-CkWsQ5Lj.js";
1
+ import { L as e, _ as t, a as n, l as r, m as i, n as a } from "./dist-jjH04EIX.js";
2
2
  import { TextSelection as o } from "@tiptap/pm/state";
3
3
  import { CellSelection as s, addColumnAfter as c, addColumnBefore as l, addRowAfter as u, addRowBefore as d, columnResizing as f, columnResizingPluginKey as p, deleteColumn as m, deleteRow as h, deleteTable as g, fixTables as _, goToNextCell as v, mergeCells as y, setCellAttr as b, splitCell as x, tableEditing as S, toggleHeader as C, toggleHeaderCell as w } from "@tiptap/pm/tables";
4
- //#region node_modules/.pnpm/@tiptap+extension-table@3.30.2_@tiptap+core@3.30.2_@tiptap+pm@3.30.2__@tiptap+pm@3.30.2/node_modules/@tiptap/extension-table/dist/index.js
4
+ //#region node_modules/.pnpm/@tiptap+extension-table@3.30.5_@tiptap+core@3.30.5_@tiptap+pm@3.30.5__@tiptap+pm@3.30.5/node_modules/@tiptap/extension-table/dist/index.js
5
5
  function T(e) {
6
6
  return e === "left" || e === "right" || e === "center" ? e : null;
7
7
  }
@@ -126,30 +126,30 @@ function L(e, t) {
126
126
  return t ? ["width", `${Math.max(t, e)}px`] : ["min-width", `${e}px`];
127
127
  }
128
128
  function R(e, t, n, r, i, a) {
129
- var o;
130
- let s = 0, c = !0, l = t.firstChild, u = e.firstChild;
131
- if (u !== null) for (let e = 0, n = 0; e < u.childCount; e += 1) {
132
- let { colspan: o, colwidth: d } = u.child(e).attrs;
133
- for (let e = 0; e < o; e += 1, n += 1) {
134
- let o = i === n ? a : d && d[e], u = o ? `${o}px` : "";
135
- if (s += o || r, o || (c = !1), l) {
136
- if (l.style.width !== u) {
137
- let [e, t] = L(r, o);
138
- l.style.setProperty(e, t);
129
+ let o = 0, s = !0, c = t.firstChild, l = e.firstChild;
130
+ if (l !== null) for (let e = 0, n = 0; e < l.childCount; e += 1) {
131
+ let { colspan: u, colwidth: d } = l.child(e).attrs;
132
+ for (let e = 0; e < u; e += 1, n += 1) {
133
+ let l = i === n ? a : d && d[e], u = l ? `${l}px` : "";
134
+ if (o += l || r, l || (s = !1), c) {
135
+ if (c.style.width !== u) {
136
+ let [e, t] = L(r, l);
137
+ c.style.setProperty(e, t);
139
138
  }
140
- l = l.nextSibling;
139
+ c = c.nextSibling;
141
140
  } else {
142
- let e = document.createElement("col"), [n, i] = L(r, o);
141
+ let e = document.createElement("col"), [n, i] = L(r, l);
143
142
  e.style.setProperty(n, i), t.appendChild(e);
144
143
  }
145
144
  }
146
145
  }
147
- for (; l;) {
148
- let e = l.nextSibling;
149
- (o = l.parentNode) == null || o.removeChild(l), l = e;
146
+ for (; c;) {
147
+ var u;
148
+ let e = c.nextSibling;
149
+ (u = c.parentNode) == null || u.removeChild(c), c = e;
150
150
  }
151
151
  let d = e.attrs.style && typeof e.attrs.style == "string" && /\bwidth\s*:/i.test(e.attrs.style);
152
- c && !d ? (n.style.width = `${s}px`, n.style.minWidth = "") : (n.style.width = "", n.style.minWidth = `${s}px`);
152
+ s && !d ? (n.style.width = `${o}px`, n.style.minWidth = "") : (n.style.width = "", n.style.minWidth = `${o}px`);
153
153
  }
154
154
  var z = class {
155
155
  constructor(e, t, n, r = {}) {
@@ -301,17 +301,14 @@ function X(e, t, n = {}) {
301
301
  for (let t = 0; t < a; t += 1) !u[t] && e[t]?.align && (u[t] = e[t].align);
302
302
  });
303
303
  let d = "\n", f = Array.from({ length: a }).map((e, t) => l && c[t] && c[t].text || "");
304
- return d += `| ${f.map((e, t) => s(e, o[t])).join(" | ")} |
305
- `, d += `| ${o.map((e, t) => {
304
+ return d += `| ${f.map((e, t) => s(e, o[t])).join(" | ")} |\n`, d += `| ${o.map((e, t) => {
306
305
  let n = Math.max(3, e), r = u[t];
307
306
  return r === "left" ? `:${"-".repeat(n)}` : r === "right" ? `${"-".repeat(n)}:` : r === "center" ? `:${"-".repeat(n)}:` : "-".repeat(n);
308
- }).join(" | ")} |
309
- `, (l ? i.slice(1) : i).forEach((e) => {
310
- d += `| ${Array.from({ length: a }).fill(0).map((t, n) => s(e[n] && e[n].text || "", o[n])).join(" | ")} |
311
- `;
307
+ }).join(" | ")} |\n`, (l ? i.slice(1) : i).forEach((e) => {
308
+ d += `| ${Array.from({ length: a }).fill(0).map((t, n) => s(e[n] && e[n].text || "", o[n])).join(" | ")} |\n`;
312
309
  }), d;
313
310
  }
314
- var Z = X, Q = n.create({
311
+ var Z = n.create({
315
312
  name: "table",
316
313
  addOptions() {
317
314
  return {
@@ -372,7 +369,7 @@ var Z = X, Q = n.create({
372
369
  }), n.push(t.createNode("tableRow", {}, i));
373
370
  }), t.createNode("table", void 0, n);
374
371
  },
375
- renderMarkdown: (e, t) => Z(e, t),
372
+ renderMarkdown: (e, t) => X(e, t),
376
373
  markdownTokenizer: {
377
374
  name: "table",
378
375
  level: "block",
@@ -478,13 +475,13 @@ var Z = X, Q = n.create({
478
475
  };
479
476
  return { tableRole: r(t(e, "tableRole", n)) };
480
477
  }
481
- }), $ = a.create({
478
+ }), Q = a.create({
482
479
  name: "tableKit",
483
480
  addExtensions() {
484
481
  let e = [];
485
- return this.options.table !== !1 && e.push(Q.configure(this.options.table)), this.options.tableCell !== !1 && e.push(P.configure(this.options.tableCell)), this.options.tableHeader !== !1 && e.push(F.configure(this.options.tableHeader)), this.options.tableRow !== !1 && e.push(I.configure(this.options.tableRow)), e;
482
+ return this.options.table !== !1 && e.push(Z.configure(this.options.table)), this.options.tableCell !== !1 && e.push(P.configure(this.options.tableCell)), this.options.tableHeader !== !1 && e.push(F.configure(this.options.tableHeader)), this.options.tableRow !== !1 && e.push(I.configure(this.options.tableRow)), e;
486
483
  }
487
- }), ee = Q.extend({
484
+ }), $ = Z.extend({
488
485
  onUpdate() {
489
486
  if (this.editor.isEditable) return;
490
487
  let e = p.getState(this.editor.state);
@@ -504,4 +501,4 @@ var Z = X, Q = n.create({
504
501
  }
505
502
  }).configure({ resizable: !0 });
506
503
  //#endregion
507
- export { $ as n, ee as t };
504
+ export { Q as n, $ as t };