@webiny/lexical-editor 6.0.0-alpha.5 → 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 (172) hide show
  1. package/README.md +6 -12
  2. package/commands/index.d.ts +5 -5
  3. package/commands/index.js +5 -5
  4. package/commands/index.js.map +1 -1
  5. package/components/Editor/EnsureHeadingTagPlugin.js +1 -1
  6. package/components/Editor/EnsureHeadingTagPlugin.js.map +1 -1
  7. package/components/Editor/RichTextEditor.d.ts +11 -6
  8. package/components/Editor/RichTextEditor.js +22 -16
  9. package/components/Editor/RichTextEditor.js.map +1 -1
  10. package/components/Editor/normalizeInputValue.d.ts +1 -1
  11. package/components/Editor/normalizeInputValue.js.map +1 -1
  12. package/components/LexicalEditorConfig/LexicalEditorConfig.d.ts +14 -16
  13. package/components/LexicalEditorConfig/LexicalEditorConfig.js +20 -58
  14. package/components/LexicalEditorConfig/LexicalEditorConfig.js.map +1 -1
  15. package/components/LexicalHtmlRenderer.d.ts +3 -6
  16. package/components/LexicalHtmlRenderer.js +12 -17
  17. package/components/LexicalHtmlRenderer.js.map +1 -1
  18. package/components/Toolbar/StaticToolbar.css +416 -0
  19. package/components/Toolbar/StaticToolbar.d.ts +1 -1
  20. package/components/Toolbar/StaticToolbar.js +2 -2
  21. package/components/Toolbar/StaticToolbar.js.map +1 -1
  22. package/components/ToolbarActions/BoldAction.js +2 -2
  23. package/components/ToolbarActions/BoldAction.js.map +1 -1
  24. package/components/ToolbarActions/BulletListAction.js +5 -6
  25. package/components/ToolbarActions/BulletListAction.js.map +1 -1
  26. package/components/ToolbarActions/CodeHighlightAction.js +2 -2
  27. package/components/ToolbarActions/CodeHighlightAction.js.map +1 -1
  28. package/components/ToolbarActions/FontColorAction.js +4 -4
  29. package/components/ToolbarActions/FontColorAction.js.map +1 -1
  30. package/components/ToolbarActions/ImageAction.js +3 -3
  31. package/components/ToolbarActions/ImageAction.js.map +1 -1
  32. package/components/ToolbarActions/ItalicAction.js +2 -2
  33. package/components/ToolbarActions/ItalicAction.js.map +1 -1
  34. package/components/ToolbarActions/LinkAction.js +3 -3
  35. package/components/ToolbarActions/LinkAction.js.map +1 -1
  36. package/components/ToolbarActions/NumberedListAction.js +7 -11
  37. package/components/ToolbarActions/NumberedListAction.js.map +1 -1
  38. package/components/ToolbarActions/QuoteAction.js +6 -6
  39. package/components/ToolbarActions/QuoteAction.js.map +1 -1
  40. package/components/ToolbarActions/TextAlignmentAction.js +4 -4
  41. package/components/ToolbarActions/TextAlignmentAction.js.map +1 -1
  42. package/components/ToolbarActions/TypographyAction.js +14 -11
  43. package/components/ToolbarActions/TypographyAction.js.map +1 -1
  44. package/components/ToolbarActions/UnderlineAction.js +1 -1
  45. package/components/ToolbarActions/UnderlineAction.js.map +1 -1
  46. package/context/RichTextEditorContext.d.ts +5 -6
  47. package/context/RichTextEditorContext.js +17 -4
  48. package/context/RichTextEditorContext.js.map +1 -1
  49. package/context/TypographyActionContext.d.ts +1 -1
  50. package/context/TypographyActionContext.js.map +1 -1
  51. package/exports/admin/lexical.d.ts +15 -0
  52. package/exports/admin/lexical.js +23 -0
  53. package/exports/admin/lexical.js.map +1 -0
  54. package/hooks/index.d.ts +7 -8
  55. package/hooks/index.js +7 -8
  56. package/hooks/index.js.map +1 -1
  57. package/hooks/useCurrentElement.js +2 -3
  58. package/hooks/useCurrentElement.js.map +1 -1
  59. package/hooks/useCurrentSelection.js +4 -4
  60. package/hooks/useCurrentSelection.js.map +1 -1
  61. package/hooks/useFontColorPicker.d.ts +1 -1
  62. package/hooks/useFontColorPicker.js +1 -1
  63. package/hooks/useFontColorPicker.js.map +1 -1
  64. package/hooks/useRichTextEditor.d.ts +1 -1
  65. package/hooks/useRichTextEditor.js +1 -1
  66. package/hooks/useRichTextEditor.js.map +1 -1
  67. package/hooks/useTextAlignmentAction.d.ts +1 -1
  68. package/hooks/useTextAlignmentAction.js +1 -1
  69. package/hooks/useTextAlignmentAction.js.map +1 -1
  70. package/hooks/useTypographyAction.d.ts +1 -1
  71. package/hooks/useTypographyAction.js +1 -1
  72. package/hooks/useTypographyAction.js.map +1 -1
  73. package/index.d.ts +33 -37
  74. package/index.js +33 -37
  75. package/index.js.map +1 -1
  76. package/package.json +18 -22
  77. package/plugins/BlurEventPlugin/BlurEventPlugin.d.ts +1 -1
  78. package/plugins/BlurEventPlugin/BlurEventPlugin.js +1 -1
  79. package/plugins/BlurEventPlugin/BlurEventPlugin.js.map +1 -1
  80. package/plugins/CodeHighlightPlugin/CodeHighlightPlugin.js +1 -1
  81. package/plugins/CodeHighlightPlugin/CodeHighlightPlugin.js.map +1 -1
  82. package/plugins/CodeHighlightPlugin/index.d.ts +1 -1
  83. package/plugins/CodeHighlightPlugin/index.js +1 -1
  84. package/plugins/CodeHighlightPlugin/index.js.map +1 -1
  85. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditor.d.ts +4 -10
  86. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditor.js +15 -145
  87. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditor.js.map +1 -1
  88. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorController.d.ts +2 -3
  89. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorController.js +10 -11
  90. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorController.js.map +1 -1
  91. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.css +1 -136
  92. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.d.ts +5 -6
  93. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.js +3 -7
  94. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.js.map +1 -1
  95. package/plugins/FloatingLinkEditorPlugin/index.d.ts +1 -1
  96. package/plugins/FloatingLinkEditorPlugin/index.js +1 -1
  97. package/plugins/FloatingLinkEditorPlugin/index.js.map +1 -1
  98. package/plugins/FloatingLinkEditorPlugin/types.d.ts +10 -0
  99. package/plugins/FloatingLinkEditorPlugin/types.js +3 -0
  100. package/plugins/FloatingLinkEditorPlugin/types.js.map +1 -0
  101. package/plugins/FloatingLinkEditorPlugin/useFloatingLinkEditor.d.ts +8 -0
  102. package/plugins/FloatingLinkEditorPlugin/useFloatingLinkEditor.js +128 -0
  103. package/plugins/FloatingLinkEditorPlugin/useFloatingLinkEditor.js.map +1 -0
  104. package/plugins/FontColorPlugin/FontColorPlugin.js +2 -2
  105. package/plugins/FontColorPlugin/FontColorPlugin.js.map +1 -1
  106. package/plugins/FontColorPlugin/applyColorToSelection.js +1 -1
  107. package/plugins/FontColorPlugin/applyColorToSelection.js.map +1 -1
  108. package/plugins/ImagesPlugin/ImagesPlugin.d.ts +1 -2
  109. package/plugins/ImagesPlugin/ImagesPlugin.js +5 -8
  110. package/plugins/ImagesPlugin/ImagesPlugin.js.map +1 -1
  111. package/plugins/LinkPlugin/LinkPlugin.js +2 -3
  112. package/plugins/LinkPlugin/LinkPlugin.js.map +1 -1
  113. package/plugins/ListPLugin/ListPlugin.js +45 -3
  114. package/plugins/ListPLugin/ListPlugin.js.map +1 -1
  115. package/plugins/QuoteNodePlugin/QuoteNodePlugin.js +12 -4
  116. package/plugins/QuoteNodePlugin/QuoteNodePlugin.js.map +1 -1
  117. package/plugins/StateHandlingPlugin.d.ts +1 -1
  118. package/plugins/StateHandlingPlugin.js +6 -6
  119. package/plugins/StateHandlingPlugin.js.map +1 -1
  120. package/plugins/TypographyPlugin/TypographyPlugin.js +2 -2
  121. package/plugins/TypographyPlugin/TypographyPlugin.js.map +1 -1
  122. package/types.d.ts +3 -3
  123. package/types.js +1 -1
  124. package/types.js.map +1 -1
  125. package/ui/ContentEditable.d.ts +0 -1
  126. package/ui/Divider.d.ts +0 -1
  127. package/ui/DropDown.js +4 -3
  128. package/ui/DropDown.js.map +1 -1
  129. package/ui/ImageResizer.d.ts +0 -1
  130. package/ui/ImageResizer.js.map +1 -1
  131. package/ui/LinkPreview.d.ts +0 -1
  132. package/ui/TextInput.d.ts +0 -1
  133. package/utils/files.d.ts +6 -6
  134. package/utils/files.js +3 -13
  135. package/utils/files.js.map +1 -1
  136. package/utils/insertImage.d.ts +1 -1
  137. package/utils/insertImage.js.map +1 -1
  138. package/utils/isValidLexicalData.d.ts +2 -2
  139. package/utils/isValidLexicalData.js.map +1 -1
  140. package/utils/rect.d.ts +1 -1
  141. package/utils/rect.js +1 -1
  142. package/utils/rect.js.map +1 -1
  143. package/utils/sanitizeUrl.js +1 -1
  144. package/utils/sanitizeUrl.js.map +1 -1
  145. package/utils/setFloatingElemPosition.d.ts +1 -1
  146. package/utils/setFloatingElemPosition.js +23 -21
  147. package/utils/setFloatingElemPosition.js.map +1 -1
  148. package/components/Editor/HeadingEditor.d.ts +0 -7
  149. package/components/Editor/HeadingEditor.js +0 -22
  150. package/components/Editor/HeadingEditor.js.map +0 -1
  151. package/components/Editor/ParagraphEditor.d.ts +0 -7
  152. package/components/Editor/ParagraphEditor.js +0 -22
  153. package/components/Editor/ParagraphEditor.js.map +0 -1
  154. package/components/Toolbar/Toolbar.css +0 -643
  155. package/components/Toolbar/Toolbar.d.ts +0 -6
  156. package/components/Toolbar/Toolbar.js +0 -148
  157. package/components/Toolbar/Toolbar.js.map +0 -1
  158. package/components/ToolbarActions/FontSizeAction.d.ts +0 -14
  159. package/components/ToolbarActions/FontSizeAction.js +0 -91
  160. package/components/ToolbarActions/FontSizeAction.js.map +0 -1
  161. package/hooks/useList.d.ts +0 -2
  162. package/hooks/useList.js +0 -50
  163. package/hooks/useList.js.map +0 -1
  164. package/hooks/useQuote.d.ts +0 -2
  165. package/hooks/useQuote.js +0 -17
  166. package/hooks/useQuote.js.map +0 -1
  167. package/plugins/FloatingLinkEditorPlugin/LinkEditForm.d.ts +0 -8
  168. package/plugins/FloatingLinkEditorPlugin/LinkEditForm.js +0 -104
  169. package/plugins/FloatingLinkEditorPlugin/LinkEditForm.js.map +0 -1
  170. package/plugins/FloatingLinkEditorPlugin/LinkPreviewForm.d.ts +0 -9
  171. package/plugins/FloatingLinkEditorPlugin/LinkPreviewForm.js +0 -34
  172. package/plugins/FloatingLinkEditorPlugin/LinkPreviewForm.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  import { useContext } from "react";
2
- import { FontColorActionContext } from "../context/FontColorActionContext";
2
+ import { FontColorActionContext } from "../context/FontColorActionContext.js";
3
3
  export function useFontColorPicker() {
4
4
  const context = useContext(FontColorActionContext);
5
5
  if (!context) {
@@ -1 +1 @@
1
- {"version":3,"names":["useContext","FontColorActionContext","useFontColorPicker","context","Error"],"sources":["useFontColorPicker.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { FontColorActionContext } from \"~/context/FontColorActionContext\";\n\nexport function useFontColorPicker() {\n const context = useContext(FontColorActionContext);\n if (!context) {\n throw Error(\n `Missing FontColorActionContext in the component hierarchy. Are you using \"useFontColorPicker()\" in the right place?`\n );\n }\n\n return context;\n}\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,sBAAsB;AAE/B,OAAO,SAASC,kBAAkBA,CAAA,EAAG;EACjC,MAAMC,OAAO,GAAGH,UAAU,CAACC,sBAAsB,CAAC;EAClD,IAAI,CAACE,OAAO,EAAE;IACV,MAAMC,KAAK,CACP,qHACJ,CAAC;EACL;EAEA,OAAOD,OAAO;AAClB","ignoreList":[]}
1
+ {"version":3,"names":["useContext","FontColorActionContext","useFontColorPicker","context","Error"],"sources":["useFontColorPicker.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { FontColorActionContext } from \"~/context/FontColorActionContext.js\";\n\nexport function useFontColorPicker() {\n const context = useContext(FontColorActionContext);\n if (!context) {\n throw Error(\n `Missing FontColorActionContext in the component hierarchy. Are you using \"useFontColorPicker()\" in the right place?`\n );\n }\n\n return context;\n}\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,sBAAsB;AAE/B,OAAO,SAASC,kBAAkBA,CAAA,EAAG;EACjC,MAAMC,OAAO,GAAGH,UAAU,CAACC,sBAAsB,CAAC;EAClD,IAAI,CAACE,OAAO,EAAE;IACV,MAAMC,KAAK,CACP,qHACJ,CAAC;EACL;EAEA,OAAOD,OAAO;AAClB","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import { RichTextEditorContext } from "../context/RichTextEditorContext";
1
+ import { RichTextEditorContext } from "../context/RichTextEditorContext.js";
2
2
  export declare function useRichTextEditor(): RichTextEditorContext;
@@ -1,5 +1,5 @@
1
1
  import { useContext } from "react";
2
- import { RichTextEditorContext } from "../context/RichTextEditorContext";
2
+ import { RichTextEditorContext } from "../context/RichTextEditorContext.js";
3
3
  export function useRichTextEditor() {
4
4
  const context = useContext(RichTextEditorContext);
5
5
  if (!context) {
@@ -1 +1 @@
1
- {"version":3,"names":["useContext","RichTextEditorContext","useRichTextEditor","context","Error"],"sources":["useRichTextEditor.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { RichTextEditorContext } from \"~/context/RichTextEditorContext\";\n\nexport function useRichTextEditor() {\n const context = useContext(RichTextEditorContext);\n if (!context) {\n throw Error(\n `Missing RichTextEditorContext in the component hierarchy. Are you using \"useRichTextEditor()\" in the right place?`\n );\n }\n\n return context;\n}\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,qBAAqB;AAE9B,OAAO,SAASC,iBAAiBA,CAAA,EAAG;EAChC,MAAMC,OAAO,GAAGH,UAAU,CAACC,qBAAqB,CAAC;EACjD,IAAI,CAACE,OAAO,EAAE;IACV,MAAMC,KAAK,CACP,mHACJ,CAAC;EACL;EAEA,OAAOD,OAAO;AAClB","ignoreList":[]}
1
+ {"version":3,"names":["useContext","RichTextEditorContext","useRichTextEditor","context","Error"],"sources":["useRichTextEditor.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { RichTextEditorContext } from \"~/context/RichTextEditorContext.js\";\n\nexport function useRichTextEditor() {\n const context = useContext(RichTextEditorContext);\n if (!context) {\n throw Error(\n `Missing RichTextEditorContext in the component hierarchy. Are you using \"useRichTextEditor()\" in the right place?`\n );\n }\n\n return context;\n}\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,qBAAqB;AAE9B,OAAO,SAASC,iBAAiBA,CAAA,EAAG;EAChC,MAAMC,OAAO,GAAGH,UAAU,CAACC,qBAAqB,CAAC;EACjD,IAAI,CAACE,OAAO,EAAE;IACV,MAAMC,KAAK,CACP,mHACJ,CAAC;EACL;EAEA,OAAOD,OAAO;AAClB","ignoreList":[]}
@@ -1 +1 @@
1
- export declare function useTextAlignmentAction(): import("../context/TextAlignmentActionContextProps").TextAlignmentActionContextProps;
1
+ export declare function useTextAlignmentAction(): import("~/context/TextAlignmentActionContextProps.js").TextAlignmentActionContextProps;
@@ -1,5 +1,5 @@
1
1
  import { useContext } from "react";
2
- import { TextAlignmentActionContext } from "../context/TextAlignmentActionContextProps";
2
+ import { TextAlignmentActionContext } from "../context/TextAlignmentActionContextProps.js";
3
3
  export function useTextAlignmentAction() {
4
4
  const context = useContext(TextAlignmentActionContext);
5
5
  if (!context) {
@@ -1 +1 @@
1
- {"version":3,"names":["useContext","TextAlignmentActionContext","useTextAlignmentAction","context","Error"],"sources":["useTextAlignmentAction.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { TextAlignmentActionContext } from \"~/context/TextAlignmentActionContextProps\";\n\nexport function useTextAlignmentAction() {\n const context = useContext(TextAlignmentActionContext);\n if (!context) {\n throw Error(\n `Missing TextAlignmentActionContext in the component hierarchy. Are you using \"useTextAlignmentAction()\" in the right place?`\n );\n }\n\n return context;\n}\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,0BAA0B;AAEnC,OAAO,SAASC,sBAAsBA,CAAA,EAAG;EACrC,MAAMC,OAAO,GAAGH,UAAU,CAACC,0BAA0B,CAAC;EACtD,IAAI,CAACE,OAAO,EAAE;IACV,MAAMC,KAAK,CACP,6HACJ,CAAC;EACL;EAEA,OAAOD,OAAO;AAClB","ignoreList":[]}
1
+ {"version":3,"names":["useContext","TextAlignmentActionContext","useTextAlignmentAction","context","Error"],"sources":["useTextAlignmentAction.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { TextAlignmentActionContext } from \"~/context/TextAlignmentActionContextProps.js\";\n\nexport function useTextAlignmentAction() {\n const context = useContext(TextAlignmentActionContext);\n if (!context) {\n throw Error(\n `Missing TextAlignmentActionContext in the component hierarchy. Are you using \"useTextAlignmentAction()\" in the right place?`\n );\n }\n\n return context;\n}\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,0BAA0B;AAEnC,OAAO,SAASC,sBAAsBA,CAAA,EAAG;EACrC,MAAMC,OAAO,GAAGH,UAAU,CAACC,0BAA0B,CAAC;EACtD,IAAI,CAACE,OAAO,EAAE;IACV,MAAMC,KAAK,CACP,6HACJ,CAAC;EACL;EAEA,OAAOD,OAAO;AAClB","ignoreList":[]}
@@ -1 +1 @@
1
- export declare function useTypographyAction(): import("../context/TypographyActionContext").TypographyActionContextProps;
1
+ export declare function useTypographyAction(): import("~/context/TypographyActionContext.js").TypographyActionContextProps;
@@ -1,5 +1,5 @@
1
1
  import { useContext } from "react";
2
- import { TypographyActionContext } from "../context/TypographyActionContext";
2
+ import { TypographyActionContext } from "../context/TypographyActionContext.js";
3
3
  export function useTypographyAction() {
4
4
  const context = useContext(TypographyActionContext);
5
5
  if (!context) {
@@ -1 +1 @@
1
- {"version":3,"names":["useContext","TypographyActionContext","useTypographyAction","context","Error"],"sources":["useTypographyAction.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { TypographyActionContext } from \"~/context/TypographyActionContext\";\n\nexport function useTypographyAction() {\n const context = useContext(TypographyActionContext);\n if (!context) {\n throw Error(\n `Missing TypographyActionContext in the component hierarchy. Are you using \"useTypographyAction()\" in the right place?`\n );\n }\n\n return context;\n}\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,uBAAuB;AAEhC,OAAO,SAASC,mBAAmBA,CAAA,EAAG;EAClC,MAAMC,OAAO,GAAGH,UAAU,CAACC,uBAAuB,CAAC;EACnD,IAAI,CAACE,OAAO,EAAE;IACV,MAAMC,KAAK,CACP,uHACJ,CAAC;EACL;EAEA,OAAOD,OAAO;AAClB","ignoreList":[]}
1
+ {"version":3,"names":["useContext","TypographyActionContext","useTypographyAction","context","Error"],"sources":["useTypographyAction.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { TypographyActionContext } from \"~/context/TypographyActionContext.js\";\n\nexport function useTypographyAction() {\n const context = useContext(TypographyActionContext);\n if (!context) {\n throw Error(\n `Missing TypographyActionContext in the component hierarchy. Are you using \"useTypographyAction()\" in the right place?`\n );\n }\n\n return context;\n}\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,uBAAuB;AAEhC,OAAO,SAASC,mBAAmBA,CAAA,EAAG;EAClC,MAAMC,OAAO,GAAGH,UAAU,CAACC,uBAAuB,CAAC;EACnD,IAAI,CAACE,OAAO,EAAE;IACV,MAAMC,KAAK,CACP,uHACJ,CAAC;EACL;EAEA,OAAOD,OAAO;AAClB","ignoreList":[]}
package/index.d.ts CHANGED
@@ -1,37 +1,33 @@
1
- export { LexicalHtmlRenderer } from "./components/LexicalHtmlRenderer";
2
- export * from "./hooks";
3
- export { Divider } from "./ui/Divider";
4
- export { DropDownItem } from "./ui/DropDown";
5
- export { DropDown } from "./ui/DropDown";
6
- export { BoldAction } from "./components/ToolbarActions/BoldAction";
7
- export { BulletListAction } from "./components/ToolbarActions/BulletListAction";
8
- export { CodeHighlightAction } from "./components/ToolbarActions/CodeHighlightAction";
9
- export { FontSizeAction } from "./components/ToolbarActions/FontSizeAction";
10
- export { FontColorAction } from "./components/ToolbarActions/FontColorAction";
11
- export { ItalicAction } from "./components/ToolbarActions/ItalicAction";
12
- export { LinkAction } from "./components/ToolbarActions/LinkAction";
13
- export { NumberedListAction } from "./components/ToolbarActions/NumberedListAction";
14
- export { QuoteAction } from "./components/ToolbarActions/QuoteAction";
15
- export { UnderlineAction } from "./components/ToolbarActions/UnderlineAction";
16
- export { TypographyAction } from "./components/ToolbarActions/TypographyAction";
17
- export { TextAlignmentAction } from "./components/ToolbarActions/TextAlignmentAction";
18
- export { ImageAction } from "./components/ToolbarActions/ImageAction";
19
- export { Toolbar } from "./components/Toolbar/Toolbar";
20
- export { StaticToolbar } from "./components/Toolbar/StaticToolbar";
21
- export { RichTextEditor } from "./components/Editor/RichTextEditor";
22
- export { HeadingEditor } from "./components/Editor/HeadingEditor";
23
- export { ParagraphEditor } from "./components/Editor/ParagraphEditor";
24
- export { LinkPlugin } from "./plugins/LinkPlugin/LinkPlugin";
25
- export { FloatingLinkEditorPlugin } from "./plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin";
26
- export { CodeHighlightPlugin } from "./plugins/CodeHighlightPlugin/CodeHighlightPlugin";
27
- export { BlurEventPlugin } from "./plugins/BlurEventPlugin/BlurEventPlugin";
28
- export { FontColorPlugin } from "./plugins/FontColorPlugin/FontColorPlugin";
29
- export { TypographyPlugin } from "./plugins/TypographyPlugin/TypographyPlugin";
30
- export { QuotePlugin } from "./plugins/QuoteNodePlugin/QuoteNodePlugin";
31
- export { ListPlugin } from "./plugins/ListPLugin/ListPlugin";
32
- export { ImagesPlugin } from "./plugins/ImagesPlugin/ImagesPlugin";
33
- export { StateHandlingPlugin } from "./plugins/StateHandlingPlugin";
34
- export { isValidLexicalData } from "./utils/isValidLexicalData";
35
- export * from "./commands";
36
- export * as types from "./types";
37
- export { LexicalEditorConfig, useLexicalEditorConfig } from "./components/LexicalEditorConfig/LexicalEditorConfig";
1
+ export { LexicalHtmlRenderer } from "./components/LexicalHtmlRenderer.js";
2
+ export * from "./hooks/index.js";
3
+ export { Divider } from "./ui/Divider.js";
4
+ export { DropDownItem } from "./ui/DropDown.js";
5
+ export { DropDown } from "./ui/DropDown.js";
6
+ export { BoldAction } from "./components/ToolbarActions/BoldAction.js";
7
+ export { BulletListAction } from "./components/ToolbarActions/BulletListAction.js";
8
+ export { CodeHighlightAction } from "./components/ToolbarActions/CodeHighlightAction.js";
9
+ export { FontColorAction } from "./components/ToolbarActions/FontColorAction.js";
10
+ export { ItalicAction } from "./components/ToolbarActions/ItalicAction.js";
11
+ export { LinkAction } from "./components/ToolbarActions/LinkAction.js";
12
+ export { NumberedListAction } from "./components/ToolbarActions/NumberedListAction.js";
13
+ export { QuoteAction } from "./components/ToolbarActions/QuoteAction.js";
14
+ export { UnderlineAction } from "./components/ToolbarActions/UnderlineAction.js";
15
+ export { TypographyAction } from "./components/ToolbarActions/TypographyAction.js";
16
+ export { TextAlignmentAction } from "./components/ToolbarActions/TextAlignmentAction.js";
17
+ export { ImageAction } from "./components/ToolbarActions/ImageAction.js";
18
+ export { StaticToolbar } from "./components/Toolbar/StaticToolbar.js";
19
+ export { RichTextEditor } from "./components/Editor/RichTextEditor.js";
20
+ export { LinkPlugin } from "./plugins/LinkPlugin/LinkPlugin.js";
21
+ export { FloatingLinkEditorPlugin } from "./plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.js";
22
+ export { CodeHighlightPlugin } from "./plugins/CodeHighlightPlugin/CodeHighlightPlugin.js";
23
+ export { BlurEventPlugin } from "./plugins/BlurEventPlugin/BlurEventPlugin.js";
24
+ export { FontColorPlugin } from "./plugins/FontColorPlugin/FontColorPlugin.js";
25
+ export { TypographyPlugin } from "./plugins/TypographyPlugin/TypographyPlugin.js";
26
+ export { QuotePlugin } from "./plugins/QuoteNodePlugin/QuoteNodePlugin.js";
27
+ export { ListPlugin } from "./plugins/ListPLugin/ListPlugin.js";
28
+ export { ImagesPlugin } from "./plugins/ImagesPlugin/ImagesPlugin.js";
29
+ export { StateHandlingPlugin } from "./plugins/StateHandlingPlugin.js";
30
+ export { isValidLexicalData } from "./utils/isValidLexicalData.js";
31
+ export * from "./commands/index.js";
32
+ export * as types from "./types.js";
33
+ export { LexicalEditorConfig, useLexicalEditorConfig } from "./components/LexicalEditorConfig/LexicalEditorConfig.js";
package/index.js CHANGED
@@ -1,50 +1,46 @@
1
1
  // render
2
- export { LexicalHtmlRenderer } from "./components/LexicalHtmlRenderer";
2
+ export { LexicalHtmlRenderer } from "./components/LexicalHtmlRenderer.js";
3
3
  // hooks
4
- export * from "./hooks";
4
+ export * from "./hooks/index.js";
5
5
  // UI elements
6
- export { Divider } from "./ui/Divider";
7
- export { DropDownItem } from "./ui/DropDown";
8
- export { DropDown } from "./ui/DropDown";
6
+ export { Divider } from "./ui/Divider.js";
7
+ export { DropDownItem } from "./ui/DropDown.js";
8
+ export { DropDown } from "./ui/DropDown.js";
9
9
  // actions
10
- export { BoldAction } from "./components/ToolbarActions/BoldAction";
11
- export { BulletListAction } from "./components/ToolbarActions/BulletListAction";
12
- export { CodeHighlightAction } from "./components/ToolbarActions/CodeHighlightAction";
13
- export { FontSizeAction } from "./components/ToolbarActions/FontSizeAction";
14
- export { FontColorAction } from "./components/ToolbarActions/FontColorAction";
15
- export { ItalicAction } from "./components/ToolbarActions/ItalicAction";
16
- export { LinkAction } from "./components/ToolbarActions/LinkAction";
17
- export { NumberedListAction } from "./components/ToolbarActions/NumberedListAction";
18
- export { QuoteAction } from "./components/ToolbarActions/QuoteAction";
19
- export { UnderlineAction } from "./components/ToolbarActions/UnderlineAction";
20
- export { TypographyAction } from "./components/ToolbarActions/TypographyAction";
21
- export { TextAlignmentAction } from "./components/ToolbarActions/TextAlignmentAction";
22
- export { ImageAction } from "./components/ToolbarActions/ImageAction";
10
+ export { BoldAction } from "./components/ToolbarActions/BoldAction.js";
11
+ export { BulletListAction } from "./components/ToolbarActions/BulletListAction.js";
12
+ export { CodeHighlightAction } from "./components/ToolbarActions/CodeHighlightAction.js";
13
+ export { FontColorAction } from "./components/ToolbarActions/FontColorAction.js";
14
+ export { ItalicAction } from "./components/ToolbarActions/ItalicAction.js";
15
+ export { LinkAction } from "./components/ToolbarActions/LinkAction.js";
16
+ export { NumberedListAction } from "./components/ToolbarActions/NumberedListAction.js";
17
+ export { QuoteAction } from "./components/ToolbarActions/QuoteAction.js";
18
+ export { UnderlineAction } from "./components/ToolbarActions/UnderlineAction.js";
19
+ export { TypographyAction } from "./components/ToolbarActions/TypographyAction.js";
20
+ export { TextAlignmentAction } from "./components/ToolbarActions/TextAlignmentAction.js";
21
+ export { ImageAction } from "./components/ToolbarActions/ImageAction.js";
23
22
  // toolbars
24
- export { Toolbar } from "./components/Toolbar/Toolbar";
25
- export { StaticToolbar } from "./components/Toolbar/StaticToolbar";
23
+ export { StaticToolbar } from "./components/Toolbar/StaticToolbar.js";
26
24
  // editor
27
- export { RichTextEditor } from "./components/Editor/RichTextEditor";
28
- export { HeadingEditor } from "./components/Editor/HeadingEditor";
29
- export { ParagraphEditor } from "./components/Editor/ParagraphEditor";
25
+ export { RichTextEditor } from "./components/Editor/RichTextEditor.js";
30
26
  // plugins
31
- export { LinkPlugin } from "./plugins/LinkPlugin/LinkPlugin";
32
- export { FloatingLinkEditorPlugin } from "./plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin";
33
- export { CodeHighlightPlugin } from "./plugins/CodeHighlightPlugin/CodeHighlightPlugin";
34
- export { BlurEventPlugin } from "./plugins/BlurEventPlugin/BlurEventPlugin";
35
- export { FontColorPlugin } from "./plugins/FontColorPlugin/FontColorPlugin";
36
- export { TypographyPlugin } from "./plugins/TypographyPlugin/TypographyPlugin";
37
- export { QuotePlugin } from "./plugins/QuoteNodePlugin/QuoteNodePlugin";
38
- export { ListPlugin } from "./plugins/ListPLugin/ListPlugin";
39
- export { ImagesPlugin } from "./plugins/ImagesPlugin/ImagesPlugin";
40
- export { StateHandlingPlugin } from "./plugins/StateHandlingPlugin";
27
+ export { LinkPlugin } from "./plugins/LinkPlugin/LinkPlugin.js";
28
+ export { FloatingLinkEditorPlugin } from "./plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.js";
29
+ export { CodeHighlightPlugin } from "./plugins/CodeHighlightPlugin/CodeHighlightPlugin.js";
30
+ export { BlurEventPlugin } from "./plugins/BlurEventPlugin/BlurEventPlugin.js";
31
+ export { FontColorPlugin } from "./plugins/FontColorPlugin/FontColorPlugin.js";
32
+ export { TypographyPlugin } from "./plugins/TypographyPlugin/TypographyPlugin.js";
33
+ export { QuotePlugin } from "./plugins/QuoteNodePlugin/QuoteNodePlugin.js";
34
+ export { ListPlugin } from "./plugins/ListPLugin/ListPlugin.js";
35
+ export { ImagesPlugin } from "./plugins/ImagesPlugin/ImagesPlugin.js";
36
+ export { StateHandlingPlugin } from "./plugins/StateHandlingPlugin.js";
41
37
  // utils
42
- export { isValidLexicalData } from "./utils/isValidLexicalData";
38
+ export { isValidLexicalData } from "./utils/isValidLexicalData.js";
43
39
  // Commands
44
- export * from "./commands";
40
+ export * from "./commands/index.js";
45
41
  // types
46
- export * as types from "./types";
42
+ export * as types from "./types.js";
47
43
  // config
48
- export { LexicalEditorConfig, useLexicalEditorConfig } from "./components/LexicalEditorConfig/LexicalEditorConfig";
44
+ export { LexicalEditorConfig, useLexicalEditorConfig } from "./components/LexicalEditorConfig/LexicalEditorConfig.js";
49
45
 
50
46
  //# sourceMappingURL=index.js.map
package/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["LexicalHtmlRenderer","Divider","DropDownItem","DropDown","BoldAction","BulletListAction","CodeHighlightAction","FontSizeAction","FontColorAction","ItalicAction","LinkAction","NumberedListAction","QuoteAction","UnderlineAction","TypographyAction","TextAlignmentAction","ImageAction","Toolbar","StaticToolbar","RichTextEditor","HeadingEditor","ParagraphEditor","LinkPlugin","FloatingLinkEditorPlugin","CodeHighlightPlugin","BlurEventPlugin","FontColorPlugin","TypographyPlugin","QuotePlugin","ListPlugin","ImagesPlugin","StateHandlingPlugin","isValidLexicalData","types","LexicalEditorConfig","useLexicalEditorConfig"],"sources":["index.ts"],"sourcesContent":["// render\nexport { LexicalHtmlRenderer } from \"~/components/LexicalHtmlRenderer\";\n// hooks\nexport * from \"./hooks\";\n// UI elements\nexport { Divider } from \"~/ui/Divider\";\nexport { DropDownItem } from \"~/ui/DropDown\";\nexport { DropDown } from \"~/ui/DropDown\";\n// actions\nexport { BoldAction } from \"~/components/ToolbarActions/BoldAction\";\nexport { BulletListAction } from \"~/components/ToolbarActions/BulletListAction\";\nexport { CodeHighlightAction } from \"~/components/ToolbarActions/CodeHighlightAction\";\nexport { FontSizeAction } from \"~/components/ToolbarActions/FontSizeAction\";\nexport { FontColorAction } from \"~/components/ToolbarActions/FontColorAction\";\nexport { ItalicAction } from \"~/components/ToolbarActions/ItalicAction\";\nexport { LinkAction } from \"~/components/ToolbarActions/LinkAction\";\nexport { NumberedListAction } from \"~/components/ToolbarActions/NumberedListAction\";\nexport { QuoteAction } from \"~/components/ToolbarActions/QuoteAction\";\nexport { UnderlineAction } from \"~/components/ToolbarActions/UnderlineAction\";\nexport { TypographyAction } from \"~/components/ToolbarActions/TypographyAction\";\nexport { TextAlignmentAction } from \"~/components/ToolbarActions/TextAlignmentAction\";\nexport { ImageAction } from \"~/components/ToolbarActions/ImageAction\";\n// toolbars\nexport { Toolbar } from \"~/components/Toolbar/Toolbar\";\nexport { StaticToolbar } from \"~/components/Toolbar/StaticToolbar\";\n// editor\nexport { RichTextEditor } from \"~/components/Editor/RichTextEditor\";\nexport { HeadingEditor } from \"~/components/Editor/HeadingEditor\";\nexport { ParagraphEditor } from \"~/components/Editor/ParagraphEditor\";\n// plugins\nexport { LinkPlugin } from \"~/plugins/LinkPlugin/LinkPlugin\";\nexport { FloatingLinkEditorPlugin } from \"~/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin\";\nexport { CodeHighlightPlugin } from \"~/plugins/CodeHighlightPlugin/CodeHighlightPlugin\";\nexport { BlurEventPlugin } from \"~/plugins/BlurEventPlugin/BlurEventPlugin\";\nexport { FontColorPlugin } from \"~/plugins/FontColorPlugin/FontColorPlugin\";\nexport { TypographyPlugin } from \"~/plugins/TypographyPlugin/TypographyPlugin\";\nexport { QuotePlugin } from \"~/plugins/QuoteNodePlugin/QuoteNodePlugin\";\nexport { ListPlugin } from \"~/plugins/ListPLugin/ListPlugin\";\nexport { ImagesPlugin } from \"~/plugins/ImagesPlugin/ImagesPlugin\";\nexport { StateHandlingPlugin } from \"~/plugins/StateHandlingPlugin\";\n// utils\nexport { isValidLexicalData } from \"~/utils/isValidLexicalData\";\n// Commands\nexport * from \"~/commands\";\n// types\nexport * as types from \"./types\";\n// config\nexport {\n LexicalEditorConfig,\n useLexicalEditorConfig\n} from \"~/components/LexicalEditorConfig/LexicalEditorConfig\";\n"],"mappings":"AAAA;AACA,SAASA,mBAAmB;AAC5B;AACA;AACA;AACA,SAASC,OAAO;AAChB,SAASC,YAAY;AACrB,SAASC,QAAQ;AACjB;AACA,SAASC,UAAU;AACnB,SAASC,gBAAgB;AACzB,SAASC,mBAAmB;AAC5B,SAASC,cAAc;AACvB,SAASC,eAAe;AACxB,SAASC,YAAY;AACrB,SAASC,UAAU;AACnB,SAASC,kBAAkB;AAC3B,SAASC,WAAW;AACpB,SAASC,eAAe;AACxB,SAASC,gBAAgB;AACzB,SAASC,mBAAmB;AAC5B,SAASC,WAAW;AACpB;AACA,SAASC,OAAO;AAChB,SAASC,aAAa;AACtB;AACA,SAASC,cAAc;AACvB,SAASC,aAAa;AACtB,SAASC,eAAe;AACxB;AACA,SAASC,UAAU;AACnB,SAASC,wBAAwB;AACjC,SAASC,mBAAmB;AAC5B,SAASC,eAAe;AACxB,SAASC,eAAe;AACxB,SAASC,gBAAgB;AACzB,SAASC,WAAW;AACpB,SAASC,UAAU;AACnB,SAASC,YAAY;AACrB,SAASC,mBAAmB;AAC5B;AACA,SAASC,kBAAkB;AAC3B;AACA;AACA;AACA,OAAO,KAAKC,KAAK;AACjB;AACA,SACIC,mBAAmB,EACnBC,sBAAsB","ignoreList":[]}
1
+ {"version":3,"names":["LexicalHtmlRenderer","Divider","DropDownItem","DropDown","BoldAction","BulletListAction","CodeHighlightAction","FontColorAction","ItalicAction","LinkAction","NumberedListAction","QuoteAction","UnderlineAction","TypographyAction","TextAlignmentAction","ImageAction","StaticToolbar","RichTextEditor","LinkPlugin","FloatingLinkEditorPlugin","CodeHighlightPlugin","BlurEventPlugin","FontColorPlugin","TypographyPlugin","QuotePlugin","ListPlugin","ImagesPlugin","StateHandlingPlugin","isValidLexicalData","types","LexicalEditorConfig","useLexicalEditorConfig"],"sources":["index.ts"],"sourcesContent":["// render\nexport { LexicalHtmlRenderer } from \"~/components/LexicalHtmlRenderer.js\";\n// hooks\nexport * 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// actions\nexport { BoldAction } from \"~/components/ToolbarActions/BoldAction.js\";\nexport { BulletListAction } from \"~/components/ToolbarActions/BulletListAction.js\";\nexport { CodeHighlightAction } from \"~/components/ToolbarActions/CodeHighlightAction.js\";\nexport { FontColorAction } from \"~/components/ToolbarActions/FontColorAction.js\";\nexport { ItalicAction } from \"~/components/ToolbarActions/ItalicAction.js\";\nexport { LinkAction } from \"~/components/ToolbarActions/LinkAction.js\";\nexport { NumberedListAction } from \"~/components/ToolbarActions/NumberedListAction.js\";\nexport { QuoteAction } from \"~/components/ToolbarActions/QuoteAction.js\";\nexport { UnderlineAction } from \"~/components/ToolbarActions/UnderlineAction.js\";\nexport { TypographyAction } from \"~/components/ToolbarActions/TypographyAction.js\";\nexport { TextAlignmentAction } from \"~/components/ToolbarActions/TextAlignmentAction.js\";\nexport { ImageAction } from \"~/components/ToolbarActions/ImageAction.js\";\n// toolbars\nexport { StaticToolbar } from \"~/components/Toolbar/StaticToolbar.js\";\n// editor\nexport { RichTextEditor } from \"~/components/Editor/RichTextEditor.js\";\n// plugins\nexport { LinkPlugin } from \"~/plugins/LinkPlugin/LinkPlugin.js\";\nexport { FloatingLinkEditorPlugin } from \"~/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.js\";\nexport { CodeHighlightPlugin } from \"~/plugins/CodeHighlightPlugin/CodeHighlightPlugin.js\";\nexport { BlurEventPlugin } from \"~/plugins/BlurEventPlugin/BlurEventPlugin.js\";\nexport { FontColorPlugin } from \"~/plugins/FontColorPlugin/FontColorPlugin.js\";\nexport { TypographyPlugin } from \"~/plugins/TypographyPlugin/TypographyPlugin.js\";\nexport { QuotePlugin } from \"~/plugins/QuoteNodePlugin/QuoteNodePlugin.js\";\nexport { ListPlugin } from \"~/plugins/ListPLugin/ListPlugin.js\";\nexport { ImagesPlugin } from \"~/plugins/ImagesPlugin/ImagesPlugin.js\";\nexport { StateHandlingPlugin } from \"~/plugins/StateHandlingPlugin.js\";\n// utils\nexport { isValidLexicalData } from \"~/utils/isValidLexicalData.js\";\n// Commands\nexport * from \"~/commands/index.js\";\n// types\nexport * as types from \"./types.js\";\n// config\nexport {\n LexicalEditorConfig,\n useLexicalEditorConfig\n} from \"~/components/LexicalEditorConfig/LexicalEditorConfig.js\";\n"],"mappings":"AAAA;AACA,SAASA,mBAAmB;AAC5B;AACA;AACA;AACA,SAASC,OAAO;AAChB,SAASC,YAAY;AACrB,SAASC,QAAQ;AACjB;AACA,SAASC,UAAU;AACnB,SAASC,gBAAgB;AACzB,SAASC,mBAAmB;AAC5B,SAASC,eAAe;AACxB,SAASC,YAAY;AACrB,SAASC,UAAU;AACnB,SAASC,kBAAkB;AAC3B,SAASC,WAAW;AACpB,SAASC,eAAe;AACxB,SAASC,gBAAgB;AACzB,SAASC,mBAAmB;AAC5B,SAASC,WAAW;AACpB;AACA,SAASC,aAAa;AACtB;AACA,SAASC,cAAc;AACvB;AACA,SAASC,UAAU;AACnB,SAASC,wBAAwB;AACjC,SAASC,mBAAmB;AAC5B,SAASC,eAAe;AACxB,SAASC,eAAe;AACxB,SAASC,gBAAgB;AACzB,SAASC,WAAW;AACpB,SAASC,UAAU;AACnB,SAASC,YAAY;AACrB,SAASC,mBAAmB;AAC5B;AACA,SAASC,kBAAkB;AAC3B;AACA;AACA;AACA,OAAO,KAAKC,KAAK;AACjB;AACA,SACIC,mBAAmB,EACnBC,sBAAsB","ignoreList":[]}
package/package.json CHANGED
@@ -1,40 +1,36 @@
1
1
  {
2
2
  "name": "@webiny/lexical-editor",
3
- "version": "6.0.0-alpha.5",
3
+ "version": "6.0.0-rc.0",
4
+ "type": "module",
4
5
  "repository": {
5
6
  "type": "git",
6
7
  "url": "https://github.com/webiny/webiny-js.git"
7
8
  },
8
9
  "license": "MIT",
9
10
  "dependencies": {
10
- "@emotion/react": "11.10.8",
11
- "@lexical/code": "0.23.1",
12
- "@lexical/history": "0.23.1",
13
- "@lexical/react": "0.23.1",
14
- "@lexical/rich-text": "0.23.1",
15
- "@lexical/selection": "0.23.1",
16
- "@lexical/text": "0.23.1",
17
- "@lexical/utils": "0.23.1",
18
- "@webiny/lexical-nodes": "6.0.0-alpha.5",
19
- "@webiny/lexical-theme": "6.0.0-alpha.5",
20
- "@webiny/react-composition": "6.0.0-alpha.5",
21
- "@webiny/react-properties": "6.0.0-alpha.5",
22
- "emotion": "10.0.27",
23
- "lexical": "0.23.1",
24
- "lodash": "4.17.21",
11
+ "@floating-ui/dom": "1.7.5",
12
+ "@lexical/code": "0.40.0",
13
+ "@lexical/history": "0.40.0",
14
+ "@lexical/react": "0.40.0",
15
+ "@lexical/rich-text": "0.40.0",
16
+ "@lexical/selection": "0.40.0",
17
+ "@lexical/text": "0.40.0",
18
+ "@lexical/utils": "0.40.0",
19
+ "@webiny/lexical-nodes": "6.0.0-rc.0",
20
+ "@webiny/lexical-theme": "6.0.0-rc.0",
21
+ "@webiny/react-composition": "6.0.0-rc.0",
22
+ "@webiny/react-properties": "6.0.0-rc.0",
23
+ "lexical": "0.40.0",
24
+ "lodash": "4.17.23",
25
25
  "react": "18.2.0",
26
26
  "react-dom": "18.2.0"
27
27
  },
28
28
  "devDependencies": {
29
- "@webiny/project-utils": "6.0.0-alpha.5"
29
+ "@webiny/build-tools": "6.0.0-rc.0"
30
30
  },
31
31
  "publishConfig": {
32
32
  "access": "public",
33
33
  "directory": "dist"
34
34
  },
35
- "scripts": {
36
- "build": "node ../cli/bin.js run build",
37
- "watch": "node ../cli/bin.js run watch"
38
- },
39
- "gitHead": "b7e120541b093e91f214904a9f13e4c2c4640978"
35
+ "gitHead": "0f2aa699f4642e550ab62c96fcd050e8d02345c9"
40
36
  }
@@ -1,5 +1,5 @@
1
1
  import type { FC } from "react";
2
- import type { LexicalValue } from "../../types";
2
+ import type { LexicalValue } from "../../types.js";
3
3
  interface BlurEventPlugin {
4
4
  onBlur?: (editorState: LexicalValue) => void;
5
5
  }
@@ -1,6 +1,6 @@
1
1
  import { useEffect } from "react";
2
2
  import { BLUR_COMMAND, COMMAND_PRIORITY_LOW } from "lexical";
3
- import { useRichTextEditor } from "../../hooks";
3
+ import { useRichTextEditor } from "../../hooks/index.js";
4
4
  export const BlurEventPlugin = ({
5
5
  onBlur
6
6
  }) => {
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","BLUR_COMMAND","COMMAND_PRIORITY_LOW","useRichTextEditor","BlurEventPlugin","onBlur","editor","registerCommand","editorState","getEditorState","JSON","stringify","toJSON"],"sources":["BlurEventPlugin.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { useEffect } from \"react\";\nimport { BLUR_COMMAND, COMMAND_PRIORITY_LOW } from \"lexical\";\nimport type { LexicalValue } from \"~/types\";\nimport { useRichTextEditor } from \"~/hooks\";\n\ninterface BlurEventPlugin {\n onBlur?: (editorState: LexicalValue) => void;\n}\n\nexport const BlurEventPlugin: FC<BlurEventPlugin> = ({ onBlur }) => {\n const { editor } = useRichTextEditor();\n\n useEffect(\n () =>\n editor.registerCommand(\n BLUR_COMMAND,\n () => {\n if (typeof onBlur === \"function\") {\n const editorState = editor.getEditorState();\n onBlur(JSON.stringify(editorState.toJSON()));\n }\n return false;\n },\n COMMAND_PRIORITY_LOW\n ),\n []\n );\n return null;\n};\n"],"mappings":"AACA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,YAAY,EAAEC,oBAAoB,QAAQ,SAAS;AAE5D,SAASC,iBAAiB;AAM1B,OAAO,MAAMC,eAAoC,GAAGA,CAAC;EAAEC;AAAO,CAAC,KAAK;EAChE,MAAM;IAAEC;EAAO,CAAC,GAAGH,iBAAiB,CAAC,CAAC;EAEtCH,SAAS,CACL,MACIM,MAAM,CAACC,eAAe,CAClBN,YAAY,EACZ,MAAM;IACF,IAAI,OAAOI,MAAM,KAAK,UAAU,EAAE;MAC9B,MAAMG,WAAW,GAAGF,MAAM,CAACG,cAAc,CAAC,CAAC;MAC3CJ,MAAM,CAACK,IAAI,CAACC,SAAS,CAACH,WAAW,CAACI,MAAM,CAAC,CAAC,CAAC,CAAC;IAChD;IACA,OAAO,KAAK;EAChB,CAAC,EACDV,oBACJ,CAAC,EACL,EACJ,CAAC;EACD,OAAO,IAAI;AACf,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["useEffect","BLUR_COMMAND","COMMAND_PRIORITY_LOW","useRichTextEditor","BlurEventPlugin","onBlur","editor","registerCommand","editorState","getEditorState","JSON","stringify","toJSON"],"sources":["BlurEventPlugin.tsx"],"sourcesContent":["import type { FC } from \"react\";\nimport { useEffect } from \"react\";\nimport { BLUR_COMMAND, COMMAND_PRIORITY_LOW } from \"lexical\";\nimport type { LexicalValue } from \"~/types.js\";\nimport { useRichTextEditor } from \"~/hooks/index.js\";\n\ninterface BlurEventPlugin {\n onBlur?: (editorState: LexicalValue) => void;\n}\n\nexport const BlurEventPlugin: FC<BlurEventPlugin> = ({ onBlur }) => {\n const { editor } = useRichTextEditor();\n\n useEffect(\n () =>\n editor.registerCommand(\n BLUR_COMMAND,\n () => {\n if (typeof onBlur === \"function\") {\n const editorState = editor.getEditorState();\n onBlur(JSON.stringify(editorState.toJSON()));\n }\n return false;\n },\n COMMAND_PRIORITY_LOW\n ),\n []\n );\n return null;\n};\n"],"mappings":"AACA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,YAAY,EAAEC,oBAAoB,QAAQ,SAAS;AAE5D,SAASC,iBAAiB;AAM1B,OAAO,MAAMC,eAAoC,GAAGA,CAAC;EAAEC;AAAO,CAAC,KAAK;EAChE,MAAM;IAAEC;EAAO,CAAC,GAAGH,iBAAiB,CAAC,CAAC;EAEtCH,SAAS,CACL,MACIM,MAAM,CAACC,eAAe,CAClBN,YAAY,EACZ,MAAM;IACF,IAAI,OAAOI,MAAM,KAAK,UAAU,EAAE;MAC9B,MAAMG,WAAW,GAAGF,MAAM,CAACG,cAAc,CAAC,CAAC;MAC3CJ,MAAM,CAACK,IAAI,CAACC,SAAS,CAACH,WAAW,CAACI,MAAM,CAAC,CAAC,CAAC,CAAC;IAChD;IACA,OAAO,KAAK;EAChB,CAAC,EACDV,oBACJ,CAAC,EACL,EACJ,CAAC;EACD,OAAO,IAAI;AACf,CAAC","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  import { useEffect } from "react";
2
2
  import { registerCodeHighlighting } from "@lexical/code";
3
- import { useRichTextEditor } from "../../hooks";
3
+ import { useRichTextEditor } from "../../hooks/index.js";
4
4
  export function CodeHighlightPlugin() {
5
5
  const {
6
6
  editor
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","registerCodeHighlighting","useRichTextEditor","CodeHighlightPlugin","editor"],"sources":["CodeHighlightPlugin.tsx"],"sourcesContent":["import { useEffect } from \"react\";\nimport { registerCodeHighlighting } from \"@lexical/code\";\nimport { useRichTextEditor } from \"~/hooks\";\n\nexport function CodeHighlightPlugin() {\n const { editor } = useRichTextEditor();\n useEffect(() => {\n return registerCodeHighlighting(editor);\n }, [editor]);\n return null;\n}\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,wBAAwB,QAAQ,eAAe;AACxD,SAASC,iBAAiB;AAE1B,OAAO,SAASC,mBAAmBA,CAAA,EAAG;EAClC,MAAM;IAAEC;EAAO,CAAC,GAAGF,iBAAiB,CAAC,CAAC;EACtCF,SAAS,CAAC,MAAM;IACZ,OAAOC,wBAAwB,CAACG,MAAM,CAAC;EAC3C,CAAC,EAAE,CAACA,MAAM,CAAC,CAAC;EACZ,OAAO,IAAI;AACf","ignoreList":[]}
1
+ {"version":3,"names":["useEffect","registerCodeHighlighting","useRichTextEditor","CodeHighlightPlugin","editor"],"sources":["CodeHighlightPlugin.tsx"],"sourcesContent":["import { useEffect } from \"react\";\nimport { registerCodeHighlighting } from \"@lexical/code\";\nimport { useRichTextEditor } from \"~/hooks/index.js\";\n\nexport function CodeHighlightPlugin() {\n const { editor } = useRichTextEditor();\n useEffect(() => {\n return registerCodeHighlighting(editor);\n }, [editor]);\n return null;\n}\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,wBAAwB,QAAQ,eAAe;AACxD,SAASC,iBAAiB;AAE1B,OAAO,SAASC,mBAAmBA,CAAA,EAAG;EAClC,MAAM;IAAEC;EAAO,CAAC,GAAGF,iBAAiB,CAAC,CAAC;EACtCF,SAAS,CAAC,MAAM;IACZ,OAAOC,wBAAwB,CAACG,MAAM,CAAC;EAC3C,CAAC,EAAE,CAACA,MAAM,CAAC,CAAC;EACZ,OAAO,IAAI;AACf","ignoreList":[]}
@@ -1 +1 @@
1
- export * from "./CodeHighlightPlugin";
1
+ export * from "./CodeHighlightPlugin.js";
@@ -1,3 +1,3 @@
1
- export * from "./CodeHighlightPlugin";
1
+ export * from "./CodeHighlightPlugin.js";
2
2
 
3
3
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./CodeHighlightPlugin\";\n"],"mappings":"AAAA","ignoreList":[]}
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"./CodeHighlightPlugin.js\";\n"],"mappings":"AAAA","ignoreList":[]}
@@ -1,16 +1,10 @@
1
1
  import React from "react";
2
- import { LinkEditForm as DefaultLinkEditForm } from "./LinkEditForm";
3
- import { type LexicalEditor } from "lexical";
4
- export interface LinkData {
5
- url: string;
6
- target: string | null;
7
- alt: string | null;
8
- }
2
+ import type { LexicalEditor } from "lexical";
3
+ import { LinkFormProps } from "./types.js";
9
4
  interface FloatingLinkEditorProps {
10
5
  editor: LexicalEditor;
11
6
  isVisible: boolean;
12
- anchorElem: HTMLElement;
13
- LinkEditForm?: typeof DefaultLinkEditForm;
7
+ LinkForm: React.FunctionComponent<LinkFormProps>;
14
8
  }
15
- export declare function FloatingLinkEditor({ editor, isVisible, anchorElem, LinkEditForm }: FloatingLinkEditorProps): React.JSX.Element;
9
+ export declare function FloatingLinkEditor({ editor, isVisible, LinkForm }: FloatingLinkEditorProps): React.JSX.Element;
16
10
  export {};
@@ -1,158 +1,28 @@
1
- import React, { useCallback, useEffect, useRef, useState } from "react";
2
- import { getSelectedNode } from "../../utils/getSelectedNode";
3
- import { $isLinkNode, TOGGLE_LINK_COMMAND } from "@webiny/lexical-nodes";
4
- import { setFloatingElemPosition } from "../../utils/setFloatingElemPosition";
5
- import { sanitizeUrl } from "../../utils/sanitizeUrl";
6
- import { isChildOfLinkEditor } from "./isChildOfLinkEditor";
7
- import { LinkEditForm as DefaultLinkEditForm } from "./LinkEditForm";
8
- import { LinkPreviewForm } from "./LinkPreviewForm";
9
- import { SELECTION_CHANGE_COMMAND, COMMAND_PRIORITY_LOW, BLUR_COMMAND, $getSelection, $isRangeSelection } from "lexical";
10
- import { mergeRegister } from "@lexical/utils";
1
+ import React from "react";
2
+ import { useFloatingLinkEditor } from "./useFloatingLinkEditor.js";
11
3
  export function FloatingLinkEditor({
12
4
  editor,
13
5
  isVisible,
14
- anchorElem,
15
- LinkEditForm = DefaultLinkEditForm
6
+ LinkForm
16
7
  }) {
17
- const editorRef = useRef(null);
18
- const [linkData, setLinkData] = useState({
19
- url: "",
20
- target: null,
21
- alt: null
22
- });
23
- const [isEditMode, setEditMode] = useState(false);
24
- const [lastSelection, setLastSelection] = useState(null);
25
- const updateLinkEditor = useCallback(() => {
26
- const selection = $getSelection();
27
- const emptyLinkData = {
28
- url: "",
29
- target: null,
30
- alt: null
31
- };
32
- if ($isRangeSelection(selection)) {
33
- const node = getSelectedNode(selection);
34
- const parent = node.getParent();
35
- if ($isLinkNode(parent)) {
36
- const linkData = {
37
- url: parent.getURL(),
38
- target: parent.getTarget(),
39
- alt: $isLinkNode(parent) ? parent.getAlt() : null
40
- };
41
- setLinkData(linkData);
42
- } else if ($isLinkNode(node)) {
43
- const linkData = {
44
- url: node.getURL(),
45
- target: node.getTarget(),
46
- alt: $isLinkNode(node) ? node.getAlt() : null
47
- };
48
- setLinkData(linkData);
49
- } else {
50
- setLinkData(emptyLinkData);
51
- }
52
- }
53
- const editorElem = editorRef.current;
54
- const nativeSelection = window.getSelection();
55
- const activeElement = document.activeElement;
56
- if (editorElem === null) {
57
- return;
58
- }
59
- const rootElement = editor.getRootElement();
60
- if (selection !== null && nativeSelection !== null && rootElement !== null && rootElement.contains(nativeSelection.anchorNode)) {
61
- const domRange = nativeSelection.getRangeAt(0);
62
- let rect;
63
- if (nativeSelection.anchorNode === rootElement) {
64
- let inner = rootElement;
65
- while (inner.firstElementChild != null) {
66
- inner = inner.firstElementChild;
67
- }
68
- rect = inner.getBoundingClientRect();
69
- } else {
70
- rect = domRange.getBoundingClientRect();
71
- }
72
- setFloatingElemPosition(rect, editorElem, anchorElem);
73
- setLastSelection(selection);
74
- } else if (!activeElement || activeElement.className !== "link-input") {
75
- if (rootElement !== null) {
76
- setFloatingElemPosition(null, editorElem, anchorElem);
77
- }
78
- setLastSelection(null);
79
- setEditMode(false);
80
- setLinkData(emptyLinkData);
81
- }
82
- return true;
83
- }, [anchorElem, editor]);
84
- const removeLink = () => {
85
- editor.dispatchCommand(TOGGLE_LINK_COMMAND, null);
86
- setEditMode(false);
87
- };
88
- const applyChanges = linkData => {
89
- const confirmedLinkData = {
90
- url: sanitizeUrl(linkData.url),
91
- target: linkData.target,
92
- alt: linkData.alt
93
- };
94
- if (lastSelection !== null) {
95
- editor.dispatchCommand(TOGGLE_LINK_COMMAND, confirmedLinkData);
96
- setEditMode(false);
97
- }
98
- };
99
- useEffect(() => {
100
- const scrollerElem = anchorElem.parentElement;
101
- const update = () => {
102
- editor.getEditorState().read(() => {
103
- updateLinkEditor();
104
- });
105
- };
106
- window.addEventListener("resize", update);
107
- if (scrollerElem) {
108
- scrollerElem.addEventListener("scroll", update);
109
- }
110
- return () => {
111
- window.removeEventListener("resize", update);
112
- if (scrollerElem) {
113
- scrollerElem.removeEventListener("scroll", update);
114
- }
115
- };
116
- }, [anchorElem.parentElement, editor, updateLinkEditor]);
117
- useEffect(() => {
118
- return mergeRegister(editor.registerUpdateListener(({
119
- editorState
120
- }) => {
121
- editorState.read(() => {
122
- updateLinkEditor();
123
- });
124
- }), editor.registerCommand(SELECTION_CHANGE_COMMAND, () => {
125
- updateLinkEditor();
126
- return false;
127
- }, COMMAND_PRIORITY_LOW), editor.registerCommand(BLUR_COMMAND, payload => {
128
- if (!isChildOfLinkEditor(payload.relatedTarget)) {
129
- // setEditMode(false);
130
- }
131
- return false;
132
- }, COMMAND_PRIORITY_LOW));
133
- }, [editor, updateLinkEditor]);
134
- useEffect(() => {
135
- editor.getEditorState().read(() => {
136
- updateLinkEditor();
137
- });
138
- }, [editor, updateLinkEditor]);
8
+ const {
9
+ editorRef,
10
+ linkData,
11
+ applyChanges,
12
+ removeLink
13
+ } = useFloatingLinkEditor(editor);
139
14
  return /*#__PURE__*/React.createElement("div", {
140
15
  ref: editorRef,
141
- className: "link-editor",
16
+ className: "z-dialog absolute link-editor",
142
17
  style: {
143
- display: isVisible ? "block" : "none"
18
+ opacity: isVisible ? 1 : 0,
19
+ pointerEvents: isVisible ? "auto" : "none"
144
20
  }
145
- }, isEditMode ? /*#__PURE__*/React.createElement(LinkEditForm, {
21
+ }, isVisible ? /*#__PURE__*/React.createElement(LinkForm, {
146
22
  linkData: linkData,
147
23
  onSave: applyChanges,
148
- onCancel: () => setEditMode(false)
149
- }) : /*#__PURE__*/React.createElement(LinkPreviewForm, {
150
- linkData: linkData,
151
- removeLink: removeLink,
152
- onEdit: () => {
153
- setEditMode(true);
154
- }
155
- }));
24
+ removeLink: removeLink
25
+ }) : null);
156
26
  }
157
27
 
158
28
  //# sourceMappingURL=FloatingLinkEditor.js.map