@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,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 { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection';
9
11
  import { mergeRegister } from '@lexical/utils';
@@ -18,13 +20,14 @@ import { useCallback, useEffect } from 'react';
18
20
  * LICENSE file in the root directory of this source tree.
19
21
  *
20
22
  */
23
+
21
24
  const INSERT_HORIZONTAL_RULE_COMMAND = createCommand('INSERT_HORIZONTAL_RULE_COMMAND');
22
25
  function HorizontalRuleComponent({
23
26
  nodeKey
24
27
  }) {
25
28
  const [editor] = useLexicalComposerContext();
26
29
  const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey);
27
- const onDelete = useCallback(event => {
30
+ const $onDelete = useCallback(event => {
28
31
  if (isSelected && $isNodeSelection($getSelection())) {
29
32
  event.preventDefault();
30
33
  const node = $getNodeByKey(nodeKey);
@@ -46,8 +49,8 @@ function HorizontalRuleComponent({
46
49
  return true;
47
50
  }
48
51
  return false;
49
- }, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_DELETE_COMMAND, onDelete, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_BACKSPACE_COMMAND, onDelete, COMMAND_PRIORITY_LOW));
50
- }, [clearSelection, editor, isSelected, nodeKey, onDelete, setSelected]);
52
+ }, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_DELETE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_BACKSPACE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW));
53
+ }, [clearSelection, editor, isSelected, nodeKey, $onDelete, setSelected]);
51
54
  useEffect(() => {
52
55
  const hrElem = editor.getElementByKey(nodeKey);
53
56
  if (hrElem !== null) {
@@ -69,7 +72,7 @@ class HorizontalRuleNode extends DecoratorNode {
69
72
  static importDOM() {
70
73
  return {
71
74
  hr: () => ({
72
- conversion: convertHorizontalRuleElement,
75
+ conversion: $convertHorizontalRuleElement,
73
76
  priority: 0
74
77
  })
75
78
  };
@@ -103,7 +106,7 @@ class HorizontalRuleNode extends DecoratorNode {
103
106
  });
104
107
  }
105
108
  }
106
- function convertHorizontalRuleElement() {
109
+ function $convertHorizontalRuleElement() {
107
110
  return {
108
111
  node: $createHorizontalRuleNode()
109
112
  };
@@ -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 LexicalHorizontalRuleNode = process.env.NODE_ENV === 'development' ? require('./LexicalHorizontalRuleNode.dev.js') : require('./LexicalHorizontalRuleNode.prod.js');
9
11
  module.exports = LexicalHorizontalRuleNode;
@@ -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 './LexicalHorizontalRuleNode.dev.mjs';
8
10
  import * as modProd from './LexicalHorizontalRuleNode.prod.mjs';
9
11
  const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
@@ -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
  const mod = await (process.env.NODE_ENV === 'development' ? import('./LexicalHorizontalRuleNode.dev.mjs') : import('./LexicalHorizontalRuleNode.prod.mjs'));
8
10
  export const $createHorizontalRuleNode = mod.$createHorizontalRuleNode;
9
11
  export const $isHorizontalRuleNode = mod.$isHorizontalRuleNode;
@@ -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
  */
7
- 'use strict';var a=require("@lexical/react/LexicalComposerContext"),f=require("@lexical/react/useLexicalNodeSelection"),g=require("@lexical/utils"),k=require("lexical"),n=require("react");let p=k.createCommand("INSERT_HORIZONTAL_RULE_COMMAND");
8
- function q({nodeKey:b}){let [d]=a.useLexicalComposerContext(),[e,l,m]=f.useLexicalNodeSelection(b),h=n.useCallback(c=>e&&k.$isNodeSelection(k.$getSelection())&&(c.preventDefault(),c=k.$getNodeByKey(b),r(c))?(c.remove(),!0):!1,[e,b]);n.useEffect(()=>g.mergeRegister(d.registerCommand(k.CLICK_COMMAND,c=>{let v=d.getElementByKey(b);return c.target===v?(c.shiftKey||m(),l(!e),!0):!1},k.COMMAND_PRIORITY_LOW),d.registerCommand(k.KEY_DELETE_COMMAND,h,k.COMMAND_PRIORITY_LOW),d.registerCommand(k.KEY_BACKSPACE_COMMAND,
9
- h,k.COMMAND_PRIORITY_LOW)),[m,d,e,b,h,l]);n.useEffect(()=>{let c=d.getElementByKey(b);null!==c&&(c.className=e?"selected":"")},[d,e,b]);return null}
10
- class t extends k.DecoratorNode{static getType(){return"horizontalrule"}static clone(b){return new t(b.__key)}static importJSON(){return u()}static importDOM(){return{hr:()=>({conversion:w,priority:0})}}exportJSON(){return{type:"horizontalrule",version:1}}exportDOM(){return{element:document.createElement("hr")}}createDOM(){return document.createElement("hr")}getTextContent(){return"\n"}isInline(){return!1}updateDOM(){return!1}decorate(){return n.createElement(q,{nodeKey:this.__key})}}
11
- function w(){return{node:u()}}function u(){return k.$applyNodeReplacement(new t)}function r(b){return b instanceof t}exports.$createHorizontalRuleNode=u;exports.$isHorizontalRuleNode=r;exports.HorizontalRuleNode=t;exports.INSERT_HORIZONTAL_RULE_COMMAND=p
8
+
9
+ 'use strict';var a=require("@lexical/react/LexicalComposerContext"),d=require("@lexical/react/useLexicalNodeSelection"),g=require("@lexical/utils"),h=require("lexical"),l=require("react"),m=Object.create(null);if(l)for(var q in l)m[q]=l[q];m.default=l;let r=h.createCommand("INSERT_HORIZONTAL_RULE_COMMAND");
10
+ function t({nodeKey:b}){let [e]=a.useLexicalComposerContext(),[f,n,p]=d.useLexicalNodeSelection(b),k=l.useCallback(c=>f&&h.$isNodeSelection(h.$getSelection())&&(c.preventDefault(),c=h.$getNodeByKey(b),u(c))?(c.remove(),!0):!1,[f,b]);l.useEffect(()=>g.mergeRegister(e.registerCommand(h.CLICK_COMMAND,c=>{let x=e.getElementByKey(b);return c.target===x?(c.shiftKey||p(),n(!f),!0):!1},h.COMMAND_PRIORITY_LOW),e.registerCommand(h.KEY_DELETE_COMMAND,k,h.COMMAND_PRIORITY_LOW),e.registerCommand(h.KEY_BACKSPACE_COMMAND,
11
+ k,h.COMMAND_PRIORITY_LOW)),[p,e,f,b,k,n]);l.useEffect(()=>{let c=e.getElementByKey(b);null!==c&&(c.className=f?"selected":"")},[e,f,b]);return null}
12
+ class v extends h.DecoratorNode{static getType(){return"horizontalrule"}static clone(b){return new v(b.__key)}static importJSON(){return w()}static importDOM(){return{hr:()=>({conversion:y,priority:0})}}exportJSON(){return{type:"horizontalrule",version:1}}exportDOM(){return{element:document.createElement("hr")}}createDOM(){return document.createElement("hr")}getTextContent(){return"\n"}isInline(){return!1}updateDOM(){return!1}decorate(){return m.createElement(t,{nodeKey:this.__key})}}
13
+ function y(){return{node:w()}}function w(){return h.$applyNodeReplacement(new v)}function u(b){return b instanceof v}exports.$createHorizontalRuleNode=w;exports.$isHorizontalRuleNode=u;exports.HorizontalRuleNode=v;exports.INSERT_HORIZONTAL_RULE_COMMAND=r
@@ -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 e}from"@lexical/react/LexicalComposerContext";import{useLexicalNodeSelection as t}from"@lexical/react/useLexicalNodeSelection";import{mergeRegister as r}from"@lexical/utils";import{createCommand as n,DecoratorNode as o,$applyNodeReplacement as i,$isNodeSelection as c,$getSelection as a,$getNodeByKey as l,CLICK_COMMAND as u,COMMAND_PRIORITY_LOW as m,KEY_DELETE_COMMAND as s,KEY_BACKSPACE_COMMAND as p}from"lexical";import*as f from"react";import{useCallback as d,useEffect as x}from"react";const y=n("INSERT_HORIZONTAL_RULE_COMMAND");function O({nodeKey:n}){const[o]=e(),[i,f,y]=t(n),O=d((e=>{if(i&&c(a())){e.preventDefault();const t=l(n);if(E(t))return t.remove(),!0}return!1}),[i,n]);return x((()=>r(o.registerCommand(u,(e=>{const t=o.getElementByKey(n);return e.target===t&&(e.shiftKey||y(),f(!i),!0)}),m),o.registerCommand(s,O,m),o.registerCommand(p,O,m))),[y,o,i,n,O,f]),x((()=>{const e=o.getElementByKey(n);null!==e&&(e.className=i?"selected":"")}),[o,i,n]),null}class g extends o{static getType(){return"horizontalrule"}static clone(e){return new g(e.__key)}static importJSON(e){return C()}static importDOM(){return{hr:()=>({conversion:h,priority:0})}}exportJSON(){return{type:"horizontalrule",version:1}}exportDOM(){return{element:document.createElement("hr")}}createDOM(){return document.createElement("hr")}getTextContent(){return"\n"}isInline(){return!1}updateDOM(){return!1}decorate(){return f.createElement(O,{nodeKey:this.__key})}}function h(){return{node:C()}}function C(){return i(new g)}function E(e){return e instanceof g}export{C as $createHorizontalRuleNode,E as $isHorizontalRuleNode,g as HorizontalRuleNode,y as INSERT_HORIZONTAL_RULE_COMMAND};
@@ -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');
@@ -19,6 +21,7 @@ var react = require('react');
19
21
  * LICENSE file in the root directory of this source tree.
20
22
  *
21
23
  */
24
+
22
25
  function HorizontalRulePlugin() {
23
26
  const [editor] = LexicalComposerContext.useLexicalComposerContext();
24
27
  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 { INSERT_HORIZONTAL_RULE_COMMAND, $createHorizontalRuleNode } from '@lexical/react/LexicalHorizontalRuleNode';
9
11
  import { $insertNodeToNearestRoot } from '@lexical/utils';
@@ -17,6 +19,7 @@ import { useEffect } from 'react';
17
19
  * LICENSE file in the root directory of this source tree.
18
20
  *
19
21
  */
22
+
20
23
  function HorizontalRulePlugin() {
21
24
  const [editor] = useLexicalComposerContext();
22
25
  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 LexicalHorizontalRulePlugin = process.env.NODE_ENV === 'development' ? require('./LexicalHorizontalRulePlugin.dev.js') : require('./LexicalHorizontalRulePlugin.prod.js');
9
11
  module.exports = LexicalHorizontalRulePlugin;
@@ -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 './LexicalHorizontalRulePlugin.dev.mjs';
8
10
  import * as modProd from './LexicalHorizontalRulePlugin.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('./LexicalHorizontalRulePlugin.dev.mjs') : import('./LexicalHorizontalRulePlugin.prod.mjs'));
8
10
  export const HorizontalRulePlugin = mod.HorizontalRulePlugin;
@@ -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
  'use strict';var b=require("@lexical/react/LexicalComposerContext"),c=require("@lexical/react/LexicalHorizontalRuleNode"),e=require("@lexical/utils"),f=require("lexical"),g=require("react");
8
10
  exports.HorizontalRulePlugin=function(){let [d]=b.useLexicalComposerContext();g.useEffect(()=>d.registerCommand(c.INSERT_HORIZONTAL_RULE_COMMAND,()=>{var a=f.$getSelection();if(!f.$isRangeSelection(a))return!1;null!==a.focus.getNode()&&(a=c.$createHorizontalRuleNode(),e.$insertNodeToNearestRoot(a));return!0},f.COMMAND_PRIORITY_EDITOR),[d]);return null}
@@ -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{INSERT_HORIZONTAL_RULE_COMMAND as r,$createHorizontalRuleNode as t}from"@lexical/react/LexicalHorizontalRuleNode";import{$insertNodeToNearestRoot as e}from"@lexical/utils";import{$getSelection as i,$isRangeSelection as l,COMMAND_PRIORITY_EDITOR as c}from"lexical";import{useEffect as m}from"react";function n(){const[n]=o();return m((()=>n.registerCommand(r,(o=>{const r=i();if(!l(r))return!1;if(null!==r.focus.getNode()){const o=t();e(o)}return!0}),c)),[n]),null}export{n as HorizontalRulePlugin};
@@ -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 link = require('@lexical/link');
@@ -19,6 +21,7 @@ var react = require('react');
19
21
  * LICENSE file in the root directory of this source tree.
20
22
  *
21
23
  */
24
+
22
25
  function LinkPlugin({
23
26
  validateUrl
24
27
  }) {
@@ -29,11 +32,11 @@ function LinkPlugin({
29
32
  }
30
33
  return utils.mergeRegister(editor.registerCommand(link.TOGGLE_LINK_COMMAND, payload => {
31
34
  if (payload === null) {
32
- link.toggleLink(payload);
35
+ link.$toggleLink(payload);
33
36
  return true;
34
37
  } else if (typeof payload === 'string') {
35
38
  if (validateUrl === undefined || validateUrl(payload)) {
36
- link.toggleLink(payload);
39
+ link.$toggleLink(payload);
37
40
  return true;
38
41
  }
39
42
  return false;
@@ -44,7 +47,7 @@ function LinkPlugin({
44
47
  rel,
45
48
  title
46
49
  } = payload;
47
- link.toggleLink(url, {
50
+ link.$toggleLink(url, {
48
51
  rel,
49
52
  target,
50
53
  title
@@ -3,8 +3,10 @@
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 { LinkNode, TOGGLE_LINK_COMMAND, toggleLink } from '@lexical/link';
8
+
9
+ import { LinkNode, TOGGLE_LINK_COMMAND, $toggleLink } from '@lexical/link';
8
10
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
9
11
  import { mergeRegister, objectKlassEquals } from '@lexical/utils';
10
12
  import { COMMAND_PRIORITY_LOW, PASTE_COMMAND, $getSelection, $isRangeSelection, $isElementNode } from 'lexical';
@@ -17,6 +19,7 @@ import { useEffect } from 'react';
17
19
  * LICENSE file in the root directory of this source tree.
18
20
  *
19
21
  */
22
+
20
23
  function LinkPlugin({
21
24
  validateUrl
22
25
  }) {
@@ -27,11 +30,11 @@ function LinkPlugin({
27
30
  }
28
31
  return mergeRegister(editor.registerCommand(TOGGLE_LINK_COMMAND, payload => {
29
32
  if (payload === null) {
30
- toggleLink(payload);
33
+ $toggleLink(payload);
31
34
  return true;
32
35
  } else if (typeof payload === 'string') {
33
36
  if (validateUrl === undefined || validateUrl(payload)) {
34
- toggleLink(payload);
37
+ $toggleLink(payload);
35
38
  return true;
36
39
  }
37
40
  return false;
@@ -42,7 +45,7 @@ function LinkPlugin({
42
45
  rel,
43
46
  title
44
47
  } = payload;
45
- toggleLink(url, {
48
+ $toggleLink(url, {
46
49
  rel,
47
50
  target,
48
51
  title
@@ -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 LexicalLinkPlugin = process.env.NODE_ENV === 'development' ? require('./LexicalLinkPlugin.dev.js') : require('./LexicalLinkPlugin.prod.js');
9
11
  module.exports = LexicalLinkPlugin;
@@ -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 './LexicalLinkPlugin.dev.mjs';
8
10
  import * as modProd from './LexicalLinkPlugin.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('./LexicalLinkPlugin.dev.mjs') : import('./LexicalLinkPlugin.prod.mjs'));
8
10
  export const LinkPlugin = mod.LinkPlugin;
@@ -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/link"),c=require("@lexical/react/LexicalComposerContext"),k=require("@lexical/utils"),l=require("lexical"),m=require("react");
8
- exports.LinkPlugin=function({validateUrl:d}){let [e]=c.useLexicalComposerContext();m.useEffect(()=>{if(!e.hasNodes([b.LinkNode]))throw Error("LinkPlugin: LinkNode not registered on editor");return k.mergeRegister(e.registerCommand(b.TOGGLE_LINK_COMMAND,a=>{if(null===a)return b.toggleLink(a),!0;if("string"===typeof a)return void 0===d||d(a)?(b.toggleLink(a),!0):!1;let {url:f,target:g,rel:h,title:n}=a;b.toggleLink(f,{rel:h,target:g,title:n});return!0},l.COMMAND_PRIORITY_LOW),void 0!==d?e.registerCommand(l.PASTE_COMMAND,
10
+ exports.LinkPlugin=function({validateUrl:d}){let [e]=c.useLexicalComposerContext();m.useEffect(()=>{if(!e.hasNodes([b.LinkNode]))throw Error("LinkPlugin: LinkNode not registered on editor");return k.mergeRegister(e.registerCommand(b.TOGGLE_LINK_COMMAND,a=>{if(null===a)return b.$toggleLink(a),!0;if("string"===typeof a)return void 0===d||d(a)?(b.$toggleLink(a),!0):!1;let {url:f,target:g,rel:h,title:n}=a;b.$toggleLink(f,{rel:h,target:g,title:n});return!0},l.COMMAND_PRIORITY_LOW),void 0!==d?e.registerCommand(l.PASTE_COMMAND,
9
11
  a=>{let f=l.$getSelection();if(!l.$isRangeSelection(f)||f.isCollapsed()||!k.objectKlassEquals(a,ClipboardEvent)||null===a.clipboardData)return!1;let g=a.clipboardData.getData("text");return d(g)?f.getNodes().some(h=>l.$isElementNode(h))?!1:(e.dispatchCommand(b.TOGGLE_LINK_COMMAND,g),a.preventDefault(),!0):!1},l.COMMAND_PRIORITY_LOW):()=>{})},[e,d]);return null}
@@ -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{LinkNode as t,TOGGLE_LINK_COMMAND as r,toggleLink as e}from"@lexical/link";import{useLexicalComposerContext as o}from"@lexical/react/LexicalComposerContext";import{mergeRegister as i,objectKlassEquals as n}from"@lexical/utils";import{COMMAND_PRIORITY_LOW as l,PASTE_COMMAND as a,$getSelection as m,$isRangeSelection as s,$isElementNode as c}from"lexical";import{useEffect as d}from"react";function u({validateUrl:u}){const[p]=o();return d((()=>{if(!p.hasNodes([t]))throw new Error("LinkPlugin: LinkNode not registered on editor");return i(p.registerCommand(r,(t=>{if(null===t)return e(t),!0;if("string"==typeof t)return!(void 0!==u&&!u(t))&&(e(t),!0);{const{url:r,target:o,rel:i,title:n}=t;return e(r,{rel:i,target:o,title:n}),!0}}),l),void 0!==u?p.registerCommand(a,(t=>{const e=m();if(!s(e)||e.isCollapsed()||!n(t,ClipboardEvent))return!1;const o=t;if(null===o.clipboardData)return!1;const i=o.clipboardData.getData("text");return!!u(i)&&(!e.getNodes().some((t=>c(t)))&&(p.dispatchCommand(r,i),t.preventDefault(),!0))}),l):()=>{})}),[p,u]),null}export{u as LinkPlugin};
8
+
9
+ import{LinkNode as t,TOGGLE_LINK_COMMAND as r,$toggleLink as e}from"@lexical/link";import{useLexicalComposerContext as o}from"@lexical/react/LexicalComposerContext";import{mergeRegister as i,objectKlassEquals as n}from"@lexical/utils";import{COMMAND_PRIORITY_LOW as l,PASTE_COMMAND as a,$getSelection as m,$isRangeSelection as s,$isElementNode as c}from"lexical";import{useEffect as d}from"react";function u({validateUrl:u}){const[p]=o();return d((()=>{if(!p.hasNodes([t]))throw new Error("LinkPlugin: LinkNode not registered on editor");return i(p.registerCommand(r,(t=>{if(null===t)return e(t),!0;if("string"==typeof t)return!(void 0!==u&&!u(t))&&(e(t),!0);{const{url:r,target:o,rel:i,title:n}=t;return e(r,{rel:i,target:o,title:n}),!0}}),l),void 0!==u?p.registerCommand(a,(t=>{const e=m();if(!s(e)||e.isCollapsed()||!n(t,ClipboardEvent))return!1;const o=t;if(null===o.clipboardData)return!1;const i=o.clipboardData.getData("text");return!!u(i)&&(!e.getNodes().some((t=>c(t)))&&(p.dispatchCommand(r,i),t.preventDefault(),!0))}),l):()=>{})}),[p,u]),null}export{u as LinkPlugin};
@@ -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 list = require('@lexical/list');
@@ -19,6 +21,7 @@ var lexical = require('lexical');
19
21
  * LICENSE file in the root directory of this source tree.
20
22
  *
21
23
  */
24
+
22
25
  function useList(editor) {
23
26
  react.useEffect(() => {
24
27
  return utils.mergeRegister(editor.registerCommand(list.INSERT_ORDERED_LIST_COMMAND, () => {
@@ -47,6 +50,7 @@ function useList(editor) {
47
50
  * LICENSE file in the root directory of this source tree.
48
51
  *
49
52
  */
53
+
50
54
  function ListPlugin() {
51
55
  const [editor] = LexicalComposerContext.useLexicalComposerContext();
52
56
  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 { INSERT_ORDERED_LIST_COMMAND, insertList, INSERT_UNORDERED_LIST_COMMAND, REMOVE_LIST_COMMAND, removeList, $handleListInsertParagraph, ListNode, ListItemNode } from '@lexical/list';
8
10
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
9
11
  import { useEffect } from 'react';
@@ -17,6 +19,7 @@ import { COMMAND_PRIORITY_LOW, INSERT_PARAGRAPH_COMMAND } from 'lexical';
17
19
  * LICENSE file in the root directory of this source tree.
18
20
  *
19
21
  */
22
+
20
23
  function useList(editor) {
21
24
  useEffect(() => {
22
25
  return mergeRegister(editor.registerCommand(INSERT_ORDERED_LIST_COMMAND, () => {
@@ -45,6 +48,7 @@ function useList(editor) {
45
48
  * LICENSE file in the root directory of this source tree.
46
49
  *
47
50
  */
51
+
48
52
  function ListPlugin() {
49
53
  const [editor] = useLexicalComposerContext();
50
54
  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 LexicalListPlugin = process.env.NODE_ENV === 'development' ? require('./LexicalListPlugin.dev.js') : require('./LexicalListPlugin.prod.js');
9
11
  module.exports = LexicalListPlugin;
@@ -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 './LexicalListPlugin.dev.mjs';
8
10
  import * as modProd from './LexicalListPlugin.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('./LexicalListPlugin.dev.mjs') : import('./LexicalListPlugin.prod.mjs'));
8
10
  export const ListPlugin = mod.ListPlugin;
@@ -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/list"),c=require("@lexical/react/LexicalComposerContext"),d=require("react"),e=require("@lexical/utils"),f=require("lexical");
8
10
  function g(a){d.useEffect(()=>e.mergeRegister(a.registerCommand(b.INSERT_ORDERED_LIST_COMMAND,()=>{b.insertList(a,"number");return!0},f.COMMAND_PRIORITY_LOW),a.registerCommand(b.INSERT_UNORDERED_LIST_COMMAND,()=>{b.insertList(a,"bullet");return!0},f.COMMAND_PRIORITY_LOW),a.registerCommand(b.REMOVE_LIST_COMMAND,()=>{b.removeList(a);return!0},f.COMMAND_PRIORITY_LOW),a.registerCommand(f.INSERT_PARAGRAPH_COMMAND,()=>b.$handleListInsertParagraph()?!0:!1,f.COMMAND_PRIORITY_LOW)),[a])}
9
11
  exports.ListPlugin=function(){let [a]=c.useLexicalComposerContext();d.useEffect(()=>{if(!a.hasNodes([b.ListNode,b.ListItemNode]))throw Error("ListPlugin: ListNode and/or ListItemNode not registered on editor");},[a]);g(a);return null}
@@ -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{INSERT_ORDERED_LIST_COMMAND as r,insertList as e,INSERT_UNORDERED_LIST_COMMAND as o,REMOVE_LIST_COMMAND as t,removeList as i,$handleListInsertParagraph as m,ListNode as n,ListItemNode as l}from"@lexical/list";import{useLexicalComposerContext as s}from"@lexical/react/LexicalComposerContext";import{useEffect as a}from"react";import{mergeRegister as c}from"@lexical/utils";import{COMMAND_PRIORITY_LOW as d,INSERT_PARAGRAPH_COMMAND as f}from"lexical";function u(){const[u]=s();return a((()=>{if(!u.hasNodes([n,l]))throw new Error("ListPlugin: ListNode and/or ListItemNode not registered on editor")}),[u]),function(n){a((()=>c(n.registerCommand(r,(()=>(e(n,"number"),!0)),d),n.registerCommand(o,(()=>(e(n,"bullet"),!0)),d),n.registerCommand(t,(()=>(i(n),!0)),d),n.registerCommand(f,(()=>!!m()),d))),[n])}(u),null}export{u as ListPlugin};
@@ -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 markdown = require('@lexical/markdown');
@@ -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
  const HR = {
22
25
  dependencies: [LexicalHorizontalRuleNode.HorizontalRuleNode],
23
26
  export: node => {
@@ -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 { TRANSFORMERS, registerMarkdownShortcuts } from '@lexical/markdown';
8
10
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
9
11
  import { HorizontalRuleNode, $isHorizontalRuleNode, $createHorizontalRuleNode } from '@lexical/react/LexicalHorizontalRuleNode';
@@ -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
  const HR = {
20
23
  dependencies: [HorizontalRuleNode],
21
24
  export: node => {
@@ -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 LexicalMarkdownShortcutPlugin = process.env.NODE_ENV === 'development' ? require('./LexicalMarkdownShortcutPlugin.dev.js') : require('./LexicalMarkdownShortcutPlugin.prod.js');
9
11
  module.exports = LexicalMarkdownShortcutPlugin;
@@ -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 './LexicalMarkdownShortcutPlugin.dev.mjs';
8
10
  import * as modProd from './LexicalMarkdownShortcutPlugin.prod.mjs';
9
11
  const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;
@@ -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
  const mod = await (process.env.NODE_ENV === 'development' ? import('./LexicalMarkdownShortcutPlugin.dev.mjs') : import('./LexicalMarkdownShortcutPlugin.prod.mjs'));
8
10
  export const DEFAULT_TRANSFORMERS = mod.DEFAULT_TRANSFORMERS;
9
11
  export const MarkdownShortcutPlugin = mod.MarkdownShortcutPlugin;
@@ -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
  'use strict';var c=require("@lexical/markdown"),d=require("@lexical/react/LexicalComposerContext"),e=require("@lexical/react/LexicalHorizontalRuleNode"),f=require("react");let g=[{dependencies:[e.HorizontalRuleNode],export:a=>e.$isHorizontalRuleNode(a)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(a,b,k,h)=>{b=e.$createHorizontalRuleNode();h||null!=a.getNextSibling()?a.replace(b):a.insertBefore(b);b.selectNext()},type:"element"},...c.TRANSFORMERS];exports.DEFAULT_TRANSFORMERS=g;
8
10
  exports.MarkdownShortcutPlugin=function({transformers:a=g}){let [b]=d.useLexicalComposerContext();f.useEffect(()=>c.registerMarkdownShortcuts(b,a),[b,a]);return null}
@@ -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{TRANSFORMERS as e,registerMarkdownShortcuts as r}from"@lexical/markdown";import{useLexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{HorizontalRuleNode as o,$isHorizontalRuleNode as l,$createHorizontalRuleNode as n}from"@lexical/react/LexicalHorizontalRuleNode";import{useEffect as c}from"react";const i=[{dependencies:[o],export:e=>l(e)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,r,t,o)=>{const l=n();o||null!=e.getNextSibling()?e.replace(l):e.insertBefore(l),l.selectNext()},type:"element"},...e];function a({transformers:e=i}){const[o]=t();return c((()=>r(o,e)),[o,e]),null}export{i as DEFAULT_TRANSFORMERS,a as MarkdownShortcutPlugin};
@@ -3,13 +3,28 @@
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 LexicalCollaborationContext = require('@lexical/react/LexicalCollaborationContext');
10
12
  var LexicalComposerContext = require('@lexical/react/LexicalComposerContext');
11
13
  var React = require('react');
12
14
 
15
+ function _interopNamespaceDefault(e) {
16
+ var n = Object.create(null);
17
+ if (e) {
18
+ for (var k in e) {
19
+ n[k] = e[k];
20
+ }
21
+ }
22
+ n.default = e;
23
+ return n;
24
+ }
25
+
26
+ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
27
+
13
28
  /**
14
29
  * Copyright (c) Meta Platforms, Inc. and affiliates.
15
30
  *
@@ -17,6 +32,7 @@ var React = require('react');
17
32
  * LICENSE file in the root directory of this source tree.
18
33
  *
19
34
  */
35
+
20
36
  function getTransformSetFromKlass(klass) {
21
37
  const transform = klass.transform();
22
38
  return transform !== null ? new Set([transform]) : new Set();
@@ -102,7 +118,7 @@ function LexicalNestedComposer({
102
118
  initialEditor.setEditable(editable);
103
119
  });
104
120
  }, [initialEditor, parentEditor]);
105
- return /*#__PURE__*/React.createElement(LexicalComposerContext.LexicalComposerContext.Provider, {
121
+ return /*#__PURE__*/React__namespace.createElement(LexicalComposerContext.LexicalComposerContext.Provider, {
106
122
  value: composerContext
107
123
  }, !isCollabActive || isCollabReady ? children : null);
108
124
  }
@@ -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 { useCollaborationContext } from '@lexical/react/LexicalCollaborationContext';
8
10
  import { LexicalComposerContext, createLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
9
11
  import * as React from 'react';
@@ -16,6 +18,7 @@ import { useRef, useContext, useMemo, useEffect } from 'react';
16
18
  * LICENSE file in the root directory of this source tree.
17
19
  *
18
20
  */
21
+
19
22
  function getTransformSetFromKlass(klass) {
20
23
  const transform = klass.transform();
21
24
  return transform !== null ? new Set([transform]) : new Set();
@@ -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 LexicalNestedComposer = process.env.NODE_ENV === 'development' ? require('./LexicalNestedComposer.dev.js') : require('./LexicalNestedComposer.prod.js');
9
11
  module.exports = LexicalNestedComposer;
@@ -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 './LexicalNestedComposer.dev.mjs';
8
10
  import * as modProd from './LexicalNestedComposer.prod.mjs';
9
11
  const mod = process.env.NODE_ENV === 'development' ? modDev : modProd;