@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,10 +1,11 @@
1
+ "use client";
1
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
3
- import { INSERT_TABLE_COMMAND, TableCellNode, TableNode, TableRowNode, } from '@lexical/table';
4
- import { createContext, useContext, useEffect, useMemo, useState } from 'react';
5
- import Button from '../ui/Button';
6
- import { DialogActions } from '../ui/Dialog';
7
- import TextInput from '../ui/TextInput';
3
+ import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
4
+ import { INSERT_TABLE_COMMAND, TableCellNode, TableNode, TableRowNode, } from "@lexical/table";
5
+ import { createContext, useContext, useEffect, useMemo, useState } from "react";
6
+ import Button from "../ui/Button";
7
+ import { DialogActions } from "../ui/Dialog";
8
+ import TextInput from "../ui/TextInput";
8
9
  export const CellContext = createContext({
9
10
  cellEditorConfig: null,
10
11
  cellEditorPlugins: null,
@@ -26,8 +27,8 @@ export function TableContext({ children }) {
26
27
  }), [contextValue.cellEditorConfig, contextValue.cellEditorPlugins]), children: children }));
27
28
  }
28
29
  export function InsertTableDialog({ activeEditor, onClose, }) {
29
- const [rows, setRows] = useState('5');
30
- const [columns, setColumns] = useState('5');
30
+ const [rows, setRows] = useState("5");
31
+ const [columns, setColumns] = useState("5");
31
32
  const [isDisabled, setIsDisabled] = useState(true);
32
33
  useEffect(() => {
33
34
  const row = Number(rows);
@@ -46,14 +47,14 @@ export function InsertTableDialog({ activeEditor, onClose, }) {
46
47
  });
47
48
  onClose();
48
49
  };
49
- return (_jsxs(_Fragment, { children: [_jsx(TextInput, { placeholder: '# of rows (1-500)', label: "Rows", onChange: setRows, value: rows, "data-test-id": "table-modal-rows", type: "number" }), _jsx(TextInput, { placeholder: '# of columns (1-50)', label: "Columns", onChange: setColumns, value: columns, "data-test-id": "table-modal-columns", type: "number" }), _jsx(DialogActions, { "data-test-id": "table-model-confirm-insert", children: _jsx(Button, { disabled: isDisabled, onClick: onClick, children: "Confirm" }) })] }));
50
+ return (_jsxs(_Fragment, { children: [_jsx(TextInput, { placeholder: "# of rows (1-500)", label: "Rows", onChange: setRows, value: rows, "data-test-id": "table-modal-rows", type: "number" }), _jsx(TextInput, { placeholder: "# of columns (1-50)", label: "Columns", onChange: setColumns, value: columns, "data-test-id": "table-modal-columns", type: "number" }), _jsx(DialogActions, { "data-test-id": "table-model-confirm-insert", children: _jsx(Button, { disabled: isDisabled, onClick: onClick, children: "Confirm" }) })] }));
50
51
  }
51
52
  export function TablePlugin({ cellEditorConfig, children, }) {
52
53
  const [editor] = useLexicalComposerContext();
53
54
  const cellContext = useContext(CellContext);
54
55
  useEffect(() => {
55
56
  if (!editor.hasNodes([TableNode, TableRowNode, TableCellNode])) {
56
- throw new Error('TablePlugin: TableNode, TableRowNode, or TableCellNode is not registered on editor');
57
+ throw new Error("TablePlugin: TableNode, TableRowNode, or TableCellNode is not registered on editor");
57
58
  }
58
59
  }, [editor]);
59
60
  useEffect(() => {
@@ -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 TableScrollShadowPlugin(): null;
9
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/TableScrollShadowPlugin/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAuCH,MAAM,CAAC,OAAO,UAAU,uBAAuB,IAAI,IAAI,CAiGtD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/TableScrollShadowPlugin/index.tsx"],"names":[],"mappings":"AA+CA,MAAM,CAAC,OAAO,UAAU,uBAAuB,IAAI,IAAI,CAiGtD"}
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  /**
2
3
  * Copyright (c) Meta Platforms, Inc. and affiliates.
3
4
  *
@@ -5,12 +6,12 @@
5
6
  * LICENSE file in the root directory of this source tree.
6
7
  *
7
8
  */
8
- import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
9
- import { useEffect } from 'react';
10
- const SCROLLABLE_WRAPPER_CLASS = 'PlaygroundEditorTheme__tableScrollableWrapper';
11
- const HAS_SCROLL_RIGHT_CLASS = 'PlaygroundEditorTheme__tableScrollRight';
12
- const HAS_SCROLL_LEFT_CLASS = 'PlaygroundEditorTheme__tableScrollLeft';
13
- const HAS_SCROLL_MIDDLE_CLASS = 'PlaygroundEditorTheme__tableScrollMiddle';
9
+ import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
10
+ import { useEffect } from "react";
11
+ const SCROLLABLE_WRAPPER_CLASS = "PlaygroundEditorTheme__tableScrollableWrapper";
12
+ const HAS_SCROLL_RIGHT_CLASS = "PlaygroundEditorTheme__tableScrollRight";
13
+ const HAS_SCROLL_LEFT_CLASS = "PlaygroundEditorTheme__tableScrollLeft";
14
+ const HAS_SCROLL_MIDDLE_CLASS = "PlaygroundEditorTheme__tableScrollMiddle";
14
15
  function updateTableScrollState(element) {
15
16
  const hasScroll = element.scrollWidth > element.clientWidth;
16
17
  // Adding and removing 1 and -1 for floating point precision
@@ -68,7 +69,7 @@ export default function TableScrollShadowPlugin() {
68
69
  const handler = () => {
69
70
  updateTableScrollState(wrapper);
70
71
  };
71
- wrapper.addEventListener('scroll', handler, { passive: true });
72
+ wrapper.addEventListener("scroll", handler, { passive: true });
72
73
  scrollHandlers.set(wrapper, handler);
73
74
  };
74
75
  const wrappers = editorElement.querySelectorAll(`.${SCROLLABLE_WRAPPER_CLASS}`);
@@ -105,7 +106,7 @@ export default function TableScrollShadowPlugin() {
105
106
  resizeObserver.disconnect();
106
107
  wrapperObserver.disconnect();
107
108
  scrollHandlers.forEach((handler, wrapper) => {
108
- wrapper.removeEventListener('scroll', handler);
109
+ wrapper.removeEventListener("scroll", handler);
109
110
  });
110
111
  scrollHandlers.clear();
111
112
  };
@@ -1,11 +1,4 @@
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 declare function isSelectAll(event: KeyboardEvent): boolean;
10
3
  export default function TestRecorderPlugin(): JSX.Element;
11
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/TestRecorderPlugin/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AA4F/B,wBAAgB,WAAW,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAKzD;AAoWD,MAAM,CAAC,OAAO,UAAU,kBAAkB,IAAI,GAAG,CAAC,OAAO,CAUxD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/TestRecorderPlugin/index.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAiGjC,wBAAgB,WAAW,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAKzD;AAoWD,MAAM,CAAC,OAAO,UAAU,kBAAkB,IAAI,GAAG,CAAC,OAAO,CAUxD"}
@@ -1,19 +1,20 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
3
- import { IS_APPLE } from '@lexical/utils';
4
- import { $createParagraphNode, $createTextNode, $getRoot, getDOMSelection, } from 'lexical';
5
- import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
3
+ import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
4
+ import { IS_APPLE } from "@lexical/utils";
5
+ import { $createParagraphNode, $createTextNode, $getRoot, getDOMSelection, } from "lexical";
6
+ import { useCallback, useEffect, useLayoutEffect, useRef, useState, } from "react";
6
7
  const copy = (text) => {
7
8
  var _a, _b;
8
- const textArea = document.createElement('textarea');
9
- textArea.value = text || '';
10
- textArea.style.position = 'absolute';
11
- textArea.style.opacity = '0';
9
+ const textArea = document.createElement("textarea");
10
+ textArea.value = text || "";
11
+ textArea.style.position = "absolute";
12
+ textArea.style.opacity = "0";
12
13
  (_a = document.body) === null || _a === void 0 ? void 0 : _a.appendChild(textArea);
13
14
  textArea.focus();
14
15
  textArea.select();
15
16
  try {
16
- const result = document.execCommand('copy');
17
+ const result = document.execCommand("copy");
17
18
  // eslint-disable-next-line no-console
18
19
  console.log(result);
19
20
  }
@@ -24,10 +25,10 @@ const copy = (text) => {
24
25
  };
25
26
  const download = (filename, text) => {
26
27
  var _a, _b;
27
- const a = document.createElement('a');
28
- a.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text || ''));
29
- a.setAttribute('download', filename);
30
- a.style.display = 'none';
28
+ const a = document.createElement("a");
29
+ a.setAttribute("href", "data:text/plain;charset=utf-8," + encodeURIComponent(text || ""));
30
+ a.setAttribute("download", filename);
31
+ a.style.display = "none";
31
32
  (_a = document.body) === null || _a === void 0 ? void 0 : _a.appendChild(a);
32
33
  a.click();
33
34
  (_b = document.body) === null || _b === void 0 ? void 0 : _b.removeChild(a);
@@ -35,25 +36,25 @@ const download = (filename, text) => {
35
36
  const formatStep = (step) => {
36
37
  const formatOneStep = (name, value) => {
37
38
  switch (name) {
38
- case 'click': {
39
+ case "click": {
39
40
  return ` await page.mouse.click(${value.x}, ${value.y});`;
40
41
  }
41
- case 'press': {
42
+ case "press": {
42
43
  return ` await page.keyboard.press('${value}');`;
43
44
  }
44
- case 'keydown': {
45
+ case "keydown": {
45
46
  return ` await page.keyboard.keydown('${value}');`;
46
47
  }
47
- case 'keyup': {
48
+ case "keyup": {
48
49
  return ` await page.keyboard.keyup('${value}');`;
49
50
  }
50
- case 'type': {
51
+ case "type": {
51
52
  return ` await page.keyboard.type('${value}');`;
52
53
  }
53
- case 'selectAll': {
54
+ case "selectAll": {
54
55
  return ` await selectAll(page);`;
55
56
  }
56
- case 'snapshot': {
57
+ case "snapshot": {
57
58
  return ` await assertHTMLSnapshot(page);
58
59
  await assertSelection(page, {
59
60
  anchorPath: [${value.anchorPath.toString()}],
@@ -80,7 +81,7 @@ const formatStep = (step) => {
80
81
  }
81
82
  };
82
83
  export function isSelectAll(event) {
83
- return (event.key.toLowerCase() === 'a' &&
84
+ return (event.key.toLowerCase() === "a" &&
84
85
  (IS_APPLE ? event.metaKey : event.ctrlKey));
85
86
  }
86
87
  // stolen from LexicalSelection-test
@@ -108,20 +109,20 @@ function getPathFromNodeToEditor(node, rootElement) {
108
109
  return path;
109
110
  }
110
111
  const keyPresses = new Set([
111
- 'Enter',
112
- 'Backspace',
113
- 'Delete',
114
- 'Escape',
115
- 'ArrowLeft',
116
- 'ArrowRight',
117
- 'ArrowUp',
118
- 'ArrowDown',
112
+ "Enter",
113
+ "Backspace",
114
+ "Delete",
115
+ "Escape",
116
+ "ArrowLeft",
117
+ "ArrowRight",
118
+ "ArrowUp",
119
+ "ArrowDown",
119
120
  ]);
120
121
  function useTestRecorder(editor) {
121
122
  const [steps, setSteps] = useState([]);
122
123
  const [isRecording, setIsRecording] = useState(false);
123
- const [, setCurrentInnerHTML] = useState('');
124
- const [templatedTest, setTemplatedTest] = useState('');
124
+ const [, setCurrentInnerHTML] = useState("");
125
+ const [templatedTest, setTemplatedTest] = useState("");
125
126
  const previousSelectionRef = useRef(null);
126
127
  const skipNextSelectionChangeRef = useRef(false);
127
128
  const preRef = useRef(null);
@@ -178,7 +179,7 @@ ${steps.map(formatStep).join(`\n`)}
178
179
  const lastStep = steps[currentIndex];
179
180
  if (lastStep) {
180
181
  if (lastStep.name === name) {
181
- if (name === 'type') {
182
+ if (name === "type") {
182
183
  // for typing events we just append the text
183
184
  return [
184
185
  ...steps.slice(0, currentIndex),
@@ -207,16 +208,16 @@ ${steps.map(formatStep).join(`\n`)}
207
208
  }
208
209
  const key = event.key;
209
210
  if (isSelectAll(event)) {
210
- pushStep('selectAll', '');
211
+ pushStep("selectAll", "");
211
212
  }
212
213
  else if (keyPresses.has(key)) {
213
- pushStep('press', event.key);
214
+ pushStep("press", event.key);
214
215
  }
215
216
  else if ([...key].length > 1) {
216
- pushStep('keydown', event.key);
217
+ pushStep("keydown", event.key);
217
218
  }
218
219
  else {
219
- pushStep('type', event.key);
220
+ pushStep("type", event.key);
220
221
  }
221
222
  };
222
223
  const onKeyUp = (event) => {
@@ -225,17 +226,17 @@ ${steps.map(formatStep).join(`\n`)}
225
226
  }
226
227
  const key = event.key;
227
228
  if (!keyPresses.has(key) && [...key].length > 1) {
228
- pushStep('keyup', event.key);
229
+ pushStep("keyup", event.key);
229
230
  }
230
231
  };
231
232
  return editor.registerRootListener((rootElement, prevRootElement) => {
232
233
  if (prevRootElement !== null) {
233
- prevRootElement.removeEventListener('keydown', onKeyDown);
234
- prevRootElement.removeEventListener('keyup', onKeyUp);
234
+ prevRootElement.removeEventListener("keydown", onKeyDown);
235
+ prevRootElement.removeEventListener("keyup", onKeyUp);
235
236
  }
236
237
  if (rootElement !== null) {
237
- rootElement.addEventListener('keydown', onKeyDown);
238
- rootElement.addEventListener('keyup', onKeyUp);
238
+ rootElement.addEventListener("keydown", onKeyDown);
239
+ rootElement.addEventListener("keyup", onKeyUp);
239
240
  }
240
241
  });
241
242
  }, [editor, isRecording, pushStep]);
@@ -331,7 +332,7 @@ ${steps.map(formatStep).join(`\n`)}
331
332
  if (focusNode !== null) {
332
333
  focusPath = getPathFromNodeToEditor(focusNode, rootElement);
333
334
  }
334
- pushStep('snapshot', {
335
+ pushStep("snapshot", {
335
336
  anchorNode,
336
337
  anchorOffset,
337
338
  anchorPath,
@@ -344,9 +345,9 @@ ${steps.map(formatStep).join(`\n`)}
344
345
  copy(generateTestContent());
345
346
  }, [generateTestContent]);
346
347
  const onDownloadClick = useCallback(() => {
347
- download('test.js', generateTestContent());
348
+ download("test.js", generateTestContent());
348
349
  }, [generateTestContent]);
349
- const button = (_jsx("button", { id: "test-recorder-button", className: `editor-dev-button ${isRecording ? 'active' : ''}`, onClick: () => toggleEditorSelection(getCurrentEditor()), title: isRecording ? 'Disable test recorder' : 'Enable test recorder' }));
350
+ const button = (_jsx("button", { id: "test-recorder-button", className: `editor-dev-button ${isRecording ? "active" : ""}`, onClick: () => toggleEditorSelection(getCurrentEditor()), title: isRecording ? "Disable test recorder" : "Enable test recorder" }));
350
351
  const output = isRecording ? (_jsxs("div", { className: "test-recorder-output", children: [_jsxs("div", { className: "test-recorder-toolbar", children: [_jsx("button", { className: "test-recorder-button", id: "test-recorder-button-snapshot", title: "Insert snapshot", onClick: onSnapshotClick }), _jsx("button", { className: "test-recorder-button", id: "test-recorder-button-copy", title: "Copy to clipboard", onClick: onCopyClick }), _jsx("button", { className: "test-recorder-button", id: "test-recorder-button-download", title: "Download as a file", onClick: onDownloadClick })] }), _jsx("pre", { id: "test-recorder", ref: preRef, children: templatedTest })] })) : null;
351
352
  return [button, output];
352
353
  }
@@ -5,8 +5,8 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
- import './fontSize.css';
9
- import { LexicalEditor } from 'lexical';
8
+ import "./fontSize.css";
9
+ import { LexicalEditor } from "lexical";
10
10
  export declare function parseFontSizeForToolbar(input: string): string;
11
11
  export declare function parseAllowedFontSize(input: string): string;
12
12
  export default function FontSize({ selectionFontSize, disabled, editor, }: {
@@ -1 +1 @@
1
- {"version":3,"file":"fontSize.d.ts","sourceRoot":"","sources":["../../../src/plugins/ToolbarPlugin/fontSize.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,gBAAgB,CAAC;AAExB,OAAO,EAAC,aAAa,EAAC,MAAM,SAAS,CAAC;AA8BtC,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS7D;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS1D;AAED,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC/B,iBAAiB,EACjB,QAAQ,EACR,MAAM,GACP,EAAE;IACD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,aAAa,CAAC;CACvB,2CAyHA"}
1
+ {"version":3,"file":"fontSize.d.ts","sourceRoot":"","sources":["../../../src/plugins/ToolbarPlugin/fontSize.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,gBAAgB,CAAC;AAExB,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AA8BxC,wBAAgB,uBAAuB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS7D;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAS1D;AAED,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC/B,iBAAiB,EACjB,QAAQ,EACR,MAAM,GACP,EAAE;IACD,iBAAiB,EAAE,MAAM,CAAC;IAC1B,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,aAAa,CAAC;CACvB,2CA2HA"}
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  /**
3
4
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -6,18 +7,18 @@ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-run
6
7
  * LICENSE file in the root directory of this source tree.
7
8
  *
8
9
  */
9
- import './fontSize.css';
10
- import * as React from 'react';
11
- import { MAX_ALLOWED_FONT_SIZE, MIN_ALLOWED_FONT_SIZE, } from '../../context/ToolbarContext';
12
- import { isKeyboardInput } from '../../utils/focusUtils';
13
- import { SHORTCUTS } from '../ShortcutsPlugin/shortcuts';
14
- import { updateFontSize, updateFontSizeInSelection, UpdateFontSizeType, } from './utils';
10
+ import "./fontSize.css";
11
+ import * as React from "react";
12
+ import { MAX_ALLOWED_FONT_SIZE, MIN_ALLOWED_FONT_SIZE, } from "../../context/ToolbarContext";
13
+ import { isKeyboardInput } from "../../utils/focusUtils";
14
+ import { SHORTCUTS } from "../ShortcutsPlugin/shortcuts";
15
+ import { updateFontSize, updateFontSizeInSelection, UpdateFontSizeType, } from "./utils";
15
16
  function parseFontSize(input) {
16
17
  const match = input.match(/^(\d+(?:\.\d+)?)(px|pt)$/);
17
18
  return match ? [Number(match[1]), match[2]] : null;
18
19
  }
19
20
  function normalizeToPx(fontSize, unit) {
20
- return unit === 'pt' ? Math.round((fontSize * 4) / 3) : fontSize;
21
+ return unit === "pt" ? Math.round((fontSize * 4) / 3) : fontSize;
21
22
  }
22
23
  function isValidFontSize(fontSizePx) {
23
24
  return (fontSizePx >= MIN_ALLOWED_FONT_SIZE && fontSizePx <= MAX_ALLOWED_FONT_SIZE);
@@ -25,7 +26,7 @@ function isValidFontSize(fontSizePx) {
25
26
  export function parseFontSizeForToolbar(input) {
26
27
  const parsed = parseFontSize(input);
27
28
  if (!parsed) {
28
- return '';
29
+ return "";
29
30
  }
30
31
  const [fontSize, unit] = parsed;
31
32
  const fontSizePx = normalizeToPx(fontSize, unit);
@@ -34,11 +35,11 @@ export function parseFontSizeForToolbar(input) {
34
35
  export function parseAllowedFontSize(input) {
35
36
  const parsed = parseFontSize(input);
36
37
  if (!parsed) {
37
- return '';
38
+ return "";
38
39
  }
39
40
  const [fontSize, unit] = parsed;
40
41
  const fontSizePx = normalizeToPx(fontSize, unit);
41
- return isValidFontSize(fontSizePx) ? input : '';
42
+ return isValidFontSize(fontSizePx) ? input : "";
42
43
  }
43
44
  export default function FontSize({ selectionFontSize, disabled, editor, }) {
44
45
  const [inputValue, setInputValue] = React.useState(selectionFontSize);
@@ -46,23 +47,23 @@ export default function FontSize({ selectionFontSize, disabled, editor, }) {
46
47
  const [isMouseMode, setIsMouseMode] = React.useState(false);
47
48
  const handleKeyPress = (e) => {
48
49
  const inputValueNumber = Number(inputValue);
49
- if (e.key === 'Tab') {
50
+ if (e.key === "Tab") {
50
51
  return;
51
52
  }
52
- if (['e', 'E', '+', '-'].includes(e.key) || isNaN(inputValueNumber)) {
53
+ if (["e", "E", "+", "-"].includes(e.key) || isNaN(inputValueNumber)) {
53
54
  e.preventDefault();
54
- setInputValue('');
55
+ setInputValue("");
55
56
  return;
56
57
  }
57
58
  setInputChangeFlag(true);
58
- if (e.key === 'Enter' || e.key === 'Escape') {
59
+ if (e.key === "Enter" || e.key === "Escape") {
59
60
  e.preventDefault();
60
61
  updateFontSizeByInputValue(inputValueNumber, !isMouseMode);
61
62
  }
62
63
  };
63
64
  const handleInputBlur = () => {
64
65
  setIsMouseMode(false);
65
- if (inputValue !== '' && inputChangeFlag) {
66
+ if (inputValue !== "" && inputChangeFlag) {
66
67
  const inputValueNumber = Number(inputValue);
67
68
  updateFontSizeByInputValue(inputValueNumber);
68
69
  }
@@ -79,18 +80,18 @@ export default function FontSize({ selectionFontSize, disabled, editor, }) {
79
80
  updatedFontSize = MIN_ALLOWED_FONT_SIZE;
80
81
  }
81
82
  setInputValue(String(updatedFontSize));
82
- updateFontSizeInSelection(editor, String(updatedFontSize) + 'px', null, skipRefocus);
83
+ updateFontSizeInSelection(editor, String(updatedFontSize) + "px", null, skipRefocus);
83
84
  setInputChangeFlag(false);
84
85
  };
85
86
  React.useEffect(() => {
86
87
  setInputValue(selectionFontSize);
87
88
  }, [selectionFontSize]);
88
89
  return (_jsxs(_Fragment, { children: [_jsx("button", { type: "button", disabled: disabled ||
89
- (selectionFontSize !== '' &&
90
+ (selectionFontSize !== "" &&
90
91
  Number(inputValue) <= MIN_ALLOWED_FONT_SIZE), onClick: (e) => {
91
92
  updateFontSize(editor, UpdateFontSizeType.decrement, inputValue, isKeyboardInput(e));
92
93
  }, className: "toolbar-item font-decrement", "aria-label": "Decrease font size", title: `Decrease font size (${SHORTCUTS.DECREASE_FONT_SIZE})`, children: _jsx("i", { className: "format minus-icon" }) }), _jsx("input", { type: "number", title: "Font size", value: inputValue, disabled: disabled, className: "toolbar-item font-size-input", min: MIN_ALLOWED_FONT_SIZE, max: MAX_ALLOWED_FONT_SIZE, onChange: (e) => setInputValue(e.target.value), onClick: handleClick, onKeyDown: handleKeyPress, onBlur: handleInputBlur }), _jsx("button", { type: "button", disabled: disabled ||
93
- (selectionFontSize !== '' &&
94
+ (selectionFontSize !== "" &&
94
95
  Number(inputValue) >= MAX_ALLOWED_FONT_SIZE), onClick: (e) => {
95
96
  updateFontSize(editor, UpdateFontSizeType.increment, inputValue, isKeyboardInput(e));
96
97
  }, className: "toolbar-item font-increment", "aria-label": "Increase font size", title: `Increase font size (${SHORTCUTS.INCREASE_FONT_SIZE})`, children: _jsx("i", { className: "format add-icon" }) })] }));
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/ToolbarPlugin/index.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AA8BjC,OAAO,EAmBL,aAAa,EAUd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,QAAQ,EAAoC,MAAM,OAAO,CAAC;AA2fnE,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,MAAM,EACN,YAAY,EACZ,eAAe,EACf,iBAAiB,GAClB,EAAE;IACD,MAAM,EAAE,aAAa,CAAC;IACtB,YAAY,EAAE,aAAa,CAAC;IAC5B,eAAe,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC;IACzC,iBAAiB,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;CACtC,GAAG,GAAG,CAAC,OAAO,CAg0Bd"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/plugins/ToolbarPlugin/index.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AA0BjC,OAAO,EAkBL,aAAa,EAUd,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,QAAQ,EAAoC,MAAM,OAAO,CAAC;AAqenE,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,MAAM,EACN,YAAY,EACZ,eAAe,EACf,iBAAiB,GAClB,EAAE;IACD,MAAM,EAAE,aAAa,CAAC;IACtB,YAAY,EAAE,aAAa,CAAC;IAC5B,eAAe,EAAE,QAAQ,CAAC,aAAa,CAAC,CAAC;IACzC,iBAAiB,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;CACtC,GAAG,GAAG,CAAC,OAAO,CA82Bd"}