@webiny/lexical-editor 0.0.0-unstable.98511f29f1 → 0.0.0-unstable.9bd236cf5e

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 (347) hide show
  1. package/commands/image.d.ts +6 -0
  2. package/commands/image.js +4 -0
  3. package/commands/image.js.map +1 -0
  4. package/commands/index.d.ts +5 -0
  5. package/commands/index.js +7 -0
  6. package/commands/index.js.map +1 -0
  7. package/commands/list.d.ts +7 -0
  8. package/commands/list.js +6 -0
  9. package/commands/list.js.map +1 -0
  10. package/commands/quote.d.ts +5 -0
  11. package/commands/quote.js +4 -0
  12. package/commands/quote.js.map +1 -0
  13. package/commands/toolbar.d.ts +1 -0
  14. package/commands/toolbar.js +4 -0
  15. package/commands/toolbar.js.map +1 -0
  16. package/commands/typography.d.ts +8 -0
  17. package/commands/typography.js +4 -0
  18. package/commands/typography.js.map +1 -0
  19. package/components/Editor/EnsureHeadingTagPlugin.d.ts +6 -0
  20. package/components/Editor/EnsureHeadingTagPlugin.js +20 -0
  21. package/components/Editor/EnsureHeadingTagPlugin.js.map +1 -0
  22. package/components/Editor/HeadingEditor.d.ts +2 -2
  23. package/components/Editor/HeadingEditor.js +20 -25
  24. package/components/Editor/HeadingEditor.js.map +1 -1
  25. package/components/Editor/ParagraphEditor.d.ts +2 -2
  26. package/components/Editor/ParagraphEditor.js +20 -25
  27. package/components/Editor/ParagraphEditor.js.map +1 -1
  28. package/components/Editor/RichTextEditor.d.ts +38 -23
  29. package/components/Editor/RichTextEditor.js +113 -139
  30. package/components/Editor/RichTextEditor.js.map +1 -1
  31. package/components/Editor/normalizeInputValue.d.ts +6 -0
  32. package/components/Editor/normalizeInputValue.js +16 -0
  33. package/components/Editor/normalizeInputValue.js.map +1 -0
  34. package/components/LexicalEditorConfig/LexicalEditorConfig.d.ts +8 -8
  35. package/components/LexicalEditorConfig/LexicalEditorConfig.js +42 -52
  36. package/components/LexicalEditorConfig/LexicalEditorConfig.js.map +1 -1
  37. package/components/LexicalEditorConfig/components/Node.d.ts +2 -2
  38. package/components/LexicalEditorConfig/components/Node.js +19 -27
  39. package/components/LexicalEditorConfig/components/Node.js.map +1 -1
  40. package/components/LexicalEditorConfig/components/Plugin.d.ts +1 -1
  41. package/components/LexicalEditorConfig/components/Plugin.js +19 -27
  42. package/components/LexicalEditorConfig/components/Plugin.js.map +1 -1
  43. package/components/LexicalEditorConfig/components/ToolbarElement.d.ts +1 -1
  44. package/components/LexicalEditorConfig/components/ToolbarElement.js +19 -27
  45. package/components/LexicalEditorConfig/components/ToolbarElement.js.map +1 -1
  46. package/components/LexicalHtmlRenderer.d.ts +6 -10
  47. package/components/LexicalHtmlRenderer.js +44 -56
  48. package/components/LexicalHtmlRenderer.js.map +1 -1
  49. package/components/Toolbar/StaticToolbar.css +1 -1
  50. package/components/Toolbar/StaticToolbar.d.ts +3 -1
  51. package/components/Toolbar/StaticToolbar.js +21 -100
  52. package/components/Toolbar/StaticToolbar.js.map +1 -1
  53. package/components/Toolbar/Toolbar.css +72 -75
  54. package/components/Toolbar/Toolbar.d.ts +1 -2
  55. package/components/Toolbar/Toolbar.js +87 -142
  56. package/components/Toolbar/Toolbar.js.map +1 -1
  57. package/components/ToolbarActions/BoldAction.d.ts +2 -2
  58. package/components/ToolbarActions/BoldAction.js +20 -38
  59. package/components/ToolbarActions/BoldAction.js.map +1 -1
  60. package/components/ToolbarActions/BulletListAction.d.ts +2 -2
  61. package/components/ToolbarActions/BulletListAction.js +29 -45
  62. package/components/ToolbarActions/BulletListAction.js.map +1 -1
  63. package/components/ToolbarActions/CodeHighlightAction.d.ts +2 -2
  64. package/components/ToolbarActions/CodeHighlightAction.js +20 -38
  65. package/components/ToolbarActions/CodeHighlightAction.js.map +1 -1
  66. package/components/ToolbarActions/FontColorAction.d.ts +22 -4
  67. package/components/ToolbarActions/FontColorAction.js +40 -73
  68. package/components/ToolbarActions/FontColorAction.js.map +1 -1
  69. package/components/ToolbarActions/FontSizeAction.d.ts +14 -2
  70. package/components/ToolbarActions/FontSizeAction.js +70 -80
  71. package/components/ToolbarActions/FontSizeAction.js.map +1 -1
  72. package/components/ToolbarActions/ImageAction.d.ts +2 -2
  73. package/components/ToolbarActions/ImageAction.js +25 -41
  74. package/components/ToolbarActions/ImageAction.js.map +1 -1
  75. package/components/ToolbarActions/ItalicAction.d.ts +2 -2
  76. package/components/ToolbarActions/ItalicAction.js +20 -38
  77. package/components/ToolbarActions/ItalicAction.js.map +1 -1
  78. package/components/ToolbarActions/LinkAction.d.ts +2 -2
  79. package/components/ToolbarActions/LinkAction.js +27 -54
  80. package/components/ToolbarActions/LinkAction.js.map +1 -1
  81. package/components/ToolbarActions/NumberedListAction.d.ts +2 -2
  82. package/components/ToolbarActions/NumberedListAction.js +30 -52
  83. package/components/ToolbarActions/NumberedListAction.js.map +1 -1
  84. package/components/ToolbarActions/QuoteAction.d.ts +2 -2
  85. package/components/ToolbarActions/QuoteAction.js +25 -44
  86. package/components/ToolbarActions/QuoteAction.js.map +1 -1
  87. package/components/ToolbarActions/TextAlignmentAction.d.ts +22 -4
  88. package/components/ToolbarActions/TextAlignmentAction.js +44 -53
  89. package/components/ToolbarActions/TextAlignmentAction.js.map +1 -1
  90. package/components/ToolbarActions/TypographyAction.d.ts +22 -4
  91. package/components/ToolbarActions/TypographyAction.js +69 -106
  92. package/components/ToolbarActions/TypographyAction.js.map +1 -1
  93. package/components/ToolbarActions/UnderlineAction.d.ts +2 -2
  94. package/components/ToolbarActions/UnderlineAction.js +20 -39
  95. package/components/ToolbarActions/UnderlineAction.js.map +1 -1
  96. package/context/FontColorActionContext.js +3 -9
  97. package/context/FontColorActionContext.js.map +1 -1
  98. package/context/RichTextEditorContext.d.ts +9 -18
  99. package/context/RichTextEditorContext.js +17 -70
  100. package/context/RichTextEditorContext.js.map +1 -1
  101. package/context/SharedHistoryContext.d.ts +3 -4
  102. package/context/SharedHistoryContext.js +14 -21
  103. package/context/SharedHistoryContext.js.map +1 -1
  104. package/context/TextAlignmentActionContextProps.d.ts +1 -1
  105. package/context/TextAlignmentActionContextProps.js +3 -9
  106. package/context/TextAlignmentActionContextProps.js.map +1 -1
  107. package/context/TypographyActionContext.d.ts +3 -2
  108. package/context/TypographyActionContext.js +3 -9
  109. package/context/TypographyActionContext.js.map +1 -1
  110. package/hooks/index.d.ts +8 -0
  111. package/hooks/index.js +10 -0
  112. package/hooks/index.js.map +1 -0
  113. package/hooks/useCurrentElement.d.ts +7 -0
  114. package/hooks/useCurrentElement.js +27 -0
  115. package/hooks/useCurrentElement.js.map +1 -0
  116. package/hooks/useCurrentSelection.d.ts +13 -0
  117. package/hooks/useCurrentSelection.js +57 -0
  118. package/hooks/useCurrentSelection.js.map +1 -0
  119. package/hooks/useFontColorPicker.js +8 -12
  120. package/hooks/useFontColorPicker.js.map +1 -1
  121. package/hooks/useIsMounted.d.ts +1 -0
  122. package/hooks/useIsMounted.js +12 -0
  123. package/hooks/useIsMounted.js.map +1 -0
  124. package/hooks/useList.js +43 -32
  125. package/hooks/useList.js.map +1 -1
  126. package/hooks/useQuote.js +15 -18
  127. package/hooks/useQuote.js.map +1 -1
  128. package/hooks/useRichTextEditor.js +8 -12
  129. package/hooks/useRichTextEditor.js.map +1 -1
  130. package/hooks/useTextAlignmentAction.js +8 -12
  131. package/hooks/useTextAlignmentAction.js.map +1 -1
  132. package/hooks/useTypographyAction.js +8 -12
  133. package/hooks/useTypographyAction.js.map +1 -1
  134. package/index.d.ts +5 -10
  135. package/index.js +49 -300
  136. package/index.js.map +1 -1
  137. package/package.json +21 -23
  138. package/plugins/BlurEventPlugin/BlurEventPlugin.d.ts +2 -2
  139. package/plugins/BlurEventPlugin/BlurEventPlugin.js +18 -26
  140. package/plugins/BlurEventPlugin/BlurEventPlugin.js.map +1 -1
  141. package/plugins/CodeHighlightPlugin/CodeHighlightPlugin.js +12 -18
  142. package/plugins/CodeHighlightPlugin/CodeHighlightPlugin.js.map +1 -1
  143. package/plugins/CodeHighlightPlugin/index.js +2 -15
  144. package/plugins/CodeHighlightPlugin/index.js.map +1 -1
  145. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditor.d.ts +16 -0
  146. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditor.js +158 -0
  147. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditor.js.map +1 -0
  148. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorController.d.ts +8 -0
  149. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorController.js +62 -0
  150. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorController.js.map +1 -0
  151. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.css +60 -6
  152. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.d.ts +4 -4
  153. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.js +12 -258
  154. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.js.map +1 -1
  155. package/plugins/FloatingLinkEditorPlugin/LinkEditForm.d.ts +8 -0
  156. package/plugins/FloatingLinkEditorPlugin/LinkEditForm.js +104 -0
  157. package/plugins/FloatingLinkEditorPlugin/LinkEditForm.js.map +1 -0
  158. package/plugins/FloatingLinkEditorPlugin/LinkPreviewForm.d.ts +9 -0
  159. package/plugins/FloatingLinkEditorPlugin/LinkPreviewForm.js +34 -0
  160. package/plugins/FloatingLinkEditorPlugin/LinkPreviewForm.js.map +1 -0
  161. package/plugins/FloatingLinkEditorPlugin/index.js +2 -15
  162. package/plugins/FloatingLinkEditorPlugin/index.js.map +1 -1
  163. package/plugins/FloatingLinkEditorPlugin/isChildOfLinkEditor.d.ts +1 -0
  164. package/plugins/FloatingLinkEditorPlugin/isChildOfLinkEditor.js +12 -0
  165. package/plugins/FloatingLinkEditorPlugin/isChildOfLinkEditor.js.map +1 -0
  166. package/plugins/FontColorPlugin/FontColorPlugin.d.ts +1 -2
  167. package/plugins/FontColorPlugin/FontColorPlugin.js +21 -33
  168. package/plugins/FontColorPlugin/FontColorPlugin.js.map +1 -1
  169. package/plugins/FontColorPlugin/applyColorToNode.d.ts +3 -0
  170. package/plugins/FontColorPlugin/applyColorToNode.js +8 -0
  171. package/plugins/FontColorPlugin/applyColorToNode.js.map +1 -0
  172. package/plugins/FontColorPlugin/applyColorToSelection.d.ts +3 -0
  173. package/plugins/FontColorPlugin/applyColorToSelection.js +66 -0
  174. package/plugins/FontColorPlugin/applyColorToSelection.js.map +1 -0
  175. package/plugins/ImagesPlugin/ImagesPlugin.d.ts +2 -3
  176. package/plugins/ImagesPlugin/ImagesPlugin.js +63 -64
  177. package/plugins/ImagesPlugin/ImagesPlugin.js.map +1 -1
  178. package/plugins/LinkPlugin/LinkPlugin.d.ts +5 -0
  179. package/plugins/LinkPlugin/LinkPlugin.js +59 -0
  180. package/plugins/LinkPlugin/LinkPlugin.js.map +1 -0
  181. package/plugins/ListPLugin/ListPlugin.js +14 -22
  182. package/plugins/ListPLugin/ListPlugin.js.map +1 -1
  183. package/plugins/QuoteNodePlugin/QuoteNodePlugin.js +18 -0
  184. package/plugins/QuoteNodePlugin/QuoteNodePlugin.js.map +1 -0
  185. package/plugins/StateHandlingPlugin.d.ts +8 -0
  186. package/plugins/StateHandlingPlugin.js +75 -0
  187. package/plugins/StateHandlingPlugin.js.map +1 -0
  188. package/plugins/TypographyPlugin/TypographyPlugin.d.ts +1 -2
  189. package/plugins/TypographyPlugin/TypographyPlugin.js +19 -27
  190. package/plugins/TypographyPlugin/TypographyPlugin.js.map +1 -1
  191. package/types.d.ts +8 -67
  192. package/types.js +8 -38
  193. package/types.js.map +1 -1
  194. package/ui/ContentEditable.js +10 -15
  195. package/ui/ContentEditable.js.map +1 -1
  196. package/ui/Divider.js +6 -11
  197. package/ui/Divider.js.map +1 -1
  198. package/ui/DropDown.d.ts +2 -3
  199. package/ui/DropDown.js +64 -88
  200. package/ui/DropDown.js.map +1 -1
  201. package/ui/ImageResizer.d.ts +0 -2
  202. package/ui/ImageResizer.js +87 -89
  203. package/ui/ImageResizer.js.map +1 -1
  204. package/ui/LinkPreview.js +25 -29
  205. package/ui/LinkPreview.js.map +1 -1
  206. package/ui/Placeholder.d.ts +1 -1
  207. package/ui/Placeholder.js +13 -17
  208. package/ui/Placeholder.js.map +1 -1
  209. package/ui/TextInput.d.ts +1 -1
  210. package/ui/TextInput.js +14 -19
  211. package/ui/TextInput.js.map +1 -1
  212. package/ui/ToolbarActionDialog.d.ts +2 -3
  213. package/ui/ToolbarActionDialog.js +25 -54
  214. package/ui/ToolbarActionDialog.js.map +1 -1
  215. package/utils/canUseDOM.js +2 -7
  216. package/utils/canUseDOM.js.map +1 -1
  217. package/utils/files.d.ts +1 -2
  218. package/utils/files.js +6 -47
  219. package/utils/files.js.map +1 -1
  220. package/utils/getDOMRangeRect.d.ts +0 -2
  221. package/utils/getDOMRangeRect.js +7 -11
  222. package/utils/getDOMRangeRect.js.map +1 -1
  223. package/utils/getSelectedNode.d.ts +1 -1
  224. package/utils/getSelectedNode.js +12 -17
  225. package/utils/getSelectedNode.js.map +1 -1
  226. package/utils/getTransparentImage.js +3 -8
  227. package/utils/getTransparentImage.js.map +1 -1
  228. package/utils/insertImage.d.ts +2 -0
  229. package/utils/insertImage.js +16 -0
  230. package/utils/insertImage.js.map +1 -0
  231. package/utils/isAnchorLink.d.ts +1 -0
  232. package/utils/isAnchorLink.js +5 -0
  233. package/utils/isAnchorLink.js.map +1 -0
  234. package/utils/isChildOfFloatingToolbar.d.ts +1 -0
  235. package/utils/isChildOfFloatingToolbar.js +12 -0
  236. package/utils/isChildOfFloatingToolbar.js.map +1 -0
  237. package/utils/isHTMLElement.d.ts +0 -2
  238. package/utils/isHTMLElement.js +4 -8
  239. package/utils/isHTMLElement.js.map +1 -1
  240. package/utils/isValidJSON.js +5 -10
  241. package/utils/isValidJSON.js.map +1 -1
  242. package/utils/isValidLexicalData.d.ts +4 -2
  243. package/utils/isValidLexicalData.js +18 -18
  244. package/utils/isValidLexicalData.js.map +1 -1
  245. package/utils/point.js +38 -63
  246. package/utils/point.js.map +1 -1
  247. package/utils/rect.d.ts +2 -4
  248. package/utils/rect.js +117 -151
  249. package/utils/rect.js.map +1 -1
  250. package/utils/sanitizeUrl.d.ts +0 -7
  251. package/utils/sanitizeUrl.js +10 -12
  252. package/utils/sanitizeUrl.js.map +1 -1
  253. package/utils/setFloatingElemPosition.d.ts +1 -3
  254. package/utils/setFloatingElemPosition.js +29 -39
  255. package/utils/setFloatingElemPosition.js.map +1 -1
  256. package/commands/insertFiles.d.ts +0 -14
  257. package/commands/insertFiles.js +0 -9
  258. package/commands/insertFiles.js.map +0 -1
  259. package/commands/webiny-list.d.ts +0 -7
  260. package/commands/webiny-list.js +0 -13
  261. package/commands/webiny-list.js.map +0 -1
  262. package/commands/webiny-quote.d.ts +0 -5
  263. package/commands/webiny-quote.js +0 -9
  264. package/commands/webiny-quote.js.map +0 -1
  265. package/components/ImageComponent.d.ts +0 -23
  266. package/components/ImageComponent.js +0 -252
  267. package/components/ImageComponent.js.map +0 -1
  268. package/nodes/FontColorNode.d.ts +0 -43
  269. package/nodes/FontColorNode.js +0 -123
  270. package/nodes/FontColorNode.js.map +0 -1
  271. package/nodes/HeadingNode.d.ts +0 -34
  272. package/nodes/HeadingNode.js +0 -192
  273. package/nodes/HeadingNode.js.map +0 -1
  274. package/nodes/ImageNode.d.ts +0 -50
  275. package/nodes/ImageNode.js +0 -206
  276. package/nodes/ImageNode.js.map +0 -1
  277. package/nodes/ListItemNode.d.ts +0 -46
  278. package/nodes/ListItemNode.js +0 -437
  279. package/nodes/ListItemNode.js.map +0 -1
  280. package/nodes/ListNode/formatList.d.ts +0 -12
  281. package/nodes/ListNode/formatList.js +0 -424
  282. package/nodes/ListNode/formatList.js.map +0 -1
  283. package/nodes/ListNode.d.ts +0 -42
  284. package/nodes/ListNode.js +0 -288
  285. package/nodes/ListNode.js.map +0 -1
  286. package/nodes/ParagraphNode.d.ts +0 -32
  287. package/nodes/ParagraphNode.js +0 -218
  288. package/nodes/ParagraphNode.js.map +0 -1
  289. package/nodes/QuoteNode.d.ts +0 -34
  290. package/nodes/QuoteNode.js +0 -225
  291. package/nodes/QuoteNode.js.map +0 -1
  292. package/nodes/TypographyElementNode.d.ts +0 -42
  293. package/nodes/TypographyElementNode.js +0 -151
  294. package/nodes/TypographyElementNode.js.map +0 -1
  295. package/nodes/imageNode.css +0 -43
  296. package/nodes/types.d.ts +0 -15
  297. package/nodes/types.js +0 -5
  298. package/nodes/types.js.map +0 -1
  299. package/nodes/webinyNodes.d.ts +0 -7
  300. package/nodes/webinyNodes.js +0 -46
  301. package/nodes/webinyNodes.js.map +0 -1
  302. package/plugins/LexicalUpdateStatePlugin/LexicalUpdateStatePlugin.d.ts +0 -8
  303. package/plugins/LexicalUpdateStatePlugin/LexicalUpdateStatePlugin.js +0 -34
  304. package/plugins/LexicalUpdateStatePlugin/LexicalUpdateStatePlugin.js.map +0 -1
  305. package/plugins/LexicalUpdateStatePlugin/index.d.ts +0 -1
  306. package/plugins/LexicalUpdateStatePlugin/index.js +0 -16
  307. package/plugins/LexicalUpdateStatePlugin/index.js.map +0 -1
  308. package/plugins/WebinyQuoteNodePlugin/WebinyQuoteNodePlugin.js +0 -24
  309. package/plugins/WebinyQuoteNodePlugin/WebinyQuoteNodePlugin.js.map +0 -1
  310. package/themes/webinyLexicalTheme.css +0 -423
  311. package/themes/webinyLexicalTheme.d.ts +0 -9
  312. package/themes/webinyLexicalTheme.js +0 -90
  313. package/themes/webinyLexicalTheme.js.map +0 -1
  314. package/utils/findTypographyStyleByHtmlTag.d.ts +0 -8
  315. package/utils/findTypographyStyleByHtmlTag.js +0 -16
  316. package/utils/findTypographyStyleByHtmlTag.js.map +0 -1
  317. package/utils/generateInitialLexicalValue.d.ts +0 -5
  318. package/utils/generateInitialLexicalValue.js +0 -30
  319. package/utils/generateInitialLexicalValue.js.map +0 -1
  320. package/utils/getLexicalTextSelectionState.d.ts +0 -5
  321. package/utils/getLexicalTextSelectionState.js +0 -163
  322. package/utils/getLexicalTextSelectionState.js.map +0 -1
  323. package/utils/nodes/clearNodeFormating.d.ts +0 -2
  324. package/utils/nodes/clearNodeFormating.js +0 -28
  325. package/utils/nodes/clearNodeFormating.js.map +0 -1
  326. package/utils/nodes/formatToHeading.d.ts +0 -3
  327. package/utils/nodes/formatToHeading.js +0 -25
  328. package/utils/nodes/formatToHeading.js.map +0 -1
  329. package/utils/nodes/formatToParagraph.d.ts +0 -2
  330. package/utils/nodes/formatToParagraph.js +0 -20
  331. package/utils/nodes/formatToParagraph.js.map +0 -1
  332. package/utils/nodes/formatToQuote.d.ts +0 -2
  333. package/utils/nodes/formatToQuote.js +0 -25
  334. package/utils/nodes/formatToQuote.js.map +0 -1
  335. package/utils/nodes/insertImage.d.ts +0 -2
  336. package/utils/nodes/insertImage.js +0 -22
  337. package/utils/nodes/insertImage.js.map +0 -1
  338. package/utils/nodes/listNode.d.ts +0 -11
  339. package/utils/nodes/listNode.js +0 -107
  340. package/utils/nodes/listNode.js.map +0 -1
  341. package/utils/styleObjectToString.d.ts +0 -2
  342. package/utils/styleObjectToString.js +0 -22
  343. package/utils/styleObjectToString.js.map +0 -1
  344. package/utils/toTypographyEmotionMap.d.ts +0 -3
  345. package/utils/toTypographyEmotionMap.js +0 -41
  346. package/utils/toTypographyEmotionMap.js.map +0 -1
  347. /package/plugins/{WebinyQuoteNodePlugin/WebinyQuoteNodePlugin.d.ts → QuoteNodePlugin/QuoteNodePlugin.d.ts} +0 -0
@@ -0,0 +1,6 @@
1
+ import type { LexicalCommand, NodeKey } from "lexical";
2
+ import type { ImageNodeProps } from "@webiny/lexical-nodes";
3
+ export interface ImagePayload extends ImageNodeProps {
4
+ key?: NodeKey;
5
+ }
6
+ export declare const INSERT_IMAGE_COMMAND: LexicalCommand<ImagePayload>;
@@ -0,0 +1,4 @@
1
+ import { createCommand } from "lexical";
2
+ export const INSERT_IMAGE_COMMAND = createCommand("INSERT_IMAGE_COMMAND");
3
+
4
+ //# sourceMappingURL=image.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createCommand","INSERT_IMAGE_COMMAND"],"sources":["image.ts"],"sourcesContent":["import type { LexicalCommand, NodeKey } from \"lexical\";\nimport { createCommand } from \"lexical\";\nimport type { ImageNodeProps } from \"@webiny/lexical-nodes\";\n\nexport interface ImagePayload extends ImageNodeProps {\n key?: NodeKey;\n}\n\nexport const INSERT_IMAGE_COMMAND: LexicalCommand<ImagePayload> =\n createCommand(\"INSERT_IMAGE_COMMAND\");\n"],"mappings":"AACA,SAASA,aAAa,QAAQ,SAAS;AAOvC,OAAO,MAAMC,oBAAkD,GAC3DD,aAAa,CAAC,sBAAsB,CAAC","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ export * from "./typography";
2
+ export * from "./image";
3
+ export * from "./list";
4
+ export * from "./quote";
5
+ export * from "./toolbar";
@@ -0,0 +1,7 @@
1
+ export * from "./typography";
2
+ export * from "./image";
3
+ export * from "./list";
4
+ export * from "./quote";
5
+ export * from "./toolbar";
6
+
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sources":["index.ts"],"sourcesContent":["export * from \"~/commands/typography\";\nexport * from \"~/commands/image\";\nexport * from \"~/commands/list\";\nexport * from \"~/commands/quote\";\nexport * from \"~/commands/toolbar\";\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA","ignoreList":[]}
@@ -0,0 +1,7 @@
1
+ import type { LexicalCommand } from "lexical";
2
+ export type ListCommandPayload = {
3
+ themeStyleId?: string;
4
+ };
5
+ export declare const INSERT_UNORDERED_LIST_COMMAND: LexicalCommand<ListCommandPayload>;
6
+ export declare const INSERT_ORDERED_LIST_COMMAND: LexicalCommand<ListCommandPayload>;
7
+ export declare const REMOVE_LIST_COMMAND: LexicalCommand<void>;
@@ -0,0 +1,6 @@
1
+ import { createCommand } from "lexical";
2
+ export const INSERT_UNORDERED_LIST_COMMAND = createCommand("INSERT_UNORDERED_LIST_COMMAND");
3
+ export const INSERT_ORDERED_LIST_COMMAND = createCommand("INSERT_ORDERED_LIST_COMMAND");
4
+ export const REMOVE_LIST_COMMAND = createCommand("REMOVE_LIST_COMMAND");
5
+
6
+ //# sourceMappingURL=list.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createCommand","INSERT_UNORDERED_LIST_COMMAND","INSERT_ORDERED_LIST_COMMAND","REMOVE_LIST_COMMAND"],"sources":["list.ts"],"sourcesContent":["import type { LexicalCommand } from \"lexical\";\nimport { createCommand } from \"lexical\";\n\nexport type ListCommandPayload = {\n themeStyleId?: string;\n};\n\nexport const INSERT_UNORDERED_LIST_COMMAND: LexicalCommand<ListCommandPayload> = createCommand(\n \"INSERT_UNORDERED_LIST_COMMAND\"\n);\n\nexport const INSERT_ORDERED_LIST_COMMAND: LexicalCommand<ListCommandPayload> = createCommand(\n \"INSERT_ORDERED_LIST_COMMAND\"\n);\n\nexport const REMOVE_LIST_COMMAND: LexicalCommand<void> = createCommand(\"REMOVE_LIST_COMMAND\");\n"],"mappings":"AACA,SAASA,aAAa,QAAQ,SAAS;AAMvC,OAAO,MAAMC,6BAAiE,GAAGD,aAAa,CAC1F,+BACJ,CAAC;AAED,OAAO,MAAME,2BAA+D,GAAGF,aAAa,CACxF,6BACJ,CAAC;AAED,OAAO,MAAMG,mBAAyC,GAAGH,aAAa,CAAC,qBAAqB,CAAC","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ import type { LexicalCommand } from "lexical";
2
+ export type QuoteCommandPayload = {
3
+ themeStyleId: string;
4
+ };
5
+ export declare const INSERT_QUOTE_COMMAND: LexicalCommand<QuoteCommandPayload>;
@@ -0,0 +1,4 @@
1
+ import { createCommand } from "lexical";
2
+ export const INSERT_QUOTE_COMMAND = createCommand("INSERT_QUOTE_COMMAND");
3
+
4
+ //# sourceMappingURL=quote.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createCommand","INSERT_QUOTE_COMMAND"],"sources":["quote.ts"],"sourcesContent":["import type { LexicalCommand } from \"lexical\";\nimport { createCommand } from \"lexical\";\n\nexport type QuoteCommandPayload = {\n themeStyleId: string;\n};\n\nexport const INSERT_QUOTE_COMMAND: LexicalCommand<QuoteCommandPayload> =\n createCommand(\"INSERT_QUOTE_COMMAND\");\n"],"mappings":"AACA,SAASA,aAAa,QAAQ,SAAS;AAMvC,OAAO,MAAMC,oBAAyD,GAClED,aAAa,CAAC,sBAAsB,CAAC","ignoreList":[]}
@@ -0,0 +1 @@
1
+ export declare const HIDE_FLOATING_TOOLBAR: import("lexical").LexicalCommand<unknown>;
@@ -0,0 +1,4 @@
1
+ import { createCommand } from "lexical";
2
+ export const HIDE_FLOATING_TOOLBAR = createCommand("HIDE_FLOATING_TOOLBAR_COMMAND");
3
+
4
+ //# sourceMappingURL=toolbar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createCommand","HIDE_FLOATING_TOOLBAR"],"sources":["toolbar.ts"],"sourcesContent":["import { createCommand } from \"lexical\";\n\nexport const HIDE_FLOATING_TOOLBAR = createCommand(\"HIDE_FLOATING_TOOLBAR_COMMAND\");\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,SAAS;AAEvC,OAAO,MAAMC,qBAAqB,GAAGD,aAAa,CAAC,+BAA+B,CAAC","ignoreList":[]}
@@ -0,0 +1,8 @@
1
+ import type { LexicalCommand, LexicalEditor, NodeKey } from "lexical";
2
+ import type { TypographyValue } from "@webiny/lexical-theme";
3
+ export declare const ADD_TYPOGRAPHY_COMMAND: LexicalCommand<TypographyPayload>;
4
+ export interface TypographyPayload {
5
+ value: TypographyValue;
6
+ caption?: LexicalEditor;
7
+ key?: NodeKey;
8
+ }
@@ -0,0 +1,4 @@
1
+ import { createCommand } from "lexical";
2
+ export const ADD_TYPOGRAPHY_COMMAND = createCommand("ADD_TYPOGRAPHY_COMMAND");
3
+
4
+ //# sourceMappingURL=typography.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["createCommand","ADD_TYPOGRAPHY_COMMAND"],"sources":["typography.ts"],"sourcesContent":["import type { LexicalCommand, LexicalEditor, NodeKey } from \"lexical\";\nimport { createCommand } from \"lexical\";\nimport type { TypographyValue } from \"@webiny/lexical-theme\";\n\nexport const ADD_TYPOGRAPHY_COMMAND: LexicalCommand<TypographyPayload> =\n createCommand(\"ADD_TYPOGRAPHY_COMMAND\");\n\nexport interface TypographyPayload {\n value: TypographyValue;\n caption?: LexicalEditor;\n key?: NodeKey;\n}\n"],"mappings":"AACA,SAASA,aAAa,QAAQ,SAAS;AAGvC,OAAO,MAAMC,sBAAyD,GAClED,aAAa,CAAC,wBAAwB,CAAC","ignoreList":[]}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * In the "Heading" editor, we only want to support heading tags.
3
+ * However, when the editor is empty, and you start typing, Lexical automatically creates an empty "paragraph" node.
4
+ * This ensures that any paragraph node is automatically converted to a heading node.
5
+ */
6
+ export declare const EnsureHeadingTagPlugin: () => null;
@@ -0,0 +1,20 @@
1
+ import { useEffect } from "react";
2
+ import { ParagraphNode, $createHeadingNode } from "@webiny/lexical-nodes";
3
+ import { useRichTextEditor } from "../../hooks";
4
+
5
+ /**
6
+ * In the "Heading" editor, we only want to support heading tags.
7
+ * However, when the editor is empty, and you start typing, Lexical automatically creates an empty "paragraph" node.
8
+ * This ensures that any paragraph node is automatically converted to a heading node.
9
+ */
10
+ export const EnsureHeadingTagPlugin = () => {
11
+ const {
12
+ editor
13
+ } = useRichTextEditor();
14
+ useEffect(() => editor.registerNodeTransform(ParagraphNode, node => {
15
+ node.replace($createHeadingNode("h1"), true);
16
+ }), []);
17
+ return null;
18
+ };
19
+
20
+ //# sourceMappingURL=EnsureHeadingTagPlugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["useEffect","ParagraphNode","$createHeadingNode","useRichTextEditor","EnsureHeadingTagPlugin","editor","registerNodeTransform","node","replace"],"sources":["EnsureHeadingTagPlugin.tsx"],"sourcesContent":["import { useEffect } from \"react\";\nimport { ParagraphNode, $createHeadingNode } from \"@webiny/lexical-nodes\";\nimport { useRichTextEditor } from \"~/hooks\";\n\n/**\n * In the \"Heading\" editor, we only want to support heading tags.\n * However, when the editor is empty, and you start typing, Lexical automatically creates an empty \"paragraph\" node.\n * This ensures that any paragraph node is automatically converted to a heading node.\n */\nexport const EnsureHeadingTagPlugin = () => {\n const { editor } = useRichTextEditor();\n\n useEffect(\n () =>\n editor.registerNodeTransform(ParagraphNode, node => {\n node.replace($createHeadingNode(\"h1\"), true);\n }),\n []\n );\n return null;\n};\n"],"mappings":"AAAA,SAASA,SAAS,QAAQ,OAAO;AACjC,SAASC,aAAa,EAAEC,kBAAkB,QAAQ,uBAAuB;AACzE,SAASC,iBAAiB;;AAE1B;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,sBAAsB,GAAGA,CAAA,KAAM;EACxC,MAAM;IAAEC;EAAO,CAAC,GAAGF,iBAAiB,CAAC,CAAC;EAEtCH,SAAS,CACL,MACIK,MAAM,CAACC,qBAAqB,CAACL,aAAa,EAAEM,IAAI,IAAI;IAChDA,IAAI,CAACC,OAAO,CAACN,kBAAkB,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;EAChD,CAAC,CAAC,EACN,EACJ,CAAC;EACD,OAAO,IAAI;AACf,CAAC","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
- import { RichTextEditorProps } from "./RichTextEditor";
2
+ import type { RichTextEditorProps } from "./RichTextEditor";
3
3
  interface HeadingEditorProps extends RichTextEditorProps {
4
4
  tag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
5
5
  }
6
- export declare const HeadingEditor: React.FC<HeadingEditorProps>;
6
+ export declare const HeadingEditor: ({ tag, placeholder, ...rest }: HeadingEditorProps) => React.JSX.Element;
7
7
  export {};
@@ -1,27 +1,22 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.HeadingEditor = void 0;
8
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
9
- var _react = _interopRequireDefault(require("react"));
10
- var _RichTextEditor = require("./RichTextEditor");
11
- var _Toolbar = require("../Toolbar/Toolbar");
12
- var _excluded = ["tag", "placeholder"];
13
- var HeadingEditor = function HeadingEditor(_ref) {
14
- var tag = _ref.tag,
15
- placeholder = _ref.placeholder,
16
- rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
17
- return /*#__PURE__*/_react.default.createElement(_RichTextEditor.RichTextEditor, Object.assign({
18
- toolbar: /*#__PURE__*/_react.default.createElement(_Toolbar.Toolbar, null),
19
- tag: tag !== null && tag !== void 0 ? tag : "h1",
20
- placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : "Enter your heading text here..."
1
+ import React from "react";
2
+ import { RichTextEditor } from "./RichTextEditor";
3
+ import { Toolbar } from "../Toolbar/Toolbar";
4
+ import { EnsureHeadingTagPlugin } from "./EnsureHeadingTagPlugin";
5
+ const styles = {
6
+ padding: 5
7
+ };
8
+ export const HeadingEditor = ({
9
+ tag,
10
+ placeholder,
11
+ ...rest
12
+ }) => {
13
+ return /*#__PURE__*/React.createElement(RichTextEditor, Object.assign({
14
+ toolbar: /*#__PURE__*/React.createElement(Toolbar, null),
15
+ tag: tag ?? "h1",
16
+ placeholder: placeholder ?? "Enter your heading text here..."
21
17
  }, rest, {
22
- styles: {
23
- padding: 5
24
- }
25
- }), rest === null || rest === void 0 ? void 0 : rest.children);
18
+ styles: styles
19
+ }), /*#__PURE__*/React.createElement(EnsureHeadingTagPlugin, null), rest?.children);
26
20
  };
27
- exports.HeadingEditor = HeadingEditor;
21
+
22
+ //# sourceMappingURL=HeadingEditor.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","_RichTextEditor","_Toolbar","_excluded","HeadingEditor","_ref","tag","placeholder","rest","_objectWithoutProperties2","default","createElement","RichTextEditor","Object","assign","toolbar","Toolbar","styles","padding","children","exports"],"sources":["HeadingEditor.tsx"],"sourcesContent":["import React from \"react\";\nimport { RichTextEditor, RichTextEditorProps } from \"~/components/Editor/RichTextEditor\";\nimport { Toolbar } from \"~/components/Toolbar/Toolbar\";\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={<Toolbar />}\n tag={tag ?? \"h1\"}\n placeholder={placeholder ?? \"Enter your heading text here...\"}\n {...rest}\n styles={{ padding: 5 }}\n >\n {rest?.children}\n </RichTextEditor>\n );\n};\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAAuD,IAAAG,SAAA;AAMhD,IAAMC,aAA2C,GAAG,SAA9CA,aAA2CA,CAAAC,IAAA,EAAsC;EAAA,IAAhCC,GAAG,GAAAD,IAAA,CAAHC,GAAG;IAAEC,WAAW,GAAAF,IAAA,CAAXE,WAAW;IAAKC,IAAI,OAAAC,yBAAA,CAAAC,OAAA,EAAAL,IAAA,EAAAF,SAAA;EACnF,oBACIL,MAAA,CAAAY,OAAA,CAAAC,aAAA,CAACV,eAAA,CAAAW,cAAc,EAAAC,MAAA,CAAAC,MAAA;IACXC,OAAO,eAAEjB,MAAA,CAAAY,OAAA,CAAAC,aAAA,CAACT,QAAA,CAAAc,OAAO,MAAE,CAAE;IACrBV,GAAG,EAAEA,GAAG,aAAHA,GAAG,cAAHA,GAAG,GAAI,IAAK;IACjBC,WAAW,EAAEA,WAAW,aAAXA,WAAW,cAAXA,WAAW,GAAI;EAAkC,GAC1DC,IAAI;IACRS,MAAM,EAAE;MAAEC,OAAO,EAAE;IAAE;EAAE,IAEtBV,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEW,QACK,CAAC;AAEzB,CAAC;AAACC,OAAA,CAAAhB,aAAA,GAAAA,aAAA"}
1
+ {"version":3,"names":["React","RichTextEditor","Toolbar","EnsureHeadingTagPlugin","styles","padding","HeadingEditor","tag","placeholder","rest","createElement","Object","assign","toolbar","children"],"sources":["HeadingEditor.tsx"],"sourcesContent":["import React from \"react\";\nimport type { RichTextEditorProps } from \"~/components/Editor/RichTextEditor\";\nimport { RichTextEditor } from \"~/components/Editor/RichTextEditor\";\nimport { Toolbar } from \"~/components/Toolbar/Toolbar\";\nimport { EnsureHeadingTagPlugin } from \"~/components/Editor/EnsureHeadingTagPlugin\";\n\ninterface HeadingEditorProps extends RichTextEditorProps {\n tag?: \"h1\" | \"h2\" | \"h3\" | \"h4\" | \"h5\" | \"h6\";\n}\n\nconst styles = { padding: 5 };\n\nexport const HeadingEditor = ({ tag, placeholder, ...rest }: HeadingEditorProps) => {\n return (\n <RichTextEditor\n toolbar={<Toolbar />}\n tag={tag ?? \"h1\"}\n placeholder={placeholder ?? \"Enter your heading text here...\"}\n {...rest}\n styles={styles}\n >\n <EnsureHeadingTagPlugin />\n {rest?.children}\n </RichTextEditor>\n );\n};\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,cAAc;AACvB,SAASC,OAAO;AAChB,SAASC,sBAAsB;AAM/B,MAAMC,MAAM,GAAG;EAAEC,OAAO,EAAE;AAAE,CAAC;AAE7B,OAAO,MAAMC,aAAa,GAAGA,CAAC;EAAEC,GAAG;EAAEC,WAAW;EAAE,GAAGC;AAAyB,CAAC,KAAK;EAChF,oBACIT,KAAA,CAAAU,aAAA,CAACT,cAAc,EAAAU,MAAA,CAAAC,MAAA;IACXC,OAAO,eAAEb,KAAA,CAAAU,aAAA,CAACR,OAAO,MAAE,CAAE;IACrBK,GAAG,EAAEA,GAAG,IAAI,IAAK;IACjBC,WAAW,EAAEA,WAAW,IAAI;EAAkC,GAC1DC,IAAI;IACRL,MAAM,EAAEA;EAAO,iBAEfJ,KAAA,CAAAU,aAAA,CAACP,sBAAsB,MAAE,CAAC,EACzBM,IAAI,EAAEK,QACK,CAAC;AAEzB,CAAC","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
- import { RichTextEditorProps } from "./RichTextEditor";
2
+ import type { RichTextEditorProps } from "./RichTextEditor";
3
3
  interface ParagraphLexicalEditorProps extends RichTextEditorProps {
4
4
  tag?: "p";
5
5
  }
6
- declare const ParagraphEditor: React.FC<ParagraphLexicalEditorProps>;
6
+ declare const ParagraphEditor: ({ placeholder, tag, ...rest }: ParagraphLexicalEditorProps) => React.JSX.Element;
7
7
  export { ParagraphEditor };
@@ -1,27 +1,22 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.ParagraphEditor = void 0;
8
- var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
9
- var _react = _interopRequireDefault(require("react"));
10
- var _RichTextEditor = require("./RichTextEditor");
11
- var _Toolbar = require("../Toolbar/Toolbar");
12
- var _excluded = ["placeholder", "tag"];
13
- var ParagraphEditor = function ParagraphEditor(_ref) {
14
- var placeholder = _ref.placeholder,
15
- tag = _ref.tag,
16
- rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
17
- return /*#__PURE__*/_react.default.createElement(_RichTextEditor.RichTextEditor, Object.assign({
18
- toolbar: /*#__PURE__*/_react.default.createElement(_Toolbar.Toolbar, null),
19
- tag: tag !== null && tag !== void 0 ? tag : "p",
20
- placeholder: placeholder !== null && placeholder !== void 0 ? placeholder : "Enter your text here..."
1
+ import React from "react";
2
+ import { RichTextEditor } from "./RichTextEditor";
3
+ import { Toolbar } from "../Toolbar/Toolbar";
4
+ const styles = {
5
+ padding: 5
6
+ };
7
+ const ParagraphEditor = ({
8
+ placeholder,
9
+ tag,
10
+ ...rest
11
+ }) => {
12
+ return /*#__PURE__*/React.createElement(RichTextEditor, Object.assign({
13
+ toolbar: /*#__PURE__*/React.createElement(Toolbar, null),
14
+ tag: tag ?? "p",
15
+ placeholder: placeholder ?? "Enter your text here..."
21
16
  }, rest, {
22
- styles: {
23
- padding: 5
24
- }
25
- }), rest === null || rest === void 0 ? void 0 : rest.children);
17
+ styles: styles
18
+ }), rest?.children);
26
19
  };
27
- exports.ParagraphEditor = ParagraphEditor;
20
+ export { ParagraphEditor };
21
+
22
+ //# sourceMappingURL=ParagraphEditor.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","_interopRequireDefault","require","_RichTextEditor","_Toolbar","_excluded","ParagraphEditor","_ref","placeholder","tag","rest","_objectWithoutProperties2","default","createElement","RichTextEditor","Object","assign","toolbar","Toolbar","styles","padding","children","exports"],"sources":["ParagraphEditor.tsx"],"sourcesContent":["import React from \"react\";\nimport { RichTextEditor, RichTextEditorProps } from \"~/components/Editor/RichTextEditor\";\nimport { Toolbar } from \"~/components/Toolbar/Toolbar\";\n\ninterface ParagraphLexicalEditorProps extends RichTextEditorProps {\n tag?: \"p\";\n}\n\nconst ParagraphEditor: React.FC<ParagraphLexicalEditorProps> = ({ placeholder, tag, ...rest }) => {\n return (\n <RichTextEditor\n toolbar={<Toolbar />}\n tag={tag ?? \"p\"}\n placeholder={placeholder ?? \"Enter your text here...\"}\n {...rest}\n styles={{ padding: 5 }}\n >\n {rest?.children}\n </RichTextEditor>\n );\n};\n\nexport { ParagraphEditor };\n"],"mappings":";;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,eAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAAuD,IAAAG,SAAA;AAMvD,IAAMC,eAAsD,GAAG,SAAzDA,eAAsDA,CAAAC,IAAA,EAAsC;EAAA,IAAhCC,WAAW,GAAAD,IAAA,CAAXC,WAAW;IAAEC,GAAG,GAAAF,IAAA,CAAHE,GAAG;IAAKC,IAAI,OAAAC,yBAAA,CAAAC,OAAA,EAAAL,IAAA,EAAAF,SAAA;EACvF,oBACIL,MAAA,CAAAY,OAAA,CAAAC,aAAA,CAACV,eAAA,CAAAW,cAAc,EAAAC,MAAA,CAAAC,MAAA;IACXC,OAAO,eAAEjB,MAAA,CAAAY,OAAA,CAAAC,aAAA,CAACT,QAAA,CAAAc,OAAO,MAAE,CAAE;IACrBT,GAAG,EAAEA,GAAG,aAAHA,GAAG,cAAHA,GAAG,GAAI,GAAI;IAChBD,WAAW,EAAEA,WAAW,aAAXA,WAAW,cAAXA,WAAW,GAAI;EAA0B,GAClDE,IAAI;IACRS,MAAM,EAAE;MAAEC,OAAO,EAAE;IAAE;EAAE,IAEtBV,IAAI,aAAJA,IAAI,uBAAJA,IAAI,CAAEW,QACK,CAAC;AAEzB,CAAC;AAACC,OAAA,CAAAhB,eAAA,GAAAA,eAAA"}
1
+ {"version":3,"names":["React","RichTextEditor","Toolbar","styles","padding","ParagraphEditor","placeholder","tag","rest","createElement","Object","assign","toolbar","children"],"sources":["ParagraphEditor.tsx"],"sourcesContent":["import React from \"react\";\nimport type { RichTextEditorProps } from \"~/components/Editor/RichTextEditor\";\nimport { RichTextEditor } from \"~/components/Editor/RichTextEditor\";\nimport { Toolbar } from \"~/components/Toolbar/Toolbar\";\n\ninterface ParagraphLexicalEditorProps extends RichTextEditorProps {\n tag?: \"p\";\n}\n\nconst styles = { padding: 5 };\n\nconst ParagraphEditor = ({ placeholder, tag, ...rest }: ParagraphLexicalEditorProps) => {\n return (\n <RichTextEditor\n toolbar={<Toolbar />}\n tag={tag ?? \"p\"}\n placeholder={placeholder ?? \"Enter your text here...\"}\n {...rest}\n styles={styles}\n >\n {rest?.children}\n </RichTextEditor>\n );\n};\n\nexport { ParagraphEditor };\n"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAEzB,SAASC,cAAc;AACvB,SAASC,OAAO;AAMhB,MAAMC,MAAM,GAAG;EAAEC,OAAO,EAAE;AAAE,CAAC;AAE7B,MAAMC,eAAe,GAAGA,CAAC;EAAEC,WAAW;EAAEC,GAAG;EAAE,GAAGC;AAAkC,CAAC,KAAK;EACpF,oBACIR,KAAA,CAAAS,aAAA,CAACR,cAAc,EAAAS,MAAA,CAAAC,MAAA;IACXC,OAAO,eAAEZ,KAAA,CAAAS,aAAA,CAACP,OAAO,MAAE,CAAE;IACrBK,GAAG,EAAEA,GAAG,IAAI,GAAI;IAChBD,WAAW,EAAEA,WAAW,IAAI;EAA0B,GAClDE,IAAI;IACRL,MAAM,EAAEA;EAAO,IAEdK,IAAI,EAAEK,QACK,CAAC;AAEzB,CAAC;AAED,SAASR,eAAe","ignoreList":[]}
@@ -1,34 +1,49 @@
1
1
  import React from "react";
2
- import { LexicalValue, ThemeEmotionMap, ToolbarActionPlugin } from "../../types";
3
- import { Klass, LexicalNode } from "lexical";
4
- import { WebinyTheme } from "../../themes/webinyLexicalTheme";
5
- import { CSSObject } from "@emotion/react";
2
+ import type { CSSObject } from "@emotion/react";
3
+ import type { Klass, LexicalNode } from "lexical";
4
+ import type { EditorTheme, ThemeEmotionMap } from "@webiny/lexical-theme";
5
+ import type { LexicalValue, ToolbarActionPlugin } from "../../types";
6
6
  export interface RichTextEditorProps {
7
- toolbar?: React.ReactNode;
8
- staticToolbar?: React.ReactNode;
9
- toolbarActionPlugins?: ToolbarActionPlugin[];
10
- tag?: string;
11
- onChange?: (json: LexicalValue) => void;
12
- value: LexicalValue | null;
7
+ children?: React.ReactNode | React.ReactNode[];
8
+ classes?: string;
9
+ contentEditableStyles?: React.CSSProperties;
13
10
  focus?: boolean;
14
- placeholder?: string;
11
+ height?: number | string;
15
12
  nodes?: Klass<LexicalNode>[];
16
- /**
17
- * @description Lexical plugins
18
- */
19
- children?: React.ReactNode | React.ReactNode[];
20
13
  onBlur?: (editorState: LexicalValue) => void;
21
- height?: number | string;
22
- width?: number | string;
23
- theme: WebinyTheme;
24
- themeStylesTransformer?: (cssObject: Record<string, any>) => CSSObject;
25
- themeEmotionMap?: ThemeEmotionMap;
14
+ onChange?: (json: LexicalValue) => void;
15
+ placeholder?: string;
26
16
  placeholderStyles?: React.CSSProperties;
17
+ staticToolbar?: React.ReactNode;
27
18
  styles?: React.CSSProperties;
28
- contentEditableStyles?: React.CSSProperties;
29
- classes?: string;
19
+ tag?: string;
20
+ theme: EditorTheme;
21
+ themeEmotionMap?: ThemeEmotionMap;
22
+ toolbarActionPlugins?: ToolbarActionPlugin[];
23
+ themeStylesTransformer?: (cssObject: Record<string, any>) => CSSObject;
24
+ toolbar?: React.ReactNode;
25
+ value: LexicalValue | null | undefined;
26
+ width?: number | string;
30
27
  }
31
28
  /**
32
29
  * @description Main editor container
33
30
  */
34
- export declare const RichTextEditor: import("@webiny/react-composition").ComposableFC<RichTextEditorProps>;
31
+ export declare const RichTextEditor: ((props: RichTextEditorProps) => React.JSX.Element) & {
32
+ original: (props: RichTextEditorProps) => React.JSX.Element;
33
+ originalName: string;
34
+ displayName: string;
35
+ } & {
36
+ original: ((props: RichTextEditorProps) => React.JSX.Element) & {
37
+ original: (props: RichTextEditorProps) => React.JSX.Element;
38
+ originalName: string;
39
+ displayName: string;
40
+ };
41
+ originalName: string;
42
+ displayName: string;
43
+ } & {
44
+ createDecorator: (decorator: import("@webiny/react-composition").ComponentDecorator<((props: RichTextEditorProps) => React.JSX.Element) & {
45
+ original: (props: RichTextEditorProps) => React.JSX.Element;
46
+ originalName: string;
47
+ displayName: string;
48
+ }>) => (props: unknown) => React.JSX.Element;
49
+ };