@webiny/lexical-editor 6.0.0-beta.0 → 6.0.0-rc.0

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 (264) hide show
  1. package/README.md +6 -12
  2. package/commands/image.d.ts +2 -2
  3. package/commands/image.js +2 -8
  4. package/commands/image.js.map +1 -1
  5. package/commands/index.d.ts +5 -3
  6. package/commands/index.js +5 -38
  7. package/commands/index.js.map +1 -1
  8. package/commands/list.d.ts +2 -2
  9. package/commands/list.js +4 -10
  10. package/commands/list.js.map +1 -1
  11. package/commands/quote.d.ts +2 -2
  12. package/commands/quote.js +2 -8
  13. package/commands/quote.js.map +1 -1
  14. package/commands/toolbar.d.ts +1 -0
  15. package/commands/toolbar.js +4 -0
  16. package/commands/toolbar.js.map +1 -0
  17. package/commands/typography.d.ts +8 -0
  18. package/commands/typography.js +4 -0
  19. package/commands/typography.js.map +1 -0
  20. package/components/Editor/EnsureHeadingTagPlugin.d.ts +6 -0
  21. package/components/Editor/EnsureHeadingTagPlugin.js +20 -0
  22. package/components/Editor/EnsureHeadingTagPlugin.js.map +1 -0
  23. package/components/Editor/RichTextEditor.d.ts +29 -12
  24. package/components/Editor/RichTextEditor.js +89 -110
  25. package/components/Editor/RichTextEditor.js.map +1 -1
  26. package/components/Editor/normalizeInputValue.d.ts +6 -0
  27. package/components/Editor/normalizeInputValue.js +16 -0
  28. package/components/Editor/normalizeInputValue.js.map +1 -0
  29. package/components/LexicalEditorConfig/LexicalEditorConfig.d.ts +14 -16
  30. package/components/LexicalEditorConfig/LexicalEditorConfig.js +21 -69
  31. package/components/LexicalEditorConfig/LexicalEditorConfig.js.map +1 -1
  32. package/components/LexicalEditorConfig/components/Node.d.ts +1 -1
  33. package/components/LexicalEditorConfig/components/Node.js +17 -26
  34. package/components/LexicalEditorConfig/components/Node.js.map +1 -1
  35. package/components/LexicalEditorConfig/components/Plugin.js +17 -26
  36. package/components/LexicalEditorConfig/components/Plugin.js.map +1 -1
  37. package/components/LexicalEditorConfig/components/ToolbarElement.js +17 -26
  38. package/components/LexicalEditorConfig/components/ToolbarElement.js.map +1 -1
  39. package/components/LexicalHtmlRenderer.d.ts +5 -8
  40. package/components/LexicalHtmlRenderer.js +35 -50
  41. package/components/LexicalHtmlRenderer.js.map +1 -1
  42. package/components/Toolbar/StaticToolbar.css +416 -0
  43. package/components/Toolbar/StaticToolbar.d.ts +3 -1
  44. package/components/Toolbar/StaticToolbar.js +19 -23
  45. package/components/Toolbar/StaticToolbar.js.map +1 -1
  46. package/components/ToolbarActions/BoldAction.js +16 -21
  47. package/components/ToolbarActions/BoldAction.js.map +1 -1
  48. package/components/ToolbarActions/BulletListAction.js +25 -31
  49. package/components/ToolbarActions/BulletListAction.js.map +1 -1
  50. package/components/ToolbarActions/CodeHighlightAction.js +16 -21
  51. package/components/ToolbarActions/CodeHighlightAction.js.map +1 -1
  52. package/components/ToolbarActions/FontColorAction.d.ts +16 -4
  53. package/components/ToolbarActions/FontColorAction.js +32 -43
  54. package/components/ToolbarActions/FontColorAction.js.map +1 -1
  55. package/components/ToolbarActions/ImageAction.js +19 -34
  56. package/components/ToolbarActions/ImageAction.js.map +1 -1
  57. package/components/ToolbarActions/ItalicAction.js +16 -21
  58. package/components/ToolbarActions/ItalicAction.js.map +1 -1
  59. package/components/ToolbarActions/LinkAction.js +19 -24
  60. package/components/ToolbarActions/LinkAction.js.map +1 -1
  61. package/components/ToolbarActions/NumberedListAction.js +25 -36
  62. package/components/ToolbarActions/NumberedListAction.js.map +1 -1
  63. package/components/ToolbarActions/QuoteAction.js +20 -25
  64. package/components/ToolbarActions/QuoteAction.js.map +1 -1
  65. package/components/ToolbarActions/TextAlignmentAction.d.ts +16 -4
  66. package/components/ToolbarActions/TextAlignmentAction.js +36 -45
  67. package/components/ToolbarActions/TextAlignmentAction.js.map +1 -1
  68. package/components/ToolbarActions/TypographyAction.d.ts +16 -4
  69. package/components/ToolbarActions/TypographyAction.js +57 -79
  70. package/components/ToolbarActions/TypographyAction.js.map +1 -1
  71. package/components/ToolbarActions/UnderlineAction.js +16 -21
  72. package/components/ToolbarActions/UnderlineAction.js.map +1 -1
  73. package/context/FontColorActionContext.js +2 -9
  74. package/context/FontColorActionContext.js.map +1 -1
  75. package/context/RichTextEditorContext.d.ts +7 -8
  76. package/context/RichTextEditorContext.js +28 -26
  77. package/context/RichTextEditorContext.js.map +1 -1
  78. package/context/SharedHistoryContext.d.ts +3 -3
  79. package/context/SharedHistoryContext.js +12 -20
  80. package/context/SharedHistoryContext.js.map +1 -1
  81. package/context/TextAlignmentActionContextProps.d.ts +1 -1
  82. package/context/TextAlignmentActionContextProps.js +2 -9
  83. package/context/TextAlignmentActionContextProps.js.map +1 -1
  84. package/context/TypographyActionContext.d.ts +3 -2
  85. package/context/TypographyActionContext.js +2 -9
  86. package/context/TypographyActionContext.js.map +1 -1
  87. package/exports/admin/lexical.d.ts +15 -0
  88. package/exports/admin/lexical.js +23 -0
  89. package/exports/admin/lexical.js.map +1 -0
  90. package/hooks/index.d.ts +7 -8
  91. package/hooks/index.js +7 -93
  92. package/hooks/index.js.map +1 -1
  93. package/hooks/useCurrentElement.d.ts +3 -3
  94. package/hooks/useCurrentElement.js +11 -18
  95. package/hooks/useCurrentElement.js.map +1 -1
  96. package/hooks/useCurrentSelection.d.ts +2 -1
  97. package/hooks/useCurrentSelection.js +27 -40
  98. package/hooks/useCurrentSelection.js.map +1 -1
  99. package/hooks/useFontColorPicker.d.ts +1 -1
  100. package/hooks/useFontColorPicker.js +5 -11
  101. package/hooks/useFontColorPicker.js.map +1 -1
  102. package/hooks/useIsMounted.js +6 -14
  103. package/hooks/useIsMounted.js.map +1 -1
  104. package/hooks/useRichTextEditor.d.ts +1 -1
  105. package/hooks/useRichTextEditor.js +5 -11
  106. package/hooks/useRichTextEditor.js.map +1 -1
  107. package/hooks/useTextAlignmentAction.d.ts +1 -1
  108. package/hooks/useTextAlignmentAction.js +5 -11
  109. package/hooks/useTextAlignmentAction.js.map +1 -1
  110. package/hooks/useTypographyAction.d.ts +1 -1
  111. package/hooks/useTypographyAction.js +5 -11
  112. package/hooks/useTypographyAction.js.map +1 -1
  113. package/index.d.ts +33 -38
  114. package/index.js +44 -322
  115. package/index.js.map +1 -1
  116. package/package.json +18 -22
  117. package/plugins/BlurEventPlugin/BlurEventPlugin.d.ts +2 -2
  118. package/plugins/BlurEventPlugin/BlurEventPlugin.js +16 -22
  119. package/plugins/BlurEventPlugin/BlurEventPlugin.js.map +1 -1
  120. package/plugins/CodeHighlightPlugin/CodeHighlightPlugin.js +9 -14
  121. package/plugins/CodeHighlightPlugin/CodeHighlightPlugin.js.map +1 -1
  122. package/plugins/CodeHighlightPlugin/index.d.ts +1 -1
  123. package/plugins/CodeHighlightPlugin/index.js +1 -16
  124. package/plugins/CodeHighlightPlugin/index.js.map +1 -1
  125. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditor.d.ts +10 -0
  126. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditor.js +28 -0
  127. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditor.js.map +1 -0
  128. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorController.d.ts +7 -0
  129. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorController.js +61 -0
  130. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorController.js.map +1 -0
  131. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.css +2 -136
  132. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.d.ts +4 -16
  133. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.js +7 -180
  134. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.js.map +1 -1
  135. package/plugins/FloatingLinkEditorPlugin/index.d.ts +1 -1
  136. package/plugins/FloatingLinkEditorPlugin/index.js +1 -16
  137. package/plugins/FloatingLinkEditorPlugin/index.js.map +1 -1
  138. package/plugins/FloatingLinkEditorPlugin/isChildOfLinkEditor.js +2 -8
  139. package/plugins/FloatingLinkEditorPlugin/isChildOfLinkEditor.js.map +1 -1
  140. package/plugins/FloatingLinkEditorPlugin/types.d.ts +10 -0
  141. package/plugins/FloatingLinkEditorPlugin/types.js +3 -0
  142. package/plugins/FloatingLinkEditorPlugin/types.js.map +1 -0
  143. package/plugins/FloatingLinkEditorPlugin/useFloatingLinkEditor.d.ts +8 -2
  144. package/plugins/FloatingLinkEditorPlugin/useFloatingLinkEditor.js +119 -63
  145. package/plugins/FloatingLinkEditorPlugin/useFloatingLinkEditor.js.map +1 -1
  146. package/plugins/FontColorPlugin/FontColorPlugin.js +19 -28
  147. package/plugins/FontColorPlugin/FontColorPlugin.js.map +1 -1
  148. package/plugins/FontColorPlugin/applyColorToNode.d.ts +3 -0
  149. package/plugins/FontColorPlugin/applyColorToNode.js +8 -0
  150. package/plugins/FontColorPlugin/applyColorToNode.js.map +1 -0
  151. package/plugins/FontColorPlugin/applyColorToSelection.d.ts +3 -0
  152. package/plugins/FontColorPlugin/applyColorToSelection.js +66 -0
  153. package/plugins/FontColorPlugin/applyColorToSelection.js.map +1 -0
  154. package/plugins/ImagesPlugin/ImagesPlugin.d.ts +2 -3
  155. package/plugins/ImagesPlugin/ImagesPlugin.js +58 -60
  156. package/plugins/ImagesPlugin/ImagesPlugin.js.map +1 -1
  157. package/plugins/LinkPlugin/LinkPlugin.d.ts +1 -1
  158. package/plugins/LinkPlugin/LinkPlugin.js +29 -37
  159. package/plugins/LinkPlugin/LinkPlugin.js.map +1 -1
  160. package/plugins/ListPLugin/ListPlugin.js +52 -15
  161. package/plugins/ListPLugin/ListPlugin.js.map +1 -1
  162. package/plugins/QuoteNodePlugin/QuoteNodePlugin.js +19 -16
  163. package/plugins/QuoteNodePlugin/QuoteNodePlugin.js.map +1 -1
  164. package/plugins/StateHandlingPlugin.d.ts +8 -0
  165. package/plugins/StateHandlingPlugin.js +75 -0
  166. package/plugins/StateHandlingPlugin.js.map +1 -0
  167. package/plugins/TypographyPlugin/TypographyPlugin.js +17 -21
  168. package/plugins/TypographyPlugin/TypographyPlugin.js.map +1 -1
  169. package/types.d.ts +8 -8
  170. package/types.js +6 -38
  171. package/types.js.map +1 -1
  172. package/ui/ContentEditable.d.ts +0 -1
  173. package/ui/ContentEditable.js +7 -14
  174. package/ui/ContentEditable.js.map +1 -1
  175. package/ui/Divider.d.ts +0 -1
  176. package/ui/Divider.js +3 -10
  177. package/ui/Divider.js.map +1 -1
  178. package/ui/DropDown.d.ts +1 -1
  179. package/ui/DropDown.js +64 -90
  180. package/ui/DropDown.js.map +1 -1
  181. package/ui/ImageResizer.d.ts +0 -1
  182. package/ui/ImageResizer.js +84 -89
  183. package/ui/ImageResizer.js.map +1 -1
  184. package/ui/LinkPreview.d.ts +0 -1
  185. package/ui/LinkPreview.js +22 -29
  186. package/ui/LinkPreview.js.map +1 -1
  187. package/ui/Placeholder.d.ts +1 -1
  188. package/ui/Placeholder.js +10 -16
  189. package/ui/Placeholder.js.map +1 -1
  190. package/ui/TextInput.d.ts +1 -2
  191. package/ui/TextInput.js +11 -18
  192. package/ui/TextInput.js.map +1 -1
  193. package/ui/ToolbarActionDialog.js +30 -42
  194. package/ui/ToolbarActionDialog.js.map +1 -1
  195. package/utils/canUseDOM.js +1 -7
  196. package/utils/canUseDOM.js.map +1 -1
  197. package/utils/files.d.ts +6 -7
  198. package/utils/files.js +5 -56
  199. package/utils/files.js.map +1 -1
  200. package/utils/getDOMRangeRect.js +4 -10
  201. package/utils/getDOMRangeRect.js.map +1 -1
  202. package/utils/getSelectedNode.d.ts +1 -1
  203. package/utils/getSelectedNode.js +9 -16
  204. package/utils/getSelectedNode.js.map +1 -1
  205. package/utils/getTransparentImage.js +1 -7
  206. package/utils/getTransparentImage.js.map +1 -1
  207. package/utils/insertImage.d.ts +1 -1
  208. package/utils/insertImage.js +8 -14
  209. package/utils/insertImage.js.map +1 -1
  210. package/utils/isAnchorLink.js +1 -7
  211. package/utils/isAnchorLink.js.map +1 -1
  212. package/utils/isChildOfFloatingToolbar.js +2 -8
  213. package/utils/isChildOfFloatingToolbar.js.map +1 -1
  214. package/utils/isHTMLElement.js +1 -7
  215. package/utils/isHTMLElement.js.map +1 -1
  216. package/utils/isValidJSON.js +3 -9
  217. package/utils/isValidJSON.js.map +1 -1
  218. package/utils/isValidLexicalData.d.ts +3 -3
  219. package/utils/isValidLexicalData.js +6 -12
  220. package/utils/isValidLexicalData.js.map +1 -1
  221. package/utils/point.js +35 -60
  222. package/utils/point.js.map +1 -1
  223. package/utils/rect.d.ts +2 -2
  224. package/utils/rect.js +115 -149
  225. package/utils/rect.js.map +1 -1
  226. package/utils/sanitizeUrl.js +6 -13
  227. package/utils/sanitizeUrl.js.map +1 -1
  228. package/utils/setFloatingElemPosition.d.ts +1 -1
  229. package/utils/setFloatingElemPosition.js +29 -39
  230. package/utils/setFloatingElemPosition.js.map +1 -1
  231. package/components/Editor/HeadingEditor.d.ts +0 -7
  232. package/components/Editor/HeadingEditor.js +0 -29
  233. package/components/Editor/HeadingEditor.js.map +0 -1
  234. package/components/Editor/ParagraphEditor.d.ts +0 -7
  235. package/components/Editor/ParagraphEditor.js +0 -29
  236. package/components/Editor/ParagraphEditor.js.map +0 -1
  237. package/components/Toolbar/Toolbar.css +0 -647
  238. package/components/Toolbar/Toolbar.d.ts +0 -6
  239. package/components/Toolbar/Toolbar.js +0 -162
  240. package/components/Toolbar/Toolbar.js.map +0 -1
  241. package/components/ToolbarActions/FontSizeAction.d.ts +0 -2
  242. package/components/ToolbarActions/FontSizeAction.js +0 -88
  243. package/components/ToolbarActions/FontSizeAction.js.map +0 -1
  244. package/hooks/useList.d.ts +0 -2
  245. package/hooks/useList.js +0 -54
  246. package/hooks/useList.js.map +0 -1
  247. package/hooks/useQuote.d.ts +0 -2
  248. package/hooks/useQuote.js +0 -22
  249. package/hooks/useQuote.js.map +0 -1
  250. package/plugins/FloatingLinkEditorPlugin/LinkEditForm.d.ts +0 -9
  251. package/plugins/FloatingLinkEditorPlugin/LinkEditForm.js +0 -118
  252. package/plugins/FloatingLinkEditorPlugin/LinkEditForm.js.map +0 -1
  253. package/plugins/FloatingLinkEditorPlugin/LinkPreviewForm.d.ts +0 -9
  254. package/plugins/FloatingLinkEditorPlugin/LinkPreviewForm.js +0 -44
  255. package/plugins/FloatingLinkEditorPlugin/LinkPreviewForm.js.map +0 -1
  256. package/plugins/LexicalUpdateStatePlugin/UpdateStatePlugin.d.ts +0 -9
  257. package/plugins/LexicalUpdateStatePlugin/UpdateStatePlugin.js +0 -45
  258. package/plugins/LexicalUpdateStatePlugin/UpdateStatePlugin.js.map +0 -1
  259. package/plugins/LexicalUpdateStatePlugin/index.d.ts +0 -1
  260. package/plugins/LexicalUpdateStatePlugin/index.js +0 -18
  261. package/plugins/LexicalUpdateStatePlugin/index.js.map +0 -1
  262. package/utils/generateInitialLexicalValue.d.ts +0 -5
  263. package/utils/generateInitialLexicalValue.js +0 -33
  264. package/utils/generateInitialLexicalValue.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_reactComposition","_TypographyActionContext","_lexicalNodes","_useRichTextEditor2","_commands","_useCurrentElement2","BaseTypographyActionDropDown","exports","makeDecoratable","useEffect","console","log","TypographyActionDropDown","_ref","element","default","createElement","Compose","component","with","_with","TypographyAction","_useState","useState","_useState2","_slicedToArray2","typography","setTypography","_useRichTextEditor","useRichTextEditor","editor","themeEmotionMap","_useCurrentElement","useCurrentElement","isTypographySelected","$isTypographyNode","isParagraphSelected","$isParagraphNode","isHeadingSelected","$isHeadingNode","isQuoteSelected","$isQuoteNode","setTypographySelect","useCallback","value","onTypographySelect","tag","includes","dispatchCommand","ADD_TYPOGRAPHY_COMMAND","INSERT_ORDERED_LIST_COMMAND","themeStyleId","id","INSERT_UNORDERED_LIST_COMMAND","INSERT_QUOTE_COMMAND","el","getTypographyValue","styleId","getTypographyStyleId","style","name","css","styles","getStyleId","undefined","elementStyle","TypographyActionContext","Provider","applyTypography","TypographyDropDown"],"sources":["TypographyAction.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from \"react\";\nimport { LexicalCommand } from \"lexical\";\nimport { Compose, makeDecoratable } from \"@webiny/react-composition\";\nimport { TypographyValue } from \"@webiny/lexical-theme\";\nimport { TypographyActionContext } from \"~/context/TypographyActionContext\";\nimport {\n $isHeadingNode,\n $isParagraphNode,\n $isQuoteNode,\n $isTypographyNode,\n ADD_TYPOGRAPHY_COMMAND,\n TypographyNode,\n TypographyPayload\n} from \"@webiny/lexical-nodes\";\nimport { useRichTextEditor } from \"~/hooks/useRichTextEditor\";\nimport {\n INSERT_ORDERED_LIST_COMMAND,\n INSERT_UNORDERED_LIST_COMMAND,\n INSERT_QUOTE_COMMAND,\n ListCommandPayload,\n QuoteCommandPayload\n} from \"~/commands\";\nimport { useCurrentElement } from \"~/hooks/useCurrentElement\";\n\n/*\n * Base composable action component that is mounted on toolbar action as a placeholder for the custom toolbar action.\n * Note: Toa add custom component access trough @see LexicalEditorConfig API\n * */\nexport const BaseTypographyActionDropDown = makeDecoratable(\n \"BaseTypographyActionDropDown\",\n (): JSX.Element | null => {\n useEffect(() => {\n console.log(\"Default BaseTypographyActionDropDown, please add your own component\");\n }, []);\n return null;\n }\n);\n\ninterface TypographyActionDropdownProps {\n element: JSX.Element;\n}\n\nconst TypographyActionDropDown = ({ element }: TypographyActionDropdownProps): JSX.Element => {\n return <Compose component={BaseTypographyActionDropDown} with={() => () => element} />;\n};\n\nexport type TypographyAction = React.ComponentType<unknown> & {\n TypographyDropDown: typeof TypographyActionDropDown;\n};\n\nexport const TypographyAction: TypographyAction = () => {\n const [typography, setTypography] = useState<TypographyValue>();\n const { editor, themeEmotionMap } = useRichTextEditor();\n const { element } = useCurrentElement();\n const isTypographySelected = $isTypographyNode(element);\n const isParagraphSelected = $isParagraphNode(element);\n const isHeadingSelected = $isHeadingNode(element);\n const isQuoteSelected = $isQuoteNode(element);\n\n const setTypographySelect = useCallback(\n (value: TypographyValue) => {\n setTypography(value);\n },\n [typography]\n );\n\n const onTypographySelect = useCallback((value: TypographyValue) => {\n setTypographySelect(value);\n if (value.tag.includes(\"h\") || value.tag.includes(\"p\")) {\n editor.dispatchCommand<LexicalCommand<TypographyPayload>>(ADD_TYPOGRAPHY_COMMAND, {\n value\n });\n }\n\n if (value.tag === \"ol\") {\n editor.dispatchCommand<LexicalCommand<ListCommandPayload>>(\n INSERT_ORDERED_LIST_COMMAND,\n {\n themeStyleId: value.id\n }\n );\n }\n\n if (value.tag === \"ul\") {\n editor.dispatchCommand<LexicalCommand<ListCommandPayload>>(\n INSERT_UNORDERED_LIST_COMMAND,\n {\n themeStyleId: value.id\n }\n );\n }\n\n if (value.tag === \"quoteblock\") {\n editor.dispatchCommand<LexicalCommand<QuoteCommandPayload>>(INSERT_QUOTE_COMMAND, {\n themeStyleId: value.id\n });\n }\n }, []);\n\n useEffect(() => {\n if (!element) {\n return;\n }\n // header and paragraph elements inserted with typography node\n if (isTypographySelected) {\n const el = element as TypographyNode;\n setTypography(el.getTypographyValue());\n return;\n }\n\n if (isParagraphSelected || isHeadingSelected || isQuoteSelected) {\n const styleId = element.getTypographyStyleId();\n if (!styleId) {\n return;\n }\n\n if (!themeEmotionMap) {\n return;\n }\n\n const style = themeEmotionMap[styleId];\n if (style) {\n setTypography({\n name: style?.name,\n id: style.id,\n css: style.styles,\n tag: style.tag\n });\n }\n return;\n }\n\n // list and quote element\n if (themeEmotionMap && element?.getStyleId) {\n const themeStyleId = element?.getStyleId() || undefined;\n if (themeStyleId) {\n const elementStyle = themeEmotionMap[themeStyleId];\n if (elementStyle) {\n setTypography({\n id: elementStyle.id,\n css: elementStyle.styles,\n name: elementStyle.name,\n tag: elementStyle.tag\n });\n }\n }\n }\n }, [element, isTypographySelected, isQuoteSelected, isParagraphSelected, isHeadingSelected]);\n\n return (\n <TypographyActionContext.Provider\n value={{\n value: typography,\n applyTypography: onTypographySelect\n }}\n >\n <BaseTypographyActionDropDown />\n </TypographyActionContext.Provider>\n );\n};\n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;UACtB,CAAC,CAAC;QACN;MACJ;IACJ;EACJ,CAAC,EAAE,CAAChC,OAAO,EAAEoB,oBAAoB,EAAEM,eAAe,EAAEJ,mBAAmB,EAAEE,iBAAiB,CAAC,CAAC;EAE5F,oBACIzC,MAAA,CAAAkB,OAAA,CAAAC,aAAA,CAACf,wBAAA,CAAAiE,uBAAuB,CAACC,QAAQ;IAC7BvB,KAAK,EAAE;MACHA,KAAK,EAAElB,UAAU;MACjB0C,eAAe,EAAEvB;IACrB;EAAE,gBAEFhD,MAAA,CAAAkB,OAAA,CAAAC,aAAA,CAACV,4BAA4B,MAAE,CACD,CAAC;AAE3C,CAAC;AAEDe,gBAAgB,CAACgD,kBAAkB,GAAGzD,wBAAwB","ignoreList":[]}
1
+ {"version":3,"names":["React","useCallback","useEffect","useState","Compose","makeDecoratable","TypographyActionContext","$isHeadingNode","$isListNode","$isParagraphNode","$isQuoteNode","useRichTextEditor","INSERT_ORDERED_LIST_COMMAND","INSERT_UNORDERED_LIST_COMMAND","INSERT_QUOTE_COMMAND","ADD_TYPOGRAPHY_COMMAND","useCurrentElement","quoteTagNames","BaseTypographyActionDropDown","console","log","TypographyActionDropDown","element","createElement","component","with","TypographyAction","typography","setTypography","editor","theme","isParagraphSelected","isHeadingSelected","isQuoteSelected","onTypographySelect","value","tag","includes","dispatchCommand","themeStyleId","id","styleId","getStyleId","style","getTypographyById","label","Provider","applyTypography","TypographyDropDown"],"sources":["TypographyAction.tsx"],"sourcesContent":["import React, { useCallback, useEffect, useState } from \"react\";\nimport type { LexicalCommand } from \"lexical\";\nimport { Compose, makeDecoratable } from \"@webiny/react-composition\";\nimport type { TypographyValue } from \"@webiny/lexical-theme\";\nimport type { ActiveTypography } from \"~/context/TypographyActionContext.js\";\nimport { TypographyActionContext } from \"~/context/TypographyActionContext.js\";\nimport { $isHeadingNode, $isListNode, $isParagraphNode, $isQuoteNode } from \"@webiny/lexical-nodes\";\nimport { useRichTextEditor } from \"~/hooks/useRichTextEditor.js\";\nimport type {\n ListCommandPayload,\n QuoteCommandPayload,\n TypographyPayload\n} from \"~/commands/index.js\";\nimport {\n INSERT_ORDERED_LIST_COMMAND,\n INSERT_UNORDERED_LIST_COMMAND,\n INSERT_QUOTE_COMMAND,\n ADD_TYPOGRAPHY_COMMAND\n} from \"~/commands/index.js\";\nimport { useCurrentElement } from \"~/hooks/useCurrentElement.js\";\n\n// Unfortunately, for some time in v5 we had `quoteblock` in our theme, so let's not break it.\nconst quoteTagNames = [\"blockquote\", \"quoteblock\"];\n\n/*\n * Base composable action component that is mounted on toolbar action as a placeholder for the custom toolbar action.\n * Note: Toa add custom component access trough @see LexicalEditorConfig API\n * */\nexport const BaseTypographyActionDropDown = makeDecoratable(\n \"BaseTypographyActionDropDown\",\n (): JSX.Element | null => {\n useEffect(() => {\n console.log(\"Default BaseTypographyActionDropDown, please add your own component\");\n }, []);\n return null;\n }\n);\n\ninterface TypographyActionDropdownProps {\n element: JSX.Element;\n}\n\nconst TypographyActionDropDown = ({ element }: TypographyActionDropdownProps): JSX.Element => {\n return <Compose component={BaseTypographyActionDropDown} with={() => () => element} />;\n};\n\nexport type TypographyAction = React.ComponentType<unknown> & {\n TypographyDropDown: typeof TypographyActionDropDown;\n};\n\nexport const TypographyAction: TypographyAction = () => {\n const [typography, setTypography] = useState<ActiveTypography>();\n const { editor, theme } = useRichTextEditor();\n const { element } = useCurrentElement();\n const isParagraphSelected = $isParagraphNode(element);\n const isHeadingSelected = $isHeadingNode(element);\n const isQuoteSelected = $isQuoteNode(element);\n\n const onTypographySelect = useCallback((value: TypographyValue) => {\n setTypography(value);\n\n if (value.tag.includes(\"h\") || value.tag.includes(\"p\")) {\n editor.dispatchCommand<LexicalCommand<TypographyPayload>>(ADD_TYPOGRAPHY_COMMAND, {\n value\n });\n return;\n }\n\n if (value.tag === \"ol\") {\n editor.dispatchCommand<LexicalCommand<ListCommandPayload>>(\n INSERT_ORDERED_LIST_COMMAND,\n {\n themeStyleId: value.id\n }\n );\n return;\n }\n\n if (value.tag === \"ul\") {\n editor.dispatchCommand<LexicalCommand<ListCommandPayload>>(\n INSERT_UNORDERED_LIST_COMMAND,\n {\n themeStyleId: value.id\n }\n );\n return;\n }\n\n if (quoteTagNames.includes(value.tag)) {\n editor.dispatchCommand<LexicalCommand<QuoteCommandPayload>>(INSERT_QUOTE_COMMAND, {\n themeStyleId: value.id\n });\n }\n }, []);\n\n useEffect(() => {\n if (!element) {\n return;\n }\n\n if (isParagraphSelected || isHeadingSelected || isQuoteSelected) {\n const styleId = element.getStyleId();\n if (!styleId) {\n return;\n }\n\n const style = theme.getTypographyById(styleId);\n if (style) {\n setTypography({\n id: style.id,\n label: style.label\n });\n }\n return;\n }\n\n // list and quote element\n if ($isListNode(element)) {\n const styleId = element.getStyleId();\n if (!styleId) {\n return;\n }\n\n const style = theme.getTypographyById(styleId);\n if (style) {\n setTypography({\n id: style.id,\n label: style.label\n });\n }\n }\n }, [element, isQuoteSelected, isParagraphSelected, isHeadingSelected]);\n\n return (\n <TypographyActionContext.Provider\n value={{\n value: typography,\n applyTypography: onTypographySelect\n }}\n >\n <BaseTypographyActionDropDown />\n </TypographyActionContext.Provider>\n );\n};\n\nTypographyAction.TypographyDropDown = TypographyActionDropDown;\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAE/D,SAASC,OAAO,EAAEC,eAAe,QAAQ,2BAA2B;AAGpE,SAASC,uBAAuB;AAChC,SAASC,cAAc,EAAEC,WAAW,EAAEC,gBAAgB,EAAEC,YAAY,QAAQ,uBAAuB;AACnG,SAASC,iBAAiB;AAM1B,SACIC,2BAA2B,EAC3BC,6BAA6B,EAC7BC,oBAAoB,EACpBC,sBAAsB;AAE1B,SAASC,iBAAiB;;AAE1B;AACA,MAAMC,aAAa,GAAG,CAAC,YAAY,EAAE,YAAY,CAAC;;AAElD;AACA;AACA;AACA;AACA,OAAO,MAAMC,4BAA4B,GAAGb,eAAe,CACv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e,EAAEF,mBAAmB,EAAEC,iBAAiB,CAAC,CAAC;EAEtE,oBACIhC,KAAA,CAAAuB,aAAA,CAACjB,uBAAuB,CAACwC,QAAQ;IAC7BX,KAAK,EAAE;MACHA,KAAK,EAAER,UAAU;MACjBoB,eAAe,EAAEb;IACrB;EAAE,gBAEFlC,KAAA,CAAAuB,aAAA,CAACL,4BAA4B,MAAE,CACD,CAAC;AAE3C,CAAC;AAEDQ,gBAAgB,CAACsB,kBAAkB,GAAG3B,wBAAwB","ignoreList":[]}
@@ -1,27 +1,22 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.UnderlineAction = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var _lexical = require("lexical");
10
- var _hooks = require("../../hooks");
11
- var UnderlineAction = exports.UnderlineAction = function UnderlineAction() {
12
- var _useRichTextEditor = (0, _hooks.useRichTextEditor)(),
13
- editor = _useRichTextEditor.editor;
14
- var _useCurrentSelection = (0, _hooks.useCurrentSelection)(),
15
- rangeSelection = _useCurrentSelection.rangeSelection;
16
- var isUnderlineSelected = rangeSelection ? rangeSelection.hasFormat("underline") : false;
17
- var handleClick = function handleClick() {
18
- editor.dispatchCommand(_lexical.FORMAT_TEXT_COMMAND, "underline");
1
+ import React from "react";
2
+ import { FORMAT_TEXT_COMMAND } from "lexical";
3
+ import { useCurrentSelection, useRichTextEditor } from "../../hooks/index.js";
4
+ export const UnderlineAction = () => {
5
+ const {
6
+ editor
7
+ } = useRichTextEditor();
8
+ const {
9
+ rangeSelection
10
+ } = useCurrentSelection();
11
+ const isUnderlineSelected = rangeSelection ? rangeSelection.hasFormat("underline") : false;
12
+ const handleClick = () => {
13
+ editor.dispatchCommand(FORMAT_TEXT_COMMAND, "underline");
19
14
  };
20
- return /*#__PURE__*/_react.default.createElement("button", {
15
+ return /*#__PURE__*/React.createElement("button", {
21
16
  onClick: handleClick,
22
17
  className: "popup-item spaced " + (isUnderlineSelected ? "active" : ""),
23
- "aria-label": "Format text as italic"
24
- }, /*#__PURE__*/_react.default.createElement("i", {
18
+ "aria-label": "Underline text"
19
+ }, /*#__PURE__*/React.createElement("i", {
25
20
  className: "format underline"
26
21
  }));
27
22
  };
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","_lexical","_hooks","UnderlineAction","exports","_useRichTextEditor","useRichTextEditor","editor","_useCurrentSelection","useCurrentSelection","rangeSelection","isUnderlineSelected","hasFormat","handleClick","dispatchCommand","FORMAT_TEXT_COMMAND","default","createElement","onClick","className"],"sources":["UnderlineAction.tsx"],"sourcesContent":["import React from \"react\";\nimport { FORMAT_TEXT_COMMAND } from \"lexical\";\nimport { useCurrentSelection, useRichTextEditor } from \"~/hooks\";\n\nexport const UnderlineAction = () => {\n const { editor } = useRichTextEditor();\n const { rangeSelection } = useCurrentSelection();\n const isUnderlineSelected = rangeSelection ? rangeSelection.hasFormat(\"underline\") : false;\n\n const handleClick = () => {\n editor.dispatchCommand(FORMAT_TEXT_COMMAND, \"underline\");\n };\n\n return (\n <button\n onClick={handleClick}\n className={\"popup-item spaced \" + (isUnderlineSelected ? \"active\" : \"\")}\n aria-label=\"Format text as italic\"\n >\n <i className=\"format underline\" />\n </button>\n );\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAEO,IAAMG,eAAe,GAAAC,OAAA,CAAAD,eAAA,GAAG,SAAlBA,eAAeA,CAAA,EAAS;EACjC,IAAAE,kBAAA,GAAmB,IAAAC,wBAAiB,EAAC,CAAC;IAA9BC,MAAM,GAAAF,kBAAA,CAANE,MAAM;EACd,IAAAC,oBAAA,GAA2B,IAAAC,0BAAmB,EAAC,CAAC;IAAxCC,cAAc,GAAAF,oBAAA,CAAdE,cAAc;EACtB,IAAMC,mBAAmB,GAAGD,cAAc,GAAGA,cAAc,CAACE,SAAS,CAAC,WAAW,CAAC,GAAG,KAAK;EAE1F,IAAMC,WAAW,GAAG,SAAdA,WAAWA,CAAA,EAAS;IACtBN,MAAM,CAACO,eAAe,CAACC,4BAAmB,EAAE,WAAW,CAAC;EAC5D,CAAC;EAED,oBACIjB,MAAA,CAAAkB,OAAA,CAAAC,aAAA;IACIC,OAAO,EAAEL,WAAY;IACrBM,SAAS,EAAE,oBAAoB,IAAIR,mBAAmB,GAAG,QAAQ,GAAG,EAAE,CAAE;IACxE,cAAW;EAAuB,gBAElCb,MAAA,CAAAkB,OAAA,CAAAC,aAAA;IAAGE,SAAS,EAAC;EAAkB,CAAE,CAC7B,CAAC;AAEjB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","FORMAT_TEXT_COMMAND","useCurrentSelection","useRichTextEditor","UnderlineAction","editor","rangeSelection","isUnderlineSelected","hasFormat","handleClick","dispatchCommand","createElement","onClick","className"],"sources":["UnderlineAction.tsx"],"sourcesContent":["import React from \"react\";\nimport { FORMAT_TEXT_COMMAND } from \"lexical\";\nimport { useCurrentSelection, useRichTextEditor } from \"~/hooks/index.js\";\n\nexport const UnderlineAction = () => {\n const { editor } = useRichTextEditor();\n const { rangeSelection } = useCurrentSelection();\n const isUnderlineSelected = rangeSelection ? rangeSelection.hasFormat(\"underline\") : false;\n\n const handleClick = () => {\n editor.dispatchCommand(FORMAT_TEXT_COMMAND, \"underline\");\n };\n\n return (\n <button\n onClick={handleClick}\n className={\"popup-item spaced \" + (isUnderlineSelected ? \"active\" : \"\")}\n aria-label=\"Underline text\"\n >\n <i className=\"format underline\" />\n </button>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,SAASC,mBAAmB,QAAQ,SAAS;AAC7C,SAASC,mBAAmB,EAAEC,iBAAiB;AAE/C,OAAO,MAAMC,eAAe,GAAGA,CAAA,KAAM;EACjC,MAAM;IAAEC;EAAO,CAAC,GAAGF,iBAAiB,CAAC,CAAC;EACtC,MAAM;IAAEG;EAAe,CAAC,GAAGJ,mBAAmB,CAAC,CAAC;EAChD,MAAMK,mBAAmB,GAAGD,cAAc,GAAGA,cAAc,CAACE,SAAS,CAAC,WAAW,CAAC,GAAG,KAAK;EAE1F,MAAMC,WAAW,GAAGA,CAAA,KAAM;IACtBJ,MAAM,CAACK,eAAe,CAACT,mBAAmB,EAAE,WAAW,CAAC;EAC5D,CAAC;EAED,oBACID,KAAA,CAAAW,aAAA;IACIC,OAAO,EAAEH,WAAY;IACrBI,SAAS,EAAE,oBAAoB,IAAIN,mBAAmB,GAAG,QAAQ,GAAG,EAAE,CAAE;IACxE,cAAW;EAAgB,gBAE3BP,KAAA,CAAAW,aAAA;IAAGE,SAAS,EAAC;EAAkB,CAAE,CAC7B,CAAC;AAEjB,CAAC","ignoreList":[]}
@@ -1,11 +1,4 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.FontColorActionContext = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var FontColorActionContext = exports.FontColorActionContext = /*#__PURE__*/_react.default.createContext(undefined);
1
+ import React from "react";
2
+ export const FontColorActionContext = /*#__PURE__*/React.createContext(undefined);
10
3
 
11
4
  //# sourceMappingURL=FontColorActionContext.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","FontColorActionContext","exports","React","createContext","undefined"],"sources":["FontColorActionContext.tsx"],"sourcesContent":["import React from \"react\";\n\nexport interface FontColorActionContext {\n /*\n * @desc Current selected color value\n * */\n value: string;\n\n /*\n * @desc Apply color to selected text.\n * @params: value\n */\n applyColor: (value: string, themeColorName: string | undefined) => void;\n}\n\nexport const FontColorActionContext = React.createContext<FontColorActionContext | undefined>(\n undefined\n);\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAeO,IAAMC,sBAAsB,GAAAC,OAAA,CAAAD,sBAAA,gBAAGE,cAAK,CAACC,aAAa,CACrDC,SACJ,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","FontColorActionContext","createContext","undefined"],"sources":["FontColorActionContext.tsx"],"sourcesContent":["import React from \"react\";\n\nexport interface FontColorActionContext {\n /*\n * @desc Current selected color value\n * */\n value: string;\n\n /*\n * @desc Apply color to selected text.\n * @params: value\n */\n applyColor: (value: string, themeColorName: string | undefined) => void;\n}\n\nexport const FontColorActionContext = React.createContext<FontColorActionContext | undefined>(\n undefined\n);\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAezB,OAAO,MAAMC,sBAAsB,gBAAGD,KAAK,CAACE,aAAa,CACrDC,SACJ,CAAC","ignoreList":[]}
@@ -1,19 +1,18 @@
1
1
  import React from "react";
2
- import { LexicalEditor } from "lexical";
3
- import type { ThemeEmotionMap, WebinyTheme } from "@webiny/lexical-theme";
4
- import { ToolbarActionPlugin } from "../types";
2
+ import type { LexicalEditor } from "lexical";
3
+ import { type EditorTheme, Theme } from "@webiny/lexical-theme";
4
+ import type { ToolbarActionPlugin } from "../types.js";
5
5
  export interface RichTextEditorContext {
6
6
  editor: LexicalEditor;
7
- theme?: WebinyTheme;
8
- themeEmotionMap?: ThemeEmotionMap;
7
+ getOverlaysElement: () => HTMLElement;
9
8
  toolbarActionPlugins: ToolbarActionPlugin[];
9
+ theme: Theme;
10
10
  }
11
11
  export declare const RichTextEditorContext: React.Context<RichTextEditorContext | undefined>;
12
12
  interface RichTextEditorProviderProps {
13
- theme: WebinyTheme;
14
- themeEmotionMap?: ThemeEmotionMap;
13
+ theme: EditorTheme;
15
14
  toolbarActionPlugins?: ToolbarActionPlugin[];
16
15
  children?: React.ReactNode | React.ReactNode[];
17
16
  }
18
- export declare const RichTextEditorProvider: ({ themeEmotionMap, theme, toolbarActionPlugins, children }: RichTextEditorProviderProps) => React.JSX.Element;
17
+ export declare const RichTextEditorProvider: ({ theme, toolbarActionPlugins, children }: RichTextEditorProviderProps) => React.JSX.Element;
19
18
  export {};
@@ -1,30 +1,32 @@
1
- "use strict";
2
-
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
5
- Object.defineProperty(exports, "__esModule", {
6
- value: true
7
- });
8
- exports.RichTextEditorProvider = exports.RichTextEditorContext = void 0;
9
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
- var _react = _interopRequireWildcard(require("react"));
11
- var _LexicalComposerContext = require("@lexical/react/LexicalComposerContext");
12
- var RichTextEditorContext = exports.RichTextEditorContext = /*#__PURE__*/(0, _react.createContext)(undefined);
13
- var RichTextEditorProvider = exports.RichTextEditorProvider = function RichTextEditorProvider(_ref) {
14
- var themeEmotionMap = _ref.themeEmotionMap,
15
- theme = _ref.theme,
16
- _ref$toolbarActionPlu = _ref.toolbarActionPlugins,
17
- toolbarActionPlugins = _ref$toolbarActionPlu === void 0 ? [] : _ref$toolbarActionPlu,
18
- children = _ref.children;
19
- var _useLexicalComposerCo = (0, _LexicalComposerContext.useLexicalComposerContext)(),
20
- _useLexicalComposerCo2 = (0, _slicedToArray2.default)(_useLexicalComposerCo, 1),
21
- editor = _useLexicalComposerCo2[0];
22
- return /*#__PURE__*/_react.default.createElement(RichTextEditorContext.Provider, {
1
+ import React, { createContext, useCallback, useMemo } from "react";
2
+ import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
3
+ import { Theme } from "@webiny/lexical-theme";
4
+ export const RichTextEditorContext = /*#__PURE__*/createContext(undefined);
5
+ export const RichTextEditorProvider = ({
6
+ theme,
7
+ toolbarActionPlugins = [],
8
+ children
9
+ }) => {
10
+ const [editor] = useLexicalComposerContext();
11
+ const getOverlaysElement = useCallback(() => {
12
+ const rootElement = editor.getRootElement();
13
+ if (!rootElement) {
14
+ return document.body;
15
+ }
16
+ const shell = rootElement.closest(".editor-shell");
17
+ if (!shell) {
18
+ return document.body;
19
+ }
20
+ const overlays = shell.previousElementSibling;
21
+ return overlays ?? document.body;
22
+ }, [editor]);
23
+ const internalTheme = useMemo(() => new Theme(theme.colors, theme.typography, theme.tokens), [theme]);
24
+ return /*#__PURE__*/React.createElement(RichTextEditorContext.Provider, {
23
25
  value: {
24
- editor: editor,
25
- theme: theme,
26
- themeEmotionMap: themeEmotionMap,
27
- toolbarActionPlugins: toolbarActionPlugins
26
+ editor,
27
+ getOverlaysElement,
28
+ theme: internalTheme,
29
+ toolbarActionPlugins
28
30
  }
29
31
  }, children);
30
32
  };
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","_LexicalComposerContext","RichTextEditorContext","exports","createContext","undefined","RichTextEditorProvider","_ref","themeEmotionMap","theme","_ref$toolbarActionPlu","toolbarActionPlugins","children","_useLexicalComposerCo","useLexicalComposerContext","_useLexicalComposerCo2","_slicedToArray2","default","editor","createElement","Provider","value"],"sources":["RichTextEditorContext.tsx"],"sourcesContent":["import React, { createContext } from \"react\";\nimport { LexicalEditor } from \"lexical\";\nimport { useLexicalComposerContext } from \"@lexical/react/LexicalComposerContext\";\nimport type { ThemeEmotionMap, WebinyTheme } from \"@webiny/lexical-theme\";\nimport { ToolbarActionPlugin } from \"~/types\";\n\nexport interface RichTextEditorContext {\n editor: LexicalEditor;\n theme?: WebinyTheme;\n themeEmotionMap?: ThemeEmotionMap;\n toolbarActionPlugins: ToolbarActionPlugin[];\n}\n\nexport const RichTextEditorContext = createContext<RichTextEditorContext | undefined>(undefined);\n\ninterface RichTextEditorProviderProps {\n theme: WebinyTheme;\n themeEmotionMap?: ThemeEmotionMap;\n toolbarActionPlugins?: ToolbarActionPlugin[];\n children?: React.ReactNode | React.ReactNode[];\n}\n\nexport const RichTextEditorProvider = ({\n themeEmotionMap,\n theme,\n toolbarActionPlugins = [],\n children\n}: RichTextEditorProviderProps) => {\n const [editor] = useLexicalComposerContext();\n\n return (\n <RichTextEditorContext.Provider\n value={{\n editor,\n theme,\n themeEmotionMap,\n toolbarActionPlugins\n }}\n >\n {children}\n </RichTextEditorContext.Provider>\n );\n};\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAEA,IAAAC,uBAAA,GAAAD,OAAA;AAWO,IAAME,qBAAqB,GAAAC,OAAA,CAAAD,qBAAA,gBAAG,IAAAE,oBAAa,EAAoCC,SAAS,CAAC;AASzF,IAAMC,sBAAsB,GAAAH,OAAA,CAAAG,sBAAA,GAAG,SAAzBA,sBAAsBA,CAAAC,IAAA,EAKA;EAAA,IAJ/BC,eAAe,GAAAD,IAAA,CAAfC,eAAe;IACfC,KAAK,GAAAF,IAAA,CAALE,KAAK;IAAAC,qBAAA,GAAAH,IAAA,CACLI,oBAAoB;IAApBA,oBAAoB,GAAAD,qBAAA,cAAG,EAAE,GAAAA,qBAAA;IACzBE,QAAQ,GAAAL,IAAA,CAARK,QAAQ;EAER,IAAAC,qBAAA,GAAiB,IAAAC,iDAAyB,EAAC,CAAC;IAAAC,sBAAA,OAAAC,eAAA,CAAAC,OAAA,EAAAJ,qBAAA;IAArCK,MAAM,GAAAH,sBAAA;EAEb,oBACIjB,MAAA,CAAAmB,OAAA,CAAAE,aAAA,CAACjB,qBAAqB,CAACkB,QAAQ;IAC3BC,KAAK,EAAE;MACHH,MAAM,EAANA,MAAM;MACNT,KAAK,EAALA,KAAK;MACLD,eAAe,EAAfA,eAAe;MACfG,oBAAoB,EAApBA;IACJ;EAAE,GAEDC,QAC2B,CAAC;AAEzC,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","createContext","useCallback","useMemo","useLexicalComposerContext","Theme","RichTextEditorContext","undefined","RichTextEditorProvider","theme","toolbarActionPlugins","children","editor","getOverlaysElement","rootElement","getRootElement","document","body","shell","closest","overlays","previousElementSibling","internalTheme","colors","typography","tokens","createElement","Provider","value"],"sources":["RichTextEditorContext.tsx"],"sourcesContent":["import React, { createContext, useCallback, useMemo } from \"react\";\nimport type { LexicalEditor } from \"lexical\";\nimport { useLexicalComposerContext } from \"@lexical/react/LexicalComposerContext\";\nimport { type EditorTheme, Theme } from \"@webiny/lexical-theme\";\nimport type { ToolbarActionPlugin } from \"~/types.js\";\n\nexport interface RichTextEditorContext {\n editor: LexicalEditor;\n getOverlaysElement: () => HTMLElement;\n toolbarActionPlugins: ToolbarActionPlugin[];\n theme: Theme;\n}\n\nexport const RichTextEditorContext = createContext<RichTextEditorContext | undefined>(undefined);\n\ninterface RichTextEditorProviderProps {\n theme: EditorTheme;\n toolbarActionPlugins?: ToolbarActionPlugin[];\n children?: React.ReactNode | React.ReactNode[];\n}\n\nexport const RichTextEditorProvider = ({\n theme,\n toolbarActionPlugins = [],\n children\n}: RichTextEditorProviderProps) => {\n const [editor] = useLexicalComposerContext();\n\n const getOverlaysElement = useCallback(() => {\n const rootElement = editor.getRootElement();\n if (!rootElement) {\n return document.body;\n }\n\n const shell = rootElement.closest(\".editor-shell\");\n if (!shell) {\n return document.body;\n }\n const overlays = shell.previousElementSibling;\n\n return (overlays ?? document.body) as HTMLElement;\n }, [editor]);\n\n const internalTheme = useMemo(\n () => new Theme(theme.colors, theme.typography, theme.tokens),\n [theme]\n );\n\n return (\n <RichTextEditorContext.Provider\n value={{\n editor,\n getOverlaysElement,\n theme: internalTheme,\n toolbarActionPlugins\n }}\n >\n {children}\n </RichTextEditorContext.Provider>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,aAAa,EAAEC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AAElE,SAASC,yBAAyB,QAAQ,uCAAuC;AACjF,SAA2BC,KAAK,QAAQ,uBAAuB;AAU/D,OAAO,MAAMC,qBAAqB,gBAAGL,aAAa,CAAoCM,SAAS,CAAC;AAQhG,OAAO,MAAMC,sBAAsB,GAAGA,CAAC;EACnCC,KAAK;EACLC,oBAAoB,GAAG,EAAE;EACzBC;AACyB,CAAC,KAAK;EAC/B,MAAM,CAACC,MAAM,CAAC,GAAGR,yBAAyB,CAAC,CAAC;EAE5C,MAAMS,kBAAkB,GAAGX,WAAW,CAAC,MAAM;IACzC,MAAMY,WAAW,GAAGF,MAAM,CAACG,cAAc,CAAC,CAAC;IAC3C,IAAI,CAACD,WAAW,EAAE;MACd,OAAOE,QAAQ,CAACC,IAAI;IACxB;IAEA,MAAMC,KAAK,GAAGJ,WAAW,CAACK,OAAO,CAAC,eAAe,CAAC;IAClD,IAAI,CAACD,KAAK,EAAE;MACR,OAAOF,QAAQ,CAACC,IAAI;IACxB;IACA,MAAMG,QAAQ,GAAGF,KAAK,CAACG,sBAAsB;IAE7C,OAAQD,QAAQ,IAAIJ,QAAQ,CAACC,IAAI;EACrC,CAAC,EAAE,CAACL,MAAM,CAAC,CAAC;EAEZ,MAAMU,aAAa,GAAGnB,OAAO,CACzB,MAAM,IAAIE,KAAK,CAACI,KAAK,CAACc,MAAM,EAAEd,KAAK,CAACe,UAAU,EAAEf,KAAK,CAACgB,MAAM,CAAC,EAC7D,CAAChB,KAAK,CACV,CAAC;EAED,oBACIT,KAAA,CAAA0B,aAAA,CAACpB,qBAAqB,CAACqB,QAAQ;IAC3BC,KAAK,EAAE;MACHhB,MAAM;MACNC,kBAAkB;MAClBJ,KAAK,EAAEa,aAAa;MACpBZ;IACJ;EAAE,GAEDC,QAC2B,CAAC;AAEzC,CAAC","ignoreList":[]}
@@ -1,6 +1,6 @@
1
- import { ReactNode } from "react";
2
- import { HistoryState } from "@lexical/history";
3
- declare type ContextShape = {
1
+ import type { ReactNode } from "react";
2
+ import type { HistoryState } from "@lexical/history";
3
+ type ContextShape = {
4
4
  historyState?: HistoryState;
5
5
  };
6
6
  export declare const SharedHistoryContext: ({ children }: {
@@ -1,27 +1,19 @@
1
- "use strict";
2
-
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.useSharedHistoryContext = exports.SharedHistoryContext = void 0;
8
- var _react = _interopRequireWildcard(require("react"));
9
- var React = _react;
10
- var _history = require("@lexical/history");
11
- var Context = /*#__PURE__*/(0, _react.createContext)({});
12
- var SharedHistoryContext = exports.SharedHistoryContext = function SharedHistoryContext(_ref) {
13
- var children = _ref.children;
14
- var historyContext = (0, _react.useMemo)(function () {
15
- return {
16
- historyState: (0, _history.createEmptyHistoryState)()
17
- };
18
- }, []);
1
+ import * as React from "react";
2
+ import { createContext, useContext, useMemo } from "react";
3
+ import { createEmptyHistoryState } from "@lexical/history";
4
+ const Context = /*#__PURE__*/createContext({});
5
+ export const SharedHistoryContext = ({
6
+ children
7
+ }) => {
8
+ const historyContext = useMemo(() => ({
9
+ historyState: createEmptyHistoryState()
10
+ }), []);
19
11
  return /*#__PURE__*/React.createElement(Context.Provider, {
20
12
  value: historyContext
21
13
  }, children);
22
14
  };
23
- var useSharedHistoryContext = exports.useSharedHistoryContext = function useSharedHistoryContext() {
24
- return (0, _react.useContext)(Context);
15
+ export const useSharedHistoryContext = () => {
16
+ return useContext(Context);
25
17
  };
26
18
 
27
19
  //# sourceMappingURL=SharedHistoryContext.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireWildcard","require","React","_history","Context","createContext","SharedHistoryContext","exports","_ref","children","historyContext","useMemo","historyState","createEmptyHistoryState","createElement","Provider","value","useSharedHistoryContext","useContext"],"sources":["SharedHistoryContext.tsx"],"sourcesContent":["import * as React from \"react\";\nimport { createContext, ReactNode, useContext, useMemo } from \"react\";\nimport { createEmptyHistoryState, HistoryState } from \"@lexical/history\";\n\ntype ContextShape = {\n historyState?: HistoryState;\n};\n\nconst Context: React.Context<ContextShape> = createContext({});\n\nexport const SharedHistoryContext = ({ children }: { children: ReactNode }): JSX.Element => {\n const historyContext = useMemo(() => ({ historyState: createEmptyHistoryState() }), []);\n return <Context.Provider value={historyContext}>{children}</Context.Provider>;\n};\n\nexport const useSharedHistoryContext = (): ContextShape => {\n return useContext(Context);\n};\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AAA+B,IAAAC,KAAA,GAAAH,MAAA;AAE/B,IAAAI,QAAA,GAAAF,OAAA;AAMA,IAAMG,OAAoC,gBAAG,IAAAC,oBAAa,EAAC,CAAC,CAAC,CAAC;AAEvD,IAAMC,oBAAoB,GAAAC,OAAA,CAAAD,oBAAA,GAAG,SAAvBA,oBAAoBA,CAAAE,IAAA,EAA2D;EAAA,IAArDC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;EAC3C,IAAMC,cAAc,GAAG,IAAAC,cAAO,EAAC;IAAA,OAAO;MAAEC,YAAY,EAAE,IAAAC,gCAAuB,EAAC;IAAE,CAAC;EAAA,CAAC,EAAE,EAAE,CAAC;EACvF,oBAAOX,KAAA,CAAAY,aAAA,CAACV,OAAO,CAACW,QAAQ;IAACC,KAAK,EAAEN;EAAe,GAAED,QAA2B,CAAC;AACjF,CAAC;AAEM,IAAMQ,uBAAuB,GAAAV,OAAA,CAAAU,uBAAA,GAAG,SAA1BA,uBAAuBA,CAAA,EAAuB;EACvD,OAAO,IAAAC,iBAAU,EAACd,OAAO,CAAC;AAC9B,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","createContext","useContext","useMemo","createEmptyHistoryState","Context","SharedHistoryContext","children","historyContext","historyState","createElement","Provider","value","useSharedHistoryContext"],"sources":["SharedHistoryContext.tsx"],"sourcesContent":["import * as React from \"react\";\nimport type { ReactNode } from \"react\";\nimport { createContext, useContext, useMemo } from \"react\";\nimport type { HistoryState } from \"@lexical/history\";\nimport { createEmptyHistoryState } from \"@lexical/history\";\n\ntype ContextShape = {\n historyState?: HistoryState;\n};\n\nconst Context: React.Context<ContextShape> = createContext({});\n\nexport const SharedHistoryContext = ({ children }: { children: ReactNode }): JSX.Element => {\n const historyContext = useMemo(() => ({ historyState: createEmptyHistoryState() }), []);\n return <Context.Provider value={historyContext}>{children}</Context.Provider>;\n};\n\nexport const useSharedHistoryContext = (): ContextShape => {\n return useContext(Context);\n};\n"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,SAASC,aAAa,EAAEC,UAAU,EAAEC,OAAO,QAAQ,OAAO;AAE1D,SAASC,uBAAuB,QAAQ,kBAAkB;AAM1D,MAAMC,OAAoC,gBAAGJ,aAAa,CAAC,CAAC,CAAC,CAAC;AAE9D,OAAO,MAAMK,oBAAoB,GAAGA,CAAC;EAAEC;AAAkC,CAAC,KAAkB;EACxF,MAAMC,cAAc,GAAGL,OAAO,CAAC,OAAO;IAAEM,YAAY,EAAEL,uBAAuB,CAAC;EAAE,CAAC,CAAC,EAAE,EAAE,CAAC;EACvF,oBAAOJ,KAAA,CAAAU,aAAA,CAACL,OAAO,CAACM,QAAQ;IAACC,KAAK,EAAEJ;EAAe,GAAED,QAA2B,CAAC;AACjF,CAAC;AAED,OAAO,MAAMM,uBAAuB,GAAGA,CAAA,KAAoB;EACvD,OAAOX,UAAU,CAACG,OAAO,CAAC;AAC9B,CAAC","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { ElementFormatType } from "lexical";
2
+ import type { ElementFormatType } from "lexical";
3
3
  export interface TextAlignmentActionContextProps {
4
4
  value: ElementFormatType;
5
5
  applyTextAlignment: (value: ElementFormatType) => void;
@@ -1,11 +1,4 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.TextAlignmentActionContext = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var TextAlignmentActionContext = exports.TextAlignmentActionContext = /*#__PURE__*/_react.default.createContext(undefined);
1
+ import React from "react";
2
+ export const TextAlignmentActionContext = /*#__PURE__*/React.createContext(undefined);
10
3
 
11
4
  //# sourceMappingURL=TextAlignmentActionContextProps.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","TextAlignmentActionContext","exports","React","createContext","undefined"],"sources":["TextAlignmentActionContextProps.tsx"],"sourcesContent":["import React from \"react\";\nimport { ElementFormatType } from \"lexical\";\n\nexport interface TextAlignmentActionContextProps {\n /*\n * Selected text alignment value\n * */\n value: ElementFormatType;\n\n /*\n * Apply text alignment to selected text\n */\n applyTextAlignment: (value: ElementFormatType) => void;\n\n outdentText: () => void;\n\n indentText: () => void;\n}\n\nexport const TextAlignmentActionContext = React.createContext<\n TextAlignmentActionContextProps | undefined\n>(undefined);\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAmBO,IAAMC,0BAA0B,GAAAC,OAAA,CAAAD,0BAAA,gBAAGE,cAAK,CAACC,aAAa,CAE3DC,SAAS,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","TextAlignmentActionContext","createContext","undefined"],"sources":["TextAlignmentActionContextProps.tsx"],"sourcesContent":["import React from \"react\";\nimport type { ElementFormatType } from \"lexical\";\n\nexport interface TextAlignmentActionContextProps {\n /*\n * Selected text alignment value\n * */\n value: ElementFormatType;\n\n /*\n * Apply text alignment to selected text\n */\n applyTextAlignment: (value: ElementFormatType) => void;\n\n outdentText: () => void;\n\n indentText: () => void;\n}\n\nexport const TextAlignmentActionContext = React.createContext<\n TextAlignmentActionContextProps | undefined\n>(undefined);\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAmBzB,OAAO,MAAMC,0BAA0B,gBAAGD,KAAK,CAACE,aAAa,CAE3DC,SAAS,CAAC","ignoreList":[]}
@@ -1,7 +1,8 @@
1
1
  import React from "react";
2
- import { TypographyValue } from "@webiny/lexical-theme";
2
+ import type { TypographyValue } from "@webiny/lexical-theme";
3
+ export type ActiveTypography = Pick<TypographyValue, "id" | "label">;
3
4
  export interface TypographyActionContextProps {
4
- value: TypographyValue | undefined;
5
+ value: ActiveTypography | undefined;
5
6
  applyTypography: (value: TypographyValue) => void;
6
7
  }
7
8
  export declare const TypographyActionContext: React.Context<TypographyActionContextProps | undefined>;
@@ -1,11 +1,4 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.TypographyActionContext = void 0;
8
- var _react = _interopRequireDefault(require("react"));
9
- var TypographyActionContext = exports.TypographyActionContext = /*#__PURE__*/_react.default.createContext(undefined);
1
+ import React from "react";
2
+ export const TypographyActionContext = /*#__PURE__*/React.createContext(undefined);
10
3
 
11
4
  //# sourceMappingURL=TypographyActionContext.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","TypographyActionContext","exports","React","createContext","undefined"],"sources":["TypographyActionContext.tsx"],"sourcesContent":["import React from \"react\";\nimport { TypographyValue } from \"@webiny/lexical-theme\";\n\nexport interface TypographyActionContextProps {\n /*\n * @desc Current selected typography\n * */\n value: TypographyValue | undefined;\n\n /*\n * @desc Apply font family to selected text.\n * @params: value\n */\n applyTypography: (value: TypographyValue) => void;\n}\n\nexport const TypographyActionContext = React.createContext<\n TypographyActionContextProps | undefined\n>(undefined);\n"],"mappings":";;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AAgBO,IAAMC,uBAAuB,GAAAC,OAAA,CAAAD,uBAAA,gBAAGE,cAAK,CAACC,aAAa,CAExDC,SAAS,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["React","TypographyActionContext","createContext","undefined"],"sources":["TypographyActionContext.tsx"],"sourcesContent":["import React from \"react\";\nimport type { TypographyValue } from \"@webiny/lexical-theme\";\n\nexport type ActiveTypography = Pick<TypographyValue, \"id\" | \"label\">;\n\nexport interface TypographyActionContextProps {\n /*\n * @desc Current selected typography\n * */\n value: ActiveTypography | undefined;\n\n /*\n * @desc Apply font family to selected text.\n * @params: value\n */\n applyTypography: (value: TypographyValue) => void;\n}\n\nexport const TypographyActionContext = React.createContext<\n TypographyActionContextProps | undefined\n>(undefined);\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAkBzB,OAAO,MAAMC,uBAAuB,gBAAGD,KAAK,CAACE,aAAa,CAExDC,SAAS,CAAC","ignoreList":[]}
@@ -0,0 +1,15 @@
1
+ export { LexicalHtmlRenderer } from "../../components/LexicalHtmlRenderer.js";
2
+ export { getNodeFromSelection } from "../../hooks/index.js";
3
+ export { useCurrentElement } from "../../hooks/index.js";
4
+ export { useCurrentSelection } from "../../hooks/index.js";
5
+ export { useDeriveValueFromSelection } from "../../hooks/index.js";
6
+ export { useRichTextEditor } from "../../hooks/index.js";
7
+ export { useFontColorPicker } from "../../hooks/index.js";
8
+ export { useTextAlignmentAction } from "../../hooks/index.js";
9
+ export { useTypographyAction } from "../../hooks/index.js";
10
+ export { useIsMounted } from "../../hooks/index.js";
11
+ export { Divider } from "../../ui/Divider.js";
12
+ export { DropDownItem } from "../../ui/DropDown.js";
13
+ export { DropDown } from "../../ui/DropDown.js";
14
+ export type { Klass, LexicalNode } from "../../types.js";
15
+ export { LexicalEditorConfig, useLexicalEditorConfig } from "../../components/LexicalEditorConfig/LexicalEditorConfig.js";
@@ -0,0 +1,23 @@
1
+ // render
2
+ export { LexicalHtmlRenderer } from "../../components/LexicalHtmlRenderer.js";
3
+ // hooks
4
+ export { getNodeFromSelection } from "../../hooks/index.js";
5
+ export { useCurrentElement } from "../../hooks/index.js";
6
+ export { useCurrentSelection } from "../../hooks/index.js";
7
+ export { useDeriveValueFromSelection } from "../../hooks/index.js";
8
+ export { useRichTextEditor } from "../../hooks/index.js";
9
+ export { useFontColorPicker } from "../../hooks/index.js";
10
+ export { useTextAlignmentAction } from "../../hooks/index.js";
11
+ export { useTypographyAction } from "../../hooks/index.js";
12
+ export { useIsMounted } from "../../hooks/index.js";
13
+ // UI elements
14
+ export { Divider } from "../../ui/Divider.js";
15
+ export { DropDownItem } from "../../ui/DropDown.js";
16
+ export { DropDown } from "../../ui/DropDown.js";
17
+
18
+ // types
19
+
20
+ // config
21
+ export { LexicalEditorConfig, useLexicalEditorConfig } from "../../components/LexicalEditorConfig/LexicalEditorConfig.js";
22
+
23
+ //# sourceMappingURL=lexical.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["LexicalHtmlRenderer","getNodeFromSelection","useCurrentElement","useCurrentSelection","useDeriveValueFromSelection","useRichTextEditor","useFontColorPicker","useTextAlignmentAction","useTypographyAction","useIsMounted","Divider","DropDownItem","DropDown","LexicalEditorConfig","useLexicalEditorConfig"],"sources":["lexical.ts"],"sourcesContent":["// render\nexport { LexicalHtmlRenderer } from \"~/components/LexicalHtmlRenderer.js\";\n// hooks\nexport { getNodeFromSelection } from \"~/hooks/index.js\";\nexport { useCurrentElement } from \"~/hooks/index.js\";\nexport { useCurrentSelection } from \"~/hooks/index.js\";\nexport { useDeriveValueFromSelection } from \"~/hooks/index.js\";\nexport { useRichTextEditor } from \"~/hooks/index.js\";\nexport { useFontColorPicker } from \"~/hooks/index.js\";\nexport { useTextAlignmentAction } from \"~/hooks/index.js\";\nexport { useTypographyAction } from \"~/hooks/index.js\";\nexport { useIsMounted } from \"~/hooks/index.js\";\n// UI elements\nexport { Divider } from \"~/ui/Divider.js\";\nexport { DropDownItem } from \"~/ui/DropDown.js\";\nexport { DropDown } from \"~/ui/DropDown.js\";\n\n// types\nexport type { Klass, LexicalNode } from \"~/types.js\";\n// config\nexport {\n LexicalEditorConfig,\n useLexicalEditorConfig\n} from \"~/components/LexicalEditorConfig/LexicalEditorConfig.js\";\n"],"mappings":"AAAA;AACA,SAASA,mBAAmB;AAC5B;AACA,SAASC,oBAAoB;AAC7B,SAASC,iBAAiB;AAC1B,SAASC,mBAAmB;AAC5B,SAASC,2BAA2B;AACpC,SAASC,iBAAiB;AAC1B,SAASC,kBAAkB;AAC3B,SAASC,sBAAsB;AAC/B,SAASC,mBAAmB;AAC5B,SAASC,YAAY;AACrB;AACA,SAASC,OAAO;AAChB,SAASC,YAAY;AACrB,SAASC,QAAQ;;AAEjB;;AAEA;AACA,SACIC,mBAAmB,EACnBC,sBAAsB","ignoreList":[]}
package/hooks/index.d.ts CHANGED
@@ -1,8 +1,7 @@
1
- export * from "./useRichTextEditor";
2
- export * from "./useFontColorPicker";
3
- export * from "./useTypographyAction";
4
- export * from "./useTextAlignmentAction";
5
- export * from "./useCurrentSelection";
6
- export * from "./useCurrentElement";
7
- export * from "./useList";
8
- export * from "./useIsMounted";
1
+ export * from "./useRichTextEditor.js";
2
+ export * from "./useFontColorPicker.js";
3
+ export * from "./useTypographyAction.js";
4
+ export * from "./useTextAlignmentAction.js";
5
+ export * from "./useCurrentSelection.js";
6
+ export * from "./useCurrentElement.js";
7
+ export * from "./useIsMounted.js";
package/hooks/index.js CHANGED
@@ -1,95 +1,9 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- var _useRichTextEditor = require("./useRichTextEditor");
7
- Object.keys(_useRichTextEditor).forEach(function (key) {
8
- if (key === "default" || key === "__esModule") return;
9
- if (key in exports && exports[key] === _useRichTextEditor[key]) return;
10
- Object.defineProperty(exports, key, {
11
- enumerable: true,
12
- get: function get() {
13
- return _useRichTextEditor[key];
14
- }
15
- });
16
- });
17
- var _useFontColorPicker = require("./useFontColorPicker");
18
- Object.keys(_useFontColorPicker).forEach(function (key) {
19
- if (key === "default" || key === "__esModule") return;
20
- if (key in exports && exports[key] === _useFontColorPicker[key]) return;
21
- Object.defineProperty(exports, key, {
22
- enumerable: true,
23
- get: function get() {
24
- return _useFontColorPicker[key];
25
- }
26
- });
27
- });
28
- var _useTypographyAction = require("./useTypographyAction");
29
- Object.keys(_useTypographyAction).forEach(function (key) {
30
- if (key === "default" || key === "__esModule") return;
31
- if (key in exports && exports[key] === _useTypographyAction[key]) return;
32
- Object.defineProperty(exports, key, {
33
- enumerable: true,
34
- get: function get() {
35
- return _useTypographyAction[key];
36
- }
37
- });
38
- });
39
- var _useTextAlignmentAction = require("./useTextAlignmentAction");
40
- Object.keys(_useTextAlignmentAction).forEach(function (key) {
41
- if (key === "default" || key === "__esModule") return;
42
- if (key in exports && exports[key] === _useTextAlignmentAction[key]) return;
43
- Object.defineProperty(exports, key, {
44
- enumerable: true,
45
- get: function get() {
46
- return _useTextAlignmentAction[key];
47
- }
48
- });
49
- });
50
- var _useCurrentSelection = require("./useCurrentSelection");
51
- Object.keys(_useCurrentSelection).forEach(function (key) {
52
- if (key === "default" || key === "__esModule") return;
53
- if (key in exports && exports[key] === _useCurrentSelection[key]) return;
54
- Object.defineProperty(exports, key, {
55
- enumerable: true,
56
- get: function get() {
57
- return _useCurrentSelection[key];
58
- }
59
- });
60
- });
61
- var _useCurrentElement = require("./useCurrentElement");
62
- Object.keys(_useCurrentElement).forEach(function (key) {
63
- if (key === "default" || key === "__esModule") return;
64
- if (key in exports && exports[key] === _useCurrentElement[key]) return;
65
- Object.defineProperty(exports, key, {
66
- enumerable: true,
67
- get: function get() {
68
- return _useCurrentElement[key];
69
- }
70
- });
71
- });
72
- var _useList = require("./useList");
73
- Object.keys(_useList).forEach(function (key) {
74
- if (key === "default" || key === "__esModule") return;
75
- if (key in exports && exports[key] === _useList[key]) return;
76
- Object.defineProperty(exports, key, {
77
- enumerable: true,
78
- get: function get() {
79
- return _useList[key];
80
- }
81
- });
82
- });
83
- var _useIsMounted = require("./useIsMounted");
84
- Object.keys(_useIsMounted).forEach(function (key) {
85
- if (key === "default" || key === "__esModule") return;
86
- if (key in exports && exports[key] === _useIsMounted[key]) return;
87
- Object.defineProperty(exports, key, {
88
- enumerable: true,
89
- get: function get() {
90
- return _useIsMounted[key];
91
- }
92
- });
93
- });
1
+ export * from "./useRichTextEditor.js";
2
+ export * from "./useFontColorPicker.js";
3
+ export * from "./useTypographyAction.js";
4
+ export * from "./useTextAlignmentAction.js";
5
+ export * from "./useCurrentSelection.js";
6
+ export * from "./useCurrentElement.js";
7
+ export * from "./useIsMounted.js";
94
8
 
95
9
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_useRichTextEditor","require","Object","keys","forEach","key","exports","defineProperty","enumerable","get","_useFontColorPicker","_useTypographyAction","_useTextAlignmentAction","_useCurrentSelection","_useCurrentElement","_useList","_useIsMounted"],"sources":["index.ts"],"sourcesContent":["export * from \"./useRichTextEditor\";\nexport * from \"./useFontColorPicker\";\nexport * from \"./useTypographyAction\";\nexport * from \"./useTextAlignmentAction\";\nexport * from \"./useCurrentSelection\";\nexport * from \"./useCurrentElement\";\nexport * from \"./useList\";\nexport * from \"./useIsMounted\";\n"],"mappings":";;;;;AAAA,IAAAA,kBAAA,GAAAC,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAH,kBAAA,EAAAI,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAL,kBAAA,CAAAK,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAT,kBAAA,CAAAK,GAAA;IAAA;EAAA;AAAA;AACA,IAAAK,mBAAA,GAAAT,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAO,mBAAA,EAAAN,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAK,mBAAA,CAAAL,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAC,mBAAA,CAAAL,GAAA;IAAA;EAAA;AAAA;AACA,IAAAM,oBAAA,GAAAV,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAQ,oBAAA,EAAAP,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAA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A,IAAA;MAAA,OAAAK,kBAAA,CAAAT,GAAA;IAAA;EAAA;AAAA;AACA,IAAAU,QAAA,GAAAd,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAY,QAAA,EAAAX,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAU,QAAA,CAAAV,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAM,QAAA,CAAAV,GAAA;IAAA;EAAA;AAAA;AACA,IAAAW,aAAA,GAAAf,OAAA;AAAAC,MAAA,CAAAC,IAAA,CAAAa,aAAA,EAAAZ,OAAA,WAAAC,GAAA;EAAA,IAAAA,GAAA,kBAAAA,GAAA;EAAA,IAAAA,GAAA,IAAAC,OAAA,IAAAA,OAAA,CAAAD,GAAA,MAAAW,aAAA,CAAAX,GAAA;EAAAH,MAAA,CAAAK,cAAA,CAAAD,OAAA,EAAAD,GAAA;IAAAG,UAAA;IAAAC,GAAA,WAAAA,IAAA;MAAA,OAAAO,aAAA,CAAAX,GAAA;IAAA;EAAA;AAAA","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./useRichTextEditor.js\";\nexport * from \"./useFontColorPicker.js\";\nexport * from \"./useTypographyAction.js\";\nexport * from \"./useTextAlignmentAction.js\";\nexport * from \"./useCurrentSelection.js\";\nexport * from \"./useCurrentElement.js\";\nexport * from \"./useIsMounted.js\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -1,7 +1,7 @@
1
- import { RangeSelection } from "lexical";
1
+ import type { RangeSelection } from "lexical";
2
2
  export declare function useCurrentElement(): {
3
3
  element: null;
4
4
  } | {
5
- element: import("lexical").LexicalNode;
5
+ element: import("lexical").TextNode | import("lexical").LexicalNode;
6
6
  };
7
- export declare function getNodeFromSelection(selection: RangeSelection): import("lexical").LexicalNode;
7
+ export declare function getNodeFromSelection(selection: RangeSelection): import("lexical").TextNode | import("lexical").LexicalNode;