@clevertask/scribe 0.1.6 → 0.1.7
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 +1 -0
- package/dist/{BarMenu-CXaFlpRJ.js → BarMenu-DC-S5Ggq.js} +1 -1
- package/dist/components/Menu/BarMenu.js +1 -1
- package/dist/components/Menu/BubbleMenu.js +2 -2
- package/dist/components/Menu/LinkBubbleMenu.js +2 -2
- package/dist/components/Menu/Mobile/ListOptionBar.js +1 -1
- package/dist/components/Scribe/extension/emoji/suggest.js +1 -1
- package/dist/components/Scribe/extension/slashCommand/renderItems.js +1 -1
- package/dist/components/Scribe/index.d.ts +4 -0
- package/dist/components/Scribe/index.d.ts.map +1 -1
- package/dist/components/Scribe/index.js +110 -75
- package/dist/{dist-Cp938P7P.js → dist-DT3iiwSr.js} +280 -144
- package/dist/{menus-CakIdDdY.js → menus-CrKTaPWU.js} +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -186,6 +186,7 @@ If your content arrives as HTML (for example from a server), use the helper belo
|
|
|
186
186
|
| `editable` | `boolean` | `true` | Controls whether the editor is editable. |
|
|
187
187
|
| `autoFocus` | `boolean` | `false` | Controls whether the editor should automatically focus when mounted. |
|
|
188
188
|
| `extensions` | `Extension[]` | `undefined` | You can set your own extensions for the text editor. For more information, [check the tip tap extensions docs](https://tiptap.dev/docs/editor/core-concepts/extensions) |
|
|
189
|
+
| `externalEditor` | `Editor` | `undefined` | Uses a caller-owned Tiptap editor. Scribe attaches the editor but does not destroy it. The caller remains responsible for destroying it. |
|
|
189
190
|
| `editorProps` | `EditorProps` | `undefined` | A tiptap-based prop to handle advanced use cases, you can read about it on their [documentation](https://tiptap.dev/docs/editor/api/editor#editorprops) |
|
|
190
191
|
| `showBarMenu` | `boolean` | `true` | Determines whether to show the text editor top menu bar or not. This menu bar shows options to format the text |
|
|
191
192
|
| `placeholderText` | `string` | `Type "/" for commands...` | Change the initial placeholder for your text editor |
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as e } from "./dist-DT3iiwSr.js";
|
|
2
2
|
import { getPopupMountTarget as t } from "./components/Scribe/extension/getPopupMountTarget.js";
|
|
3
3
|
import n from "./components/Menu/LinkEditor.js";
|
|
4
4
|
import { hideLinkBubbleMenu as r } from "./components/Menu/linkBubbleMenuPlugin.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../BarMenu-
|
|
1
|
+
import { t as e } from "../../BarMenu-DC-S5Ggq.js";
|
|
2
2
|
export { e as default };
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as e } from "../../dist-DT3iiwSr.js";
|
|
2
2
|
import { getPopupMountTarget as t } from "../Scribe/extension/getPopupMountTarget.js";
|
|
3
|
-
import { t as n } from "../../menus-
|
|
3
|
+
import { t as n } from "../../menus-CrKTaPWU.js";
|
|
4
4
|
import { Flex as r, IconButton as i } from "@radix-ui/themes";
|
|
5
5
|
import { useCallback as a } from "react";
|
|
6
6
|
import { jsx as o } from "react/jsx-runtime";
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { a as e } from "../../dist-DT3iiwSr.js";
|
|
2
2
|
import { getPopupMountTarget as t } from "../Scribe/extension/getPopupMountTarget.js";
|
|
3
3
|
import n from "./LinkEditor.js";
|
|
4
4
|
import { hideLinkBubbleMenu as r, linkBubbleMenuPluginKey as i } from "./linkBubbleMenuPlugin.js";
|
|
5
|
-
import { t as a } from "../../menus-
|
|
5
|
+
import { t as a } from "../../menus-CrKTaPWU.js";
|
|
6
6
|
import { Box as o } from "@radix-ui/themes";
|
|
7
7
|
import { useCallback as s, useEffect as c, useMemo as l, useRef as u, useState as d } from "react";
|
|
8
8
|
import { jsx as f } from "react/jsx-runtime";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as e } from "../../../../dist-
|
|
1
|
+
import { n as e } from "../../../../dist-DT3iiwSr.js";
|
|
2
2
|
import { getPopupMountTarget as t } from "../getPopupMountTarget.js";
|
|
3
3
|
import { t as n } from "../../../../tippy.esm-D9LL2xiE.js";
|
|
4
4
|
import { EmojiList as r } from "./EmojiList.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as e } from "../../../../dist-
|
|
1
|
+
import { n as e } from "../../../../dist-DT3iiwSr.js";
|
|
2
2
|
import { getPopupMountTarget as t } from "../getPopupMountTarget.js";
|
|
3
3
|
import { t as n } from "../../../../tippy.esm-D9LL2xiE.js";
|
|
4
4
|
import { SlashCommandList as r } from "./SlashCommandList.js";
|
|
@@ -31,6 +31,10 @@ export interface ScribeProps {
|
|
|
31
31
|
editable?: boolean;
|
|
32
32
|
autoFocus?: boolean;
|
|
33
33
|
extensions?: Extension[];
|
|
34
|
+
/**
|
|
35
|
+
* A caller-owned editor. Scribe attaches it without taking responsibility
|
|
36
|
+
* for destroying it.
|
|
37
|
+
*/
|
|
34
38
|
externalEditor?: Editor;
|
|
35
39
|
editorProps?: UseEditorOptions;
|
|
36
40
|
showBarMenu?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/Scribe/index.tsx"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAG9B,OAAO,EAAE,UAAU,EAAQ,MAAM,MAAM,CAAC;AAGxC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAE1E,OAAO,KAAK,EACV,kCAAkC,EAElC,iCAAiC,EAClC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,OAAO,EACP,MAAM,EAGN,SAAS,EACT,WAAW,EACX,gBAAgB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../lib/components/Scribe/index.tsx"],"names":[],"mappings":"AAAA,OAAO,sBAAsB,CAAC;AAG9B,OAAO,EAAE,UAAU,EAAQ,MAAM,MAAM,CAAC;AAGxC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,0BAA0B,CAAC;AAE1E,OAAO,KAAK,EACV,kCAAkC,EAElC,iCAAiC,EAClC,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,OAAO,EACP,MAAM,EAGN,SAAS,EACT,WAAW,EACX,gBAAgB,EAEjB,MAAM,eAAe,CAAC;AACvB,OAAO,EAEL,oBAAoB,EAMrB,MAAM,OAAO,CAAC;AAGf,YAAY,EACV,yBAAyB,EACzB,mBAAmB,EACnB,yBAAyB,EACzB,8BAA8B,EAC9B,cAAc,GACf,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACpE,YAAY,EACV,kCAAkC,EAClC,yBAAyB,EACzB,iCAAiC,GAClC,MAAM,6BAA6B,CAAC;AAErC,MAAM,MAAM,sBAAsB,GAAG;IACnC,WAAW,EAAE,OAAO,CAAC;IACrB,WAAW,EAAE,OAAO,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,GAAG,cAAc,CAAC;CACjC,CAAC;AAEF,MAAM,WAAW,SAAS;IACxB,YAAY,EAAE,MAAM,IAAI,CAAC;IACzB,UAAU,EAAE,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,GAAG,UAAU,KAAK,MAAM,GAAG,WAAW,GAAG,SAAS,CAAC;IAC5F,UAAU,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAAI,CAAC;IACvC,2FAA2F;IAC3F,2BAA2B,EAAE,CAAC,MAAM,EAAE,iCAAiC,KAAK,IAAI,CAAC;IACjF,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,WAAW;IAC1B,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,sBAAsB,KAAK,IAAI,CAAC;IAC5D;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC;IACzB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,gBAAgB,CAAC;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kBAAkB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACzC,sBAAsB,CAAC,EAAE,UAAU,CAAC;IACpC,kBAAkB,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IACzC,sBAAsB,CAAC,EAAE,UAAU,CAAC;IACpC,SAAS,CAAC,EAAE,oBAAoB,CAAC;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB;;;OAGG;IACH,YAAY,CAAC,EAAE,yBAAyB,CAAC;IACzC,sEAAsE;IACtE,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,mFAAmF;IACnF,uBAAuB,CAAC,EAAE,kCAAkC,CAAC;CAC9D;AAoQD,eAAO,MAAM,MAAM,mGAMlB,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { n as e, t } from "../../BarMenu-
|
|
2
|
-
import {
|
|
3
|
-
import { t as r } from "../../dist-BQjH-i-q.js";
|
|
1
|
+
import { n as e, t } from "../../BarMenu-DC-S5Ggq.js";
|
|
2
|
+
import { i as n, t as r } from "../../dist-DT3iiwSr.js";
|
|
4
3
|
import i from "../Menu/LinkBubbleMenu.js";
|
|
5
4
|
import { t as a } from "../../html-to-markdown-CrNOkSye.js";
|
|
6
5
|
import { t as o } from "../../extension-CZOsheCI.js";
|
|
@@ -11,98 +10,90 @@ import { ListOptionBar as c } from "../Menu/Mobile/ListOptionBar.js";
|
|
|
11
10
|
import { forwardRef as l, useCallback as u, useEffect as d, useImperativeHandle as f, useRef as p, useState as m } from "react";
|
|
12
11
|
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
13
12
|
import '../../assets/index.css';//#region lib/components/Scribe/index.tsx
|
|
14
|
-
var _ =
|
|
15
|
-
let
|
|
16
|
-
d(() => {
|
|
17
|
-
|
|
18
|
-
}, [
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
13
|
+
var _ = (e) => {
|
|
14
|
+
let t = p([]), n = p(e);
|
|
15
|
+
return d(() => {
|
|
16
|
+
n.current = e;
|
|
17
|
+
}, [e]), {
|
|
18
|
+
handleTableOfContentsChange: u((e, r) => {
|
|
19
|
+
t.current = e, n.current?.(e, r);
|
|
20
|
+
}, []),
|
|
21
|
+
tableOfContentsItemsRef: t
|
|
22
|
+
};
|
|
23
|
+
}, v = l((n, o) => {
|
|
24
|
+
let { autoFocus: s = !1, content: l, editable: m = !0, editor: _, initialContentWasApplied: v, onContentChange: y, showBarMenu: b = !0, editorContentStyle: x, editorContentClassName: S, mainContainerStyle: C, mainContainerClassName: w, onKeyDown: T, mobile: E, tableOfContentsItemsRef: D } = n, O = p(v && l !== void 0), k = u(({ editor: e, transaction: t }) => {
|
|
22
25
|
if (t.getMeta("scribeTableOfContents")) return;
|
|
23
|
-
let n = e.getHTML(), r = e.getJSON(), i = !
|
|
24
|
-
|
|
26
|
+
let n = e.getHTML(), r = e.getJSON(), i = !m;
|
|
27
|
+
y && y({
|
|
25
28
|
jsonContent: e.isEmpty ? "" : r,
|
|
26
29
|
htmlContent: e.isEmpty ? "" : n,
|
|
27
30
|
markdownContent: e.isEmpty ? "" : a(n),
|
|
28
31
|
source: i ? "programmatic" : "user"
|
|
29
32
|
});
|
|
30
|
-
}, [
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
html: () => L.getHTML(),
|
|
46
|
-
json: () => L.getJSON(),
|
|
47
|
-
markdown: () => a(L.getHTML())
|
|
48
|
-
}[e]?.(), [L]), B = u((e) => {
|
|
49
|
-
L.commands.setContent(e);
|
|
50
|
-
}, [L]), V = u((e) => {
|
|
51
|
-
let t = typeof e == "string" ? e : e.id, n = N.current.find((e) => e.id === t) ?? (typeof e == "string" ? void 0 : e);
|
|
52
|
-
if (!n || L.isDestroyed) return;
|
|
53
|
-
let r = L.view.nodeDOM(n.pos), i = r instanceof HTMLElement ? r : n.dom;
|
|
54
|
-
if (L.isEditable) {
|
|
55
|
-
let e = Math.max(0, Math.min(n.pos + n.node.nodeSize - 1, L.state.doc.content.size));
|
|
56
|
-
L.commands.focus(e, { scrollIntoView: !1 });
|
|
33
|
+
}, [m, y]), A = u(() => {
|
|
34
|
+
_.commands.setContent("");
|
|
35
|
+
}, [_]), j = u((e) => _.isEmpty ? "" : {
|
|
36
|
+
html: () => _.getHTML(),
|
|
37
|
+
json: () => _.getJSON(),
|
|
38
|
+
markdown: () => a(_.getHTML())
|
|
39
|
+
}[e]?.(), [_]), M = u((e) => {
|
|
40
|
+
_.commands.setContent(e);
|
|
41
|
+
}, [_]), N = u((e) => {
|
|
42
|
+
let t = typeof e == "string" ? e : e.id, n = D.current.find((e) => e.id === t) ?? (typeof e == "string" ? void 0 : e);
|
|
43
|
+
if (!n || _.isDestroyed) return;
|
|
44
|
+
let r = _.view.nodeDOM(n.pos), i = r instanceof HTMLElement ? r : n.dom;
|
|
45
|
+
if (_.isEditable) {
|
|
46
|
+
let e = Math.max(0, Math.min(n.pos + n.node.nodeSize - 1, _.state.doc.content.size));
|
|
47
|
+
_.commands.focus(e, { scrollIntoView: !1 });
|
|
57
48
|
}
|
|
58
49
|
i.scrollIntoView({
|
|
59
50
|
behavior: "smooth",
|
|
60
51
|
block: "start"
|
|
61
52
|
});
|
|
62
|
-
}, [
|
|
63
|
-
return f(
|
|
64
|
-
resetContent:
|
|
65
|
-
setContent:
|
|
66
|
-
getContent:
|
|
67
|
-
scrollToTableOfContentsItem:
|
|
68
|
-
editor:
|
|
53
|
+
}, [_, D]);
|
|
54
|
+
return f(o, () => ({
|
|
55
|
+
resetContent: A,
|
|
56
|
+
setContent: M,
|
|
57
|
+
getContent: j,
|
|
58
|
+
scrollToTableOfContentsItem: N,
|
|
59
|
+
editor: _
|
|
69
60
|
}), [
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
61
|
+
_,
|
|
62
|
+
j,
|
|
63
|
+
A,
|
|
64
|
+
N,
|
|
65
|
+
M
|
|
75
66
|
]), d(() => {
|
|
76
|
-
if (
|
|
77
|
-
if (
|
|
78
|
-
|
|
67
|
+
if (l !== void 0) {
|
|
68
|
+
if (O.current) {
|
|
69
|
+
O.current = !1;
|
|
79
70
|
return;
|
|
80
71
|
}
|
|
81
|
-
|
|
72
|
+
_.commands.setContent(l, { emitUpdate: !1 });
|
|
82
73
|
}
|
|
83
|
-
}, [
|
|
84
|
-
|
|
85
|
-
}, [
|
|
86
|
-
|
|
87
|
-
}), [
|
|
88
|
-
|
|
89
|
-
}, [
|
|
90
|
-
className: e("scribe-wrapper", "scribe-root",
|
|
74
|
+
}, [l, _]), d(() => {
|
|
75
|
+
_.setEditable(!!m);
|
|
76
|
+
}, [m, _]), d(() => (_.off("update"), _.on("update", k), () => {
|
|
77
|
+
_.off("update", k);
|
|
78
|
+
}), [_, k]), d(() => {
|
|
79
|
+
s && _.commands.focus("end");
|
|
80
|
+
}, [s, _]), /* @__PURE__ */ g("div", {
|
|
81
|
+
className: e("scribe-wrapper", "scribe-root", w),
|
|
91
82
|
"data-scribe-root": !0,
|
|
92
|
-
style:
|
|
83
|
+
style: C,
|
|
93
84
|
children: [/* @__PURE__ */ g("div", {
|
|
94
|
-
className: e("scribe-frame",
|
|
85
|
+
className: e("scribe-frame", m && "scribe-frame--editable"),
|
|
95
86
|
children: [
|
|
96
|
-
|
|
87
|
+
_ && b ? /* @__PURE__ */ h(t, { editor: _ }) : null,
|
|
97
88
|
/* @__PURE__ */ g("div", {
|
|
98
|
-
className: e("scribe-content",
|
|
99
|
-
style:
|
|
100
|
-
children: [/* @__PURE__ */ h(
|
|
101
|
-
editor:
|
|
102
|
-
onKeyDown:
|
|
103
|
-
}),
|
|
89
|
+
className: e("scribe-content", m && "scribe-content--editable", S),
|
|
90
|
+
style: x,
|
|
91
|
+
children: [/* @__PURE__ */ h(r, {
|
|
92
|
+
editor: _,
|
|
93
|
+
onKeyDown: T
|
|
94
|
+
}), m ? /* @__PURE__ */ h(i, { editor: _ }) : null]
|
|
104
95
|
}),
|
|
105
|
-
|
|
96
|
+
E ? /* @__PURE__ */ h(c, { editor: _ }) : null
|
|
106
97
|
]
|
|
107
98
|
}), /* @__PURE__ */ h("div", {
|
|
108
99
|
className: "scribe-popup-root",
|
|
@@ -110,5 +101,49 @@ var _ = l((s, l) => {
|
|
|
110
101
|
})]
|
|
111
102
|
});
|
|
112
103
|
});
|
|
104
|
+
v.displayName = "ScribeEditor";
|
|
105
|
+
var y = l((e, t) => {
|
|
106
|
+
let { content: r, editable: i = !0, editorProps: a, extensions: s, onTableOfContentsChange: c } = e, { handleTableOfContentsChange: l, tableOfContentsItemsRef: u } = _(c), [d] = m(() => ({
|
|
107
|
+
...a,
|
|
108
|
+
content: r ?? a?.content,
|
|
109
|
+
editable: i,
|
|
110
|
+
extensions: [...o({
|
|
111
|
+
...e,
|
|
112
|
+
onTableOfContentsChange: l
|
|
113
|
+
}), ...s ?? []],
|
|
114
|
+
editorProps: {
|
|
115
|
+
attributes: { class: "scribe" },
|
|
116
|
+
...a?.editorProps
|
|
117
|
+
},
|
|
118
|
+
shouldRerenderOnTransaction: a?.shouldRerenderOnTransaction ?? !1
|
|
119
|
+
})), f = n(d);
|
|
120
|
+
return f ? /* @__PURE__ */ h(v, {
|
|
121
|
+
...e,
|
|
122
|
+
ref: t,
|
|
123
|
+
editor: f,
|
|
124
|
+
initialContentWasApplied: !0,
|
|
125
|
+
tableOfContentsItemsRef: u
|
|
126
|
+
}) : null;
|
|
127
|
+
});
|
|
128
|
+
y.displayName = "OwnedScribe";
|
|
129
|
+
var b = l((e, t) => {
|
|
130
|
+
let { externalEditor: n, onTableOfContentsChange: r } = e, { tableOfContentsItemsRef: i } = _(r);
|
|
131
|
+
return n ? /* @__PURE__ */ h(v, {
|
|
132
|
+
...e,
|
|
133
|
+
ref: t,
|
|
134
|
+
editor: n,
|
|
135
|
+
initialContentWasApplied: !1,
|
|
136
|
+
tableOfContentsItemsRef: i
|
|
137
|
+
}) : null;
|
|
138
|
+
});
|
|
139
|
+
b.displayName = "ExternalScribe";
|
|
140
|
+
var x = l((e, t) => e.externalEditor ? /* @__PURE__ */ h(b, {
|
|
141
|
+
...e,
|
|
142
|
+
ref: t
|
|
143
|
+
}) : /* @__PURE__ */ h(y, {
|
|
144
|
+
...e,
|
|
145
|
+
ref: t
|
|
146
|
+
}));
|
|
147
|
+
x.displayName = "Scribe";
|
|
113
148
|
//#endregion
|
|
114
|
-
export {
|
|
149
|
+
export { x as Scribe, s as SuggestionItemType };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-CtkjhSXr.js";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
2
|
+
import { t } from "./dist-BQjH-i-q.js";
|
|
3
|
+
import * as n from "react";
|
|
4
|
+
import r, { createContext as i, forwardRef as a, useContext as o, useDebugValue as s, useEffect as c, useLayoutEffect as l, useMemo as u, useRef as d, useState as f, version as p } from "react";
|
|
5
|
+
import m, { flushSync as h } from "react-dom";
|
|
6
|
+
import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
|
|
6
7
|
//#region builtin:esm-external-require-react
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
})),
|
|
10
|
-
var t =
|
|
8
|
+
var y = /* @__PURE__ */ e(((e, t) => {
|
|
9
|
+
t.exports = { ...n };
|
|
10
|
+
})), b = /* @__PURE__ */ e(((e) => {
|
|
11
|
+
var t = y();
|
|
11
12
|
function n(e, t) {
|
|
12
13
|
return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
|
|
13
14
|
}
|
|
@@ -44,7 +45,7 @@ var _ = /* @__PURE__ */ e(((e, n) => {
|
|
|
44
45
|
}
|
|
45
46
|
var d = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? u : c;
|
|
46
47
|
e.useSyncExternalStore = t.useSyncExternalStore === void 0 ? d : t.useSyncExternalStore;
|
|
47
|
-
})),
|
|
48
|
+
})), ee = /* @__PURE__ */ e(((e) => {
|
|
48
49
|
process.env.NODE_ENV !== "production" && (function() {
|
|
49
50
|
function t(e, t) {
|
|
50
51
|
return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
|
|
@@ -87,18 +88,18 @@ var _ = /* @__PURE__ */ e(((e, n) => {
|
|
|
87
88
|
return t();
|
|
88
89
|
}
|
|
89
90
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
90
|
-
var a =
|
|
91
|
+
var a = y(), o = typeof Object.is == "function" ? Object.is : t, s = a.useState, c = a.useEffect, l = a.useLayoutEffect, u = a.useDebugValue, d = !1, f = !1, p = typeof window > "u" || window.document === void 0 || window.document.createElement === void 0 ? i : n;
|
|
91
92
|
e.useSyncExternalStore = a.useSyncExternalStore === void 0 ? p : a.useSyncExternalStore, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
92
93
|
})();
|
|
93
|
-
})),
|
|
94
|
-
process.env.NODE_ENV === "production" ? t.exports =
|
|
95
|
-
})),
|
|
96
|
-
function
|
|
94
|
+
})), x = /* @__PURE__ */ e(((e, t) => {
|
|
95
|
+
process.env.NODE_ENV === "production" ? t.exports = b() : t.exports = ee();
|
|
96
|
+
})), S = x(), { getOwnPropertyNames: te, getOwnPropertySymbols: C } = Object, { hasOwnProperty: w } = Object.prototype;
|
|
97
|
+
function T(e, t) {
|
|
97
98
|
return function(n, r, i) {
|
|
98
99
|
return e(n, r, i) && t(n, r, i);
|
|
99
100
|
};
|
|
100
101
|
}
|
|
101
|
-
function
|
|
102
|
+
function E(e) {
|
|
102
103
|
return function(t, n, r) {
|
|
103
104
|
if (!t || !n || typeof t != "object" || typeof n != "object") return e(t, n, r);
|
|
104
105
|
let { cache: i } = r, a = i.get(t), o = i.get(n);
|
|
@@ -108,39 +109,39 @@ function w(e) {
|
|
|
108
109
|
return i.delete(t), i.delete(n), s;
|
|
109
110
|
};
|
|
110
111
|
}
|
|
111
|
-
function
|
|
112
|
+
function ne(e) {
|
|
112
113
|
return e?.[Symbol.toStringTag];
|
|
113
114
|
}
|
|
114
|
-
function
|
|
115
|
-
return te(e).concat(
|
|
115
|
+
function D(e) {
|
|
116
|
+
return te(e).concat(C(e));
|
|
116
117
|
}
|
|
117
|
-
var
|
|
118
|
-
function
|
|
118
|
+
var O = Object.hasOwn || ((e, t) => w.call(e, t));
|
|
119
|
+
function k(e, t) {
|
|
119
120
|
return e === t || !e && !t && e !== e && t !== t;
|
|
120
121
|
}
|
|
121
|
-
var
|
|
122
|
-
function
|
|
123
|
-
return e.byteLength === t.byteLength &&
|
|
122
|
+
var A = "__v", re = "__o", ie = "_owner", { getOwnPropertyDescriptor: j, keys: M } = Object;
|
|
123
|
+
function ae(e, t) {
|
|
124
|
+
return e.byteLength === t.byteLength && R(new Uint8Array(e), new Uint8Array(t));
|
|
124
125
|
}
|
|
125
|
-
function
|
|
126
|
+
function oe(e, t, n) {
|
|
126
127
|
let r = e.length;
|
|
127
128
|
if (t.length !== r) return !1;
|
|
128
129
|
for (; r-- > 0;) if (!n.equals(e[r], t[r], r, r, e, t, n)) return !1;
|
|
129
130
|
return !0;
|
|
130
131
|
}
|
|
131
|
-
function oe(e, t) {
|
|
132
|
-
return e.byteLength === t.byteLength && z(new Uint8Array(e.buffer, e.byteOffset, e.byteLength), new Uint8Array(t.buffer, t.byteOffset, t.byteLength));
|
|
133
|
-
}
|
|
134
132
|
function se(e, t) {
|
|
135
|
-
return
|
|
133
|
+
return e.byteLength === t.byteLength && R(new Uint8Array(e.buffer, e.byteOffset, e.byteLength), new Uint8Array(t.buffer, t.byteOffset, t.byteLength));
|
|
136
134
|
}
|
|
137
135
|
function ce(e, t) {
|
|
138
|
-
return e.
|
|
136
|
+
return k(e.getTime(), t.getTime());
|
|
139
137
|
}
|
|
140
138
|
function le(e, t) {
|
|
139
|
+
return e.name === t.name && e.message === t.message && e.cause === t.cause && e.stack === t.stack;
|
|
140
|
+
}
|
|
141
|
+
function ue(e, t) {
|
|
141
142
|
return e === t;
|
|
142
143
|
}
|
|
143
|
-
function
|
|
144
|
+
function N(e, t, n) {
|
|
144
145
|
let r = e.size;
|
|
145
146
|
if (r !== t.size) return !1;
|
|
146
147
|
if (!r) return !0;
|
|
@@ -164,27 +165,27 @@ function M(e, t, n) {
|
|
|
164
165
|
}
|
|
165
166
|
return !0;
|
|
166
167
|
}
|
|
167
|
-
var
|
|
168
|
-
function
|
|
169
|
-
let r =
|
|
170
|
-
if (
|
|
171
|
-
for (; i-- > 0;) if (!
|
|
168
|
+
var de = k;
|
|
169
|
+
function fe(e, t, n) {
|
|
170
|
+
let r = M(e), i = r.length;
|
|
171
|
+
if (M(t).length !== i) return !1;
|
|
172
|
+
for (; i-- > 0;) if (!B(e, t, n, r[i])) return !1;
|
|
172
173
|
return !0;
|
|
173
174
|
}
|
|
174
|
-
function
|
|
175
|
-
let r =
|
|
176
|
-
if (
|
|
175
|
+
function P(e, t, n) {
|
|
176
|
+
let r = D(e), i = r.length;
|
|
177
|
+
if (D(t).length !== i) return !1;
|
|
177
178
|
let a, o, s;
|
|
178
|
-
for (; i-- > 0;) if (a = r[i], !
|
|
179
|
+
for (; i-- > 0;) if (a = r[i], !B(e, t, n, a) || (o = j(e, a), s = j(t, a), (o || s) && (!o || !s || o.configurable !== s.configurable || o.enumerable !== s.enumerable || o.writable !== s.writable))) return !1;
|
|
179
180
|
return !0;
|
|
180
181
|
}
|
|
181
|
-
function
|
|
182
|
-
return
|
|
182
|
+
function F(e, t) {
|
|
183
|
+
return k(e.valueOf(), t.valueOf());
|
|
183
184
|
}
|
|
184
|
-
function
|
|
185
|
+
function I(e, t) {
|
|
185
186
|
return e.source === t.source && e.flags === t.flags;
|
|
186
187
|
}
|
|
187
|
-
function
|
|
188
|
+
function L(e, t, n) {
|
|
188
189
|
let r = e.size;
|
|
189
190
|
if (r !== t.size) return !1;
|
|
190
191
|
if (!r) return !0;
|
|
@@ -202,19 +203,19 @@ function R(e, t, n) {
|
|
|
202
203
|
}
|
|
203
204
|
return !0;
|
|
204
205
|
}
|
|
205
|
-
function
|
|
206
|
+
function R(e, t) {
|
|
206
207
|
let n = e.byteLength;
|
|
207
208
|
if (t.byteLength !== n || e.byteOffset !== t.byteOffset) return !1;
|
|
208
209
|
for (; n-- > 0;) if (e[n] !== t[n]) return !1;
|
|
209
210
|
return !0;
|
|
210
211
|
}
|
|
211
|
-
function
|
|
212
|
+
function z(e, t) {
|
|
212
213
|
return e.hostname === t.hostname && e.pathname === t.pathname && e.protocol === t.protocol && e.port === t.port && e.hash === t.hash && e.username === t.username && e.password === t.password;
|
|
213
214
|
}
|
|
214
|
-
function
|
|
215
|
-
return (r ===
|
|
215
|
+
function B(e, t, n, r) {
|
|
216
|
+
return (r === ie || r === re || r === A) && (e.$$typeof || t.$$typeof) ? !0 : O(t, r) && n.equals(e[r], t[r], r, r, e, t, n);
|
|
216
217
|
}
|
|
217
|
-
var
|
|
218
|
+
var V = "[object ArrayBuffer]", pe = "[object Arguments]", me = "[object Boolean]", he = "[object DataView]", ge = "[object Date]", _e = "[object Error]", ve = "[object Map]", ye = "[object Number]", be = "[object Object]", xe = "[object RegExp]", Se = "[object Set]", Ce = "[object String]", we = {
|
|
218
219
|
"[object Int8Array]": !0,
|
|
219
220
|
"[object Uint8Array]": !0,
|
|
220
221
|
"[object Uint8ClampedArray]": !0,
|
|
@@ -227,8 +228,8 @@ var H = "[object ArrayBuffer]", U = "[object Arguments]", W = "[object Boolean]"
|
|
|
227
228
|
"[object Float64Array]": !0,
|
|
228
229
|
"[object BigInt64Array]": !0,
|
|
229
230
|
"[object BigUint64Array]": !0
|
|
230
|
-
},
|
|
231
|
-
function
|
|
231
|
+
}, Te = "[object URL]", Ee = Object.prototype.toString;
|
|
232
|
+
function De({ areArrayBuffersEqual: e, areArraysEqual: t, areDataViewsEqual: n, areDatesEqual: r, areErrorsEqual: i, areFunctionsEqual: a, areMapsEqual: o, areNumbersEqual: s, areObjectsEqual: c, arePrimitiveWrappersEqual: l, areRegExpsEqual: u, areSetsEqual: d, areTypedArraysEqual: f, areUrlsEqual: p, unknownTagComparators: m }) {
|
|
232
233
|
return function(h, g, _) {
|
|
233
234
|
if (h === g) return !0;
|
|
234
235
|
if (h == null || g == null) return !1;
|
|
@@ -243,23 +244,23 @@ function Se({ areArrayBuffersEqual: e, areArraysEqual: t, areDataViewsEqual: n,
|
|
|
243
244
|
if (y === RegExp) return u(h, g, _);
|
|
244
245
|
if (y === Map) return o(h, g, _);
|
|
245
246
|
if (y === Set) return d(h, g, _);
|
|
246
|
-
let b =
|
|
247
|
-
if (b ===
|
|
248
|
-
if (b ===
|
|
249
|
-
if (b ===
|
|
250
|
-
if (b ===
|
|
251
|
-
if (b ===
|
|
252
|
-
if (b ===
|
|
253
|
-
if (b ===
|
|
254
|
-
if (b ===
|
|
255
|
-
if (
|
|
256
|
-
if (b ===
|
|
257
|
-
if (b ===
|
|
258
|
-
if (b ===
|
|
247
|
+
let b = Ee.call(h);
|
|
248
|
+
if (b === ge) return r(h, g, _);
|
|
249
|
+
if (b === xe) return u(h, g, _);
|
|
250
|
+
if (b === ve) return o(h, g, _);
|
|
251
|
+
if (b === Se) return d(h, g, _);
|
|
252
|
+
if (b === be) return typeof h.then != "function" && typeof g.then != "function" && c(h, g, _);
|
|
253
|
+
if (b === Te) return p(h, g, _);
|
|
254
|
+
if (b === _e) return i(h, g, _);
|
|
255
|
+
if (b === pe) return c(h, g, _);
|
|
256
|
+
if (we[b]) return f(h, g, _);
|
|
257
|
+
if (b === V) return e(h, g, _);
|
|
258
|
+
if (b === he) return n(h, g, _);
|
|
259
|
+
if (b === me || b === ye || b === Ce) return l(h, g, _);
|
|
259
260
|
if (m) {
|
|
260
261
|
let e = m[b];
|
|
261
262
|
if (!e) {
|
|
262
|
-
let t =
|
|
263
|
+
let t = ne(h);
|
|
263
264
|
t && (e = m[t]);
|
|
264
265
|
}
|
|
265
266
|
if (e) return e(h, g, _);
|
|
@@ -267,26 +268,26 @@ function Se({ areArrayBuffersEqual: e, areArraysEqual: t, areDataViewsEqual: n,
|
|
|
267
268
|
return !1;
|
|
268
269
|
};
|
|
269
270
|
}
|
|
270
|
-
function
|
|
271
|
+
function Oe({ circular: e, createCustomConfig: t, strict: n }) {
|
|
271
272
|
let r = {
|
|
272
|
-
areArrayBuffersEqual:
|
|
273
|
-
areArraysEqual: n ?
|
|
274
|
-
areDataViewsEqual:
|
|
275
|
-
areDatesEqual:
|
|
276
|
-
areErrorsEqual:
|
|
277
|
-
areFunctionsEqual:
|
|
278
|
-
areMapsEqual: n ?
|
|
279
|
-
areNumbersEqual:
|
|
280
|
-
areObjectsEqual: n ?
|
|
281
|
-
arePrimitiveWrappersEqual:
|
|
282
|
-
areRegExpsEqual:
|
|
283
|
-
areSetsEqual: n ?
|
|
284
|
-
areTypedArraysEqual: n ?
|
|
285
|
-
areUrlsEqual:
|
|
273
|
+
areArrayBuffersEqual: ae,
|
|
274
|
+
areArraysEqual: n ? P : oe,
|
|
275
|
+
areDataViewsEqual: se,
|
|
276
|
+
areDatesEqual: ce,
|
|
277
|
+
areErrorsEqual: le,
|
|
278
|
+
areFunctionsEqual: ue,
|
|
279
|
+
areMapsEqual: n ? T(N, P) : N,
|
|
280
|
+
areNumbersEqual: de,
|
|
281
|
+
areObjectsEqual: n ? P : fe,
|
|
282
|
+
arePrimitiveWrappersEqual: F,
|
|
283
|
+
areRegExpsEqual: I,
|
|
284
|
+
areSetsEqual: n ? T(L, P) : L,
|
|
285
|
+
areTypedArraysEqual: n ? T(R, P) : R,
|
|
286
|
+
areUrlsEqual: z,
|
|
286
287
|
unknownTagComparators: void 0
|
|
287
288
|
};
|
|
288
289
|
if (t && (r = Object.assign({}, r, t(r))), e) {
|
|
289
|
-
let e =
|
|
290
|
+
let e = E(r.areArraysEqual), t = E(r.areMapsEqual), n = E(r.areObjectsEqual), i = E(r.areSetsEqual);
|
|
290
291
|
r = Object.assign({}, r, {
|
|
291
292
|
areArraysEqual: e,
|
|
292
293
|
areMapsEqual: t,
|
|
@@ -296,12 +297,12 @@ function Ce({ circular: e, createCustomConfig: t, strict: n }) {
|
|
|
296
297
|
}
|
|
297
298
|
return r;
|
|
298
299
|
}
|
|
299
|
-
function
|
|
300
|
+
function ke(e) {
|
|
300
301
|
return function(t, n, r, i, a, o, s) {
|
|
301
302
|
return e(t, n, s);
|
|
302
303
|
};
|
|
303
304
|
}
|
|
304
|
-
function
|
|
305
|
+
function Ae({ circular: e, comparator: t, createState: n, equals: r, strict: i }) {
|
|
305
306
|
if (n) return function(a, o) {
|
|
306
307
|
let { cache: s = e ? /* @__PURE__ */ new WeakMap() : void 0, meta: c } = n();
|
|
307
308
|
return t(a, o, {
|
|
@@ -329,35 +330,35 @@ function Te({ circular: e, comparator: t, createState: n, equals: r, strict: i }
|
|
|
329
330
|
return t(e, n, a);
|
|
330
331
|
};
|
|
331
332
|
}
|
|
332
|
-
var
|
|
333
|
-
|
|
333
|
+
var je = H();
|
|
334
|
+
H({ strict: !0 }), H({ circular: !0 }), H({
|
|
334
335
|
circular: !0,
|
|
335
336
|
strict: !0
|
|
336
|
-
}),
|
|
337
|
+
}), H({ createInternalComparator: () => k }), H({
|
|
337
338
|
strict: !0,
|
|
338
|
-
createInternalComparator: () =>
|
|
339
|
-
}),
|
|
339
|
+
createInternalComparator: () => k
|
|
340
|
+
}), H({
|
|
340
341
|
circular: !0,
|
|
341
|
-
createInternalComparator: () =>
|
|
342
|
-
}),
|
|
342
|
+
createInternalComparator: () => k
|
|
343
|
+
}), H({
|
|
343
344
|
circular: !0,
|
|
344
|
-
createInternalComparator: () =>
|
|
345
|
+
createInternalComparator: () => k,
|
|
345
346
|
strict: !0
|
|
346
347
|
});
|
|
347
|
-
function
|
|
348
|
-
let { circular: t = !1, createInternalComparator: n, createState: r, strict: i = !1 } = e, a =
|
|
349
|
-
return
|
|
348
|
+
function H(e = {}) {
|
|
349
|
+
let { circular: t = !1, createInternalComparator: n, createState: r, strict: i = !1 } = e, a = De(Oe(e));
|
|
350
|
+
return Ae({
|
|
350
351
|
circular: t,
|
|
351
352
|
comparator: a,
|
|
352
353
|
createState: r,
|
|
353
|
-
equals: n ? n(a) :
|
|
354
|
+
equals: n ? n(a) : ke(a),
|
|
354
355
|
strict: i
|
|
355
356
|
});
|
|
356
357
|
}
|
|
357
358
|
//#endregion
|
|
358
359
|
//#region node_modules/.pnpm/use-sync-external-store@1.6.0_react@19.2.5/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.js
|
|
359
|
-
var
|
|
360
|
-
var t =
|
|
360
|
+
var Me = /* @__PURE__ */ e(((e) => {
|
|
361
|
+
var t = y(), n = x();
|
|
361
362
|
function r(e, t) {
|
|
362
363
|
return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
|
|
363
364
|
}
|
|
@@ -401,13 +402,13 @@ var De = /* @__PURE__ */ e(((e) => {
|
|
|
401
402
|
f.hasValue = !0, f.value = p;
|
|
402
403
|
}, [p]), l(p), p;
|
|
403
404
|
};
|
|
404
|
-
})),
|
|
405
|
+
})), Ne = /* @__PURE__ */ e(((e) => {
|
|
405
406
|
process.env.NODE_ENV !== "production" && (function() {
|
|
406
407
|
function t(e, t) {
|
|
407
408
|
return e === t && (e !== 0 || 1 / e == 1 / t) || e !== e && t !== t;
|
|
408
409
|
}
|
|
409
410
|
typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
|
|
410
|
-
var n =
|
|
411
|
+
var n = y(), r = x(), i = typeof Object.is == "function" ? Object.is : t, a = r.useSyncExternalStore, o = n.useRef, s = n.useEffect, c = n.useMemo, l = n.useDebugValue;
|
|
411
412
|
e.useSyncExternalStoreWithSelector = function(e, t, n, r, u) {
|
|
412
413
|
var d = o(null);
|
|
413
414
|
if (d.current === null) {
|
|
@@ -448,17 +449,17 @@ var De = /* @__PURE__ */ e(((e) => {
|
|
|
448
449
|
}, [p]), l(p), p;
|
|
449
450
|
}, typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ < "u" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop == "function" && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
|
|
450
451
|
})();
|
|
451
|
-
})),
|
|
452
|
-
process.env.NODE_ENV === "production" ? t.exports =
|
|
453
|
-
})))(),
|
|
452
|
+
})), Pe = (/* @__PURE__ */ e(((e, t) => {
|
|
453
|
+
process.env.NODE_ENV === "production" ? t.exports = Me() : t.exports = Ne();
|
|
454
|
+
})))(), Fe = (...e) => (t) => {
|
|
454
455
|
e.forEach((e) => {
|
|
455
456
|
typeof e == "function" ? e(t) : e && (e.current = t);
|
|
456
457
|
});
|
|
457
|
-
},
|
|
458
|
-
let t = (0,
|
|
459
|
-
return /* @__PURE__ */
|
|
458
|
+
}, Ie = ({ contentComponent: e }) => {
|
|
459
|
+
let t = (0, S.useSyncExternalStore)(e.subscribe, e.getSnapshot, e.getServerSnapshot);
|
|
460
|
+
return /* @__PURE__ */ _(g, { children: Object.values(t) });
|
|
460
461
|
};
|
|
461
|
-
function
|
|
462
|
+
function Le() {
|
|
462
463
|
let e = /* @__PURE__ */ new Set(), t = {}, n = !1, r = () => {
|
|
463
464
|
n || !e.size || (n = !0, queueMicrotask(() => {
|
|
464
465
|
n = !1, e.forEach((e) => e());
|
|
@@ -479,7 +480,7 @@ function Me() {
|
|
|
479
480
|
setRenderer(e, n) {
|
|
480
481
|
t = {
|
|
481
482
|
...t,
|
|
482
|
-
[e]:
|
|
483
|
+
[e]: m.createPortal(n.reactElement, n.element, e)
|
|
483
484
|
}, r();
|
|
484
485
|
},
|
|
485
486
|
removeRenderer(e) {
|
|
@@ -488,9 +489,9 @@ function Me() {
|
|
|
488
489
|
}
|
|
489
490
|
};
|
|
490
491
|
}
|
|
491
|
-
var
|
|
492
|
+
var Re = class extends r.Component {
|
|
492
493
|
constructor(e) {
|
|
493
|
-
super(e), this.editorContentRef =
|
|
494
|
+
super(e), this.editorContentRef = r.createRef();
|
|
494
495
|
}
|
|
495
496
|
componentDidMount() {
|
|
496
497
|
this.init();
|
|
@@ -503,7 +504,7 @@ var Ne = class extends n.Component {
|
|
|
503
504
|
if (e && !e.isDestroyed && e.view.dom?.parentNode) {
|
|
504
505
|
if (e.contentComponent) return;
|
|
505
506
|
let t = this.editorContentRef.current;
|
|
506
|
-
t.append(...e.view.dom.parentNode.childNodes), e.setOptions({ element: t }), e.contentComponent =
|
|
507
|
+
t.append(...e.view.dom.parentNode.childNodes), e.setOptions({ element: t }), e.contentComponent = Le(), e.createNodeViews(), e.isEditorContentInitialized = !0, this.forceUpdate();
|
|
507
508
|
}
|
|
508
509
|
}
|
|
509
510
|
componentWillUnmount() {
|
|
@@ -519,19 +520,19 @@ var Ne = class extends n.Component {
|
|
|
519
520
|
}
|
|
520
521
|
render() {
|
|
521
522
|
let { editor: e, innerRef: t, ...n } = this.props;
|
|
522
|
-
return /* @__PURE__ */ g
|
|
523
|
-
ref:
|
|
523
|
+
return /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("div", {
|
|
524
|
+
ref: Fe(t, this.editorContentRef),
|
|
524
525
|
...n
|
|
525
|
-
}), e?.contentComponent && /* @__PURE__ */
|
|
526
|
+
}), e?.contentComponent && /* @__PURE__ */ _(Ie, { contentComponent: e.contentComponent })] });
|
|
526
527
|
}
|
|
527
|
-
},
|
|
528
|
-
let
|
|
529
|
-
return
|
|
530
|
-
key:
|
|
528
|
+
}, ze = a((e, t) => {
|
|
529
|
+
let n = r.useMemo(() => Math.floor(Math.random() * 4294967295).toString(), [e.editor]);
|
|
530
|
+
return r.createElement(Re, {
|
|
531
|
+
key: n,
|
|
531
532
|
innerRef: t,
|
|
532
533
|
...e
|
|
533
534
|
});
|
|
534
|
-
}),
|
|
535
|
+
}), U = r.memo(ze), Be = typeof window < "u" ? l : c, Ve = class {
|
|
535
536
|
constructor(e) {
|
|
536
537
|
this.transactionNumber = 0, this.lastTransactionNumber = 0, this.subscribers = /* @__PURE__ */ new Set(), this.editor = e, this.lastSnapshot = {
|
|
537
538
|
editor: e,
|
|
@@ -566,21 +567,156 @@ var Ne = class extends n.Component {
|
|
|
566
567
|
}
|
|
567
568
|
}
|
|
568
569
|
};
|
|
569
|
-
function
|
|
570
|
-
let [t] =
|
|
571
|
-
return
|
|
570
|
+
function W(e) {
|
|
571
|
+
let [t] = f(() => new Ve(e.editor)), n = (0, Pe.useSyncExternalStoreWithSelector)(t.subscribe, t.getSnapshot, t.getServerSnapshot, e.selector, e.equalityFn ?? je);
|
|
572
|
+
return Be(() => t.watch(e.editor), [e.editor, t]), s(n), n;
|
|
572
573
|
}
|
|
573
|
-
process.env.NODE_ENV, typeof window > "u" || typeof window < "u" && window.next
|
|
574
|
-
|
|
574
|
+
var G = process.env.NODE_ENV !== "production", K = typeof window > "u", He = K || !!(typeof window < "u" && window.next), Ue = class e {
|
|
575
|
+
constructor(e) {
|
|
576
|
+
this.editor = null, this.subscriptions = /* @__PURE__ */ new Set(), this.isComponentMounted = !1, this.previousDeps = null, this.instanceId = "", this.options = e, this.subscriptions = /* @__PURE__ */ new Set(), this.setEditor(this.getInitialEditor()), this.scheduleDestroy(), this.getEditor = this.getEditor.bind(this), this.getServerSnapshot = this.getServerSnapshot.bind(this), this.subscribe = this.subscribe.bind(this), this.refreshEditorInstance = this.refreshEditorInstance.bind(this), this.scheduleDestroy = this.scheduleDestroy.bind(this), this.onRender = this.onRender.bind(this), this.createEditor = this.createEditor.bind(this);
|
|
577
|
+
}
|
|
578
|
+
setEditor(e) {
|
|
579
|
+
this.editor = e, this.instanceId = Math.random().toString(36).slice(2, 9), this.subscriptions.forEach((e) => e());
|
|
580
|
+
}
|
|
581
|
+
getInitialEditor() {
|
|
582
|
+
let e = this.options.current.immediatelyRender, t = e ?? !0;
|
|
583
|
+
return K ? (t && G && console.warn("SSR detected. `immediatelyRender` has been set to false to avoid hydration mismatches"), t = !1) : He && e === void 0 && (t = !1, G && console.warn("Next.js detected. `immediatelyRender` defaults to false to avoid hydration mismatches. Pass `immediatelyRender: true` explicitly if you are rendering the editor only on the client.")), t ? this.createEditor() : null;
|
|
584
|
+
}
|
|
585
|
+
createEditor() {
|
|
586
|
+
return new t({
|
|
587
|
+
...this.options.current,
|
|
588
|
+
onBeforeCreate: (...e) => {
|
|
589
|
+
var t;
|
|
590
|
+
return (t = this.options.current).onBeforeCreate?.call(t, ...e);
|
|
591
|
+
},
|
|
592
|
+
onBlur: (...e) => {
|
|
593
|
+
var t;
|
|
594
|
+
return (t = this.options.current).onBlur?.call(t, ...e);
|
|
595
|
+
},
|
|
596
|
+
onCreate: (...e) => {
|
|
597
|
+
var t;
|
|
598
|
+
return (t = this.options.current).onCreate?.call(t, ...e);
|
|
599
|
+
},
|
|
600
|
+
onDestroy: (...e) => {
|
|
601
|
+
var t;
|
|
602
|
+
return (t = this.options.current).onDestroy?.call(t, ...e);
|
|
603
|
+
},
|
|
604
|
+
onFocus: (...e) => {
|
|
605
|
+
var t;
|
|
606
|
+
return (t = this.options.current).onFocus?.call(t, ...e);
|
|
607
|
+
},
|
|
608
|
+
onSelectionUpdate: (...e) => {
|
|
609
|
+
var t;
|
|
610
|
+
return (t = this.options.current).onSelectionUpdate?.call(t, ...e);
|
|
611
|
+
},
|
|
612
|
+
onTransaction: (...e) => {
|
|
613
|
+
var t;
|
|
614
|
+
return (t = this.options.current).onTransaction?.call(t, ...e);
|
|
615
|
+
},
|
|
616
|
+
onUpdate: (...e) => {
|
|
617
|
+
var t;
|
|
618
|
+
return (t = this.options.current).onUpdate?.call(t, ...e);
|
|
619
|
+
},
|
|
620
|
+
onContentError: (...e) => {
|
|
621
|
+
var t;
|
|
622
|
+
return (t = this.options.current).onContentError?.call(t, ...e);
|
|
623
|
+
},
|
|
624
|
+
onDrop: (...e) => {
|
|
625
|
+
var t;
|
|
626
|
+
return (t = this.options.current).onDrop?.call(t, ...e);
|
|
627
|
+
},
|
|
628
|
+
onPaste: (...e) => {
|
|
629
|
+
var t;
|
|
630
|
+
return (t = this.options.current).onPaste?.call(t, ...e);
|
|
631
|
+
},
|
|
632
|
+
onDelete: (...e) => {
|
|
633
|
+
var t;
|
|
634
|
+
return (t = this.options.current).onDelete?.call(t, ...e);
|
|
635
|
+
},
|
|
636
|
+
onMount: (...e) => {
|
|
637
|
+
var t;
|
|
638
|
+
return (t = this.options.current).onMount?.call(t, ...e);
|
|
639
|
+
},
|
|
640
|
+
onUnmount: (...e) => {
|
|
641
|
+
var t;
|
|
642
|
+
return (t = this.options.current).onUnmount?.call(t, ...e);
|
|
643
|
+
}
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
getEditor() {
|
|
647
|
+
return this.editor;
|
|
648
|
+
}
|
|
649
|
+
getServerSnapshot() {
|
|
650
|
+
return null;
|
|
651
|
+
}
|
|
652
|
+
subscribe(e) {
|
|
653
|
+
return this.subscriptions.add(e), () => {
|
|
654
|
+
this.subscriptions.delete(e);
|
|
655
|
+
};
|
|
656
|
+
}
|
|
657
|
+
static compareOptions(e, t) {
|
|
658
|
+
return Object.keys(e).every((n) => [
|
|
659
|
+
"onCreate",
|
|
660
|
+
"onBeforeCreate",
|
|
661
|
+
"onDestroy",
|
|
662
|
+
"onUpdate",
|
|
663
|
+
"onTransaction",
|
|
664
|
+
"onFocus",
|
|
665
|
+
"onBlur",
|
|
666
|
+
"onSelectionUpdate",
|
|
667
|
+
"onContentError",
|
|
668
|
+
"onDrop",
|
|
669
|
+
"onPaste"
|
|
670
|
+
].includes(n) ? !0 : n === "extensions" && e.extensions && t.extensions ? e.extensions.length === t.extensions.length && e.extensions.every((e, n) => e === t.extensions?.[n]) : e[n] === t[n]);
|
|
671
|
+
}
|
|
672
|
+
onRender(t) {
|
|
673
|
+
return () => (this.isComponentMounted = !0, clearTimeout(this.scheduledDestructionTimeout), this.editor && !this.editor.isDestroyed && t.length === 0 ? e.compareOptions(this.options.current, this.editor.options) || this.editor.setOptions({
|
|
674
|
+
...this.options.current,
|
|
675
|
+
editable: this.editor.isEditable
|
|
676
|
+
}) : this.refreshEditorInstance(t), () => {
|
|
677
|
+
this.isComponentMounted = !1, this.scheduleDestroy();
|
|
678
|
+
});
|
|
679
|
+
}
|
|
680
|
+
refreshEditorInstance(e) {
|
|
681
|
+
if (this.editor && !this.editor.isDestroyed) {
|
|
682
|
+
if (this.previousDeps === null) {
|
|
683
|
+
this.previousDeps = e;
|
|
684
|
+
return;
|
|
685
|
+
}
|
|
686
|
+
if (this.previousDeps.length === e.length && this.previousDeps.every((t, n) => t === e[n])) return;
|
|
687
|
+
}
|
|
688
|
+
this.editor && !this.editor.isDestroyed && this.editor.destroy(), this.setEditor(this.createEditor()), this.previousDeps = e;
|
|
689
|
+
}
|
|
690
|
+
scheduleDestroy() {
|
|
691
|
+
let e = this.instanceId, t = this.editor;
|
|
692
|
+
this.scheduledDestructionTimeout = setTimeout(() => {
|
|
693
|
+
if (this.isComponentMounted && this.instanceId === e) {
|
|
694
|
+
t && t.setOptions(this.options.current);
|
|
695
|
+
return;
|
|
696
|
+
}
|
|
697
|
+
t && !t.isDestroyed && (t.destroy(), this.instanceId === e && this.setEditor(null));
|
|
698
|
+
}, 1);
|
|
699
|
+
}
|
|
700
|
+
};
|
|
701
|
+
function We(e = {}, t = []) {
|
|
702
|
+
let n = d(e);
|
|
703
|
+
n.current = e;
|
|
704
|
+
let [r] = f(() => new Ue(n)), i = (0, S.useSyncExternalStore)(r.subscribe, r.getEditor, r.getServerSnapshot);
|
|
705
|
+
return s(i), c(r.onRender(t)), W({
|
|
706
|
+
editor: i,
|
|
707
|
+
selector: ({ transactionNumber: t }) => e.shouldRerenderOnTransaction === !1 || e.shouldRerenderOnTransaction === void 0 ? null : e.immediatelyRender && t === 0 ? 0 : t + 1
|
|
708
|
+
}), i;
|
|
709
|
+
}
|
|
710
|
+
var q = i({ editor: null });
|
|
575
711
|
q.Consumer;
|
|
576
|
-
var
|
|
712
|
+
var Ge = () => o(q), Ke = i({
|
|
577
713
|
onDragStart: () => {},
|
|
578
714
|
nodeViewContentChildren: void 0,
|
|
579
715
|
nodeViewContentRef: () => {}
|
|
580
|
-
}), J = () =>
|
|
581
|
-
|
|
716
|
+
}), J = () => o(Ke);
|
|
717
|
+
r.forwardRef((e, t) => {
|
|
582
718
|
let { onDragStart: n } = J();
|
|
583
|
-
return /* @__PURE__ */
|
|
719
|
+
return /* @__PURE__ */ _(e.as || "div", {
|
|
584
720
|
...e,
|
|
585
721
|
ref: t,
|
|
586
722
|
"data-node-view-wrapper": "",
|
|
@@ -597,26 +733,26 @@ function Y(e) {
|
|
|
597
733
|
function X(e) {
|
|
598
734
|
return !!(typeof e == "object" && e.$$typeof && (e.$$typeof.toString() === "Symbol(react.forward_ref)" || e.$$typeof.description === "react.forward_ref"));
|
|
599
735
|
}
|
|
600
|
-
function
|
|
736
|
+
function qe(e) {
|
|
601
737
|
return !!(typeof e == "object" && e.$$typeof && (e.$$typeof.toString() === "Symbol(react.memo)" || e.$$typeof.description === "react.memo"));
|
|
602
738
|
}
|
|
603
|
-
function
|
|
739
|
+
function Je(e) {
|
|
604
740
|
if (Y(e) || X(e)) return !0;
|
|
605
|
-
if (
|
|
741
|
+
if (qe(e)) {
|
|
606
742
|
let t = e.type;
|
|
607
743
|
if (t) return Y(t) || X(t);
|
|
608
744
|
}
|
|
609
745
|
return !1;
|
|
610
746
|
}
|
|
611
|
-
function
|
|
747
|
+
function Ye() {
|
|
612
748
|
try {
|
|
613
|
-
if (
|
|
749
|
+
if (p) return parseInt(p.split(".")[0], 10) >= 19;
|
|
614
750
|
} catch {}
|
|
615
751
|
return !1;
|
|
616
752
|
}
|
|
617
|
-
var
|
|
753
|
+
var Xe = class {
|
|
618
754
|
constructor(e, { editor: t, props: n = {}, as: r = "div", className: i = "" }) {
|
|
619
|
-
this.ref = null, this.destroyed = !1, this.id = Math.floor(Math.random() * 4294967295).toString(), this.component = e, this.editor = t, this.props = n, this.element = document.createElement(r), this.element.classList.add("react-renderer"), i && this.element.classList.add(...i.split(" ")), this.editor.isEditorContentInitialized ?
|
|
755
|
+
this.ref = null, this.destroyed = !1, this.id = Math.floor(Math.random() * 4294967295).toString(), this.component = e, this.editor = t, this.props = n, this.element = document.createElement(r), this.element.classList.add("react-renderer"), i && this.element.classList.add(...i.split(" ")), this.editor.isEditorContentInitialized ? h(() => {
|
|
620
756
|
this.render();
|
|
621
757
|
}) : queueMicrotask(() => {
|
|
622
758
|
this.destroyed || this.render();
|
|
@@ -625,10 +761,10 @@ var Ue = class {
|
|
|
625
761
|
render() {
|
|
626
762
|
var e;
|
|
627
763
|
if (this.destroyed) return;
|
|
628
|
-
let t = this.component, n = this.props, r = this.editor, i =
|
|
764
|
+
let t = this.component, n = this.props, r = this.editor, i = Ye(), a = Je(t), o = { ...n };
|
|
629
765
|
o.ref && !(i || a) && delete o.ref, !o.ref && (i || a) && (o.ref = (e) => {
|
|
630
766
|
this.ref = e;
|
|
631
|
-
}), this.reactElement = /* @__PURE__ */
|
|
767
|
+
}), this.reactElement = /* @__PURE__ */ _(t, { ...o }), (e = r?.contentComponent) == null || e.setRenderer(this.id, this);
|
|
632
768
|
}
|
|
633
769
|
updateProps(e = {}) {
|
|
634
770
|
if (this.destroyed) return;
|
|
@@ -658,19 +794,19 @@ var Ue = class {
|
|
|
658
794
|
});
|
|
659
795
|
}
|
|
660
796
|
};
|
|
661
|
-
|
|
662
|
-
var Z =
|
|
797
|
+
r.createContext({ markViewContentRef: () => {} });
|
|
798
|
+
var Z = i({ get editor() {
|
|
663
799
|
throw Error("useTiptap must be used within a <Tiptap> provider");
|
|
664
800
|
} });
|
|
665
801
|
Z.displayName = "TiptapContext";
|
|
666
|
-
var
|
|
802
|
+
var Ze = () => o(Z);
|
|
667
803
|
function Q({ children: e, ...t }) {
|
|
668
804
|
let n = "editor" in t ? t.editor : t.instance;
|
|
669
805
|
if (!n) throw Error("Tiptap: An editor instance is required. Pass a non-null `editor` prop.");
|
|
670
|
-
let r =
|
|
671
|
-
return /* @__PURE__ */
|
|
806
|
+
let r = u(() => ({ editor: n }), [n]), i = u(() => ({ editor: n }), [n]);
|
|
807
|
+
return /* @__PURE__ */ _(q.Provider, {
|
|
672
808
|
value: i,
|
|
673
|
-
children: /* @__PURE__ */
|
|
809
|
+
children: /* @__PURE__ */ _(Z.Provider, {
|
|
674
810
|
value: r,
|
|
675
811
|
children: e
|
|
676
812
|
})
|
|
@@ -678,12 +814,12 @@ function Q({ children: e, ...t }) {
|
|
|
678
814
|
}
|
|
679
815
|
Q.displayName = "Tiptap";
|
|
680
816
|
function $({ ...e }) {
|
|
681
|
-
let { editor: t } =
|
|
682
|
-
return /* @__PURE__ */
|
|
817
|
+
let { editor: t } = Ze();
|
|
818
|
+
return /* @__PURE__ */ _(U, {
|
|
683
819
|
editor: t,
|
|
684
820
|
...e
|
|
685
821
|
});
|
|
686
822
|
}
|
|
687
823
|
$.displayName = "Tiptap.Content", Object.assign(Q, { Content: $ });
|
|
688
824
|
//#endregion
|
|
689
|
-
export {
|
|
825
|
+
export { W as a, We as i, Xe as n, Ge as r, U as t };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as e } from "./dist-
|
|
1
|
+
import { r as e } from "./dist-DT3iiwSr.js";
|
|
2
2
|
import { a as t, i as n, r } from "./dist-CnXCIcnl.js";
|
|
3
3
|
import { A as i, C as a, I as o, S as s, n as c } from "./dist-BQjH-i-q.js";
|
|
4
4
|
import { a as l, c as u, i as d, l as f, n as p, o as m, s as h, t as g, u as _ } from "./floating-ui.dom-rih69525.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clevertask/scribe",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A Radix-based Tiptap rich text editor with a Notion-style block interface for viewing and creating content. Perfect for diverse needs like notes, documents, AI chat, Markdown parsing, and comments.",
|
|
6
6
|
"keywords": [
|