@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.
- package/README.md +29 -1
- package/dist/{BarMenu-C9tCdvyV.js → BarMenu-sZGqMjQr.js} +1 -1
- package/dist/components/Menu/BarMenu.js +1 -1
- package/dist/components/Menu/BubbleMenu.js +2 -2
- package/dist/components/Menu/CalloutBubbleMenu.js +64 -64
- package/dist/components/Menu/LinkBubbleMenu.js +16 -16
- package/dist/components/Menu/Mobile/ListOptionBar.js +1 -1
- package/dist/components/Menu/TableBubbleMenu.js +2 -2
- package/dist/components/Menu/linkBubbleMenuPlugin.js +1 -1
- package/dist/components/Scribe/extension/callout.js +2 -5
- package/dist/components/Scribe/extension/emoji/suggest.js +1 -1
- package/dist/components/Scribe/extension/extension-link.js +1 -1
- package/dist/components/Scribe/extension/extension-markdown-paste.js +2 -2
- package/dist/components/Scribe/extension/extension-selectedText.js +1 -1
- package/dist/components/Scribe/extension/external-link-preview/commands.js +38 -38
- package/dist/components/Scribe/extension/external-link-preview/index.d.ts +1 -2
- package/dist/components/Scribe/extension/external-link-preview/index.d.ts.map +1 -1
- package/dist/components/Scribe/extension/external-link-preview/index.js +20 -113
- package/dist/components/Scribe/extension/external-link-preview/node-view.js +6 -6
- package/dist/components/Scribe/extension/external-link-preview/paste.js +5 -5
- package/dist/components/Scribe/extension/external-link-preview/render-html.js +1 -1
- package/dist/components/Scribe/extension/external-link-preview/schema.d.ts +8 -0
- package/dist/components/Scribe/extension/external-link-preview/schema.d.ts.map +1 -0
- package/dist/components/Scribe/extension/external-link-preview/schema.js +100 -0
- package/dist/components/Scribe/extension/index.d.ts +2 -2
- package/dist/components/Scribe/extension/index.d.ts.map +1 -1
- package/dist/components/Scribe/extension/index.js +1 -1
- package/dist/components/Scribe/extension/resizable-table.js +1 -1
- package/dist/components/Scribe/extension/slashCommand/index.js +32 -2
- package/dist/components/Scribe/extension/slashCommand/renderItems.js +1 -1
- package/dist/components/Scribe/extension/tableOfContents.js +1 -1
- package/dist/components/Scribe/index.js +4 -4
- package/dist/{slashCommand-D35jcSNp.js → dist-Bm6rBIf2.js} +101 -110
- package/dist/{dist-DRPH9MfF.js → dist-BrbZZTdj.js} +21 -9
- package/dist/{dist-CkWsQ5Lj.js → dist-jjH04EIX.js} +585 -798
- package/dist/extension-BNjzWzJi.js +57 -0
- package/dist/{extension-link-yMrg9JOz.js → extension-link-7ta0X4tP.js} +2 -2
- package/dist/{html-to-markdown-CnlA8pb8.js → html-to-markdown-pY8ngCXa.js} +14 -14
- package/dist/main.js +6 -6
- package/dist/{markdown-to-html-BLzYd3Fu.js → markdown-to-html-BSuSwB4B.js} +42 -14
- package/dist/{menus-Dy2dj4QT.js → menus-i0cEakC3.js} +137 -135
- package/dist/{resizable-table-D0mls3aB.js → resizable-table-DFTyMlVu.js} +27 -30
- package/dist/{extension-DOo9QT6U.js → schema-extensions-B-U6SbYg.js} +51922 -51962
- package/dist/schema-extensions.d.ts +20 -0
- package/dist/schema-extensions.d.ts.map +1 -0
- package/dist/schema-extensions.js +2 -0
- package/dist/schema.d.ts +17 -0
- package/dist/schema.d.ts.map +1 -0
- package/dist/schema.js +5 -0
- package/dist/utils/html-to-markdown.js +1 -1
- package/dist/utils/index.js +4 -4
- package/dist/utils/markdown-to-html.js +1 -1
- package/package.json +57 -51
|
@@ -1,17 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { a as
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
//#region node_modules/.pnpm/@tiptap+extension-bubble-menu@3.30.
|
|
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
|
-
|
|
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:
|
|
31
|
-
let { doc: a, selection: o } = t, { empty: s } = o, c = !a.textBetween(
|
|
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 =
|
|
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(
|
|
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 &&
|
|
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
|
|
163
|
-
key: typeof e.pluginKey == "string" ? new
|
|
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
|
-
|
|
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.
|
|
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
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
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
|
|
302
|
-
key: typeof e.pluginKey == "string" ? new
|
|
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
|
-
|
|
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.
|
|
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
|
|
342
|
+
return e ?? new _(t);
|
|
341
343
|
}
|
|
342
|
-
var j = typeof window < "u" ?
|
|
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 =
|
|
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 =
|
|
521
|
-
let
|
|
522
|
-
$(
|
|
523
|
-
let { editor:
|
|
524
|
-
updateDelay:
|
|
525
|
-
resizeDelay:
|
|
526
|
-
appendTo:
|
|
527
|
-
pluginKey:
|
|
528
|
-
shouldShow:
|
|
529
|
-
getReferencedVirtualElement:
|
|
530
|
-
options:
|
|
531
|
-
},
|
|
532
|
-
|
|
533
|
-
let [
|
|
534
|
-
return
|
|
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 =
|
|
542
|
+
let e = d.current;
|
|
541
543
|
e.style.visibility = "hidden", e.style.position = "absolute";
|
|
542
544
|
let t = D({
|
|
543
|
-
...
|
|
545
|
+
..._.current,
|
|
544
546
|
editor: h,
|
|
545
547
|
element: e
|
|
546
548
|
});
|
|
547
549
|
h.registerPlugin(t);
|
|
548
|
-
let n =
|
|
549
|
-
return
|
|
550
|
-
|
|
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]),
|
|
555
|
-
if (!(!
|
|
556
|
-
if (
|
|
557
|
-
|
|
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(
|
|
562
|
+
h.view.dispatch(h.state.tr.setMeta(f, {
|
|
561
563
|
type: "updateOptions",
|
|
562
|
-
options:
|
|
564
|
+
options: _.current
|
|
563
565
|
}));
|
|
564
566
|
}
|
|
565
567
|
}, [
|
|
566
|
-
|
|
568
|
+
v,
|
|
567
569
|
h,
|
|
570
|
+
n,
|
|
568
571
|
r,
|
|
569
|
-
i,
|
|
570
|
-
o,
|
|
571
|
-
c,
|
|
572
572
|
a,
|
|
573
573
|
s,
|
|
574
|
-
|
|
575
|
-
|
|
574
|
+
i,
|
|
575
|
+
o,
|
|
576
|
+
f
|
|
577
|
+
]), w(c, d.current);
|
|
576
578
|
});
|
|
577
|
-
|
|
578
|
-
let
|
|
579
|
-
$(
|
|
580
|
-
let { editor:
|
|
581
|
-
updateDelay:
|
|
582
|
-
resizeDelay:
|
|
583
|
-
appendTo:
|
|
584
|
-
pluginKey:
|
|
585
|
-
shouldShow:
|
|
586
|
-
options:
|
|
587
|
-
},
|
|
588
|
-
|
|
589
|
-
let [
|
|
590
|
-
return
|
|
591
|
-
if (
|
|
592
|
-
if (!
|
|
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 =
|
|
598
|
+
let e = u.current;
|
|
597
599
|
e.style.visibility = "hidden", e.style.position = "absolute";
|
|
598
600
|
let t = k({
|
|
599
|
-
...
|
|
600
|
-
editor:
|
|
601
|
+
...g.current,
|
|
602
|
+
editor: p,
|
|
601
603
|
element: e
|
|
602
604
|
});
|
|
603
|
-
|
|
604
|
-
let n =
|
|
605
|
-
return
|
|
606
|
-
|
|
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
|
-
}, [
|
|
611
|
-
if (!(!
|
|
612
|
-
if (
|
|
613
|
-
|
|
612
|
+
}, [p]), b(() => {
|
|
613
|
+
if (!(!_ || !p || p.isDestroyed)) {
|
|
614
|
+
if (y.current) {
|
|
615
|
+
y.current = !1;
|
|
614
616
|
return;
|
|
615
617
|
}
|
|
616
|
-
|
|
618
|
+
p.view.dispatch(p.state.tr.setMeta(d, {
|
|
617
619
|
type: "updateOptions",
|
|
618
|
-
options:
|
|
620
|
+
options: g.current
|
|
619
621
|
}));
|
|
620
622
|
}
|
|
621
623
|
}, [
|
|
622
|
-
|
|
623
|
-
|
|
624
|
+
_,
|
|
625
|
+
p,
|
|
626
|
+
n,
|
|
624
627
|
r,
|
|
625
|
-
i,
|
|
626
|
-
o,
|
|
627
|
-
s,
|
|
628
628
|
a,
|
|
629
|
-
|
|
630
|
-
|
|
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-
|
|
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.
|
|
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
|
-
|
|
130
|
-
let
|
|
131
|
-
|
|
132
|
-
let
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
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
|
-
|
|
139
|
+
c = c.nextSibling;
|
|
141
140
|
} else {
|
|
142
|
-
let e = document.createElement("col"), [n, i] = L(r,
|
|
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 (;
|
|
148
|
-
|
|
149
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 =
|
|
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) =>
|
|
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
|
-
}),
|
|
478
|
+
}), Q = a.create({
|
|
482
479
|
name: "tableKit",
|
|
483
480
|
addExtensions() {
|
|
484
481
|
let e = [];
|
|
485
|
-
return this.options.table !== !1 && e.push(
|
|
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
|
-
}),
|
|
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 {
|
|
504
|
+
export { Q as n, $ as t };
|