@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
@@ -1,9 +1,2 @@
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
  export default function EmojiPickerPlugin(): import("react/jsx-runtime").JSX.Element;
9
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/EmojiPickerPlugin/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAoFH,MAAM,CAAC,OAAO,UAAU,iBAAiB,4CA4GxC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/EmojiPickerPlugin/index.tsx"],"names":[],"mappings":"AA4FA,MAAM,CAAC,OAAO,UAAU,iBAAiB,4CA4GxC"}
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
2
3
  /**
3
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -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
- import type { JSX } from 'react';
1
+ import type { JSX } from "react";
9
2
  export default function EmojisPlugin(): JSX.Element | null;
10
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/EmojisPlugin/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AA8D/B,MAAM,CAAC,OAAO,UAAU,YAAY,IAAI,GAAG,CAAC,OAAO,GAAG,IAAI,CAIzD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/EmojisPlugin/index.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AA8DjC,MAAM,CAAC,OAAO,UAAU,YAAY,IAAI,GAAG,CAAC,OAAO,GAAG,IAAI,CAIzD"}
@@ -1,19 +1,13 @@
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 { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
9
- import { TextNode } from 'lexical';
10
- import { useEffect } from 'react';
11
- import { $createEmojiNode, EmojiNode } from '../../nodes/EmojiNode';
1
+ "use client";
2
+ import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
3
+ import { TextNode } from "lexical";
4
+ import { useEffect } from "react";
5
+ import { $createEmojiNode, EmojiNode } from "../../nodes/EmojiNode";
12
6
  const emojis = new Map([
13
- [':)', ['emoji happysmile', '🙂']],
14
- [':D', ['emoji veryhappysmile', '😀']],
15
- [':(', ['emoji unhappysmile', '🙁']],
16
- ['<3', ['emoji heart', '']],
7
+ [":)", ["emoji happysmile", "🙂"]],
8
+ [":D", ["emoji veryhappysmile", "😀"]],
9
+ [":(", ["emoji unhappysmile", "🙁"]],
10
+ ["<3", ["emoji heart", ""]],
17
11
  ]);
18
12
  function $findAndTransformEmoji(node) {
19
13
  const text = node.getTextContent();
@@ -47,7 +41,7 @@ function $textNodeTransform(node) {
47
41
  function useEmojis(editor) {
48
42
  useEffect(() => {
49
43
  if (!editor.hasNodes([EmojiNode])) {
50
- throw new Error('EmojisPlugin: EmojiNode not registered on editor');
44
+ throw new Error("EmojisPlugin: EmojiNode not registered on editor");
51
45
  }
52
46
  return editor.registerNodeTransform(TextNode, $textNodeTransform);
53
47
  }, [editor]);
@@ -5,9 +5,9 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
- import type { JSX } from 'react';
9
- import 'katex/dist/katex.css';
10
- import { LexicalCommand, LexicalEditor } from 'lexical';
8
+ import type { JSX } from "react";
9
+ import "katex/dist/katex.css";
10
+ import { LexicalCommand, LexicalEditor } from "lexical";
11
11
  type CommandPayload = {
12
12
  equation: string;
13
13
  inline: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/EquationsPlugin/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAE/B,OAAO,sBAAsB,CAAC;AAI9B,OAAO,EAML,cAAc,EACd,aAAa,EACd,MAAM,SAAS,CAAC;AAOjB,KAAK,cAAc,GAAG;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,cAAc,CAAC,cAAc,CACzB,CAAC;AAE3C,wBAAgB,oBAAoB,CAAC,EACnC,YAAY,EACZ,OAAO,GACR,EAAE;IACD,YAAY,EAAE,aAAa,CAAC;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,GAAG,GAAG,CAAC,OAAO,CAUd;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,IAAI,GAAG,CAAC,OAAO,GAAG,IAAI,CA4B5D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/EquationsPlugin/index.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,sBAAsB,CAAC;AAI9B,OAAO,EAML,cAAc,EACd,aAAa,EACd,MAAM,SAAS,CAAC;AAMjB,KAAK,cAAc,GAAG;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,cAAc,CAAC,cAAc,CACzB,CAAC;AAE3C,wBAAgB,oBAAoB,CAAC,EACnC,YAAY,EACZ,OAAO,GACR,EAAE;IACD,YAAY,EAAE,aAAa,CAAC;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,GAAG,GAAG,CAAC,OAAO,CAad;AAED,MAAM,CAAC,OAAO,UAAU,eAAe,IAAI,GAAG,CAAC,OAAO,GAAG,IAAI,CA4B5D"}
@@ -1,15 +1,19 @@
1
+ "use client";
1
2
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import 'katex/dist/katex.css';
3
- import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
4
- import { $wrapNodeInElement } from '@lexical/utils';
5
- import { $createParagraphNode, $insertNodes, $isRootOrShadowRoot, COMMAND_PRIORITY_EDITOR, createCommand, } from 'lexical';
6
- import { useCallback, useEffect } from 'react';
7
- import { $createEquationNode, EquationNode } from '../../nodes/EquationNode';
8
- import KatexEquationAlterer from '../../ui/KatexEquationAlterer';
9
- export const INSERT_EQUATION_COMMAND = createCommand('INSERT_EQUATION_COMMAND');
3
+ import "katex/dist/katex.css";
4
+ import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
5
+ import { $wrapNodeInElement } from "@lexical/utils";
6
+ import { $createParagraphNode, $insertNodes, $isRootOrShadowRoot, COMMAND_PRIORITY_EDITOR, createCommand, } from "lexical";
7
+ import { useCallback, useEffect } from "react";
8
+ import { $createEquationNode, EquationNode } from "../../nodes/EquationNode";
9
+ import KatexEquationAlterer from "../../ui/KatexEquationAlterer";
10
+ export const INSERT_EQUATION_COMMAND = createCommand("INSERT_EQUATION_COMMAND");
10
11
  export function InsertEquationDialog({ activeEditor, onClose, }) {
11
12
  const onEquationConfirm = useCallback((equation, inline) => {
12
- activeEditor.dispatchCommand(INSERT_EQUATION_COMMAND, { equation, inline });
13
+ activeEditor.dispatchCommand(INSERT_EQUATION_COMMAND, {
14
+ equation,
15
+ inline,
16
+ });
13
17
  onClose();
14
18
  }, [activeEditor, onClose]);
15
19
  return _jsx(KatexEquationAlterer, { onConfirm: onEquationConfirm });
@@ -18,7 +22,7 @@ export default function EquationsPlugin() {
18
22
  const [editor] = useLexicalComposerContext();
19
23
  useEffect(() => {
20
24
  if (!editor.hasNodes([EquationNode])) {
21
- throw new Error('EquationsPlugins: EquationsNode not registered on editor');
25
+ throw new Error("EquationsPlugins: EquationsNode not registered on editor");
22
26
  }
23
27
  return editor.registerCommand(INSERT_EQUATION_COMMAND, (payload) => {
24
28
  const { equation, inline } = payload;
@@ -5,8 +5,8 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
- import type { JSX } from 'react';
9
- import { LexicalCommand } from 'lexical';
8
+ import type { JSX } from "react";
9
+ import { LexicalCommand } from "lexical";
10
10
  export declare const INSERT_FIGMA_COMMAND: LexicalCommand<string>;
11
11
  export default function FigmaPlugin(): JSX.Element | null;
12
12
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/FigmaPlugin/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAI/B,OAAO,EAAyC,cAAc,EAAC,MAAM,SAAS,CAAC;AAK/E,eAAO,MAAM,oBAAoB,EAAE,cAAc,CAAC,MAAM,CAEvD,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,WAAW,IAAI,GAAG,CAAC,OAAO,GAAG,IAAI,CAoBxD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/FigmaPlugin/index.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAIjC,OAAO,EAGL,cAAc,EACf,MAAM,SAAS,CAAC;AAKjB,eAAO,MAAM,oBAAoB,EAAE,cAAc,CAAC,MAAM,CAEvD,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,WAAW,IAAI,GAAG,CAAC,OAAO,GAAG,IAAI,CAoBxD"}
@@ -1,21 +1,15 @@
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 { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
9
- import { $insertNodeToNearestRoot } from '@lexical/utils';
10
- import { COMMAND_PRIORITY_EDITOR, createCommand } from 'lexical';
11
- import { useEffect } from 'react';
12
- import { $createFigmaNode, FigmaNode } from '../../nodes/FigmaNode';
13
- export const INSERT_FIGMA_COMMAND = createCommand('INSERT_FIGMA_COMMAND');
1
+ "use client";
2
+ import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
3
+ import { $insertNodeToNearestRoot } from "@lexical/utils";
4
+ import { COMMAND_PRIORITY_EDITOR, createCommand, } from "lexical";
5
+ import { useEffect } from "react";
6
+ import { $createFigmaNode, FigmaNode } from "../../nodes/FigmaNode/FigmaNode";
7
+ export const INSERT_FIGMA_COMMAND = createCommand("INSERT_FIGMA_COMMAND");
14
8
  export default function FigmaPlugin() {
15
9
  const [editor] = useLexicalComposerContext();
16
10
  useEffect(() => {
17
11
  if (!editor.hasNodes([FigmaNode])) {
18
- throw new Error('FigmaPlugin: FigmaNode not registered on editor');
12
+ throw new Error("FigmaPlugin: FigmaNode not registered on editor");
19
13
  }
20
14
  return editor.registerCommand(INSERT_FIGMA_COMMAND, (payload) => {
21
15
  const figmaNode = $createFigmaNode(payload);
@@ -39,3 +39,14 @@
39
39
  width: 20px;
40
40
  vertical-align: -0.25em;
41
41
  }
42
+
43
+ @media (prefers-color-scheme: dark) {
44
+ .link-editor {
45
+ background-color: #2b2b2b;
46
+ box-shadow: 0 5px 10px rgba(0, 0, 0, 0.7);
47
+ }
48
+
49
+ .link-editor .button.hovered {
50
+ background-color: #3a3a3a;
51
+ }
52
+ }
@@ -5,9 +5,9 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
- import type { JSX } from 'react';
9
- import './index.css';
10
- import { Dispatch } from 'react';
8
+ import type { JSX } from "react";
9
+ import "./index.css";
10
+ import { Dispatch } from "react";
11
11
  export default function FloatingLinkEditorPlugin({ anchorElem, isLinkEditMode, setIsLinkEditMode, }: {
12
12
  anchorElem?: HTMLElement;
13
13
  isLinkEditMode: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/FloatingLinkEditorPlugin/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAE/B,OAAO,aAAa,CAAC;AAyBrB,OAAO,EAAC,QAAQ,EAA2C,MAAM,OAAO,CAAC;AAiazE,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAAC,EAC/C,UAA0B,EAC1B,cAAc,EACd,iBAAiB,GAClB,EAAE;IACD,UAAU,CAAC,EAAE,WAAW,CAAC;IACzB,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;CACtC,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAQrB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/FloatingLinkEditorPlugin/index.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,aAAa,CAAC;AAyBrB,OAAO,EAAE,QAAQ,EAA4C,MAAM,OAAO,CAAC;AAka3E,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAAC,EAC/C,UAA0B,EAC1B,cAAc,EACd,iBAAiB,GAClB,EAAE;IACD,UAAU,CAAC,EAAE,WAAW,CAAC;IACzB,cAAc,EAAE,OAAO,CAAC;IACxB,iBAAiB,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;CACtC,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAQrB"}
@@ -1,22 +1,23 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import './index.css';
3
- import { $createLinkNode, $isAutoLinkNode, $isLinkNode, TOGGLE_LINK_COMMAND, } from '@lexical/link';
4
- import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
5
- import { $findMatchingParent, mergeRegister } from '@lexical/utils';
6
- import { $getSelection, $isLineBreakNode, $isNodeSelection, $isRangeSelection, CLICK_COMMAND, COMMAND_PRIORITY_CRITICAL, COMMAND_PRIORITY_HIGH, COMMAND_PRIORITY_LOW, getDOMSelection, KEY_ESCAPE_COMMAND, SELECTION_CHANGE_COMMAND, } from 'lexical';
7
- import { useCallback, useEffect, useRef, useState } from 'react';
8
- import { createPortal } from 'react-dom';
9
- import { getSelectedNode } from '../../utils/getSelectedNode';
10
- import { setFloatingElemPositionForLinkEditor } from '../../utils/setFloatingElemPositionForLinkEditor';
11
- import { sanitizeUrl } from '../../utils/url';
3
+ import "./index.css";
4
+ import { $createLinkNode, $isAutoLinkNode, $isLinkNode, TOGGLE_LINK_COMMAND, } from "@lexical/link";
5
+ import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
6
+ import { $findMatchingParent, mergeRegister } from "@lexical/utils";
7
+ import { $getSelection, $isLineBreakNode, $isNodeSelection, $isRangeSelection, CLICK_COMMAND, COMMAND_PRIORITY_CRITICAL, COMMAND_PRIORITY_HIGH, COMMAND_PRIORITY_LOW, getDOMSelection, KEY_ESCAPE_COMMAND, SELECTION_CHANGE_COMMAND, } from "lexical";
8
+ import { useCallback, useEffect, useRef, useState } from "react";
9
+ import { createPortal } from "react-dom";
10
+ import { getSelectedNode } from "../../utils/getSelectedNode";
11
+ import { setFloatingElemPositionForLinkEditor } from "../../utils/setFloatingElemPositionForLinkEditor";
12
+ import { sanitizeUrl } from "../../utils/url";
12
13
  function preventDefault(event) {
13
14
  event.preventDefault();
14
15
  }
15
16
  function FloatingLinkEditor({ editor, isLink, setIsLink, anchorElem, isLinkEditMode, setIsLinkEditMode, }) {
16
17
  const editorRef = useRef(null);
17
18
  const inputRef = useRef(null);
18
- const [linkUrl, setLinkUrl] = useState('');
19
- const [editedLinkUrl, setEditedLinkUrl] = useState('https://');
19
+ const [linkUrl, setLinkUrl] = useState("");
20
+ const [editedLinkUrl, setEditedLinkUrl] = useState("https://");
20
21
  const [lastSelection, setLastSelection] = useState(null);
21
22
  const $updateLinkEditor = useCallback(() => {
22
23
  var _a, _b;
@@ -31,7 +32,7 @@ function FloatingLinkEditor({ editor, isLink, setIsLink, anchorElem, isLinkEditM
31
32
  setLinkUrl(node.getURL());
32
33
  }
33
34
  else {
34
- setLinkUrl('');
35
+ setLinkUrl("");
35
36
  }
36
37
  if (isLinkEditMode) {
37
38
  setEditedLinkUrl(linkUrl);
@@ -49,7 +50,7 @@ function FloatingLinkEditor({ editor, isLink, setIsLink, anchorElem, isLinkEditM
49
50
  setLinkUrl(node.getURL());
50
51
  }
51
52
  else {
52
- setLinkUrl('');
53
+ setLinkUrl("");
53
54
  }
54
55
  if (isLinkEditMode) {
55
56
  setEditedLinkUrl(linkUrl);
@@ -85,13 +86,13 @@ function FloatingLinkEditor({ editor, isLink, setIsLink, anchorElem, isLinkEditM
85
86
  }
86
87
  setLastSelection(selection);
87
88
  }
88
- else if (!activeElement || activeElement.className !== 'link-input') {
89
+ else if (!activeElement || activeElement.className !== "link-input") {
89
90
  if (rootElement !== null) {
90
91
  setFloatingElemPositionForLinkEditor(null, editorElem, anchorElem);
91
92
  }
92
93
  setLastSelection(null);
93
94
  setIsLinkEditMode(false);
94
- setLinkUrl('');
95
+ setLinkUrl("");
95
96
  }
96
97
  return true;
97
98
  }, [anchorElem, editor, setIsLinkEditMode, isLinkEditMode, linkUrl]);
@@ -102,14 +103,14 @@ function FloatingLinkEditor({ editor, isLink, setIsLink, anchorElem, isLinkEditM
102
103
  $updateLinkEditor();
103
104
  });
104
105
  };
105
- window.addEventListener('resize', update);
106
+ window.addEventListener("resize", update);
106
107
  if (scrollerElem) {
107
- scrollerElem.addEventListener('scroll', update);
108
+ scrollerElem.addEventListener("scroll", update);
108
109
  }
109
110
  return () => {
110
- window.removeEventListener('resize', update);
111
+ window.removeEventListener("resize", update);
111
112
  if (scrollerElem) {
112
- scrollerElem.removeEventListener('scroll', update);
113
+ scrollerElem.removeEventListener("scroll", update);
113
114
  }
114
115
  };
115
116
  }, [anchorElem.parentElement, editor, $updateLinkEditor]);
@@ -150,16 +151,16 @@ function FloatingLinkEditor({ editor, isLink, setIsLink, anchorElem, isLinkEditM
150
151
  setIsLinkEditMode(false);
151
152
  }
152
153
  };
153
- editorElement.addEventListener('focusout', handleBlur);
154
+ editorElement.addEventListener("focusout", handleBlur);
154
155
  return () => {
155
- editorElement.removeEventListener('focusout', handleBlur);
156
+ editorElement.removeEventListener("focusout", handleBlur);
156
157
  };
157
158
  }, [editorRef, setIsLink, setIsLinkEditMode, isLink]);
158
159
  const monitorInputInteraction = (event) => {
159
- if (event.key === 'Enter') {
160
+ if (event.key === "Enter") {
160
161
  handleLinkSubmission(event);
161
162
  }
162
- else if (event.key === 'Escape') {
163
+ else if (event.key === "Escape") {
163
164
  event.preventDefault();
164
165
  setIsLinkEditMode(false);
165
166
  }
@@ -167,7 +168,7 @@ function FloatingLinkEditor({ editor, isLink, setIsLink, anchorElem, isLinkEditM
167
168
  const handleLinkSubmission = (event) => {
168
169
  event.preventDefault();
169
170
  if (lastSelection !== null) {
170
- if (linkUrl !== '') {
171
+ if (linkUrl !== "") {
171
172
  editor.update(() => {
172
173
  editor.dispatchCommand(TOGGLE_LINK_COMMAND, sanitizeUrl(editedLinkUrl));
173
174
  const selection = $getSelection();
@@ -184,7 +185,7 @@ function FloatingLinkEditor({ editor, isLink, setIsLink, anchorElem, isLinkEditM
184
185
  }
185
186
  });
186
187
  }
187
- setEditedLinkUrl('https://');
188
+ setEditedLinkUrl("https://");
188
189
  setIsLinkEditMode(false);
189
190
  }
190
191
  };
@@ -266,7 +267,7 @@ function useFloatingLinkEditorToolbar(editor, anchorElem, isLinkEditMode, setIsL
266
267
  const node = getSelectedNode(selection);
267
268
  const linkNode = $findMatchingParent(node, $isLinkNode);
268
269
  if ($isLinkNode(linkNode) && (payload.metaKey || payload.ctrlKey)) {
269
- window.open(linkNode.getURL(), '_blank');
270
+ window.open(linkNode.getURL(), "_blank");
270
271
  return true;
271
272
  }
272
273
  }
@@ -31,6 +31,7 @@
31
31
  padding: 8px;
32
32
  cursor: pointer;
33
33
  vertical-align: middle;
34
+ align-items: center;
34
35
  }
35
36
 
36
37
  .floating-text-format-popup button.popup-item:disabled {
@@ -76,6 +77,7 @@
76
77
  vertical-align: middle;
77
78
  -webkit-appearance: none;
78
79
  -moz-appearance: none;
80
+ appearance: none;
79
81
  width: 70px;
80
82
  font-size: 14px;
81
83
  color: #777;
@@ -139,3 +141,16 @@
139
141
  display: none;
140
142
  }
141
143
  }
144
+
145
+ @media (prefers-color-scheme: dark) {
146
+ .floating-text-format-popup {
147
+ background: #2a2a2a;
148
+ box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.7);
149
+ }
150
+ .floating-text-format-popup button.popup-item:hover:not([disabled]) {
151
+ background-color: #3a3a3a;
152
+ }
153
+ .floating-text-format-popup .divider {
154
+ background-color: #3a3a3a;
155
+ }
156
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/FloatingTextFormatToolbarPlugin/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,aAAa,CAAC;AAiBrB,OAAO,EAAE,QAAQ,EAA4C,MAAM,OAAO,CAAC;AAga3E,MAAM,CAAC,OAAO,UAAU,+BAA+B,CAAC,EACtD,UAA0B,EAC1B,iBAAiB,GAClB,EAAE;IACD,UAAU,CAAC,EAAE,WAAW,CAAC;IACzB,iBAAiB,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;CACtC,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAGrB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/FloatingTextFormatToolbarPlugin/index.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,aAAa,CAAC;AAiBrB,OAAO,EAAE,QAAQ,EAA4C,MAAM,OAAO,CAAC;AA+Z3E,MAAM,CAAC,OAAO,UAAU,+BAA+B,CAAC,EACtD,UAA0B,EAC1B,iBAAiB,GAClB,EAAE;IACD,UAAU,CAAC,EAAE,WAAW,CAAC;IACzB,iBAAiB,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;CACtC,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CAGrB"}
@@ -1,6 +1,7 @@
1
+ "use client";
1
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import "./index.css";
3
- import { $isCodeHighlightNode } from "@lexical/code";
4
+ import { $isCodeHighlightNode } from "../../nodes/CodeNode/CodeHighlightNode";
4
5
  import { $isLinkNode, TOGGLE_LINK_COMMAND } from "@lexical/link";
5
6
  import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
6
7
  import { mergeRegister } from "@lexical/utils";
@@ -5,9 +5,9 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
- import type { JSX } from 'react';
9
- import { LexicalCommand, LexicalEditor } from 'lexical';
10
- import { ImagePayload } from '../../nodes/ImageNode';
8
+ import type { JSX } from "react";
9
+ import { LexicalCommand, LexicalEditor } from "lexical";
10
+ import { ImagePayload } from "../../nodes/ImageNode";
11
11
  export type InsertImagePayload = Readonly<ImagePayload>;
12
12
  export declare const INSERT_IMAGE_COMMAND: LexicalCommand<InsertImagePayload>;
13
13
  export declare function InsertImageUriDialogBody({ onClick, }: {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/ImagesPlugin/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAc/B,OAAO,EAiBL,cAAc,EACd,aAAa,EACd,MAAM,SAAS,CAAC;AAMjB,OAAO,EAIL,YAAY,EACb,MAAM,uBAAuB,CAAC;AAM/B,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;AAExD,eAAO,MAAM,oBAAoB,EAAE,cAAc,CAAC,kBAAkB,CAC7B,CAAC;AAExC,wBAAgB,wBAAwB,CAAC,EACvC,OAAO,GACR,EAAE;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,IAAI,CAAC;CAChD,2CAgCA;AAED,wBAAgB,6BAA6B,CAAC,EAC5C,OAAO,GACR,EAAE;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,IAAI,CAAC;CAChD,2CA4CA;AAED,wBAAgB,iBAAiB,CAAC,EAChC,YAAY,EACZ,OAAO,GACR,EAAE;IACD,YAAY,EAAE,aAAa,CAAC;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,GAAG,GAAG,CAAC,OAAO,CA0Dd;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,eAAe,GAChB,EAAE;IACD,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CA+CrB;AAuGD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,SAAS;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,CAAC,EAAE,IAAI,CAAC;KACpB;CACF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/ImagesPlugin/index.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAcjC,OAAO,EAiBL,cAAc,EACd,aAAa,EACd,MAAM,SAAS,CAAC;AAKjB,OAAO,EAIL,YAAY,EACb,MAAM,uBAAuB,CAAC;AAM/B,MAAM,MAAM,kBAAkB,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;AAExD,eAAO,MAAM,oBAAoB,EAAE,cAAc,CAAC,kBAAkB,CAC7B,CAAC;AAExC,wBAAgB,wBAAwB,CAAC,EACvC,OAAO,GACR,EAAE;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,IAAI,CAAC;CAChD,2CAiCA;AAED,wBAAgB,6BAA6B,CAAC,EAC5C,OAAO,GACR,EAAE;IACD,OAAO,EAAE,CAAC,OAAO,EAAE,kBAAkB,KAAK,IAAI,CAAC;CAChD,2CA6CA;AAED,wBAAgB,iBAAiB,CAAC,EAChC,YAAY,EACZ,OAAO,GACR,EAAE;IACD,YAAY,EAAE,aAAa,CAAC;IAC5B,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB,GAAG,GAAG,CAAC,OAAO,CA6Dd;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,eAAe,GAChB,EAAE;IACD,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,GAAG,GAAG,CAAC,OAAO,GAAG,IAAI,CA+CrB;AAuGD,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,SAAS;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,WAAW,CAAC,EAAE,IAAI,CAAC;KACpB;CACF"}
@@ -1,34 +1,35 @@
1
+ "use client";
1
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { $isAutoLinkNode, $isLinkNode, TOGGLE_LINK_COMMAND, } from '@lexical/link';
3
- import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
4
- import { $findMatchingParent, $wrapNodeInElement, mergeRegister, } from '@lexical/utils';
5
- import { $createParagraphNode, $createRangeSelection, $getSelection, $insertNodes, $isNodeSelection, $isRootOrShadowRoot, $setSelection, COMMAND_PRIORITY_EDITOR, COMMAND_PRIORITY_HIGH, COMMAND_PRIORITY_LOW, createCommand, DRAGOVER_COMMAND, DRAGSTART_COMMAND, DROP_COMMAND, getDOMSelectionFromTarget, isHTMLElement, } from 'lexical';
6
- import { useEffect, useRef, useState } from 'react';
7
- import landscapeImage from '../../images/landscape.jpg';
8
- import yellowFlowerImage from '../../images/yellow-flower.jpg';
9
- import { $createImageNode, $isImageNode, ImageNode, } from '../../nodes/ImageNode';
10
- import Button from '../../ui/Button';
11
- import { DialogActions, DialogButtonsList } from '../../ui/Dialog';
12
- import FileInput from '../../ui/FileInput';
13
- import TextInput from '../../ui/TextInput';
14
- export const INSERT_IMAGE_COMMAND = createCommand('INSERT_IMAGE_COMMAND');
3
+ import { $isAutoLinkNode, $isLinkNode, TOGGLE_LINK_COMMAND, } from "@lexical/link";
4
+ import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
5
+ import { $findMatchingParent, $wrapNodeInElement, mergeRegister, } from "@lexical/utils";
6
+ import { $createParagraphNode, $createRangeSelection, $getSelection, $insertNodes, $isNodeSelection, $isRootOrShadowRoot, $setSelection, COMMAND_PRIORITY_EDITOR, COMMAND_PRIORITY_HIGH, COMMAND_PRIORITY_LOW, createCommand, DRAGOVER_COMMAND, DRAGSTART_COMMAND, DROP_COMMAND, getDOMSelectionFromTarget, isHTMLElement, } from "lexical";
7
+ import { useEffect, useRef, useState } from "react";
8
+ import landscapeImage from "../../images/landscape.jpg";
9
+ import yellowFlowerImage from "../../images/yellow-flower.jpg";
10
+ import { $createImageNode, $isImageNode, ImageNode, } from "../../nodes/ImageNode";
11
+ import Button from "../../ui/Button";
12
+ import { DialogActions, DialogButtonsList } from "../../ui/Dialog";
13
+ import FileInput from "../../ui/FileInput";
14
+ import TextInput from "../../ui/TextInput";
15
+ export const INSERT_IMAGE_COMMAND = createCommand("INSERT_IMAGE_COMMAND");
15
16
  export function InsertImageUriDialogBody({ onClick, }) {
16
- const [src, setSrc] = useState('');
17
- const [altText, setAltText] = useState('');
18
- const isDisabled = src === '';
17
+ const [src, setSrc] = useState("");
18
+ const [altText, setAltText] = useState("");
19
+ const isDisabled = src === "";
19
20
  return (_jsxs(_Fragment, { children: [_jsx(TextInput, { label: "Image URL", placeholder: "i.e. https://source.unsplash.com/random", onChange: setSrc, value: src, "data-test-id": "image-modal-url-input" }), _jsx(TextInput, { label: "Alt Text", placeholder: "Random unsplash image", onChange: setAltText, value: altText, "data-test-id": "image-modal-alt-text-input" }), _jsx(DialogActions, { children: _jsx(Button, { "data-test-id": "image-modal-confirm-btn", disabled: isDisabled, onClick: () => onClick({ altText, src }), children: "Confirm" }) })] }));
20
21
  }
21
22
  export function InsertImageUploadedDialogBody({ onClick, }) {
22
- const [src, setSrc] = useState('');
23
- const [altText, setAltText] = useState('');
24
- const isDisabled = src === '';
23
+ const [src, setSrc] = useState("");
24
+ const [altText, setAltText] = useState("");
25
+ const isDisabled = src === "";
25
26
  const loadImage = (files) => {
26
27
  const reader = new FileReader();
27
28
  reader.onload = function () {
28
- if (typeof reader.result === 'string') {
29
+ if (typeof reader.result === "string") {
29
30
  setSrc(reader.result);
30
31
  }
31
- return '';
32
+ return "";
32
33
  };
33
34
  if (files !== null) {
34
35
  reader.readAsDataURL(files[0]);
@@ -44,9 +45,9 @@ export function InsertImageDialog({ activeEditor, onClose, }) {
44
45
  const handler = (e) => {
45
46
  hasModifier.current = e.altKey;
46
47
  };
47
- document.addEventListener('keydown', handler);
48
+ document.addEventListener("keydown", handler);
48
49
  return () => {
49
- document.removeEventListener('keydown', handler);
50
+ document.removeEventListener("keydown", handler);
50
51
  };
51
52
  }, [activeEditor]);
52
53
  const onClick = (payload) => {
@@ -55,19 +56,19 @@ export function InsertImageDialog({ activeEditor, onClose, }) {
55
56
  };
56
57
  return (_jsxs(_Fragment, { children: [!mode && (_jsxs(DialogButtonsList, { children: [_jsx(Button, { "data-test-id": "image-modal-option-sample", onClick: () => onClick(hasModifier.current
57
58
  ? {
58
- altText: 'Daylight fir trees forest glacier green high ice landscape',
59
+ altText: "Daylight fir trees forest glacier green high ice landscape",
59
60
  src: landscapeImage,
60
61
  }
61
62
  : {
62
- altText: 'Yellow flower in tilt shift lens',
63
+ altText: "Yellow flower in tilt shift lens",
63
64
  src: yellowFlowerImage,
64
- }), children: "Sample" }), _jsx(Button, { "data-test-id": "image-modal-option-url", onClick: () => setMode('url'), children: "URL" }), _jsx(Button, { "data-test-id": "image-modal-option-file", onClick: () => setMode('file'), children: "File" })] })), mode === 'url' && _jsx(InsertImageUriDialogBody, { onClick: onClick }), mode === 'file' && _jsx(InsertImageUploadedDialogBody, { onClick: onClick })] }));
65
+ }), children: "Sample" }), _jsx(Button, { "data-test-id": "image-modal-option-url", onClick: () => setMode("url"), children: "URL" }), _jsx(Button, { "data-test-id": "image-modal-option-file", onClick: () => setMode("file"), children: "File" })] })), mode === "url" && _jsx(InsertImageUriDialogBody, { onClick: onClick }), mode === "file" && _jsx(InsertImageUploadedDialogBody, { onClick: onClick })] }));
65
66
  }
66
67
  export default function ImagesPlugin({ captionsEnabled, }) {
67
68
  const [editor] = useLexicalComposerContext();
68
69
  useEffect(() => {
69
70
  if (!editor.hasNodes([ImageNode])) {
70
- throw new Error('ImagesPlugin: ImageNode not registered on editor');
71
+ throw new Error("ImagesPlugin: ImageNode not registered on editor");
71
72
  }
72
73
  return mergeRegister(editor.registerCommand(INSERT_IMAGE_COMMAND, (payload) => {
73
74
  const imageNode = $createImageNode(payload);
@@ -86,10 +87,10 @@ export default function ImagesPlugin({ captionsEnabled, }) {
86
87
  }, [captionsEnabled, editor]);
87
88
  return null;
88
89
  }
89
- const TRANSPARENT_IMAGE = 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7';
90
- const img = document.createElement('img');
91
- img.src = TRANSPARENT_IMAGE;
92
90
  function $onDragStart(event) {
91
+ const TRANSPARENT_IMAGE = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7";
92
+ const img = document.createElement("img");
93
+ img.src = TRANSPARENT_IMAGE;
93
94
  const node = $getImageNodeInSelection();
94
95
  if (!node) {
95
96
  return false;
@@ -98,9 +99,9 @@ function $onDragStart(event) {
98
99
  if (!dataTransfer) {
99
100
  return false;
100
101
  }
101
- dataTransfer.setData('text/plain', '_');
102
+ dataTransfer.setData("text/plain", "_");
102
103
  dataTransfer.setDragImage(img, 0, 0);
103
- dataTransfer.setData('application/x-lexical-drag', JSON.stringify({
104
+ dataTransfer.setData("application/x-lexical-drag", JSON.stringify({
104
105
  data: {
105
106
  altText: node.__altText,
106
107
  caption: node.__caption,
@@ -111,7 +112,7 @@ function $onDragStart(event) {
111
112
  src: node.__src,
112
113
  width: node.__width,
113
114
  },
114
- type: 'image',
115
+ type: "image",
115
116
  }));
116
117
  return true;
117
118
  }
@@ -162,12 +163,12 @@ function $getImageNodeInSelection() {
162
163
  }
163
164
  function getDragImageData(event) {
164
165
  var _a;
165
- const dragData = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.getData('application/x-lexical-drag');
166
+ const dragData = (_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.getData("application/x-lexical-drag");
166
167
  if (!dragData) {
167
168
  return null;
168
169
  }
169
170
  const { type, data } = JSON.parse(dragData);
170
- if (type !== 'image') {
171
+ if (type !== "image") {
171
172
  return null;
172
173
  }
173
174
  return data;
@@ -175,9 +176,9 @@ function getDragImageData(event) {
175
176
  function canDropImage(event) {
176
177
  const target = event.target;
177
178
  return !!(isHTMLElement(target) &&
178
- !target.closest('code, span.editor-image') &&
179
+ !target.closest("code, span.editor-image") &&
179
180
  isHTMLElement(target.parentElement) &&
180
- target.parentElement.closest('div.ContentEditable__root'));
181
+ target.parentElement.closest("div.ContentEditable__root"));
181
182
  }
182
183
  function getDragSelection(event) {
183
184
  let range;
@@ -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
- import type { JSX } from 'react';
1
+ import type { JSX } from "react";
9
2
  export default function KeywordsPlugin(): JSX.Element | null;
10
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/KeywordsPlugin/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAW/B,MAAM,CAAC,OAAO,UAAU,cAAc,IAAI,GAAG,CAAC,OAAO,GAAG,IAAI,CAoC3D"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/KeywordsPlugin/index.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAWjC,MAAM,CAAC,OAAO,UAAU,cAAc,IAAI,GAAG,CAAC,OAAO,GAAG,IAAI,CAoC3D"}