@webiny/lexical-editor 5.44.1-beta.0 → 5.45.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (252) hide show
  1. package/README.md +6 -12
  2. package/commands/image.d.ts +2 -2
  3. package/commands/image.js +2 -8
  4. package/commands/image.js.map +1 -1
  5. package/commands/index.d.ts +5 -4
  6. package/commands/index.js +5 -49
  7. package/commands/index.js.map +1 -1
  8. package/commands/list.d.ts +1 -1
  9. package/commands/list.js +4 -10
  10. package/commands/list.js.map +1 -1
  11. package/commands/quote.d.ts +1 -1
  12. package/commands/quote.js +2 -8
  13. package/commands/quote.js.map +1 -1
  14. package/commands/toolbar.js +2 -8
  15. package/commands/toolbar.js.map +1 -1
  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.js +10 -16
  20. package/components/Editor/EnsureHeadingTagPlugin.js.map +1 -1
  21. package/components/Editor/RichTextEditor.d.ts +12 -8
  22. package/components/Editor/RichTextEditor.js +89 -102
  23. package/components/Editor/RichTextEditor.js.map +1 -1
  24. package/components/Editor/normalizeInputValue.d.ts +1 -1
  25. package/components/Editor/normalizeInputValue.js +2 -8
  26. package/components/Editor/normalizeInputValue.js.map +1 -1
  27. package/components/LexicalEditorConfig/LexicalEditorConfig.d.ts +14 -16
  28. package/components/LexicalEditorConfig/LexicalEditorConfig.js +21 -69
  29. package/components/LexicalEditorConfig/LexicalEditorConfig.js.map +1 -1
  30. package/components/LexicalEditorConfig/components/Node.d.ts +1 -1
  31. package/components/LexicalEditorConfig/components/Node.js +17 -26
  32. package/components/LexicalEditorConfig/components/Node.js.map +1 -1
  33. package/components/LexicalEditorConfig/components/Plugin.js +17 -26
  34. package/components/LexicalEditorConfig/components/Plugin.js.map +1 -1
  35. package/components/LexicalEditorConfig/components/ToolbarElement.js +17 -26
  36. package/components/LexicalEditorConfig/components/ToolbarElement.js.map +1 -1
  37. package/components/LexicalHtmlRenderer.d.ts +4 -7
  38. package/components/LexicalHtmlRenderer.js +35 -53
  39. package/components/LexicalHtmlRenderer.js.map +1 -1
  40. package/components/Toolbar/StaticToolbar.css +416 -0
  41. package/components/Toolbar/StaticToolbar.d.ts +3 -1
  42. package/components/Toolbar/StaticToolbar.js +19 -23
  43. package/components/Toolbar/StaticToolbar.js.map +1 -1
  44. package/components/ToolbarActions/BoldAction.js +16 -21
  45. package/components/ToolbarActions/BoldAction.js.map +1 -1
  46. package/components/ToolbarActions/BulletListAction.js +25 -31
  47. package/components/ToolbarActions/BulletListAction.js.map +1 -1
  48. package/components/ToolbarActions/CodeHighlightAction.js +16 -21
  49. package/components/ToolbarActions/CodeHighlightAction.js.map +1 -1
  50. package/components/ToolbarActions/FontColorAction.js +32 -42
  51. package/components/ToolbarActions/FontColorAction.js.map +1 -1
  52. package/components/ToolbarActions/ImageAction.js +19 -34
  53. package/components/ToolbarActions/ImageAction.js.map +1 -1
  54. package/components/ToolbarActions/ItalicAction.js +16 -21
  55. package/components/ToolbarActions/ItalicAction.js.map +1 -1
  56. package/components/ToolbarActions/LinkAction.js +19 -24
  57. package/components/ToolbarActions/LinkAction.js.map +1 -1
  58. package/components/ToolbarActions/NumberedListAction.js +25 -36
  59. package/components/ToolbarActions/NumberedListAction.js.map +1 -1
  60. package/components/ToolbarActions/QuoteAction.js +20 -25
  61. package/components/ToolbarActions/QuoteAction.js.map +1 -1
  62. package/components/ToolbarActions/TextAlignmentAction.js +36 -45
  63. package/components/ToolbarActions/TextAlignmentAction.js.map +1 -1
  64. package/components/ToolbarActions/TypographyAction.js +57 -79
  65. package/components/ToolbarActions/TypographyAction.js.map +1 -1
  66. package/components/ToolbarActions/UnderlineAction.js +16 -21
  67. package/components/ToolbarActions/UnderlineAction.js.map +1 -1
  68. package/context/FontColorActionContext.js +2 -9
  69. package/context/FontColorActionContext.js.map +1 -1
  70. package/context/RichTextEditorContext.d.ts +6 -7
  71. package/context/RichTextEditorContext.js +28 -26
  72. package/context/RichTextEditorContext.js.map +1 -1
  73. package/context/SharedHistoryContext.d.ts +2 -2
  74. package/context/SharedHistoryContext.js +12 -20
  75. package/context/SharedHistoryContext.js.map +1 -1
  76. package/context/TextAlignmentActionContextProps.d.ts +1 -1
  77. package/context/TextAlignmentActionContextProps.js +2 -9
  78. package/context/TextAlignmentActionContextProps.js.map +1 -1
  79. package/context/TypographyActionContext.d.ts +3 -2
  80. package/context/TypographyActionContext.js +2 -9
  81. package/context/TypographyActionContext.js.map +1 -1
  82. package/exports/admin/lexical.d.ts +15 -0
  83. package/exports/admin/lexical.js +23 -0
  84. package/exports/admin/lexical.js.map +1 -0
  85. package/hooks/index.d.ts +7 -8
  86. package/hooks/index.js +7 -93
  87. package/hooks/index.js.map +1 -1
  88. package/hooks/useCurrentElement.d.ts +3 -3
  89. package/hooks/useCurrentElement.js +11 -18
  90. package/hooks/useCurrentElement.js.map +1 -1
  91. package/hooks/useCurrentSelection.d.ts +2 -1
  92. package/hooks/useCurrentSelection.js +27 -40
  93. package/hooks/useCurrentSelection.js.map +1 -1
  94. package/hooks/useFontColorPicker.d.ts +1 -1
  95. package/hooks/useFontColorPicker.js +5 -11
  96. package/hooks/useFontColorPicker.js.map +1 -1
  97. package/hooks/useIsMounted.js +6 -14
  98. package/hooks/useIsMounted.js.map +1 -1
  99. package/hooks/useRichTextEditor.d.ts +1 -1
  100. package/hooks/useRichTextEditor.js +5 -11
  101. package/hooks/useRichTextEditor.js.map +1 -1
  102. package/hooks/useTextAlignmentAction.d.ts +1 -1
  103. package/hooks/useTextAlignmentAction.js +5 -11
  104. package/hooks/useTextAlignmentAction.js.map +1 -1
  105. package/hooks/useTypographyAction.d.ts +1 -1
  106. package/hooks/useTypographyAction.js +5 -11
  107. package/hooks/useTypographyAction.js.map +1 -1
  108. package/index.d.ts +33 -38
  109. package/index.js +44 -322
  110. package/index.js.map +1 -1
  111. package/package.json +18 -22
  112. package/plugins/BlurEventPlugin/BlurEventPlugin.d.ts +2 -2
  113. package/plugins/BlurEventPlugin/BlurEventPlugin.js +16 -22
  114. package/plugins/BlurEventPlugin/BlurEventPlugin.js.map +1 -1
  115. package/plugins/CodeHighlightPlugin/CodeHighlightPlugin.js +9 -14
  116. package/plugins/CodeHighlightPlugin/CodeHighlightPlugin.js.map +1 -1
  117. package/plugins/CodeHighlightPlugin/index.d.ts +1 -1
  118. package/plugins/CodeHighlightPlugin/index.js +1 -16
  119. package/plugins/CodeHighlightPlugin/index.js.map +1 -1
  120. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditor.d.ts +10 -0
  121. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditor.js +28 -0
  122. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditor.js.map +1 -0
  123. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorController.d.ts +7 -0
  124. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorController.js +61 -0
  125. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorController.js.map +1 -0
  126. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.css +2 -136
  127. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.d.ts +4 -16
  128. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.js +7 -180
  129. package/plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.js.map +1 -1
  130. package/plugins/FloatingLinkEditorPlugin/index.d.ts +1 -1
  131. package/plugins/FloatingLinkEditorPlugin/index.js +1 -16
  132. package/plugins/FloatingLinkEditorPlugin/index.js.map +1 -1
  133. package/plugins/FloatingLinkEditorPlugin/isChildOfLinkEditor.js +3 -9
  134. package/plugins/FloatingLinkEditorPlugin/isChildOfLinkEditor.js.map +1 -1
  135. package/plugins/FloatingLinkEditorPlugin/types.d.ts +10 -0
  136. package/plugins/FloatingLinkEditorPlugin/types.js +3 -0
  137. package/plugins/FloatingLinkEditorPlugin/types.js.map +1 -0
  138. package/plugins/FloatingLinkEditorPlugin/useFloatingLinkEditor.d.ts +8 -2
  139. package/plugins/FloatingLinkEditorPlugin/useFloatingLinkEditor.js +120 -88
  140. package/plugins/FloatingLinkEditorPlugin/useFloatingLinkEditor.js.map +1 -1
  141. package/plugins/FontColorPlugin/FontColorPlugin.js +19 -22
  142. package/plugins/FontColorPlugin/FontColorPlugin.js.map +1 -1
  143. package/plugins/FontColorPlugin/applyColorToNode.d.ts +2 -2
  144. package/plugins/FontColorPlugin/applyColorToNode.js +4 -10
  145. package/plugins/FontColorPlugin/applyColorToNode.js.map +1 -1
  146. package/plugins/FontColorPlugin/applyColorToSelection.d.ts +2 -2
  147. package/plugins/FontColorPlugin/applyColorToSelection.js +28 -44
  148. package/plugins/FontColorPlugin/applyColorToSelection.js.map +1 -1
  149. package/plugins/ImagesPlugin/ImagesPlugin.d.ts +1 -2
  150. package/plugins/ImagesPlugin/ImagesPlugin.js +58 -60
  151. package/plugins/ImagesPlugin/ImagesPlugin.js.map +1 -1
  152. package/plugins/LinkPlugin/LinkPlugin.js +29 -37
  153. package/plugins/LinkPlugin/LinkPlugin.js.map +1 -1
  154. package/plugins/ListPLugin/ListPlugin.js +52 -15
  155. package/plugins/ListPLugin/ListPlugin.js.map +1 -1
  156. package/plugins/QuoteNodePlugin/QuoteNodePlugin.js +19 -16
  157. package/plugins/QuoteNodePlugin/QuoteNodePlugin.js.map +1 -1
  158. package/plugins/StateHandlingPlugin.d.ts +1 -1
  159. package/plugins/StateHandlingPlugin.js +32 -39
  160. package/plugins/StateHandlingPlugin.js.map +1 -1
  161. package/plugins/TypographyPlugin/TypographyPlugin.js +17 -21
  162. package/plugins/TypographyPlugin/TypographyPlugin.js.map +1 -1
  163. package/types.d.ts +4 -4
  164. package/types.js +6 -38
  165. package/types.js.map +1 -1
  166. package/ui/ContentEditable.d.ts +0 -1
  167. package/ui/ContentEditable.js +7 -14
  168. package/ui/ContentEditable.js.map +1 -1
  169. package/ui/Divider.d.ts +0 -1
  170. package/ui/Divider.js +3 -10
  171. package/ui/Divider.js.map +1 -1
  172. package/ui/DropDown.d.ts +1 -1
  173. package/ui/DropDown.js +64 -90
  174. package/ui/DropDown.js.map +1 -1
  175. package/ui/ImageResizer.d.ts +0 -1
  176. package/ui/ImageResizer.js +78 -83
  177. package/ui/ImageResizer.js.map +1 -1
  178. package/ui/LinkPreview.d.ts +0 -1
  179. package/ui/LinkPreview.js +22 -29
  180. package/ui/LinkPreview.js.map +1 -1
  181. package/ui/Placeholder.d.ts +1 -1
  182. package/ui/Placeholder.js +10 -16
  183. package/ui/Placeholder.js.map +1 -1
  184. package/ui/TextInput.d.ts +0 -1
  185. package/ui/TextInput.js +11 -18
  186. package/ui/TextInput.js.map +1 -1
  187. package/ui/ToolbarActionDialog.js +30 -42
  188. package/ui/ToolbarActionDialog.js.map +1 -1
  189. package/utils/canUseDOM.js +1 -7
  190. package/utils/canUseDOM.js.map +1 -1
  191. package/utils/files.d.ts +6 -6
  192. package/utils/files.js +5 -32
  193. package/utils/files.js.map +1 -1
  194. package/utils/getDOMRangeRect.js +4 -10
  195. package/utils/getDOMRangeRect.js.map +1 -1
  196. package/utils/getSelectedNode.d.ts +1 -1
  197. package/utils/getSelectedNode.js +9 -16
  198. package/utils/getSelectedNode.js.map +1 -1
  199. package/utils/getTransparentImage.js +1 -7
  200. package/utils/getTransparentImage.js.map +1 -1
  201. package/utils/insertImage.d.ts +1 -1
  202. package/utils/insertImage.js +8 -14
  203. package/utils/insertImage.js.map +1 -1
  204. package/utils/isAnchorLink.js +1 -7
  205. package/utils/isAnchorLink.js.map +1 -1
  206. package/utils/isChildOfFloatingToolbar.js +3 -12
  207. package/utils/isChildOfFloatingToolbar.js.map +1 -1
  208. package/utils/isHTMLElement.js +1 -7
  209. package/utils/isHTMLElement.js.map +1 -1
  210. package/utils/isValidJSON.js +3 -9
  211. package/utils/isValidJSON.js.map +1 -1
  212. package/utils/isValidLexicalData.d.ts +3 -3
  213. package/utils/isValidLexicalData.js +6 -12
  214. package/utils/isValidLexicalData.js.map +1 -1
  215. package/utils/point.js +35 -60
  216. package/utils/point.js.map +1 -1
  217. package/utils/rect.d.ts +1 -1
  218. package/utils/rect.js +115 -149
  219. package/utils/rect.js.map +1 -1
  220. package/utils/sanitizeUrl.js +6 -13
  221. package/utils/sanitizeUrl.js.map +1 -1
  222. package/utils/setFloatingElemPosition.d.ts +1 -1
  223. package/utils/setFloatingElemPosition.js +24 -30
  224. package/utils/setFloatingElemPosition.js.map +1 -1
  225. package/components/Editor/HeadingEditor.d.ts +0 -7
  226. package/components/Editor/HeadingEditor.js +0 -30
  227. package/components/Editor/HeadingEditor.js.map +0 -1
  228. package/components/Editor/ParagraphEditor.d.ts +0 -7
  229. package/components/Editor/ParagraphEditor.js +0 -29
  230. package/components/Editor/ParagraphEditor.js.map +0 -1
  231. package/components/Toolbar/Toolbar.css +0 -643
  232. package/components/Toolbar/Toolbar.d.ts +0 -11
  233. package/components/Toolbar/Toolbar.js +0 -165
  234. package/components/Toolbar/Toolbar.js.map +0 -1
  235. package/components/ToolbarActions/FontSizeAction.d.ts +0 -14
  236. package/components/ToolbarActions/FontSizeAction.js +0 -109
  237. package/components/ToolbarActions/FontSizeAction.js.map +0 -1
  238. package/hooks/useList.d.ts +0 -2
  239. package/hooks/useList.js +0 -54
  240. package/hooks/useList.js.map +0 -1
  241. package/hooks/useQuote.d.ts +0 -2
  242. package/hooks/useQuote.js +0 -22
  243. package/hooks/useQuote.js.map +0 -1
  244. package/plugins/FloatingLinkEditorPlugin/LinkEditForm.d.ts +0 -9
  245. package/plugins/FloatingLinkEditorPlugin/LinkEditForm.js +0 -118
  246. package/plugins/FloatingLinkEditorPlugin/LinkEditForm.js.map +0 -1
  247. package/plugins/FloatingLinkEditorPlugin/LinkPreviewForm.d.ts +0 -9
  248. package/plugins/FloatingLinkEditorPlugin/LinkPreviewForm.js +0 -44
  249. package/plugins/FloatingLinkEditorPlugin/LinkPreviewForm.js.map +0 -1
  250. package/utils/generateInitialLexicalValue.d.ts +0 -4
  251. package/utils/generateInitialLexicalValue.js +0 -33
  252. package/utils/generateInitialLexicalValue.js.map +0 -1
@@ -1,39 +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.useCurrentSelection = useCurrentSelection;
8
- exports.useDeriveValueFromSelection = useDeriveValueFromSelection;
9
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
- var _react = require("react");
11
- var _lexical = require("lexical");
12
- var _useIsMounted = require("./useIsMounted");
13
- var _useRichTextEditor3 = require("./useRichTextEditor");
1
+ import { useCallback, useEffect, useState } from "react";
2
+ import { $getSelection, $isRangeSelection, $isNodeSelection } from "lexical";
3
+ import { useIsMounted } from "./useIsMounted.js";
4
+ import { useRichTextEditor } from "./useRichTextEditor.js";
14
5
  function getOutput(selection) {
15
6
  return {
16
- selection: selection,
17
- rangeSelection: (0, _lexical.$isRangeSelection)(selection) ? selection : null,
18
- nodeSelection: (0, _lexical.$isNodeSelection)(selection) ? selection : null
7
+ selection,
8
+ rangeSelection: $isRangeSelection(selection) ? selection : null,
9
+ nodeSelection: $isNodeSelection(selection) ? selection : null
19
10
  };
20
11
  }
21
- function useCurrentSelection() {
22
- var _useRichTextEditor = (0, _useRichTextEditor3.useRichTextEditor)(),
23
- editor = _useRichTextEditor.editor;
24
- var _useState = (0, _react.useState)(getOutput(null)),
25
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
26
- selection = _useState2[0],
27
- setSelection = _useState2[1];
28
- var isMounted = (0, _useIsMounted.useIsMounted)();
29
- var storeSelection = (0, _react.useCallback)(function () {
30
- editor.getEditorState().read(function () {
12
+ export function useCurrentSelection() {
13
+ const {
14
+ editor
15
+ } = useRichTextEditor();
16
+ const [selection, setSelection] = useState(getOutput(null));
17
+ const isMounted = useIsMounted();
18
+ const storeSelection = useCallback(() => {
19
+ editor.read(() => {
31
20
  if (isMounted()) {
32
- setSelection(getOutput((0, _lexical.$getSelection)()));
21
+ setSelection(getOutput($getSelection()));
33
22
  }
34
23
  });
35
24
  }, [editor]);
36
- (0, _react.useEffect)(function () {
25
+ useEffect(() => {
37
26
  // On first mount, store current selection.
38
27
  storeSelection();
39
28
 
@@ -42,22 +31,20 @@ function useCurrentSelection() {
42
31
  }, []);
43
32
  return selection;
44
33
  }
45
- function useDeriveValueFromSelection(generator) {
46
- var _useRichTextEditor2 = (0, _useRichTextEditor3.useRichTextEditor)(),
47
- editor = _useRichTextEditor2.editor;
48
- var _useState3 = (0, _react.useState)(generator(getOutput(null))),
49
- _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
50
- value = _useState4[0],
51
- setValue = _useState4[1];
52
- var isMounted = (0, _useIsMounted.useIsMounted)();
53
- var generateValue = (0, _react.useCallback)(function () {
54
- editor.getEditorState().read(function () {
34
+ export function useDeriveValueFromSelection(generator) {
35
+ const {
36
+ editor
37
+ } = useRichTextEditor();
38
+ const [value, setValue] = useState(generator(getOutput(null)));
39
+ const isMounted = useIsMounted();
40
+ const generateValue = useCallback(() => {
41
+ editor.read(() => {
55
42
  if (isMounted()) {
56
- setValue(generator(getOutput((0, _lexical.$getSelection)())));
43
+ setValue(generator(getOutput($getSelection())));
57
44
  }
58
45
  });
59
46
  }, [editor]);
60
- (0, _react.useEffect)(function () {
47
+ useEffect(() => {
61
48
  // On first mount, generate current value.
62
49
  generateValue();
63
50
 
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","_lexical","_useIsMounted","_useRichTextEditor3","getOutput","selection","rangeSelection","$isRangeSelection","nodeSelection","$isNodeSelection","useCurrentSelection","_useRichTextEditor","useRichTextEditor","editor","_useState","useState","_useState2","_slicedToArray2","default","setSelection","isMounted","useIsMounted","storeSelection","useCallback","getEditorState","read","$getSelection","useEffect","registerUpdateListener","useDeriveValueFromSelection","generator","_useRichTextEditor2","_useState3","_useState4","value","setValue","generateValue"],"sources":["useCurrentSelection.ts"],"sourcesContent":["import { useCallback, useEffect, useState } from \"react\";\nimport {\n $getSelection,\n $isRangeSelection,\n $isNodeSelection,\n RangeSelection,\n NodeSelection\n} from \"lexical\";\nimport { useIsMounted } from \"./useIsMounted\";\nimport { useRichTextEditor } from \"~/hooks/useRichTextEditor\";\n\nexport interface CurrentSelection {\n selection: ReturnType<typeof $getSelection>;\n rangeSelection: RangeSelection | null;\n nodeSelection: NodeSelection | null;\n}\n\ninterface Generator<T> {\n (params: CurrentSelection): T;\n}\n\nfunction getOutput(selection: ReturnType<typeof $getSelection>) {\n return {\n selection,\n rangeSelection: $isRangeSelection(selection) ? selection : null,\n nodeSelection: $isNodeSelection(selection) ? selection : null\n };\n}\n\nexport function useCurrentSelection() {\n const { editor } = useRichTextEditor();\n const [selection, setSelection] = useState<CurrentSelection>(getOutput(null));\n const isMounted = useIsMounted();\n\n const storeSelection = useCallback(() => {\n editor.getEditorState().read(() => {\n if (isMounted()) {\n setSelection(getOutput($getSelection()));\n }\n });\n }, [editor]);\n\n useEffect(() => {\n // On first mount, store current selection.\n storeSelection();\n\n // Subscribe to editor updates and keep track of the selection.\n return editor.registerUpdateListener(storeSelection);\n }, []);\n\n return selection;\n}\n\nexport function useDeriveValueFromSelection<T>(generator: Generator<T>) {\n const { editor } = useRichTextEditor();\n const [value, setValue] = useState<T>(generator(getOutput(null)));\n const isMounted = useIsMounted();\n\n const generateValue = useCallback(() => {\n editor.getEditorState().read(() => {\n if (isMounted()) {\n setValue(generator(getOutput($getSelection())));\n }\n });\n }, [editor]);\n\n useEffect(() => {\n // On first mount, generate current value.\n generateValue();\n\n // Subscribe to editor updates and regenerate the value.\n return editor.registerUpdateListener(generateValue);\n }, []);\n\n return value;\n}\n"],"mappings":";;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AAOA,IAAAE,aAAA,GAAAF,OAAA;AACA,IAAAG,mBAAA,GAAAH,OAAA;AAYA,SAASI,SAASA,CAACC,SAA2C,EAAE;EAC5D,OAAO;IACHA,SAAS,EAATA,SAAS;IACTC,cAAc,EAAE,IAAAC,0BAAiB,EAACF,SAAS,CAAC,GAAGA,SAAS,GAAG,IAAI;IAC/DG,aAAa,EAAE,IAAAC,yBAAgB,EAACJ,SAAS,CAAC,GAAGA,SAAS,GAAG;EAC7D,CAAC;AACL;AAEO,SAASK,mBAAmBA,CAAA,EAAG;EAClC,IAAAC,kBAAA,GAAmB,IAAAC,qCAAiB,EAAC,CAAC;IAA9BC,MAAM,GAAAF,kBAAA,CAANE,MAAM;EACd,IAAAC,SAAA,GAAkC,IAAAC,eAAQ,EAAmBX,SAAS,CAAC,IAAI,CAAC,CAAC;IAAAY,UAAA,OAAAC,eAAA,CAAAC,OAAA,EAAAJ,SAAA;IAAtET,SAAS,GAAAW,UAAA;IAAEG,YAAY,GAAAH,UAAA;EAC9B,IAAMI,SAAS,GAAG,IAAAC,0BAAY,EAAC,CAAC;EAEhC,IAAMC,cAAc,GAAG,IAAAC,kBAAW,EAAC,YAAM;IACrCV,MAAM,CAACW,cAAc,CAAC,CAAC,CAACC,IAAI,CAAC,YAAM;MAC/B,IAAIL,SAAS,CAAC,CAAC,EAAE;QACbD,YAAY,CAACf,SAAS,CAAC,IAAAsB,sBAAa,EAAC,CAAC,CAAC,CAAC;MAC5C;IACJ,CAAC,CAAC;EACN,CAAC,EAAE,CAACb,MAAM,CAAC,CAAC;EAEZ,IAAAc,gBAAS,EAAC,YAAM;IACZ;IACAL,cAAc,CAAC,CAAC;;IAEhB;IACA,OAAOT,MAAM,CAACe,sBAAsB,CAACN,cAAc,CAAC;EACxD,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOjB,SAAS;AACpB;AAEO,SAASwB,2BAA2BA,CAAIC,SAAuB,EAAE;EACpE,IAAAC,mBAAA,GAAmB,IAAAnB,qCAAiB,EAAC,CAAC;IAA9BC,MAAM,GAAAkB,mBAAA,CAANlB,MAAM;EACd,IAAAmB,UAAA,GAA0B,IAAAjB,eAAQ,EAAIe,SAAS,CAAC1B,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;IAAA6B,UAAA,OAAAhB,eAAA,CAAAC,OAAA,EAAAc,UAAA;IAA1DE,KAAK,GAAAD,UAAA;IAAEE,QAAQ,GAAAF,UAAA;EACtB,IAAMb,SAAS,GAAG,IAAAC,0BAAY,EAAC,CAAC;EAEhC,IAAMe,aAAa,GAAG,IAAAb,kBAAW,EAAC,YAAM;IACpCV,MAAM,CAACW,cAAc,CAAC,CAAC,CAACC,IAAI,CAAC,YAAM;MAC/B,IAAIL,SAAS,CAAC,CAAC,EAAE;QACbe,QAAQ,CAACL,SAAS,CAAC1B,SAAS,CAAC,IAAAsB,sBAAa,EAAC,CAAC,CAAC,CAAC,CAAC;MACnD;IACJ,CAAC,CAAC;EACN,CAAC,EAAE,CAACb,MAAM,CAAC,CAAC;EAEZ,IAAAc,gBAAS,EAAC,YAAM;IACZ;IACAS,aAAa,CAAC,CAAC;;IAEf;IACA,OAAOvB,MAAM,CAACe,sBAAsB,CAACQ,aAAa,CAAC;EACvD,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOF,KAAK;AAChB","ignoreList":[]}
1
+ {"version":3,"names":["useCallback","useEffect","useState","$getSelection","$isRangeSelection","$isNodeSelection","useIsMounted","useRichTextEditor","getOutput","selection","rangeSelection","nodeSelection","useCurrentSelection","editor","setSelection","isMounted","storeSelection","read","registerUpdateListener","useDeriveValueFromSelection","generator","value","setValue","generateValue"],"sources":["useCurrentSelection.ts"],"sourcesContent":["import { useCallback, useEffect, useState } from \"react\";\nimport type { RangeSelection, NodeSelection } from \"lexical\";\nimport { $getSelection, $isRangeSelection, $isNodeSelection } from \"lexical\";\nimport { useIsMounted } from \"./useIsMounted.js\";\nimport { useRichTextEditor } from \"~/hooks/useRichTextEditor.js\";\n\nexport interface CurrentSelection {\n selection: ReturnType<typeof $getSelection>;\n rangeSelection: RangeSelection | null;\n nodeSelection: NodeSelection | null;\n}\n\ninterface Generator<T> {\n (params: CurrentSelection): T;\n}\n\nfunction getOutput(selection: ReturnType<typeof $getSelection>) {\n return {\n selection,\n rangeSelection: $isRangeSelection(selection) ? selection : null,\n nodeSelection: $isNodeSelection(selection) ? selection : null\n };\n}\n\nexport function useCurrentSelection() {\n const { editor } = useRichTextEditor();\n const [selection, setSelection] = useState<CurrentSelection>(getOutput(null));\n const isMounted = useIsMounted();\n\n const storeSelection = useCallback(() => {\n editor.read(() => {\n if (isMounted()) {\n setSelection(getOutput($getSelection()));\n }\n });\n }, [editor]);\n\n useEffect(() => {\n // On first mount, store current selection.\n storeSelection();\n\n // Subscribe to editor updates and keep track of the selection.\n return editor.registerUpdateListener(storeSelection);\n }, []);\n\n return selection;\n}\n\nexport function useDeriveValueFromSelection<T>(generator: Generator<T>) {\n const { editor } = useRichTextEditor();\n const [value, setValue] = useState<T>(generator(getOutput(null)));\n const isMounted = useIsMounted();\n\n const generateValue = useCallback(() => {\n editor.read(() => {\n if (isMounted()) {\n setValue(generator(getOutput($getSelection())));\n }\n });\n }, [editor]);\n\n useEffect(() => {\n // On first mount, generate current value.\n generateValue();\n\n // Subscribe to editor updates and regenerate the value.\n return editor.registerUpdateListener(generateValue);\n }, []);\n\n return value;\n}\n"],"mappings":"AAAA,SAASA,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAExD,SAASC,aAAa,EAAEC,iBAAiB,EAAEC,gBAAgB,QAAQ,SAAS;AAC5E,SAASC,YAAY;AACrB,SAASC,iBAAiB;AAY1B,SAASC,SAASA,CAACC,SAA2C,EAAE;EAC5D,OAAO;IACHA,SAAS;IACTC,cAAc,EAAEN,iBAAiB,CAACK,SAAS,CAAC,GAAGA,SAAS,GAAG,IAAI;IAC/DE,aAAa,EAAEN,gBAAgB,CAACI,SAAS,CAAC,GAAGA,SAAS,GAAG;EAC7D,CAAC;AACL;AAEA,OAAO,SAASG,mBAAmBA,CAAA,EAAG;EAClC,MAAM;IAAEC;EAAO,CAAC,GAAGN,iBAAiB,CAAC,CAAC;EACtC,MAAM,CAACE,SAAS,EAAEK,YAAY,CAAC,GAAGZ,QAAQ,CAAmBM,SAAS,CAAC,IAAI,CAAC,CAAC;EAC7E,MAAMO,SAAS,GAAGT,YAAY,CAAC,CAAC;EAEhC,MAAMU,cAAc,GAAGhB,WAAW,CAAC,MAAM;IACrCa,MAAM,CAACI,IAAI,CAAC,MAAM;MACd,IAAIF,SAAS,CAAC,CAAC,EAAE;QACbD,YAAY,CAACN,SAAS,CAACL,aAAa,CAAC,CAAC,CAAC,CAAC;MAC5C;IACJ,CAAC,CAAC;EACN,CAAC,EAAE,CAACU,MAAM,CAAC,CAAC;EAEZZ,SAAS,CAAC,MAAM;IACZ;IACAe,cAAc,CAAC,CAAC;;IAEhB;IACA,OAAOH,MAAM,CAACK,sBAAsB,CAACF,cAAc,CAAC;EACxD,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOP,SAAS;AACpB;AAEA,OAAO,SAASU,2BAA2BA,CAAIC,SAAuB,EAAE;EACpE,MAAM;IAAEP;EAAO,CAAC,GAAGN,iBAAiB,CAAC,CAAC;EACtC,MAAM,CAACc,KAAK,EAAEC,QAAQ,CAAC,GAAGpB,QAAQ,CAAIkB,SAAS,CAACZ,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC;EACjE,MAAMO,SAAS,GAAGT,YAAY,CAAC,CAAC;EAEhC,MAAMiB,aAAa,GAAGvB,WAAW,CAAC,MAAM;IACpCa,MAAM,CAACI,IAAI,CAAC,MAAM;MACd,IAAIF,SAAS,CAAC,CAAC,EAAE;QACbO,QAAQ,CAACF,SAAS,CAACZ,SAAS,CAACL,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;MACnD;IACJ,CAAC,CAAC;EACN,CAAC,EAAE,CAACU,MAAM,CAAC,CAAC;EAEZZ,SAAS,CAAC,MAAM;IACZ;IACAsB,aAAa,CAAC,CAAC;;IAEf;IACA,OAAOV,MAAM,CAACK,sBAAsB,CAACK,aAAa,CAAC;EACvD,CAAC,EAAE,EAAE,CAAC;EAEN,OAAOF,KAAK;AAChB","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import { FontColorActionContext } from "../context/FontColorActionContext";
1
+ import { FontColorActionContext } from "../context/FontColorActionContext.js";
2
2
  export declare function useFontColorPicker(): FontColorActionContext;
@@ -1,15 +1,9 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useFontColorPicker = useFontColorPicker;
7
- var _react = require("react");
8
- var _FontColorActionContext = require("../context/FontColorActionContext");
9
- function useFontColorPicker() {
10
- var context = (0, _react.useContext)(_FontColorActionContext.FontColorActionContext);
1
+ import { useContext } from "react";
2
+ import { FontColorActionContext } from "../context/FontColorActionContext.js";
3
+ export function useFontColorPicker() {
4
+ const context = useContext(FontColorActionContext);
11
5
  if (!context) {
12
- throw Error("Missing FontColorActionContext in the component hierarchy. Are you using \"useFontColorPicker()\" in the right place?");
6
+ throw Error(`Missing FontColorActionContext in the component hierarchy. Are you using "useFontColorPicker()" in the right place?`);
13
7
  }
14
8
  return context;
15
9
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","_FontColorActionContext","useFontColorPicker","context","useContext","FontColorActionContext","Error"],"sources":["useFontColorPicker.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { FontColorActionContext } from \"~/context/FontColorActionContext\";\n\nexport function useFontColorPicker() {\n const context = useContext(FontColorActionContext);\n if (!context) {\n throw Error(\n `Missing FontColorActionContext in the component hierarchy. Are you using \"useFontColorPicker()\" in the right place?`\n );\n }\n\n return context;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,uBAAA,GAAAD,OAAA;AAEO,SAASE,kBAAkBA,CAAA,EAAG;EACjC,IAAMC,OAAO,GAAG,IAAAC,iBAAU,EAACC,8CAAsB,CAAC;EAClD,IAAI,CAACF,OAAO,EAAE;IACV,MAAMG,KAAK,wHAEX,CAAC;EACL;EAEA,OAAOH,OAAO;AAClB","ignoreList":[]}
1
+ {"version":3,"names":["useContext","FontColorActionContext","useFontColorPicker","context","Error"],"sources":["useFontColorPicker.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { FontColorActionContext } from \"~/context/FontColorActionContext.js\";\n\nexport function useFontColorPicker() {\n const context = useContext(FontColorActionContext);\n if (!context) {\n throw Error(\n `Missing FontColorActionContext in the component hierarchy. Are you using \"useFontColorPicker()\" in the right place?`\n );\n }\n\n return context;\n}\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,sBAAsB;AAE/B,OAAO,SAASC,kBAAkBA,CAAA,EAAG;EACjC,MAAMC,OAAO,GAAGH,UAAU,CAACC,sBAAsB,CAAC;EAClD,IAAI,CAACE,OAAO,EAAE;IACV,MAAMC,KAAK,CACP,qHACJ,CAAC;EACL;EAEA,OAAOD,OAAO;AAClB","ignoreList":[]}
@@ -1,20 +1,12 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useIsMounted = useIsMounted;
7
- var _react = require("react");
8
- function useIsMounted() {
9
- var isMounted = (0, _react.useRef)(true);
10
- (0, _react.useEffect)(function () {
11
- return function () {
1
+ import { useEffect, useRef } from "react";
2
+ export function useIsMounted() {
3
+ const isMounted = useRef(true);
4
+ useEffect(() => {
5
+ return () => {
12
6
  isMounted.current = false;
13
7
  };
14
8
  }, []);
15
- return function () {
16
- return isMounted.current;
17
- };
9
+ return () => isMounted.current;
18
10
  }
19
11
 
20
12
  //# sourceMappingURL=useIsMounted.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","useIsMounted","isMounted","useRef","useEffect","current"],"sources":["useIsMounted.ts"],"sourcesContent":["import { useEffect, useRef } from \"react\";\n\nexport function useIsMounted() {\n const isMounted = useRef(true);\n\n useEffect(() => {\n return () => {\n isMounted.current = false;\n };\n }, []);\n\n return () => isMounted.current;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEO,SAASC,YAAYA,CAAA,EAAG;EAC3B,IAAMC,SAAS,GAAG,IAAAC,aAAM,EAAC,IAAI,CAAC;EAE9B,IAAAC,gBAAS,EAAC,YAAM;IACZ,OAAO,YAAM;MACTF,SAAS,CAACG,OAAO,GAAG,KAAK;IAC7B,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO;IAAA,OAAMH,SAAS,CAACG,OAAO;EAAA;AAClC","ignoreList":[]}
1
+ {"version":3,"names":["useEffect","useRef","useIsMounted","isMounted","current"],"sources":["useIsMounted.ts"],"sourcesContent":["import { useEffect, useRef } from \"react\";\n\nexport function useIsMounted() {\n const isMounted = useRef(true);\n\n useEffect(() => {\n return () => {\n isMounted.current = false;\n };\n }, []);\n\n return () => isMounted.current;\n}\n"],"mappings":"AAAA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AAEzC,OAAO,SAASC,YAAYA,CAAA,EAAG;EAC3B,MAAMC,SAAS,GAAGF,MAAM,CAAC,IAAI,CAAC;EAE9BD,SAAS,CAAC,MAAM;IACZ,OAAO,MAAM;MACTG,SAAS,CAACC,OAAO,GAAG,KAAK;IAC7B,CAAC;EACL,CAAC,EAAE,EAAE,CAAC;EAEN,OAAO,MAAMD,SAAS,CAACC,OAAO;AAClC","ignoreList":[]}
@@ -1,2 +1,2 @@
1
- import { RichTextEditorContext } from "../context/RichTextEditorContext";
1
+ import { RichTextEditorContext } from "../context/RichTextEditorContext.js";
2
2
  export declare function useRichTextEditor(): RichTextEditorContext;
@@ -1,15 +1,9 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useRichTextEditor = useRichTextEditor;
7
- var _react = require("react");
8
- var _RichTextEditorContext = require("../context/RichTextEditorContext");
9
- function useRichTextEditor() {
10
- var context = (0, _react.useContext)(_RichTextEditorContext.RichTextEditorContext);
1
+ import { useContext } from "react";
2
+ import { RichTextEditorContext } from "../context/RichTextEditorContext.js";
3
+ export function useRichTextEditor() {
4
+ const context = useContext(RichTextEditorContext);
11
5
  if (!context) {
12
- throw Error("Missing RichTextEditorContext in the component hierarchy. Are you using \"useRichTextEditor()\" in the right place?");
6
+ throw Error(`Missing RichTextEditorContext in the component hierarchy. Are you using "useRichTextEditor()" in the right place?`);
13
7
  }
14
8
  return context;
15
9
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","_RichTextEditorContext","useRichTextEditor","context","useContext","RichTextEditorContext","Error"],"sources":["useRichTextEditor.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { RichTextEditorContext } from \"~/context/RichTextEditorContext\";\n\nexport function useRichTextEditor() {\n const context = useContext(RichTextEditorContext);\n if (!context) {\n throw Error(\n `Missing RichTextEditorContext in the component hierarchy. Are you using \"useRichTextEditor()\" in the right place?`\n );\n }\n\n return context;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,sBAAA,GAAAD,OAAA;AAEO,SAASE,iBAAiBA,CAAA,EAAG;EAChC,IAAMC,OAAO,GAAG,IAAAC,iBAAU,EAACC,4CAAqB,CAAC;EACjD,IAAI,CAACF,OAAO,EAAE;IACV,MAAMG,KAAK,sHAEX,CAAC;EACL;EAEA,OAAOH,OAAO;AAClB","ignoreList":[]}
1
+ {"version":3,"names":["useContext","RichTextEditorContext","useRichTextEditor","context","Error"],"sources":["useRichTextEditor.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { RichTextEditorContext } from \"~/context/RichTextEditorContext.js\";\n\nexport function useRichTextEditor() {\n const context = useContext(RichTextEditorContext);\n if (!context) {\n throw Error(\n `Missing RichTextEditorContext in the component hierarchy. Are you using \"useRichTextEditor()\" in the right place?`\n );\n }\n\n return context;\n}\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,qBAAqB;AAE9B,OAAO,SAASC,iBAAiBA,CAAA,EAAG;EAChC,MAAMC,OAAO,GAAGH,UAAU,CAACC,qBAAqB,CAAC;EACjD,IAAI,CAACE,OAAO,EAAE;IACV,MAAMC,KAAK,CACP,mHACJ,CAAC;EACL;EAEA,OAAOD,OAAO;AAClB","ignoreList":[]}
@@ -1 +1 @@
1
- export declare function useTextAlignmentAction(): import("../context/TextAlignmentActionContextProps").TextAlignmentActionContextProps;
1
+ export declare function useTextAlignmentAction(): import("~/context/TextAlignmentActionContextProps.js").TextAlignmentActionContextProps;
@@ -1,15 +1,9 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useTextAlignmentAction = useTextAlignmentAction;
7
- var _react = require("react");
8
- var _TextAlignmentActionContextProps = require("../context/TextAlignmentActionContextProps");
9
- function useTextAlignmentAction() {
10
- var context = (0, _react.useContext)(_TextAlignmentActionContextProps.TextAlignmentActionContext);
1
+ import { useContext } from "react";
2
+ import { TextAlignmentActionContext } from "../context/TextAlignmentActionContextProps.js";
3
+ export function useTextAlignmentAction() {
4
+ const context = useContext(TextAlignmentActionContext);
11
5
  if (!context) {
12
- throw Error("Missing TextAlignmentActionContext in the component hierarchy. Are you using \"useTextAlignmentAction()\" in the right place?");
6
+ throw Error(`Missing TextAlignmentActionContext in the component hierarchy. Are you using "useTextAlignmentAction()" in the right place?`);
13
7
  }
14
8
  return context;
15
9
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","_TextAlignmentActionContextProps","useTextAlignmentAction","context","useContext","TextAlignmentActionContext","Error"],"sources":["useTextAlignmentAction.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { TextAlignmentActionContext } from \"~/context/TextAlignmentActionContextProps\";\n\nexport function useTextAlignmentAction() {\n const context = useContext(TextAlignmentActionContext);\n if (!context) {\n throw Error(\n `Missing TextAlignmentActionContext in the component hierarchy. Are you using \"useTextAlignmentAction()\" in the right place?`\n );\n }\n\n return context;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,gCAAA,GAAAD,OAAA;AAEO,SAASE,sBAAsBA,CAAA,EAAG;EACrC,IAAMC,OAAO,GAAG,IAAAC,iBAAU,EAACC,2DAA0B,CAAC;EACtD,IAAI,CAACF,OAAO,EAAE;IACV,MAAMG,KAAK,gIAEX,CAAC;EACL;EAEA,OAAOH,OAAO;AAClB","ignoreList":[]}
1
+ {"version":3,"names":["useContext","TextAlignmentActionContext","useTextAlignmentAction","context","Error"],"sources":["useTextAlignmentAction.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { TextAlignmentActionContext } from \"~/context/TextAlignmentActionContextProps.js\";\n\nexport function useTextAlignmentAction() {\n const context = useContext(TextAlignmentActionContext);\n if (!context) {\n throw Error(\n `Missing TextAlignmentActionContext in the component hierarchy. Are you using \"useTextAlignmentAction()\" in the right place?`\n );\n }\n\n return context;\n}\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,0BAA0B;AAEnC,OAAO,SAASC,sBAAsBA,CAAA,EAAG;EACrC,MAAMC,OAAO,GAAGH,UAAU,CAACC,0BAA0B,CAAC;EACtD,IAAI,CAACE,OAAO,EAAE;IACV,MAAMC,KAAK,CACP,6HACJ,CAAC;EACL;EAEA,OAAOD,OAAO;AAClB","ignoreList":[]}
@@ -1 +1 @@
1
- export declare function useTypographyAction(): import("../context/TypographyActionContext").TypographyActionContextProps;
1
+ export declare function useTypographyAction(): import("~/context/TypographyActionContext.js").TypographyActionContextProps;
@@ -1,15 +1,9 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.useTypographyAction = useTypographyAction;
7
- var _react = require("react");
8
- var _TypographyActionContext = require("../context/TypographyActionContext");
9
- function useTypographyAction() {
10
- var context = (0, _react.useContext)(_TypographyActionContext.TypographyActionContext);
1
+ import { useContext } from "react";
2
+ import { TypographyActionContext } from "../context/TypographyActionContext.js";
3
+ export function useTypographyAction() {
4
+ const context = useContext(TypographyActionContext);
11
5
  if (!context) {
12
- throw Error("Missing TypographyActionContext in the component hierarchy. Are you using \"useTypographyAction()\" in the right place?");
6
+ throw Error(`Missing TypographyActionContext in the component hierarchy. Are you using "useTypographyAction()" in the right place?`);
13
7
  }
14
8
  return context;
15
9
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_react","require","_TypographyActionContext","useTypographyAction","context","useContext","TypographyActionContext","Error"],"sources":["useTypographyAction.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { TypographyActionContext } from \"~/context/TypographyActionContext\";\n\nexport function useTypographyAction() {\n const context = useContext(TypographyActionContext);\n if (!context) {\n throw Error(\n `Missing TypographyActionContext in the component hierarchy. Are you using \"useTypographyAction()\" in the right place?`\n );\n }\n\n return context;\n}\n"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,wBAAA,GAAAD,OAAA;AAEO,SAASE,mBAAmBA,CAAA,EAAG;EAClC,IAAMC,OAAO,GAAG,IAAAC,iBAAU,EAACC,gDAAuB,CAAC;EACnD,IAAI,CAACF,OAAO,EAAE;IACV,MAAMG,KAAK,0HAEX,CAAC;EACL;EAEA,OAAOH,OAAO;AAClB","ignoreList":[]}
1
+ {"version":3,"names":["useContext","TypographyActionContext","useTypographyAction","context","Error"],"sources":["useTypographyAction.ts"],"sourcesContent":["import { useContext } from \"react\";\nimport { TypographyActionContext } from \"~/context/TypographyActionContext.js\";\n\nexport function useTypographyAction() {\n const context = useContext(TypographyActionContext);\n if (!context) {\n throw Error(\n `Missing TypographyActionContext in the component hierarchy. Are you using \"useTypographyAction()\" in the right place?`\n );\n }\n\n return context;\n}\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,OAAO;AAClC,SAASC,uBAAuB;AAEhC,OAAO,SAASC,mBAAmBA,CAAA,EAAG;EAClC,MAAMC,OAAO,GAAGH,UAAU,CAACC,uBAAuB,CAAC;EACnD,IAAI,CAACE,OAAO,EAAE;IACV,MAAMC,KAAK,CACP,uHACJ,CAAC;EACL;EAEA,OAAOD,OAAO;AAClB","ignoreList":[]}
package/index.d.ts CHANGED
@@ -1,38 +1,33 @@
1
- export { LexicalHtmlRenderer } from "./components/LexicalHtmlRenderer";
2
- export * from "./hooks";
3
- export { Divider } from "./ui/Divider";
4
- export { DropDownItem } from "./ui/DropDown";
5
- export { DropDown } from "./ui/DropDown";
6
- export { BoldAction } from "./components/ToolbarActions/BoldAction";
7
- export { BulletListAction } from "./components/ToolbarActions/BulletListAction";
8
- export { CodeHighlightAction } from "./components/ToolbarActions/CodeHighlightAction";
9
- export { FontSizeAction } from "./components/ToolbarActions/FontSizeAction";
10
- export { FontColorAction } from "./components/ToolbarActions/FontColorAction";
11
- export { ItalicAction } from "./components/ToolbarActions/ItalicAction";
12
- export { LinkAction } from "./components/ToolbarActions/LinkAction";
13
- export { NumberedListAction } from "./components/ToolbarActions/NumberedListAction";
14
- export { QuoteAction } from "./components/ToolbarActions/QuoteAction";
15
- export { UnderlineAction } from "./components/ToolbarActions/UnderlineAction";
16
- export { TypographyAction } from "./components/ToolbarActions/TypographyAction";
17
- export { TextAlignmentAction } from "./components/ToolbarActions/TextAlignmentAction";
18
- export { ImageAction } from "./components/ToolbarActions/ImageAction";
19
- export { Toolbar } from "./components/Toolbar/Toolbar";
20
- export { StaticToolbar } from "./components/Toolbar/StaticToolbar";
21
- export { RichTextEditor } from "./components/Editor/RichTextEditor";
22
- export { HeadingEditor } from "./components/Editor/HeadingEditor";
23
- export { ParagraphEditor } from "./components/Editor/ParagraphEditor";
24
- export { StateHandlingPlugin } from "./plugins/StateHandlingPlugin";
25
- export { LinkPlugin } from "./plugins/LinkPlugin/LinkPlugin";
26
- export { FloatingLinkEditorPlugin } from "./plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin";
27
- export { CodeHighlightPlugin } from "./plugins/CodeHighlightPlugin/CodeHighlightPlugin";
28
- export { BlurEventPlugin } from "./plugins/BlurEventPlugin/BlurEventPlugin";
29
- export { FontColorPlugin } from "./plugins/FontColorPlugin/FontColorPlugin";
30
- export { TypographyPlugin } from "./plugins/TypographyPlugin/TypographyPlugin";
31
- export { QuotePlugin } from "./plugins/QuoteNodePlugin/QuoteNodePlugin";
32
- export { ListPlugin } from "./plugins/ListPLugin/ListPlugin";
33
- export { ImagesPlugin } from "./plugins/ImagesPlugin/ImagesPlugin";
34
- export { generateInitialLexicalValue } from "./utils/generateInitialLexicalValue";
35
- export { isValidLexicalData } from "./utils/isValidLexicalData";
36
- export * from "./commands";
37
- export * as types from "./types";
38
- export { LexicalEditorConfig, useLexicalEditorConfig } from "./components/LexicalEditorConfig/LexicalEditorConfig";
1
+ export { LexicalHtmlRenderer } from "./components/LexicalHtmlRenderer.js";
2
+ export * from "./hooks/index.js";
3
+ export { Divider } from "./ui/Divider.js";
4
+ export { DropDownItem } from "./ui/DropDown.js";
5
+ export { DropDown } from "./ui/DropDown.js";
6
+ export { BoldAction } from "./components/ToolbarActions/BoldAction.js";
7
+ export { BulletListAction } from "./components/ToolbarActions/BulletListAction.js";
8
+ export { CodeHighlightAction } from "./components/ToolbarActions/CodeHighlightAction.js";
9
+ export { FontColorAction } from "./components/ToolbarActions/FontColorAction.js";
10
+ export { ItalicAction } from "./components/ToolbarActions/ItalicAction.js";
11
+ export { LinkAction } from "./components/ToolbarActions/LinkAction.js";
12
+ export { NumberedListAction } from "./components/ToolbarActions/NumberedListAction.js";
13
+ export { QuoteAction } from "./components/ToolbarActions/QuoteAction.js";
14
+ export { UnderlineAction } from "./components/ToolbarActions/UnderlineAction.js";
15
+ export { TypographyAction } from "./components/ToolbarActions/TypographyAction.js";
16
+ export { TextAlignmentAction } from "./components/ToolbarActions/TextAlignmentAction.js";
17
+ export { ImageAction } from "./components/ToolbarActions/ImageAction.js";
18
+ export { StaticToolbar } from "./components/Toolbar/StaticToolbar.js";
19
+ export { RichTextEditor } from "./components/Editor/RichTextEditor.js";
20
+ export { LinkPlugin } from "./plugins/LinkPlugin/LinkPlugin.js";
21
+ export { FloatingLinkEditorPlugin } from "./plugins/FloatingLinkEditorPlugin/FloatingLinkEditorPlugin.js";
22
+ export { CodeHighlightPlugin } from "./plugins/CodeHighlightPlugin/CodeHighlightPlugin.js";
23
+ export { BlurEventPlugin } from "./plugins/BlurEventPlugin/BlurEventPlugin.js";
24
+ export { FontColorPlugin } from "./plugins/FontColorPlugin/FontColorPlugin.js";
25
+ export { TypographyPlugin } from "./plugins/TypographyPlugin/TypographyPlugin.js";
26
+ export { QuotePlugin } from "./plugins/QuoteNodePlugin/QuoteNodePlugin.js";
27
+ export { ListPlugin } from "./plugins/ListPLugin/ListPlugin.js";
28
+ export { ImagesPlugin } from "./plugins/ImagesPlugin/ImagesPlugin.js";
29
+ export { StateHandlingPlugin } from "./plugins/StateHandlingPlugin.js";
30
+ export { isValidLexicalData } from "./utils/isValidLexicalData.js";
31
+ export * from "./commands/index.js";
32
+ export * as types from "./types.js";
33
+ export { LexicalEditorConfig, useLexicalEditorConfig } from "./components/LexicalEditorConfig/LexicalEditorConfig.js";