@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,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 { $createYouTubeNode, YouTubeNode } from '../../nodes/YouTubeNode';
13
- export const INSERT_YOUTUBE_COMMAND = createCommand('INSERT_YOUTUBE_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 { $createYouTubeNode, YouTubeNode, } from "../../nodes/YouTubeNode/YouTubeNode";
7
+ export const INSERT_YOUTUBE_COMMAND = createCommand("INSERT_YOUTUBE_COMMAND");
14
8
  export default function YouTubePlugin() {
15
9
  const [editor] = useLexicalComposerContext();
16
10
  useEffect(() => {
17
11
  if (!editor.hasNodes([YouTubeNode])) {
18
- throw new Error('YouTubePlugin: YouTubeNode not registered on editor');
12
+ throw new Error("YouTubePlugin: YouTubeNode not registered on editor");
19
13
  }
20
14
  return editor.registerCommand(INSERT_YOUTUBE_COMMAND, (payload) => {
21
15
  const youTubeNode = $createYouTubeNode(payload);
@@ -1,19 +1,11 @@
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
- */
9
1
  .PlaygroundEditorTheme__paragraph {
10
- margin: 0;
2
+ margin: 0 0 1em 0;
11
3
  position: relative;
12
4
  }
13
5
  .PlaygroundEditorTheme__quote {
14
6
  margin: 0;
15
7
  margin-left: 20px;
16
- margin-bottom: 10px;
8
+ margin-bottom: 1.6em;
17
9
  font-size: 15px;
18
10
  color: rgb(101, 103, 107);
19
11
  border-left-color: rgb(206, 208, 212);
@@ -25,18 +17,18 @@
25
17
  font-size: 24px;
26
18
  color: rgb(5, 5, 5);
27
19
  font-weight: 400;
28
- margin: 0;
20
+ margin: 0 0 1em 0;
29
21
  }
30
22
  .PlaygroundEditorTheme__h2 {
31
23
  font-size: 15px;
32
24
  color: rgb(101, 103, 107);
33
25
  font-weight: 700;
34
- margin: 0;
26
+ margin: 0 0 1em 0;
35
27
  text-transform: uppercase;
36
28
  }
37
29
  .PlaygroundEditorTheme__h3 {
38
30
  font-size: 12px;
39
- margin: 0;
31
+ margin: 0 0 1em 0;
40
32
  text-transform: uppercase;
41
33
  }
42
34
  .PlaygroundEditorTheme__indent {
@@ -73,7 +65,7 @@
73
65
  }
74
66
 
75
67
  .PlaygroundEditorTheme__tabNode.PlaygroundEditorTheme__textUnderline::after {
76
- content: '';
68
+ content: "";
77
69
  position: absolute;
78
70
  left: 0;
79
71
  right: 0;
@@ -82,7 +74,7 @@
82
74
  }
83
75
 
84
76
  .PlaygroundEditorTheme__tabNode.PlaygroundEditorTheme__textStrikethrough::before {
85
- content: '';
77
+ content: "";
86
78
  position: absolute;
87
79
  left: 0;
88
80
  right: 0;
@@ -92,7 +84,7 @@
92
84
 
93
85
  .PlaygroundEditorTheme__tabNode.PlaygroundEditorTheme__textUnderlineStrikethrough::before,
94
86
  .PlaygroundEditorTheme__tabNode.PlaygroundEditorTheme__textUnderlineStrikethrough::after {
95
- content: '';
87
+ content: "";
96
88
  position: absolute;
97
89
  left: 0;
98
90
  right: 0;
@@ -149,7 +141,7 @@
149
141
  position: absolute;
150
142
  }
151
143
  .PlaygroundEditorTheme__blockCursor:after {
152
- content: '';
144
+ content: "";
153
145
  display: block;
154
146
  position: absolute;
155
147
  top: -2px;
@@ -171,10 +163,11 @@
171
163
  font-size: 13px;
172
164
  margin: 0;
173
165
  margin-top: 8px;
174
- margin-bottom: 8px;
166
+ margin-bottom: 1.5em;
175
167
  overflow-x: auto;
176
168
  position: relative;
177
169
  tab-size: 2;
170
+ white-space: pre;
178
171
  }
179
172
  .PlaygroundEditorTheme__code:before {
180
173
  content: attr(data-gutter);
@@ -189,6 +182,9 @@
189
182
  text-align: right;
190
183
  min-width: 25px;
191
184
  }
185
+ .PlaygroundEditorTheme__code span {
186
+ white-space: nowrap;
187
+ }
192
188
  .PlaygroundEditorTheme__tableScrollableWrapper {
193
189
  overflow-x: auto;
194
190
  margin: 0px 25px 30px 0px;
@@ -247,7 +243,7 @@
247
243
  }
248
244
  .PlaygroundEditorTheme__tableFrozenRow tr:nth-of-type(1) > th:after,
249
245
  .PlaygroundEditorTheme__tableFrozenRow tr:nth-of-type(1) > td:after {
250
- content: '';
246
+ content: "";
251
247
  position: absolute;
252
248
  left: 0;
253
249
  bottom: 0;
@@ -267,7 +263,7 @@
267
263
  left: 0;
268
264
  }
269
265
  .PlaygroundEditorTheme__tableFrozenColumn tr > :first-child::after {
270
- content: '';
266
+ content: "";
271
267
  position: absolute;
272
268
  left: 0;
273
269
  top: 0;
@@ -329,7 +325,7 @@
329
325
  top: 0;
330
326
  background-color: highlight;
331
327
  mix-blend-mode: multiply;
332
- content: '';
328
+ content: "";
333
329
  pointer-events: none;
334
330
  }
335
331
  .PlaygroundEditorTheme__tableAddColumns {
@@ -346,7 +342,7 @@
346
342
  background-position: center;
347
343
  background-repeat: no-repeat;
348
344
  display: block;
349
- content: ' ';
345
+ content: " ";
350
346
  position: absolute;
351
347
  top: 0;
352
348
  left: 0;
@@ -372,7 +368,7 @@
372
368
  background-position: center;
373
369
  background-repeat: no-repeat;
374
370
  display: block;
375
- content: ' ';
371
+ content: " ";
376
372
  position: absolute;
377
373
  top: 0;
378
374
  left: 0;
@@ -424,37 +420,39 @@
424
420
  }
425
421
  .PlaygroundEditorTheme__ol1 {
426
422
  padding: 0;
427
- margin: 0;
423
+ margin: 0 0 1em 0;
428
424
  list-style-position: outside;
425
+ list-style-type: decimal;
429
426
  }
430
427
  .PlaygroundEditorTheme__ol2 {
431
428
  padding: 0;
432
- margin: 0;
429
+ margin: 0 0 1em 0;
433
430
  list-style-type: upper-alpha;
434
431
  list-style-position: outside;
435
432
  }
436
433
  .PlaygroundEditorTheme__ol3 {
437
434
  padding: 0;
438
- margin: 0;
435
+ margin: 0 0 1em 0;
439
436
  list-style-type: lower-alpha;
440
437
  list-style-position: outside;
441
438
  }
442
439
  .PlaygroundEditorTheme__ol4 {
443
440
  padding: 0;
444
- margin: 0;
441
+ margin: 0 0 1em 0;
445
442
  list-style-type: upper-roman;
446
443
  list-style-position: outside;
447
444
  }
448
445
  .PlaygroundEditorTheme__ol5 {
449
446
  padding: 0;
450
- margin: 0;
447
+ margin: 0 0 1em 0;
451
448
  list-style-type: lower-roman;
452
449
  list-style-position: outside;
453
450
  }
454
451
  .PlaygroundEditorTheme__ul {
455
452
  padding: 0;
456
- margin: 0;
453
+ margin: 0 0 1em 0;
457
454
  list-style-position: outside;
455
+ list-style-type: disc;
458
456
  }
459
457
  .PlaygroundEditorTheme__listItem {
460
458
  margin: 0 32px;
@@ -486,7 +484,7 @@
486
484
  }
487
485
  .PlaygroundEditorTheme__listItemUnchecked:before,
488
486
  .PlaygroundEditorTheme__listItemChecked:before {
489
- content: '\200B';
487
+ content: "\200B";
490
488
  width: 0.9em;
491
489
  height: 0.9em;
492
490
  top: 50%;
@@ -516,7 +514,7 @@
516
514
  background-repeat: no-repeat;
517
515
  }
518
516
  .PlaygroundEditorTheme__listItemChecked:after {
519
- content: '';
517
+ content: "";
520
518
  cursor: pointer;
521
519
  border-color: #fff;
522
520
  border-style: solid;
@@ -598,7 +596,7 @@
598
596
  .PlaygroundEditorTheme__layoutContainer {
599
597
  display: grid;
600
598
  gap: 10px;
601
- margin: 10px 0;
599
+ margin: 10px 0 1.5em 0;
602
600
  }
603
601
  .PlaygroundEditorTheme__layoutItem {
604
602
  border: 1px dashed #ddd;
@@ -616,7 +614,7 @@
616
614
  cursor: pointer;
617
615
  }
618
616
  .PlaygroundEditorTheme__hr:after {
619
- content: '';
617
+ content: "";
620
618
  display: block;
621
619
  height: 2px;
622
620
  background-color: #ccc;
@@ -683,3 +681,273 @@
683
681
  background-repeat: no-repeat;
684
682
  background-size: contain;
685
683
  }
684
+
685
+ /* Dark mode overrides */
686
+ @media (prefers-color-scheme: dark) {
687
+ .PlaygroundEditorTheme__quote {
688
+ color: rgb(154, 158, 165);
689
+ border-left-color: rgb(99, 102, 107);
690
+ }
691
+
692
+ .PlaygroundEditorTheme__h1 {
693
+ color: rgb(229, 229, 229);
694
+ }
695
+
696
+ .PlaygroundEditorTheme__h2 {
697
+ color: rgb(154, 158, 165);
698
+ }
699
+
700
+ .PlaygroundEditorTheme__textHighlight {
701
+ background: rgba(255, 212, 0, 0.2);
702
+ border-bottom: 2px solid rgba(255, 212, 0, 0.5);
703
+ }
704
+
705
+ .PlaygroundEditorTheme__textCode {
706
+ background-color: rgb(45, 45, 48);
707
+ }
708
+
709
+ .PlaygroundEditorTheme__hashtag {
710
+ background-color: rgba(88, 144, 255, 0.25);
711
+ border-bottom: 1px solid rgba(88, 144, 255, 0.5);
712
+ }
713
+
714
+ .PlaygroundEditorTheme__link {
715
+ color: rgb(88, 166, 255);
716
+ }
717
+
718
+ .PlaygroundEditorTheme__blockCursor:after {
719
+ border-top: 1px solid white;
720
+ }
721
+
722
+ .PlaygroundEditorTheme__code {
723
+ background-color: rgb(45, 45, 48);
724
+ }
725
+
726
+ .PlaygroundEditorTheme__code:before {
727
+ background-color: #333;
728
+ border-right: 1px solid #555;
729
+ color: #aaa;
730
+ }
731
+
732
+ .PlaygroundEditorTheme__tableScrollRight {
733
+ box-shadow: inset -10px 0 10px rgba(255, 255, 255, 0.15);
734
+ }
735
+
736
+ .PlaygroundEditorTheme__tableScrollLeft {
737
+ box-shadow: inset 10px 0 10px rgba(255, 255, 255, 0.15);
738
+ }
739
+
740
+ .PlaygroundEditorTheme__tableScrollMiddle {
741
+ box-shadow:
742
+ inset 10px 0 10px rgba(255, 255, 255, 0.15),
743
+ inset -10px 0 10px rgba(255, 255, 255, 0.15);
744
+ }
745
+
746
+ .PlaygroundEditorTheme__tableFrozenRow tr:nth-of-type(1) > td {
747
+ background-color: #1e1e1e;
748
+ }
749
+
750
+ .PlaygroundEditorTheme__tableFrozenRow tr:nth-of-type(1) > th {
751
+ background-color: #2d2d2d;
752
+ }
753
+
754
+ .PlaygroundEditorTheme__tableFrozenRow tr:nth-of-type(1) > th:after,
755
+ .PlaygroundEditorTheme__tableFrozenRow tr:nth-of-type(1) > td:after {
756
+ border-bottom: 1px solid #444;
757
+ }
758
+
759
+ .PlaygroundEditorTheme__tableFrozenColumn tr > td:first-child {
760
+ background-color: #1e1e1e;
761
+ }
762
+
763
+ .PlaygroundEditorTheme__tableFrozenColumn tr > th:first-child {
764
+ background-color: #2d2d2d;
765
+ }
766
+
767
+ .PlaygroundEditorTheme__tableFrozenColumn tr > :first-child::after {
768
+ border-right: 1px solid #444;
769
+ }
770
+
771
+ .PlaygroundEditorTheme__tableRowStriping tr:nth-child(even),
772
+ .PlaygroundEditorTheme__tableFrozenColumn
773
+ .PlaygroundEditorTheme__table.PlaygroundEditorTheme__tableRowStriping
774
+ tr:nth-child(even)
775
+ > td:first-child {
776
+ background-color: #2a2a3a;
777
+ }
778
+
779
+ .PlaygroundEditorTheme__tableSelected {
780
+ outline: 2px solid rgb(88, 166, 255);
781
+ }
782
+
783
+ .PlaygroundEditorTheme__tableCell {
784
+ border: 1px solid #888;
785
+ }
786
+
787
+ .PlaygroundEditorTheme__tableCellHeader {
788
+ background-color: #3f3f3f;
789
+ }
790
+
791
+ .PlaygroundEditorTheme__tableAddColumns {
792
+ background-color: #333;
793
+ }
794
+
795
+ .PlaygroundEditorTheme__tableAddColumns:hover,
796
+ .PlaygroundEditorTheme__tableAddRows:hover {
797
+ background-color: #3a4a5a;
798
+ }
799
+
800
+ .PlaygroundEditorTheme__tableAddRows {
801
+ background-color: #333;
802
+ }
803
+
804
+ .PlaygroundEditorTheme__tableCellResizeRuler {
805
+ background-color: rgb(88, 166, 255);
806
+ }
807
+
808
+ .PlaygroundEditorTheme__tableCellActionButton {
809
+ background-color: #333;
810
+ color: #ddd;
811
+ }
812
+
813
+ .PlaygroundEditorTheme__tableCellActionButton:hover {
814
+ background-color: #444;
815
+ }
816
+
817
+ .PlaygroundEditorTheme__characterLimit {
818
+ background-color: #663333 !important;
819
+ }
820
+
821
+ .PlaygroundEditorTheme__listItemUnchecked:focus:before,
822
+ .PlaygroundEditorTheme__listItemChecked:focus:before {
823
+ box-shadow: 0 0 0 2px #4a5f8f;
824
+ }
825
+
826
+ .PlaygroundEditorTheme__listItemUnchecked:before {
827
+ border: 1px solid #666;
828
+ }
829
+
830
+ .PlaygroundEditorTheme__listItemChecked:before {
831
+ border: 1px solid rgb(88, 166, 255);
832
+ background-color: #5a9aff;
833
+ }
834
+
835
+ .PlaygroundEditorTheme__listItemChecked:after {
836
+ border-color: #1e1e1e;
837
+ }
838
+
839
+ .PlaygroundEditorTheme__tokenComment {
840
+ color: #7a8f8f;
841
+ }
842
+
843
+ .PlaygroundEditorTheme__tokenDeleted {
844
+ border-image: linear-gradient(to right, #663333 50%, #552222 50%) fill 0/0/0
845
+ 100vw;
846
+ }
847
+
848
+ .PlaygroundEditorTheme__tokenInserted {
849
+ border-image: linear-gradient(to right, #336633 50%, #224422 50%) fill 0/0/0
850
+ 100vw;
851
+ }
852
+
853
+ .PlaygroundEditorTheme__tokenUnchanged {
854
+ border-image: linear-gradient(to right, #444 50%, #333 50%) fill 0/0/0 100vw;
855
+ }
856
+
857
+ .PlaygroundEditorTheme__tokenPunctuation {
858
+ color: #777;
859
+ }
860
+
861
+ .PlaygroundEditorTheme__tokenProperty {
862
+ color: #d88fb3;
863
+ }
864
+
865
+ .PlaygroundEditorTheme__tokenSelector {
866
+ color: #99dd66;
867
+ }
868
+
869
+ .PlaygroundEditorTheme__tokenOperator {
870
+ color: #d4a574;
871
+ }
872
+
873
+ .PlaygroundEditorTheme__tokenAttr {
874
+ color: #58aaff;
875
+ }
876
+
877
+ .PlaygroundEditorTheme__tokenVariable {
878
+ color: #ffbb22;
879
+ }
880
+
881
+ .PlaygroundEditorTheme__tokenFunction {
882
+ color: #ff6b88;
883
+ }
884
+
885
+ .PlaygroundEditorTheme__mark {
886
+ background: rgba(255, 212, 0, 0.2);
887
+ border-bottom: 2px solid rgba(255, 212, 0, 0.5);
888
+ }
889
+
890
+ .PlaygroundEditorTheme__markOverlap {
891
+ background: rgba(255, 212, 0, 0.4);
892
+ border-bottom: 2px solid rgba(255, 212, 0, 0.6);
893
+ }
894
+
895
+ .PlaygroundEditorTheme__mark.selected {
896
+ background: rgba(255, 212, 0, 0.3);
897
+ border-bottom: 2px solid rgba(255, 212, 0, 0.7);
898
+ }
899
+
900
+ .PlaygroundEditorTheme__markOverlap.selected {
901
+ background: rgba(255, 212, 0, 0.4);
902
+ border-bottom: 2px solid rgba(255, 212, 0, 0.6);
903
+ }
904
+
905
+ .PlaygroundEditorTheme__embedBlockFocus {
906
+ outline: 2px solid rgb(88, 166, 255);
907
+ }
908
+
909
+ .PlaygroundEditorTheme__layoutItem {
910
+ border: 1px dashed #444;
911
+ }
912
+
913
+ .PlaygroundEditorTheme__autocomplete {
914
+ color: #666;
915
+ }
916
+
917
+ .PlaygroundEditorTheme__hr:after {
918
+ background-color: #555;
919
+ }
920
+
921
+ .PlaygroundEditorTheme__hr.PlaygroundEditorTheme__hrSelected {
922
+ outline: 2px solid rgb(88, 166, 255);
923
+ }
924
+
925
+ .PlaygroundEditorTheme__specialText {
926
+ background-color: #664400;
927
+ }
928
+
929
+ .PlaygroundEditorTheme__contextMenu {
930
+ background: #1e1e1e;
931
+ border: 1px solid #444;
932
+ box-shadow: 0px 5px 10px rgba(0, 0, 0, 0.7);
933
+ }
934
+
935
+ .PlaygroundEditorTheme__contextMenuItem {
936
+ background-color: #1e1e1e;
937
+ color: #e0e0e0;
938
+ }
939
+
940
+ .PlaygroundEditorTheme__contextMenuItem.open {
941
+ background: #333;
942
+ }
943
+
944
+ .PlaygroundEditorTheme__contextMenuItem:focus,
945
+ .PlaygroundEditorTheme__contextMenuItem:not([disabled]):active {
946
+ background: #2a2a2a;
947
+ }
948
+
949
+ .PlaygroundEditorTheme__contextMenuItem:disabled {
950
+ background: #1e1e1e;
951
+ color: #666;
952
+ }
953
+ }