reactjs-tiptap-editor 0.4.2 → 1.0.0

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.
Files changed (338) hide show
  1. package/lib/ActionMenuButton-BKOg7hkq.js +38 -0
  2. package/lib/ActionMenuButton-DLQyd_gx.cjs +1 -0
  3. package/lib/Attachment.cjs +2 -2
  4. package/lib/Attachment.d.cts +32 -44
  5. package/lib/Attachment.d.ts +32 -44
  6. package/lib/Attachment.js +129 -99
  7. package/lib/Blockquote.cjs +3 -3
  8. package/lib/Blockquote.d.cts +32 -44
  9. package/lib/Blockquote.d.ts +32 -44
  10. package/lib/Blockquote.js +50 -22
  11. package/lib/Bold.cjs +1 -1
  12. package/lib/Bold.d.cts +32 -44
  13. package/lib/Bold.d.ts +32 -44
  14. package/lib/Bold.js +48 -20
  15. package/lib/BulletList.cjs +1 -1
  16. package/lib/BulletList.d.cts +32 -44
  17. package/lib/BulletList.d.ts +32 -44
  18. package/lib/BulletList.js +38 -9
  19. package/lib/Clear.cjs +1 -1
  20. package/lib/Clear.d.cts +32 -44
  21. package/lib/Clear.d.ts +32 -44
  22. package/lib/Clear.js +32 -6
  23. package/lib/Code.cjs +1 -1
  24. package/lib/Code.d.cts +32 -44
  25. package/lib/Code.d.ts +32 -44
  26. package/lib/Code.js +53 -25
  27. package/lib/CodeBlock.cjs +35 -35
  28. package/lib/CodeBlock.d.cts +32 -44
  29. package/lib/CodeBlock.d.ts +32 -44
  30. package/lib/CodeBlock.js +605 -590
  31. package/lib/CodeView.cjs +1 -1
  32. package/lib/CodeView.d.cts +33 -45
  33. package/lib/CodeView.d.ts +33 -45
  34. package/lib/CodeView.js +49 -21
  35. package/lib/Color.cjs +1 -1
  36. package/lib/Color.d.cts +36 -44
  37. package/lib/Color.d.ts +36 -44
  38. package/lib/Color.js +123 -79
  39. package/lib/Column.cjs +1 -0
  40. package/lib/{Document.d.cts → Column.d.cts} +38 -47
  41. package/lib/{Document.d.ts → Column.d.ts} +38 -47
  42. package/lib/Column.js +217 -0
  43. package/lib/{Drawer-CaAfmqNo.js → Drawer-DZ5jvmrX.js} +404 -394
  44. package/lib/Drawer-SRhwOc6T.cjs +1 -0
  45. package/lib/Drawer.cjs +1 -1
  46. package/lib/Drawer.d.cts +32 -44
  47. package/lib/Drawer.d.ts +32 -44
  48. package/lib/Drawer.js +6 -5
  49. package/lib/Emoji.cjs +1 -1
  50. package/lib/Emoji.d.cts +32 -49
  51. package/lib/Emoji.d.ts +32 -49
  52. package/lib/Emoji.js +377 -392
  53. package/lib/Excalidraw-DwBRXEtC.js +345 -0
  54. package/lib/Excalidraw-ZN3DQvDC.cjs +1 -0
  55. package/lib/Excalidraw.cjs +1 -1
  56. package/lib/Excalidraw.d.cts +32 -44
  57. package/lib/Excalidraw.d.ts +32 -44
  58. package/lib/Excalidraw.js +6 -4
  59. package/lib/ExportPdf.cjs +5 -5
  60. package/lib/ExportPdf.d.cts +32 -44
  61. package/lib/ExportPdf.d.ts +32 -44
  62. package/lib/ExportPdf.js +60 -32
  63. package/lib/ExportWord.cjs +1 -1
  64. package/lib/ExportWord.d.cts +33 -45
  65. package/lib/ExportWord.d.ts +33 -45
  66. package/lib/ExportWord.js +84 -21
  67. package/lib/FontFamily.cjs +1 -1
  68. package/lib/FontFamily.d.cts +46 -47
  69. package/lib/FontFamily.d.ts +46 -47
  70. package/lib/FontFamily.js +72 -74
  71. package/lib/FontSize.cjs +1 -1
  72. package/lib/FontSize.d.cts +43 -47
  73. package/lib/FontSize.d.ts +43 -47
  74. package/lib/FontSize.js +72 -64
  75. package/lib/Heading.cjs +1 -1
  76. package/lib/Heading.d.cts +46 -44
  77. package/lib/Heading.d.ts +46 -44
  78. package/lib/Heading.js +91 -73
  79. package/lib/Highlight.cjs +1 -1
  80. package/lib/Highlight.d.cts +36 -44
  81. package/lib/Highlight.d.ts +36 -44
  82. package/lib/Highlight.js +152 -21
  83. package/lib/History.cjs +1 -1
  84. package/lib/History.d.cts +34 -44
  85. package/lib/History.d.ts +34 -44
  86. package/lib/History.js +976 -53
  87. package/lib/HorizontalRule.cjs +1 -1
  88. package/lib/HorizontalRule.d.cts +32 -44
  89. package/lib/HorizontalRule.d.ts +32 -44
  90. package/lib/HorizontalRule.js +97 -17
  91. package/lib/Icon-DUpv2cI6.cjs +1 -0
  92. package/lib/Icon-jKs8Hr6p.js +11 -0
  93. package/lib/Iframe-CmXkEqOd.js +431 -0
  94. package/lib/Iframe-Cvca2G7X.cjs +1 -0
  95. package/lib/Iframe.cjs +1 -1
  96. package/lib/Iframe.d.cts +31 -50
  97. package/lib/Iframe.d.ts +31 -50
  98. package/lib/Iframe.js +6 -4
  99. package/lib/Image.cjs +1 -1
  100. package/lib/Image.d.cts +32 -45
  101. package/lib/Image.d.ts +32 -45
  102. package/lib/Image.js +848 -5
  103. package/lib/ImageGif.cjs +1 -1
  104. package/lib/ImageGif.d.cts +33 -47
  105. package/lib/ImageGif.d.ts +33 -47
  106. package/lib/ImageGif.js +424 -5
  107. package/lib/ImportWord.cjs +48 -48
  108. package/lib/ImportWord.d.cts +33 -45
  109. package/lib/ImportWord.d.ts +33 -45
  110. package/lib/ImportWord.js +2596 -2588
  111. package/lib/Indent.cjs +1 -1
  112. package/lib/Indent.d.cts +32 -44
  113. package/lib/Indent.d.ts +32 -44
  114. package/lib/Indent.js +97 -27
  115. package/lib/Italic.cjs +1 -1
  116. package/lib/Italic.d.cts +32 -44
  117. package/lib/Italic.d.ts +32 -44
  118. package/lib/Italic.js +47 -19
  119. package/lib/Katex-DsYXsjSS.js +2740 -0
  120. package/lib/Katex-XfrNne6U.cjs +4 -0
  121. package/lib/Katex.cjs +1 -1
  122. package/lib/Katex.d.cts +32 -44
  123. package/lib/Katex.d.ts +32 -44
  124. package/lib/Katex.js +5 -196
  125. package/lib/LineHeight.cjs +1 -1
  126. package/lib/LineHeight.d.cts +34 -50
  127. package/lib/LineHeight.d.ts +34 -50
  128. package/lib/LineHeight.js +71 -112
  129. package/lib/Link.cjs +1 -1
  130. package/lib/Link.d.cts +33 -47
  131. package/lib/Link.d.ts +33 -47
  132. package/lib/Link.js +3 -3
  133. package/lib/LinkEditBlock-BZenZq-Z.cjs +5 -0
  134. package/lib/LinkEditBlock-CB8yIffE.js +1241 -0
  135. package/lib/Mention.cjs +1 -1
  136. package/lib/Mention.d.cts +29 -44
  137. package/lib/Mention.d.ts +29 -44
  138. package/lib/Mention.js +112 -124
  139. package/lib/Mermaid.cjs +2 -2
  140. package/lib/Mermaid.d.cts +32 -44
  141. package/lib/Mermaid.d.ts +32 -44
  142. package/lib/Mermaid.js +177 -165
  143. package/lib/MoreMark.cjs +1 -1
  144. package/lib/MoreMark.d.cts +47 -46
  145. package/lib/MoreMark.d.ts +47 -46
  146. package/lib/MoreMark.js +125 -55
  147. package/lib/OrderedList.cjs +1 -1
  148. package/lib/OrderedList.d.cts +32 -44
  149. package/lib/OrderedList.d.ts +32 -44
  150. package/lib/OrderedList.js +37 -9
  151. package/lib/SearchAndReplace.cjs +1 -1
  152. package/lib/SearchAndReplace.d.cts +32 -47
  153. package/lib/SearchAndReplace.d.ts +32 -47
  154. package/lib/SearchAndReplace.js +221 -197
  155. package/lib/SlashCommand.cjs +1 -1
  156. package/lib/SlashCommand.d.cts +44 -51
  157. package/lib/SlashCommand.d.ts +44 -51
  158. package/lib/SlashCommand.js +235 -249
  159. package/lib/Strike.cjs +1 -1
  160. package/lib/Strike.d.cts +32 -44
  161. package/lib/Strike.d.ts +32 -44
  162. package/lib/Strike.js +39 -11
  163. package/lib/Table-B1j1Ebmh.cjs +9 -0
  164. package/lib/Table-Db8TcQX8.js +1984 -0
  165. package/lib/Table.cjs +1 -9
  166. package/lib/Table.d.cts +33 -47
  167. package/lib/Table.d.ts +33 -47
  168. package/lib/Table.js +3 -558
  169. package/lib/TaskList.cjs +1 -1
  170. package/lib/TaskList.d.cts +32 -44
  171. package/lib/TaskList.d.ts +32 -44
  172. package/lib/TaskList.js +38 -10
  173. package/lib/TextAlign.cjs +1 -1
  174. package/lib/TextAlign.d.cts +45 -44
  175. package/lib/TextAlign.d.ts +45 -44
  176. package/lib/TextAlign.js +108 -101
  177. package/lib/TextDirection.cjs +1 -1
  178. package/lib/TextDirection.d.cts +61 -44
  179. package/lib/TextDirection.d.ts +61 -44
  180. package/lib/TextDirection.js +105 -112
  181. package/lib/TextUnderline.cjs +1 -1
  182. package/lib/TextUnderline.d.cts +32 -44
  183. package/lib/TextUnderline.d.ts +32 -44
  184. package/lib/TextUnderline.js +46 -18
  185. package/lib/{Twitter-BFULyqdR.js → Twitter-CXmmjz9R.js} +536 -498
  186. package/lib/Twitter-CtVTIWJW.cjs +1 -0
  187. package/lib/Twitter.cjs +1 -1
  188. package/lib/Twitter.d.cts +32 -44
  189. package/lib/Twitter.d.ts +32 -44
  190. package/lib/Twitter.js +5 -4
  191. package/lib/Video.cjs +1 -1
  192. package/lib/Video.d.cts +32 -44
  193. package/lib/Video.d.ts +32 -44
  194. package/lib/Video.js +261 -4
  195. package/lib/_commonjsHelpers-BItOPCY9.js +28 -0
  196. package/lib/_commonjsHelpers-BTDuMlIz.cjs +1 -0
  197. package/lib/bubble.cjs +2 -0
  198. package/lib/{bubble-extra.d.cts → bubble.d.cts} +58 -59
  199. package/lib/{bubble-extra.d.ts → bubble.d.ts} +58 -59
  200. package/lib/bubble.js +1925 -0
  201. package/lib/button-B12K7BJ4.cjs +1 -0
  202. package/lib/button-DXMsXUEn.js +43 -0
  203. package/lib/clsx-C11secjj.cjs +1 -0
  204. package/lib/clsx-OuTLNxxd.js +16 -0
  205. package/lib/delete-node-CosiBes5.cjs +1 -0
  206. package/lib/delete-node-IyVmiRbI.js +22 -0
  207. package/lib/dialog-CaCS-W5S.cjs +1 -0
  208. package/lib/dialog-PtQivpHS.js +100 -0
  209. package/lib/dom-dataset-BqoJhJXt.cjs +1 -0
  210. package/lib/dom-dataset-CIEeltF6.js +47 -0
  211. package/lib/dropdown-menu-BPp2Z_U-.js +136 -0
  212. package/lib/dropdown-menu-CdSm4emp.cjs +1 -0
  213. package/lib/file-BLas99n7.js +43 -0
  214. package/lib/file-i7e4nQY2.cjs +1 -0
  215. package/lib/floating-ui.dom-U1vPFQ5f.js +1151 -0
  216. package/lib/floating-ui.dom-VCrc58uF.cjs +1 -0
  217. package/lib/icons-Cllpys39.js +362 -0
  218. package/lib/icons-CqHjeW5T.cjs +1 -0
  219. package/lib/index-BH4bc3jN.cjs +33 -0
  220. package/lib/index-BPfVXs5_.js +2380 -0
  221. package/lib/index-Bnmd0WvY.js +1631 -0
  222. package/lib/{index-Ch6dBBad.js → index-CBce_TWY.js} +40 -42
  223. package/lib/{index-5iBZLua9.cjs → index-D-5U8dY8.cjs} +8 -8
  224. package/lib/{index-ByurDDMv.js → index-D2TUfKkC.js} +2 -2
  225. package/lib/index-DV5kbgRU.cjs +1 -0
  226. package/lib/{index-LmrOdnen.js → index-DYkucCoF.js} +396 -495
  227. package/lib/index-Dfmm6FTT.cjs +1 -0
  228. package/lib/index-DnWWK9F_.js +6374 -0
  229. package/lib/index-DzcKxutn.js +632 -0
  230. package/lib/index-DzvuNTxo.cjs +4 -0
  231. package/lib/{index-BeCTd5v2.cjs → index-N--9MohJ.cjs} +1 -1
  232. package/lib/index-RfTlOzIr.cjs +22 -0
  233. package/lib/index.cjs +132 -1
  234. package/lib/index.d.cts +34 -285
  235. package/lib/index.d.ts +34 -285
  236. package/lib/index.js +243 -2
  237. package/lib/input-_ECRfn3Y.cjs +1 -0
  238. package/lib/input-wJ9PDEzZ.js +21 -0
  239. package/lib/isNumber-ClPupm7P.cjs +1 -0
  240. package/lib/isNumber-fpLGS0AZ.js +15 -0
  241. package/lib/label-BkgAe7IY.cjs +1 -0
  242. package/lib/label-CGdLYWv7.js +19 -0
  243. package/lib/locale-bundle.cjs +1 -1
  244. package/lib/locale-bundle.d.cts +5410 -62
  245. package/lib/locale-bundle.d.ts +5410 -62
  246. package/lib/locale-bundle.js +9 -7
  247. package/lib/popover-BgmUNMHj.cjs +1 -0
  248. package/lib/popover-CAuEW0Mr.js +23 -0
  249. package/lib/separator-CuBW_w98.js +328 -0
  250. package/lib/separator-DRIrVZ2N.cjs +1 -0
  251. package/lib/store-DX599H5W.js +10 -0
  252. package/lib/store-WStcMOiW.cjs +1 -0
  253. package/lib/style.css +1 -1
  254. package/lib/switch-CnLJ7Y-b.cjs +1 -0
  255. package/lib/switch-Coix_FA1.js +27 -0
  256. package/lib/tabs-B5mVSN1I.js +46 -0
  257. package/lib/tabs-BoLCMcCI.cjs +1 -0
  258. package/lib/textarea-B-6zTKQz.cjs +1 -0
  259. package/lib/{textarea-aPtytkDx.js → textarea-DUUM1jZd.js} +1 -1
  260. package/lib/theme-B7aAsK_T.js +15 -0
  261. package/lib/theme-D8_cxGqB.cjs +1 -0
  262. package/lib/throttle-CdwDrFpn.js +249 -0
  263. package/lib/throttle-qX7Yjtsg.cjs +1 -0
  264. package/lib/toggle-Cdp4IT2U.js +85 -0
  265. package/lib/toggle-D41PzQLJ.cjs +1 -0
  266. package/lib/tooltip-BuEiE96N.cjs +1 -0
  267. package/lib/tooltip-CopwsU8q.js +23 -0
  268. package/lib/updatePosition-8Sdem5jb.cjs +1 -0
  269. package/lib/updatePosition-BPmcE0YD.js +215 -0
  270. package/lib/use-toast-Bz3QCOtE.cjs +1 -0
  271. package/lib/use-toast-Crf7-q5H.js +98 -0
  272. package/lib/useButtonProps-BsEd4zYM.js +141 -0
  273. package/lib/useButtonProps-C6Vpn190.cjs +1 -0
  274. package/package.json +22 -105
  275. package/lib/ActionMenuButton-CYdM1xx5.cjs +0 -1
  276. package/lib/ActionMenuButton-DKRF6oa0.js +0 -33
  277. package/lib/BaseKit.cjs +0 -3
  278. package/lib/BaseKit.d.cts +0 -481
  279. package/lib/BaseKit.d.ts +0 -481
  280. package/lib/BaseKit.js +0 -132
  281. package/lib/Document.cjs +0 -1
  282. package/lib/Document.js +0 -9
  283. package/lib/Drawer-CdvCMSzN.cjs +0 -1
  284. package/lib/Excalidraw-BbMQhNvs.cjs +0 -1
  285. package/lib/Excalidraw-CVWz2Vyn.js +0 -290
  286. package/lib/FormatPainter.cjs +0 -1
  287. package/lib/FormatPainter.d.cts +0 -372
  288. package/lib/FormatPainter.d.ts +0 -372
  289. package/lib/FormatPainter.js +0 -76
  290. package/lib/ListItem.cjs +0 -1
  291. package/lib/ListItem.d.cts +0 -290
  292. package/lib/ListItem.d.ts +0 -290
  293. package/lib/ListItem.js +0 -7
  294. package/lib/MultiColumn.cjs +0 -1
  295. package/lib/MultiColumn.d.cts +0 -294
  296. package/lib/MultiColumn.d.ts +0 -294
  297. package/lib/MultiColumn.js +0 -8
  298. package/lib/RichTextEditor-CxvwGvQG.cjs +0 -142
  299. package/lib/RichTextEditor-DGcKEUGr.js +0 -22166
  300. package/lib/Selection.cjs +0 -1
  301. package/lib/Selection.d.cts +0 -289
  302. package/lib/Selection.d.ts +0 -289
  303. package/lib/Selection.js +0 -25
  304. package/lib/SubAndSuperScript.cjs +0 -1
  305. package/lib/SubAndSuperScript.d.cts +0 -377
  306. package/lib/SubAndSuperScript.d.ts +0 -377
  307. package/lib/SubAndSuperScript.js +0 -43
  308. package/lib/TableOfContent.cjs +0 -1
  309. package/lib/TableOfContent.d.cts +0 -291
  310. package/lib/TableOfContent.d.ts +0 -291
  311. package/lib/TableOfContent.js +0 -185
  312. package/lib/TextBubble.cjs +0 -1
  313. package/lib/TextBubble.d.cts +0 -362
  314. package/lib/TextBubble.d.ts +0 -362
  315. package/lib/TextBubble.js +0 -133
  316. package/lib/TrailingNode.cjs +0 -1
  317. package/lib/TrailingNode.d.cts +0 -297
  318. package/lib/TrailingNode.d.ts +0 -297
  319. package/lib/TrailingNode.js +0 -41
  320. package/lib/Twitter-Cutpkh3h.cjs +0 -1
  321. package/lib/bubble-extra.cjs +0 -2
  322. package/lib/bubble-extra.js +0 -631
  323. package/lib/dom-dataset-_6-diIRQ.cjs +0 -33
  324. package/lib/dom-dataset-lYeH6gfI.js +0 -2361
  325. package/lib/index-6D1J-A-o.cjs +0 -1
  326. package/lib/index-B96Cclrj.cjs +0 -3
  327. package/lib/index-BBz7Nmv9.js +0 -55
  328. package/lib/index-CUogRI7j.cjs +0 -1
  329. package/lib/index-DF2Lp4HZ.cjs +0 -100
  330. package/lib/index-D_L6n8O8.js +0 -76
  331. package/lib/index-Dbvi-Bvh.cjs +0 -1
  332. package/lib/index-DpCrt7xs.cjs +0 -1
  333. package/lib/index-DsAX1Vq8.cjs +0 -1
  334. package/lib/index-Dy4DlW9o.js +0 -12
  335. package/lib/index-J3jHHZ4d.js +0 -200
  336. package/lib/index-VvXaaKe3.js +0 -898
  337. package/lib/index-kbO3iWqL.js +0 -13432
  338. package/lib/textarea-DFo_aXnj.cjs +0 -1
@@ -0,0 +1 @@
1
+ "use strict";const we=require("./index-RfTlOzIr.cjs"),xe=require("./index-BH4bc3jN.cjs"),n=require("react/jsx-runtime"),h=require("react"),U=require("./clsx-C11secjj.cjs"),Ot=require("./toggle-D41PzQLJ.cjs"),$t=require("./index-DV5kbgRU.cjs"),Dt=require("./Icon-DUpv2cI6.cjs"),At=require("./index-Dfmm6FTT.cjs"),Vt=require("./label-BkgAe7IY.cjs"),Mt=require("./input-_ECRfn3Y.cjs"),Wt=require("./button-B12K7BJ4.cjs"),tt=require("./useButtonProps-C6Vpn190.cjs"),ye=require("./popover-BgmUNMHj.cjs"),Bt="_verified_lvyh0_1",Be={verified:Bt},Pt=()=>n.jsx("svg",{viewBox:"0 0 24 24","aria-label":"Verified account",role:"img",className:Be.verified,children:n.jsx("g",{children:n.jsx("path",{d:"M22.25 12c0-1.43-.88-2.67-2.19-3.34.46-1.39.2-2.9-.81-3.91s-2.52-1.27-3.91-.81c-.66-1.31-1.91-2.19-3.34-2.19s-2.67.88-3.33 2.19c-1.4-.46-2.91-.2-3.92.81s-1.26 2.52-.8 3.91c-1.31.67-2.2 1.91-2.2 3.34s.89 2.67 2.2 3.34c-.46 1.39-.21 2.9.8 3.91s2.52 1.26 3.91.81c.67 1.31 1.91 2.19 3.34 2.19s2.68-.88 3.34-2.19c1.39.45 2.9.2 3.91-.81s1.27-2.52.81-3.91c1.31-.67 2.19-1.91 2.19-3.34zm-11.71 4.2L6.8 12.46l1.41-1.42 2.26 2.26 4.8-5.23 1.47 1.36-6.2 6.77z"})})}),Ft=()=>n.jsx("svg",{viewBox:"0 0 22 22","aria-label":"Verified account",role:"img",className:Be.verified,children:n.jsxs("g",{children:[n.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"0-a",x1:"4.411",x2:"18.083",y1:"2.495",y2:"21.508",children:[n.jsx("stop",{offset:"0",stopColor:"#f4e72a"}),n.jsx("stop",{offset:".539",stopColor:"#cd8105"}),n.jsx("stop",{offset:".68",stopColor:"#cb7b00"}),n.jsx("stop",{offset:"1",stopColor:"#f4ec26"}),n.jsx("stop",{offset:"1",stopColor:"#f4e72a"})]}),n.jsxs("linearGradient",{gradientUnits:"userSpaceOnUse",id:"0-b",x1:"5.355",x2:"16.361",y1:"3.395",y2:"19.133",children:[n.jsx("stop",{offset:"0",stopColor:"#f9e87f"}),n.jsx("stop",{offset:".406",stopColor:"#e2b719"}),n.jsx("stop",{offset:".989",stopColor:"#e2b719"})]}),n.jsxs("g",{clipRule:"evenodd",fillRule:"evenodd",children:[n.jsx("path",{d:"M13.324 3.848L11 1.6 8.676 3.848l-3.201-.453-.559 3.184L2.06 8.095 3.48 11l-1.42 2.904 2.856 1.516.559 3.184 3.201-.452L11 20.4l2.324-2.248 3.201.452.559-3.184 2.856-1.516L18.52 11l1.42-2.905-2.856-1.516-.559-3.184zm-7.09 7.575l3.428 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fill:"url(#0-a)"}),n.jsx("path",{d:"M13.101 4.533L11 2.5 8.899 4.533l-2.895-.41-.505 2.88-2.583 1.37L4.2 11l-1.284 2.627 2.583 1.37.505 2.88 2.895-.41L11 19.5l2.101-2.033 2.895.41.505-2.88 2.583-1.37L17.8 11l1.284-2.627-2.583-1.37-.505-2.88zm-6.868 6.89l3.429 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fill:"url(#0-b)"}),n.jsx("path",{d:"M6.233 11.423l3.429 3.428 5.65-6.17.038-.033-.005 1.398-5.683 6.206-3.429-3.429-.003-1.405.005.003z",fill:"#d18800"})]})]})}),Ut=()=>n.jsx("svg",{viewBox:"0 0 22 22","aria-label":"Verified account",role:"img",className:Be.verified,children:n.jsx("g",{children:n.jsx("path",{clipRule:"evenodd",d:"M12.05 2.056c-.568-.608-1.532-.608-2.1 0l-1.393 1.49c-.284.303-.685.47-1.1.455L5.42 3.932c-.832-.028-1.514.654-1.486 1.486l.069 2.039c.014.415-.152.816-.456 1.1l-1.49 1.392c-.608.568-.608 1.533 0 2.101l1.49 1.393c.304.284.47.684.456 1.1l-.07 2.038c-.027.832.655 1.514 1.487 1.486l2.038-.069c.415-.014.816.152 1.1.455l1.392 1.49c.569.609 1.533.609 2.102 0l1.393-1.49c.283-.303.684-.47 1.099-.455l2.038.069c.832.028 1.515-.654 1.486-1.486L18 14.542c-.015-.415.152-.815.455-1.099l1.49-1.393c.608-.568.608-1.533 0-2.101l-1.49-1.393c-.303-.283-.47-.684-.455-1.1l.068-2.038c.029-.832-.654-1.514-1.486-1.486l-2.038.07c-.415.013-.816-.153-1.1-.456zm-5.817 9.367l3.429 3.428 5.683-6.206-1.347-1.247-4.4 4.795-2.072-2.072z",fillRule:"evenodd"})})}),zt="_root_98iqw_1",Ht="_article_98iqw_21",nt={root:zt,article:Ht},Pe=({className:e,children:t})=>n.jsx("div",{className:U.clsx("react-tweet-theme",nt.root,e),children:n.jsx("article",{className:nt.article,children:t})}),pt=e=>n.jsx("img",{...e}),Gt="_header_nqq4j_1",Xt="_avatar_nqq4j_11",Kt="_avatarOverflow_nqq4j_16",Qt="_avatarSquare_nqq4j_23",Jt="_avatarShadow_nqq4j_26",Yt="_author_nqq4j_37",Zt="_authorLink_nqq4j_44",en="_authorVerified_nqq4j_53",tn="_authorLinkText_nqq4j_56",nn="_authorMeta_nqq4j_63",rn="_authorFollow_nqq4j_66",sn="_username_nqq4j_69",on="_follow_nqq4j_74",an="_separator_nqq4j_82",cn="_brand_nqq4j_86",ln="_twitterIcon_nqq4j_90",b={header:Gt,avatar:Xt,avatarOverflow:Kt,avatarSquare:Qt,avatarShadow:Jt,author:Yt,authorLink:Zt,authorVerified:en,authorLinkText:tn,authorMeta:nn,authorFollow:rn,username:sn,follow:on,separator:an,brand:cn,twitterIcon:ln},dn="_verifiedOld_lcna5_1",un="_verifiedBlue_lcna5_4",fn="_verifiedGovernment_lcna5_7",Te={verifiedOld:dn,verifiedBlue:un,verifiedGovernment:fn},mt=({user:e,className:t})=>{const r=e.verified||e.is_blue_verified||e.verified_type;let s=n.jsx(Pt,{}),o=Te.verifiedBlue;if(r)switch(e.is_blue_verified||(o=Te.verifiedOld),e.verified_type){case"Government":s=n.jsx(Ut,{}),o=Te.verifiedGovernment;break;case"Business":s=n.jsx(Ft,{}),o=null;break}return r?n.jsx("div",{className:U.clsx(t,o),children:s}):null},hn=({tweet:e,components:t})=>{var r;const s=(r=t==null?void 0:t.AvatarImg)!=null?r:pt,{user:o}=e;return n.jsxs("div",{className:b.header,children:[n.jsxs("a",{href:e.url,className:b.avatar,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("div",{className:U.clsx(b.avatarOverflow,o.profile_image_shape==="Square"&&b.avatarSquare),children:n.jsx(s,{src:o.profile_image_url_https,alt:o.name,width:48,height:48})}),n.jsx("div",{className:b.avatarOverflow,children:n.jsx("div",{className:b.avatarShadow})})]}),n.jsxs("div",{className:b.author,children:[n.jsxs("a",{href:e.url,className:b.authorLink,target:"_blank",rel:"noopener noreferrer",children:[n.jsx("div",{className:b.authorLinkText,children:n.jsx("span",{title:o.name,children:o.name})}),n.jsx(mt,{user:o,className:b.authorVerified})]}),n.jsxs("div",{className:b.authorMeta,children:[n.jsx("a",{href:e.url,className:b.username,target:"_blank",rel:"noopener noreferrer",children:n.jsxs("span",{title:`@${o.screen_name}`,children:["@",o.screen_name]})}),n.jsxs("div",{className:b.authorFollow,children:[n.jsx("span",{className:b.separator,children:"·"}),n.jsx("a",{href:o.follow_url,className:b.follow,target:"_blank",rel:"noopener noreferrer",children:"Follow"})]})]})]}),n.jsx("a",{href:e.url,className:b.brand,target:"_blank",rel:"noopener noreferrer","aria-label":"View on Twitter",children:n.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:b.twitterIcon,children:n.jsx("g",{children:n.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})})})})]})},_n="_root_1ec15_1",pn={root:_n},mn=({tweet:e})=>n.jsxs("a",{href:e.in_reply_to_url,className:pn.root,target:"_blank",rel:"noopener noreferrer",children:["Replying to @",e.in_reply_to_screen_name]}),xn="_root_eihfa_1",vn={root:xn},gn=({href:e,children:t})=>n.jsx("a",{href:e,className:vn.root,target:"_blank",rel:"noopener noreferrer nofollow",children:t}),jn="_root_1xq52_1",wn={root:jn},yn=({tweet:e})=>n.jsx("p",{className:wn.root,lang:e.lang,dir:"auto",children:e.entities.map((t,r)=>{switch(t.type){case"hashtag":case"mention":case"url":case"symbol":return n.jsx(gn,{href:t.href,children:t.text},r);case"media":return;default:return n.jsx("span",{dangerouslySetInnerHTML:{__html:t.text}},r)}})}),rt=e=>`https://x.com/${e.user.screen_name}/status/${e.id_str}`,xt=e=>`https://x.com/${typeof e=="string"?e:e.user.screen_name}`,Tn=e=>`https://x.com/intent/like?tweet_id=${e.id_str}`,bn=e=>`https://x.com/intent/tweet?in_reply_to=${e.id_str}`,Nn=e=>`https://x.com/intent/follow?screen_name=${e.user.screen_name}`,Rn=e=>`https://x.com/hashtag/${e.text}`,kn=e=>`https://x.com/search?q=%24${e.text}`,Sn=e=>`https://x.com/${e.in_reply_to_screen_name}/status/${e.in_reply_to_status_id_str}`,vt=(e,t)=>{const r=new URL(e.media_url_https),s=r.pathname.split(".").pop();return s?(r.pathname=r.pathname.replace(`.${s}`,""),r.searchParams.set("format",s),r.searchParams.set("name",t),r.toString()):e.media_url_https},En=e=>{const{variants:t}=e.video_info;return t.filter(s=>s.content_type==="video/mp4").sort((s,o)=>{var a,i;return((a=o.bitrate)!=null?a:0)-((i=s.bitrate)!=null?i:0)})},In=e=>{const t=En(e);return t.length>1?t[1]:t[0]},qe=e=>e>999999?`${(e/1e6).toFixed(1)}M`:e>999?`${(e/1e3).toFixed(1)}K`:e.toString();function st(e){const t=Array.from(e.text),r=[{indices:e.display_text_range,type:"text"}];return ce(r,"hashtag",e.entities.hashtags),ce(r,"mention",e.entities.user_mentions),ce(r,"url",e.entities.urls),ce(r,"symbol",e.entities.symbols),e.entities.media&&ce(r,"media",e.entities.media),Cn(e,r),r.map(s=>{const o=t.slice(s.indices[0],s.indices[1]).join("");switch(s.type){case"hashtag":return Object.assign(s,{href:Rn(s),text:o});case"mention":return Object.assign(s,{href:xt(s.screen_name),text:o});case"url":case"media":return Object.assign(s,{href:s.expanded_url,text:s.display_url});case"symbol":return Object.assign(s,{href:kn(s),text:o});default:return Object.assign(s,{text:o})}})}function ce(e,t,r){for(const s of r)for(const[o,a]of e.entries()){if(a.indices[0]>s.indices[0]||a.indices[1]<s.indices[1])continue;const i=[{...s,type:t}];a.indices[0]<s.indices[0]&&i.unshift({indices:[a.indices[0],s.indices[0]],type:"text"}),a.indices[1]>s.indices[1]&&i.push({indices:[s.indices[1],a.indices[1]],type:"text"}),e.splice(o,1,...i);break}}function Cn(e,t){e.entities.media&&e.entities.media[0].indices[0]<e.display_text_range[1]&&(e.display_text_range[1]=e.entities.media[0].indices[0]);const r=t.at(-1);r&&r.indices[1]>e.display_text_range[1]&&(r.indices[1]=e.display_text_range[1])}const qn=e=>({...e,url:rt(e),user:{...e.user,url:xt(e),follow_url:Nn(e)},like_url:Tn(e),reply_url:bn(e),in_reply_to_url:e.in_reply_to_screen_name?Sn(e):void 0,entities:st(e),quoted_tweet:e.quoted_tweet?{...e.quoted_tweet,url:rt(e.quoted_tweet),entities:st(e.quoted_tweet)}:void 0}),Ln="_root_g9tkv_1",On="_rounded_g9tkv_6",$n="_mediaWrapper_g9tkv_10",Dn="_grid2Columns_g9tkv_17",An="_grid3_g9tkv_20",Vn="_grid2x2_g9tkv_23",Mn="_mediaContainer_g9tkv_26",Wn="_mediaLink_g9tkv_34",Bn="_skeleton_g9tkv_38",Pn="_image_g9tkv_43",I={root:Ln,rounded:On,mediaWrapper:$n,grid2Columns:Dn,grid3:An,grid2x2:Vn,mediaContainer:Mn,mediaLink:Wn,skeleton:Bn,image:Pn},Fn="_anchor_fp31d_1",Un="_videoButton_fp31d_17",zn="_videoButtonIcon_fp31d_35",Hn="_watchOnTwitter_fp31d_44",Gn="_viewReplies_fp31d_60",se={anchor:Fn,videoButton:Un,videoButtonIcon:zn,watchOnTwitter:Hn,viewReplies:Gn},Xn=({tweet:e,media:t})=>{const[r,s]=h.useState(!0),[o,a]=h.useState(!1),[i,c]=h.useState(!1),f=In(t);let d=0;return n.jsxs(n.Fragment,{children:[n.jsx("video",{className:I.image,poster:vt(t,"small"),controls:!r,playsInline:!0,preload:"none",tabIndex:r?-1:0,onPlay:()=>{d&&window.clearTimeout(d),o||a(!0),i&&c(!1)},onPause:()=>{d&&window.clearTimeout(d),d=window.setTimeout(()=>{o&&a(!1),d=0},100)},onEnded:()=>{c(!0)},children:n.jsx("source",{src:f.url,type:f.content_type})}),r&&n.jsx("button",{type:"button",className:se.videoButton,"aria-label":"View video on X",onClick:v=>{const p=v.currentTarget.previousSibling;v.preventDefault(),s(!1),p.load(),p.play().then(()=>{a(!0),p.focus()}).catch(w=>{console.error("Error playing video:",w),s(!0),a(!1)})},children:n.jsx("svg",{viewBox:"0 0 24 24",className:se.videoButtonIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M21 12L4 2v20l17-10z"})})})}),!o&&!i&&n.jsx("div",{className:se.watchOnTwitter,children:n.jsx("a",{href:e.url,className:se.anchor,target:"_blank",rel:"noopener noreferrer",children:r?"Watch on X":"Continue watching on X"})}),i&&n.jsx("a",{href:e.url,className:U.clsx(se.anchor,se.viewReplies),target:"_blank",rel:"noopener noreferrer",children:"View replies"})]})},Kn=e=>n.jsx("img",{...e}),ot=(e,t)=>{let r=56.25;return t===1&&(r=100/e.original_info.width*e.original_info.height),t===2&&(r=r*2),{width:e.type==="photo"?void 0:"unset",paddingBottom:`${r}%`}},gt=({tweet:e,components:t,quoted:r})=>{var s,o,a;const i=(a=(s=e.mediaDetails)==null?void 0:s.length)!=null?a:0;var c;const f=(c=t==null?void 0:t.MediaImg)!=null?c:Kn;return n.jsx("div",{className:U.clsx(I.root,!r&&I.rounded),children:n.jsx("div",{className:U.clsx(I.mediaWrapper,i>1&&I.grid2Columns,i===3&&I.grid3,i>4&&I.grid2x2),children:(o=e.mediaDetails)==null?void 0:o.map(d=>n.jsx(h.Fragment,{children:d.type==="photo"?n.jsxs("a",{href:e.url,className:U.clsx(I.mediaContainer,I.mediaLink),target:"_blank",rel:"noopener noreferrer",children:[n.jsx("div",{className:I.skeleton,style:ot(d,i)}),n.jsx(f,{src:vt(d,"small"),alt:d.ext_alt_text||"Image",className:I.image,draggable:!0})]},d.media_url_https):n.jsxs("div",{className:I.mediaContainer,children:[n.jsx("div",{className:I.skeleton,style:ot(d,i)}),n.jsx(Xn,{tweet:e,media:d})]},d.media_url_https)},d.media_url_https))})})},Qn={hour:"numeric",minute:"2-digit",hour12:!0,weekday:"short",month:"short",day:"numeric",year:"numeric"},Jn=new Intl.DateTimeFormat("en-US",Qn),Yn=e=>{const t={};for(const r of e)t[r.type]=r.value;return t},Zn=e=>{const t=Yn(Jn.formatToParts(e)),r=`${t.hour}:${t.minute} ${t.dayPeriod}`,s=`${t.month} ${t.day}, ${t.year}`;return`${r} · ${s}`},er="_root_i24yn_1",tr={root:er},nr=({tweet:e})=>{const t=new Date(e.created_at),r=Zn(t);return n.jsx("a",{className:tr.root,href:e.url,target:"_blank",rel:"noopener noreferrer","aria-label":r,children:n.jsx("time",{dateTime:t.toISOString(),children:r})})},rr="_info_19qcj_1",sr="_infoLink_19qcj_10",or="_infoIcon_19qcj_30",be={info:rr,infoLink:sr,infoIcon:or},ir=({tweet:e})=>n.jsxs("div",{className:be.info,children:[n.jsx(nr,{tweet:e}),n.jsx("a",{className:be.infoLink,href:"https://help.x.com/en/x-for-websites-ads-info-and-privacy",target:"_blank",rel:"noopener noreferrer","aria-label":"Twitter for Websites, Ads Information and Privacy",children:n.jsx("svg",{viewBox:"0 0 24 24","aria-hidden":"true",className:be.infoIcon,children:n.jsx("g",{children:n.jsx("path",{d:"M13.5 8.5c0 .83-.67 1.5-1.5 1.5s-1.5-.67-1.5-1.5S11.17 7 12 7s1.5.67 1.5 1.5zM13 17v-5h-2v5h2zm-1 5.25c5.66 0 10.25-4.59 10.25-10.25S17.66 1.75 12 1.75 1.75 6.34 1.75 12 6.34 22.25 12 22.25zM20.25 12c0 4.56-3.69 8.25-8.25 8.25S3.75 16.56 3.75 12 7.44 3.75 12 3.75s8.25 3.69 8.25 8.25z"})})})})]}),ar="_actions_n2anf_1",cr="_like_n2anf_13",lr="_reply_n2anf_14",dr="_copy_n2anf_15",ur="_likeIconWrapper_n2anf_27",fr="_likeCount_n2anf_30",hr="_replyIconWrapper_n2anf_35",_r="_copyIconWrapper_n2anf_36",pr="_likeIcon_n2anf_27",mr="_replyIcon_n2anf_35",xr="_copyIcon_n2anf_36",vr="_replyText_n2anf_56",gr="_copyText_n2anf_57",S={actions:ar,like:cr,reply:lr,copy:dr,likeIconWrapper:ur,likeCount:fr,replyIconWrapper:hr,copyIconWrapper:_r,likeIcon:pr,replyIcon:mr,copyIcon:xr,replyText:vr,copyText:gr},jr=({tweet:e})=>{const[t,r]=h.useState(!1),s=()=>{navigator.clipboard.writeText(e.url),r(!0)};return h.useEffect(()=>{if(t){const o=setTimeout(()=>{r(!1)},6e3);return()=>clearTimeout(o)}},[t]),n.jsxs("button",{type:"button",className:S.copy,"aria-label":"Copy link",onClick:s,children:[n.jsx("div",{className:S.copyIconWrapper,children:t?n.jsx("svg",{viewBox:"0 0 24 24",className:S.copyIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M9.64 18.952l-5.55-4.861 1.317-1.504 3.951 3.459 8.459-10.948L19.4 6.32 9.64 18.952z"})})}):n.jsx("svg",{viewBox:"0 0 24 24",className:S.copyIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M18.36 5.64c-1.95-1.96-5.11-1.96-7.07 0L9.88 7.05 8.46 5.64l1.42-1.42c2.73-2.73 7.16-2.73 9.9 0 2.73 2.74 2.73 7.17 0 9.9l-1.42 1.42-1.41-1.42 1.41-1.41c1.96-1.96 1.96-5.12 0-7.07zm-2.12 3.53l-7.07 7.07-1.41-1.41 7.07-7.07 1.41 1.41zm-12.02.71l1.42-1.42 1.41 1.42-1.41 1.41c-1.96 1.96-1.96 5.12 0 7.07 1.95 1.96 5.11 1.96 7.07 0l1.41-1.41 1.42 1.41-1.42 1.42c-2.73 2.73-7.16 2.73-9.9 0-2.73-2.74-2.73-7.17 0-9.9z"})})})}),n.jsx("span",{className:S.copyText,children:t?"Copied!":"Copy link"})]})},wr=({tweet:e})=>{const t=qe(e.favorite_count);return n.jsxs("div",{className:S.actions,children:[n.jsxs("a",{className:S.like,href:e.like_url,target:"_blank",rel:"noopener noreferrer","aria-label":`Like. This Tweet has ${t} likes`,children:[n.jsx("div",{className:S.likeIconWrapper,children:n.jsx("svg",{viewBox:"0 0 24 24",className:S.likeIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M20.884 13.19c-1.351 2.48-4.001 5.12-8.379 7.67l-.503.3-.504-.3c-4.379-2.55-7.029-5.19-8.382-7.67-1.36-2.5-1.41-4.86-.514-6.67.887-1.79 2.647-2.91 4.601-3.01 1.651-.09 3.368.56 4.798 2.01 1.429-1.45 3.146-2.1 4.796-2.01 1.954.1 3.714 1.22 4.601 3.01.896 1.81.846 4.17-.514 6.67z"})})})}),n.jsx("span",{className:S.likeCount,children:t})]}),n.jsxs("a",{className:S.reply,href:e.reply_url,target:"_blank",rel:"noopener noreferrer","aria-label":"Reply to this Tweet on Twitter",children:[n.jsx("div",{className:S.replyIconWrapper,children:n.jsx("svg",{viewBox:"0 0 24 24",className:S.replyIcon,"aria-hidden":"true",children:n.jsx("g",{children:n.jsx("path",{d:"M1.751 10c0-4.42 3.584-8 8.005-8h4.366c4.49 0 8.129 3.64 8.129 8.13 0 2.96-1.607 5.68-4.196 7.11l-8.054 4.46v-3.69h-.067c-4.49.1-8.183-3.51-8.183-8.01z"})})})}),n.jsx("span",{className:S.replyText,children:"Reply"})]}),n.jsx(jr,{tweet:e})]})},yr="_replies_1cutb_1",Tr="_link_1cutb_4",br="_text_1cutb_23",Ne={replies:yr,link:Tr,text:br},Nr=({tweet:e})=>n.jsx("div",{className:Ne.replies,children:n.jsx("a",{className:Ne.link,href:e.url,target:"_blank",rel:"noopener noreferrer",children:n.jsx("span",{className:Ne.text,children:e.conversation_count===0?"Read more on X":e.conversation_count===1?`Read ${qe(e.conversation_count)} reply`:`Read ${qe(e.conversation_count)} replies`})})}),Rr="_root_q5799_1",kr="_article_q5799_16",it={root:Rr,article:kr},Sr=({tweet:e,children:t})=>n.jsx("div",{className:it.root,onClick:r=>{r.preventDefault(),window.open(e.url,"_blank")},children:n.jsx("article",{className:it.article,children:t})}),Er="_header_r31i5_1",Ir="_avatar_r31i5_11",Cr="_avatarSquare_r31i5_17",qr="_author_r31i5_21",Lr="_authorText_r31i5_26",Or="_username_r31i5_33",K={header:Er,avatar:Ir,avatarSquare:Cr,author:qr,authorText:Lr,username:Or},$r=({tweet:e})=>{const{user:t}=e;return n.jsxs("div",{className:K.header,children:[n.jsx("a",{href:e.url,className:K.avatar,target:"_blank",rel:"noopener noreferrer",children:n.jsx("div",{className:U.clsx(K.avatarOverflow,t.profile_image_shape==="Square"&&K.avatarSquare),children:n.jsx(pt,{src:t.profile_image_url_https,alt:t.name,width:20,height:20})})}),n.jsxs("div",{className:K.author,children:[n.jsx("div",{className:K.authorText,children:n.jsx("span",{title:t.name,children:t.name})}),n.jsx(mt,{user:t}),n.jsx("div",{className:K.username,children:n.jsxs("span",{title:`@${t.screen_name}`,children:["@",t.screen_name]})})]})]})},Dr="_root_175ot_1",Ar={root:Dr},Vr=({tweet:e})=>n.jsx("p",{className:Ar.root,lang:e.lang,dir:"auto",children:e.entities.map((t,r)=>n.jsx("span",{dangerouslySetInnerHTML:{__html:t.text}},r))}),Mr=({tweet:e})=>{var t;return n.jsxs(Sr,{tweet:e,children:[n.jsx($r,{tweet:e}),n.jsx(Vr,{tweet:e}),(t=e.mediaDetails)!=null&&t.length?n.jsx(gt,{quoted:!0,tweet:e}):null]})},Wr=({tweet:e,components:t})=>{var r;const s=h.useMemo(()=>qn(e),[e]);return n.jsxs(Pe,{children:[n.jsx(hn,{tweet:s,components:t}),s.in_reply_to_status_id_str&&n.jsx(mn,{tweet:s}),n.jsx(yn,{tweet:s}),(r=s.mediaDetails)!=null&&r.length?n.jsx(gt,{tweet:s,components:t}):null,s.quoted_tweet&&n.jsx(Mr,{tweet:s.quoted_tweet}),n.jsx(ir,{tweet:s}),n.jsx(wr,{tweet:s}),n.jsx(Nr,{tweet:s})]})},Br="_root_16yxa_1",Pr={root:Br},Fr=e=>n.jsx(Pe,{children:n.jsxs("div",{className:Pr.root,children:[n.jsx("h3",{children:"Tweet not found"}),n.jsx("p",{children:"The embedded tweet could not be found…"})]})}),Ur="_skeleton_oi7hr_1",zr={skeleton:Ur},_e=({style:e})=>n.jsx("span",{className:zr.skeleton,style:e}),Hr="_root_17qqv_1",Gr={root:Hr},Xr=()=>n.jsxs(Pe,{className:Gr.root,children:[n.jsx(_e,{style:{height:"3rem",marginBottom:"0.75rem"}}),n.jsx(_e,{style:{height:"6rem",margin:"0.5rem 0"}}),n.jsx("div",{style:{borderTop:"var(--tweet-border)",margin:"0.5rem 0"}}),n.jsx(_e,{style:{height:"2rem"}}),n.jsx(_e,{style:{height:"2rem",borderRadius:"9999px",marginTop:"0.5rem"}})]}),jt=0,wt=1,yt=2,at=3;var ct=Object.prototype.hasOwnProperty;function Le(e,t){var r,s;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((s=e.length)===t.length)for(;s--&&Le(e[s],t[s]););return s===-1}if(!r||typeof e=="object"){s=0;for(r in e)if(ct.call(e,r)&&++s&&!ct.call(t,r)||!(r in t)||!Le(e[r],t[r]))return!1;return Object.keys(t).length===s}}return e!==e&&t!==t}const P=new WeakMap,F=()=>{},R=F(),Oe=Object,u=e=>e===R,M=e=>typeof e=="function",z=(e,t)=>({...e,...t}),Tt=e=>M(e.then),Re={},pe={},Fe="undefined",le=typeof window!=Fe,$e=typeof document!=Fe,Kr=le&&"Deno"in window,Qr=()=>le&&typeof window.requestAnimationFrame!=Fe,bt=(e,t)=>{const r=P.get(e);return[()=>!u(t)&&e.get(t)||Re,s=>{if(!u(t)){const o=e.get(t);t in pe||(pe[t]=o),r[5](t,z(o,s),o||Re)}},r[6],()=>!u(t)&&t in pe?pe[t]:!u(t)&&e.get(t)||Re]};let De=!0;const Jr=()=>De,[Ae,Ve]=le&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[F,F],Yr=()=>{const e=$e&&document.visibilityState;return u(e)||e!=="hidden"},Zr=e=>($e&&document.addEventListener("visibilitychange",e),Ae("focus",e),()=>{$e&&document.removeEventListener("visibilitychange",e),Ve("focus",e)}),es=e=>{const t=()=>{De=!0,e()},r=()=>{De=!1};return Ae("online",t),Ae("offline",r),()=>{Ve("online",t),Ve("offline",r)}},ts={isOnline:Jr,isVisible:Yr},ns={initFocus:Zr,initReconnect:es},lt=!h.useId,oe=!le||Kr,rs=e=>Qr()?window.requestAnimationFrame(e):setTimeout(e,1),ke=oe?h.useEffect:h.useLayoutEffect,Se=typeof navigator<"u"&&navigator.connection,dt=!oe&&Se&&(["slow-2g","2g"].includes(Se.effectiveType)||Se.saveData),me=new WeakMap,ss=e=>Oe.prototype.toString.call(e),Ee=(e,t)=>e===`[object ${t}]`;let os=0;const Me=e=>{const t=typeof e,r=ss(e),s=Ee(r,"Date"),o=Ee(r,"RegExp"),a=Ee(r,"Object");let i,c;if(Oe(e)===e&&!s&&!o){if(i=me.get(e),i)return i;if(i=++os+"~",me.set(e,i),Array.isArray(e)){for(i="@",c=0;c<e.length;c++)i+=Me(e[c])+",";me.set(e,i)}if(a){i="#";const f=Oe.keys(e).sort();for(;!u(c=f.pop());)u(e[c])||(i+=c+":"+Me(e[c])+",");me.set(e,i)}}else i=s?e.toJSON():t=="symbol"?e.toString():t=="string"?JSON.stringify(e):""+e;return i},Ue=e=>{if(M(e))try{e=e()}catch{e=""}const t=e;return e=typeof e=="string"?e:(Array.isArray(e)?e.length:e)?Me(e):"",[e,t]};let is=0;const We=()=>++is;async function Nt(...e){const[t,r,s,o]=e,a=z({populateCache:!0,throwOnError:!0},typeof o=="boolean"?{revalidate:o}:o||{});let i=a.populateCache;const c=a.rollbackOnError;let f=a.optimisticData;const d=w=>typeof c=="function"?c(w):c!==!1,v=a.throwOnError;if(M(r)){const w=r,N=[],E=t.keys();for(const q of E)!/^\$(inf|sub)\$/.test(q)&&w(t.get(q)._k)&&N.push(q);return Promise.all(N.map(p))}return p(r);async function p(w){const[N]=Ue(w);if(!N)return;const[E,q]=bt(t,N),[$,ie,l,de]=P.get(t),Q=()=>{const L=$[N];return(M(a.revalidate)?a.revalidate(E().data,w):a.revalidate!==!1)&&(delete l[N],delete de[N],L&&L[0])?L[0](yt).then(()=>E().data):E().data};if(e.length<3)return Q();let y=s,D,A=!1;const J=We();ie[N]=[J,0];const m=!u(f),Y=E(),V=Y.data,Z=Y._c,H=u(Z)?V:Z;if(m&&(f=M(f)?f(H,V):f,q({data:f,_c:H})),M(y))try{y=y(H)}catch(L){D=L,A=!0}if(y&&Tt(y))if(y=await y.catch(L=>{D=L,A=!0}),J!==ie[N][0]){if(A)throw D;return y}else A&&m&&d(D)&&(i=!0,q({data:H,_c:R}));if(i&&!A)if(M(i)){const L=i(y,H);q({data:L,error:R,_c:R})}else q({data:y,error:R,_c:R});if(ie[N][1]=We(),Promise.resolve(Q()).then(()=>{q({_c:R})}),A){if(v)throw D;return}return y}}const ut=(e,t)=>{for(const r in e)e[r][0]&&e[r][0](t)},as=(e,t)=>{if(!P.has(e)){const r=z(ns,t),s=Object.create(null),o=Nt.bind(R,e);let a=F;const i=Object.create(null),c=(v,p)=>{const w=i[v]||[];return i[v]=w,w.push(p),()=>w.splice(w.indexOf(p),1)},f=(v,p,w)=>{e.set(v,p);const N=i[v];if(N)for(const E of N)E(p,w)},d=()=>{if(!P.has(e)&&(P.set(e,[s,Object.create(null),Object.create(null),Object.create(null),o,f,c]),!oe)){const v=r.initFocus(setTimeout.bind(R,ut.bind(R,s,jt))),p=r.initReconnect(setTimeout.bind(R,ut.bind(R,s,wt)));a=()=>{v&&v(),p&&p(),P.delete(e)}}};return d(),[e,o,d,a]}return[e,P.get(e)[4]]},cs=(e,t,r,s,o)=>{const a=r.errorRetryCount,i=o.retryCount,c=~~((Math.random()+.5)*(1<<(i<8?i:8)))*r.errorRetryInterval;!u(a)&&i>a||setTimeout(s,c,o)},ls=Le,[Rt,ds]=as(new Map),us=z({onLoadingSlow:F,onSuccess:F,onError:F,onErrorRetry:cs,onDiscarded:F,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:dt?1e4:5e3,focusThrottleInterval:5*1e3,dedupingInterval:2*1e3,loadingTimeout:dt?5e3:3e3,compare:ls,isPaused:()=>!1,cache:Rt,mutate:ds,fallback:{}},ts),fs=(e,t)=>{const r=z(e,t);if(t){const{use:s,fallback:o}=e,{use:a,fallback:i}=t;s&&a&&(r.use=s.concat(a)),o&&i&&(r.fallback=z(o,i))}return r},hs=h.createContext({}),_s="$inf$",kt=le&&window.__SWR_DEVTOOLS_USE__,ps=kt?window.__SWR_DEVTOOLS_USE__:[],ms=()=>{kt&&(window.__SWR_DEVTOOLS_REACT__=h)},xs=e=>M(e[1])?[e[0],e[1],e[2]||{}]:[e[0],null,(e[1]===null?e[2]:e[1])||{}],vs=()=>{const e=h.useContext(hs);return h.useMemo(()=>z(us,e),[e])},gs=e=>(t,r,s)=>e(t,r&&((...a)=>{const[i]=Ue(t),[,,,c]=P.get(Rt);if(i.startsWith(_s))return r(...a);const f=c[i];return u(f)?r(...a):(delete c[i],f)}),s),js=ps.concat(gs),ws=e=>function(...r){const s=vs(),[o,a,i]=xs(r),c=fs(s,i);let f=e;const{use:d}=c,v=(d||[]).concat(js);for(let p=v.length;p--;)f=v[p](f);return f(o,a||c.fetcher||null,c)},ys=(e,t,r)=>{const s=t[e]||(t[e]=[]);return s.push(r),()=>{const o=s.indexOf(r);o>=0&&(s[o]=s[s.length-1],s.pop())}};ms();const Ie=h.use||(e=>{switch(e.status){case"pending":throw e;case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e.status="pending",e.then(t=>{e.status="fulfilled",e.value=t},t=>{e.status="rejected",e.reason=t}),e}}),Ce={dedupe:!0},ft=Promise.resolve(R),Ts=(e,t,r)=>{const{cache:s,compare:o,suspense:a,fallbackData:i,revalidateOnMount:c,revalidateIfStale:f,refreshInterval:d,refreshWhenHidden:v,refreshWhenOffline:p,keepPreviousData:w,strictServerPrefetchWarning:N}=r,[E,q,$,ie]=P.get(s),[l,de]=Ue(e),Q=h.useRef(!1),y=h.useRef(!1),D=h.useRef(l),A=h.useRef(t),J=h.useRef(r),m=()=>J.current,Y=()=>m().isVisible()&&m().isOnline(),[V,Z,H,L]=bt(s,l),ee=h.useRef({}).current,ue=u(i)?u(r.fallback)?R:r.fallback[l]:i,He=(_,x)=>{for(const j in ee){const g=j;if(g==="data"){if(!o(_[g],x[g])&&(!u(_[g])||!o(he,x[g])))return!1}else if(x[g]!==_[g])return!1}return!0},Ge=h.useMemo(()=>{const _=!l||!t?!1:u(c)?m().isPaused()||a?!1:f!==!1:c,x=k=>{const W=z(k);return delete W._k,_?{isValidating:!0,isLoading:!0,...W}:W},j=V(),g=L(),O=x(j),re=j===g?O:x(g);let T=O;return[()=>{const k=x(V());return He(k,T)?(T.data=k.data,T.isLoading=k.isLoading,T.isValidating=k.isValidating,T.error=k.error,T):(T=k,k)},()=>re]},[s,l]),te=xe.shimExports.useSyncExternalStore(h.useCallback(_=>H(l,(x,j)=>{He(j,x)||_()}),[s,l]),Ge[0],Ge[1]),Xe=!Q.current,Et=E[l]&&E[l].length>0,ne=te.data,G=u(ne)?ue&&Tt(ue)?Ie(ue):ue:ne,fe=te.error,ve=h.useRef(G),he=w?u(ne)?u(ve.current)?G:ve.current:ne:G,X=l&&u(G),It=!oe&&xe.shimExports.useSyncExternalStore(()=>F,()=>!1,()=>!0);N&&It&&!a&&X&&console.warn(`Missing pre-initiated data for serialized key "${l}" during server-side rendering. Data fethcing should be initiated on the server and provided to SWR via fallback data. You can set "strictServerPrefetchWarning: false" to disable this warning.`);const Ke=Et&&!u(fe)?!1:Xe&&!u(c)?c:m().isPaused()?!1:a?u(G)?!1:f:u(G)||f,Qe=!!(l&&t&&Xe&&Ke),Ct=u(te.isValidating)?Qe:te.isValidating,qt=u(te.isLoading)?Qe:te.isLoading,ae=h.useCallback(async _=>{const x=A.current;if(!l||!x||y.current||m().isPaused())return!1;let j,g,O=!0;const re=_||{},T=!$[l]||!re.dedupe,k=()=>lt?!y.current&&l===D.current&&Q.current:l===D.current,W={isValidating:!1,isLoading:!1},Ye=()=>{Z(W)},Ze=()=>{const C=$[l];C&&C[1]===g&&delete $[l]},et={isValidating:!0};u(V().data)&&(et.isLoading=!0);try{if(T&&(Z(et),r.loadingTimeout&&u(V().data)&&setTimeout(()=>{O&&k()&&m().onLoadingSlow(l,r)},r.loadingTimeout),$[l]=[x(de),We()]),[j,g]=$[l],j=await j,T&&setTimeout(Ze,r.dedupingInterval),!$[l]||$[l][1]!==g)return T&&k()&&m().onDiscarded(l),!1;W.error=R;const C=q[l];if(!u(C)&&(g<=C[0]||g<=C[1]||C[1]===0))return Ye(),T&&k()&&m().onDiscarded(l),!1;const B=V().data;W.data=o(B,j)?B:j,T&&k()&&m().onSuccess(j,l,r)}catch(C){Ze();const B=m(),{shouldRetryOnError:ge}=B;B.isPaused()||(W.error=C,T&&k()&&(B.onError(C,l,B),(ge===!0||M(ge)&&ge(C))&&(!m().revalidateOnFocus||!m().revalidateOnReconnect||Y())&&B.onErrorRetry(C,l,B,Lt=>{const je=E[l];je&&je[0]&&je[0](at,Lt)},{retryCount:(re.retryCount||0)+1,dedupe:!0})))}return O=!1,Ye(),!0},[l,s]),Je=h.useCallback((..._)=>Nt(s,D.current,..._),[]);if(ke(()=>{A.current=t,J.current=r,u(ne)||(ve.current=ne)}),ke(()=>{if(!l)return;const _=ae.bind(R,Ce);let x=0;m().revalidateOnFocus&&(x=Date.now()+m().focusThrottleInterval);const g=ys(l,E,(O,re={})=>{if(O==jt){const T=Date.now();m().revalidateOnFocus&&T>x&&Y()&&(x=T+m().focusThrottleInterval,_())}else if(O==wt)m().revalidateOnReconnect&&Y()&&_();else{if(O==yt)return ae();if(O==at)return ae(re)}});return y.current=!1,D.current=l,Q.current=!0,Z({_k:de}),Ke&&($[l]||(u(G)||oe?_():rs(_))),()=>{y.current=!0,g()}},[l]),ke(()=>{let _;function x(){const g=M(d)?d(V().data):d;g&&_!==-1&&(_=setTimeout(j,g))}function j(){!V().error&&(v||m().isVisible())&&(p||m().isOnline())?ae(Ce).then(x):x()}return x(),()=>{_&&(clearTimeout(_),_=-1)}},[d,v,p,l]),h.useDebugValue(he),a){if(!lt&&oe&&X)throw new Error("Fallback data is required when using Suspense in SSR.");X&&(A.current=t,J.current=r,y.current=!1);const _=ie[l],x=!u(_)&&X?Je(_):ft;if(Ie(x),!u(fe)&&X)throw fe;const j=X?ae(Ce):ft;!u(he)&&X&&(j.status="fulfilled",j.value=!0),Ie(j)}return{mutate:Je,get data(){return ee.data=!0,he},get error(){return ee.error=!0,fe},get isValidating(){return ee.isValidating=!0,Ct},get isLoading(){return ee.isLoading=!0,qt}}},ht=ws(Ts);class bs extends Error{constructor({message:t,status:r,data:s}){super(t),this.name="TwitterApiError",this.status=r,this.data=s}}const Ns=ht.default||ht,Rs="https://react-tweet.vercel.app";async function ks([e,t]){const r=await fetch(e,t),s=await r.json();if(r.ok)return s.data||null;throw new bs({message:`Failed to fetch tweet at "${e}" with "${r.status}".`,data:s,status:r.status})}const Ss=(e,t,r)=>{const{isLoading:s,data:o,error:a}=Ns(()=>t||e?[t||e&&`${Rs}/api/tweet/${e}`,r]:null,ks,{revalidateIfStale:!1,revalidateOnFocus:!1,shouldRetryOnError:!1});return{isLoading:!!(s||o===void 0&&!a),data:o,error:a}},Es=({id:e,apiUrl:t,fallback:r=n.jsx(Xr,{}),components:s,fetchOptions:o,onError:a})=>{const{data:i,error:c,isLoading:f}=Ss(e,t,o);if(f)return r;if(c||!i){const d=(s==null?void 0:s.TweetNotFound)||Fr;return n.jsx(d,{error:a?a(c):c})}return n.jsx(Wr,{tweet:i,components:s})};function Is({node:e}){var s;const t=((s=e==null?void 0:e.attrs)==null?void 0:s.src)||"",r=t==null?void 0:t.split("/").pop();return r?n.jsx(xe.NodeViewWrapper,{children:n.jsx("div",{"data-twitter":"",children:n.jsx(Es,{id:r})})}):null}function St(e){const{t}=At.useLocale(),[r,s]=h.useState("");h.useEffect(()=>{var a;if(e!=null&&e.editor){const{src:i}=(a=e.editor)==null?void 0:a.getAttributes(ze.name);i&&s(i)}},[e==null?void 0:e.editor]);function o(a){a.preventDefault(),a.stopPropagation(),e==null||e.onSetLink(r)}return n.jsx("div",{className:"border-neutral-200 richtext-rounded-lg !richtext-border richtext-bg-white richtext-p-2 richtext-shadow-sm dark:richtext-border-neutral-800 dark:richtext-bg-black",children:n.jsxs("form",{className:"richtext-flex richtext-flex-col richtext-gap-2",onSubmit:o,children:[n.jsx(Vt.Label,{className:"mb-[6px]",children:t("editor.link.dialog.text")}),n.jsx("div",{className:"richtext-mb-[10px] richtext-flex richtext-w-full richtext-max-w-sm richtext-items-center richtext-gap-1.5",children:n.jsx("div",{className:"richtext-relative richtext-w-full richtext-max-w-sm richtext-items-center",children:n.jsx(Mt.Input,{className:"richtext-w-80",onChange:a=>s(a.target.value),placeholder:"Text",required:!0,type:"text",value:r})})}),n.jsx(Wt.Button,{className:"richtext-mt-2 richtext-self-end",type:"submit",children:t("editor.link.dialog.button.apply")})]})})}function Cs(){const[e,t]=h.useState(!1),r=$t.useEditorInstance(),s=tt.useButtonProps(ze.name),{icon:o=void 0,tooltip:a=void 0,tooltipOptions:i={},action:c=void 0,isActive:f=void 0}=(s==null?void 0:s.componentProps)??{},{editorDisabled:d}=tt.useToggleActive(f);function v(p){d||c&&(c(p),t(!1))}return n.jsxs(ye.Popover,{modal:!0,onOpenChange:t,open:e,children:[n.jsx(ye.PopoverTrigger,{asChild:!0,children:n.jsx(Ot.ActionButton,{disabled:d,isActive:f,tooltip:a,tooltipOptions:i,children:n.jsx(Dt.IconComponent,{name:o})})}),n.jsx(ye.PopoverContent,{align:"start",className:"richtext-w-full",hideWhenDetached:!0,side:"bottom",children:n.jsx(St,{editor:r,onSetLink:v})})]})}const qs=/(https?:\/\/)?(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?/g,Ls=/^https?:\/\/(www\.)?x\.com\/(\w{1,15})(\/status\/(\d+))?(\/\S*)?$/;function _t(e){return e.match(Ls)}const ze=we.Node3.create({name:"twitter",draggable:!0,selectable:!0,addOptions(){return{addPasteHandler:!0,HTMLAttributes:{},inline:!1,origin:"",button:({editor:e,t})=>({componentProps:{action:r=>{e.commands.setTweet({src:r})},isActive:()=>!1,disabled:!1,icon:"Twitter",tooltip:t("editor.twitter.tooltip"),editor:e}})}},addNodeView(){return xe.ReactNodeViewRenderer(Is,{attrs:this.options.HTMLAttributes})},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},addAttributes(){return{src:{default:null}}},parseHTML(){return[{tag:"div[data-twitter]"}]},addCommands(){return{setTweet:e=>({commands:t})=>_t(e.src)?t.insertContent({type:this.name,attrs:e}):!1,updateTweet:e=>({commands:t})=>_t(e.src)?t.updateAttributes(this.name,{src:e.src}):!1}},addPasteRules(){return this.options.addPasteHandler?[we.nodePasteRule({find:qs,type:this.type,getAttributes:e=>({src:e.input})})]:[]},renderHTML({HTMLAttributes:e}){return["div",we.mergeAttributes({"data-twitter":""},e)]}});exports.FormEditLinkTwitter=St;exports.RichTextTwitter=Cs;exports.Twitter=ze;
package/lib/Twitter.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-DF2Lp4HZ.cjs");require("./dom-dataset-_6-diIRQ.cjs");const e=require("./Twitter-Cutpkh3h.cjs");exports.Twitter=e.Twitter;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-RfTlOzIr.cjs");require("./index-BH4bc3jN.cjs");const e=require("./Twitter-CtVTIWJW.cjs");exports.RichTextTwitter=e.RichTextTwitter;exports.Twitter=e.Twitter;
package/lib/Twitter.d.cts CHANGED
@@ -1,5 +1,8 @@
1
+ import { JSX } from 'react/jsx-runtime';
1
2
  import { Node as Node_2 } from '@tiptap/core';
2
3
 
4
+ export declare function RichTextTwitter(): JSX.Element;
5
+
3
6
  /**
4
7
  * This extension adds support for tweets.
5
8
  */
@@ -60,11 +63,22 @@ declare module '@tiptap/core' {
60
63
  }
61
64
 
62
65
 
66
+ declare module '@tiptap/core' {
67
+ interface Storage {
68
+ color: ColorStorage;
69
+ }
70
+ }
71
+
72
+
63
73
  declare module '@tiptap/core' {
64
74
  interface Commands<ReturnType> {
65
- drawer: {
66
- setDrawer: (options: any, replace?: any) => ReturnType;
67
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
75
+ columns: {
76
+ insertColumns: (attrs?: {
77
+ cols: number;
78
+ }) => ReturnType;
79
+ addColBefore: () => ReturnType;
80
+ addColAfter: () => ReturnType;
81
+ deleteCol: () => ReturnType;
68
82
  };
69
83
  }
70
84
  }
@@ -72,8 +86,9 @@ declare module '@tiptap/core' {
72
86
 
73
87
  declare module '@tiptap/core' {
74
88
  interface Commands<ReturnType> {
75
- excalidraw: {
76
- setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
89
+ drawer: {
90
+ setDrawer: (options: any, replace?: any) => ReturnType;
91
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
77
92
  };
78
93
  }
79
94
  }
@@ -91,7 +106,16 @@ declare module '@tiptap/core' {
91
106
  declare module '@tiptap/core' {
92
107
  interface Commands<ReturnType> {
93
108
  exportWord: {
94
- exportToWord: () => ReturnType;
109
+ exportToWord: (docState: any) => ReturnType;
110
+ };
111
+ }
112
+ }
113
+
114
+
115
+ declare module '@tiptap/core' {
116
+ interface Commands<ReturnType> {
117
+ excalidraw: {
118
+ setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
95
119
  };
96
120
  }
97
121
  }
@@ -116,10 +140,8 @@ declare module '@tiptap/core' {
116
140
 
117
141
 
118
142
  declare module '@tiptap/core' {
119
- interface Commands<ReturnType> {
120
- painter: {
121
- setPainter: (marks: Mark[]) => ReturnType;
122
- };
143
+ interface Storage {
144
+ highlight: HighlightStorage;
123
145
  }
124
146
  }
125
147
 
@@ -204,16 +226,6 @@ declare module '@tiptap/core' {
204
226
  }
205
227
 
206
228
 
207
- declare module '@tiptap/core' {
208
- interface Commands<ReturnType> {
209
- lineHeight: {
210
- setLineHeight: (lineHeight: string) => ReturnType;
211
- unsetLineHeight: () => ReturnType;
212
- };
213
- }
214
- }
215
-
216
-
217
229
  declare module '@tiptap/core' {
218
230
  interface Commands<ReturnType> {
219
231
  mermaid: {
@@ -224,20 +236,6 @@ declare module '@tiptap/core' {
224
236
  }
225
237
 
226
238
 
227
- declare module '@tiptap/core' {
228
- interface Commands<ReturnType> {
229
- columns: {
230
- insertColumns: (attrs?: {
231
- cols: number;
232
- }) => ReturnType;
233
- addColBefore: () => ReturnType;
234
- addColAfter: () => ReturnType;
235
- deleteCol: () => ReturnType;
236
- };
237
- }
238
- }
239
-
240
-
241
239
  declare module '@tiptap/core' {
242
240
  interface Commands<ReturnType> {
243
241
  search: {
@@ -261,16 +259,6 @@ declare module '@tiptap/core' {
261
259
  }
262
260
 
263
261
 
264
- declare module '@tiptap/core' {
265
- interface Commands<ReturnType> {
266
- tableOfContents: {
267
- setTableOfContents: () => ReturnType;
268
- removeTableOfContents: () => ReturnType;
269
- };
270
- }
271
- }
272
-
273
-
274
262
  declare module '@tiptap/core' {
275
263
  interface Commands<ReturnType> {
276
264
  twitter: {
package/lib/Twitter.d.ts CHANGED
@@ -1,5 +1,8 @@
1
+ import { JSX } from 'react/jsx-runtime';
1
2
  import { Node as Node_2 } from '@tiptap/core';
2
3
 
4
+ export declare function RichTextTwitter(): JSX.Element;
5
+
3
6
  /**
4
7
  * This extension adds support for tweets.
5
8
  */
@@ -60,11 +63,22 @@ declare module '@tiptap/core' {
60
63
  }
61
64
 
62
65
 
66
+ declare module '@tiptap/core' {
67
+ interface Storage {
68
+ color: ColorStorage;
69
+ }
70
+ }
71
+
72
+
63
73
  declare module '@tiptap/core' {
64
74
  interface Commands<ReturnType> {
65
- drawer: {
66
- setDrawer: (options: any, replace?: any) => ReturnType;
67
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
75
+ columns: {
76
+ insertColumns: (attrs?: {
77
+ cols: number;
78
+ }) => ReturnType;
79
+ addColBefore: () => ReturnType;
80
+ addColAfter: () => ReturnType;
81
+ deleteCol: () => ReturnType;
68
82
  };
69
83
  }
70
84
  }
@@ -72,8 +86,9 @@ declare module '@tiptap/core' {
72
86
 
73
87
  declare module '@tiptap/core' {
74
88
  interface Commands<ReturnType> {
75
- excalidraw: {
76
- setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
89
+ drawer: {
90
+ setDrawer: (options: any, replace?: any) => ReturnType;
91
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
77
92
  };
78
93
  }
79
94
  }
@@ -91,7 +106,16 @@ declare module '@tiptap/core' {
91
106
  declare module '@tiptap/core' {
92
107
  interface Commands<ReturnType> {
93
108
  exportWord: {
94
- exportToWord: () => ReturnType;
109
+ exportToWord: (docState: any) => ReturnType;
110
+ };
111
+ }
112
+ }
113
+
114
+
115
+ declare module '@tiptap/core' {
116
+ interface Commands<ReturnType> {
117
+ excalidraw: {
118
+ setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
95
119
  };
96
120
  }
97
121
  }
@@ -116,10 +140,8 @@ declare module '@tiptap/core' {
116
140
 
117
141
 
118
142
  declare module '@tiptap/core' {
119
- interface Commands<ReturnType> {
120
- painter: {
121
- setPainter: (marks: Mark[]) => ReturnType;
122
- };
143
+ interface Storage {
144
+ highlight: HighlightStorage;
123
145
  }
124
146
  }
125
147
 
@@ -204,16 +226,6 @@ declare module '@tiptap/core' {
204
226
  }
205
227
 
206
228
 
207
- declare module '@tiptap/core' {
208
- interface Commands<ReturnType> {
209
- lineHeight: {
210
- setLineHeight: (lineHeight: string) => ReturnType;
211
- unsetLineHeight: () => ReturnType;
212
- };
213
- }
214
- }
215
-
216
-
217
229
  declare module '@tiptap/core' {
218
230
  interface Commands<ReturnType> {
219
231
  mermaid: {
@@ -224,20 +236,6 @@ declare module '@tiptap/core' {
224
236
  }
225
237
 
226
238
 
227
- declare module '@tiptap/core' {
228
- interface Commands<ReturnType> {
229
- columns: {
230
- insertColumns: (attrs?: {
231
- cols: number;
232
- }) => ReturnType;
233
- addColBefore: () => ReturnType;
234
- addColAfter: () => ReturnType;
235
- deleteCol: () => ReturnType;
236
- };
237
- }
238
- }
239
-
240
-
241
239
  declare module '@tiptap/core' {
242
240
  interface Commands<ReturnType> {
243
241
  search: {
@@ -261,16 +259,6 @@ declare module '@tiptap/core' {
261
259
  }
262
260
 
263
261
 
264
- declare module '@tiptap/core' {
265
- interface Commands<ReturnType> {
266
- tableOfContents: {
267
- setTableOfContents: () => ReturnType;
268
- removeTableOfContents: () => ReturnType;
269
- };
270
- }
271
- }
272
-
273
-
274
262
  declare module '@tiptap/core' {
275
263
  interface Commands<ReturnType> {
276
264
  twitter: {
package/lib/Twitter.js CHANGED
@@ -1,6 +1,7 @@
1
- import "./index-kbO3iWqL.js";
2
- import "./dom-dataset-lYeH6gfI.js";
3
- import { T as m } from "./Twitter-BFULyqdR.js";
1
+ import "./index-DnWWK9F_.js";
2
+ import "./index-DzcKxutn.js";
3
+ import { R as o, T } from "./Twitter-CXmmjz9R.js";
4
4
  export {
5
- m as Twitter
5
+ o as RichTextTwitter,
6
+ T as Twitter
6
7
  };
package/lib/Video.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./index-DF2Lp4HZ.cjs");require("./index-6D1J-A-o.cjs");const e=require("./RichTextEditor-CxvwGvQG.cjs");exports.Video=e.Video;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("./index-RfTlOzIr.cjs"),b=require("./index-Dfmm6FTT.cjs"),x=require("./useButtonProps-C6Vpn190.cjs"),o=require("react/jsx-runtime"),d=require("react"),$=require("./toggle-D41PzQLJ.cjs"),E=require("./index-DV5kbgRU.cjs"),g=require("./dialog-CaCS-W5S.cjs"),u=require("./tabs-BoLCMcCI.cjs"),D=require("./button-B12K7BJ4.cjs"),I=require("./input-_ECRfn3Y.cjs");function R(e,t){let s;try{s=new URL(e)}catch{return!1}return!(t!=null&&t.length)||t.length===1&&t[0]==="."?!0:t.some(n=>{if(n.includes("*")){const l=n.replace(/\./g,"\\.").replace(/\*/g,".*");return new RegExp(`^${l}$`).test(s.hostname)}return s.hostname.includes(n)})}function H(){const{t:e}=b.useLocale(),t=E.useEditorInstance(),s=x.useButtonProps(V.name),{icon:n,tooltip:l}=(s==null?void 0:s.componentProps)??{},{editorDisabled:c}=x.useToggleActive(),[p,w]=d.useState(""),y=d.useRef(null),[j,f]=d.useState(""),[L,h]=d.useState(!1),m=x.useExtension(V.name),k=r=>{h(r.detail)};d.useEffect(()=>{const r=b.listenEvent(b.EVENTS.UPLOAD_VIDEO(t.id),k);return()=>{r()}},[t]);const i=d.useMemo(()=>(m==null?void 0:m.options)??{},[m]);async function C(r){var M;const a=(M=r==null?void 0:r.target)==null?void 0:M.files;if(!t||t.isDestroyed||a.length===0)return;const v=a[0];let T="";i.upload?T=await i.upload(v):T=URL.createObjectURL(v),t.chain().focus().setVideo({src:T,width:"100%"}).run(),h(!1)}function A(r){r.preventDefault(),r.stopPropagation(),p&&(t.chain().focus().setVideo({src:p,width:"100%"}).run(),h(!1),w(""))}function S(r){var a;r.preventDefault(),(a=y.current)==null||a.click()}return o.jsxs(g.Dialog,{onOpenChange:h,open:L,children:[o.jsx(g.DialogTrigger,{asChild:!0,children:o.jsx($.ActionButton,{action:()=>{c||h(!0)},icon:n,tooltip:l,disabled:c})}),o.jsxs(g.DialogContent,{children:[o.jsx(g.DialogTitle,{children:e("editor.video.dialog.title")}),o.jsxs(u.Tabs,{activationMode:"manual",defaultValue:(i==null?void 0:i.resourceVideo)==="both"||(i==null?void 0:i.resourceVideo)==="upload"?"upload":"link",children:[o.jsxs(u.TabsList,{className:"richtext-grid richtext-w-full richtext-grid-cols-2",children:[((i==null?void 0:i.resourceVideo)==="both"||(i==null?void 0:i.resourceVideo)==="upload")&&o.jsx(u.TabsTrigger,{value:"upload",children:e("editor.video.dialog.tab.upload")}),((i==null?void 0:i.resourceVideo)==="both"||(i==null?void 0:i.resourceVideo)==="link")&&o.jsx(u.TabsTrigger,{value:"link",children:e("editor.video.dialog.link")})]}),o.jsxs(u.TabsContent,{value:"upload",children:[o.jsx("div",{className:"richtext-flex richtext-items-center richtext-gap-[10px]",children:o.jsx(D.Button,{className:"richtext-mt-1 richtext-w-full",onClick:S,size:"sm",children:e("editor.video.dialog.tab.upload")})}),o.jsx("input",{accept:"video/*",multiple:!0,onChange:C,ref:y,type:"file",style:{display:"none"}})]}),o.jsxs(u.TabsContent,{value:"link",children:[o.jsx("div",{children:o.jsxs("div",{className:"richtext-flex richtext-items-center richtext-gap-2",children:[o.jsx(I.Input,{autoFocus:!0,placeholder:e("editor.video.dialog.placeholder"),required:!0,type:"url",value:p,onChange:r=>{w(r.target.value)},onBlur:r=>{const a=r.target.value,v=i.videoProviders||["."];a&&!R(a,v)?f("Invalid video URL"):f("")}}),o.jsx(D.Button,{type:"button",onClick:A,children:e("editor.video.dialog.button.apply")})]})}),j&&o.jsx("div",{className:"richtext-my-[5px] richtext-text-red-500",children:j})]})]})]})]})}function B(e){e=e.replace("https://youtu.be/","https://www.youtube.com/watch?v=").replace("watch?v=","embed/");const t=e.match(/^https:\/\/www\.youtube\.com\/shorts\/([a-zA-Z0-9_-]+)/);t&&(e=`https://www.youtube.com/embed/${t[1]}`);const s=e.match(/^https:\/\/vimeo\.com\/(\d+)(?:\/([a-zA-Z0-9]+))?/);if(s){const l=s[1],c=s[2];c?e=`https://player.vimeo.com/video/${l}?h=${c}`:e=`https://player.vimeo.com/video/${l}`}return/^https?:\/\/www.bilibili.com\/video\/.*/i.test(e)&&(e=e.replace(/\?.*$/,"").replace("https://www.bilibili.com/video/","https://player.bilibili.com/player.html?bvid=")),e.includes("drive.google.com")&&(e=e.replace("/view","/preview")),e}const V=q.Node3.create({name:"video",group:"block",atom:!0,draggable:!0,addOptions(){return{divider:!1,spacer:!1,allowFullscreen:!0,upload:void 0,frameborder:!1,resourceVideo:"both",width:b.VIDEO_SIZE["size-medium"],HTMLAttributes:{class:"iframe-wrapper"},button:({editor:e,t})=>{var s,n;return{componentProps:{action:()=>{},isActive:()=>e.isActive("video")||!1,disabled:!((n=(s=e.can()).setVideo)!=null&&n.call(s,{})),icon:"Video",tooltip:t("editor.video.tooltip"),videoProviders:["."],editor:e}}}}},addAttributes(){return{src:{default:null,renderHTML:({src:e})=>({src:e?B(e):null})},width:{default:this.options.width,renderHTML:({width:e})=>({width:x.getCssUnitWithDefault(e)})},frameborder:{default:this.options.frameborder?1:0,parseHTML:()=>this.options.frameborder?1:0},allowfullscreen:{default:this.options.allowFullscreen,parseHTML:()=>this.options.allowFullscreen},align:{default:"center",renderHTML:({align:e})=>({align:e})}}},parseHTML(){return[{tag:"div[data-video] iframe"}]},renderHTML({HTMLAttributes:e}){const{width:t="100%",align:s="center"}=e??{},n={...e,width:"100%",height:"100%"},l=`position: relative;overflow: hidden;display: flex;flex: 1;max-width: ${t};`,c=`flex: 1;padding-bottom: ${9/16*100}%;`,f=["div",{style:`display: flex; justify-content: ${s};`},["div",{style:l},["div",{style:c}],["iframe",n]]];return["div",{...this.options.HTMLAttributes,class:"iframe-wrapper","data-video":""},f]},addCommands(){return{setVideo:e=>({commands:t})=>t.insertContent({type:this.name,attrs:e}),updateVideo:e=>({commands:t})=>t.updateAttributes(this.name,e)}}});exports.RichTextVideo=H;exports.Video=V;
package/lib/Video.d.cts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { Editor } from '@tiptap/react';
2
2
  import { Extension } from '@tiptap/core';
3
+ import { JSX } from 'react/jsx-runtime';
3
4
  import { Node as Node_2 } from '@tiptap/core';
4
5
 
5
6
  /**
@@ -71,6 +72,8 @@ declare interface GeneralOptions<T> {
71
72
  shortcutKeys?: string[] | string[][];
72
73
  }
73
74
 
75
+ export declare function RichTextVideo(): JSX.Element;
76
+
74
77
  export declare const Video: Node_2<VideoOptions, any>;
75
78
 
76
79
  /**
@@ -145,11 +148,22 @@ declare module '@tiptap/core' {
145
148
  }
146
149
 
147
150
 
151
+ declare module '@tiptap/core' {
152
+ interface Storage {
153
+ color: ColorStorage;
154
+ }
155
+ }
156
+
157
+
148
158
  declare module '@tiptap/core' {
149
159
  interface Commands<ReturnType> {
150
- drawer: {
151
- setDrawer: (options: any, replace?: any) => ReturnType;
152
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
160
+ columns: {
161
+ insertColumns: (attrs?: {
162
+ cols: number;
163
+ }) => ReturnType;
164
+ addColBefore: () => ReturnType;
165
+ addColAfter: () => ReturnType;
166
+ deleteCol: () => ReturnType;
153
167
  };
154
168
  }
155
169
  }
@@ -157,8 +171,9 @@ declare module '@tiptap/core' {
157
171
 
158
172
  declare module '@tiptap/core' {
159
173
  interface Commands<ReturnType> {
160
- excalidraw: {
161
- setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
174
+ drawer: {
175
+ setDrawer: (options: any, replace?: any) => ReturnType;
176
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
162
177
  };
163
178
  }
164
179
  }
@@ -176,7 +191,16 @@ declare module '@tiptap/core' {
176
191
  declare module '@tiptap/core' {
177
192
  interface Commands<ReturnType> {
178
193
  exportWord: {
179
- exportToWord: () => ReturnType;
194
+ exportToWord: (docState: any) => ReturnType;
195
+ };
196
+ }
197
+ }
198
+
199
+
200
+ declare module '@tiptap/core' {
201
+ interface Commands<ReturnType> {
202
+ excalidraw: {
203
+ setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
180
204
  };
181
205
  }
182
206
  }
@@ -201,10 +225,8 @@ declare module '@tiptap/core' {
201
225
 
202
226
 
203
227
  declare module '@tiptap/core' {
204
- interface Commands<ReturnType> {
205
- painter: {
206
- setPainter: (marks: Mark[]) => ReturnType;
207
- };
228
+ interface Storage {
229
+ highlight: HighlightStorage;
208
230
  }
209
231
  }
210
232
 
@@ -289,16 +311,6 @@ declare module '@tiptap/core' {
289
311
  }
290
312
 
291
313
 
292
- declare module '@tiptap/core' {
293
- interface Commands<ReturnType> {
294
- lineHeight: {
295
- setLineHeight: (lineHeight: string) => ReturnType;
296
- unsetLineHeight: () => ReturnType;
297
- };
298
- }
299
- }
300
-
301
-
302
314
  declare module '@tiptap/core' {
303
315
  interface Commands<ReturnType> {
304
316
  mermaid: {
@@ -309,20 +321,6 @@ declare module '@tiptap/core' {
309
321
  }
310
322
 
311
323
 
312
- declare module '@tiptap/core' {
313
- interface Commands<ReturnType> {
314
- columns: {
315
- insertColumns: (attrs?: {
316
- cols: number;
317
- }) => ReturnType;
318
- addColBefore: () => ReturnType;
319
- addColAfter: () => ReturnType;
320
- deleteCol: () => ReturnType;
321
- };
322
- }
323
- }
324
-
325
-
326
324
  declare module '@tiptap/core' {
327
325
  interface Commands<ReturnType> {
328
326
  search: {
@@ -346,16 +344,6 @@ declare module '@tiptap/core' {
346
344
  }
347
345
 
348
346
 
349
- declare module '@tiptap/core' {
350
- interface Commands<ReturnType> {
351
- tableOfContents: {
352
- setTableOfContents: () => ReturnType;
353
- removeTableOfContents: () => ReturnType;
354
- };
355
- }
356
- }
357
-
358
-
359
347
  declare module '@tiptap/core' {
360
348
  interface Commands<ReturnType> {
361
349
  twitter: {
package/lib/Video.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { Editor } from '@tiptap/react';
2
2
  import { Extension } from '@tiptap/core';
3
+ import { JSX } from 'react/jsx-runtime';
3
4
  import { Node as Node_2 } from '@tiptap/core';
4
5
 
5
6
  /**
@@ -71,6 +72,8 @@ declare interface GeneralOptions<T> {
71
72
  shortcutKeys?: string[] | string[][];
72
73
  }
73
74
 
75
+ export declare function RichTextVideo(): JSX.Element;
76
+
74
77
  export declare const Video: Node_2<VideoOptions, any>;
75
78
 
76
79
  /**
@@ -145,11 +148,22 @@ declare module '@tiptap/core' {
145
148
  }
146
149
 
147
150
 
151
+ declare module '@tiptap/core' {
152
+ interface Storage {
153
+ color: ColorStorage;
154
+ }
155
+ }
156
+
157
+
148
158
  declare module '@tiptap/core' {
149
159
  interface Commands<ReturnType> {
150
- drawer: {
151
- setDrawer: (options: any, replace?: any) => ReturnType;
152
- setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
160
+ columns: {
161
+ insertColumns: (attrs?: {
162
+ cols: number;
163
+ }) => ReturnType;
164
+ addColBefore: () => ReturnType;
165
+ addColAfter: () => ReturnType;
166
+ deleteCol: () => ReturnType;
153
167
  };
154
168
  }
155
169
  }
@@ -157,8 +171,9 @@ declare module '@tiptap/core' {
157
171
 
158
172
  declare module '@tiptap/core' {
159
173
  interface Commands<ReturnType> {
160
- excalidraw: {
161
- setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
174
+ drawer: {
175
+ setDrawer: (options: any, replace?: any) => ReturnType;
176
+ setAlignImageDrawer: (align: 'left' | 'center' | 'right') => ReturnType;
162
177
  };
163
178
  }
164
179
  }
@@ -176,7 +191,16 @@ declare module '@tiptap/core' {
176
191
  declare module '@tiptap/core' {
177
192
  interface Commands<ReturnType> {
178
193
  exportWord: {
179
- exportToWord: () => ReturnType;
194
+ exportToWord: (docState: any) => ReturnType;
195
+ };
196
+ }
197
+ }
198
+
199
+
200
+ declare module '@tiptap/core' {
201
+ interface Commands<ReturnType> {
202
+ excalidraw: {
203
+ setExcalidraw: (attrs?: IExcalidrawAttrs) => ReturnType;
180
204
  };
181
205
  }
182
206
  }
@@ -201,10 +225,8 @@ declare module '@tiptap/core' {
201
225
 
202
226
 
203
227
  declare module '@tiptap/core' {
204
- interface Commands<ReturnType> {
205
- painter: {
206
- setPainter: (marks: Mark[]) => ReturnType;
207
- };
228
+ interface Storage {
229
+ highlight: HighlightStorage;
208
230
  }
209
231
  }
210
232
 
@@ -289,16 +311,6 @@ declare module '@tiptap/core' {
289
311
  }
290
312
 
291
313
 
292
- declare module '@tiptap/core' {
293
- interface Commands<ReturnType> {
294
- lineHeight: {
295
- setLineHeight: (lineHeight: string) => ReturnType;
296
- unsetLineHeight: () => ReturnType;
297
- };
298
- }
299
- }
300
-
301
-
302
314
  declare module '@tiptap/core' {
303
315
  interface Commands<ReturnType> {
304
316
  mermaid: {
@@ -309,20 +321,6 @@ declare module '@tiptap/core' {
309
321
  }
310
322
 
311
323
 
312
- declare module '@tiptap/core' {
313
- interface Commands<ReturnType> {
314
- columns: {
315
- insertColumns: (attrs?: {
316
- cols: number;
317
- }) => ReturnType;
318
- addColBefore: () => ReturnType;
319
- addColAfter: () => ReturnType;
320
- deleteCol: () => ReturnType;
321
- };
322
- }
323
- }
324
-
325
-
326
324
  declare module '@tiptap/core' {
327
325
  interface Commands<ReturnType> {
328
326
  search: {
@@ -346,16 +344,6 @@ declare module '@tiptap/core' {
346
344
  }
347
345
 
348
346
 
349
- declare module '@tiptap/core' {
350
- interface Commands<ReturnType> {
351
- tableOfContents: {
352
- setTableOfContents: () => ReturnType;
353
- removeTableOfContents: () => ReturnType;
354
- };
355
- }
356
- }
357
-
358
-
359
347
  declare module '@tiptap/core' {
360
348
  interface Commands<ReturnType> {
361
349
  twitter: {