@lexical/react 0.1.5 → 0.1.9

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 (102) hide show
  1. package/DEPRECATED_useLexical.dev.js +84 -0
  2. package/DEPRECATED_useLexical.js +9 -2
  3. package/DEPRECATED_useLexical.prod.js +8 -0
  4. package/DEPRECATED_useLexicalAutoFormatter.dev.js +729 -0
  5. package/DEPRECATED_useLexicalAutoFormatter.js +9 -12
  6. package/DEPRECATED_useLexicalAutoFormatter.prod.js +25 -0
  7. package/DEPRECATED_useLexicalCanShowPlaceholder.dev.js +136 -0
  8. package/DEPRECATED_useLexicalCanShowPlaceholder.js +9 -3
  9. package/DEPRECATED_useLexicalCanShowPlaceholder.prod.js +8 -0
  10. package/DEPRECATED_useLexicalCharacterLimit.dev.js +293 -0
  11. package/DEPRECATED_useLexicalCharacterLimit.js +9 -9
  12. package/DEPRECATED_useLexicalCharacterLimit.prod.js +14 -0
  13. package/DEPRECATED_useLexicalDecorators.dev.js +82 -0
  14. package/DEPRECATED_useLexicalDecorators.js +9 -2
  15. package/DEPRECATED_useLexicalDecorators.prod.js +8 -0
  16. package/DEPRECATED_useLexicalEditor.dev.js +52 -0
  17. package/DEPRECATED_useLexicalEditor.js +9 -1
  18. package/DEPRECATED_useLexicalEditor.prod.js +7 -0
  19. package/DEPRECATED_useLexicalEditorEvents.dev.js +96 -0
  20. package/DEPRECATED_useLexicalEditorEvents.js +9 -2
  21. package/DEPRECATED_useLexicalEditorEvents.prod.js +8 -0
  22. package/DEPRECATED_useLexicalHistory.dev.js +342 -0
  23. package/DEPRECATED_useLexicalHistory.js +9 -7
  24. package/DEPRECATED_useLexicalHistory.prod.js +13 -0
  25. package/DEPRECATED_useLexicalList.dev.js +64 -0
  26. package/DEPRECATED_useLexicalList.js +9 -12
  27. package/DEPRECATED_useLexicalList.prod.js +7 -0
  28. package/DEPRECATED_useLexicalPlainText.dev.js +778 -0
  29. package/DEPRECATED_useLexicalPlainText.js +9 -17
  30. package/DEPRECATED_useLexicalPlainText.prod.js +22 -0
  31. package/DEPRECATED_useLexicalRichText.dev.js +1349 -0
  32. package/DEPRECATED_useLexicalRichText.js +9 -30
  33. package/DEPRECATED_useLexicalRichText.prod.js +35 -0
  34. package/LexicalAutoFormatterPlugin.dev.js +732 -0
  35. package/LexicalAutoFormatterPlugin.js +9 -13
  36. package/LexicalAutoFormatterPlugin.prod.js +25 -0
  37. package/LexicalAutoLinkPlugin.dev.js +227 -0
  38. package/LexicalAutoLinkPlugin.js +9 -5
  39. package/LexicalAutoLinkPlugin.prod.js +12 -0
  40. package/LexicalBootstrapPlugin.dev.js +122 -0
  41. package/LexicalBootstrapPlugin.js +9 -0
  42. package/LexicalBootstrapPlugin.prod.js +8 -0
  43. package/LexicalCharacterLimitPlugin.dev.js +351 -0
  44. package/LexicalCharacterLimitPlugin.js +9 -10
  45. package/LexicalCharacterLimitPlugin.prod.js +14 -0
  46. package/LexicalCollaborationPlugin.dev.js +220 -0
  47. package/LexicalCollaborationPlugin.js +9 -8
  48. package/LexicalCollaborationPlugin.prod.js +13 -0
  49. package/LexicalComposer.dev.js +76 -0
  50. package/LexicalComposer.js +9 -2
  51. package/LexicalComposer.prod.js +9 -0
  52. package/LexicalComposerContext.dev.js +53 -0
  53. package/LexicalComposerContext.js +9 -1
  54. package/LexicalComposerContext.prod.js +7 -0
  55. package/LexicalContentEditable.dev.js +71 -0
  56. package/LexicalContentEditable.js +9 -3
  57. package/LexicalContentEditable.prod.js +9 -0
  58. package/LexicalHashtagPlugin.dev.js +152 -0
  59. package/LexicalHashtagPlugin.js +9 -4
  60. package/LexicalHashtagPlugin.prod.js +10 -0
  61. package/LexicalHistoryPlugin.dev.js +347 -0
  62. package/LexicalHistoryPlugin.js +9 -7
  63. package/LexicalHistoryPlugin.prod.js +13 -0
  64. package/LexicalHorizontalRuleNode.dev.js +66 -0
  65. package/LexicalHorizontalRuleNode.js +9 -0
  66. package/LexicalHorizontalRuleNode.prod.js +8 -0
  67. package/LexicalLinkPlugin.dev.js +136 -0
  68. package/LexicalLinkPlugin.js +9 -3
  69. package/LexicalLinkPlugin.prod.js +9 -0
  70. package/LexicalListPlugin.dev.js +67 -0
  71. package/LexicalListPlugin.js +9 -12
  72. package/LexicalListPlugin.prod.js +8 -0
  73. package/LexicalNestedComposer.dev.js +60 -0
  74. package/LexicalNestedComposer.js +9 -1
  75. package/LexicalNestedComposer.prod.js +8 -0
  76. package/LexicalOnChangePlugin.dev.js +57 -0
  77. package/LexicalOnChangePlugin.js +9 -1
  78. package/LexicalOnChangePlugin.prod.js +7 -0
  79. package/LexicalPlainTextPlugin.dev.js +585 -0
  80. package/LexicalPlainTextPlugin.js +9 -13
  81. package/LexicalPlainTextPlugin.prod.js +18 -0
  82. package/LexicalRichTextPlugin.dev.js +1156 -0
  83. package/LexicalRichTextPlugin.js +9 -26
  84. package/LexicalRichTextPlugin.prod.js +31 -0
  85. package/LexicalTablePlugin.dev.js +77 -0
  86. package/LexicalTablePlugin.js +9 -4
  87. package/LexicalTablePlugin.prod.js +9 -0
  88. package/LexicalTreeView.dev.js +340 -0
  89. package/LexicalTreeView.js +9 -12
  90. package/LexicalTreeView.prod.js +19 -0
  91. package/README.md +10 -5
  92. package/package.json +5 -4
  93. package/useLexicalDecoratorMap.dev.js +83 -0
  94. package/useLexicalDecoratorMap.js +9 -1
  95. package/useLexicalDecoratorMap.prod.js +8 -0
  96. package/useLexicalIsTextContentEmpty.dev.js +84 -0
  97. package/useLexicalIsTextContentEmpty.js +9 -2
  98. package/useLexicalIsTextContentEmpty.prod.js +8 -0
  99. package/withSubscriptions.dev.js +23 -0
  100. package/withSubscriptions.js +9 -1
  101. package/withSubscriptions.prod.js +7 -0
  102. package/LexicalHorizontalRulePlugin.js +0 -1
@@ -1,12 +1,9 @@
1
- 'use strict';var g=require("react"),l=require("lexical"),m=require("lexical/ListItemNode"),p=require("lexical/ListNode"),q=require("lexical/ParagraphNode");function r(d){d=d.getParent();if(!p.$isListNode(d))throw Error("Minified Lexical error #2; see codes.json for the full message or use the non-minified dev environment for full errors and additional helpful warnings.");let a=d;for(;null!==a;)a=a.getParent(),p.$isListNode(a)&&(d=a);return d}
2
- function t(d){let a=[];d=d.getChildren().filter(m.$isListItemNode);for(let b=0;b<d.length;b++){const c=d[b],e=c.getFirstChild();p.$isListNode(e)?a=a.concat(t(e)):a.push(c)}return a}function u(d,a){for(;null!=d&&!(d instanceof a);)d=d.getParent();return d}
3
- function v(d){d.update(()=>{l.$log("removeList");var a=l.$getSelection();if(null!==a){const c=new Set,e=a.getNodes();a=a.anchor.getNode();if(0===e.length&&m.$isListItemNode(a))c.add(r(a));else for(a=0;a<e.length;a++){var b=e[a];l.$isLeafNode(b)&&(b=u(b,m.ListItemNode),null!=b&&c.add(r(b)))}c.forEach(f=>{let h=f;t(f).forEach(k=>{if(null!=k){const n=q.$createParagraphNode();n.append(...k.getChildren());h.insertAfter(n);h=n;k.remove()}});f.remove()})}})}
4
- function w(d,a){if(p.$isListNode(d))return d;const b=d.getPreviousSibling(),c=d.getNextSibling(),e=m.$createListItemNode();if(p.$isListNode(b)&&a===b.getTag())return e.append(d),b.append(e),p.$isListNode(c)&&a===c.getTag()&&(b.append(...c.getChildren()),c.remove()),b;if(p.$isListNode(c)&&a===c.getTag())return e.append(d),c.getFirstChildOrThrow().insertBefore(e),c;a=p.$createListNode(a);a.append(e);d.replace(a);e.append(d);return a}
5
- function x(d,a){d.update(()=>{l.$log("formatList");var b=l.$getSelection();if(null!==b){var c=b.getNodes();b=b.anchor.getNode();var e=b.getParent();if(0===c.length)c=p.$createListNode(a),l.$isRootNode(e)?(b.replace(c),b=m.$createListItemNode(),c.append(b)):m.$isListItemNode(b)&&(b=b.getParentOrThrow(),c.append(...b.getChildren()),b.replace(c));else for(b=new Set,e=0;e<c.length;e++){var f=c[e];if(l.$isElementNode(f)&&f.isEmpty()&&!b.has(f.getKey()))w(f,a);else if(l.$isLeafNode(f))for(f=f.getParent();null!=
6
- f;){const k=f.getKey();if(p.$isListNode(f)){if(!b.has(k)){var h=p.$createListNode(a);h.append(...f.getChildren());f.replace(h);b.add(k)}break}else{h=f.getParent();if(l.$isRootNode(h)&&!b.has(k)){b.add(k);w(f,a);break}f=h}}}}})}
7
- function y(d){var a=l.$getSelection();if(null===a)return!1;var b=a.getNodes(),c=[];0===b.length&&b.push(a.anchor.getNode());if(1===b.length){a:{for(b=b[0];null!==b;){if(m.$isListItemNode(b))break a;b=b.getParent()}b=null}null!==b&&(c=[b])}else{c=new Set;for(a=0;a<b.length;a++){const e=b[a];m.$isListItemNode(e)&&c.add(e)}c=Array.from(c)}return 0<c.length?("indent"===d?z(c):A(c),!0):!1}function B(d){return m.$isListItemNode(d)&&p.$isListNode(d.getFirstChild())}
8
- function z(d){d.forEach(a=>{if(!B(a)){var b=a.getParent(),c=a.getNextSibling(),e=a.getPreviousSibling();if(B(c)&&B(e))e=e.getFirstChild(),p.$isListNode(e)&&(e.append(a),a=c.getFirstChild(),p.$isListNode(a)&&(c=a.getChildren(),e.append(...c),a.remove()),e.getChildren().forEach(f=>f.markDirty()));else if(B(c))c=c.getFirstChild(),p.$isListNode(c)&&(e=c.getFirstChild(),null!==e&&e.insertBefore(a),c.getChildren().forEach(f=>f.markDirty()));else if(B(e))c=e.getFirstChild(),p.$isListNode(c)&&(c.append(a),
9
- c.getChildren().forEach(f=>f.markDirty()));else if(p.$isListNode(b)){const f=m.$createListItemNode(),h=p.$createListNode(b.getTag());f.append(h);h.append(a);e?e.insertAfter(f):c?c.insertBefore(f):b.append(f)}p.$isListNode(b)&&b.getChildren().forEach(f=>f.markDirty())}})}
10
- function A(d){d.forEach(a=>{if(!B(a)){var b=a.getParent(),c=b?b.getParent():void 0,e=c?c.getParent():void 0;if(p.$isListNode(e)&&m.$isListItemNode(c)&&p.$isListNode(b)){var f=b?b.getFirstChild():void 0,h=b?b.getLastChild():void 0;if(a.is(f))c.insertBefore(a),b.isEmpty()&&c.remove();else if(a.is(h))c.insertAfter(a),b.isEmpty()&&c.remove();else{var k=b.getTag();f=m.$createListItemNode();const n=p.$createListNode(k);f.append(n);a.getPreviousSiblings().forEach(C=>n.append(C));h=m.$createListItemNode();
11
- k=p.$createListNode(k);h.append(k);k.append(...a.getNextSiblings());c.insertBefore(f);c.insertAfter(h);c.replace(a)}b.getChildren().forEach(n=>n.markDirty());e.getChildren().forEach(n=>n.markDirty())}}})}
12
- function D(d){g.useEffect(()=>d.addListener("command",a=>{if("indentContent"===a){if(y("indent"))return!0}else if("outdentContent"===a){if(y("outdent"))return!0}else{if("insertOrderedList"===a)return x(d,"ol"),!0;if("insertUnorderedList"===a)return x(d,"ul"),!0;if("removeList"===a)return v(d),!0}return!1},1),[d])}module.exports=function(d){D(d)};
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ 'use strict'
8
+ const DEPRECATED_useLexicalList = process.env.NODE_ENV === 'development' ? require('./DEPRECATED_useLexicalList.dev.js') : require('./DEPRECATED_useLexicalList.prod.js')
9
+ module.exports = DEPRECATED_useLexicalList;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ var b=require("@lexical/list"),d=require("react");function e(a){d.useEffect(()=>a.addListener("command",c=>{if("indentContent"===c){if(b.indentList())return!0}else if("outdentContent"===c){if(b.outdentList())return!0}else{if("insertOrderedList"===c)return b.insertList(a,"ol"),!0;if("insertUnorderedList"===c)return b.insertList(a,"ul"),!0;if("removeList"===c)return b.removeList(a),!0}return!1},1),[a])}module.exports=function(a){e(a)};