@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
@@ -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 './ColorPicker.css';
8
+ import type { JSX } from "react";
9
+ import "./ColorPicker.css";
10
10
  interface ColorPickerProps {
11
11
  color: string;
12
12
  onChange?: (value: string, skipHistoryStack: boolean, skipRefocus: boolean) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../src/ui/ColorPicker.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAE/B,OAAO,mBAAmB,CAAC;AAW3B,UAAU,gBAAgB;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,CACT,KAAK,EAAE,MAAM,EACb,gBAAgB,EAAE,OAAO,EACzB,WAAW,EAAE,OAAO,KACjB,IAAI,CAAC;CACX;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,UAE9C;AAuBD,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,KAAK,EACL,QAAQ,GACT,EAAE,QAAQ,CAAC,gBAAgB,CAAC,GAAG,GAAG,CAAC,OAAO,CA+G1C;AAED,MAAM,WAAW,QAAQ;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AAqFD,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAuB3C"}
1
+ {"version":3,"file":"ColorPicker.d.ts","sourceRoot":"","sources":["../../src/ui/ColorPicker.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,mBAAmB,CAAC;AAW3B,UAAU,gBAAgB;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,CACT,KAAK,EAAE,MAAM,EACb,gBAAgB,EAAE,OAAO,EACzB,WAAW,EAAE,OAAO,KACjB,IAAI,CAAC;CACX;AAED,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,UAE9C;AAuBD,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,KAAK,EACL,QAAQ,GACT,EAAE,QAAQ,CAAC,gBAAgB,CAAC,GAAG,GAAG,CAAC,OAAO,CAiH1C;AAED,MAAM,WAAW,QAAQ;IACvB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;CACX;AA2FD,wBAAgB,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAuB3C"}
@@ -1,35 +1,36 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import './ColorPicker.css';
3
- import { calculateZoomLevel } from '@lexical/utils';
4
- import { useMemo, useRef, useState } from 'react';
5
- import { isKeyboardInput } from '../utils/focusUtils';
6
- import TextInput from './TextInput';
3
+ import "./ColorPicker.css";
4
+ import { calculateZoomLevel } from "@lexical/utils";
5
+ import { useMemo, useRef, useState } from "react";
6
+ import { isKeyboardInput } from "../utils/focusUtils";
7
+ import TextInput from "./TextInput";
7
8
  let skipAddingToHistoryStack = false;
8
9
  export function parseAllowedColor(input) {
9
- return /^rgb\(\d+, \d+, \d+\)$/.test(input) ? input : '';
10
+ return /^rgb\(\d+, \d+, \d+\)$/.test(input) ? input : "";
10
11
  }
11
12
  const basicColors = [
12
- '#d0021b',
13
- '#f5a623',
14
- '#f8e71c',
15
- '#8b572a',
16
- '#7ed321',
17
- '#417505',
18
- '#bd10e0',
19
- '#9013fe',
20
- '#4a90e2',
21
- '#50e3c2',
22
- '#b8e986',
23
- '#000000',
24
- '#4a4a4a',
25
- '#9b9b9b',
26
- '#ffffff',
13
+ "#d0021b",
14
+ "#f5a623",
15
+ "#f8e71c",
16
+ "#8b572a",
17
+ "#7ed321",
18
+ "#417505",
19
+ "#bd10e0",
20
+ "#9013fe",
21
+ "#4a90e2",
22
+ "#50e3c2",
23
+ "#b8e986",
24
+ "#000000",
25
+ "#4a4a4a",
26
+ "#9b9b9b",
27
+ "#ffffff",
27
28
  ];
28
29
  const WIDTH = 214;
29
30
  const HEIGHT = 150;
30
31
  export default function ColorPicker({ color, onChange, }) {
31
- const [selfColor, setSelfColor] = useState(transformColor('hex', color));
32
- const [inputColor, setInputColor] = useState(transformColor('hex', color).hex);
32
+ const [selfColor, setSelfColor] = useState(transformColor("hex", color));
33
+ const [inputColor, setInputColor] = useState(transformColor("hex", color).hex);
33
34
  const innerDivRef = useRef(null);
34
35
  const saturationPosition = useMemo(() => ({
35
36
  x: (selfColor.hsv.s / 100) * WIDTH,
@@ -47,32 +48,32 @@ export default function ColorPicker({ color, onChange, }) {
47
48
  const onSetHex = (hex) => {
48
49
  setInputColor(hex);
49
50
  if (/^#[0-9A-Fa-f]{6}$/i.test(hex)) {
50
- const newColor = transformColor('hex', hex);
51
+ const newColor = transformColor("hex", hex);
51
52
  setSelfColor(newColor);
52
53
  emitOnChange(newColor.hex);
53
54
  }
54
55
  };
55
56
  const onMoveSaturation = ({ x, y }) => {
56
57
  const newHsv = Object.assign(Object.assign({}, selfColor.hsv), { s: (x / WIDTH) * 100, v: 100 - (y / HEIGHT) * 100 });
57
- const newColor = transformColor('hsv', newHsv);
58
+ const newColor = transformColor("hsv", newHsv);
58
59
  setSelfColor(newColor);
59
60
  setInputColor(newColor.hex);
60
61
  emitOnChange(newColor.hex);
61
62
  };
62
63
  const onMoveHue = ({ x }) => {
63
64
  const newHsv = Object.assign(Object.assign({}, selfColor.hsv), { h: (x / WIDTH) * 360 });
64
- const newColor = transformColor('hsv', newHsv);
65
+ const newColor = transformColor("hsv", newHsv);
65
66
  setSelfColor(newColor);
66
67
  setInputColor(newColor.hex);
67
68
  emitOnChange(newColor.hex);
68
69
  };
69
70
  const onBasicColorClick = (e, basicColor) => {
70
- const newColor = transformColor('hex', basicColor);
71
+ const newColor = transformColor("hex", basicColor);
71
72
  setSelfColor(newColor);
72
73
  setInputColor(newColor.hex);
73
74
  emitOnChange(newColor.hex, isKeyboardInput(e));
74
75
  };
75
- return (_jsxs("div", { className: "color-picker-wrapper", style: { width: WIDTH }, ref: innerDivRef, children: [_jsx(TextInput, { label: "Hex", onChange: onSetHex, value: inputColor }), _jsx("div", { className: "color-picker-basic-color", children: basicColors.map((basicColor) => (_jsx("button", { className: basicColor === selfColor.hex ? ' active' : '', style: { backgroundColor: basicColor }, onClick: (e) => onBasicColorClick(e, basicColor) }, basicColor))) }), _jsx(MoveWrapper, { className: "color-picker-saturation", style: { backgroundColor: `hsl(${selfColor.hsv.h}, 100%, 50%)` }, onChange: onMoveSaturation, children: _jsx("div", { className: "color-picker-saturation_cursor", style: {
76
+ return (_jsxs("div", { className: "color-picker-wrapper", style: { width: WIDTH }, ref: innerDivRef, children: [_jsx(TextInput, { label: "Hex", onChange: onSetHex, value: inputColor }), _jsx("div", { className: "color-picker-basic-color", children: basicColors.map((basicColor) => (_jsx("button", { className: basicColor === selfColor.hex ? " active" : "", style: { backgroundColor: basicColor }, onClick: (e) => onBasicColorClick(e, basicColor) }, basicColor))) }), _jsx(MoveWrapper, { className: "color-picker-saturation", style: { backgroundColor: `hsl(${selfColor.hsv.h}, 100%, 50%)` }, onChange: onMoveSaturation, children: _jsx("div", { className: "color-picker-saturation_cursor", style: {
76
77
  backgroundColor: selfColor.hex,
77
78
  left: saturationPosition.x,
78
79
  top: saturationPosition.y,
@@ -81,7 +82,7 @@ export default function ColorPicker({ color, onChange, }) {
81
82
  left: huePosition.x,
82
83
  } }) }), _jsx("div", { className: "color-picker-color", style: { backgroundColor: selfColor.hex } })] }));
83
84
  }
84
- function MoveWrapper({ className, style, onChange, children }) {
85
+ function MoveWrapper({ className, style, onChange, children, }) {
85
86
  const divRef = useRef(null);
86
87
  const draggedRef = useRef(false);
87
88
  const move = (e) => {
@@ -108,13 +109,13 @@ function MoveWrapper({ className, style, onChange, children }) {
108
109
  if (draggedRef.current) {
109
110
  skipAddingToHistoryStack = false;
110
111
  }
111
- document.removeEventListener('mousemove', onMouseMove, false);
112
- document.removeEventListener('mouseup', onMouseUp, false);
112
+ document.removeEventListener("mousemove", onMouseMove, false);
113
+ document.removeEventListener("mouseup", onMouseUp, false);
113
114
  move(_e);
114
115
  draggedRef.current = false;
115
116
  };
116
- document.addEventListener('mousemove', onMouseMove, false);
117
- document.addEventListener('mouseup', onMouseUp, false);
117
+ document.addEventListener("mousemove", onMouseMove, false);
118
+ document.addEventListener("mouseup", onMouseUp, false);
118
119
  };
119
120
  return (_jsx("div", { ref: divRef, className: className, style: style, onMouseDown: onMouseDown, children: children }));
120
121
  }
@@ -122,29 +123,29 @@ function clamp(value, max, min) {
122
123
  return value > max ? max : value < min ? min : value;
123
124
  }
124
125
  export function toHex(value) {
125
- if (!value.startsWith('#')) {
126
- const ctx = document.createElement('canvas').getContext('2d');
126
+ if (!value.startsWith("#")) {
127
+ const ctx = document.createElement("canvas").getContext("2d");
127
128
  if (!ctx) {
128
- throw new Error('2d context not supported or canvas already initialized');
129
+ throw new Error("2d context not supported or canvas already initialized");
129
130
  }
130
131
  ctx.fillStyle = value;
131
132
  return ctx.fillStyle;
132
133
  }
133
134
  else if (value.length === 4 || value.length === 5) {
134
135
  value = value
135
- .split('')
136
- .map((v, i) => (i ? v + v : '#'))
137
- .join('');
136
+ .split("")
137
+ .map((v, i) => (i ? v + v : "#"))
138
+ .join("");
138
139
  return value;
139
140
  }
140
141
  else if (value.length === 7 || value.length === 9) {
141
142
  return value;
142
143
  }
143
- return '#000000';
144
+ return "#000000";
144
145
  }
145
146
  function hex2rgb(hex) {
146
147
  const rbgArr = (hex
147
- .replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, (m, r, g, b) => '#' + r + r + g + g + b + b)
148
+ .replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/i, (m, r, g, b) => "#" + r + r + g + g + b + b)
148
149
  .substring(1)
149
150
  .match(/.{2}/g) || []).map((x) => parseInt(x, 16));
150
151
  return {
@@ -185,25 +186,25 @@ function hsv2rgb({ h, s, v }) {
185
186
  return { b, g, r };
186
187
  }
187
188
  function rgb2hex({ b, g, r }) {
188
- return '#' + [r, g, b].map((x) => x.toString(16).padStart(2, '0')).join('');
189
+ return "#" + [r, g, b].map((x) => x.toString(16).padStart(2, "0")).join("");
189
190
  }
190
191
  function transformColor(format, color) {
191
- let hex = toHex('#121212');
192
+ let hex = toHex("#121212");
192
193
  let rgb = hex2rgb(hex);
193
194
  let hsv = rgb2hsv(rgb);
194
- if (format === 'hex') {
195
+ if (format === "hex") {
195
196
  const value = color;
196
197
  hex = toHex(value);
197
198
  rgb = hex2rgb(hex);
198
199
  hsv = rgb2hsv(rgb);
199
200
  }
200
- else if (format === 'rgb') {
201
+ else if (format === "rgb") {
201
202
  const value = color;
202
203
  rgb = value;
203
204
  hex = rgb2hex(rgb);
204
205
  hsv = rgb2hsv(rgb);
205
206
  }
206
- else if (format === 'hsv') {
207
+ else if (format === "hsv") {
207
208
  const value = color;
208
209
  hsv = value;
209
210
  rgb = hsv2rgb(hsv);
@@ -1 +1 @@
1
- {"version":3,"file":"DropDown.d.ts","sourceRoot":"","sources":["../../src/ui/DropDown.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAIjC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,SAAS,EAMV,MAAM,OAAO,CAAC;AAaf,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,SAAS,EACT,OAAO,EACP,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,2CA4BA;AA0FD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC/B,QAAgB,EAChB,WAAW,EACX,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,QAAQ,EACR,oBAAoB,EACpB,WAAW,GACZ,EAAE;IACD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;IACpB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,GAAG,GAAG,CAAC,OAAO,CAmHd"}
1
+ {"version":3,"file":"DropDown.d.ts","sourceRoot":"","sources":["../../src/ui/DropDown.tsx"],"names":[],"mappings":"AACA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAIjC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EACL,SAAS,EAMV,MAAM,OAAO,CAAC;AAaf,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,SAAS,EACT,OAAO,EACP,KAAK,GACN,EAAE;IACD,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,CAAC,KAAK,IAAI,CAAC;IAC9D,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,2CA4BA;AA0FD,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,EAC/B,QAAgB,EAChB,WAAW,EACX,eAAe,EACf,eAAe,EACf,mBAAmB,EACnB,QAAQ,EACR,oBAAoB,EACpB,WAAW,GACZ,EAAE;IACD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,eAAe,EAAE,MAAM,CAAC;IACxB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,SAAS,CAAC;IACpB,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB,GAAG,GAAG,CAAC,OAAO,CAmHd"}
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
3
  import { calculateZoomLevel } from "@lexical/utils";
3
4
  import { isDOMNode } from "lexical";
@@ -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 './FlashMessage.css';
10
- import { ReactNode } from 'react';
8
+ import type { JSX } from "react";
9
+ import "./FlashMessage.css";
10
+ import { ReactNode } from "react";
11
11
  export interface FlashMessageProps {
12
12
  children: ReactNode;
13
13
  }
@@ -1 +1 @@
1
- {"version":3,"file":"FlashMessage.d.ts","sourceRoot":"","sources":["../../src/ui/FlashMessage.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAE/B,OAAO,oBAAoB,CAAC;AAE5B,OAAO,EAAC,SAAS,EAAC,MAAM,OAAO,CAAC;AAGhC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,QAAQ,GACT,EAAE,iBAAiB,GAAG,GAAG,CAAC,OAAO,CASjC"}
1
+ {"version":3,"file":"FlashMessage.d.ts","sourceRoot":"","sources":["../../src/ui/FlashMessage.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,oBAAoB,CAAC;AAE5B,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGlC,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,SAAS,CAAC;CACrB;AAED,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,QAAQ,GACT,EAAE,iBAAiB,GAAG,GAAG,CAAC,OAAO,CASjC"}
@@ -1,6 +1,7 @@
1
+ "use client";
1
2
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import './FlashMessage.css';
3
- import { createPortal } from 'react-dom';
3
+ import "./FlashMessage.css";
4
+ import { createPortal } from "react-dom";
4
5
  export default function FlashMessage({ children, }) {
5
6
  return createPortal(_jsx("div", { className: "FlashMessage__overlay", role: "dialog", children: _jsx("p", { className: "FlashMessage__alert", role: "alert", children: children }) }), document.body);
6
7
  }
@@ -5,8 +5,8 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
- import type { LexicalEditor } from 'lexical';
9
- import type { JSX } from 'react';
8
+ import type { LexicalEditor } from "lexical";
9
+ import type { JSX } from "react";
10
10
  export default function ImageResizer({ onResizeStart, onResizeEnd, buttonRef, imageRef, maxWidth, editor, showCaption, setShowCaption, captionsEnabled, }: {
11
11
  editor: LexicalEditor;
12
12
  buttonRef: {
@@ -16,7 +16,7 @@ export default function ImageResizer({ onResizeStart, onResizeEnd, buttonRef, im
16
16
  current: null | HTMLElement;
17
17
  };
18
18
  maxWidth?: number;
19
- onResizeEnd: (width: 'inherit' | number, height: 'inherit' | number) => void;
19
+ onResizeEnd: (width: "inherit" | number, height: "inherit" | number) => void;
20
20
  onResizeStart: () => void;
21
21
  setShowCaption: (show: boolean) => void;
22
22
  showCaption: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"ImageResizer.d.ts","sourceRoot":"","sources":["../../src/ui/ImageResizer.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAiB/B,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,aAAa,EACb,WAAW,EACX,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,WAAW,EACX,cAAc,EACd,eAAe,GAChB,EAAE;IACD,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,EAAE;QAAC,OAAO,EAAE,IAAI,GAAG,iBAAiB,CAAA;KAAC,CAAC;IAC/C,QAAQ,EAAE;QAAC,OAAO,EAAE,IAAI,GAAG,WAAW,CAAA;KAAC,CAAC;IACxC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,MAAM,KAAK,IAAI,CAAC;IAC7E,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,cAAc,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,WAAW,EAAE,OAAO,CAAC;IACrB,eAAe,EAAE,OAAO,CAAC;CAC1B,GAAG,GAAG,CAAC,OAAO,CA8Qd"}
1
+ {"version":3,"file":"ImageResizer.d.ts","sourceRoot":"","sources":["../../src/ui/ImageResizer.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAiBjC,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,EACnC,aAAa,EACb,WAAW,EACX,SAAS,EACT,QAAQ,EACR,QAAQ,EACR,MAAM,EACN,WAAW,EACX,cAAc,EACd,eAAe,GAChB,EAAE;IACD,MAAM,EAAE,aAAa,CAAC;IACtB,SAAS,EAAE;QAAE,OAAO,EAAE,IAAI,GAAG,iBAAiB,CAAA;KAAE,CAAC;IACjD,QAAQ,EAAE;QAAE,OAAO,EAAE,IAAI,GAAG,WAAW,CAAA;KAAE,CAAC;IAC1C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,MAAM,KAAK,IAAI,CAAC;IAC7E,aAAa,EAAE,MAAM,IAAI,CAAC;IAC1B,cAAc,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;IACxC,WAAW,EAAE,OAAO,CAAC;IACrB,eAAe,EAAE,OAAO,CAAC;CAC1B,GAAG,GAAG,CAAC,OAAO,CA+Qd"}
@@ -1,6 +1,7 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { calculateZoomLevel } from '@lexical/utils';
3
- import { useRef } from 'react';
3
+ import { calculateZoomLevel } from "@lexical/utils";
4
+ import { useRef } from "react";
4
5
  function clamp(value, min, max) {
5
6
  return Math.min(Math.max(value, min), max);
6
7
  }
@@ -13,8 +14,8 @@ const Direction = {
13
14
  export default function ImageResizer({ onResizeStart, onResizeEnd, buttonRef, imageRef, maxWidth, editor, showCaption, setShowCaption, captionsEnabled, }) {
14
15
  const controlWrapperRef = useRef(null);
15
16
  const userSelect = useRef({
16
- priority: '',
17
- value: 'default',
17
+ priority: "",
18
+ value: "default",
18
19
  });
19
20
  const positioningRef = useRef({
20
21
  currentHeight: 0,
@@ -44,24 +45,24 @@ export default function ImageResizer({ onResizeStart, onResizeEnd, buttonRef, im
44
45
  const ns = direction === Direction.north || direction === Direction.south;
45
46
  const nwse = (direction & Direction.north && direction & Direction.west) ||
46
47
  (direction & Direction.south && direction & Direction.east);
47
- const cursorDir = ew ? 'ew' : ns ? 'ns' : nwse ? 'nwse' : 'nesw';
48
+ const cursorDir = ew ? "ew" : ns ? "ns" : nwse ? "nwse" : "nesw";
48
49
  if (editorRootElement !== null) {
49
- editorRootElement.style.setProperty('cursor', `${cursorDir}-resize`, 'important');
50
+ editorRootElement.style.setProperty("cursor", `${cursorDir}-resize`, "important");
50
51
  }
51
52
  if (document.body !== null) {
52
- document.body.style.setProperty('cursor', `${cursorDir}-resize`, 'important');
53
- userSelect.current.value = document.body.style.getPropertyValue('-webkit-user-select');
54
- userSelect.current.priority = document.body.style.getPropertyPriority('-webkit-user-select');
55
- document.body.style.setProperty('-webkit-user-select', `none`, 'important');
53
+ document.body.style.setProperty("cursor", `${cursorDir}-resize`, "important");
54
+ userSelect.current.value = document.body.style.getPropertyValue("-webkit-user-select");
55
+ userSelect.current.priority = document.body.style.getPropertyPriority("-webkit-user-select");
56
+ document.body.style.setProperty("-webkit-user-select", `none`, "important");
56
57
  }
57
58
  };
58
59
  const setEndCursor = () => {
59
60
  if (editorRootElement !== null) {
60
- editorRootElement.style.setProperty('cursor', 'text');
61
+ editorRootElement.style.setProperty("cursor", "text");
61
62
  }
62
63
  if (document.body !== null) {
63
- document.body.style.setProperty('cursor', 'default');
64
- document.body.style.setProperty('-webkit-user-select', userSelect.current.value, userSelect.current.priority);
64
+ document.body.style.setProperty("cursor", "default");
65
+ document.body.style.setProperty("-webkit-user-select", userSelect.current.value, userSelect.current.priority);
65
66
  }
66
67
  };
67
68
  const handlePointerDown = (event, direction) => {
@@ -86,11 +87,11 @@ export default function ImageResizer({ onResizeStart, onResizeEnd, buttonRef, im
86
87
  positioning.direction = direction;
87
88
  setStartCursor(direction);
88
89
  onResizeStart();
89
- controlWrapper.classList.add('image-control-wrapper--resizing');
90
+ controlWrapper.classList.add("image-control-wrapper--resizing");
90
91
  image.style.height = `${height}px`;
91
92
  image.style.width = `${width}px`;
92
- document.addEventListener('pointermove', handlePointerMove);
93
- document.addEventListener('pointerup', handlePointerUp);
93
+ document.addEventListener("pointermove", handlePointerMove);
94
+ document.addEventListener("pointerup", handlePointerUp);
94
95
  }
95
96
  };
96
97
  const handlePointerMove = (event) => {
@@ -142,11 +143,11 @@ export default function ImageResizer({ onResizeStart, onResizeEnd, buttonRef, im
142
143
  positioning.currentWidth = 0;
143
144
  positioning.currentHeight = 0;
144
145
  positioning.isResizing = false;
145
- controlWrapper.classList.remove('image-control-wrapper--resizing');
146
+ controlWrapper.classList.remove("image-control-wrapper--resizing");
146
147
  setEndCursor();
147
148
  onResizeEnd(width, height);
148
- document.removeEventListener('pointermove', handlePointerMove);
149
- document.removeEventListener('pointerup', handlePointerUp);
149
+ document.removeEventListener("pointermove", handlePointerMove);
150
+ document.removeEventListener("pointerup", handlePointerUp);
150
151
  }
151
152
  };
152
153
  return (_jsxs("div", { ref: controlWrapperRef, children: [!showCaption && captionsEnabled && (_jsx("button", { className: "image-caption-button", ref: buttonRef, onClick: () => {
@@ -27,7 +27,7 @@
27
27
 
28
28
  .KatexEquationAlterer_centerRow {
29
29
  display: flex;
30
- flex-direction: 'row';
30
+ flex-direction: "row";
31
31
  margin-top: 10px;
32
32
  margin-bottom: 10px;
33
33
  justify-content: center;
@@ -38,4 +38,6 @@
38
38
  width: 100%;
39
39
  resize: none;
40
40
  padding: 7px;
41
+ border: 1px solid;
42
+ border-color: black;
41
43
  }
@@ -1 +1 @@
1
- {"version":3,"file":"KatexEquationAlterer.d.ts","sourceRoot":"","sources":["../../src/ui/KatexEquationAlterer.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,4BAA4B,CAAC;AASpC,KAAK,KAAK,GAAG;IACX,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CACxD,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,EAC3C,SAAS,EACT,eAAoB,GACrB,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAyDrB"}
1
+ {"version":3,"file":"KatexEquationAlterer.d.ts","sourceRoot":"","sources":["../../src/ui/KatexEquationAlterer.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,4BAA4B,CAAC;AASpC,KAAK,KAAK,GAAG;IACX,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI,CAAC;CACxD,CAAC;AAEF,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,EAC3C,SAAS,EACT,eAAoB,GACrB,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAyDrB"}
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
3
  import "./KatexEquationAlterer.css";
3
4
  import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
@@ -1 +1 @@
1
- {"version":3,"file":"KatexRenderer.d.ts","sourceRoot":"","sources":["../../src/ui/KatexRenderer.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAKjC,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,QAAQ,EACR,MAAM,EACN,aAAa,GACd,EAAE,QAAQ,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC,GAAG,GAAG,CAAC,OAAO,CA2Cf"}
1
+ {"version":3,"file":"KatexRenderer.d.ts","sourceRoot":"","sources":["../../src/ui/KatexRenderer.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAKjC,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EACpC,QAAQ,EACR,MAAM,EACN,aAAa,GACd,EAAE,QAAQ,CAAC;IACV,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,aAAa,EAAE,MAAM,IAAI,CAAC;CAC3B,CAAC,GAAG,GAAG,CAAC,OAAO,CA2Cf"}
@@ -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
  import katex from "katex";
3
4
  import { useEffect, useRef } from "react";
@@ -1 +1 @@
1
- {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../src/ui/Modal.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,aAAa,CAAC;AAGrB,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AA4ErD,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAC5B,OAAO,EACP,QAAQ,EACR,KAAK,EACL,mBAA2B,GAC5B,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,GAAG,CAAC,OAAO,CAWd"}
1
+ {"version":3,"file":"Modal.d.ts","sourceRoot":"","sources":["../../src/ui/Modal.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,aAAa,CAAC;AAGrB,OAAO,EAAE,SAAS,EAAqB,MAAM,OAAO,CAAC;AA4ErD,MAAM,CAAC,OAAO,UAAU,KAAK,CAAC,EAC5B,OAAO,EACP,QAAQ,EACR,KAAK,EACL,mBAA2B,GAC5B,EAAE;IACD,QAAQ,EAAE,SAAS,CAAC;IACpB,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf,GAAG,GAAG,CAAC,OAAO,CAWd"}
package/build/ui/Modal.js CHANGED
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import "./Modal.css";
3
4
  import { isDOMNode } from "lexical";
@@ -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 * as React from 'react';
8
+ import type { JSX } from "react";
9
+ import * as React from "react";
10
10
  export default function Switch({ checked, onClick, text, id, }: Readonly<{
11
11
  checked: boolean;
12
12
  id?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../src/ui/Switch.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAC,GAAG,EAAC,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,OAAO,EACP,OAAO,EACP,IAAI,EACJ,EAAE,GACH,EAAE,QAAQ,CAAC;IACV,OAAO,EAAE,OAAO,CAAC;IACjB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IACtE,IAAI,EAAE,MAAM,CAAC;CACd,CAAC,GAAG,GAAG,CAAC,OAAO,CAcf"}
1
+ {"version":3,"file":"Switch.d.ts","sourceRoot":"","sources":["../../src/ui/Switch.tsx"],"names":[],"mappings":"AACA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,EAC7B,OAAO,EACP,OAAO,EACP,IAAI,EACJ,EAAE,GACH,EAAE,QAAQ,CAAC;IACV,OAAO,EAAE,OAAO,CAAC;IACjB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,CAAC,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,iBAAiB,EAAE,UAAU,CAAC,KAAK,IAAI,CAAC;IACtE,IAAI,EAAE,MAAM,CAAC;CACd,CAAC,GAAG,GAAG,CAAC,OAAO,CAef"}
@@ -1,6 +1,7 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useMemo } from 'react';
3
+ import { useMemo } from "react";
3
4
  export default function Switch({ checked, onClick, text, id, }) {
4
- const buttonId = useMemo(() => 'id_' + Math.floor(Math.random() * 10000), []);
5
+ const buttonId = useMemo(() => "id_" + Math.floor(Math.random() * 10000), []);
5
6
  return (_jsxs("div", { className: "switch", id: id, children: [_jsx("label", { htmlFor: buttonId, children: text }), _jsx("button", { role: "switch", "aria-checked": checked, id: buttonId, onClick: onClick, children: _jsx("span", {}) })] }));
6
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../src/ui/TextInput.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAE/C,KAAK,KAAK,GAAG,QAAQ,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,sBAAsB,CAAC;CAC/B,CAAC,CAAC;AAEH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,KAAK,EACL,KAAK,EACL,QAAQ,EACR,WAAgB,EAChB,cAAc,EAAE,UAAU,EAC1B,IAAa,GACd,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAgBrB"}
1
+ {"version":3,"file":"TextInput.d.ts","sourceRoot":"","sources":["../../src/ui/TextInput.tsx"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,sBAAsB,EAAE,MAAM,OAAO,CAAC;AAE/C,KAAK,KAAK,GAAG,QAAQ,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,sBAAsB,CAAC;CAC/B,CAAC,CAAC;AAEH,MAAM,CAAC,OAAO,UAAU,SAAS,CAAC,EAChC,KAAK,EACL,KAAK,EACL,QAAQ,EACR,WAAgB,EAChB,cAAc,EAAE,UAAU,EAC1B,IAAa,GACd,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAgBrB"}
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import "./Input.css";
3
4
  export default function TextInput({ label, value, onChange, placeholder = "", "data-test-id": dataTestId, type = "text", }) {
@@ -0,0 +1,22 @@
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 { ElementFormatType, NodeKey } from "lexical";
9
+ import type { JSX } from "react";
10
+ import { ReactNode } from "react";
11
+ type Props = Readonly<{
12
+ children: ReactNode;
13
+ format?: ElementFormatType | null;
14
+ nodeKey: NodeKey;
15
+ className: Readonly<{
16
+ base: string;
17
+ focus: string;
18
+ }>;
19
+ }>;
20
+ export declare function ServerBlockWithAlignableContents({ children, format, nodeKey, className, }: Props): JSX.Element;
21
+ export {};
22
+ //# sourceMappingURL=ServerBlockWithAlignableContents.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ServerBlockWithAlignableContents.d.ts","sourceRoot":"","sources":["../../src/utils/ServerBlockWithAlignableContents.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,KAAK,KAAK,GAAG,QAAQ,CAAC;IACpB,QAAQ,EAAE,SAAS,CAAC;IACpB,MAAM,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAAC;IAClC,OAAO,EAAE,OAAO,CAAC;IACjB,SAAS,EAAE,QAAQ,CAAC;QAClB,IAAI,EAAE,MAAM,CAAC;QACb,KAAK,EAAE,MAAM,CAAC;KACf,CAAC,CAAC;CACJ,CAAC,CAAC;AAEH,wBAAgB,gCAAgC,CAAC,EAC/C,QAAQ,EACR,MAAM,EACN,OAAO,EACP,SAAS,GACV,EAAE,KAAK,GAAG,GAAG,CAAC,OAAO,CAWrB"}
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ export function ServerBlockWithAlignableContents({ children, format, nodeKey, className, }) {
3
+ return (_jsx("div", { className: [className.base].filter(Boolean).join(" "), style: {
4
+ textAlign: format ? format : undefined,
5
+ }, children: children }));
6
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"focusUtils.d.ts","sourceRoot":"","sources":["../../src/utils/focusUtils.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,4BAA4B,GACvC,cAAc,WAAW,KACxB,WAAW,GAAG,IAShB,CAAC;AAEF,eAAO,MAAM,sBAAsB,GACjC,cAAc,WAAW,KACxB,WAAW,GAAG,IAIhB,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,OAAO,UAAU,GAAG,YAAY,GAAG,KAAK,CAAC,UAAU,KAClD,OAMF,CAAC"}
1
+ {"version":3,"file":"focusUtils.d.ts","sourceRoot":"","sources":["../../src/utils/focusUtils.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AAEH,eAAO,MAAM,4BAA4B,GACvC,cAAc,WAAW,KACxB,WAAW,GAAG,IAShB,CAAC;AAEF,eAAO,MAAM,sBAAsB,GACjC,cAAc,WAAW,KACxB,WAAW,GAAG,IAIhB,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,OAAO,UAAU,GAAG,YAAY,GAAG,KAAK,CAAC,UAAU,KAClD,OAMF,CAAC"}
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  /**
2
3
  * Copyright (c) Meta Platforms, Inc. and affiliates.
3
4
  *
@@ -6,7 +7,7 @@
6
7
  *
7
8
  */
8
9
  export const findFirstFocusableDescendant = (startElement) => {
9
- const focusableSelector = 'button, a[href], input, select, textarea, details, summary [tabindex], [contenteditable]';
10
+ const focusableSelector = "button, a[href], input, select, textarea, details, summary [tabindex], [contenteditable]";
10
11
  const focusableDescendants = startElement.querySelector(focusableSelector);
11
12
  return focusableDescendants;
12
13
  };
@@ -16,8 +17,8 @@ export const focusNearestDescendant = (startElement) => {
16
17
  return el;
17
18
  };
18
19
  export const isKeyboardInput = (event) => {
19
- if ('pointerId' in event && 'pointerType' in event) {
20
- return event.pointerId === -1 && event.pointerType === '';
20
+ if ("pointerId" in event && "pointerType" in event) {
21
+ return event.pointerId === -1 && event.pointerType === "";
21
22
  }
22
23
  return (event === null || event === void 0 ? void 0 : event.detail) === 0;
23
24
  };
@@ -1 +1 @@
1
- {"version":3,"file":"getDOMRangeRect.d.ts","sourceRoot":"","sources":["../../src/utils/getDOMRangeRect.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,eAAe,EAAE,SAAS,EAC1B,WAAW,EAAE,WAAW,GACvB,OAAO,CAgBT"}
1
+ {"version":3,"file":"getDOMRangeRect.d.ts","sourceRoot":"","sources":["../../src/utils/getDOMRangeRect.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,wBAAgB,eAAe,CAC7B,eAAe,EAAE,SAAS,EAC1B,WAAW,EAAE,WAAW,GACvB,OAAO,CAgBT"}
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  /**
2
3
  * Copyright (c) Meta Platforms, Inc. and affiliates.
3
4
  *
@@ -1 +1 @@
1
- {"version":3,"file":"setFloatingElemPosition.d.ts","sourceRoot":"","sources":["../../src/utils/setFloatingElemPosition.ts"],"names":[],"mappings":"AAUA,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,OAAO,GAAG,IAAI,EAC1B,YAAY,EAAE,WAAW,EACzB,UAAU,EAAE,WAAW,EACvB,MAAM,GAAE,OAAe,EACvB,WAAW,GAAE,MAAqB,EAClC,gBAAgB,GAAE,MAA0B,GAC3C,IAAI,CAwDN"}
1
+ {"version":3,"file":"setFloatingElemPosition.d.ts","sourceRoot":"","sources":["../../src/utils/setFloatingElemPosition.ts"],"names":[],"mappings":"AAYA,wBAAgB,uBAAuB,CACrC,UAAU,EAAE,OAAO,GAAG,IAAI,EAC1B,YAAY,EAAE,WAAW,EACzB,UAAU,EAAE,WAAW,EACvB,MAAM,GAAE,OAAe,EACvB,WAAW,GAAE,MAAqB,EAClC,gBAAgB,GAAE,MAA0B,GAC3C,IAAI,CAwDN"}
@@ -1,3 +1,4 @@
1
+ "use client";
1
2
  /**
2
3
  * Copyright (c) Meta Platforms, Inc. and affiliates.
3
4
  *
@@ -10,8 +11,8 @@ const HORIZONTAL_OFFSET = 5;
10
11
  export function setFloatingElemPosition(targetRect, floatingElem, anchorElem, isLink = false, verticalGap = VERTICAL_GAP, horizontalOffset = HORIZONTAL_OFFSET) {
11
12
  const scrollerElem = anchorElem.parentElement;
12
13
  if (targetRect === null || !scrollerElem) {
13
- floatingElem.style.opacity = '0';
14
- floatingElem.style.transform = 'translate(-10000px, -10000px)';
14
+ floatingElem.style.opacity = "0";
15
+ floatingElem.style.transform = "translate(-10000px, -10000px)";
15
16
  return;
16
17
  }
17
18
  const floatingElemRect = floatingElem.getBoundingClientRect();
@@ -29,7 +30,7 @@ export function setFloatingElemPosition(targetRect, floatingElem, anchorElem, is
29
30
  ? textNode
30
31
  : textNode.parentElement;
31
32
  const textAlign = window.getComputedStyle(textElement).textAlign;
32
- if (textAlign === 'right' || textAlign === 'end') {
33
+ if (textAlign === "right" || textAlign === "end") {
33
34
  // For end-aligned text, position the toolbar relative to the text end
34
35
  left = targetRect.right - floatingElemRect.width + horizontalOffset;
35
36
  }
@@ -50,6 +51,6 @@ export function setFloatingElemPosition(targetRect, floatingElem, anchorElem, is
50
51
  }
51
52
  top -= anchorElementRect.top;
52
53
  left -= anchorElementRect.left;
53
- floatingElem.style.opacity = '1';
54
+ floatingElem.style.opacity = "1";
54
55
  floatingElem.style.transform = `translate(${left}px, ${top}px)`;
55
56
  }
@@ -1,10 +1,3 @@
1
- /**
2
- * Copyright (c) Meta Platforms, Inc. and affiliates.
3
- *
4
- * This source code is licensed under the MIT license found in the
5
- * LICENSE file in the root directory of this source tree.
6
- *
7
- */
8
1
  export declare function addSwipeLeftListener(element: HTMLElement, cb: (_force: number, e: TouchEvent) => void): () => void;
9
2
  export declare function addSwipeRightListener(element: HTMLElement, cb: (_force: number, e: TouchEvent) => void): () => void;
10
3
  export declare function addSwipeUpListener(element: HTMLElement, cb: (_force: number, e: TouchEvent) => void): () => void;
@@ -1 +1 @@
1
- {"version":3,"file":"swipe.d.ts","sourceRoot":"","sources":["../../src/utils/swipe.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA0EH,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,KAAK,IAAI,SAvDmB,IAAI,CA+DnE;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,KAAK,IAAI,SAnEmB,IAAI,CA2EnE;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,KAAK,IAAI,SA/EmB,IAAI,CAuFnE;AAED,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,KAAK,IAAI,SA3FmB,IAAI,CAmGnE"}
1
+ {"version":3,"file":"swipe.d.ts","sourceRoot":"","sources":["../../src/utils/swipe.ts"],"names":[],"mappings":"AAkFA,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,KAAK,IAAI,SAvDmB,IAAI,CA+DnE;AAED,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,KAAK,IAAI,SAnEmB,IAAI,CA2EnE;AAED,wBAAgB,kBAAkB,CAChC,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,KAAK,IAAI,SA/EmB,IAAI,CAuFnE;AAED,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,WAAW,EACpB,EAAE,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,UAAU,KAAK,IAAI,SA3FmB,IAAI,CAmGnE"}