@payloadcms/richtext-lexical 3.0.0-beta.2 → 3.0.0-beta.21

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 (415) hide show
  1. package/dist/cell/index.d.ts +1 -1
  2. package/dist/cell/index.d.ts.map +1 -1
  3. package/dist/cell/index.js +2 -4
  4. package/dist/cell/index.js.map +1 -1
  5. package/dist/field/features/align/feature.client.d.ts.map +1 -1
  6. package/dist/field/features/align/feature.client.js +1 -2
  7. package/dist/field/features/align/feature.client.js.map +1 -1
  8. package/dist/field/features/blockquote/feature.client.d.ts.map +1 -1
  9. package/dist/field/features/blockquote/feature.client.js +3 -6
  10. package/dist/field/features/blockquote/feature.client.js.map +1 -1
  11. package/dist/field/features/blockquote/feature.server.d.ts.map +1 -1
  12. package/dist/field/features/blockquote/feature.server.js +4 -4
  13. package/dist/field/features/blockquote/feature.server.js.map +1 -1
  14. package/dist/field/features/blockquote/markdownTransformer.d.ts.map +1 -1
  15. package/dist/field/features/blockquote/markdownTransformer.js +2 -4
  16. package/dist/field/features/blockquote/markdownTransformer.js.map +1 -1
  17. package/dist/field/features/blocks/component/BlockContent.d.ts.map +1 -1
  18. package/dist/field/features/blocks/component/BlockContent.js +3 -5
  19. package/dist/field/features/blocks/component/BlockContent.js.map +1 -1
  20. package/dist/field/features/blocks/component/index.d.ts.map +1 -1
  21. package/dist/field/features/blocks/component/index.js +36 -3
  22. package/dist/field/features/blocks/component/index.js.map +1 -1
  23. package/dist/field/features/blocks/drawer/index.d.ts.map +1 -1
  24. package/dist/field/features/blocks/drawer/index.js +2 -4
  25. package/dist/field/features/blocks/drawer/index.js.map +1 -1
  26. package/dist/field/features/blocks/feature.server.d.ts.map +1 -1
  27. package/dist/field/features/blocks/feature.server.js +109 -77
  28. package/dist/field/features/blocks/feature.server.js.map +1 -1
  29. package/dist/field/features/blocks/nodes/BlocksNode.d.ts +1 -3
  30. package/dist/field/features/blocks/nodes/BlocksNode.d.ts.map +1 -1
  31. package/dist/field/features/blocks/nodes/BlocksNode.js +1 -2
  32. package/dist/field/features/blocks/nodes/BlocksNode.js.map +1 -1
  33. package/dist/field/features/blocks/plugin/commands.d.ts.map +1 -1
  34. package/dist/field/features/blocks/plugin/commands.js +1 -2
  35. package/dist/field/features/blocks/plugin/commands.js.map +1 -1
  36. package/dist/field/features/blocks/plugin/index.d.ts.map +1 -1
  37. package/dist/field/features/blocks/plugin/index.js +3 -6
  38. package/dist/field/features/blocks/plugin/index.js.map +1 -1
  39. package/dist/field/features/blocks/populationPromise.d.ts.map +1 -1
  40. package/dist/field/features/blocks/populationPromise.js +3 -18
  41. package/dist/field/features/blocks/populationPromise.js.map +1 -1
  42. package/dist/field/features/blocks/validate.d.ts.map +1 -1
  43. package/dist/field/features/blocks/validate.js +22 -36
  44. package/dist/field/features/blocks/validate.js.map +1 -1
  45. package/dist/field/features/converters/html/field/index.d.ts +8 -2
  46. package/dist/field/features/converters/html/field/index.d.ts.map +1 -1
  47. package/dist/field/features/converters/html/field/index.js +6 -3
  48. package/dist/field/features/converters/html/field/index.js.map +1 -1
  49. package/dist/field/features/debug/testrecorder/plugin/index.d.ts.map +1 -1
  50. package/dist/field/features/debug/testrecorder/plugin/index.js +2 -4
  51. package/dist/field/features/debug/testrecorder/plugin/index.js.map +1 -1
  52. package/dist/field/features/debug/treeview/plugin/index.d.ts.map +1 -1
  53. package/dist/field/features/debug/treeview/plugin/index.js +2 -4
  54. package/dist/field/features/debug/treeview/plugin/index.js.map +1 -1
  55. package/dist/field/features/format/bold/feature.client.d.ts.map +1 -1
  56. package/dist/field/features/format/bold/feature.client.js +1 -2
  57. package/dist/field/features/format/bold/feature.client.js.map +1 -1
  58. package/dist/field/features/format/inlinecode/feature.client.d.ts.map +1 -1
  59. package/dist/field/features/format/inlinecode/feature.client.js +1 -2
  60. package/dist/field/features/format/inlinecode/feature.client.js.map +1 -1
  61. package/dist/field/features/format/italic/feature.client.d.ts.map +1 -1
  62. package/dist/field/features/format/italic/feature.client.js +1 -2
  63. package/dist/field/features/format/italic/feature.client.js.map +1 -1
  64. package/dist/field/features/format/strikethrough/feature.client.d.ts.map +1 -1
  65. package/dist/field/features/format/strikethrough/feature.client.js +1 -2
  66. package/dist/field/features/format/strikethrough/feature.client.js.map +1 -1
  67. package/dist/field/features/format/subscript/feature.client.d.ts.map +1 -1
  68. package/dist/field/features/format/subscript/feature.client.js +1 -2
  69. package/dist/field/features/format/subscript/feature.client.js.map +1 -1
  70. package/dist/field/features/format/superscript/feature.client.d.ts.map +1 -1
  71. package/dist/field/features/format/superscript/feature.client.js +1 -2
  72. package/dist/field/features/format/superscript/feature.client.js.map +1 -1
  73. package/dist/field/features/format/underline/feature.client.d.ts.map +1 -1
  74. package/dist/field/features/format/underline/feature.client.js +1 -2
  75. package/dist/field/features/format/underline/feature.client.js.map +1 -1
  76. package/dist/field/features/heading/feature.client.d.ts.map +1 -1
  77. package/dist/field/features/heading/feature.client.js +3 -6
  78. package/dist/field/features/heading/feature.client.js.map +1 -1
  79. package/dist/field/features/heading/feature.server.d.ts.map +1 -1
  80. package/dist/field/features/heading/feature.server.js +5 -5
  81. package/dist/field/features/heading/feature.server.js.map +1 -1
  82. package/dist/field/features/heading/markdownTransformer.d.ts.map +1 -1
  83. package/dist/field/features/heading/markdownTransformer.js +1 -2
  84. package/dist/field/features/heading/markdownTransformer.js.map +1 -1
  85. package/dist/field/features/horizontalrule/component/index.d.ts +10 -0
  86. package/dist/field/features/horizontalrule/component/index.d.ts.map +1 -0
  87. package/dist/field/features/horizontalrule/component/index.js +62 -0
  88. package/dist/field/features/horizontalrule/component/index.js.map +1 -0
  89. package/dist/field/features/horizontalrule/feature.client.d.ts +3 -0
  90. package/dist/field/features/horizontalrule/feature.client.d.ts.map +1 -0
  91. package/dist/field/features/horizontalrule/feature.client.js +53 -0
  92. package/dist/field/features/horizontalrule/feature.client.js.map +1 -0
  93. package/dist/field/features/horizontalrule/feature.server.d.ts +3 -0
  94. package/dist/field/features/horizontalrule/feature.server.d.ts.map +1 -0
  95. package/dist/field/features/horizontalrule/feature.server.js +37 -0
  96. package/dist/field/features/horizontalrule/feature.server.js.map +1 -0
  97. package/dist/field/features/horizontalrule/markdownTransformer.d.ts +3 -0
  98. package/dist/field/features/horizontalrule/markdownTransformer.d.ts.map +1 -0
  99. package/dist/field/features/horizontalrule/markdownTransformer.js +23 -0
  100. package/dist/field/features/horizontalrule/markdownTransformer.js.map +1 -0
  101. package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.d.ts +53 -0
  102. package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.d.ts.map +1 -0
  103. package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.js +88 -0
  104. package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.js.map +1 -0
  105. package/dist/field/features/horizontalrule/plugin/index.d.ts +6 -0
  106. package/dist/field/features/horizontalrule/plugin/index.d.ts.map +1 -0
  107. package/dist/field/features/horizontalrule/plugin/index.js +31 -0
  108. package/dist/field/features/horizontalrule/plugin/index.js.map +1 -0
  109. package/dist/field/features/horizontalrule/plugin/index.scss +20 -0
  110. package/dist/field/features/indent/feature.client.d.ts.map +1 -1
  111. package/dist/field/features/indent/feature.client.js +1 -2
  112. package/dist/field/features/indent/feature.client.js.map +1 -1
  113. package/dist/field/features/link/drawer/baseFields.d.ts +3 -3
  114. package/dist/field/features/link/drawer/baseFields.d.ts.map +1 -1
  115. package/dist/field/features/link/drawer/baseFields.js +28 -42
  116. package/dist/field/features/link/drawer/baseFields.js.map +1 -1
  117. package/dist/field/features/link/drawer/index.js +3 -2
  118. package/dist/field/features/link/drawer/index.js.map +1 -1
  119. package/dist/field/features/link/drawer/types.d.ts +4 -2
  120. package/dist/field/features/link/drawer/types.d.ts.map +1 -1
  121. package/dist/field/features/link/drawer/types.js.map +1 -1
  122. package/dist/field/features/link/feature.client.d.ts.map +1 -1
  123. package/dist/field/features/link/feature.client.js +2 -4
  124. package/dist/field/features/link/feature.client.js.map +1 -1
  125. package/dist/field/features/link/feature.server.d.ts +0 -2
  126. package/dist/field/features/link/feature.server.d.ts.map +1 -1
  127. package/dist/field/features/link/feature.server.js +48 -9
  128. package/dist/field/features/link/feature.server.js.map +1 -1
  129. package/dist/field/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  130. package/dist/field/features/link/nodes/AutoLinkNode.js +1 -2
  131. package/dist/field/features/link/nodes/AutoLinkNode.js.map +1 -1
  132. package/dist/field/features/link/nodes/LinkNode.d.ts +1 -3
  133. package/dist/field/features/link/nodes/LinkNode.d.ts.map +1 -1
  134. package/dist/field/features/link/nodes/LinkNode.js +2 -4
  135. package/dist/field/features/link/nodes/LinkNode.js.map +1 -1
  136. package/dist/field/features/link/plugins/autoLink/index.d.ts.map +1 -1
  137. package/dist/field/features/link/plugins/autoLink/index.js +3 -6
  138. package/dist/field/features/link/plugins/autoLink/index.js.map +1 -1
  139. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.d.ts.map +1 -1
  140. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.js +1 -2
  141. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.js.map +1 -1
  142. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  143. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js +56 -39
  144. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  145. package/dist/field/features/link/plugins/floatingLinkEditor/index.scss +9 -1
  146. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts +3 -5
  147. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts.map +1 -1
  148. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js +11 -29
  149. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js.map +1 -1
  150. package/dist/field/features/link/plugins/link/index.d.ts.map +1 -1
  151. package/dist/field/features/link/plugins/link/index.js +3 -12
  152. package/dist/field/features/link/plugins/link/index.js.map +1 -1
  153. package/dist/field/features/link/populationPromise.d.ts.map +1 -1
  154. package/dist/field/features/link/populationPromise.js +9 -25
  155. package/dist/field/features/link/populationPromise.js.map +1 -1
  156. package/dist/field/features/link/validate.d.ts +5 -0
  157. package/dist/field/features/link/validate.d.ts.map +1 -0
  158. package/dist/field/features/link/validate.js +32 -0
  159. package/dist/field/features/link/validate.js.map +1 -0
  160. package/dist/field/features/lists/checklist/feature.client.d.ts.map +1 -1
  161. package/dist/field/features/lists/checklist/feature.client.js +1 -2
  162. package/dist/field/features/lists/checklist/feature.client.js.map +1 -1
  163. package/dist/field/features/lists/checklist/feature.server.d.ts.map +1 -1
  164. package/dist/field/features/lists/checklist/feature.server.js +6 -6
  165. package/dist/field/features/lists/checklist/feature.server.js.map +1 -1
  166. package/dist/field/features/lists/checklist/markdownTransformers.d.ts.map +1 -1
  167. package/dist/field/features/lists/checklist/markdownTransformers.js +1 -2
  168. package/dist/field/features/lists/checklist/markdownTransformers.js.map +1 -1
  169. package/dist/field/features/lists/checklist/plugin/index.d.ts.map +1 -1
  170. package/dist/field/features/lists/checklist/plugin/index.js +1 -2
  171. package/dist/field/features/lists/checklist/plugin/index.js.map +1 -1
  172. package/dist/field/features/lists/common/markdown.d.ts.map +1 -1
  173. package/dist/field/features/lists/common/markdown.js +1 -2
  174. package/dist/field/features/lists/common/markdown.js.map +1 -1
  175. package/dist/field/features/lists/htmlConverter.d.ts.map +1 -1
  176. package/dist/field/features/lists/htmlConverter.js +13 -6
  177. package/dist/field/features/lists/htmlConverter.js.map +1 -1
  178. package/dist/field/features/lists/orderedlist/feature.client.d.ts.map +1 -1
  179. package/dist/field/features/lists/orderedlist/feature.client.js +1 -2
  180. package/dist/field/features/lists/orderedlist/feature.client.js.map +1 -1
  181. package/dist/field/features/lists/orderedlist/feature.server.d.ts.map +1 -1
  182. package/dist/field/features/lists/orderedlist/feature.server.js +6 -6
  183. package/dist/field/features/lists/orderedlist/feature.server.js.map +1 -1
  184. package/dist/field/features/lists/orderedlist/markdownTransformer.d.ts.map +1 -1
  185. package/dist/field/features/lists/orderedlist/markdownTransformer.js +1 -2
  186. package/dist/field/features/lists/orderedlist/markdownTransformer.js.map +1 -1
  187. package/dist/field/features/lists/plugin/index.d.ts.map +1 -1
  188. package/dist/field/features/lists/plugin/index.js +1 -2
  189. package/dist/field/features/lists/plugin/index.js.map +1 -1
  190. package/dist/field/features/lists/unorderedlist/feature.client.d.ts.map +1 -1
  191. package/dist/field/features/lists/unorderedlist/feature.client.js +1 -2
  192. package/dist/field/features/lists/unorderedlist/feature.client.js.map +1 -1
  193. package/dist/field/features/lists/unorderedlist/feature.server.d.ts.map +1 -1
  194. package/dist/field/features/lists/unorderedlist/feature.server.js +6 -6
  195. package/dist/field/features/lists/unorderedlist/feature.server.js.map +1 -1
  196. package/dist/field/features/lists/unorderedlist/markdownTransformer.d.ts.map +1 -1
  197. package/dist/field/features/lists/unorderedlist/markdownTransformer.js +1 -2
  198. package/dist/field/features/lists/unorderedlist/markdownTransformer.js.map +1 -1
  199. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.d.ts.map +1 -1
  200. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js +2 -4
  201. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js.map +1 -1
  202. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts +1 -3
  203. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  204. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +2 -4
  205. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  206. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.d.ts.map +1 -1
  207. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.js +2 -4
  208. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.js.map +1 -1
  209. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.d.ts.map +1 -1
  210. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.js +2 -4
  211. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.js.map +1 -1
  212. package/dist/field/features/migrations/slateToLexical/converter/index.d.ts.map +1 -1
  213. package/dist/field/features/migrations/slateToLexical/converter/index.js +2 -1
  214. package/dist/field/features/migrations/slateToLexical/converter/index.js.map +1 -1
  215. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts +1 -3
  216. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  217. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +2 -4
  218. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  219. package/dist/field/features/paragraph/feature.client.d.ts.map +1 -1
  220. package/dist/field/features/paragraph/feature.client.js +2 -4
  221. package/dist/field/features/paragraph/feature.client.js.map +1 -1
  222. package/dist/field/features/relationship/drawer/commands.d.ts.map +1 -1
  223. package/dist/field/features/relationship/drawer/commands.js +1 -2
  224. package/dist/field/features/relationship/drawer/commands.js.map +1 -1
  225. package/dist/field/features/relationship/drawer/index.d.ts.map +1 -1
  226. package/dist/field/features/relationship/drawer/index.js +7 -13
  227. package/dist/field/features/relationship/drawer/index.js.map +1 -1
  228. package/dist/field/features/relationship/feature.server.d.ts.map +1 -1
  229. package/dist/field/features/relationship/feature.server.js +3 -2
  230. package/dist/field/features/relationship/feature.server.js.map +1 -1
  231. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts +3 -8
  232. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts.map +1 -1
  233. package/dist/field/features/relationship/nodes/RelationshipNode.js +8 -8
  234. package/dist/field/features/relationship/nodes/RelationshipNode.js.map +1 -1
  235. package/dist/field/features/relationship/nodes/components/RelationshipComponent.d.ts.map +1 -1
  236. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js +54 -7
  237. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js.map +1 -1
  238. package/dist/field/features/relationship/plugins/index.d.ts.map +1 -1
  239. package/dist/field/features/relationship/plugins/index.js +3 -6
  240. package/dist/field/features/relationship/plugins/index.js.map +1 -1
  241. package/dist/field/features/relationship/populationPromise.js +7 -6
  242. package/dist/field/features/relationship/populationPromise.js.map +1 -1
  243. package/dist/field/features/typeUtilities.d.ts +8 -0
  244. package/dist/field/features/typeUtilities.d.ts.map +1 -0
  245. package/dist/field/features/typeUtilities.js +8 -0
  246. package/dist/field/features/typeUtilities.js.map +1 -0
  247. package/dist/field/features/types.d.ts +57 -33
  248. package/dist/field/features/types.d.ts.map +1 -1
  249. package/dist/field/features/types.js.map +1 -1
  250. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.d.ts.map +1 -1
  251. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js +5 -6
  252. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js.map +1 -1
  253. package/dist/field/features/upload/component/index.d.ts.map +1 -1
  254. package/dist/field/features/upload/component/index.js +55 -9
  255. package/dist/field/features/upload/component/index.js.map +1 -1
  256. package/dist/field/features/upload/drawer/commands.d.ts.map +1 -1
  257. package/dist/field/features/upload/drawer/commands.js +1 -2
  258. package/dist/field/features/upload/drawer/commands.js.map +1 -1
  259. package/dist/field/features/upload/drawer/index.d.ts.map +1 -1
  260. package/dist/field/features/upload/drawer/index.js +8 -12
  261. package/dist/field/features/upload/drawer/index.js.map +1 -1
  262. package/dist/field/features/upload/feature.server.d.ts.map +1 -1
  263. package/dist/field/features/upload/feature.server.js +39 -11
  264. package/dist/field/features/upload/feature.server.js.map +1 -1
  265. package/dist/field/features/upload/nodes/UploadNode.d.ts +2 -14
  266. package/dist/field/features/upload/nodes/UploadNode.d.ts.map +1 -1
  267. package/dist/field/features/upload/nodes/UploadNode.js +6 -9
  268. package/dist/field/features/upload/nodes/UploadNode.js.map +1 -1
  269. package/dist/field/features/upload/plugin/index.d.ts +2 -2
  270. package/dist/field/features/upload/plugin/index.d.ts.map +1 -1
  271. package/dist/field/features/upload/plugin/index.js +4 -9
  272. package/dist/field/features/upload/plugin/index.js.map +1 -1
  273. package/dist/field/features/upload/populationPromise.js +11 -8
  274. package/dist/field/features/upload/populationPromise.js.map +1 -1
  275. package/dist/field/features/upload/validate.d.ts +2 -1
  276. package/dist/field/features/upload/validate.d.ts.map +1 -1
  277. package/dist/field/features/upload/validate.js +34 -12
  278. package/dist/field/features/upload/validate.js.map +1 -1
  279. package/dist/field/index.d.ts +1 -1
  280. package/dist/field/index.d.ts.map +1 -1
  281. package/dist/field/index.js.map +1 -1
  282. package/dist/field/lexical/LexicalEditor.d.ts.map +1 -1
  283. package/dist/field/lexical/LexicalEditor.js +6 -11
  284. package/dist/field/lexical/LexicalEditor.js.map +1 -1
  285. package/dist/field/lexical/LexicalProvider.d.ts +1 -1
  286. package/dist/field/lexical/LexicalProvider.d.ts.map +1 -1
  287. package/dist/field/lexical/LexicalProvider.js +1 -2
  288. package/dist/field/lexical/LexicalProvider.js.map +1 -1
  289. package/dist/field/lexical/config/client/default.d.ts +1 -1
  290. package/dist/field/lexical/config/client/default.d.ts.map +1 -1
  291. package/dist/field/lexical/config/client/default.js.map +1 -1
  292. package/dist/field/lexical/config/client/sanitize.d.ts +1 -1
  293. package/dist/field/lexical/config/client/sanitize.d.ts.map +1 -1
  294. package/dist/field/lexical/config/client/sanitize.js.map +1 -1
  295. package/dist/field/lexical/config/server/default.d.ts +2 -3
  296. package/dist/field/lexical/config/server/default.d.ts.map +1 -1
  297. package/dist/field/lexical/config/server/default.js +3 -3
  298. package/dist/field/lexical/config/server/default.js.map +1 -1
  299. package/dist/field/lexical/config/server/loader.d.ts +4 -2
  300. package/dist/field/lexical/config/server/loader.d.ts.map +1 -1
  301. package/dist/field/lexical/config/server/loader.js +3 -2
  302. package/dist/field/lexical/config/server/loader.js.map +1 -1
  303. package/dist/field/lexical/config/server/sanitize.d.ts +2 -1
  304. package/dist/field/lexical/config/server/sanitize.d.ts.map +1 -1
  305. package/dist/field/lexical/config/server/sanitize.js +23 -8
  306. package/dist/field/lexical/config/server/sanitize.js.map +1 -1
  307. package/dist/field/lexical/config/types.d.ts +1 -1
  308. package/dist/field/lexical/config/types.d.ts.map +1 -1
  309. package/dist/field/lexical/config/types.js.map +1 -1
  310. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.d.ts.map +1 -1
  311. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.js +3 -6
  312. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.js.map +1 -1
  313. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.d.ts.map +1 -1
  314. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.js +3 -6
  315. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.js.map +1 -1
  316. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.d.ts.map +1 -1
  317. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.js +27 -29
  318. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.js.map +1 -1
  319. package/dist/field/lexical/plugins/MarkdownShortcut/index.d.ts.map +1 -1
  320. package/dist/field/lexical/plugins/MarkdownShortcut/index.js +1 -2
  321. package/dist/field/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  322. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  323. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +3 -6
  324. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  325. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts.map +1 -1
  326. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +3 -6
  327. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
  328. package/dist/field/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
  329. package/dist/field/lexical/plugins/SlashMenu/index.js +1 -2
  330. package/dist/field/lexical/plugins/SlashMenu/index.js.map +1 -1
  331. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts.map +1 -1
  332. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js +13 -10
  333. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  334. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.d.ts.map +1 -1
  335. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js +1 -2
  336. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js.map +1 -1
  337. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  338. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js +10 -7
  339. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  340. package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.d.ts +9 -0
  341. package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.d.ts.map +1 -0
  342. package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.js +35 -0
  343. package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.js.map +1 -0
  344. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.d.ts.map +1 -1
  345. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.js +1 -2
  346. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.js.map +1 -1
  347. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.d.ts +1 -1
  348. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
  349. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js +17 -7
  350. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  351. package/dist/field/lexical/theme/EditorTheme.scss +11 -8
  352. package/dist/field/lexical/ui/ContentEditable.d.ts.map +1 -1
  353. package/dist/field/lexical/ui/ContentEditable.js +1 -2
  354. package/dist/field/lexical/ui/ContentEditable.js.map +1 -1
  355. package/dist/field/lexical/ui/icons/HorizontalRule/index.d.ts +3 -0
  356. package/dist/field/lexical/ui/icons/HorizontalRule/index.d.ts.map +1 -0
  357. package/dist/field/lexical/ui/icons/HorizontalRule/index.js +19 -0
  358. package/dist/field/lexical/ui/icons/HorizontalRule/index.js.map +1 -0
  359. package/dist/field/lexical/utils/getSelectedNode.d.ts.map +1 -1
  360. package/dist/field/lexical/utils/getSelectedNode.js +1 -2
  361. package/dist/field/lexical/utils/getSelectedNode.js.map +1 -1
  362. package/dist/field/lexical/utils/nodeFormat.d.ts +2 -1
  363. package/dist/field/lexical/utils/nodeFormat.d.ts.map +1 -1
  364. package/dist/field/lexical/utils/nodeFormat.js.map +1 -1
  365. package/dist/field/lexical/utils/setFloatingElemPosition.d.ts +1 -1
  366. package/dist/field/lexical/utils/setFloatingElemPosition.d.ts.map +1 -1
  367. package/dist/field/lexical/utils/setFloatingElemPosition.js +15 -13
  368. package/dist/field/lexical/utils/setFloatingElemPosition.js.map +1 -1
  369. package/dist/field/lexical/utils/url.d.ts.map +1 -1
  370. package/dist/field/lexical/utils/url.js +3 -0
  371. package/dist/field/lexical/utils/url.js.map +1 -1
  372. package/dist/forEachNodeRecursively.d.ts +10 -0
  373. package/dist/forEachNodeRecursively.d.ts.map +1 -0
  374. package/dist/forEachNodeRecursively.js +24 -0
  375. package/dist/forEachNodeRecursively.js.map +1 -0
  376. package/dist/generateComponentMap.d.ts.map +1 -1
  377. package/dist/generateComponentMap.js +16 -22
  378. package/dist/generateComponentMap.js.map +1 -1
  379. package/dist/generateSchemaMap.d.ts.map +1 -1
  380. package/dist/generateSchemaMap.js +4 -12
  381. package/dist/generateSchemaMap.js.map +1 -1
  382. package/dist/index.d.ts +6 -5
  383. package/dist/index.d.ts.map +1 -1
  384. package/dist/index.js +260 -173
  385. package/dist/index.js.map +1 -1
  386. package/dist/populate/defaultValue.d.ts.map +1 -1
  387. package/dist/populate/defaultValue.js +1 -0
  388. package/dist/populate/defaultValue.js.map +1 -1
  389. package/dist/populate/populate.d.ts +3 -3
  390. package/dist/populate/populate.d.ts.map +1 -1
  391. package/dist/populate/populate.js.map +1 -1
  392. package/dist/populate/populateLexicalPopulationPromises.d.ts +12 -0
  393. package/dist/populate/populateLexicalPopulationPromises.d.ts.map +1 -0
  394. package/dist/populate/populateLexicalPopulationPromises.js +35 -0
  395. package/dist/populate/populateLexicalPopulationPromises.js.map +1 -0
  396. package/dist/populate/recurseNestedFields.d.ts +7 -4
  397. package/dist/populate/recurseNestedFields.d.ts.map +1 -1
  398. package/dist/populate/recurseNestedFields.js +3 -5
  399. package/dist/populate/recurseNestedFields.js.map +1 -1
  400. package/dist/scss/app.scss +2 -3
  401. package/dist/scss/vars.scss +0 -7
  402. package/dist/types.d.ts +11 -5
  403. package/dist/types.d.ts.map +1 -1
  404. package/dist/types.js.map +1 -1
  405. package/dist/validate/index.d.ts +1 -1
  406. package/dist/validate/index.d.ts.map +1 -1
  407. package/package.json +47 -46
  408. package/components.d.ts +0 -6
  409. package/components.js +0 -7
  410. package/dist/populate/richTextRelationshipPromise.d.ts +0 -23
  411. package/dist/populate/richTextRelationshipPromise.d.ts.map +0 -1
  412. package/dist/populate/richTextRelationshipPromise.js +0 -68
  413. package/dist/populate/richTextRelationshipPromise.js.map +0 -1
  414. package/dist/scss/fonts.scss +0 -75
  415. package/src/index.ts +0 -423
@@ -1,6 +1,6 @@
1
- import lexicalRichTextImport from '@lexical/rich-text';
2
- const { HeadingNode } = lexicalRichTextImport;
1
+ import { HeadingNode } from '@lexical/rich-text';
3
2
  import { convertLexicalNodesToHTML } from '../converters/html/converter/index.js';
3
+ import { createNode } from '../typeUtilities.js';
4
4
  import { HeadingFeatureClientComponent } from './feature.client.js';
5
5
  import { MarkdownTransformer } from './markdownTransformer.js';
6
6
  export const HeadingFeature = (props)=>{
@@ -19,12 +19,12 @@ export const HeadingFeature = (props)=>{
19
19
  feature: ()=>{
20
20
  return {
21
21
  ClientComponent: HeadingFeatureClientComponent,
22
+ clientFeatureProps: props,
22
23
  markdownTransformers: [
23
24
  MarkdownTransformer(enabledHeadingSizes)
24
25
  ],
25
26
  nodes: [
26
- {
27
- type: HeadingNode.getType(),
27
+ createNode({
28
28
  converters: {
29
29
  html: {
30
30
  converter: async ({ converters, node, parent, payload })=>{
@@ -45,7 +45,7 @@ export const HeadingFeature = (props)=>{
45
45
  }
46
46
  },
47
47
  node: HeadingNode
48
- }
48
+ })
49
49
  ],
50
50
  serverFeatureProps: props
51
51
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/field/features/heading/feature.server.ts"],"sourcesContent":["import type { HeadingTagType, SerializedHeadingNode } from '@lexical/rich-text'\n\nimport lexicalRichTextImport from '@lexical/rich-text'\nconst { HeadingNode } = lexicalRichTextImport\n\nimport type { HTMLConverter } from '../converters/html/converter/types.js'\nimport type { FeatureProviderProviderServer } from '../types.js'\n\nimport { convertLexicalNodesToHTML } from '../converters/html/converter/index.js'\nimport { HeadingFeatureClientComponent } from './feature.client.js'\nimport { MarkdownTransformer } from './markdownTransformer.js'\n\nexport type HeadingFeatureProps = {\n enabledHeadingSizes?: HeadingTagType[]\n}\n\nexport const HeadingFeature: FeatureProviderProviderServer<\n HeadingFeatureProps,\n HeadingFeatureProps\n> = (props) => {\n if (!props) {\n props = {}\n }\n\n const { enabledHeadingSizes = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] } = props\n\n return {\n feature: () => {\n return {\n ClientComponent: HeadingFeatureClientComponent,\n markdownTransformers: [MarkdownTransformer(enabledHeadingSizes)],\n nodes: [\n {\n type: HeadingNode.getType(),\n converters: {\n html: {\n converter: async ({ converters, node, parent, payload }) => {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n lexicalNodes: node.children,\n parent: {\n ...node,\n parent,\n },\n payload,\n })\n\n return '<' + node?.tag + '>' + childrenText + '</' + node?.tag + '>'\n },\n nodeTypes: [HeadingNode.getType()],\n } as HTMLConverter<SerializedHeadingNode>,\n },\n node: HeadingNode,\n },\n ],\n serverFeatureProps: props,\n }\n },\n key: 'heading',\n serverFeatureProps: props,\n }\n}\n"],"names":["lexicalRichTextImport","HeadingNode","convertLexicalNodesToHTML","HeadingFeatureClientComponent","MarkdownTransformer","HeadingFeature","props","enabledHeadingSizes","feature","ClientComponent","markdownTransformers","nodes","type","getType","converters","html","converter","node","parent","payload","childrenText","lexicalNodes","children","tag","nodeTypes","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,OAAOA,2BAA2B,qBAAoB;AACtD,MAAM,EAAEC,WAAW,EAAE,GAAGD;AAKxB,SAASE,yBAAyB,QAAQ,wCAAuC;AACjF,SAASC,6BAA6B,QAAQ,sBAAqB;AACnE,SAASC,mBAAmB,QAAQ,2BAA0B;AAM9D,OAAO,MAAMC,iBAGT,CAACC;IACH,IAAI,CAACA,OAAO;QACVA,QAAQ,CAAC;IACX;IAEA,MAAM,EAAEC,sBAAsB;QAAC;QAAM;QAAM;QAAM;QAAM;QAAM;KAAK,EAAE,GAAGD;IAEvE,OAAO;QACLE,SAAS;YACP,OAAO;gBACLC,iBAAiBN;gBACjBO,sBAAsB;oBAACN,oBAAoBG;iBAAqB;gBAChEI,OAAO;oBACL;wBACEC,MAAMX,YAAYY,OAAO;wBACzBC,YAAY;4BACVC,MAAM;gCACJC,WAAW,OAAO,EAAEF,UAAU,EAAEG,IAAI,EAAEC,MAAM,EAAEC,OAAO,EAAE;oCACrD,MAAMC,eAAe,MAAMlB,0BAA0B;wCACnDY;wCACAO,cAAcJ,KAAKK,QAAQ;wCAC3BJ,QAAQ;4CACN,GAAGD,IAAI;4CACPC;wCACF;wCACAC;oCACF;oCAEA,OAAO,MAAMF,MAAMM,MAAM,MAAMH,eAAe,OAAOH,MAAMM,MAAM;gCACnE;gCACAC,WAAW;oCAACvB,YAAYY,OAAO;iCAAG;4BACpC;wBACF;wBACAI,MAAMhB;oBACR;iBACD;gBACDwB,oBAAoBnB;YACtB;QACF;QACAoB,KAAK;QACLD,oBAAoBnB;IACtB;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../src/field/features/heading/feature.server.ts"],"sourcesContent":["import type { HeadingTagType } from '@lexical/rich-text'\n\nimport { HeadingNode } from '@lexical/rich-text'\n\nimport type { FeatureProviderProviderServer } from '../types.js'\n\nimport { convertLexicalNodesToHTML } from '../converters/html/converter/index.js'\nimport { createNode } from '../typeUtilities.js'\nimport { HeadingFeatureClientComponent } from './feature.client.js'\nimport { MarkdownTransformer } from './markdownTransformer.js'\n\nexport type HeadingFeatureProps = {\n enabledHeadingSizes?: HeadingTagType[]\n}\n\nexport const HeadingFeature: FeatureProviderProviderServer<\n HeadingFeatureProps,\n HeadingFeatureProps\n> = (props) => {\n if (!props) {\n props = {}\n }\n\n const { enabledHeadingSizes = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] } = props\n\n return {\n feature: () => {\n return {\n ClientComponent: HeadingFeatureClientComponent,\n clientFeatureProps: props,\n markdownTransformers: [MarkdownTransformer(enabledHeadingSizes)],\n nodes: [\n createNode({\n converters: {\n html: {\n converter: async ({ converters, node, parent, payload }) => {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n lexicalNodes: node.children,\n parent: {\n ...node,\n parent,\n },\n payload,\n })\n\n return '<' + node?.tag + '>' + childrenText + '</' + node?.tag + '>'\n },\n nodeTypes: [HeadingNode.getType()],\n },\n },\n node: HeadingNode,\n }),\n ],\n serverFeatureProps: props,\n }\n },\n key: 'heading',\n serverFeatureProps: props,\n }\n}\n"],"names":["HeadingNode","convertLexicalNodesToHTML","createNode","HeadingFeatureClientComponent","MarkdownTransformer","HeadingFeature","props","enabledHeadingSizes","feature","ClientComponent","clientFeatureProps","markdownTransformers","nodes","converters","html","converter","node","parent","payload","childrenText","lexicalNodes","children","tag","nodeTypes","getType","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,SAASA,WAAW,QAAQ,qBAAoB;AAIhD,SAASC,yBAAyB,QAAQ,wCAAuC;AACjF,SAASC,UAAU,QAAQ,sBAAqB;AAChD,SAASC,6BAA6B,QAAQ,sBAAqB;AACnE,SAASC,mBAAmB,QAAQ,2BAA0B;AAM9D,OAAO,MAAMC,iBAGT,CAACC;IACH,IAAI,CAACA,OAAO;QACVA,QAAQ,CAAC;IACX;IAEA,MAAM,EAAEC,sBAAsB;QAAC;QAAM;QAAM;QAAM;QAAM;QAAM;KAAK,EAAE,GAAGD;IAEvE,OAAO;QACLE,SAAS;YACP,OAAO;gBACLC,iBAAiBN;gBACjBO,oBAAoBJ;gBACpBK,sBAAsB;oBAACP,oBAAoBG;iBAAqB;gBAChEK,OAAO;oBACLV,WAAW;wBACTW,YAAY;4BACVC,MAAM;gCACJC,WAAW,OAAO,EAAEF,UAAU,EAAEG,IAAI,EAAEC,MAAM,EAAEC,OAAO,EAAE;oCACrD,MAAMC,eAAe,MAAMlB,0BAA0B;wCACnDY;wCACAO,cAAcJ,KAAKK,QAAQ;wCAC3BJ,QAAQ;4CACN,GAAGD,IAAI;4CACPC;wCACF;wCACAC;oCACF;oCAEA,OAAO,MAAMF,MAAMM,MAAM,MAAMH,eAAe,OAAOH,MAAMM,MAAM;gCACnE;gCACAC,WAAW;oCAACvB,YAAYwB,OAAO;iCAAG;4BACpC;wBACF;wBACAR,MAAMhB;oBACR;iBACD;gBACDyB,oBAAoBnB;YACtB;QACF;QACAoB,KAAK;QACLD,oBAAoBnB;IACtB;AACF,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"markdownTransformer.d.ts","sourceRoot":"","sources":["../../../../src/field/features/heading/markdownTransformer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAOxD,eAAO,MAAM,mBAAmB,EAAE,CAAC,mBAAmB,EAAE,cAAc,EAAE,KAAK,kBA0B5E,CAAA"}
1
+ {"version":3,"file":"markdownTransformer.d.ts","sourceRoot":"","sources":["../../../../src/field/features/heading/markdownTransformer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAC3D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAA;AAMxD,eAAO,MAAM,mBAAmB,EAAE,CAAC,mBAAmB,EAAE,cAAc,EAAE,KAAK,kBA0B5E,CAAA"}
@@ -1,5 +1,4 @@
1
- import lexicalRichTextImport from '@lexical/rich-text';
2
- const { $createHeadingNode, $isHeadingNode, HeadingNode } = lexicalRichTextImport;
1
+ import { $createHeadingNode, $isHeadingNode, HeadingNode } from '@lexical/rich-text';
3
2
  import { createBlockNode } from '../../lexical/utils/markdown/createBlockNode.js';
4
3
  export const MarkdownTransformer = (enabledHeadingSizes)=>{
5
4
  // Convert enabledHeadingSizes to a list of numbers (1 for h1, 2 for h2, etc.)
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/field/features/heading/markdownTransformer.ts"],"sourcesContent":["import type { ElementTransformer } from '@lexical/markdown'\nimport type { HeadingTagType } from '@lexical/rich-text'\n\nimport lexicalRichTextImport from '@lexical/rich-text'\nconst { $createHeadingNode, $isHeadingNode, HeadingNode } = lexicalRichTextImport\n\nimport { createBlockNode } from '../../lexical/utils/markdown/createBlockNode.js'\n\nexport const MarkdownTransformer: (enabledHeadingSizes: HeadingTagType[]) => ElementTransformer = (\n enabledHeadingSizes,\n) => {\n // Convert enabledHeadingSizes to a list of numbers (1 for h1, 2 for h2, etc.)\n const enabledSizes = enabledHeadingSizes.map((tag) => Number(tag.slice(1)))\n\n // Create a regex pattern that matches any of the enabled sizes\n const pattern = `^(${enabledSizes.map((size) => `#{${size}}`).join('|')})\\\\s`\n const regExp = new RegExp(pattern)\n\n return {\n type: 'element',\n dependencies: [HeadingNode],\n export: (node, exportChildren) => {\n if (!$isHeadingNode(node)) {\n return null\n }\n const level = Number(node.getTag().slice(1))\n return '#'.repeat(level) + ' ' + exportChildren(node)\n },\n regExp,\n replace: createBlockNode((match) => {\n const tag = ('h' + match[1].length) as HeadingTagType\n return $createHeadingNode(tag)\n }),\n }\n}\n"],"names":["lexicalRichTextImport","$createHeadingNode","$isHeadingNode","HeadingNode","createBlockNode","MarkdownTransformer","enabledHeadingSizes","enabledSizes","map","tag","Number","slice","pattern","size","join","regExp","RegExp","type","dependencies","export","node","exportChildren","level","getTag","repeat","replace","match","length"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAGA,OAAOA,2BAA2B,qBAAoB;AACtD,MAAM,EAAEC,kBAAkB,EAAEC,cAAc,EAAEC,WAAW,EAAE,GAAGH;AAE5D,SAASI,eAAe,QAAQ,kDAAiD;AAEjF,OAAO,MAAMC,sBAAqF,CAChGC;IAEA,8EAA8E;IAC9E,MAAMC,eAAeD,oBAAoBE,GAAG,CAAC,CAACC,MAAQC,OAAOD,IAAIE,KAAK,CAAC;IAEvE,+DAA+D;IAC/D,MAAMC,UAAU,CAAC,EAAE,EAAEL,aAAaC,GAAG,CAAC,CAACK,OAAS,CAAC,EAAE,EAAEA,KAAK,CAAC,CAAC,EAAEC,IAAI,CAAC,KAAK,IAAI,CAAC;IAC7E,MAAMC,SAAS,IAAIC,OAAOJ;IAE1B,OAAO;QACLK,MAAM;QACNC,cAAc;YAACf;SAAY;QAC3BgB,QAAQ,CAACC,MAAMC;YACb,IAAI,CAACnB,eAAekB,OAAO;gBACzB,OAAO;YACT;YACA,MAAME,QAAQZ,OAAOU,KAAKG,MAAM,GAAGZ,KAAK,CAAC;YACzC,OAAO,IAAIa,MAAM,CAACF,SAAS,MAAMD,eAAeD;QAClD;QACAL;QACAU,SAASrB,gBAAgB,CAACsB;YACxB,MAAMjB,MAAO,MAAMiB,KAAK,CAAC,EAAE,CAACC,MAAM;YAClC,OAAO1B,mBAAmBQ;QAC5B;IACF;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../src/field/features/heading/markdownTransformer.ts"],"sourcesContent":["import type { ElementTransformer } from '@lexical/markdown'\nimport type { HeadingTagType } from '@lexical/rich-text'\n\nimport { $createHeadingNode, $isHeadingNode, HeadingNode } from '@lexical/rich-text'\n\nimport { createBlockNode } from '../../lexical/utils/markdown/createBlockNode.js'\n\nexport const MarkdownTransformer: (enabledHeadingSizes: HeadingTagType[]) => ElementTransformer = (\n enabledHeadingSizes,\n) => {\n // Convert enabledHeadingSizes to a list of numbers (1 for h1, 2 for h2, etc.)\n const enabledSizes = enabledHeadingSizes.map((tag) => Number(tag.slice(1)))\n\n // Create a regex pattern that matches any of the enabled sizes\n const pattern = `^(${enabledSizes.map((size) => `#{${size}}`).join('|')})\\\\s`\n const regExp = new RegExp(pattern)\n\n return {\n type: 'element',\n dependencies: [HeadingNode],\n export: (node, exportChildren) => {\n if (!$isHeadingNode(node)) {\n return null\n }\n const level = Number(node.getTag().slice(1))\n return '#'.repeat(level) + ' ' + exportChildren(node)\n },\n regExp,\n replace: createBlockNode((match) => {\n const tag = ('h' + match[1].length) as HeadingTagType\n return $createHeadingNode(tag)\n }),\n }\n}\n"],"names":["$createHeadingNode","$isHeadingNode","HeadingNode","createBlockNode","MarkdownTransformer","enabledHeadingSizes","enabledSizes","map","tag","Number","slice","pattern","size","join","regExp","RegExp","type","dependencies","export","node","exportChildren","level","getTag","repeat","replace","match","length"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAGA,SAASA,kBAAkB,EAAEC,cAAc,EAAEC,WAAW,QAAQ,qBAAoB;AAEpF,SAASC,eAAe,QAAQ,kDAAiD;AAEjF,OAAO,MAAMC,sBAAqF,CAChGC;IAEA,8EAA8E;IAC9E,MAAMC,eAAeD,oBAAoBE,GAAG,CAAC,CAACC,MAAQC,OAAOD,IAAIE,KAAK,CAAC;IAEvE,+DAA+D;IAC/D,MAAMC,UAAU,CAAC,EAAE,EAAEL,aAAaC,GAAG,CAAC,CAACK,OAAS,CAAC,EAAE,EAAEA,KAAK,CAAC,CAAC,EAAEC,IAAI,CAAC,KAAK,IAAI,CAAC;IAC7E,MAAMC,SAAS,IAAIC,OAAOJ;IAE1B,OAAO;QACLK,MAAM;QACNC,cAAc;YAACf;SAAY;QAC3BgB,QAAQ,CAACC,MAAMC;YACb,IAAI,CAACnB,eAAekB,OAAO;gBACzB,OAAO;YACT;YACA,MAAME,QAAQZ,OAAOU,KAAKG,MAAM,GAAGZ,KAAK,CAAC;YACzC,OAAO,IAAIa,MAAM,CAACF,SAAS,MAAMD,eAAeD;QAClD;QACAL;QACAU,SAASrB,gBAAgB,CAACsB;YACxB,MAAMjB,MAAO,MAAMiB,KAAK,CAAC,EAAE,CAACC,MAAM;YAClC,OAAO1B,mBAAmBQ;QAC5B;IACF;AACF,EAAC"}
@@ -0,0 +1,10 @@
1
+ import type { NodeKey } from 'lexical';
2
+ /**
3
+ * React component rendered in the lexical editor, WITHIN the hr element created by createDOM of the HorizontalRuleNode.
4
+ *
5
+ * @param nodeKey every node has a unique key (this key is not saved to the database and thus may differ between sessions). It's useful for working with the CURRENT lexical editor state
6
+ */
7
+ export declare function HorizontalRuleComponent({ nodeKey }: {
8
+ nodeKey: NodeKey;
9
+ }): any;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/horizontalrule/component/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAkBtC;;;;GAIG;AACH,wBAAgB,uBAAuB,CAAC,EAAE,OAAO,EAAE,EAAE;IAAE,OAAO,EAAE,OAAO,CAAA;CAAE,OAmDxE"}
@@ -0,0 +1,62 @@
1
+ 'use client';
2
+ import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js';
3
+ import { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection.js';
4
+ import { mergeRegister } from '@lexical/utils';
5
+ import { $getNodeByKey, $getSelection, $isNodeSelection, CLICK_COMMAND, COMMAND_PRIORITY_LOW, KEY_BACKSPACE_COMMAND, KEY_DELETE_COMMAND } from 'lexical';
6
+ import { useCallback, useEffect } from 'react';
7
+ import { $isHorizontalRuleNode } from '../nodes/HorizontalRuleNode.js';
8
+ /**
9
+ * React component rendered in the lexical editor, WITHIN the hr element created by createDOM of the HorizontalRuleNode.
10
+ *
11
+ * @param nodeKey every node has a unique key (this key is not saved to the database and thus may differ between sessions). It's useful for working with the CURRENT lexical editor state
12
+ */ export function HorizontalRuleComponent({ nodeKey }) {
13
+ const [editor] = useLexicalComposerContext();
14
+ const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey);
15
+ const onDelete = useCallback((event)=>{
16
+ if (isSelected && $isNodeSelection($getSelection())) {
17
+ event.preventDefault();
18
+ const node = $getNodeByKey(nodeKey);
19
+ if ($isHorizontalRuleNode(node)) {
20
+ node.remove();
21
+ return true;
22
+ }
23
+ }
24
+ return false;
25
+ }, [
26
+ isSelected,
27
+ nodeKey
28
+ ]);
29
+ useEffect(()=>{
30
+ return mergeRegister(editor.registerCommand(CLICK_COMMAND, (event)=>{
31
+ const hrElem = editor.getElementByKey(nodeKey);
32
+ if (event.target === hrElem) {
33
+ if (!event.shiftKey) {
34
+ clearSelection();
35
+ }
36
+ setSelected(!isSelected);
37
+ return true;
38
+ }
39
+ return false;
40
+ }, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_DELETE_COMMAND, onDelete, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_BACKSPACE_COMMAND, onDelete, COMMAND_PRIORITY_LOW));
41
+ }, [
42
+ clearSelection,
43
+ editor,
44
+ isSelected,
45
+ nodeKey,
46
+ onDelete,
47
+ setSelected
48
+ ]);
49
+ useEffect(()=>{
50
+ const hrElem = editor.getElementByKey(nodeKey);
51
+ if (hrElem !== null) {
52
+ hrElem.className = isSelected ? 'selected' : '';
53
+ }
54
+ }, [
55
+ editor,
56
+ isSelected,
57
+ nodeKey
58
+ ]);
59
+ return null;
60
+ }
61
+
62
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/field/features/horizontalrule/component/index.tsx"],"sourcesContent":["'use client'\n\nimport type { NodeKey } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection.js'\nimport { mergeRegister } from '@lexical/utils'\nimport {\n $getNodeByKey,\n $getSelection,\n $isNodeSelection,\n CLICK_COMMAND,\n COMMAND_PRIORITY_LOW,\n KEY_BACKSPACE_COMMAND,\n KEY_DELETE_COMMAND,\n} from 'lexical'\nimport { useCallback, useEffect } from 'react'\n\nimport { $isHorizontalRuleNode } from '../nodes/HorizontalRuleNode.js'\n\n/**\n * React component rendered in the lexical editor, WITHIN the hr element created by createDOM of the HorizontalRuleNode.\n *\n * @param nodeKey every node has a unique key (this key is not saved to the database and thus may differ between sessions). It's useful for working with the CURRENT lexical editor state\n */\nexport function HorizontalRuleComponent({ nodeKey }: { nodeKey: NodeKey }) {\n const [editor] = useLexicalComposerContext()\n const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey)\n\n const onDelete = useCallback(\n (event: KeyboardEvent) => {\n if (isSelected && $isNodeSelection($getSelection())) {\n event.preventDefault()\n const node = $getNodeByKey(nodeKey)\n if ($isHorizontalRuleNode(node)) {\n node.remove()\n return true\n }\n }\n return false\n },\n [isSelected, nodeKey],\n )\n\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand(\n CLICK_COMMAND,\n (event: MouseEvent) => {\n const hrElem = editor.getElementByKey(nodeKey)\n\n if (event.target === hrElem) {\n if (!event.shiftKey) {\n clearSelection()\n }\n setSelected(!isSelected)\n return true\n }\n\n return false\n },\n COMMAND_PRIORITY_LOW,\n ),\n editor.registerCommand(KEY_DELETE_COMMAND, onDelete, COMMAND_PRIORITY_LOW),\n editor.registerCommand(KEY_BACKSPACE_COMMAND, onDelete, COMMAND_PRIORITY_LOW),\n )\n }, [clearSelection, editor, isSelected, nodeKey, onDelete, setSelected])\n\n useEffect(() => {\n const hrElem = editor.getElementByKey(nodeKey)\n if (hrElem !== null) {\n hrElem.className = isSelected ? 'selected' : ''\n }\n }, [editor, isSelected, nodeKey])\n\n return null\n}\n"],"names":["useLexicalComposerContext","useLexicalNodeSelection","mergeRegister","$getNodeByKey","$getSelection","$isNodeSelection","CLICK_COMMAND","COMMAND_PRIORITY_LOW","KEY_BACKSPACE_COMMAND","KEY_DELETE_COMMAND","useCallback","useEffect","$isHorizontalRuleNode","HorizontalRuleComponent","nodeKey","editor","isSelected","setSelected","clearSelection","onDelete","event","preventDefault","node","remove","registerCommand","hrElem","getElementByKey","target","shiftKey","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,SAASC,uBAAuB,QAAQ,4CAA2C;AACnF,SAASC,aAAa,QAAQ,iBAAgB;AAC9C,SACEC,aAAa,EACbC,aAAa,EACbC,gBAAgB,EAChBC,aAAa,EACbC,oBAAoB,EACpBC,qBAAqB,EACrBC,kBAAkB,QACb,UAAS;AAChB,SAASC,WAAW,EAAEC,SAAS,QAAQ,QAAO;AAE9C,SAASC,qBAAqB,QAAQ,iCAAgC;AAEtE;;;;CAIC,GACD,OAAO,SAASC,wBAAwB,EAAEC,OAAO,EAAwB;IACvE,MAAM,CAACC,OAAO,GAAGf;IACjB,MAAM,CAACgB,YAAYC,aAAaC,eAAe,GAAGjB,wBAAwBa;IAE1E,MAAMK,WAAWT,YACf,CAACU;QACC,IAAIJ,cAAcX,iBAAiBD,kBAAkB;YACnDgB,MAAMC,cAAc;YACpB,MAAMC,OAAOnB,cAAcW;YAC3B,IAAIF,sBAAsBU,OAAO;gBAC/BA,KAAKC,MAAM;gBACX,OAAO;YACT;QACF;QACA,OAAO;IACT,GACA;QAACP;QAAYF;KAAQ;IAGvBH,UAAU;QACR,OAAOT,cACLa,OAAOS,eAAe,CACpBlB,eACA,CAACc;YACC,MAAMK,SAASV,OAAOW,eAAe,CAACZ;YAEtC,IAAIM,MAAMO,MAAM,KAAKF,QAAQ;gBAC3B,IAAI,CAACL,MAAMQ,QAAQ,EAAE;oBACnBV;gBACF;gBACAD,YAAY,CAACD;gBACb,OAAO;YACT;YAEA,OAAO;QACT,GACAT,uBAEFQ,OAAOS,eAAe,CAACf,oBAAoBU,UAAUZ,uBACrDQ,OAAOS,eAAe,CAAChB,uBAAuBW,UAAUZ;IAE5D,GAAG;QAACW;QAAgBH;QAAQC;QAAYF;QAASK;QAAUF;KAAY;IAEvEN,UAAU;QACR,MAAMc,SAASV,OAAOW,eAAe,CAACZ;QACtC,IAAIW,WAAW,MAAM;YACnBA,OAAOI,SAAS,GAAGb,aAAa,aAAa;QAC/C;IACF,GAAG;QAACD;QAAQC;QAAYF;KAAQ;IAEhC,OAAO;AACT"}
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" resolution-mode="require"/>
2
+ export declare const HorizontalRuleFeatureClientComponent: import("react").FC<undefined>;
3
+ //# sourceMappingURL=feature.client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/field/features/horizontalrule/feature.client.tsx"],"names":[],"mappings":";AA8CA,eAAO,MAAM,oCAAoC,+BAEhD,CAAA"}
@@ -0,0 +1,53 @@
1
+ 'use client';
2
+ import { SlashMenuOption } from '../../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js';
3
+ import { HorizontalRuleIcon } from '../../lexical/ui/icons/HorizontalRule/index.js';
4
+ import { createClientComponent } from '../createClientComponent.js';
5
+ import { MarkdownTransformer } from './markdownTransformer.js';
6
+ import { HorizontalRuleNode, INSERT_HORIZONTAL_RULE_COMMAND } from './nodes/HorizontalRuleNode.js';
7
+ import { HorizontalRulePlugin } from './plugin/index.js';
8
+ const HorizontalRuleFeatureClient = (props)=>{
9
+ return {
10
+ clientFeatureProps: props,
11
+ feature: ()=>({
12
+ clientFeatureProps: props,
13
+ markdownTransformers: [
14
+ MarkdownTransformer
15
+ ],
16
+ nodes: [
17
+ HorizontalRuleNode
18
+ ],
19
+ plugins: [
20
+ {
21
+ Component: HorizontalRulePlugin,
22
+ position: 'normal'
23
+ }
24
+ ],
25
+ slashMenu: {
26
+ options: [
27
+ {
28
+ displayName: 'Basic',
29
+ key: 'basic',
30
+ options: [
31
+ new SlashMenuOption(`horizontalrule`, {
32
+ Icon: HorizontalRuleIcon,
33
+ displayName: `Horizontal Rule`,
34
+ keywords: [
35
+ 'hr',
36
+ 'horizontal rule',
37
+ 'line',
38
+ 'separator'
39
+ ],
40
+ onSelect: ({ editor })=>{
41
+ editor.dispatchCommand(INSERT_HORIZONTAL_RULE_COMMAND, undefined);
42
+ }
43
+ })
44
+ ]
45
+ }
46
+ ]
47
+ }
48
+ })
49
+ };
50
+ };
51
+ export const HorizontalRuleFeatureClientComponent = createClientComponent(HorizontalRuleFeatureClient);
52
+
53
+ //# sourceMappingURL=feature.client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/field/features/horizontalrule/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport type { FeatureProviderProviderClient } from '../types.js'\n\nimport { SlashMenuOption } from '../../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js'\nimport { HorizontalRuleIcon } from '../../lexical/ui/icons/HorizontalRule/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { MarkdownTransformer } from './markdownTransformer.js'\nimport { HorizontalRuleNode, INSERT_HORIZONTAL_RULE_COMMAND } from './nodes/HorizontalRuleNode.js'\nimport { HorizontalRulePlugin } from './plugin/index.js'\n\nconst HorizontalRuleFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n markdownTransformers: [MarkdownTransformer],\n nodes: [HorizontalRuleNode],\n plugins: [\n {\n Component: HorizontalRulePlugin,\n position: 'normal',\n },\n ],\n slashMenu: {\n options: [\n {\n displayName: 'Basic',\n key: 'basic',\n options: [\n new SlashMenuOption(`horizontalrule`, {\n Icon: HorizontalRuleIcon,\n displayName: `Horizontal Rule`,\n keywords: ['hr', 'horizontal rule', 'line', 'separator'],\n onSelect: ({ editor }) => {\n editor.dispatchCommand(INSERT_HORIZONTAL_RULE_COMMAND, undefined)\n },\n }),\n ],\n },\n ],\n },\n }),\n }\n}\n\nexport const HorizontalRuleFeatureClientComponent = createClientComponent(\n HorizontalRuleFeatureClient,\n)\n"],"names":["SlashMenuOption","HorizontalRuleIcon","createClientComponent","MarkdownTransformer","HorizontalRuleNode","INSERT_HORIZONTAL_RULE_COMMAND","HorizontalRulePlugin","HorizontalRuleFeatureClient","props","clientFeatureProps","feature","markdownTransformers","nodes","plugins","Component","position","slashMenu","options","displayName","key","Icon","keywords","onSelect","editor","dispatchCommand","undefined","HorizontalRuleFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,SAASA,eAAe,QAAQ,sEAAqE;AACrG,SAASC,kBAAkB,QAAQ,iDAAgD;AACnF,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,mBAAmB,QAAQ,2BAA0B;AAC9D,SAASC,kBAAkB,EAAEC,8BAA8B,QAAQ,gCAA+B;AAClG,SAASC,oBAAoB,QAAQ,oBAAmB;AAExD,MAAMC,8BAAwE,CAACC;IAC7E,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,sBAAsB;oBAACR;iBAAoB;gBAC3CS,OAAO;oBAACR;iBAAmB;gBAC3BS,SAAS;oBACP;wBACEC,WAAWR;wBACXS,UAAU;oBACZ;iBACD;gBACDC,WAAW;oBACTC,SAAS;wBACP;4BACEC,aAAa;4BACbC,KAAK;4BACLF,SAAS;gCACP,IAAIjB,gBAAgB,CAAC,cAAc,CAAC,EAAE;oCACpCoB,MAAMnB;oCACNiB,aAAa,CAAC,eAAe,CAAC;oCAC9BG,UAAU;wCAAC;wCAAM;wCAAmB;wCAAQ;qCAAY;oCACxDC,UAAU,CAAC,EAAEC,MAAM,EAAE;wCACnBA,OAAOC,eAAe,CAACnB,gCAAgCoB;oCACzD;gCACF;6BACD;wBACH;qBACD;gBACH;YACF,CAAA;IACF;AACF;AAEA,OAAO,MAAMC,uCAAuCxB,sBAClDK,6BACD"}
@@ -0,0 +1,3 @@
1
+ import type { FeatureProviderProviderServer } from '../types.js';
2
+ export declare const HorizontalRuleFeature: FeatureProviderProviderServer<undefined, undefined>;
3
+ //# sourceMappingURL=feature.server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../../src/field/features/horizontalrule/feature.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAA;AAOhE,eAAO,MAAM,qBAAqB,EAAE,6BAA6B,CAAC,SAAS,EAAE,SAAS,CA4BrF,CAAA"}
@@ -0,0 +1,37 @@
1
+ import { createNode } from '../typeUtilities.js';
2
+ import { HorizontalRuleFeatureClientComponent } from './feature.client.js';
3
+ import { MarkdownTransformer } from './markdownTransformer.js';
4
+ import { HorizontalRuleNode } from './nodes/HorizontalRuleNode.js';
5
+ export const HorizontalRuleFeature = (props)=>{
6
+ return {
7
+ feature: ()=>{
8
+ return {
9
+ ClientComponent: HorizontalRuleFeatureClientComponent,
10
+ clientFeatureProps: null,
11
+ markdownTransformers: [
12
+ MarkdownTransformer
13
+ ],
14
+ nodes: [
15
+ createNode({
16
+ converters: {
17
+ html: {
18
+ converter: ()=>{
19
+ return `<hr/>`;
20
+ },
21
+ nodeTypes: [
22
+ HorizontalRuleNode.getType()
23
+ ]
24
+ }
25
+ },
26
+ node: HorizontalRuleNode
27
+ })
28
+ ],
29
+ serverFeatureProps: props
30
+ };
31
+ },
32
+ key: 'horizontalrule',
33
+ serverFeatureProps: props
34
+ };
35
+ };
36
+
37
+ //# sourceMappingURL=feature.server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/field/features/horizontalrule/feature.server.ts"],"sourcesContent":["import type { FeatureProviderProviderServer } from '../types.js'\n\nimport { createNode } from '../typeUtilities.js'\nimport { HorizontalRuleFeatureClientComponent } from './feature.client.js'\nimport { MarkdownTransformer } from './markdownTransformer.js'\nimport { HorizontalRuleNode } from './nodes/HorizontalRuleNode.js'\n\nexport const HorizontalRuleFeature: FeatureProviderProviderServer<undefined, undefined> = (\n props,\n) => {\n return {\n feature: () => {\n return {\n ClientComponent: HorizontalRuleFeatureClientComponent,\n clientFeatureProps: null,\n markdownTransformers: [MarkdownTransformer],\n nodes: [\n createNode({\n converters: {\n html: {\n converter: () => {\n return `<hr/>`\n },\n nodeTypes: [HorizontalRuleNode.getType()],\n },\n },\n node: HorizontalRuleNode,\n }),\n ],\n serverFeatureProps: props,\n }\n },\n key: 'horizontalrule',\n serverFeatureProps: props,\n }\n}\n"],"names":["createNode","HorizontalRuleFeatureClientComponent","MarkdownTransformer","HorizontalRuleNode","HorizontalRuleFeature","props","feature","ClientComponent","clientFeatureProps","markdownTransformers","nodes","converters","html","converter","nodeTypes","getType","node","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,SAASA,UAAU,QAAQ,sBAAqB;AAChD,SAASC,oCAAoC,QAAQ,sBAAqB;AAC1E,SAASC,mBAAmB,QAAQ,2BAA0B;AAC9D,SAASC,kBAAkB,QAAQ,gCAA+B;AAElE,OAAO,MAAMC,wBAA6E,CACxFC;IAEA,OAAO;QACLC,SAAS;YACP,OAAO;gBACLC,iBAAiBN;gBACjBO,oBAAoB;gBACpBC,sBAAsB;oBAACP;iBAAoB;gBAC3CQ,OAAO;oBACLV,WAAW;wBACTW,YAAY;4BACVC,MAAM;gCACJC,WAAW;oCACT,OAAO,CAAC,KAAK,CAAC;gCAChB;gCACAC,WAAW;oCAACX,mBAAmBY,OAAO;iCAAG;4BAC3C;wBACF;wBACAC,MAAMb;oBACR;iBACD;gBACDc,oBAAoBZ;YACtB;QACF;QACAa,KAAK;QACLD,oBAAoBZ;IACtB;AACF,EAAC"}
@@ -0,0 +1,3 @@
1
+ import type { ElementTransformer } from '@lexical/markdown';
2
+ export declare const MarkdownTransformer: ElementTransformer;
3
+ //# sourceMappingURL=markdownTransformer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdownTransformer.d.ts","sourceRoot":"","sources":["../../../../src/field/features/horizontalrule/markdownTransformer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAQ3D,eAAO,MAAM,mBAAmB,EAAE,kBAiBjC,CAAA"}
@@ -0,0 +1,23 @@
1
+ import { $createHorizontalRuleNode, $isHorizontalRuleNode, HorizontalRuleNode } from './nodes/HorizontalRuleNode.js';
2
+ export const MarkdownTransformer = {
3
+ type: 'element',
4
+ dependencies: [
5
+ HorizontalRuleNode
6
+ ],
7
+ export: (node, exportChildren)=>{
8
+ if (!$isHorizontalRuleNode(node)) {
9
+ return null;
10
+ }
11
+ return '---';
12
+ },
13
+ // match ---
14
+ regExp: /^---\s*$/,
15
+ replace: (parentNode)=>{
16
+ const node = $createHorizontalRuleNode();
17
+ if (node) {
18
+ parentNode.replace(node);
19
+ }
20
+ }
21
+ };
22
+
23
+ //# sourceMappingURL=markdownTransformer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/field/features/horizontalrule/markdownTransformer.ts"],"sourcesContent":["import type { ElementTransformer } from '@lexical/markdown'\n\nimport {\n $createHorizontalRuleNode,\n $isHorizontalRuleNode,\n HorizontalRuleNode,\n} from './nodes/HorizontalRuleNode.js'\n\nexport const MarkdownTransformer: ElementTransformer = {\n type: 'element',\n dependencies: [HorizontalRuleNode],\n export: (node, exportChildren) => {\n if (!$isHorizontalRuleNode(node)) {\n return null\n }\n return '---'\n },\n // match ---\n regExp: /^---\\s*$/,\n replace: (parentNode) => {\n const node = $createHorizontalRuleNode()\n if (node) {\n parentNode.replace(node)\n }\n },\n}\n"],"names":["$createHorizontalRuleNode","$isHorizontalRuleNode","HorizontalRuleNode","MarkdownTransformer","type","dependencies","export","node","exportChildren","regExp","replace","parentNode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,SACEA,yBAAyB,EACzBC,qBAAqB,EACrBC,kBAAkB,QACb,gCAA+B;AAEtC,OAAO,MAAMC,sBAA0C;IACrDC,MAAM;IACNC,cAAc;QAACH;KAAmB;IAClCI,QAAQ,CAACC,MAAMC;QACb,IAAI,CAACP,sBAAsBM,OAAO;YAChC,OAAO;QACT;QACA,OAAO;IACT;IACA,YAAY;IACZE,QAAQ;IACRC,SAAS,CAACC;QACR,MAAMJ,OAAOP;QACb,IAAIO,MAAM;YACRI,WAAWD,OAAO,CAACH;QACrB;IACF;AACF,EAAC"}
@@ -0,0 +1,53 @@
1
+ import type { DOMConversionMap, DOMExportOutput, LexicalCommand, LexicalNode, SerializedLexicalNode } from 'lexical';
2
+ import { DecoratorNode } from 'lexical';
3
+ import * as React from 'react';
4
+ /**
5
+ * Serialized representation of a horizontal rule node. Serialized = converted to JSON. This is what is stored in the database / in the lexical editor state.
6
+ */
7
+ export type SerializedHorizontalRuleNode = SerializedLexicalNode;
8
+ export declare const INSERT_HORIZONTAL_RULE_COMMAND: LexicalCommand<void>;
9
+ /**
10
+ * This node is a DecoratorNode. DecoratorNodes allow you to render React components in the editor.
11
+ *
12
+ * They need both createDom and decorate functions. createDom => outside of the html. decorate => React Component inside of the html.
13
+ *
14
+ * If we used DecoratorBlockNode instead, we would only need a decorate method
15
+ */
16
+ export declare class HorizontalRuleNode extends DecoratorNode<React.ReactElement> {
17
+ static clone(node: HorizontalRuleNode): HorizontalRuleNode;
18
+ static getType(): string;
19
+ /**
20
+ * Defines what happens if you copy an hr element from another page and paste it into the lexical editor
21
+ *
22
+ * This also determines the behavior of lexical's internal HTML -> Lexical converter
23
+ */
24
+ static importDOM(): DOMConversionMap | null;
25
+ /**
26
+ * The data for this node is stored serialized as JSON. This is the "load function" of that node: it takes the saved data and converts it into a node.
27
+ */
28
+ static importJSON(serializedNode: SerializedHorizontalRuleNode): HorizontalRuleNode;
29
+ /**
30
+ * Determines how the hr element is rendered in the lexical editor. This is only the "initial" / "outer" HTML element.
31
+ */
32
+ createDOM(): HTMLElement;
33
+ /**
34
+ * Allows you to render a React component within whatever createDOM returns.
35
+ */
36
+ decorate(): React.ReactElement;
37
+ /**
38
+ * Opposite of importDOM, this function defines what happens when you copy an hr element from the lexical editor and paste it into another page.
39
+ *
40
+ * This also determines the behavior of lexical's internal Lexical -> HTML converter
41
+ */
42
+ exportDOM(): DOMExportOutput;
43
+ /**
44
+ * Opposite of importJSON. This determines what data is saved in the database / in the lexical editor state.
45
+ */
46
+ exportJSON(): SerializedLexicalNode;
47
+ getTextContent(): string;
48
+ isInline(): false;
49
+ updateDOM(): boolean;
50
+ }
51
+ export declare function $createHorizontalRuleNode(): HorizontalRuleNode;
52
+ export declare function $isHorizontalRuleNode(node: LexicalNode | null | undefined): node is HorizontalRuleNode;
53
+ //# sourceMappingURL=HorizontalRuleNode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HorizontalRuleNode.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/horizontalrule/nodes/HorizontalRuleNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAEhB,eAAe,EACf,cAAc,EACd,WAAW,EACX,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAEhB,OAAO,EAAyB,aAAa,EAAiB,MAAM,SAAS,CAAA;AAC7E,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAQ9B;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG,qBAAqB,CAAA;AAEhE,eAAO,MAAM,8BAA8B,EAAE,cAAc,CAAC,IAAI,CAE/D,CAAA;AAED;;;;;;GAMG;AACH,qBAAa,kBAAmB,SAAQ,aAAa,CAAC,KAAK,CAAC,YAAY,CAAC;IACvE,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,kBAAkB,GAAG,kBAAkB;IAI1D,MAAM,CAAC,OAAO,IAAI,MAAM;IAIxB;;;;OAIG;IACH,MAAM,CAAC,SAAS,IAAI,gBAAgB,GAAG,IAAI;IAS3C;;OAEG;IACH,MAAM,CAAC,UAAU,CAAC,cAAc,EAAE,4BAA4B,GAAG,kBAAkB;IAInF;;OAEG;IACH,SAAS,IAAI,WAAW;IAIxB;;OAEG;IACH,QAAQ,IAAI,KAAK,CAAC,YAAY;IAI9B;;;;OAIG;IACH,SAAS,IAAI,eAAe;IAG5B;;OAEG;IACH,UAAU,IAAI,qBAAqB;IAOnC,cAAc,IAAI,MAAM;IAIxB,QAAQ,IAAI,KAAK;IAIjB,SAAS,IAAI,OAAO;CAGrB;AAMD,wBAAgB,yBAAyB,IAAI,kBAAkB,CAE9D;AAED,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GACnC,IAAI,IAAI,kBAAkB,CAE5B"}
@@ -0,0 +1,88 @@
1
+ import { $applyNodeReplacement, DecoratorNode, createCommand } from 'lexical';
2
+ import * as React from 'react';
3
+ const HorizontalRuleComponent = /*#__PURE__*/ React.lazy(()=>import('../component/index.js').then((module)=>({
4
+ default: module.HorizontalRuleComponent
5
+ })));
6
+ export const INSERT_HORIZONTAL_RULE_COMMAND = createCommand('INSERT_HORIZONTAL_RULE_COMMAND');
7
+ /**
8
+ * This node is a DecoratorNode. DecoratorNodes allow you to render React components in the editor.
9
+ *
10
+ * They need both createDom and decorate functions. createDom => outside of the html. decorate => React Component inside of the html.
11
+ *
12
+ * If we used DecoratorBlockNode instead, we would only need a decorate method
13
+ */ export class HorizontalRuleNode extends DecoratorNode {
14
+ static clone(node) {
15
+ return new HorizontalRuleNode(node.__key);
16
+ }
17
+ static getType() {
18
+ return 'horizontalrule';
19
+ }
20
+ /**
21
+ * Defines what happens if you copy an hr element from another page and paste it into the lexical editor
22
+ *
23
+ * This also determines the behavior of lexical's internal HTML -> Lexical converter
24
+ */ static importDOM() {
25
+ return {
26
+ hr: ()=>({
27
+ conversion: convertHorizontalRuleElement,
28
+ priority: 0
29
+ })
30
+ };
31
+ }
32
+ /**
33
+ * The data for this node is stored serialized as JSON. This is the "load function" of that node: it takes the saved data and converts it into a node.
34
+ */ static importJSON(serializedNode) {
35
+ return $createHorizontalRuleNode();
36
+ }
37
+ /**
38
+ * Determines how the hr element is rendered in the lexical editor. This is only the "initial" / "outer" HTML element.
39
+ */ createDOM() {
40
+ return document.createElement('hr');
41
+ }
42
+ /**
43
+ * Allows you to render a React component within whatever createDOM returns.
44
+ */ decorate() {
45
+ return /*#__PURE__*/ React.createElement(HorizontalRuleComponent, {
46
+ nodeKey: this.__key
47
+ });
48
+ }
49
+ /**
50
+ * Opposite of importDOM, this function defines what happens when you copy an hr element from the lexical editor and paste it into another page.
51
+ *
52
+ * This also determines the behavior of lexical's internal Lexical -> HTML converter
53
+ */ exportDOM() {
54
+ return {
55
+ element: document.createElement('hr')
56
+ };
57
+ }
58
+ /**
59
+ * Opposite of importJSON. This determines what data is saved in the database / in the lexical editor state.
60
+ */ exportJSON() {
61
+ return {
62
+ type: 'horizontalrule',
63
+ version: 1
64
+ };
65
+ }
66
+ getTextContent() {
67
+ return '\n';
68
+ }
69
+ isInline() {
70
+ return false;
71
+ }
72
+ updateDOM() {
73
+ return false;
74
+ }
75
+ }
76
+ function convertHorizontalRuleElement() {
77
+ return {
78
+ node: $createHorizontalRuleNode()
79
+ };
80
+ }
81
+ export function $createHorizontalRuleNode() {
82
+ return $applyNodeReplacement(new HorizontalRuleNode());
83
+ }
84
+ export function $isHorizontalRuleNode(node) {
85
+ return node instanceof HorizontalRuleNode;
86
+ }
87
+
88
+ //# sourceMappingURL=HorizontalRuleNode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/field/features/horizontalrule/nodes/HorizontalRuleNode.tsx"],"sourcesContent":["import type {\n DOMConversionMap,\n DOMConversionOutput,\n DOMExportOutput,\n LexicalCommand,\n LexicalNode,\n SerializedLexicalNode,\n} from 'lexical'\n\nimport { $applyNodeReplacement, DecoratorNode, createCommand } from 'lexical'\nimport * as React from 'react'\n\nconst HorizontalRuleComponent = React.lazy(() =>\n import('../component/index.js').then((module) => ({\n default: module.HorizontalRuleComponent,\n })),\n)\n\n/**\n * Serialized representation of a horizontal rule node. Serialized = converted to JSON. This is what is stored in the database / in the lexical editor state.\n */\nexport type SerializedHorizontalRuleNode = SerializedLexicalNode\n\nexport const INSERT_HORIZONTAL_RULE_COMMAND: LexicalCommand<void> = createCommand(\n 'INSERT_HORIZONTAL_RULE_COMMAND',\n)\n\n/**\n * This node is a DecoratorNode. DecoratorNodes allow you to render React components in the editor.\n *\n * They need both createDom and decorate functions. createDom => outside of the html. decorate => React Component inside of the html.\n *\n * If we used DecoratorBlockNode instead, we would only need a decorate method\n */\nexport class HorizontalRuleNode extends DecoratorNode<React.ReactElement> {\n static clone(node: HorizontalRuleNode): HorizontalRuleNode {\n return new HorizontalRuleNode(node.__key)\n }\n\n static getType(): string {\n return 'horizontalrule'\n }\n\n /**\n * Defines what happens if you copy an hr element from another page and paste it into the lexical editor\n *\n * This also determines the behavior of lexical's internal HTML -> Lexical converter\n */\n static importDOM(): DOMConversionMap | null {\n return {\n hr: () => ({\n conversion: convertHorizontalRuleElement,\n priority: 0,\n }),\n }\n }\n\n /**\n * The data for this node is stored serialized as JSON. This is the \"load function\" of that node: it takes the saved data and converts it into a node.\n */\n static importJSON(serializedNode: SerializedHorizontalRuleNode): HorizontalRuleNode {\n return $createHorizontalRuleNode()\n }\n\n /**\n * Determines how the hr element is rendered in the lexical editor. This is only the \"initial\" / \"outer\" HTML element.\n */\n createDOM(): HTMLElement {\n return document.createElement('hr')\n }\n\n /**\n * Allows you to render a React component within whatever createDOM returns.\n */\n decorate(): React.ReactElement {\n return <HorizontalRuleComponent nodeKey={this.__key} />\n }\n\n /**\n * Opposite of importDOM, this function defines what happens when you copy an hr element from the lexical editor and paste it into another page.\n *\n * This also determines the behavior of lexical's internal Lexical -> HTML converter\n */\n exportDOM(): DOMExportOutput {\n return { element: document.createElement('hr') }\n }\n /**\n * Opposite of importJSON. This determines what data is saved in the database / in the lexical editor state.\n */\n exportJSON(): SerializedLexicalNode {\n return {\n type: 'horizontalrule',\n version: 1,\n }\n }\n\n getTextContent(): string {\n return '\\n'\n }\n\n isInline(): false {\n return false\n }\n\n updateDOM(): boolean {\n return false\n }\n}\n\nfunction convertHorizontalRuleElement(): DOMConversionOutput {\n return { node: $createHorizontalRuleNode() }\n}\n\nexport function $createHorizontalRuleNode(): HorizontalRuleNode {\n return $applyNodeReplacement(new HorizontalRuleNode())\n}\n\nexport function $isHorizontalRuleNode(\n node: LexicalNode | null | undefined,\n): node is HorizontalRuleNode {\n return node instanceof HorizontalRuleNode\n}\n"],"names":["$applyNodeReplacement","DecoratorNode","createCommand","React","HorizontalRuleComponent","lazy","then","module","default","INSERT_HORIZONTAL_RULE_COMMAND","HorizontalRuleNode","clone","node","__key","getType","importDOM","hr","conversion","convertHorizontalRuleElement","priority","importJSON","serializedNode","$createHorizontalRuleNode","createDOM","document","createElement","decorate","nodeKey","exportDOM","element","exportJSON","type","version","getTextContent","isInline","updateDOM","$isHorizontalRuleNode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AASA,SAASA,qBAAqB,EAAEC,aAAa,EAAEC,aAAa,QAAQ,UAAS;AAC7E,YAAYC,WAAW,QAAO;AAE9B,MAAMC,wCAA0BD,MAAME,IAAI,CAAC,IACzC,MAAM,CAAC,yBAAyBC,IAAI,CAAC,CAACC,SAAY,CAAA;YAChDC,SAASD,OAAOH,uBAAuB;QACzC,CAAA;AAQF,OAAO,MAAMK,iCAAuDP,cAClE,kCACD;AAED;;;;;;CAMC,GACD,OAAO,MAAMQ,2BAA2BT;IACtC,OAAOU,MAAMC,IAAwB,EAAsB;QACzD,OAAO,IAAIF,mBAAmBE,KAAKC,KAAK;IAC1C;IAEA,OAAOC,UAAkB;QACvB,OAAO;IACT;IAEA;;;;GAIC,GACD,OAAOC,YAAqC;QAC1C,OAAO;YACLC,IAAI,IAAO,CAAA;oBACTC,YAAYC;oBACZC,UAAU;gBACZ,CAAA;QACF;IACF;IAEA;;GAEC,GACD,OAAOC,WAAWC,cAA4C,EAAsB;QAClF,OAAOC;IACT;IAEA;;GAEC,GACDC,YAAyB;QACvB,OAAOC,SAASC,aAAa,CAAC;IAChC;IAEA;;GAEC,GACDC,WAA+B;QAC7B,qBAAO,oBAACtB;YAAwBuB,SAAS,IAAI,CAACd,KAAK;;IACrD;IAEA;;;;GAIC,GACDe,YAA6B;QAC3B,OAAO;YAAEC,SAASL,SAASC,aAAa,CAAC;QAAM;IACjD;IACA;;GAEC,GACDK,aAAoC;QAClC,OAAO;YACLC,MAAM;YACNC,SAAS;QACX;IACF;IAEAC,iBAAyB;QACvB,OAAO;IACT;IAEAC,WAAkB;QAChB,OAAO;IACT;IAEAC,YAAqB;QACnB,OAAO;IACT;AACF;AAEA,SAASjB;IACP,OAAO;QAAEN,MAAMU;IAA4B;AAC7C;AAEA,OAAO,SAASA;IACd,OAAOtB,sBAAsB,IAAIU;AACnC;AAEA,OAAO,SAAS0B,sBACdxB,IAAoC;IAEpC,OAAOA,gBAAgBF;AACzB"}
@@ -0,0 +1,6 @@
1
+ import './index.scss';
2
+ /**
3
+ * Registers the INSERT_HORIZONTAL_RULE_COMMAND lexical command and defines the behavior for when it is called.
4
+ */
5
+ export declare function HorizontalRulePlugin(): null;
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/horizontalrule/plugin/index.tsx"],"names":[],"mappings":"AAWA,OAAO,cAAc,CAAA;AAErB;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CA2B3C"}
@@ -0,0 +1,31 @@
1
+ 'use client';
2
+ import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js';
3
+ import { $insertNodeToNearestRoot } from '@lexical/utils';
4
+ import { $getSelection, $isRangeSelection, COMMAND_PRIORITY_EDITOR } from 'lexical';
5
+ import { useEffect } from 'react';
6
+ import { $createHorizontalRuleNode, INSERT_HORIZONTAL_RULE_COMMAND } from '../nodes/HorizontalRuleNode.js';
7
+ import './index.scss';
8
+ /**
9
+ * Registers the INSERT_HORIZONTAL_RULE_COMMAND lexical command and defines the behavior for when it is called.
10
+ */ export function HorizontalRulePlugin() {
11
+ const [editor] = useLexicalComposerContext();
12
+ useEffect(()=>{
13
+ return editor.registerCommand(INSERT_HORIZONTAL_RULE_COMMAND, (type)=>{
14
+ const selection = $getSelection();
15
+ if (!$isRangeSelection(selection)) {
16
+ return false;
17
+ }
18
+ const focusNode = selection.focus.getNode();
19
+ if (focusNode !== null) {
20
+ const horizontalRuleNode = $createHorizontalRuleNode();
21
+ $insertNodeToNearestRoot(horizontalRuleNode);
22
+ }
23
+ return true;
24
+ }, COMMAND_PRIORITY_EDITOR);
25
+ }, [
26
+ editor
27
+ ]);
28
+ return null;
29
+ }
30
+
31
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/field/features/horizontalrule/plugin/index.tsx"],"sourcesContent":["'use client'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { $insertNodeToNearestRoot } from '@lexical/utils'\nimport { $getSelection, $isRangeSelection, COMMAND_PRIORITY_EDITOR } from 'lexical'\nimport { useEffect } from 'react'\n\nimport {\n $createHorizontalRuleNode,\n INSERT_HORIZONTAL_RULE_COMMAND,\n} from '../nodes/HorizontalRuleNode.js'\nimport './index.scss'\n\n/**\n * Registers the INSERT_HORIZONTAL_RULE_COMMAND lexical command and defines the behavior for when it is called.\n */\nexport function HorizontalRulePlugin(): null {\n const [editor] = useLexicalComposerContext()\n\n useEffect(() => {\n return editor.registerCommand(\n INSERT_HORIZONTAL_RULE_COMMAND,\n (type) => {\n const selection = $getSelection()\n\n if (!$isRangeSelection(selection)) {\n return false\n }\n\n const focusNode = selection.focus.getNode()\n\n if (focusNode !== null) {\n const horizontalRuleNode = $createHorizontalRuleNode()\n $insertNodeToNearestRoot(horizontalRuleNode)\n }\n\n return true\n },\n COMMAND_PRIORITY_EDITOR,\n )\n }, [editor])\n\n return null\n}\n"],"names":["useLexicalComposerContext","$insertNodeToNearestRoot","$getSelection","$isRangeSelection","COMMAND_PRIORITY_EDITOR","useEffect","$createHorizontalRuleNode","INSERT_HORIZONTAL_RULE_COMMAND","HorizontalRulePlugin","editor","registerCommand","type","selection","focusNode","focus","getNode","horizontalRuleNode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,SAASC,wBAAwB,QAAQ,iBAAgB;AACzD,SAASC,aAAa,EAAEC,iBAAiB,EAAEC,uBAAuB,QAAQ,UAAS;AACnF,SAASC,SAAS,QAAQ,QAAO;AAEjC,SACEC,yBAAyB,EACzBC,8BAA8B,QACzB,iCAAgC;AACvC,OAAO,eAAc;AAErB;;CAEC,GACD,OAAO,SAASC;IACd,MAAM,CAACC,OAAO,GAAGT;IAEjBK,UAAU;QACR,OAAOI,OAAOC,eAAe,CAC3BH,gCACA,CAACI;YACC,MAAMC,YAAYV;YAElB,IAAI,CAACC,kBAAkBS,YAAY;gBACjC,OAAO;YACT;YAEA,MAAMC,YAAYD,UAAUE,KAAK,CAACC,OAAO;YAEzC,IAAIF,cAAc,MAAM;gBACtB,MAAMG,qBAAqBV;gBAC3BL,yBAAyBe;YAC3B;YAEA,OAAO;QACT,GACAZ;IAEJ,GAAG;QAACK;KAAO;IAEX,OAAO;AACT"}
@@ -0,0 +1,20 @@
1
+ @import '../../../../scss/styles.scss';
2
+
3
+ hr {
4
+ padding: 2px 2px;
5
+ border: none;
6
+ margin: 1rem 0;
7
+ cursor: pointer;
8
+ }
9
+
10
+ hr:after {
11
+ content: '';
12
+ display: block;
13
+ height: 2px;
14
+ background-color: var(--theme-elevation-250);
15
+ }
16
+
17
+ hr.selected {
18
+ outline: 2px solid var(--theme-success-500);
19
+ user-select: none;
20
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/field/features/indent/feature.client.tsx"],"names":[],"mappings":";AAkEA,eAAO,MAAM,4BAA4B,+BAA6C,CAAA"}
1
+ {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/field/features/indent/feature.client.tsx"],"names":[],"mappings":";AAiEA,eAAO,MAAM,4BAA4B,+BAA6C,CAAA"}
@@ -1,6 +1,5 @@
1
1
  'use client';
2
- import lexicalImport from 'lexical';
3
- const { INDENT_CONTENT_COMMAND, OUTDENT_CONTENT_COMMAND } = lexicalImport;
2
+ import { INDENT_CONTENT_COMMAND, OUTDENT_CONTENT_COMMAND } from 'lexical';
4
3
  import { IndentDecreaseIcon } from '../../lexical/ui/icons/IndentDecrease/index.js';
5
4
  import { IndentIncreaseIcon } from '../../lexical/ui/icons/IndentIncrease/index.js';
6
5
  import { createClientComponent } from '../createClientComponent.js';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/field/features/indent/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport lexicalImport from 'lexical'\nconst { INDENT_CONTENT_COMMAND, OUTDENT_CONTENT_COMMAND } = lexicalImport\n\nimport type { FeatureProviderProviderClient } from '../types.js'\n\nimport { IndentDecreaseIcon } from '../../lexical/ui/icons/IndentDecrease/index.js'\nimport { IndentIncreaseIcon } from '../../lexical/ui/icons/IndentIncrease/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { IndentSectionWithEntries } from './floatingSelectToolbarIndentSection.js'\n\nconst IndentFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n floatingSelectToolbar: {\n sections: [\n IndentSectionWithEntries([\n {\n ChildComponent: IndentDecreaseIcon,\n isActive: () => false,\n isEnabled: ({ selection }) => {\n if (!selection || !selection?.getNodes()?.length) {\n return false\n }\n for (const node of selection.getNodes()) {\n // If at least one node is indented, this should be active\n if (\n ('__indent' in node && (node.__indent as number) > 0) ||\n (node.getParent() &&\n '__indent' in node.getParent() &&\n node.getParent().__indent > 0)\n ) {\n return true\n }\n }\n return false\n },\n key: 'indent-decrease',\n label: `Decrease Indent`,\n onClick: ({ editor }) => {\n editor.dispatchCommand(OUTDENT_CONTENT_COMMAND, undefined)\n },\n order: 1,\n },\n ]),\n IndentSectionWithEntries([\n {\n ChildComponent: IndentIncreaseIcon,\n isActive: () => false,\n key: 'indent-increase',\n label: `Increase Indent`,\n onClick: ({ editor }) => {\n editor.dispatchCommand(INDENT_CONTENT_COMMAND, undefined)\n },\n order: 2,\n },\n ]),\n ],\n },\n }),\n }\n}\n\nexport const IndentFeatureClientComponent = createClientComponent(IndentFeatureClient)\n"],"names":["lexicalImport","INDENT_CONTENT_COMMAND","OUTDENT_CONTENT_COMMAND","IndentDecreaseIcon","IndentIncreaseIcon","createClientComponent","IndentSectionWithEntries","IndentFeatureClient","props","clientFeatureProps","feature","floatingSelectToolbar","sections","ChildComponent","isActive","isEnabled","selection","getNodes","length","node","__indent","getParent","key","label","onClick","editor","dispatchCommand","undefined","order","IndentFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,OAAOA,mBAAmB,UAAS;AACnC,MAAM,EAAEC,sBAAsB,EAAEC,uBAAuB,EAAE,GAAGF;AAI5D,SAASG,kBAAkB,QAAQ,iDAAgD;AACnF,SAASC,kBAAkB,QAAQ,iDAAgD;AACnF,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,wBAAwB,QAAQ,0CAAyC;AAElF,MAAMC,sBAAgE,CAACC;IACrE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,uBAAuB;oBACrBC,UAAU;wBACRN,yBAAyB;4BACvB;gCACEO,gBAAgBV;gCAChBW,UAAU,IAAM;gCAChBC,WAAW,CAAC,EAAEC,SAAS,EAAE;oCACvB,IAAI,CAACA,aAAa,CAACA,WAAWC,YAAYC,QAAQ;wCAChD,OAAO;oCACT;oCACA,KAAK,MAAMC,QAAQH,UAAUC,QAAQ,GAAI;wCACvC,0DAA0D;wCAC1D,IACE,AAAC,cAAcE,QAAQ,AAACA,KAAKC,QAAQ,GAAc,KAClDD,KAAKE,SAAS,MACb,cAAcF,KAAKE,SAAS,MAC5BF,KAAKE,SAAS,GAAGD,QAAQ,GAAG,GAC9B;4CACA,OAAO;wCACT;oCACF;oCACA,OAAO;gCACT;gCACAE,KAAK;gCACLC,OAAO,CAAC,eAAe,CAAC;gCACxBC,SAAS,CAAC,EAAEC,MAAM,EAAE;oCAClBA,OAAOC,eAAe,CAACxB,yBAAyByB;gCAClD;gCACAC,OAAO;4BACT;yBACD;wBACDtB,yBAAyB;4BACvB;gCACEO,gBAAgBT;gCAChBU,UAAU,IAAM;gCAChBQ,KAAK;gCACLC,OAAO,CAAC,eAAe,CAAC;gCACxBC,SAAS,CAAC,EAAEC,MAAM,EAAE;oCAClBA,OAAOC,eAAe,CAACzB,wBAAwB0B;gCACjD;gCACAC,OAAO;4BACT;yBACD;qBACF;gBACH;YACF,CAAA;IACF;AACF;AAEA,OAAO,MAAMC,+BAA+BxB,sBAAsBE,qBAAoB"}
1
+ {"version":3,"sources":["../../../../src/field/features/indent/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport { INDENT_CONTENT_COMMAND, OUTDENT_CONTENT_COMMAND } from 'lexical'\n\nimport type { FeatureProviderProviderClient } from '../types.js'\n\nimport { IndentDecreaseIcon } from '../../lexical/ui/icons/IndentDecrease/index.js'\nimport { IndentIncreaseIcon } from '../../lexical/ui/icons/IndentIncrease/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { IndentSectionWithEntries } from './floatingSelectToolbarIndentSection.js'\n\nconst IndentFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n floatingSelectToolbar: {\n sections: [\n IndentSectionWithEntries([\n {\n ChildComponent: IndentDecreaseIcon,\n isActive: () => false,\n isEnabled: ({ selection }) => {\n if (!selection || !selection?.getNodes()?.length) {\n return false\n }\n for (const node of selection.getNodes()) {\n // If at least one node is indented, this should be active\n if (\n ('__indent' in node && (node.__indent as number) > 0) ||\n (node.getParent() &&\n '__indent' in node.getParent() &&\n node.getParent().__indent > 0)\n ) {\n return true\n }\n }\n return false\n },\n key: 'indent-decrease',\n label: `Decrease Indent`,\n onClick: ({ editor }) => {\n editor.dispatchCommand(OUTDENT_CONTENT_COMMAND, undefined)\n },\n order: 1,\n },\n ]),\n IndentSectionWithEntries([\n {\n ChildComponent: IndentIncreaseIcon,\n isActive: () => false,\n key: 'indent-increase',\n label: `Increase Indent`,\n onClick: ({ editor }) => {\n editor.dispatchCommand(INDENT_CONTENT_COMMAND, undefined)\n },\n order: 2,\n },\n ]),\n ],\n },\n }),\n }\n}\n\nexport const IndentFeatureClientComponent = createClientComponent(IndentFeatureClient)\n"],"names":["INDENT_CONTENT_COMMAND","OUTDENT_CONTENT_COMMAND","IndentDecreaseIcon","IndentIncreaseIcon","createClientComponent","IndentSectionWithEntries","IndentFeatureClient","props","clientFeatureProps","feature","floatingSelectToolbar","sections","ChildComponent","isActive","isEnabled","selection","getNodes","length","node","__indent","getParent","key","label","onClick","editor","dispatchCommand","undefined","order","IndentFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,sBAAsB,EAAEC,uBAAuB,QAAQ,UAAS;AAIzE,SAASC,kBAAkB,QAAQ,iDAAgD;AACnF,SAASC,kBAAkB,QAAQ,iDAAgD;AACnF,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,wBAAwB,QAAQ,0CAAyC;AAElF,MAAMC,sBAAgE,CAACC;IACrE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,uBAAuB;oBACrBC,UAAU;wBACRN,yBAAyB;4BACvB;gCACEO,gBAAgBV;gCAChBW,UAAU,IAAM;gCAChBC,WAAW,CAAC,EAAEC,SAAS,EAAE;oCACvB,IAAI,CAACA,aAAa,CAACA,WAAWC,YAAYC,QAAQ;wCAChD,OAAO;oCACT;oCACA,KAAK,MAAMC,QAAQH,UAAUC,QAAQ,GAAI;wCACvC,0DAA0D;wCAC1D,IACE,AAAC,cAAcE,QAAQ,AAACA,KAAKC,QAAQ,GAAc,KAClDD,KAAKE,SAAS,MACb,cAAcF,KAAKE,SAAS,MAC5BF,KAAKE,SAAS,GAAGD,QAAQ,GAAG,GAC9B;4CACA,OAAO;wCACT;oCACF;oCACA,OAAO;gCACT;gCACAE,KAAK;gCACLC,OAAO,CAAC,eAAe,CAAC;gCACxBC,SAAS,CAAC,EAAEC,MAAM,EAAE;oCAClBA,OAAOC,eAAe,CAACxB,yBAAyByB;gCAClD;gCACAC,OAAO;4BACT;yBACD;wBACDtB,yBAAyB;4BACvB;gCACEO,gBAAgBT;gCAChBU,UAAU,IAAM;gCAChBQ,KAAK;gCACLC,OAAO,CAAC,eAAe,CAAC;gCACxBC,SAAS,CAAC,EAAEC,MAAM,EAAE;oCAClBA,OAAOC,eAAe,CAACzB,wBAAwB0B;gCACjD;gCACAC,OAAO;4BACT;yBACD;qBACF;gBACH;YACF,CAAA;IACF;AACF;AAEA,OAAO,MAAMC,+BAA+BxB,sBAAsBE,qBAAoB"}