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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (415) hide show
  1. package/dist/cell/index.d.ts +1 -1
  2. package/dist/cell/index.d.ts.map +1 -1
  3. package/dist/cell/index.js +2 -4
  4. package/dist/cell/index.js.map +1 -1
  5. package/dist/field/features/align/feature.client.d.ts.map +1 -1
  6. package/dist/field/features/align/feature.client.js +1 -2
  7. package/dist/field/features/align/feature.client.js.map +1 -1
  8. package/dist/field/features/blockquote/feature.client.d.ts.map +1 -1
  9. package/dist/field/features/blockquote/feature.client.js +3 -6
  10. package/dist/field/features/blockquote/feature.client.js.map +1 -1
  11. package/dist/field/features/blockquote/feature.server.d.ts.map +1 -1
  12. package/dist/field/features/blockquote/feature.server.js +4 -4
  13. package/dist/field/features/blockquote/feature.server.js.map +1 -1
  14. package/dist/field/features/blockquote/markdownTransformer.d.ts.map +1 -1
  15. package/dist/field/features/blockquote/markdownTransformer.js +2 -4
  16. package/dist/field/features/blockquote/markdownTransformer.js.map +1 -1
  17. package/dist/field/features/blocks/component/BlockContent.d.ts.map +1 -1
  18. package/dist/field/features/blocks/component/BlockContent.js +3 -5
  19. package/dist/field/features/blocks/component/BlockContent.js.map +1 -1
  20. package/dist/field/features/blocks/component/index.d.ts.map +1 -1
  21. package/dist/field/features/blocks/component/index.js +36 -3
  22. package/dist/field/features/blocks/component/index.js.map +1 -1
  23. package/dist/field/features/blocks/drawer/index.d.ts.map +1 -1
  24. package/dist/field/features/blocks/drawer/index.js +2 -4
  25. package/dist/field/features/blocks/drawer/index.js.map +1 -1
  26. package/dist/field/features/blocks/feature.server.d.ts.map +1 -1
  27. package/dist/field/features/blocks/feature.server.js +109 -77
  28. package/dist/field/features/blocks/feature.server.js.map +1 -1
  29. package/dist/field/features/blocks/nodes/BlocksNode.d.ts +1 -3
  30. package/dist/field/features/blocks/nodes/BlocksNode.d.ts.map +1 -1
  31. package/dist/field/features/blocks/nodes/BlocksNode.js +1 -2
  32. package/dist/field/features/blocks/nodes/BlocksNode.js.map +1 -1
  33. package/dist/field/features/blocks/plugin/commands.d.ts.map +1 -1
  34. package/dist/field/features/blocks/plugin/commands.js +1 -2
  35. package/dist/field/features/blocks/plugin/commands.js.map +1 -1
  36. package/dist/field/features/blocks/plugin/index.d.ts.map +1 -1
  37. package/dist/field/features/blocks/plugin/index.js +3 -6
  38. package/dist/field/features/blocks/plugin/index.js.map +1 -1
  39. package/dist/field/features/blocks/populationPromise.d.ts.map +1 -1
  40. package/dist/field/features/blocks/populationPromise.js +3 -18
  41. package/dist/field/features/blocks/populationPromise.js.map +1 -1
  42. package/dist/field/features/blocks/validate.d.ts.map +1 -1
  43. package/dist/field/features/blocks/validate.js +22 -36
  44. package/dist/field/features/blocks/validate.js.map +1 -1
  45. package/dist/field/features/converters/html/field/index.d.ts +8 -2
  46. package/dist/field/features/converters/html/field/index.d.ts.map +1 -1
  47. package/dist/field/features/converters/html/field/index.js +6 -3
  48. package/dist/field/features/converters/html/field/index.js.map +1 -1
  49. package/dist/field/features/debug/testrecorder/plugin/index.d.ts.map +1 -1
  50. package/dist/field/features/debug/testrecorder/plugin/index.js +2 -4
  51. package/dist/field/features/debug/testrecorder/plugin/index.js.map +1 -1
  52. package/dist/field/features/debug/treeview/plugin/index.d.ts.map +1 -1
  53. package/dist/field/features/debug/treeview/plugin/index.js +2 -4
  54. package/dist/field/features/debug/treeview/plugin/index.js.map +1 -1
  55. package/dist/field/features/format/bold/feature.client.d.ts.map +1 -1
  56. package/dist/field/features/format/bold/feature.client.js +1 -2
  57. package/dist/field/features/format/bold/feature.client.js.map +1 -1
  58. package/dist/field/features/format/inlinecode/feature.client.d.ts.map +1 -1
  59. package/dist/field/features/format/inlinecode/feature.client.js +1 -2
  60. package/dist/field/features/format/inlinecode/feature.client.js.map +1 -1
  61. package/dist/field/features/format/italic/feature.client.d.ts.map +1 -1
  62. package/dist/field/features/format/italic/feature.client.js +1 -2
  63. package/dist/field/features/format/italic/feature.client.js.map +1 -1
  64. package/dist/field/features/format/strikethrough/feature.client.d.ts.map +1 -1
  65. package/dist/field/features/format/strikethrough/feature.client.js +1 -2
  66. package/dist/field/features/format/strikethrough/feature.client.js.map +1 -1
  67. package/dist/field/features/format/subscript/feature.client.d.ts.map +1 -1
  68. package/dist/field/features/format/subscript/feature.client.js +1 -2
  69. package/dist/field/features/format/subscript/feature.client.js.map +1 -1
  70. package/dist/field/features/format/superscript/feature.client.d.ts.map +1 -1
  71. package/dist/field/features/format/superscript/feature.client.js +1 -2
  72. package/dist/field/features/format/superscript/feature.client.js.map +1 -1
  73. package/dist/field/features/format/underline/feature.client.d.ts.map +1 -1
  74. package/dist/field/features/format/underline/feature.client.js +1 -2
  75. package/dist/field/features/format/underline/feature.client.js.map +1 -1
  76. package/dist/field/features/heading/feature.client.d.ts.map +1 -1
  77. package/dist/field/features/heading/feature.client.js +3 -6
  78. package/dist/field/features/heading/feature.client.js.map +1 -1
  79. package/dist/field/features/heading/feature.server.d.ts.map +1 -1
  80. package/dist/field/features/heading/feature.server.js +5 -5
  81. package/dist/field/features/heading/feature.server.js.map +1 -1
  82. package/dist/field/features/heading/markdownTransformer.d.ts.map +1 -1
  83. package/dist/field/features/heading/markdownTransformer.js +1 -2
  84. package/dist/field/features/heading/markdownTransformer.js.map +1 -1
  85. package/dist/field/features/horizontalrule/component/index.d.ts +10 -0
  86. package/dist/field/features/horizontalrule/component/index.d.ts.map +1 -0
  87. package/dist/field/features/horizontalrule/component/index.js +62 -0
  88. package/dist/field/features/horizontalrule/component/index.js.map +1 -0
  89. package/dist/field/features/horizontalrule/feature.client.d.ts +3 -0
  90. package/dist/field/features/horizontalrule/feature.client.d.ts.map +1 -0
  91. package/dist/field/features/horizontalrule/feature.client.js +53 -0
  92. package/dist/field/features/horizontalrule/feature.client.js.map +1 -0
  93. package/dist/field/features/horizontalrule/feature.server.d.ts +3 -0
  94. package/dist/field/features/horizontalrule/feature.server.d.ts.map +1 -0
  95. package/dist/field/features/horizontalrule/feature.server.js +37 -0
  96. package/dist/field/features/horizontalrule/feature.server.js.map +1 -0
  97. package/dist/field/features/horizontalrule/markdownTransformer.d.ts +3 -0
  98. package/dist/field/features/horizontalrule/markdownTransformer.d.ts.map +1 -0
  99. package/dist/field/features/horizontalrule/markdownTransformer.js +23 -0
  100. package/dist/field/features/horizontalrule/markdownTransformer.js.map +1 -0
  101. package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.d.ts +53 -0
  102. package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.d.ts.map +1 -0
  103. package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.js +88 -0
  104. package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.js.map +1 -0
  105. package/dist/field/features/horizontalrule/plugin/index.d.ts +6 -0
  106. package/dist/field/features/horizontalrule/plugin/index.d.ts.map +1 -0
  107. package/dist/field/features/horizontalrule/plugin/index.js +31 -0
  108. package/dist/field/features/horizontalrule/plugin/index.js.map +1 -0
  109. package/dist/field/features/horizontalrule/plugin/index.scss +20 -0
  110. package/dist/field/features/indent/feature.client.d.ts.map +1 -1
  111. package/dist/field/features/indent/feature.client.js +1 -2
  112. package/dist/field/features/indent/feature.client.js.map +1 -1
  113. package/dist/field/features/link/drawer/baseFields.d.ts +3 -3
  114. package/dist/field/features/link/drawer/baseFields.d.ts.map +1 -1
  115. package/dist/field/features/link/drawer/baseFields.js +28 -42
  116. package/dist/field/features/link/drawer/baseFields.js.map +1 -1
  117. package/dist/field/features/link/drawer/index.js +3 -2
  118. package/dist/field/features/link/drawer/index.js.map +1 -1
  119. package/dist/field/features/link/drawer/types.d.ts +4 -2
  120. package/dist/field/features/link/drawer/types.d.ts.map +1 -1
  121. package/dist/field/features/link/drawer/types.js.map +1 -1
  122. package/dist/field/features/link/feature.client.d.ts.map +1 -1
  123. package/dist/field/features/link/feature.client.js +2 -4
  124. package/dist/field/features/link/feature.client.js.map +1 -1
  125. package/dist/field/features/link/feature.server.d.ts +0 -2
  126. package/dist/field/features/link/feature.server.d.ts.map +1 -1
  127. package/dist/field/features/link/feature.server.js +48 -9
  128. package/dist/field/features/link/feature.server.js.map +1 -1
  129. package/dist/field/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  130. package/dist/field/features/link/nodes/AutoLinkNode.js +1 -2
  131. package/dist/field/features/link/nodes/AutoLinkNode.js.map +1 -1
  132. package/dist/field/features/link/nodes/LinkNode.d.ts +1 -3
  133. package/dist/field/features/link/nodes/LinkNode.d.ts.map +1 -1
  134. package/dist/field/features/link/nodes/LinkNode.js +2 -4
  135. package/dist/field/features/link/nodes/LinkNode.js.map +1 -1
  136. package/dist/field/features/link/plugins/autoLink/index.d.ts.map +1 -1
  137. package/dist/field/features/link/plugins/autoLink/index.js +3 -6
  138. package/dist/field/features/link/plugins/autoLink/index.js.map +1 -1
  139. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.d.ts.map +1 -1
  140. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.js +1 -2
  141. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.js.map +1 -1
  142. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  143. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js +56 -39
  144. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  145. package/dist/field/features/link/plugins/floatingLinkEditor/index.scss +9 -1
  146. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts +3 -5
  147. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts.map +1 -1
  148. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js +11 -29
  149. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js.map +1 -1
  150. package/dist/field/features/link/plugins/link/index.d.ts.map +1 -1
  151. package/dist/field/features/link/plugins/link/index.js +3 -12
  152. package/dist/field/features/link/plugins/link/index.js.map +1 -1
  153. package/dist/field/features/link/populationPromise.d.ts.map +1 -1
  154. package/dist/field/features/link/populationPromise.js +9 -25
  155. package/dist/field/features/link/populationPromise.js.map +1 -1
  156. package/dist/field/features/link/validate.d.ts +5 -0
  157. package/dist/field/features/link/validate.d.ts.map +1 -0
  158. package/dist/field/features/link/validate.js +32 -0
  159. package/dist/field/features/link/validate.js.map +1 -0
  160. package/dist/field/features/lists/checklist/feature.client.d.ts.map +1 -1
  161. package/dist/field/features/lists/checklist/feature.client.js +1 -2
  162. package/dist/field/features/lists/checklist/feature.client.js.map +1 -1
  163. package/dist/field/features/lists/checklist/feature.server.d.ts.map +1 -1
  164. package/dist/field/features/lists/checklist/feature.server.js +6 -6
  165. package/dist/field/features/lists/checklist/feature.server.js.map +1 -1
  166. package/dist/field/features/lists/checklist/markdownTransformers.d.ts.map +1 -1
  167. package/dist/field/features/lists/checklist/markdownTransformers.js +1 -2
  168. package/dist/field/features/lists/checklist/markdownTransformers.js.map +1 -1
  169. package/dist/field/features/lists/checklist/plugin/index.d.ts.map +1 -1
  170. package/dist/field/features/lists/checklist/plugin/index.js +1 -2
  171. package/dist/field/features/lists/checklist/plugin/index.js.map +1 -1
  172. package/dist/field/features/lists/common/markdown.d.ts.map +1 -1
  173. package/dist/field/features/lists/common/markdown.js +1 -2
  174. package/dist/field/features/lists/common/markdown.js.map +1 -1
  175. package/dist/field/features/lists/htmlConverter.d.ts.map +1 -1
  176. package/dist/field/features/lists/htmlConverter.js +13 -6
  177. package/dist/field/features/lists/htmlConverter.js.map +1 -1
  178. package/dist/field/features/lists/orderedlist/feature.client.d.ts.map +1 -1
  179. package/dist/field/features/lists/orderedlist/feature.client.js +1 -2
  180. package/dist/field/features/lists/orderedlist/feature.client.js.map +1 -1
  181. package/dist/field/features/lists/orderedlist/feature.server.d.ts.map +1 -1
  182. package/dist/field/features/lists/orderedlist/feature.server.js +6 -6
  183. package/dist/field/features/lists/orderedlist/feature.server.js.map +1 -1
  184. package/dist/field/features/lists/orderedlist/markdownTransformer.d.ts.map +1 -1
  185. package/dist/field/features/lists/orderedlist/markdownTransformer.js +1 -2
  186. package/dist/field/features/lists/orderedlist/markdownTransformer.js.map +1 -1
  187. package/dist/field/features/lists/plugin/index.d.ts.map +1 -1
  188. package/dist/field/features/lists/plugin/index.js +1 -2
  189. package/dist/field/features/lists/plugin/index.js.map +1 -1
  190. package/dist/field/features/lists/unorderedlist/feature.client.d.ts.map +1 -1
  191. package/dist/field/features/lists/unorderedlist/feature.client.js +1 -2
  192. package/dist/field/features/lists/unorderedlist/feature.client.js.map +1 -1
  193. package/dist/field/features/lists/unorderedlist/feature.server.d.ts.map +1 -1
  194. package/dist/field/features/lists/unorderedlist/feature.server.js +6 -6
  195. package/dist/field/features/lists/unorderedlist/feature.server.js.map +1 -1
  196. package/dist/field/features/lists/unorderedlist/markdownTransformer.d.ts.map +1 -1
  197. package/dist/field/features/lists/unorderedlist/markdownTransformer.js +1 -2
  198. package/dist/field/features/lists/unorderedlist/markdownTransformer.js.map +1 -1
  199. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.d.ts.map +1 -1
  200. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js +2 -4
  201. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js.map +1 -1
  202. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts +1 -3
  203. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  204. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +2 -4
  205. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  206. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.d.ts.map +1 -1
  207. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.js +2 -4
  208. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.js.map +1 -1
  209. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.d.ts.map +1 -1
  210. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.js +2 -4
  211. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.js.map +1 -1
  212. package/dist/field/features/migrations/slateToLexical/converter/index.d.ts.map +1 -1
  213. package/dist/field/features/migrations/slateToLexical/converter/index.js +2 -1
  214. package/dist/field/features/migrations/slateToLexical/converter/index.js.map +1 -1
  215. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts +1 -3
  216. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  217. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +2 -4
  218. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  219. package/dist/field/features/paragraph/feature.client.d.ts.map +1 -1
  220. package/dist/field/features/paragraph/feature.client.js +2 -4
  221. package/dist/field/features/paragraph/feature.client.js.map +1 -1
  222. package/dist/field/features/relationship/drawer/commands.d.ts.map +1 -1
  223. package/dist/field/features/relationship/drawer/commands.js +1 -2
  224. package/dist/field/features/relationship/drawer/commands.js.map +1 -1
  225. package/dist/field/features/relationship/drawer/index.d.ts.map +1 -1
  226. package/dist/field/features/relationship/drawer/index.js +7 -13
  227. package/dist/field/features/relationship/drawer/index.js.map +1 -1
  228. package/dist/field/features/relationship/feature.server.d.ts.map +1 -1
  229. package/dist/field/features/relationship/feature.server.js +3 -2
  230. package/dist/field/features/relationship/feature.server.js.map +1 -1
  231. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts +3 -8
  232. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts.map +1 -1
  233. package/dist/field/features/relationship/nodes/RelationshipNode.js +8 -8
  234. package/dist/field/features/relationship/nodes/RelationshipNode.js.map +1 -1
  235. package/dist/field/features/relationship/nodes/components/RelationshipComponent.d.ts.map +1 -1
  236. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js +54 -7
  237. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js.map +1 -1
  238. package/dist/field/features/relationship/plugins/index.d.ts.map +1 -1
  239. package/dist/field/features/relationship/plugins/index.js +3 -6
  240. package/dist/field/features/relationship/plugins/index.js.map +1 -1
  241. package/dist/field/features/relationship/populationPromise.js +7 -6
  242. package/dist/field/features/relationship/populationPromise.js.map +1 -1
  243. package/dist/field/features/typeUtilities.d.ts +8 -0
  244. package/dist/field/features/typeUtilities.d.ts.map +1 -0
  245. package/dist/field/features/typeUtilities.js +8 -0
  246. package/dist/field/features/typeUtilities.js.map +1 -0
  247. package/dist/field/features/types.d.ts +57 -33
  248. package/dist/field/features/types.d.ts.map +1 -1
  249. package/dist/field/features/types.js.map +1 -1
  250. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.d.ts.map +1 -1
  251. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js +5 -6
  252. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js.map +1 -1
  253. package/dist/field/features/upload/component/index.d.ts.map +1 -1
  254. package/dist/field/features/upload/component/index.js +55 -9
  255. package/dist/field/features/upload/component/index.js.map +1 -1
  256. package/dist/field/features/upload/drawer/commands.d.ts.map +1 -1
  257. package/dist/field/features/upload/drawer/commands.js +1 -2
  258. package/dist/field/features/upload/drawer/commands.js.map +1 -1
  259. package/dist/field/features/upload/drawer/index.d.ts.map +1 -1
  260. package/dist/field/features/upload/drawer/index.js +8 -12
  261. package/dist/field/features/upload/drawer/index.js.map +1 -1
  262. package/dist/field/features/upload/feature.server.d.ts.map +1 -1
  263. package/dist/field/features/upload/feature.server.js +39 -11
  264. package/dist/field/features/upload/feature.server.js.map +1 -1
  265. package/dist/field/features/upload/nodes/UploadNode.d.ts +2 -14
  266. package/dist/field/features/upload/nodes/UploadNode.d.ts.map +1 -1
  267. package/dist/field/features/upload/nodes/UploadNode.js +6 -9
  268. package/dist/field/features/upload/nodes/UploadNode.js.map +1 -1
  269. package/dist/field/features/upload/plugin/index.d.ts +2 -2
  270. package/dist/field/features/upload/plugin/index.d.ts.map +1 -1
  271. package/dist/field/features/upload/plugin/index.js +4 -9
  272. package/dist/field/features/upload/plugin/index.js.map +1 -1
  273. package/dist/field/features/upload/populationPromise.js +11 -8
  274. package/dist/field/features/upload/populationPromise.js.map +1 -1
  275. package/dist/field/features/upload/validate.d.ts +2 -1
  276. package/dist/field/features/upload/validate.d.ts.map +1 -1
  277. package/dist/field/features/upload/validate.js +34 -12
  278. package/dist/field/features/upload/validate.js.map +1 -1
  279. package/dist/field/index.d.ts +1 -1
  280. package/dist/field/index.d.ts.map +1 -1
  281. package/dist/field/index.js.map +1 -1
  282. package/dist/field/lexical/LexicalEditor.d.ts.map +1 -1
  283. package/dist/field/lexical/LexicalEditor.js +6 -11
  284. package/dist/field/lexical/LexicalEditor.js.map +1 -1
  285. package/dist/field/lexical/LexicalProvider.d.ts +1 -1
  286. package/dist/field/lexical/LexicalProvider.d.ts.map +1 -1
  287. package/dist/field/lexical/LexicalProvider.js +1 -2
  288. package/dist/field/lexical/LexicalProvider.js.map +1 -1
  289. package/dist/field/lexical/config/client/default.d.ts +1 -1
  290. package/dist/field/lexical/config/client/default.d.ts.map +1 -1
  291. package/dist/field/lexical/config/client/default.js.map +1 -1
  292. package/dist/field/lexical/config/client/sanitize.d.ts +1 -1
  293. package/dist/field/lexical/config/client/sanitize.d.ts.map +1 -1
  294. package/dist/field/lexical/config/client/sanitize.js.map +1 -1
  295. package/dist/field/lexical/config/server/default.d.ts +2 -3
  296. package/dist/field/lexical/config/server/default.d.ts.map +1 -1
  297. package/dist/field/lexical/config/server/default.js +3 -3
  298. package/dist/field/lexical/config/server/default.js.map +1 -1
  299. package/dist/field/lexical/config/server/loader.d.ts +4 -2
  300. package/dist/field/lexical/config/server/loader.d.ts.map +1 -1
  301. package/dist/field/lexical/config/server/loader.js +3 -2
  302. package/dist/field/lexical/config/server/loader.js.map +1 -1
  303. package/dist/field/lexical/config/server/sanitize.d.ts +2 -1
  304. package/dist/field/lexical/config/server/sanitize.d.ts.map +1 -1
  305. package/dist/field/lexical/config/server/sanitize.js +23 -8
  306. package/dist/field/lexical/config/server/sanitize.js.map +1 -1
  307. package/dist/field/lexical/config/types.d.ts +1 -1
  308. package/dist/field/lexical/config/types.d.ts.map +1 -1
  309. package/dist/field/lexical/config/types.js.map +1 -1
  310. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.d.ts.map +1 -1
  311. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.js +3 -6
  312. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.js.map +1 -1
  313. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.d.ts.map +1 -1
  314. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.js +3 -6
  315. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.js.map +1 -1
  316. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.d.ts.map +1 -1
  317. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.js +27 -29
  318. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.js.map +1 -1
  319. package/dist/field/lexical/plugins/MarkdownShortcut/index.d.ts.map +1 -1
  320. package/dist/field/lexical/plugins/MarkdownShortcut/index.js +1 -2
  321. package/dist/field/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  322. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  323. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +3 -6
  324. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  325. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts.map +1 -1
  326. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +3 -6
  327. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
  328. package/dist/field/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
  329. package/dist/field/lexical/plugins/SlashMenu/index.js +1 -2
  330. package/dist/field/lexical/plugins/SlashMenu/index.js.map +1 -1
  331. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts.map +1 -1
  332. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js +13 -10
  333. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  334. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.d.ts.map +1 -1
  335. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js +1 -2
  336. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js.map +1 -1
  337. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  338. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js +10 -7
  339. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  340. package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.d.ts +9 -0
  341. package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.d.ts.map +1 -0
  342. package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.js +35 -0
  343. package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.js.map +1 -0
  344. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.d.ts.map +1 -1
  345. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.js +1 -2
  346. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.js.map +1 -1
  347. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.d.ts +1 -1
  348. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
  349. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js +17 -7
  350. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  351. package/dist/field/lexical/theme/EditorTheme.scss +11 -8
  352. package/dist/field/lexical/ui/ContentEditable.d.ts.map +1 -1
  353. package/dist/field/lexical/ui/ContentEditable.js +1 -2
  354. package/dist/field/lexical/ui/ContentEditable.js.map +1 -1
  355. package/dist/field/lexical/ui/icons/HorizontalRule/index.d.ts +3 -0
  356. package/dist/field/lexical/ui/icons/HorizontalRule/index.d.ts.map +1 -0
  357. package/dist/field/lexical/ui/icons/HorizontalRule/index.js +19 -0
  358. package/dist/field/lexical/ui/icons/HorizontalRule/index.js.map +1 -0
  359. package/dist/field/lexical/utils/getSelectedNode.d.ts.map +1 -1
  360. package/dist/field/lexical/utils/getSelectedNode.js +1 -2
  361. package/dist/field/lexical/utils/getSelectedNode.js.map +1 -1
  362. package/dist/field/lexical/utils/nodeFormat.d.ts +2 -1
  363. package/dist/field/lexical/utils/nodeFormat.d.ts.map +1 -1
  364. package/dist/field/lexical/utils/nodeFormat.js.map +1 -1
  365. package/dist/field/lexical/utils/setFloatingElemPosition.d.ts +1 -1
  366. package/dist/field/lexical/utils/setFloatingElemPosition.d.ts.map +1 -1
  367. package/dist/field/lexical/utils/setFloatingElemPosition.js +15 -13
  368. package/dist/field/lexical/utils/setFloatingElemPosition.js.map +1 -1
  369. package/dist/field/lexical/utils/url.d.ts.map +1 -1
  370. package/dist/field/lexical/utils/url.js +3 -0
  371. package/dist/field/lexical/utils/url.js.map +1 -1
  372. package/dist/forEachNodeRecursively.d.ts +10 -0
  373. package/dist/forEachNodeRecursively.d.ts.map +1 -0
  374. package/dist/forEachNodeRecursively.js +24 -0
  375. package/dist/forEachNodeRecursively.js.map +1 -0
  376. package/dist/generateComponentMap.d.ts.map +1 -1
  377. package/dist/generateComponentMap.js +16 -22
  378. package/dist/generateComponentMap.js.map +1 -1
  379. package/dist/generateSchemaMap.d.ts.map +1 -1
  380. package/dist/generateSchemaMap.js +4 -12
  381. package/dist/generateSchemaMap.js.map +1 -1
  382. package/dist/index.d.ts +6 -5
  383. package/dist/index.d.ts.map +1 -1
  384. package/dist/index.js +260 -173
  385. package/dist/index.js.map +1 -1
  386. package/dist/populate/defaultValue.d.ts.map +1 -1
  387. package/dist/populate/defaultValue.js +1 -0
  388. package/dist/populate/defaultValue.js.map +1 -1
  389. package/dist/populate/populate.d.ts +3 -3
  390. package/dist/populate/populate.d.ts.map +1 -1
  391. package/dist/populate/populate.js.map +1 -1
  392. package/dist/populate/populateLexicalPopulationPromises.d.ts +12 -0
  393. package/dist/populate/populateLexicalPopulationPromises.d.ts.map +1 -0
  394. package/dist/populate/populateLexicalPopulationPromises.js +35 -0
  395. package/dist/populate/populateLexicalPopulationPromises.js.map +1 -0
  396. package/dist/populate/recurseNestedFields.d.ts +7 -4
  397. package/dist/populate/recurseNestedFields.d.ts.map +1 -1
  398. package/dist/populate/recurseNestedFields.js +3 -5
  399. package/dist/populate/recurseNestedFields.js.map +1 -1
  400. package/dist/scss/app.scss +2 -3
  401. package/dist/scss/vars.scss +0 -7
  402. package/dist/types.d.ts +11 -5
  403. package/dist/types.d.ts.map +1 -1
  404. package/dist/types.js.map +1 -1
  405. package/dist/validate/index.d.ts +1 -1
  406. package/dist/validate/index.d.ts.map +1 -1
  407. package/package.json +47 -46
  408. package/components.d.ts +0 -6
  409. package/components.js +0 -7
  410. package/dist/populate/richTextRelationshipPromise.d.ts +0 -23
  411. package/dist/populate/richTextRelationshipPromise.d.ts.map +0 -1
  412. package/dist/populate/richTextRelationshipPromise.js +0 -68
  413. package/dist/populate/richTextRelationshipPromise.js.map +0 -1
  414. package/dist/scss/fonts.scss +0 -75
  415. package/src/index.ts +0 -423
@@ -1,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;;;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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9CsB,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,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;YACpBC,UAAU;QACZ;QACA;YACEJ,MAAM;YACNC,MAAM;YACNL,OAAO;gBACLS,aAAa,CAAC,EAAEF,CAAC,EAAE,GAAKA,EAAE;YAC5B;YACAG,cAAc;YACdJ,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;YACpBI,SAAS;gBACP;oBACEL,OAAO,CAAC,EAAEC,CAAC,EAAE,G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, handleModalSubmit, stateData })=>{
84
84
  }, /*#__PURE__*/ React.createElement(RenderFields, {
85
85
  fieldMap: Array.isArray(fieldMap) ? fieldMap : [],
86
86
  forceRender: true,
87
- path: "",
87
+ path: "" // See Blocks feature path for details as for why this is empty
88
+ ,
88
89
  readOnly: false,
89
- schemaPath: ""
90
+ schemaPath: schemaFieldsPath
90
91
  }), /*#__PURE__*/ React.createElement(FormSubmit, null, t('general:submit'))));
91
92
  };
92
93
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/link/drawer/index.tsx"],"sourcesContent":["import type { FormProps } from '@payloadcms/ui/forms/Form'\nimport type { FormState } from 'payload/types'\n\nimport { Drawer } from '@payloadcms/ui/elements/Drawer'\nimport { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'\nimport { Form } from '@payloadcms/ui/forms/Form'\nimport { RenderFields } from '@payloadcms/ui/forms/RenderFields'\nimport { FormSubmit } from '@payloadcms/ui/forms/Submit'\nimport { useConfig } from '@payloadcms/ui/providers/Config'\nimport { useDocumentInfo } from '@payloadcms/ui/providers/DocumentInfo'\nimport { useTranslation } from '@payloadcms/ui/providers/Translation'\nimport { getFormState } from '@payloadcms/ui/utilities/getFormState'\nimport React, { useCallback, useEffect, useState } from 'react'\nimport { v4 as uuid } from 'uuid'\n\nimport { useEditorConfigContext } from '../../../lexical/config/client/EditorConfigProvider.js'\nimport './index.scss'\nimport { type Props } from './types.js'\n\nconst baseClass = 'lexical-link-edit-drawer'\n\nexport const LinkDrawer: React.FC<Props> = ({ drawerSlug, handleModalSubmit, stateData }) => {\n const { t } = useTranslation()\n const { id } = useDocumentInfo()\n const { schemaPath } = useFieldProps()\n const config = useConfig()\n const [initialState, setInitialState] = useState<FormState | false>(false)\n const {\n field: { richTextComponentMap },\n } = useEditorConfigContext()\n\n const componentMapRenderedFieldsPath = `feature.link.fields.fields`\n const schemaFieldsPath = `${schemaPath}.feature.link.fields`\n\n const fieldMap = richTextComponentMap.get(componentMapRenderedFieldsPath) // Field Schema\n\n useEffect(() => {\n const awaitInitialState = async () => {\n const state = await getFormState({\n apiRoute: config.routes.api,\n body: {\n id,\n data: stateData,\n operation: 'update',\n schemaPath: schemaFieldsPath,\n },\n serverURL: config.serverURL,\n }) // Form State\n\n setInitialState(state)\n }\n\n if (stateData) {\n void awaitInitialState()\n }\n }, [config.routes.api, config.serverURL, schemaFieldsPath, id, stateData])\n\n const onChange: FormProps['onChange'][0] = useCallback(\n async ({ formState: prevFormState }) => {\n return await getFormState({\n apiRoute: config.routes.api,\n body: {\n id,\n formState: prevFormState,\n operation: 'update',\n schemaPath: schemaFieldsPath,\n },\n serverURL: config.serverURL,\n })\n },\n\n [config.routes.api, config.serverURL, schemaFieldsPath, id],\n )\n\n return (\n <Drawer className={baseClass} slug={drawerSlug} title={t('fields:editLink') ?? ''}>\n {initialState !== false && (\n <Form\n beforeSubmit={[onChange]}\n disableValidationOnSubmit\n fields={Array.isArray(fieldMap) ? fieldMap : []}\n initialState={initialState}\n onChange={[onChange]}\n onSubmit={handleModalSubmit}\n uuid={uuid()}\n >\n <RenderFields\n fieldMap={Array.isArray(fieldMap) ? fieldMap : []}\n forceRender\n path=\"\"\n readOnly={false}\n schemaPath=\"\"\n />\n\n <FormSubmit>{t('general:submit')}</FormSubmit>\n </Form>\n )}\n </Drawer>\n )\n}\n"],"names":["Drawer","useFieldProps","Form","RenderFields","FormSubmit","useConfig","useDocumentInfo","useTranslation","getFormState","React","useCallback","useEffect","useState","v4","uuid","useEditorConfigContext","baseClass","LinkDrawer","drawerSlug","handleModalSubmit","stateData","t","id","schemaPath","config","initialState","setInitialState","field","richTextComponentMap","componentMapRenderedFieldsPath","schemaFieldsPath","fieldMap","get","awaitInitialState","state","apiRoute","routes","api","body","data","operation","serverURL","onChange","formState","prevFormState","className","slug","title","beforeSubmit","disableValidationOnSubmit","fields","Array","isArray","onSubmit","forceRender","path","readOnly"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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gBACd;gBACAW,WAAWjB,OAAOiB,SAAS;YAC7B,GAAG,aAAa;;YAEhBf,gBAAgBQ;QAClB;QAEA,IAAId,WAAW;YACb,KAAKa;QACP;IACF,GAAG;QAACT,OAAOY,MAAM,CAACC,GAAG;QAAEb,OAAOiB,SAAS;QAAEX;QAAkBR;QAAIF;KAAU;IAEzE,MAAMsB,WAAqChC,YACzC,OAAO,EAAEiC,WAAWC,aAAa,EAAE;QACjC,OAAO,MAAMpC,aAAa;YACxB2B,UAAUX,OAAOY,MAAM,CAACC,GAAG;YAC3BC,MAAM;gBACJhB;gBACAqB,WAAWC;gBACXJ,WAAW;gBACXjB,YAAYO;YACd;YACAW,WAAWjB,OAAOiB,SAAS;QAC7B;IACF,GAEA;QAACjB,OAAOY,MAAM,CAACC,GAAG;QAAEb,OAAOiB,SAAS;QAAEX;QAAkBR;KAAG;IAG7D,qBACE,oBAACtB;QAAO6C,WAAW7B;QAAW8B,MAAM5B;QAAY6B,OAAO1B,EAAE,sBAAsB;OAC5EI,iBAAiB,uBAChB,oBAACvB;QACC8C,cAAc;YAACN;SAAS;QACxBO,2BAAAA;QACAC,QAAQC,MAAMC,OAAO,CAACrB,YAAYA,WAAW,EAAE;QAC/CN,cAAcA;QACdiB,UAAU;YAACA;SAAS;QACpBW,UAAUlC;QACVL,MAAMA;qBAEN,oBAACX;QACC4B,UAAUoB,MAAMC,OAAO,CAACrB,YAAYA,WAAW,EAAE;QACjDuB,aAAAA;QACAC,MAAK;QACLC,UAAU;QACVjC,YAAW;sBAGb,oBAACnB,kBAAYiB,EAAE;AAKzB,EAAC"}
1
+ {"version":3,"sources":["../../../../../src/field/features/link/drawer/index.tsx"],"sourcesContent":["import type { FormProps } from '@payloadcms/ui/forms/Form'\nimport type { FormState } from 'payload/types'\n\nimport { Drawer } from '@payloadcms/ui/elements/Drawer'\nimport { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'\nimport { Form } from '@payloadcms/ui/forms/Form'\nimport { RenderFields } from '@payloadcms/ui/forms/RenderFields'\nimport { FormSubmit } from '@payloadcms/ui/forms/Submit'\nimport { useConfig } from '@payloadcms/ui/providers/Config'\nimport { useDocumentInfo } from '@payloadcms/ui/providers/DocumentInfo'\nimport { useTranslation } from '@payloadcms/ui/providers/Translation'\nimport { getFormState } from '@payloadcms/ui/utilities/getFormState'\nimport React, { useCallback, useEffect, useState } from 'react'\nimport { v4 as uuid } from 'uuid'\n\nimport { useEditorConfigContext } from '../../../lexical/config/client/EditorConfigProvider.js'\nimport './index.scss'\nimport { type Props } from './types.js'\n\nconst baseClass = 'lexical-link-edit-drawer'\n\nexport const LinkDrawer: React.FC<Props> = ({ drawerSlug, handleModalSubmit, stateData }) => {\n const { t } = useTranslation()\n const { id } = useDocumentInfo()\n const { schemaPath } = useFieldProps()\n const config = useConfig()\n const [initialState, setInitialState] = useState<FormState | false>(false)\n const {\n field: { richTextComponentMap },\n } = useEditorConfigContext()\n\n const componentMapRenderedFieldsPath = `feature.link.fields.fields`\n const schemaFieldsPath = `${schemaPath}.feature.link.fields`\n\n const fieldMap = richTextComponentMap.get(componentMapRenderedFieldsPath) // Field Schema\n\n useEffect(() => {\n const awaitInitialState = async () => {\n const state = await getFormState({\n apiRoute: config.routes.api,\n body: {\n id,\n data: stateData,\n operation: 'update',\n schemaPath: schemaFieldsPath,\n },\n serverURL: config.serverURL,\n }) // Form State\n\n setInitialState(state)\n }\n\n if (stateData) {\n void awaitInitialState()\n }\n }, [config.routes.api, config.serverURL, schemaFieldsPath, id, stateData])\n\n const onChange: FormProps['onChange'][0] = useCallback(\n async ({ formState: prevFormState }) => {\n return await getFormState({\n apiRoute: config.routes.api,\n body: {\n id,\n formState: prevFormState,\n operation: 'update',\n schemaPath: schemaFieldsPath,\n },\n serverURL: config.serverURL,\n })\n },\n\n [config.routes.api, config.serverURL, schemaFieldsPath, id],\n )\n\n return (\n <Drawer className={baseClass} slug={drawerSlug} title={t('fields:editLink') ?? ''}>\n {initialState !== false && (\n <Form\n beforeSubmit={[onChange]}\n disableValidationOnSubmit\n fields={Array.isArray(fieldMap) ? fieldMap : []}\n initialState={initialState}\n onChange={[onChange]}\n onSubmit={handleModalSubmit}\n uuid={uuid()}\n >\n <RenderFields\n fieldMap={Array.isArray(fieldMap) ? fieldMap : []}\n forceRender\n path=\"\" // See Blocks feature path for details as for why this is empty\n readOnly={false}\n schemaPath={schemaFieldsPath}\n />\n\n <FormSubmit>{t('general:submit')}</FormSubmit>\n </Form>\n )}\n </Drawer>\n )\n}\n"],"names":["Drawer","useFieldProps","Form","RenderFields","FormSubmit","useConfig","useDocumentInfo","useTranslation","getFormState","React","useCallback","useEffect","useState","v4","uuid","useEditorConfigContext","baseClass","LinkDrawer","drawerSlug","handleModalSubmit","stateData","t","id","schemaPath","config","initialState","setInitialState","field","richTextComponentMap","componentMapRenderedFieldsPath","schemaFieldsPath","fieldMap","get","awaitInitialState","state","apiRoute","routes","api","body","data","operation","serverURL","onChange","formState","prevFormState","className","slug","title","beforeSubmit","disableValidationOnSubmit","fields","Array","isArray","onSubmit","forceRender","path","readOnly"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAGA,SAASA,MAAM,QAAQ,iCAAgC;AACvD,SAASC,aAAa,QAAQ,0CAAyC;AACvE,SAASC,IAAI,QAAQ,4BAA2B;AAChD,SAASC,YAAY,QAAQ,oCAAmC;AAChE,SAASC,UAAU,QAAQ,8BAA6B;AACxD,SAASC,SAAS,QAAQ,kCAAiC;AAC3D,SAASC,eAAe,QAAQ,wCAAuC;AACvE,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,YAAY,QAAQ,wCAAuC;AACpE,OAAOC,SAASC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AAC/D,SAASC,MAAMC,IAAI,QAAQ,OAAM;AAEjC,SAASC,sBAAsB,QAAQ,yDA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AAEX;QAAkBR;KAAG;IAG7D,qBACE,oBAACtB;QAAO6C,WAAW7B;QAAW8B,MAAM5B;QAAY6B,OAAO1B,EAAE,sBAAsB;OAC5EI,iBAAiB,uBAChB,oBAACvB;QACC8C,cAAc;YAACN;SAAS;QACxBO,2BAAAA;QACAC,QAAQC,MAAMC,OAAO,CAACrB,YAAYA,WAAW,EAAE;QAC/CN,cAAcA;QACdiB,UAAU;YAACA;SAAS;QACpBW,UAAUlC;QACVL,MAAMA;qBAEN,oBAACX;QACC4B,UAAUoB,MAAMC,OAAO,CAACrB,YAAYA,WAAW,EAAE;QACjDuB,aAAAA;QACAC,MAAK,GAAG,+DAA+D;;QACvEC,UAAU;QACVjC,YAAYO;sBAGd,oBAAC1B,kBAAYiB,EAAE;AAKzB,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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,OAAOA,wBAAwB,iBAAgB;AAC/C,MAAM,EAAEC,mBAAmB,EAAE,GAAGD;AAEhC,OAAOE,mBAAmB,UAAS;AACnC,MAAM,EAAEC,aAAa,EAAEC,iBAAiB,EAAE,GAAGF;AAM7C,SAASG,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,aAAa3B,oBAAoB0B,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
+ {"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":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,eAAe,CAAA;AAGpE,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAA;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAUtD,MAAM,MAAM,6BAA6B,GACrC;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;QAChD,IAAI,EAAE,IAAI,CAAA;KACX,KAAK,+BAA+B,EAAE,CAAC,GACxC,+BAA+B,EAAE,CAAA;CACtC,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,6BAA6B,CAAC,sBAAsB,EAAE,WAAW,CA8F1F,CAAA"}
1
+ {"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../../src/field/features/link/feature.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAC7D,OAAO,KAAK,EAAS,+BAA+B,EAAE,MAAM,eAAe,CAAA;AAM3E,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAA;AAChE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAWtD,MAAM,MAAM,6BAA6B,GACrC;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,28 +1,54 @@
1
+ import { traverseFields } from '@payloadcms/next/utilities';
2
+ import { sanitizeFields } from 'payload/config';
3
+ import { deepCopyObject } from 'payload/utilities';
1
4
  import { convertLexicalNodesToHTML } from '../converters/html/converter/index.js';
5
+ import { createNode } from '../typeUtilities.js';
2
6
  import { LinkFeatureClientComponent } from './feature.client.js';
3
7
  import { AutoLinkNode } from './nodes/AutoLinkNode.js';
4
8
  import { LinkNode } from './nodes/LinkNode.js';
5
9
  import { transformExtraFields } from './plugins/floatingLinkEditor/utilities.js';
6
10
  import { linkPopulationPromiseHOC } from './populationPromise.js';
11
+ import { linkValidation } from './validate.js';
7
12
  export const LinkFeature = (props)=>{
8
13
  if (!props) {
9
14
  props = {};
10
15
  }
11
16
  return {
12
- 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;
13
27
  return {
14
28
  ClientComponent: LinkFeatureClientComponent,
15
29
  clientFeatureProps: {
16
30
  disabledCollections: props.disabledCollections,
17
31
  enabledCollections: props.enabledCollections
18
32
  },
19
- generateSchemaMap: ({ config, i18n, props })=>{
20
- return {
21
- fields: transformExtraFields(props.fields, config, i18n, props.enabledCollections, props.disabledCollections)
22
- };
33
+ generateSchemaMap: ({ config, i18n })=>{
34
+ if (!sanitizedFields || !Array.isArray(sanitizedFields) || sanitizedFields.length === 0) {
35
+ return null;
36
+ }
37
+ const schemaMap = new Map();
38
+ const validRelationships = config.collections.map((c)=>c.slug) || [];
39
+ schemaMap.set('fields', sanitizedFields);
40
+ traverseFields({
41
+ config,
42
+ fields: sanitizedFields,
43
+ i18n,
44
+ schemaMap,
45
+ schemaPath: 'fields',
46
+ validRelationships
47
+ });
48
+ return schemaMap;
23
49
  },
24
50
  nodes: [
25
- {
51
+ createNode({
26
52
  converters: {
27
53
  html: {
28
54
  converter: async ({ converters, node, parent, payload })=>{
@@ -47,12 +73,22 @@ export const LinkFeature = (props)=>{
47
73
  ]
48
74
  }
49
75
  },
76
+ hooks: {
77
+ afterRead: [
78
+ ({ node })=>{
79
+ return node;
80
+ }
81
+ ]
82
+ },
50
83
  node: AutoLinkNode,
51
84
  populationPromises: [
52
85
  linkPopulationPromiseHOC(props)
86
+ ],
87
+ validations: [
88
+ linkValidation(props)
53
89
  ]
54
- },
55
- {
90
+ }),
91
+ createNode({
56
92
  converters: {
57
93
  html: {
58
94
  converter: async ({ converters, node, parent, payload })=>{
@@ -77,8 +113,11 @@ export const LinkFeature = (props)=>{
77
113
  node: LinkNode,
78
114
  populationPromises: [
79
115
  linkPopulationPromiseHOC(props)
116
+ ],
117
+ validations: [
118
+ linkValidation(props)
80
119
  ]
81
- }
120
+ })
82
121
  ],
83
122
  serverFeatureProps: props
84
123
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/field/features/link/feature.server.ts"],"sourcesContent":["import type { I18n } from '@payloadcms/translations'\nimport type { SanitizedConfig } from 'payload/config'\nimport type { FieldWithRichTextRequiredEditor } from 'payload/types'\n\nimport type { HTMLConverter } from '../converters/html/converter/types.js'\nimport type { FeatureProviderProviderServer } from '../types.js'\nimport type { ClientProps } from './feature.client.js'\nimport type { SerializedAutoLinkNode, SerializedLinkNode } from './nodes/types.js'\n\nimport { convertLexicalNodesToHTML } from '../converters/html/converter/index.js'\nimport { LinkFeatureClientComponent } from './feature.client.js'\nimport { AutoLinkNode } from './nodes/AutoLinkNode.js'\nimport { LinkNode } from './nodes/LinkNode.js'\nimport { transformExtraFields } from './plugins/floatingLinkEditor/utilities.js'\nimport { linkPopulationPromiseHOC } from './populationPromise.js'\n\nexport type ExclusiveLinkCollectionsProps =\n | {\n /**\n * The collections that should be disabled for internal linking. Overrides the `enableRichTextLink` property in the collection config.\n * When this property is set, `enabledCollections` will not be available.\n **/\n disabledCollections?: string[]\n\n // Ensures that enabledCollections is not available when disabledCollections is set\n enabledCollections?: never\n }\n | {\n // Ensures that disabledCollections is not available when enabledCollections is set\n disabledCollections?: never\n\n /**\n * The collections that should be enabled for internal linking. Overrides the `enableRichTextLink` property in the collection config\n * When this property is set, `disabledCollections` will not be available.\n **/\n enabledCollections?: string[]\n }\n\nexport type LinkFeatureServerProps = ExclusiveLinkCollectionsProps & {\n /**\n * A function or array defining additional fields for the link feature. These will be\n * displayed in the link editor drawer.\n */\n fields?:\n | ((args: {\n config: SanitizedConfig\n defaultFields: FieldWithRichTextRequiredEditor[]\n i18n: I18n\n }) => FieldWithRichTextRequiredEditor[])\n | FieldWithRichTextRequiredEditor[]\n}\n\nexport const LinkFeature: FeatureProviderProviderServer<LinkFeatureServerProps, ClientProps> = (\n props,\n) => {\n if (!props) {\n props = {}\n }\n return {\n feature: () => {\n return {\n ClientComponent: LinkFeatureClientComponent,\n clientFeatureProps: {\n disabledCollections: props.disabledCollections,\n enabledCollections: props.enabledCollections,\n } as ExclusiveLinkCollectionsProps,\n generateSchemaMap: ({ config, i18n, props }) => {\n return {\n fields: transformExtraFields(\n props.fields,\n config,\n i18n,\n props.enabledCollections,\n props.disabledCollections,\n ),\n }\n },\n nodes: [\n {\n converters: {\n html: {\n converter: async ({ converters, node, parent, payload }) => {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n lexicalNodes: node.children,\n parent: {\n ...node,\n parent,\n },\n payload,\n })\n\n const rel: string = node.fields.newTab ? ' rel=\"noopener noreferrer\"' : ''\n\n let href: string = node.fields.url\n if (node.fields.linkType === 'internal') {\n href =\n typeof node.fields.doc?.value === 'string'\n ? node.fields.doc?.value\n : node.fields.doc?.value?.id\n }\n\n return `<a href=\"${href}\"${rel}>${childrenText}</a>`\n },\n nodeTypes: [AutoLinkNode.getType()],\n } as HTMLConverter<SerializedAutoLinkNode>,\n },\n node: AutoLinkNode,\n populationPromises: [linkPopulationPromiseHOC(props)],\n },\n {\n converters: {\n html: {\n converter: async ({ converters, node, parent, payload }) => {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n lexicalNodes: node.children,\n parent: {\n ...node,\n parent,\n },\n payload,\n })\n\n const rel: string = node.fields.newTab ? ' rel=\"noopener noreferrer\"' : ''\n\n const href: string =\n node.fields.linkType === 'custom'\n ? node.fields.url\n : (node.fields.doc?.value as string)\n\n return `<a href=\"${href}\"${rel}>${childrenText}</a>`\n },\n nodeTypes: [LinkNode.getType()],\n } as HTMLConverter<SerializedLinkNode>,\n },\n node: LinkNode,\n populationPromises: [linkPopulationPromiseHOC(props)],\n },\n ],\n serverFeatureProps: props,\n }\n },\n key: 'link',\n serverFeatureProps: props,\n }\n}\n"],"names":["convertLexicalNodesToHTML","LinkFeatureClientComponent","AutoLinkNode","LinkNode","transformExtraFields","linkPopulationPromiseHOC","LinkFeature","props","feature","ClientComponent","clientFeatureProps","disabledCollections","enabledCollections","generateSchemaMap","config","i18n","fields","nodes","converters","html","converter","node","parent","payload","childrenText","lexicalNodes","children","rel","newTab","href","url","linkType","doc","value","id","nodeTypes","getType","populationPromises","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AASA,SAASA,yBAAyB,QAAQ,wCAAuC;AACjF,SAASC,0BAA0B,QAAQ,sBAAqB;AAChE,SAASC,YAAY,QAAQ,0BAAyB;AACtD,SAASC,QAAQ,QAAQ,sBAAqB;AAC9C,SAASC,oBAAoB,QAAQ,4CAA2C;AAChF,SAASC,wBAAwB,QAAQ,yBAAwB;AAsCjE,OAAO,MAAMC,cAAkF,CAC7FC;IAEA,IAAI,CAACA,OAAO;QACVA,QAAQ,CAAC;IACX;IACA,OAAO;QACLC,SAAS;YACP,OAAO;gBACLC,iBAAiBR;gBACjBS,oBAAoB;oBAClBC,qBAAqBJ,MAAMI,mBAAmB;oBAC9CC,oBAAoBL,MAAMK,kBAAkB;gBAC9C;gBACAC,mBAAmB,CAAC,EAAEC,MAAM,EAAEC,IAAI,EAAER,KAAK,EAAE;oBACzC,OAAO;wBACLS,QAAQZ,qBACNG,MAAMS,MAAM,EACZF,QACAC,MACAR,MAAMK,kBAAkB,EACxBL,MAAMI,mBAAmB;oBAE7B;gBACF;gBACAM,OAAO;oBACL;wBACEC,YAAY;4BACVC,MAAM;gCACJC,WAAW,OAAO,EAAEF,UAAU,EAAEG,IAAI,EAAEC,MAAM,EAAEC,OAAO,EAAE;oCACrD,MAAMC,eAAe,MA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;4BACjC;wBACF;wBACAf,MAAMlB;wBACNkC,oBAAoB;4BAAChC,yBAAyBE;yBAAO;oBACvD;iBACD;gBACD+B,oBAAoB/B;YACtB;QACF;QACAgC,KAAK;QACLD,oBAAoB/B;IACtB;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../src/field/features/link/feature.server.ts"],"sourcesContent":["import type { Config, SanitizedConfig } from 'payload/config'\nimport type { Field, FieldWithRichTextRequiredEditor } from 'payload/types'\n\nimport { traverseFields } from '@payloadcms/next/utilities'\nimport { sanitizeFields } from 'payload/config'\nimport { deepCopyObject } from 'payload/utilities'\n\nimport type { FeatureProviderProviderServer } from '../types.js'\nimport type { ClientProps } from './feature.client.js'\n\nimport { convertLexicalNodesToHTML } from '../converters/html/converter/index.js'\nimport { createNode } from '../typeUtilities.js'\nimport { LinkFeatureClientComponent } from './feature.client.js'\nimport { AutoLinkNode } from './nodes/AutoLinkNode.js'\nimport { LinkNode } from './nodes/LinkNode.js'\nimport { transformExtraFields } from './plugins/floatingLinkEditor/utilities.js'\nimport { linkPopulationPromiseHOC } from './populationPromise.js'\nimport { linkValidation } from './validate.js'\n\nexport type ExclusiveLinkCollectionsProps =\n | {\n /**\n * The collections that should be disabled for internal linking. Overrides the `enableRichTextLink` property in the collection config.\n * When this property is set, `enabledCollections` will not be available.\n **/\n disabledCollections?: string[]\n\n // Ensures that enabledCollections is not available when disabledCollections is set\n enabledCollections?: never\n }\n | {\n // Ensures that disabledCollections is not available when enabledCollections is set\n disabledCollections?: never\n\n /**\n * The collections that should be enabled for internal linking. Overrides the `enableRichTextLink` property in the collection config\n * When this property is set, `disabledCollections` will not be available.\n **/\n enabledCollections?: string[]\n }\n\nexport type LinkFeatureServerProps = ExclusiveLinkCollectionsProps & {\n /**\n * A function or array defining additional fields for the link feature. These will be\n * displayed in the link editor drawer.\n */\n fields?:\n | ((args: {\n config: SanitizedConfig\n defaultFields: FieldWithRichTextRequiredEditor[]\n }) => FieldWithRichTextRequiredEditor[])\n | FieldWithRichTextRequiredEditor[]\n}\n\nexport const LinkFeature: FeatureProviderProviderServer<LinkFeatureServerProps, ClientProps> = (\n props,\n) => {\n if (!props) {\n props = {}\n }\n return {\n feature: async ({ config: _config }) => {\n const validRelationships = _config.collections.map((c) => c.slug) || []\n\n const _transformedFields = transformExtraFields(\n deepCopyObject(props.fields),\n _config,\n props.enabledCollections,\n props.disabledCollections,\n )\n\n const sanitizedFields = (await sanitizeFields({\n config: _config as unknown as Config,\n fields: _transformedFields,\n requireFieldLevelRichTextEditor: true,\n validRelationships,\n })) as FieldWithRichTextRequiredEditor[]\n props.fields = sanitizedFields\n\n return {\n ClientComponent: LinkFeatureClientComponent,\n clientFeatureProps: {\n disabledCollections: props.disabledCollections,\n enabledCollections: props.enabledCollections,\n } as ExclusiveLinkCollectionsProps,\n generateSchemaMap: ({ config, i18n }) => {\n if (!sanitizedFields || !Array.isArray(sanitizedFields) || sanitizedFields.length === 0) {\n return null\n }\n\n const schemaMap = new Map<string, Field[]>()\n\n const validRelationships = config.collections.map((c) => c.slug) || []\n\n schemaMap.set('fields', sanitizedFields)\n\n traverseFields({\n config,\n fields: sanitizedFields,\n i18n,\n schemaMap,\n schemaPath: 'fields',\n validRelationships,\n })\n\n return schemaMap\n },\n nodes: [\n createNode({\n converters: {\n html: {\n converter: async ({ converters, node, parent, payload }) => {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n lexicalNodes: node.children,\n parent: {\n ...node,\n parent,\n },\n payload,\n })\n\n const rel: string = node.fields.newTab ? ' rel=\"noopener noreferrer\"' : ''\n\n let href: string = node.fields.url\n if (node.fields.linkType === 'internal') {\n href =\n typeof node.fields.doc?.value === 'string'\n ? node.fields.doc?.value\n : node.fields.doc?.value?.id\n }\n\n return `<a href=\"${href}\"${rel}>${childrenText}</a>`\n },\n nodeTypes: [AutoLinkNode.getType()],\n },\n },\n hooks: {\n afterRead: [\n ({ node }) => {\n return node\n },\n ],\n },\n node: AutoLinkNode,\n populationPromises: [linkPopulationPromiseHOC(props)],\n validations: [linkValidation(props)],\n }),\n createNode({\n converters: {\n html: {\n converter: async ({ converters, node, parent, payload }) => {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n lexicalNodes: node.children,\n parent: {\n ...node,\n parent,\n },\n payload,\n })\n\n const rel: string = node.fields.newTab ? ' rel=\"noopener noreferrer\"' : ''\n\n const href: string =\n node.fields.linkType === 'custom'\n ? node.fields.url\n : (node.fields.doc?.value as string)\n\n return `<a href=\"${href}\"${rel}>${childrenText}</a>`\n },\n nodeTypes: [LinkNode.getType()],\n },\n },\n node: LinkNode,\n populationPromises: [linkPopulationPromiseHOC(props)],\n validations: [linkValidation(props)],\n }),\n ],\n serverFeatureProps: props,\n }\n },\n key: 'link',\n serverFeatureProps: props,\n }\n}\n"],"names":["traverseFields","sanitizeFields","deepCopyObject","convertLexicalNodesToHTML","createNode","LinkFeatureClientComponent","AutoLinkNode","LinkNode","transformExtraFields","linkPopulationPromiseHOC","linkValidation","LinkFeature","props","feature","config","_config","validRelationships","collections","map","c","slug","_transformedFields","fields","enabledCollections","disabledCollections","sanitizedFields","requireFieldLevelRichTextEditor","ClientComponent","clientFeatureProps","generateSchemaMap","i18n","Array","isArray","length","schemaMap","Map","set","schemaPath","nodes","converters","html","converter","node","parent","payload","childrenText","lexicalNodes","children","rel","newTab","href","url","linkType","doc","value","id","nodeTypes","getType","hooks","afterRead","populationPromises","validations","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAGA,SAASA,cAAc,QAAQ,6BAA4B;AAC3D,SAASC,cAAc,QAAQ,iBAAgB;AAC/C,SAASC,cAAc,QAAQ,oBAAmB;AAKlD,SAASC,yBAAyB,QAAQ,wCAAuC;AACjF,SAASC,UAAU,QAAQ,sBAAqB;AAChD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AE;IAAE,MAAM,EAAE,UAAU,CAAA;CAAE,GAAG,YAAY,CAEpF;AACD,wBAAgB,eAAe,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,IAAI,YAAY,CAE1F"}
1
+ {"version":3,"file":"AutoLinkNode.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/link/nodes/AutoLinkNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAIvE,OAAO,KAAK,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAA;AAEpE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAKxC,qBAAa,YAAa,SAAQ,QAAQ;IACxC,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,YAAY,GAAG,YAAY;IAI9C,MAAM,CAAC,OAAO,IAAI,MAAM;IAIxB,MAAM,CAAC,SAAS,IAAI,IAAI;IAKxB,MAAM,CAAC,UAAU,CAAC,cAAc,EAAE,sBAAsB,GAAG,YAAY;IAkBvE,UAAU,IAAI,sBAAsB;IAQpC,cAAc,CAAC,SAAS,EAAE,cAAc,EAAE,gBAAgB,UAAO,GAAG,WAAW,GAAG,IAAI;CASvF;AAED,wBAAgB,mBAAmB,CAAC,EAAE,MAAM,EAAE,EAAE;IAAE,MAAM,EAAE,UAAU,CAAA;CAAE,GAAG,YAAY,CAEpF;AACD,wBAAgB,eAAe,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,IAAI,YAAY,CAE1F"}
@@ -1,5 +1,4 @@
1
- import lexicalImport from 'lexical';
2
- const { $applyNodeReplacement, $isElementNode } = lexicalImport;
1
+ import { $applyNodeReplacement, $isElementNode } from 'lexical';
3
2
  import { LinkNode } from './LinkNode.js';
4
3
  // Custom node type to override `canInsertTextAfter` that will
5
4
  // allow typing within the link
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/link/nodes/AutoLinkNode.ts"],"sourcesContent":["import type { ElementNode, LexicalNode, RangeSelection } from 'lexical'\n\nimport lexicalImport from 'lexical'\nconst { $applyNodeReplacement, $isElementNode } = lexicalImport\n\nimport type { LinkFields, SerializedAutoLinkNode } from './types.js'\n\nimport { LinkNode } from './LinkNode.js'\n\n// Custom node type to override `canInsertTextAfter` that will\n// allow typing within the link\n\nexport class AutoLinkNode extends LinkNode {\n static clone(node: AutoLinkNode): AutoLinkNode {\n return new AutoLinkNode({ fields: node.__fields, key: node.__key })\n }\n\n static getType(): string {\n return 'autolink'\n }\n\n static importDOM(): null {\n // TODO: Should link node should handle the import over autolink?\n return null\n }\n\n static importJSON(serializedNode: SerializedAutoLinkNode): AutoLinkNode {\n if (\n serializedNode.version === 1 &&\n typeof serializedNode.fields?.doc?.value === 'object' &&\n serializedNode.fields?.doc?.value?.id\n ) {\n serializedNode.fields.doc.value = serializedNode.fields.doc.value.id\n serializedNode.version = 2\n }\n\n const node = $createAutoLinkNode({ fields: serializedNode.fields })\n\n node.setFormat(serializedNode.format)\n node.setIndent(serializedNode.indent)\n node.setDirection(serializedNode.direction)\n return node\n }\n\n exportJSON(): SerializedAutoLinkNode {\n return {\n ...super.exportJSON(),\n type: 'autolink',\n version: 2,\n }\n }\n\n insertNewAfter(selection: RangeSelection, restoreSelection = true): ElementNode | null {\n const element = this.getParentOrThrow().insertNewAfter(selection, restoreSelection)\n if ($isElementNode(element)) {\n const linkNode = $createAutoLinkNode({ fields: this.__fields })\n element.append(linkNode)\n return linkNode\n }\n return null\n }\n}\n\nexport function $createAutoLinkNode({ fields }: { fields: LinkFields }): AutoLinkNode {\n return $applyNodeReplacement(new AutoLinkNode({ fields }))\n}\nexport function $isAutoLinkNode(node: LexicalNode | null | undefined): node is AutoLinkNode {\n return node instanceof AutoLinkNode\n}\n"],"names":["lexicalImport","$applyNodeReplacement","$isElementNode","LinkNode","AutoLinkNode","clone","node","fields","__fields","key","__key","getType","importDOM","importJSON","serializedNode","version","doc","value","id","$createAutoLinkNode","setFormat","format","setIndent","indent","setDirection","direction","exportJSON","type","insertNewAfter","selection","restoreSelection","element","getParentOrThrow","linkNode","append","$isAutoLinkNode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,OAAOA,mBAAmB,UAAS;AACnC,MAAM,EAAEC,qBAAqB,EAAEC,cAAc,EAAE,GAAGF;AAIlD,SAASG,QAAQ,QAAQ,gBAAe;AAExC,8DAA8D;AAC9D,+BAA+B;AAE/B,OAAO,MAAMC,qBAAqBD;IAChC,OAAOE,MAAMC,IAAkB,EAAgB;QAC7C,OAAO,IAAIF,aAAa;YAAEG,QAAQD,KAAKE,QAAQ;YAAEC,KAAKH,KAAKI,KAAK;QAAC;IACnE;IAEA,OAAOC,UAAkB;QACvB,OAAO;IACT;IAEA,OAAOC,YAAkB;QACvB,iEAAiE;QACjE,OAAO;IACT;IAEA,OAAOC,WAAWC,cAAsC,EAAgB;QACtE,IACEA,eAAeC,OAAO,KAAK,KAC3B,OAAOD,eAAeP,MAAM,EAAES,KAAKC,UAAU,YAC7CH,eAAeP,MAAM,EAAES,KAAKC,OAAOC,IACnC;YACAJ,eAAeP,MAAM,CAACS,GAAG,CAACC,KAAK,GAAGH,eAAeP,MAAM,CAACS,GAAG,CAACC,KAAK,CAACC,EAAE;YACpEJ,eAAeC,OAAO,GAAG;QAC3B;QAEA,MAAMT,OAAOa,oBAAoB;YAAEZ,QAAQO,eAAeP,MAAM;QAAC;QAEjED,KAAKc,SAAS,CAACN,eAAeO,MAAM;QACpCf,KAAKgB,SAAS,CAACR,eAAeS,MAAM;QACpCjB,KAAKkB,YAAY,CAACV,eAAeW,SAAS;QAC1C,OAAOnB;IACT;IAEAoB,aAAqC;QACnC,OAAO;YACL,GAAG,KAAK,CAACA,YAAY;YACrBC,MAAM;YACNZ,SAAS;QACX;IACF;IAEAa,eAAeC,SAAyB,EAAEC,mBAAmB,IAAI,EAAsB;QACrF,MAAMC,UAAU,IAAI,CAACC,gBAAgB,GAAGJ,cAAc,CAACC,WAAWC;QAClE,IAAI5B,eAAe6B,UAAU;YAC3B,MAAME,WAAWd,oBAAoB;gBAAEZ,QAAQ,IAAI,CAACC,QAAQ;YAAC;YAC7DuB,QAAQG,MAAM,CAACD;YACf,OAAOA;QACT;QACA,OAAO;IACT;AACF;AAEA,OAAO,SAASd,oBAAoB,EAAEZ,MAAM,EAA0B;IACpE,OAAON,sBAAsB,IAAIG,aAAa;QAAEG;IAAO;AACzD;AACA,OAAO,SAAS4B,gBAAgB7B,IAAoC;IAClE,OAAOA,gBAAgBF;AACzB"}
1
+ {"version":3,"sources":["../../../../../src/field/features/link/nodes/AutoLinkNode.ts"],"sourcesContent":["import type { ElementNode, LexicalNode, RangeSelection } from 'lexical'\n\nimport { $applyNodeReplacement, $isElementNode } from 'lexical'\n\nimport type { LinkFields, SerializedAutoLinkNode } from './types.js'\n\nimport { LinkNode } from './LinkNode.js'\n\n// Custom node type to override `canInsertTextAfter` that will\n// allow typing within the link\n\nexport class AutoLinkNode extends LinkNode {\n static clone(node: AutoLinkNode): AutoLinkNode {\n return new AutoLinkNode({ fields: node.__fields, key: node.__key })\n }\n\n static getType(): string {\n return 'autolink'\n }\n\n static importDOM(): null {\n // TODO: Should link node should handle the import over autolink?\n return null\n }\n\n static importJSON(serializedNode: SerializedAutoLinkNode): AutoLinkNode {\n if (\n serializedNode.version === 1 &&\n typeof serializedNode.fields?.doc?.value === 'object' &&\n serializedNode.fields?.doc?.value?.id\n ) {\n serializedNode.fields.doc.value = serializedNode.fields.doc.value.id\n serializedNode.version = 2\n }\n\n const node = $createAutoLinkNode({ fields: serializedNode.fields })\n\n node.setFormat(serializedNode.format)\n node.setIndent(serializedNode.indent)\n node.setDirection(serializedNode.direction)\n return node\n }\n\n exportJSON(): SerializedAutoLinkNode {\n return {\n ...super.exportJSON(),\n type: 'autolink',\n version: 2,\n }\n }\n\n insertNewAfter(selection: RangeSelection, restoreSelection = true): ElementNode | null {\n const element = this.getParentOrThrow().insertNewAfter(selection, restoreSelection)\n if ($isElementNode(element)) {\n const linkNode = $createAutoLinkNode({ fields: this.__fields })\n element.append(linkNode)\n return linkNode\n }\n return null\n }\n}\n\nexport function $createAutoLinkNode({ fields }: { fields: LinkFields }): AutoLinkNode {\n return $applyNodeReplacement(new AutoLinkNode({ fields }))\n}\nexport function $isAutoLinkNode(node: LexicalNode | null | undefined): node is AutoLinkNode {\n return node instanceof AutoLinkNode\n}\n"],"names":["$applyNodeReplacement","$isElementNode","LinkNode","AutoLinkNode","clone","node","fields","__fields","key","__key","getType","importDOM","importJSON","serializedNode","version","doc","value","id","$createAutoLinkNode","setFormat","format","setIndent","indent","setDirection","direction","exportJSON","type","insertNewAfter","selection","restoreSelection","element","getParentOrThrow","linkNode","append","$isAutoLinkNode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,SAASA,qBAAqB,EAAEC,cAAc,QAAQ,UAAS;AAI/D,SAASC,QAAQ,QAAQ,gBAAe;AAExC,8DAA8D;AAC9D,+BAA+B;AAE/B,OAAO,MAAMC,qBAAqBD;IAChC,OAAOE,MAAMC,IAAkB,EAAgB;QAC7C,OAAO,IAAIF,aAAa;YAAEG,QAAQD,KAAKE,QAAQ;YAAEC,KAAKH,KAAKI,KAAK;QAAC;IACnE;IAEA,OAAOC,UAAkB;QACvB,OAAO;IACT;IAEA,OAAOC,YAAkB;QACvB,iEAAiE;QACjE,OAAO;IACT;IAEA,OAAOC,WAAWC,cAAsC,EAAgB;QACtE,IACEA,eAAeC,OAAO,KAAK,KAC3B,OAAOD,eAAeP,MAAM,EAAES,KAAKC,UAAU,YAC7CH,eAAeP,MAAM,EAAES,KAAKC,OAAOC,IACnC;YACAJ,eAAeP,MAAM,CAACS,GAAG,CAACC,KAAK,GAAGH,eAAeP,MAAM,CAACS,GAAG,CAACC,KAAK,CAACC,EAAE;YACpEJ,eAAeC,OAAO,GAAG;QAC3B;QAEA,MAAMT,OAAOa,oBAAoB;YAAEZ,QAAQO,eAAeP,MAAM;QAAC;QAEjED,KAAKc,SAAS,CAACN,eAAeO,MAAM;QACpCf,KAAKgB,SAAS,CAACR,eAAeS,MAAM;QACpCjB,KAAKkB,YAAY,CAACV,eAAeW,SAAS;QAC1C,OAAOnB;IACT;IAEAoB,aAAqC;QACnC,OAAO;YACL,GAAG,KAAK,CAACA,YAAY;YACrBC,MAAM;YACNZ,SAAS;QACX;IACF;IAEAa,eAAeC,SAAyB,EAAEC,mBAAmB,IAAI,EAAsB;QACrF,MAAMC,UAAU,IAAI,CAACC,gBAAgB,GAAGJ,cAAc,CAACC,WAAWC;QAClE,IAAI5B,eAAe6B,UAAU;YAC3B,MAAME,WAAWd,oBAAoB;gBAAEZ,QAAQ,IAAI,CAACC,QAAQ;YAAC;YAC7DuB,QAAQG,MAAM,CAACD;YACf,OAAOA;QACT;QACA,OAAO;IACT;AACF;AAEA,OAAO,SAASd,oBAAoB,EAAEZ,MAAM,EAA0B;IACpE,OAAON,sBAAsB,IAAIG,aAAa;QAAEG;IAAO;AACzD;AACA,OAAO,SAAS4B,gBAAgB7B,IAAoC;IAClE,OAAOA,gBAAgBF;AACzB"}
@@ -1,7 +1,6 @@
1
1
  import type { BaseSelection } from 'lexical';
2
- import lexicalImport from 'lexical';
3
- declare const ElementNode: typeof lexicalImport.ElementNode;
4
2
  import type { DOMConversionMap, EditorConfig, ElementNode as ElementNodeType, LexicalCommand, LexicalNode, NodeKey, RangeSelection } from 'lexical';
3
+ import { ElementNode } from 'lexical';
5
4
  import type { LinkPayload } from '../plugins/floatingLinkEditor/types.js';
6
5
  import type { LinkFields, SerializedLinkNode } from './types.js';
7
6
  /** @noInheritDoc */
@@ -34,5 +33,4 @@ export declare function $createLinkNode({ fields }: {
34
33
  export declare function $isLinkNode(node: LexicalNode | null | undefined): node is LinkNode;
35
34
  export declare const TOGGLE_LINK_COMMAND: LexicalCommand<LinkPayload | null>;
36
35
  export declare function toggleLink(payload: LinkPayload): void;
37
- export {};
38
36
  //# sourceMappingURL=LinkNode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"LinkNode.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/link/nodes/LinkNode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAK5C,OAAO,aAAa,MAAM,SAAS,CAAA;AACnC,QAAA,MAME,WAAW,kCAEI,CAAA;AAEjB,OAAO,KAAK,EACV,gBAAgB,EAEhB,YAAY,EACZ,WAAW,IAAI,eAAe,EAC9B,cAAc,EACd,WAAW,EACX,OAAO,EACP,cAAc,EACf,MAAM,SAAS,CAAA;AAEhB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAIhE,oBAAoB;AACpB,qBAAa,QAAS,SAAQ,WAAW;IACvC,QAAQ,EAAE,UAAU,CAAA;gBAER,EACV,MAKC,EACD,GAAG,GACJ,EAAE;QACD,MAAM,EAAE,UAAU,CAAA;QAClB,GAAG,CAAC,EAAE,OAAO,CAAA;KACd;IAKD,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,GAAG,QAAQ;IAOtC,MAAM,CAAC,OAAO,IAAI,MAAM;IAIxB,MAAM,CAAC,SAAS,IAAI,gBAAgB,GAAG,IAAI;IAS3C,MAAM,CAAC,UAAU,CAAC,cAAc,EAAE,kBAAkB,GAAG,QAAQ;IAmB/D,UAAU,IAAI,KAAK;IAInB,kBAAkB,IAAI,KAAK;IAI3B,mBAAmB,IAAI,KAAK;IAI5B,SAAS,CAAC,MAAM,EAAE,YAAY,GAAG,iBAAiB;IAiBlD,UAAU,IAAI,kBAAkB;IAShC,gBAAgB,CACd,KAAK,EAA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AO,MAAM,mBAAmB,EAAE,cAAc,CAAC,WAAW,GAAG,IAAI,CAC7B,CAAA;AAEtC,wBAAgB,UAAU,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,CA6GrD"}
@@ -1,7 +1,5 @@
1
- import lexicalUtilsImport from '@lexical/utils';
2
- const { addClassNamesToElement, isHTMLAnchorElement } = lexicalUtilsImport;
3
- import lexicalImport from 'lexical';
4
- const { $applyNodeReplacement, $createTextNode, $getSelection, $isElementNode, $isRangeSelection, ElementNode, createCommand } = lexicalImport;
1
+ import { addClassNamesToElement, isHTMLAnchorElement } from '@lexical/utils';
2
+ import { $applyNodeReplacement, $createTextNode, $getSelection, $isElementNode, $isRangeSelection, ElementNode, createCommand } from 'lexical';
5
3
  const SUPPORTED_URL_PROTOCOLS = new Set([
6
4
  'http:',
7
5
  'https:',