@datalayer/lexical-loro 0.2.5 → 1.0.1

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 (399) hide show
  1. package/package.json +1 -1
  2. package/lib/App.d.ts +0 -2
  3. package/lib/App.js +0 -141
  4. package/lib/Editor.d.ts +0 -2
  5. package/lib/Editor.js +0 -115
  6. package/lib/Settings.d.ts +0 -2
  7. package/lib/Settings.js +0 -57
  8. package/lib/appSettings.d.ts +0 -36
  9. package/lib/appSettings.js +0 -48
  10. package/lib/collab/loro/Bindings.d.ts +0 -41
  11. package/lib/collab/loro/Bindings.js +0 -99
  12. package/lib/collab/loro/Debug.d.ts +0 -33
  13. package/lib/collab/loro/Debug.js +0 -452
  14. package/lib/collab/loro/LexicalCollaborationContext.d.ts +0 -19
  15. package/lib/collab/loro/LexicalCollaborationContext.js +0 -52
  16. package/lib/collab/loro/LexicalCollaborationPlugin.d.ts +0 -24
  17. package/lib/collab/loro/LexicalCollaborationPlugin.js +0 -83
  18. package/lib/collab/loro/State.d.ts +0 -53
  19. package/lib/collab/loro/State.js +0 -94
  20. package/lib/collab/loro/components/LoroCollaborationUI.d.ts +0 -13
  21. package/lib/collab/loro/components/LoroCollaborationUI.js +0 -9
  22. package/lib/collab/loro/components/LoroCollaborators.d.ts +0 -8
  23. package/lib/collab/loro/components/LoroCollaborators.js +0 -102
  24. package/lib/collab/loro/components/index.d.ts +0 -2
  25. package/lib/collab/loro/components/index.js +0 -6
  26. package/lib/collab/loro/index.d.ts +0 -6
  27. package/lib/collab/loro/index.js +0 -10
  28. package/lib/collab/loro/integrators/BaseIntegrator.d.ts +0 -14
  29. package/lib/collab/loro/integrators/BaseIntegrator.js +0 -5
  30. package/lib/collab/loro/integrators/CounterIntegrator.d.ts +0 -23
  31. package/lib/collab/loro/integrators/CounterIntegrator.js +0 -44
  32. package/lib/collab/loro/integrators/ListIntegrator.d.ts +0 -23
  33. package/lib/collab/loro/integrators/ListIntegrator.js +0 -53
  34. package/lib/collab/loro/integrators/MapIntegrator.d.ts +0 -24
  35. package/lib/collab/loro/integrators/MapIntegrator.js +0 -235
  36. package/lib/collab/loro/integrators/TextIntegrator.d.ts +0 -25
  37. package/lib/collab/loro/integrators/TextIntegrator.js +0 -55
  38. package/lib/collab/loro/integrators/TreeIntegrator.d.ts +0 -36
  39. package/lib/collab/loro/integrators/TreeIntegrator.js +0 -251
  40. package/lib/collab/loro/nodes/NodeFactory.d.ts +0 -15
  41. package/lib/collab/loro/nodes/NodeFactory.js +0 -101
  42. package/lib/collab/loro/nodes/NodesMapper.d.ts +0 -120
  43. package/lib/collab/loro/nodes/NodesMapper.js +0 -277
  44. package/lib/collab/loro/propagators/DecoratorNodePropagator.d.ts +0 -60
  45. package/lib/collab/loro/propagators/DecoratorNodePropagator.js +0 -306
  46. package/lib/collab/loro/propagators/ElementNodePropagator.d.ts +0 -62
  47. package/lib/collab/loro/propagators/ElementNodePropagator.js +0 -326
  48. package/lib/collab/loro/propagators/LineBreakNodePropagator.d.ts +0 -57
  49. package/lib/collab/loro/propagators/LineBreakNodePropagator.js +0 -200
  50. package/lib/collab/loro/propagators/RootNodePropagator.d.ts +0 -55
  51. package/lib/collab/loro/propagators/RootNodePropagator.js +0 -174
  52. package/lib/collab/loro/propagators/TextNodePropagator.d.ts +0 -60
  53. package/lib/collab/loro/propagators/TextNodePropagator.js +0 -440
  54. package/lib/collab/loro/propagators/index.d.ts +0 -49
  55. package/lib/collab/loro/propagators/index.js +0 -30
  56. package/lib/collab/loro/provider/websocket.d.ts +0 -116
  57. package/lib/collab/loro/provider/websocket.js +0 -911
  58. package/lib/collab/loro/servers/index.d.ts +0 -0
  59. package/lib/collab/loro/servers/index.js +0 -4
  60. package/lib/collab/loro/servers/ws/callback.d.ts +0 -5
  61. package/lib/collab/loro/servers/ws/callback.js +0 -89
  62. package/lib/collab/loro/servers/ws/server.d.ts +0 -2
  63. package/lib/collab/loro/servers/ws/server.js +0 -29
  64. package/lib/collab/loro/servers/ws/utils.d.ts +0 -40
  65. package/lib/collab/loro/servers/ws/utils.js +0 -517
  66. package/lib/collab/loro/sync/SyncCursors.d.ts +0 -32
  67. package/lib/collab/loro/sync/SyncCursors.js +0 -475
  68. package/lib/collab/loro/sync/SyncLexicalToLoro.d.ts +0 -4
  69. package/lib/collab/loro/sync/SyncLexicalToLoro.js +0 -113
  70. package/lib/collab/loro/sync/SyncLoroToLexical.d.ts +0 -5
  71. package/lib/collab/loro/sync/SyncLoroToLexical.js +0 -100
  72. package/lib/collab/loro/types/LexicalNodeData.d.ts +0 -32
  73. package/lib/collab/loro/types/LexicalNodeData.js +0 -75
  74. package/lib/collab/loro/useCollaboration.d.ts +0 -12
  75. package/lib/collab/loro/useCollaboration.js +0 -260
  76. package/lib/collab/loro/utils/InitialContent.d.ts +0 -64
  77. package/lib/collab/loro/utils/InitialContent.js +0 -113
  78. package/lib/collab/loro/utils/LexicalToLoro.d.ts +0 -18
  79. package/lib/collab/loro/utils/LexicalToLoro.js +0 -100
  80. package/lib/collab/loro/utils/Utils.d.ts +0 -44
  81. package/lib/collab/loro/utils/Utils.js +0 -157
  82. package/lib/collab/loro/wsProvider.d.ts +0 -8
  83. package/lib/collab/loro/wsProvider.js +0 -35
  84. package/lib/collab/utils/invariant.d.ts +0 -1
  85. package/lib/collab/utils/invariant.js +0 -15
  86. package/lib/collab/utils/simpleDiffWithCursor.d.ts +0 -5
  87. package/lib/collab/utils/simpleDiffWithCursor.js +0 -35
  88. package/lib/collab/yjs/Bindings.d.ts +0 -23
  89. package/lib/collab/yjs/Bindings.js +0 -26
  90. package/lib/collab/yjs/Debug.d.ts +0 -23
  91. package/lib/collab/yjs/Debug.js +0 -213
  92. package/lib/collab/yjs/LexicalCollaborationContext.d.ts +0 -10
  93. package/lib/collab/yjs/LexicalCollaborationContext.js +0 -37
  94. package/lib/collab/yjs/LexicalCollaborationPlugin.d.ts +0 -21
  95. package/lib/collab/yjs/LexicalCollaborationPlugin.js +0 -63
  96. package/lib/collab/yjs/State.d.ts +0 -51
  97. package/lib/collab/yjs/State.js +0 -35
  98. package/lib/collab/yjs/nodes/AnyCollabNode.d.ts +0 -5
  99. package/lib/collab/yjs/nodes/AnyCollabNode.js +0 -1
  100. package/lib/collab/yjs/nodes/CollabDecoratorNode.d.ts +0 -22
  101. package/lib/collab/yjs/nodes/CollabDecoratorNode.js +0 -64
  102. package/lib/collab/yjs/nodes/CollabElementNode.d.ts +0 -40
  103. package/lib/collab/yjs/nodes/CollabElementNode.js +0 -462
  104. package/lib/collab/yjs/nodes/CollabLineBreakNode.d.ts +0 -19
  105. package/lib/collab/yjs/nodes/CollabLineBreakNode.js +0 -44
  106. package/lib/collab/yjs/nodes/CollabTextNode.d.ts +0 -25
  107. package/lib/collab/yjs/nodes/CollabTextNode.js +0 -103
  108. package/lib/collab/yjs/provider/websocket.d.ts +0 -88
  109. package/lib/collab/yjs/provider/websocket.js +0 -415
  110. package/lib/collab/yjs/servers/index.d.ts +0 -0
  111. package/lib/collab/yjs/servers/index.js +0 -0
  112. package/lib/collab/yjs/servers/ws/callback.d.ts +0 -5
  113. package/lib/collab/yjs/servers/ws/callback.js +0 -72
  114. package/lib/collab/yjs/servers/ws/server.d.ts +0 -2
  115. package/lib/collab/yjs/servers/ws/server.js +0 -25
  116. package/lib/collab/yjs/servers/ws/utils.d.ts +0 -49
  117. package/lib/collab/yjs/servers/ws/utils.js +0 -284
  118. package/lib/collab/yjs/sync/SyncCursors.d.ts +0 -39
  119. package/lib/collab/yjs/sync/SyncCursors.js +0 -351
  120. package/lib/collab/yjs/sync/SyncEditorStates.d.ts +0 -10
  121. package/lib/collab/yjs/sync/SyncEditorStates.js +0 -200
  122. package/lib/collab/yjs/useCollaboration.d.ts +0 -12
  123. package/lib/collab/yjs/useCollaboration.js +0 -255
  124. package/lib/collab/yjs/utils/Utils.d.ts +0 -25
  125. package/lib/collab/yjs/utils/Utils.js +0 -402
  126. package/lib/collab/yjs/wsProvider.d.ts +0 -3
  127. package/lib/collab/yjs/wsProvider.js +0 -21
  128. package/lib/commenting/index.d.ts +0 -41
  129. package/lib/commenting/index.js +0 -328
  130. package/lib/context/FlashMessageContext.d.ts +0 -7
  131. package/lib/context/FlashMessageContext.js +0 -24
  132. package/lib/context/SettingsContext.d.ts +0 -12
  133. package/lib/context/SettingsContext.js +0 -38
  134. package/lib/context/SharedHistoryContext.d.ts +0 -11
  135. package/lib/context/SharedHistoryContext.js +0 -11
  136. package/lib/context/ToolbarContext.d.ts +0 -65
  137. package/lib/context/ToolbarContext.js +0 -84
  138. package/lib/demo.d.ts +0 -12
  139. package/lib/demo.js +0 -45
  140. package/lib/hooks/useFlashMessage.d.ts +0 -2
  141. package/lib/hooks/useFlashMessage.js +0 -8
  142. package/lib/hooks/useModal.d.ts +0 -5
  143. package/lib/hooks/useModal.js +0 -26
  144. package/lib/hooks/useReport.d.ts +0 -1
  145. package/lib/hooks/useReport.js +0 -50
  146. package/lib/index.d.ts +0 -1
  147. package/lib/index.js +0 -5
  148. package/lib/nodes/AutocompleteNode.d.ts +0 -27
  149. package/lib/nodes/AutocompleteNode.js +0 -60
  150. package/lib/nodes/CounterComponent.d.ts +0 -6
  151. package/lib/nodes/CounterComponent.js +0 -137
  152. package/lib/nodes/CounterNode.d.ts +0 -23
  153. package/lib/nodes/CounterNode.js +0 -47
  154. package/lib/nodes/DateTimeNode/DateTimeComponent.d.ts +0 -8
  155. package/lib/nodes/DateTimeNode/DateTimeComponent.js +0 -119
  156. package/lib/nodes/DateTimeNode/DateTimeNode.d.ts +0 -27
  157. package/lib/nodes/DateTimeNode/DateTimeNode.js +0 -82
  158. package/lib/nodes/EmojiNode.d.ts +0 -18
  159. package/lib/nodes/EmojiNode.js +0 -54
  160. package/lib/nodes/EquationComponent.d.ts +0 -9
  161. package/lib/nodes/EquationComponent.js +0 -75
  162. package/lib/nodes/EquationNode.d.ts +0 -26
  163. package/lib/nodes/EquationNode.js +0 -109
  164. package/lib/nodes/ExcalidrawNode/ExcalidrawComponent.d.ts +0 -8
  165. package/lib/nodes/ExcalidrawNode/ExcalidrawComponent.js +0 -110
  166. package/lib/nodes/ExcalidrawNode/ExcalidrawImage.d.ts +0 -50
  167. package/lib/nodes/ExcalidrawNode/ExcalidrawImage.js +0 -55
  168. package/lib/nodes/ExcalidrawNode/index.d.ts +0 -32
  169. package/lib/nodes/ExcalidrawNode/index.js +0 -117
  170. package/lib/nodes/FigmaNode.d.ts +0 -20
  171. package/lib/nodes/FigmaNode.js +0 -52
  172. package/lib/nodes/ImageComponent.d.ts +0 -16
  173. package/lib/nodes/ImageComponent.js +0 -272
  174. package/lib/nodes/ImageNode.d.ts +0 -50
  175. package/lib/nodes/ImageNode.js +0 -151
  176. package/lib/nodes/InlineImageNode/InlineImageComponent.d.ts +0 -26
  177. package/lib/nodes/InlineImageNode/InlineImageComponent.js +0 -161
  178. package/lib/nodes/InlineImageNode/InlineImageNode.d.ts +0 -59
  179. package/lib/nodes/InlineImageNode/InlineImageNode.js +0 -162
  180. package/lib/nodes/KeywordNode.d.ts +0 -14
  181. package/lib/nodes/KeywordNode.js +0 -37
  182. package/lib/nodes/LayoutContainerNode.d.ts +0 -24
  183. package/lib/nodes/LayoutContainerNode.js +0 -95
  184. package/lib/nodes/LayoutItemNode.d.ts +0 -16
  185. package/lib/nodes/LayoutItemNode.js +0 -69
  186. package/lib/nodes/MentionNode.d.ts +0 -20
  187. package/lib/nodes/MentionNode.js +0 -85
  188. package/lib/nodes/PageBreakNode/index.d.ts +0 -17
  189. package/lib/nodes/PageBreakNode/index.js +0 -83
  190. package/lib/nodes/PlaygroundNodes.d.ts +0 -3
  191. package/lib/nodes/PlaygroundNodes.js +0 -75
  192. package/lib/nodes/PollComponent.d.ts +0 -9
  193. package/lib/nodes/PollComponent.js +0 -85
  194. package/lib/nodes/PollNode.d.ts +0 -43
  195. package/lib/nodes/PollNode.js +0 -153
  196. package/lib/nodes/SpecialTextNode.d.ts +0 -24
  197. package/lib/nodes/SpecialTextNode.js +0 -54
  198. package/lib/nodes/StickyComponent.d.ts +0 -10
  199. package/lib/nodes/StickyComponent.js +0 -162
  200. package/lib/nodes/StickyNode.d.ts +0 -31
  201. package/lib/nodes/StickyNode.js +0 -76
  202. package/lib/nodes/TweetNode.d.ts +0 -21
  203. package/lib/nodes/TweetNode.js +0 -119
  204. package/lib/nodes/YouTubeNode.d.ts +0 -22
  205. package/lib/nodes/YouTubeNode.js +0 -84
  206. package/lib/plugins/ActionsPlugin/index.d.ts +0 -5
  207. package/lib/plugins/ActionsPlugin/index.js +0 -168
  208. package/lib/plugins/AutoEmbedPlugin/index.d.ts +0 -19
  209. package/lib/plugins/AutoEmbedPlugin/index.js +0 -158
  210. package/lib/plugins/AutoLinkPlugin/index.d.ts +0 -2
  211. package/lib/plugins/AutoLinkPlugin/index.js +0 -15
  212. package/lib/plugins/AutocompletePlugin/index.d.ts +0 -10
  213. package/lib/plugins/AutocompletePlugin/index.js +0 -2477
  214. package/lib/plugins/CodeActionMenuPlugin/components/CopyButton/index.d.ts +0 -7
  215. package/lib/plugins/CodeActionMenuPlugin/components/CopyButton/index.js +0 -46
  216. package/lib/plugins/CodeActionMenuPlugin/components/PrettierButton/index.d.ts +0 -17
  217. package/lib/plugins/CodeActionMenuPlugin/components/PrettierButton/index.js +0 -115
  218. package/lib/plugins/CodeActionMenuPlugin/index.d.ts +0 -5
  219. package/lib/plugins/CodeActionMenuPlugin/index.js +0 -104
  220. package/lib/plugins/CodeActionMenuPlugin/utils.d.ts +0 -1
  221. package/lib/plugins/CodeActionMenuPlugin/utils.js +0 -22
  222. package/lib/plugins/CodeHighlightPrismPlugin/index.d.ts +0 -2
  223. package/lib/plugins/CodeHighlightPrismPlugin/index.js +0 -14
  224. package/lib/plugins/CodeHighlightShikiPlugin/index.d.ts +0 -2
  225. package/lib/plugins/CodeHighlightShikiPlugin/index.js +0 -14
  226. package/lib/plugins/CollapsiblePlugin/CollapsibleContainerNode.d.ts +0 -25
  227. package/lib/plugins/CollapsiblePlugin/CollapsibleContainerNode.js +0 -135
  228. package/lib/plugins/CollapsiblePlugin/CollapsibleContentNode.d.ts +0 -16
  229. package/lib/plugins/CollapsiblePlugin/CollapsibleContentNode.js +0 -83
  230. package/lib/plugins/CollapsiblePlugin/CollapsibleTitleNode.d.ts +0 -16
  231. package/lib/plugins/CollapsiblePlugin/CollapsibleTitleNode.js +0 -85
  232. package/lib/plugins/CollapsiblePlugin/CollapsibleUtils.d.ts +0 -2
  233. package/lib/plugins/CollapsiblePlugin/CollapsibleUtils.js +0 -12
  234. package/lib/plugins/CollapsiblePlugin/index.d.ts +0 -3
  235. package/lib/plugins/CollapsiblePlugin/index.js +0 -132
  236. package/lib/plugins/CommentPlugin/index.d.ts +0 -9
  237. package/lib/plugins/CommentPlugin/index.js +0 -460
  238. package/lib/plugins/ComponentPickerPlugin/index.d.ts +0 -2
  239. package/lib/plugins/ComponentPickerPlugin/index.js +0 -276
  240. package/lib/plugins/ContextMenuPlugin/index.d.ts +0 -2
  241. package/lib/plugins/ContextMenuPlugin/index.js +0 -112
  242. package/lib/plugins/CounterPlugin/index.d.ts +0 -3
  243. package/lib/plugins/CounterPlugin/index.js +0 -24
  244. package/lib/plugins/DateTimePlugin/index.d.ts +0 -8
  245. package/lib/plugins/DateTimePlugin/index.js +0 -28
  246. package/lib/plugins/DebugPlugin/index.d.ts +0 -3
  247. package/lib/plugins/DebugPlugin/index.js +0 -219
  248. package/lib/plugins/DocsPlugin/index.d.ts +0 -2
  249. package/lib/plugins/DocsPlugin/index.js +0 -4
  250. package/lib/plugins/DragDropPastePlugin/index.d.ts +0 -1
  251. package/lib/plugins/DragDropPastePlugin/index.js +0 -37
  252. package/lib/plugins/DraggableBlockPlugin/index.d.ts +0 -12
  253. package/lib/plugins/DraggableBlockPlugin/index.js +0 -36
  254. package/lib/plugins/EmojiPickerPlugin/index.d.ts +0 -1
  255. package/lib/plugins/EmojiPickerPlugin/index.js +0 -84
  256. package/lib/plugins/EmojisPlugin/index.d.ts +0 -2
  257. package/lib/plugins/EmojisPlugin/index.js +0 -56
  258. package/lib/plugins/EquationsPlugin/index.d.ts +0 -14
  259. package/lib/plugins/EquationsPlugin/index.js +0 -34
  260. package/lib/plugins/ExcalidrawPlugin/index.d.ts +0 -5
  261. package/lib/plugins/ExcalidrawPlugin/index.js +0 -44
  262. package/lib/plugins/FigmaPlugin/index.d.ts +0 -4
  263. package/lib/plugins/FigmaPlugin/index.js +0 -24
  264. package/lib/plugins/FloatingLinkEditorPlugin/index.d.ts +0 -15
  265. package/lib/plugins/FloatingLinkEditorPlugin/index.js +0 -280
  266. package/lib/plugins/FloatingTextFormatToolbarPlugin/index.d.ts +0 -7
  267. package/lib/plugins/FloatingTextFormatToolbarPlugin/index.js +0 -219
  268. package/lib/plugins/ImagesPlugin/index.d.ts +0 -24
  269. package/lib/plugins/ImagesPlugin/index.js +0 -195
  270. package/lib/plugins/InlineImagePlugin/index.d.ts +0 -17
  271. package/lib/plugins/InlineImagePlugin/index.js +0 -180
  272. package/lib/plugins/KeywordsPlugin/index.d.ts +0 -2
  273. package/lib/plugins/KeywordsPlugin/index.js +0 -35
  274. package/lib/plugins/LayoutPlugin/InsertLayoutDialog.d.ts +0 -6
  275. package/lib/plugins/LayoutPlugin/InsertLayoutDialog.js +0 -21
  276. package/lib/plugins/LayoutPlugin/LayoutPlugin.d.ts +0 -7
  277. package/lib/plugins/LayoutPlugin/LayoutPlugin.js +0 -135
  278. package/lib/plugins/LinkPlugin/index.d.ts +0 -6
  279. package/lib/plugins/LinkPlugin/index.js +0 -11
  280. package/lib/plugins/MarkdownShortcutPlugin/index.d.ts +0 -2
  281. package/lib/plugins/MarkdownShortcutPlugin/index.js +0 -6
  282. package/lib/plugins/MarkdownTransformers/index.d.ts +0 -8
  283. package/lib/plugins/MarkdownTransformers/index.js +0 -238
  284. package/lib/plugins/MaxLengthPlugin/index.d.ts +0 -3
  285. package/lib/plugins/MaxLengthPlugin/index.js +0 -41
  286. package/lib/plugins/MentionsPlugin/index.d.ts +0 -2
  287. package/lib/plugins/MentionsPlugin/index.js +0 -564
  288. package/lib/plugins/PageBreakPlugin/index.d.ts +0 -4
  289. package/lib/plugins/PageBreakPlugin/index.js +0 -31
  290. package/lib/plugins/PasteLogPlugin/index.d.ts +0 -2
  291. package/lib/plugins/PasteLogPlugin/index.js +0 -27
  292. package/lib/plugins/PollPlugin/index.d.ts +0 -8
  293. package/lib/plugins/PollPlugin/index.js +0 -38
  294. package/lib/plugins/ShortcutsPlugin/index.d.ts +0 -6
  295. package/lib/plugins/ShortcutsPlugin/index.js +0 -116
  296. package/lib/plugins/ShortcutsPlugin/shortcuts.d.ts +0 -59
  297. package/lib/plugins/ShortcutsPlugin/shortcuts.js +0 -173
  298. package/lib/plugins/SpecialTextPlugin/index.d.ts +0 -2
  299. package/lib/plugins/SpecialTextPlugin/index.js +0 -50
  300. package/lib/plugins/SpeechToTextPlugin/index.d.ts +0 -5
  301. package/lib/plugins/SpeechToTextPlugin/index.js +0 -86
  302. package/lib/plugins/StickyPlugin/index.d.ts +0 -2
  303. package/lib/plugins/StickyPlugin/index.js +0 -16
  304. package/lib/plugins/TabFocusPlugin/index.d.ts +0 -1
  305. package/lib/plugins/TabFocusPlugin/index.js +0 -38
  306. package/lib/plugins/TableActionMenuPlugin/index.d.ts +0 -5
  307. package/lib/plugins/TableActionMenuPlugin/index.js +0 -492
  308. package/lib/plugins/TableCellResizer/index.d.ts +0 -3
  309. package/lib/plugins/TableCellResizer/index.js +0 -297
  310. package/lib/plugins/TableHoverActionsPlugin/index.d.ts +0 -4
  311. package/lib/plugins/TableHoverActionsPlugin/index.js +0 -188
  312. package/lib/plugins/TableOfContentsPlugin/index.d.ts +0 -2
  313. package/lib/plugins/TableOfContentsPlugin/index.js +0 -116
  314. package/lib/plugins/TablePlugin.d.ts +0 -31
  315. package/lib/plugins/TablePlugin.js +0 -63
  316. package/lib/plugins/TestRecorderPlugin/index.d.ts +0 -3
  317. package/lib/plugins/TestRecorderPlugin/index.js +0 -346
  318. package/lib/plugins/ToolbarPlugin/fontSize.d.ts +0 -9
  319. package/lib/plugins/ToolbarPlugin/fontSize.js +0 -84
  320. package/lib/plugins/ToolbarPlugin/index.d.ts +0 -9
  321. package/lib/plugins/ToolbarPlugin/index.js +0 -500
  322. package/lib/plugins/ToolbarPlugin/utils.d.ts +0 -26
  323. package/lib/plugins/ToolbarPlugin/utils.js +0 -247
  324. package/lib/plugins/TreeViewPlugin/index.d.ts +0 -2
  325. package/lib/plugins/TreeViewPlugin/index.js +0 -7
  326. package/lib/plugins/TwitterPlugin/index.d.ts +0 -4
  327. package/lib/plugins/TwitterPlugin/index.js +0 -24
  328. package/lib/plugins/TypingPerfPlugin/index.d.ts +0 -2
  329. package/lib/plugins/TypingPerfPlugin/index.js +0 -97
  330. package/lib/plugins/YouTubePlugin/index.d.ts +0 -4
  331. package/lib/plugins/YouTubePlugin/index.js +0 -24
  332. package/lib/server/validation.d.ts +0 -1
  333. package/lib/server/validation.js +0 -115
  334. package/lib/setupEnv.d.ts +0 -2
  335. package/lib/setupEnv.js +0 -29
  336. package/lib/themes/CommentEditorTheme.d.ts +0 -4
  337. package/lib/themes/CommentEditorTheme.js +0 -11
  338. package/lib/themes/PlaygroundEditorTheme.d.ts +0 -4
  339. package/lib/themes/PlaygroundEditorTheme.js +0 -124
  340. package/lib/themes/StickyEditorTheme.d.ts +0 -4
  341. package/lib/themes/StickyEditorTheme.js +0 -11
  342. package/lib/tyes.dt.d.ts +0 -12
  343. package/lib/tyes.dt.js +0 -4
  344. package/lib/ui/Button.d.ts +0 -12
  345. package/lib/ui/Button.js +0 -6
  346. package/lib/ui/ColorPicker.d.ts +0 -14
  347. package/lib/ui/ColorPicker.js +0 -219
  348. package/lib/ui/ContentEditable.d.ts +0 -9
  349. package/lib/ui/ContentEditable.js +0 -6
  350. package/lib/ui/Dialog.d.ts +0 -10
  351. package/lib/ui/Dialog.js +0 -8
  352. package/lib/ui/DropDown.d.ts +0 -18
  353. package/lib/ui/DropDown.js +0 -133
  354. package/lib/ui/DropdownColorPicker.d.ts +0 -13
  355. package/lib/ui/DropdownColorPicker.js +0 -6
  356. package/lib/ui/EquationEditor.d.ts +0 -8
  357. package/lib/ui/EquationEditor.js +0 -11
  358. package/lib/ui/ExcalidrawModal.d.ts +0 -42
  359. package/lib/ui/ExcalidrawModal.js +0 -103
  360. package/lib/ui/FileInput.d.ts +0 -10
  361. package/lib/ui/FileInput.js +0 -5
  362. package/lib/ui/FlashMessage.d.ts +0 -7
  363. package/lib/ui/FlashMessage.js +0 -6
  364. package/lib/ui/ImageResizer.d.ts +0 -17
  365. package/lib/ui/ImageResizer.js +0 -171
  366. package/lib/ui/KatexEquationAlterer.d.ts +0 -8
  367. package/lib/ui/KatexEquationAlterer.js +0 -23
  368. package/lib/ui/KatexRenderer.d.ts +0 -6
  369. package/lib/ui/KatexRenderer.js +0 -24
  370. package/lib/ui/Modal.d.ts +0 -9
  371. package/lib/ui/Modal.js +0 -48
  372. package/lib/ui/Select.d.ts +0 -8
  373. package/lib/ui/Select.js +0 -5
  374. package/lib/ui/Switch.d.ts +0 -8
  375. package/lib/ui/Switch.js +0 -6
  376. package/lib/ui/TextInput.d.ts +0 -13
  377. package/lib/ui/TextInput.js +0 -7
  378. package/lib/utils/docSerialization.d.ts +0 -3
  379. package/lib/utils/docSerialization.js +0 -60
  380. package/lib/utils/emoji-list.d.ts +0 -20
  381. package/lib/utils/emoji-list.js +0 -16609
  382. package/lib/utils/getDOMRangeRect.d.ts +0 -8
  383. package/lib/utils/getDOMRangeRect.js +0 -26
  384. package/lib/utils/getSelectedNode.d.ts +0 -2
  385. package/lib/utils/getSelectedNode.js +0 -28
  386. package/lib/utils/getThemeSelector.d.ts +0 -2
  387. package/lib/utils/getThemeSelector.js +0 -14
  388. package/lib/utils/isMobileWidth.d.ts +0 -7
  389. package/lib/utils/isMobileWidth.js +0 -11
  390. package/lib/utils/joinClasses.d.ts +0 -1
  391. package/lib/utils/joinClasses.js +0 -7
  392. package/lib/utils/setFloatingElemPosition.d.ts +0 -1
  393. package/lib/utils/setFloatingElemPosition.js +0 -59
  394. package/lib/utils/setFloatingElemPositionForLinkEditor.d.ts +0 -1
  395. package/lib/utils/setFloatingElemPositionForLinkEditor.js +0 -36
  396. package/lib/utils/swipe.d.ts +0 -4
  397. package/lib/utils/swipe.js +0 -94
  398. package/lib/utils/url.d.ts +0 -2
  399. package/lib/utils/url.js +0 -31
@@ -1,42 +0,0 @@
1
- import type { AppState, BinaryFiles, ExcalidrawInitialDataState } from '@excalidraw/excalidraw/types';
2
- import './ExcalidrawModal.css';
3
- import { ReactPortal } from 'react';
4
- export type ExcalidrawInitialElements = ExcalidrawInitialDataState['elements'];
5
- type Props = {
6
- closeOnClickOutside?: boolean;
7
- /**
8
- * The initial set of elements to draw into the scene
9
- */
10
- initialElements: ExcalidrawInitialElements;
11
- /**
12
- * The initial set of elements to draw into the scene
13
- */
14
- initialAppState: AppState;
15
- /**
16
- * The initial set of elements to draw into the scene
17
- */
18
- initialFiles: BinaryFiles;
19
- /**
20
- * Controls the visibility of the modal
21
- */
22
- isShown?: boolean;
23
- /**
24
- * Callback when closing and discarding the new changes
25
- */
26
- onClose: () => void;
27
- /**
28
- * Completely remove Excalidraw component
29
- */
30
- onDelete: () => void;
31
- /**
32
- * Callback when the save button is clicked
33
- */
34
- onSave: (elements: ExcalidrawInitialElements, appState: Partial<AppState>, files: BinaryFiles) => void;
35
- };
36
- /**
37
- * @explorer-desc
38
- * A component which renders a modal with Excalidraw (a painting app)
39
- * which can be used to export an editable image
40
- */
41
- export default function ExcalidrawModal({ closeOnClickOutside, onSave, initialElements, initialAppState, initialFiles, isShown, onDelete, onClose, }: Props): ReactPortal | null;
42
- export {};
@@ -1,103 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import './ExcalidrawModal.css';
3
- import { Excalidraw } from '@excalidraw/excalidraw';
4
- import { isDOMNode } from 'lexical';
5
- import { useEffect, useLayoutEffect, useRef, useState } from 'react';
6
- import { createPortal } from 'react-dom';
7
- import Button from './Button';
8
- import Modal from './Modal';
9
- /**
10
- * @explorer-desc
11
- * A component which renders a modal with Excalidraw (a painting app)
12
- * which can be used to export an editable image
13
- */
14
- export default function ExcalidrawModal({ closeOnClickOutside = false, onSave, initialElements, initialAppState, initialFiles, isShown = false, onDelete, onClose, }) {
15
- const excaliDrawModelRef = useRef(null);
16
- const [excalidrawAPI, setExcalidrawAPI] = useState(null);
17
- const [discardModalOpen, setDiscardModalOpen] = useState(false);
18
- const [elements, setElements] = useState(initialElements);
19
- const [files, setFiles] = useState(initialFiles);
20
- useEffect(() => {
21
- excaliDrawModelRef.current?.focus();
22
- }, []);
23
- useEffect(() => {
24
- let modalOverlayElement = null;
25
- const clickOutsideHandler = (event) => {
26
- const target = event.target;
27
- if (excaliDrawModelRef.current !== null &&
28
- isDOMNode(target) &&
29
- !excaliDrawModelRef.current.contains(target) &&
30
- closeOnClickOutside) {
31
- onDelete();
32
- }
33
- };
34
- if (excaliDrawModelRef.current !== null) {
35
- modalOverlayElement = excaliDrawModelRef.current?.parentElement;
36
- modalOverlayElement?.addEventListener('click', clickOutsideHandler);
37
- }
38
- return () => {
39
- modalOverlayElement?.removeEventListener('click', clickOutsideHandler);
40
- };
41
- }, [closeOnClickOutside, onDelete]);
42
- useLayoutEffect(() => {
43
- const currentModalRef = excaliDrawModelRef.current;
44
- const onKeyDown = (event) => {
45
- if (event.key === 'Escape') {
46
- onDelete();
47
- }
48
- };
49
- currentModalRef?.addEventListener('keydown', onKeyDown);
50
- return () => {
51
- currentModalRef?.removeEventListener('keydown', onKeyDown);
52
- };
53
- }, [elements, files, onDelete]);
54
- const save = () => {
55
- if (elements?.some((el) => !el.isDeleted)) {
56
- const appState = excalidrawAPI?.getAppState();
57
- // We only need a subset of the state
58
- const partialState = {
59
- exportBackground: appState?.exportBackground,
60
- exportScale: appState?.exportScale,
61
- exportWithDarkMode: appState?.theme === 'dark',
62
- isBindingEnabled: appState?.isBindingEnabled,
63
- isLoading: appState?.isLoading,
64
- name: appState?.name,
65
- theme: appState?.theme,
66
- viewBackgroundColor: appState?.viewBackgroundColor,
67
- viewModeEnabled: appState?.viewModeEnabled,
68
- zenModeEnabled: appState?.zenModeEnabled,
69
- zoom: appState?.zoom,
70
- };
71
- onSave(elements, partialState, files);
72
- }
73
- else {
74
- // delete node if the scene is clear
75
- onDelete();
76
- }
77
- };
78
- const discard = () => {
79
- setDiscardModalOpen(true);
80
- };
81
- function ShowDiscardDialog() {
82
- return (_jsxs(Modal, { title: "Discard", onClose: () => {
83
- setDiscardModalOpen(false);
84
- }, closeOnClickOutside: false, children: ["Are you sure you want to discard the changes?", _jsxs("div", { className: "ExcalidrawModal__discardModal", children: [_jsx(Button, { onClick: () => {
85
- setDiscardModalOpen(false);
86
- onClose();
87
- }, children: "Discard" }), ' ', _jsx(Button, { onClick: () => {
88
- setDiscardModalOpen(false);
89
- }, children: "Cancel" })] })] }));
90
- }
91
- if (isShown === false) {
92
- return null;
93
- }
94
- const onChange = (els, _, fls) => {
95
- setElements(els);
96
- setFiles(fls);
97
- };
98
- return createPortal(_jsx("div", { className: "ExcalidrawModal__overlay", role: "dialog", children: _jsx("div", { className: "ExcalidrawModal__modal", ref: excaliDrawModelRef, tabIndex: -1, children: _jsxs("div", { className: "ExcalidrawModal__row", children: [discardModalOpen && _jsx(ShowDiscardDialog, {}), _jsx(Excalidraw, { onChange: onChange, excalidrawAPI: setExcalidrawAPI, initialData: {
99
- appState: initialAppState || { isLoading: false },
100
- elements: initialElements,
101
- files: initialFiles,
102
- } }), _jsxs("div", { className: "ExcalidrawModal__actions", children: [_jsx("button", { className: "action-button", onClick: discard, children: "Discard" }), _jsx("button", { className: "action-button", onClick: save, children: "Save" })] })] }) }) }), document.body);
103
- }
@@ -1,10 +0,0 @@
1
- import type { JSX } from 'react';
2
- import './Input.css';
3
- type Props = Readonly<{
4
- 'data-test-id'?: string;
5
- accept?: string;
6
- label: string;
7
- onChange: (files: FileList | null) => void;
8
- }>;
9
- export default function FileInput({ accept, label, onChange, 'data-test-id': dataTestId, }: Props): JSX.Element;
10
- export {};
@@ -1,5 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import './Input.css';
3
- export default function FileInput({ accept, label, onChange, 'data-test-id': dataTestId, }) {
4
- return (_jsxs("div", { className: "Input__wrapper", children: [_jsx("label", { className: "Input__label", children: label }), _jsx("input", { type: "file", accept: accept, className: "Input__input", onChange: (e) => onChange(e.target.files), "data-test-id": dataTestId })] }));
5
- }
@@ -1,7 +0,0 @@
1
- import type { JSX } from 'react';
2
- import './FlashMessage.css';
3
- import { ReactNode } from 'react';
4
- export interface FlashMessageProps {
5
- children: ReactNode;
6
- }
7
- export default function FlashMessage({ children, }: FlashMessageProps): JSX.Element;
@@ -1,6 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import './FlashMessage.css';
3
- import { createPortal } from 'react-dom';
4
- export default function FlashMessage({ children, }) {
5
- return createPortal(_jsx("div", { className: "FlashMessage__overlay", role: "dialog", children: _jsx("p", { className: "FlashMessage__alert", role: "alert", children: children }) }), document.body);
6
- }
@@ -1,17 +0,0 @@
1
- import type { LexicalEditor } from 'lexical';
2
- import type { JSX } from 'react';
3
- export default function ImageResizer({ onResizeStart, onResizeEnd, buttonRef, imageRef, maxWidth, editor, showCaption, setShowCaption, captionsEnabled, }: {
4
- editor: LexicalEditor;
5
- buttonRef: {
6
- current: null | HTMLButtonElement;
7
- };
8
- imageRef: {
9
- current: null | HTMLElement;
10
- };
11
- maxWidth?: number;
12
- onResizeEnd: (width: 'inherit' | number, height: 'inherit' | number) => void;
13
- onResizeStart: () => void;
14
- setShowCaption: (show: boolean) => void;
15
- showCaption: boolean;
16
- captionsEnabled: boolean;
17
- }): JSX.Element;
@@ -1,171 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { calculateZoomLevel } from '@lexical/utils';
3
- import { useRef } from 'react';
4
- function clamp(value, min, max) {
5
- return Math.min(Math.max(value, min), max);
6
- }
7
- const Direction = {
8
- east: 1 << 0,
9
- north: 1 << 3,
10
- south: 1 << 1,
11
- west: 1 << 2,
12
- };
13
- export default function ImageResizer({ onResizeStart, onResizeEnd, buttonRef, imageRef, maxWidth, editor, showCaption, setShowCaption, captionsEnabled, }) {
14
- const controlWrapperRef = useRef(null);
15
- const userSelect = useRef({
16
- priority: '',
17
- value: 'default',
18
- });
19
- const positioningRef = useRef({
20
- currentHeight: 0,
21
- currentWidth: 0,
22
- direction: 0,
23
- isResizing: false,
24
- ratio: 0,
25
- startHeight: 0,
26
- startWidth: 0,
27
- startX: 0,
28
- startY: 0,
29
- });
30
- const editorRootElement = editor.getRootElement();
31
- // Find max width, accounting for editor padding.
32
- const maxWidthContainer = maxWidth
33
- ? maxWidth
34
- : editorRootElement !== null
35
- ? editorRootElement.getBoundingClientRect().width - 20
36
- : 100;
37
- const maxHeightContainer = editorRootElement !== null
38
- ? editorRootElement.getBoundingClientRect().height - 20
39
- : 100;
40
- const minWidth = 100;
41
- const minHeight = 100;
42
- const setStartCursor = (direction) => {
43
- const ew = direction === Direction.east || direction === Direction.west;
44
- const ns = direction === Direction.north || direction === Direction.south;
45
- const nwse = (direction & Direction.north && direction & Direction.west) ||
46
- (direction & Direction.south && direction & Direction.east);
47
- const cursorDir = ew ? 'ew' : ns ? 'ns' : nwse ? 'nwse' : 'nesw';
48
- if (editorRootElement !== null) {
49
- editorRootElement.style.setProperty('cursor', `${cursorDir}-resize`, 'important');
50
- }
51
- 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');
56
- }
57
- };
58
- const setEndCursor = () => {
59
- if (editorRootElement !== null) {
60
- editorRootElement.style.setProperty('cursor', 'text');
61
- }
62
- 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);
65
- }
66
- };
67
- const handlePointerDown = (event, direction) => {
68
- if (!editor.isEditable()) {
69
- return;
70
- }
71
- const image = imageRef.current;
72
- const controlWrapper = controlWrapperRef.current;
73
- if (image !== null && controlWrapper !== null) {
74
- event.preventDefault();
75
- const { width, height } = image.getBoundingClientRect();
76
- const zoom = calculateZoomLevel(image);
77
- const positioning = positioningRef.current;
78
- positioning.startWidth = width;
79
- positioning.startHeight = height;
80
- positioning.ratio = width / height;
81
- positioning.currentWidth = width;
82
- positioning.currentHeight = height;
83
- positioning.startX = event.clientX / zoom;
84
- positioning.startY = event.clientY / zoom;
85
- positioning.isResizing = true;
86
- positioning.direction = direction;
87
- setStartCursor(direction);
88
- onResizeStart();
89
- controlWrapper.classList.add('image-control-wrapper--resizing');
90
- image.style.height = `${height}px`;
91
- image.style.width = `${width}px`;
92
- document.addEventListener('pointermove', handlePointerMove);
93
- document.addEventListener('pointerup', handlePointerUp);
94
- }
95
- };
96
- const handlePointerMove = (event) => {
97
- const image = imageRef.current;
98
- const positioning = positioningRef.current;
99
- const isHorizontal = positioning.direction & (Direction.east | Direction.west);
100
- const isVertical = positioning.direction & (Direction.south | Direction.north);
101
- if (image !== null && positioning.isResizing) {
102
- const zoom = calculateZoomLevel(image);
103
- // Corner cursor
104
- if (isHorizontal && isVertical) {
105
- let diff = Math.floor(positioning.startX - event.clientX / zoom);
106
- diff = positioning.direction & Direction.east ? -diff : diff;
107
- const width = clamp(positioning.startWidth + diff, minWidth, maxWidthContainer);
108
- const height = width / positioning.ratio;
109
- image.style.width = `${width}px`;
110
- image.style.height = `${height}px`;
111
- positioning.currentHeight = height;
112
- positioning.currentWidth = width;
113
- }
114
- else if (isVertical) {
115
- let diff = Math.floor(positioning.startY - event.clientY / zoom);
116
- diff = positioning.direction & Direction.south ? -diff : diff;
117
- const height = clamp(positioning.startHeight + diff, minHeight, maxHeightContainer);
118
- image.style.height = `${height}px`;
119
- positioning.currentHeight = height;
120
- }
121
- else {
122
- let diff = Math.floor(positioning.startX - event.clientX / zoom);
123
- diff = positioning.direction & Direction.east ? -diff : diff;
124
- const width = clamp(positioning.startWidth + diff, minWidth, maxWidthContainer);
125
- image.style.width = `${width}px`;
126
- positioning.currentWidth = width;
127
- }
128
- }
129
- };
130
- const handlePointerUp = () => {
131
- const image = imageRef.current;
132
- const positioning = positioningRef.current;
133
- const controlWrapper = controlWrapperRef.current;
134
- if (image !== null && controlWrapper !== null && positioning.isResizing) {
135
- const width = positioning.currentWidth;
136
- const height = positioning.currentHeight;
137
- positioning.startWidth = 0;
138
- positioning.startHeight = 0;
139
- positioning.ratio = 0;
140
- positioning.startX = 0;
141
- positioning.startY = 0;
142
- positioning.currentWidth = 0;
143
- positioning.currentHeight = 0;
144
- positioning.isResizing = false;
145
- controlWrapper.classList.remove('image-control-wrapper--resizing');
146
- setEndCursor();
147
- onResizeEnd(width, height);
148
- document.removeEventListener('pointermove', handlePointerMove);
149
- document.removeEventListener('pointerup', handlePointerUp);
150
- }
151
- };
152
- return (_jsxs("div", { ref: controlWrapperRef, children: [!showCaption && captionsEnabled && (_jsx("button", { className: "image-caption-button", ref: buttonRef, onClick: () => {
153
- setShowCaption(!showCaption);
154
- }, children: "Add Caption" })), _jsx("div", { className: "image-resizer image-resizer-n", onPointerDown: (event) => {
155
- handlePointerDown(event, Direction.north);
156
- } }), _jsx("div", { className: "image-resizer image-resizer-ne", onPointerDown: (event) => {
157
- handlePointerDown(event, Direction.north | Direction.east);
158
- } }), _jsx("div", { className: "image-resizer image-resizer-e", onPointerDown: (event) => {
159
- handlePointerDown(event, Direction.east);
160
- } }), _jsx("div", { className: "image-resizer image-resizer-se", onPointerDown: (event) => {
161
- handlePointerDown(event, Direction.south | Direction.east);
162
- } }), _jsx("div", { className: "image-resizer image-resizer-s", onPointerDown: (event) => {
163
- handlePointerDown(event, Direction.south);
164
- } }), _jsx("div", { className: "image-resizer image-resizer-sw", onPointerDown: (event) => {
165
- handlePointerDown(event, Direction.south | Direction.west);
166
- } }), _jsx("div", { className: "image-resizer image-resizer-w", onPointerDown: (event) => {
167
- handlePointerDown(event, Direction.west);
168
- } }), _jsx("div", { className: "image-resizer image-resizer-nw", onPointerDown: (event) => {
169
- handlePointerDown(event, Direction.north | Direction.west);
170
- } })] }));
171
- }
@@ -1,8 +0,0 @@
1
- import type { JSX } from 'react';
2
- import './KatexEquationAlterer.css';
3
- type Props = {
4
- initialEquation?: string;
5
- onConfirm: (equation: string, inline: boolean) => void;
6
- };
7
- export default function KatexEquationAlterer({ onConfirm, initialEquation, }: Props): JSX.Element;
8
- export {};
@@ -1,23 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import './KatexEquationAlterer.css';
3
- import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
4
- import { useCallback, useState } from 'react';
5
- import { ErrorBoundary } from 'react-error-boundary';
6
- import Button from '../ui/Button';
7
- import KatexRenderer from './KatexRenderer';
8
- export default function KatexEquationAlterer({ onConfirm, initialEquation = '', }) {
9
- const [editor] = useLexicalComposerContext();
10
- const [equation, setEquation] = useState(initialEquation);
11
- const [inline, setInline] = useState(true);
12
- const onClick = useCallback(() => {
13
- onConfirm(equation, inline);
14
- }, [onConfirm, equation, inline]);
15
- const onCheckboxChange = useCallback(() => {
16
- setInline(!inline);
17
- }, [setInline, inline]);
18
- return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "KatexEquationAlterer_defaultRow", children: ["Inline", _jsx("input", { type: "checkbox", checked: inline, onChange: onCheckboxChange })] }), _jsx("div", { className: "KatexEquationAlterer_defaultRow", children: "Equation " }), _jsx("div", { className: "KatexEquationAlterer_centerRow", children: inline ? (_jsx("input", { onChange: (event) => {
19
- setEquation(event.target.value);
20
- }, value: equation, className: "KatexEquationAlterer_textArea" })) : (_jsx("textarea", { onChange: (event) => {
21
- setEquation(event.target.value);
22
- }, value: equation, className: "KatexEquationAlterer_textArea" })) }), _jsx("div", { className: "KatexEquationAlterer_defaultRow", children: "Visualization " }), _jsx("div", { className: "KatexEquationAlterer_centerRow", children: _jsx(ErrorBoundary, { onError: (e) => editor._onError(e), fallback: null, children: _jsx(KatexRenderer, { equation: equation, inline: false, onDoubleClick: () => null }) }) }), _jsx("div", { className: "KatexEquationAlterer_dialogActions", children: _jsx(Button, { onClick: onClick, children: "Confirm" }) })] }));
23
- }
@@ -1,6 +0,0 @@
1
- import type { JSX } from 'react';
2
- export default function KatexRenderer({ equation, inline, onDoubleClick, }: Readonly<{
3
- equation: string;
4
- inline: boolean;
5
- onDoubleClick: () => void;
6
- }>): JSX.Element;
@@ -1,24 +0,0 @@
1
- import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
- import katex from 'katex';
3
- import { useEffect, useRef } from 'react';
4
- export default function KatexRenderer({ equation, inline, onDoubleClick, }) {
5
- const katexElementRef = useRef(null);
6
- useEffect(() => {
7
- const katexElement = katexElementRef.current;
8
- if (katexElement !== null) {
9
- katex.render(equation, katexElement, {
10
- displayMode: !inline, // true === block display //
11
- errorColor: '#cc0000',
12
- output: 'html',
13
- strict: 'warn',
14
- throwOnError: false,
15
- trust: false,
16
- });
17
- }
18
- }, [equation, inline]);
19
- return (
20
- // We use an empty image tag either side to ensure Android doesn't try and compose from the
21
- // inner text from Katex. There didn't seem to be any other way of making this work,
22
- // without having a physical space.
23
- _jsxs(_Fragment, { children: [_jsx("img", { src: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7", width: "0", height: "0", alt: "" }), _jsx("span", { role: "button", tabIndex: -1, onDoubleClick: onDoubleClick, ref: katexElementRef }), _jsx("img", { src: "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7", width: "0", height: "0", alt: "" })] }));
24
- }
package/lib/ui/Modal.d.ts DELETED
@@ -1,9 +0,0 @@
1
- import type { JSX } from 'react';
2
- import './Modal.css';
3
- import { ReactNode } from 'react';
4
- export default function Modal({ onClose, children, title, closeOnClickOutside, }: {
5
- children: ReactNode;
6
- closeOnClickOutside?: boolean;
7
- onClose: () => void;
8
- title: string;
9
- }): JSX.Element;
package/lib/ui/Modal.js DELETED
@@ -1,48 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import './Modal.css';
3
- import { isDOMNode } from 'lexical';
4
- import { useEffect, useRef } from 'react';
5
- import { createPortal } from 'react-dom';
6
- function PortalImpl({ onClose, children, title, closeOnClickOutside, }) {
7
- const modalRef = useRef(null);
8
- useEffect(() => {
9
- if (modalRef.current !== null) {
10
- modalRef.current.focus();
11
- }
12
- }, []);
13
- useEffect(() => {
14
- let modalOverlayElement = null;
15
- const handler = (event) => {
16
- if (event.key === 'Escape') {
17
- onClose();
18
- }
19
- };
20
- const clickOutsideHandler = (event) => {
21
- const target = event.target;
22
- if (modalRef.current !== null &&
23
- isDOMNode(target) &&
24
- !modalRef.current.contains(target) &&
25
- closeOnClickOutside) {
26
- onClose();
27
- }
28
- };
29
- const modelElement = modalRef.current;
30
- if (modelElement !== null) {
31
- modalOverlayElement = modelElement.parentElement;
32
- if (modalOverlayElement !== null) {
33
- modalOverlayElement.addEventListener('click', clickOutsideHandler);
34
- }
35
- }
36
- window.addEventListener('keydown', handler);
37
- return () => {
38
- window.removeEventListener('keydown', handler);
39
- if (modalOverlayElement !== null) {
40
- modalOverlayElement?.removeEventListener('click', clickOutsideHandler);
41
- }
42
- };
43
- }, [closeOnClickOutside, onClose]);
44
- return (_jsx("div", { className: "Modal__overlay", role: "dialog", children: _jsxs("div", { className: "Modal__modal", tabIndex: -1, ref: modalRef, children: [_jsx("h2", { className: "Modal__title", children: title }), _jsx("button", { className: "Modal__closeButton", "aria-label": "Close modal", type: "button", onClick: onClose, children: "X" }), _jsx("div", { className: "Modal__content", children: children })] }) }));
45
- }
46
- export default function Modal({ onClose, children, title, closeOnClickOutside = false, }) {
47
- return createPortal(_jsx(PortalImpl, { onClose: onClose, title: title, closeOnClickOutside: closeOnClickOutside, children: children }), document.body);
48
- }
@@ -1,8 +0,0 @@
1
- import type { JSX } from 'react';
2
- import './Select.css';
3
- type SelectIntrinsicProps = JSX.IntrinsicElements['select'];
4
- interface SelectProps extends SelectIntrinsicProps {
5
- label: string;
6
- }
7
- export default function Select({ children, label, className, ...other }: SelectProps): JSX.Element;
8
- export {};
package/lib/ui/Select.js DELETED
@@ -1,5 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import './Select.css';
3
- export default function Select({ children, label, className, ...other }) {
4
- return (_jsxs("div", { className: "Input__wrapper", children: [_jsx("label", { style: { marginTop: '-1em' }, className: "Input__label", children: label }), _jsx("select", { ...other, className: className || 'select', children: children })] }));
5
- }
@@ -1,8 +0,0 @@
1
- import type { JSX } from 'react';
2
- import * as React from 'react';
3
- export default function Switch({ checked, onClick, text, id, }: Readonly<{
4
- checked: boolean;
5
- id?: string;
6
- onClick: (e: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
7
- text: string;
8
- }>): JSX.Element;
package/lib/ui/Switch.js DELETED
@@ -1,6 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useMemo } from 'react';
3
- export default function Switch({ checked, onClick, text, id, }) {
4
- const buttonId = useMemo(() => 'id_' + Math.floor(Math.random() * 10000), []);
5
- 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
- }
@@ -1,13 +0,0 @@
1
- import type { JSX } from 'react';
2
- import './Input.css';
3
- import { HTMLInputTypeAttribute } from 'react';
4
- type Props = Readonly<{
5
- 'data-test-id'?: string;
6
- label: string;
7
- onChange: (val: string) => void;
8
- placeholder?: string;
9
- value: string;
10
- type?: HTMLInputTypeAttribute;
11
- }>;
12
- export default function TextInput({ label, value, onChange, placeholder, 'data-test-id': dataTestId, type, }: Props): JSX.Element;
13
- export {};
@@ -1,7 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import './Input.css';
3
- export default function TextInput({ label, value, onChange, placeholder = '', 'data-test-id': dataTestId, type = 'text', }) {
4
- return (_jsxs("div", { className: "Input__wrapper", children: [_jsx("label", { className: "Input__label", children: label }), _jsx("input", { type: type, className: "Input__input", placeholder: placeholder, value: value, onChange: (e) => {
5
- onChange(e.target.value);
6
- }, "data-test-id": dataTestId })] }));
7
- }
@@ -1,3 +0,0 @@
1
- import { SerializedDocument } from '@lexical/file';
2
- export declare function docToHash(doc: SerializedDocument): Promise<string>;
3
- export declare function docFromHash(hash: string): Promise<SerializedDocument | null>;
@@ -1,60 +0,0 @@
1
- /*
2
- * Copyright (c) 2023-2025 Datalayer, Inc.
3
- * Distributed under the terms of the MIT License.
4
- */
5
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
6
- async function* generateReader(reader) {
7
- let done = false;
8
- while (!done) {
9
- const res = await reader.read();
10
- const { value } = res;
11
- if (value !== undefined) {
12
- yield value;
13
- }
14
- done = res.done;
15
- }
16
- }
17
- async function readBytestoString(reader) {
18
- const output = [];
19
- const chunkSize = 0x8000;
20
- for await (const value of generateReader(reader)) {
21
- for (let i = 0; i < value.length; i += chunkSize) {
22
- output.push(String.fromCharCode(...value.subarray(i, i + chunkSize)));
23
- }
24
- }
25
- return output.join('');
26
- }
27
- export async function docToHash(doc) {
28
- const cs = new CompressionStream('gzip');
29
- const writer = cs.writable.getWriter();
30
- const [, output] = await Promise.all([
31
- writer
32
- .write(new TextEncoder().encode(JSON.stringify(doc)))
33
- .then(() => writer.close()),
34
- readBytestoString(cs.readable.getReader()),
35
- ]);
36
- return `#doc=${btoa(output)
37
- .replace(/\//g, '_')
38
- .replace(/\+/g, '-')
39
- .replace(/=+$/, '')}`;
40
- }
41
- export async function docFromHash(hash) {
42
- const m = /^#doc=(.*)$/.exec(hash);
43
- if (!m) {
44
- return null;
45
- }
46
- const ds = new DecompressionStream('gzip');
47
- const writer = ds.writable.getWriter();
48
- const b64 = atob(m[1].replace(/_/g, '/').replace(/-/g, '+'));
49
- const array = new Uint8Array(b64.length);
50
- for (let i = 0; i < b64.length; i++) {
51
- array[i] = b64.charCodeAt(i);
52
- }
53
- const closed = writer.write(array).then(() => writer.close());
54
- const output = [];
55
- for await (const chunk of generateReader(ds.readable.pipeThrough(new TextDecoderStream()).getReader())) {
56
- output.push(chunk);
57
- }
58
- await closed;
59
- return JSON.parse(output.join(''));
60
- }
@@ -1,20 +0,0 @@
1
- declare const _default: ({
2
- description: string;
3
- emoji: string;
4
- category: string;
5
- aliases: string[];
6
- tags: string[];
7
- unicode_version: string;
8
- ios_version: string;
9
- skin_tones?: undefined;
10
- } | {
11
- emoji: string;
12
- description: string;
13
- category: string;
14
- aliases: string[];
15
- tags: string[];
16
- unicode_version: string;
17
- ios_version: string;
18
- skin_tones: boolean;
19
- })[];
20
- export default _default;