@scottjgilbert/lexical-blog-editor 0.1.4 → 1.0.0-beta.2

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 (313) hide show
  1. package/README.md +73 -67
  2. package/build/Editor.d.ts +8 -3
  3. package/build/Editor.d.ts.map +1 -1
  4. package/build/Editor.js +13 -8
  5. package/build/EditorExport.d.ts +4 -0
  6. package/build/EditorExport.d.ts.map +1 -0
  7. package/build/EditorExport.js +13 -0
  8. package/build/appSettings.d.ts +1 -1
  9. package/build/appSettings.js +1 -1
  10. package/build/buildHTMLConfig.d.ts +1 -1
  11. package/build/buildHTMLConfig.d.ts.map +1 -1
  12. package/build/buildHTMLConfig.js +35 -11
  13. package/build/context/FlashMessageContext.d.ts +2 -2
  14. package/build/context/FlashMessageContext.d.ts.map +1 -1
  15. package/build/context/FlashMessageContext.js +4 -3
  16. package/build/context/SharedHistoryContext.d.ts +3 -3
  17. package/build/context/SharedHistoryContext.d.ts.map +1 -1
  18. package/build/context/SharedHistoryContext.js +3 -2
  19. package/build/context/ToolbarContext.d.ts +1 -0
  20. package/build/context/ToolbarContext.d.ts.map +1 -1
  21. package/build/context/ToolbarContext.js +2 -0
  22. package/build/hooks/useModal.d.ts.map +1 -1
  23. package/build/hooks/useModal.js +1 -0
  24. package/build/hooks/useReport.d.ts +0 -7
  25. package/build/hooks/useReport.d.ts.map +1 -1
  26. package/build/hooks/useReport.js +1 -0
  27. package/build/index.css +283 -246
  28. package/build/index.d.ts +3 -3
  29. package/build/index.d.ts.map +1 -1
  30. package/build/index.js +2 -2
  31. package/build/nodes/CodeNode/CodeHighlightNode.d.ts +35 -0
  32. package/build/nodes/CodeNode/CodeHighlightNode.d.ts.map +1 -0
  33. package/build/nodes/CodeNode/CodeHighlightNode.js +88 -0
  34. package/build/nodes/CodeNode/CodeHighlighterShiki.d.ts +22 -0
  35. package/build/nodes/CodeNode/CodeHighlighterShiki.d.ts.map +1 -0
  36. package/build/nodes/CodeNode/CodeHighlighterShiki.js +644 -0
  37. package/build/nodes/CodeNode/CodeNode.d.ts +48 -0
  38. package/build/nodes/CodeNode/CodeNode.d.ts.map +1 -0
  39. package/build/nodes/CodeNode/CodeNode.js +367 -0
  40. package/build/nodes/CodeNode/FacadeShiki.d.ts +18 -0
  41. package/build/nodes/CodeNode/FacadeShiki.d.ts.map +1 -0
  42. package/build/nodes/CodeNode/FacadeShiki.js +159 -0
  43. package/build/nodes/CodeNode/FlatStructureUtils.d.ts +21 -0
  44. package/build/nodes/CodeNode/FlatStructureUtils.d.ts.map +1 -0
  45. package/build/nodes/CodeNode/FlatStructureUtils.js +85 -0
  46. package/build/nodes/CodeNode/invariant.d.ts +2 -0
  47. package/build/nodes/CodeNode/invariant.d.ts.map +1 -0
  48. package/build/nodes/CodeNode/invariant.js +6 -0
  49. package/build/nodes/DateTimeNode/DateTimeComponent.d.ts.map +1 -1
  50. package/build/nodes/DateTimeNode/DateTimeComponent.js +1 -0
  51. package/build/nodes/DateTimeNode/DateTimeNode.css +21 -0
  52. package/build/nodes/FigmaNode/FigmaNode.d.ts.map +1 -0
  53. package/build/nodes/FigmaNode/ServerFigmaNode.d.ts +21 -0
  54. package/build/nodes/FigmaNode/ServerFigmaNode.d.ts.map +1 -0
  55. package/build/nodes/FigmaNode/ServerFigmaNode.js +48 -0
  56. package/build/nodes/ImageComponent.d.ts.map +1 -1
  57. package/build/nodes/ImageComponent.js +1 -2
  58. package/build/nodes/ImageNode.d.ts +7 -7
  59. package/build/nodes/ImageNode.d.ts.map +1 -1
  60. package/build/nodes/ImageNode.js +30 -30
  61. package/build/nodes/LayoutContainerNode.d.ts +2 -2
  62. package/build/nodes/LayoutContainerNode.d.ts.map +1 -1
  63. package/build/nodes/LayoutContainerNode.js +10 -10
  64. package/build/nodes/PlaygroundNodes/PlaygroundNodes.d.ts.map +1 -0
  65. package/build/nodes/{PlaygroundNodes.js → PlaygroundNodes/PlaygroundNodes.js} +19 -21
  66. package/build/nodes/PlaygroundNodes/ServerPlaygroundNodes.d.ts +11 -0
  67. package/build/nodes/PlaygroundNodes/ServerPlaygroundNodes.d.ts.map +1 -0
  68. package/build/nodes/PlaygroundNodes/ServerPlaygroundNodes.js +65 -0
  69. package/build/nodes/TweetNode/ServerTweetNode.d.ts +20 -0
  70. package/build/nodes/TweetNode/ServerTweetNode.d.ts.map +1 -0
  71. package/build/nodes/TweetNode/ServerTweetNode.js +59 -0
  72. package/build/nodes/TweetNode/TweetNode.d.ts.map +1 -0
  73. package/build/nodes/YouTubeNode/ServerYouTubeNode.d.ts +21 -0
  74. package/build/nodes/YouTubeNode/ServerYouTubeNode.d.ts.map +1 -0
  75. package/build/nodes/YouTubeNode/ServerYouTubeNode.js +67 -0
  76. package/build/nodes/YouTubeNode/YouTubeNode.d.ts.map +1 -0
  77. package/build/plugins/ActionsPlugin/index.d.ts +0 -7
  78. package/build/plugins/ActionsPlugin/index.d.ts.map +1 -1
  79. package/build/plugins/ActionsPlugin/index.js +2 -1
  80. package/build/plugins/AutoEmbedPlugin/index.d.ts +2 -9
  81. package/build/plugins/AutoEmbedPlugin/index.d.ts.map +1 -1
  82. package/build/plugins/AutoEmbedPlugin/index.js +30 -29
  83. package/build/plugins/AutoLinkPlugin/index.d.ts +1 -1
  84. package/build/plugins/AutoLinkPlugin/index.d.ts.map +1 -1
  85. package/build/plugins/AutoLinkPlugin/index.js +3 -2
  86. package/build/plugins/CodeActionMenuPlugin/components/CopyButton/index.d.ts +1 -1
  87. package/build/plugins/CodeActionMenuPlugin/components/CopyButton/index.d.ts.map +1 -1
  88. package/build/plugins/CodeActionMenuPlugin/components/CopyButton/index.js +7 -6
  89. package/build/plugins/CodeActionMenuPlugin/components/PrettierButton/index.d.ts +2 -2
  90. package/build/plugins/CodeActionMenuPlugin/components/PrettierButton/index.d.ts.map +1 -1
  91. package/build/plugins/CodeActionMenuPlugin/components/PrettierButton/index.js +25 -24
  92. package/build/plugins/CodeActionMenuPlugin/index.d.ts +2 -9
  93. package/build/plugins/CodeActionMenuPlugin/index.d.ts.map +1 -1
  94. package/build/plugins/CodeActionMenuPlugin/index.js +22 -20
  95. package/build/plugins/CodeActionMenuPlugin/utils.d.ts.map +1 -1
  96. package/build/plugins/CodeActionMenuPlugin/utils.js +3 -2
  97. package/build/plugins/CodeHighlightPrismPlugin/index.d.ts +1 -1
  98. package/build/plugins/CodeHighlightPrismPlugin/index.d.ts.map +1 -1
  99. package/build/plugins/CodeHighlightPrismPlugin/index.js +4 -10
  100. package/build/plugins/CodeHighlightShikiPlugin/index.d.ts +1 -1
  101. package/build/plugins/CodeHighlightShikiPlugin/index.d.ts.map +1 -1
  102. package/build/plugins/CodeHighlightShikiPlugin/index.js +3 -3
  103. package/build/plugins/CollapsiblePlugin/Collapsible.css +17 -1
  104. package/build/plugins/CollapsiblePlugin/index.d.ts +1 -1
  105. package/build/plugins/CollapsiblePlugin/index.d.ts.map +1 -1
  106. package/build/plugins/CollapsiblePlugin/index.js +11 -10
  107. package/build/plugins/ComponentPickerPlugin/index.d.ts.map +1 -1
  108. package/build/plugins/ComponentPickerPlugin/index.js +3 -8
  109. package/build/plugins/ContextMenuPlugin/index.d.ts +1 -1
  110. package/build/plugins/ContextMenuPlugin/index.d.ts.map +1 -1
  111. package/build/plugins/ContextMenuPlugin/index.js +15 -14
  112. package/build/plugins/DateTimePlugin/index.d.ts +2 -2
  113. package/build/plugins/DateTimePlugin/index.d.ts.map +1 -1
  114. package/build/plugins/DateTimePlugin/index.js +8 -14
  115. package/build/plugins/DragDropPastePlugin/index.d.ts +0 -7
  116. package/build/plugins/DragDropPastePlugin/index.d.ts.map +1 -1
  117. package/build/plugins/DragDropPastePlugin/index.js +12 -11
  118. package/build/plugins/DraggableBlockPlugin/index.css +6 -0
  119. package/build/plugins/DraggableBlockPlugin/index.d.ts +2 -2
  120. package/build/plugins/DraggableBlockPlugin/index.d.ts.map +1 -1
  121. package/build/plugins/DraggableBlockPlugin/index.js +23 -22
  122. package/build/plugins/EmojiPickerPlugin/index.d.ts +0 -7
  123. package/build/plugins/EmojiPickerPlugin/index.d.ts.map +1 -1
  124. package/build/plugins/EmojiPickerPlugin/index.js +1 -0
  125. package/build/plugins/EmojisPlugin/index.d.ts +1 -8
  126. package/build/plugins/EmojisPlugin/index.d.ts.map +1 -1
  127. package/build/plugins/EmojisPlugin/index.js +10 -16
  128. package/build/plugins/EquationsPlugin/index.d.ts +3 -3
  129. package/build/plugins/EquationsPlugin/index.d.ts.map +1 -1
  130. package/build/plugins/EquationsPlugin/index.js +14 -10
  131. package/build/plugins/FigmaPlugin/index.d.ts +2 -2
  132. package/build/plugins/FigmaPlugin/index.d.ts.map +1 -1
  133. package/build/plugins/FigmaPlugin/index.js +8 -14
  134. package/build/plugins/FloatingLinkEditorPlugin/index.css +11 -0
  135. package/build/plugins/FloatingLinkEditorPlugin/index.d.ts +3 -3
  136. package/build/plugins/FloatingLinkEditorPlugin/index.d.ts.map +1 -1
  137. package/build/plugins/FloatingLinkEditorPlugin/index.js +28 -27
  138. package/build/plugins/FloatingTextFormatToolbarPlugin/index.css +15 -0
  139. package/build/plugins/FloatingTextFormatToolbarPlugin/index.d.ts.map +1 -1
  140. package/build/plugins/FloatingTextFormatToolbarPlugin/index.js +2 -1
  141. package/build/plugins/ImagesPlugin/index.d.ts +3 -3
  142. package/build/plugins/ImagesPlugin/index.d.ts.map +1 -1
  143. package/build/plugins/ImagesPlugin/index.js +38 -37
  144. package/build/plugins/KeywordsPlugin/index.d.ts +1 -8
  145. package/build/plugins/KeywordsPlugin/index.d.ts.map +1 -1
  146. package/build/plugins/KeywordsPlugin/index.js +6 -12
  147. package/build/plugins/LayoutPlugin/InsertLayoutDialog.d.ts +2 -2
  148. package/build/plugins/LayoutPlugin/InsertLayoutDialog.d.ts.map +1 -1
  149. package/build/plugins/LayoutPlugin/InsertLayoutDialog.js +10 -9
  150. package/build/plugins/LayoutPlugin/LayoutPlugin.d.ts +1 -1
  151. package/build/plugins/LayoutPlugin/LayoutPlugin.d.ts.map +1 -1
  152. package/build/plugins/LayoutPlugin/LayoutPlugin.js +8 -14
  153. package/build/plugins/LinkPlugin/index.d.ts.map +1 -1
  154. package/build/plugins/LinkPlugin/index.js +1 -0
  155. package/build/plugins/MarkdownShortcutPlugin/index.d.ts.map +1 -1
  156. package/build/plugins/MarkdownShortcutPlugin/index.js +1 -0
  157. package/build/plugins/MarkdownTransformers/index.d.ts +1 -1
  158. package/build/plugins/MarkdownTransformers/index.d.ts.map +1 -1
  159. package/build/plugins/MarkdownTransformers/index.js +25 -25
  160. package/build/plugins/PasteLogPlugin/index.d.ts.map +1 -1
  161. package/build/plugins/PasteLogPlugin/index.js +1 -0
  162. package/build/plugins/ShortcutsPlugin/index.d.ts +0 -7
  163. package/build/plugins/ShortcutsPlugin/index.d.ts.map +1 -1
  164. package/build/plugins/ShortcutsPlugin/index.js +1 -0
  165. package/build/plugins/SpeechToTextPlugin/index.d.ts +2 -2
  166. package/build/plugins/SpeechToTextPlugin/index.d.ts.map +1 -1
  167. package/build/plugins/SpeechToTextPlugin/index.js +7 -11
  168. package/build/plugins/TabFocusPlugin/index.d.ts +0 -7
  169. package/build/plugins/TabFocusPlugin/index.d.ts.map +1 -1
  170. package/build/plugins/TabFocusPlugin/index.js +6 -5
  171. package/build/plugins/TableActionMenuPlugin/index.d.ts +1 -8
  172. package/build/plugins/TableActionMenuPlugin/index.d.ts.map +1 -1
  173. package/build/plugins/TableActionMenuPlugin/index.js +41 -40
  174. package/build/plugins/TableCellResizer/index.d.ts +2 -2
  175. package/build/plugins/TableCellResizer/index.d.ts.map +1 -1
  176. package/build/plugins/TableCellResizer/index.js +43 -42
  177. package/build/plugins/TableHoverActionsPlugin/index.d.ts +1 -8
  178. package/build/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -1
  179. package/build/plugins/TableHoverActionsPlugin/index.js +19 -18
  180. package/build/plugins/TableHoverActionsV2Plugin/index.d.ts.map +1 -1
  181. package/build/plugins/TableHoverActionsV2Plugin/index.js +1 -0
  182. package/build/plugins/TablePlugin.d.ts +2 -2
  183. package/build/plugins/TablePlugin.d.ts.map +1 -1
  184. package/build/plugins/TablePlugin.js +11 -10
  185. package/build/plugins/TableScrollShadowPlugin/index.d.ts +0 -7
  186. package/build/plugins/TableScrollShadowPlugin/index.d.ts.map +1 -1
  187. package/build/plugins/TableScrollShadowPlugin/index.js +9 -8
  188. package/build/plugins/TestRecorderPlugin/index.d.ts +1 -8
  189. package/build/plugins/TestRecorderPlugin/index.d.ts.map +1 -1
  190. package/build/plugins/TestRecorderPlugin/index.js +45 -44
  191. package/build/plugins/ToolbarPlugin/fontSize.d.ts +2 -2
  192. package/build/plugins/ToolbarPlugin/fontSize.d.ts.map +1 -1
  193. package/build/plugins/ToolbarPlugin/fontSize.js +19 -18
  194. package/build/plugins/ToolbarPlugin/index.d.ts.map +1 -1
  195. package/build/plugins/ToolbarPlugin/index.js +68 -60
  196. package/build/plugins/ToolbarPlugin/languages.d.ts +14 -0
  197. package/build/plugins/ToolbarPlugin/languages.d.ts.map +1 -0
  198. package/build/plugins/ToolbarPlugin/languages.js +185 -0
  199. package/build/plugins/ToolbarPlugin/utils.d.ts +2 -2
  200. package/build/plugins/ToolbarPlugin/utils.js +21 -21
  201. package/build/plugins/TwitterPlugin/index.d.ts +2 -2
  202. package/build/plugins/TwitterPlugin/index.d.ts.map +1 -1
  203. package/build/plugins/TwitterPlugin/index.js +8 -14
  204. package/build/plugins/YouTubePlugin/index.d.ts +2 -2
  205. package/build/plugins/YouTubePlugin/index.d.ts.map +1 -1
  206. package/build/plugins/YouTubePlugin/index.js +8 -14
  207. package/build/themes/PlaygroundEditorTheme.css +301 -33
  208. package/build/themes/ViewerTheme.css +899 -0
  209. package/build/{plugins/MentionsPlugin/index.d.ts → themes/ViewerTheme.d.ts} +5 -3
  210. package/build/themes/ViewerTheme.d.ts.map +1 -0
  211. package/build/themes/ViewerTheme.js +124 -0
  212. package/build/themes/ViewerThemeComplete.css +1043 -0
  213. package/build/ui/ColorPicker.d.ts +2 -2
  214. package/build/ui/ColorPicker.d.ts.map +1 -1
  215. package/build/ui/ColorPicker.js +47 -46
  216. package/build/ui/DropDown.d.ts.map +1 -1
  217. package/build/ui/DropDown.js +1 -0
  218. package/build/ui/FlashMessage.d.ts +3 -3
  219. package/build/ui/FlashMessage.d.ts.map +1 -1
  220. package/build/ui/FlashMessage.js +3 -2
  221. package/build/ui/ImageResizer.d.ts +3 -3
  222. package/build/ui/ImageResizer.d.ts.map +1 -1
  223. package/build/ui/ImageResizer.js +20 -19
  224. package/build/ui/KatexEquationAlterer.css +3 -1
  225. package/build/ui/KatexEquationAlterer.d.ts.map +1 -1
  226. package/build/ui/KatexEquationAlterer.js +1 -0
  227. package/build/ui/KatexRenderer.d.ts.map +1 -1
  228. package/build/ui/KatexRenderer.js +1 -0
  229. package/build/ui/Modal.d.ts.map +1 -1
  230. package/build/ui/Modal.js +1 -0
  231. package/build/ui/Switch.d.ts +2 -2
  232. package/build/ui/Switch.d.ts.map +1 -1
  233. package/build/ui/Switch.js +3 -2
  234. package/build/ui/TextInput.d.ts.map +1 -1
  235. package/build/ui/TextInput.js +1 -0
  236. package/build/utils/ServerBlockWithAlignableContents.d.ts +22 -0
  237. package/build/utils/ServerBlockWithAlignableContents.d.ts.map +1 -0
  238. package/build/utils/ServerBlockWithAlignableContents.js +6 -0
  239. package/build/utils/focusUtils.d.ts.map +1 -1
  240. package/build/utils/focusUtils.js +4 -3
  241. package/build/utils/getDOMRangeRect.d.ts.map +1 -1
  242. package/build/utils/getDOMRangeRect.js +1 -0
  243. package/build/utils/setFloatingElemPosition.d.ts.map +1 -1
  244. package/build/utils/setFloatingElemPosition.js +5 -4
  245. package/build/utils/swipe.d.ts +0 -7
  246. package/build/utils/swipe.d.ts.map +1 -1
  247. package/build/utils/swipe.js +5 -11
  248. package/build/viewer/Viewer.d.ts +18 -0
  249. package/build/viewer/Viewer.d.ts.map +1 -0
  250. package/build/viewer/Viewer.js +105 -0
  251. package/build/viewer/client.d.ts +18 -0
  252. package/build/viewer/client.d.ts.map +1 -0
  253. package/build/viewer/client.js +97 -0
  254. package/build/viewer/index.d.ts +4 -0
  255. package/build/viewer/index.d.ts.map +1 -0
  256. package/build/viewer/index.js +2 -0
  257. package/package.json +58 -36
  258. package/build/collaboration.d.ts +0 -12
  259. package/build/collaboration.d.ts.map +0 -1
  260. package/build/collaboration.js +0 -32
  261. package/build/nodes/FigmaNode.d.ts.map +0 -1
  262. package/build/nodes/PageBreakNode/index.css +0 -64
  263. package/build/nodes/PageBreakNode/index.d.ts +0 -25
  264. package/build/nodes/PageBreakNode/index.d.ts.map +0 -1
  265. package/build/nodes/PageBreakNode/index.js +0 -83
  266. package/build/nodes/PlaygroundNodes.d.ts.map +0 -1
  267. package/build/nodes/PollComponent.d.ts +0 -17
  268. package/build/nodes/PollComponent.d.ts.map +0 -1
  269. package/build/nodes/PollComponent.js +0 -85
  270. package/build/nodes/PollNode.css +0 -165
  271. package/build/nodes/PollNode.d.ts +0 -51
  272. package/build/nodes/PollNode.d.ts.map +0 -1
  273. package/build/nodes/PollNode.js +0 -153
  274. package/build/nodes/StickyComponent.d.ts +0 -18
  275. package/build/nodes/StickyComponent.d.ts.map +0 -1
  276. package/build/nodes/StickyComponent.js +0 -155
  277. package/build/nodes/StickyNode.css +0 -37
  278. package/build/nodes/StickyNode.d.ts +0 -39
  279. package/build/nodes/StickyNode.d.ts.map +0 -1
  280. package/build/nodes/StickyNode.js +0 -66
  281. package/build/nodes/TweetNode.d.ts.map +0 -1
  282. package/build/nodes/YouTubeNode.d.ts.map +0 -1
  283. package/build/plugins/DocsPlugin/index.d.ts +0 -10
  284. package/build/plugins/DocsPlugin/index.d.ts.map +0 -1
  285. package/build/plugins/DocsPlugin/index.js +0 -4
  286. package/build/plugins/MaxLengthPlugin/index.d.ts +0 -11
  287. package/build/plugins/MaxLengthPlugin/index.d.ts.map +0 -1
  288. package/build/plugins/MaxLengthPlugin/index.js +0 -44
  289. package/build/plugins/MentionsPlugin/index.d.ts.map +0 -1
  290. package/build/plugins/MentionsPlugin/index.js +0 -562
  291. package/build/plugins/PageBreakPlugin/index.d.ts +0 -12
  292. package/build/plugins/PageBreakPlugin/index.d.ts.map +0 -1
  293. package/build/plugins/PageBreakPlugin/index.js +0 -34
  294. package/build/plugins/StickyPlugin/index.d.ts +0 -10
  295. package/build/plugins/StickyPlugin/index.d.ts.map +0 -1
  296. package/build/plugins/StickyPlugin/index.js +0 -19
  297. package/build/plugins/TreeViewPlugin/index.d.ts +0 -10
  298. package/build/plugins/TreeViewPlugin/index.d.ts.map +0 -1
  299. package/build/plugins/TreeViewPlugin/index.js +0 -7
  300. package/build/plugins/TypingPerfPlugin/index.d.ts +0 -10
  301. package/build/plugins/TypingPerfPlugin/index.d.ts.map +0 -1
  302. package/build/plugins/TypingPerfPlugin/index.js +0 -100
  303. package/build/plugins/VersionsPlugin/index.css +0 -57
  304. package/build/plugins/VersionsPlugin/index.d.ts +0 -14
  305. package/build/plugins/VersionsPlugin/index.d.ts.map +0 -1
  306. package/build/plugins/VersionsPlugin/index.js +0 -147
  307. /package/build/nodes/{FigmaNode.d.ts → FigmaNode/FigmaNode.d.ts} +0 -0
  308. /package/build/nodes/{FigmaNode.js → FigmaNode/FigmaNode.js} +0 -0
  309. /package/build/nodes/{PlaygroundNodes.d.ts → PlaygroundNodes/PlaygroundNodes.d.ts} +0 -0
  310. /package/build/nodes/{TweetNode.d.ts → TweetNode/TweetNode.d.ts} +0 -0
  311. /package/build/nodes/{TweetNode.js → TweetNode/TweetNode.js} +0 -0
  312. /package/build/nodes/{YouTubeNode.d.ts → YouTubeNode/YouTubeNode.d.ts} +0 -0
  313. /package/build/nodes/{YouTubeNode.js → YouTubeNode/YouTubeNode.js} +0 -0
@@ -0,0 +1,59 @@
1
+ import { DecoratorBlockNode, } from "@lexical/react/LexicalDecoratorBlockNode";
2
+ function $convertTweetElement(domNode) {
3
+ const id = domNode.getAttribute("data-lexical-tweet-id");
4
+ if (id) {
5
+ const node = $createTweetNode(id);
6
+ return { node };
7
+ }
8
+ return null;
9
+ }
10
+ export class TweetNode extends DecoratorBlockNode {
11
+ static getType() {
12
+ return "tweet";
13
+ }
14
+ static clone(node) {
15
+ return new TweetNode(node.__id, node.__format, node.__key);
16
+ }
17
+ static importJSON(serializedNode) {
18
+ return $createTweetNode(serializedNode.id).updateFromJSON(serializedNode);
19
+ }
20
+ exportJSON() {
21
+ return Object.assign(Object.assign({}, super.exportJSON()), { id: this.getId() });
22
+ }
23
+ static importDOM() {
24
+ return {
25
+ div: (domNode) => {
26
+ if (!domNode.hasAttribute("data-lexical-tweet-id")) {
27
+ return null;
28
+ }
29
+ return {
30
+ conversion: $convertTweetElement,
31
+ priority: 2,
32
+ };
33
+ },
34
+ };
35
+ }
36
+ exportDOM() {
37
+ const element = document.createElement("div");
38
+ element.setAttribute("data-lexical-tweet-id", this.__id);
39
+ const text = document.createTextNode(this.getTextContent());
40
+ element.append(text);
41
+ return { element };
42
+ }
43
+ constructor(id, format, key) {
44
+ super(format, key);
45
+ this.__id = id;
46
+ }
47
+ getId() {
48
+ return this.__id;
49
+ }
50
+ getTextContent(_includeInert, _includeDirectionless) {
51
+ return `https://x.com/i/web/status/${this.__id}`;
52
+ }
53
+ }
54
+ export function $createTweetNode(tweetID) {
55
+ return new TweetNode(tweetID);
56
+ }
57
+ export function $isTweetNode(node) {
58
+ return node instanceof TweetNode;
59
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TweetNode.d.ts","sourceRoot":"","sources":["../../../src/nodes/TweetNode/TweetNode.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAEhB,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,OAAO,EACP,MAAM,EACP,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjC,OAAO,EACL,kBAAkB,EAClB,4BAA4B,EAC7B,MAAM,0CAA0C,CAAC;AAqGlD,MAAM,MAAM,mBAAmB,GAAG,MAAM,CACtC;IACE,EAAE,EAAE,MAAM,CAAC;CACZ,EACD,4BAA4B,CAC7B,CAAC;AAEF,qBAAa,SAAU,SAAQ,kBAAkB;IAC/C,IAAI,EAAE,MAAM,CAAC;IAEb,MAAM,CAAC,OAAO,IAAI,MAAM;IAIxB,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,GAAG,SAAS;IAIxC,MAAM,CAAC,UAAU,CAAC,cAAc,EAAE,mBAAmB,GAAG,SAAS;IAIjE,UAAU,IAAI,mBAAmB;IAOjC,MAAM,CAAC,SAAS,IAAI,gBAAgB,CAAC,cAAc,CAAC,GAAG,IAAI;IAc3D,SAAS,IAAI,eAAe;gBAQhB,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,iBAAiB,EAAE,GAAG,CAAC,EAAE,OAAO;IAKjE,KAAK,IAAI,MAAM;IAIf,cAAc,CACZ,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,EACnC,qBAAqB,CAAC,EAAE,KAAK,GAAG,SAAS,GACxC,MAAM;IAIT,QAAQ,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,GAAG,GAAG,CAAC,OAAO;CAgBnE;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,CAE3D;AAED,wBAAgB,YAAY,CAC1B,IAAI,EAAE,SAAS,GAAG,WAAW,GAAG,IAAI,GAAG,SAAS,GAC/C,IAAI,IAAI,SAAS,CAEnB"}
@@ -0,0 +1,21 @@
1
+ import type { DOMConversionMap, DOMExportOutput, ElementFormatType, LexicalNode, NodeKey, Spread } from "lexical";
2
+ import { DecoratorBlockNode, SerializedDecoratorBlockNode } from "@lexical/react/LexicalDecoratorBlockNode";
3
+ export type SerializedYouTubeNode = Spread<{
4
+ videoID: string;
5
+ }, SerializedDecoratorBlockNode>;
6
+ export declare class YouTubeNode extends DecoratorBlockNode {
7
+ __id: string;
8
+ static getType(): string;
9
+ static clone(node: YouTubeNode): YouTubeNode;
10
+ static importJSON(serializedNode: SerializedYouTubeNode): YouTubeNode;
11
+ exportJSON(): SerializedYouTubeNode;
12
+ constructor(id: string, format?: ElementFormatType, key?: NodeKey);
13
+ exportDOM(): DOMExportOutput;
14
+ static importDOM(): DOMConversionMap | null;
15
+ updateDOM(): false;
16
+ getId(): string;
17
+ getTextContent(_includeInert?: boolean | undefined, _includeDirectionless?: false | undefined): string;
18
+ }
19
+ export declare function $createYouTubeNode(videoID: string): YouTubeNode;
20
+ export declare function $isYouTubeNode(node: YouTubeNode | LexicalNode | null | undefined): node is YouTubeNode;
21
+ //# sourceMappingURL=ServerYouTubeNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServerYouTubeNode.d.ts","sourceRoot":"","sources":["../../../src/nodes/YouTubeNode/ServerYouTubeNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAEhB,eAAe,EACf,iBAAiB,EACjB,WAAW,EACX,OAAO,EACP,MAAM,EACP,MAAM,SAAS,CAAC;AAEjB,OAAO,EACL,kBAAkB,EAClB,4BAA4B,EAC7B,MAAM,0CAA0C,CAAC;AAElD,MAAM,MAAM,qBAAqB,GAAG,MAAM,CACxC;IACE,OAAO,EAAE,MAAM,CAAC;CACjB,EACD,4BAA4B,CAC7B,CAAC;AAaF,qBAAa,WAAY,SAAQ,kBAAkB;IACjD,IAAI,EAAE,MAAM,CAAC;IAEb,MAAM,CAAC,OAAO,IAAI,MAAM;IAIxB,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,WAAW,GAAG,WAAW;IAI5C,MAAM,CAAC,UAAU,CAAC,cAAc,EAAE,qBAAqB,GAAG,WAAW;IAMrE,UAAU,IAAI,qBAAqB;gBAOvB,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,iBAAiB,EAAE,GAAG,CAAC,EAAE,OAAO;IAKjE,SAAS,IAAI,eAAe;IAmB5B,MAAM,CAAC,SAAS,IAAI,gBAAgB,GAAG,IAAI;IAc3C,SAAS,IAAI,KAAK;IAIlB,KAAK,IAAI,MAAM;IAIf,cAAc,CACZ,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,EACnC,qBAAqB,CAAC,EAAE,KAAK,GAAG,SAAS,GACxC,MAAM;CAGV;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,CAE/D;AAED,wBAAgB,cAAc,CAC5B,IAAI,EAAE,WAAW,GAAG,WAAW,GAAG,IAAI,GAAG,SAAS,GACjD,IAAI,IAAI,WAAW,CAErB"}
@@ -0,0 +1,67 @@
1
+ import { DecoratorBlockNode, } from "@lexical/react/LexicalDecoratorBlockNode";
2
+ function $convertYoutubeElement(domNode) {
3
+ const videoID = domNode.getAttribute("data-lexical-youtube");
4
+ if (videoID) {
5
+ const node = $createYouTubeNode(videoID);
6
+ return { node };
7
+ }
8
+ return null;
9
+ }
10
+ export class YouTubeNode extends DecoratorBlockNode {
11
+ static getType() {
12
+ return "youtube";
13
+ }
14
+ static clone(node) {
15
+ return new YouTubeNode(node.__id, node.__format, node.__key);
16
+ }
17
+ static importJSON(serializedNode) {
18
+ return $createYouTubeNode(serializedNode.videoID).updateFromJSON(serializedNode);
19
+ }
20
+ exportJSON() {
21
+ return Object.assign(Object.assign({}, super.exportJSON()), { videoID: this.__id });
22
+ }
23
+ constructor(id, format, key) {
24
+ super(format, key);
25
+ this.__id = id;
26
+ }
27
+ exportDOM() {
28
+ const element = document.createElement("iframe");
29
+ element.setAttribute("data-lexical-youtube", this.__id);
30
+ element.setAttribute("width", "560");
31
+ element.setAttribute("height", "315");
32
+ element.setAttribute("src", `https://www.youtube-nocookie.com/embed/${this.__id}`);
33
+ element.setAttribute("frameborder", "0");
34
+ element.setAttribute("allow", "accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture");
35
+ element.setAttribute("allowfullscreen", "true");
36
+ element.setAttribute("title", "YouTube video");
37
+ return { element };
38
+ }
39
+ static importDOM() {
40
+ return {
41
+ iframe: (domNode) => {
42
+ if (!domNode.hasAttribute("data-lexical-youtube")) {
43
+ return null;
44
+ }
45
+ return {
46
+ conversion: $convertYoutubeElement,
47
+ priority: 1,
48
+ };
49
+ },
50
+ };
51
+ }
52
+ updateDOM() {
53
+ return false;
54
+ }
55
+ getId() {
56
+ return this.__id;
57
+ }
58
+ getTextContent(_includeInert, _includeDirectionless) {
59
+ return `https://www.youtube.com/watch?v=${this.__id}`;
60
+ }
61
+ }
62
+ export function $createYouTubeNode(videoID) {
63
+ return new YouTubeNode(videoID);
64
+ }
65
+ export function $isYouTubeNode(node) {
66
+ return node instanceof YouTubeNode;
67
+ }
@@ -0,0 +1 @@
1
+ {"version":3,"file":"YouTubeNode.d.ts","sourceRoot":"","sources":["../../../src/nodes/YouTubeNode/YouTubeNode.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EACV,gBAAgB,EAEhB,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,OAAO,EACP,MAAM,EACP,MAAM,SAAS,CAAC;AACjB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjC,OAAO,EACL,kBAAkB,EAClB,4BAA4B,EAC7B,MAAM,0CAA0C,CAAC;AAqClD,MAAM,MAAM,qBAAqB,GAAG,MAAM,CACxC;IACE,OAAO,EAAE,MAAM,CAAC;CACjB,EACD,4BAA4B,CAC7B,CAAC;AAaF,qBAAa,WAAY,SAAQ,kBAAkB;IACjD,IAAI,EAAE,MAAM,CAAC;IAEb,MAAM,CAAC,OAAO,IAAI,MAAM;IAIxB,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,WAAW,GAAG,WAAW;IAI5C,MAAM,CAAC,UAAU,CAAC,cAAc,EAAE,qBAAqB,GAAG,WAAW;IAMrE,UAAU,IAAI,qBAAqB;gBAOvB,EAAE,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,iBAAiB,EAAE,GAAG,CAAC,EAAE,OAAO;IAKjE,SAAS,IAAI,eAAe;IAmB5B,MAAM,CAAC,SAAS,IAAI,gBAAgB,GAAG,IAAI;IAc3C,SAAS,IAAI,KAAK;IAIlB,KAAK,IAAI,MAAM;IAIf,cAAc,CACZ,aAAa,CAAC,EAAE,OAAO,GAAG,SAAS,EACnC,qBAAqB,CAAC,EAAE,KAAK,GAAG,SAAS,GACxC,MAAM;IAIT,QAAQ,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,GAAG,GAAG,CAAC,OAAO;CAepE;AAED,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW,CAE/D;AAED,wBAAgB,cAAc,CAC5B,IAAI,EAAE,WAAW,GAAG,WAAW,GAAG,IAAI,GAAG,SAAS,GACjD,IAAI,IAAI,WAAW,CAErB"}
@@ -1,10 +1,3 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
1
  import type { JSX } from "react";
9
2
  export default function ActionsPlugin({ shouldPreserveNewLinesInMarkdown, useCollabV2, }: {
10
3
  shouldPreserveNewLinesInMarkdown: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/ActionsPlugin/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAiEjC,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,gCAAgC,EAChC,WAAW,GACZ,EAAE;IACD,gCAAgC,EAAE,OAAO,CAAC;IAC1C,WAAW,EAAE,OAAO,CAAC;CACtB,GAAG,GAAG,CAAC,OAAO,CAkKd"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/ActionsPlugin/index.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AA4DjC,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,gCAAgC,EAChC,WAAW,GACZ,EAAE;IACD,gCAAgC,EAAE,OAAO,CAAC;IAC1C,WAAW,EAAE,OAAO,CAAC;CACtB,GAAG,GAAG,CAAC,OAAO,CAkKd"}
@@ -1,5 +1,6 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { $createCodeNode, $isCodeNode } from "@lexical/code";
3
+ import { $createCodeNode, $isCodeNode } from "../../nodes/CodeNode/CodeNode";
3
4
  import { editorStateFromSerializedDocument, exportFile, importFile, } from "@lexical/file";
4
5
  import { $convertFromMarkdownString, $convertToMarkdownString, } from "@lexical/markdown";
5
6
  import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
@@ -1,12 +1,5 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
- import type { JSX } from 'react';
9
- import { EmbedConfig } from '@lexical/react/LexicalAutoEmbedPlugin';
1
+ import type { JSX } from "react";
2
+ import { EmbedConfig } from "@lexical/react/LexicalAutoEmbedPlugin";
10
3
  interface PlaygroundEmbedConfig extends EmbedConfig {
11
4
  contentName: string;
12
5
  icon?: JSX.Element;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/AutoEmbedPlugin/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAE/B,OAAO,EAEL,WAAW,EAIZ,MAAM,uCAAuC,CAAC;AAa/C,UAAU,qBAAsB,SAAQ,WAAW;IAEjD,WAAW,EAAE,MAAM,CAAC;IAGpB,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAGnB,UAAU,EAAE,MAAM,CAAC;IAGnB,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAGxB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,kBAAkB,EAAE,qBAgChC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,qBAmChC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,qBA+B9B,CAAC;AAEF,eAAO,MAAM,YAAY,yBAIxB,CAAC;AA0EF,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,OAAO,GACR,EAAE;IACD,WAAW,EAAE,qBAAqB,CAAC;IACnC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,GAAG,GAAG,CAAC,OAAO,CAuDd;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,IAAI,GAAG,CAAC,OAAO,CAiErD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/AutoEmbedPlugin/index.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAEL,WAAW,EAIZ,MAAM,uCAAuC,CAAC;AAY/C,UAAU,qBAAsB,SAAQ,WAAW;IAEjD,WAAW,EAAE,MAAM,CAAC;IAGpB,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,CAAC;IAGnB,UAAU,EAAE,MAAM,CAAC;IAGnB,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAGxB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,kBAAkB,EAAE,qBAgChC,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,qBAmChC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,qBA+B9B,CAAC;AAEF,eAAO,MAAM,YAAY,yBAIxB,CAAC;AA2EF,wBAAgB,eAAe,CAAC,EAC9B,WAAW,EACX,OAAO,GACR,EAAE;IACD,WAAW,EAAE,qBAAqB,CAAC;IACnC,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,GAAG,GAAG,CAAC,OAAO,CAwDd;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,IAAI,GAAG,CAAC,OAAO,CAuErD"}
@@ -1,23 +1,24 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { AutoEmbedOption, LexicalAutoEmbedPlugin, URL_MATCHER, } from '@lexical/react/LexicalAutoEmbedPlugin';
3
- import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
4
- import { useMemo, useState } from 'react';
5
- import * as ReactDOM from 'react-dom';
6
- import useModal from '../../hooks/useModal';
7
- import Button from '../../ui/Button';
8
- import { DialogActions } from '../../ui/Dialog';
9
- import { INSERT_FIGMA_COMMAND } from '../FigmaPlugin';
10
- import { INSERT_TWEET_COMMAND } from '../TwitterPlugin';
11
- import { INSERT_YOUTUBE_COMMAND } from '../YouTubePlugin';
3
+ import { AutoEmbedOption, LexicalAutoEmbedPlugin, URL_MATCHER, } from "@lexical/react/LexicalAutoEmbedPlugin";
4
+ import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
5
+ import { useMemo, useState } from "react";
6
+ import * as ReactDOM from "react-dom";
7
+ import useModal from "../../hooks/useModal";
8
+ import Button from "../../ui/Button";
9
+ import { DialogActions } from "../../ui/Dialog";
10
+ import { INSERT_FIGMA_COMMAND } from "../FigmaPlugin";
11
+ import { INSERT_TWEET_COMMAND } from "../TwitterPlugin";
12
+ import { INSERT_YOUTUBE_COMMAND } from "../YouTubePlugin";
12
13
  export const YoutubeEmbedConfig = {
13
- contentName: 'Youtube Video',
14
- exampleUrl: 'https://www.youtube.com/watch?v=jNQXAC9IVRw',
14
+ contentName: "Youtube Video",
15
+ exampleUrl: "https://www.youtube.com/watch?v=jNQXAC9IVRw",
15
16
  // Icon for display.
16
17
  icon: _jsx("i", { className: "icon youtube" }),
17
18
  insertNode: (editor, result) => {
18
19
  editor.dispatchCommand(INSERT_YOUTUBE_COMMAND, result.id);
19
20
  },
20
- keywords: ['youtube', 'video'],
21
+ keywords: ["youtube", "video"],
21
22
  // Determine if a given URL is a match and return url data.
22
23
  parseUrl: async (url) => {
23
24
  const match = /^.*(youtu\.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/.exec(url);
@@ -30,12 +31,12 @@ export const YoutubeEmbedConfig = {
30
31
  }
31
32
  return null;
32
33
  },
33
- type: 'youtube-video',
34
+ type: "youtube-video",
34
35
  };
35
36
  export const TwitterEmbedConfig = {
36
37
  // e.g. Tweet or Google Map.
37
- contentName: 'X(Tweet)',
38
- exampleUrl: 'https://x.com/jack/status/20',
38
+ contentName: "X(Tweet)",
39
+ exampleUrl: "https://x.com/jack/status/20",
39
40
  // Icon for display.
40
41
  icon: _jsx("i", { className: "icon x" }),
41
42
  // Create the Lexical embed node from the url data.
@@ -43,7 +44,7 @@ export const TwitterEmbedConfig = {
43
44
  editor.dispatchCommand(INSERT_TWEET_COMMAND, result.id);
44
45
  },
45
46
  // For extra searching.
46
- keywords: ['tweet', 'twitter', 'x'],
47
+ keywords: ["tweet", "twitter", "x"],
47
48
  // Determine if a given URL is a match and return url data.
48
49
  parseUrl: (text) => {
49
50
  const match = /^https:\/\/(twitter|x)\.com\/(#!\/)?(\w+)\/status(es)*\/(\d+)/.exec(text);
@@ -55,16 +56,16 @@ export const TwitterEmbedConfig = {
55
56
  }
56
57
  return null;
57
58
  },
58
- type: 'tweet',
59
+ type: "tweet",
59
60
  };
60
61
  export const FigmaEmbedConfig = {
61
- contentName: 'Figma Document',
62
- exampleUrl: 'https://www.figma.com/file/LKQ4FJ4bTnCSjedbRpk931/Sample-File',
62
+ contentName: "Figma Document",
63
+ exampleUrl: "https://www.figma.com/file/LKQ4FJ4bTnCSjedbRpk931/Sample-File",
63
64
  icon: _jsx("i", { className: "icon figma" }),
64
65
  insertNode: (editor, result) => {
65
66
  editor.dispatchCommand(INSERT_FIGMA_COMMAND, result.id);
66
67
  },
67
- keywords: ['figma', 'figma.com', 'mock-up'],
68
+ keywords: ["figma", "figma.com", "mock-up"],
68
69
  // Determine if a given URL is a match and return url data.
69
70
  parseUrl: (text) => {
70
71
  const match = /https:\/\/([\w.-]+\.)?figma.com\/(file|proto)\/([0-9a-zA-Z]{22,128})(?:\/.*)?$/.exec(text);
@@ -76,7 +77,7 @@ export const FigmaEmbedConfig = {
76
77
  }
77
78
  return null;
78
79
  },
79
- type: 'figma',
80
+ type: "figma",
80
81
  };
81
82
  export const EmbedConfigs = [
82
83
  TwitterEmbedConfig,
@@ -84,11 +85,11 @@ export const EmbedConfigs = [
84
85
  FigmaEmbedConfig,
85
86
  ];
86
87
  function AutoEmbedMenuItem({ index, isSelected, onClick, onMouseEnter, option, }) {
87
- let className = 'item';
88
+ let className = "item";
88
89
  if (isSelected) {
89
- className += ' selected';
90
+ className += " selected";
90
91
  }
91
- return (_jsx("li", { tabIndex: -1, className: className, ref: option.setRefElement, role: "option", "aria-selected": isSelected, id: 'typeahead-item-' + index, onMouseEnter: onMouseEnter, onClick: onClick, children: _jsx("span", { className: "text", children: option.title }) }, option.key));
92
+ return (_jsx("li", { tabIndex: -1, className: className, ref: option.setRefElement, role: "option", "aria-selected": isSelected, id: "typeahead-item-" + index, onMouseEnter: onMouseEnter, onClick: onClick, children: _jsx("span", { className: "text", children: option.title }) }, option.key));
92
93
  }
93
94
  function AutoEmbedMenu({ options, selectedItemIndex, onOptionClick, onOptionMouseEnter, }) {
94
95
  return (_jsx("div", { className: "typeahead-popover", children: _jsx("ul", { children: options.map((option, i) => (_jsx(AutoEmbedMenuItem, { index: i, isSelected: selectedItemIndex === i, onClick: () => onOptionClick(option, i), onMouseEnter: () => onOptionMouseEnter(i), option: option }, option.key))) }) }));
@@ -103,7 +104,7 @@ const debounce = (callback, delay) => {
103
104
  };
104
105
  };
105
106
  export function AutoEmbedDialog({ embedConfig, onClose, }) {
106
- const [text, setText] = useState('');
107
+ const [text, setText] = useState("");
107
108
  const [editor] = useLexicalComposerContext();
108
109
  const [embedResult, setEmbedResult] = useState(null);
109
110
  const validateText = useMemo(() => debounce((inputText) => {
@@ -123,7 +124,7 @@ export function AutoEmbedDialog({ embedConfig, onClose, }) {
123
124
  onClose();
124
125
  }
125
126
  };
126
- return (_jsxs("div", { style: { width: '600px' }, children: [_jsx("div", { className: "Input__wrapper", children: _jsx("input", { type: "text", className: "Input__input", placeholder: embedConfig.exampleUrl, value: text, "data-test-id": `${embedConfig.type}-embed-modal-url`, onChange: (e) => {
127
+ return (_jsxs("div", { style: { width: "600px" }, children: [_jsx("div", { className: "Input__wrapper", children: _jsx("input", { type: "text", className: "Input__input", placeholder: embedConfig.exampleUrl, value: text, "data-test-id": `${embedConfig.type}-embed-modal-url`, onChange: (e) => {
127
128
  const { value } = e.target;
128
129
  setText(value);
129
130
  validateText(value);
@@ -136,7 +137,7 @@ export default function AutoEmbedPlugin() {
136
137
  };
137
138
  const getMenuOptions = (activeEmbedConfig, embedFn, dismissFn) => {
138
139
  return [
139
- new AutoEmbedOption('Dismiss', {
140
+ new AutoEmbedOption("Dismiss", {
140
141
  onSelect: dismissFn,
141
142
  }),
142
143
  new AutoEmbedOption(`Embed ${activeEmbedConfig.contentName}`, {
@@ -144,7 +145,7 @@ export default function AutoEmbedPlugin() {
144
145
  }),
145
146
  ];
146
147
  };
147
- return (_jsxs(_Fragment, { children: [modal, _jsx(LexicalAutoEmbedPlugin, { embedConfigs: EmbedConfigs, onOpenEmbedModalForConfig: openEmbedModal, getMenuOptions: getMenuOptions, menuRenderFn: (anchorElementRef, { selectedIndex, options, selectOptionAndCleanUp, setHighlightedIndex }) => anchorElementRef.current
148
+ return (_jsxs(_Fragment, { children: [modal, _jsx(LexicalAutoEmbedPlugin, { embedConfigs: EmbedConfigs, onOpenEmbedModalForConfig: openEmbedModal, getMenuOptions: getMenuOptions, menuRenderFn: (anchorElementRef, { selectedIndex, options, selectOptionAndCleanUp, setHighlightedIndex, }) => anchorElementRef.current
148
149
  ? ReactDOM.createPortal(_jsx("div", { className: "typeahead-popover auto-embed-menu", style: {
149
150
  marginLeft: `${Math.max(parseFloat(anchorElementRef.current.style.width) - 200, 0)}px`,
150
151
  width: 200,
@@ -5,6 +5,6 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
- import type { JSX } from 'react';
8
+ import type { JSX } from "react";
9
9
  export default function LexicalAutoLinkPlugin(): JSX.Element;
10
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/AutoLinkPlugin/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAuB/B,MAAM,CAAC,OAAO,UAAU,qBAAqB,IAAI,GAAG,CAAC,OAAO,CAE3D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/AutoLinkPlugin/index.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAsBjC,MAAM,CAAC,OAAO,UAAU,qBAAqB,IAAI,GAAG,CAAC,OAAO,CAE3D"}
@@ -1,10 +1,11 @@
1
+ "use client";
1
2
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { AutoLinkPlugin, createLinkMatcherWithRegExp, } from '@lexical/react/LexicalAutoLinkPlugin';
3
+ import { AutoLinkPlugin, createLinkMatcherWithRegExp, } from "@lexical/react/LexicalAutoLinkPlugin";
3
4
  const URL_REGEX = /((https?:\/\/(www\.)?)|(www\.))[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-zA-Z0-9()]{1,6}\b([-a-zA-Z0-9()@:%_+.~#?&//=]*)(?<![-.+():%])/;
4
5
  const EMAIL_REGEX = /(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))/;
5
6
  const MATCHERS = [
6
7
  createLinkMatcherWithRegExp(URL_REGEX, (text) => {
7
- return text.startsWith('http') ? text : `https://${text}`;
8
+ return text.startsWith("http") ? text : `https://${text}`;
8
9
  }),
9
10
  createLinkMatcherWithRegExp(EMAIL_REGEX, (text) => {
10
11
  return `mailto:${text}`;
@@ -1,4 +1,4 @@
1
- import { LexicalEditor } from 'lexical';
1
+ import { LexicalEditor } from "lexical";
2
2
  interface Props {
3
3
  editor: LexicalEditor;
4
4
  getCodeDOMNode: () => HTMLElement | null;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/CodeActionMenuPlugin/components/CopyButton/index.tsx"],"names":[],"mappings":"AAQA,OAAO,EAIL,aAAa,EACd,MAAM,SAAS,CAAC;AAMjB,UAAU,KAAK;IACb,MAAM,EAAE,aAAa,CAAC;IACtB,cAAc,EAAE,MAAM,WAAW,GAAG,IAAI,CAAC;CAC1C;AAED,wBAAgB,UAAU,CAAC,EAAC,MAAM,EAAE,cAAc,EAAC,EAAE,KAAK,2CA6CzD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/CodeActionMenuPlugin/components/CopyButton/index.tsx"],"names":[],"mappings":"AAUA,OAAO,EAIL,aAAa,EACd,MAAM,SAAS,CAAC;AAKjB,UAAU,KAAK;IACb,MAAM,EAAE,aAAa,CAAC;IACtB,cAAc,EAAE,MAAM,WAAW,GAAG,IAAI,CAAC;CAC1C;AAED,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,cAAc,EAAE,EAAE,KAAK,2CA6C3D"}
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx } from "react/jsx-runtime";
2
3
  /**
3
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -6,10 +7,10 @@ import { jsx as _jsx } from "react/jsx-runtime";
6
7
  * LICENSE file in the root directory of this source tree.
7
8
  *
8
9
  */
9
- import { $isCodeNode } from '@lexical/code';
10
- import { $getNearestNodeFromDOMNode, $getSelection, $setSelection, } from 'lexical';
11
- import { useState } from 'react';
12
- import { useDebounce } from '../../utils';
10
+ import { $isCodeNode } from "../../../../nodes/CodeNode/CodeNode";
11
+ import { $getNearestNodeFromDOMNode, $getSelection, $setSelection, } from "lexical";
12
+ import { useState } from "react";
13
+ import { useDebounce } from "../../utils";
13
14
  export function CopyButton({ editor, getCodeDOMNode }) {
14
15
  const [isCopyCompleted, setCopyCompleted] = useState(false);
15
16
  const removeSuccessIcon = useDebounce(() => {
@@ -20,7 +21,7 @@ export function CopyButton({ editor, getCodeDOMNode }) {
20
21
  if (!codeDOMNode) {
21
22
  return;
22
23
  }
23
- let content = '';
24
+ let content = "";
24
25
  editor.update(() => {
25
26
  const codeNode = $getNearestNodeFromDOMNode(codeDOMNode);
26
27
  if ($isCodeNode(codeNode)) {
@@ -35,7 +36,7 @@ export function CopyButton({ editor, getCodeDOMNode }) {
35
36
  removeSuccessIcon();
36
37
  }
37
38
  catch (err) {
38
- console.error('Failed to copy: ', err);
39
+ console.error("Failed to copy: ", err);
39
40
  }
40
41
  }
41
42
  return (_jsx("button", { className: "menu-item", onClick: handleClick, "aria-label": "copy", children: isCopyCompleted ? (_jsx("i", { className: "format success" })) : (_jsx("i", { className: "format copy" })) }));
@@ -5,8 +5,8 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
- import './index.css';
9
- import { LexicalEditor } from 'lexical';
8
+ import "./index.css";
9
+ import { LexicalEditor } from "lexical";
10
10
  interface Props {
11
11
  lang: string;
12
12
  editor: LexicalEditor;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/CodeActionMenuPlugin/components/PrettierButton/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,aAAa,CAAC;AAGrB,OAAO,EAA6B,aAAa,EAAC,MAAM,SAAS,CAAC;AAIlE,UAAU,KAAK;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,aAAa,CAAC;IACtB,cAAc,EAAE,MAAM,WAAW,GAAG,IAAI,CAAC;CAC1C;AAyCD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEnD;AAaD,wBAAgB,cAAc,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,cAAc,EAAC,EAAE,KAAK,2CAoFnE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/CodeActionMenuPlugin/components/PrettierButton/index.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,OAAO,aAAa,CAAC;AAGrB,OAAO,EAA8B,aAAa,EAAE,MAAM,SAAS,CAAC;AAIpE,UAAU,KAAK;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,aAAa,CAAC;IACtB,cAAc,EAAE,MAAM,WAAW,GAAG,IAAI,CAAC;CAC1C;AAyCD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAEnD;AAaD,wBAAgB,cAAc,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,EAAE,KAAK,2CAqFrE"}
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  /**
3
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -6,21 +7,21 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
6
7
  * LICENSE file in the root directory of this source tree.
7
8
  *
8
9
  */
9
- import './index.css';
10
- import { $isCodeNode } from '@lexical/code';
11
- import { $getNearestNodeFromDOMNode } from 'lexical';
12
- import { useState } from 'react';
10
+ import "./index.css";
11
+ import { $isCodeNode } from "../../../../nodes/CodeNode/CodeNode";
12
+ import { $getNearestNodeFromDOMNode } from "lexical";
13
+ import { useState } from "react";
13
14
  const PRETTIER_PARSER_MODULES = {
14
- css: [() => import('prettier/parser-postcss')],
15
- html: [() => import('prettier/parser-html')],
15
+ css: [() => import("prettier/parser-postcss")],
16
+ html: [() => import("prettier/parser-html")],
16
17
  js: [
17
- () => import('prettier/parser-babel'),
18
- () => import('prettier/plugins/estree'),
18
+ () => import("prettier/parser-babel"),
19
+ () => import("prettier/plugins/estree"),
19
20
  ],
20
- markdown: [() => import('prettier/parser-markdown')],
21
+ markdown: [() => import("prettier/parser-markdown")],
21
22
  typescript: [
22
- () => import('prettier/parser-typescript'),
23
- () => import('prettier/plugins/estree'),
23
+ () => import("prettier/parser-typescript"),
24
+ () => import("prettier/plugins/estree"),
24
25
  ],
25
26
  };
26
27
  async function loadPrettierParserByLang(lang) {
@@ -29,15 +30,15 @@ async function loadPrettierParserByLang(lang) {
29
30
  return modules;
30
31
  }
31
32
  async function loadPrettierFormat() {
32
- const { format } = await import('prettier/standalone');
33
+ const { format } = await import("prettier/standalone");
33
34
  return format;
34
35
  }
35
36
  const PRETTIER_OPTIONS_BY_LANG = {
36
- css: { parser: 'css' },
37
- html: { parser: 'html' },
38
- js: { parser: 'babel' },
39
- markdown: { parser: 'markdown' },
40
- typescript: { parser: 'typescript' },
37
+ css: { parser: "css" },
38
+ html: { parser: "html" },
39
+ js: { parser: "babel" },
40
+ markdown: { parser: "markdown" },
41
+ typescript: { parser: "typescript" },
41
42
  };
42
43
  const LANG_CAN_BE_PRETTIER = Object.keys(PRETTIER_OPTIONS_BY_LANG);
43
44
  export function canBePrettier(lang) {
@@ -51,21 +52,21 @@ function getPrettierOptions(lang) {
51
52
  return options;
52
53
  }
53
54
  export function PrettierButton({ lang, editor, getCodeDOMNode }) {
54
- const [syntaxError, setSyntaxError] = useState('');
55
+ const [syntaxError, setSyntaxError] = useState("");
55
56
  const [tipsVisible, setTipsVisible] = useState(false);
56
57
  async function handleClick() {
57
58
  const codeDOMNode = getCodeDOMNode();
58
59
  if (!codeDOMNode) {
59
60
  return;
60
61
  }
61
- let content = '';
62
+ let content = "";
62
63
  editor.update(() => {
63
64
  const codeNode = $getNearestNodeFromDOMNode(codeDOMNode);
64
65
  if ($isCodeNode(codeNode)) {
65
66
  content = codeNode.getTextContent();
66
67
  }
67
68
  });
68
- if (content === '') {
69
+ if (content === "") {
69
70
  return;
70
71
  }
71
72
  try {
@@ -79,7 +80,7 @@ export function PrettierButton({ lang, editor, getCodeDOMNode }) {
79
80
  if ($isCodeNode(codeNode)) {
80
81
  const selection = codeNode.select(0);
81
82
  selection.insertText(formattedCode);
82
- setSyntaxError('');
83
+ setSyntaxError("");
83
84
  setTipsVisible(false);
84
85
  }
85
86
  });
@@ -94,16 +95,16 @@ export function PrettierButton({ lang, editor, getCodeDOMNode }) {
94
95
  setTipsVisible(true);
95
96
  }
96
97
  else {
97
- console.error('Unexpected error: ', error);
98
+ console.error("Unexpected error: ", error);
98
99
  }
99
100
  }
100
101
  function handleMouseEnter() {
101
- if (syntaxError !== '') {
102
+ if (syntaxError !== "") {
102
103
  setTipsVisible(true);
103
104
  }
104
105
  }
105
106
  function handleMouseLeave() {
106
- if (syntaxError !== '') {
107
+ if (syntaxError !== "") {
107
108
  setTipsVisible(false);
108
109
  }
109
110
  }
@@ -1,12 +1,5 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
- import './index.css';
9
- import * as React from 'react';
1
+ import "./index.css";
2
+ import * as React from "react";
10
3
  export default function CodeActionMenuPlugin({ anchorElem, }: {
11
4
  anchorElem?: HTMLElement;
12
5
  }): React.ReactPortal | null;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/CodeActionMenuPlugin/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,aAAa,CAAC;AAWrB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAiK/B,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,EAC3C,UAA0B,GAC3B,EAAE;IACD,UAAU,CAAC,EAAE,WAAW,CAAC;CAC1B,GAAG,KAAK,CAAC,WAAW,GAAG,IAAI,CAK3B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/CodeActionMenuPlugin/index.tsx"],"names":[],"mappings":"AAYA,OAAO,aAAa,CAAC;AAOrB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAiK/B,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,EAC3C,UAA0B,GAC3B,EAAE;IACD,UAAU,CAAC,EAAE,WAAW,CAAC;CAC1B,GAAG,KAAK,CAAC,WAAW,GAAG,IAAI,CAK3B"}