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,431 @@
|
|
|
1
|
+
import { N as v, n as x, m as k } from "./index-DnWWK9F_.js";
|
|
2
|
+
import { N as y, R as S } from "./index-DzcKxutn.js";
|
|
3
|
+
import { jsxs as f, jsx as d, Fragment as I } from "react/jsx-runtime";
|
|
4
|
+
import { useState as P, useCallback as R } from "react";
|
|
5
|
+
import { c as M } from "./clsx-OuTLNxxd.js";
|
|
6
|
+
import { Resizable as N } from "re-resizable";
|
|
7
|
+
import { g as l } from "./dom-dataset-CIEeltF6.js";
|
|
8
|
+
import { A as j } from "./toggle-Cdp4IT2U.js";
|
|
9
|
+
import { e as U } from "./index-BPfVXs5_.js";
|
|
10
|
+
import { u as q, a as A } from "./useButtonProps-BsEd4zYM.js";
|
|
11
|
+
import { I as L } from "./input-wJ9PDEzZ.js";
|
|
12
|
+
import { B as D } from "./button-DXMsXUEn.js";
|
|
13
|
+
const m = {
|
|
14
|
+
youtube: {
|
|
15
|
+
example: "https://www.youtube.com/watch?v=I4sMhHbHYXM",
|
|
16
|
+
src: "https://www.youtube.com/embed/I4sMhHbHYXM",
|
|
17
|
+
srcPrefix: "https://www.youtube.com/embed",
|
|
18
|
+
linkRule: [
|
|
19
|
+
/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\s/]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[&?]v=)|youtu\.be\/)([\w-]{11})/
|
|
20
|
+
]
|
|
21
|
+
},
|
|
22
|
+
youku: {
|
|
23
|
+
example: "https://v.youku.com/v_show/id_XNDM0NDM4MTcy.html?spm=a2h0c.8166622.PhoneSokuUgc_4.dtitle",
|
|
24
|
+
src: "https://player.youku.com/embed/XNDM0NDM4MTcy",
|
|
25
|
+
srcPrefix: "https://player.youku.com/embed",
|
|
26
|
+
linkRule: [String.raw`v.youku.com\/v_show\/id_\w+\=*`],
|
|
27
|
+
idRule: String.raw`id_\w+\=*`
|
|
28
|
+
},
|
|
29
|
+
bilibili: {
|
|
30
|
+
example: "https://www.bilibili.com/video/BV1EJ411u7DN",
|
|
31
|
+
src: "https://player.bilibili.com/player.html?bvid=BV1EJ411u7DN",
|
|
32
|
+
srcPrefix: "https://player.bilibili.com/player.html?bvid",
|
|
33
|
+
linkRule: [String.raw`www.bilibili.com\/video\/\w+`]
|
|
34
|
+
},
|
|
35
|
+
qqvideo: {
|
|
36
|
+
example: "https://v.qq.com/x/cover/mzc0020006aw1mn/u0033nvzb5v.html",
|
|
37
|
+
src: "https://v.qq.com/txp/iframe/player.html?vid=u0033nvzb5v",
|
|
38
|
+
srcPrefix: "https://v.qq.com/txp/iframe/player.html?vid",
|
|
39
|
+
linkRule: [String.raw`v.qq.com\/x\/cover\/\w+\/\w+`]
|
|
40
|
+
},
|
|
41
|
+
amap: {
|
|
42
|
+
example: "https://ditu.amap.com/",
|
|
43
|
+
src: "https://www.amap.com/place/B000A45467",
|
|
44
|
+
srcPrefix: "",
|
|
45
|
+
linkRule: [String.raw`\.amap\.com`]
|
|
46
|
+
},
|
|
47
|
+
baidu_map: {
|
|
48
|
+
example: "https://j.map.baidu.com/15/fo",
|
|
49
|
+
src: "https://j.map.baidu.com/15/fo",
|
|
50
|
+
srcPrefix: "",
|
|
51
|
+
linkRule: [String.raw`map\.baidu\.com`]
|
|
52
|
+
},
|
|
53
|
+
modao: {
|
|
54
|
+
example: "https://free.modao.cc/app/2cd26580a6717a147454df7470e7ec464093cba3/embed/v2#screen=sk71k6d1dfxulzx",
|
|
55
|
+
src: "https://free.modao.cc/app/6UkpAxcGE3nPz52GLqhnOZgC7MATBSy/embed/v2",
|
|
56
|
+
srcPrefix: "",
|
|
57
|
+
linkRule: [String.raw`https:\/\/\w+.modao.cc\/app\/\w+\/embed\/v2`],
|
|
58
|
+
tips: "Modao > More > Share > Embed > COPY"
|
|
59
|
+
},
|
|
60
|
+
lanhu: {
|
|
61
|
+
example: "https://lanhuapp.com/link/#/invite?sid=evP7L",
|
|
62
|
+
src: "https://lanhuapp.com/url/evP7L",
|
|
63
|
+
srcPrefix: "",
|
|
64
|
+
linkRule: [String.raw`https:\/\/lanhuapp.com\/url\/\w+`],
|
|
65
|
+
tips: "Lanhu > Project > Share > Copy Link"
|
|
66
|
+
},
|
|
67
|
+
figma: {
|
|
68
|
+
example: "https://www.figma.com/file/aS9uSgPXoNpaPkzbjNcK8v/Demo?node-id=0%3A1",
|
|
69
|
+
src: "https://www.figma.com/file/aS9uSgPXoNpaPkzbjNcK8v/Demo?node-id=0%3A1",
|
|
70
|
+
srcPrefix: "https://www.figma.com/embed?embed_host=share&url",
|
|
71
|
+
linkRule: [String.raw`https:\/\/www.figma.com\/file\/\w+`]
|
|
72
|
+
},
|
|
73
|
+
canva: {
|
|
74
|
+
example: "https://www.canva.cn/design/DAD61-t29UI/view",
|
|
75
|
+
src: "https://www.canva.cn/design/DAD61-t29UI/view",
|
|
76
|
+
srcPrefix: "",
|
|
77
|
+
linkRule: [String.raw`https:\/\/www.canva.cn\/design\/.+\/view`]
|
|
78
|
+
},
|
|
79
|
+
processon: {
|
|
80
|
+
example: "https://www.processon.com/embed/5ea99d8607912948b0e6fe78",
|
|
81
|
+
src: "https://www.processon.com/embed/5ea99d8607912948b0e6fe78",
|
|
82
|
+
srcPrefix: "",
|
|
83
|
+
linkRule: [String.raw`https:\/\/www.processon.com\/embed\/\w+`]
|
|
84
|
+
},
|
|
85
|
+
codepen: {
|
|
86
|
+
example: "https://codepen.io/mekery/embed/YzyrKOJ",
|
|
87
|
+
src: "https://codepen.io/mekery/embed/YzyrKOJ",
|
|
88
|
+
srcPrefix: "",
|
|
89
|
+
linkRule: [String.raw`https:\/\/codepen.io\/.+\/embed\/\w+`]
|
|
90
|
+
},
|
|
91
|
+
jinshuju: {
|
|
92
|
+
example: "https://jinshuju.net/f/q9YvVf",
|
|
93
|
+
src: "https://jinshuju.net/f/q9YvVf",
|
|
94
|
+
srcPrefix: "",
|
|
95
|
+
linkRule: [String.raw`https:\/\/jinshuju.net\/f\/\w+`]
|
|
96
|
+
},
|
|
97
|
+
iframe: {
|
|
98
|
+
example: "https://v.youku.com/v_show/id_XNDM0NDM4MTcy.html",
|
|
99
|
+
src: "https://player.youku.com/embed/XNDM0NDM4MTcy",
|
|
100
|
+
srcPrefix: "",
|
|
101
|
+
linkRule: [".+"]
|
|
102
|
+
},
|
|
103
|
+
googlemaps: {
|
|
104
|
+
example: "https://goo.gl/maps/8Ys8b4K1ZJY2",
|
|
105
|
+
src: "https://www.google.com/maps/embed?pb=https://goo.gl/maps/8Ys8b4K1ZJY2",
|
|
106
|
+
srcPrefix: "",
|
|
107
|
+
linkRule: [String.raw`https:\/\/goo.gl\/maps\/\w+`]
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
function _(e) {
|
|
111
|
+
const t = m.youtube, i = e.matchedUrl;
|
|
112
|
+
e.validLink = !0;
|
|
113
|
+
const r = i.split("="), n = r.length;
|
|
114
|
+
if (n > 0) {
|
|
115
|
+
const c = r[n - 1];
|
|
116
|
+
e.src = `${t.srcPrefix}/${c}`, e.validId = !0;
|
|
117
|
+
}
|
|
118
|
+
return e;
|
|
119
|
+
}
|
|
120
|
+
function $(e) {
|
|
121
|
+
const t = m.youku, i = e.matchedUrl, r = t.idRule, n = new RegExp(r), c = i.match(n);
|
|
122
|
+
if (c && c.length > 0) {
|
|
123
|
+
const o = c[0].slice(3);
|
|
124
|
+
e.validId = !0, e.src = `${t.srcPrefix}/${o}`;
|
|
125
|
+
} else
|
|
126
|
+
e.validId = !1;
|
|
127
|
+
return e;
|
|
128
|
+
}
|
|
129
|
+
function T(e) {
|
|
130
|
+
const t = m.bilibili, r = e.matchedUrl.split("/"), n = r.length;
|
|
131
|
+
if (n > 0) {
|
|
132
|
+
const c = r[n - 1];
|
|
133
|
+
e.src = `${t.srcPrefix}=${c}`, e.validId = !0;
|
|
134
|
+
}
|
|
135
|
+
return e;
|
|
136
|
+
}
|
|
137
|
+
function Y(e) {
|
|
138
|
+
const t = m.qqvideo, r = e.matchedUrl.split("/"), n = r.length;
|
|
139
|
+
if (n > 0) {
|
|
140
|
+
const c = r[n - 1];
|
|
141
|
+
e.src = `${t.srcPrefix}=${c}`, e.validId = !0;
|
|
142
|
+
}
|
|
143
|
+
return e;
|
|
144
|
+
}
|
|
145
|
+
function z(e, t) {
|
|
146
|
+
return t.src = e, t.validId = !0, t;
|
|
147
|
+
}
|
|
148
|
+
function C(e, t) {
|
|
149
|
+
return t.src = e, t.validId = !0, t;
|
|
150
|
+
}
|
|
151
|
+
function E(e, t) {
|
|
152
|
+
return t.src = e, t.validId = !0, t.originalLink = e, t;
|
|
153
|
+
}
|
|
154
|
+
function H(e) {
|
|
155
|
+
return e.src = e.matchedUrl, e.validId = !0, e.originalLink = e.src, e;
|
|
156
|
+
}
|
|
157
|
+
function B(e) {
|
|
158
|
+
return e.src = e.matchedUrl, e.validId = !0, e.originalLink = e.src, e;
|
|
159
|
+
}
|
|
160
|
+
function V(e) {
|
|
161
|
+
const t = m.figma;
|
|
162
|
+
return e.src = `${t.srcPrefix}=${encodeURIComponent(e.matchedUrl)}`, e.validId = !0, e.originalLink = e.matchedUrl, e;
|
|
163
|
+
}
|
|
164
|
+
function K(e, t) {
|
|
165
|
+
return t.src = `${t.matchedUrl}?embed`, t.validId = !0, t.originalLink = e, t;
|
|
166
|
+
}
|
|
167
|
+
function O(e, t) {
|
|
168
|
+
return t.src = `${t.matchedUrl}`, t.validId = !0, t.originalLink = e, t;
|
|
169
|
+
}
|
|
170
|
+
function X(e) {
|
|
171
|
+
return e.src = `${e.matchedUrl}`, e.validId = !0, e.originalLink = e.src, e;
|
|
172
|
+
}
|
|
173
|
+
function J(e, t) {
|
|
174
|
+
return t.src = `${t.matchedUrl}?background=white&banner=show&embedded=true`, t.validId = !0, t.originalLink = e, t;
|
|
175
|
+
}
|
|
176
|
+
function W(e, t) {
|
|
177
|
+
return t.src = `${t.matchedUrl}`, t.validId = !0, t.originalLink = e, t;
|
|
178
|
+
}
|
|
179
|
+
function F(e, t, i) {
|
|
180
|
+
if (e === "googlemaps")
|
|
181
|
+
return i.validLink = !0, i.matchedUrl = t, i;
|
|
182
|
+
const n = m[e].linkRule;
|
|
183
|
+
for (const c of n) {
|
|
184
|
+
const o = new RegExp(c), a = t.match(o);
|
|
185
|
+
if (a && a.length > 0)
|
|
186
|
+
return i.validLink = !0, i.matchedUrl = e === "youtube" ? a[1] : a[0], i;
|
|
187
|
+
}
|
|
188
|
+
return i;
|
|
189
|
+
}
|
|
190
|
+
function G(e) {
|
|
191
|
+
var i, r;
|
|
192
|
+
let t = "iframe";
|
|
193
|
+
return ((i = e.includes) != null && i.call(e, "youtube") || (r = e.includes) != null && r.call(e, "youtu.be")) && (t = "youtube"), e.includes("youku") && (t = "youku"), e.includes("bilibili") && (t = "bilibili"), e.includes("qq") && (t = "qqvideo"), e.includes("amap") && (t = "amap"), e.includes("map.baidu") && (t = "baidu_map"), (e.includes("google.com/maps") || e.includes("maps.app.goo.gl")) && (t = "googlemaps"), e.includes("modao") && (t = "modao"), e.includes("lanhuapp") && (t = "lanhu"), e.includes("figma") && (t = "figma"), e.includes("canva") && (t = "canva"), e.includes("processon") && (t = "processon"), e.includes("codepen") && (t = "codepen"), e.includes("jinshuju") && (t = "jinshuju"), e.includes("iframe") && (t = "iframe"), t;
|
|
194
|
+
}
|
|
195
|
+
function Z(e) {
|
|
196
|
+
let t = {
|
|
197
|
+
validLink: !1,
|
|
198
|
+
validId: !1,
|
|
199
|
+
matchedUrl: "",
|
|
200
|
+
originalLink: e,
|
|
201
|
+
src: ""
|
|
202
|
+
};
|
|
203
|
+
const i = G(e);
|
|
204
|
+
if (t = F(i, e, t), !t.validLink)
|
|
205
|
+
return t;
|
|
206
|
+
switch (i) {
|
|
207
|
+
case "youtube":
|
|
208
|
+
return _(t);
|
|
209
|
+
case "youku":
|
|
210
|
+
return $(t);
|
|
211
|
+
case "bilibili":
|
|
212
|
+
return T(t);
|
|
213
|
+
case "qqvideo":
|
|
214
|
+
return Y(t);
|
|
215
|
+
case "amap":
|
|
216
|
+
return z(e, t);
|
|
217
|
+
case "baidu_map":
|
|
218
|
+
return C(e, t);
|
|
219
|
+
case "googlemaps":
|
|
220
|
+
return E(e, t);
|
|
221
|
+
case "modao":
|
|
222
|
+
return H(t);
|
|
223
|
+
case "lanhu":
|
|
224
|
+
return B(t);
|
|
225
|
+
case "figma":
|
|
226
|
+
return V(t);
|
|
227
|
+
case "canva":
|
|
228
|
+
return K(e, t);
|
|
229
|
+
case "processon":
|
|
230
|
+
return O(e, t);
|
|
231
|
+
case "codepen":
|
|
232
|
+
return X(t);
|
|
233
|
+
case "jinshuju":
|
|
234
|
+
return J(e, t);
|
|
235
|
+
case "iframe":
|
|
236
|
+
return W(e, t);
|
|
237
|
+
default:
|
|
238
|
+
return e;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
const Q = "_wrap_5y04w_1", ee = "_innerWrap_5y04w_15", w = {
|
|
242
|
+
wrap: Q,
|
|
243
|
+
innerWrap: ee
|
|
244
|
+
};
|
|
245
|
+
function te({ editor: e, node: t, updateAttributes: i }) {
|
|
246
|
+
const r = U(), { src: n, width: c, height: o } = t.attrs, [a, p] = P("");
|
|
247
|
+
function u() {
|
|
248
|
+
if (!a)
|
|
249
|
+
return;
|
|
250
|
+
const s = Z(a);
|
|
251
|
+
e.chain().updateAttributes(b.name, {
|
|
252
|
+
src: (s == null ? void 0 : s.src) || a
|
|
253
|
+
}).setNodeSelection(e.state.selection.from).focus().run();
|
|
254
|
+
}
|
|
255
|
+
const g = R(
|
|
256
|
+
(s) => {
|
|
257
|
+
i({ width: s.width, height: s.height });
|
|
258
|
+
},
|
|
259
|
+
[i]
|
|
260
|
+
);
|
|
261
|
+
return /* @__PURE__ */ f(y, { children: [
|
|
262
|
+
!n && /* @__PURE__ */ f("div", { className: "richtext-mx-auto richtext-my-[12px] richtext-flex richtext-max-w-[600px] richtext-items-center richtext-justify-center richtext-gap-[10px] richtext-rounded-[12px] richtext-border richtext-border-solid richtext-border-[#ccc] richtext-p-[10px]", children: [
|
|
263
|
+
/* @__PURE__ */ d(
|
|
264
|
+
L,
|
|
265
|
+
{
|
|
266
|
+
autoFocus: !0,
|
|
267
|
+
className: "richtext-flex-1",
|
|
268
|
+
onInput: (s) => p(s.target.value),
|
|
269
|
+
placeholder: "Enter link",
|
|
270
|
+
type: "url",
|
|
271
|
+
value: a
|
|
272
|
+
}
|
|
273
|
+
),
|
|
274
|
+
/* @__PURE__ */ d(
|
|
275
|
+
D,
|
|
276
|
+
{
|
|
277
|
+
className: "richtext-w-[60px]",
|
|
278
|
+
onClick: u,
|
|
279
|
+
children: "OK"
|
|
280
|
+
}
|
|
281
|
+
)
|
|
282
|
+
] }),
|
|
283
|
+
n && /* @__PURE__ */ d(
|
|
284
|
+
N,
|
|
285
|
+
{
|
|
286
|
+
size: { width: Number.parseInt(c), height: Number.parseInt(o) },
|
|
287
|
+
onResizeStop: (s, ie, re, h) => {
|
|
288
|
+
g({
|
|
289
|
+
width: Number.parseInt(c) + h.width,
|
|
290
|
+
height: Number.parseInt(o) + h.height
|
|
291
|
+
});
|
|
292
|
+
},
|
|
293
|
+
children: /* @__PURE__ */ d("div", { className: M(w.wrap, "render-wrapper"), children: /* @__PURE__ */ d(
|
|
294
|
+
"div",
|
|
295
|
+
{
|
|
296
|
+
className: w.innerWrap,
|
|
297
|
+
style: { pointerEvents: r ? "none" : "auto" },
|
|
298
|
+
children: /* @__PURE__ */ d(
|
|
299
|
+
"iframe",
|
|
300
|
+
{
|
|
301
|
+
className: "richtext-my-[12px] ",
|
|
302
|
+
src: n
|
|
303
|
+
}
|
|
304
|
+
)
|
|
305
|
+
}
|
|
306
|
+
) })
|
|
307
|
+
}
|
|
308
|
+
)
|
|
309
|
+
] });
|
|
310
|
+
}
|
|
311
|
+
function we() {
|
|
312
|
+
const e = q(b.name), {
|
|
313
|
+
icon: t = void 0,
|
|
314
|
+
tooltip: i = void 0,
|
|
315
|
+
shortcutKeys: r = void 0,
|
|
316
|
+
tooltipOptions: n = {},
|
|
317
|
+
action: c = void 0,
|
|
318
|
+
isActive: o = void 0
|
|
319
|
+
} = (e == null ? void 0 : e.componentProps) ?? {}, { editorDisabled: a, update: p } = A(o), u = () => {
|
|
320
|
+
a || c && (c(), p());
|
|
321
|
+
};
|
|
322
|
+
return e ? /* @__PURE__ */ d(
|
|
323
|
+
j,
|
|
324
|
+
{
|
|
325
|
+
action: u,
|
|
326
|
+
disabled: a,
|
|
327
|
+
icon: t,
|
|
328
|
+
shortcutKeys: r,
|
|
329
|
+
tooltip: i,
|
|
330
|
+
tooltipOptions: n
|
|
331
|
+
}
|
|
332
|
+
) : /* @__PURE__ */ d(I, {});
|
|
333
|
+
}
|
|
334
|
+
const b = /* @__PURE__ */ v.create({
|
|
335
|
+
name: "iframe",
|
|
336
|
+
content: "",
|
|
337
|
+
marks: "",
|
|
338
|
+
group: "block",
|
|
339
|
+
selectable: !0,
|
|
340
|
+
atom: !0,
|
|
341
|
+
draggable: !0,
|
|
342
|
+
addOptions() {
|
|
343
|
+
var e;
|
|
344
|
+
return {
|
|
345
|
+
...(e = this.parent) == null ? void 0 : e.call(this),
|
|
346
|
+
HTMLAttributes: {
|
|
347
|
+
class: "iframe"
|
|
348
|
+
},
|
|
349
|
+
button: ({
|
|
350
|
+
editor: t,
|
|
351
|
+
extension: i,
|
|
352
|
+
t: r
|
|
353
|
+
}) => ({
|
|
354
|
+
componentProps: {
|
|
355
|
+
action: (n) => t.commands.setIframe(n),
|
|
356
|
+
upload: i.options.upload,
|
|
357
|
+
// isActive: () => editor.can().setIframe({}),
|
|
358
|
+
icon: "Iframe",
|
|
359
|
+
tooltip: r("editor.iframe.tooltip")
|
|
360
|
+
}
|
|
361
|
+
})
|
|
362
|
+
};
|
|
363
|
+
},
|
|
364
|
+
addAttributes() {
|
|
365
|
+
return {
|
|
366
|
+
width: {
|
|
367
|
+
default: 600,
|
|
368
|
+
parseHTML: l("width")
|
|
369
|
+
},
|
|
370
|
+
height: {
|
|
371
|
+
default: 300,
|
|
372
|
+
parseHTML: l("height")
|
|
373
|
+
},
|
|
374
|
+
src: {
|
|
375
|
+
default: null,
|
|
376
|
+
parseHTML: l("src")
|
|
377
|
+
},
|
|
378
|
+
defaultShowPicker: {
|
|
379
|
+
default: !1
|
|
380
|
+
},
|
|
381
|
+
frameborder: {
|
|
382
|
+
default: 0
|
|
383
|
+
},
|
|
384
|
+
allowfullscreen: {
|
|
385
|
+
default: this.options.allowFullscreen,
|
|
386
|
+
parseHTML: () => this.options.allowFullscreen
|
|
387
|
+
}
|
|
388
|
+
};
|
|
389
|
+
},
|
|
390
|
+
parseHTML() {
|
|
391
|
+
return [
|
|
392
|
+
{
|
|
393
|
+
tag: "iframe"
|
|
394
|
+
}
|
|
395
|
+
];
|
|
396
|
+
},
|
|
397
|
+
renderHTML({ HTMLAttributes: e }) {
|
|
398
|
+
return ["iframe", k(this.options.HTMLAttributes, e)];
|
|
399
|
+
},
|
|
400
|
+
addCommands() {
|
|
401
|
+
return {
|
|
402
|
+
setIframe: (e) => ({ tr: t, commands: i, chain: r }) => {
|
|
403
|
+
var c, o, a;
|
|
404
|
+
if (((a = (o = (c = t.selection) == null ? void 0 : c.node) == null ? void 0 : o.type) == null ? void 0 : a.name) == this.name)
|
|
405
|
+
return i.updateAttributes(this.name, e);
|
|
406
|
+
const n = e || { url: "" };
|
|
407
|
+
return r().insertContent({
|
|
408
|
+
type: this.name,
|
|
409
|
+
attrs: n
|
|
410
|
+
}).run();
|
|
411
|
+
}
|
|
412
|
+
};
|
|
413
|
+
},
|
|
414
|
+
addInputRules() {
|
|
415
|
+
return [
|
|
416
|
+
x({
|
|
417
|
+
find: /^\$iframe\$$/,
|
|
418
|
+
type: this.type,
|
|
419
|
+
getAttributes: () => ({ width: "100%" })
|
|
420
|
+
})
|
|
421
|
+
];
|
|
422
|
+
},
|
|
423
|
+
addNodeView() {
|
|
424
|
+
return S(te);
|
|
425
|
+
}
|
|
426
|
+
});
|
|
427
|
+
export {
|
|
428
|
+
b as I,
|
|
429
|
+
we as R,
|
|
430
|
+
Z as g
|
|
431
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const l=require("./index-RfTlOzIr.cjs"),v=require("./index-BH4bc3jN.cjs"),s=require("react/jsx-runtime"),b=require("react"),S=require("./clsx-C11secjj.cjs"),I=require("re-resizable"),h=require("./dom-dataset-BqoJhJXt.cjs"),P=require("./toggle-D41PzQLJ.cjs"),R=require("./index-DV5kbgRU.cjs"),g=require("./useButtonProps-C6Vpn190.cjs"),q=require("./input-_ECRfn3Y.cjs"),j=require("./button-B12K7BJ4.cjs"),u={youtube:{example:"https://www.youtube.com/watch?v=I4sMhHbHYXM",src:"https://www.youtube.com/embed/I4sMhHbHYXM",srcPrefix:"https://www.youtube.com/embed",linkRule:[/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^\s/]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[&?]v=)|youtu\.be\/)([\w-]{11})/]},youku:{example:"https://v.youku.com/v_show/id_XNDM0NDM4MTcy.html?spm=a2h0c.8166622.PhoneSokuUgc_4.dtitle",src:"https://player.youku.com/embed/XNDM0NDM4MTcy",srcPrefix:"https://player.youku.com/embed",linkRule:[String.raw`v.youku.com\/v_show\/id_\w+\=*`],idRule:String.raw`id_\w+\=*`},bilibili:{example:"https://www.bilibili.com/video/BV1EJ411u7DN",src:"https://player.bilibili.com/player.html?bvid=BV1EJ411u7DN",srcPrefix:"https://player.bilibili.com/player.html?bvid",linkRule:[String.raw`www.bilibili.com\/video\/\w+`]},qqvideo:{example:"https://v.qq.com/x/cover/mzc0020006aw1mn/u0033nvzb5v.html",src:"https://v.qq.com/txp/iframe/player.html?vid=u0033nvzb5v",srcPrefix:"https://v.qq.com/txp/iframe/player.html?vid",linkRule:[String.raw`v.qq.com\/x\/cover\/\w+\/\w+`]},amap:{example:"https://ditu.amap.com/",src:"https://www.amap.com/place/B000A45467",srcPrefix:"",linkRule:[String.raw`\.amap\.com`]},baidu_map:{example:"https://j.map.baidu.com/15/fo",src:"https://j.map.baidu.com/15/fo",srcPrefix:"",linkRule:[String.raw`map\.baidu\.com`]},modao:{example:"https://free.modao.cc/app/2cd26580a6717a147454df7470e7ec464093cba3/embed/v2#screen=sk71k6d1dfxulzx",src:"https://free.modao.cc/app/6UkpAxcGE3nPz52GLqhnOZgC7MATBSy/embed/v2",srcPrefix:"",linkRule:[String.raw`https:\/\/\w+.modao.cc\/app\/\w+\/embed\/v2`],tips:"Modao > More > Share > Embed > COPY"},lanhu:{example:"https://lanhuapp.com/link/#/invite?sid=evP7L",src:"https://lanhuapp.com/url/evP7L",srcPrefix:"",linkRule:[String.raw`https:\/\/lanhuapp.com\/url\/\w+`],tips:"Lanhu > Project > Share > Copy Link"},figma:{example:"https://www.figma.com/file/aS9uSgPXoNpaPkzbjNcK8v/Demo?node-id=0%3A1",src:"https://www.figma.com/file/aS9uSgPXoNpaPkzbjNcK8v/Demo?node-id=0%3A1",srcPrefix:"https://www.figma.com/embed?embed_host=share&url",linkRule:[String.raw`https:\/\/www.figma.com\/file\/\w+`]},canva:{example:"https://www.canva.cn/design/DAD61-t29UI/view",src:"https://www.canva.cn/design/DAD61-t29UI/view",srcPrefix:"",linkRule:[String.raw`https:\/\/www.canva.cn\/design\/.+\/view`]},processon:{example:"https://www.processon.com/embed/5ea99d8607912948b0e6fe78",src:"https://www.processon.com/embed/5ea99d8607912948b0e6fe78",srcPrefix:"",linkRule:[String.raw`https:\/\/www.processon.com\/embed\/\w+`]},codepen:{example:"https://codepen.io/mekery/embed/YzyrKOJ",src:"https://codepen.io/mekery/embed/YzyrKOJ",srcPrefix:"",linkRule:[String.raw`https:\/\/codepen.io\/.+\/embed\/\w+`]},jinshuju:{example:"https://jinshuju.net/f/q9YvVf",src:"https://jinshuju.net/f/q9YvVf",srcPrefix:"",linkRule:[String.raw`https:\/\/jinshuju.net\/f\/\w+`]},iframe:{example:"https://v.youku.com/v_show/id_XNDM0NDM4MTcy.html",src:"https://player.youku.com/embed/XNDM0NDM4MTcy",srcPrefix:"",linkRule:[".+"]},googlemaps:{example:"https://goo.gl/maps/8Ys8b4K1ZJY2",src:"https://www.google.com/maps/embed?pb=https://goo.gl/maps/8Ys8b4K1ZJY2",srcPrefix:"",linkRule:[String.raw`https:\/\/goo.gl\/maps\/\w+`]}};function M(e){const t=u.youtube,i=e.matchedUrl;e.validLink=!0;const r=i.split("="),n=r.length;if(n>0){const c=r[n-1];e.src=`${t.srcPrefix}/${c}`,e.validId=!0}return e}function N(e){const t=u.youku,i=e.matchedUrl,r=t.idRule,n=new RegExp(r),c=i.match(n);if(c&&c.length>0){const o=c[0].slice(3);e.validId=!0,e.src=`${t.srcPrefix}/${o}`}else e.validId=!1;return e}function U(e){const t=u.bilibili,r=e.matchedUrl.split("/"),n=r.length;if(n>0){const c=r[n-1];e.src=`${t.srcPrefix}=${c}`,e.validId=!0}return e}function A(e){const t=u.qqvideo,r=e.matchedUrl.split("/"),n=r.length;if(n>0){const c=r[n-1];e.src=`${t.srcPrefix}=${c}`,e.validId=!0}return e}function D(e,t){return t.src=e,t.validId=!0,t}function $(e,t){return t.src=e,t.validId=!0,t}function L(e,t){return t.src=e,t.validId=!0,t.originalLink=e,t}function _(e){return e.src=e.matchedUrl,e.validId=!0,e.originalLink=e.src,e}function T(e){return e.src=e.matchedUrl,e.validId=!0,e.originalLink=e.src,e}function z(e){const t=u.figma;return e.src=`${t.srcPrefix}=${encodeURIComponent(e.matchedUrl)}`,e.validId=!0,e.originalLink=e.matchedUrl,e}function Y(e,t){return t.src=`${t.matchedUrl}?embed`,t.validId=!0,t.originalLink=e,t}function C(e,t){return t.src=`${t.matchedUrl}`,t.validId=!0,t.originalLink=e,t}function E(e){return e.src=`${e.matchedUrl}`,e.validId=!0,e.originalLink=e.src,e}function H(e,t){return t.src=`${t.matchedUrl}?background=white&banner=show&embedded=true`,t.validId=!0,t.originalLink=e,t}function B(e,t){return t.src=`${t.matchedUrl}`,t.validId=!0,t.originalLink=e,t}function V(e,t,i){if(e==="googlemaps")return i.validLink=!0,i.matchedUrl=t,i;const n=u[e].linkRule;for(const c of n){const o=new RegExp(c),a=t.match(o);if(a&&a.length>0)return i.validLink=!0,i.matchedUrl=e==="youtube"?a[1]:a[0],i}return i}function K(e){var i,r;let t="iframe";return((i=e.includes)!=null&&i.call(e,"youtube")||(r=e.includes)!=null&&r.call(e,"youtu.be"))&&(t="youtube"),e.includes("youku")&&(t="youku"),e.includes("bilibili")&&(t="bilibili"),e.includes("qq")&&(t="qqvideo"),e.includes("amap")&&(t="amap"),e.includes("map.baidu")&&(t="baidu_map"),(e.includes("google.com/maps")||e.includes("maps.app.goo.gl"))&&(t="googlemaps"),e.includes("modao")&&(t="modao"),e.includes("lanhuapp")&&(t="lanhu"),e.includes("figma")&&(t="figma"),e.includes("canva")&&(t="canva"),e.includes("processon")&&(t="processon"),e.includes("codepen")&&(t="codepen"),e.includes("jinshuju")&&(t="jinshuju"),e.includes("iframe")&&(t="iframe"),t}function k(e){let t={validLink:!1,validId:!1,matchedUrl:"",originalLink:e,src:""};const i=K(e);if(t=V(i,e,t),!t.validLink)return t;switch(i){case"youtube":return M(t);case"youku":return N(t);case"bilibili":return U(t);case"qqvideo":return A(t);case"amap":return D(e,t);case"baidu_map":return $(e,t);case"googlemaps":return L(e,t);case"modao":return _(t);case"lanhu":return T(t);case"figma":return z(t);case"canva":return Y(e,t);case"processon":return C(e,t);case"codepen":return E(t);case"jinshuju":return H(e,t);case"iframe":return B(e,t);default:return e}}const O="_wrap_5y04w_1",X="_innerWrap_5y04w_15",x={wrap:O,innerWrap:X};function J({editor:e,node:t,updateAttributes:i}){const r=R.useEditableEditor(),{src:n,width:c,height:o}=t.attrs,[a,m]=b.useState("");function p(){if(!a)return;const d=k(a);e.chain().updateAttributes(f.name,{src:(d==null?void 0:d.src)||a}).setNodeSelection(e.state.selection.from).focus().run()}const y=b.useCallback(d=>{i({width:d.width,height:d.height})},[i]);return s.jsxs(v.NodeViewWrapper,{children:[!n&&s.jsxs("div",{className:"richtext-mx-auto richtext-my-[12px] richtext-flex richtext-max-w-[600px] richtext-items-center richtext-justify-center richtext-gap-[10px] richtext-rounded-[12px] richtext-border richtext-border-solid richtext-border-[#ccc] richtext-p-[10px]",children:[s.jsx(q.Input,{autoFocus:!0,className:"richtext-flex-1",onInput:d=>m(d.target.value),placeholder:"Enter link",type:"url",value:a}),s.jsx(j.Button,{className:"richtext-w-[60px]",onClick:p,children:"OK"})]}),n&&s.jsx(I.Resizable,{size:{width:Number.parseInt(c),height:Number.parseInt(o)},onResizeStop:(d,F,G,w)=>{y({width:Number.parseInt(c)+w.width,height:Number.parseInt(o)+w.height})},children:s.jsx("div",{className:S.clsx(x.wrap,"render-wrapper"),children:s.jsx("div",{className:x.innerWrap,style:{pointerEvents:r?"none":"auto"},children:s.jsx("iframe",{className:"richtext-my-[12px] ",src:n})})})})]})}function W(){const e=g.useButtonProps(f.name),{icon:t=void 0,tooltip:i=void 0,shortcutKeys:r=void 0,tooltipOptions:n={},action:c=void 0,isActive:o=void 0}=(e==null?void 0:e.componentProps)??{},{editorDisabled:a,update:m}=g.useToggleActive(o),p=()=>{a||c&&(c(),m())};return e?s.jsx(P.ActionButton,{action:p,disabled:a,icon:t,shortcutKeys:r,tooltip:i,tooltipOptions:n}):s.jsx(s.Fragment,{})}const f=l.Node3.create({name:"iframe",content:"",marks:"",group:"block",selectable:!0,atom:!0,draggable:!0,addOptions(){var e;return{...(e=this.parent)==null?void 0:e.call(this),HTMLAttributes:{class:"iframe"},button:({editor:t,extension:i,t:r})=>({componentProps:{action:n=>t.commands.setIframe(n),upload:i.options.upload,icon:"Iframe",tooltip:r("editor.iframe.tooltip")}})}},addAttributes(){return{width:{default:600,parseHTML:h.getDatasetAttribute("width")},height:{default:300,parseHTML:h.getDatasetAttribute("height")},src:{default:null,parseHTML:h.getDatasetAttribute("src")},defaultShowPicker:{default:!1},frameborder:{default:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen}}},parseHTML(){return[{tag:"iframe"}]},renderHTML({HTMLAttributes:e}){return["iframe",l.mergeAttributes(this.options.HTMLAttributes,e)]},addCommands(){return{setIframe:e=>({tr:t,commands:i,chain:r})=>{var c,o,a;if(((a=(o=(c=t.selection)==null?void 0:c.node)==null?void 0:o.type)==null?void 0:a.name)==this.name)return i.updateAttributes(this.name,e);const n=e||{url:""};return r().insertContent({type:this.name,attrs:n}).run()}}},addInputRules(){return[l.nodeInputRule({find:/^\$iframe\$$/,type:this.type,getAttributes:()=>({width:"100%"})})]},addNodeView(){return v.ReactNodeViewRenderer(J)}});exports.Iframe=f;exports.RichTextIframe=W;exports.getServiceSrc=k;
|
package/lib/Iframe.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("./Iframe-Cvca2G7X.cjs");require("./dom-dataset-BqoJhJXt.cjs");exports.Iframe=e.Iframe;exports.RichTextIframe=e.RichTextIframe;
|
package/lib/Iframe.d.cts
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
+
import { JSX } from 'react/jsx-runtime';
|
|
1
2
|
import { Node as Node_2 } from '@tiptap/core';
|
|
2
3
|
|
|
3
4
|
export declare const Iframe: Node_2<any, any>;
|
|
4
5
|
|
|
5
|
-
export declare
|
|
6
|
-
width?: number | string;
|
|
7
|
-
height?: number;
|
|
8
|
-
src?: string;
|
|
9
|
-
defaultShowPicker?: boolean;
|
|
10
|
-
}
|
|
6
|
+
export declare function RichTextIframe(): JSX.Element;
|
|
11
7
|
|
|
12
8
|
export { }
|
|
13
9
|
|
|
@@ -42,6 +38,27 @@ declare module '@tiptap/core' {
|
|
|
42
38
|
}
|
|
43
39
|
|
|
44
40
|
|
|
41
|
+
declare module '@tiptap/core' {
|
|
42
|
+
interface Storage {
|
|
43
|
+
color: ColorStorage;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
declare module '@tiptap/core' {
|
|
49
|
+
interface Commands<ReturnType> {
|
|
50
|
+
columns: {
|
|
51
|
+
insertColumns: (attrs?: {
|
|
52
|
+
cols: number;
|
|
53
|
+
}) => ReturnType;
|
|
54
|
+
addColBefore: () => ReturnType;
|
|
55
|
+
addColAfter: () => ReturnType;
|
|
56
|
+
deleteCol: () => ReturnType;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
45
62
|
declare module '@tiptap/core' {
|
|
46
63
|
interface Commands<ReturnType> {
|
|
47
64
|
drawer: {
|
|
@@ -73,7 +90,7 @@ declare module '@tiptap/core' {
|
|
|
73
90
|
declare module '@tiptap/core' {
|
|
74
91
|
interface Commands<ReturnType> {
|
|
75
92
|
exportWord: {
|
|
76
|
-
exportToWord: () => ReturnType;
|
|
93
|
+
exportToWord: (docState: any) => ReturnType;
|
|
77
94
|
};
|
|
78
95
|
}
|
|
79
96
|
}
|
|
@@ -98,10 +115,8 @@ declare module '@tiptap/core' {
|
|
|
98
115
|
|
|
99
116
|
|
|
100
117
|
declare module '@tiptap/core' {
|
|
101
|
-
interface
|
|
102
|
-
|
|
103
|
-
setPainter: (marks: Mark[]) => ReturnType;
|
|
104
|
-
};
|
|
118
|
+
interface Storage {
|
|
119
|
+
highlight: HighlightStorage;
|
|
105
120
|
}
|
|
106
121
|
}
|
|
107
122
|
|
|
@@ -186,16 +201,6 @@ declare module '@tiptap/core' {
|
|
|
186
201
|
}
|
|
187
202
|
|
|
188
203
|
|
|
189
|
-
declare module '@tiptap/core' {
|
|
190
|
-
interface Commands<ReturnType> {
|
|
191
|
-
lineHeight: {
|
|
192
|
-
setLineHeight: (lineHeight: string) => ReturnType;
|
|
193
|
-
unsetLineHeight: () => ReturnType;
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
|
|
199
204
|
declare module '@tiptap/core' {
|
|
200
205
|
interface Commands<ReturnType> {
|
|
201
206
|
mermaid: {
|
|
@@ -206,20 +211,6 @@ declare module '@tiptap/core' {
|
|
|
206
211
|
}
|
|
207
212
|
|
|
208
213
|
|
|
209
|
-
declare module '@tiptap/core' {
|
|
210
|
-
interface Commands<ReturnType> {
|
|
211
|
-
columns: {
|
|
212
|
-
insertColumns: (attrs?: {
|
|
213
|
-
cols: number;
|
|
214
|
-
}) => ReturnType;
|
|
215
|
-
addColBefore: () => ReturnType;
|
|
216
|
-
addColAfter: () => ReturnType;
|
|
217
|
-
deleteCol: () => ReturnType;
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
|
|
223
214
|
declare module '@tiptap/core' {
|
|
224
215
|
interface Commands<ReturnType> {
|
|
225
216
|
search: {
|
|
@@ -243,16 +234,6 @@ declare module '@tiptap/core' {
|
|
|
243
234
|
}
|
|
244
235
|
|
|
245
236
|
|
|
246
|
-
declare module '@tiptap/core' {
|
|
247
|
-
interface Commands<ReturnType> {
|
|
248
|
-
tableOfContents: {
|
|
249
|
-
setTableOfContents: () => ReturnType;
|
|
250
|
-
removeTableOfContents: () => ReturnType;
|
|
251
|
-
};
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
|
|
256
237
|
declare module '@tiptap/core' {
|
|
257
238
|
interface Commands<ReturnType> {
|
|
258
239
|
twitter: {
|
package/lib/Iframe.d.ts
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
|
+
import { JSX } from 'react/jsx-runtime';
|
|
1
2
|
import { Node as Node_2 } from '@tiptap/core';
|
|
2
3
|
|
|
3
4
|
export declare const Iframe: Node_2<any, any>;
|
|
4
5
|
|
|
5
|
-
export declare
|
|
6
|
-
width?: number | string;
|
|
7
|
-
height?: number;
|
|
8
|
-
src?: string;
|
|
9
|
-
defaultShowPicker?: boolean;
|
|
10
|
-
}
|
|
6
|
+
export declare function RichTextIframe(): JSX.Element;
|
|
11
7
|
|
|
12
8
|
export { }
|
|
13
9
|
|
|
@@ -42,6 +38,27 @@ declare module '@tiptap/core' {
|
|
|
42
38
|
}
|
|
43
39
|
|
|
44
40
|
|
|
41
|
+
declare module '@tiptap/core' {
|
|
42
|
+
interface Storage {
|
|
43
|
+
color: ColorStorage;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
declare module '@tiptap/core' {
|
|
49
|
+
interface Commands<ReturnType> {
|
|
50
|
+
columns: {
|
|
51
|
+
insertColumns: (attrs?: {
|
|
52
|
+
cols: number;
|
|
53
|
+
}) => ReturnType;
|
|
54
|
+
addColBefore: () => ReturnType;
|
|
55
|
+
addColAfter: () => ReturnType;
|
|
56
|
+
deleteCol: () => ReturnType;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
45
62
|
declare module '@tiptap/core' {
|
|
46
63
|
interface Commands<ReturnType> {
|
|
47
64
|
drawer: {
|
|
@@ -73,7 +90,7 @@ declare module '@tiptap/core' {
|
|
|
73
90
|
declare module '@tiptap/core' {
|
|
74
91
|
interface Commands<ReturnType> {
|
|
75
92
|
exportWord: {
|
|
76
|
-
exportToWord: () => ReturnType;
|
|
93
|
+
exportToWord: (docState: any) => ReturnType;
|
|
77
94
|
};
|
|
78
95
|
}
|
|
79
96
|
}
|
|
@@ -98,10 +115,8 @@ declare module '@tiptap/core' {
|
|
|
98
115
|
|
|
99
116
|
|
|
100
117
|
declare module '@tiptap/core' {
|
|
101
|
-
interface
|
|
102
|
-
|
|
103
|
-
setPainter: (marks: Mark[]) => ReturnType;
|
|
104
|
-
};
|
|
118
|
+
interface Storage {
|
|
119
|
+
highlight: HighlightStorage;
|
|
105
120
|
}
|
|
106
121
|
}
|
|
107
122
|
|
|
@@ -186,16 +201,6 @@ declare module '@tiptap/core' {
|
|
|
186
201
|
}
|
|
187
202
|
|
|
188
203
|
|
|
189
|
-
declare module '@tiptap/core' {
|
|
190
|
-
interface Commands<ReturnType> {
|
|
191
|
-
lineHeight: {
|
|
192
|
-
setLineHeight: (lineHeight: string) => ReturnType;
|
|
193
|
-
unsetLineHeight: () => ReturnType;
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
|
|
199
204
|
declare module '@tiptap/core' {
|
|
200
205
|
interface Commands<ReturnType> {
|
|
201
206
|
mermaid: {
|
|
@@ -206,20 +211,6 @@ declare module '@tiptap/core' {
|
|
|
206
211
|
}
|
|
207
212
|
|
|
208
213
|
|
|
209
|
-
declare module '@tiptap/core' {
|
|
210
|
-
interface Commands<ReturnType> {
|
|
211
|
-
columns: {
|
|
212
|
-
insertColumns: (attrs?: {
|
|
213
|
-
cols: number;
|
|
214
|
-
}) => ReturnType;
|
|
215
|
-
addColBefore: () => ReturnType;
|
|
216
|
-
addColAfter: () => ReturnType;
|
|
217
|
-
deleteCol: () => ReturnType;
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
|
|
223
214
|
declare module '@tiptap/core' {
|
|
224
215
|
interface Commands<ReturnType> {
|
|
225
216
|
search: {
|
|
@@ -243,16 +234,6 @@ declare module '@tiptap/core' {
|
|
|
243
234
|
}
|
|
244
235
|
|
|
245
236
|
|
|
246
|
-
declare module '@tiptap/core' {
|
|
247
|
-
interface Commands<ReturnType> {
|
|
248
|
-
tableOfContents: {
|
|
249
|
-
setTableOfContents: () => ReturnType;
|
|
250
|
-
removeTableOfContents: () => ReturnType;
|
|
251
|
-
};
|
|
252
|
-
}
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
|
|
256
237
|
declare module '@tiptap/core' {
|
|
257
238
|
interface Commands<ReturnType> {
|
|
258
239
|
twitter: {
|