phx-react 1.3.1569 → 1.3.1571

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 (855) hide show
  1. package/dist/cjs/components/Combobox/Combobox.js +9 -3
  2. package/dist/cjs/components/Combobox/Combobox.js.map +1 -1
  3. package/dist/cjs/components/TextEditorV2/commenting/index.d.ts +41 -0
  4. package/dist/cjs/components/TextEditorV2/commenting/index.js +340 -0
  5. package/dist/cjs/components/TextEditorV2/commenting/index.js.map +1 -0
  6. package/dist/cjs/components/TextEditorV2/constants.d.ts +1 -0
  7. package/dist/cjs/components/TextEditorV2/constants.js +5 -0
  8. package/dist/cjs/components/TextEditorV2/constants.js.map +1 -0
  9. package/dist/cjs/components/TextEditorV2/context/SettingsContext.d.ts +12 -0
  10. package/dist/cjs/components/TextEditorV2/context/SettingsContext.js +59 -0
  11. package/dist/cjs/components/TextEditorV2/context/SettingsContext.js.map +1 -0
  12. package/dist/cjs/components/TextEditorV2/context/SharedAutocompleteContext.d.ts +10 -0
  13. package/dist/cjs/components/TextEditorV2/context/SharedAutocompleteContext.js +50 -0
  14. package/dist/cjs/components/TextEditorV2/context/SharedAutocompleteContext.js.map +1 -0
  15. package/dist/cjs/components/TextEditorV2/context/SharedHistoryContext.d.ts +11 -0
  16. package/dist/cjs/components/TextEditorV2/context/SharedHistoryContext.js +17 -0
  17. package/dist/cjs/components/TextEditorV2/context/SharedHistoryContext.js.map +1 -0
  18. package/dist/cjs/components/TextEditorV2/editor.d.ts +10 -0
  19. package/dist/cjs/components/TextEditorV2/editor.js +203 -0
  20. package/dist/cjs/components/TextEditorV2/editor.js.map +1 -0
  21. package/dist/cjs/components/TextEditorV2/hooks/useModal.d.ts +5 -0
  22. package/dist/cjs/components/TextEditorV2/hooks/useModal.js +32 -0
  23. package/dist/cjs/components/TextEditorV2/hooks/useModal.js.map +1 -0
  24. package/dist/cjs/components/TextEditorV2/hooks/useReport.d.ts +1 -0
  25. package/dist/cjs/components/TextEditorV2/hooks/useReport.js +45 -0
  26. package/dist/cjs/components/TextEditorV2/hooks/useReport.js.map +1 -0
  27. package/dist/cjs/components/TextEditorV2/lib/Settings.d.ts +2 -0
  28. package/dist/cjs/components/TextEditorV2/lib/Settings.js +52 -0
  29. package/dist/cjs/components/TextEditorV2/lib/Settings.js.map +1 -0
  30. package/dist/cjs/components/TextEditorV2/lib/appSettings.d.ts +19 -0
  31. package/dist/cjs/components/TextEditorV2/lib/appSettings.js +21 -0
  32. package/dist/cjs/components/TextEditorV2/lib/appSettings.js.map +1 -0
  33. package/dist/cjs/components/TextEditorV2/lib/collaboration.d.ts +3 -0
  34. package/dist/cjs/components/TextEditorV2/lib/collaboration.js +26 -0
  35. package/dist/cjs/components/TextEditorV2/lib/collaboration.js.map +1 -0
  36. package/dist/cjs/components/TextEditorV2/lib/setupEnv.d.ts +1 -0
  37. package/dist/cjs/components/TextEditorV2/lib/setupEnv.js +23 -0
  38. package/dist/cjs/components/TextEditorV2/lib/setupEnv.js.map +1 -0
  39. package/dist/cjs/components/TextEditorV2/nodes/AutocompleteNode.d.ts +25 -0
  40. package/dist/cjs/components/TextEditorV2/nodes/AutocompleteNode.js +58 -0
  41. package/dist/cjs/components/TextEditorV2/nodes/AutocompleteNode.js.map +1 -0
  42. package/dist/cjs/components/TextEditorV2/nodes/EmojiNode.d.ts +18 -0
  43. package/dist/cjs/components/TextEditorV2/nodes/EmojiNode.js +62 -0
  44. package/dist/cjs/components/TextEditorV2/nodes/EmojiNode.js.map +1 -0
  45. package/dist/cjs/components/TextEditorV2/nodes/EquationComponent.d.ts +9 -0
  46. package/dist/cjs/components/TextEditorV2/nodes/EquationComponent.js +72 -0
  47. package/dist/cjs/components/TextEditorV2/nodes/EquationComponent.js.map +1 -0
  48. package/dist/cjs/components/TextEditorV2/nodes/EquationNode.d.ts +26 -0
  49. package/dist/cjs/components/TextEditorV2/nodes/EquationNode.js +126 -0
  50. package/dist/cjs/components/TextEditorV2/nodes/EquationNode.js.map +1 -0
  51. package/dist/cjs/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawComponent.d.ts +6 -0
  52. package/dist/cjs/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawComponent.js +117 -0
  53. package/dist/cjs/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawComponent.js.map +1 -0
  54. package/dist/cjs/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawImage.d.ts +50 -0
  55. package/dist/cjs/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawImage.js +59 -0
  56. package/dist/cjs/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawImage.js.map +1 -0
  57. package/dist/cjs/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawModal.d.ts +44 -0
  58. package/dist/cjs/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawModal.js +143 -0
  59. package/dist/cjs/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawModal.js.map +1 -0
  60. package/dist/cjs/components/TextEditorV2/nodes/ExcalidrawNode/index.d.ts +22 -0
  61. package/dist/cjs/components/TextEditorV2/nodes/ExcalidrawNode/index.js +103 -0
  62. package/dist/cjs/components/TextEditorV2/nodes/ExcalidrawNode/index.js.map +1 -0
  63. package/dist/cjs/components/TextEditorV2/nodes/ExtendedTextNode.d.ts +12 -0
  64. package/dist/cjs/components/TextEditorV2/nodes/ExtendedTextNode.js +106 -0
  65. package/dist/cjs/components/TextEditorV2/nodes/ExtendedTextNode.js.map +1 -0
  66. package/dist/cjs/components/TextEditorV2/nodes/FigmaNode.d.ts +19 -0
  67. package/dist/cjs/components/TextEditorV2/nodes/FigmaNode.js +63 -0
  68. package/dist/cjs/components/TextEditorV2/nodes/FigmaNode.js.map +1 -0
  69. package/dist/cjs/components/TextEditorV2/nodes/ImageComponent.d.ts +14 -0
  70. package/dist/cjs/components/TextEditorV2/nodes/ImageComponent.js +212 -0
  71. package/dist/cjs/components/TextEditorV2/nodes/ImageComponent.js.map +1 -0
  72. package/dist/cjs/components/TextEditorV2/nodes/ImageNode.d.ts +56 -0
  73. package/dist/cjs/components/TextEditorV2/nodes/ImageNode.js +136 -0
  74. package/dist/cjs/components/TextEditorV2/nodes/ImageNode.js.map +1 -0
  75. package/dist/cjs/components/TextEditorV2/nodes/InlineImageComponent.d.ts +18 -0
  76. package/dist/cjs/components/TextEditorV2/nodes/InlineImageComponent.js +194 -0
  77. package/dist/cjs/components/TextEditorV2/nodes/InlineImageComponent.js.map +1 -0
  78. package/dist/cjs/components/TextEditorV2/nodes/InlineImageNode.d.ts +54 -0
  79. package/dist/cjs/components/TextEditorV2/nodes/InlineImageNode.js +142 -0
  80. package/dist/cjs/components/TextEditorV2/nodes/InlineImageNode.js.map +1 -0
  81. package/dist/cjs/components/TextEditorV2/nodes/KeywordNode.d.ts +15 -0
  82. package/dist/cjs/components/TextEditorV2/nodes/KeywordNode.js +54 -0
  83. package/dist/cjs/components/TextEditorV2/nodes/KeywordNode.js.map +1 -0
  84. package/dist/cjs/components/TextEditorV2/nodes/LayoutContainerNode.d.ts +21 -0
  85. package/dist/cjs/components/TextEditorV2/nodes/LayoutContainerNode.js +63 -0
  86. package/dist/cjs/components/TextEditorV2/nodes/LayoutContainerNode.js.map +1 -0
  87. package/dist/cjs/components/TextEditorV2/nodes/LayoutItemNode.d.ts +15 -0
  88. package/dist/cjs/components/TextEditorV2/nodes/LayoutItemNode.js +51 -0
  89. package/dist/cjs/components/TextEditorV2/nodes/LayoutItemNode.js.map +1 -0
  90. package/dist/cjs/components/TextEditorV2/nodes/MentionNode.d.ts +20 -0
  91. package/dist/cjs/components/TextEditorV2/nodes/MentionNode.js +89 -0
  92. package/dist/cjs/components/TextEditorV2/nodes/MentionNode.js.map +1 -0
  93. package/dist/cjs/components/TextEditorV2/nodes/PageBreakNode/index.d.ts +17 -0
  94. package/dist/cjs/components/TextEditorV2/nodes/PageBreakNode/index.js +113 -0
  95. package/dist/cjs/components/TextEditorV2/nodes/PageBreakNode/index.js.map +1 -0
  96. package/dist/cjs/components/TextEditorV2/nodes/PlaygroundNodes.d.ts +3 -0
  97. package/dist/cjs/components/TextEditorV2/nodes/PlaygroundNodes.js +68 -0
  98. package/dist/cjs/components/TextEditorV2/nodes/PlaygroundNodes.js.map +1 -0
  99. package/dist/cjs/components/TextEditorV2/nodes/PollComponent.d.ts +8 -0
  100. package/dist/cjs/components/TextEditorV2/nodes/PollComponent.js +113 -0
  101. package/dist/cjs/components/TextEditorV2/nodes/PollComponent.js.map +1 -0
  102. package/dist/cjs/components/TextEditorV2/nodes/PollNode.d.ts +33 -0
  103. package/dist/cjs/components/TextEditorV2/nodes/PollNode.js +149 -0
  104. package/dist/cjs/components/TextEditorV2/nodes/PollNode.js.map +1 -0
  105. package/dist/cjs/components/TextEditorV2/nodes/StickyComponent.d.ts +9 -0
  106. package/dist/cjs/components/TextEditorV2/nodes/StickyComponent.js +167 -0
  107. package/dist/cjs/components/TextEditorV2/nodes/StickyComponent.js.map +1 -0
  108. package/dist/cjs/components/TextEditorV2/nodes/StickyNode.d.ts +37 -0
  109. package/dist/cjs/components/TextEditorV2/nodes/StickyNode.js +94 -0
  110. package/dist/cjs/components/TextEditorV2/nodes/StickyNode.js.map +1 -0
  111. package/dist/cjs/components/TextEditorV2/nodes/TableNode.d.ts +54 -0
  112. package/dist/cjs/components/TextEditorV2/nodes/TableNode.js +198 -0
  113. package/dist/cjs/components/TextEditorV2/nodes/TableNode.js.map +1 -0
  114. package/dist/cjs/components/TextEditorV2/nodes/TweetNode.d.ts +28 -0
  115. package/dist/cjs/components/TextEditorV2/nodes/TweetNode.js +156 -0
  116. package/dist/cjs/components/TextEditorV2/nodes/TweetNode.js.map +1 -0
  117. package/dist/cjs/components/TextEditorV2/nodes/YouTubeNode.d.ts +28 -0
  118. package/dist/cjs/components/TextEditorV2/nodes/YouTubeNode.js +103 -0
  119. package/dist/cjs/components/TextEditorV2/nodes/YouTubeNode.js.map +1 -0
  120. package/dist/cjs/components/TextEditorV2/plugins/ActionsPlugin/index.d.ts +2 -0
  121. package/dist/cjs/components/TextEditorV2/plugins/ActionsPlugin/index.js +183 -0
  122. package/dist/cjs/components/TextEditorV2/plugins/ActionsPlugin/index.js.map +1 -0
  123. package/dist/cjs/components/TextEditorV2/plugins/AutoEmbedPlugin/index.d.ts +19 -0
  124. package/dist/cjs/components/TextEditorV2/plugins/AutoEmbedPlugin/index.js +179 -0
  125. package/dist/cjs/components/TextEditorV2/plugins/AutoEmbedPlugin/index.js.map +1 -0
  126. package/dist/cjs/components/TextEditorV2/plugins/AutoLinkPlugin/index.d.ts +2 -0
  127. package/dist/cjs/components/TextEditorV2/plugins/AutoLinkPlugin/index.js +16 -0
  128. package/dist/cjs/components/TextEditorV2/plugins/AutoLinkPlugin/index.js.map +1 -0
  129. package/dist/cjs/components/TextEditorV2/plugins/AutocompletePlugin/index.d.ts +2 -0
  130. package/dist/cjs/components/TextEditorV2/plugins/AutocompletePlugin/index.js +2465 -0
  131. package/dist/cjs/components/TextEditorV2/plugins/AutocompletePlugin/index.js.map +1 -0
  132. package/dist/cjs/components/TextEditorV2/plugins/CodeActionMenuPlugin/components/CopyButton/index.d.ts +8 -0
  133. package/dist/cjs/components/TextEditorV2/plugins/CodeActionMenuPlugin/components/CopyButton/index.js +55 -0
  134. package/dist/cjs/components/TextEditorV2/plugins/CodeActionMenuPlugin/components/CopyButton/index.js.map +1 -0
  135. package/dist/cjs/components/TextEditorV2/plugins/CodeActionMenuPlugin/components/PrettierButton/index.d.ts +10 -0
  136. package/dist/cjs/components/TextEditorV2/plugins/CodeActionMenuPlugin/components/PrettierButton/index.js +159 -0
  137. package/dist/cjs/components/TextEditorV2/plugins/CodeActionMenuPlugin/components/PrettierButton/index.js.map +1 -0
  138. package/dist/cjs/components/TextEditorV2/plugins/CodeActionMenuPlugin/index.d.ts +4 -0
  139. package/dist/cjs/components/TextEditorV2/plugins/CodeActionMenuPlugin/index.js +111 -0
  140. package/dist/cjs/components/TextEditorV2/plugins/CodeActionMenuPlugin/index.js.map +1 -0
  141. package/dist/cjs/components/TextEditorV2/plugins/CodeActionMenuPlugin/utils.d.ts +1 -0
  142. package/dist/cjs/components/TextEditorV2/plugins/CodeActionMenuPlugin/utils.js +21 -0
  143. package/dist/cjs/components/TextEditorV2/plugins/CodeActionMenuPlugin/utils.js.map +1 -0
  144. package/dist/cjs/components/TextEditorV2/plugins/CodeHighlightPlugin/index.d.ts +1 -0
  145. package/dist/cjs/components/TextEditorV2/plugins/CodeHighlightPlugin/index.js +12 -0
  146. package/dist/cjs/components/TextEditorV2/plugins/CodeHighlightPlugin/index.js.map +1 -0
  147. package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContainerNode.d.ts +23 -0
  148. package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContainerNode.js +88 -0
  149. package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContainerNode.js.map +1 -0
  150. package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContentNode.d.ts +17 -0
  151. package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContentNode.js +70 -0
  152. package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContentNode.js.map +1 -0
  153. package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleTitleNode.d.ts +18 -0
  154. package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleTitleNode.js +95 -0
  155. package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleTitleNode.js.map +1 -0
  156. package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/index.d.ts +3 -0
  157. package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/index.js +148 -0
  158. package/dist/cjs/components/TextEditorV2/plugins/CollapsiblePlugin/index.js.map +1 -0
  159. package/dist/cjs/components/TextEditorV2/plugins/ComponentPickerPlugin/index.d.ts +2 -0
  160. package/dist/cjs/components/TextEditorV2/plugins/ComponentPickerPlugin/index.js +264 -0
  161. package/dist/cjs/components/TextEditorV2/plugins/ComponentPickerPlugin/index.js.map +1 -0
  162. package/dist/cjs/components/TextEditorV2/plugins/ContextMenuPlugin/index.d.ts +11 -0
  163. package/dist/cjs/components/TextEditorV2/plugins/ContextMenuPlugin/index.js +171 -0
  164. package/dist/cjs/components/TextEditorV2/plugins/ContextMenuPlugin/index.js.map +1 -0
  165. package/dist/cjs/components/TextEditorV2/plugins/DocsPlugin/index.d.ts +2 -0
  166. package/dist/cjs/components/TextEditorV2/plugins/DocsPlugin/index.js +10 -0
  167. package/dist/cjs/components/TextEditorV2/plugins/DocsPlugin/index.js.map +1 -0
  168. package/dist/cjs/components/TextEditorV2/plugins/DragDropPastePlugin/index.d.ts +1 -0
  169. package/dist/cjs/components/TextEditorV2/plugins/DragDropPastePlugin/index.js +44 -0
  170. package/dist/cjs/components/TextEditorV2/plugins/DragDropPastePlugin/index.js.map +1 -0
  171. package/dist/cjs/components/TextEditorV2/plugins/DraggableBlockPlugin/index.d.ts +4 -0
  172. package/dist/cjs/components/TextEditorV2/plugins/DraggableBlockPlugin/index.js +288 -0
  173. package/dist/cjs/components/TextEditorV2/plugins/DraggableBlockPlugin/index.js.map +1 -0
  174. package/dist/cjs/components/TextEditorV2/plugins/EmojiPickerPlugin/index.d.ts +2 -0
  175. package/dist/cjs/components/TextEditorV2/plugins/EmojiPickerPlugin/index.js +97 -0
  176. package/dist/cjs/components/TextEditorV2/plugins/EmojiPickerPlugin/index.js.map +1 -0
  177. package/dist/cjs/components/TextEditorV2/plugins/EmojisPlugin/index.d.ts +1 -0
  178. package/dist/cjs/components/TextEditorV2/plugins/EmojisPlugin/index.js +64 -0
  179. package/dist/cjs/components/TextEditorV2/plugins/EmojisPlugin/index.js.map +1 -0
  180. package/dist/cjs/components/TextEditorV2/plugins/EquationsPlugin/index.d.ts +14 -0
  181. package/dist/cjs/components/TextEditorV2/plugins/EquationsPlugin/index.js +42 -0
  182. package/dist/cjs/components/TextEditorV2/plugins/EquationsPlugin/index.js.map +1 -0
  183. package/dist/cjs/components/TextEditorV2/plugins/ExcalidrawPlugin/index.d.ts +3 -0
  184. package/dist/cjs/components/TextEditorV2/plugins/ExcalidrawPlugin/index.js +28 -0
  185. package/dist/cjs/components/TextEditorV2/plugins/ExcalidrawPlugin/index.js.map +1 -0
  186. package/dist/cjs/components/TextEditorV2/plugins/FigmaPlugin/index.d.ts +3 -0
  187. package/dist/cjs/components/TextEditorV2/plugins/FigmaPlugin/index.js +25 -0
  188. package/dist/cjs/components/TextEditorV2/plugins/FigmaPlugin/index.js.map +1 -0
  189. package/dist/cjs/components/TextEditorV2/plugins/FloatingLinkEditorPlugin/index.d.ts +7 -0
  190. package/dist/cjs/components/TextEditorV2/plugins/FloatingLinkEditorPlugin/index.js +200 -0
  191. package/dist/cjs/components/TextEditorV2/plugins/FloatingLinkEditorPlugin/index.js.map +1 -0
  192. package/dist/cjs/components/TextEditorV2/plugins/FloatingTextFormatToolbarPlugin/index.d.ts +4 -0
  193. package/dist/cjs/components/TextEditorV2/plugins/FloatingTextFormatToolbarPlugin/index.js +229 -0
  194. package/dist/cjs/components/TextEditorV2/plugins/FloatingTextFormatToolbarPlugin/index.js.map +1 -0
  195. package/dist/cjs/components/TextEditorV2/plugins/ImagesPlugin/index.d.ts +22 -0
  196. package/dist/cjs/components/TextEditorV2/plugins/ImagesPlugin/index.js +188 -0
  197. package/dist/cjs/components/TextEditorV2/plugins/ImagesPlugin/index.js.map +1 -0
  198. package/dist/cjs/components/TextEditorV2/plugins/InlineImagePlugin/index.d.ts +17 -0
  199. package/dist/cjs/components/TextEditorV2/plugins/InlineImagePlugin/index.js +193 -0
  200. package/dist/cjs/components/TextEditorV2/plugins/InlineImagePlugin/index.js.map +1 -0
  201. package/dist/cjs/components/TextEditorV2/plugins/KeywordsPlugin/index.d.ts +1 -0
  202. package/dist/cjs/components/TextEditorV2/plugins/KeywordsPlugin/index.js +33 -0
  203. package/dist/cjs/components/TextEditorV2/plugins/KeywordsPlugin/index.js.map +1 -0
  204. package/dist/cjs/components/TextEditorV2/plugins/LayoutPlugin/InsertLayoutDialog.d.ts +6 -0
  205. package/dist/cjs/components/TextEditorV2/plugins/LayoutPlugin/InsertLayoutDialog.js +34 -0
  206. package/dist/cjs/components/TextEditorV2/plugins/LayoutPlugin/InsertLayoutDialog.js.map +1 -0
  207. package/dist/cjs/components/TextEditorV2/plugins/LayoutPlugin/LayoutPlugin.d.ts +7 -0
  208. package/dist/cjs/components/TextEditorV2/plugins/LayoutPlugin/LayoutPlugin.js +89 -0
  209. package/dist/cjs/components/TextEditorV2/plugins/LayoutPlugin/LayoutPlugin.js.map +1 -0
  210. package/dist/cjs/components/TextEditorV2/plugins/LinkPlugin/index.d.ts +2 -0
  211. package/dist/cjs/components/TextEditorV2/plugins/LinkPlugin/index.js +11 -0
  212. package/dist/cjs/components/TextEditorV2/plugins/LinkPlugin/index.js.map +1 -0
  213. package/dist/cjs/components/TextEditorV2/plugins/ListMaxIndentLevelPlugin/index.d.ts +5 -0
  214. package/dist/cjs/components/TextEditorV2/plugins/ListMaxIndentLevelPlugin/index.js +44 -0
  215. package/dist/cjs/components/TextEditorV2/plugins/ListMaxIndentLevelPlugin/index.js.map +1 -0
  216. package/dist/cjs/components/TextEditorV2/plugins/MarkdownShortcutPlugin/index.d.ts +2 -0
  217. package/dist/cjs/components/TextEditorV2/plugins/MarkdownShortcutPlugin/index.js +11 -0
  218. package/dist/cjs/components/TextEditorV2/plugins/MarkdownShortcutPlugin/index.js.map +1 -0
  219. package/dist/cjs/components/TextEditorV2/plugins/MarkdownTransformers/index.d.ts +8 -0
  220. package/dist/cjs/components/TextEditorV2/plugins/MarkdownTransformers/index.js +242 -0
  221. package/dist/cjs/components/TextEditorV2/plugins/MarkdownTransformers/index.js.map +1 -0
  222. package/dist/cjs/components/TextEditorV2/plugins/MaxLengthPlugin/index.d.ts +3 -0
  223. package/dist/cjs/components/TextEditorV2/plugins/MaxLengthPlugin/index.js +41 -0
  224. package/dist/cjs/components/TextEditorV2/plugins/MaxLengthPlugin/index.js.map +1 -0
  225. package/dist/cjs/components/TextEditorV2/plugins/MentionsPlugin/index.d.ts +2 -0
  226. package/dist/cjs/components/TextEditorV2/plugins/MentionsPlugin/index.js +560 -0
  227. package/dist/cjs/components/TextEditorV2/plugins/MentionsPlugin/index.js.map +1 -0
  228. package/dist/cjs/components/TextEditorV2/plugins/PageBreakPlugin/index.d.ts +3 -0
  229. package/dist/cjs/components/TextEditorV2/plugins/PageBreakPlugin/index.js +31 -0
  230. package/dist/cjs/components/TextEditorV2/plugins/PageBreakPlugin/index.js.map +1 -0
  231. package/dist/cjs/components/TextEditorV2/plugins/PasteLogPlugin/index.d.ts +2 -0
  232. package/dist/cjs/components/TextEditorV2/plugins/PasteLogPlugin/index.js +37 -0
  233. package/dist/cjs/components/TextEditorV2/plugins/PasteLogPlugin/index.js.map +1 -0
  234. package/dist/cjs/components/TextEditorV2/plugins/PollPlugin/index.d.ts +8 -0
  235. package/dist/cjs/components/TextEditorV2/plugins/PollPlugin/index.js +46 -0
  236. package/dist/cjs/components/TextEditorV2/plugins/PollPlugin/index.js.map +1 -0
  237. package/dist/cjs/components/TextEditorV2/plugins/StickyPlugin/index.d.ts +1 -0
  238. package/dist/cjs/components/TextEditorV2/plugins/StickyPlugin/index.js +16 -0
  239. package/dist/cjs/components/TextEditorV2/plugins/StickyPlugin/index.js.map +1 -0
  240. package/dist/cjs/components/TextEditorV2/plugins/TabFocusPlugin/index.d.ts +1 -0
  241. package/dist/cjs/components/TextEditorV2/plugins/TabFocusPlugin/index.js +38 -0
  242. package/dist/cjs/components/TextEditorV2/plugins/TabFocusPlugin/index.js.map +1 -0
  243. package/dist/cjs/components/TextEditorV2/plugins/TableActionMenuPlugin/index.d.ts +5 -0
  244. package/dist/cjs/components/TextEditorV2/plugins/TableActionMenuPlugin/index.js +487 -0
  245. package/dist/cjs/components/TextEditorV2/plugins/TableActionMenuPlugin/index.js.map +1 -0
  246. package/dist/cjs/components/TextEditorV2/plugins/TableCellResizer/index.d.ts +2 -0
  247. package/dist/cjs/components/TextEditorV2/plugins/TableCellResizer/index.js +253 -0
  248. package/dist/cjs/components/TextEditorV2/plugins/TableCellResizer/index.js.map +1 -0
  249. package/dist/cjs/components/TextEditorV2/plugins/TableOfContentsPlugin/index.d.ts +2 -0
  250. package/dist/cjs/components/TextEditorV2/plugins/TableOfContentsPlugin/index.js +117 -0
  251. package/dist/cjs/components/TextEditorV2/plugins/TableOfContentsPlugin/index.js.map +1 -0
  252. package/dist/cjs/components/TextEditorV2/plugins/TablePlugin.d.ts +32 -0
  253. package/dist/cjs/components/TextEditorV2/plugins/TablePlugin.js +85 -0
  254. package/dist/cjs/components/TextEditorV2/plugins/TablePlugin.js.map +1 -0
  255. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/bold-text.d.ts +6 -0
  256. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/bold-text.js +18 -0
  257. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/bold-text.js.map +1 -0
  258. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/bullet.d.ts +6 -0
  259. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/bullet.js +28 -0
  260. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/bullet.js.map +1 -0
  261. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/font-size.d.ts +6 -0
  262. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/font-size.js +65 -0
  263. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/font-size.js.map +1 -0
  264. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/heading.d.ts +6 -0
  265. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/heading.js +71 -0
  266. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/heading.js.map +1 -0
  267. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/italic-text.d.ts +6 -0
  268. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/italic-text.js +18 -0
  269. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/italic-text.js.map +1 -0
  270. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/link.d.ts +5 -0
  271. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/link.js +46 -0
  272. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/link.js.map +1 -0
  273. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/number-bullet.d.ts +6 -0
  274. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/number-bullet.js +28 -0
  275. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/number-bullet.js.map +1 -0
  276. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/text-align.d.ts +6 -0
  277. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/text-align.js +52 -0
  278. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/text-align.js.map +1 -0
  279. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/text-color.d.ts +6 -0
  280. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/text-color.js +28 -0
  281. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/text-color.js.map +1 -0
  282. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/underline-text.d.ts +6 -0
  283. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/underline-text.js +19 -0
  284. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/underline-text.js.map +1 -0
  285. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-image.d.ts +6 -0
  286. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-image.js +41 -0
  287. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-image.js.map +1 -0
  288. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-pdf.d.ts +11 -0
  289. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-pdf.js +162 -0
  290. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-pdf.js.map +1 -0
  291. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/index.d.ts +4 -0
  292. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/index.js +163 -0
  293. package/dist/cjs/components/TextEditorV2/plugins/ToolbarPlugin/index.js.map +1 -0
  294. package/dist/cjs/components/TextEditorV2/plugins/TreeViewPlugin/index.d.ts +2 -0
  295. package/dist/cjs/components/TextEditorV2/plugins/TreeViewPlugin/index.js +12 -0
  296. package/dist/cjs/components/TextEditorV2/plugins/TreeViewPlugin/index.js.map +1 -0
  297. package/dist/cjs/components/TextEditorV2/plugins/TwitterPlugin/index.d.ts +3 -0
  298. package/dist/cjs/components/TextEditorV2/plugins/TwitterPlugin/index.js +25 -0
  299. package/dist/cjs/components/TextEditorV2/plugins/TwitterPlugin/index.js.map +1 -0
  300. package/dist/cjs/components/TextEditorV2/plugins/YouTubePlugin/index.d.ts +3 -0
  301. package/dist/cjs/components/TextEditorV2/plugins/YouTubePlugin/index.js +25 -0
  302. package/dist/cjs/components/TextEditorV2/plugins/YouTubePlugin/index.js.map +1 -0
  303. package/dist/cjs/components/TextEditorV2/shared/canUseDOM.d.ts +1 -0
  304. package/dist/cjs/components/TextEditorV2/shared/canUseDOM.js +7 -0
  305. package/dist/cjs/components/TextEditorV2/shared/canUseDOM.js.map +1 -0
  306. package/dist/cjs/components/TextEditorV2/shared/caretFromPoint.d.ts +4 -0
  307. package/dist/cjs/components/TextEditorV2/shared/caretFromPoint.js +32 -0
  308. package/dist/cjs/components/TextEditorV2/shared/caretFromPoint.js.map +1 -0
  309. package/dist/cjs/components/TextEditorV2/shared/environment.d.ts +16 -0
  310. package/dist/cjs/components/TextEditorV2/shared/environment.js +17 -0
  311. package/dist/cjs/components/TextEditorV2/shared/environment.js.map +1 -0
  312. package/dist/cjs/components/TextEditorV2/shared/invariant.d.ts +1 -0
  313. package/dist/cjs/components/TextEditorV2/shared/invariant.js +15 -0
  314. package/dist/cjs/components/TextEditorV2/shared/invariant.js.map +1 -0
  315. package/dist/cjs/components/TextEditorV2/shared/simpleDiffWithCursor.d.ts +5 -0
  316. package/dist/cjs/components/TextEditorV2/shared/simpleDiffWithCursor.js +28 -0
  317. package/dist/cjs/components/TextEditorV2/shared/simpleDiffWithCursor.js.map +1 -0
  318. package/dist/cjs/components/TextEditorV2/shared/useLayoutEffect.d.ts +3 -0
  319. package/dist/cjs/components/TextEditorV2/shared/useLayoutEffect.js +7 -0
  320. package/dist/cjs/components/TextEditorV2/shared/useLayoutEffect.js.map +1 -0
  321. package/dist/cjs/components/TextEditorV2/shared/warnOnlyOnce.d.ts +1 -0
  322. package/dist/cjs/components/TextEditorV2/shared/warnOnlyOnce.js +16 -0
  323. package/dist/cjs/components/TextEditorV2/shared/warnOnlyOnce.js.map +1 -0
  324. package/dist/cjs/components/TextEditorV2/style.d.ts +2 -0
  325. package/dist/cjs/components/TextEditorV2/style.js +9 -0
  326. package/dist/cjs/components/TextEditorV2/style.js.map +1 -0
  327. package/dist/cjs/components/TextEditorV2/themes/CommentEditorTheme.d.ts +3 -0
  328. package/dist/cjs/components/TextEditorV2/themes/CommentEditorTheme.js +7 -0
  329. package/dist/cjs/components/TextEditorV2/themes/CommentEditorTheme.js.map +1 -0
  330. package/dist/cjs/components/TextEditorV2/themes/PlaygroundEditorTheme.d.ts +3 -0
  331. package/dist/cjs/components/TextEditorV2/themes/PlaygroundEditorTheme.js +107 -0
  332. package/dist/cjs/components/TextEditorV2/themes/PlaygroundEditorTheme.js.map +1 -0
  333. package/dist/cjs/components/TextEditorV2/themes/StickyEditorTheme.d.ts +3 -0
  334. package/dist/cjs/components/TextEditorV2/themes/StickyEditorTheme.js +7 -0
  335. package/dist/cjs/components/TextEditorV2/themes/StickyEditorTheme.js.map +1 -0
  336. package/dist/cjs/components/TextEditorV2/ui/Button.d.ts +11 -0
  337. package/dist/cjs/components/TextEditorV2/ui/Button.js +11 -0
  338. package/dist/cjs/components/TextEditorV2/ui/Button.js.map +1 -0
  339. package/dist/cjs/components/TextEditorV2/ui/ColorPicker.d.ts +12 -0
  340. package/dist/cjs/components/TextEditorV2/ui/ColorPicker.js +216 -0
  341. package/dist/cjs/components/TextEditorV2/ui/ColorPicker.js.map +1 -0
  342. package/dist/cjs/components/TextEditorV2/ui/ContentEditable.d.ts +4 -0
  343. package/dist/cjs/components/TextEditorV2/ui/ContentEditable.js +11 -0
  344. package/dist/cjs/components/TextEditorV2/ui/ContentEditable.js.map +1 -0
  345. package/dist/cjs/components/TextEditorV2/ui/Dialog.d.ts +9 -0
  346. package/dist/cjs/components/TextEditorV2/ui/Dialog.js +15 -0
  347. package/dist/cjs/components/TextEditorV2/ui/Dialog.js.map +1 -0
  348. package/dist/cjs/components/TextEditorV2/ui/DropDown.d.ts +17 -0
  349. package/dist/cjs/components/TextEditorV2/ui/DropDown.js +133 -0
  350. package/dist/cjs/components/TextEditorV2/ui/DropDown.js.map +1 -0
  351. package/dist/cjs/components/TextEditorV2/ui/DropdownColorPicker.d.ts +21 -0
  352. package/dist/cjs/components/TextEditorV2/ui/DropdownColorPicker.js +20 -0
  353. package/dist/cjs/components/TextEditorV2/ui/DropdownColorPicker.js.map +1 -0
  354. package/dist/cjs/components/TextEditorV2/ui/EquationEditor.d.ts +8 -0
  355. package/dist/cjs/components/TextEditorV2/ui/EquationEditor.js +20 -0
  356. package/dist/cjs/components/TextEditorV2/ui/EquationEditor.js.map +1 -0
  357. package/dist/cjs/components/TextEditorV2/ui/FileInput.d.ts +9 -0
  358. package/dist/cjs/components/TextEditorV2/ui/FileInput.js +12 -0
  359. package/dist/cjs/components/TextEditorV2/ui/FileInput.js.map +1 -0
  360. package/dist/cjs/components/TextEditorV2/ui/ImageResizer.d.ts +11 -0
  361. package/dist/cjs/components/TextEditorV2/ui/ImageResizer.js +178 -0
  362. package/dist/cjs/components/TextEditorV2/ui/ImageResizer.js.map +1 -0
  363. package/dist/cjs/components/TextEditorV2/ui/KatexEquationAlterer.d.ts +7 -0
  364. package/dist/cjs/components/TextEditorV2/ui/KatexEquationAlterer.js +39 -0
  365. package/dist/cjs/components/TextEditorV2/ui/KatexEquationAlterer.js.map +1 -0
  366. package/dist/cjs/components/TextEditorV2/ui/KatexRenderer.d.ts +6 -0
  367. package/dist/cjs/components/TextEditorV2/ui/KatexRenderer.js +33 -0
  368. package/dist/cjs/components/TextEditorV2/ui/KatexRenderer.js.map +1 -0
  369. package/dist/cjs/components/TextEditorV2/ui/Modal.d.ts +8 -0
  370. package/dist/cjs/components/TextEditorV2/ui/Modal.js +54 -0
  371. package/dist/cjs/components/TextEditorV2/ui/Modal.js.map +1 -0
  372. package/dist/cjs/components/TextEditorV2/ui/Placeholder.d.ts +6 -0
  373. package/dist/cjs/components/TextEditorV2/ui/Placeholder.js +10 -0
  374. package/dist/cjs/components/TextEditorV2/ui/Placeholder.js.map +1 -0
  375. package/dist/cjs/components/TextEditorV2/ui/Select.d.ts +7 -0
  376. package/dist/cjs/components/TextEditorV2/ui/Select.js +12 -0
  377. package/dist/cjs/components/TextEditorV2/ui/Select.js.map +1 -0
  378. package/dist/cjs/components/TextEditorV2/ui/Switch.d.ts +7 -0
  379. package/dist/cjs/components/TextEditorV2/ui/Switch.js +15 -0
  380. package/dist/cjs/components/TextEditorV2/ui/Switch.js.map +1 -0
  381. package/dist/cjs/components/TextEditorV2/ui/TextInput.d.ts +12 -0
  382. package/dist/cjs/components/TextEditorV2/ui/TextInput.js +14 -0
  383. package/dist/cjs/components/TextEditorV2/ui/TextInput.js.map +1 -0
  384. package/dist/cjs/components/TextEditorV2/utils/emoji-list.d.ts +20 -0
  385. package/dist/cjs/components/TextEditorV2/utils/emoji-list.js +16607 -0
  386. package/dist/cjs/components/TextEditorV2/utils/emoji-list.js.map +1 -0
  387. package/dist/cjs/components/TextEditorV2/utils/getDOMRangeRect.d.ts +1 -0
  388. package/dist/cjs/components/TextEditorV2/utils/getDOMRangeRect.js +19 -0
  389. package/dist/cjs/components/TextEditorV2/utils/getDOMRangeRect.js.map +1 -0
  390. package/dist/cjs/components/TextEditorV2/utils/getPrepopulatedRichText.d.ts +1 -0
  391. package/dist/cjs/components/TextEditorV2/utils/getPrepopulatedRichText.js +35 -0
  392. package/dist/cjs/components/TextEditorV2/utils/getPrepopulatedRichText.js.map +1 -0
  393. package/dist/cjs/components/TextEditorV2/utils/getSelectedNode.d.ts +2 -0
  394. package/dist/cjs/components/TextEditorV2/utils/getSelectedNode.js +21 -0
  395. package/dist/cjs/components/TextEditorV2/utils/getSelectedNode.js.map +1 -0
  396. package/dist/cjs/components/TextEditorV2/utils/guard.d.ts +1 -0
  397. package/dist/cjs/components/TextEditorV2/utils/guard.js +7 -0
  398. package/dist/cjs/components/TextEditorV2/utils/guard.js.map +1 -0
  399. package/dist/cjs/components/TextEditorV2/utils/isMobileWidth.d.ts +0 -0
  400. package/dist/cjs/components/TextEditorV2/utils/isMobileWidth.js +2 -0
  401. package/dist/cjs/components/TextEditorV2/utils/isMobileWidth.js.map +1 -0
  402. package/dist/cjs/components/TextEditorV2/utils/joinClasses.d.ts +1 -0
  403. package/dist/cjs/components/TextEditorV2/utils/joinClasses.js +11 -0
  404. package/dist/cjs/components/TextEditorV2/utils/joinClasses.js.map +1 -0
  405. package/dist/cjs/components/TextEditorV2/utils/point.d.ts +14 -0
  406. package/dist/cjs/components/TextEditorV2/utils/point.js +51 -0
  407. package/dist/cjs/components/TextEditorV2/utils/point.js.map +1 -0
  408. package/dist/cjs/components/TextEditorV2/utils/rect.d.ts +38 -0
  409. package/dist/cjs/components/TextEditorV2/utils/rect.js +125 -0
  410. package/dist/cjs/components/TextEditorV2/utils/rect.js.map +1 -0
  411. package/dist/cjs/components/TextEditorV2/utils/setFloatingElemPosition.d.ts +1 -0
  412. package/dist/cjs/components/TextEditorV2/utils/setFloatingElemPosition.js +33 -0
  413. package/dist/cjs/components/TextEditorV2/utils/setFloatingElemPosition.js.map +1 -0
  414. package/dist/cjs/components/TextEditorV2/utils/setFloatingElemPositionForLinkEditor.d.ts +1 -0
  415. package/dist/cjs/components/TextEditorV2/utils/setFloatingElemPositionForLinkEditor.js +31 -0
  416. package/dist/cjs/components/TextEditorV2/utils/setFloatingElemPositionForLinkEditor.js.map +1 -0
  417. package/dist/cjs/components/TextEditorV2/utils/swipe.d.ts +4 -0
  418. package/dist/cjs/components/TextEditorV2/utils/swipe.js +97 -0
  419. package/dist/cjs/components/TextEditorV2/utils/swipe.js.map +1 -0
  420. package/dist/cjs/components/TextEditorV2/utils/url.d.ts +2 -0
  421. package/dist/cjs/components/TextEditorV2/utils/url.js +26 -0
  422. package/dist/cjs/components/TextEditorV2/utils/url.js.map +1 -0
  423. package/dist/cjs/components/Textarea/Textarea.js +28 -4
  424. package/dist/cjs/components/Textarea/Textarea.js.map +1 -1
  425. package/dist/cjs/index.d.ts +2 -1
  426. package/dist/cjs/index.js +5 -3
  427. package/dist/cjs/index.js.map +1 -1
  428. package/dist/esm/components/Combobox/Combobox.js +9 -3
  429. package/dist/esm/components/Combobox/Combobox.js.map +1 -1
  430. package/dist/esm/components/TextEditorV2/commenting/index.d.ts +41 -0
  431. package/dist/esm/components/TextEditorV2/commenting/index.js +334 -0
  432. package/dist/esm/components/TextEditorV2/commenting/index.js.map +1 -0
  433. package/dist/esm/components/TextEditorV2/constants.d.ts +1 -0
  434. package/dist/esm/components/TextEditorV2/constants.js +2 -0
  435. package/dist/esm/components/TextEditorV2/constants.js.map +1 -0
  436. package/dist/esm/components/TextEditorV2/context/SettingsContext.d.ts +12 -0
  437. package/dist/esm/components/TextEditorV2/context/SettingsContext.js +54 -0
  438. package/dist/esm/components/TextEditorV2/context/SettingsContext.js.map +1 -0
  439. package/dist/esm/components/TextEditorV2/context/SharedAutocompleteContext.d.ts +10 -0
  440. package/dist/esm/components/TextEditorV2/context/SharedAutocompleteContext.js +44 -0
  441. package/dist/esm/components/TextEditorV2/context/SharedAutocompleteContext.js.map +1 -0
  442. package/dist/esm/components/TextEditorV2/context/SharedHistoryContext.d.ts +11 -0
  443. package/dist/esm/components/TextEditorV2/context/SharedHistoryContext.js +11 -0
  444. package/dist/esm/components/TextEditorV2/context/SharedHistoryContext.js.map +1 -0
  445. package/dist/esm/components/TextEditorV2/editor.d.ts +10 -0
  446. package/dist/esm/components/TextEditorV2/editor.js +200 -0
  447. package/dist/esm/components/TextEditorV2/editor.js.map +1 -0
  448. package/dist/esm/components/TextEditorV2/hooks/useModal.d.ts +5 -0
  449. package/dist/esm/components/TextEditorV2/hooks/useModal.js +28 -0
  450. package/dist/esm/components/TextEditorV2/hooks/useModal.js.map +1 -0
  451. package/dist/esm/components/TextEditorV2/hooks/useReport.d.ts +1 -0
  452. package/dist/esm/components/TextEditorV2/hooks/useReport.js +42 -0
  453. package/dist/esm/components/TextEditorV2/hooks/useReport.js.map +1 -0
  454. package/dist/esm/components/TextEditorV2/lib/Settings.d.ts +2 -0
  455. package/dist/esm/components/TextEditorV2/lib/Settings.js +48 -0
  456. package/dist/esm/components/TextEditorV2/lib/Settings.js.map +1 -0
  457. package/dist/esm/components/TextEditorV2/lib/appSettings.d.ts +19 -0
  458. package/dist/esm/components/TextEditorV2/lib/appSettings.js +18 -0
  459. package/dist/esm/components/TextEditorV2/lib/appSettings.js.map +1 -0
  460. package/dist/esm/components/TextEditorV2/lib/collaboration.d.ts +3 -0
  461. package/dist/esm/components/TextEditorV2/lib/collaboration.js +23 -0
  462. package/dist/esm/components/TextEditorV2/lib/collaboration.js.map +1 -0
  463. package/dist/esm/components/TextEditorV2/lib/setupEnv.d.ts +1 -0
  464. package/dist/esm/components/TextEditorV2/lib/setupEnv.js +21 -0
  465. package/dist/esm/components/TextEditorV2/lib/setupEnv.js.map +1 -0
  466. package/dist/esm/components/TextEditorV2/nodes/AutocompleteNode.d.ts +25 -0
  467. package/dist/esm/components/TextEditorV2/nodes/AutocompleteNode.js +54 -0
  468. package/dist/esm/components/TextEditorV2/nodes/AutocompleteNode.js.map +1 -0
  469. package/dist/esm/components/TextEditorV2/nodes/EmojiNode.d.ts +18 -0
  470. package/dist/esm/components/TextEditorV2/nodes/EmojiNode.js +57 -0
  471. package/dist/esm/components/TextEditorV2/nodes/EmojiNode.js.map +1 -0
  472. package/dist/esm/components/TextEditorV2/nodes/EquationComponent.d.ts +9 -0
  473. package/dist/esm/components/TextEditorV2/nodes/EquationComponent.js +68 -0
  474. package/dist/esm/components/TextEditorV2/nodes/EquationComponent.js.map +1 -0
  475. package/dist/esm/components/TextEditorV2/nodes/EquationNode.d.ts +26 -0
  476. package/dist/esm/components/TextEditorV2/nodes/EquationNode.js +121 -0
  477. package/dist/esm/components/TextEditorV2/nodes/EquationNode.js.map +1 -0
  478. package/dist/esm/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawComponent.d.ts +6 -0
  479. package/dist/esm/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawComponent.js +113 -0
  480. package/dist/esm/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawComponent.js.map +1 -0
  481. package/dist/esm/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawImage.d.ts +50 -0
  482. package/dist/esm/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawImage.js +56 -0
  483. package/dist/esm/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawImage.js.map +1 -0
  484. package/dist/esm/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawModal.d.ts +44 -0
  485. package/dist/esm/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawModal.js +137 -0
  486. package/dist/esm/components/TextEditorV2/nodes/ExcalidrawNode/ExcalidrawModal.js.map +1 -0
  487. package/dist/esm/components/TextEditorV2/nodes/ExcalidrawNode/index.d.ts +22 -0
  488. package/dist/esm/components/TextEditorV2/nodes/ExcalidrawNode/index.js +98 -0
  489. package/dist/esm/components/TextEditorV2/nodes/ExcalidrawNode/index.js.map +1 -0
  490. package/dist/esm/components/TextEditorV2/nodes/ExtendedTextNode.d.ts +12 -0
  491. package/dist/esm/components/TextEditorV2/nodes/ExtendedTextNode.js +101 -0
  492. package/dist/esm/components/TextEditorV2/nodes/ExtendedTextNode.js.map +1 -0
  493. package/dist/esm/components/TextEditorV2/nodes/FigmaNode.d.ts +19 -0
  494. package/dist/esm/components/TextEditorV2/nodes/FigmaNode.js +58 -0
  495. package/dist/esm/components/TextEditorV2/nodes/FigmaNode.js.map +1 -0
  496. package/dist/esm/components/TextEditorV2/nodes/ImageComponent.d.ts +14 -0
  497. package/dist/esm/components/TextEditorV2/nodes/ImageComponent.js +207 -0
  498. package/dist/esm/components/TextEditorV2/nodes/ImageComponent.js.map +1 -0
  499. package/dist/esm/components/TextEditorV2/nodes/ImageNode.d.ts +56 -0
  500. package/dist/esm/components/TextEditorV2/nodes/ImageNode.js +131 -0
  501. package/dist/esm/components/TextEditorV2/nodes/ImageNode.js.map +1 -0
  502. package/dist/esm/components/TextEditorV2/nodes/InlineImageComponent.d.ts +18 -0
  503. package/dist/esm/components/TextEditorV2/nodes/InlineImageComponent.js +189 -0
  504. package/dist/esm/components/TextEditorV2/nodes/InlineImageComponent.js.map +1 -0
  505. package/dist/esm/components/TextEditorV2/nodes/InlineImageNode.d.ts +54 -0
  506. package/dist/esm/components/TextEditorV2/nodes/InlineImageNode.js +137 -0
  507. package/dist/esm/components/TextEditorV2/nodes/InlineImageNode.js.map +1 -0
  508. package/dist/esm/components/TextEditorV2/nodes/KeywordNode.d.ts +15 -0
  509. package/dist/esm/components/TextEditorV2/nodes/KeywordNode.js +49 -0
  510. package/dist/esm/components/TextEditorV2/nodes/KeywordNode.js.map +1 -0
  511. package/dist/esm/components/TextEditorV2/nodes/LayoutContainerNode.d.ts +21 -0
  512. package/dist/esm/components/TextEditorV2/nodes/LayoutContainerNode.js +58 -0
  513. package/dist/esm/components/TextEditorV2/nodes/LayoutContainerNode.js.map +1 -0
  514. package/dist/esm/components/TextEditorV2/nodes/LayoutItemNode.d.ts +15 -0
  515. package/dist/esm/components/TextEditorV2/nodes/LayoutItemNode.js +46 -0
  516. package/dist/esm/components/TextEditorV2/nodes/LayoutItemNode.js.map +1 -0
  517. package/dist/esm/components/TextEditorV2/nodes/MentionNode.d.ts +20 -0
  518. package/dist/esm/components/TextEditorV2/nodes/MentionNode.js +84 -0
  519. package/dist/esm/components/TextEditorV2/nodes/MentionNode.js.map +1 -0
  520. package/dist/esm/components/TextEditorV2/nodes/PageBreakNode/index.d.ts +17 -0
  521. package/dist/esm/components/TextEditorV2/nodes/PageBreakNode/index.js +108 -0
  522. package/dist/esm/components/TextEditorV2/nodes/PageBreakNode/index.js.map +1 -0
  523. package/dist/esm/components/TextEditorV2/nodes/PlaygroundNodes.d.ts +3 -0
  524. package/dist/esm/components/TextEditorV2/nodes/PlaygroundNodes.js +66 -0
  525. package/dist/esm/components/TextEditorV2/nodes/PlaygroundNodes.js.map +1 -0
  526. package/dist/esm/components/TextEditorV2/nodes/PollComponent.d.ts +8 -0
  527. package/dist/esm/components/TextEditorV2/nodes/PollComponent.js +109 -0
  528. package/dist/esm/components/TextEditorV2/nodes/PollComponent.js.map +1 -0
  529. package/dist/esm/components/TextEditorV2/nodes/PollNode.d.ts +33 -0
  530. package/dist/esm/components/TextEditorV2/nodes/PollNode.js +143 -0
  531. package/dist/esm/components/TextEditorV2/nodes/PollNode.js.map +1 -0
  532. package/dist/esm/components/TextEditorV2/nodes/StickyComponent.d.ts +9 -0
  533. package/dist/esm/components/TextEditorV2/nodes/StickyComponent.js +163 -0
  534. package/dist/esm/components/TextEditorV2/nodes/StickyComponent.js.map +1 -0
  535. package/dist/esm/components/TextEditorV2/nodes/StickyNode.d.ts +37 -0
  536. package/dist/esm/components/TextEditorV2/nodes/StickyNode.js +89 -0
  537. package/dist/esm/components/TextEditorV2/nodes/StickyNode.js.map +1 -0
  538. package/dist/esm/components/TextEditorV2/nodes/TableNode.d.ts +54 -0
  539. package/dist/esm/components/TextEditorV2/nodes/TableNode.js +188 -0
  540. package/dist/esm/components/TextEditorV2/nodes/TableNode.js.map +1 -0
  541. package/dist/esm/components/TextEditorV2/nodes/TweetNode.d.ts +28 -0
  542. package/dist/esm/components/TextEditorV2/nodes/TweetNode.js +151 -0
  543. package/dist/esm/components/TextEditorV2/nodes/TweetNode.js.map +1 -0
  544. package/dist/esm/components/TextEditorV2/nodes/YouTubeNode.d.ts +28 -0
  545. package/dist/esm/components/TextEditorV2/nodes/YouTubeNode.js +98 -0
  546. package/dist/esm/components/TextEditorV2/nodes/YouTubeNode.js.map +1 -0
  547. package/dist/esm/components/TextEditorV2/plugins/ActionsPlugin/index.d.ts +2 -0
  548. package/dist/esm/components/TextEditorV2/plugins/ActionsPlugin/index.js +180 -0
  549. package/dist/esm/components/TextEditorV2/plugins/ActionsPlugin/index.js.map +1 -0
  550. package/dist/esm/components/TextEditorV2/plugins/AutoEmbedPlugin/index.d.ts +19 -0
  551. package/dist/esm/components/TextEditorV2/plugins/AutoEmbedPlugin/index.js +174 -0
  552. package/dist/esm/components/TextEditorV2/plugins/AutoEmbedPlugin/index.js.map +1 -0
  553. package/dist/esm/components/TextEditorV2/plugins/AutoLinkPlugin/index.d.ts +2 -0
  554. package/dist/esm/components/TextEditorV2/plugins/AutoLinkPlugin/index.js +12 -0
  555. package/dist/esm/components/TextEditorV2/plugins/AutoLinkPlugin/index.js.map +1 -0
  556. package/dist/esm/components/TextEditorV2/plugins/AutocompletePlugin/index.d.ts +2 -0
  557. package/dist/esm/components/TextEditorV2/plugins/AutocompletePlugin/index.js +2461 -0
  558. package/dist/esm/components/TextEditorV2/plugins/AutocompletePlugin/index.js.map +1 -0
  559. package/dist/esm/components/TextEditorV2/plugins/CodeActionMenuPlugin/components/CopyButton/index.d.ts +8 -0
  560. package/dist/esm/components/TextEditorV2/plugins/CodeActionMenuPlugin/components/CopyButton/index.js +52 -0
  561. package/dist/esm/components/TextEditorV2/plugins/CodeActionMenuPlugin/components/CopyButton/index.js.map +1 -0
  562. package/dist/esm/components/TextEditorV2/plugins/CodeActionMenuPlugin/components/PrettierButton/index.d.ts +10 -0
  563. package/dist/esm/components/TextEditorV2/plugins/CodeActionMenuPlugin/components/PrettierButton/index.js +155 -0
  564. package/dist/esm/components/TextEditorV2/plugins/CodeActionMenuPlugin/components/PrettierButton/index.js.map +1 -0
  565. package/dist/esm/components/TextEditorV2/plugins/CodeActionMenuPlugin/index.d.ts +4 -0
  566. package/dist/esm/components/TextEditorV2/plugins/CodeActionMenuPlugin/index.js +108 -0
  567. package/dist/esm/components/TextEditorV2/plugins/CodeActionMenuPlugin/index.js.map +1 -0
  568. package/dist/esm/components/TextEditorV2/plugins/CodeActionMenuPlugin/utils.d.ts +1 -0
  569. package/dist/esm/components/TextEditorV2/plugins/CodeActionMenuPlugin/utils.js +18 -0
  570. package/dist/esm/components/TextEditorV2/plugins/CodeActionMenuPlugin/utils.js.map +1 -0
  571. package/dist/esm/components/TextEditorV2/plugins/CodeHighlightPlugin/index.d.ts +1 -0
  572. package/dist/esm/components/TextEditorV2/plugins/CodeHighlightPlugin/index.js +9 -0
  573. package/dist/esm/components/TextEditorV2/plugins/CodeHighlightPlugin/index.js.map +1 -0
  574. package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContainerNode.d.ts +23 -0
  575. package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContainerNode.js +82 -0
  576. package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContainerNode.js.map +1 -0
  577. package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContentNode.d.ts +17 -0
  578. package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContentNode.js +64 -0
  579. package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleContentNode.js.map +1 -0
  580. package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleTitleNode.d.ts +18 -0
  581. package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleTitleNode.js +89 -0
  582. package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/CollapsibleTitleNode.js.map +1 -0
  583. package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/index.d.ts +3 -0
  584. package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/index.js +144 -0
  585. package/dist/esm/components/TextEditorV2/plugins/CollapsiblePlugin/index.js.map +1 -0
  586. package/dist/esm/components/TextEditorV2/plugins/ComponentPickerPlugin/index.d.ts +2 -0
  587. package/dist/esm/components/TextEditorV2/plugins/ComponentPickerPlugin/index.js +261 -0
  588. package/dist/esm/components/TextEditorV2/plugins/ComponentPickerPlugin/index.js.map +1 -0
  589. package/dist/esm/components/TextEditorV2/plugins/ContextMenuPlugin/index.d.ts +11 -0
  590. package/dist/esm/components/TextEditorV2/plugins/ContextMenuPlugin/index.js +167 -0
  591. package/dist/esm/components/TextEditorV2/plugins/ContextMenuPlugin/index.js.map +1 -0
  592. package/dist/esm/components/TextEditorV2/plugins/DocsPlugin/index.d.ts +2 -0
  593. package/dist/esm/components/TextEditorV2/plugins/DocsPlugin/index.js +6 -0
  594. package/dist/esm/components/TextEditorV2/plugins/DocsPlugin/index.js.map +1 -0
  595. package/dist/esm/components/TextEditorV2/plugins/DragDropPastePlugin/index.d.ts +1 -0
  596. package/dist/esm/components/TextEditorV2/plugins/DragDropPastePlugin/index.js +41 -0
  597. package/dist/esm/components/TextEditorV2/plugins/DragDropPastePlugin/index.js.map +1 -0
  598. package/dist/esm/components/TextEditorV2/plugins/DraggableBlockPlugin/index.d.ts +4 -0
  599. package/dist/esm/components/TextEditorV2/plugins/DraggableBlockPlugin/index.js +284 -0
  600. package/dist/esm/components/TextEditorV2/plugins/DraggableBlockPlugin/index.js.map +1 -0
  601. package/dist/esm/components/TextEditorV2/plugins/EmojiPickerPlugin/index.d.ts +2 -0
  602. package/dist/esm/components/TextEditorV2/plugins/EmojiPickerPlugin/index.js +94 -0
  603. package/dist/esm/components/TextEditorV2/plugins/EmojiPickerPlugin/index.js.map +1 -0
  604. package/dist/esm/components/TextEditorV2/plugins/EmojisPlugin/index.d.ts +1 -0
  605. package/dist/esm/components/TextEditorV2/plugins/EmojisPlugin/index.js +61 -0
  606. package/dist/esm/components/TextEditorV2/plugins/EmojisPlugin/index.js.map +1 -0
  607. package/dist/esm/components/TextEditorV2/plugins/EquationsPlugin/index.d.ts +14 -0
  608. package/dist/esm/components/TextEditorV2/plugins/EquationsPlugin/index.js +36 -0
  609. package/dist/esm/components/TextEditorV2/plugins/EquationsPlugin/index.js.map +1 -0
  610. package/dist/esm/components/TextEditorV2/plugins/ExcalidrawPlugin/index.d.ts +3 -0
  611. package/dist/esm/components/TextEditorV2/plugins/ExcalidrawPlugin/index.js +24 -0
  612. package/dist/esm/components/TextEditorV2/plugins/ExcalidrawPlugin/index.js.map +1 -0
  613. package/dist/esm/components/TextEditorV2/plugins/FigmaPlugin/index.d.ts +3 -0
  614. package/dist/esm/components/TextEditorV2/plugins/FigmaPlugin/index.js +21 -0
  615. package/dist/esm/components/TextEditorV2/plugins/FigmaPlugin/index.js.map +1 -0
  616. package/dist/esm/components/TextEditorV2/plugins/FloatingLinkEditorPlugin/index.d.ts +7 -0
  617. package/dist/esm/components/TextEditorV2/plugins/FloatingLinkEditorPlugin/index.js +196 -0
  618. package/dist/esm/components/TextEditorV2/plugins/FloatingLinkEditorPlugin/index.js.map +1 -0
  619. package/dist/esm/components/TextEditorV2/plugins/FloatingTextFormatToolbarPlugin/index.d.ts +4 -0
  620. package/dist/esm/components/TextEditorV2/plugins/FloatingTextFormatToolbarPlugin/index.js +225 -0
  621. package/dist/esm/components/TextEditorV2/plugins/FloatingTextFormatToolbarPlugin/index.js.map +1 -0
  622. package/dist/esm/components/TextEditorV2/plugins/ImagesPlugin/index.d.ts +22 -0
  623. package/dist/esm/components/TextEditorV2/plugins/ImagesPlugin/index.js +181 -0
  624. package/dist/esm/components/TextEditorV2/plugins/ImagesPlugin/index.js.map +1 -0
  625. package/dist/esm/components/TextEditorV2/plugins/InlineImagePlugin/index.d.ts +17 -0
  626. package/dist/esm/components/TextEditorV2/plugins/InlineImagePlugin/index.js +187 -0
  627. package/dist/esm/components/TextEditorV2/plugins/InlineImagePlugin/index.js.map +1 -0
  628. package/dist/esm/components/TextEditorV2/plugins/KeywordsPlugin/index.d.ts +1 -0
  629. package/dist/esm/components/TextEditorV2/plugins/KeywordsPlugin/index.js +30 -0
  630. package/dist/esm/components/TextEditorV2/plugins/KeywordsPlugin/index.js.map +1 -0
  631. package/dist/esm/components/TextEditorV2/plugins/LayoutPlugin/InsertLayoutDialog.d.ts +6 -0
  632. package/dist/esm/components/TextEditorV2/plugins/LayoutPlugin/InsertLayoutDialog.js +30 -0
  633. package/dist/esm/components/TextEditorV2/plugins/LayoutPlugin/InsertLayoutDialog.js.map +1 -0
  634. package/dist/esm/components/TextEditorV2/plugins/LayoutPlugin/LayoutPlugin.d.ts +7 -0
  635. package/dist/esm/components/TextEditorV2/plugins/LayoutPlugin/LayoutPlugin.js +85 -0
  636. package/dist/esm/components/TextEditorV2/plugins/LayoutPlugin/LayoutPlugin.js.map +1 -0
  637. package/dist/esm/components/TextEditorV2/plugins/LinkPlugin/index.d.ts +2 -0
  638. package/dist/esm/components/TextEditorV2/plugins/LinkPlugin/index.js +7 -0
  639. package/dist/esm/components/TextEditorV2/plugins/LinkPlugin/index.js.map +1 -0
  640. package/dist/esm/components/TextEditorV2/plugins/ListMaxIndentLevelPlugin/index.d.ts +5 -0
  641. package/dist/esm/components/TextEditorV2/plugins/ListMaxIndentLevelPlugin/index.js +41 -0
  642. package/dist/esm/components/TextEditorV2/plugins/ListMaxIndentLevelPlugin/index.js.map +1 -0
  643. package/dist/esm/components/TextEditorV2/plugins/MarkdownShortcutPlugin/index.d.ts +2 -0
  644. package/dist/esm/components/TextEditorV2/plugins/MarkdownShortcutPlugin/index.js +7 -0
  645. package/dist/esm/components/TextEditorV2/plugins/MarkdownShortcutPlugin/index.js.map +1 -0
  646. package/dist/esm/components/TextEditorV2/plugins/MarkdownTransformers/index.d.ts +8 -0
  647. package/dist/esm/components/TextEditorV2/plugins/MarkdownTransformers/index.js +239 -0
  648. package/dist/esm/components/TextEditorV2/plugins/MarkdownTransformers/index.js.map +1 -0
  649. package/dist/esm/components/TextEditorV2/plugins/MaxLengthPlugin/index.d.ts +3 -0
  650. package/dist/esm/components/TextEditorV2/plugins/MaxLengthPlugin/index.js +38 -0
  651. package/dist/esm/components/TextEditorV2/plugins/MaxLengthPlugin/index.js.map +1 -0
  652. package/dist/esm/components/TextEditorV2/plugins/MentionsPlugin/index.d.ts +2 -0
  653. package/dist/esm/components/TextEditorV2/plugins/MentionsPlugin/index.js +557 -0
  654. package/dist/esm/components/TextEditorV2/plugins/MentionsPlugin/index.js.map +1 -0
  655. package/dist/esm/components/TextEditorV2/plugins/PageBreakPlugin/index.d.ts +3 -0
  656. package/dist/esm/components/TextEditorV2/plugins/PageBreakPlugin/index.js +27 -0
  657. package/dist/esm/components/TextEditorV2/plugins/PageBreakPlugin/index.js.map +1 -0
  658. package/dist/esm/components/TextEditorV2/plugins/PasteLogPlugin/index.d.ts +2 -0
  659. package/dist/esm/components/TextEditorV2/plugins/PasteLogPlugin/index.js +33 -0
  660. package/dist/esm/components/TextEditorV2/plugins/PasteLogPlugin/index.js.map +1 -0
  661. package/dist/esm/components/TextEditorV2/plugins/PollPlugin/index.d.ts +8 -0
  662. package/dist/esm/components/TextEditorV2/plugins/PollPlugin/index.js +40 -0
  663. package/dist/esm/components/TextEditorV2/plugins/PollPlugin/index.js.map +1 -0
  664. package/dist/esm/components/TextEditorV2/plugins/StickyPlugin/index.d.ts +1 -0
  665. package/dist/esm/components/TextEditorV2/plugins/StickyPlugin/index.js +13 -0
  666. package/dist/esm/components/TextEditorV2/plugins/StickyPlugin/index.js.map +1 -0
  667. package/dist/esm/components/TextEditorV2/plugins/TabFocusPlugin/index.d.ts +1 -0
  668. package/dist/esm/components/TextEditorV2/plugins/TabFocusPlugin/index.js +35 -0
  669. package/dist/esm/components/TextEditorV2/plugins/TabFocusPlugin/index.js.map +1 -0
  670. package/dist/esm/components/TextEditorV2/plugins/TableActionMenuPlugin/index.d.ts +5 -0
  671. package/dist/esm/components/TextEditorV2/plugins/TableActionMenuPlugin/index.js +483 -0
  672. package/dist/esm/components/TextEditorV2/plugins/TableActionMenuPlugin/index.js.map +1 -0
  673. package/dist/esm/components/TextEditorV2/plugins/TableCellResizer/index.d.ts +2 -0
  674. package/dist/esm/components/TextEditorV2/plugins/TableCellResizer/index.js +249 -0
  675. package/dist/esm/components/TextEditorV2/plugins/TableCellResizer/index.js.map +1 -0
  676. package/dist/esm/components/TextEditorV2/plugins/TableOfContentsPlugin/index.d.ts +2 -0
  677. package/dist/esm/components/TextEditorV2/plugins/TableOfContentsPlugin/index.js +113 -0
  678. package/dist/esm/components/TextEditorV2/plugins/TableOfContentsPlugin/index.js.map +1 -0
  679. package/dist/esm/components/TextEditorV2/plugins/TablePlugin.d.ts +32 -0
  680. package/dist/esm/components/TextEditorV2/plugins/TablePlugin.js +78 -0
  681. package/dist/esm/components/TextEditorV2/plugins/TablePlugin.js.map +1 -0
  682. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/bold-text.d.ts +6 -0
  683. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/bold-text.js +14 -0
  684. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/bold-text.js.map +1 -0
  685. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/bullet.d.ts +6 -0
  686. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/bullet.js +24 -0
  687. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/bullet.js.map +1 -0
  688. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/font-size.d.ts +6 -0
  689. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/font-size.js +61 -0
  690. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/font-size.js.map +1 -0
  691. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/heading.d.ts +6 -0
  692. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/heading.js +67 -0
  693. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/heading.js.map +1 -0
  694. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/italic-text.d.ts +6 -0
  695. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/italic-text.js +14 -0
  696. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/italic-text.js.map +1 -0
  697. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/link.d.ts +5 -0
  698. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/link.js +42 -0
  699. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/link.js.map +1 -0
  700. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/number-bullet.d.ts +6 -0
  701. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/number-bullet.js +24 -0
  702. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/number-bullet.js.map +1 -0
  703. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/text-align.d.ts +6 -0
  704. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/text-align.js +48 -0
  705. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/text-align.js.map +1 -0
  706. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/text-color.d.ts +6 -0
  707. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/text-color.js +24 -0
  708. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/text-color.js.map +1 -0
  709. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/underline-text.d.ts +6 -0
  710. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/underline-text.js +15 -0
  711. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/underline-text.js.map +1 -0
  712. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-image.d.ts +6 -0
  713. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-image.js +37 -0
  714. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-image.js.map +1 -0
  715. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-pdf.d.ts +11 -0
  716. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-pdf.js +159 -0
  717. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/components/upload-pdf.js.map +1 -0
  718. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/index.d.ts +4 -0
  719. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/index.js +159 -0
  720. package/dist/esm/components/TextEditorV2/plugins/ToolbarPlugin/index.js.map +1 -0
  721. package/dist/esm/components/TextEditorV2/plugins/TreeViewPlugin/index.d.ts +2 -0
  722. package/dist/esm/components/TextEditorV2/plugins/TreeViewPlugin/index.js +8 -0
  723. package/dist/esm/components/TextEditorV2/plugins/TreeViewPlugin/index.js.map +1 -0
  724. package/dist/esm/components/TextEditorV2/plugins/TwitterPlugin/index.d.ts +3 -0
  725. package/dist/esm/components/TextEditorV2/plugins/TwitterPlugin/index.js +21 -0
  726. package/dist/esm/components/TextEditorV2/plugins/TwitterPlugin/index.js.map +1 -0
  727. package/dist/esm/components/TextEditorV2/plugins/YouTubePlugin/index.d.ts +3 -0
  728. package/dist/esm/components/TextEditorV2/plugins/YouTubePlugin/index.js +21 -0
  729. package/dist/esm/components/TextEditorV2/plugins/YouTubePlugin/index.js.map +1 -0
  730. package/dist/esm/components/TextEditorV2/shared/canUseDOM.d.ts +1 -0
  731. package/dist/esm/components/TextEditorV2/shared/canUseDOM.js +4 -0
  732. package/dist/esm/components/TextEditorV2/shared/canUseDOM.js.map +1 -0
  733. package/dist/esm/components/TextEditorV2/shared/caretFromPoint.d.ts +4 -0
  734. package/dist/esm/components/TextEditorV2/shared/caretFromPoint.js +29 -0
  735. package/dist/esm/components/TextEditorV2/shared/caretFromPoint.js.map +1 -0
  736. package/dist/esm/components/TextEditorV2/shared/environment.d.ts +16 -0
  737. package/dist/esm/components/TextEditorV2/shared/environment.js +14 -0
  738. package/dist/esm/components/TextEditorV2/shared/environment.js.map +1 -0
  739. package/dist/esm/components/TextEditorV2/shared/invariant.d.ts +1 -0
  740. package/dist/esm/components/TextEditorV2/shared/invariant.js +12 -0
  741. package/dist/esm/components/TextEditorV2/shared/invariant.js.map +1 -0
  742. package/dist/esm/components/TextEditorV2/shared/simpleDiffWithCursor.d.ts +5 -0
  743. package/dist/esm/components/TextEditorV2/shared/simpleDiffWithCursor.js +25 -0
  744. package/dist/esm/components/TextEditorV2/shared/simpleDiffWithCursor.js.map +1 -0
  745. package/dist/esm/components/TextEditorV2/shared/useLayoutEffect.d.ts +3 -0
  746. package/dist/esm/components/TextEditorV2/shared/useLayoutEffect.js +5 -0
  747. package/dist/esm/components/TextEditorV2/shared/useLayoutEffect.js.map +1 -0
  748. package/dist/esm/components/TextEditorV2/shared/warnOnlyOnce.d.ts +1 -0
  749. package/dist/esm/components/TextEditorV2/shared/warnOnlyOnce.js +13 -0
  750. package/dist/esm/components/TextEditorV2/shared/warnOnlyOnce.js.map +1 -0
  751. package/dist/esm/components/TextEditorV2/style.d.ts +2 -0
  752. package/dist/esm/components/TextEditorV2/style.js +5 -0
  753. package/dist/esm/components/TextEditorV2/style.js.map +1 -0
  754. package/dist/esm/components/TextEditorV2/themes/CommentEditorTheme.d.ts +3 -0
  755. package/dist/esm/components/TextEditorV2/themes/CommentEditorTheme.js +5 -0
  756. package/dist/esm/components/TextEditorV2/themes/CommentEditorTheme.js.map +1 -0
  757. package/dist/esm/components/TextEditorV2/themes/PlaygroundEditorTheme.d.ts +3 -0
  758. package/dist/esm/components/TextEditorV2/themes/PlaygroundEditorTheme.js +105 -0
  759. package/dist/esm/components/TextEditorV2/themes/PlaygroundEditorTheme.js.map +1 -0
  760. package/dist/esm/components/TextEditorV2/themes/StickyEditorTheme.d.ts +3 -0
  761. package/dist/esm/components/TextEditorV2/themes/StickyEditorTheme.js +5 -0
  762. package/dist/esm/components/TextEditorV2/themes/StickyEditorTheme.js.map +1 -0
  763. package/dist/esm/components/TextEditorV2/ui/Button.d.ts +11 -0
  764. package/dist/esm/components/TextEditorV2/ui/Button.js +8 -0
  765. package/dist/esm/components/TextEditorV2/ui/Button.js.map +1 -0
  766. package/dist/esm/components/TextEditorV2/ui/ColorPicker.d.ts +12 -0
  767. package/dist/esm/components/TextEditorV2/ui/ColorPicker.js +212 -0
  768. package/dist/esm/components/TextEditorV2/ui/ColorPicker.js.map +1 -0
  769. package/dist/esm/components/TextEditorV2/ui/ContentEditable.d.ts +4 -0
  770. package/dist/esm/components/TextEditorV2/ui/ContentEditable.js +7 -0
  771. package/dist/esm/components/TextEditorV2/ui/ContentEditable.js.map +1 -0
  772. package/dist/esm/components/TextEditorV2/ui/Dialog.d.ts +9 -0
  773. package/dist/esm/components/TextEditorV2/ui/Dialog.js +10 -0
  774. package/dist/esm/components/TextEditorV2/ui/Dialog.js.map +1 -0
  775. package/dist/esm/components/TextEditorV2/ui/DropDown.d.ts +17 -0
  776. package/dist/esm/components/TextEditorV2/ui/DropDown.js +129 -0
  777. package/dist/esm/components/TextEditorV2/ui/DropDown.js.map +1 -0
  778. package/dist/esm/components/TextEditorV2/ui/DropdownColorPicker.d.ts +21 -0
  779. package/dist/esm/components/TextEditorV2/ui/DropdownColorPicker.js +17 -0
  780. package/dist/esm/components/TextEditorV2/ui/DropdownColorPicker.js.map +1 -0
  781. package/dist/esm/components/TextEditorV2/ui/EquationEditor.d.ts +8 -0
  782. package/dist/esm/components/TextEditorV2/ui/EquationEditor.js +17 -0
  783. package/dist/esm/components/TextEditorV2/ui/EquationEditor.js.map +1 -0
  784. package/dist/esm/components/TextEditorV2/ui/FileInput.d.ts +9 -0
  785. package/dist/esm/components/TextEditorV2/ui/FileInput.js +8 -0
  786. package/dist/esm/components/TextEditorV2/ui/FileInput.js.map +1 -0
  787. package/dist/esm/components/TextEditorV2/ui/ImageResizer.d.ts +11 -0
  788. package/dist/esm/components/TextEditorV2/ui/ImageResizer.js +174 -0
  789. package/dist/esm/components/TextEditorV2/ui/ImageResizer.js.map +1 -0
  790. package/dist/esm/components/TextEditorV2/ui/KatexEquationAlterer.d.ts +7 -0
  791. package/dist/esm/components/TextEditorV2/ui/KatexEquationAlterer.js +35 -0
  792. package/dist/esm/components/TextEditorV2/ui/KatexEquationAlterer.js.map +1 -0
  793. package/dist/esm/components/TextEditorV2/ui/KatexRenderer.d.ts +6 -0
  794. package/dist/esm/components/TextEditorV2/ui/KatexRenderer.js +29 -0
  795. package/dist/esm/components/TextEditorV2/ui/KatexRenderer.js.map +1 -0
  796. package/dist/esm/components/TextEditorV2/ui/Modal.d.ts +8 -0
  797. package/dist/esm/components/TextEditorV2/ui/Modal.js +50 -0
  798. package/dist/esm/components/TextEditorV2/ui/Modal.js.map +1 -0
  799. package/dist/esm/components/TextEditorV2/ui/Placeholder.d.ts +6 -0
  800. package/dist/esm/components/TextEditorV2/ui/Placeholder.js +6 -0
  801. package/dist/esm/components/TextEditorV2/ui/Placeholder.js.map +1 -0
  802. package/dist/esm/components/TextEditorV2/ui/Select.d.ts +7 -0
  803. package/dist/esm/components/TextEditorV2/ui/Select.js +9 -0
  804. package/dist/esm/components/TextEditorV2/ui/Select.js.map +1 -0
  805. package/dist/esm/components/TextEditorV2/ui/Switch.d.ts +7 -0
  806. package/dist/esm/components/TextEditorV2/ui/Switch.js +11 -0
  807. package/dist/esm/components/TextEditorV2/ui/Switch.js.map +1 -0
  808. package/dist/esm/components/TextEditorV2/ui/TextInput.d.ts +12 -0
  809. package/dist/esm/components/TextEditorV2/ui/TextInput.js +10 -0
  810. package/dist/esm/components/TextEditorV2/ui/TextInput.js.map +1 -0
  811. package/dist/esm/components/TextEditorV2/utils/emoji-list.d.ts +20 -0
  812. package/dist/esm/components/TextEditorV2/utils/emoji-list.js +16605 -0
  813. package/dist/esm/components/TextEditorV2/utils/emoji-list.js.map +1 -0
  814. package/dist/esm/components/TextEditorV2/utils/getDOMRangeRect.d.ts +1 -0
  815. package/dist/esm/components/TextEditorV2/utils/getDOMRangeRect.js +16 -0
  816. package/dist/esm/components/TextEditorV2/utils/getDOMRangeRect.js.map +1 -0
  817. package/dist/esm/components/TextEditorV2/utils/getPrepopulatedRichText.d.ts +1 -0
  818. package/dist/esm/components/TextEditorV2/utils/getPrepopulatedRichText.js +32 -0
  819. package/dist/esm/components/TextEditorV2/utils/getPrepopulatedRichText.js.map +1 -0
  820. package/dist/esm/components/TextEditorV2/utils/getSelectedNode.d.ts +2 -0
  821. package/dist/esm/components/TextEditorV2/utils/getSelectedNode.js +18 -0
  822. package/dist/esm/components/TextEditorV2/utils/getSelectedNode.js.map +1 -0
  823. package/dist/esm/components/TextEditorV2/utils/guard.d.ts +1 -0
  824. package/dist/esm/components/TextEditorV2/utils/guard.js +4 -0
  825. package/dist/esm/components/TextEditorV2/utils/guard.js.map +1 -0
  826. package/dist/esm/components/TextEditorV2/utils/isMobileWidth.d.ts +0 -0
  827. package/dist/esm/components/TextEditorV2/utils/isMobileWidth.js +2 -0
  828. package/dist/esm/components/TextEditorV2/utils/isMobileWidth.js.map +1 -0
  829. package/dist/esm/components/TextEditorV2/utils/joinClasses.d.ts +1 -0
  830. package/dist/esm/components/TextEditorV2/utils/joinClasses.js +8 -0
  831. package/dist/esm/components/TextEditorV2/utils/joinClasses.js.map +1 -0
  832. package/dist/esm/components/TextEditorV2/utils/point.d.ts +14 -0
  833. package/dist/esm/components/TextEditorV2/utils/point.js +47 -0
  834. package/dist/esm/components/TextEditorV2/utils/point.js.map +1 -0
  835. package/dist/esm/components/TextEditorV2/utils/rect.d.ts +38 -0
  836. package/dist/esm/components/TextEditorV2/utils/rect.js +122 -0
  837. package/dist/esm/components/TextEditorV2/utils/rect.js.map +1 -0
  838. package/dist/esm/components/TextEditorV2/utils/setFloatingElemPosition.d.ts +1 -0
  839. package/dist/esm/components/TextEditorV2/utils/setFloatingElemPosition.js +30 -0
  840. package/dist/esm/components/TextEditorV2/utils/setFloatingElemPosition.js.map +1 -0
  841. package/dist/esm/components/TextEditorV2/utils/setFloatingElemPositionForLinkEditor.d.ts +1 -0
  842. package/dist/esm/components/TextEditorV2/utils/setFloatingElemPositionForLinkEditor.js +28 -0
  843. package/dist/esm/components/TextEditorV2/utils/setFloatingElemPositionForLinkEditor.js.map +1 -0
  844. package/dist/esm/components/TextEditorV2/utils/swipe.d.ts +4 -0
  845. package/dist/esm/components/TextEditorV2/utils/swipe.js +91 -0
  846. package/dist/esm/components/TextEditorV2/utils/swipe.js.map +1 -0
  847. package/dist/esm/components/TextEditorV2/utils/url.d.ts +2 -0
  848. package/dist/esm/components/TextEditorV2/utils/url.js +22 -0
  849. package/dist/esm/components/TextEditorV2/utils/url.js.map +1 -0
  850. package/dist/esm/components/Textarea/Textarea.js +28 -4
  851. package/dist/esm/components/Textarea/Textarea.js.map +1 -1
  852. package/dist/esm/index.d.ts +2 -1
  853. package/dist/esm/index.js +2 -1
  854. package/dist/esm/index.js.map +1 -1
  855. package/package.json +11 -2
@@ -0,0 +1,212 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.RIGHT_CLICK_IMAGE_COMMAND = void 0;
4
+ exports.default = ImageComponent;
5
+ var tslib_1 = require("tslib");
6
+ var LexicalAutoFocusPlugin_1 = require("@lexical/react/LexicalAutoFocusPlugin");
7
+ var LexicalCollaborationContext_1 = require("@lexical/react/LexicalCollaborationContext");
8
+ var LexicalCollaborationPlugin_1 = require("@lexical/react/LexicalCollaborationPlugin");
9
+ var LexicalComposerContext_1 = require("@lexical/react/LexicalComposerContext");
10
+ var LexicalErrorBoundary_1 = tslib_1.__importDefault(require("@lexical/react/LexicalErrorBoundary"));
11
+ var LexicalHashtagPlugin_1 = require("@lexical/react/LexicalHashtagPlugin");
12
+ var LexicalHistoryPlugin_1 = require("@lexical/react/LexicalHistoryPlugin");
13
+ var LexicalNestedComposer_1 = require("@lexical/react/LexicalNestedComposer");
14
+ var LexicalRichTextPlugin_1 = require("@lexical/react/LexicalRichTextPlugin");
15
+ var useLexicalNodeSelection_1 = require("@lexical/react/useLexicalNodeSelection");
16
+ var utils_1 = require("@lexical/utils");
17
+ var lexical_1 = require("lexical");
18
+ var React = tslib_1.__importStar(require("react"));
19
+ var react_1 = require("react");
20
+ var SettingsContext_1 = require("../context/SettingsContext");
21
+ var SharedHistoryContext_1 = require("../context/SharedHistoryContext");
22
+ var collaboration_1 = require("../lib/collaboration");
23
+ var EmojisPlugin_1 = tslib_1.__importDefault(require("../plugins/EmojisPlugin"));
24
+ var KeywordsPlugin_1 = tslib_1.__importDefault(require("../plugins/KeywordsPlugin"));
25
+ var LinkPlugin_1 = tslib_1.__importDefault(require("../plugins/LinkPlugin"));
26
+ var MentionsPlugin_1 = tslib_1.__importDefault(require("../plugins/MentionsPlugin"));
27
+ var TreeViewPlugin_1 = tslib_1.__importDefault(require("../plugins/TreeViewPlugin"));
28
+ var ContentEditable_1 = tslib_1.__importDefault(require("../ui/ContentEditable"));
29
+ var ImageResizer_1 = tslib_1.__importDefault(require("../ui/ImageResizer"));
30
+ var Placeholder_1 = tslib_1.__importDefault(require("../ui/Placeholder"));
31
+ var ImageNode_1 = require("./ImageNode");
32
+ var imageCache = new Set();
33
+ exports.RIGHT_CLICK_IMAGE_COMMAND = (0, lexical_1.createCommand)('RIGHT_CLICK_IMAGE_COMMAND');
34
+ function useSuspenseImage(src) {
35
+ if (!imageCache.has(src)) {
36
+ throw new Promise(function (resolve) {
37
+ var img = new Image();
38
+ img.src = src;
39
+ img.onload = function () {
40
+ imageCache.add(src);
41
+ resolve(null);
42
+ };
43
+ });
44
+ }
45
+ }
46
+ function LazyImage(_a) {
47
+ var altText = _a.altText, className = _a.className, height = _a.height, imageRef = _a.imageRef, maxWidth = _a.maxWidth, src = _a.src, width = _a.width;
48
+ useSuspenseImage(src);
49
+ return (React.createElement("img", { ref: imageRef, alt: altText, className: className || undefined, draggable: 'false', src: src, style: {
50
+ height: height,
51
+ maxWidth: maxWidth,
52
+ width: width,
53
+ } }));
54
+ }
55
+ function ImageComponent(_a) {
56
+ var altText = _a.altText, caption = _a.caption, height = _a.height, maxWidth = _a.maxWidth, nodeKey = _a.nodeKey, resizable = _a.resizable, showCaption = _a.showCaption, src = _a.src, width = _a.width;
57
+ var imageRef = (0, react_1.useRef)(null);
58
+ var buttonRef = (0, react_1.useRef)(null);
59
+ var _b = (0, useLexicalNodeSelection_1.useLexicalNodeSelection)(nodeKey), isSelected = _b[0], setSelected = _b[1], clearSelection = _b[2];
60
+ var _c = (0, react_1.useState)(false), isResizing = _c[0], setIsResizing = _c[1];
61
+ var isCollabActive = (0, LexicalCollaborationContext_1.useCollaborationContext)().isCollabActive;
62
+ var editor = (0, LexicalComposerContext_1.useLexicalComposerContext)()[0];
63
+ var _d = (0, react_1.useState)(null), selection = _d[0], setSelection = _d[1];
64
+ var activeEditorRef = (0, react_1.useRef)(null);
65
+ var onDelete = (0, react_1.useCallback)(function (payload) {
66
+ if (isSelected && (0, lexical_1.$isNodeSelection)((0, lexical_1.$getSelection)())) {
67
+ var event_1 = payload;
68
+ event_1.preventDefault();
69
+ var node = (0, lexical_1.$getNodeByKey)(nodeKey);
70
+ if ((0, ImageNode_1.$isImageNode)(node)) {
71
+ node.remove();
72
+ }
73
+ }
74
+ return false;
75
+ }, [isSelected, nodeKey]);
76
+ var onEnter = (0, react_1.useCallback)(function (event) {
77
+ var latestSelection = (0, lexical_1.$getSelection)();
78
+ var buttonElem = buttonRef.current;
79
+ if (isSelected && (0, lexical_1.$isNodeSelection)(latestSelection) && latestSelection.getNodes().length === 1) {
80
+ if (showCaption) {
81
+ // Move focus into nested editor
82
+ (0, lexical_1.$setSelection)(null);
83
+ event.preventDefault();
84
+ caption.focus();
85
+ return true;
86
+ }
87
+ else if (buttonElem !== null && buttonElem !== document.activeElement) {
88
+ event.preventDefault();
89
+ buttonElem.focus();
90
+ return true;
91
+ }
92
+ }
93
+ return false;
94
+ }, [caption, isSelected, showCaption]);
95
+ var onEscape = (0, react_1.useCallback)(function (event) {
96
+ if (activeEditorRef.current === caption || buttonRef.current === event.target) {
97
+ (0, lexical_1.$setSelection)(null);
98
+ editor.update(function () {
99
+ setSelected(true);
100
+ var parentRootElement = editor.getRootElement();
101
+ if (parentRootElement !== null) {
102
+ parentRootElement.focus();
103
+ }
104
+ });
105
+ return true;
106
+ }
107
+ return false;
108
+ }, [caption, editor, setSelected]);
109
+ var onClick = (0, react_1.useCallback)(function (payload) {
110
+ var event = payload;
111
+ if (isResizing) {
112
+ return true;
113
+ }
114
+ if (event.target === imageRef.current) {
115
+ if (event.shiftKey) {
116
+ setSelected(!isSelected);
117
+ }
118
+ else {
119
+ clearSelection();
120
+ setSelected(true);
121
+ }
122
+ return true;
123
+ }
124
+ return false;
125
+ }, [isResizing, isSelected, setSelected, clearSelection]);
126
+ var onRightClick = (0, react_1.useCallback)(function (event) {
127
+ editor.getEditorState().read(function () {
128
+ var latestSelection = (0, lexical_1.$getSelection)();
129
+ var domElement = event.target;
130
+ if (domElement.tagName === 'IMG' &&
131
+ (0, lexical_1.$isRangeSelection)(latestSelection) &&
132
+ latestSelection.getNodes().length === 1) {
133
+ editor.dispatchCommand(exports.RIGHT_CLICK_IMAGE_COMMAND, event);
134
+ }
135
+ });
136
+ }, [editor]);
137
+ (0, react_1.useEffect)(function () {
138
+ var isMounted = true;
139
+ var rootElement = editor.getRootElement();
140
+ var unregister = (0, utils_1.mergeRegister)(editor.registerUpdateListener(function (_a) {
141
+ var editorState = _a.editorState;
142
+ if (isMounted) {
143
+ setSelection(editorState.read(function () { return (0, lexical_1.$getSelection)(); }));
144
+ }
145
+ }), editor.registerCommand(lexical_1.SELECTION_CHANGE_COMMAND, function (_, activeEditor) {
146
+ activeEditorRef.current = activeEditor;
147
+ return false;
148
+ }, lexical_1.COMMAND_PRIORITY_LOW), editor.registerCommand(lexical_1.CLICK_COMMAND, onClick, lexical_1.COMMAND_PRIORITY_LOW), editor.registerCommand(exports.RIGHT_CLICK_IMAGE_COMMAND, onClick, lexical_1.COMMAND_PRIORITY_LOW), editor.registerCommand(lexical_1.DRAGSTART_COMMAND, function (event) {
149
+ if (event.target === imageRef.current) {
150
+ // TODO This is just a temporary workaround for FF to behave like other browsers.
151
+ // Ideally, this handles drag & drop too (and all browsers).
152
+ event.preventDefault();
153
+ return true;
154
+ }
155
+ return false;
156
+ }, lexical_1.COMMAND_PRIORITY_LOW), editor.registerCommand(lexical_1.KEY_DELETE_COMMAND, onDelete, lexical_1.COMMAND_PRIORITY_LOW), editor.registerCommand(lexical_1.KEY_BACKSPACE_COMMAND, onDelete, lexical_1.COMMAND_PRIORITY_LOW), editor.registerCommand(lexical_1.KEY_ENTER_COMMAND, onEnter, lexical_1.COMMAND_PRIORITY_LOW), editor.registerCommand(lexical_1.KEY_ESCAPE_COMMAND, onEscape, lexical_1.COMMAND_PRIORITY_LOW));
157
+ rootElement === null || rootElement === void 0 ? void 0 : rootElement.addEventListener('contextmenu', onRightClick);
158
+ return function () {
159
+ isMounted = false;
160
+ unregister();
161
+ rootElement === null || rootElement === void 0 ? void 0 : rootElement.removeEventListener('contextmenu', onRightClick);
162
+ };
163
+ }, [
164
+ clearSelection,
165
+ editor,
166
+ isResizing,
167
+ isSelected,
168
+ nodeKey,
169
+ onDelete,
170
+ onEnter,
171
+ onEscape,
172
+ onClick,
173
+ onRightClick,
174
+ setSelected,
175
+ ]);
176
+ var onResizeEnd = function (nextWidth, nextHeight) {
177
+ // Delay hiding the resize bars for click case
178
+ setTimeout(function () {
179
+ setIsResizing(false);
180
+ }, 200);
181
+ editor.update(function () {
182
+ var node = (0, lexical_1.$getNodeByKey)(nodeKey);
183
+ if ((0, ImageNode_1.$isImageNode)(node)) {
184
+ node.setWidthAndHeight(nextWidth, nextHeight);
185
+ }
186
+ });
187
+ };
188
+ var onResizeStart = function () {
189
+ setIsResizing(true);
190
+ };
191
+ var historyState = (0, SharedHistoryContext_1.useSharedHistoryContext)().historyState;
192
+ var showNestedEditorTreeView = (0, SettingsContext_1.useSettings)().settings.showNestedEditorTreeView;
193
+ var draggable = isSelected && (0, lexical_1.$isNodeSelection)(selection) && !isResizing;
194
+ var isFocused = isSelected || isResizing;
195
+ return (React.createElement(react_1.Suspense, { fallback: null },
196
+ React.createElement(React.Fragment, null,
197
+ React.createElement("div", { draggable: draggable },
198
+ React.createElement(LazyImage, { altText: altText, className: isFocused ? "focused ".concat((0, lexical_1.$isNodeSelection)(selection) ? 'draggable' : '') : null, height: height, imageRef: imageRef, maxWidth: maxWidth, src: src, width: width })),
199
+ showCaption && (React.createElement("div", { className: 'image-caption-container' },
200
+ React.createElement(LexicalNestedComposer_1.LexicalNestedComposer, { initialEditor: caption },
201
+ React.createElement(LexicalAutoFocusPlugin_1.AutoFocusPlugin, null),
202
+ React.createElement(MentionsPlugin_1.default, null),
203
+ React.createElement(LinkPlugin_1.default, null),
204
+ React.createElement(EmojisPlugin_1.default, null),
205
+ React.createElement(LexicalHashtagPlugin_1.HashtagPlugin, null),
206
+ React.createElement(KeywordsPlugin_1.default, null),
207
+ isCollabActive ? (React.createElement(LexicalCollaborationPlugin_1.CollaborationPlugin, { id: caption.getKey(), providerFactory: collaboration_1.createWebsocketProvider, shouldBootstrap: true })) : (React.createElement(LexicalHistoryPlugin_1.HistoryPlugin, { externalHistoryState: historyState })),
208
+ React.createElement(LexicalRichTextPlugin_1.RichTextPlugin, { contentEditable: React.createElement(ContentEditable_1.default, { className: 'ImageNode__contentEditable' }), ErrorBoundary: LexicalErrorBoundary_1.default, placeholder: React.createElement(Placeholder_1.default, { className: 'ImageNode__placeholder' }, "Enter a caption...") }),
209
+ showNestedEditorTreeView === true ? React.createElement(TreeViewPlugin_1.default, null) : null))),
210
+ resizable && (0, lexical_1.$isNodeSelection)(selection) && isFocused && (React.createElement(ImageResizer_1.default, { editor: editor, imageRef: imageRef, maxWidth: maxWidth, onResizeEnd: onResizeEnd, onResizeStart: onResizeStart })))));
211
+ }
212
+ //# sourceMappingURL=ImageComponent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImageComponent.js","sourceRoot":"","sources":["../../../../../src/components/TextEditorV2/nodes/ImageComponent.tsx"],"names":[],"mappings":";;;AA+FA,iCAiQC;;AA9VD,gFAAuE;AACvE,0FAAoF;AACpF,wFAA+E;AAC/E,gFAAiF;AACjF,qGAAsE;AACtE,4EAAmE;AACnE,4EAAmE;AACnE,8EAA4E;AAC5E,8EAAqE;AACrE,kFAAgF;AAChF,wCAA8C;AAC9C,mCAegB;AAChB,mDAA8B;AAC9B,+BAA0E;AAC1E,8DAAwD;AACxD,wEAAyE;AACzE,sDAA8D;AAC9D,iFAAkD;AAClD,qFAAsD;AACtD,6EAA8C;AAC9C,qFAAsD;AACtD,qFAAsD;AACtD,kFAAmD;AACnD,4EAA6C;AAC7C,0EAA2C;AAC3C,yCAA0C;AAE1C,IAAM,UAAU,GAAG,IAAI,GAAG,EAAE,CAAA;AAEf,QAAA,yBAAyB,GAA+B,IAAA,uBAAa,EAAC,2BAA2B,CAAC,CAAA;AAE/G,SAAS,gBAAgB,CAAC,GAAW;IACnC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,OAAO,CAAC,UAAC,OAAO;YACxB,IAAM,GAAG,GAAG,IAAI,KAAK,EAAE,CAAA;YACvB,GAAG,CAAC,GAAG,GAAG,GAAG,CAAA;YACb,GAAG,CAAC,MAAM,GAAG;gBACX,UAAU,CAAC,GAAG,CAA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,CAAC,CAAC,CAChB,oBAAC,gDAAmB,IAAC,EAAE,EAAE,OAAO,CAAC,MAAM,EAAE,EAAE,eAAe,EAAE,uCAAuB,EAAE,eAAe,SAAG,CACxG,CAAC,CAAC,CAAC,CACF,oBAAC,oCAAa,IAAC,oBAAoB,EAAE,YAAY,GAAI,CACtD;oBACD,oBAAC,sCAAc,IACb,eAAe,EAAE,oBAAC,yBAAe,IAAC,SAAS,EAAC,4BAA4B,GAAG,EAC3E,aAAa,EAAE,8BAAoB,EACnC,WAAW,EAAE,oBAAC,qBAAW,IAAC,SAAS,EAAC,wBAAwB,yBAAiC,GAC7F;oBACD,wBAAwB,KAAK,IAAI,CAAC,CAAC,CAAC,oBAAC,wBAAc,OAAG,CAAC,CAAC,CAAC,IAAI,CACxC,CACpB,CACP;YACA,SAAS,IAAI,IAAA,0BAAgB,EAAC,SAAS,CAAC,IAAI,SAAS,IAAI,CACxD,oBAAC,sBAAY,IACX,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,EACxB,aAAa,EAAE,aAAa,GAC5B,CACH,CACA,CACM,CACZ,CAAA;AACH,CAAC"}
@@ -0,0 +1,56 @@
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 { DOMConversionMap, DOMExportOutput, EditorConfig, LexicalEditor, LexicalNode, NodeKey, SerializedEditor, SerializedLexicalNode, Spread } from 'lexical';
9
+ import { DecoratorNode } from 'lexical';
10
+ import * as React from 'react';
11
+ export interface ImagePayload {
12
+ altText: string;
13
+ caption?: LexicalEditor;
14
+ height?: number;
15
+ key?: NodeKey;
16
+ maxWidth?: number;
17
+ showCaption?: boolean;
18
+ src: string;
19
+ width?: number;
20
+ captionsEnabled?: boolean;
21
+ }
22
+ export type SerializedImageNode = Spread<{
23
+ altText: string;
24
+ caption: SerializedEditor;
25
+ height?: number;
26
+ maxWidth: number;
27
+ showCaption: boolean;
28
+ src: string;
29
+ width?: number;
30
+ }, SerializedLexicalNode>;
31
+ export declare class ImageNode extends DecoratorNode<React.JSX.Element> {
32
+ __src: string;
33
+ __altText: string;
34
+ __width: 'inherit' | number;
35
+ __height: 'inherit' | number;
36
+ __maxWidth: number;
37
+ __showCaption: boolean;
38
+ __caption: LexicalEditor;
39
+ __captionsEnabled: boolean;
40
+ static getType(): string;
41
+ static clone(node: ImageNode): ImageNode;
42
+ static importJSON(serializedNode: SerializedImageNode): ImageNode;
43
+ exportDOM(): DOMExportOutput;
44
+ static importDOM(): DOMConversionMap | null;
45
+ constructor(src: string, altText: string, maxWidth: number, width?: 'inherit' | number, height?: 'inherit' | number, showCaption?: boolean, caption?: LexicalEditor, captionsEnabled?: boolean, key?: NodeKey);
46
+ exportJSON(): SerializedImageNode;
47
+ setWidthAndHeight(width: 'inherit' | number, height: 'inherit' | number): void;
48
+ setShowCaption(showCaption: boolean): void;
49
+ createDOM(config: EditorConfig): HTMLElement;
50
+ updateDOM(): false;
51
+ getSrc(): string;
52
+ getAltText(): string;
53
+ decorate(): React.JSX.Element;
54
+ }
55
+ export declare function $createImageNode({ altText, caption, captionsEnabled, height, key, maxWidth, showCaption, src, width, }: ImagePayload): ImageNode;
56
+ export declare function $isImageNode(node: LexicalNode | null | undefined): node is ImageNode;
@@ -0,0 +1,136 @@
1
+ "use strict";
2
+ /**
3
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
4
+ *
5
+ * This source code is licensed under the MIT license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ *
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.ImageNode = void 0;
11
+ exports.$createImageNode = $createImageNode;
12
+ exports.$isImageNode = $isImageNode;
13
+ var tslib_1 = require("tslib");
14
+ var lexical_1 = require("lexical");
15
+ var React = tslib_1.__importStar(require("react"));
16
+ var react_1 = require("react");
17
+ var ImageComponent = React.lazy(
18
+ // @ts-ignore
19
+ function () { return Promise.resolve().then(function () { return tslib_1.__importStar(require('./ImageComponent')); }); });
20
+ function convertImageElement(domNode) {
21
+ if (domNode instanceof HTMLImageElement) {
22
+ var altText = domNode.alt, height = domNode.height, src = domNode.src, width = domNode.width;
23
+ var node = $createImageNode({ altText: altText, height: height, src: src, width: width });
24
+ return { node: node };
25
+ }
26
+ return null;
27
+ }
28
+ var ImageNode = /** @class */ (function (_super) {
29
+ tslib_1.__extends(ImageNode, _super);
30
+ function ImageNode(src, altText, maxWidth, width, height, showCaption, caption, captionsEnabled, key) {
31
+ var _this = _super.call(this, key) || this;
32
+ _this.__src = src;
33
+ _this.__altText = altText;
34
+ _this.__maxWidth = maxWidth;
35
+ _this.__width = width || 'inherit';
36
+ _this.__height = height || 'inherit';
37
+ _this.__showCaption = showCaption || false;
38
+ _this.__caption = caption || (0, lexical_1.createEditor)();
39
+ _this.__captionsEnabled = captionsEnabled || captionsEnabled === undefined;
40
+ return _this;
41
+ }
42
+ ImageNode.getType = function () {
43
+ return 'image';
44
+ };
45
+ ImageNode.clone = function (node) {
46
+ return new ImageNode(node.__src, node.__altText, node.__maxWidth, node.__width, node.__height, node.__showCaption, node.__caption, node.__captionsEnabled, node.__key);
47
+ };
48
+ ImageNode.importJSON = function (serializedNode) {
49
+ var altText = serializedNode.altText, caption = serializedNode.caption, height = serializedNode.height, maxWidth = serializedNode.maxWidth, showCaption = serializedNode.showCaption, src = serializedNode.src, width = serializedNode.width;
50
+ var node = $createImageNode({
51
+ altText: altText,
52
+ height: height,
53
+ maxWidth: maxWidth,
54
+ showCaption: showCaption,
55
+ src: src,
56
+ width: width,
57
+ });
58
+ var nestedEditor = node.__caption;
59
+ var editorState = nestedEditor.parseEditorState(caption.editorState);
60
+ if (!editorState.isEmpty()) {
61
+ nestedEditor.setEditorState(editorState);
62
+ }
63
+ return node;
64
+ };
65
+ ImageNode.prototype.exportDOM = function () {
66
+ var element = document.createElement('img');
67
+ element.setAttribute('src', this.__src);
68
+ element.setAttribute('alt', this.__altText);
69
+ element.setAttribute('width', this.__width.toString());
70
+ element.setAttribute('height', this.__height.toString());
71
+ return { element: element };
72
+ };
73
+ ImageNode.importDOM = function () {
74
+ return {
75
+ img: function () { return ({
76
+ conversion: convertImageElement,
77
+ priority: 0,
78
+ }); },
79
+ };
80
+ };
81
+ ImageNode.prototype.exportJSON = function () {
82
+ return {
83
+ altText: this.getAltText(),
84
+ caption: this.__caption.toJSON(),
85
+ height: this.__height === 'inherit' ? 0 : this.__height,
86
+ maxWidth: this.__maxWidth,
87
+ showCaption: this.__showCaption,
88
+ src: this.getSrc(),
89
+ type: 'image',
90
+ version: 1,
91
+ width: this.__width === 'inherit' ? 0 : this.__width,
92
+ };
93
+ };
94
+ ImageNode.prototype.setWidthAndHeight = function (width, height) {
95
+ var writable = this.getWritable();
96
+ writable.__width = width;
97
+ writable.__height = height;
98
+ };
99
+ ImageNode.prototype.setShowCaption = function (showCaption) {
100
+ var writable = this.getWritable();
101
+ writable.__showCaption = showCaption;
102
+ };
103
+ // View
104
+ ImageNode.prototype.createDOM = function (config) {
105
+ var span = document.createElement('span');
106
+ var theme = config.theme;
107
+ var className = theme.image;
108
+ if (className !== undefined) {
109
+ span.className = className;
110
+ }
111
+ return span;
112
+ };
113
+ ImageNode.prototype.updateDOM = function () {
114
+ return false;
115
+ };
116
+ ImageNode.prototype.getSrc = function () {
117
+ return this.__src;
118
+ };
119
+ ImageNode.prototype.getAltText = function () {
120
+ return this.__altText;
121
+ };
122
+ ImageNode.prototype.decorate = function () {
123
+ return (React.createElement(react_1.Suspense, { fallback: null },
124
+ React.createElement(ImageComponent, { altText: this.__altText, caption: this.__caption, height: this.__height, maxWidth: this.__maxWidth, nodeKey: this.getKey(), resizable: true, showCaption: this.__showCaption, src: this.__src, width: this.__width })));
125
+ };
126
+ return ImageNode;
127
+ }(lexical_1.DecoratorNode));
128
+ exports.ImageNode = ImageNode;
129
+ function $createImageNode(_a) {
130
+ var altText = _a.altText, caption = _a.caption, captionsEnabled = _a.captionsEnabled, height = _a.height, key = _a.key, _b = _a.maxWidth, maxWidth = _b === void 0 ? 500 : _b, showCaption = _a.showCaption, src = _a.src, width = _a.width;
131
+ return (0, lexical_1.$applyNodeReplacement)(new ImageNode(src, altText, maxWidth, width, height, showCaption, caption, captionsEnabled, key));
132
+ }
133
+ function $isImageNode(node) {
134
+ return node instanceof ImageNode;
135
+ }
136
+ //# sourceMappingURL=ImageNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ImageNode.js","sourceRoot":"","sources":["../../../../../src/components/TextEditorV2/nodes/ImageNode.tsx"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAoNH,4CAcC;AAED,oCAEC;;AAxND,mCAA4E;AAC5E,mDAA8B;AAC9B,+BAAgC;AAEhC,IAAM,cAAc,GAAG,KAAK,CAAC,IAAI;AAC/B,aAAa;AACb,cAAM,gFAAO,kBAAkB,QAAzB,CAA0B,CACjC,CAAA;AAcD,SAAS,mBAAmB,CAAC,OAAa;IACxC,IAAI,OAAO,YAAY,gBAAgB,EAAE,CAAC;QAChC,IAAK,OAAO,GAAyB,OAAO,IAAhC,EAAE,MAAM,GAAiB,OAAO,OAAxB,EAAE,GAAG,GAAY,OAAO,IAAnB,EAAE,KAAK,GAAK,OAAO,MAAZ,CAAY;QACpD,IAAM,IAAI,GAAG,gBAAgB,CAAC,EAAE,OAAO,SAAA,EAAE,MAAM,QAAA,EAAE,GAAG,KAAA,EAAE,KAAK,OAAA,EAAE,CAAC,CAAA;QAC9D,OAAO,EAAE,IAAI,MAAA,EAAE,CAAA;IACjB,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC;AAeD;IAA+B,qCAAgC;IAiE7D,mBACE,GAAW,EACX,OAAe,EACf,QAAgB,EAChB,KAA0B,EAC1B,MAA2B,EAC3B,WAAqB,EACrB,OAAuB,EACvB,eAAyB,EACzB,GAAa;QAEb,YAAA,MAAK,YA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AAI,CAAC,SAAS,EACvB,OAAO,EAAE,IAAI,CAAC,SAAS,EACvB,MAAM,EAAE,IAAI,CAAC,QAAQ,EACrB,QAAQ,EAAE,IAAI,CAAC,UAAU,EACzB,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE,EACtB,SAAS,QACT,WAAW,EAAE,IAAI,CAAC,aAAa,EAC/B,GAAG,EAAE,IAAI,CAAC,KAAK,EACf,KAAK,EAAE,IAAI,CAAC,OAAO,GACnB,CACO,CACZ,CAAA;IACH,CAAC;IACH,gBAAC;AAAD,CAAC,AAzJD,CAA+B,uBAAa,GAyJ3C;AAzJY,8BAAS;AA2JtB,SAAgB,gBAAgB,CAAC,EAUlB;QATb,OAAO,aAAA,EACP,OAAO,aAAA,EACP,eAAe,qBAAA,EACf,MAAM,YAAA,EACN,GAAG,SAAA,EACH,gBAAc,EAAd,QAAQ,mBAAG,GAAG,KAAA,EACd,WAAW,iBAAA,EACX,GAAG,SAAA,EACH,KAAK,WAAA;IAEL,OAAO,IAAA,+BAAqB,EAC1B,IAAI,SAAS,CAAC,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,eAAe,EAAE,GAAG,CAAC,CACjG,CAAA;AACH,CAAC;AAED,SAAgB,YAAY,CAAC,IAAoC;IAC/D,OAAO,IAAI,YAAY,SAAS,CAAA;AAClC,CAAC"}
@@ -0,0 +1,18 @@
1
+ import type { Position } from './InlineImageNode';
2
+ import type { LexicalEditor, NodeKey } from 'lexical';
3
+ import * as React from 'react';
4
+ export declare function UpdateInlineImageDialog({ activeEditor, nodeKey, onClose, }: {
5
+ activeEditor: LexicalEditor;
6
+ nodeKey: NodeKey;
7
+ onClose(): void;
8
+ }): React.JSX.Element;
9
+ export default function InlineImageComponent({ altText, caption, height, nodeKey, position, showCaption, src, width, }: {
10
+ altText: string;
11
+ caption: LexicalEditor;
12
+ height: 'inherit' | number;
13
+ nodeKey: NodeKey;
14
+ showCaption: boolean;
15
+ src: string;
16
+ width: 'inherit' | number;
17
+ position: Position;
18
+ }): React.JSX.Element;
@@ -0,0 +1,194 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.UpdateInlineImageDialog = UpdateInlineImageDialog;
4
+ exports.default = InlineImageComponent;
5
+ var tslib_1 = require("tslib");
6
+ var LexicalAutoFocusPlugin_1 = require("@lexical/react/LexicalAutoFocusPlugin");
7
+ var LexicalComposerContext_1 = require("@lexical/react/LexicalComposerContext");
8
+ var LexicalErrorBoundary_1 = tslib_1.__importDefault(require("@lexical/react/LexicalErrorBoundary"));
9
+ var LexicalNestedComposer_1 = require("@lexical/react/LexicalNestedComposer");
10
+ var LexicalRichTextPlugin_1 = require("@lexical/react/LexicalRichTextPlugin");
11
+ var useLexicalNodeSelection_1 = require("@lexical/react/useLexicalNodeSelection");
12
+ var utils_1 = require("@lexical/utils");
13
+ var lexical_1 = require("lexical");
14
+ var React = tslib_1.__importStar(require("react"));
15
+ var react_1 = require("react");
16
+ var useModal_1 = tslib_1.__importDefault(require("../hooks/useModal"));
17
+ var FloatingLinkEditorPlugin_1 = tslib_1.__importDefault(require("../plugins/FloatingLinkEditorPlugin"));
18
+ var FloatingTextFormatToolbarPlugin_1 = tslib_1.__importDefault(require("../plugins/FloatingTextFormatToolbarPlugin"));
19
+ var LinkPlugin_1 = tslib_1.__importDefault(require("../plugins/LinkPlugin"));
20
+ var Button_1 = tslib_1.__importDefault(require("../ui/Button"));
21
+ var ContentEditable_1 = tslib_1.__importDefault(require("../ui/ContentEditable"));
22
+ var Dialog_1 = require("../ui/Dialog");
23
+ var Placeholder_1 = tslib_1.__importDefault(require("../ui/Placeholder"));
24
+ var Select_1 = tslib_1.__importDefault(require("../ui/Select"));
25
+ var TextInput_1 = tslib_1.__importDefault(require("../ui/TextInput"));
26
+ var InlineImageNode_1 = require("./InlineImageNode");
27
+ var imageCache = new Set();
28
+ function useSuspenseImage(src) {
29
+ if (!imageCache.has(src)) {
30
+ throw new Promise(function (resolve) {
31
+ var img = new Image();
32
+ img.src = src;
33
+ img.onload = function () {
34
+ imageCache.add(src);
35
+ resolve(null);
36
+ };
37
+ });
38
+ }
39
+ }
40
+ function LazyImage(_a) {
41
+ var altText = _a.altText, className = _a.className, height = _a.height, imageRef = _a.imageRef, position = _a.position, src = _a.src, width = _a.width;
42
+ useSuspenseImage(src);
43
+ return (React.createElement("img", { ref: imageRef, alt: altText, className: className || undefined, "data-position": position, draggable: 'false', src: src, style: {
44
+ display: 'block',
45
+ height: height,
46
+ width: width,
47
+ } }));
48
+ }
49
+ function UpdateInlineImageDialog(_a) {
50
+ var activeEditor = _a.activeEditor, nodeKey = _a.nodeKey, onClose = _a.onClose;
51
+ var editorState = activeEditor.getEditorState();
52
+ var node = editorState.read(function () { return (0, lexical_1.$getNodeByKey)(nodeKey); });
53
+ var _b = (0, react_1.useState)(node.getAltText()), altText = _b[0], setAltText = _b[1];
54
+ var _c = (0, react_1.useState)(node.getShowCaption()), showCaption = _c[0], setShowCaption = _c[1];
55
+ var _d = (0, react_1.useState)(node.getPosition()), position = _d[0], setPosition = _d[1];
56
+ var handleShowCaptionChange = function (e) {
57
+ setShowCaption(e.target.checked);
58
+ };
59
+ var handlePositionChange = function (e) {
60
+ setPosition(e.target.value);
61
+ };
62
+ var handleOnConfirm = function () {
63
+ var payload = { altText: altText, position: position, showCaption: showCaption };
64
+ if (node) {
65
+ activeEditor.update(function () {
66
+ node.update(payload);
67
+ });
68
+ }
69
+ onClose();
70
+ };
71
+ return (React.createElement(React.Fragment, null,
72
+ React.createElement("div", { style: { marginBottom: '1em' } },
73
+ React.createElement(TextInput_1.default, { "data-test-id": 'image-modal-alt-text-input', label: 'Alt Text', onChange: setAltText, placeholder: 'Descriptive alternative text', value: altText })),
74
+ React.createElement(Select_1.default, { id: 'position-select', label: 'Position', name: 'position', onChange: handlePositionChange, style: { marginBottom: '1em', width: '208px' }, value: position },
75
+ React.createElement("option", { value: 'left' }, "Left"),
76
+ React.createElement("option", { value: 'right' }, "Right"),
77
+ React.createElement("option", { value: 'full' }, "Full Width")),
78
+ React.createElement("div", { className: 'Input__wrapper' },
79
+ React.createElement("input", { checked: showCaption, id: 'caption', onChange: handleShowCaptionChange, type: 'checkbox' }),
80
+ React.createElement("label", { htmlFor: 'caption' }, "Show Caption")),
81
+ React.createElement(Dialog_1.DialogActions, null,
82
+ React.createElement(Button_1.default, { "data-test-id": 'image-modal-file-upload-btn', onClick: function () { return handleOnConfirm(); } }, "Confirm"))));
83
+ }
84
+ function InlineImageComponent(_a) {
85
+ var altText = _a.altText, caption = _a.caption, height = _a.height, nodeKey = _a.nodeKey, position = _a.position, showCaption = _a.showCaption, src = _a.src, width = _a.width;
86
+ var _b = (0, useModal_1.default)(), modal = _b[0], showModal = _b[1];
87
+ var imageRef = (0, react_1.useRef)(null);
88
+ var buttonRef = (0, react_1.useRef)(null);
89
+ var _c = (0, useLexicalNodeSelection_1.useLexicalNodeSelection)(nodeKey), isSelected = _c[0], setSelected = _c[1], clearSelection = _c[2];
90
+ var editor = (0, LexicalComposerContext_1.useLexicalComposerContext)()[0];
91
+ var _d = (0, react_1.useState)(null), selection = _d[0], setSelection = _d[1];
92
+ var activeEditorRef = (0, react_1.useRef)(null);
93
+ var onDelete = (0, react_1.useCallback)(function (payload) {
94
+ if (isSelected && (0, lexical_1.$isNodeSelection)((0, lexical_1.$getSelection)())) {
95
+ var event_1 = payload;
96
+ event_1.preventDefault();
97
+ var node = (0, lexical_1.$getNodeByKey)(nodeKey);
98
+ if ((0, InlineImageNode_1.$isInlineImageNode)(node)) {
99
+ node.remove();
100
+ }
101
+ }
102
+ return false;
103
+ }, [isSelected, nodeKey]);
104
+ var onEnter = (0, react_1.useCallback)(function (event) {
105
+ var latestSelection = (0, lexical_1.$getSelection)();
106
+ var buttonElem = buttonRef.current;
107
+ if (isSelected && (0, lexical_1.$isNodeSelection)(latestSelection) && latestSelection.getNodes().length === 1) {
108
+ if (showCaption) {
109
+ // Move focus into nested editor
110
+ (0, lexical_1.$setSelection)(null);
111
+ event.preventDefault();
112
+ caption.focus();
113
+ return true;
114
+ }
115
+ else if (buttonElem !== null && buttonElem !== document.activeElement) {
116
+ event.preventDefault();
117
+ buttonElem.focus();
118
+ return true;
119
+ }
120
+ }
121
+ return false;
122
+ }, [caption, isSelected, showCaption]);
123
+ var onEscape = (0, react_1.useCallback)(function (event) {
124
+ if (activeEditorRef.current === caption || buttonRef.current === event.target) {
125
+ (0, lexical_1.$setSelection)(null);
126
+ editor.update(function () {
127
+ setSelected(true);
128
+ var parentRootElement = editor.getRootElement();
129
+ if (parentRootElement !== null) {
130
+ parentRootElement.focus();
131
+ }
132
+ });
133
+ return true;
134
+ }
135
+ return false;
136
+ }, [caption, editor, setSelected]);
137
+ (0, react_1.useEffect)(function () {
138
+ var isMounted = true;
139
+ var unregister = (0, utils_1.mergeRegister)(editor.registerUpdateListener(function (_a) {
140
+ var editorState = _a.editorState;
141
+ if (isMounted) {
142
+ setSelection(editorState.read(function () { return (0, lexical_1.$getSelection)(); }));
143
+ }
144
+ }), editor.registerCommand(lexical_1.SELECTION_CHANGE_COMMAND, function (_, activeEditor) {
145
+ activeEditorRef.current = activeEditor;
146
+ return false;
147
+ }, lexical_1.COMMAND_PRIORITY_LOW), editor.registerCommand(lexical_1.CLICK_COMMAND, function (payload) {
148
+ var event = payload;
149
+ if (event.target === imageRef.current) {
150
+ if (event.shiftKey) {
151
+ setSelected(!isSelected);
152
+ }
153
+ else {
154
+ clearSelection();
155
+ setSelected(true);
156
+ }
157
+ return true;
158
+ }
159
+ return false;
160
+ }, lexical_1.COMMAND_PRIORITY_LOW), editor.registerCommand(lexical_1.DRAGSTART_COMMAND, function (event) {
161
+ if (event.target === imageRef.current) {
162
+ // TODO This is just a temporary workaround for FF to behave like other browsers.
163
+ // Ideally, this handles drag & drop too (and all browsers).
164
+ event.preventDefault();
165
+ return true;
166
+ }
167
+ return false;
168
+ }, lexical_1.COMMAND_PRIORITY_LOW), editor.registerCommand(lexical_1.KEY_DELETE_COMMAND, onDelete, lexical_1.COMMAND_PRIORITY_LOW), editor.registerCommand(lexical_1.KEY_BACKSPACE_COMMAND, onDelete, lexical_1.COMMAND_PRIORITY_LOW), editor.registerCommand(lexical_1.KEY_ENTER_COMMAND, onEnter, lexical_1.COMMAND_PRIORITY_LOW), editor.registerCommand(lexical_1.KEY_ESCAPE_COMMAND, onEscape, lexical_1.COMMAND_PRIORITY_LOW));
169
+ return function () {
170
+ isMounted = false;
171
+ unregister();
172
+ };
173
+ }, [clearSelection, editor, isSelected, nodeKey, onDelete, onEnter, onEscape, setSelected]);
174
+ var draggable = isSelected && (0, lexical_1.$isNodeSelection)(selection);
175
+ var isFocused = isSelected;
176
+ return (React.createElement(react_1.Suspense, { fallback: null },
177
+ React.createElement(React.Fragment, null,
178
+ React.createElement("div", { draggable: draggable },
179
+ React.createElement("button", { ref: buttonRef, className: 'image-edit-button', onClick: function () {
180
+ showModal('Update Inline Image', function (onClose) { return (React.createElement(UpdateInlineImageDialog, { activeEditor: editor, nodeKey: nodeKey, onClose: onClose })); });
181
+ }, type: 'button' }, "Edit"),
182
+ React.createElement(LazyImage, { altText: altText, className: isFocused ? "focused ".concat((0, lexical_1.$isNodeSelection)(selection) ? 'draggable' : '') : null, height: height, imageRef: imageRef, position: position, src: src, width: width })),
183
+ showCaption && (React.createElement("div", { className: 'image-caption-container' },
184
+ React.createElement(LexicalNestedComposer_1.LexicalNestedComposer, { initialEditor: caption },
185
+ React.createElement(LexicalAutoFocusPlugin_1.AutoFocusPlugin, null),
186
+ React.createElement(LinkPlugin_1.default, null),
187
+ React.createElement(FloatingLinkEditorPlugin_1.default, { isLinkEditMode: false, setIsLinkEditMode: function () {
188
+ console.log('FloatingLinkEditorPlugin');
189
+ } }),
190
+ React.createElement(FloatingTextFormatToolbarPlugin_1.default, null),
191
+ React.createElement(LexicalRichTextPlugin_1.RichTextPlugin, { contentEditable: React.createElement(ContentEditable_1.default, { className: 'InlineImageNode__contentEditable' }), ErrorBoundary: LexicalErrorBoundary_1.default, placeholder: React.createElement(Placeholder_1.default, { className: 'InlineImageNode__placeholder' }, "Enter a caption...") }))))),
192
+ modal));
193
+ }
194
+ //# sourceMappingURL=InlineImageComponent.js.map