reactjs-tiptap-editor 0.4.2 → 1.0.1
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-BKOg7hkq.js +38 -0
- package/lib/ActionMenuButton-DLQyd_gx.cjs +1 -0
- package/lib/Attachment.cjs +2 -2
- package/lib/Attachment.d.cts +27 -39
- package/lib/Attachment.d.ts +27 -39
- package/lib/Attachment.js +129 -99
- package/lib/Blockquote.cjs +3 -3
- package/lib/Blockquote.d.cts +27 -39
- package/lib/Blockquote.d.ts +27 -39
- package/lib/Blockquote.js +50 -22
- package/lib/Bold.cjs +1 -1
- package/lib/Bold.d.cts +27 -39
- package/lib/Bold.d.ts +27 -39
- package/lib/Bold.js +48 -20
- package/lib/BulletList.cjs +1 -1
- package/lib/BulletList.d.cts +27 -39
- package/lib/BulletList.d.ts +27 -39
- package/lib/BulletList.js +38 -9
- package/lib/Clear.cjs +1 -1
- package/lib/Clear.d.cts +27 -39
- package/lib/Clear.d.ts +27 -39
- package/lib/Clear.js +32 -6
- package/lib/Code.cjs +1 -1
- package/lib/Code.d.cts +27 -39
- package/lib/Code.d.ts +27 -39
- package/lib/Code.js +53 -25
- package/lib/CodeBlock.cjs +35 -35
- package/lib/CodeBlock.d.cts +27 -39
- package/lib/CodeBlock.d.ts +27 -39
- package/lib/CodeBlock.js +605 -590
- package/lib/CodeView.cjs +1 -1
- package/lib/CodeView.d.cts +28 -40
- package/lib/CodeView.d.ts +28 -40
- package/lib/CodeView.js +49 -21
- package/lib/Color.cjs +1 -1
- package/lib/Color.d.cts +31 -39
- package/lib/Color.d.ts +31 -39
- package/lib/Color.js +123 -79
- package/lib/Column.cjs +1 -0
- package/lib/{Document.d.cts → Column.d.cts} +33 -42
- package/lib/{Document.d.ts → Column.d.ts} +33 -42
- package/lib/Column.js +217 -0
- package/lib/{Drawer-CaAfmqNo.js → Drawer-DZ5jvmrX.js} +404 -394
- package/lib/Drawer-SRhwOc6T.cjs +1 -0
- package/lib/Drawer.cjs +1 -1
- package/lib/Drawer.d.cts +27 -39
- package/lib/Drawer.d.ts +27 -39
- package/lib/Drawer.js +6 -5
- package/lib/Emoji.cjs +1 -1
- package/lib/Emoji.d.cts +27 -44
- package/lib/Emoji.d.ts +27 -44
- package/lib/Emoji.js +377 -392
- package/lib/Excalidraw-DwBRXEtC.js +345 -0
- package/lib/Excalidraw-ZN3DQvDC.cjs +1 -0
- package/lib/Excalidraw.cjs +1 -1
- package/lib/Excalidraw.d.cts +27 -39
- package/lib/Excalidraw.d.ts +27 -39
- package/lib/Excalidraw.js +6 -4
- package/lib/ExportPdf.cjs +5 -5
- package/lib/ExportPdf.d.cts +27 -39
- package/lib/ExportPdf.d.ts +27 -39
- package/lib/ExportPdf.js +60 -32
- package/lib/ExportWord.cjs +1 -1
- package/lib/ExportWord.d.cts +28 -40
- package/lib/ExportWord.d.ts +28 -40
- package/lib/ExportWord.js +84 -21
- package/lib/FontFamily.cjs +1 -1
- package/lib/FontFamily.d.cts +41 -42
- package/lib/FontFamily.d.ts +41 -42
- package/lib/FontFamily.js +72 -74
- package/lib/FontSize.cjs +1 -1
- package/lib/FontSize.d.cts +38 -42
- package/lib/FontSize.d.ts +38 -42
- package/lib/FontSize.js +72 -64
- package/lib/Heading.cjs +1 -1
- package/lib/Heading.d.cts +41 -39
- package/lib/Heading.d.ts +41 -39
- package/lib/Heading.js +91 -73
- package/lib/Highlight.cjs +1 -1
- package/lib/Highlight.d.cts +31 -39
- package/lib/Highlight.d.ts +31 -39
- package/lib/Highlight.js +150 -19
- package/lib/History.cjs +1 -1
- package/lib/History.d.cts +29 -39
- package/lib/History.d.ts +29 -39
- package/lib/History.js +976 -53
- package/lib/HorizontalRule.cjs +1 -1
- package/lib/HorizontalRule.d.cts +27 -39
- package/lib/HorizontalRule.d.ts +27 -39
- package/lib/HorizontalRule.js +97 -17
- package/lib/Icon-DUpv2cI6.cjs +1 -0
- package/lib/Icon-jKs8Hr6p.js +11 -0
- package/lib/Iframe-CmXkEqOd.js +431 -0
- package/lib/Iframe-Cvca2G7X.cjs +1 -0
- package/lib/Iframe.cjs +1 -1
- package/lib/Iframe.d.cts +26 -45
- package/lib/Iframe.d.ts +26 -45
- package/lib/Iframe.js +6 -4
- package/lib/Image.cjs +1 -1
- package/lib/Image.d.cts +27 -40
- package/lib/Image.d.ts +27 -40
- package/lib/Image.js +848 -5
- package/lib/ImageGif.cjs +1 -1
- package/lib/ImageGif.d.cts +28 -42
- package/lib/ImageGif.d.ts +28 -42
- package/lib/ImageGif.js +424 -5
- package/lib/ImportWord.cjs +48 -48
- package/lib/ImportWord.d.cts +28 -40
- package/lib/ImportWord.d.ts +28 -40
- package/lib/ImportWord.js +2759 -2751
- package/lib/Indent.cjs +1 -1
- package/lib/Indent.d.cts +27 -39
- package/lib/Indent.d.ts +27 -39
- package/lib/Indent.js +97 -27
- package/lib/Italic.cjs +1 -1
- package/lib/Italic.d.cts +27 -39
- package/lib/Italic.d.ts +27 -39
- package/lib/Italic.js +47 -19
- package/lib/Katex-DsYXsjSS.js +2740 -0
- package/lib/Katex-XfrNne6U.cjs +4 -0
- package/lib/Katex.cjs +1 -1
- package/lib/Katex.d.cts +27 -39
- package/lib/Katex.d.ts +27 -39
- package/lib/Katex.js +5 -196
- package/lib/LineHeight.cjs +1 -1
- package/lib/LineHeight.d.cts +29 -45
- package/lib/LineHeight.d.ts +29 -45
- package/lib/LineHeight.js +71 -112
- package/lib/Link.cjs +1 -1
- package/lib/Link.d.cts +28 -42
- package/lib/Link.d.ts +28 -42
- package/lib/Link.js +3 -3
- package/lib/LinkEditBlock-BZenZq-Z.cjs +5 -0
- package/lib/LinkEditBlock-CB8yIffE.js +1241 -0
- package/lib/Mention.cjs +1 -1
- package/lib/Mention.d.cts +24 -39
- package/lib/Mention.d.ts +24 -39
- package/lib/Mention.js +112 -124
- package/lib/Mermaid.cjs +2 -2
- package/lib/Mermaid.d.cts +27 -39
- package/lib/Mermaid.d.ts +27 -39
- package/lib/Mermaid.js +177 -165
- package/lib/MoreMark.cjs +1 -1
- package/lib/MoreMark.d.cts +42 -41
- package/lib/MoreMark.d.ts +42 -41
- package/lib/MoreMark.js +125 -55
- package/lib/OrderedList.cjs +1 -1
- package/lib/OrderedList.d.cts +27 -39
- package/lib/OrderedList.d.ts +27 -39
- package/lib/OrderedList.js +37 -9
- package/lib/SearchAndReplace.cjs +1 -1
- package/lib/SearchAndReplace.d.cts +27 -42
- package/lib/SearchAndReplace.d.ts +27 -42
- package/lib/SearchAndReplace.js +221 -197
- package/lib/SlashCommand.cjs +1 -1
- package/lib/SlashCommand.d.cts +39 -46
- package/lib/SlashCommand.d.ts +39 -46
- package/lib/SlashCommand.js +235 -249
- package/lib/Strike.cjs +1 -1
- package/lib/Strike.d.cts +27 -39
- package/lib/Strike.d.ts +27 -39
- package/lib/Strike.js +39 -11
- package/lib/Table-B1j1Ebmh.cjs +9 -0
- package/lib/Table-Db8TcQX8.js +1984 -0
- package/lib/Table.cjs +1 -9
- package/lib/Table.d.cts +28 -42
- package/lib/Table.d.ts +28 -42
- package/lib/Table.js +3 -558
- package/lib/TaskList.cjs +1 -1
- package/lib/TaskList.d.cts +27 -39
- package/lib/TaskList.d.ts +27 -39
- package/lib/TaskList.js +38 -10
- package/lib/TextAlign.cjs +1 -1
- package/lib/TextAlign.d.cts +40 -39
- package/lib/TextAlign.d.ts +40 -39
- package/lib/TextAlign.js +108 -101
- package/lib/TextDirection.cjs +1 -1
- package/lib/TextDirection.d.cts +56 -39
- package/lib/TextDirection.d.ts +56 -39
- package/lib/TextDirection.js +105 -112
- package/lib/TextUnderline.cjs +1 -1
- package/lib/TextUnderline.d.cts +27 -39
- package/lib/TextUnderline.d.ts +27 -39
- package/lib/TextUnderline.js +46 -18
- package/lib/{Twitter-BFULyqdR.js → Twitter-CXmmjz9R.js} +536 -498
- package/lib/Twitter-CtVTIWJW.cjs +1 -0
- package/lib/Twitter.cjs +1 -1
- package/lib/Twitter.d.cts +27 -39
- package/lib/Twitter.d.ts +27 -39
- package/lib/Twitter.js +5 -4
- package/lib/Video.cjs +1 -1
- package/lib/Video.d.cts +27 -39
- package/lib/Video.d.ts +27 -39
- package/lib/Video.js +261 -4
- package/lib/_commonjsHelpers-BItOPCY9.js +28 -0
- package/lib/_commonjsHelpers-BTDuMlIz.cjs +1 -0
- package/lib/bubble.cjs +2 -0
- package/lib/{bubble-extra.d.cts → bubble.d.cts} +53 -54
- package/lib/{bubble-extra.d.ts → bubble.d.ts} +53 -54
- package/lib/bubble.js +1925 -0
- package/lib/button-B12K7BJ4.cjs +1 -0
- package/lib/button-DXMsXUEn.js +43 -0
- package/lib/clsx-C11secjj.cjs +1 -0
- package/lib/clsx-OuTLNxxd.js +16 -0
- package/lib/delete-node-CosiBes5.cjs +1 -0
- package/lib/delete-node-IyVmiRbI.js +22 -0
- package/lib/dialog-CaCS-W5S.cjs +1 -0
- package/lib/dialog-PtQivpHS.js +100 -0
- package/lib/dom-dataset-BqoJhJXt.cjs +1 -0
- package/lib/dom-dataset-CIEeltF6.js +47 -0
- package/lib/dropdown-menu-BPp2Z_U-.js +136 -0
- package/lib/dropdown-menu-CdSm4emp.cjs +1 -0
- package/lib/file-BLas99n7.js +43 -0
- package/lib/file-i7e4nQY2.cjs +1 -0
- package/lib/floating-ui.dom-U1vPFQ5f.js +1151 -0
- package/lib/floating-ui.dom-VCrc58uF.cjs +1 -0
- package/lib/icons-Cllpys39.js +362 -0
- package/lib/icons-CqHjeW5T.cjs +1 -0
- package/lib/index-BH4bc3jN.cjs +33 -0
- package/lib/index-BPfVXs5_.js +2380 -0
- package/lib/index-Bnmd0WvY.js +1631 -0
- package/lib/{index-Ch6dBBad.js → index-CBce_TWY.js} +40 -42
- package/lib/{index-5iBZLua9.cjs → index-D-5U8dY8.cjs} +8 -8
- package/lib/{index-ByurDDMv.js → index-D2TUfKkC.js} +2 -2
- package/lib/index-DV5kbgRU.cjs +1 -0
- package/lib/{index-LmrOdnen.js → index-DYkucCoF.js} +396 -495
- package/lib/index-Dfmm6FTT.cjs +1 -0
- package/lib/index-DnWWK9F_.js +6374 -0
- package/lib/index-DzcKxutn.js +632 -0
- package/lib/index-DzvuNTxo.cjs +4 -0
- package/lib/{index-BeCTd5v2.cjs → index-N--9MohJ.cjs} +1 -1
- package/lib/index-RfTlOzIr.cjs +22 -0
- package/lib/index.cjs +132 -1
- package/lib/index.d.cts +29 -280
- package/lib/index.d.ts +29 -280
- package/lib/index.js +243 -2
- package/lib/input-_ECRfn3Y.cjs +1 -0
- package/lib/input-wJ9PDEzZ.js +21 -0
- package/lib/isNumber-ClPupm7P.cjs +1 -0
- package/lib/isNumber-fpLGS0AZ.js +15 -0
- package/lib/label-BkgAe7IY.cjs +1 -0
- package/lib/label-CGdLYWv7.js +19 -0
- package/lib/locale-bundle.cjs +1 -1
- package/lib/locale-bundle.d.cts +5405 -57
- package/lib/locale-bundle.d.ts +5405 -57
- package/lib/locale-bundle.js +9 -7
- package/lib/popover-BgmUNMHj.cjs +1 -0
- package/lib/popover-CAuEW0Mr.js +23 -0
- package/lib/separator-CuBW_w98.js +328 -0
- package/lib/separator-DRIrVZ2N.cjs +1 -0
- package/lib/store-DX599H5W.js +10 -0
- package/lib/store-WStcMOiW.cjs +1 -0
- package/lib/style.css +1 -1
- package/lib/switch-CnLJ7Y-b.cjs +1 -0
- package/lib/switch-Coix_FA1.js +27 -0
- package/lib/tabs-B5mVSN1I.js +46 -0
- package/lib/tabs-BoLCMcCI.cjs +1 -0
- package/lib/textarea-B-6zTKQz.cjs +1 -0
- package/lib/{textarea-aPtytkDx.js → textarea-DUUM1jZd.js} +1 -1
- package/lib/theme-B7aAsK_T.js +15 -0
- package/lib/theme-D8_cxGqB.cjs +1 -0
- package/lib/throttle-CdwDrFpn.js +249 -0
- package/lib/throttle-qX7Yjtsg.cjs +1 -0
- package/lib/toggle-Cdp4IT2U.js +85 -0
- package/lib/toggle-D41PzQLJ.cjs +1 -0
- package/lib/tooltip-BuEiE96N.cjs +1 -0
- package/lib/tooltip-CopwsU8q.js +23 -0
- package/lib/updatePosition-8Sdem5jb.cjs +1 -0
- package/lib/updatePosition-BPmcE0YD.js +215 -0
- package/lib/use-toast-Bz3QCOtE.cjs +1 -0
- package/lib/use-toast-Crf7-q5H.js +98 -0
- package/lib/useButtonProps-BsEd4zYM.js +141 -0
- package/lib/useButtonProps-C6Vpn190.cjs +1 -0
- package/package.json +22 -105
- package/lib/ActionMenuButton-CYdM1xx5.cjs +0 -1
- package/lib/ActionMenuButton-DKRF6oa0.js +0 -33
- package/lib/BaseKit.cjs +0 -3
- package/lib/BaseKit.d.cts +0 -481
- package/lib/BaseKit.d.ts +0 -481
- package/lib/BaseKit.js +0 -132
- package/lib/Document.cjs +0 -1
- package/lib/Document.js +0 -9
- package/lib/Drawer-CdvCMSzN.cjs +0 -1
- package/lib/Excalidraw-BbMQhNvs.cjs +0 -1
- package/lib/Excalidraw-CVWz2Vyn.js +0 -290
- package/lib/FormatPainter.cjs +0 -1
- package/lib/FormatPainter.d.cts +0 -372
- package/lib/FormatPainter.d.ts +0 -372
- package/lib/FormatPainter.js +0 -76
- package/lib/ListItem.cjs +0 -1
- package/lib/ListItem.d.cts +0 -290
- package/lib/ListItem.d.ts +0 -290
- package/lib/ListItem.js +0 -7
- package/lib/MultiColumn.cjs +0 -1
- package/lib/MultiColumn.d.cts +0 -294
- package/lib/MultiColumn.d.ts +0 -294
- package/lib/MultiColumn.js +0 -8
- package/lib/RichTextEditor-CxvwGvQG.cjs +0 -142
- package/lib/RichTextEditor-DGcKEUGr.js +0 -22166
- package/lib/Selection.cjs +0 -1
- package/lib/Selection.d.cts +0 -289
- package/lib/Selection.d.ts +0 -289
- package/lib/Selection.js +0 -25
- package/lib/SubAndSuperScript.cjs +0 -1
- package/lib/SubAndSuperScript.d.cts +0 -377
- package/lib/SubAndSuperScript.d.ts +0 -377
- package/lib/SubAndSuperScript.js +0 -43
- package/lib/TableOfContent.cjs +0 -1
- package/lib/TableOfContent.d.cts +0 -291
- package/lib/TableOfContent.d.ts +0 -291
- package/lib/TableOfContent.js +0 -185
- package/lib/TextBubble.cjs +0 -1
- package/lib/TextBubble.d.cts +0 -362
- package/lib/TextBubble.d.ts +0 -362
- package/lib/TextBubble.js +0 -133
- package/lib/TrailingNode.cjs +0 -1
- package/lib/TrailingNode.d.cts +0 -297
- package/lib/TrailingNode.d.ts +0 -297
- package/lib/TrailingNode.js +0 -41
- package/lib/Twitter-Cutpkh3h.cjs +0 -1
- package/lib/bubble-extra.cjs +0 -2
- package/lib/bubble-extra.js +0 -631
- package/lib/dom-dataset-_6-diIRQ.cjs +0 -33
- package/lib/dom-dataset-lYeH6gfI.js +0 -2361
- package/lib/index-6D1J-A-o.cjs +0 -1
- package/lib/index-B96Cclrj.cjs +0 -3
- package/lib/index-BBz7Nmv9.js +0 -55
- package/lib/index-CUogRI7j.cjs +0 -1
- package/lib/index-DF2Lp4HZ.cjs +0 -100
- package/lib/index-D_L6n8O8.js +0 -76
- package/lib/index-Dbvi-Bvh.cjs +0 -1
- package/lib/index-DpCrt7xs.cjs +0 -1
- package/lib/index-DsAX1Vq8.cjs +0 -1
- package/lib/index-Dy4DlW9o.js +0 -12
- package/lib/index-J3jHHZ4d.js +0 -200
- package/lib/index-VvXaaKe3.js +0 -898
- package/lib/index-kbO3iWqL.js +0 -13432
- package/lib/textarea-DFo_aXnj.cjs +0 -1
|
@@ -0,0 +1,345 @@
|
|
|
1
|
+
import { N as V, n as $, m as B } from "./index-DnWWK9F_.js";
|
|
2
|
+
import { N as U, R as X } from "./index-DzcKxutn.js";
|
|
3
|
+
import { jsxs as _, jsx as i } from "react/jsx-runtime";
|
|
4
|
+
import { useMemo as F, useState as l, useCallback as T, useEffect as M, useRef as G } from "react";
|
|
5
|
+
import { A as y } from "./toggle-Cdp4IT2U.js";
|
|
6
|
+
import { D as Y, a as q, b as J, c as K, d as Q } from "./dialog-PtQivpHS.js";
|
|
7
|
+
import { u as ee, d as te, a as re, i as ne } from "./useButtonProps-BsEd4zYM.js";
|
|
8
|
+
import { a as ie } from "./index-BPfVXs5_.js";
|
|
9
|
+
import { c as H } from "./clsx-OuTLNxxd.js";
|
|
10
|
+
import { Resizable as ae } from "re-resizable";
|
|
11
|
+
import { n as se, g as O } from "./dom-dataset-CIEeltF6.js";
|
|
12
|
+
import { B as oe } from "./button-DXMsXUEn.js";
|
|
13
|
+
function ce(e) {
|
|
14
|
+
return e = e || /* @__PURE__ */ new Map(), {
|
|
15
|
+
/**
|
|
16
|
+
* A Map of event names to registered handler functions.
|
|
17
|
+
*/
|
|
18
|
+
all: e,
|
|
19
|
+
/**
|
|
20
|
+
* Register an event handler for the given type.
|
|
21
|
+
* @param {string|symbol} type Type of event to listen for, or `'*'` for all events
|
|
22
|
+
* @param {Function} handler Function to call in response to given event
|
|
23
|
+
* @memberOf mitt
|
|
24
|
+
*/
|
|
25
|
+
//@ts-expect-error
|
|
26
|
+
on(t, n) {
|
|
27
|
+
const r = e.get(t);
|
|
28
|
+
r ? r.push(n) : e.set(t, [n]);
|
|
29
|
+
},
|
|
30
|
+
/**
|
|
31
|
+
* Remove an event handler for the given type.
|
|
32
|
+
* If `handler` is omitted, all handlers of the given type are removed.
|
|
33
|
+
* @param {string|symbol} type Type of event to unregister `handler` from (`'*'` to remove a wildcard handler)
|
|
34
|
+
* @param {Function} [handler] Handler function to remove
|
|
35
|
+
* @memberOf mitt
|
|
36
|
+
*/
|
|
37
|
+
//@ts-expect-error
|
|
38
|
+
off(t, n) {
|
|
39
|
+
const r = e.get(t);
|
|
40
|
+
r && (n ? r.splice(r.indexOf(n) >>> 0, 1) : e.set(t, []));
|
|
41
|
+
},
|
|
42
|
+
/**
|
|
43
|
+
* Invoke all handlers for the given type.
|
|
44
|
+
* If present, `'*'` handlers are invoked after type-matched handlers.
|
|
45
|
+
*
|
|
46
|
+
* Note: Manually firing '*' handlers is not supported.
|
|
47
|
+
*
|
|
48
|
+
* @param {string|symbol} type The event type to invoke
|
|
49
|
+
* @param {Any} [evt] Any value (object is recommended and powerful), passed to each handler
|
|
50
|
+
* @memberOf mitt
|
|
51
|
+
*/
|
|
52
|
+
emit(t, n) {
|
|
53
|
+
let r = e.get(t);
|
|
54
|
+
r && [...r].map((s) => {
|
|
55
|
+
s(n);
|
|
56
|
+
}), r = e.get("*"), r && [...r].map((s) => {
|
|
57
|
+
s(t, n);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
let S;
|
|
63
|
+
function W() {
|
|
64
|
+
try {
|
|
65
|
+
return S || (S = ce()), S;
|
|
66
|
+
} catch {
|
|
67
|
+
throw new Error("Error EventEmitter");
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
const R = "OPEN_EXCALIDRAW_SETTING_MODAL";
|
|
71
|
+
function de(e, t) {
|
|
72
|
+
W().on(e, t);
|
|
73
|
+
}
|
|
74
|
+
function le(e, t) {
|
|
75
|
+
W().off(e, t);
|
|
76
|
+
}
|
|
77
|
+
function De(e) {
|
|
78
|
+
W().emit(R, e);
|
|
79
|
+
}
|
|
80
|
+
function Oe() {
|
|
81
|
+
const e = ie(), t = ee(C.name), n = te(C.name), {
|
|
82
|
+
tooltipOptions: r = {},
|
|
83
|
+
isActive: s = void 0
|
|
84
|
+
} = (t == null ? void 0 : t.componentProps) ?? {}, { editorDisabled: o } = re(s), f = F(() => (n == null ? void 0 : n.options) || {}, [n]), [c, w] = l(null), [N, E] = l({}), [D, h] = l({ elements: [], appState: { isLoading: !1 }, files: null }), [b, u] = l(!1), [x, A] = l(!0), [v, a] = l(null), d = T(
|
|
85
|
+
(p) => {
|
|
86
|
+
p && import("@excalidraw/excalidraw").then((m) => {
|
|
87
|
+
w(m.Excalidraw);
|
|
88
|
+
}).catch(a).finally(() => A(!1));
|
|
89
|
+
},
|
|
90
|
+
[A]
|
|
91
|
+
), g = T((p) => {
|
|
92
|
+
setTimeout(() => {
|
|
93
|
+
p.refresh();
|
|
94
|
+
});
|
|
95
|
+
}, []), I = T((p, m, j) => {
|
|
96
|
+
E({
|
|
97
|
+
elements: p,
|
|
98
|
+
appState: { isLoading: !1 },
|
|
99
|
+
files: j
|
|
100
|
+
});
|
|
101
|
+
}, []), z = T(() => {
|
|
102
|
+
if (!c) {
|
|
103
|
+
u(!1);
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
e.chain().focus().setExcalidraw({ data: N }).run(), u(!1);
|
|
107
|
+
}, [c, e, N, u]);
|
|
108
|
+
return M(() => {
|
|
109
|
+
const p = (m) => {
|
|
110
|
+
(m == null ? void 0 : m.editor) === e && (u(!0), m && h(m.data));
|
|
111
|
+
};
|
|
112
|
+
return de(R, p), () => {
|
|
113
|
+
le(R, p);
|
|
114
|
+
};
|
|
115
|
+
}, [e, u]), M(() => {
|
|
116
|
+
!x && c && b && setTimeout(() => {
|
|
117
|
+
window.dispatchEvent(new Event("resize"));
|
|
118
|
+
}, 400);
|
|
119
|
+
}, [x, c, b]), /* @__PURE__ */ _(
|
|
120
|
+
Y,
|
|
121
|
+
{
|
|
122
|
+
onOpenChange: u,
|
|
123
|
+
open: b,
|
|
124
|
+
children: [
|
|
125
|
+
/* @__PURE__ */ i(q, { asChild: !0, children: /* @__PURE__ */ i(
|
|
126
|
+
y,
|
|
127
|
+
{
|
|
128
|
+
disabled: o,
|
|
129
|
+
icon: "Excalidraw",
|
|
130
|
+
tooltip: "Excalidraw",
|
|
131
|
+
tooltipOptions: r,
|
|
132
|
+
action: () => {
|
|
133
|
+
o || u(!0);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
) }),
|
|
137
|
+
/* @__PURE__ */ _(J, { className: "richtext-z-[99999] !richtext-max-w-[1300px]", children: [
|
|
138
|
+
/* @__PURE__ */ i(K, { children: "Excalidraw" }),
|
|
139
|
+
/* @__PURE__ */ _("div", { style: { height: "100%", borderWidth: 1 }, children: [
|
|
140
|
+
x && /* @__PURE__ */ i("p", { children: "Loading..." }),
|
|
141
|
+
v && /* @__PURE__ */ i("p", { children: v && v.message || "Error" }),
|
|
142
|
+
/* @__PURE__ */ i(
|
|
143
|
+
"div",
|
|
144
|
+
{
|
|
145
|
+
ref: d,
|
|
146
|
+
style: { width: "100%", height: 600 },
|
|
147
|
+
children: !x && !v && c ? /* @__PURE__ */ i(
|
|
148
|
+
c,
|
|
149
|
+
{
|
|
150
|
+
initialData: D,
|
|
151
|
+
langCode: "en",
|
|
152
|
+
onChange: I,
|
|
153
|
+
ref: g,
|
|
154
|
+
...f.excalidrawProps
|
|
155
|
+
}
|
|
156
|
+
) : null
|
|
157
|
+
}
|
|
158
|
+
)
|
|
159
|
+
] }),
|
|
160
|
+
/* @__PURE__ */ i(Q, { children: /* @__PURE__ */ i(
|
|
161
|
+
oe,
|
|
162
|
+
{
|
|
163
|
+
disabled: !c,
|
|
164
|
+
onClick: z,
|
|
165
|
+
type: "button",
|
|
166
|
+
children: "Save changes"
|
|
167
|
+
}
|
|
168
|
+
) })
|
|
169
|
+
] })
|
|
170
|
+
]
|
|
171
|
+
}
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
const ue = "_wrap_15k3c_1", he = "_renderWrap_15k3c_7", pe = "_handlerWrap_15k3c_30", L = {
|
|
175
|
+
wrap: ue,
|
|
176
|
+
renderWrap: he,
|
|
177
|
+
handlerWrap: pe
|
|
178
|
+
}, me = 10, fe = 200, Z = 15, k = { width: "100%", height: "100%", maxWidth: "100%" };
|
|
179
|
+
function ge({ editor: e, node: t, updateAttributes: n }) {
|
|
180
|
+
const r = G(null), s = e.isActive(C.name), { data: o, width: f, height: c } = t.attrs, [w, N] = l(null), [E, D] = l(!0), [h, b] = l(null), [u, x] = l(100), A = T((a) => () => {
|
|
181
|
+
x(
|
|
182
|
+
(d) => ne(a === "minus" ? d - Z : d + Z, me, fe)
|
|
183
|
+
);
|
|
184
|
+
}, []);
|
|
185
|
+
M(() => {
|
|
186
|
+
let a = !1;
|
|
187
|
+
return import("@excalidraw/excalidraw").then((d) => {
|
|
188
|
+
a || (r.current = d.exportToSvg);
|
|
189
|
+
}).catch((d) => !a && b(d)).finally(() => !a && D(!1)), () => {
|
|
190
|
+
a = !0;
|
|
191
|
+
};
|
|
192
|
+
}, [o]), M(() => {
|
|
193
|
+
let a = !1;
|
|
194
|
+
return (async () => {
|
|
195
|
+
if (!r.current || a || E || h || !o)
|
|
196
|
+
return;
|
|
197
|
+
const g = await r.current(o);
|
|
198
|
+
a || (g.setAttribute("width", "100%"), g.setAttribute("height", "100%"), g.setAttribute("display", "block"), N(g));
|
|
199
|
+
})(), () => {
|
|
200
|
+
a = !0;
|
|
201
|
+
};
|
|
202
|
+
}, [o, E, h]);
|
|
203
|
+
const v = (a) => {
|
|
204
|
+
n({ width: a.width, height: a.height });
|
|
205
|
+
};
|
|
206
|
+
return /* @__PURE__ */ i(U, { className: H(L.wrap, s && L.isActive), children: /* @__PURE__ */ i(
|
|
207
|
+
ae,
|
|
208
|
+
{
|
|
209
|
+
size: { width: Number.parseInt(f), height: Number.parseInt(c) },
|
|
210
|
+
onResizeStop: (a, d, g, I) => {
|
|
211
|
+
v({
|
|
212
|
+
width: Number.parseInt(f) + I.width,
|
|
213
|
+
height: Number.parseInt(c) + I.height
|
|
214
|
+
});
|
|
215
|
+
},
|
|
216
|
+
children: /* @__PURE__ */ _(
|
|
217
|
+
"div",
|
|
218
|
+
{
|
|
219
|
+
className: H(L.renderWrap, "render-wrapper"),
|
|
220
|
+
style: { ...k, overflow: "hidden" },
|
|
221
|
+
children: [
|
|
222
|
+
h && /* @__PURE__ */ i("div", { style: k, children: /* @__PURE__ */ i("p", { children: h.message || h }) }),
|
|
223
|
+
E && /* @__PURE__ */ i("p", { children: "Loading..." }),
|
|
224
|
+
!E && !h && w && /* @__PURE__ */ i(
|
|
225
|
+
"div",
|
|
226
|
+
{
|
|
227
|
+
dangerouslySetInnerHTML: { __html: (w == null ? void 0 : w.outerHTML) ?? "" },
|
|
228
|
+
style: {
|
|
229
|
+
height: "100%",
|
|
230
|
+
maxHeight: "100%",
|
|
231
|
+
padding: 24,
|
|
232
|
+
overflow: "hidden",
|
|
233
|
+
display: "flex",
|
|
234
|
+
justifyContent: "center",
|
|
235
|
+
alignItems: "center",
|
|
236
|
+
transform: `scale(${u / 100})`,
|
|
237
|
+
transition: "all ease-in-out .3s"
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
),
|
|
241
|
+
/* @__PURE__ */ _("div", { className: L.handlerWrap, children: [
|
|
242
|
+
/* @__PURE__ */ i(
|
|
243
|
+
y,
|
|
244
|
+
{
|
|
245
|
+
action: A("minus"),
|
|
246
|
+
icon: "ZoomOut",
|
|
247
|
+
tooltip: "Zoom Out"
|
|
248
|
+
}
|
|
249
|
+
),
|
|
250
|
+
/* @__PURE__ */ i(
|
|
251
|
+
y,
|
|
252
|
+
{
|
|
253
|
+
action: A("plus"),
|
|
254
|
+
icon: "ZoomIn",
|
|
255
|
+
tooltip: "Zoom In"
|
|
256
|
+
}
|
|
257
|
+
)
|
|
258
|
+
] })
|
|
259
|
+
]
|
|
260
|
+
}
|
|
261
|
+
)
|
|
262
|
+
}
|
|
263
|
+
) });
|
|
264
|
+
}
|
|
265
|
+
const P = { elements: [] }, C = /* @__PURE__ */ V.create({
|
|
266
|
+
name: "excalidraw",
|
|
267
|
+
group: "block",
|
|
268
|
+
selectable: !0,
|
|
269
|
+
atom: !0,
|
|
270
|
+
draggable: !0,
|
|
271
|
+
inline: !1,
|
|
272
|
+
addAttributes() {
|
|
273
|
+
return {
|
|
274
|
+
defaultShowPicker: {
|
|
275
|
+
default: !1
|
|
276
|
+
},
|
|
277
|
+
createUser: {
|
|
278
|
+
default: null
|
|
279
|
+
},
|
|
280
|
+
width: {
|
|
281
|
+
default: "100%",
|
|
282
|
+
parseHTML: O("width")
|
|
283
|
+
},
|
|
284
|
+
height: {
|
|
285
|
+
default: 240,
|
|
286
|
+
parseHTML: O("height")
|
|
287
|
+
},
|
|
288
|
+
data: {
|
|
289
|
+
default: P,
|
|
290
|
+
parseHTML: O("data", !0)
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
},
|
|
294
|
+
addOptions() {
|
|
295
|
+
var e;
|
|
296
|
+
return {
|
|
297
|
+
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
298
|
+
HTMLAttributes: {
|
|
299
|
+
class: "excalidraw"
|
|
300
|
+
},
|
|
301
|
+
excalidrawProps: {},
|
|
302
|
+
button: () => ({
|
|
303
|
+
componentProps: {}
|
|
304
|
+
})
|
|
305
|
+
};
|
|
306
|
+
},
|
|
307
|
+
parseHTML() {
|
|
308
|
+
return [
|
|
309
|
+
{
|
|
310
|
+
tag: "div[class=excalidraw]"
|
|
311
|
+
}
|
|
312
|
+
];
|
|
313
|
+
},
|
|
314
|
+
renderHTML({ HTMLAttributes: e, node: t }) {
|
|
315
|
+
return ["div", B(this.options.HTMLAttributes, e, se(t))];
|
|
316
|
+
},
|
|
317
|
+
addCommands() {
|
|
318
|
+
return {
|
|
319
|
+
setExcalidraw: (e) => ({ tr: t, commands: n, chain: r }) => {
|
|
320
|
+
var s, o, f;
|
|
321
|
+
return e = e || {}, e.data = e.data || P, ((f = (o = (s = t.selection) == null ? void 0 : s.node) == null ? void 0 : o.type) == null ? void 0 : f.name) == this.name ? n.updateAttributes(this.name, e) : r().insertContent({
|
|
322
|
+
type: this.name,
|
|
323
|
+
attrs: e
|
|
324
|
+
}).run();
|
|
325
|
+
}
|
|
326
|
+
};
|
|
327
|
+
},
|
|
328
|
+
addNodeView() {
|
|
329
|
+
return X(ge);
|
|
330
|
+
},
|
|
331
|
+
addInputRules() {
|
|
332
|
+
return [
|
|
333
|
+
$({
|
|
334
|
+
find: /^\$excalidraw\$$/,
|
|
335
|
+
type: this.type,
|
|
336
|
+
getAttributes: () => ({ width: "100%" })
|
|
337
|
+
})
|
|
338
|
+
];
|
|
339
|
+
}
|
|
340
|
+
});
|
|
341
|
+
export {
|
|
342
|
+
C as E,
|
|
343
|
+
Oe as R,
|
|
344
|
+
De as t
|
|
345
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var V=Object.create;var W=Object.defineProperty;var U=Object.getOwnPropertyDescriptor;var X=Object.getOwnPropertyNames;var F=Object.getPrototypeOf,G=Object.prototype.hasOwnProperty;var Y=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of X(t))!G.call(e,a)&&a!==r&&W(e,a,{get:()=>t[a],enumerable:!(n=U(t,a))||n.enumerable});return e};var k=(e,t,r)=>(r=e!=null?V(F(e)):{},Y(t||!e||!e.__esModule?W(r,"default",{value:e,enumerable:!0}):r,e));const N=require("./index-RfTlOzIr.cjs"),z=require("./index-BH4bc3jN.cjs"),s=require("react/jsx-runtime"),i=require("react"),C=require("./toggle-D41PzQLJ.cjs"),S=require("./dialog-CaCS-W5S.cjs"),I=require("./useButtonProps-C6Vpn190.cjs"),J=require("./index-DV5kbgRU.cjs"),q=require("./clsx-C11secjj.cjs"),K=require("re-resizable"),_=require("./dom-dataset-BqoJhJXt.cjs"),Q=require("./button-B12K7BJ4.cjs");function ee(e){return e=e||new Map,{all:e,on(t,r){const n=e.get(t);n?n.push(r):e.set(t,[r])},off(t,r){const n=e.get(t);n&&(r?n.splice(n.indexOf(r)>>>0,1):e.set(t,[]))},emit(t,r){let n=e.get(t);n&&[...n].map(a=>{a(r)}),n=e.get("*"),n&&[...n].map(a=>{a(t,r)})}}}let O;function y(){try{return O||(O=ee()),O}catch{throw new Error("Error EventEmitter")}}const R="OPEN_EXCALIDRAW_SETTING_MODAL";function te(e,t){y().on(e,t)}function re(e,t){y().off(e,t)}function ne(e){y().emit(R,e)}function se(){const e=J.useEditorInstance(),t=I.useButtonProps(L.name),r=I.useExtension(L.name),{tooltipOptions:n={},isActive:a=void 0}=(t==null?void 0:t.componentProps)??{},{editorDisabled:c}=I.useToggleActive(a),f=i.useMemo(()=>(r==null?void 0:r.options)||{},[r]),[l,m]=i.useState(null),[T,w]=i.useState({}),[M,h]=i.useState({elements:[],appState:{isLoading:!1},files:null}),[v,d]=i.useState(!1),[E,A]=i.useState(!0),[b,o]=i.useState(null),u=i.useCallback(p=>{p&&import("@excalidraw/excalidraw").then(g=>{m(g.Excalidraw)}).catch(o).finally(()=>A(!1))},[A]),x=i.useCallback(p=>{setTimeout(()=>{p.refresh()})},[]),j=i.useCallback((p,g,B)=>{w({elements:p,appState:{isLoading:!1},files:B})},[]),$=i.useCallback(()=>{if(!l){d(!1);return}e.chain().focus().setExcalidraw({data:T}).run(),d(!1)},[l,e,T,d]);return i.useEffect(()=>{const p=g=>{(g==null?void 0:g.editor)===e&&(d(!0),g&&h(g.data))};return te(R,p),()=>{re(R,p)}},[e,d]),i.useEffect(()=>{!E&&l&&v&&setTimeout(()=>{window.dispatchEvent(new Event("resize"))},400)},[E,l,v]),s.jsxs(S.Dialog,{onOpenChange:d,open:v,children:[s.jsx(S.DialogTrigger,{asChild:!0,children:s.jsx(C.ActionButton,{disabled:c,icon:"Excalidraw",tooltip:"Excalidraw",tooltipOptions:n,action:()=>{c||d(!0)}})}),s.jsxs(S.DialogContent,{className:"richtext-z-[99999] !richtext-max-w-[1300px]",children:[s.jsx(S.DialogTitle,{children:"Excalidraw"}),s.jsxs("div",{style:{height:"100%",borderWidth:1},children:[E&&s.jsx("p",{children:"Loading..."}),b&&s.jsx("p",{children:b&&b.message||"Error"}),s.jsx("div",{ref:u,style:{width:"100%",height:600},children:!E&&!b&&l?s.jsx(l,{initialData:M,langCode:"en",onChange:j,ref:x,...f.excalidrawProps}):null})]}),s.jsx(S.DialogFooter,{children:s.jsx(Q.Button,{disabled:!l,onClick:$,type:"button",children:"Save changes"})})]})]})}const ie="_wrap_15k3c_1",ae="_renderWrap_15k3c_7",oe="_handlerWrap_15k3c_30",D={wrap:ie,renderWrap:ae,handlerWrap:oe},ce=10,le=200,H=15,P={width:"100%",height:"100%",maxWidth:"100%"};function ue({editor:e,node:t,updateAttributes:r}){const n=i.useRef(null),a=e.isActive(L.name),{data:c,width:f,height:l}=t.attrs,[m,T]=i.useState(null),[w,M]=i.useState(!0),[h,v]=i.useState(null),[d,E]=i.useState(100),A=i.useCallback(o=>()=>{E(u=>I.clamp(o==="minus"?u-H:u+H,ce,le))},[]);i.useEffect(()=>{let o=!1;return import("@excalidraw/excalidraw").then(u=>{o||(n.current=u.exportToSvg)}).catch(u=>!o&&v(u)).finally(()=>!o&&M(!1)),()=>{o=!0}},[c]),i.useEffect(()=>{let o=!1;return(async()=>{if(!n.current||o||w||h||!c)return;const x=await n.current(c);o||(x.setAttribute("width","100%"),x.setAttribute("height","100%"),x.setAttribute("display","block"),T(x))})(),()=>{o=!0}},[c,w,h]);const b=o=>{r({width:o.width,height:o.height})};return s.jsx(z.NodeViewWrapper,{className:q.clsx(D.wrap,a&&D.isActive),children:s.jsx(K.Resizable,{size:{width:Number.parseInt(f),height:Number.parseInt(l)},onResizeStop:(o,u,x,j)=>{b({width:Number.parseInt(f)+j.width,height:Number.parseInt(l)+j.height})},children:s.jsxs("div",{className:q.clsx(D.renderWrap,"render-wrapper"),style:{...P,overflow:"hidden"},children:[h&&s.jsx("div",{style:P,children:s.jsx("p",{children:h.message||h})}),w&&s.jsx("p",{children:"Loading..."}),!w&&!h&&m&&s.jsx("div",{dangerouslySetInnerHTML:{__html:(m==null?void 0:m.outerHTML)??""},style:{height:"100%",maxHeight:"100%",padding:24,overflow:"hidden",display:"flex",justifyContent:"center",alignItems:"center",transform:`scale(${d/100})`,transition:"all ease-in-out .3s"}}),s.jsxs("div",{className:D.handlerWrap,children:[s.jsx(C.ActionButton,{action:A("minus"),icon:"ZoomOut",tooltip:"Zoom Out"}),s.jsx(C.ActionButton,{action:A("plus"),icon:"ZoomIn",tooltip:"Zoom In"})]})]})})})}const Z={elements:[]},L=N.Node3.create({name:"excalidraw",group:"block",selectable:!0,atom:!0,draggable:!0,inline:!1,addAttributes(){return{defaultShowPicker:{default:!1},createUser:{default:null},width:{default:"100%",parseHTML:_.getDatasetAttribute("width")},height:{default:240,parseHTML:_.getDatasetAttribute("height")},data:{default:Z,parseHTML:_.getDatasetAttribute("data",!0)}}},addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),HTMLAttributes:{class:"excalidraw"},excalidrawProps:{},button:()=>({componentProps:{}})}},parseHTML(){return[{tag:"div[class=excalidraw]"}]},renderHTML({HTMLAttributes:e,node:t}){return["div",N.mergeAttributes(this.options.HTMLAttributes,e,_.nodeAttrsToDataset(t))]},addCommands(){return{setExcalidraw:e=>({tr:t,commands:r,chain:n})=>{var a,c,f;return e=e||{},e.data=e.data||Z,((f=(c=(a=t.selection)==null?void 0:a.node)==null?void 0:c.type)==null?void 0:f.name)==this.name?r.updateAttributes(this.name,e):n().insertContent({type:this.name,attrs:e}).run()}}},addNodeView(){return z.ReactNodeViewRenderer(ue)},addInputRules(){return[N.nodeInputRule({find:/^\$excalidraw\$$/,type:this.type,getAttributes:()=>({width:"100%"})})]}});exports.Excalidraw=L;exports.RichTextExcalidraw=se;exports.triggerOpenExcalidrawSettingModal=ne;
|
package/lib/Excalidraw.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-RfTlOzIr.cjs");require("./index-BH4bc3jN.cjs");const e=require("./Excalidraw-ZN3DQvDC.cjs");require("./dom-dataset-BqoJhJXt.cjs");exports.Excalidraw=e.Excalidraw;exports.RichTextExcalidraw=e.RichTextExcalidraw;
|
package/lib/Excalidraw.d.cts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { JSX } from 'react/jsx-runtime';
|
|
1
2
|
import { Node as Node_2 } from '@tiptap/core';
|
|
2
3
|
|
|
3
4
|
export declare const Excalidraw: Node_2<any, any>;
|
|
@@ -10,6 +11,8 @@ export declare interface IExcalidrawAttrs {
|
|
|
10
11
|
data?: Record<string, unknown>;
|
|
11
12
|
}
|
|
12
13
|
|
|
14
|
+
export declare function RichTextExcalidraw(): JSX.Element;
|
|
15
|
+
|
|
13
16
|
export { }
|
|
14
17
|
|
|
15
18
|
|
|
@@ -43,6 +46,27 @@ declare module '@tiptap/core' {
|
|
|
43
46
|
}
|
|
44
47
|
|
|
45
48
|
|
|
49
|
+
declare module '@tiptap/core' {
|
|
50
|
+
interface Storage {
|
|
51
|
+
color: ColorStorage;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
declare module '@tiptap/core' {
|
|
57
|
+
interface Commands<ReturnType> {
|
|
58
|
+
columns: {
|
|
59
|
+
insertColumns: (attrs?: {
|
|
60
|
+
cols: number;
|
|
61
|
+
}) => ReturnType;
|
|
62
|
+
addColBefore: () => ReturnType;
|
|
63
|
+
addColAfter: () => ReturnType;
|
|
64
|
+
deleteCol: () => ReturnType;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
|
|
46
70
|
declare module '@tiptap/core' {
|
|
47
71
|
interface Commands<ReturnType> {
|
|
48
72
|
drawer: {
|
|
@@ -74,7 +98,7 @@ declare module '@tiptap/core' {
|
|
|
74
98
|
declare module '@tiptap/core' {
|
|
75
99
|
interface Commands<ReturnType> {
|
|
76
100
|
exportWord: {
|
|
77
|
-
exportToWord: () => ReturnType;
|
|
101
|
+
exportToWord: (docState: any) => ReturnType;
|
|
78
102
|
};
|
|
79
103
|
}
|
|
80
104
|
}
|
|
@@ -99,10 +123,8 @@ declare module '@tiptap/core' {
|
|
|
99
123
|
|
|
100
124
|
|
|
101
125
|
declare module '@tiptap/core' {
|
|
102
|
-
interface
|
|
103
|
-
|
|
104
|
-
setPainter: (marks: Mark[]) => ReturnType;
|
|
105
|
-
};
|
|
126
|
+
interface Storage {
|
|
127
|
+
highlight: HighlightStorage;
|
|
106
128
|
}
|
|
107
129
|
}
|
|
108
130
|
|
|
@@ -187,16 +209,6 @@ declare module '@tiptap/core' {
|
|
|
187
209
|
}
|
|
188
210
|
|
|
189
211
|
|
|
190
|
-
declare module '@tiptap/core' {
|
|
191
|
-
interface Commands<ReturnType> {
|
|
192
|
-
lineHeight: {
|
|
193
|
-
setLineHeight: (lineHeight: string) => ReturnType;
|
|
194
|
-
unsetLineHeight: () => ReturnType;
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
|
|
200
212
|
declare module '@tiptap/core' {
|
|
201
213
|
interface Commands<ReturnType> {
|
|
202
214
|
mermaid: {
|
|
@@ -207,20 +219,6 @@ declare module '@tiptap/core' {
|
|
|
207
219
|
}
|
|
208
220
|
|
|
209
221
|
|
|
210
|
-
declare module '@tiptap/core' {
|
|
211
|
-
interface Commands<ReturnType> {
|
|
212
|
-
columns: {
|
|
213
|
-
insertColumns: (attrs?: {
|
|
214
|
-
cols: number;
|
|
215
|
-
}) => ReturnType;
|
|
216
|
-
addColBefore: () => ReturnType;
|
|
217
|
-
addColAfter: () => ReturnType;
|
|
218
|
-
deleteCol: () => ReturnType;
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
|
|
224
222
|
declare module '@tiptap/core' {
|
|
225
223
|
interface Commands<ReturnType> {
|
|
226
224
|
search: {
|
|
@@ -244,16 +242,6 @@ declare module '@tiptap/core' {
|
|
|
244
242
|
}
|
|
245
243
|
|
|
246
244
|
|
|
247
|
-
declare module '@tiptap/core' {
|
|
248
|
-
interface Commands<ReturnType> {
|
|
249
|
-
tableOfContents: {
|
|
250
|
-
setTableOfContents: () => ReturnType;
|
|
251
|
-
removeTableOfContents: () => ReturnType;
|
|
252
|
-
};
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
|
|
257
245
|
declare module '@tiptap/core' {
|
|
258
246
|
interface Commands<ReturnType> {
|
|
259
247
|
twitter: {
|
package/lib/Excalidraw.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { JSX } from 'react/jsx-runtime';
|
|
1
2
|
import { Node as Node_2 } from '@tiptap/core';
|
|
2
3
|
|
|
3
4
|
export declare const Excalidraw: Node_2<any, any>;
|
|
@@ -10,6 +11,8 @@ export declare interface IExcalidrawAttrs {
|
|
|
10
11
|
data?: Record<string, unknown>;
|
|
11
12
|
}
|
|
12
13
|
|
|
14
|
+
export declare function RichTextExcalidraw(): JSX.Element;
|
|
15
|
+
|
|
13
16
|
export { }
|
|
14
17
|
|
|
15
18
|
|
|
@@ -43,6 +46,27 @@ declare module '@tiptap/core' {
|
|
|
43
46
|
}
|
|
44
47
|
|
|
45
48
|
|
|
49
|
+
declare module '@tiptap/core' {
|
|
50
|
+
interface Storage {
|
|
51
|
+
color: ColorStorage;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
declare module '@tiptap/core' {
|
|
57
|
+
interface Commands<ReturnType> {
|
|
58
|
+
columns: {
|
|
59
|
+
insertColumns: (attrs?: {
|
|
60
|
+
cols: number;
|
|
61
|
+
}) => ReturnType;
|
|
62
|
+
addColBefore: () => ReturnType;
|
|
63
|
+
addColAfter: () => ReturnType;
|
|
64
|
+
deleteCol: () => ReturnType;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
|
|
46
70
|
declare module '@tiptap/core' {
|
|
47
71
|
interface Commands<ReturnType> {
|
|
48
72
|
drawer: {
|
|
@@ -74,7 +98,7 @@ declare module '@tiptap/core' {
|
|
|
74
98
|
declare module '@tiptap/core' {
|
|
75
99
|
interface Commands<ReturnType> {
|
|
76
100
|
exportWord: {
|
|
77
|
-
exportToWord: () => ReturnType;
|
|
101
|
+
exportToWord: (docState: any) => ReturnType;
|
|
78
102
|
};
|
|
79
103
|
}
|
|
80
104
|
}
|
|
@@ -99,10 +123,8 @@ declare module '@tiptap/core' {
|
|
|
99
123
|
|
|
100
124
|
|
|
101
125
|
declare module '@tiptap/core' {
|
|
102
|
-
interface
|
|
103
|
-
|
|
104
|
-
setPainter: (marks: Mark[]) => ReturnType;
|
|
105
|
-
};
|
|
126
|
+
interface Storage {
|
|
127
|
+
highlight: HighlightStorage;
|
|
106
128
|
}
|
|
107
129
|
}
|
|
108
130
|
|
|
@@ -187,16 +209,6 @@ declare module '@tiptap/core' {
|
|
|
187
209
|
}
|
|
188
210
|
|
|
189
211
|
|
|
190
|
-
declare module '@tiptap/core' {
|
|
191
|
-
interface Commands<ReturnType> {
|
|
192
|
-
lineHeight: {
|
|
193
|
-
setLineHeight: (lineHeight: string) => ReturnType;
|
|
194
|
-
unsetLineHeight: () => ReturnType;
|
|
195
|
-
};
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
|
|
200
212
|
declare module '@tiptap/core' {
|
|
201
213
|
interface Commands<ReturnType> {
|
|
202
214
|
mermaid: {
|
|
@@ -207,20 +219,6 @@ declare module '@tiptap/core' {
|
|
|
207
219
|
}
|
|
208
220
|
|
|
209
221
|
|
|
210
|
-
declare module '@tiptap/core' {
|
|
211
|
-
interface Commands<ReturnType> {
|
|
212
|
-
columns: {
|
|
213
|
-
insertColumns: (attrs?: {
|
|
214
|
-
cols: number;
|
|
215
|
-
}) => ReturnType;
|
|
216
|
-
addColBefore: () => ReturnType;
|
|
217
|
-
addColAfter: () => ReturnType;
|
|
218
|
-
deleteCol: () => ReturnType;
|
|
219
|
-
};
|
|
220
|
-
}
|
|
221
|
-
}
|
|
222
|
-
|
|
223
|
-
|
|
224
222
|
declare module '@tiptap/core' {
|
|
225
223
|
interface Commands<ReturnType> {
|
|
226
224
|
search: {
|
|
@@ -244,16 +242,6 @@ declare module '@tiptap/core' {
|
|
|
244
242
|
}
|
|
245
243
|
|
|
246
244
|
|
|
247
|
-
declare module '@tiptap/core' {
|
|
248
|
-
interface Commands<ReturnType> {
|
|
249
|
-
tableOfContents: {
|
|
250
|
-
setTableOfContents: () => ReturnType;
|
|
251
|
-
removeTableOfContents: () => ReturnType;
|
|
252
|
-
};
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
|
|
257
245
|
declare module '@tiptap/core' {
|
|
258
246
|
interface Commands<ReturnType> {
|
|
259
247
|
twitter: {
|
package/lib/Excalidraw.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import "./index-
|
|
2
|
-
import "./
|
|
3
|
-
import { E as m } from "./Excalidraw-
|
|
1
|
+
import "./index-DnWWK9F_.js";
|
|
2
|
+
import "./index-DzcKxutn.js";
|
|
3
|
+
import { E as m, R as p } from "./Excalidraw-DwBRXEtC.js";
|
|
4
|
+
import "./dom-dataset-CIEeltF6.js";
|
|
4
5
|
export {
|
|
5
|
-
m as Excalidraw
|
|
6
|
+
m as Excalidraw,
|
|
7
|
+
p as RichTextExcalidraw
|
|
6
8
|
};
|
package/lib/ExportPdf.cjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const v=require("./index-RfTlOzIr.cjs"),l=require("react/jsx-runtime"),y=require("./toggle-D41PzQLJ.cjs");require("react");require("./index-DV5kbgRU.cjs");const h=require("./useButtonProps-C6Vpn190.cjs");function E(e,n){var m;const t=document.createElement("iframe");t.setAttribute("style","position: absolute; width: 0; height: 0; top: 0; left: 0;"),document.body.appendChild(t);const o=t.contentDocument||((m=t.contentWindow)==null?void 0:m.document);if(!o)return;const{paperSize:s,title:i="Echo Editor",margins:{top:d,right:c,bottom:r,left:a}}=n,p=`
|
|
2
2
|
<!DOCTYPE html>
|
|
3
3
|
<html lang="en">
|
|
4
4
|
<head>
|
|
5
|
-
<title>${
|
|
5
|
+
<title>${i}</title>
|
|
6
6
|
<meta charset="UTF-8">
|
|
7
7
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
8
8
|
<style>
|
|
9
9
|
@media print {
|
|
10
10
|
@page {
|
|
11
|
-
size: ${
|
|
12
|
-
margin: ${
|
|
11
|
+
size: ${s};
|
|
12
|
+
margin: ${d} ${c} ${r} ${a}; /* top, right, bottom, left */
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
body {
|
|
@@ -36,4 +36,4 @@
|
|
|
36
36
|
</div>
|
|
37
37
|
</body>
|
|
38
38
|
</html>
|
|
39
|
-
`;
|
|
39
|
+
`;o.open(),o.write(p),o.close(),t.addEventListener("load",()=>{setTimeout(()=>{var u,f;try{(u=t.contentWindow)==null||u.focus(),(f=t.contentWindow)==null||f.print()}catch(x){console.error("Print failed",x)}setTimeout(()=>{document.body.removeChild(t)},100)},50)})}function g(e,n){const t=e.getHTML();return t?(E(t,n),!0):!1}function P(){const e=h.useButtonProps(b.name),{icon:n=void 0,tooltip:t=void 0,shortcutKeys:o=void 0,tooltipOptions:s={},action:i=void 0,isActive:d=void 0}=(e==null?void 0:e.componentProps)??{},{dataState:c,disabled:r,update:a}=h.useToggleActive(d),p=()=>{r||i&&(i(),a())};return e?l.jsx(y.ActionButton,{action:p,dataState:c,disabled:r,icon:n,shortcutKeys:o,tooltip:t,tooltipOptions:s}):l.jsx(l.Fragment,{})}const b=v.Extension.create({name:"exportPdf",addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),paperSize:"Letter",title:"Echo Editor",margins:{top:"0.4in",right:"0.4in",bottom:"0.4in",left:"0.4in"},button:({editor:n,extension:t,t:o})=>({componentProps:{action:()=>{g(n,t.options)},icon:"ExportPdf",tooltip:o("editor.exportPdf.tooltip"),isActive:()=>!1,disabled:!1}})}},addCommands(){return{exportToPdf:()=>({editor:e})=>g(e,this.options)}}});exports.ExportPdf=b;exports.RichTextExportPdf=P;
|