@lexical/react 0.35.1-nightly.20250924.0 → 0.36.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 (154) hide show
  1. package/ExtensionComponent.d.ts +42 -0
  2. package/LexicalAutoEmbedPlugin.dev.js +2 -0
  3. package/LexicalAutoEmbedPlugin.dev.mjs +2 -0
  4. package/LexicalAutoEmbedPlugin.prod.js +1 -1
  5. package/LexicalAutoEmbedPlugin.prod.mjs +1 -1
  6. package/LexicalAutoLinkPlugin.d.ts +2 -17
  7. package/LexicalAutoLinkPlugin.dev.js +7 -309
  8. package/LexicalAutoLinkPlugin.dev.mjs +9 -310
  9. package/LexicalAutoLinkPlugin.js.flow +4 -18
  10. package/LexicalAutoLinkPlugin.prod.js +1 -1
  11. package/LexicalAutoLinkPlugin.prod.mjs +1 -1
  12. package/LexicalClearEditorPlugin.dev.js +2 -23
  13. package/LexicalClearEditorPlugin.dev.mjs +2 -23
  14. package/LexicalClearEditorPlugin.prod.js +1 -1
  15. package/LexicalClearEditorPlugin.prod.mjs +1 -1
  16. package/LexicalClickableLinkPlugin.dev.js +5 -70
  17. package/LexicalClickableLinkPlugin.dev.mjs +6 -71
  18. package/LexicalClickableLinkPlugin.prod.js +1 -1
  19. package/LexicalClickableLinkPlugin.prod.mjs +1 -1
  20. package/LexicalCollaborationContext.prod.js +1 -1
  21. package/LexicalCollaborationContext.prod.mjs +1 -1
  22. package/LexicalCollaborationPlugin.dev.mjs +2 -2
  23. package/LexicalCollaborationPlugin.prod.mjs +1 -1
  24. package/LexicalContentEditable.dev.js +2 -3
  25. package/LexicalContentEditable.dev.mjs +2 -3
  26. package/LexicalContentEditable.prod.js +1 -1
  27. package/LexicalContentEditable.prod.mjs +1 -1
  28. package/LexicalContextMenuPlugin.dev.js +2 -0
  29. package/LexicalContextMenuPlugin.dev.mjs +4 -2
  30. package/LexicalContextMenuPlugin.prod.js +1 -1
  31. package/LexicalContextMenuPlugin.prod.mjs +1 -1
  32. package/LexicalDecoratorBlockNode.dev.js +1 -0
  33. package/LexicalDecoratorBlockNode.dev.mjs +1 -0
  34. package/LexicalDecoratorBlockNode.js.flow +7 -0
  35. package/LexicalDecoratorBlockNode.prod.js +1 -1
  36. package/LexicalDecoratorBlockNode.prod.mjs +1 -1
  37. package/LexicalDraggableBlockPlugin.dev.js +6 -0
  38. package/LexicalDraggableBlockPlugin.dev.mjs +6 -0
  39. package/LexicalDraggableBlockPlugin.prod.js +1 -1
  40. package/LexicalDraggableBlockPlugin.prod.mjs +1 -1
  41. package/LexicalExtensionComponent.dev.js +53 -0
  42. package/LexicalExtensionComponent.dev.mjs +51 -0
  43. package/LexicalExtensionComponent.js +11 -0
  44. package/LexicalExtensionComponent.js.flow +12 -0
  45. package/LexicalExtensionComponent.mjs +12 -0
  46. package/LexicalExtensionComponent.node.mjs +10 -0
  47. package/LexicalExtensionComponent.prod.js +9 -0
  48. package/LexicalExtensionComponent.prod.mjs +9 -0
  49. package/LexicalExtensionComposer.d.ts +69 -0
  50. package/LexicalExtensionComposer.dev.js +105 -0
  51. package/LexicalExtensionComposer.dev.mjs +103 -0
  52. package/LexicalExtensionComposer.js +11 -0
  53. package/LexicalExtensionComposer.js.flow +20 -0
  54. package/LexicalExtensionComposer.mjs +12 -0
  55. package/LexicalExtensionComposer.node.mjs +10 -0
  56. package/LexicalExtensionComposer.prod.js +9 -0
  57. package/LexicalExtensionComposer.prod.mjs +9 -0
  58. package/LexicalHashtagPlugin.dev.js +1 -136
  59. package/LexicalHashtagPlugin.dev.mjs +3 -138
  60. package/LexicalHashtagPlugin.prod.js +1 -1
  61. package/LexicalHashtagPlugin.prod.mjs +1 -1
  62. package/LexicalHorizontalRuleNode.d.ts +10 -11
  63. package/LexicalHorizontalRuleNode.dev.js +12 -26
  64. package/LexicalHorizontalRuleNode.dev.mjs +14 -27
  65. package/LexicalHorizontalRuleNode.js.flow +2 -3
  66. package/LexicalHorizontalRuleNode.prod.js +1 -1
  67. package/LexicalHorizontalRuleNode.prod.mjs +1 -1
  68. package/LexicalLinkPlugin.d.ts +1 -1
  69. package/LexicalLinkPlugin.dev.js +7 -52
  70. package/LexicalLinkPlugin.dev.mjs +8 -53
  71. package/LexicalLinkPlugin.prod.js +1 -1
  72. package/LexicalLinkPlugin.prod.mjs +1 -1
  73. package/LexicalListPlugin.js.flow +5 -0
  74. package/LexicalMarkdownShortcutPlugin.dev.mjs +1 -1
  75. package/LexicalMarkdownShortcutPlugin.prod.mjs +1 -1
  76. package/LexicalNestedComposer.js.flow +10 -6
  77. package/LexicalNodeContextMenuPlugin.dev.js +10 -0
  78. package/LexicalNodeContextMenuPlugin.dev.mjs +11 -1
  79. package/LexicalNodeContextMenuPlugin.prod.js +1 -1
  80. package/LexicalNodeContextMenuPlugin.prod.mjs +1 -1
  81. package/LexicalNodeMenuPlugin.dev.js +2 -0
  82. package/LexicalNodeMenuPlugin.dev.mjs +4 -2
  83. package/LexicalNodeMenuPlugin.prod.js +1 -1
  84. package/LexicalNodeMenuPlugin.prod.mjs +1 -1
  85. package/LexicalPlainTextPlugin.d.ts +1 -1
  86. package/LexicalPlainTextPlugin.dev.js +85 -30
  87. package/LexicalPlainTextPlugin.dev.mjs +85 -30
  88. package/LexicalPlainTextPlugin.prod.js +1 -1
  89. package/LexicalPlainTextPlugin.prod.mjs +1 -1
  90. package/LexicalReactExtension.dev.js +187 -0
  91. package/LexicalReactExtension.dev.mjs +184 -0
  92. package/LexicalReactExtension.js +11 -0
  93. package/LexicalReactExtension.js.flow +68 -0
  94. package/LexicalReactExtension.mjs +13 -0
  95. package/LexicalReactExtension.node.mjs +11 -0
  96. package/LexicalReactExtension.prod.js +9 -0
  97. package/LexicalReactExtension.prod.mjs +9 -0
  98. package/LexicalReactPluginHostExtension.dev.js +189 -0
  99. package/LexicalReactPluginHostExtension.dev.mjs +181 -0
  100. package/LexicalReactPluginHostExtension.js +11 -0
  101. package/LexicalReactPluginHostExtension.js.flow +84 -0
  102. package/LexicalReactPluginHostExtension.mjs +18 -0
  103. package/LexicalReactPluginHostExtension.node.mjs +16 -0
  104. package/LexicalReactPluginHostExtension.prod.js +9 -0
  105. package/LexicalReactPluginHostExtension.prod.mjs +9 -0
  106. package/LexicalReactProviderExtension.dev.js +33 -0
  107. package/LexicalReactProviderExtension.dev.mjs +31 -0
  108. package/LexicalReactProviderExtension.js +11 -0
  109. package/LexicalReactProviderExtension.js.flow +12 -0
  110. package/LexicalReactProviderExtension.mjs +12 -0
  111. package/LexicalReactProviderExtension.node.mjs +10 -0
  112. package/LexicalReactProviderExtension.prod.js +9 -0
  113. package/LexicalReactProviderExtension.prod.mjs +9 -0
  114. package/LexicalRichTextPlugin.d.ts +1 -1
  115. package/LexicalRichTextPlugin.dev.js +85 -30
  116. package/LexicalRichTextPlugin.dev.mjs +85 -30
  117. package/LexicalRichTextPlugin.prod.js +1 -1
  118. package/LexicalRichTextPlugin.prod.mjs +1 -1
  119. package/LexicalTabIndentationPlugin.d.ts +2 -2
  120. package/LexicalTabIndentationPlugin.dev.js +3 -57
  121. package/LexicalTabIndentationPlugin.dev.mjs +3 -56
  122. package/LexicalTabIndentationPlugin.prod.js +1 -1
  123. package/LexicalTabIndentationPlugin.prod.mjs +1 -1
  124. package/LexicalTreeViewExtension.dev.js +57 -0
  125. package/LexicalTreeViewExtension.dev.mjs +54 -0
  126. package/LexicalTreeViewExtension.js +11 -0
  127. package/LexicalTreeViewExtension.js.flow +12 -0
  128. package/LexicalTreeViewExtension.mjs +13 -0
  129. package/LexicalTreeViewExtension.node.mjs +11 -0
  130. package/LexicalTreeViewExtension.prod.js +9 -0
  131. package/LexicalTreeViewExtension.prod.mjs +9 -0
  132. package/LexicalTypeaheadMenuPlugin.dev.js +2 -0
  133. package/LexicalTypeaheadMenuPlugin.dev.mjs +4 -2
  134. package/LexicalTypeaheadMenuPlugin.prod.js +1 -1
  135. package/LexicalTypeaheadMenuPlugin.prod.mjs +1 -1
  136. package/ReactExtension.d.ts +41 -0
  137. package/ReactPluginHostExtension.d.ts +56 -0
  138. package/ReactProviderExtension.d.ts +9 -0
  139. package/TreeViewExtension.d.ts +18 -0
  140. package/package.json +228 -17
  141. package/shared/LegacyDecorators.d.ts +23 -0
  142. package/shared/buildEditorComponent.d.ts +11 -0
  143. package/shared/mergeRefs.d.ts +2 -1
  144. package/shared/types.d.ts +89 -0
  145. package/shared/useReactDecorators.d.ts +12 -0
  146. package/useExtensionComponent.d.ts +10 -0
  147. package/useLexicalExtensionComponent.dev.js +37 -0
  148. package/useLexicalExtensionComponent.dev.mjs +34 -0
  149. package/useLexicalExtensionComponent.js +11 -0
  150. package/useLexicalExtensionComponent.js.flow +12 -0
  151. package/useLexicalExtensionComponent.mjs +13 -0
  152. package/useLexicalExtensionComponent.node.mjs +11 -0
  153. package/useLexicalExtensionComponent.prod.js +9 -0
  154. package/useLexicalExtensionComponent.prod.mjs +9 -0
@@ -6,10 +6,9 @@
6
6
  *
7
7
  */
8
8
 
9
- import { HashtagNode, $createHashtagNode } from '@lexical/hashtag';
9
+ import { HashtagNode, registerLexicalHashtag } from '@lexical/hashtag';
10
10
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
11
- import { useLexicalTextEntity } from '@lexical/react/useLexicalTextEntity';
12
- import { useEffect, useCallback } from 'react';
11
+ import { useEffect } from 'react';
13
12
 
14
13
  /**
15
14
  * Copyright (c) Meta Platforms, Inc. and affiliates.
@@ -19,148 +18,14 @@ import { useEffect, useCallback } from 'react';
19
18
  *
20
19
  */
21
20
 
22
- function getHashtagRegexStringChars() {
23
- // Latin accented characters
24
- // Excludes 0xd7 from the range
25
- // (the multiplication sign, confusable with "x").
26
- // Also excludes 0xf7, the division sign
27
- const latinAccents = '\xc0-\xd6' + '\xd8-\xf6' + '\xf8-\xff' + '\u0100-\u024f' + '\u0253-\u0254' + '\u0256-\u0257' + '\u0259' + '\u025b' + '\u0263' + '\u0268' + '\u026f' + '\u0272' + '\u0289' + '\u028b' + '\u02bb' + '\u0300-\u036f' + '\u1e00-\u1eff';
28
-
29
- // Cyrillic (Russian, Ukrainian, etc.)
30
- const nonLatinChars = '\u0400-\u04ff' +
31
- // Cyrillic
32
- '\u0500-\u0527' +
33
- // Cyrillic Supplement
34
- '\u2de0-\u2dff' +
35
- // Cyrillic Extended A
36
- '\ua640-\ua69f' +
37
- // Cyrillic Extended B
38
- '\u0591-\u05bf' +
39
- // Hebrew
40
- '\u05c1-\u05c2' + '\u05c4-\u05c5' + '\u05c7' + '\u05d0-\u05ea' + '\u05f0-\u05f4' + '\ufb12-\ufb28' +
41
- // Hebrew Presentation Forms
42
- '\ufb2a-\ufb36' + '\ufb38-\ufb3c' + '\ufb3e' + '\ufb40-\ufb41' + '\ufb43-\ufb44' + '\ufb46-\ufb4f' + '\u0610-\u061a' +
43
- // Arabic
44
- '\u0620-\u065f' + '\u066e-\u06d3' + '\u06d5-\u06dc' + '\u06de-\u06e8' + '\u06ea-\u06ef' + '\u06fa-\u06fc' + '\u06ff' + '\u0750-\u077f' +
45
- // Arabic Supplement
46
- '\u08a0' +
47
- // Arabic Extended A
48
- '\u08a2-\u08ac' + '\u08e4-\u08fe' + '\ufb50-\ufbb1' +
49
- // Arabic Pres. Forms A
50
- '\ufbd3-\ufd3d' + '\ufd50-\ufd8f' + '\ufd92-\ufdc7' + '\ufdf0-\ufdfb' + '\ufe70-\ufe74' +
51
- // Arabic Pres. Forms B
52
- '\ufe76-\ufefc' + '\u200c-\u200c' +
53
- // Zero-Width Non-Joiner
54
- '\u0e01-\u0e3a' +
55
- // Thai
56
- '\u0e40-\u0e4e' +
57
- // Hangul (Korean)
58
- '\u1100-\u11ff' +
59
- // Hangul Jamo
60
- '\u3130-\u3185' +
61
- // Hangul Compatibility Jamo
62
- '\uA960-\uA97F' +
63
- // Hangul Jamo Extended-A
64
- '\uAC00-\uD7AF' +
65
- // Hangul Syllables
66
- '\uD7B0-\uD7FF' +
67
- // Hangul Jamo Extended-B
68
- '\uFFA1-\uFFDC'; // Half-width Hangul
69
-
70
- const charCode = String.fromCharCode;
71
- const cjkChars = '\u30A1-\u30FA\u30FC-\u30FE' +
72
- // Katakana (full-width)
73
- '\uFF66-\uFF9F' +
74
- // Katakana (half-width)
75
- '\uFF10-\uFF19\uFF21-\uFF3A' + '\uFF41-\uFF5A' +
76
- // Latin (full-width)
77
- '\u3041-\u3096\u3099-\u309E' +
78
- // Hiragana
79
- '\u3400-\u4DBF' +
80
- // Kanji (CJK Extension A)
81
- '\u4E00-\u9FFF' +
82
- // Kanji (Unified)
83
- // Disabled as it breaks the Regex.
84
- // charCode(0x20000) + '-' + charCode(0x2A6DF) + // Kanji (CJK Extension B)
85
- charCode(0x2a700) + '-' + charCode(0x2b73f) +
86
- // Kanji (CJK Extension C)
87
- charCode(0x2b740) + '-' + charCode(0x2b81f) +
88
- // Kanji (CJK Extension D)
89
- charCode(0x2f800) + '-' + charCode(0x2fa1f) + '\u3003\u3005\u303B'; // Kanji (CJK supplement)
90
-
91
- const otherChars = latinAccents + nonLatinChars + cjkChars;
92
- // equivalent of \p{L}
93
-
94
- const unicodeLetters = '\u0041-\u005A\u0061-\u007A\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6' + '\u00F8-\u0241\u0250-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EE\u037A\u0386' + '\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03CE\u03D0-\u03F5\u03F7-\u0481' + '\u048A-\u04CE\u04D0-\u04F9\u0500-\u050F\u0531-\u0556\u0559\u0561-\u0587' + '\u05D0-\u05EA\u05F0-\u05F2\u0621-\u063A\u0640-\u064A\u066E-\u066F' + '\u0671-\u06D3\u06D5\u06E5-\u06E6\u06EE-\u06EF\u06FA-\u06FC\u06FF\u0710' + '\u0712-\u072F\u074D-\u076D\u0780-\u07A5\u07B1\u0904-\u0939\u093D\u0950' + '\u0958-\u0961\u097D\u0985-\u098C\u098F-\u0990\u0993-\u09A8\u09AA-\u09B0' + '\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC-\u09DD\u09DF-\u09E1\u09F0-\u09F1' + '\u0A05-\u0A0A\u0A0F-\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32-\u0A33' + '\u0A35-\u0A36\u0A38-\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D' + '\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2-\u0AB3\u0AB5-\u0AB9\u0ABD' + '\u0AD0\u0AE0-\u0AE1\u0B05-\u0B0C\u0B0F-\u0B10\u0B13-\u0B28\u0B2A-\u0B30' + '\u0B32-\u0B33\u0B35-\u0B39\u0B3D\u0B5C-\u0B5D\u0B5F-\u0B61\u0B71\u0B83' + '\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99-\u0B9A\u0B9C\u0B9E-\u0B9F' + '\u0BA3-\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0C05-\u0C0C\u0C0E-\u0C10' + '\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C60-\u0C61\u0C85-\u0C8C' + '\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE' + '\u0CE0-\u0CE1\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D28\u0D2A-\u0D39' + '\u0D60-\u0D61\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6' + '\u0E01-\u0E30\u0E32-\u0E33\u0E40-\u0E46\u0E81-\u0E82\u0E84\u0E87-\u0E88' + '\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7' + '\u0EAA-\u0EAB\u0EAD-\u0EB0\u0EB2-\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6' + '\u0EDC-\u0EDD\u0F00\u0F40-\u0F47\u0F49-\u0F6A\u0F88-\u0F8B\u1000-\u1021' + '\u1023-\u1027\u1029-\u102A\u1050-\u1055\u10A0-\u10C5\u10D0-\u10FA\u10FC' + '\u1100-\u1159\u115F-\u11A2\u11A8-\u11F9\u1200-\u1248\u124A-\u124D' + '\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0' + '\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310' + '\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C' + '\u166F-\u1676\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711' + '\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7' + '\u17DC\u1820-\u1877\u1880-\u18A8\u1900-\u191C\u1950-\u196D\u1970-\u1974' + '\u1980-\u19A9\u19C1-\u19C7\u1A00-\u1A16\u1D00-\u1DBF\u1E00-\u1E9B' + '\u1EA0-\u1EF9\u1F00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D' + '\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC' + '\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC' + '\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u2094\u2102\u2107' + '\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D' + '\u212F-\u2131\u2133-\u2139\u213C-\u213F\u2145-\u2149\u2C00-\u2C2E' + '\u2C30-\u2C5E\u2C80-\u2CE4\u2D00-\u2D25\u2D30-\u2D65\u2D6F\u2D80-\u2D96' + '\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6' + '\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3006\u3031-\u3035' + '\u303B-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF' + '\u3105-\u312C\u3131-\u318E\u31A0-\u31B7\u31F0-\u31FF\u3400-\u4DB5' + '\u4E00-\u9FBB\uA000-\uA48C\uA800-\uA801\uA803-\uA805\uA807-\uA80A' + '\uA80C-\uA822\uAC00-\uD7A3\uF900-\uFA2D\uFA30-\uFA6A\uFA70-\uFAD9' + '\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C' + '\uFB3E\uFB40-\uFB41\uFB43-\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F' + '\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A' + '\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7' + '\uFFDA-\uFFDC';
95
-
96
- // equivalent of \p{Mn}\p{Mc}
97
- const unicodeAccents = '\u0300-\u036F\u0483-\u0486\u0591-\u05B9\u05BB-\u05BD\u05BF' + '\u05C1-\u05C2\u05C4-\u05C5\u05C7\u0610-\u0615\u064B-\u065E\u0670' + '\u06D6-\u06DC\u06DF-\u06E4\u06E7-\u06E8\u06EA-\u06ED\u0711\u0730-\u074A' + '\u07A6-\u07B0\u0901-\u0903\u093C\u093E-\u094D\u0951-\u0954\u0962-\u0963' + '\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7-\u09C8\u09CB-\u09CD\u09D7' + '\u09E2-\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47-\u0A48\u0A4B-\u0A4D' + '\u0A70-\u0A71\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD' + '\u0AE2-\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B43\u0B47-\u0B48\u0B4B-\u0B4D' + '\u0B56-\u0B57\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7' + '\u0C01-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55-\u0C56' + '\u0C82-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5-\u0CD6' + '\u0D02-\u0D03\u0D3E-\u0D43\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D82-\u0D83' + '\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2-\u0DF3\u0E31\u0E34-\u0E3A' + '\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB-\u0EBC\u0EC8-\u0ECD\u0F18-\u0F19' + '\u0F35\u0F37\u0F39\u0F3E-\u0F3F\u0F71-\u0F84\u0F86-\u0F87\u0F90-\u0F97' + '\u0F99-\u0FBC\u0FC6\u102C-\u1032\u1036-\u1039\u1056-\u1059\u135F' + '\u1712-\u1714\u1732-\u1734\u1752-\u1753\u1772-\u1773\u17B6-\u17D3\u17DD' + '\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8-\u19C9' + '\u1A17-\u1A1B\u1DC0-\u1DC3\u20D0-\u20DC\u20E1\u20E5-\u20EB\u302A-\u302F' + '\u3099-\u309A\uA802\uA806\uA80B\uA823-\uA827\uFB1E\uFE00-\uFE0F' + '\uFE20-\uFE23';
98
-
99
- // equivalent of \p{Dn}
100
- const unicodeDigits = '\u0030-\u0039\u0660-\u0669\u06F0-\u06F9\u0966-\u096F\u09E6-\u09EF' + '\u0A66-\u0A6F\u0AE6-\u0AEF\u0B66-\u0B6F\u0BE6-\u0BEF\u0C66-\u0C6F' + '\u0CE6-\u0CEF\u0D66-\u0D6F\u0E50-\u0E59\u0ED0-\u0ED9\u0F20-\u0F29' + '\u1040-\u1049\u17E0-\u17E9\u1810-\u1819\u1946-\u194F\u19D0-\u19D9' + '\uFF10-\uFF19';
101
-
102
- // An alpha char is a unicode chars excluding unicode combining marks
103
- // but including other chars, a hashtag must start with one of these,
104
- // it does not make sense to have a combining mark before a base character.
105
- const alpha = unicodeLetters + otherChars;
106
-
107
- // A numeric character is any with the number digit property, or
108
- // underscore. These characters can be included in hashtags, but a hashtag
109
- // cannot have only these characters.
110
- const numeric = unicodeDigits + '_';
111
-
112
- // Alphanumeric char is any alpha char or a unicode char with decimal
113
- // number property \p{Nd}
114
- const alphanumeric = alpha + unicodeAccents + numeric;
115
- const hashChars = '#\\uFF03'; // normal '#' or full-width '#'
116
-
117
- return {
118
- alpha,
119
- alphanumeric,
120
- hashChars
121
- };
122
- }
123
- function getHashtagRegexString() {
124
- const {
125
- alpha,
126
- alphanumeric,
127
- hashChars
128
- } = getHashtagRegexStringChars();
129
- const hashtagAlpha = '[' + alpha + ']';
130
- const hashtagAlphanumeric = '[' + alphanumeric + ']';
131
- const hashtagBoundary = '^|$|[^&/' + alphanumeric + ']';
132
- const hashCharList = '[' + hashChars + ']';
133
-
134
- // A hashtag contains characters, numbers and underscores,
135
- // but not all numbers.
136
- const hashtag = '(' + hashtagBoundary + ')(' + hashCharList + ')(' + hashtagAlphanumeric + '*' + hashtagAlpha + hashtagAlphanumeric + '*)';
137
- return hashtag;
138
- }
139
- const REGEX = new RegExp(getHashtagRegexString(), 'i');
140
21
  function HashtagPlugin() {
141
22
  const [editor] = useLexicalComposerContext();
142
23
  useEffect(() => {
143
24
  if (!editor.hasNodes([HashtagNode])) {
144
25
  throw new Error('HashtagPlugin: HashtagNode not registered on editor');
145
26
  }
27
+ return registerLexicalHashtag(editor);
146
28
  }, [editor]);
147
- const $createHashtagNode_ = useCallback(textNode => {
148
- return $createHashtagNode(textNode.getTextContent());
149
- }, []);
150
- const getHashtagMatch = useCallback(text => {
151
- const matchArr = REGEX.exec(text);
152
- if (matchArr === null) {
153
- return null;
154
- }
155
- const hashtagLength = matchArr[3].length + 1;
156
- const startOffset = matchArr.index + matchArr[1].length;
157
- const endOffset = startOffset + hashtagLength;
158
- return {
159
- end: endOffset,
160
- start: startOffset
161
- };
162
- }, []);
163
- useLexicalTextEntity(getHashtagMatch, HashtagNode, $createHashtagNode_);
164
29
  return null;
165
30
  }
166
31
 
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- "use strict";var e=require("@lexical/hashtag"),t=require("@lexical/react/LexicalComposerContext"),a=require("@lexical/react/useLexicalTextEntity"),r=require("react");const n=new RegExp(function(){const{alpha:e,alphanumeric:t,hashChars:a}=function(){const e=String.fromCharCode,t="A-Za-zªµºÀ-ÖØ-öø-Ɂɐ-ˁˆ-ˑˠ-ˤˮͺΆΈ-ΊΌΎ-ΡΣ-ώϐ-ϵϷ-ҁҊ-ӎӐ-ӹԀ-ԏԱ-Ֆՙա-ևא-תװ-ײء-غـ-يٮ-ٯٱ-ۓەۥ-ۦۮ-ۯۺ-ۼۿܐܒ-ܯݍ-ݭހ-ޥޱऄ-हऽॐक़-ॡॽঅ-ঌএ-ঐও-নপ-রলশ-হঽৎড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હઽૐૠ-ૡଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହଽଡ଼-ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-ஹఅ-ఌఎ-ఐఒ-నప-ళవ-హౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹൠ-ൡඅ-ඖක-නඳ-රලව-ෆก-ะา-ำเ-ๆກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ະາ-ຳຽເ-ໄໆໜ-ໝༀཀ-ཇཉ-ཪྈ-ྋက-အဣ-ဧဩ-ဪၐ-ၕႠ-Ⴥა-ჺჼᄀ-ᅙᅟ-ᆢᆨ-ᇹሀ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙶᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦩᧁ-ᧇᨀ-ᨖᴀ-ᶿḀ-ẛẠ-ỹἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₔℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℱℳ-ℹℼ-ℿⅅ-ⅉⰀ-Ⱞⰰ-ⱞⲀ-ⳤⴀ-ⴥⴰ-ⵥⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〆〱-〵〻-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄬㄱ-ㆎㆠ-ㆷㇰ-ㇿ㐀-䶵一-龻ꀀ-ꒌꠀ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢ가-힣豈-鶴侮-頻並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵÀ-ÖØ-öø-ÿĀ-ɏɓ-ɔɖ-ɗəɛɣɨɯɲʉʋʻ̀-ͯḀ-ỿЀ-ӿԀ-ԧⷠ-ⷿꙀ-֑ꚟ-ֿׁ-ׂׄ-ׇׅא-תװ-״﬒-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﭏؐ-ؚؠ-ٟٮ-ۓە-ۜ۞-۪ۨ-ۯۺ-ۼۿݐ-ݿࢠࢢ-ࢬࣤ-ࣾﭐ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼ‌-‌ก-ฺเ-๎ᄀ-ᇿ㄰-ㆅꥠ-꥿가-힯ힰ-퟿ᄀ-ᅵァ-ヺー-ヾヲ-゚0-9A-Za-zぁ-ゖ゙-ゞ㐀-䶿一-鿿"+e(173824)+"-"+e(177983)+e(177984)+"-"+e(178207)+e(194560)+"-"+e(195103)+"〃々〻";return{alpha:t,alphanumeric:t+"̀-ͯ҃-֑҆-ֹֻ-ֽֿׁ-ׂׄ-ׇׅؐ-ًؕ-ٰٞۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ްँ-ः़ा-्॑-॔ॢ-ॣঁ-ঃ়া-ৄে-ৈো-্ৗৢ-ৣਁ-ਃ਼ਾ-ੂੇ-ੈੋ-੍ੰ-ੱઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣଁ-ଃ଼ା-ୃେ-ୈୋ-୍ୖ-ୗஂா-ூெ-ைொ-்ௗఁ-ఃా-ౄె-ైొ-్ౕ-ౖಂ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕ-ೖം-ഃാ-ൃെ-ൈൊ-്ൗං-ඃ්ා-ුූෘ-ෟෲ-ෳัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-༹༙༵༷༾-༿ཱ-྄྆-྇ྐ-ྗྙ-ྼ࿆ာ-ဲံ-္ၖ-ၙ፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳា-៓៝᠋-᠍ᢩᤠ-ᤫᤰ-᤻ᦰ-ᧀᧈ-ᧉᨗ-ᨛ᷀-᷃⃐-⃥⃜⃡-⃫〪-゙〯-゚ꠂ꠆ꠋꠣ-ꠧﬞ︀-️︠-︣0-9٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉០-៩᠐-᠙᥆-᥏᧐-᧙0-9_",hashChars:"#\\uFF03"}}(),r="["+t+"]";return"("+("^|$|[^&/"+t+"]")+")("+("["+a+"]")+")("+r+"*"+("["+e+"]")+r+"*)"}(),"i");exports.HashtagPlugin=function(){const[s]=t.useLexicalComposerContext();r.useEffect((()=>{if(!s.hasNodes([e.HashtagNode]))throw new Error("HashtagPlugin: HashtagNode not registered on editor")}),[s]);const o=r.useCallback((t=>e.$createHashtagNode(t.getTextContent())),[]),c=r.useCallback((e=>{const t=n.exec(e);if(null===t)return null;const a=t[3].length+1,r=t.index+t[1].length;return{end:r+a,start:r}}),[]);return a.useLexicalTextEntity(c,e.HashtagNode,o),null};
9
+ "use strict";var e=require("@lexical/hashtag"),r=require("@lexical/react/LexicalComposerContext"),t=require("react");exports.HashtagPlugin=function(){const[a]=r.useLexicalComposerContext();return t.useEffect((()=>{if(!a.hasNodes([e.HashtagNode]))throw new Error("HashtagPlugin: HashtagNode not registered on editor");return e.registerLexicalHashtag(a)}),[a]),null};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- import{HashtagNode as t,$createHashtagNode as e}from"@lexical/hashtag";import{useLexicalComposerContext as r}from"@lexical/react/LexicalComposerContext";import{useLexicalTextEntity as n}from"@lexical/react/useLexicalTextEntity";import{useEffect as o,useCallback as a}from"react";const i=new RegExp(function(){const{alpha:t,alphanumeric:e,hashChars:r}=function(){const t=String.fromCharCode,e="A-Za-zªµºÀ-ÖØ-öø-Ɂɐ-ˁˆ-ˑˠ-ˤˮͺΆΈ-ΊΌΎ-ΡΣ-ώϐ-ϵϷ-ҁҊ-ӎӐ-ӹԀ-ԏԱ-Ֆՙա-ևא-תװ-ײء-غـ-يٮ-ٯٱ-ۓەۥ-ۦۮ-ۯۺ-ۼۿܐܒ-ܯݍ-ݭހ-ޥޱऄ-हऽॐक़-ॡॽঅ-ঌএ-ঐও-নপ-রলশ-হঽৎড়-ঢ়য়-ৡৰ-ৱਅ-ਊਏ-ਐਓ-ਨਪ-ਰਲ-ਲ਼ਵ-ਸ਼ਸ-ਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલ-ળવ-હઽૐૠ-ૡଅ-ଌଏ-ଐଓ-ନପ-ରଲ-ଳଵ-ହଽଡ଼-ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கங-சஜஞ-டண-தந-பம-ஹఅ-ఌఎ-ఐఒ-నప-ళవ-హౠ-ౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠ-ೡഅ-ഌഎ-ഐഒ-നപ-ഹൠ-ൡඅ-ඖක-නඳ-රලව-ෆก-ะา-ำเ-ๆກ-ຂຄງ-ຈຊຍດ-ທນ-ຟມ-ຣລວສ-ຫອ-ະາ-ຳຽເ-ໄໆໜ-ໝༀཀ-ཇཉ-ཪྈ-ྋက-အဣ-ဧဩ-ဪၐ-ၕႠ-Ⴥა-ჺჼᄀ-ᅙᅟ-ᆢᆨ-ᇹሀ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙶᚁ-ᚚᚠ-ᛪᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦩᧁ-ᧇᨀ-ᨖᴀ-ᶿḀ-ẛẠ-ỹἀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₔℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℱℳ-ℹℼ-ℿⅅ-ⅉⰀ-Ⱞⰰ-ⱞⲀ-ⳤⴀ-ⴥⴰ-ⵥⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〆〱-〵〻-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄬㄱ-ㆎㆠ-ㆷㇰ-ㇿ㐀-䶵一-龻ꀀ-ꒌꠀ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢ가-힣豈-鶴侮-頻並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵÀ-ÖØ-öø-ÿĀ-ɏɓ-ɔɖ-ɗəɛɣɨɯɲʉʋʻ̀-ͯḀ-ỿЀ-ӿԀ-ԧⷠ-ⷿꙀ-֑ꚟ-ֿׁ-ׂׄ-ׇׅא-תװ-״﬒-ﬨשׁ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﭏؐ-ؚؠ-ٟٮ-ۓە-ۜ۞-۪ۨ-ۯۺ-ۼۿݐ-ݿࢠࢢ-ࢬࣤ-ࣾﭐ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼ‌-‌ก-ฺเ-๎ᄀ-ᇿ㄰-ㆅꥠ-꥿가-힯ힰ-퟿ᄀ-ᅵァ-ヺー-ヾヲ-゚0-9A-Za-zぁ-ゖ゙-ゞ㐀-䶿一-鿿"+t(173824)+"-"+t(177983)+t(177984)+"-"+t(178207)+t(194560)+"-"+t(195103)+"〃々〻";return{alpha:e,alphanumeric:e+"̀-ͯ҃-֑҆-ֹֻ-ֽֿׁ-ׂׄ-ׇׅؐ-ًؕ-ٰٞۖ-ۜ۟-ۤۧ-۪ۨ-ܑۭܰ-݊ަ-ްँ-ः़ा-्॑-॔ॢ-ॣঁ-ঃ়া-ৄে-ৈো-্ৗৢ-ৣਁ-ਃ਼ਾ-ੂੇ-ੈੋ-੍ੰ-ੱઁ-ઃ઼ા-ૅે-ૉો-્ૢ-ૣଁ-ଃ଼ା-ୃେ-ୈୋ-୍ୖ-ୗஂா-ூெ-ைொ-்ௗఁ-ఃా-ౄె-ైొ-్ౕ-ౖಂ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕ-ೖം-ഃാ-ൃെ-ൈൊ-്ൗං-ඃ්ා-ුූෘ-ෟෲ-ෳัิ-ฺ็-๎ັິ-ູົ-ຼ່-ໍ༘-༹༙༵༷༾-༿ཱ-྄྆-྇ྐ-ྗྙ-ྼ࿆ာ-ဲံ-္ၖ-ၙ፟ᜒ-᜔ᜲ-᜴ᝒ-ᝓᝲ-ᝳា-៓៝᠋-᠍ᢩᤠ-ᤫᤰ-᤻ᦰ-ᧀᧈ-ᧉᨗ-ᨛ᷀-᷃⃐-⃥⃜⃡-⃫〪-゙〯-゚ꠂ꠆ꠋꠣ-ꠧﬞ︀-️︠-︣0-9٠-٩۰-۹०-९০-৯੦-੯૦-૯୦-୯௦-௯౦-౯೦-೯൦-൯๐-๙໐-໙༠-༩၀-၉០-៩᠐-᠙᥆-᥏᧐-᧙0-9_",hashChars:"#\\uFF03"}}(),n="["+e+"]";return"("+("^|$|[^&/"+e+"]")+")("+("["+r+"]")+")("+n+"*"+("["+t+"]")+n+"*)"}(),"i");function c(){const[c]=r();o((()=>{if(!c.hasNodes([t]))throw new Error("HashtagPlugin: HashtagNode not registered on editor")}),[c]);const l=a((t=>e(t.getTextContent())),[]),s=a((t=>{const e=i.exec(t);if(null===e)return null;const r=e[3].length+1,n=e.index+e[1].length;return{end:n+r,start:n}}),[]);return n(s,t,l),null}export{c as HashtagPlugin};
9
+ import{HashtagNode as r,registerLexicalHashtag as o}from"@lexical/hashtag";import{useLexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{useEffect as e}from"react";function a(){const[a]=t();return e((()=>{if(!a.hasNodes([r]))throw new Error("HashtagPlugin: HashtagNode not registered on editor");return o(a)}),[a]),null}export{a as HashtagPlugin};
@@ -5,22 +5,21 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
- import type { DOMConversionMap, DOMExportOutput, EditorConfig, LexicalCommand, LexicalNode, SerializedLexicalNode } from 'lexical';
8
+ import type { DOMConversionMap } from 'lexical';
9
9
  import type { JSX } from 'react';
10
- import { DecoratorNode } from 'lexical';
11
- export type SerializedHorizontalRuleNode = SerializedLexicalNode;
12
- export declare const INSERT_HORIZONTAL_RULE_COMMAND: LexicalCommand<void>;
13
- export declare class HorizontalRuleNode extends DecoratorNode<JSX.Element> {
10
+ import { $isHorizontalRuleNode, HorizontalRuleNode as BaseHorizontalRuleNode, INSERT_HORIZONTAL_RULE_COMMAND, type SerializedHorizontalRuleNode } from '@lexical/extension';
11
+ export { $isHorizontalRuleNode, INSERT_HORIZONTAL_RULE_COMMAND, type SerializedHorizontalRuleNode, };
12
+ /**
13
+ * @deprecated A pure Lexical implementation is available in `@lexical/extension` as HorizontalRuleExtension
14
+ */
15
+ export declare class HorizontalRuleNode extends BaseHorizontalRuleNode {
14
16
  static getType(): string;
15
17
  static clone(node: HorizontalRuleNode): HorizontalRuleNode;
16
18
  static importJSON(serializedNode: SerializedHorizontalRuleNode): HorizontalRuleNode;
17
19
  static importDOM(): DOMConversionMap | null;
18
- exportDOM(): DOMExportOutput;
19
- createDOM(config: EditorConfig): HTMLElement;
20
- getTextContent(): string;
21
- isInline(): false;
22
- updateDOM(): boolean;
23
20
  decorate(): JSX.Element;
24
21
  }
22
+ /**
23
+ * @deprecated A pure Lexical implementation is available in `@lexical/extension` as HorizontalRuleExtension
24
+ */
25
25
  export declare function $createHorizontalRuleNode(): HorizontalRuleNode;
26
- export declare function $isHorizontalRuleNode(node: LexicalNode | null | undefined): node is HorizontalRuleNode;
@@ -8,6 +8,7 @@
8
8
 
9
9
  'use strict';
10
10
 
11
+ var extension = require('@lexical/extension');
11
12
  var LexicalComposerContext = require('@lexical/react/LexicalComposerContext');
12
13
  var useLexicalNodeSelection = require('@lexical/react/useLexicalNodeSelection');
13
14
  var utils = require('@lexical/utils');
@@ -23,7 +24,6 @@ var jsxRuntime = require('react/jsx-runtime');
23
24
  *
24
25
  */
25
26
 
26
- const INSERT_HORIZONTAL_RULE_COMMAND = lexical.createCommand('INSERT_HORIZONTAL_RULE_COMMAND');
27
27
  function HorizontalRuleComponent({
28
28
  nodeKey
29
29
  }) {
@@ -55,7 +55,11 @@ function HorizontalRuleComponent({
55
55
  }, [editor, isSelected, nodeKey]);
56
56
  return null;
57
57
  }
58
- class HorizontalRuleNode extends lexical.DecoratorNode {
58
+
59
+ /**
60
+ * @deprecated A pure Lexical implementation is available in `@lexical/extension` as HorizontalRuleExtension
61
+ */
62
+ class HorizontalRuleNode extends extension.HorizontalRuleNode {
59
63
  static getType() {
60
64
  return 'horizontalrule';
61
65
  }
@@ -73,25 +77,6 @@ class HorizontalRuleNode extends lexical.DecoratorNode {
73
77
  })
74
78
  };
75
79
  }
76
- exportDOM() {
77
- return {
78
- element: document.createElement('hr')
79
- };
80
- }
81
- createDOM(config) {
82
- const element = document.createElement('hr');
83
- utils.addClassNamesToElement(element, config.theme.hr);
84
- return element;
85
- }
86
- getTextContent() {
87
- return '\n';
88
- }
89
- isInline() {
90
- return false;
91
- }
92
- updateDOM() {
93
- return false;
94
- }
95
80
  decorate() {
96
81
  return /*#__PURE__*/jsxRuntime.jsx(HorizontalRuleComponent, {
97
82
  nodeKey: this.__key
@@ -103,14 +88,15 @@ function $convertHorizontalRuleElement() {
103
88
  node: $createHorizontalRuleNode()
104
89
  };
105
90
  }
91
+
92
+ /**
93
+ * @deprecated A pure Lexical implementation is available in `@lexical/extension` as HorizontalRuleExtension
94
+ */
106
95
  function $createHorizontalRuleNode() {
107
96
  return lexical.$applyNodeReplacement(new HorizontalRuleNode());
108
97
  }
109
- function $isHorizontalRuleNode(node) {
110
- return node instanceof HorizontalRuleNode;
111
- }
112
98
 
99
+ exports.$isHorizontalRuleNode = extension.$isHorizontalRuleNode;
100
+ exports.INSERT_HORIZONTAL_RULE_COMMAND = extension.INSERT_HORIZONTAL_RULE_COMMAND;
113
101
  exports.$createHorizontalRuleNode = $createHorizontalRuleNode;
114
- exports.$isHorizontalRuleNode = $isHorizontalRuleNode;
115
102
  exports.HorizontalRuleNode = HorizontalRuleNode;
116
- exports.INSERT_HORIZONTAL_RULE_COMMAND = INSERT_HORIZONTAL_RULE_COMMAND;
@@ -6,10 +6,12 @@
6
6
  *
7
7
  */
8
8
 
9
+ import { HorizontalRuleNode as HorizontalRuleNode$1 } from '@lexical/extension';
10
+ export { $isHorizontalRuleNode, INSERT_HORIZONTAL_RULE_COMMAND } from '@lexical/extension';
9
11
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
10
12
  import { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection';
11
- import { addClassNamesToElement, mergeRegister, removeClassNamesFromElement } from '@lexical/utils';
12
- import { createCommand, DecoratorNode, $applyNodeReplacement, CLICK_COMMAND, COMMAND_PRIORITY_LOW } from 'lexical';
13
+ import { mergeRegister, addClassNamesToElement, removeClassNamesFromElement } from '@lexical/utils';
14
+ import { $applyNodeReplacement, CLICK_COMMAND, COMMAND_PRIORITY_LOW } from 'lexical';
13
15
  import { useEffect } from 'react';
14
16
  import { jsx } from 'react/jsx-runtime';
15
17
 
@@ -21,7 +23,6 @@ import { jsx } from 'react/jsx-runtime';
21
23
  *
22
24
  */
23
25
 
24
- const INSERT_HORIZONTAL_RULE_COMMAND = createCommand('INSERT_HORIZONTAL_RULE_COMMAND');
25
26
  function HorizontalRuleComponent({
26
27
  nodeKey
27
28
  }) {
@@ -53,7 +54,11 @@ function HorizontalRuleComponent({
53
54
  }, [editor, isSelected, nodeKey]);
54
55
  return null;
55
56
  }
56
- class HorizontalRuleNode extends DecoratorNode {
57
+
58
+ /**
59
+ * @deprecated A pure Lexical implementation is available in `@lexical/extension` as HorizontalRuleExtension
60
+ */
61
+ class HorizontalRuleNode extends HorizontalRuleNode$1 {
57
62
  static getType() {
58
63
  return 'horizontalrule';
59
64
  }
@@ -71,25 +76,6 @@ class HorizontalRuleNode extends DecoratorNode {
71
76
  })
72
77
  };
73
78
  }
74
- exportDOM() {
75
- return {
76
- element: document.createElement('hr')
77
- };
78
- }
79
- createDOM(config) {
80
- const element = document.createElement('hr');
81
- addClassNamesToElement(element, config.theme.hr);
82
- return element;
83
- }
84
- getTextContent() {
85
- return '\n';
86
- }
87
- isInline() {
88
- return false;
89
- }
90
- updateDOM() {
91
- return false;
92
- }
93
79
  decorate() {
94
80
  return /*#__PURE__*/jsx(HorizontalRuleComponent, {
95
81
  nodeKey: this.__key
@@ -101,11 +87,12 @@ function $convertHorizontalRuleElement() {
101
87
  node: $createHorizontalRuleNode()
102
88
  };
103
89
  }
90
+
91
+ /**
92
+ * @deprecated A pure Lexical implementation is available in `@lexical/extension` as HorizontalRuleExtension
93
+ */
104
94
  function $createHorizontalRuleNode() {
105
95
  return $applyNodeReplacement(new HorizontalRuleNode());
106
96
  }
107
- function $isHorizontalRuleNode(node) {
108
- return node instanceof HorizontalRuleNode;
109
- }
110
97
 
111
- export { $createHorizontalRuleNode, $isHorizontalRuleNode, HorizontalRuleNode, INSERT_HORIZONTAL_RULE_COMMAND };
98
+ export { $createHorizontalRuleNode, HorizontalRuleNode };
@@ -7,10 +7,9 @@
7
7
  * @flow strict
8
8
  */
9
9
 
10
- import type {LexicalNode, LexicalCommand} from 'lexical';
11
-
10
+ import type {LexicalNode, LexicalCommand, SerializedLexicalNode} from 'lexical';
12
11
  import {DecoratorNode} from 'lexical';
13
-
12
+ export type SerializedHorizontalRuleNode = SerializedLexicalNode;
14
13
  declare export class HorizontalRuleNode extends DecoratorNode<React.Node> {
15
14
  static getType(): string;
16
15
  static clone(node: HorizontalRuleNode): HorizontalRuleNode;
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- "use strict";var e=require("@lexical/react/LexicalComposerContext"),t=require("@lexical/react/useLexicalNodeSelection"),r=require("@lexical/utils"),n=require("lexical"),o=require("react"),c=require("react/jsx-runtime");const s=n.createCommand("INSERT_HORIZONTAL_RULE_COMMAND");function a({nodeKey:c}){const[s]=e.useLexicalComposerContext(),[a,i,l]=t.useLexicalNodeSelection(c);return o.useEffect((()=>r.mergeRegister(s.registerCommand(n.CLICK_COMMAND,(e=>{const t=s.getElementByKey(c);return e.target===t&&(e.shiftKey||l(),i(!a),!0)}),n.COMMAND_PRIORITY_LOW))),[l,s,a,c,i]),o.useEffect((()=>{const e=s.getElementByKey(c),t=s._config.theme.hrSelected??"selected";null!==e&&(a?r.addClassNamesToElement(e,t):r.removeClassNamesFromElement(e,t))}),[s,a,c]),null}class i extends n.DecoratorNode{static getType(){return"horizontalrule"}static clone(e){return new i(e.__key)}static importJSON(e){return u().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:l,priority:0})}}exportDOM(){return{element:document.createElement("hr")}}createDOM(e){const t=document.createElement("hr");return r.addClassNamesToElement(t,e.theme.hr),t}getTextContent(){return"\n"}isInline(){return!1}updateDOM(){return!1}decorate(){return c.jsx(a,{nodeKey:this.__key})}}function l(){return{node:u()}}function u(){return n.$applyNodeReplacement(new i)}exports.$createHorizontalRuleNode=u,exports.$isHorizontalRuleNode=function(e){return e instanceof i},exports.HorizontalRuleNode=i,exports.INSERT_HORIZONTAL_RULE_COMMAND=s;
9
+ "use strict";var e=require("@lexical/extension"),t=require("@lexical/react/LexicalComposerContext"),r=require("@lexical/react/useLexicalNodeSelection"),o=require("@lexical/utils"),n=require("lexical"),i=require("react"),l=require("react/jsx-runtime");function s({nodeKey:e}){const[l]=t.useLexicalComposerContext(),[s,a,c]=r.useLexicalNodeSelection(e);return i.useEffect((()=>o.mergeRegister(l.registerCommand(n.CLICK_COMMAND,(t=>{const r=l.getElementByKey(e);return t.target===r&&(t.shiftKey||c(),a(!s),!0)}),n.COMMAND_PRIORITY_LOW))),[c,l,s,e,a]),i.useEffect((()=>{const t=l.getElementByKey(e),r=l._config.theme.hrSelected??"selected";null!==t&&(s?o.addClassNamesToElement(t,r):o.removeClassNamesFromElement(t,r))}),[l,s,e]),null}class a extends e.HorizontalRuleNode{static getType(){return"horizontalrule"}static clone(e){return new a(e.__key)}static importJSON(e){return u().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:c,priority:0})}}decorate(){return l.jsx(s,{nodeKey:this.__key})}}function c(){return{node:u()}}function u(){return n.$applyNodeReplacement(new a)}exports.$isHorizontalRuleNode=e.$isHorizontalRuleNode,exports.INSERT_HORIZONTAL_RULE_COMMAND=e.INSERT_HORIZONTAL_RULE_COMMAND,exports.$createHorizontalRuleNode=u,exports.HorizontalRuleNode=a;
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- import{useLexicalComposerContext as e}from"@lexical/react/LexicalComposerContext";import{useLexicalNodeSelection as t}from"@lexical/react/useLexicalNodeSelection";import{addClassNamesToElement as r,mergeRegister as n,removeClassNamesFromElement as o}from"@lexical/utils";import{createCommand as c,DecoratorNode as i,$applyNodeReplacement as u,CLICK_COMMAND as l,COMMAND_PRIORITY_LOW as m}from"lexical";import{useEffect as a}from"react";import{jsx as s}from"react/jsx-runtime";const p=c("INSERT_HORIZONTAL_RULE_COMMAND");function d({nodeKey:c}){const[i]=e(),[u,s,p]=t(c);return a((()=>n(i.registerCommand(l,(e=>{const t=i.getElementByKey(c);return e.target===t&&(e.shiftKey||p(),s(!u),!0)}),m))),[p,i,u,c,s]),a((()=>{const e=i.getElementByKey(c),t=i._config.theme.hrSelected??"selected";null!==e&&(u?r(e,t):o(e,t))}),[i,u,c]),null}class f extends i{static getType(){return"horizontalrule"}static clone(e){return new f(e.__key)}static importJSON(e){return y().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:x,priority:0})}}exportDOM(){return{element:document.createElement("hr")}}createDOM(e){const t=document.createElement("hr");return r(t,e.theme.hr),t}getTextContent(){return"\n"}isInline(){return!1}updateDOM(){return!1}decorate(){return s(d,{nodeKey:this.__key})}}function x(){return{node:y()}}function y(){return u(new f)}function h(e){return e instanceof f}export{y as $createHorizontalRuleNode,h as $isHorizontalRuleNode,f as HorizontalRuleNode,p as INSERT_HORIZONTAL_RULE_COMMAND};
9
+ import{HorizontalRuleNode as e}from"@lexical/extension";export{$isHorizontalRuleNode,INSERT_HORIZONTAL_RULE_COMMAND}from"@lexical/extension";import{useLexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{useLexicalNodeSelection as r}from"@lexical/react/useLexicalNodeSelection";import{mergeRegister as o,addClassNamesToElement as n,removeClassNamesFromElement as i}from"@lexical/utils";import{$applyNodeReplacement as l,CLICK_COMMAND as c,COMMAND_PRIORITY_LOW as a}from"lexical";import{useEffect as m}from"react";import{jsx as s}from"react/jsx-runtime";function u({nodeKey:e}){const[l]=t(),[s,u,p]=r(e);return m((()=>o(l.registerCommand(c,(t=>{const r=l.getElementByKey(e);return t.target===r&&(t.shiftKey||p(),u(!s),!0)}),a))),[p,l,s,e,u]),m((()=>{const t=l.getElementByKey(e),r=l._config.theme.hrSelected??"selected";null!==t&&(s?n(t,r):i(t,r))}),[l,s,e]),null}class p extends e{static getType(){return"horizontalrule"}static clone(e){return new p(e.__key)}static importJSON(e){return f().updateFromJSON(e)}static importDOM(){return{hr:()=>({conversion:x,priority:0})}}decorate(){return s(u,{nodeKey:this.__key})}}function x(){return{node:f()}}function f(){return l(new p)}export{f as $createHorizontalRuleNode,p as HorizontalRuleNode};
@@ -5,7 +5,7 @@
5
5
  * LICENSE file in the root directory of this source tree.
6
6
  *
7
7
  */
8
- import { LinkAttributes } from '@lexical/link';
8
+ import { type LinkAttributes } from '@lexical/link';
9
9
  type Props = {
10
10
  validateUrl?: (url: string) => boolean;
11
11
  attributes?: LinkAttributes;
@@ -8,10 +8,9 @@
8
8
 
9
9
  'use strict';
10
10
 
11
+ var extension = require('@lexical/extension');
11
12
  var link = require('@lexical/link');
12
13
  var LexicalComposerContext = require('@lexical/react/LexicalComposerContext');
13
- var utils = require('@lexical/utils');
14
- var lexical = require('lexical');
15
14
  var react = require('react');
16
15
 
17
16
  /**
@@ -31,56 +30,12 @@ function LinkPlugin({
31
30
  if (!editor.hasNodes([link.LinkNode])) {
32
31
  throw new Error('LinkPlugin: LinkNode not registered on editor');
33
32
  }
34
- return utils.mergeRegister(editor.registerCommand(link.TOGGLE_LINK_COMMAND, payload => {
35
- if (payload === null) {
36
- link.$toggleLink(payload);
37
- return true;
38
- } else if (typeof payload === 'string') {
39
- if (validateUrl === undefined || validateUrl(payload)) {
40
- link.$toggleLink(payload, attributes);
41
- return true;
42
- }
43
- return false;
44
- } else {
45
- const {
46
- url,
47
- target,
48
- rel,
49
- title
50
- } = payload;
51
- link.$toggleLink(url, {
52
- ...attributes,
53
- rel,
54
- target,
55
- title
56
- });
57
- return true;
58
- }
59
- }, lexical.COMMAND_PRIORITY_LOW), validateUrl !== undefined ? editor.registerCommand(lexical.PASTE_COMMAND, event => {
60
- const selection = lexical.$getSelection();
61
- if (!lexical.$isRangeSelection(selection) || selection.isCollapsed() || !utils.objectKlassEquals(event, ClipboardEvent)) {
62
- return false;
63
- }
64
- if (event.clipboardData === null) {
65
- return false;
66
- }
67
- const clipboardText = event.clipboardData.getData('text');
68
- if (!validateUrl(clipboardText)) {
69
- return false;
70
- }
71
- // If we select nodes that are elements then avoid applying the link.
72
- if (!selection.getNodes().some(node => lexical.$isElementNode(node))) {
73
- editor.dispatchCommand(link.TOGGLE_LINK_COMMAND, {
74
- ...attributes,
75
- url: clipboardText
76
- });
77
- event.preventDefault();
78
- return true;
79
- }
80
- return false;
81
- }, lexical.COMMAND_PRIORITY_LOW) : () => {
82
- // Don't paste arbitrary text as a link when there's no validate function
83
- });
33
+ });
34
+ react.useEffect(() => {
35
+ return link.registerLink(editor, extension.namedSignals({
36
+ attributes,
37
+ validateUrl
38
+ }));
84
39
  }, [editor, validateUrl, attributes]);
85
40
  return null;
86
41
  }
@@ -6,10 +6,9 @@
6
6
  *
7
7
  */
8
8
 
9
- import { LinkNode, TOGGLE_LINK_COMMAND, $toggleLink } from '@lexical/link';
9
+ import { namedSignals } from '@lexical/extension';
10
+ import { LinkNode, registerLink } from '@lexical/link';
10
11
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
11
- import { mergeRegister, objectKlassEquals } from '@lexical/utils';
12
- import { COMMAND_PRIORITY_LOW, PASTE_COMMAND, $getSelection, $isRangeSelection, $isElementNode } from 'lexical';
13
12
  import { useEffect } from 'react';
14
13
 
15
14
  /**
@@ -29,56 +28,12 @@ function LinkPlugin({
29
28
  if (!editor.hasNodes([LinkNode])) {
30
29
  throw new Error('LinkPlugin: LinkNode not registered on editor');
31
30
  }
32
- return mergeRegister(editor.registerCommand(TOGGLE_LINK_COMMAND, payload => {
33
- if (payload === null) {
34
- $toggleLink(payload);
35
- return true;
36
- } else if (typeof payload === 'string') {
37
- if (validateUrl === undefined || validateUrl(payload)) {
38
- $toggleLink(payload, attributes);
39
- return true;
40
- }
41
- return false;
42
- } else {
43
- const {
44
- url,
45
- target,
46
- rel,
47
- title
48
- } = payload;
49
- $toggleLink(url, {
50
- ...attributes,
51
- rel,
52
- target,
53
- title
54
- });
55
- return true;
56
- }
57
- }, COMMAND_PRIORITY_LOW), validateUrl !== undefined ? editor.registerCommand(PASTE_COMMAND, event => {
58
- const selection = $getSelection();
59
- if (!$isRangeSelection(selection) || selection.isCollapsed() || !objectKlassEquals(event, ClipboardEvent)) {
60
- return false;
61
- }
62
- if (event.clipboardData === null) {
63
- return false;
64
- }
65
- const clipboardText = event.clipboardData.getData('text');
66
- if (!validateUrl(clipboardText)) {
67
- return false;
68
- }
69
- // If we select nodes that are elements then avoid applying the link.
70
- if (!selection.getNodes().some(node => $isElementNode(node))) {
71
- editor.dispatchCommand(TOGGLE_LINK_COMMAND, {
72
- ...attributes,
73
- url: clipboardText
74
- });
75
- event.preventDefault();
76
- return true;
77
- }
78
- return false;
79
- }, COMMAND_PRIORITY_LOW) : () => {
80
- // Don't paste arbitrary text as a link when there's no validate function
81
- });
31
+ });
32
+ useEffect(() => {
33
+ return registerLink(editor, namedSignals({
34
+ attributes,
35
+ validateUrl
36
+ }));
82
37
  }, [editor, validateUrl, attributes]);
83
38
  return null;
84
39
  }
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
9
- "use strict";var e=require("@lexical/link"),t=require("@lexical/react/LexicalComposerContext"),r=require("@lexical/utils"),i=require("lexical"),l=require("react");exports.LinkPlugin=function({validateUrl:n,attributes:o}){const[a]=t.useLexicalComposerContext();return l.useEffect((()=>{if(!a.hasNodes([e.LinkNode]))throw new Error("LinkPlugin: LinkNode not registered on editor");return r.mergeRegister(a.registerCommand(e.TOGGLE_LINK_COMMAND,(t=>{if(null===t)return e.$toggleLink(t),!0;if("string"==typeof t)return!(void 0!==n&&!n(t))&&(e.$toggleLink(t,o),!0);{const{url:r,target:i,rel:l,title:n}=t;return e.$toggleLink(r,{...o,rel:l,target:i,title:n}),!0}}),i.COMMAND_PRIORITY_LOW),void 0!==n?a.registerCommand(i.PASTE_COMMAND,(t=>{const l=i.$getSelection();if(!i.$isRangeSelection(l)||l.isCollapsed()||!r.objectKlassEquals(t,ClipboardEvent))return!1;if(null===t.clipboardData)return!1;const s=t.clipboardData.getData("text");return!!n(s)&&(!l.getNodes().some((e=>i.$isElementNode(e)))&&(a.dispatchCommand(e.TOGGLE_LINK_COMMAND,{...o,url:s}),t.preventDefault(),!0))}),i.COMMAND_PRIORITY_LOW):()=>{})}),[a,n,o]),null};
9
+ "use strict";var e=require("@lexical/extension"),r=require("@lexical/link"),i=require("@lexical/react/LexicalComposerContext"),t=require("react");exports.LinkPlugin=function({validateUrl:n,attributes:l}){const[o]=i.useLexicalComposerContext();return t.useEffect((()=>{if(!o.hasNodes([r.LinkNode]))throw new Error("LinkPlugin: LinkNode not registered on editor")})),t.useEffect((()=>r.registerLink(o,e.namedSignals({attributes:l,validateUrl:n}))),[o,n,l]),null};
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
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 l}from"@lexical/utils";import{COMMAND_PRIORITY_LOW as n,PASTE_COMMAND as a,$getSelection as m,$isRangeSelection as s,$isElementNode as u}from"lexical";import{useEffect as d}from"react";function c({validateUrl:c,attributes:p}){const[f]=o();return d((()=>{if(!f.hasNodes([t]))throw new Error("LinkPlugin: LinkNode not registered on editor");return i(f.registerCommand(r,(t=>{if(null===t)return e(t),!0;if("string"==typeof t)return!(void 0!==c&&!c(t))&&(e(t,p),!0);{const{url:r,target:o,rel:i,title:l}=t;return e(r,{...p,rel:i,target:o,title:l}),!0}}),n),void 0!==c?f.registerCommand(a,(t=>{const e=m();if(!s(e)||e.isCollapsed()||!l(t,ClipboardEvent))return!1;if(null===t.clipboardData)return!1;const o=t.clipboardData.getData("text");return!!c(o)&&(!e.getNodes().some((t=>u(t)))&&(f.dispatchCommand(r,{...p,url:o}),t.preventDefault(),!0))}),n):()=>{})}),[f,c,p]),null}export{c as LinkPlugin};
9
+ import{namedSignals as r}from"@lexical/extension";import{LinkNode as t,registerLink as e}from"@lexical/link";import{useLexicalComposerContext as o}from"@lexical/react/LexicalComposerContext";import{useEffect as i}from"react";function l({validateUrl:l,attributes:n}){const[a]=o();return i((()=>{if(!a.hasNodes([t]))throw new Error("LinkPlugin: LinkNode not registered on editor")})),i((()=>e(a,r({attributes:n,validateUrl:l}))),[a,l,n]),null}export{l as LinkPlugin};
@@ -8,3 +8,8 @@
8
8
  */
9
9
 
10
10
  declare export function ListPlugin(): null;
11
+
12
+ export type ListPluginProps = {
13
+ hasStrictIndent?: boolean;
14
+ };
15
+ declare export function ListPlugin(props: ListPluginProps): null;
@@ -8,7 +8,7 @@
8
8
 
9
9
  import { TRANSFORMERS, registerMarkdownShortcuts } from '@lexical/markdown';
10
10
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
11
- import { HorizontalRuleNode, $isHorizontalRuleNode, $createHorizontalRuleNode } from '@lexical/react/LexicalHorizontalRuleNode';
11
+ import { HorizontalRuleNode, $createHorizontalRuleNode, $isHorizontalRuleNode } from '@lexical/react/LexicalHorizontalRuleNode';
12
12
  import { useEffect } from 'react';
13
13
 
14
14
  /**
@@ -6,4 +6,4 @@
6
6
  *
7
7
  */
8
8
 
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};
9
+ import{TRANSFORMERS as e,registerMarkdownShortcuts as r}from"@lexical/markdown";import{useLexicalComposerContext as t}from"@lexical/react/LexicalComposerContext";import{HorizontalRuleNode as o,$createHorizontalRuleNode as l,$isHorizontalRuleNode as n}from"@lexical/react/LexicalHorizontalRuleNode";import{useEffect as c}from"react";const i=[{dependencies:[o],export:e=>n(e)?"***":null,regExp:/^(---|\*\*\*|___)\s?$/,replace:(e,r,t,o)=>{const n=l();o||null!=e.getNextSibling()?e.replace(n):e.insertBefore(n),n.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};