reactjs-tiptap-editor 0.3.8 → 0.3.10
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/lib/{ActionMenuButton-CqlhqVIW.cjs → ActionMenuButton-D96eTByd.cjs} +1 -1
- package/lib/{ActionMenuButton-DXwpQHj4.js → ActionMenuButton-ZOYNohaO.js} +1 -1
- package/lib/Attachment.cjs +1 -1
- package/lib/Attachment.d.cts +12 -12
- package/lib/Attachment.d.ts +12 -12
- package/lib/Attachment.js +1 -1
- package/lib/Blockquote.cjs +1 -1
- package/lib/Blockquote.d.cts +12 -12
- package/lib/Blockquote.d.ts +12 -12
- package/lib/Blockquote.js +1 -1
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.d.cts +12 -12
- package/lib/Bold.d.ts +12 -12
- package/lib/Bold.js +1 -1
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.d.cts +12 -12
- package/lib/BulletList.d.ts +12 -12
- package/lib/BulletList.js +1 -1
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.d.cts +12 -12
- package/lib/Clear.d.ts +12 -12
- package/lib/Clear.js +1 -1
- package/lib/Code.cjs +1 -1
- package/lib/Code.d.cts +12 -12
- package/lib/Code.d.ts +12 -12
- package/lib/Code.js +1 -1
- package/lib/CodeBlock.cjs +1 -1
- package/lib/CodeBlock.d.cts +12 -12
- package/lib/CodeBlock.d.ts +12 -12
- package/lib/CodeBlock.js +1 -1
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.d.cts +12 -12
- package/lib/CodeView.d.ts +12 -12
- package/lib/CodeView.js +1 -1
- package/lib/Color.cjs +1 -1
- package/lib/Color.d.cts +12 -12
- package/lib/Color.d.ts +12 -12
- package/lib/Color.js +1 -1
- package/lib/Document.d.cts +12 -12
- package/lib/Document.d.ts +12 -12
- package/lib/{Drawer-B6uGc4Ab.js → Drawer-D7VC0bqz.js} +1 -1
- package/lib/{Drawer-DBt_aN5x.cjs → Drawer-hzhjTRvj.cjs} +1 -1
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.d.cts +12 -12
- package/lib/Drawer.d.ts +12 -12
- package/lib/Drawer.js +2 -2
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.d.cts +12 -12
- package/lib/Emoji.d.ts +12 -12
- package/lib/Emoji.js +1 -1
- package/lib/Excalidraw-Bj3dtbC4.cjs +1 -0
- package/lib/Excalidraw-DuV1h_du.js +282 -0
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.d.cts +12 -12
- package/lib/Excalidraw.d.ts +12 -12
- package/lib/Excalidraw.js +1 -1
- package/lib/ExportPdf.cjs +1 -1
- package/lib/ExportPdf.d.cts +12 -12
- package/lib/ExportPdf.d.ts +12 -12
- package/lib/ExportPdf.js +1 -1
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.d.cts +12 -12
- package/lib/ExportWord.d.ts +12 -12
- package/lib/ExportWord.js +1 -1
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.d.cts +12 -12
- package/lib/FontFamily.d.ts +12 -12
- package/lib/FontFamily.js +2 -2
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.d.cts +12 -12
- package/lib/FontSize.d.ts +12 -12
- package/lib/FontSize.js +2 -2
- package/lib/FormatPainter.cjs +1 -1
- package/lib/FormatPainter.d.cts +12 -12
- package/lib/FormatPainter.d.ts +12 -12
- package/lib/FormatPainter.js +1 -1
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.d.cts +12 -12
- package/lib/Heading.d.ts +12 -12
- package/lib/Heading.js +2 -2
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.d.cts +12 -12
- package/lib/Highlight.d.ts +12 -12
- package/lib/Highlight.js +1 -1
- package/lib/History.cjs +1 -1
- package/lib/History.d.cts +12 -12
- package/lib/History.d.ts +12 -12
- package/lib/History.js +1 -1
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.d.cts +12 -12
- package/lib/HorizontalRule.d.ts +12 -12
- package/lib/HorizontalRule.js +1 -1
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.d.cts +12 -12
- package/lib/Iframe.d.ts +12 -12
- package/lib/Iframe.js +1 -1
- package/lib/Image.cjs +1 -1
- package/lib/Image.d.cts +12 -12
- package/lib/Image.d.ts +12 -12
- package/lib/Image.js +1 -1
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.d.cts +12 -12
- package/lib/ImageGif.d.ts +12 -12
- package/lib/ImageGif.js +1 -1
- package/lib/ImportWord.cjs +1 -1
- package/lib/ImportWord.d.cts +12 -12
- package/lib/ImportWord.d.ts +12 -12
- package/lib/ImportWord.js +1 -1
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.d.cts +12 -12
- package/lib/Indent.d.ts +12 -12
- package/lib/Indent.js +1 -1
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.d.cts +12 -12
- package/lib/Italic.d.ts +12 -12
- package/lib/Italic.js +1 -1
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.d.cts +12 -12
- package/lib/Katex.d.ts +12 -12
- package/lib/Katex.js +2 -2
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.d.cts +12 -12
- package/lib/LineHeight.d.ts +12 -12
- package/lib/LineHeight.js +1 -1
- package/lib/Link.cjs +1 -1
- package/lib/Link.d.cts +12 -12
- package/lib/Link.d.ts +12 -12
- package/lib/Link.js +1 -1
- package/lib/ListItem.d.cts +12 -12
- package/lib/ListItem.d.ts +12 -12
- package/lib/Mention.cjs +1 -1
- package/lib/Mention.d.cts +12 -12
- package/lib/Mention.d.ts +12 -12
- package/lib/Mermaid.cjs +1 -1
- package/lib/Mermaid.d.cts +12 -12
- package/lib/Mermaid.d.ts +12 -12
- package/lib/Mermaid.js +2 -2
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.d.cts +12 -12
- package/lib/MoreMark.d.ts +12 -12
- package/lib/MoreMark.js +1 -1
- package/lib/MultiColumn.cjs +1 -1
- package/lib/MultiColumn.d.cts +12 -12
- package/lib/MultiColumn.d.ts +12 -12
- package/lib/MultiColumn.js +1 -1
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.d.cts +12 -12
- package/lib/OrderedList.d.ts +12 -12
- package/lib/OrderedList.js +1 -1
- package/lib/{RichTextEditor-BfYZYQb9.js → RichTextEditor-CRDKX-F8.js} +11 -11
- package/lib/{RichTextEditor-Db6oQoYY.cjs → RichTextEditor-ymQlnG9m.cjs} +1 -1
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.d.cts +12 -12
- package/lib/SearchAndReplace.d.ts +12 -12
- package/lib/SearchAndReplace.js +1 -1
- package/lib/Selection.d.cts +12 -12
- package/lib/Selection.d.ts +12 -12
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.d.cts +12 -12
- package/lib/SlashCommand.d.ts +12 -12
- package/lib/SlashCommand.js +1 -1
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.d.cts +12 -12
- package/lib/Strike.d.ts +12 -12
- package/lib/Strike.js +1 -1
- package/lib/SubAndSuperScript.cjs +1 -1
- package/lib/SubAndSuperScript.d.cts +12 -12
- package/lib/SubAndSuperScript.d.ts +12 -12
- package/lib/SubAndSuperScript.js +1 -1
- package/lib/Table.cjs +1 -1
- package/lib/Table.d.cts +12 -12
- package/lib/Table.d.ts +12 -12
- package/lib/Table.js +1 -1
- package/lib/TableOfContent.cjs +1 -1
- package/lib/TableOfContent.d.cts +12 -12
- package/lib/TableOfContent.d.ts +12 -12
- package/lib/TableOfContent.js +1 -1
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.d.cts +12 -12
- package/lib/TaskList.d.ts +12 -12
- package/lib/TaskList.js +1 -1
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.d.cts +12 -12
- package/lib/TextAlign.d.ts +12 -12
- package/lib/TextAlign.js +1 -1
- package/lib/TextBubble.cjs +1 -1
- package/lib/TextBubble.d.cts +12 -12
- package/lib/TextBubble.d.ts +12 -12
- package/lib/TextBubble.js +1 -1
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.d.cts +12 -12
- package/lib/TextDirection.d.ts +12 -12
- package/lib/TextDirection.js +1 -1
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.d.cts +12 -12
- package/lib/TextUnderline.d.ts +12 -12
- package/lib/TextUnderline.js +1 -1
- package/lib/TrailingNode.d.cts +12 -12
- package/lib/TrailingNode.d.ts +12 -12
- package/lib/{Twitter-DLO12QnF.cjs → Twitter-CMr6GpHp.cjs} +1 -1
- package/lib/{Twitter-CZA9dXpC.js → Twitter-CjAodXzu.js} +1 -1
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.d.cts +12 -12
- package/lib/Twitter.d.ts +12 -12
- package/lib/Twitter.js +1 -1
- package/lib/Video.cjs +1 -1
- package/lib/Video.d.cts +12 -12
- package/lib/Video.d.ts +12 -12
- package/lib/Video.js +1 -1
- package/lib/bubble-extra.cjs +1 -1
- package/lib/bubble-extra.d.cts +12 -12
- package/lib/bubble-extra.d.ts +12 -12
- package/lib/bubble-extra.js +5 -5
- package/lib/{dom-dataset-DmsCLv1q.cjs → dom-dataset-Cuy-pIfj.cjs} +3 -3
- package/lib/index.cjs +1 -1
- package/lib/index.d.cts +12 -12
- package/lib/index.d.ts +12 -12
- package/lib/index.js +2 -2
- package/lib/locale-bundle.d.cts +12 -12
- package/lib/locale-bundle.d.ts +12 -12
- package/lib/{textarea-ILk3QoYy.cjs → textarea-Ci1tHD6V.cjs} +1 -1
- package/lib/{textarea-BUlQB7hI.js → textarea-CtL8w6IS.js} +1 -1
- package/package.json +1 -2
- package/lib/Excalidraw-BmNljVH8.cjs +0 -1
- package/lib/Excalidraw-DwD8Qm59.js +0 -651
|
@@ -1,651 +0,0 @@
|
|
|
1
|
-
import { N as at, n as st, m as lt } from "./index-CXIIg9Sq.js";
|
|
2
|
-
import { N as ut, c as q, R as ct, n as ft, g as $ } from "./dom-dataset-2RXYq9wp.js";
|
|
3
|
-
import { jsxs as B, jsx as g } from "react/jsx-runtime";
|
|
4
|
-
import it, { useState as O, useCallback as I, useEffect as G, useRef as pt } from "react";
|
|
5
|
-
import { w as ht, x as dt, A as Y, y as mt, z as bt, F as gt, B as yt, a2 as vt, p as _t, K as wt } from "./RichTextEditor-BfYZYQb9.js";
|
|
6
|
-
import { n as Et } from "./index-D-DR0FPY.js";
|
|
7
|
-
import { Resizable as Tt } from "re-resizable";
|
|
8
|
-
import Ot from "react-dom";
|
|
9
|
-
let X;
|
|
10
|
-
function Q() {
|
|
11
|
-
try {
|
|
12
|
-
return X || (X = Et()), X;
|
|
13
|
-
} catch {
|
|
14
|
-
throw new Error("Error EventEmitter");
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
const J = "OPEN_EXCALIDRAW_SETTING_MODAL";
|
|
18
|
-
function xt(l, h) {
|
|
19
|
-
Q().on(l, h);
|
|
20
|
-
}
|
|
21
|
-
function Ct(l, h) {
|
|
22
|
-
Q().off(l, h);
|
|
23
|
-
}
|
|
24
|
-
function Gt(l) {
|
|
25
|
-
Q().emit(J, l);
|
|
26
|
-
}
|
|
27
|
-
const Dt = ({ editor: l }) => {
|
|
28
|
-
const [h, x] = O(null), [C, c] = O({}), [f, n] = O({ elements: [], appState: { isLoading: !1 }, files: null }), [e, r] = O(!1), [d, s] = O(!0), [b, i] = O(null), N = I(
|
|
29
|
-
(w) => {
|
|
30
|
-
w && import("@excalidraw/excalidraw").then((_) => {
|
|
31
|
-
x(_.Excalidraw);
|
|
32
|
-
}).catch(i).finally(() => s(!1));
|
|
33
|
-
},
|
|
34
|
-
[s]
|
|
35
|
-
), W = I((w) => {
|
|
36
|
-
setTimeout(() => {
|
|
37
|
-
w.refresh();
|
|
38
|
-
});
|
|
39
|
-
}, []), T = I((w, _, S) => {
|
|
40
|
-
c({
|
|
41
|
-
elements: w,
|
|
42
|
-
appState: { isLoading: !1 },
|
|
43
|
-
files: S
|
|
44
|
-
});
|
|
45
|
-
}, []), V = I(() => {
|
|
46
|
-
if (!h) {
|
|
47
|
-
r(!1);
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
l.chain().focus().setExcalidraw({ data: C }).run(), r(!1);
|
|
51
|
-
}, [h, l, C, r]);
|
|
52
|
-
return G(() => {
|
|
53
|
-
const w = (_) => {
|
|
54
|
-
(_ == null ? void 0 : _.editor) === l && (r(!0), _ && n(_.data));
|
|
55
|
-
};
|
|
56
|
-
return xt(J, w), () => {
|
|
57
|
-
Ct(J, w);
|
|
58
|
-
};
|
|
59
|
-
}, [l, r]), /* @__PURE__ */ B(
|
|
60
|
-
ht,
|
|
61
|
-
{
|
|
62
|
-
onOpenChange: r,
|
|
63
|
-
open: e,
|
|
64
|
-
children: [
|
|
65
|
-
/* @__PURE__ */ g(dt, { asChild: !0, children: /* @__PURE__ */ g(
|
|
66
|
-
Y,
|
|
67
|
-
{
|
|
68
|
-
action: () => r(!0),
|
|
69
|
-
icon: "Excalidraw",
|
|
70
|
-
tooltip: "Excalidraw"
|
|
71
|
-
}
|
|
72
|
-
) }),
|
|
73
|
-
/* @__PURE__ */ B(mt, { className: "richtext-z-[99999] !richtext-max-w-[1300px]", children: [
|
|
74
|
-
/* @__PURE__ */ g(bt, { children: "Excalidraw" }),
|
|
75
|
-
/* @__PURE__ */ B("div", { style: { height: "100%", borderWidth: 1 }, children: [
|
|
76
|
-
d && /* @__PURE__ */ g("p", { children: "Loading..." }),
|
|
77
|
-
b && /* @__PURE__ */ g("p", { children: b && b.message || "Error" }),
|
|
78
|
-
/* @__PURE__ */ g(
|
|
79
|
-
"div",
|
|
80
|
-
{
|
|
81
|
-
ref: N,
|
|
82
|
-
style: { width: "100%", height: 600 },
|
|
83
|
-
children: !d && !b && h ? /* @__PURE__ */ g(
|
|
84
|
-
h,
|
|
85
|
-
{
|
|
86
|
-
initialData: f,
|
|
87
|
-
langCode: "en",
|
|
88
|
-
onChange: T,
|
|
89
|
-
ref: W
|
|
90
|
-
}
|
|
91
|
-
) : null
|
|
92
|
-
}
|
|
93
|
-
)
|
|
94
|
-
] }),
|
|
95
|
-
/* @__PURE__ */ g(gt, { children: /* @__PURE__ */ g(
|
|
96
|
-
yt,
|
|
97
|
-
{
|
|
98
|
-
onClick: V,
|
|
99
|
-
type: "button",
|
|
100
|
-
children: "Save changes"
|
|
101
|
-
}
|
|
102
|
-
) })
|
|
103
|
-
] })
|
|
104
|
-
]
|
|
105
|
-
}
|
|
106
|
-
);
|
|
107
|
-
};
|
|
108
|
-
var H = { exports: {} }, Pt = H.exports, tt;
|
|
109
|
-
function St() {
|
|
110
|
-
return tt || (tt = 1, function(l, h) {
|
|
111
|
-
(function(C, c) {
|
|
112
|
-
l.exports = c(it, Ot);
|
|
113
|
-
})(Pt, function(x, C) {
|
|
114
|
-
return (
|
|
115
|
-
/******/
|
|
116
|
-
function(c) {
|
|
117
|
-
var f = {};
|
|
118
|
-
function n(e) {
|
|
119
|
-
if (f[e])
|
|
120
|
-
return f[e].exports;
|
|
121
|
-
var r = f[e] = {
|
|
122
|
-
/******/
|
|
123
|
-
i: e,
|
|
124
|
-
/******/
|
|
125
|
-
l: !1,
|
|
126
|
-
/******/
|
|
127
|
-
exports: {}
|
|
128
|
-
/******/
|
|
129
|
-
};
|
|
130
|
-
return c[e].call(r.exports, r, r.exports, n), r.l = !0, r.exports;
|
|
131
|
-
}
|
|
132
|
-
return n.m = c, n.c = f, n.d = function(e, r, d) {
|
|
133
|
-
n.o(e, r) || Object.defineProperty(e, r, { enumerable: !0, get: d });
|
|
134
|
-
}, n.r = function(e) {
|
|
135
|
-
typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e, "__esModule", { value: !0 });
|
|
136
|
-
}, n.t = function(e, r) {
|
|
137
|
-
if (r & 1 && (e = n(e)), r & 8 || r & 4 && typeof e == "object" && e && e.__esModule) return e;
|
|
138
|
-
var d = /* @__PURE__ */ Object.create(null);
|
|
139
|
-
if (n.r(d), Object.defineProperty(d, "default", { enumerable: !0, value: e }), r & 2 && typeof e != "string") for (var s in e) n.d(d, s, (function(b) {
|
|
140
|
-
return e[b];
|
|
141
|
-
}).bind(null, s));
|
|
142
|
-
return d;
|
|
143
|
-
}, n.n = function(e) {
|
|
144
|
-
var r = e && e.__esModule ? (
|
|
145
|
-
/******/
|
|
146
|
-
function() {
|
|
147
|
-
return e.default;
|
|
148
|
-
}
|
|
149
|
-
) : (
|
|
150
|
-
/******/
|
|
151
|
-
function() {
|
|
152
|
-
return e;
|
|
153
|
-
}
|
|
154
|
-
);
|
|
155
|
-
return n.d(r, "a", r), r;
|
|
156
|
-
}, n.o = function(e, r) {
|
|
157
|
-
return Object.prototype.hasOwnProperty.call(e, r);
|
|
158
|
-
}, n.p = "", n(n.s = 4);
|
|
159
|
-
}([
|
|
160
|
-
/* 0 */
|
|
161
|
-
/***/
|
|
162
|
-
function(c, f, n) {
|
|
163
|
-
c.exports = n(5)();
|
|
164
|
-
},
|
|
165
|
-
/* 1 */
|
|
166
|
-
/***/
|
|
167
|
-
function(c, f) {
|
|
168
|
-
c.exports = x;
|
|
169
|
-
},
|
|
170
|
-
/* 2 */
|
|
171
|
-
/***/
|
|
172
|
-
function(c, f) {
|
|
173
|
-
c.exports = C;
|
|
174
|
-
},
|
|
175
|
-
/* 3 */
|
|
176
|
-
/***/
|
|
177
|
-
function(c, f) {
|
|
178
|
-
c.exports = function(n, e, r) {
|
|
179
|
-
var d = n.direction, s = n.value;
|
|
180
|
-
switch (d) {
|
|
181
|
-
case "top":
|
|
182
|
-
return r.top + s < e.top && r.bottom > e.bottom && r.left < e.left && r.right > e.right;
|
|
183
|
-
case "left":
|
|
184
|
-
return r.left + s < e.left && r.bottom > e.bottom && r.top < e.top && r.right > e.right;
|
|
185
|
-
case "bottom":
|
|
186
|
-
return r.bottom - s > e.bottom && r.left < e.left && r.right > e.right && r.top < e.top;
|
|
187
|
-
case "right":
|
|
188
|
-
return r.right - s > e.right && r.left < e.left && r.top < e.top && r.bottom > e.bottom;
|
|
189
|
-
}
|
|
190
|
-
};
|
|
191
|
-
},
|
|
192
|
-
/* 4 */
|
|
193
|
-
/***/
|
|
194
|
-
function(c, f, n) {
|
|
195
|
-
n.r(f), n.d(f, "default", function() {
|
|
196
|
-
return F;
|
|
197
|
-
});
|
|
198
|
-
var e = n(1), r = /* @__PURE__ */ n.n(e), d = n(2), s = /* @__PURE__ */ n.n(d), b = n(0), i = /* @__PURE__ */ n.n(b), N = n(3), W = /* @__PURE__ */ n.n(N);
|
|
199
|
-
function T(o) {
|
|
200
|
-
return typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? T = function(u) {
|
|
201
|
-
return typeof u;
|
|
202
|
-
} : T = function(u) {
|
|
203
|
-
return u && typeof Symbol == "function" && u.constructor === Symbol && u !== Symbol.prototype ? "symbol" : typeof u;
|
|
204
|
-
}, T(o);
|
|
205
|
-
}
|
|
206
|
-
function V(o, a) {
|
|
207
|
-
if (!(o instanceof a))
|
|
208
|
-
throw new TypeError("Cannot call a class as a function");
|
|
209
|
-
}
|
|
210
|
-
function w(o, a) {
|
|
211
|
-
for (var u = 0; u < a.length; u++) {
|
|
212
|
-
var t = a[u];
|
|
213
|
-
t.enumerable = t.enumerable || !1, t.configurable = !0, "value" in t && (t.writable = !0), Object.defineProperty(o, t.key, t);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
function _(o, a, u) {
|
|
217
|
-
return a && w(o.prototype, a), o;
|
|
218
|
-
}
|
|
219
|
-
function S(o, a) {
|
|
220
|
-
return a && (T(a) === "object" || typeof a == "function") ? a : p(o);
|
|
221
|
-
}
|
|
222
|
-
function R(o) {
|
|
223
|
-
return R = Object.setPrototypeOf ? Object.getPrototypeOf : function(u) {
|
|
224
|
-
return u.__proto__ || Object.getPrototypeOf(u);
|
|
225
|
-
}, R(o);
|
|
226
|
-
}
|
|
227
|
-
function p(o) {
|
|
228
|
-
if (o === void 0)
|
|
229
|
-
throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
|
|
230
|
-
return o;
|
|
231
|
-
}
|
|
232
|
-
function D(o, a) {
|
|
233
|
-
if (typeof a != "function" && a !== null)
|
|
234
|
-
throw new TypeError("Super expression must either be null or a function");
|
|
235
|
-
o.prototype = Object.create(a && a.prototype, { constructor: { value: o, writable: !0, configurable: !0 } }), a && M(o, a);
|
|
236
|
-
}
|
|
237
|
-
function M(o, a) {
|
|
238
|
-
return M = Object.setPrototypeOf || function(t, E) {
|
|
239
|
-
return t.__proto__ = E, t;
|
|
240
|
-
}, M(o, a);
|
|
241
|
-
}
|
|
242
|
-
function P(o, a, u) {
|
|
243
|
-
return a in o ? Object.defineProperty(o, a, { value: u, enumerable: !0, configurable: !0, writable: !0 }) : o[a] = u, o;
|
|
244
|
-
}
|
|
245
|
-
function ot(o) {
|
|
246
|
-
return o.width === void 0 && (o.width = o.right - o.left), o.height === void 0 && (o.height = o.bottom - o.top), o;
|
|
247
|
-
}
|
|
248
|
-
var F = /* @__PURE__ */ function(o) {
|
|
249
|
-
D(a, o);
|
|
250
|
-
function a(u) {
|
|
251
|
-
var t;
|
|
252
|
-
return V(this, a), t = S(this, R(a).call(this, u)), P(p(t), "getContainer", function() {
|
|
253
|
-
return t.props.containment || window;
|
|
254
|
-
}), P(p(t), "addEventListener", function(E, m, y, k) {
|
|
255
|
-
t.debounceCheck || (t.debounceCheck = {});
|
|
256
|
-
var v, j, L = function() {
|
|
257
|
-
v = null, t.check();
|
|
258
|
-
};
|
|
259
|
-
k > -1 ? j = function() {
|
|
260
|
-
v || (v = setTimeout(L, k || 0));
|
|
261
|
-
} : j = function() {
|
|
262
|
-
clearTimeout(v), v = setTimeout(L, y || 0);
|
|
263
|
-
};
|
|
264
|
-
var z = {
|
|
265
|
-
target: E,
|
|
266
|
-
fn: j,
|
|
267
|
-
getLastTimeout: function() {
|
|
268
|
-
return v;
|
|
269
|
-
}
|
|
270
|
-
};
|
|
271
|
-
E.addEventListener(m, z.fn), t.debounceCheck[m] = z;
|
|
272
|
-
}), P(p(t), "startWatching", function() {
|
|
273
|
-
t.debounceCheck || t.interval || (t.props.intervalCheck && (t.interval = setInterval(t.check, t.props.intervalDelay)), t.props.scrollCheck && t.addEventListener(t.getContainer(), "scroll", t.props.scrollDelay, t.props.scrollThrottle), t.props.resizeCheck && t.addEventListener(window, "resize", t.props.resizeDelay, t.props.resizeThrottle), !t.props.delayedCall && t.check());
|
|
274
|
-
}), P(p(t), "stopWatching", function() {
|
|
275
|
-
if (t.debounceCheck) {
|
|
276
|
-
for (var E in t.debounceCheck)
|
|
277
|
-
if (t.debounceCheck.hasOwnProperty(E)) {
|
|
278
|
-
var m = t.debounceCheck[E];
|
|
279
|
-
clearTimeout(m.getLastTimeout()), m.target.removeEventListener(E, m.fn), t.debounceCheck[E] = null;
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
t.debounceCheck = null, t.interval && (t.interval = clearInterval(t.interval));
|
|
283
|
-
}), P(p(t), "check", function() {
|
|
284
|
-
var E = t.node, m, y;
|
|
285
|
-
if (!E)
|
|
286
|
-
return t.state;
|
|
287
|
-
if (m = ot(t.roundRectDown(E.getBoundingClientRect())), t.props.containment) {
|
|
288
|
-
var k = t.props.containment.getBoundingClientRect();
|
|
289
|
-
y = {
|
|
290
|
-
top: k.top,
|
|
291
|
-
left: k.left,
|
|
292
|
-
bottom: k.bottom,
|
|
293
|
-
right: k.right
|
|
294
|
-
};
|
|
295
|
-
} else
|
|
296
|
-
y = {
|
|
297
|
-
top: 0,
|
|
298
|
-
left: 0,
|
|
299
|
-
bottom: window.innerHeight || document.documentElement.clientHeight,
|
|
300
|
-
right: window.innerWidth || document.documentElement.clientWidth
|
|
301
|
-
};
|
|
302
|
-
var v = t.props.offset || {}, j = T(v) === "object";
|
|
303
|
-
j && (y.top += v.top || 0, y.left += v.left || 0, y.bottom -= v.bottom || 0, y.right -= v.right || 0);
|
|
304
|
-
var L = {
|
|
305
|
-
top: m.top >= y.top,
|
|
306
|
-
left: m.left >= y.left,
|
|
307
|
-
bottom: m.bottom <= y.bottom,
|
|
308
|
-
right: m.right <= y.right
|
|
309
|
-
}, z = m.height > 0 && m.width > 0, A = z && L.top && L.left && L.bottom && L.right;
|
|
310
|
-
if (z && t.props.partialVisibility) {
|
|
311
|
-
var K = m.top <= y.bottom && m.bottom >= y.top && m.left <= y.right && m.right >= y.left;
|
|
312
|
-
typeof t.props.partialVisibility == "string" && (K = L[t.props.partialVisibility]), A = t.props.minTopValue ? K && m.top <= y.bottom - t.props.minTopValue : K;
|
|
313
|
-
}
|
|
314
|
-
typeof v.direction == "string" && typeof v.value == "number" && (console.warn("[notice] offset.direction and offset.value have been deprecated. They still work for now, but will be removed in next major version. Please upgrade to the new syntax: { %s: %d }", v.direction, v.value), A = W()(v, m, y));
|
|
315
|
-
var Z = t.state;
|
|
316
|
-
return t.state.isVisible !== A && (Z = {
|
|
317
|
-
isVisible: A,
|
|
318
|
-
visibilityRect: L
|
|
319
|
-
}, t.setState(Z), t.props.onChange && t.props.onChange(A)), Z;
|
|
320
|
-
}), t.state = {
|
|
321
|
-
isVisible: null,
|
|
322
|
-
visibilityRect: {}
|
|
323
|
-
}, t;
|
|
324
|
-
}
|
|
325
|
-
return _(a, [{
|
|
326
|
-
key: "componentDidMount",
|
|
327
|
-
value: function() {
|
|
328
|
-
this.node = s.a.findDOMNode(this), this.props.active && this.startWatching();
|
|
329
|
-
}
|
|
330
|
-
}, {
|
|
331
|
-
key: "componentWillUnmount",
|
|
332
|
-
value: function() {
|
|
333
|
-
this.stopWatching();
|
|
334
|
-
}
|
|
335
|
-
}, {
|
|
336
|
-
key: "componentDidUpdate",
|
|
337
|
-
value: function(t) {
|
|
338
|
-
this.node = s.a.findDOMNode(this), this.props.active && !t.active ? (this.setState({
|
|
339
|
-
isVisible: null,
|
|
340
|
-
visibilityRect: {}
|
|
341
|
-
}), this.startWatching()) : this.props.active || this.stopWatching();
|
|
342
|
-
}
|
|
343
|
-
}, {
|
|
344
|
-
key: "roundRectDown",
|
|
345
|
-
value: function(t) {
|
|
346
|
-
return {
|
|
347
|
-
top: Math.floor(t.top),
|
|
348
|
-
left: Math.floor(t.left),
|
|
349
|
-
bottom: Math.floor(t.bottom),
|
|
350
|
-
right: Math.floor(t.right)
|
|
351
|
-
};
|
|
352
|
-
}
|
|
353
|
-
/**
|
|
354
|
-
* Check if the element is within the visible viewport
|
|
355
|
-
*/
|
|
356
|
-
}, {
|
|
357
|
-
key: "render",
|
|
358
|
-
value: function() {
|
|
359
|
-
return this.props.children instanceof Function ? this.props.children({
|
|
360
|
-
isVisible: this.state.isVisible,
|
|
361
|
-
visibilityRect: this.state.visibilityRect
|
|
362
|
-
}) : r.a.Children.only(this.props.children);
|
|
363
|
-
}
|
|
364
|
-
}]), a;
|
|
365
|
-
}(r.a.Component);
|
|
366
|
-
P(F, "defaultProps", {
|
|
367
|
-
active: !0,
|
|
368
|
-
partialVisibility: !1,
|
|
369
|
-
minTopValue: 0,
|
|
370
|
-
scrollCheck: !1,
|
|
371
|
-
scrollDelay: 250,
|
|
372
|
-
scrollThrottle: -1,
|
|
373
|
-
resizeCheck: !1,
|
|
374
|
-
resizeDelay: 250,
|
|
375
|
-
resizeThrottle: -1,
|
|
376
|
-
intervalCheck: !0,
|
|
377
|
-
intervalDelay: 100,
|
|
378
|
-
delayedCall: !1,
|
|
379
|
-
offset: {},
|
|
380
|
-
containment: null,
|
|
381
|
-
children: r.a.createElement("span", null)
|
|
382
|
-
}), P(F, "propTypes", {
|
|
383
|
-
onChange: i.a.func,
|
|
384
|
-
active: i.a.bool,
|
|
385
|
-
partialVisibility: i.a.oneOfType([i.a.bool, i.a.oneOf(["top", "right", "bottom", "left"])]),
|
|
386
|
-
delayedCall: i.a.bool,
|
|
387
|
-
offset: i.a.oneOfType([
|
|
388
|
-
i.a.shape({
|
|
389
|
-
top: i.a.number,
|
|
390
|
-
left: i.a.number,
|
|
391
|
-
bottom: i.a.number,
|
|
392
|
-
right: i.a.number
|
|
393
|
-
}),
|
|
394
|
-
// deprecated offset property
|
|
395
|
-
i.a.shape({
|
|
396
|
-
direction: i.a.oneOf(["top", "right", "bottom", "left"]),
|
|
397
|
-
value: i.a.number
|
|
398
|
-
})
|
|
399
|
-
]),
|
|
400
|
-
scrollCheck: i.a.bool,
|
|
401
|
-
scrollDelay: i.a.number,
|
|
402
|
-
scrollThrottle: i.a.number,
|
|
403
|
-
resizeCheck: i.a.bool,
|
|
404
|
-
resizeDelay: i.a.number,
|
|
405
|
-
resizeThrottle: i.a.number,
|
|
406
|
-
intervalCheck: i.a.bool,
|
|
407
|
-
intervalDelay: i.a.number,
|
|
408
|
-
containment: typeof window < "u" ? i.a.instanceOf(window.Element) : i.a.any,
|
|
409
|
-
children: i.a.oneOfType([i.a.element, i.a.func]),
|
|
410
|
-
minTopValue: i.a.number
|
|
411
|
-
});
|
|
412
|
-
},
|
|
413
|
-
/* 5 */
|
|
414
|
-
/***/
|
|
415
|
-
function(c, f, n) {
|
|
416
|
-
var e = n(6);
|
|
417
|
-
function r() {
|
|
418
|
-
}
|
|
419
|
-
function d() {
|
|
420
|
-
}
|
|
421
|
-
d.resetWarningCache = r, c.exports = function() {
|
|
422
|
-
function s(N, W, T, V, w, _) {
|
|
423
|
-
if (_ !== e) {
|
|
424
|
-
var S = new Error(
|
|
425
|
-
"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types"
|
|
426
|
-
);
|
|
427
|
-
throw S.name = "Invariant Violation", S;
|
|
428
|
-
}
|
|
429
|
-
}
|
|
430
|
-
s.isRequired = s;
|
|
431
|
-
function b() {
|
|
432
|
-
return s;
|
|
433
|
-
}
|
|
434
|
-
var i = {
|
|
435
|
-
array: s,
|
|
436
|
-
bool: s,
|
|
437
|
-
func: s,
|
|
438
|
-
number: s,
|
|
439
|
-
object: s,
|
|
440
|
-
string: s,
|
|
441
|
-
symbol: s,
|
|
442
|
-
any: s,
|
|
443
|
-
arrayOf: b,
|
|
444
|
-
element: s,
|
|
445
|
-
elementType: s,
|
|
446
|
-
instanceOf: b,
|
|
447
|
-
node: s,
|
|
448
|
-
objectOf: b,
|
|
449
|
-
oneOf: b,
|
|
450
|
-
oneOfType: b,
|
|
451
|
-
shape: b,
|
|
452
|
-
exact: b,
|
|
453
|
-
checkPropTypes: d,
|
|
454
|
-
resetWarningCache: r
|
|
455
|
-
};
|
|
456
|
-
return i.PropTypes = i, i;
|
|
457
|
-
};
|
|
458
|
-
},
|
|
459
|
-
/* 6 */
|
|
460
|
-
/***/
|
|
461
|
-
function(c, f, n) {
|
|
462
|
-
var e = "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";
|
|
463
|
-
c.exports = e;
|
|
464
|
-
}
|
|
465
|
-
/******/
|
|
466
|
-
])
|
|
467
|
-
);
|
|
468
|
-
});
|
|
469
|
-
}(H)), H.exports;
|
|
470
|
-
}
|
|
471
|
-
var Mt = St();
|
|
472
|
-
const Lt = /* @__PURE__ */ vt(Mt), At = "_wrap_15k3c_1", Wt = "_renderWrap_15k3c_7", kt = "_title_15k3c_14", Nt = "_handlerWrap_15k3c_30", U = {
|
|
473
|
-
wrap: At,
|
|
474
|
-
renderWrap: Wt,
|
|
475
|
-
title: kt,
|
|
476
|
-
handlerWrap: Nt
|
|
477
|
-
}, Vt = 10, It = 200, et = 15, rt = { width: "100%", height: "100%", maxWidth: "100%" };
|
|
478
|
-
function Rt({ editor: l, node: h, updateAttributes: x }) {
|
|
479
|
-
const C = pt(null), c = l.isActive(zt.name), { data: f, width: n, height: e } = h.attrs, [r, d] = O(null), [s, b] = O(!0), [i, N] = O(null), [W, T] = O(!1), [V, w] = O(100), _ = I(
|
|
480
|
-
(p) => {
|
|
481
|
-
p && T(!0);
|
|
482
|
-
},
|
|
483
|
-
[T]
|
|
484
|
-
), S = I((p) => () => {
|
|
485
|
-
w(
|
|
486
|
-
(D) => wt(p === "minus" ? D - et : D + et, Vt, It)
|
|
487
|
-
);
|
|
488
|
-
}, []);
|
|
489
|
-
G(() => {
|
|
490
|
-
let p = !1;
|
|
491
|
-
return import("@excalidraw/excalidraw").then((D) => {
|
|
492
|
-
p || (C.current = D.exportToSvg);
|
|
493
|
-
}).catch((D) => !p && N(D)).finally(() => !p && b(!1)), () => {
|
|
494
|
-
p = !0;
|
|
495
|
-
};
|
|
496
|
-
}, [b, f]), G(() => {
|
|
497
|
-
let p = !1;
|
|
498
|
-
return (async () => {
|
|
499
|
-
if (p || s || i || !W || !f)
|
|
500
|
-
return;
|
|
501
|
-
const M = await C.current(f);
|
|
502
|
-
p || (M.setAttribute("width", "100%"), M.setAttribute("height", "100%"), M.setAttribute("display", "block"), d(M));
|
|
503
|
-
})(), () => {
|
|
504
|
-
p = !0;
|
|
505
|
-
};
|
|
506
|
-
}, [f, s, i, W]);
|
|
507
|
-
const R = (p) => {
|
|
508
|
-
x({ width: p.width, height: p.height });
|
|
509
|
-
};
|
|
510
|
-
return /* @__PURE__ */ g(ut, { className: q(U.wrap, c && U.isActive), children: /* @__PURE__ */ g(Lt, { onChange: _, children: /* @__PURE__ */ g(
|
|
511
|
-
Tt,
|
|
512
|
-
{
|
|
513
|
-
size: { width: Number.parseInt(n), height: Number.parseInt(e) },
|
|
514
|
-
onResizeStop: (p, D, M, P) => {
|
|
515
|
-
R({
|
|
516
|
-
width: Number.parseInt(n) + P.width,
|
|
517
|
-
height: Number.parseInt(e) + P.height
|
|
518
|
-
});
|
|
519
|
-
},
|
|
520
|
-
children: /* @__PURE__ */ B(
|
|
521
|
-
"div",
|
|
522
|
-
{
|
|
523
|
-
className: q(U.renderWrap, "render-wrapper"),
|
|
524
|
-
style: { ...rt, overflow: "hidden" },
|
|
525
|
-
children: [
|
|
526
|
-
i && /* @__PURE__ */ g("div", { style: rt, children: /* @__PURE__ */ g("p", { children: i.message || i }) }),
|
|
527
|
-
s && /* @__PURE__ */ g("p", { children: "Loading..." }),
|
|
528
|
-
!s && !i && W && /* @__PURE__ */ g(
|
|
529
|
-
"div",
|
|
530
|
-
{
|
|
531
|
-
dangerouslySetInnerHTML: { __html: (r == null ? void 0 : r.outerHTML) ?? "" },
|
|
532
|
-
style: {
|
|
533
|
-
height: "100%",
|
|
534
|
-
maxHeight: "100%",
|
|
535
|
-
padding: 24,
|
|
536
|
-
overflow: "hidden",
|
|
537
|
-
display: "flex",
|
|
538
|
-
justifyContent: "center",
|
|
539
|
-
alignItems: "center",
|
|
540
|
-
transform: `scale(${V / 100})`,
|
|
541
|
-
transition: "all ease-in-out .3s"
|
|
542
|
-
}
|
|
543
|
-
}
|
|
544
|
-
),
|
|
545
|
-
/* @__PURE__ */ g("div", { className: U.title }),
|
|
546
|
-
/* @__PURE__ */ B("div", { className: U.handlerWrap, children: [
|
|
547
|
-
/* @__PURE__ */ g(
|
|
548
|
-
Y,
|
|
549
|
-
{
|
|
550
|
-
action: S("minus"),
|
|
551
|
-
icon: "ZoomOut",
|
|
552
|
-
tooltip: "Zoom Out"
|
|
553
|
-
}
|
|
554
|
-
),
|
|
555
|
-
/* @__PURE__ */ g(
|
|
556
|
-
Y,
|
|
557
|
-
{
|
|
558
|
-
action: S("plus"),
|
|
559
|
-
icon: "ZoomIn",
|
|
560
|
-
tooltip: "Zoom In"
|
|
561
|
-
}
|
|
562
|
-
)
|
|
563
|
-
] })
|
|
564
|
-
]
|
|
565
|
-
}
|
|
566
|
-
)
|
|
567
|
-
}
|
|
568
|
-
) }) });
|
|
569
|
-
}
|
|
570
|
-
const jt = it.memo(Rt, (l, h) => !!_t(l.node.attrs, h.node.attrs)), nt = { elements: [] }, zt = /* @__PURE__ */ at.create({
|
|
571
|
-
name: "excalidraw",
|
|
572
|
-
group: "block",
|
|
573
|
-
selectable: !0,
|
|
574
|
-
atom: !0,
|
|
575
|
-
draggable: !0,
|
|
576
|
-
inline: !1,
|
|
577
|
-
addAttributes() {
|
|
578
|
-
return {
|
|
579
|
-
defaultShowPicker: {
|
|
580
|
-
default: !1
|
|
581
|
-
},
|
|
582
|
-
createUser: {
|
|
583
|
-
default: null
|
|
584
|
-
},
|
|
585
|
-
width: {
|
|
586
|
-
default: "100%",
|
|
587
|
-
parseHTML: $("width")
|
|
588
|
-
},
|
|
589
|
-
height: {
|
|
590
|
-
default: 240,
|
|
591
|
-
parseHTML: $("height")
|
|
592
|
-
},
|
|
593
|
-
data: {
|
|
594
|
-
default: nt,
|
|
595
|
-
parseHTML: $("data", !0)
|
|
596
|
-
}
|
|
597
|
-
};
|
|
598
|
-
},
|
|
599
|
-
addOptions() {
|
|
600
|
-
var l;
|
|
601
|
-
return {
|
|
602
|
-
...(l = this.parent) == null ? void 0 : l.call(this),
|
|
603
|
-
HTMLAttributes: {
|
|
604
|
-
class: "excalidraw"
|
|
605
|
-
},
|
|
606
|
-
button: ({ editor: h }) => ({
|
|
607
|
-
component: Dt,
|
|
608
|
-
componentProps: {
|
|
609
|
-
editor: h
|
|
610
|
-
}
|
|
611
|
-
})
|
|
612
|
-
};
|
|
613
|
-
},
|
|
614
|
-
parseHTML() {
|
|
615
|
-
return [
|
|
616
|
-
{
|
|
617
|
-
tag: "div[class=excalidraw]"
|
|
618
|
-
}
|
|
619
|
-
];
|
|
620
|
-
},
|
|
621
|
-
renderHTML({ HTMLAttributes: l, node: h }) {
|
|
622
|
-
return ["div", lt(this.options.HTMLAttributes, l, ft(h))];
|
|
623
|
-
},
|
|
624
|
-
addCommands() {
|
|
625
|
-
return {
|
|
626
|
-
setExcalidraw: (l) => ({ tr: h, commands: x, chain: C }) => {
|
|
627
|
-
var c, f, n;
|
|
628
|
-
return l = l || {}, l.data = l.data || nt, ((n = (f = (c = h.selection) == null ? void 0 : c.node) == null ? void 0 : f.type) == null ? void 0 : n.name) == this.name ? x.updateAttributes(this.name, l) : C().insertContent({
|
|
629
|
-
type: this.name,
|
|
630
|
-
attrs: l
|
|
631
|
-
}).run();
|
|
632
|
-
}
|
|
633
|
-
};
|
|
634
|
-
},
|
|
635
|
-
addNodeView() {
|
|
636
|
-
return ct(jt);
|
|
637
|
-
},
|
|
638
|
-
addInputRules() {
|
|
639
|
-
return [
|
|
640
|
-
st({
|
|
641
|
-
find: /^\$excalidraw\$$/,
|
|
642
|
-
type: this.type,
|
|
643
|
-
getAttributes: () => ({ width: "100%" })
|
|
644
|
-
})
|
|
645
|
-
];
|
|
646
|
-
}
|
|
647
|
-
});
|
|
648
|
-
export {
|
|
649
|
-
zt as E,
|
|
650
|
-
Gt as t
|
|
651
|
-
};
|