@webiny/lexical-editor 0.0.0-unstable.085ff6572f

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 (306) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +17 -0
  3. package/commands/webiny-list.d.ts +7 -0
  4. package/commands/webiny-list.js +13 -0
  5. package/commands/webiny-list.js.map +1 -0
  6. package/commands/webiny-quote.d.ts +5 -0
  7. package/commands/webiny-quote.js +9 -0
  8. package/commands/webiny-quote.js.map +1 -0
  9. package/components/AddRichTextEditorNodeType.d.ts +6 -0
  10. package/components/AddRichTextEditorNodeType.js +28 -0
  11. package/components/AddRichTextEditorNodeType.js.map +1 -0
  12. package/components/AddRichTextEditorPlugin.d.ts +12 -0
  13. package/components/AddRichTextEditorPlugin.js +33 -0
  14. package/components/AddRichTextEditorPlugin.js.map +1 -0
  15. package/components/AddToolbarAction.d.ts +7 -0
  16. package/components/AddToolbarAction.js +33 -0
  17. package/components/AddToolbarAction.js.map +1 -0
  18. package/components/Editor/HeadingEditor.d.ts +7 -0
  19. package/components/Editor/HeadingEditor.js +29 -0
  20. package/components/Editor/HeadingEditor.js.map +1 -0
  21. package/components/Editor/ParagraphEditor.d.ts +7 -0
  22. package/components/Editor/ParagraphEditor.js +30 -0
  23. package/components/Editor/ParagraphEditor.js.map +1 -0
  24. package/components/Editor/RichTextEditor.d.ts +26 -0
  25. package/components/Editor/RichTextEditor.js +138 -0
  26. package/components/Editor/RichTextEditor.js.map +1 -0
  27. package/components/LexicalEditorConfig/LexicalEditorConfig.d.ts +11 -0
  28. package/components/LexicalEditorConfig/LexicalEditorConfig.js +19 -0
  29. package/components/LexicalEditorConfig/LexicalEditorConfig.js.map +1 -0
  30. package/components/LexicalHtmlRenderer.d.ts +16 -0
  31. package/components/LexicalHtmlRenderer.js +67 -0
  32. package/components/LexicalHtmlRenderer.js.map +1 -0
  33. package/components/Toolbar/HeadingToolbar.d.ts +12 -0
  34. package/components/Toolbar/HeadingToolbar.js +23 -0
  35. package/components/Toolbar/HeadingToolbar.js.map +1 -0
  36. package/components/Toolbar/ParagraphToolbar.d.ts +12 -0
  37. package/components/Toolbar/ParagraphToolbar.js +23 -0
  38. package/components/Toolbar/ParagraphToolbar.js.map +1 -0
  39. package/components/Toolbar/Toolbar.css +435 -0
  40. package/components/Toolbar/Toolbar.d.ts +13 -0
  41. package/components/Toolbar/Toolbar.js +215 -0
  42. package/components/Toolbar/Toolbar.js.map +1 -0
  43. package/components/ToolbarActions/BoldAction.d.ts +2 -0
  44. package/components/ToolbarActions/BoldAction.js +43 -0
  45. package/components/ToolbarActions/BoldAction.js.map +1 -0
  46. package/components/ToolbarActions/BulletListAction.d.ts +2 -0
  47. package/components/ToolbarActions/BulletListAction.js +56 -0
  48. package/components/ToolbarActions/BulletListAction.js.map +1 -0
  49. package/components/ToolbarActions/CodeHighlightAction.d.ts +2 -0
  50. package/components/ToolbarActions/CodeHighlightAction.js +43 -0
  51. package/components/ToolbarActions/CodeHighlightAction.js.map +1 -0
  52. package/components/ToolbarActions/FontColorAction.d.ts +11 -0
  53. package/components/ToolbarActions/FontColorAction.js +83 -0
  54. package/components/ToolbarActions/FontColorAction.js.map +1 -0
  55. package/components/ToolbarActions/FontSizeAction.d.ts +2 -0
  56. package/components/ToolbarActions/FontSizeAction.js +101 -0
  57. package/components/ToolbarActions/FontSizeAction.js.map +1 -0
  58. package/components/ToolbarActions/ItalicAction.d.ts +2 -0
  59. package/components/ToolbarActions/ItalicAction.js +43 -0
  60. package/components/ToolbarActions/ItalicAction.js.map +1 -0
  61. package/components/ToolbarActions/LinkAction.d.ts +2 -0
  62. package/components/ToolbarActions/LinkAction.js +64 -0
  63. package/components/ToolbarActions/LinkAction.js.map +1 -0
  64. package/components/ToolbarActions/NumberedListAction.d.ts +2 -0
  65. package/components/ToolbarActions/NumberedListAction.js +58 -0
  66. package/components/ToolbarActions/NumberedListAction.js.map +1 -0
  67. package/components/ToolbarActions/QuoteAction.d.ts +2 -0
  68. package/components/ToolbarActions/QuoteAction.js +52 -0
  69. package/components/ToolbarActions/QuoteAction.js.map +1 -0
  70. package/components/ToolbarActions/TextAlignmentAction.d.ts +11 -0
  71. package/components/ToolbarActions/TextAlignmentAction.js +70 -0
  72. package/components/ToolbarActions/TextAlignmentAction.js.map +1 -0
  73. package/components/ToolbarActions/TypographyAction.d.ts +11 -0
  74. package/components/ToolbarActions/TypographyAction.js +145 -0
  75. package/components/ToolbarActions/TypographyAction.js.map +1 -0
  76. package/components/ToolbarActions/UnderlineAction.d.ts +2 -0
  77. package/components/ToolbarActions/UnderlineAction.js +43 -0
  78. package/components/ToolbarActions/UnderlineAction.js.map +1 -0
  79. package/components/ToolbarPresets/HeadingToolbarPreset.d.ts +2 -0
  80. package/components/ToolbarPresets/HeadingToolbarPreset.js +56 -0
  81. package/components/ToolbarPresets/HeadingToolbarPreset.js.map +1 -0
  82. package/components/ToolbarPresets/ParagraphToolbarPreset.d.ts +2 -0
  83. package/components/ToolbarPresets/ParagraphToolbarPreset.js +71 -0
  84. package/components/ToolbarPresets/ParagraphToolbarPreset.js.map +1 -0
  85. package/context/FontColorActionContext.d.ts +6 -0
  86. package/context/FontColorActionContext.js +10 -0
  87. package/context/FontColorActionContext.js.map +1 -0
  88. package/context/RichTextEditorContext.d.ts +26 -0
  89. package/context/RichTextEditorContext.js +68 -0
  90. package/context/RichTextEditorContext.js.map +1 -0
  91. package/context/SharedHistoryContext.d.ts +11 -0
  92. package/context/SharedHistoryContext.js +26 -0
  93. package/context/SharedHistoryContext.js.map +1 -0
  94. package/context/TextAlignmentActionContextProps.d.ts +9 -0
  95. package/context/TextAlignmentActionContextProps.js +10 -0
  96. package/context/TextAlignmentActionContextProps.js.map +1 -0
  97. package/context/TypographyActionContext.d.ts +7 -0
  98. package/context/TypographyActionContext.js +10 -0
  99. package/context/TypographyActionContext.js.map +1 -0
  100. package/hooks/useFontColorPicker.d.ts +2 -0
  101. package/hooks/useFontColorPicker.js +15 -0
  102. package/hooks/useFontColorPicker.js.map +1 -0
  103. package/hooks/useList.d.ts +2 -0
  104. package/hooks/useList.js +39 -0
  105. package/hooks/useList.js.map +1 -0
  106. package/hooks/useQuote.d.ts +2 -0
  107. package/hooks/useQuote.js +20 -0
  108. package/hooks/useQuote.js.map +1 -0
  109. package/hooks/useRichTextEditor.d.ts +2 -0
  110. package/hooks/useRichTextEditor.js +15 -0
  111. package/hooks/useRichTextEditor.js.map +1 -0
  112. package/hooks/useTextAlignmentAction.d.ts +1 -0
  113. package/hooks/useTextAlignmentAction.js +15 -0
  114. package/hooks/useTextAlignmentAction.js.map +1 -0
  115. package/hooks/useTypographyAction.d.ts +1 -0
  116. package/hooks/useTypographyAction.js +15 -0
  117. package/hooks/useTypographyAction.js.map +1 -0
  118. package/images/icons/LICENSE.md +5 -0
  119. package/images/icons/chat-square-quote.svg +1 -0
  120. package/images/icons/chevron-down.svg +1 -0
  121. package/images/icons/code.svg +1 -0
  122. package/images/icons/font-color.svg +1 -0
  123. package/images/icons/indent.svg +3 -0
  124. package/images/icons/justify.svg +3 -0
  125. package/images/icons/link.svg +1 -0
  126. package/images/icons/list-ol.svg +1 -0
  127. package/images/icons/list-ul.svg +1 -0
  128. package/images/icons/outdent.svg +3 -0
  129. package/images/icons/pencil-fill.svg +1 -0
  130. package/images/icons/text-center.svg +1 -0
  131. package/images/icons/text-left.svg +1 -0
  132. package/images/icons/text-paragraph.svg +1 -0
  133. package/images/icons/text-right.svg +1 -0
  134. package/images/icons/type-bold.svg +1 -0
  135. package/images/icons/type-h1.svg +1 -0
  136. package/images/icons/type-h2.svg +1 -0
  137. package/images/icons/type-h3.svg +1 -0
  138. package/images/icons/type-h4.svg +1 -0
  139. package/images/icons/type-h5.svg +1 -0
  140. package/images/icons/type-h6.svg +1 -0
  141. package/images/icons/type-italic.svg +1 -0
  142. package/images/icons/type-strikethrough.svg +1 -0
  143. package/images/icons/type-underline.svg +1 -0
  144. package/images/icons/unlink_icon.svg +1 -0
  145. package/index.d.ts +42 -0
  146. package/index.js +295 -0
  147. package/index.js.map +1 -0
  148. package/nodes/FontColorNode.d.ts +43 -0
  149. package/nodes/FontColorNode.js +127 -0
  150. package/nodes/FontColorNode.js.map +1 -0
  151. package/nodes/HeadingNode.d.ts +34 -0
  152. package/nodes/HeadingNode.js +192 -0
  153. package/nodes/HeadingNode.js.map +1 -0
  154. package/nodes/ListItemNode.d.ts +46 -0
  155. package/nodes/ListItemNode.js +441 -0
  156. package/nodes/ListItemNode.js.map +1 -0
  157. package/nodes/ListNode/formatList.d.ts +12 -0
  158. package/nodes/ListNode/formatList.js +424 -0
  159. package/nodes/ListNode/formatList.js.map +1 -0
  160. package/nodes/ListNode.d.ts +42 -0
  161. package/nodes/ListNode.js +294 -0
  162. package/nodes/ListNode.js.map +1 -0
  163. package/nodes/ParagraphNode.d.ts +32 -0
  164. package/nodes/ParagraphNode.js +218 -0
  165. package/nodes/ParagraphNode.js.map +1 -0
  166. package/nodes/QuoteNode.d.ts +34 -0
  167. package/nodes/QuoteNode.js +225 -0
  168. package/nodes/QuoteNode.js.map +1 -0
  169. package/nodes/TypographyElementNode.d.ts +42 -0
  170. package/nodes/TypographyElementNode.js +155 -0
  171. package/nodes/TypographyElementNode.js.map +1 -0
  172. package/nodes/types.d.ts +15 -0
  173. package/nodes/types.js +5 -0
  174. package/nodes/types.js.map +1 -0
  175. package/nodes/webinyNodes.d.ts +7 -0
  176. package/nodes/webinyNodes.js +45 -0
  177. package/nodes/webinyNodes.js.map +1 -0
  178. package/package.json +41 -0
  179. package/plugins/AutoLinkPlugin/AutoLinkPlugin.d.ts +11 -0
  180. package/plugins/AutoLinkPlugin/AutoLinkPlugin.js +46 -0
  181. package/plugins/AutoLinkPlugin/AutoLinkPlugin.js.map +1 -0
  182. package/plugins/AutoLinkPlugin/index.d.ts +1 -0
  183. package/plugins/AutoLinkPlugin/index.js +16 -0
  184. package/plugins/AutoLinkPlugin/index.js.map +1 -0
  185. package/plugins/BlurEventPlugin/BlurEventPlugin.d.ts +7 -0
  186. package/plugins/BlurEventPlugin/BlurEventPlugin.js +28 -0
  187. package/plugins/BlurEventPlugin/BlurEventPlugin.js.map +1 -0
  188. package/plugins/ClickableLinkPlugin/ClickableLinkPlugin.d.ts +17 -0
  189. package/plugins/ClickableLinkPlugin/ClickableLinkPlugin.js +88 -0
  190. package/plugins/ClickableLinkPlugin/ClickableLinkPlugin.js.map +1 -0
  191. package/plugins/ClickableLinkPlugin/index.d.ts +1 -0
  192. package/plugins/ClickableLinkPlugin/index.js +16 -0
  193. package/plugins/ClickableLinkPlugin/index.js.map +1 -0
  194. package/plugins/CodeHighlightPlugin/CodeHighlightPlugin.d.ts +1 -0
  195. package/plugins/CodeHighlightPlugin/CodeHighlightPlugin.js +20 -0
  196. package/plugins/CodeHighlightPlugin/CodeHighlightPlugin.js.map +1 -0
  197. package/plugins/CodeHighlightPlugin/index.d.ts +1 -0
  198. package/plugins/CodeHighlightPlugin/index.js +16 -0
  199. package/plugins/CodeHighlightPlugin/index.js.map +1 -0
  200. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.css +118 -0
  201. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.d.ts +7 -0
  202. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.js +222 -0
  203. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.js.map +1 -0
  204. package/plugins/FloatingLinkEditorPlugin/index.d.ts +1 -0
  205. package/plugins/FloatingLinkEditorPlugin/index.js +16 -0
  206. package/plugins/FloatingLinkEditorPlugin/index.js.map +1 -0
  207. package/plugins/FontColorPlugin/FontColorPlugin.d.ts +2 -0
  208. package/plugins/FontColorPlugin/FontColorPlugin.js +39 -0
  209. package/plugins/FontColorPlugin/FontColorPlugin.js.map +1 -0
  210. package/plugins/LexicalUpdateStatePlugin/LexicalUpdateStatePlugin.d.ts +8 -0
  211. package/plugins/LexicalUpdateStatePlugin/LexicalUpdateStatePlugin.js +34 -0
  212. package/plugins/LexicalUpdateStatePlugin/LexicalUpdateStatePlugin.js.map +1 -0
  213. package/plugins/LexicalUpdateStatePlugin/index.d.ts +1 -0
  214. package/plugins/LexicalUpdateStatePlugin/index.js +16 -0
  215. package/plugins/LexicalUpdateStatePlugin/index.js.map +1 -0
  216. package/plugins/TypographyPlugin/TypographyPlugin.d.ts +2 -0
  217. package/plugins/TypographyPlugin/TypographyPlugin.js +35 -0
  218. package/plugins/TypographyPlugin/TypographyPlugin.js.map +1 -0
  219. package/plugins/WebinyListPLugin/WebinyListPlugin.d.ts +1 -0
  220. package/plugins/WebinyListPLugin/WebinyListPlugin.js +25 -0
  221. package/plugins/WebinyListPLugin/WebinyListPlugin.js.map +1 -0
  222. package/plugins/WebinyQuoteNodePlugin/WebinyQuoteNodePlugin.d.ts +1 -0
  223. package/plugins/WebinyQuoteNodePlugin/WebinyQuoteNodePlugin.js +24 -0
  224. package/plugins/WebinyQuoteNodePlugin/WebinyQuoteNodePlugin.js.map +1 -0
  225. package/themes/webinyLexicalTheme.css +429 -0
  226. package/themes/webinyLexicalTheme.d.ts +9 -0
  227. package/themes/webinyLexicalTheme.js +87 -0
  228. package/themes/webinyLexicalTheme.js.map +1 -0
  229. package/types.d.ts +63 -0
  230. package/types.js +25 -0
  231. package/types.js.map +1 -0
  232. package/ui/Divider.d.ts +2 -0
  233. package/ui/Divider.js +13 -0
  234. package/ui/Divider.js.map +1 -0
  235. package/ui/DropDown.d.ts +26 -0
  236. package/ui/DropDown.js +206 -0
  237. package/ui/DropDown.js.map +1 -0
  238. package/ui/Input.css +32 -0
  239. package/ui/LinkPreview.css +69 -0
  240. package/ui/LinkPreview.d.ts +12 -0
  241. package/ui/LinkPreview.js +101 -0
  242. package/ui/LinkPreview.js.map +1 -0
  243. package/ui/Placeholder.css +23 -0
  244. package/ui/Placeholder.d.ts +13 -0
  245. package/ui/Placeholder.js +24 -0
  246. package/ui/Placeholder.js.map +1 -0
  247. package/ui/TextInput.d.ts +18 -0
  248. package/ui/TextInput.js +39 -0
  249. package/ui/TextInput.js.map +1 -0
  250. package/ui/ToolbarActionDialog.d.ts +12 -0
  251. package/ui/ToolbarActionDialog.js +106 -0
  252. package/ui/ToolbarActionDialog.js.map +1 -0
  253. package/utils/findTypographyStyleByHtmlTag.d.ts +8 -0
  254. package/utils/findTypographyStyleByHtmlTag.js +16 -0
  255. package/utils/findTypographyStyleByHtmlTag.js.map +1 -0
  256. package/utils/generateInitialLexicalValue.d.ts +5 -0
  257. package/utils/generateInitialLexicalValue.js +30 -0
  258. package/utils/generateInitialLexicalValue.js.map +1 -0
  259. package/utils/getDOMRangeRect.d.ts +10 -0
  260. package/utils/getDOMRangeRect.js +27 -0
  261. package/utils/getDOMRangeRect.js.map +1 -0
  262. package/utils/getLexicalTextSelectionState.d.ts +5 -0
  263. package/utils/getLexicalTextSelectionState.js +163 -0
  264. package/utils/getLexicalTextSelectionState.js.map +1 -0
  265. package/utils/getSelectedNode.d.ts +2 -0
  266. package/utils/getSelectedNode.js +30 -0
  267. package/utils/getSelectedNode.js.map +1 -0
  268. package/utils/isValidJSON.d.ts +1 -0
  269. package/utils/isValidJSON.js +18 -0
  270. package/utils/isValidJSON.js.map +1 -0
  271. package/utils/isValidLexicalData.d.ts +2 -0
  272. package/utils/isValidLexicalData.js +24 -0
  273. package/utils/isValidLexicalData.js.map +1 -0
  274. package/utils/nodes/clearNodeFormating.d.ts +2 -0
  275. package/utils/nodes/clearNodeFormating.js +28 -0
  276. package/utils/nodes/clearNodeFormating.js.map +1 -0
  277. package/utils/nodes/formatToHeading.d.ts +3 -0
  278. package/utils/nodes/formatToHeading.js +25 -0
  279. package/utils/nodes/formatToHeading.js.map +1 -0
  280. package/utils/nodes/formatToParagraph.d.ts +2 -0
  281. package/utils/nodes/formatToParagraph.js +20 -0
  282. package/utils/nodes/formatToParagraph.js.map +1 -0
  283. package/utils/nodes/formatToQuote.d.ts +2 -0
  284. package/utils/nodes/formatToQuote.js +25 -0
  285. package/utils/nodes/formatToQuote.js.map +1 -0
  286. package/utils/nodes/listNode.d.ts +11 -0
  287. package/utils/nodes/listNode.js +107 -0
  288. package/utils/nodes/listNode.js.map +1 -0
  289. package/utils/point.d.ts +21 -0
  290. package/utils/point.js +77 -0
  291. package/utils/point.js.map +1 -0
  292. package/utils/rect.d.ts +47 -0
  293. package/utils/rect.js +169 -0
  294. package/utils/rect.js.map +1 -0
  295. package/utils/sanitizeUrl.d.ts +8 -0
  296. package/utils/sanitizeUrl.js +27 -0
  297. package/utils/sanitizeUrl.js.map +1 -0
  298. package/utils/setFloatingElemPosition.d.ts +3 -0
  299. package/utils/setFloatingElemPosition.js +40 -0
  300. package/utils/setFloatingElemPosition.js.map +1 -0
  301. package/utils/styleObjectToString.d.ts +2 -0
  302. package/utils/styleObjectToString.js +22 -0
  303. package/utils/styleObjectToString.js.map +1 -0
  304. package/utils/toTypographyEmotionMap.d.ts +3 -0
  305. package/utils/toTypographyEmotionMap.js +36 -0
  306. package/utils/toTypographyEmotionMap.js.map +1 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) Webiny
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,17 @@
1
+ # @webiny/lexical-editor
2
+ [![](https://img.shields.io/npm/dw/@webiny/app-page-builder.svg)](https://www.npmjs.com/package/@webiny/lexical-editor)
3
+ [![](https://img.shields.io/npm/v/@webiny/app-page-builder.svg)](https://www.npmjs.com/package/@webiny/lexical-editor)
4
+ [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
5
+ [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)
6
+
7
+
8
+ ## About
9
+
10
+ This package provides a web text editor with rich text editing features. It's built on top of the Lexical framework.
11
+
12
+
13
+ To find more about the Lexical framework go to their website [lexical.dev](https://lexical.dev/)
14
+
15
+ ## Where is it used?
16
+
17
+ Currently, this packaged is used in [@webiny/app-pagebuilder](../app-page-builder).
@@ -0,0 +1,7 @@
1
+ import { LexicalCommand } from "lexical";
2
+ export declare type WebinyListCommandPayload = {
3
+ themeStyleId?: string;
4
+ };
5
+ export declare const INSERT_UNORDERED_WEBINY_LIST_COMMAND: LexicalCommand<WebinyListCommandPayload>;
6
+ export declare const INSERT_ORDERED_WEBINY_LIST_COMMAND: LexicalCommand<WebinyListCommandPayload>;
7
+ export declare const REMOVE_WEBINY_LIST_COMMAND: LexicalCommand<void>;
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.REMOVE_WEBINY_LIST_COMMAND = exports.INSERT_UNORDERED_WEBINY_LIST_COMMAND = exports.INSERT_ORDERED_WEBINY_LIST_COMMAND = void 0;
7
+ var _lexical = require("lexical");
8
+ var INSERT_UNORDERED_WEBINY_LIST_COMMAND = (0, _lexical.createCommand)("INSERT_UNORDERED_WEBINY_LIST_COMMAND");
9
+ exports.INSERT_UNORDERED_WEBINY_LIST_COMMAND = INSERT_UNORDERED_WEBINY_LIST_COMMAND;
10
+ var INSERT_ORDERED_WEBINY_LIST_COMMAND = (0, _lexical.createCommand)("INSERT_ORDERED_WEBINY_LIST_COMMAND");
11
+ exports.INSERT_ORDERED_WEBINY_LIST_COMMAND = INSERT_ORDERED_WEBINY_LIST_COMMAND;
12
+ var REMOVE_WEBINY_LIST_COMMAND = (0, _lexical.createCommand)("REMOVE_WEBINY_LIST_COMMAND");
13
+ exports.REMOVE_WEBINY_LIST_COMMAND = REMOVE_WEBINY_LIST_COMMAND;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["INSERT_UNORDERED_WEBINY_LIST_COMMAND","createCommand","INSERT_ORDERED_WEBINY_LIST_COMMAND","REMOVE_WEBINY_LIST_COMMAND"],"sources":["webiny-list.ts"],"sourcesContent":["import { createCommand, LexicalCommand } from \"lexical\";\n\nexport type WebinyListCommandPayload = {\n themeStyleId?: string;\n};\n\nexport const INSERT_UNORDERED_WEBINY_LIST_COMMAND: LexicalCommand<WebinyListCommandPayload> =\n createCommand(\"INSERT_UNORDERED_WEBINY_LIST_COMMAND\");\nexport const INSERT_ORDERED_WEBINY_LIST_COMMAND: LexicalCommand<WebinyListCommandPayload> =\n createCommand(\"INSERT_ORDERED_WEBINY_LIST_COMMAND\");\n\nexport const REMOVE_WEBINY_LIST_COMMAND: LexicalCommand<void> = createCommand(\n \"REMOVE_WEBINY_LIST_COMMAND\"\n);\n"],"mappings":";;;;;;AAAA;AAMO,IAAMA,oCAA8E,GACvF,IAAAC,sBAAa,EAAC,sCAAsC,CAAC;AAAC;AACnD,IAAMC,kCAA4E,GACrF,IAAAD,sBAAa,EAAC,oCAAoC,CAAC;AAAC;AAEjD,IAAME,0BAAgD,GAAG,IAAAF,sBAAa,EACzE,4BAA4B,CAC/B;AAAC"}
@@ -0,0 +1,5 @@
1
+ import { LexicalCommand } from "lexical";
2
+ export declare type WebinyQuoteCommandPayload = {
3
+ themeStyleId: string;
4
+ };
5
+ export declare const INSERT_WEBINY_QUOTE_COMMAND: LexicalCommand<WebinyQuoteCommandPayload>;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.INSERT_WEBINY_QUOTE_COMMAND = void 0;
7
+ var _lexical = require("lexical");
8
+ var INSERT_WEBINY_QUOTE_COMMAND = (0, _lexical.createCommand)("INSERT_WEBINY_QUOTE_COMMAND");
9
+ exports.INSERT_WEBINY_QUOTE_COMMAND = INSERT_WEBINY_QUOTE_COMMAND;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["INSERT_WEBINY_QUOTE_COMMAND","createCommand"],"sources":["webiny-quote.ts"],"sourcesContent":["import { createCommand, LexicalCommand } from \"lexical\";\n\nexport type WebinyQuoteCommandPayload = {\n themeStyleId: string;\n};\n\nexport const INSERT_WEBINY_QUOTE_COMMAND: LexicalCommand<WebinyQuoteCommandPayload> = createCommand(\n \"INSERT_WEBINY_QUOTE_COMMAND\"\n);\n"],"mappings":";;;;;;AAAA;AAMO,IAAMA,2BAAsE,GAAG,IAAAC,sBAAa,EAC/F,6BAA6B,CAChC;AAAC"}
@@ -0,0 +1,6 @@
1
+ import { FC } from "react";
2
+ import { Klass, LexicalNode } from "lexical";
3
+ export interface AddRichTextEditorNodeTypeProps {
4
+ type: Klass<LexicalNode>;
5
+ }
6
+ export declare const AddRichTextEditorNodeType: FC<AddRichTextEditorNodeTypeProps>;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.AddRichTextEditorNodeType = void 0;
8
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
9
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
+ var _react = _interopRequireDefault(require("react"));
11
+ var _reactComposition = require("@webiny/react-composition");
12
+ var _RichTextEditor = require("./Editor/RichTextEditor");
13
+ var _excluded = ["nodes", "children"];
14
+ var AddRichTextEditorNodeType = function AddRichTextEditorNodeType(_ref) {
15
+ var type = _ref.type;
16
+ var NodePlugin = (0, _reactComposition.createComponentPlugin)(_RichTextEditor.RichTextEditor, function (Original) {
17
+ return function RichTextEditor(_ref2) {
18
+ var nodes = _ref2.nodes,
19
+ children = _ref2.children,
20
+ rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
21
+ return /*#__PURE__*/_react.default.createElement(Original, Object.assign({}, rest, {
22
+ nodes: [].concat((0, _toConsumableArray2.default)(nodes || []), [type])
23
+ }), children);
24
+ };
25
+ });
26
+ return /*#__PURE__*/_react.default.createElement(NodePlugin, null);
27
+ };
28
+ exports.AddRichTextEditorNodeType = AddRichTextEditorNodeType;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["AddRichTextEditorNodeType","type","NodePlugin","createComponentPlugin","RichTextEditor","Original","nodes","children","rest"],"sources":["AddRichTextEditorNodeType.tsx"],"sourcesContent":["import React, { FC } from \"react\";\nimport { Klass, LexicalNode } from \"lexical\";\nimport { createComponentPlugin } from \"@webiny/react-composition\";\nimport { RichTextEditor } from \"~/components/Editor/RichTextEditor\";\n\nexport interface AddRichTextEditorNodeTypeProps {\n type: Klass<LexicalNode>;\n}\n\nexport const AddRichTextEditorNodeType: FC<AddRichTextEditorNodeTypeProps> = ({ type }) => {\n const NodePlugin = createComponentPlugin(RichTextEditor, Original => {\n return function RichTextEditor({ nodes, children, ...rest }): JSX.Element {\n return (\n <Original {...rest} nodes={[...(nodes || []), type]}>\n {children}\n </Original>\n );\n };\n });\n\n return <NodePlugin />;\n};\n"],"mappings":";;;;;;;;;AAAA;AAEA;AACA;AAAoE;AAM7D,IAAMA,yBAA6D,GAAG,SAAhEA,yBAA6D,OAAiB;EAAA,IAAXC,IAAI,QAAJA,IAAI;EAChF,IAAMC,UAAU,GAAG,IAAAC,uCAAqB,EAACC,8BAAc,EAAE,UAAAC,QAAQ,EAAI;IACjE,OAAO,SAASD,cAAc,QAA4C;MAAA,IAAzCE,KAAK,SAALA,KAAK;QAAEC,QAAQ,SAARA,QAAQ;QAAKC,IAAI;MACrD,oBACI,6BAAC,QAAQ,oBAAKA,IAAI;QAAE,KAAK,6CAAOF,KAAK,IAAI,EAAE,IAAGL,IAAI;MAAE,IAC/CM,QAAQ,CACF;IAEnB,CAAC;EACL,CAAC,CAAC;EAEF,oBAAO,6BAAC,UAAU,OAAG;AACzB,CAAC;AAAC"}
@@ -0,0 +1,12 @@
1
+ import React, { FC } from "react";
2
+ import { LexicalValue } from "../types";
3
+ import { WebinyTheme } from "../themes/webinyLexicalTheme";
4
+ interface AddRichTextEditorProps {
5
+ toolbar: React.ReactNode;
6
+ placeholder?: string;
7
+ value: LexicalValue;
8
+ children?: React.ReactNode;
9
+ theme: WebinyTheme;
10
+ }
11
+ export declare const AddRichTextEditorPlugin: FC<AddRichTextEditorProps>;
12
+ export {};
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.AddRichTextEditorPlugin = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _reactComposition = require("@webiny/react-composition");
10
+ var _RichTextEditor = require("./Editor/RichTextEditor");
11
+ var AddRichTextEditorPlugin = function AddRichTextEditorPlugin(_ref) {
12
+ var toolbar = _ref.toolbar,
13
+ placeholder = _ref.placeholder,
14
+ children = _ref.children;
15
+ var RichTextEditorPlugin = /*#__PURE__*/_react.default.memo((0, _reactComposition.createComponentPlugin)(_RichTextEditor.RichTextEditor, function (Original) {
16
+ return function RichTextEditorElem(_ref2) {
17
+ var tag = _ref2.tag,
18
+ value = _ref2.value,
19
+ onChange = _ref2.onChange,
20
+ theme = _ref2.theme;
21
+ return /*#__PURE__*/_react.default.createElement(Original, {
22
+ toolbar: toolbar,
23
+ tag: tag,
24
+ placeholder: placeholder,
25
+ value: value,
26
+ onChange: onChange,
27
+ theme: theme
28
+ }, children);
29
+ };
30
+ }));
31
+ return /*#__PURE__*/_react.default.createElement(RichTextEditorPlugin, null);
32
+ };
33
+ exports.AddRichTextEditorPlugin = AddRichTextEditorPlugin;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["AddRichTextEditorPlugin","toolbar","placeholder","children","RichTextEditorPlugin","React","memo","createComponentPlugin","RichTextEditor","Original","RichTextEditorElem","tag","value","onChange","theme"],"sources":["AddRichTextEditorPlugin.tsx"],"sourcesContent":["import React, { FC } from \"react\";\nimport { createComponentPlugin } from \"@webiny/react-composition\";\nimport { RichTextEditor } from \"~/components/Editor/RichTextEditor\";\nimport { LexicalValue } from \"~/types\";\nimport { WebinyTheme } from \"~/themes/webinyLexicalTheme\";\n\ninterface AddRichTextEditorProps {\n toolbar: React.ReactNode;\n placeholder?: string;\n value: LexicalValue;\n children?: React.ReactNode;\n /*\n * @description Theme to be injected into lexical editor\n */\n theme: WebinyTheme;\n}\n\nexport const AddRichTextEditorPlugin: FC<AddRichTextEditorProps> = ({\n toolbar,\n placeholder,\n children\n}) => {\n const RichTextEditorPlugin = React.memo(\n createComponentPlugin(RichTextEditor, Original => {\n return function RichTextEditorElem({ tag, value, onChange, theme }): JSX.Element {\n return (\n <Original\n toolbar={toolbar}\n tag={tag}\n placeholder={placeholder}\n value={value}\n onChange={onChange}\n theme={theme}\n >\n {children}\n </Original>\n );\n };\n })\n );\n\n return <RichTextEditorPlugin />;\n};\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAeO,IAAMA,uBAAmD,GAAG,SAAtDA,uBAAmD,OAI1D;EAAA,IAHFC,OAAO,QAAPA,OAAO;IACPC,WAAW,QAAXA,WAAW;IACXC,QAAQ,QAARA,QAAQ;EAER,IAAMC,oBAAoB,gBAAGC,cAAK,CAACC,IAAI,CACnC,IAAAC,uCAAqB,EAACC,8BAAc,EAAE,UAAAC,QAAQ,EAAI;IAC9C,OAAO,SAASC,kBAAkB,QAA+C;MAAA,IAA5CC,GAAG,SAAHA,GAAG;QAAEC,KAAK,SAALA,KAAK;QAAEC,QAAQ,SAARA,QAAQ;QAAEC,KAAK,SAALA,KAAK;MAC5D,oBACI,6BAAC,QAAQ;QACL,OAAO,EAAEb,OAAQ;QACjB,GAAG,EAAEU,GAAI;QACT,WAAW,EAAET,WAAY;QACzB,KAAK,EAAEU,KAAM;QACb,QAAQ,EAAEC,QAAS;QACnB,KAAK,EAAEC;MAAM,GAEZX,QAAQ,CACF;IAEnB,CAAC;EACL,CAAC,CAAC,CACL;EAED,oBAAO,6BAAC,oBAAoB,OAAG;AACnC,CAAC;AAAC"}
@@ -0,0 +1,7 @@
1
+ import { FC } from "react";
2
+ interface AddToolbarActionProps {
3
+ type?: "heading" | "paragraph" | string;
4
+ element: JSX.Element;
5
+ }
6
+ export declare const AddToolbarAction: FC<AddToolbarActionProps>;
7
+ export {};
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.AddToolbarAction = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _reactComposition = require("@webiny/react-composition");
10
+ var _Toolbar = require("./Toolbar/Toolbar");
11
+ var AddToolbarAction = function AddToolbarAction(_ref) {
12
+ var element = _ref.element,
13
+ targetType = _ref.type;
14
+ var ToolbarPlugin = /*#__PURE__*/_react.default.memo((0, _reactComposition.createComponentPlugin)(_Toolbar.Toolbar, function (Original) {
15
+ return function Toolbar(_ref2) {
16
+ var type = _ref2.type,
17
+ children = _ref2.children,
18
+ anchorElem = _ref2.anchorElem;
19
+ if (!targetType || targetType === type) {
20
+ return /*#__PURE__*/_react.default.createElement(Original, {
21
+ type: type,
22
+ anchorElem: anchorElem
23
+ }, element, children);
24
+ }
25
+ return /*#__PURE__*/_react.default.createElement(Original, {
26
+ anchorElem: anchorElem,
27
+ type: type
28
+ }, children);
29
+ };
30
+ }));
31
+ return /*#__PURE__*/_react.default.createElement(ToolbarPlugin, null);
32
+ };
33
+ exports.AddToolbarAction = AddToolbarAction;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["AddToolbarAction","element","targetType","type","ToolbarPlugin","React","memo","createComponentPlugin","Toolbar","Original","children","anchorElem"],"sources":["AddToolbarAction.tsx"],"sourcesContent":["import React, { FC } from \"react\";\nimport { createComponentPlugin } from \"@webiny/react-composition\";\nimport { Toolbar } from \"~/components/Toolbar/Toolbar\";\ninterface AddToolbarActionProps {\n type?: \"heading\" | \"paragraph\" | string;\n element: JSX.Element;\n}\n\nexport const AddToolbarAction: FC<AddToolbarActionProps> = ({ element, type: targetType }) => {\n const ToolbarPlugin = React.memo(\n createComponentPlugin(Toolbar, Original => {\n return function Toolbar({ type, children, anchorElem }): JSX.Element {\n if (!targetType || targetType === type) {\n return (\n <Original type={type} anchorElem={anchorElem}>\n {element}\n {children}\n </Original>\n );\n }\n\n return (\n <Original anchorElem={anchorElem} type={type}>\n {children}\n </Original>\n );\n };\n })\n );\n\n return <ToolbarPlugin />;\n};\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAMO,IAAMA,gBAA2C,GAAG,SAA9CA,gBAA2C,OAAsC;EAAA,IAAhCC,OAAO,QAAPA,OAAO;IAAQC,UAAU,QAAhBC,IAAI;EACvE,IAAMC,aAAa,gBAAGC,cAAK,CAACC,IAAI,CAC5B,IAAAC,uCAAqB,EAACC,gBAAO,EAAE,UAAAC,QAAQ,EAAI;IACvC,OAAO,SAASD,OAAO,QAA8C;MAAA,IAA3CL,IAAI,SAAJA,IAAI;QAAEO,QAAQ,SAARA,QAAQ;QAAEC,UAAU,SAAVA,UAAU;MAChD,IAAI,CAACT,UAAU,IAAIA,UAAU,KAAKC,IAAI,EAAE;QACpC,oBACI,6BAAC,QAAQ;UAAC,IAAI,EAAEA,IAAK;UAAC,UAAU,EAAEQ;QAAW,GACxCV,OAAO,EACPS,QAAQ,CACF;MAEnB;MAEA,oBACI,6BAAC,QAAQ;QAAC,UAAU,EAAEC,UAAW;QAAC,IAAI,EAAER;MAAK,GACxCO,QAAQ,CACF;IAEnB,CAAC;EACL,CAAC,CAAC,CACL;EAED,oBAAO,6BAAC,aAAa,OAAG;AAC5B,CAAC;AAAC"}
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import { RichTextEditorProps } from "./RichTextEditor";
3
+ interface HeadingEditorProps extends RichTextEditorProps {
4
+ tag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
5
+ }
6
+ export declare const HeadingEditor: React.FC<HeadingEditorProps>;
7
+ export {};
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.HeadingEditor = void 0;
8
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
9
+ var _react = _interopRequireDefault(require("react"));
10
+ var _LexicalLinkPlugin = require("@lexical/react/LexicalLinkPlugin");
11
+ var _ClickableLinkPlugin = require("../../plugins/ClickableLinkPlugin/ClickableLinkPlugin");
12
+ var _FloatingLinkEditorPlugin = require("../../plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin");
13
+ var _HeadingToolbar = require("../Toolbar/HeadingToolbar");
14
+ var _RichTextEditor = require("./RichTextEditor");
15
+ var _WebinyQuoteNodePlugin = require("../../plugins/WebinyQuoteNodePlugin/WebinyQuoteNodePlugin");
16
+ var _excluded = ["tag", "placeholder"];
17
+ var HeadingEditor = function HeadingEditor(_ref) {
18
+ var tag = _ref.tag,
19
+ placeholder = _ref.placeholder,
20
+ rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
21
+ return /*#__PURE__*/_react.default.createElement(_RichTextEditor.RichTextEditor, Object.assign({
22
+ toolbar: /*#__PURE__*/_react.default.createElement(_HeadingToolbar.HeadingToolbar, null),
23
+ tag: tag !== null && tag !== void 0 ? tag : "h1",
24
+ placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : "Enter your heading text here..."
25
+ }, rest), /*#__PURE__*/_react.default.createElement(_LexicalLinkPlugin.LinkPlugin, null), /*#__PURE__*/_react.default.createElement(_WebinyQuoteNodePlugin.QuotePlugin, null), /*#__PURE__*/_react.default.createElement(_ClickableLinkPlugin.ClickableLinkPlugin, null), /*#__PURE__*/_react.default.createElement(_FloatingLinkEditorPlugin.FloatingLinkEditorPlugin, {
26
+ anchorElem: document.body
27
+ }));
28
+ };
29
+ exports.HeadingEditor = HeadingEditor;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["HeadingEditor","tag","placeholder","rest","document","body"],"sources":["HeadingEditor.tsx"],"sourcesContent":["import React from \"react\";\nimport { LinkPlugin } from \"@lexical/react/LexicalLinkPlugin\";\nimport { ClickableLinkPlugin } from \"~/plugins/ClickableLinkPlugin/ClickableLinkPlugin\";\nimport { FloatingLinkEditorPlugin } from \"~/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin\";\nimport { HeadingToolbar } from \"~/components/Toolbar/HeadingToolbar\";\nimport { RichTextEditor, RichTextEditorProps } from \"~/components/Editor/RichTextEditor\";\nimport { QuotePlugin } from \"~/plugins/WebinyQuoteNodePlugin/WebinyQuoteNodePlugin\";\n\ninterface HeadingEditorProps extends RichTextEditorProps {\n tag?: \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\n}\n\nexport const HeadingEditor: React.FC<HeadingEditorProps> = ({ tag, placeholder, ...rest }) => {\n return (\n <RichTextEditor\n toolbar={<HeadingToolbar />}\n tag={tag ?? \"h1\"}\n placeholder={placeholder ?? \"Enter your heading text here...\"}\n {...rest}\n >\n <LinkPlugin />\n <QuotePlugin />\n <ClickableLinkPlugin />\n <FloatingLinkEditorPlugin anchorElem={document.body} />\n </RichTextEditor>\n );\n};\n"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AAAoF;AAM7E,IAAMA,aAA2C,GAAG,SAA9CA,aAA2C,OAAsC;EAAA,IAAhCC,GAAG,QAAHA,GAAG;IAAEC,WAAW,QAAXA,WAAW;IAAKC,IAAI;EACnF,oBACI,6BAAC,8BAAc;IACX,OAAO,eAAE,6BAAC,8BAAc,OAAI;IAC5B,GAAG,EAAEF,GAAG,aAAHA,GAAG,cAAHA,GAAG,GAAI,IAAK;IACjB,WAAW,EAAEC,WAAW,aAAXA,WAAW,cAAXA,WAAW,GAAI;EAAkC,GAC1DC,IAAI,gBAER,6BAAC,6BAAU,OAAG,eACd,6BAAC,kCAAW,OAAG,eACf,6BAAC,wCAAmB,OAAG,eACvB,6BAAC,kDAAwB;IAAC,UAAU,EAAEC,QAAQ,CAACC;EAAK,EAAG,CAC1C;AAEzB,CAAC;AAAC"}
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ import { RichTextEditorProps } from "./RichTextEditor";
3
+ interface ParagraphLexicalEditorProps extends RichTextEditorProps {
4
+ tag?: "p";
5
+ }
6
+ declare const ParagraphEditor: React.FC<ParagraphLexicalEditorProps>;
7
+ export { ParagraphEditor };
@@ -0,0 +1,30 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.ParagraphEditor = void 0;
8
+ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
9
+ var _react = _interopRequireDefault(require("react"));
10
+ var _CodeHighlightPlugin = require("../../plugins/CodeHighlightPlugin/CodeHighlightPlugin");
11
+ var _LexicalLinkPlugin = require("@lexical/react/LexicalLinkPlugin");
12
+ var _FloatingLinkEditorPlugin = require("../../plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin");
13
+ var _ClickableLinkPlugin = require("../../plugins/ClickableLinkPlugin/ClickableLinkPlugin");
14
+ var _ParagraphToolbar = require("../Toolbar/ParagraphToolbar");
15
+ var _RichTextEditor = require("./RichTextEditor");
16
+ var _WebinyListPlugin = require("../../plugins/WebinyListPLugin/WebinyListPlugin");
17
+ var _excluded = ["placeholder", "tag"];
18
+ var ParagraphEditor = function ParagraphEditor(_ref) {
19
+ var placeholder = _ref.placeholder,
20
+ tag = _ref.tag,
21
+ rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
22
+ return /*#__PURE__*/_react.default.createElement(_RichTextEditor.RichTextEditor, Object.assign({
23
+ toolbar: /*#__PURE__*/_react.default.createElement(_ParagraphToolbar.ParagraphToolbar, null),
24
+ tag: tag !== null && tag !== void 0 ? tag : "p",
25
+ placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : "Enter your text here..."
26
+ }, rest), /*#__PURE__*/_react.default.createElement(_LexicalLinkPlugin.LinkPlugin, null), /*#__PURE__*/_react.default.createElement(_WebinyListPlugin.WebinyListPlugin, null), /*#__PURE__*/_react.default.createElement(_CodeHighlightPlugin.CodeHighlightPlugin, null), /*#__PURE__*/_react.default.createElement(_ClickableLinkPlugin.ClickableLinkPlugin, null), /*#__PURE__*/_react.default.createElement(_FloatingLinkEditorPlugin.FloatingLinkEditorPlugin, {
27
+ anchorElem: document.body
28
+ }));
29
+ };
30
+ exports.ParagraphEditor = ParagraphEditor;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["ParagraphEditor","placeholder","tag","rest","document","body"],"sources":["ParagraphEditor.tsx"],"sourcesContent":["import React from \"react\";\nimport { CodeHighlightPlugin } from \"~/plugins/CodeHighlightPlugin/CodeHighlightPlugin\";\nimport { LinkPlugin } from \"@lexical/react/LexicalLinkPlugin\";\nimport { FloatingLinkEditorPlugin } from \"~/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin\";\nimport { ClickableLinkPlugin } from \"~/plugins/ClickableLinkPlugin/ClickableLinkPlugin\";\nimport { ParagraphToolbar } from \"~/components/Toolbar/ParagraphToolbar\";\nimport { RichTextEditor, RichTextEditorProps } from \"~/components/Editor/RichTextEditor\";\nimport { WebinyListPlugin } from \"~/plugins/WebinyListPLugin/WebinyListPlugin\";\n\ninterface ParagraphLexicalEditorProps extends RichTextEditorProps {\n tag?: \"p\";\n}\n\nconst ParagraphEditor: React.FC<ParagraphLexicalEditorProps> = ({ placeholder, tag, ...rest }) => {\n return (\n <RichTextEditor\n toolbar={<ParagraphToolbar />}\n tag={tag ?? \"p\"}\n placeholder={placeholder ?? \"Enter your text here...\"}\n {...rest}\n >\n <LinkPlugin />\n <WebinyListPlugin />\n <CodeHighlightPlugin />\n <ClickableLinkPlugin />\n <FloatingLinkEditorPlugin anchorElem={document.body} />\n </RichTextEditor>\n );\n};\n\nexport { ParagraphEditor };\n"],"mappings":";;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAA+E;AAM/E,IAAMA,eAAsD,GAAG,SAAzDA,eAAsD,OAAsC;EAAA,IAAhCC,WAAW,QAAXA,WAAW;IAAEC,GAAG,QAAHA,GAAG;IAAKC,IAAI;EACvF,oBACI,6BAAC,8BAAc;IACX,OAAO,eAAE,6BAAC,kCAAgB,OAAI;IAC9B,GAAG,EAAED,GAAG,aAAHA,GAAG,cAAHA,GAAG,GAAI,GAAI;IAChB,WAAW,EAAED,WAAW,aAAXA,WAAW,cAAXA,WAAW,GAAI;EAA0B,GAClDE,IAAI,gBAER,6BAAC,6BAAU,OAAG,eACd,6BAAC,kCAAgB,OAAG,eACpB,6BAAC,wCAAmB,OAAG,eACvB,6BAAC,wCAAmB,OAAG,eACvB,6BAAC,kDAAwB;IAAC,UAAU,EAAEC,QAAQ,CAACC;EAAK,EAAG,CAC1C;AAEzB,CAAC;AAAC"}
@@ -0,0 +1,26 @@
1
+ import React from "react";
2
+ import { LexicalValue, ThemeEmotionMap } from "../../types";
3
+ import { Klass, LexicalNode } from "lexical";
4
+ import { WebinyTheme } from "../../themes/webinyLexicalTheme";
5
+ export interface RichTextEditorProps {
6
+ toolbar?: React.ReactNode;
7
+ tag?: string;
8
+ onChange?: (json: LexicalValue) => void;
9
+ value: LexicalValue | null;
10
+ focus?: boolean;
11
+ placeholder?: string;
12
+ nodes?: Klass<LexicalNode>[];
13
+ /**
14
+ * @description Lexical plugins
15
+ */
16
+ children?: React.ReactNode | React.ReactNode[];
17
+ onBlur?: (editorState: LexicalValue) => void;
18
+ height?: number | string;
19
+ width?: number | string;
20
+ theme: WebinyTheme;
21
+ themeEmotionMap?: ThemeEmotionMap;
22
+ }
23
+ /**
24
+ * @description Main editor container
25
+ */
26
+ export declare const RichTextEditor: import("@webiny/react-composition").ComposableFC<RichTextEditorProps>;
@@ -0,0 +1,138 @@
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.RichTextEditor = void 0;
9
+ var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
10
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
11
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
12
+ var _react = _interopRequireWildcard(require("react"));
13
+ var _Placeholder = require("../../ui/Placeholder");
14
+ var _generateInitialLexicalValue = require("../../utils/generateInitialLexicalValue");
15
+ var _LexicalComposer = require("@lexical/react/LexicalComposer");
16
+ var _LexicalOnChangePlugin = require("@lexical/react/LexicalOnChangePlugin");
17
+ var _LexicalAutoFocusPlugin = require("@lexical/react/LexicalAutoFocusPlugin");
18
+ var _LexicalClearEditorPlugin = require("@lexical/react/LexicalClearEditorPlugin");
19
+ var _LexicalRichTextPlugin = require("@lexical/react/LexicalRichTextPlugin");
20
+ var _LexicalErrorBoundary = _interopRequireDefault(require("@lexical/react/LexicalErrorBoundary"));
21
+ var _reactComposition = require("@webiny/react-composition");
22
+ var _LexicalContentEditable = require("@lexical/react/LexicalContentEditable");
23
+ var _RichTextEditorContext = require("../../context/RichTextEditorContext");
24
+ var _isValidLexicalData = require("../../utils/isValidLexicalData");
25
+ var _LexicalUpdateStatePlugin = require("../../plugins/LexicalUpdateStatePlugin");
26
+ var _BlurEventPlugin = require("../../plugins/BlurEventPlugin/BlurEventPlugin");
27
+ var _FontColorPlugin = require("../../plugins/FontColorPlugin/FontColorPlugin");
28
+ var _webinyLexicalTheme = require("../../themes/webinyLexicalTheme");
29
+ var _webinyNodes = require("../../nodes/webinyNodes");
30
+ var _TypographyPlugin = require("../../plugins/TypographyPlugin/TypographyPlugin");
31
+ var _WebinyQuoteNodePlugin = require("../../plugins/WebinyQuoteNodePlugin/WebinyQuoteNodePlugin");
32
+ var _LexicalHistoryPlugin = require("@lexical/react/LexicalHistoryPlugin");
33
+ var _SharedHistoryContext = require("../../context/SharedHistoryContext");
34
+ var _useRichTextEditor2 = require("../../hooks/useRichTextEditor");
35
+ var _react2 = require("@emotion/react");
36
+ var _toTypographyEmotionMap = require("../../utils/toTypographyEmotionMap");
37
+ var BaseRichTextEditor = function BaseRichTextEditor(_ref) {
38
+ var toolbar = _ref.toolbar,
39
+ onChange = _ref.onChange,
40
+ value = _ref.value,
41
+ nodes = _ref.nodes,
42
+ placeholder = _ref.placeholder,
43
+ children = _ref.children,
44
+ onBlur = _ref.onBlur,
45
+ focus = _ref.focus,
46
+ width = _ref.width,
47
+ height = _ref.height,
48
+ theme = _ref.theme,
49
+ themeEmotionMap = _ref.themeEmotionMap;
50
+ var _useSharedHistoryCont = (0, _SharedHistoryContext.useSharedHistoryContext)(),
51
+ historyState = _useSharedHistoryCont.historyState;
52
+ var placeholderElem = /*#__PURE__*/_react.default.createElement(_Placeholder.Placeholder, null, placeholder || "Enter text...");
53
+ var scrollRef = (0, _react.useRef)(null);
54
+ var _useState = (0, _react.useState)(undefined),
55
+ _useState2 = (0, _slicedToArray2.default)(_useState, 2),
56
+ floatingAnchorElem = _useState2[0],
57
+ setFloatingAnchorElem = _useState2[1];
58
+ var _useRichTextEditor = (0, _useRichTextEditor2.useRichTextEditor)(),
59
+ setTheme = _useRichTextEditor.setTheme,
60
+ setThemeEmotionMap = _useRichTextEditor.setThemeEmotionMap;
61
+ (0, _react.useEffect)(function () {
62
+ setTheme(theme);
63
+ setThemeEmotionMap(themeEmotionMap);
64
+ }, [themeEmotionMap]);
65
+ var onRef = function onRef(_floatingAnchorElem) {
66
+ if (_floatingAnchorElem !== null) {
67
+ setFloatingAnchorElem(_floatingAnchorElem);
68
+ }
69
+ };
70
+ var sizeStyle = {
71
+ height: height || "",
72
+ width: width || ""
73
+ };
74
+ var initialConfig = {
75
+ editorState: (0, _isValidLexicalData.isValidLexicalData)(value) ? value : (0, _generateInitialLexicalValue.generateInitialLexicalValue)(),
76
+ namespace: "webiny",
77
+ onError: function onError(error) {
78
+ throw error;
79
+ },
80
+ nodes: [].concat((0, _toConsumableArray2.default)(_webinyNodes.WebinyNodes), (0, _toConsumableArray2.default)(nodes || [])),
81
+ theme: (0, _objectSpread2.default)((0, _objectSpread2.default)({}, _webinyLexicalTheme.webinyEditorTheme), {}, {
82
+ emotionMap: themeEmotionMap
83
+ })
84
+ };
85
+ function handleOnChange(editorState, editor) {
86
+ editorState.read(function () {
87
+ if (typeof onChange === "function") {
88
+ var _editorState = editor.getEditorState();
89
+ //TODO: send plain JSON object
90
+ onChange(JSON.stringify(_editorState.toJSON()));
91
+ }
92
+ });
93
+ }
94
+ return /*#__PURE__*/_react.default.createElement(_LexicalComposer.LexicalComposer, {
95
+ initialConfig: initialConfig
96
+ }, /*#__PURE__*/_react.default.createElement("div", {
97
+ ref: scrollRef,
98
+ style: (0, _objectSpread2.default)({}, sizeStyle)
99
+ }, /*#__PURE__*/_react.default.createElement(_LexicalOnChangePlugin.OnChangePlugin, {
100
+ onChange: handleOnChange
101
+ }), value && /*#__PURE__*/_react.default.createElement(_LexicalUpdateStatePlugin.LexicalUpdateStatePlugin, {
102
+ value: value
103
+ }), /*#__PURE__*/_react.default.createElement(_LexicalClearEditorPlugin.ClearEditorPlugin, null), /*#__PURE__*/_react.default.createElement(_FontColorPlugin.FontColorPlugin, null), /*#__PURE__*/_react.default.createElement(_TypographyPlugin.TypographyPlugin, null), /*#__PURE__*/_react.default.createElement(_WebinyQuoteNodePlugin.QuotePlugin, null), /*#__PURE__*/_react.default.createElement(_LexicalHistoryPlugin.HistoryPlugin, {
104
+ externalHistoryState: historyState
105
+ }), onBlur && /*#__PURE__*/_react.default.createElement(_BlurEventPlugin.BlurEventPlugin, {
106
+ onBlur: onBlur
107
+ }), focus && /*#__PURE__*/_react.default.createElement(_LexicalAutoFocusPlugin.AutoFocusPlugin, null), children, /*#__PURE__*/_react.default.createElement(_LexicalRichTextPlugin.RichTextPlugin, {
108
+ contentEditable: /*#__PURE__*/_react.default.createElement("div", {
109
+ className: "editor-scroller",
110
+ style: (0, _objectSpread2.default)({}, sizeStyle)
111
+ }, /*#__PURE__*/_react.default.createElement("div", {
112
+ className: "editor",
113
+ ref: onRef,
114
+ style: (0, _objectSpread2.default)({}, sizeStyle)
115
+ }, /*#__PURE__*/_react.default.createElement(_LexicalContentEditable.ContentEditable, {
116
+ style: (0, _objectSpread2.default)({
117
+ outline: 0
118
+ }, sizeStyle)
119
+ }))),
120
+ placeholder: placeholderElem,
121
+ ErrorBoundary: _LexicalErrorBoundary.default
122
+ }), floatingAnchorElem && toolbar));
123
+ };
124
+
125
+ /**
126
+ * @description Main editor container
127
+ */
128
+ var RichTextEditor = (0, _reactComposition.makeComposable)("RichTextEditor", function (props) {
129
+ return /*#__PURE__*/_react.default.createElement(_RichTextEditorContext.RichTextEditorProvider, null, /*#__PURE__*/_react.default.createElement(_react2.ClassNames, null, function (_ref2) {
130
+ var _props$themeEmotionMa;
131
+ var css = _ref2.css;
132
+ var themeEmotionMap = (_props$themeEmotionMa = props === null || props === void 0 ? void 0 : props.themeEmotionMap) !== null && _props$themeEmotionMa !== void 0 ? _props$themeEmotionMa : (0, _toTypographyEmotionMap.toTypographyEmotionMap)(css, props.theme);
133
+ return /*#__PURE__*/_react.default.createElement(_SharedHistoryContext.SharedHistoryContext, null, /*#__PURE__*/_react.default.createElement(BaseRichTextEditor, Object.assign({}, props, {
134
+ themeEmotionMap: themeEmotionMap
135
+ })));
136
+ }));
137
+ });
138
+ exports.RichTextEditor = RichTextEditor;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["BaseRichTextEditor","toolbar","onChange","value","nodes","placeholder","children","onBlur","focus","width","height","theme","themeEmotionMap","useSharedHistoryContext","historyState","placeholderElem","scrollRef","useRef","useState","undefined","floatingAnchorElem","setFloatingAnchorElem","useRichTextEditor","setTheme","setThemeEmotionMap","useEffect","onRef","_floatingAnchorElem","sizeStyle","initialConfig","editorState","isValidLexicalData","generateInitialLexicalValue","namespace","onError","error","WebinyNodes","webinyEditorTheme","emotionMap","handleOnChange","editor","read","getEditorState","JSON","stringify","toJSON","outline","LexicalErrorBoundary","RichTextEditor","makeComposable","props","css","toTypographyEmotionMap"],"sources":["RichTextEditor.tsx"],"sourcesContent":["import React, { useEffect, useRef, useState } from \"react\";\nimport { LexicalValue, ThemeEmotionMap } from \"~/types\";\nimport { Placeholder } from \"~/ui/Placeholder\";\nimport { generateInitialLexicalValue } from \"~/utils/generateInitialLexicalValue\";\nimport { EditorState } from \"lexical/LexicalEditorState\";\nimport { Klass, LexicalEditor, LexicalNode } from \"lexical\";\nimport { LexicalComposer } from \"@lexical/react/LexicalComposer\";\nimport { OnChangePlugin } from \"@lexical/react/LexicalOnChangePlugin\";\nimport { AutoFocusPlugin } from \"@lexical/react/LexicalAutoFocusPlugin\";\nimport { ClearEditorPlugin } from \"@lexical/react/LexicalClearEditorPlugin\";\nimport { RichTextPlugin } from \"@lexical/react/LexicalRichTextPlugin\";\nimport LexicalErrorBoundary from \"@lexical/react/LexicalErrorBoundary\";\nimport { makeComposable } from \"@webiny/react-composition\";\nimport { ContentEditable } from \"@lexical/react/LexicalContentEditable\";\nimport { RichTextEditorProvider } from \"~/context/RichTextEditorContext\";\nimport { isValidLexicalData } from \"~/utils/isValidLexicalData\";\nimport { LexicalUpdateStatePlugin } from \"~/plugins/LexicalUpdateStatePlugin\";\nimport { BlurEventPlugin } from \"~/plugins/BlurEventPlugin/BlurEventPlugin\";\nimport { FontColorPlugin } from \"~/plugins/FontColorPlugin/FontColorPlugin\";\nimport { webinyEditorTheme, WebinyTheme } from \"~/themes/webinyLexicalTheme\";\nimport { WebinyNodes } from \"~/nodes/webinyNodes\";\nimport { TypographyPlugin } from \"~/plugins/TypographyPlugin/TypographyPlugin\";\nimport { QuotePlugin } from \"~/plugins/WebinyQuoteNodePlugin/WebinyQuoteNodePlugin\";\nimport { HistoryPlugin } from \"@lexical/react/LexicalHistoryPlugin\";\nimport { SharedHistoryContext, useSharedHistoryContext } from \"~/context/SharedHistoryContext\";\nimport { useRichTextEditor } from \"~/hooks/useRichTextEditor\";\nimport { ClassNames } from \"@emotion/react\";\nimport { toTypographyEmotionMap } from \"~/utils/toTypographyEmotionMap\";\n\nexport interface RichTextEditorProps {\n toolbar?: React.ReactNode;\n tag?: string;\n onChange?: (json: LexicalValue) => void;\n value: LexicalValue | null;\n focus?: boolean;\n placeholder?: string;\n nodes?: Klass<LexicalNode>[];\n /**\n * @description Lexical plugins\n */\n children?: React.ReactNode | React.ReactNode[];\n onBlur?: (editorState: LexicalValue) => void;\n height?: number | string;\n width?: number | string;\n /*\n * @description Theme to be injected into lexical editor\n */\n theme: WebinyTheme;\n themeEmotionMap?: ThemeEmotionMap;\n}\n\nconst BaseRichTextEditor: React.FC<RichTextEditorProps> = ({\n toolbar,\n onChange,\n value,\n nodes,\n placeholder,\n children,\n onBlur,\n focus,\n width,\n height,\n theme,\n themeEmotionMap\n}: RichTextEditorProps) => {\n const { historyState } = useSharedHistoryContext();\n const placeholderElem = <Placeholder>{placeholder || \"Enter text...\"}</Placeholder>;\n const scrollRef = useRef(null);\n const [floatingAnchorElem, setFloatingAnchorElem] = useState<HTMLElement | undefined>(\n undefined\n );\n const { setTheme, setThemeEmotionMap } = useRichTextEditor();\n\n useEffect(() => {\n setTheme(theme);\n setThemeEmotionMap(themeEmotionMap);\n }, [themeEmotionMap]);\n\n const onRef = (_floatingAnchorElem: HTMLDivElement) => {\n if (_floatingAnchorElem !== null) {\n setFloatingAnchorElem(_floatingAnchorElem);\n }\n };\n\n const sizeStyle = {\n height: height || \"\",\n width: width || \"\"\n };\n\n const initialConfig = {\n editorState: isValidLexicalData(value) ? value : generateInitialLexicalValue(),\n namespace: \"webiny\",\n onError: (error: Error) => {\n throw error;\n },\n nodes: [...WebinyNodes, ...(nodes || [])],\n theme: { ...webinyEditorTheme, emotionMap: themeEmotionMap }\n };\n\n function handleOnChange(editorState: EditorState, editor: LexicalEditor) {\n editorState.read(() => {\n if (typeof onChange === \"function\") {\n const editorState = editor.getEditorState();\n //TODO: send plain JSON object\n onChange(JSON.stringify(editorState.toJSON()));\n }\n });\n }\n\n return (\n <LexicalComposer initialConfig={initialConfig}>\n <div ref={scrollRef} style={{ ...sizeStyle }}>\n {/* data */}\n <OnChangePlugin onChange={handleOnChange} />\n {value && <LexicalUpdateStatePlugin value={value} />}\n <ClearEditorPlugin />\n <FontColorPlugin />\n <TypographyPlugin />\n <QuotePlugin />\n <HistoryPlugin externalHistoryState={historyState} />\n {/* Events */}\n {onBlur && <BlurEventPlugin onBlur={onBlur} />}\n {focus && <AutoFocusPlugin />}\n {/* External plugins and components */}\n {children}\n <RichTextPlugin\n contentEditable={\n <div className=\"editor-scroller\" style={{ ...sizeStyle }}>\n <div className=\"editor\" ref={onRef} style={{ ...sizeStyle }}>\n <ContentEditable style={{ outline: 0, ...sizeStyle }} />\n </div>\n </div>\n }\n placeholder={placeholderElem}\n ErrorBoundary={LexicalErrorBoundary}\n />\n {/* Toolbar */}\n {floatingAnchorElem && toolbar}\n </div>\n </LexicalComposer>\n );\n};\n\n/**\n * @description Main editor container\n */\nexport const RichTextEditor = makeComposable<RichTextEditorProps>(\"RichTextEditor\", props => {\n return (\n <RichTextEditorProvider>\n <ClassNames>\n {({ css }) => {\n const themeEmotionMap =\n props?.themeEmotionMap ?? toTypographyEmotionMap(css, props.theme);\n return (\n <SharedHistoryContext>\n <BaseRichTextEditor {...props} themeEmotionMap={themeEmotionMap} />\n </SharedHistoryContext>\n );\n }}\n </ClassNames>\n </RichTextEditorProvider>\n );\n});\n"],"mappings":";;;;;;;;;;;AAAA;AAEA;AACA;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAwBA,IAAMA,kBAAiD,GAAG,SAApDA,kBAAiD,OAa5B;EAAA,IAZvBC,OAAO,QAAPA,OAAO;IACPC,QAAQ,QAARA,QAAQ;IACRC,KAAK,QAALA,KAAK;IACLC,KAAK,QAALA,KAAK;IACLC,WAAW,QAAXA,WAAW;IACXC,QAAQ,QAARA,QAAQ;IACRC,MAAM,QAANA,MAAM;IACNC,KAAK,QAALA,KAAK;IACLC,KAAK,QAALA,KAAK;IACLC,MAAM,QAANA,MAAM;IACNC,KAAK,QAALA,KAAK;IACLC,eAAe,QAAfA,eAAe;EAEf,4BAAyB,IAAAC,6CAAuB,GAAE;IAA1CC,YAAY,yBAAZA,YAAY;EACpB,IAAMC,eAAe,gBAAG,6BAAC,wBAAW,QAAEV,WAAW,IAAI,eAAe,CAAe;EACnF,IAAMW,SAAS,GAAG,IAAAC,aAAM,EAAC,IAAI,CAAC;EAC9B,gBAAoD,IAAAC,eAAQ,EACxDC,SAAS,CACZ;IAAA;IAFMC,kBAAkB;IAAEC,qBAAqB;EAGhD,yBAAyC,IAAAC,qCAAiB,GAAE;IAApDC,QAAQ,sBAARA,QAAQ;IAAEC,kBAAkB,sBAAlBA,kBAAkB;EAEpC,IAAAC,gBAAS,EAAC,YAAM;IACZF,QAAQ,CAACZ,KAAK,CAAC;IACfa,kBAAkB,CAACZ,eAAe,CAAC;EACvC,CAAC,EAAE,CAACA,eAAe,CAAC,CAAC;EAErB,IAAMc,KAAK,GAAG,SAARA,KAAK,CAAIC,mBAAmC,EAAK;IACnD,IAAIA,mBAAmB,KAAK,IAAI,EAAE;MAC9BN,qBAAqB,CAACM,mBAAmB,CAAC;IAC9C;EACJ,CAAC;EAED,IAAMC,SAAS,GAAG;IACdlB,MAAM,EAAEA,MAAM,IAAI,EAAE;IACpBD,KAAK,EAAEA,KAAK,IAAI;EACpB,CAAC;EAED,IAAMoB,aAAa,GAAG;IAClBC,WAAW,EAAE,IAAAC,sCAAkB,EAAC5B,KAAK,CAAC,GAAGA,KAAK,GAAG,IAAA6B,wDAA2B,GAAE;IAC9EC,SAAS,EAAE,QAAQ;IACnBC,OAAO,EAAE,iBAACC,KAAY,EAAK;MACvB,MAAMA,KAAK;IACf,CAAC;IACD/B,KAAK,6CAAMgC,wBAAW,oCAAMhC,KAAK,IAAI,EAAE,EAAE;IACzCO,KAAK,8DAAO0B,qCAAiB;MAAEC,UAAU,EAAE1B;IAAe;EAC9D,CAAC;EAED,SAAS2B,cAAc,CAACT,WAAwB,EAAEU,MAAqB,EAAE;IACrEV,WAAW,CAACW,IAAI,CAAC,YAAM;MACnB,IAAI,OAAOvC,QAAQ,KAAK,UAAU,EAAE;QAChC,IAAM4B,YAAW,GAAGU,MAAM,CAACE,cAAc,EAAE;QAC3C;QACAxC,QAAQ,CAACyC,IAAI,CAACC,SAAS,CAACd,YAAW,CAACe,MAAM,EAAE,CAAC,CAAC;MAClD;IACJ,CAAC,CAAC;EACN;EAEA,oBACI,6BAAC,gCAAe;IAAC,aAAa,EAAEhB;EAAc,gBAC1C;IAAK,GAAG,EAAEb,SAAU;IAAC,KAAK,kCAAOY,SAAS;EAAG,gBAEzC,6BAAC,qCAAc;IAAC,QAAQ,EAAEW;EAAe,EAAG,EAC3CpC,KAAK,iBAAI,6BAAC,kDAAwB;IAAC,KAAK,EAAEA;EAAM,EAAG,eACpD,6BAAC,2CAAiB,OAAG,eACrB,6BAAC,gCAAe,OAAG,eACnB,6BAAC,kCAAgB,OAAG,eACpB,6BAAC,kCAAW,OAAG,eACf,6BAAC,mCAAa;IAAC,oBAAoB,EAAEW;EAAa,EAAG,EAEpDP,MAAM,iBAAI,6BAAC,gCAAe;IAAC,MAAM,EAAEA;EAAO,EAAG,EAC7CC,KAAK,iBAAI,6BAAC,uCAAe,OAAG,EAE5BF,QAAQ,eACT,6BAAC,qCAAc;IACX,eAAe,eACX;MAAK,SAAS,EAAC,iBAAiB;MAAC,KAAK,kCAAOsB,SAAS;IAAG,gBACrD;MAAK,SAAS,EAAC,QAAQ;MAAC,GAAG,EAAEF,KAAM;MAAC,KAAK,kCAAOE,SAAS;IAAG,gBACxD,6BAAC,uCAAe;MAAC,KAAK;QAAIkB,OAAO,EAAE;MAAC,GAAKlB,SAAS;IAAG,EAAG,CACtD,CAEb;IACD,WAAW,EAAEb,eAAgB;IAC7B,aAAa,EAAEgC;EAAqB,EACtC,EAED3B,kBAAkB,IAAInB,OAAO,CAC5B,CACQ;AAE1B,CAAC;;AAED;AACA;AACA;AACO,IAAM+C,cAAc,GAAG,IAAAC,gCAAc,EAAsB,gBAAgB,EAAE,UAAAC,KAAK,EAAI;EACzF,oBACI,6BAAC,6CAAsB,qBACnB,6BAAC,kBAAU,QACN,iBAAa;IAAA;IAAA,IAAVC,GAAG,SAAHA,GAAG;IACH,IAAMvC,eAAe,4BACjBsC,KAAK,aAALA,KAAK,uBAALA,KAAK,CAAEtC,eAAe,yEAAI,IAAAwC,8CAAsB,EAACD,GAAG,EAAED,KAAK,CAACvC,KAAK,CAAC;IACtE,oBACI,6BAAC,0CAAoB,qBACjB,6BAAC,kBAAkB,oBAAKuC,KAAK;MAAE,eAAe,EAAEtC;IAAgB,GAAG,CAChD;EAE/B,CAAC,CACQ,CACQ;AAEjC,CAAC,CAAC;AAAC"}
@@ -0,0 +1,11 @@
1
+ import React from "react";
2
+ import { FontColorAction } from "../ToolbarActions/FontColorAction";
3
+ import { TypographyAction } from "../ToolbarActions/TypographyAction";
4
+ import { TextAlignmentAction } from "../ToolbarActions/TextAlignmentAction";
5
+ interface LexicalEditorConfig extends React.FC<unknown> {
6
+ FontColorAction: typeof FontColorAction;
7
+ TypographyAction: typeof TypographyAction;
8
+ TextAlignmentAction: typeof TextAlignmentAction;
9
+ }
10
+ export declare const LexicalEditorConfig: LexicalEditorConfig;
11
+ export {};
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.LexicalEditorConfig = void 0;
8
+ var _react = _interopRequireDefault(require("react"));
9
+ var _FontColorAction = require("../ToolbarActions/FontColorAction");
10
+ var _TypographyAction = require("../ToolbarActions/TypographyAction");
11
+ var _TextAlignmentAction = require("../ToolbarActions/TextAlignmentAction");
12
+ var LexicalEditorConfig = function LexicalEditorConfig(_ref) {
13
+ var children = _ref.children;
14
+ return /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, children);
15
+ };
16
+ exports.LexicalEditorConfig = LexicalEditorConfig;
17
+ LexicalEditorConfig.FontColorAction = _FontColorAction.FontColorAction;
18
+ LexicalEditorConfig.TypographyAction = _TypographyAction.TypographyAction;
19
+ LexicalEditorConfig.TextAlignmentAction = _TextAlignmentAction.TextAlignmentAction;
@@ -0,0 +1 @@
1
+ {"version":3,"names":["LexicalEditorConfig","children","FontColorAction","TypographyAction","TextAlignmentAction"],"sources":["LexicalEditorConfig.tsx"],"sourcesContent":["import React from \"react\";\nimport { FontColorAction } from \"~/components/ToolbarActions/FontColorAction\";\nimport { TypographyAction } from \"~/components/ToolbarActions/TypographyAction\";\nimport { TextAlignmentAction } from \"../ToolbarActions/TextAlignmentAction\";\n\ninterface LexicalEditorConfig extends React.FC<unknown> {\n FontColorAction: typeof FontColorAction;\n TypographyAction: typeof TypographyAction;\n TextAlignmentAction: typeof TextAlignmentAction;\n}\n\nexport const LexicalEditorConfig: LexicalEditorConfig = ({ children }) => {\n return <>{children}</>;\n};\n\nLexicalEditorConfig.FontColorAction = FontColorAction;\nLexicalEditorConfig.TypographyAction = TypographyAction;\nLexicalEditorConfig.TextAlignmentAction = TextAlignmentAction;\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AAQO,IAAMA,mBAAwC,GAAG,SAA3CA,mBAAwC,OAAqB;EAAA,IAAfC,QAAQ,QAARA,QAAQ;EAC/D,oBAAO,4DAAGA,QAAQ,CAAI;AAC1B,CAAC;AAAC;AAEFD,mBAAmB,CAACE,eAAe,GAAGA,gCAAe;AACrDF,mBAAmB,CAACG,gBAAgB,GAAGA,kCAAgB;AACvDH,mBAAmB,CAACI,mBAAmB,GAAGA,wCAAmB"}
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+ import { LexicalValue, ThemeEmotionMap } from "../types";
3
+ import { Klass, LexicalNode } from "lexical";
4
+ import { WebinyTheme } from "../themes/webinyLexicalTheme";
5
+ interface LexicalHtmlRendererProps {
6
+ nodes?: Klass<LexicalNode>[];
7
+ value: LexicalValue | null;
8
+ theme: WebinyTheme;
9
+ themeEmotionMap?: ThemeEmotionMap;
10
+ }
11
+ export declare const BaseLexicalHtmlRenderer: React.FC<LexicalHtmlRendererProps>;
12
+ /**
13
+ * @description Main editor container
14
+ */
15
+ export declare const LexicalHtmlRenderer: React.FC<LexicalHtmlRendererProps>;
16
+ export {};