@payloadcms/richtext-lexical 3.0.0-alpha.64 → 3.0.0-alpha.66

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 (379) 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 +31 -1
  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 +94 -47
  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/debug/testrecorder/plugin/index.d.ts.map +1 -1
  46. package/dist/field/features/debug/testrecorder/plugin/index.js +2 -4
  47. package/dist/field/features/debug/testrecorder/plugin/index.js.map +1 -1
  48. package/dist/field/features/debug/treeview/plugin/index.d.ts.map +1 -1
  49. package/dist/field/features/debug/treeview/plugin/index.js +2 -4
  50. package/dist/field/features/debug/treeview/plugin/index.js.map +1 -1
  51. package/dist/field/features/format/bold/feature.client.d.ts.map +1 -1
  52. package/dist/field/features/format/bold/feature.client.js +1 -2
  53. package/dist/field/features/format/bold/feature.client.js.map +1 -1
  54. package/dist/field/features/format/inlinecode/feature.client.d.ts.map +1 -1
  55. package/dist/field/features/format/inlinecode/feature.client.js +1 -2
  56. package/dist/field/features/format/inlinecode/feature.client.js.map +1 -1
  57. package/dist/field/features/format/italic/feature.client.d.ts.map +1 -1
  58. package/dist/field/features/format/italic/feature.client.js +1 -2
  59. package/dist/field/features/format/italic/feature.client.js.map +1 -1
  60. package/dist/field/features/format/strikethrough/feature.client.d.ts.map +1 -1
  61. package/dist/field/features/format/strikethrough/feature.client.js +1 -2
  62. package/dist/field/features/format/strikethrough/feature.client.js.map +1 -1
  63. package/dist/field/features/format/subscript/feature.client.d.ts.map +1 -1
  64. package/dist/field/features/format/subscript/feature.client.js +1 -2
  65. package/dist/field/features/format/subscript/feature.client.js.map +1 -1
  66. package/dist/field/features/format/superscript/feature.client.d.ts.map +1 -1
  67. package/dist/field/features/format/superscript/feature.client.js +1 -2
  68. package/dist/field/features/format/superscript/feature.client.js.map +1 -1
  69. package/dist/field/features/format/underline/feature.client.d.ts.map +1 -1
  70. package/dist/field/features/format/underline/feature.client.js +1 -2
  71. package/dist/field/features/format/underline/feature.client.js.map +1 -1
  72. package/dist/field/features/heading/feature.client.d.ts.map +1 -1
  73. package/dist/field/features/heading/feature.client.js +3 -6
  74. package/dist/field/features/heading/feature.client.js.map +1 -1
  75. package/dist/field/features/heading/feature.server.d.ts.map +1 -1
  76. package/dist/field/features/heading/feature.server.js +5 -5
  77. package/dist/field/features/heading/feature.server.js.map +1 -1
  78. package/dist/field/features/heading/markdownTransformer.d.ts.map +1 -1
  79. package/dist/field/features/heading/markdownTransformer.js +1 -2
  80. package/dist/field/features/heading/markdownTransformer.js.map +1 -1
  81. package/dist/field/features/horizontalrule/component/index.d.ts.map +1 -1
  82. package/dist/field/features/horizontalrule/component/index.js +2 -4
  83. package/dist/field/features/horizontalrule/component/index.js.map +1 -1
  84. package/dist/field/features/horizontalrule/feature.server.d.ts.map +1 -1
  85. package/dist/field/features/horizontalrule/feature.server.js +3 -2
  86. package/dist/field/features/horizontalrule/feature.server.js.map +1 -1
  87. package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.d.ts +1 -3
  88. package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.d.ts.map +1 -1
  89. package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.js +1 -2
  90. package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.js.map +1 -1
  91. package/dist/field/features/horizontalrule/plugin/index.d.ts.map +1 -1
  92. package/dist/field/features/horizontalrule/plugin/index.js +3 -6
  93. package/dist/field/features/horizontalrule/plugin/index.js.map +1 -1
  94. package/dist/field/features/indent/feature.client.d.ts.map +1 -1
  95. package/dist/field/features/indent/feature.client.js +1 -2
  96. package/dist/field/features/indent/feature.client.js.map +1 -1
  97. package/dist/field/features/link/drawer/baseFields.d.ts +3 -3
  98. package/dist/field/features/link/drawer/baseFields.d.ts.map +1 -1
  99. package/dist/field/features/link/drawer/baseFields.js +28 -42
  100. package/dist/field/features/link/drawer/baseFields.js.map +1 -1
  101. package/dist/field/features/link/drawer/types.d.ts +4 -2
  102. package/dist/field/features/link/drawer/types.d.ts.map +1 -1
  103. package/dist/field/features/link/drawer/types.js.map +1 -1
  104. package/dist/field/features/link/feature.client.d.ts.map +1 -1
  105. package/dist/field/features/link/feature.client.js +2 -4
  106. package/dist/field/features/link/feature.client.js.map +1 -1
  107. package/dist/field/features/link/feature.server.d.ts +0 -2
  108. package/dist/field/features/link/feature.server.d.ts.map +1 -1
  109. package/dist/field/features/link/feature.server.js +35 -10
  110. package/dist/field/features/link/feature.server.js.map +1 -1
  111. package/dist/field/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  112. package/dist/field/features/link/nodes/AutoLinkNode.js +1 -2
  113. package/dist/field/features/link/nodes/AutoLinkNode.js.map +1 -1
  114. package/dist/field/features/link/nodes/LinkNode.d.ts +1 -3
  115. package/dist/field/features/link/nodes/LinkNode.d.ts.map +1 -1
  116. package/dist/field/features/link/nodes/LinkNode.js +2 -4
  117. package/dist/field/features/link/nodes/LinkNode.js.map +1 -1
  118. package/dist/field/features/link/plugins/autoLink/index.d.ts.map +1 -1
  119. package/dist/field/features/link/plugins/autoLink/index.js +3 -6
  120. package/dist/field/features/link/plugins/autoLink/index.js.map +1 -1
  121. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.d.ts.map +1 -1
  122. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.js +1 -2
  123. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.js.map +1 -1
  124. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  125. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js +56 -39
  126. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  127. package/dist/field/features/link/plugins/floatingLinkEditor/index.scss +9 -1
  128. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts +3 -5
  129. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts.map +1 -1
  130. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js +11 -29
  131. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js.map +1 -1
  132. package/dist/field/features/link/plugins/link/index.d.ts.map +1 -1
  133. package/dist/field/features/link/plugins/link/index.js +3 -12
  134. package/dist/field/features/link/plugins/link/index.js.map +1 -1
  135. package/dist/field/features/link/populationPromise.d.ts.map +1 -1
  136. package/dist/field/features/link/populationPromise.js +9 -25
  137. package/dist/field/features/link/populationPromise.js.map +1 -1
  138. package/dist/field/features/link/validate.d.ts +5 -0
  139. package/dist/field/features/link/validate.d.ts.map +1 -0
  140. package/dist/field/features/link/validate.js +32 -0
  141. package/dist/field/features/link/validate.js.map +1 -0
  142. package/dist/field/features/lists/checklist/feature.client.d.ts.map +1 -1
  143. package/dist/field/features/lists/checklist/feature.client.js +1 -2
  144. package/dist/field/features/lists/checklist/feature.client.js.map +1 -1
  145. package/dist/field/features/lists/checklist/feature.server.d.ts.map +1 -1
  146. package/dist/field/features/lists/checklist/feature.server.js +6 -6
  147. package/dist/field/features/lists/checklist/feature.server.js.map +1 -1
  148. package/dist/field/features/lists/checklist/markdownTransformers.d.ts.map +1 -1
  149. package/dist/field/features/lists/checklist/markdownTransformers.js +1 -2
  150. package/dist/field/features/lists/checklist/markdownTransformers.js.map +1 -1
  151. package/dist/field/features/lists/checklist/plugin/index.d.ts.map +1 -1
  152. package/dist/field/features/lists/checklist/plugin/index.js +1 -2
  153. package/dist/field/features/lists/checklist/plugin/index.js.map +1 -1
  154. package/dist/field/features/lists/common/markdown.d.ts.map +1 -1
  155. package/dist/field/features/lists/common/markdown.js +1 -2
  156. package/dist/field/features/lists/common/markdown.js.map +1 -1
  157. package/dist/field/features/lists/htmlConverter.d.ts.map +1 -1
  158. package/dist/field/features/lists/htmlConverter.js +1 -2
  159. package/dist/field/features/lists/htmlConverter.js.map +1 -1
  160. package/dist/field/features/lists/orderedlist/feature.client.d.ts.map +1 -1
  161. package/dist/field/features/lists/orderedlist/feature.client.js +1 -2
  162. package/dist/field/features/lists/orderedlist/feature.client.js.map +1 -1
  163. package/dist/field/features/lists/orderedlist/feature.server.d.ts.map +1 -1
  164. package/dist/field/features/lists/orderedlist/feature.server.js +6 -6
  165. package/dist/field/features/lists/orderedlist/feature.server.js.map +1 -1
  166. package/dist/field/features/lists/orderedlist/markdownTransformer.d.ts.map +1 -1
  167. package/dist/field/features/lists/orderedlist/markdownTransformer.js +1 -2
  168. package/dist/field/features/lists/orderedlist/markdownTransformer.js.map +1 -1
  169. package/dist/field/features/lists/plugin/index.d.ts.map +1 -1
  170. package/dist/field/features/lists/plugin/index.js +1 -2
  171. package/dist/field/features/lists/plugin/index.js.map +1 -1
  172. package/dist/field/features/lists/unorderedlist/feature.client.d.ts.map +1 -1
  173. package/dist/field/features/lists/unorderedlist/feature.client.js +1 -2
  174. package/dist/field/features/lists/unorderedlist/feature.client.js.map +1 -1
  175. package/dist/field/features/lists/unorderedlist/feature.server.d.ts.map +1 -1
  176. package/dist/field/features/lists/unorderedlist/feature.server.js +6 -6
  177. package/dist/field/features/lists/unorderedlist/feature.server.js.map +1 -1
  178. package/dist/field/features/lists/unorderedlist/markdownTransformer.d.ts.map +1 -1
  179. package/dist/field/features/lists/unorderedlist/markdownTransformer.js +1 -2
  180. package/dist/field/features/lists/unorderedlist/markdownTransformer.js.map +1 -1
  181. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.d.ts.map +1 -1
  182. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js +2 -4
  183. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js.map +1 -1
  184. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts +1 -3
  185. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  186. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +2 -4
  187. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  188. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.d.ts.map +1 -1
  189. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.js +2 -4
  190. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.js.map +1 -1
  191. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.d.ts.map +1 -1
  192. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.js +2 -4
  193. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.js.map +1 -1
  194. package/dist/field/features/migrations/slateToLexical/converter/index.d.ts.map +1 -1
  195. package/dist/field/features/migrations/slateToLexical/converter/index.js +2 -1
  196. package/dist/field/features/migrations/slateToLexical/converter/index.js.map +1 -1
  197. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts +1 -3
  198. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  199. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +2 -4
  200. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  201. package/dist/field/features/paragraph/feature.client.d.ts.map +1 -1
  202. package/dist/field/features/paragraph/feature.client.js +2 -4
  203. package/dist/field/features/paragraph/feature.client.js.map +1 -1
  204. package/dist/field/features/relationship/drawer/commands.d.ts.map +1 -1
  205. package/dist/field/features/relationship/drawer/commands.js +1 -2
  206. package/dist/field/features/relationship/drawer/commands.js.map +1 -1
  207. package/dist/field/features/relationship/drawer/index.d.ts.map +1 -1
  208. package/dist/field/features/relationship/drawer/index.js +7 -13
  209. package/dist/field/features/relationship/drawer/index.js.map +1 -1
  210. package/dist/field/features/relationship/feature.server.d.ts.map +1 -1
  211. package/dist/field/features/relationship/feature.server.js +3 -2
  212. package/dist/field/features/relationship/feature.server.js.map +1 -1
  213. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts +3 -8
  214. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts.map +1 -1
  215. package/dist/field/features/relationship/nodes/RelationshipNode.js +8 -8
  216. package/dist/field/features/relationship/nodes/RelationshipNode.js.map +1 -1
  217. package/dist/field/features/relationship/nodes/components/RelationshipComponent.d.ts.map +1 -1
  218. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js +54 -7
  219. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js.map +1 -1
  220. package/dist/field/features/relationship/plugins/index.d.ts.map +1 -1
  221. package/dist/field/features/relationship/plugins/index.js +3 -6
  222. package/dist/field/features/relationship/plugins/index.js.map +1 -1
  223. package/dist/field/features/relationship/populationPromise.js +7 -6
  224. package/dist/field/features/relationship/populationPromise.js.map +1 -1
  225. package/dist/field/features/typeUtilities.d.ts +8 -0
  226. package/dist/field/features/typeUtilities.d.ts.map +1 -0
  227. package/dist/field/features/typeUtilities.js +8 -0
  228. package/dist/field/features/typeUtilities.js.map +1 -0
  229. package/dist/field/features/types.d.ts +56 -28
  230. package/dist/field/features/types.d.ts.map +1 -1
  231. package/dist/field/features/types.js.map +1 -1
  232. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.d.ts.map +1 -1
  233. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js +2 -4
  234. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js.map +1 -1
  235. package/dist/field/features/upload/component/index.d.ts.map +1 -1
  236. package/dist/field/features/upload/component/index.js +55 -9
  237. package/dist/field/features/upload/component/index.js.map +1 -1
  238. package/dist/field/features/upload/drawer/commands.d.ts.map +1 -1
  239. package/dist/field/features/upload/drawer/commands.js +1 -2
  240. package/dist/field/features/upload/drawer/commands.js.map +1 -1
  241. package/dist/field/features/upload/drawer/index.d.ts.map +1 -1
  242. package/dist/field/features/upload/drawer/index.js +8 -12
  243. package/dist/field/features/upload/drawer/index.js.map +1 -1
  244. package/dist/field/features/upload/feature.server.d.ts.map +1 -1
  245. package/dist/field/features/upload/feature.server.js +22 -6
  246. package/dist/field/features/upload/feature.server.js.map +1 -1
  247. package/dist/field/features/upload/nodes/UploadNode.d.ts +2 -14
  248. package/dist/field/features/upload/nodes/UploadNode.d.ts.map +1 -1
  249. package/dist/field/features/upload/nodes/UploadNode.js +6 -9
  250. package/dist/field/features/upload/nodes/UploadNode.js.map +1 -1
  251. package/dist/field/features/upload/plugin/index.d.ts +2 -2
  252. package/dist/field/features/upload/plugin/index.d.ts.map +1 -1
  253. package/dist/field/features/upload/plugin/index.js +4 -9
  254. package/dist/field/features/upload/plugin/index.js.map +1 -1
  255. package/dist/field/features/upload/populationPromise.js +11 -8
  256. package/dist/field/features/upload/populationPromise.js.map +1 -1
  257. package/dist/field/features/upload/validate.d.ts +2 -1
  258. package/dist/field/features/upload/validate.d.ts.map +1 -1
  259. package/dist/field/features/upload/validate.js +33 -9
  260. package/dist/field/features/upload/validate.js.map +1 -1
  261. package/dist/field/index.d.ts +1 -1
  262. package/dist/field/index.d.ts.map +1 -1
  263. package/dist/field/index.js.map +1 -1
  264. package/dist/field/lexical/LexicalEditor.d.ts.map +1 -1
  265. package/dist/field/lexical/LexicalEditor.js +6 -11
  266. package/dist/field/lexical/LexicalEditor.js.map +1 -1
  267. package/dist/field/lexical/LexicalProvider.d.ts +1 -1
  268. package/dist/field/lexical/LexicalProvider.d.ts.map +1 -1
  269. package/dist/field/lexical/LexicalProvider.js +1 -2
  270. package/dist/field/lexical/LexicalProvider.js.map +1 -1
  271. package/dist/field/lexical/config/client/default.d.ts +1 -1
  272. package/dist/field/lexical/config/client/default.d.ts.map +1 -1
  273. package/dist/field/lexical/config/client/default.js.map +1 -1
  274. package/dist/field/lexical/config/client/sanitize.d.ts +1 -1
  275. package/dist/field/lexical/config/client/sanitize.d.ts.map +1 -1
  276. package/dist/field/lexical/config/client/sanitize.js.map +1 -1
  277. package/dist/field/lexical/config/server/default.d.ts +2 -3
  278. package/dist/field/lexical/config/server/default.d.ts.map +1 -1
  279. package/dist/field/lexical/config/server/default.js +0 -2
  280. package/dist/field/lexical/config/server/default.js.map +1 -1
  281. package/dist/field/lexical/config/server/loader.d.ts +4 -2
  282. package/dist/field/lexical/config/server/loader.d.ts.map +1 -1
  283. package/dist/field/lexical/config/server/loader.js +3 -2
  284. package/dist/field/lexical/config/server/loader.js.map +1 -1
  285. package/dist/field/lexical/config/server/sanitize.d.ts +2 -1
  286. package/dist/field/lexical/config/server/sanitize.d.ts.map +1 -1
  287. package/dist/field/lexical/config/server/sanitize.js +23 -8
  288. package/dist/field/lexical/config/server/sanitize.js.map +1 -1
  289. package/dist/field/lexical/config/types.d.ts +1 -1
  290. package/dist/field/lexical/config/types.d.ts.map +1 -1
  291. package/dist/field/lexical/config/types.js.map +1 -1
  292. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.d.ts.map +1 -1
  293. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.js +3 -6
  294. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.js.map +1 -1
  295. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.d.ts.map +1 -1
  296. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.js +3 -6
  297. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.js.map +1 -1
  298. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.d.ts.map +1 -1
  299. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.js +27 -29
  300. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.js.map +1 -1
  301. package/dist/field/lexical/plugins/MarkdownShortcut/index.d.ts.map +1 -1
  302. package/dist/field/lexical/plugins/MarkdownShortcut/index.js +1 -2
  303. package/dist/field/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  304. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  305. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +3 -6
  306. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  307. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts.map +1 -1
  308. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +3 -6
  309. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
  310. package/dist/field/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
  311. package/dist/field/lexical/plugins/SlashMenu/index.js +1 -2
  312. package/dist/field/lexical/plugins/SlashMenu/index.js.map +1 -1
  313. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts.map +1 -1
  314. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js +2 -4
  315. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  316. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.d.ts.map +1 -1
  317. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js +1 -2
  318. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js.map +1 -1
  319. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  320. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js +2 -4
  321. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  322. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.d.ts.map +1 -1
  323. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.js +1 -2
  324. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.js.map +1 -1
  325. package/dist/field/lexical/theme/EditorTheme.scss +7 -8
  326. package/dist/field/lexical/ui/ContentEditable.d.ts.map +1 -1
  327. package/dist/field/lexical/ui/ContentEditable.js +1 -2
  328. package/dist/field/lexical/ui/ContentEditable.js.map +1 -1
  329. package/dist/field/lexical/utils/getSelectedNode.d.ts.map +1 -1
  330. package/dist/field/lexical/utils/getSelectedNode.js +1 -2
  331. package/dist/field/lexical/utils/getSelectedNode.js.map +1 -1
  332. package/dist/field/lexical/utils/nodeFormat.d.ts +2 -1
  333. package/dist/field/lexical/utils/nodeFormat.d.ts.map +1 -1
  334. package/dist/field/lexical/utils/nodeFormat.js.map +1 -1
  335. package/dist/field/lexical/utils/setFloatingElemPosition.d.ts +1 -1
  336. package/dist/field/lexical/utils/setFloatingElemPosition.d.ts.map +1 -1
  337. package/dist/field/lexical/utils/setFloatingElemPosition.js +15 -13
  338. package/dist/field/lexical/utils/setFloatingElemPosition.js.map +1 -1
  339. package/dist/field/lexical/utils/url.d.ts.map +1 -1
  340. package/dist/field/lexical/utils/url.js +3 -0
  341. package/dist/field/lexical/utils/url.js.map +1 -1
  342. package/dist/forEachNodeRecursively.d.ts +10 -0
  343. package/dist/forEachNodeRecursively.d.ts.map +1 -0
  344. package/dist/forEachNodeRecursively.js +24 -0
  345. package/dist/forEachNodeRecursively.js.map +1 -0
  346. package/dist/generateComponentMap.d.ts.map +1 -1
  347. package/dist/generateComponentMap.js +1 -10
  348. package/dist/generateComponentMap.js.map +1 -1
  349. package/dist/generateSchemaMap.d.ts.map +1 -1
  350. package/dist/generateSchemaMap.js +1 -10
  351. package/dist/generateSchemaMap.js.map +1 -1
  352. package/dist/index.d.ts +6 -5
  353. package/dist/index.d.ts.map +1 -1
  354. package/dist/index.js +260 -173
  355. package/dist/index.js.map +1 -1
  356. package/dist/populate/defaultValue.d.ts.map +1 -1
  357. package/dist/populate/defaultValue.js +1 -0
  358. package/dist/populate/defaultValue.js.map +1 -1
  359. package/dist/populate/populate.d.ts +3 -3
  360. package/dist/populate/populate.d.ts.map +1 -1
  361. package/dist/populate/populate.js.map +1 -1
  362. package/dist/populate/populateLexicalPopulationPromises.d.ts +12 -0
  363. package/dist/populate/populateLexicalPopulationPromises.d.ts.map +1 -0
  364. package/dist/populate/populateLexicalPopulationPromises.js +35 -0
  365. package/dist/populate/populateLexicalPopulationPromises.js.map +1 -0
  366. package/dist/populate/recurseNestedFields.d.ts +7 -4
  367. package/dist/populate/recurseNestedFields.d.ts.map +1 -1
  368. package/dist/populate/recurseNestedFields.js +3 -5
  369. package/dist/populate/recurseNestedFields.js.map +1 -1
  370. package/dist/types.d.ts +11 -5
  371. package/dist/types.d.ts.map +1 -1
  372. package/dist/types.js.map +1 -1
  373. package/dist/validate/index.d.ts +1 -1
  374. package/dist/validate/index.d.ts.map +1 -1
  375. package/package.json +46 -45
  376. package/dist/populate/richTextRelationshipPromise.d.ts +0 -23
  377. package/dist/populate/richTextRelationshipPromise.d.ts.map +0 -1
  378. package/dist/populate/richTextRelationshipPromise.js +0 -68
  379. package/dist/populate/richTextRelationshipPromise.js.map +0 -1
@@ -1 +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 lexicalUtilsImport from '@lexical/utils'\nconst { mergeRegister } = lexicalUtilsImport\n\nimport lexicalImport from 'lexical'\nconst {\n $getNodeByKey,\n $getSelection,\n $isNodeSelection,\n CLICK_COMMAND,\n COMMAND_PRIORITY_LOW,\n KEY_BACKSPACE_COMMAND,\n KEY_DELETE_COMMAND,\n} = lexicalImport\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","lexicalUtilsImport","mergeRegister","lexicalImport","$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,OAAOC,wBAAwB,iBAAgB;AAC/C,MAAM,EAAEC,aAAa,EAAE,GAAGD;AAE1B,OAAOE,mBAAmB,UAAS;AACnC,MAAM,EACJC,aAAa,EACbC,aAAa,EACbC,gBAAgB,EAChBC,aAAa,EACbC,oBAAoB,EACpBC,qBAAqB,EACrBC,kBAAkB,EACnB,GAAGP;AACJ,SAASQ,WAAW,EAAEC,SAAS,QAAQ,QAAO;AAE9C,SAASC,qBAAqB,QAAQ,iCAAgC;AAEtE;;;;CAIC,GACD,OAAO,SAASC,wBAAwB,EAAEC,OAAO,EAAwB;IACvE,MAAM,CAACC,OAAO,GAAGjB;IACjB,MAAM,CAACkB,YAAYC,aAAaC,eAAe,GAAGnB,wBAAwBe;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,OAAOV,cACLc,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"}
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"}
@@ -1 +1 @@
1
- {"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../../src/field/features/horizontalrule/feature.server.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAA;AAOhE,eAAO,MAAM,qBAAqB,EAAE,6BAA6B,CAAC,SAAS,EAAE,SAAS,CA4BrF,CAAA"}
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"}
@@ -1,3 +1,4 @@
1
+ import { createNode } from '../typeUtilities.js';
1
2
  import { HorizontalRuleFeatureClientComponent } from './feature.client.js';
2
3
  import { MarkdownTransformer } from './markdownTransformer.js';
3
4
  import { HorizontalRuleNode } from './nodes/HorizontalRuleNode.js';
@@ -11,7 +12,7 @@ export const HorizontalRuleFeature = (props)=>{
11
12
  MarkdownTransformer
12
13
  ],
13
14
  nodes: [
14
- {
15
+ createNode({
15
16
  converters: {
16
17
  html: {
17
18
  converter: ()=>{
@@ -23,7 +24,7 @@ export const HorizontalRuleFeature = (props)=>{
23
24
  }
24
25
  },
25
26
  node: HorizontalRuleNode
26
- }
27
+ })
27
28
  ],
28
29
  serverFeatureProps: props
29
30
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/field/features/horizontalrule/feature.server.ts"],"sourcesContent":["import type { HTMLConverter } from '../converters/html/converter/types.js'\nimport type { FeatureProviderProviderServer } from '../types.js'\nimport type { SerializedHorizontalRuleNode } from './nodes/HorizontalRuleNode.js'\n\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 {\n converters: {\n html: {\n converter: () => {\n return `<hr/>`\n },\n nodeTypes: [HorizontalRuleNode.getType()],\n } as HTMLConverter<SerializedHorizontalRuleNode>,\n },\n node: HorizontalRuleNode,\n },\n ],\n serverFeatureProps: props,\n }\n },\n key: 'horizontalrule',\n serverFeatureProps: props,\n }\n}\n"],"names":["HorizontalRuleFeatureClientComponent","MarkdownTransformer","HorizontalRuleNode","HorizontalRuleFeature","props","feature","ClientComponent","clientFeatureProps","markdownTransformers","nodes","converters","html","converter","nodeTypes","getType","node","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAIA,SAASA,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;oBACL;wBACEC,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"}
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"}
@@ -1,6 +1,5 @@
1
1
  import type { DOMConversionMap, DOMExportOutput, LexicalCommand, LexicalNode, SerializedLexicalNode } from 'lexical';
2
- import lexicalImport from 'lexical';
3
- declare const DecoratorNode: typeof lexicalImport.DecoratorNode;
2
+ import { DecoratorNode } from 'lexical';
4
3
  import * as React from 'react';
5
4
  /**
6
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.
@@ -51,5 +50,4 @@ export declare class HorizontalRuleNode extends DecoratorNode<React.ReactElement
51
50
  }
52
51
  export declare function $createHorizontalRuleNode(): HorizontalRuleNode;
53
52
  export declare function $isHorizontalRuleNode(node: LexicalNode | null | undefined): node is HorizontalRuleNode;
54
- export {};
55
53
  //# sourceMappingURL=HorizontalRuleNode.d.ts.map
@@ -1 +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,aAAa,MAAM,SAAS,CAAA;AACnC,QAAA,MAA+B,aAAa,oCAAiC,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"}
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"}
@@ -1,5 +1,4 @@
1
- import lexicalImport from 'lexical';
2
- const { $applyNodeReplacement, DecoratorNode, createCommand } = lexicalImport;
1
+ import { $applyNodeReplacement, DecoratorNode, createCommand } from 'lexical';
3
2
  import * as React from 'react';
4
3
  const HorizontalRuleComponent = /*#__PURE__*/ React.lazy(()=>import('../component/index.js').then((module)=>({
5
4
  default: module.HorizontalRuleComponent
@@ -1 +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 lexicalImport from 'lexical'\nconst { $applyNodeReplacement, DecoratorNode, createCommand } = lexicalImport\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":["lexicalImport","$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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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U;AACnC;AAEA,OAAO,SAAS0B,sBACdxB,IAAoC;IAEpC,OAAOA,gBAAgBF;AACzB"}
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"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/horizontalrule/plugin/index.tsx"],"names":[],"mappings":"AAeA,OAAO,cAAc,CAAA;AAErB;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CA2B3C"}
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"}
@@ -1,10 +1,7 @@
1
1
  'use client';
2
- import lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js';
3
- const { useLexicalComposerContext } = lexicalComposerContextImport;
4
- import lexicalUtilsImport from '@lexical/utils';
5
- const { $insertNodeToNearestRoot } = lexicalUtilsImport;
6
- import lexicalImport from 'lexical';
7
- const { $getSelection, $isRangeSelection, COMMAND_PRIORITY_EDITOR } = lexicalImport;
2
+ import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js';
3
+ import { $insertNodeToNearestRoot } from '@lexical/utils';
4
+ import { $getSelection, $isRangeSelection, COMMAND_PRIORITY_EDITOR } from 'lexical';
8
5
  import { useEffect } from 'react';
9
6
  import { $createHorizontalRuleNode, INSERT_HORIZONTAL_RULE_COMMAND } from '../nodes/HorizontalRuleNode.js';
10
7
  import './index.scss';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/horizontalrule/plugin/index.tsx"],"sourcesContent":["'use client'\n\nimport lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'\nconst { useLexicalComposerContext } = lexicalComposerContextImport\nimport lexicalUtilsImport from '@lexical/utils'\nconst { $insertNodeToNearestRoot } = lexicalUtilsImport\n\nimport lexicalImport from 'lexical'\nconst { $getSelection, $isRangeSelection, COMMAND_PRIORITY_EDITOR } = lexicalImport\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":["lexicalComposerContextImport","useLexicalComposerContext","lexicalUtilsImport","$insertNodeToNearestRoot","lexicalImport","$getSelection","$isRangeSelection","COMMAND_PRIORITY_EDITOR","useEffect","$createHorizontalRuleNode","INSERT_HORIZONTAL_RULE_COMMAND","HorizontalRulePlugin","editor","registerCommand","type","selection","focusNode","focus","getNode","horizontalRuleNode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,OAAOA,kCAAkC,2CAA0C;AACnF,MAAM,EAAEC,yBAAyB,EAAE,GAAGD;AACtC,OAAOE,wBAAwB,iBAAgB;AAC/C,MAAM,EAAEC,wBAAwB,EAAE,GAAGD;AAErC,OAAOE,mBAAmB,UAAS;AACnC,MAAM,EAAEC,aAAa,EAAEC,iBAAiB,EAAEC,uBAAuB,EAAE,GAAGH;AACtE,SAASI,SAAS,QAAQ,QAAO;AAEjC,SACEC,yBAAyB,EACzBC,8BAA8B,QACzB,iCAAgC;AACvC,OAAO,eAAc;AAErB;;CAEC,GACD,OAAO,SAASC;IACd,MAAM,CAACC,OAAO,GAAGX;IAEjBO,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;gBAC3BN,yBAAyBgB;YAC3B;YAEA,OAAO;QACT,GACAZ;IAEJ,GAAG;QAACK;KAAO;IAEX,OAAO;AACT"}
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"}
@@ -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,O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BAAoB"}
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"}
@@ -1,4 +1,4 @@
1
- import type { Config } from 'payload/config';
2
- import type { Field } from 'payload/types';
3
- export declare const getBaseFields: (config: Config, enabledCollections: false | string[], disabledCollections: false | string[]) => Field[];
1
+ import type { SanitizedConfig } from 'payload/config';
2
+ import type { FieldWithRichTextRequiredEditor } from 'payload/types';
3
+ export declare const getBaseFields: (config: SanitizedConfig, enabledCollections: false | string[], disabledCollections: false | string[]) => FieldWithRichTextRequiredEditor[];
4
4
  //# sourceMappingURL=baseFields.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"baseFields.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/link/drawer/baseFields.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AAC5C,OAAO,KAAK,EAAE,KAAK,EAAyB,MAAM,eAAe,CAAA;AAIjE,eAAO,MAAM,aAAa,WAChB,MAAM,sBACM,KAAK,GAAG,MAAM,EAAE,uBACf,KAAK,GAAG,MAAM,EAAE,KACpC,KAAK,EAmHP,CAAA"}
1
+ {"version":3,"file":"baseFields.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/link/drawer/baseFields.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,KAAK,EAAS,+BAA+B,EAAyB,MAAM,eAAe,CAAA;AAIlG,eAAO,MAAM,aAAa,WAChB,eAAe,sBACH,KAAK,GAAG,MAAM,EAAE,uBACf,KAAK,GAAG,MAAM,EAAE,KACpC,+BAA+B,EAqGjC,CAAA"}
@@ -24,61 +24,47 @@ export const getBaseFields = (config, enabledCollections, disabledCollections)=>
24
24
  required: true
25
25
  },
26
26
  {
27
- name: 'fields',
28
- type: 'group',
27
+ name: 'linkType',
28
+ type: 'radio',
29
29
  admin: {
30
- style: {
31
- borderBottom: 0,
32
- borderTop: 0,
33
- margin: 0,
34
- padding: 0
35
- }
30
+ description: ({ t })=>t('fields:chooseBetweenCustomTextOrDocument')
36
31
  },
37
- fields: [
38
- {
39
- name: 'linkType',
40
- type: 'radio',
41
- admin: {
42
- description: ({ t })=>t('fields:chooseBetweenCustomTextOrDocument')
43
- },
44
- defaultValue: 'custom',
45
- label: ({ t })=>t('fields:linkType'),
46
- options: [
47
- {
48
- label: ({ t })=>t('fields:customURL'),
49
- value: 'custom'
50
- }
51
- ],
52
- required: true
53
- },
32
+ defaultValue: 'custom',
33
+ label: ({ t })=>t('fields:linkType'),
34
+ options: [
54
35
  {
55
- name: 'url',
56
- type: 'text',
57
- label: ({ t })=>t('fields:enterURL'),
58
- required: true,
59
- validate: (value)=>{
60
- if (value && !validateUrl(value)) {
61
- return 'Invalid URL';
62
- }
63
- }
36
+ label: ({ t })=>t('fields:customURL'),
37
+ value: 'custom'
38
+ }
39
+ ],
40
+ required: true
41
+ },
42
+ {
43
+ name: 'url',
44
+ type: 'text',
45
+ label: ({ t })=>t('fields:enterURL'),
46
+ required: true,
47
+ validate: (value)=>{
48
+ if (!validateUrl(value)) {
49
+ return 'Invalid URL';
64
50
  }
65
- ]
51
+ }
66
52
  }
67
53
  ];
68
54
  // Only display internal link-specific fields / options / conditions if there are enabled relations
69
55
  if (enabledRelations?.length) {
70
- baseFields[1].fields[0].options.push({
56
+ baseFields[1].options.push({
71
57
  label: ({ t })=>t('fields:internalLink'),
72
58
  value: 'internal'
73
59
  });
74
- baseFields[1].fields[1].admin = {
75
- condition: ({ fields })=>fields?.linkType !== 'internal'
60
+ baseFields[2].admin = {
61
+ condition: ({ linkType })=>linkType !== 'internal'
76
62
  };
77
- baseFields[1].fields.push({
63
+ baseFields.push({
78
64
  name: 'doc',
79
65
  admin: {
80
- condition: ({ fields })=>{
81
- return fields?.linkType === 'internal';
66
+ condition: ({ linkType })=>{
67
+ return linkType === 'internal';
82
68
  }
83
69
  },
84
70
  // when admin.hidden is a function we need to dynamically call hidden with the user to know if the collection should be shown
@@ -96,7 +82,7 @@ export const getBaseFields = (config, enabledCollections, disabledCollections)=>
96
82
  required: true
97
83
  });
98
84
  }
99
- baseFields[1].fields.push({
85
+ baseFields.push({
100
86
  name: 'newTab',
101
87
  type: 'checkbox',
102
88
  label: ({ t })=>t('fields:openInNewTab')
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/link/drawer/baseFields.ts"],"sourcesContent":["import type { User } from 'payload/auth'\nimport type { Config } from 'payload/config'\nimport type { Field, RadioField, TextField } from 'payload/types'\n\nimport { validateUrl } from '../../../lexical/utils/url.js'\n\nexport const getBaseFields = (\n config: Config,\n enabledCollections: false | string[],\n disabledCollections: false | string[],\n): Field[] => {\n let enabledRelations: string[]\n\n /**\n * Figure out which relations should be enabled (enabledRelations) based on a collection's admin.enableRichTextLink property,\n * or the Link Feature's enabledCollections and disabledCollections properties which override it.\n */\n if (enabledCollections) {\n enabledRelations = enabledCollections\n } else if (disabledCollections) {\n enabledRelations = config.collections\n .filter(({ slug }) => !disabledCollections.includes(slug))\n .map(({ slug }) => slug)\n } else {\n enabledRelations = config.collections\n .filter(({ admin: { enableRichTextLink, hidden } }) => {\n if (typeof hidden !== 'function' && hidden) {\n return false\n }\n return enableRichTextLink\n })\n .map(({ slug }) => slug)\n }\n\n const baseFields = [\n {\n name: 'text',\n type: 'text',\n label: ({ t }) => t('fields:textToDisplay'),\n required: true,\n },\n {\n name: 'fields',\n type: 'group',\n admin: {\n style: {\n borderBottom: 0,\n borderTop: 0,\n margin: 0,\n padding: 0,\n },\n },\n fields: [\n {\n name: 'linkType',\n type: 'radio',\n admin: {\n description: ({ t }) => t('fields:chooseBetweenCustomTextOrDocument'),\n },\n defaultValue: 'custom',\n label: ({ t }) => t('fields:linkType'),\n options: [\n {\n label: ({ t }) => t('fields:customURL'),\n value: 'custom',\n },\n ],\n required: true,\n },\n {\n name: 'url',\n type: 'text',\n label: ({ t }) => t('fields:enterURL'),\n required: true,\n validate: (value: string) => {\n if (value && !validateUrl(value)) {\n return 'Invalid URL'\n }\n },\n },\n ] as Field[],\n },\n ]\n\n // Only display internal link-specific fields / options / conditions if there are enabled relations\n if (enabledRelations?.length) {\n ;(baseFields[1].fields[0] as RadioField).options.push({\n label: ({ t }) => t('fields:internalLink'),\n value: 'internal',\n })\n ;(baseFields[1].fields[1] as TextField).admin = {\n condition: ({ fields }) => fields?.linkType !== 'internal',\n }\n\n baseFields[1].fields.push({\n name: 'doc',\n admin: {\n condition: ({ fields }) => {\n return fields?.linkType === 'internal'\n },\n },\n // when admin.hidden is a function we need to dynamically call hidden with the user to know if the collection should be shown\n type: 'relationship',\n filterOptions:\n !enabledCollections && !disabledCollections\n ? ({ relationTo, user }) => {\n const hidden = config.collections.find(({ slug }) => slug === relationTo).admin.hidden\n if (typeof hidden === 'function' && hidden({ user } as { user: User })) {\n return false\n }\n }\n : null,\n label: ({ t }) => t('fields:chooseDocumentToLink'),\n relationTo: enabledRelations,\n required: true,\n })\n }\n\n baseFields[1].fields.push({\n name: 'newTab',\n type: 'checkbox',\n label: ({ t }) => t('fields:openInNewTab'),\n })\n\n return baseFields as Field[]\n}\n"],"names":["validateUrl","getBaseFields","config","enabledCollections","disabledCollections","enabledRelations","collections","filter","slug","includes","map","admin","enableRichTextLink","hidden","baseFields","name","type","label","t","required","style","borderBottom","borderTop","margin","padding","fields","description","defaultValue","options","value","validate","length","push","condition","linkType","filterOptions","relationTo","user","find"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAIA,SAASA,WAAW,QAAQ,gCAA+B;AAE3D,OAAO,MAAMC,gBAAgB,CAC3BC,QACAC,oBACAC;IAEA,IAAIC;IAEJ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ACH;KACD;IAED,mGAAmG;IACnG,IAAIxB,kBAAkB0B,QAAQ;QAC1BjB,UAAU,CAAC,EAAE,CAACW,MAAM,CAAC,EAAE,CAAgBG,OAAO,CAACI,IAAI,CAAC;YACpDf,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;YACpBW,OAAO;QACT;QACEf,UAAU,CAAC,EAAE,CAACW,MAAM,CAAC,EAAE,CAAed,KAAK,GAAG;YAC9CsB,WAAW,CAAC,EAAER,MAAM,EAAE,GAAKA,QAAQS,aAAa;QAClD;QAEApB,UAAU,CAAC,EAAE,CAACW,MAAM,CAACO,IAAI,CAAC;YACxBjB,MAAM;YACNJ,OAAO;gBACLsB,WAAW,CAAC,EAAER,MAAM,EAAE;oBACpB,OAAOA,QAAQS,aAAa;gBAC9B;YACF;YACA,6HAA6H;YAC7HlB,MAAM;YACNmB,eACE,CAAChC,sBAAsB,CAACC,sBACpB,CAAC,EAAEgC,UAAU,EAAEC,IAAI,EAAE;gBACnB,MAAMxB,SAASX,OAAOI,WAAW,CAACgC,IAAI,CAAC,CAAC,EAAE9B,IAAI,EAAE,GAAKA,SAAS4B,YAAYzB,KAAK,CAACE,MAAM;gBACtF,IAAI,OAAOA,WAAW,cAAcA,OAAO;oBAAEwB;gBAAK,IAAsB;oBACtE,OAAO;gBACT;YACF,IACA;YACNpB,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;YACpBkB,YAAY/B;YACZc,UAAU;QACZ;IACF;IAEAL,UAAU,CAAC,EAAE,CAACW,MAAM,CAACO,IAAI,CAAC;QACxBjB,MAAM;QACNC,MAAM;QACNC,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;IACtB;IAEA,OAAOJ;AACT,EAAC"}
1
+ {"version":3,"sources":["../../../../../src/field/features/link/drawer/baseFields.ts"],"sourcesContent":["import type { User } from 'payload/auth'\nimport type { SanitizedConfig } from 'payload/config'\nimport type { Field, FieldWithRichTextRequiredEditor, RadioField, TextField } from 'payload/types'\n\nimport { validateUrl } from '../../../lexical/utils/url.js'\n\nexport const getBaseFields = (\n config: SanitizedConfig,\n enabledCollections: false | string[],\n disabledCollections: false | string[],\n): FieldWithRichTextRequiredEditor[] => {\n let enabledRelations: string[]\n\n /**\n * Figure out which relations should be enabled (enabledRelations) based on a collection's admin.enableRichTextLink property,\n * or the Link Feature's enabledCollections and disabledCollections properties which override it.\n */\n if (enabledCollections) {\n enabledRelations = enabledCollections\n } else if (disabledCollections) {\n enabledRelations = config.collections\n .filter(({ slug }) => !disabledCollections.includes(slug))\n .map(({ slug }) => slug)\n } else {\n enabledRelations = config.collections\n .filter(({ admin: { enableRichTextLink, hidden } }) => {\n if (typeof hidden !== 'function' && hidden) {\n return false\n }\n return enableRichTextLink\n })\n .map(({ slug }) => slug)\n }\n\n const baseFields: Field[] = [\n {\n name: 'text',\n type: 'text',\n label: ({ t }) => t('fields:textToDisplay'),\n required: true,\n },\n {\n name: 'linkType',\n type: 'radio',\n admin: {\n description: ({ t }) => t('fields:chooseBetweenCustomTextOrDocument'),\n },\n defaultValue: 'custom',\n label: ({ t }) => t('fields:linkType'),\n options: [\n {\n label: ({ t }) => t('fields:customURL'),\n value: 'custom',\n },\n ],\n required: true,\n } as RadioField,\n {\n name: 'url',\n type: 'text',\n label: ({ t }) => t('fields:enterURL'),\n required: true,\n validate: (value: string) => {\n if (!validateUrl(value)) {\n return 'Invalid URL'\n }\n },\n },\n ]\n\n // Only display internal link-specific fields / options / conditions if there are enabled relations\n if (enabledRelations?.length) {\n ;(baseFields[1] as RadioField).options.push({\n label: ({ t }) => t('fields:internalLink'),\n value: 'internal',\n })\n ;(baseFields[2] as TextField).admin = {\n condition: ({ linkType }) => linkType !== 'internal',\n }\n\n baseFields.push({\n name: 'doc',\n admin: {\n condition: ({ linkType }) => {\n return linkType === 'internal'\n },\n },\n // when admin.hidden is a function we need to dynamically call hidden with the user to know if the collection should be shown\n type: 'relationship',\n filterOptions:\n !enabledCollections && !disabledCollections\n ? ({ relationTo, user }) => {\n const hidden = config.collections.find(({ slug }) => slug === relationTo).admin.hidden\n if (typeof hidden === 'function' && hidden({ user } as { user: User })) {\n return false\n }\n }\n : null,\n label: ({ t }) => t('fields:chooseDocumentToLink'),\n relationTo: enabledRelations,\n required: true,\n })\n }\n\n baseFields.push({\n name: 'newTab',\n type: 'checkbox',\n label: ({ t }) => t('fields:openInNewTab'),\n })\n\n return baseFields as FieldWithRichTextRequiredEditor[]\n}\n"],"names":["validateUrl","getBaseFields","config","enabledCollections","disabledCollections","enabledRelations","collections","filter","slug","includes","map","admin","enableRichTextLink","hidden","baseFields","name","type","label","t","required","description","defaultValue","options","value","validate","length","push","condition","linkType","filterOptions","relationTo","user","find"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAIA,SAASA,WAAW,QAAQ,gCAA+B;AAE3D,OAAO,MAAMC,gBAAgB,CAC3BC,QACAC,oBACAC;IAEA,IAAIC;IAEJ;;;GAGC,GACD,IAAIF,oBAAoB;QACtBE,mBAAmBF;IACrB,OAAO,IAAIC,qBAAqB;QAC9BC,mBAAmBH,OAAOI,WAAW,CAClCC,MAAM,CAAC,CAAC,EAAEC,IAAI,EAAE,GAAK,CAACJ,oBAAoBK,QAAQ,CAACD,OACnDE,GAAG,CAAC,CAAC,EAAEF,IAAI,EAAE,GAAKA;IACvB,OAAO;QACLH,mBAAmBH,OAAOI,WAAW,CAClCC,MAAM,CAAC,CAAC,EAAEI,OAAO,EAAEC,kBAAkB,EAAEC,MAAM,EAAE,EAAE;YAChD,IAAI,OAAOA,WAAW,cAAcA,QAAQ;gBAC1C,OAAO;YACT;YACA,OAAOD;QACT,GACCF,GAAG,CAAC,CAAC,EAAEF,IAAI,EAAE,GAAKA;IACvB;IAEA,MAAMM,aAAsB;QAC1B;YACEC,MAAM;YACNC,MAAM;YACNC,OAAO,CAA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T;YACF,IACA;YACNd,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;YACpBY,YAAYzB;YACZc,UAAU;QACZ;IACF;IAEAL,WAAWY,IAAI,CAAC;QACdX,MAAM;QACNC,MAAM;QACNC,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;IACtB;IAEA,OAAOJ;AACT,EAAC"}
@@ -1,8 +1,10 @@
1
1
  import type { FormState } from 'payload/types';
2
- import type { LinkPayload } from '../plugins/floatingLinkEditor/types.js';
2
+ import type { LinkFields } from '../nodes/types.js';
3
3
  export interface Props {
4
4
  drawerSlug: string;
5
5
  handleModalSubmit: (fields: FormState, data: Record<string, unknown>) => void;
6
- stateData?: LinkPayload;
6
+ stateData?: LinkFields & {
7
+ text: string;
8
+ };
7
9
  }
8
10
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/link/drawer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AAEzE,MAAM,WAAW,KAAK;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,iBAAiB,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;IAC7E,SAAS,CAAC,EAAE,WAAW,CAAA;CACxB"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/link/drawer/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAE9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAEnD,MAAM,WAAW,KAAK;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,iBAAiB,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAA;IAC7E,SAAS,CAAC,EAAE,UAAU,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAA;CAC1C"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/link/drawer/types.ts"],"sourcesContent":["import type { FormState } from 'payload/types'\n\nimport type { LinkPayload } from '../plugins/floatingLinkEditor/types.js'\n\nexport interface Props {\n drawerSlug: string\n handleModalSubmit: (fields: FormState, data: Record<string, unknown>) => void\n stateData?: LinkPayload\n}\n"],"names":[],"rangeMappings":"","mappings":"AAIA,WAIC"}
1
+ {"version":3,"sources":["../../../../../src/field/features/link/drawer/types.ts"],"sourcesContent":["import type { FormState } from 'payload/types'\n\nimport type { LinkFields } from '../nodes/types.js'\n\nexport interface Props {\n drawerSlug: string\n handleModalSubmit: (fields: FormState, data: Record<string, unknown>) => void\n stateData?: LinkFields & { text: string }\n}\n"],"names":[],"rangeMappings":"","mappings":"AAIA,WAIC"}
@@ -1 +1 @@
1
- {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/field/features/link/feature.client.tsx"],"names":[],"mappings":";AASA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAA;AAexE,MAAM,MAAM,WAAW,GAAG,6BAA6B,CAAA;AAuEvD,eAAO,MAAM,0BAA0B,+FAA2C,CAAA"}
1
+ {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/field/features/link/feature.client.tsx"],"names":[],"mappings":";AAMA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAA;AAexE,MAAM,MAAM,WAAW,GAAG,6BAA6B,CAAA;AAuEvD,eAAO,MAAM,0BAA0B,+FAA2C,CAAA"}
@@ -1,8 +1,6 @@
1
1
  'use client';
2
- import lexicalUtilsImport from '@lexical/utils';
3
- const { $findMatchingParent } = lexicalUtilsImport;
4
- import lexicalImport from 'lexical';
5
- const { $getSelection, $isRangeSelection } = lexicalImport;
2
+ import { $findMatchingParent } from '@lexical/utils';
3
+ import { $getSelection, $isRangeSelection } from 'lexical';
6
4
  import { LinkIcon } from '../../lexical/ui/icons/Link/index.js';
7
5
  import { getSelectedNode } from '../../lexical/utils/getSelectedNode.js';
8
6
  import { FeaturesSectionWithEntries } from '../common/floatingSelectToolbarFeaturesButtonsSection/index.js';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/field/features/link/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport lexicalUtilsImport from '@lexical/utils'\nconst { $findMatchingParent } = lexicalUtilsImport\n\nimport lexicalImport from 'lexical'\nconst { $getSelection, $isRangeSelection } = lexicalImport\n\nimport type { FeatureProviderProviderClient } from '../types.js'\nimport type { ExclusiveLinkCollectionsProps } from './feature.server.js'\nimport type { LinkFields } from './nodes/types.js'\n\nimport { LinkIcon } from '../../lexical/ui/icons/Link/index.js'\nimport { getSelectedNode } from '../../lexical/utils/getSelectedNode.js'\nimport { FeaturesSectionWithEntries } from '../common/floatingSelectToolbarFeaturesButtonsSection/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { AutoLinkNode } from './nodes/AutoLinkNode.js'\nimport { $isLinkNode, LinkNode, TOGGLE_LINK_COMMAND } from './nodes/LinkNode.js'\nimport { AutoLinkPlugin } from './plugins/autoLink/index.js'\nimport { ClickableLinkPlugin } from './plugins/clickableLink/index.js'\nimport { TOGGLE_LINK_WITH_MODAL_COMMAND } from './plugins/floatingLinkEditor/LinkEditor/commands.js'\nimport { FloatingLinkEditorPlugin } from './plugins/floatingLinkEditor/index.js'\nimport { LinkPlugin } from './plugins/link/index.js'\n\nexport type ClientProps = ExclusiveLinkCollectionsProps\n\nconst LinkFeatureClient: FeatureProviderProviderClient<ClientProps> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n floatingSelectToolbar: {\n sections: [\n FeaturesSectionWithEntries([\n {\n ChildComponent: LinkIcon,\n isActive: ({ selection }) => {\n if ($isRangeSelection(selection)) {\n const selectedNode = getSelectedNode(selection)\n const linkParent = $findMatchingParent(selectedNode, $isLinkNode)\n return linkParent != null\n }\n return false\n },\n key: 'link',\n label: `Link`,\n onClick: ({ editor, isActive }) => {\n if (!isActive) {\n let selectedText = null\n editor.getEditorState().read(() => {\n selectedText = $getSelection().getTextContent()\n })\n const linkFields: LinkFields = {\n doc: null,\n linkType: 'custom',\n newTab: false,\n url: 'https://',\n }\n editor.dispatchCommand(TOGGLE_LINK_WITH_MODAL_COMMAND, {\n fields: linkFields,\n text: selectedText,\n })\n } else {\n // remove link\n editor.dispatchCommand(TOGGLE_LINK_COMMAND, null)\n }\n },\n order: 1,\n },\n ]),\n ],\n },\n nodes: [LinkNode, AutoLinkNode],\n plugins: [\n {\n Component: LinkPlugin,\n position: 'normal',\n },\n {\n Component: AutoLinkPlugin,\n position: 'normal',\n },\n {\n Component: ClickableLinkPlugin,\n position: 'normal',\n },\n {\n Component: FloatingLinkEditorPlugin,\n position: 'floatingAnchorElem',\n },\n ],\n }),\n }\n}\n\nexport const LinkFeatureClientComponent = createClientComponent(LinkFeatureClient)\n"],"names":["lexicalUtilsImport","$findMatchingParent","lexicalImport","$getSelection","$isRangeSelection","LinkIcon","getSelectedNode","FeaturesSectionWithEntries","createClientComponent","AutoLinkNode","$isLinkNode","LinkNode","TOGGLE_LINK_COMMAND","AutoLinkPlugin","ClickableLinkPlugin","TOGGLE_LINK_WITH_MODAL_COMMAND","FloatingLinkEditorPlugin","LinkPlugin","LinkFeatureClient","props","clientFeatureProps","feature","floatingSelectToolbar","sections","ChildComponent","isActive","selection","selectedNode","linkParent","key","label","onClick","editor","selectedText","getEditorState","read","getTextContent","linkFields","doc","linkType","newTab","url","dispatchCommand","fields","text","order","nodes","plugins","Component","position","LinkFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AC/C;wCACA,MAAMC,aAAyB;4CAC7BC,KAAK;4CACLC,UAAU;4CACVC,QAAQ;4CACRC,KAAK;wCACP;wCACAT,OAAOU,eAAe,CAAC3B,gCAAgC;4CACrD4B,QAAQN;4CACRO,MAAMX;wCACR;oCACF,OAAO;wCACL,cAAc;wCACdD,OAAOU,eAAe,CAAC9B,qBAAqB;oCAC9C;gCACF;gCACAiC,OAAO;4BACT;yBACD;qBACF;gBACH;gBACAC,OAAO;oBAACnC;oBAAUF;iBAAa;gBAC/BsC,SAAS;oBACP;wBACEC,WAAW/B;wBACXgC,UAAU;oBACZ;oBACA;wBACED,WAAWnC;wBACXoC,UAAU;oBACZ;oBACA;wBACED,WAAWlC;wBACXmC,UAAU;oBACZ;oBACA;wBACED,WAAWhC;wBACXiC,UAAU;oBACZ;iBACD;YACH,CAAA;IACF;AACF;AAEA,OAAO,MAAMC,6BAA6B1C,sBAAsBU,mBAAkB"}
1
+ {"version":3,"sources":["../../../../src/field/features/link/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport { $findMatchingParent } from '@lexical/utils'\nimport { $getSelection, $isRangeSelection } from 'lexical'\n\nimport type { FeatureProviderProviderClient } from '../types.js'\nimport type { ExclusiveLinkCollectionsProps } from './feature.server.js'\nimport type { LinkFields } from './nodes/types.js'\n\nimport { LinkIcon } from '../../lexical/ui/icons/Link/index.js'\nimport { getSelectedNode } from '../../lexical/utils/getSelectedNode.js'\nimport { FeaturesSectionWithEntries } from '../common/floatingSelectToolbarFeaturesButtonsSection/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { AutoLinkNode } from './nodes/AutoLinkNode.js'\nimport { $isLinkNode, LinkNode, TOGGLE_LINK_COMMAND } from './nodes/LinkNode.js'\nimport { AutoLinkPlugin } from './plugins/autoLink/index.js'\nimport { ClickableLinkPlugin } from './plugins/clickableLink/index.js'\nimport { TOGGLE_LINK_WITH_MODAL_COMMAND } from './plugins/floatingLinkEditor/LinkEditor/commands.js'\nimport { FloatingLinkEditorPlugin } from './plugins/floatingLinkEditor/index.js'\nimport { LinkPlugin } from './plugins/link/index.js'\n\nexport type ClientProps = ExclusiveLinkCollectionsProps\n\nconst LinkFeatureClient: FeatureProviderProviderClient<ClientProps> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n floatingSelectToolbar: {\n sections: [\n FeaturesSectionWithEntries([\n {\n ChildComponent: LinkIcon,\n isActive: ({ selection }) => {\n if ($isRangeSelection(selection)) {\n const selectedNode = getSelectedNode(selection)\n const linkParent = $findMatchingParent(selectedNode, $isLinkNode)\n return linkParent != null\n }\n return false\n },\n key: 'link',\n label: `Link`,\n onClick: ({ editor, isActive }) => {\n if (!isActive) {\n let selectedText = null\n editor.getEditorState().read(() => {\n selectedText = $getSelection().getTextContent()\n })\n const linkFields: LinkFields = {\n doc: null,\n linkType: 'custom',\n newTab: false,\n url: 'https://',\n }\n editor.dispatchCommand(TOGGLE_LINK_WITH_MODAL_COMMAND, {\n fields: linkFields,\n text: selectedText,\n })\n } else {\n // remove link\n editor.dispatchCommand(TOGGLE_LINK_COMMAND, null)\n }\n },\n order: 1,\n },\n ]),\n ],\n },\n nodes: [LinkNode, AutoLinkNode],\n plugins: [\n {\n Component: LinkPlugin,\n position: 'normal',\n },\n {\n Component: AutoLinkPlugin,\n position: 'normal',\n },\n {\n Component: ClickableLinkPlugin,\n position: 'normal',\n },\n {\n Component: FloatingLinkEditorPlugin,\n position: 'floatingAnchorElem',\n },\n ],\n }),\n }\n}\n\nexport const LinkFeatureClientComponent = createClientComponent(LinkFeatureClient)\n"],"names":["$findMatchingParent","$getSelection","$isRangeSelection","LinkIcon","getSelectedNode","FeaturesSectionWithEntries","createClientComponent","AutoLinkNode","$isLinkNode","LinkNode","TOGGLE_LINK_COMMAND","AutoLinkPlugin","ClickableLinkPlugin","TOGGLE_LINK_WITH_MODAL_COMMAND","FloatingLinkEditorPlugin","LinkPlugin","LinkFeatureClient","props","clientFeatureProps","feature","floatingSelectToolbar","sections","ChildComponent","isActive","selection","selectedNode","linkParent","key","label","onClick","editor","selectedText","getEditorState","read","getTextContent","linkFields","doc","linkType","newTab","url","dispatchCommand","fields","text","order","nodes","plugins","Component","position","LinkFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,mBAAmB,QAAQ,iBAAgB;AACpD,SAASC,aAAa,EAAEC,iBAAiB,QAAQ,UAAS;AAM1D,SAASC,QAAQ,QAAQ,uCAAsC;AAC/D,SAASC,eAAe,QAAQ,yCAAwC;AACxE,SAASC,0BAA0B,QAAQ,iEAAgE;AAC3G,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,YAAY,QAAQ,0BAAyB;AACtD,SAASC,WAAW,EAAEC,QAAQ,EAAEC,mBAAmB,QAAQ,sBAAqB;AAChF,SAASC,cAAc,QAAQ,8BAA6B;AAC5D,SAASC,mBAAmB,QAAQ,mCAAkC;AACtE,SAASC,8BAA8B,QAAQ,sDAAqD;AACpG,SAASC,wBAAwB,QAAQ,wCAAuC;AAChF,SAASC,UAAU,QAAQ,0BAAyB;AAIpD,MAAMC,oBAAgE,CAACC;IACrE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,uBAAuB;oBACrBC,UAAU;wBACRhB,2BAA2B;4BACzB;gCACEiB,gBAAgBnB;gCAChBoB,UAAU,CAAC,EAAEC,SAAS,EAAE;oCACtB,IAAItB,kBAAkBsB,YAAY;wCAChC,MAAMC,eAAerB,gBAAgBoB;wCACrC,MAAME,aAAa1B,oBAAoByB,cAAcjB;wCACrD,OAAOkB,cAAc;oCACvB;oCACA,OAAO;gCACT;gCACAC,KAAK;gCACLC,OAAO,CAAC,IAAI,CAAC;gCACbC,SAAS,CAAC,EAAEC,MAAM,EAAEP,QAAQ,EAAE;oCAC5B,IAAI,CAACA,UAAU;wCACb,IAAIQ,eAAe;wCACnBD,OAAOE,cAAc,GAAGC,IAAI,CAAC;4CAC3BF,eAAe9B,gBAAgBiC,cAAc;wCAC/C;wCACA,MAAMC,aAAyB;4CAC7BC,KAAK;4CACLC,UAAU;4CACVC,QAAQ;4CACRC,KAAK;wCACP;wCACAT,OAAOU,eAAe,CAAC3B,gCAAgC;4CACrD4B,QAAQN;4CACRO,MAAMX;wCACR;oCACF,OAAO;wCACL,cAAc;wCACdD,OAAOU,eAAe,CAAC9B,qBAAqB;oCAC9C;gCACF;gCACAiC,OAAO;4BACT;yBACD;qBACF;gBACH;gBACAC,OAAO;oBAACnC;oBAAUF;iBAAa;gBAC/BsC,SAAS;oBACP;wBACEC,WAAW/B;wBACXgC,UAAU;oBACZ;oBACA;wBACED,WAAWnC;wBACXoC,UAAU;oBACZ;oBACA;wBACED,WAAWlC;wBACXmC,UAAU;oBACZ;oBACA;wBACED,WAAWhC;wBACXiC,UAAU;oBACZ;iBACD;YACH,CAAA;IACF;AACF;AAEA,OAAO,MAAMC,6BAA6B1C,sBAAsBU,mBAAkB"}
@@ -1,4 +1,3 @@
1
- import type { I18n } from '@payloadcms/translations';
2
1
  import type { SanitizedConfig } from 'payload/config';
3
2
  import type { FieldWithRichTextRequiredEditor } from 'payload/types';
4
3
  import type { FeatureProviderProviderServer } from '../types.js';
@@ -26,7 +25,6 @@ export type LinkFeatureServerProps = ExclusiveLinkCollectionsProps & {
26
25
  fields?: ((args: {
27
26
  config: SanitizedConfig;
28
27
  defaultFields: FieldWithRichTextRequiredEditor[];
29
- i18n: I18n;
30
28
  }) => FieldWithRichTextRequiredEditor[]) | FieldWithRichTextRequiredEditor[];
31
29
  };
32
30
  export declare const LinkFeature: FeatureProviderProviderServer<LinkFeatureServerProps, ClientProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../../src/field/features/link/feature.server.ts"],"names":[],"mappings":"AA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ACrC;IACE;;;QAGI;IACJ,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAA;IAG9B,kBAAkB,CAAC,EAAE,KAAK,CAAA;CAC3B,GACD;IAEE,mBAAmB,CAAC,EAAE,KAAK,CAAA;IAE3B;;;QAGI;IACJ,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;CAC9B,CAAA;AAEL,MAAM,MAAM,sBAAsB,GAAG,6BAA6B,GAAG;IACnE;;;OAGG;IACH,MAAM,CAAC,EACH,CAAC,CAAC,IAAI,EAAE;QACN,MAAM,EAAE,eAAe,CAAA;QACvB,aAAa,EAAE,+BAA+B,EAAE,CAAA;KACjD,KAAK,+BAA+B,EAAE,CAAC,GACxC,+BAA+B,EAAE,CAAA;CACtC,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,6BAA6B,CAAC,sBAAsB,EAAE,WAAW,CAmI1F,CAAA"}
@@ -1,33 +1,45 @@
1
1
  import { traverseFields } from '@payloadcms/next/utilities';
2
+ import { sanitizeFields } from 'payload/config';
3
+ import { deepCopyObject } from 'payload/utilities';
2
4
  import { convertLexicalNodesToHTML } from '../converters/html/converter/index.js';
5
+ import { createNode } from '../typeUtilities.js';
3
6
  import { LinkFeatureClientComponent } from './feature.client.js';
4
7
  import { AutoLinkNode } from './nodes/AutoLinkNode.js';
5
8
  import { LinkNode } from './nodes/LinkNode.js';
6
9
  import { transformExtraFields } from './plugins/floatingLinkEditor/utilities.js';
7
10
  import { linkPopulationPromiseHOC } from './populationPromise.js';
11
+ import { linkValidation } from './validate.js';
8
12
  export const LinkFeature = (props)=>{
9
13
  if (!props) {
10
14
  props = {};
11
15
  }
12
16
  return {
13
- feature: ()=>{
17
+ feature: async ({ config: _config })=>{
18
+ const validRelationships = _config.collections.map((c)=>c.slug) || [];
19
+ const _transformedFields = transformExtraFields(deepCopyObject(props.fields), _config, props.enabledCollections, props.disabledCollections);
20
+ const sanitizedFields = await sanitizeFields({
21
+ config: _config,
22
+ fields: _transformedFields,
23
+ requireFieldLevelRichTextEditor: true,
24
+ validRelationships
25
+ });
26
+ props.fields = sanitizedFields;
14
27
  return {
15
28
  ClientComponent: LinkFeatureClientComponent,
16
29
  clientFeatureProps: {
17
30
  disabledCollections: props.disabledCollections,
18
31
  enabledCollections: props.enabledCollections
19
32
  },
20
- generateSchemaMap: ({ config, i18n, props })=>{
21
- if (!props?.fields || !Array.isArray(props.fields) || props.fields.length === 0) {
33
+ generateSchemaMap: ({ config, i18n })=>{
34
+ if (!sanitizedFields || !Array.isArray(sanitizedFields) || sanitizedFields.length === 0) {
22
35
  return null;
23
36
  }
24
37
  const schemaMap = new Map();
25
38
  const validRelationships = config.collections.map((c)=>c.slug) || [];
26
- const transformedFields = transformExtraFields(props.fields, config, i18n, props.enabledCollections, props.disabledCollections);
27
- schemaMap.set('fields', transformedFields);
39
+ schemaMap.set('fields', sanitizedFields);
28
40
  traverseFields({
29
41
  config,
30
- fields: transformedFields,
42
+ fields: sanitizedFields,
31
43
  i18n,
32
44
  schemaMap,
33
45
  schemaPath: 'fields',
@@ -36,7 +48,7 @@ export const LinkFeature = (props)=>{
36
48
  return schemaMap;
37
49
  },
38
50
  nodes: [
39
- {
51
+ createNode({
40
52
  converters: {
41
53
  html: {
42
54
  converter: async ({ converters, node, parent, payload })=>{
@@ -61,12 +73,22 @@ export const LinkFeature = (props)=>{
61
73
  ]
62
74
  }
63
75
  },
76
+ hooks: {
77
+ afterRead: [
78
+ ({ node })=>{
79
+ return node;
80
+ }
81
+ ]
82
+ },
64
83
  node: AutoLinkNode,
65
84
  populationPromises: [
66
85
  linkPopulationPromiseHOC(props)
86
+ ],
87
+ validations: [
88
+ linkValidation(props)
67
89
  ]
68
- },
69
- {
90
+ }),
91
+ createNode({
70
92
  converters: {
71
93
  html: {
72
94
  converter: async ({ converters, node, parent, payload })=>{
@@ -91,8 +113,11 @@ export const LinkFeature = (props)=>{
91
113
  node: LinkNode,
92
114
  populationPromises: [
93
115
  linkPopulationPromiseHOC(props)
116
+ ],
117
+ validations: [
118
+ linkValidation(props)
94
119
  ]
95
- }
120
+ })
96
121
  ],
97
122
  serverFeatureProps: props
98
123
  };