@lexical/react 0.14.4 → 0.15.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 (287) hide show
  1. package/LexicalAutoEmbedPlugin.dev.js +17 -1
  2. package/LexicalAutoEmbedPlugin.dev.mjs +3 -0
  3. package/LexicalAutoEmbedPlugin.js +2 -0
  4. package/LexicalAutoEmbedPlugin.mjs +2 -0
  5. package/LexicalAutoEmbedPlugin.node.mjs +2 -0
  6. package/LexicalAutoEmbedPlugin.prod.js +6 -4
  7. package/LexicalAutoEmbedPlugin.prod.mjs +2 -0
  8. package/LexicalAutoFocusPlugin.dev.js +3 -0
  9. package/LexicalAutoFocusPlugin.dev.mjs +3 -0
  10. package/LexicalAutoFocusPlugin.js +2 -0
  11. package/LexicalAutoFocusPlugin.mjs +2 -0
  12. package/LexicalAutoFocusPlugin.node.mjs +2 -0
  13. package/LexicalAutoFocusPlugin.prod.js +2 -0
  14. package/LexicalAutoFocusPlugin.prod.mjs +2 -0
  15. package/LexicalAutoLinkPlugin.dev.js +9 -4
  16. package/LexicalAutoLinkPlugin.dev.mjs +10 -5
  17. package/LexicalAutoLinkPlugin.js +2 -0
  18. package/LexicalAutoLinkPlugin.mjs +2 -0
  19. package/LexicalAutoLinkPlugin.node.mjs +2 -0
  20. package/LexicalAutoLinkPlugin.prod.js +12 -10
  21. package/LexicalAutoLinkPlugin.prod.mjs +3 -1
  22. package/LexicalBlockWithAlignableContents.dev.js +20 -4
  23. package/LexicalBlockWithAlignableContents.dev.mjs +6 -3
  24. package/LexicalBlockWithAlignableContents.js +2 -0
  25. package/LexicalBlockWithAlignableContents.mjs +2 -0
  26. package/LexicalBlockWithAlignableContents.node.mjs +2 -0
  27. package/LexicalBlockWithAlignableContents.prod.js +6 -4
  28. package/LexicalBlockWithAlignableContents.prod.mjs +2 -0
  29. package/LexicalCharacterLimitPlugin.dev.js +21 -4
  30. package/LexicalCharacterLimitPlugin.dev.mjs +7 -3
  31. package/LexicalCharacterLimitPlugin.js +2 -0
  32. package/LexicalCharacterLimitPlugin.mjs +2 -0
  33. package/LexicalCharacterLimitPlugin.node.mjs +2 -0
  34. package/LexicalCharacterLimitPlugin.prod.js +11 -9
  35. package/LexicalCharacterLimitPlugin.prod.mjs +3 -1
  36. package/LexicalCheckListPlugin.dev.js +3 -0
  37. package/LexicalCheckListPlugin.dev.mjs +3 -0
  38. package/LexicalCheckListPlugin.js +2 -0
  39. package/LexicalCheckListPlugin.mjs +2 -0
  40. package/LexicalCheckListPlugin.node.mjs +2 -0
  41. package/LexicalCheckListPlugin.prod.js +2 -0
  42. package/LexicalCheckListPlugin.prod.mjs +2 -0
  43. package/LexicalClearEditorPlugin.dev.js +5 -2
  44. package/LexicalClearEditorPlugin.dev.mjs +7 -4
  45. package/LexicalClearEditorPlugin.js +2 -0
  46. package/LexicalClearEditorPlugin.mjs +2 -0
  47. package/LexicalClearEditorPlugin.node.mjs +2 -0
  48. package/LexicalClearEditorPlugin.prod.js +3 -1
  49. package/LexicalClearEditorPlugin.prod.mjs +3 -1
  50. package/LexicalClickableLinkPlugin.dev.js +14 -13
  51. package/LexicalClickableLinkPlugin.dev.mjs +14 -13
  52. package/LexicalClickableLinkPlugin.js +2 -0
  53. package/LexicalClickableLinkPlugin.mjs +2 -0
  54. package/LexicalClickableLinkPlugin.node.mjs +2 -0
  55. package/LexicalClickableLinkPlugin.prod.js +5 -4
  56. package/LexicalClickableLinkPlugin.prod.mjs +3 -1
  57. package/LexicalCollaborationContext.dev.js +3 -0
  58. package/LexicalCollaborationContext.dev.mjs +3 -0
  59. package/LexicalCollaborationContext.js +2 -0
  60. package/LexicalCollaborationContext.mjs +2 -0
  61. package/LexicalCollaborationContext.node.mjs +2 -0
  62. package/LexicalCollaborationContext.prod.js +2 -0
  63. package/LexicalCollaborationContext.prod.mjs +2 -0
  64. package/LexicalCollaborationPlugin.dev.js +19 -2
  65. package/LexicalCollaborationPlugin.dev.mjs +4 -0
  66. package/LexicalCollaborationPlugin.js +2 -0
  67. package/LexicalCollaborationPlugin.mjs +2 -0
  68. package/LexicalCollaborationPlugin.node.mjs +2 -0
  69. package/LexicalCollaborationPlugin.prod.js +12 -10
  70. package/LexicalCollaborationPlugin.prod.mjs +2 -0
  71. package/LexicalComposer.dev.js +19 -3
  72. package/LexicalComposer.dev.mjs +7 -4
  73. package/LexicalComposer.js +2 -0
  74. package/LexicalComposer.mjs +2 -0
  75. package/LexicalComposer.node.mjs +2 -0
  76. package/LexicalComposer.prod.js +5 -3
  77. package/LexicalComposer.prod.mjs +3 -1
  78. package/LexicalComposerContext.dev.js +3 -0
  79. package/LexicalComposerContext.dev.mjs +3 -0
  80. package/LexicalComposerContext.js +2 -0
  81. package/LexicalComposerContext.mjs +2 -0
  82. package/LexicalComposerContext.node.mjs +2 -0
  83. package/LexicalComposerContext.prod.js +4 -2
  84. package/LexicalComposerContext.prod.mjs +3 -1
  85. package/LexicalContentEditable.dev.js +18 -3
  86. package/LexicalContentEditable.dev.mjs +6 -4
  87. package/LexicalContentEditable.js +2 -0
  88. package/LexicalContentEditable.mjs +2 -0
  89. package/LexicalContentEditable.node.mjs +2 -0
  90. package/LexicalContentEditable.prod.js +6 -3
  91. package/LexicalContentEditable.prod.mjs +3 -1
  92. package/LexicalContextMenuPlugin.dev.js +24 -7
  93. package/LexicalContextMenuPlugin.dev.mjs +11 -7
  94. package/LexicalContextMenuPlugin.js +2 -0
  95. package/LexicalContextMenuPlugin.js.flow +12 -0
  96. package/LexicalContextMenuPlugin.mjs +2 -0
  97. package/LexicalContextMenuPlugin.node.mjs +2 -0
  98. package/LexicalContextMenuPlugin.prod.js +18 -16
  99. package/LexicalContextMenuPlugin.prod.mjs +3 -1
  100. package/LexicalDecoratorBlockNode.d.ts +1 -0
  101. package/LexicalDecoratorBlockNode.dev.js +6 -0
  102. package/LexicalDecoratorBlockNode.dev.mjs +6 -0
  103. package/LexicalDecoratorBlockNode.js +2 -0
  104. package/LexicalDecoratorBlockNode.mjs +2 -0
  105. package/LexicalDecoratorBlockNode.node.mjs +2 -0
  106. package/LexicalDecoratorBlockNode.prod.js +3 -1
  107. package/LexicalDecoratorBlockNode.prod.mjs +3 -1
  108. package/LexicalEditorRefPlugin.dev.js +17 -1
  109. package/LexicalEditorRefPlugin.dev.mjs +3 -0
  110. package/LexicalEditorRefPlugin.js +2 -0
  111. package/LexicalEditorRefPlugin.js.flow +19 -0
  112. package/LexicalEditorRefPlugin.mjs +2 -0
  113. package/LexicalEditorRefPlugin.node.mjs +2 -0
  114. package/LexicalEditorRefPlugin.prod.js +3 -1
  115. package/LexicalEditorRefPlugin.prod.mjs +2 -0
  116. package/LexicalErrorBoundary.dev.js +21 -5
  117. package/LexicalErrorBoundary.dev.mjs +3 -0
  118. package/LexicalErrorBoundary.js +2 -0
  119. package/LexicalErrorBoundary.mjs +2 -0
  120. package/LexicalErrorBoundary.node.mjs +2 -0
  121. package/LexicalErrorBoundary.prod.js +6 -4
  122. package/LexicalErrorBoundary.prod.mjs +2 -0
  123. package/LexicalHashtagPlugin.dev.js +5 -2
  124. package/LexicalHashtagPlugin.dev.mjs +5 -2
  125. package/LexicalHashtagPlugin.js +2 -0
  126. package/LexicalHashtagPlugin.mjs +2 -0
  127. package/LexicalHashtagPlugin.node.mjs +2 -0
  128. package/LexicalHashtagPlugin.prod.js +2 -0
  129. package/LexicalHashtagPlugin.prod.mjs +2 -0
  130. package/LexicalHistoryPlugin.dev.js +4 -0
  131. package/LexicalHistoryPlugin.dev.mjs +4 -0
  132. package/LexicalHistoryPlugin.js +2 -0
  133. package/LexicalHistoryPlugin.mjs +2 -0
  134. package/LexicalHistoryPlugin.node.mjs +2 -0
  135. package/LexicalHistoryPlugin.prod.js +2 -0
  136. package/LexicalHistoryPlugin.prod.mjs +2 -0
  137. package/LexicalHorizontalRuleNode.dev.js +22 -6
  138. package/LexicalHorizontalRuleNode.dev.mjs +8 -5
  139. package/LexicalHorizontalRuleNode.js +2 -0
  140. package/LexicalHorizontalRuleNode.mjs +2 -0
  141. package/LexicalHorizontalRuleNode.node.mjs +2 -0
  142. package/LexicalHorizontalRuleNode.prod.js +7 -5
  143. package/LexicalHorizontalRuleNode.prod.mjs +2 -0
  144. package/LexicalHorizontalRulePlugin.dev.js +3 -0
  145. package/LexicalHorizontalRulePlugin.dev.mjs +3 -0
  146. package/LexicalHorizontalRulePlugin.js +2 -0
  147. package/LexicalHorizontalRulePlugin.mjs +2 -0
  148. package/LexicalHorizontalRulePlugin.node.mjs +2 -0
  149. package/LexicalHorizontalRulePlugin.prod.js +2 -0
  150. package/LexicalHorizontalRulePlugin.prod.mjs +2 -0
  151. package/LexicalLinkPlugin.dev.js +6 -3
  152. package/LexicalLinkPlugin.dev.mjs +7 -4
  153. package/LexicalLinkPlugin.js +2 -0
  154. package/LexicalLinkPlugin.mjs +2 -0
  155. package/LexicalLinkPlugin.node.mjs +2 -0
  156. package/LexicalLinkPlugin.prod.js +3 -1
  157. package/LexicalLinkPlugin.prod.mjs +3 -1
  158. package/LexicalListPlugin.dev.js +4 -0
  159. package/LexicalListPlugin.dev.mjs +4 -0
  160. package/LexicalListPlugin.js +2 -0
  161. package/LexicalListPlugin.mjs +2 -0
  162. package/LexicalListPlugin.node.mjs +2 -0
  163. package/LexicalListPlugin.prod.js +2 -0
  164. package/LexicalListPlugin.prod.mjs +2 -0
  165. package/LexicalMarkdownShortcutPlugin.dev.js +3 -0
  166. package/LexicalMarkdownShortcutPlugin.dev.mjs +3 -0
  167. package/LexicalMarkdownShortcutPlugin.js +2 -0
  168. package/LexicalMarkdownShortcutPlugin.mjs +2 -0
  169. package/LexicalMarkdownShortcutPlugin.node.mjs +2 -0
  170. package/LexicalMarkdownShortcutPlugin.prod.js +2 -0
  171. package/LexicalMarkdownShortcutPlugin.prod.mjs +2 -0
  172. package/LexicalNestedComposer.dev.js +17 -1
  173. package/LexicalNestedComposer.dev.mjs +3 -0
  174. package/LexicalNestedComposer.js +2 -0
  175. package/LexicalNestedComposer.mjs +2 -0
  176. package/LexicalNestedComposer.node.mjs +2 -0
  177. package/LexicalNestedComposer.prod.js +7 -5
  178. package/LexicalNestedComposer.prod.mjs +3 -1
  179. package/LexicalNodeEventPlugin.dev.js +3 -0
  180. package/LexicalNodeEventPlugin.dev.mjs +3 -0
  181. package/LexicalNodeEventPlugin.js +2 -0
  182. package/LexicalNodeEventPlugin.js.flow +12 -0
  183. package/LexicalNodeEventPlugin.mjs +2 -0
  184. package/LexicalNodeEventPlugin.node.mjs +2 -0
  185. package/LexicalNodeEventPlugin.prod.js +2 -0
  186. package/LexicalNodeEventPlugin.prod.mjs +2 -0
  187. package/LexicalNodeMenuPlugin.dev.js +25 -8
  188. package/LexicalNodeMenuPlugin.dev.mjs +11 -7
  189. package/LexicalNodeMenuPlugin.js +2 -0
  190. package/LexicalNodeMenuPlugin.mjs +2 -0
  191. package/LexicalNodeMenuPlugin.node.mjs +2 -0
  192. package/LexicalNodeMenuPlugin.prod.js +17 -15
  193. package/LexicalNodeMenuPlugin.prod.mjs +3 -1
  194. package/LexicalOnChangePlugin.dev.js +5 -2
  195. package/LexicalOnChangePlugin.dev.mjs +7 -4
  196. package/LexicalOnChangePlugin.js +2 -0
  197. package/LexicalOnChangePlugin.mjs +2 -0
  198. package/LexicalOnChangePlugin.node.mjs +2 -0
  199. package/LexicalOnChangePlugin.prod.js +3 -1
  200. package/LexicalOnChangePlugin.prod.mjs +3 -1
  201. package/LexicalPlainTextPlugin.dev.js +26 -7
  202. package/LexicalPlainTextPlugin.dev.mjs +13 -7
  203. package/LexicalPlainTextPlugin.js +2 -0
  204. package/LexicalPlainTextPlugin.mjs +2 -0
  205. package/LexicalPlainTextPlugin.node.mjs +2 -0
  206. package/LexicalPlainTextPlugin.prod.js +6 -4
  207. package/LexicalPlainTextPlugin.prod.mjs +3 -1
  208. package/LexicalRichTextPlugin.dev.js +26 -7
  209. package/LexicalRichTextPlugin.dev.mjs +13 -7
  210. package/LexicalRichTextPlugin.js +2 -0
  211. package/LexicalRichTextPlugin.mjs +2 -0
  212. package/LexicalRichTextPlugin.node.mjs +2 -0
  213. package/LexicalRichTextPlugin.prod.js +6 -4
  214. package/LexicalRichTextPlugin.prod.mjs +3 -1
  215. package/LexicalTabIndentationPlugin.dev.js +5 -2
  216. package/LexicalTabIndentationPlugin.dev.mjs +5 -2
  217. package/LexicalTabIndentationPlugin.js +2 -0
  218. package/LexicalTabIndentationPlugin.mjs +2 -0
  219. package/LexicalTabIndentationPlugin.node.mjs +2 -0
  220. package/LexicalTabIndentationPlugin.prod.js +2 -0
  221. package/LexicalTabIndentationPlugin.prod.mjs +2 -0
  222. package/LexicalTableOfContents.d.ts +1 -1
  223. package/LexicalTableOfContents.dev.js +47 -8
  224. package/LexicalTableOfContents.dev.mjs +48 -9
  225. package/LexicalTableOfContents.js +2 -0
  226. package/LexicalTableOfContents.mjs +2 -0
  227. package/LexicalTableOfContents.node.mjs +2 -0
  228. package/LexicalTableOfContents.prod.js +6 -4
  229. package/LexicalTableOfContents.prod.mjs +3 -1
  230. package/LexicalTablePlugin.dev.js +28 -2
  231. package/LexicalTablePlugin.dev.mjs +31 -5
  232. package/LexicalTablePlugin.js +2 -0
  233. package/LexicalTablePlugin.mjs +2 -0
  234. package/LexicalTablePlugin.node.mjs +2 -0
  235. package/LexicalTablePlugin.prod.js +9 -5
  236. package/LexicalTablePlugin.prod.mjs +3 -1
  237. package/LexicalTreeView.dev.js +18 -2
  238. package/LexicalTreeView.dev.mjs +3 -0
  239. package/LexicalTreeView.js +2 -0
  240. package/LexicalTreeView.mjs +2 -0
  241. package/LexicalTreeView.node.mjs +2 -0
  242. package/LexicalTreeView.prod.js +5 -3
  243. package/LexicalTreeView.prod.mjs +2 -0
  244. package/LexicalTypeaheadMenuPlugin.dev.js +25 -8
  245. package/LexicalTypeaheadMenuPlugin.dev.mjs +11 -7
  246. package/LexicalTypeaheadMenuPlugin.js +2 -0
  247. package/LexicalTypeaheadMenuPlugin.mjs +2 -0
  248. package/LexicalTypeaheadMenuPlugin.node.mjs +2 -0
  249. package/LexicalTypeaheadMenuPlugin.prod.js +21 -19
  250. package/LexicalTypeaheadMenuPlugin.prod.mjs +3 -1
  251. package/package.json +20 -19
  252. package/shared/useCharacterLimit.d.ts +1 -1
  253. package/useLexicalEditable.dev.js +6 -2
  254. package/useLexicalEditable.dev.mjs +8 -4
  255. package/useLexicalEditable.js +2 -0
  256. package/useLexicalEditable.mjs +2 -0
  257. package/useLexicalEditable.node.mjs +2 -0
  258. package/useLexicalEditable.prod.js +3 -1
  259. package/useLexicalEditable.prod.mjs +3 -1
  260. package/useLexicalIsTextContentEmpty.dev.js +5 -2
  261. package/useLexicalIsTextContentEmpty.dev.mjs +7 -4
  262. package/useLexicalIsTextContentEmpty.js +2 -0
  263. package/useLexicalIsTextContentEmpty.mjs +2 -0
  264. package/useLexicalIsTextContentEmpty.node.mjs +2 -0
  265. package/useLexicalIsTextContentEmpty.prod.js +3 -1
  266. package/useLexicalIsTextContentEmpty.prod.mjs +3 -1
  267. package/useLexicalNodeSelection.dev.js +3 -0
  268. package/useLexicalNodeSelection.dev.mjs +4 -1
  269. package/useLexicalNodeSelection.js +2 -0
  270. package/useLexicalNodeSelection.mjs +2 -0
  271. package/useLexicalNodeSelection.node.mjs +2 -0
  272. package/useLexicalNodeSelection.prod.js +2 -0
  273. package/useLexicalNodeSelection.prod.mjs +3 -1
  274. package/useLexicalSubscription.dev.js +5 -2
  275. package/useLexicalSubscription.dev.mjs +7 -4
  276. package/useLexicalSubscription.js +2 -0
  277. package/useLexicalSubscription.mjs +2 -0
  278. package/useLexicalSubscription.node.mjs +2 -0
  279. package/useLexicalSubscription.prod.js +3 -1
  280. package/useLexicalSubscription.prod.mjs +3 -1
  281. package/useLexicalTextEntity.dev.js +3 -0
  282. package/useLexicalTextEntity.dev.mjs +3 -0
  283. package/useLexicalTextEntity.js +2 -0
  284. package/useLexicalTextEntity.mjs +2 -0
  285. package/useLexicalTextEntity.node.mjs +2 -0
  286. package/useLexicalTextEntity.prod.js +2 -0
  287. package/useLexicalTextEntity.prod.mjs +2 -0
@@ -3,9 +3,11 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
8
+
7
9
  import { $isRootTextContentEmptyCurry } from '@lexical/text';
8
- import { useLayoutEffect as useLayoutEffect$1, useEffect, useState } from 'react';
10
+ import { useLayoutEffect, useEffect, useState } from 'react';
9
11
 
10
12
  /**
11
13
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -24,8 +26,8 @@ const CAN_USE_DOM = typeof window !== 'undefined' && typeof window.document !==
24
26
  * LICENSE file in the root directory of this source tree.
25
27
  *
26
28
  */
27
- const useLayoutEffectImpl = CAN_USE_DOM ? useLayoutEffect$1 : useEffect;
28
- var useLayoutEffect = useLayoutEffectImpl;
29
+
30
+ const useLayoutEffectImpl = CAN_USE_DOM ? useLayoutEffect : useEffect;
29
31
 
30
32
  /**
31
33
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -34,9 +36,10 @@ var useLayoutEffect = useLayoutEffectImpl;
34
36
  * LICENSE file in the root directory of this source tree.
35
37
  *
36
38
  */
39
+
37
40
  function useLexicalIsTextContentEmpty(editor, trim) {
38
41
  const [isEmpty, setIsEmpty] = useState(editor.getEditorState().read($isRootTextContentEmptyCurry(editor.isComposing(), trim)));
39
- useLayoutEffect(() => {
42
+ useLayoutEffectImpl(() => {
40
43
  return editor.registerUpdateListener(({
41
44
  editorState
42
45
  }) => {
@@ -3,7 +3,9 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
8
+
7
9
  'use strict'
8
10
  const useLexicalIsTextContentEmpty = process.env.NODE_ENV === 'development' ? require('./useLexicalIsTextContentEmpty.dev.js') : require('./useLexicalIsTextContentEmpty.prod.js');
9
11
  module.exports = useLexicalIsTextContentEmpty;
@@ -3,7 +3,9 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
8
+
7
9
  import * as modDev from './useLexicalIsTextContentEmpty.dev.mjs';
8
10
  import * as modProd from './useLexicalIsTextContentEmpty.prod.mjs';
9
11
  const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
@@ -3,6 +3,8 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
8
+
7
9
  const mod = await (process.env.NODE_ENV === 'development' ? import('./useLexicalIsTextContentEmpty.dev.mjs') : import('./useLexicalIsTextContentEmpty.prod.mjs'));
8
10
  export const useLexicalIsTextContentEmpty = mod.useLexicalIsTextContentEmpty;
@@ -3,5 +3,7 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
7
- 'use strict';var b=require("@lexical/text"),e=require("react"),f="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement?e.useLayoutEffect:e.useEffect;exports.useLexicalIsTextContentEmpty=function(a,c){let [g,h]=e.useState(a.getEditorState().read(b.$isRootTextContentEmptyCurry(a.isComposing(),c)));f(()=>a.registerUpdateListener(({editorState:d})=>{let k=a.isComposing();d=d.read(b.$isRootTextContentEmptyCurry(k,c));h(d)}),[a,c]);return g}
8
+
9
+ 'use strict';var b=require("@lexical/text"),e=require("react");let f="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement?e.useLayoutEffect:e.useEffect;exports.useLexicalIsTextContentEmpty=function(a,c){let [g,h]=e.useState(a.getEditorState().read(b.$isRootTextContentEmptyCurry(a.isComposing(),c)));f(()=>a.registerUpdateListener(({editorState:d})=>{let k=a.isComposing();d=d.read(b.$isRootTextContentEmptyCurry(k,c));h(d)}),[a,c]);return g}
@@ -3,5 +3,7 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
7
- import{$isRootTextContentEmptyCurry as e}from"@lexical/text";import{useLayoutEffect as t,useEffect as o,useState as i}from"react";var r="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t:o;function n(t,o){const[n,d]=i(t.getEditorState().read(e(t.isComposing(),o)));return r((()=>t.registerUpdateListener((({editorState:i})=>{const r=t.isComposing(),n=i.read(e(r,o));d(n)}))),[t,o]),n}export{n as useLexicalIsTextContentEmpty};
8
+
9
+ import{$isRootTextContentEmptyCurry as t}from"@lexical/text";import{useLayoutEffect as e,useEffect as o,useState as i}from"react";const n="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?e:o;function r(e,o){const[r,d]=i(e.getEditorState().read(t(e.isComposing(),o)));return n((()=>e.registerUpdateListener((({editorState:i})=>{const n=e.isComposing(),r=i.read(t(n,o));d(r)}))),[e,o]),r}export{r as useLexicalIsTextContentEmpty};
@@ -3,7 +3,9 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
8
+
7
9
  'use strict';
8
10
 
9
11
  var LexicalComposerContext = require('@lexical/react/LexicalComposerContext');
@@ -17,6 +19,7 @@ var react = require('react');
17
19
  * LICENSE file in the root directory of this source tree.
18
20
  *
19
21
  */
22
+
20
23
  function isNodeSelected(editor, key) {
21
24
  return editor.getEditorState().read(() => {
22
25
  const node = lexical.$getNodeByKey(key);
@@ -3,9 +3,11 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
8
+
7
9
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
8
- import { $getNodeByKey, $getSelection, $isNodeSelection, $createNodeSelection, $setSelection } from 'lexical';
10
+ import { $getSelection, $isNodeSelection, $createNodeSelection, $setSelection, $getNodeByKey } from 'lexical';
9
11
  import { useState, useEffect, useCallback } from 'react';
10
12
 
11
13
  /**
@@ -15,6 +17,7 @@ import { useState, useEffect, useCallback } from 'react';
15
17
  * LICENSE file in the root directory of this source tree.
16
18
  *
17
19
  */
20
+
18
21
  function isNodeSelected(editor, key) {
19
22
  return editor.getEditorState().read(() => {
20
23
  const node = $getNodeByKey(key);
@@ -3,7 +3,9 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
8
+
7
9
  'use strict'
8
10
  const useLexicalNodeSelection = process.env.NODE_ENV === 'development' ? require('./useLexicalNodeSelection.dev.js') : require('./useLexicalNodeSelection.prod.js');
9
11
  module.exports = useLexicalNodeSelection;
@@ -3,7 +3,9 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
8
+
7
9
  import * as modDev from './useLexicalNodeSelection.dev.mjs';
8
10
  import * as modProd from './useLexicalNodeSelection.prod.mjs';
9
11
  const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
@@ -3,6 +3,8 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
8
+
7
9
  const mod = await (process.env.NODE_ENV === 'development' ? import('./useLexicalNodeSelection.dev.mjs') : import('./useLexicalNodeSelection.prod.mjs'));
8
10
  export const useLexicalNodeSelection = mod.useLexicalNodeSelection;
@@ -3,7 +3,9 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
8
+
7
9
  'use strict';var b=require("@lexical/react/LexicalComposerContext"),f=require("lexical"),h=require("react");function k(c,a){return c.getEditorState().read(()=>{let g=f.$getNodeByKey(a);return null===g?!1:g.isSelected()})}
8
10
  exports.useLexicalNodeSelection=function(c){let [a]=b.useLexicalComposerContext(),[g,l]=h.useState(()=>k(a,c));h.useEffect(()=>{let e=!0,d=a.registerUpdateListener(()=>{e&&l(k(a,c))});return()=>{e=!1;d()}},[a,c]);let m=h.useCallback(e=>{a.update(()=>{let d=f.$getSelection();f.$isNodeSelection(d)||(d=f.$createNodeSelection(),f.$setSelection(d));f.$isNodeSelection(d)&&(e?d.add(c):d.delete(c))})},[a,c]),n=h.useCallback(()=>{a.update(()=>{const e=f.$getSelection();f.$isNodeSelection(e)&&e.clear()})},
9
11
  [a]);return[g,m,n]}
@@ -3,5 +3,7 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
7
- import{useLexicalComposerContext as e}from"@lexical/react/LexicalComposerContext";import{$getNodeByKey as t,$getSelection as r,$isNodeSelection as o,$createNodeSelection as n,$setSelection as c}from"lexical";import{useState as a,useEffect as i,useCallback as l}from"react";function d(e,r){return e.getEditorState().read((()=>{const e=t(r);return null!==e&&e.isSelected()}))}function u(t){const[u]=e(),[p,s]=a((()=>d(u,t)));i((()=>{let e=!0;const r=u.registerUpdateListener((()=>{e&&s(d(u,t))}));return()=>{e=!1,r()}}),[u,t]);return[p,l((e=>{u.update((()=>{let a=r();o(a)||(a=n(),c(a)),o(a)&&(e?a.add(t):a.delete(t))}))}),[u,t]),l((()=>{u.update((()=>{const e=r();o(e)&&e.clear()}))}),[u])]}export{u as useLexicalNodeSelection};
8
+
9
+ import{useLexicalComposerContext as e}from"@lexical/react/LexicalComposerContext";import{$getSelection as t,$isNodeSelection as r,$createNodeSelection as o,$setSelection as n,$getNodeByKey as c}from"lexical";import{useState as a,useEffect as i,useCallback as l}from"react";function d(e,t){return e.getEditorState().read((()=>{const e=c(t);return null!==e&&e.isSelected()}))}function u(c){const[u]=e(),[p,s]=a((()=>d(u,c)));i((()=>{let e=!0;const t=u.registerUpdateListener((()=>{e&&s(d(u,c))}));return()=>{e=!1,t()}}),[u,c]);return[p,l((e=>{u.update((()=>{let a=t();r(a)||(a=o(),n(a)),r(a)&&(e?a.add(c):a.delete(c))}))}),[u,c]),l((()=>{u.update((()=>{const e=t();r(e)&&e.clear()}))}),[u])]}export{u as useLexicalNodeSelection};
@@ -3,7 +3,9 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
8
+
7
9
  'use strict';
8
10
 
9
11
  var LexicalComposerContext = require('@lexical/react/LexicalComposerContext');
@@ -26,8 +28,8 @@ const CAN_USE_DOM = typeof window !== 'undefined' && typeof window.document !==
26
28
  * LICENSE file in the root directory of this source tree.
27
29
  *
28
30
  */
31
+
29
32
  const useLayoutEffectImpl = CAN_USE_DOM ? react.useLayoutEffect : react.useEffect;
30
- var useLayoutEffect = useLayoutEffectImpl;
31
33
 
32
34
  /**
33
35
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -36,6 +38,7 @@ var useLayoutEffect = useLayoutEffectImpl;
36
38
  * LICENSE file in the root directory of this source tree.
37
39
  *
38
40
  */
41
+
39
42
  /**
40
43
  * Shortcut to Lexical subscriptions when values are used for render.
41
44
  */
@@ -44,7 +47,7 @@ function useLexicalSubscription(subscription) {
44
47
  const initializedSubscription = react.useMemo(() => subscription(editor), [editor, subscription]);
45
48
  const valueRef = react.useRef(initializedSubscription.initialValueFn());
46
49
  const [value, setValue] = react.useState(valueRef.current);
47
- useLayoutEffect(() => {
50
+ useLayoutEffectImpl(() => {
48
51
  const {
49
52
  initialValueFn,
50
53
  subscribe
@@ -3,9 +3,11 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
8
+
7
9
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
8
- import { useLayoutEffect as useLayoutEffect$1, useEffect, useMemo, useRef, useState } from 'react';
10
+ import { useLayoutEffect, useEffect, useMemo, useRef, useState } from 'react';
9
11
 
10
12
  /**
11
13
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -24,8 +26,8 @@ const CAN_USE_DOM = typeof window !== 'undefined' && typeof window.document !==
24
26
  * LICENSE file in the root directory of this source tree.
25
27
  *
26
28
  */
27
- const useLayoutEffectImpl = CAN_USE_DOM ? useLayoutEffect$1 : useEffect;
28
- var useLayoutEffect = useLayoutEffectImpl;
29
+
30
+ const useLayoutEffectImpl = CAN_USE_DOM ? useLayoutEffect : useEffect;
29
31
 
30
32
  /**
31
33
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -34,6 +36,7 @@ var useLayoutEffect = useLayoutEffectImpl;
34
36
  * LICENSE file in the root directory of this source tree.
35
37
  *
36
38
  */
39
+
37
40
  /**
38
41
  * Shortcut to Lexical subscriptions when values are used for render.
39
42
  */
@@ -42,7 +45,7 @@ function useLexicalSubscription(subscription) {
42
45
  const initializedSubscription = useMemo(() => subscription(editor), [editor, subscription]);
43
46
  const valueRef = useRef(initializedSubscription.initialValueFn());
44
47
  const [value, setValue] = useState(valueRef.current);
45
- useLayoutEffect(() => {
48
+ useLayoutEffectImpl(() => {
46
49
  const {
47
50
  initialValueFn,
48
51
  subscribe
@@ -3,7 +3,9 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
8
+
7
9
  'use strict'
8
10
  const useLexicalSubscription = process.env.NODE_ENV === 'development' ? require('./useLexicalSubscription.dev.js') : require('./useLexicalSubscription.prod.js');
9
11
  module.exports = useLexicalSubscription;
@@ -3,7 +3,9 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
8
+
7
9
  import * as modDev from './useLexicalSubscription.dev.mjs';
8
10
  import * as modProd from './useLexicalSubscription.prod.mjs';
9
11
  const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
@@ -3,6 +3,8 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
8
+
7
9
  const mod = await (process.env.NODE_ENV === 'development' ? import('./useLexicalSubscription.dev.mjs') : import('./useLexicalSubscription.prod.mjs'));
8
10
  export default mod.default;
@@ -3,6 +3,8 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
7
- 'use strict';var a=require("@lexical/react/LexicalComposerContext"),k=require("react"),l="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement?k.useLayoutEffect:k.useEffect;
8
+
9
+ 'use strict';var a=require("@lexical/react/LexicalComposerContext"),k=require("react");let l="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement?k.useLayoutEffect:k.useEffect;
8
10
  module.exports=function(c){let [f]=a.useLexicalComposerContext(),d=k.useMemo(()=>c(f),[f,c]),b=k.useRef(d.initialValueFn()),[m,g]=k.useState(b.current);l(()=>{let {initialValueFn:n,subscribe:p}=d,e=n();b.current!==e&&(b.current=e,g(e));return p(h=>{b.current=h;g(h)})},[d,c]);return m}
@@ -3,5 +3,7 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
7
- import{useLexicalComposerContext as e}from"@lexical/react/LexicalComposerContext";import{useLayoutEffect as t,useEffect as n,useMemo as r,useRef as o,useState as i}from"react";var c="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t:n;function u(t){const[n]=e(),u=r((()=>t(n)),[n,t]),a=o(u.initialValueFn()),[d,l]=i(a.current);return c((()=>{const{initialValueFn:e,subscribe:t}=u,n=e();return a.current!==n&&(a.current=n,l(n)),t((e=>{a.current=e,l(e)}))}),[u,t]),d}export{u as default};
8
+
9
+ import{useLexicalComposerContext as e}from"@lexical/react/LexicalComposerContext";import{useLayoutEffect as t,useEffect as n,useMemo as r,useRef as o,useState as i}from"react";const c="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement?t:n;function u(t){const[n]=e(),u=r((()=>t(n)),[n,t]),a=o(u.initialValueFn()),[d,l]=i(a.current);return c((()=>{const{initialValueFn:e,subscribe:t}=u,n=e();return a.current!==n&&(a.current=n,l(n)),t((e=>{a.current=e,l(e)}))}),[u,t]),d}export{u as default};
@@ -3,7 +3,9 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
8
+
7
9
  'use strict';
8
10
 
9
11
  var LexicalComposerContext = require('@lexical/react/LexicalComposerContext');
@@ -18,6 +20,7 @@ var react = require('react');
18
20
  * LICENSE file in the root directory of this source tree.
19
21
  *
20
22
  */
23
+
21
24
  function useLexicalTextEntity(getMatch, targetNode, createNode) {
22
25
  const [editor] = LexicalComposerContext.useLexicalComposerContext();
23
26
  react.useEffect(() => {
@@ -3,7 +3,9 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
8
+
7
9
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
8
10
  import { registerLexicalTextEntity } from '@lexical/text';
9
11
  import { mergeRegister } from '@lexical/utils';
@@ -16,6 +18,7 @@ import { useEffect } from 'react';
16
18
  * LICENSE file in the root directory of this source tree.
17
19
  *
18
20
  */
21
+
19
22
  function useLexicalTextEntity(getMatch, targetNode, createNode) {
20
23
  const [editor] = useLexicalComposerContext();
21
24
  useEffect(() => {
@@ -3,7 +3,9 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
8
+
7
9
  'use strict'
8
10
  const useLexicalTextEntity = process.env.NODE_ENV === 'development' ? require('./useLexicalTextEntity.dev.js') : require('./useLexicalTextEntity.prod.js');
9
11
  module.exports = useLexicalTextEntity;
@@ -3,7 +3,9 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
8
+
7
9
  import * as modDev from './useLexicalTextEntity.dev.mjs';
8
10
  import * as modProd from './useLexicalTextEntity.prod.mjs';
9
11
  const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
@@ -3,6 +3,8 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
8
+
7
9
  const mod = await (process.env.NODE_ENV === 'development' ? import('./useLexicalTextEntity.dev.mjs') : import('./useLexicalTextEntity.prod.mjs'));
8
10
  export const useLexicalTextEntity = mod.useLexicalTextEntity;
@@ -3,5 +3,7 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
8
+
7
9
  'use strict';var e=require("@lexical/react/LexicalComposerContext"),f=require("@lexical/text"),g=require("@lexical/utils"),h=require("react");exports.useLexicalTextEntity=function(a,b,c){let [d]=e.useLexicalComposerContext();h.useEffect(()=>g.mergeRegister(...f.registerLexicalTextEntity(d,a,b,c)),[c,d,a,b])}
@@ -3,5 +3,7 @@
3
3
  *
4
4
  * This source code is licensed under the MIT license found in the
5
5
  * LICENSE file in the root directory of this source tree.
6
+ *
6
7
  */
8
+
7
9
  import{useLexicalComposerContext as o}from"@lexical/react/LexicalComposerContext";import{registerLexicalTextEntity as t}from"@lexical/text";import{mergeRegister as r}from"@lexical/utils";import{useEffect as e}from"react";function i(i,m,c){const[l]=o();e((()=>r(...t(l,i,m,c))),[c,l,i,m])}export{i as useLexicalTextEntity};