@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 * as modDev from './LexicalClickableLinkPlugin.dev.mjs';
8
10
  import * as modProd from './LexicalClickableLinkPlugin.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('./LexicalClickableLinkPlugin.dev.mjs') : import('./LexicalClickableLinkPlugin.prod.mjs'));
8
10
  export default mod.default;
@@ -3,8 +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
  */
7
- 'use strict';var e=require("@lexical/link"),n=require("@lexical/react/LexicalComposerContext"),r=require("@lexical/utils"),t=require("lexical"),u=require("react");
8
- module.exports=function({newTab:p=!0,disabled:h=!1}){let [k]=n.useLexicalComposerContext();u.useEffect(()=>{let m=a=>{if(h)a.preventDefault();else{var c=a.target;if(c instanceof Node){var d=t.getNearestEditorFromDOMNode(c);if(null!==d){var f=null,l=null;d.update(()=>{var b=t.$getNearestNodeFromDOMNode(c);if(null!==b)if(b=r.$findMatchingParent(b,t.$isElementNode),e.$isLinkNode(b))f=b.sanitizeUrl(b.getURL()),l=b.getTarget();else{a:{b=r.isHTMLAnchorElement;let g=c;for(;null!=g;){if(b(g)){b=g;break a}g=
9
- g.parentNode}b=null}null!==b&&(f=b.href,l=b.target)}});if(null!==f&&""!==f){d=k.getEditorState().read(t.$getSelection);if(!t.$isRangeSelection(d)||d.isCollapsed())d="auxclick"===a.type&&1===a.button,window.open(f,p||d||a.metaKey||a.ctrlKey||"_blank"===l?"_blank":"_self");a.preventDefault()}}}}},q=a=>{h||1!==a.button||m(a)};return k.registerRootListener((a,c)=>{null!==c&&(c.removeEventListener("click",m),c.removeEventListener("mouseup",q));null!==a&&(a.addEventListener("click",m),a.addEventListener("mouseup",
10
- q))})},[k,p,h]);return null}
8
+
9
+ 'use strict';var e=require("@lexical/link"),m=require("@lexical/react/LexicalComposerContext"),r=require("@lexical/utils"),t=require("lexical"),u=require("react");
10
+ module.exports=function({newTab:n=!0,disabled:p=!1}){let [h]=m.useLexicalComposerContext();u.useEffect(()=>{let l=b=>{const c=b.target;if(c instanceof Node){var d=t.getNearestEditorFromDOMNode(c);if(null!==d){var f=null,k=null;d.update(()=>{var a=t.$getNearestNodeFromDOMNode(c);if(null!==a&&(a=r.$findMatchingParent(a,t.$isElementNode),!p))if(e.$isLinkNode(a))f=a.sanitizeUrl(a.getURL()),k=a.getTarget();else{a:{a=r.isHTMLAnchorElement;let g=c;for(;null!=g;){if(a(g)){a=g;break a}g=g.parentNode}a=null}null!==
11
+ a&&(f=a.href,k=a.target)}});if(null!==f&&""!==f){d=h.getEditorState().read(t.$getSelection);if(!t.$isRangeSelection(d)||d.isCollapsed())d="auxclick"===b.type&&1===b.button,window.open(f,n||d||b.metaKey||b.ctrlKey||"_blank"===k?"_blank":"_self");b.preventDefault()}}}},q=b=>{1===b.button&&l(b)};return h.registerRootListener((b,c)=>{null!==c&&(c.removeEventListener("click",l),c.removeEventListener("mouseup",q));null!==b&&(b.addEventListener("click",l),b.addEventListener("mouseup",q))})},[h,n,p]);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{$isLinkNode as e}from"@lexical/link";import{useLexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{$findMatchingParent as n,isHTMLAnchorElement as r}from"@lexical/utils";import{getNearestEditorFromDOMNode as l,$getNearestNodeFromDOMNode as o,$isElementNode as i,$getSelection as u,$isRangeSelection as a}from"lexical";import{useEffect as s}from"react";function c({newTab:c=!0,disabled:f=!1}){const[p]=t();return s((()=>{const t=t=>{if(f)return void t.preventDefault();const s=t.target;if(!(s instanceof Node))return;const d=l(s);if(null===d)return;let m=null,v=null;if(d.update((()=>{const t=o(s);if(null!==t){const l=n(t,i);if(e(l))m=l.sanitizeUrl(l.getURL()),v=l.getTarget();else{const e=function(e,t){let n=e;for(;null!=n;){if(t(n))return n;n=n.parentNode}return null}(s,r);null!==e&&(m=e.href,v=e.target)}}})),null===m||""===m)return;const x=p.getEditorState().read(u);if(a(x)&&!x.isCollapsed())return void t.preventDefault();const g="auxclick"===t.type&&1===t.button;window.open(m,c||g||t.metaKey||t.ctrlKey||"_blank"===v?"_blank":"_self"),t.preventDefault()},s=e=>{f||1!==e.button||t(e)};return p.registerRootListener(((e,n)=>{null!==n&&(n.removeEventListener("click",t),n.removeEventListener("mouseup",s)),null!==e&&(e.addEventListener("click",t),e.addEventListener("mouseup",s))}))}),[p,c,f]),null}export{c as default};
8
+
9
+ import{$isLinkNode as e}from"@lexical/link";import{useLexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{$findMatchingParent as n,isHTMLAnchorElement as r}from"@lexical/utils";import{getNearestEditorFromDOMNode as l,$getNearestNodeFromDOMNode as o,$isElementNode as i,$getSelection as u,$isRangeSelection as a}from"lexical";import{useEffect as s}from"react";function c({newTab:c=!0,disabled:f=!1}){const[m]=t();return s((()=>{const t=t=>{const s=t.target;if(!(s instanceof Node))return;const p=l(s);if(null===p)return;let d=null,v=null;if(p.update((()=>{const t=o(s);if(null!==t){const l=n(t,i);if(!f)if(e(l))d=l.sanitizeUrl(l.getURL()),v=l.getTarget();else{const e=function(e,t){let n=e;for(;null!=n;){if(t(n))return n;n=n.parentNode}return null}(s,r);null!==e&&(d=e.href,v=e.target)}}})),null===d||""===d)return;const x=m.getEditorState().read(u);if(a(x)&&!x.isCollapsed())return void t.preventDefault();const g="auxclick"===t.type&&1===t.button;window.open(d,c||g||t.metaKey||t.ctrlKey||"_blank"===v?"_blank":"_self"),t.preventDefault()},s=e=>{1===e.button&&t(e)};return m.registerRootListener(((e,n)=>{null!==n&&(n.removeEventListener("click",t),n.removeEventListener("mouseup",s)),null!==e&&(e.addEventListener("click",t),e.addEventListener("mouseup",s))}))}),[m,c,f]),null}export{c 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 react = require('react');
@@ -15,6 +17,7 @@ var react = require('react');
15
17
  * LICENSE file in the root directory of this source tree.
16
18
  *
17
19
  */
20
+
18
21
  const entries = [['Cat', 'rgb(125, 50, 0)'], ['Dog', 'rgb(100, 0, 0)'], ['Rabbit', 'rgb(150, 0, 0)'], ['Frog', 'rgb(200, 0, 0)'], ['Fox', 'rgb(200, 75, 0)'], ['Hedgehog', 'rgb(0, 75, 0)'], ['Pigeon', 'rgb(0, 125, 0)'], ['Squirrel', 'rgb(75, 100, 0)'], ['Bear', 'rgb(125, 100, 0)'], ['Tiger', 'rgb(0, 0, 150)'], ['Leopard', 'rgb(0, 0, 200)'], ['Zebra', 'rgb(0, 0, 250)'], ['Wolf', 'rgb(0, 100, 150)'], ['Owl', 'rgb(0, 100, 100)'], ['Gull', 'rgb(100, 0, 100)'], ['Squid', 'rgb(150, 0, 150)']];
19
22
  const randomEntry = entries[Math.floor(Math.random() * entries.length)];
20
23
  const CollaborationContext = /*#__PURE__*/react.createContext({
@@ -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 { createContext, useContext } from 'react';
8
10
 
9
11
  /**
@@ -13,6 +15,7 @@ import { createContext, useContext } from 'react';
13
15
  * LICENSE file in the root directory of this source tree.
14
16
  *
15
17
  */
18
+
16
19
  const entries = [['Cat', 'rgb(125, 50, 0)'], ['Dog', 'rgb(100, 0, 0)'], ['Rabbit', 'rgb(150, 0, 0)'], ['Frog', 'rgb(200, 0, 0)'], ['Fox', 'rgb(200, 75, 0)'], ['Hedgehog', 'rgb(0, 75, 0)'], ['Pigeon', 'rgb(0, 125, 0)'], ['Squirrel', 'rgb(75, 100, 0)'], ['Bear', 'rgb(125, 100, 0)'], ['Tiger', 'rgb(0, 0, 150)'], ['Leopard', 'rgb(0, 0, 200)'], ['Zebra', 'rgb(0, 0, 250)'], ['Wolf', 'rgb(0, 100, 150)'], ['Owl', 'rgb(0, 100, 100)'], ['Gull', 'rgb(100, 0, 100)'], ['Squid', 'rgb(150, 0, 150)']];
17
20
  const randomEntry = entries[Math.floor(Math.random() * entries.length)];
18
21
  const CollaborationContext = /*#__PURE__*/createContext({
@@ -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 LexicalCollaborationContext = process.env.NODE_ENV === 'development' ? require('./LexicalCollaborationContext.dev.js') : require('./LexicalCollaborationContext.prod.js');
9
11
  module.exports = LexicalCollaborationContext;
@@ -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 './LexicalCollaborationContext.dev.mjs';
8
10
  import * as modProd from './LexicalCollaborationContext.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('./LexicalCollaborationContext.dev.mjs') : import('./LexicalCollaborationContext.prod.mjs'));
8
10
  export const CollaborationContext = mod.CollaborationContext;
9
11
  export const useCollaborationContext = mod.useCollaborationContext;
@@ -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("react");
8
10
  let c=[["Cat","rgb(125, 50, 0)"],["Dog","rgb(100, 0, 0)"],["Rabbit","rgb(150, 0, 0)"],["Frog","rgb(200, 0, 0)"],["Fox","rgb(200, 75, 0)"],["Hedgehog","rgb(0, 75, 0)"],["Pigeon","rgb(0, 125, 0)"],["Squirrel","rgb(75, 100, 0)"],["Bear","rgb(125, 100, 0)"],["Tiger","rgb(0, 0, 150)"],["Leopard","rgb(0, 0, 200)"],["Zebra","rgb(0, 0, 250)"],["Wolf","rgb(0, 100, 150)"],["Owl","rgb(0, 100, 100)"],["Gull","rgb(100, 0, 100)"],["Squid","rgb(150, 0, 150)"]],d=c[Math.floor(Math.random()*c.length)],e=b.createContext({clientID:0,
9
11
  color:d[1],isCollabActive:!1,name:d[0],yjsDocMap:new Map});exports.CollaborationContext=e;exports.useCollaborationContext=function(f,g){let a=b.useContext(e);null!=f&&(a.name=f);null!=g&&(a.color=g);return a}
@@ -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{createContext as r,useContext as g}from"react";const o=[["Cat","rgb(125, 50, 0)"],["Dog","rgb(100, 0, 0)"],["Rabbit","rgb(150, 0, 0)"],["Frog","rgb(200, 0, 0)"],["Fox","rgb(200, 75, 0)"],["Hedgehog","rgb(0, 75, 0)"],["Pigeon","rgb(0, 125, 0)"],["Squirrel","rgb(75, 100, 0)"],["Bear","rgb(125, 100, 0)"],["Tiger","rgb(0, 0, 150)"],["Leopard","rgb(0, 0, 200)"],["Zebra","rgb(0, 0, 250)"],["Wolf","rgb(0, 100, 150)"],["Owl","rgb(0, 100, 100)"],["Gull","rgb(100, 0, 100)"],["Squid","rgb(150, 0, 150)"]],b=o[Math.floor(Math.random()*o.length)],e=r({clientID:0,color:b[1],isCollabActive:!1,name:b[0],yjsDocMap:new Map});function l(r,o){const b=g(e);return null!=r&&(b.name=r),null!=o&&(b.color=o),b}export{e as CollaborationContext,l as useCollaborationContext};
@@ -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 LexicalCollaborationContext = require('@lexical/react/LexicalCollaborationContext');
@@ -15,6 +17,19 @@ var lexical = require('lexical');
15
17
  var reactDom = require('react-dom');
16
18
  var yjs$1 = require('yjs');
17
19
 
20
+ function _interopNamespaceDefault(e) {
21
+ var n = Object.create(null);
22
+ if (e) {
23
+ for (var k in e) {
24
+ n[k] = e[k];
25
+ }
26
+ }
27
+ n.default = e;
28
+ return n;
29
+ }
30
+
31
+ var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
32
+
18
33
  /**
19
34
  * Copyright (c) Meta Platforms, Inc. and affiliates.
20
35
  *
@@ -22,6 +37,7 @@ var yjs$1 = require('yjs');
22
37
  * LICENSE file in the root directory of this source tree.
23
38
  *
24
39
  */
40
+
25
41
  function useYjsCollaboration(editor, id, provider, docMap, name, color, shouldBootstrap, cursorsContainerRef, initialEditorState, excludedProperties, awarenessData) {
26
42
  const isReloadingDoc = React.useRef(false);
27
43
  const [doc, setDoc] = React.useState(docMap.get(id));
@@ -107,7 +123,7 @@ function useYjsCollaboration(editor, id, provider, docMap, name, color, shouldBo
107
123
  const ref = element => {
108
124
  binding.cursorsContainer = element;
109
125
  };
110
- return /*#__PURE__*/reactDom.createPortal( /*#__PURE__*/React.createElement("div", {
126
+ return /*#__PURE__*/reactDom.createPortal( /*#__PURE__*/React__namespace.createElement("div", {
111
127
  ref: ref
112
128
  }), cursorsContainerRef && cursorsContainerRef.current || document.body);
113
129
  }, [binding, cursorsContainerRef]);
@@ -163,7 +179,7 @@ function useYjsHistory(editor, binding) {
163
179
  }, [undoManager]);
164
180
 
165
181
  // Exposing undo and redo states
166
- React.useEffect(() => {
182
+ React__namespace.useEffect(() => {
167
183
  const updateUndoRedoStates = () => {
168
184
  editor.dispatchCommand(lexical.CAN_UNDO_COMMAND, undoManager.undoStack.length > 0);
169
185
  editor.dispatchCommand(lexical.CAN_REDO_COMMAND, undoManager.redoStack.length > 0);
@@ -270,6 +286,7 @@ function clearEditorSkipCollab(editor, binding) {
270
286
  * LICENSE file in the root directory of this source tree.
271
287
  *
272
288
  */
289
+
273
290
  function CollaborationPlugin({
274
291
  id,
275
292
  providerFactory,
@@ -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 { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
9
11
  import * as React from 'react';
@@ -21,6 +23,7 @@ import { UndoManager } from 'yjs';
21
23
  * LICENSE file in the root directory of this source tree.
22
24
  *
23
25
  */
26
+
24
27
  function useYjsCollaboration(editor, id, provider, docMap, name, color, shouldBootstrap, cursorsContainerRef, initialEditorState, excludedProperties, awarenessData) {
25
28
  const isReloadingDoc = useRef(false);
26
29
  const [doc, setDoc] = useState(docMap.get(id));
@@ -269,6 +272,7 @@ function clearEditorSkipCollab(editor, binding) {
269
272
  * LICENSE file in the root directory of this source tree.
270
273
  *
271
274
  */
275
+
272
276
  function CollaborationPlugin({
273
277
  id,
274
278
  providerFactory,
@@ -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 LexicalCollaborationPlugin = process.env.NODE_ENV === 'development' ? require('./LexicalCollaborationPlugin.dev.js') : require('./LexicalCollaborationPlugin.prod.js');
9
11
  module.exports = LexicalCollaborationPlugin;
@@ -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 './LexicalCollaborationPlugin.dev.mjs';
8
10
  import * as modProd from './LexicalCollaborationPlugin.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('./LexicalCollaborationPlugin.dev.mjs') : import('./LexicalCollaborationPlugin.prod.mjs'));
8
10
  export const CollaborationPlugin = mod.CollaborationPlugin;
@@ -3,14 +3,16 @@
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 f=require("@lexical/react/LexicalCollaborationContext"),g=require("@lexical/react/LexicalComposerContext"),k=require("react"),B=require("@lexical/utils"),J=require("@lexical/yjs"),K=require("lexical"),L=require("react-dom"),M=require("yjs");
8
- function N(b,c,a,d,e,z,A,v,w,n,t){let q=k.useRef(!1),[x,r]=k.useState(d.get(c)),h=k.useMemo(()=>J.createBinding(b,a,c,x,d,n),[b,a,c,d,x,n]),p=k.useCallback(()=>{a.connect()},[a]),y=k.useCallback(()=>{try{a.disconnect()}catch(m){}},[a]);k.useEffect(()=>{let {root:m}=h,{awareness:C}=a,D=({status:l})=>{b.dispatchCommand(J.CONNECTED_COMMAND,"connected"===l)},E=l=>{A&&l&&m.isEmpty()&&0===m._xmlText._length&&!1===q.current&&O(b,w);q.current=!1},F=()=>{J.syncCursorPositions(h,a)},G=(l,u)=>{u=u.origin;u!==
9
- h&&J.syncYjsChangesToLexical(h,a,l,u instanceof M.UndoManager)};J.initLocalState(a,e,z,document.activeElement===b.getRootElement(),t||{});let H=l=>{P(b,h);r(l);d.set(c,l);q.current=!0};a.on("reload",H);a.on("status",D);a.on("sync",E);C.on("update",F);m.getSharedType().observeDeep(G);let T=b.registerUpdateListener(({prevEditorState:l,editorState:u,dirtyLeaves:Q,dirtyElements:R,normalizedNodes:S,tags:I})=>{!1===I.has("skip-collab")&&J.syncLexicalUpdateToYjs(h,a,l,u,R,Q,S,I)});p();return()=>{!1===q.current&&
10
- y();a.off("sync",E);a.off("status",D);a.off("reload",H);C.off("update",F);m.getSharedType().unobserveDeep(G);d.delete(c);T()}},[h,z,p,y,d,b,c,w,e,a,A,t]);let U=k.useMemo(()=>L.createPortal(k.createElement("div",{ref:m=>{h.cursorsContainer=m}}),v&&v.current||document.body),[h,v]);k.useEffect(()=>b.registerCommand(J.TOGGLE_CONNECT_COMMAND,m=>{void 0!==p&&void 0!==y&&(m?(console.log("Collaboration connected!"),p()):(console.log("Collaboration disconnected!"),y()));return!0},K.COMMAND_PRIORITY_EDITOR),
11
- [p,y,b]);return[U,h]}function V(b,c,a,d,e){k.useEffect(()=>B.mergeRegister(b.registerCommand(K.FOCUS_COMMAND,()=>{J.setLocalStateFocus(c,a,d,!0,e||{});return!1},K.COMMAND_PRIORITY_EDITOR),b.registerCommand(K.BLUR_COMMAND,()=>{J.setLocalStateFocus(c,a,d,!1,e||{});return!1},K.COMMAND_PRIORITY_EDITOR)),[d,b,a,c,e])}
12
- function W(b,c){let a=k.useMemo(()=>J.createUndoManager(c,c.root.getSharedType()),[c]);k.useEffect(()=>B.mergeRegister(b.registerCommand(K.UNDO_COMMAND,()=>{a.undo();return!0},K.COMMAND_PRIORITY_EDITOR),b.registerCommand(K.REDO_COMMAND,()=>{a.redo();return!0},K.COMMAND_PRIORITY_EDITOR)));let d=k.useCallback(()=>{a.clear()},[a]);k.useEffect(()=>{let e=()=>{b.dispatchCommand(K.CAN_UNDO_COMMAND,0<a.undoStack.length);b.dispatchCommand(K.CAN_REDO_COMMAND,0<a.redoStack.length)};a.on("stack-item-added",
13
- e);a.on("stack-item-popped",e);a.on("stack-cleared",e);return()=>{a.off("stack-item-added",e);a.off("stack-item-popped",e);a.off("stack-cleared",e)}},[b,a]);return d}
14
- function O(b,c){b.update(()=>{var a=K.$getRoot();if(a.isEmpty())if(c)switch(typeof c){case "string":var d=b.parseEditorState(c);b.setEditorState(d,{tag:"history-merge"});break;case "object":b.setEditorState(c,{tag:"history-merge"});break;case "function":b.update(()=>{K.$getRoot().isEmpty()&&c(b)},{tag:"history-merge"})}else d=K.$createParagraphNode(),a.append(d),{activeElement:a}=document,(null!==K.$getSelection()||null!==a&&a===b.getRootElement())&&d.select()},{tag:"history-merge"})}
15
- function P(b,c){b.update(()=>{let d=K.$getRoot();d.clear();d.select()},{tag:"skip-collab"});if(null!=c.cursors&&(b=c.cursors,null!=b&&(c=c.cursorsContainer,null!=c))){b=Array.from(b.values());for(let d=0;d<b.length;d++){var a=b[d].selection;if(a&&null!=a.selections){a=a.selections;for(let e=0;e<a.length;e++)c.removeChild(a[d])}}}}
16
- exports.CollaborationPlugin=function({id:b,providerFactory:c,shouldBootstrap:a,username:d,cursorColor:e,cursorsContainerRef:z,initialEditorState:A,excludedProperties:v,awarenessData:w}){let n=f.useCollaborationContext(d,e),{yjsDocMap:t,name:q,color:x}=n,[r]=g.useLexicalComposerContext();k.useEffect(()=>{n.isCollabActive=!0;return()=>{null==r._parentEditor&&(n.isCollabActive=!1)}},[n,r]);d=k.useMemo(()=>c(b,t),[b,c,t]);let [h,p]=N(r,b,d,t,q,x,a,z,A,v,w);n.clientID=p.clientID;W(r,p);V(r,d,q,x,w);return h}
8
+
9
+ 'use strict';var e=require("@lexical/react/LexicalCollaborationContext"),g=require("@lexical/react/LexicalComposerContext"),k=require("react"),z=require("@lexical/utils"),C=require("@lexical/yjs"),D=require("lexical"),L=require("react-dom"),M=require("yjs"),N=Object.create(null);if(k)for(var O in k)N[O]=k[O];N.default=k;
10
+ function P(b,c,a,d,f,A,B,v,w,n,t){let q=k.useRef(!1),[x,r]=k.useState(d.get(c)),h=k.useMemo(()=>C.createBinding(b,a,c,x,d,n),[b,a,c,d,x,n]),p=k.useCallback(()=>{a.connect()},[a]),y=k.useCallback(()=>{try{a.disconnect()}catch(m){}},[a]);k.useEffect(()=>{let {root:m}=h,{awareness:E}=a,F=({status:l})=>{b.dispatchCommand(C.CONNECTED_COMMAND,"connected"===l)},G=l=>{B&&l&&m.isEmpty()&&0===m._xmlText._length&&!1===q.current&&Q(b,w);q.current=!1},H=()=>{C.syncCursorPositions(h,a)},I=(l,u)=>{u=u.origin;u!==
11
+ h&&C.syncYjsChangesToLexical(h,a,l,u instanceof M.UndoManager)};C.initLocalState(a,f,A,document.activeElement===b.getRootElement(),t||{});let J=l=>{R(b,h);r(l);d.set(c,l);q.current=!0};a.on("reload",J);a.on("status",F);a.on("sync",G);E.on("update",H);m.getSharedType().observeDeep(I);let V=b.registerUpdateListener(({prevEditorState:l,editorState:u,dirtyLeaves:S,dirtyElements:T,normalizedNodes:U,tags:K})=>{!1===K.has("skip-collab")&&C.syncLexicalUpdateToYjs(h,a,l,u,T,S,U,K)});p();return()=>{!1===q.current&&
12
+ y();a.off("sync",G);a.off("status",F);a.off("reload",J);E.off("update",H);m.getSharedType().unobserveDeep(I);d.delete(c);V()}},[h,A,p,y,d,b,c,w,f,a,B,t]);let W=k.useMemo(()=>L.createPortal(N.createElement("div",{ref:m=>{h.cursorsContainer=m}}),v&&v.current||document.body),[h,v]);k.useEffect(()=>b.registerCommand(C.TOGGLE_CONNECT_COMMAND,m=>{void 0!==p&&void 0!==y&&(m?(console.log("Collaboration connected!"),p()):(console.log("Collaboration disconnected!"),y()));return!0},D.COMMAND_PRIORITY_EDITOR),
13
+ [p,y,b]);return[W,h]}function X(b,c,a,d,f){k.useEffect(()=>z.mergeRegister(b.registerCommand(D.FOCUS_COMMAND,()=>{C.setLocalStateFocus(c,a,d,!0,f||{});return!1},D.COMMAND_PRIORITY_EDITOR),b.registerCommand(D.BLUR_COMMAND,()=>{C.setLocalStateFocus(c,a,d,!1,f||{});return!1},D.COMMAND_PRIORITY_EDITOR)),[d,b,a,c,f])}
14
+ function Y(b,c){let a=k.useMemo(()=>C.createUndoManager(c,c.root.getSharedType()),[c]);k.useEffect(()=>z.mergeRegister(b.registerCommand(D.UNDO_COMMAND,()=>{a.undo();return!0},D.COMMAND_PRIORITY_EDITOR),b.registerCommand(D.REDO_COMMAND,()=>{a.redo();return!0},D.COMMAND_PRIORITY_EDITOR)));let d=k.useCallback(()=>{a.clear()},[a]);N.useEffect(()=>{let f=()=>{b.dispatchCommand(D.CAN_UNDO_COMMAND,0<a.undoStack.length);b.dispatchCommand(D.CAN_REDO_COMMAND,0<a.redoStack.length)};a.on("stack-item-added",
15
+ f);a.on("stack-item-popped",f);a.on("stack-cleared",f);return()=>{a.off("stack-item-added",f);a.off("stack-item-popped",f);a.off("stack-cleared",f)}},[b,a]);return d}
16
+ function Q(b,c){b.update(()=>{var a=D.$getRoot();if(a.isEmpty())if(c)switch(typeof c){case "string":var d=b.parseEditorState(c);b.setEditorState(d,{tag:"history-merge"});break;case "object":b.setEditorState(c,{tag:"history-merge"});break;case "function":b.update(()=>{D.$getRoot().isEmpty()&&c(b)},{tag:"history-merge"})}else d=D.$createParagraphNode(),a.append(d),{activeElement:a}=document,(null!==D.$getSelection()||null!==a&&a===b.getRootElement())&&d.select()},{tag:"history-merge"})}
17
+ function R(b,c){b.update(()=>{let d=D.$getRoot();d.clear();d.select()},{tag:"skip-collab"});if(null!=c.cursors&&(b=c.cursors,null!=b&&(c=c.cursorsContainer,null!=c))){b=Array.from(b.values());for(let d=0;d<b.length;d++){var a=b[d].selection;if(a&&null!=a.selections){a=a.selections;for(let f=0;f<a.length;f++)c.removeChild(a[d])}}}}
18
+ exports.CollaborationPlugin=function({id:b,providerFactory:c,shouldBootstrap:a,username:d,cursorColor:f,cursorsContainerRef:A,initialEditorState:B,excludedProperties:v,awarenessData:w}){let n=e.useCollaborationContext(d,f),{yjsDocMap:t,name:q,color:x}=n,[r]=g.useLexicalComposerContext();k.useEffect(()=>{n.isCollabActive=!0;return()=>{null==r._parentEditor&&(n.isCollabActive=!1)}},[n,r]);d=k.useMemo(()=>c(b,t),[b,c,t]);let [h,p]=P(r,b,d,t,q,x,a,A,B,v,w);n.clientID=p.clientID;Y(r,p);X(r,d,q,x,w);return h}
@@ -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{useCollaborationContext as e}from"@lexical/react/LexicalCollaborationContext";import{useLexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import*as o from"react";import{useRef as r,useState as n,useMemo as s,useCallback as c,useEffect as a}from"react";import{mergeRegister as i}from"@lexical/utils";import{createBinding as l,initLocalState as d,syncLexicalUpdateToYjs as m,TOGGLE_CONNECT_COMMAND as u,setLocalStateFocus as f,createUndoManager as p,CONNECTED_COMMAND as g,syncCursorPositions as y,syncYjsChangesToLexical as C}from"@lexical/yjs";import{COMMAND_PRIORITY_EDITOR as h,FOCUS_COMMAND as E,BLUR_COMMAND as v,UNDO_COMMAND as b,REDO_COMMAND as x,CAN_UNDO_COMMAND as k,CAN_REDO_COMMAND as S,$getRoot as D,$createParagraphNode as j,$getSelection as L}from"lexical";import{createPortal as T}from"react-dom";import{UndoManager as w}from"yjs";function A(e,t,i,f,p,E,v,b,x,k,S){const A=r(!1),[R,_]=n(f.get(t)),I=s((()=>l(e,i,t,R,f,k)),[e,i,t,f,R,k]),z=c((()=>{i.connect()}),[i]),B=c((()=>{try{i.disconnect()}catch(e){}}),[i]);a((()=>{const{root:o}=I,{awareness:r}=i,n=({status:t})=>{e.dispatchCommand(g,"connected"===t)},s=t=>{v&&t&&o.isEmpty()&&0===o._xmlText._length&&!1===A.current&&function(e,t){e.update((()=>{const o=D();if(o.isEmpty())if(t)switch(typeof t){case"string":{const o=e.parseEditorState(t);e.setEditorState(o,{tag:"history-merge"});break}case"object":e.setEditorState(t,{tag:"history-merge"});break;case"function":e.update((()=>{D().isEmpty()&&t(e)}),{tag:"history-merge"})}else{const t=j();o.append(t);const{activeElement:r}=document;(null!==L()||null!==r&&r===e.getRootElement())&&t.select()}}),{tag:"history-merge"})}(e,x),A.current=!1},c=()=>{y(I,i)},a=(e,t)=>{const o=t.origin;if(o!==I){C(I,i,e,o instanceof w)}};d(i,p,E,document.activeElement===e.getRootElement(),S||{});const l=o=>{!function(e,t){if(e.update((()=>{const e=D();e.clear(),e.select()}),{tag:"skip-collab"}),null==t.cursors)return;const o=t.cursors;if(null==o)return;const r=t.cursorsContainer;if(null==r)return;const n=Array.from(o.values());for(let e=0;e<n.length;e++){const t=n[e].selection;if(t&&null!=t.selections){const o=t.selections;for(let t=0;t<o.length;t++)r.removeChild(o[e])}}}(e,I),_(o),f.set(t,o),A.current=!0};i.on("reload",l),i.on("status",n),i.on("sync",s),r.on("update",c),o.getSharedType().observeDeep(a);const u=e.registerUpdateListener((({prevEditorState:e,editorState:t,dirtyLeaves:o,dirtyElements:r,normalizedNodes:n,tags:s})=>{!1===s.has("skip-collab")&&m(I,i,e,t,r,o,n,s)}));return z(),()=>{!1===A.current&&B(),i.off("sync",s),i.off("status",n),i.off("reload",l),r.off("update",c),o.getSharedType().unobserveDeep(a),f.delete(t),u()}}),[I,E,z,B,f,e,t,x,p,i,v,S]);const F=s((()=>T(o.createElement("div",{ref:e=>{I.cursorsContainer=e}}),b&&b.current||document.body)),[I,b]);return a((()=>e.registerCommand(u,(e=>{if(void 0!==z&&void 0!==B){e?(console.log("Collaboration connected!"),z()):(console.log("Collaboration disconnected!"),B())}return!0}),h)),[z,B,e]),[F,I]}function R(e,t){const r=s((()=>p(t,t.root.getSharedType())),[t]);a((()=>i(e.registerCommand(b,(()=>(r.undo(),!0)),h),e.registerCommand(x,(()=>(r.redo(),!0)),h))));const n=c((()=>{r.clear()}),[r]);return o.useEffect((()=>{const t=()=>{e.dispatchCommand(k,r.undoStack.length>0),e.dispatchCommand(S,r.redoStack.length>0)};return r.on("stack-item-added",t),r.on("stack-item-popped",t),r.on("stack-cleared",t),()=>{r.off("stack-item-added",t),r.off("stack-item-popped",t),r.off("stack-cleared",t)}}),[e,r]),n}function _({id:o,providerFactory:r,shouldBootstrap:n,username:c,cursorColor:l,cursorsContainerRef:d,initialEditorState:m,excludedProperties:u,awarenessData:p}){const g=e(c,l),{yjsDocMap:y,name:C,color:b}=g,[x]=t();a((()=>(g.isCollabActive=!0,()=>{null==x._parentEditor&&(g.isCollabActive=!1)})),[g,x]);const k=s((()=>r(o,y)),[o,r,y]),[S,D]=A(x,o,k,y,C,b,n,d,m,u,p);return g.clientID=D.clientID,R(x,D),function(e,t,o,r,n){a((()=>i(e.registerCommand(E,(()=>(f(t,o,r,!0,n||{}),!1)),h),e.registerCommand(v,(()=>(f(t,o,r,!1,n||{}),!1)),h))),[r,e,o,t,n])}(x,k,C,b,p),S}export{_ as CollaborationPlugin};
@@ -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 LexicalComposerContext = require('@lexical/react/LexicalComposerContext');
10
12
  var lexical = require('lexical');
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
  *
@@ -27,8 +42,8 @@ const CAN_USE_DOM = typeof window !== 'undefined' && typeof window.document !==
27
42
  * LICENSE file in the root directory of this source tree.
28
43
  *
29
44
  */
45
+
30
46
  const useLayoutEffectImpl = CAN_USE_DOM ? React.useLayoutEffect : React.useEffect;
31
- var useLayoutEffect = useLayoutEffectImpl;
32
47
 
33
48
  /**
34
49
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -37,6 +52,7 @@ var useLayoutEffect = useLayoutEffectImpl;
37
52
  * LICENSE file in the root directory of this source tree.
38
53
  *
39
54
  */
55
+
40
56
  const HISTORY_MERGE_OPTIONS = {
41
57
  tag: 'history-merge'
42
58
  };
@@ -73,7 +89,7 @@ function LexicalComposer({
73
89
  // We only do this for init
74
90
  // eslint-disable-next-line react-hooks/exhaustive-deps
75
91
  []);
76
- useLayoutEffect(() => {
92
+ useLayoutEffectImpl(() => {
77
93
  const isEditable = initialConfig.editable;
78
94
  const [editor] = composerContext;
79
95
  editor.setEditable(isEditable !== undefined ? isEditable : true);
@@ -81,7 +97,7 @@ function LexicalComposer({
81
97
  // We only do this for init
82
98
  // eslint-disable-next-line react-hooks/exhaustive-deps
83
99
  }, []);
84
- return /*#__PURE__*/React.createElement(LexicalComposerContext.LexicalComposerContext.Provider, {
100
+ return /*#__PURE__*/React__namespace.createElement(LexicalComposerContext.LexicalComposerContext.Provider, {
85
101
  value: composerContext
86
102
  }, children);
87
103
  }
@@ -3,11 +3,13 @@
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 { createLexicalComposerContext, LexicalComposerContext } from '@lexical/react/LexicalComposerContext';
8
10
  import { createEditor, $getRoot, $createParagraphNode, $getSelection } from 'lexical';
9
11
  import * as React from 'react';
10
- import { useLayoutEffect as useLayoutEffect$1, useEffect, useMemo } from 'react';
12
+ import { useLayoutEffect, useEffect, useMemo } from 'react';
11
13
 
12
14
  /**
13
15
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -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
  */
29
- const useLayoutEffectImpl = CAN_USE_DOM ? useLayoutEffect$1 : useEffect;
30
- var useLayoutEffect = useLayoutEffectImpl;
31
+
32
+ const useLayoutEffectImpl = CAN_USE_DOM ? useLayoutEffect : useEffect;
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
  const HISTORY_MERGE_OPTIONS = {
40
43
  tag: 'history-merge'
41
44
  };
@@ -72,7 +75,7 @@ function LexicalComposer({
72
75
  // We only do this for init
73
76
  // eslint-disable-next-line react-hooks/exhaustive-deps
74
77
  []);
75
- useLayoutEffect(() => {
78
+ useLayoutEffectImpl(() => {
76
79
  const isEditable = initialConfig.editable;
77
80
  const [editor] = composerContext;
78
81
  editor.setEditable(isEditable !== undefined ? isEditable : true);
@@ -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 LexicalComposer = process.env.NODE_ENV === 'development' ? require('./LexicalComposer.dev.js') : require('./LexicalComposer.prod.js');
9
11
  module.exports = LexicalComposer;
@@ -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 './LexicalComposer.dev.mjs';
8
10
  import * as modProd from './LexicalComposer.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('./LexicalComposer.dev.mjs') : import('./LexicalComposer.prod.mjs'));
8
10
  export const LexicalComposer = mod.LexicalComposer;
@@ -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
- 'use strict';var e=require("@lexical/react/LexicalComposerContext"),f=require("lexical"),g=require("react");let m="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement;var n=m?g.useLayoutEffect:g.useEffect;let p={tag:"history-merge"};
8
- function q(a,c){if(null!==c)if(void 0===c)a.update(()=>{var b=f.$getRoot();if(b.isEmpty()){let d=f.$createParagraphNode();b.append(d);b=m?document.activeElement:null;(null!==f.$getSelection()||null!==b&&b===a.getRootElement())&&d.select()}},p);else if(null!==c)switch(typeof c){case "string":let b=a.parseEditorState(c);a.setEditorState(b,p);break;case "object":a.setEditorState(c,p);break;case "function":a.update(()=>{f.$getRoot().isEmpty()&&c(a)},p)}}
9
- exports.LexicalComposer=function({initialConfig:a,children:c}){let b=g.useMemo(()=>{const {theme:d,namespace:h,editor__DEPRECATED:r,nodes:t,onError:u,editorState:v,html:w}=a,x=e.createLexicalComposerContext(null,d);let k=r||null;if(null===k){const l=f.createEditor({editable:a.editable,html:w,namespace:h,nodes:t,onError:y=>u(y,l),theme:d});q(l,v);k=l}return[k,x]},[]);n(()=>{let d=a.editable,[h]=b;h.setEditable(void 0!==d?d:!0)},[]);return g.createElement(e.LexicalComposerContext.Provider,{value:b},
8
+
9
+ 'use strict';var e=require("@lexical/react/LexicalComposerContext"),f=require("lexical"),g=require("react"),h=Object.create(null);if(g)for(var n in g)h[n]=g[n];h.default=g;let p="undefined"!==typeof window&&"undefined"!==typeof window.document&&"undefined"!==typeof window.document.createElement,q=p?g.useLayoutEffect:g.useEffect,r={tag:"history-merge"};
10
+ function t(a,c){if(null!==c)if(void 0===c)a.update(()=>{var b=f.$getRoot();if(b.isEmpty()){let d=f.$createParagraphNode();b.append(d);b=p?document.activeElement:null;(null!==f.$getSelection()||null!==b&&b===a.getRootElement())&&d.select()}},r);else if(null!==c)switch(typeof c){case "string":let b=a.parseEditorState(c);a.setEditorState(b,r);break;case "object":a.setEditorState(c,r);break;case "function":a.update(()=>{f.$getRoot().isEmpty()&&c(a)},r)}}
11
+ exports.LexicalComposer=function({initialConfig:a,children:c}){let b=g.useMemo(()=>{const {theme:d,namespace:k,editor__DEPRECATED:u,nodes:v,onError:w,editorState:x,html:y}=a,z=e.createLexicalComposerContext(null,d);let l=u||null;if(null===l){const m=f.createEditor({editable:a.editable,html:y,namespace:k,nodes:v,onError:A=>w(A,m),theme:d});t(m,x);l=m}return[l,z]},[]);q(()=>{let d=a.editable,[k]=b;k.setEditable(void 0!==d?d:!0)},[]);return h.createElement(e.LexicalComposerContext.Provider,{value:b},
10
12
  c)}
@@ -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{createLexicalComposerContext as e,LexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{createEditor as o,$getRoot as n,$createParagraphNode as i,$getSelection as r}from"lexical";import*as a from"react";import{useLayoutEffect as l,useEffect as c,useMemo as s}from"react";const d="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement;var m=d?l:c;const u={tag:"history-merge"};function f({initialConfig:l,children:c}){const f=s((()=>{const{theme:t,namespace:a,editor__DEPRECATED:c,nodes:s,onError:m,editorState:f,html:p}=l,E=e(null,t);let v=c||null;if(null===v){const e=o({editable:l.editable,html:p,namespace:a,nodes:s,onError:t=>m(t,e),theme:t});!function(e,t){if(null===t)return;if(void 0===t)e.update((()=>{const t=n();if(t.isEmpty()){const o=i();t.append(o);const n=d?document.activeElement:null;(null!==r()||null!==n&&n===e.getRootElement())&&o.select()}}),u);else if(null!==t)switch(typeof t){case"string":{const o=e.parseEditorState(t);e.setEditorState(o,u);break}case"object":e.setEditorState(t,u);break;case"function":e.update((()=>{n().isEmpty()&&t(e)}),u)}}(e,f),v=e}return[v,E]}),[]);return m((()=>{const e=l.editable,[t]=f;t.setEditable(void 0===e||e)}),[]),a.createElement(t.Provider,{value:f},c)}export{f as LexicalComposer};
8
+
9
+ import{createLexicalComposerContext as e,LexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{createEditor as o,$getRoot as n,$createParagraphNode as i,$getSelection as r}from"lexical";import*as l from"react";import{useLayoutEffect as a,useEffect as c,useMemo as s}from"react";const d="undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement,m=d?a:c,u={tag:"history-merge"};function p({initialConfig:a,children:c}){const p=s((()=>{const{theme:t,namespace:l,editor__DEPRECATED:c,nodes:s,onError:m,editorState:p,html:f}=a,E=e(null,t);let b=c||null;if(null===b){const e=o({editable:a.editable,html:f,namespace:l,nodes:s,onError:t=>m(t,e),theme:t});!function(e,t){if(null===t)return;if(void 0===t)e.update((()=>{const t=n();if(t.isEmpty()){const o=i();t.append(o);const n=d?document.activeElement:null;(null!==r()||null!==n&&n===e.getRootElement())&&o.select()}}),u);else if(null!==t)switch(typeof t){case"string":{const o=e.parseEditorState(t);e.setEditorState(o,u);break}case"object":e.setEditorState(t,u);break;case"function":e.update((()=>{n().isEmpty()&&t(e)}),u)}}(e,p),b=e}return[b,E]}),[]);return m((()=>{const e=a.editable,[t]=p;t.setEditable(void 0===e||e)}),[]),l.createElement(t.Provider,{value:p},c)}export{p as LexicalComposer};
@@ -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 react = require('react');
@@ -15,6 +17,7 @@ var react = require('react');
15
17
  * LICENSE file in the root directory of this source tree.
16
18
  *
17
19
  */
20
+
18
21
  const LexicalComposerContext = /*#__PURE__*/react.createContext(null);
19
22
  function createLexicalComposerContext(parent, theme) {
20
23
  let parentContext = null;
@@ -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 { createContext, useContext } from 'react';
8
10
 
9
11
  /**
@@ -13,6 +15,7 @@ import { createContext, useContext } from 'react';
13
15
  * LICENSE file in the root directory of this source tree.
14
16
  *
15
17
  */
18
+
16
19
  const LexicalComposerContext = /*#__PURE__*/createContext(null);
17
20
  function createLexicalComposerContext(parent, theme) {
18
21
  let parentContext = null;
@@ -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 LexicalComposerContext = process.env.NODE_ENV === 'development' ? require('./LexicalComposerContext.dev.js') : require('./LexicalComposerContext.prod.js');
9
11
  module.exports = LexicalComposerContext;
@@ -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 './LexicalComposerContext.dev.mjs';
8
10
  import * as modProd from './LexicalComposerContext.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('./LexicalComposerContext.dev.mjs') : import('./LexicalComposerContext.prod.mjs'));
8
10
  export const LexicalComposerContext = mod.LexicalComposerContext;
9
11
  export const createLexicalComposerContext = mod.createLexicalComposerContext;
@@ -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 d=require("react");function e(a){let c=new URLSearchParams;c.append("code",a);for(let b=1;b<arguments.length;b++)c.append("v",arguments[b]);throw Error(`Minified Lexical error #${a}; visit https://lexical.dev/docs/error?${c} for the full message or `+"use the non-minified dev environment for full errors and additional helpful warnings.");}let f=d.createContext(null);exports.LexicalComposerContext=f;
8
- exports.createLexicalComposerContext=function(a,c){let b=null;null!=a&&(b=a[1]);return{getTheme:function(){return null!=c?c:null!=b?b.getTheme():null}}};exports.useLexicalComposerContext=function(){let a=d.useContext(f);null==a&&e(8);return a}
8
+
9
+ 'use strict';var d=require("react"),e;function f(a){let c=new URLSearchParams;c.append("code",a);for(let b=1;b<arguments.length;b++)c.append("v",arguments[b]);throw Error(`Minified Lexical error #${a}; visit https://lexical.dev/docs/error?${c} for the full message or `+"use the non-minified dev environment for full errors and additional helpful warnings.");}e=f&&f.__esModule&&Object.prototype.hasOwnProperty.call(f,"default")?f["default"]:f;let g=d.createContext(null);
10
+ exports.LexicalComposerContext=g;exports.createLexicalComposerContext=function(a,c){let b=null;null!=a&&(b=a[1]);return{getTheme:function(){return null!=c?c:null!=b?b.getTheme():null}}};exports.useLexicalComposerContext=function(){let a=d.useContext(g);null==a&&e(8);return a}
@@ -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{createContext as e,useContext as n}from"react";var r=function(e){const n=new URLSearchParams;n.append("code",e);for(let e=1;e<arguments.length;e++)n.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${n} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)};const l=e(null);function t(e,n){let r=null;return null!=e&&(r=e[1]),{getTheme:function(){return null!=n?n:null!=r?r.getTheme():null}}}function o(){const e=n(l);return null==e&&r(8),e}export{l as LexicalComposerContext,t as createLexicalComposerContext,o as useLexicalComposerContext};
8
+
9
+ import{createContext as e,useContext as n}from"react";function r(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var t=r((function(e){const n=new URLSearchParams;n.append("code",e);for(let e=1;e<arguments.length;e++)n.append("v",arguments[e]);throw Error(`Minified Lexical error #${e}; visit https://lexical.dev/docs/error?${n} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}));const l=e(null);function o(e,n){let r=null;return null!=e&&(r=e[1]),{getTheme:function(){return null!=n?n:null!=r?r.getTheme():null}}}function u(){const e=n(l);return null==e&&t(8),e}export{l as LexicalComposerContext,o as createLexicalComposerContext,u as useLexicalComposerContext};