@payloadcms/richtext-lexical 3.0.0-beta.35 → 3.0.0-beta.37

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 (406) hide show
  1. package/dist/cell/index.d.ts +2 -0
  2. package/dist/cell/index.d.ts.map +1 -1
  3. package/dist/cell/index.js +24 -15
  4. package/dist/cell/index.js.map +1 -1
  5. package/dist/field/Field.d.ts.map +1 -1
  6. package/dist/field/Field.js +66 -47
  7. package/dist/field/Field.js.map +1 -1
  8. package/dist/field/features/align/feature.client.d.ts.map +1 -1
  9. package/dist/field/features/align/feature.client.js +12 -4
  10. package/dist/field/features/align/feature.client.js.map +1 -1
  11. package/dist/field/features/align/feature.server.d.ts.map +1 -1
  12. package/dist/field/features/align/feature.server.js +2 -0
  13. package/dist/field/features/align/feature.server.js.map +1 -1
  14. package/dist/field/features/align/i18n.d.ts +3 -0
  15. package/dist/field/features/align/i18n.d.ts.map +1 -0
  16. package/dist/field/features/align/i18n.js +196 -0
  17. package/dist/field/features/align/i18n.js.map +1 -0
  18. package/dist/field/features/blockquote/feature.client.d.ts.map +1 -1
  19. package/dist/field/features/blockquote/feature.client.js +22 -21
  20. package/dist/field/features/blockquote/feature.client.js.map +1 -1
  21. package/dist/field/features/blockquote/feature.server.d.ts.map +1 -1
  22. package/dist/field/features/blockquote/feature.server.js +2 -0
  23. package/dist/field/features/blockquote/feature.server.js.map +1 -1
  24. package/dist/field/features/blockquote/i18n.d.ts +3 -0
  25. package/dist/field/features/blockquote/i18n.d.ts.map +1 -0
  26. package/dist/field/features/blockquote/i18n.js +100 -0
  27. package/dist/field/features/blockquote/i18n.js.map +1 -0
  28. package/dist/field/features/blocks/component/BlockContent.js +62 -45
  29. package/dist/field/features/blocks/component/BlockContent.js.map +1 -1
  30. package/dist/field/features/blocks/component/index.js +38 -28
  31. package/dist/field/features/blocks/component/index.js.map +1 -1
  32. package/dist/field/features/blocks/drawer/index.js +2 -1
  33. package/dist/field/features/blocks/drawer/index.js.map +1 -1
  34. package/dist/field/features/blocks/feature.client.d.ts.map +1 -1
  35. package/dist/field/features/blocks/feature.client.js +3 -1
  36. package/dist/field/features/blocks/feature.client.js.map +1 -1
  37. package/dist/field/features/blocks/feature.server.d.ts.map +1 -1
  38. package/dist/field/features/blocks/feature.server.js +2 -0
  39. package/dist/field/features/blocks/feature.server.js.map +1 -1
  40. package/dist/field/features/blocks/i18n.d.ts +3 -0
  41. package/dist/field/features/blocks/i18n.d.ts.map +1 -0
  42. package/dist/field/features/blocks/i18n.js +100 -0
  43. package/dist/field/features/blocks/i18n.js.map +1 -0
  44. package/dist/field/features/blocks/nodes/BlocksNode.d.ts +1 -1
  45. package/dist/field/features/blocks/nodes/BlocksNode.d.ts.map +1 -1
  46. package/dist/field/features/blocks/nodes/BlocksNode.js +2 -1
  47. package/dist/field/features/blocks/nodes/BlocksNode.js.map +1 -1
  48. package/dist/field/features/blocks/plugin/index.js +2 -1
  49. package/dist/field/features/blocks/plugin/index.js.map +1 -1
  50. package/dist/field/features/blocks/populationPromise.js +1 -1
  51. package/dist/field/features/blocks/populationPromise.js.map +1 -1
  52. package/dist/field/features/converters/html/field/index.d.ts.map +1 -1
  53. package/dist/field/features/converters/html/field/index.js +30 -2
  54. package/dist/field/features/converters/html/field/index.js.map +1 -1
  55. package/dist/field/features/debug/testRecorder/plugin/index.js +65 -39
  56. package/dist/field/features/debug/testRecorder/plugin/index.js.map +1 -1
  57. package/dist/field/features/debug/treeView/plugin/index.js +2 -1
  58. package/dist/field/features/debug/treeView/plugin/index.js.map +1 -1
  59. package/dist/field/features/heading/feature.client.d.ts.map +1 -1
  60. package/dist/field/features/heading/feature.client.js +26 -21
  61. package/dist/field/features/heading/feature.client.js.map +1 -1
  62. package/dist/field/features/heading/feature.server.d.ts.map +1 -1
  63. package/dist/field/features/heading/feature.server.js +2 -0
  64. package/dist/field/features/heading/feature.server.js.map +1 -1
  65. package/dist/field/features/heading/i18n.d.ts +3 -0
  66. package/dist/field/features/heading/i18n.d.ts.map +1 -0
  67. package/dist/field/features/heading/i18n.js +100 -0
  68. package/dist/field/features/heading/i18n.js.map +1 -0
  69. package/dist/field/features/horizontalRule/feature.client.d.ts.map +1 -1
  70. package/dist/field/features/horizontalRule/feature.client.js +21 -20
  71. package/dist/field/features/horizontalRule/feature.client.js.map +1 -1
  72. package/dist/field/features/horizontalRule/feature.server.d.ts.map +1 -1
  73. package/dist/field/features/horizontalRule/feature.server.js +2 -0
  74. package/dist/field/features/horizontalRule/feature.server.js.map +1 -1
  75. package/dist/field/features/horizontalRule/i18n.d.ts +3 -0
  76. package/dist/field/features/horizontalRule/i18n.d.ts.map +1 -0
  77. package/dist/field/features/horizontalRule/i18n.js +100 -0
  78. package/dist/field/features/horizontalRule/i18n.js.map +1 -0
  79. package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.js +2 -1
  80. package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.js.map +1 -1
  81. package/dist/field/features/indent/feature.client.d.ts.map +1 -1
  82. package/dist/field/features/indent/feature.client.js +6 -2
  83. package/dist/field/features/indent/feature.client.js.map +1 -1
  84. package/dist/field/features/indent/feature.server.d.ts.map +1 -1
  85. package/dist/field/features/indent/feature.server.js +2 -0
  86. package/dist/field/features/indent/feature.server.js.map +1 -1
  87. package/dist/field/features/indent/i18n.d.ts +3 -0
  88. package/dist/field/features/indent/i18n.d.ts.map +1 -0
  89. package/dist/field/features/indent/i18n.js +132 -0
  90. package/dist/field/features/indent/i18n.js.map +1 -0
  91. package/dist/field/features/link/drawer/index.js +30 -22
  92. package/dist/field/features/link/drawer/index.js.map +1 -1
  93. package/dist/field/features/link/feature.client.d.ts.map +1 -1
  94. package/dist/field/features/link/feature.client.js +7 -1
  95. package/dist/field/features/link/feature.client.js.map +1 -1
  96. package/dist/field/features/link/feature.server.d.ts.map +1 -1
  97. package/dist/field/features/link/feature.server.js +10 -2
  98. package/dist/field/features/link/feature.server.js.map +1 -1
  99. package/dist/field/features/link/i18n.d.ts +3 -0
  100. package/dist/field/features/link/i18n.d.ts.map +1 -0
  101. package/dist/field/features/link/i18n.js +100 -0
  102. package/dist/field/features/link/i18n.js.map +1 -0
  103. package/dist/field/features/link/markdownTransformer.d.ts +6 -0
  104. package/dist/field/features/link/markdownTransformer.d.ts.map +1 -0
  105. package/dist/field/features/link/markdownTransformer.js +50 -0
  106. package/dist/field/features/link/markdownTransformer.js.map +1 -0
  107. package/dist/field/features/link/plugins/clickableLink/index.js +2 -1
  108. package/dist/field/features/link/plugins/clickableLink/index.js.map +1 -1
  109. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  110. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js +88 -70
  111. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  112. package/dist/field/features/link/plugins/floatingLinkEditor/index.js +2 -1
  113. package/dist/field/features/link/plugins/floatingLinkEditor/index.js.map +1 -1
  114. package/dist/field/features/link/populationPromise.js +1 -1
  115. package/dist/field/features/link/populationPromise.js.map +1 -1
  116. package/dist/field/features/lists/checklist/feature.client.d.ts.map +1 -1
  117. package/dist/field/features/lists/checklist/feature.client.js +21 -20
  118. package/dist/field/features/lists/checklist/feature.client.js.map +1 -1
  119. package/dist/field/features/lists/checklist/feature.server.d.ts.map +1 -1
  120. package/dist/field/features/lists/checklist/feature.server.js +2 -0
  121. package/dist/field/features/lists/checklist/feature.server.js.map +1 -1
  122. package/dist/field/features/lists/checklist/i18n.d.ts +3 -0
  123. package/dist/field/features/lists/checklist/i18n.d.ts.map +1 -0
  124. package/dist/field/features/lists/checklist/i18n.js +100 -0
  125. package/dist/field/features/lists/checklist/i18n.js.map +1 -0
  126. package/dist/field/features/lists/checklist/plugin/index.js +2 -1
  127. package/dist/field/features/lists/checklist/plugin/index.js.map +1 -1
  128. package/dist/field/features/lists/orderedList/feature.client.d.ts.map +1 -1
  129. package/dist/field/features/lists/orderedList/feature.client.js +19 -18
  130. package/dist/field/features/lists/orderedList/feature.client.js.map +1 -1
  131. package/dist/field/features/lists/orderedList/feature.server.d.ts.map +1 -1
  132. package/dist/field/features/lists/orderedList/feature.server.js +3 -1
  133. package/dist/field/features/lists/orderedList/feature.server.js.map +1 -1
  134. package/dist/field/features/lists/orderedList/i18n.d.ts +3 -0
  135. package/dist/field/features/lists/orderedList/i18n.d.ts.map +1 -0
  136. package/dist/field/features/lists/orderedList/i18n.js +100 -0
  137. package/dist/field/features/lists/orderedList/i18n.js.map +1 -0
  138. package/dist/field/features/lists/plugin/index.js +2 -1
  139. package/dist/field/features/lists/plugin/index.js.map +1 -1
  140. package/dist/field/features/lists/shared/slashMenuListGroup.d.ts +3 -0
  141. package/dist/field/features/lists/shared/slashMenuListGroup.d.ts.map +1 -0
  142. package/dist/field/features/lists/shared/slashMenuListGroup.js +11 -0
  143. package/dist/field/features/lists/shared/slashMenuListGroup.js.map +1 -0
  144. package/dist/field/features/lists/unorderedList/feature.client.d.ts.map +1 -1
  145. package/dist/field/features/lists/unorderedList/feature.client.js +19 -18
  146. package/dist/field/features/lists/unorderedList/feature.client.js.map +1 -1
  147. package/dist/field/features/lists/unorderedList/feature.server.d.ts.map +1 -1
  148. package/dist/field/features/lists/unorderedList/feature.server.js +2 -0
  149. package/dist/field/features/lists/unorderedList/feature.server.js.map +1 -1
  150. package/dist/field/features/lists/unorderedList/i18n.d.ts +3 -0
  151. package/dist/field/features/lists/unorderedList/i18n.d.ts.map +1 -0
  152. package/dist/field/features/lists/unorderedList/i18n.js +100 -0
  153. package/dist/field/features/lists/unorderedList/i18n.js.map +1 -0
  154. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js +9 -1
  155. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  156. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts +1 -1
  157. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  158. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +2 -1
  159. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  160. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js +9 -1
  161. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  162. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts +1 -1
  163. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  164. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +2 -1
  165. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  166. package/dist/field/features/paragraph/feature.client.d.ts.map +1 -1
  167. package/dist/field/features/paragraph/feature.client.js +24 -23
  168. package/dist/field/features/paragraph/feature.client.js.map +1 -1
  169. package/dist/field/features/paragraph/feature.server.d.ts.map +1 -1
  170. package/dist/field/features/paragraph/feature.server.js +2 -0
  171. package/dist/field/features/paragraph/feature.server.js.map +1 -1
  172. package/dist/field/features/paragraph/i18n.d.ts +3 -0
  173. package/dist/field/features/paragraph/i18n.d.ts.map +1 -0
  174. package/dist/field/features/paragraph/i18n.js +132 -0
  175. package/dist/field/features/paragraph/i18n.js.map +1 -0
  176. package/dist/field/features/relationship/drawer/index.js +10 -2
  177. package/dist/field/features/relationship/drawer/index.js.map +1 -1
  178. package/dist/field/features/relationship/feature.client.d.ts.map +1 -1
  179. package/dist/field/features/relationship/feature.client.js +23 -22
  180. package/dist/field/features/relationship/feature.client.js.map +1 -1
  181. package/dist/field/features/relationship/feature.server.d.ts.map +1 -1
  182. package/dist/field/features/relationship/feature.server.js +2 -0
  183. package/dist/field/features/relationship/feature.server.js.map +1 -1
  184. package/dist/field/features/relationship/i18n.d.ts +3 -0
  185. package/dist/field/features/relationship/i18n.d.ts.map +1 -0
  186. package/dist/field/features/relationship/i18n.js +100 -0
  187. package/dist/field/features/relationship/i18n.js.map +1 -0
  188. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts +1 -1
  189. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts.map +1 -1
  190. package/dist/field/features/relationship/nodes/RelationshipNode.js +2 -1
  191. package/dist/field/features/relationship/nodes/RelationshipNode.js.map +1 -1
  192. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js +64 -44
  193. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js.map +1 -1
  194. package/dist/field/features/relationship/plugins/index.js +2 -1
  195. package/dist/field/features/relationship/plugins/index.js.map +1 -1
  196. package/dist/field/features/shared/slashMenu/basicGroup.d.ts +3 -0
  197. package/dist/field/features/shared/slashMenu/basicGroup.d.ts.map +1 -0
  198. package/dist/field/features/shared/slashMenu/basicGroup.js +11 -0
  199. package/dist/field/features/shared/slashMenu/basicGroup.js.map +1 -0
  200. package/dist/field/features/toolbars/fixed/Toolbar/index.js +60 -55
  201. package/dist/field/features/toolbars/fixed/Toolbar/index.js.map +1 -1
  202. package/dist/field/features/toolbars/fixed/Toolbar/index.scss +16 -2
  203. package/dist/field/features/toolbars/inline/Toolbar/index.js +57 -49
  204. package/dist/field/features/toolbars/inline/Toolbar/index.js.map +1 -1
  205. package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts +1 -1
  206. package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
  207. package/dist/field/features/toolbars/shared/ToolbarButton/index.js +5 -3
  208. package/dist/field/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  209. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
  210. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.js +54 -35
  211. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  212. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts +1 -1
  213. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
  214. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js +25 -22
  215. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
  216. package/dist/field/features/toolbars/types.d.ts +1 -1
  217. package/dist/field/features/toolbars/types.d.ts.map +1 -1
  218. package/dist/field/features/toolbars/types.js.map +1 -1
  219. package/dist/field/features/types.d.ts +21 -2
  220. package/dist/field/features/types.d.ts.map +1 -1
  221. package/dist/field/features/types.js.map +1 -1
  222. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js +30 -22
  223. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js.map +1 -1
  224. package/dist/field/features/upload/component/index.js +104 -71
  225. package/dist/field/features/upload/component/index.js.map +1 -1
  226. package/dist/field/features/upload/drawer/index.js +8 -4
  227. package/dist/field/features/upload/drawer/index.js.map +1 -1
  228. package/dist/field/features/upload/feature.client.d.ts.map +1 -1
  229. package/dist/field/features/upload/feature.client.js +26 -25
  230. package/dist/field/features/upload/feature.client.js.map +1 -1
  231. package/dist/field/features/upload/feature.server.d.ts.map +1 -1
  232. package/dist/field/features/upload/feature.server.js +2 -0
  233. package/dist/field/features/upload/feature.server.js.map +1 -1
  234. package/dist/field/features/upload/i18n.d.ts +3 -0
  235. package/dist/field/features/upload/i18n.d.ts.map +1 -0
  236. package/dist/field/features/upload/i18n.js +100 -0
  237. package/dist/field/features/upload/i18n.js.map +1 -0
  238. package/dist/field/features/upload/nodes/UploadNode.d.ts +1 -1
  239. package/dist/field/features/upload/nodes/UploadNode.d.ts.map +1 -1
  240. package/dist/field/features/upload/nodes/UploadNode.js +2 -1
  241. package/dist/field/features/upload/nodes/UploadNode.js.map +1 -1
  242. package/dist/field/features/upload/plugin/index.js +2 -1
  243. package/dist/field/features/upload/plugin/index.js.map +1 -1
  244. package/dist/field/features/upload/populationPromise.js +1 -1
  245. package/dist/field/features/upload/populationPromise.js.map +1 -1
  246. package/dist/field/index.d.ts +2 -0
  247. package/dist/field/index.d.ts.map +1 -1
  248. package/dist/field/index.js +29 -21
  249. package/dist/field/index.js.map +1 -1
  250. package/dist/field/index.scss +0 -19
  251. package/dist/field/lexical/EditorFocusProvider.d.ts +1 -2
  252. package/dist/field/lexical/EditorFocusProvider.d.ts.map +1 -1
  253. package/dist/field/lexical/EditorFocusProvider.js +5 -3
  254. package/dist/field/lexical/EditorFocusProvider.js.map +1 -1
  255. package/dist/field/lexical/EditorPlugin.js +3 -2
  256. package/dist/field/lexical/EditorPlugin.js.map +1 -1
  257. package/dist/field/lexical/LexicalEditor.d.ts.map +1 -1
  258. package/dist/field/lexical/LexicalEditor.js +115 -81
  259. package/dist/field/lexical/LexicalEditor.js.map +1 -1
  260. package/dist/field/lexical/LexicalEditor.scss +10 -1
  261. package/dist/field/lexical/LexicalProvider.js +16 -10
  262. package/dist/field/lexical/LexicalProvider.js.map +1 -1
  263. package/dist/field/lexical/config/client/EditorConfigProvider.js +5 -3
  264. package/dist/field/lexical/config/client/EditorConfigProvider.js.map +1 -1
  265. package/dist/field/lexical/config/client/sanitize.d.ts +2 -1
  266. package/dist/field/lexical/config/client/sanitize.d.ts.map +1 -1
  267. package/dist/field/lexical/config/client/sanitize.js +2 -1
  268. package/dist/field/lexical/config/client/sanitize.js.map +1 -1
  269. package/dist/field/lexical/config/server/sanitize.d.ts.map +1 -1
  270. package/dist/field/lexical/config/server/sanitize.js +11 -0
  271. package/dist/field/lexical/config/server/sanitize.js.map +1 -1
  272. package/dist/field/lexical/config/types.d.ts +2 -0
  273. package/dist/field/lexical/config/types.d.ts.map +1 -1
  274. package/dist/field/lexical/config/types.js.map +1 -1
  275. package/dist/field/lexical/plugins/MarkdownShortcut/index.js +2 -1
  276. package/dist/field/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  277. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +1 -1
  278. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  279. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  280. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts +1 -1
  281. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts.map +1 -1
  282. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +2 -1
  283. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
  284. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts +2 -2
  285. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts.map +1 -1
  286. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
  287. package/dist/field/lexical/plugins/SlashMenu/index.js +51 -40
  288. package/dist/field/lexical/plugins/SlashMenu/index.js.map +1 -1
  289. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts +2 -2
  290. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts.map +1 -1
  291. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js +38 -119
  292. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  293. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.scss +2 -2
  294. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.d.ts +1 -1
  295. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.d.ts.map +1 -1
  296. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.js.map +1 -1
  297. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts +2 -2
  298. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  299. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js +102 -58
  300. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  301. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.scss +12 -3
  302. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts +8 -1
  303. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts.map +1 -1
  304. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js +73 -25
  305. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
  306. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts +5 -0
  307. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts.map +1 -0
  308. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.js +21 -0
  309. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.js.map +1 -0
  310. package/dist/field/lexical/plugins/handles/{DraggableBlockPlugin → utils}/getNodeCloseToPoint.d.ts +4 -0
  311. package/dist/field/lexical/plugins/handles/utils/getNodeCloseToPoint.d.ts.map +1 -0
  312. package/dist/field/lexical/plugins/handles/{DraggableBlockPlugin → utils}/getNodeCloseToPoint.js +2 -14
  313. package/dist/field/lexical/plugins/handles/utils/getNodeCloseToPoint.js.map +1 -0
  314. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
  315. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js +4 -2
  316. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  317. package/dist/field/lexical/theme/EditorTheme.scss +5 -0
  318. package/dist/field/lexical/ui/ContentEditable.d.ts +1 -1
  319. package/dist/field/lexical/ui/ContentEditable.d.ts.map +1 -1
  320. package/dist/field/lexical/ui/ContentEditable.js +2 -1
  321. package/dist/field/lexical/ui/ContentEditable.js.map +1 -1
  322. package/dist/field/lexical/ui/ContentEditable.scss +50 -2
  323. package/dist/field/lexical/ui/icons/AI/index.js +26 -17
  324. package/dist/field/lexical/ui/icons/AI/index.js.map +1 -1
  325. package/dist/field/lexical/ui/icons/Add/index.js +14 -9
  326. package/dist/field/lexical/ui/icons/Add/index.js.map +1 -1
  327. package/dist/field/lexical/ui/icons/Add/light.svg +4 -0
  328. package/dist/field/lexical/ui/icons/AlignCenter/index.js +21 -15
  329. package/dist/field/lexical/ui/icons/AlignCenter/index.js.map +1 -1
  330. package/dist/field/lexical/ui/icons/AlignJustify/index.js +21 -15
  331. package/dist/field/lexical/ui/icons/AlignJustify/index.js.map +1 -1
  332. package/dist/field/lexical/ui/icons/AlignLeft/index.js +21 -15
  333. package/dist/field/lexical/ui/icons/AlignLeft/index.js.map +1 -1
  334. package/dist/field/lexical/ui/icons/AlignRight/index.js +21 -15
  335. package/dist/field/lexical/ui/icons/AlignRight/index.js.map +1 -1
  336. package/dist/field/lexical/ui/icons/Block/index.js +30 -24
  337. package/dist/field/lexical/ui/icons/Block/index.js.map +1 -1
  338. package/dist/field/lexical/ui/icons/Blockquote/index.js +8 -6
  339. package/dist/field/lexical/ui/icons/Blockquote/index.js.map +1 -1
  340. package/dist/field/lexical/ui/icons/Bold/index.js +8 -6
  341. package/dist/field/lexical/ui/icons/Bold/index.js.map +1 -1
  342. package/dist/field/lexical/ui/icons/Checklist/index.js +19 -14
  343. package/dist/field/lexical/ui/icons/Checklist/index.js.map +1 -1
  344. package/dist/field/lexical/ui/icons/Code/index.js +14 -9
  345. package/dist/field/lexical/ui/icons/Code/index.js.map +1 -1
  346. package/dist/field/lexical/ui/icons/CodeBlock/index.js +14 -9
  347. package/dist/field/lexical/ui/icons/CodeBlock/index.js.map +1 -1
  348. package/dist/field/lexical/ui/icons/DraggableBlock/light.svg +9 -0
  349. package/dist/field/lexical/ui/icons/H1/index.js +8 -6
  350. package/dist/field/lexical/ui/icons/H1/index.js.map +1 -1
  351. package/dist/field/lexical/ui/icons/H2/index.js +8 -6
  352. package/dist/field/lexical/ui/icons/H2/index.js.map +1 -1
  353. package/dist/field/lexical/ui/icons/H3/index.js +8 -6
  354. package/dist/field/lexical/ui/icons/H3/index.js.map +1 -1
  355. package/dist/field/lexical/ui/icons/H4/index.js +8 -6
  356. package/dist/field/lexical/ui/icons/H4/index.js.map +1 -1
  357. package/dist/field/lexical/ui/icons/H5/index.js +8 -6
  358. package/dist/field/lexical/ui/icons/H5/index.js.map +1 -1
  359. package/dist/field/lexical/ui/icons/H6/index.js +8 -6
  360. package/dist/field/lexical/ui/icons/H6/index.js.map +1 -1
  361. package/dist/field/lexical/ui/icons/HorizontalRule/index.js +11 -9
  362. package/dist/field/lexical/ui/icons/HorizontalRule/index.js.map +1 -1
  363. package/dist/field/lexical/ui/icons/IndentDecrease/index.js +25 -18
  364. package/dist/field/lexical/ui/icons/IndentDecrease/index.js.map +1 -1
  365. package/dist/field/lexical/ui/icons/IndentIncrease/index.js +25 -18
  366. package/dist/field/lexical/ui/icons/IndentIncrease/index.js.map +1 -1
  367. package/dist/field/lexical/ui/icons/Italic/index.js +8 -6
  368. package/dist/field/lexical/ui/icons/Italic/index.js.map +1 -1
  369. package/dist/field/lexical/ui/icons/Link/index.js +26 -17
  370. package/dist/field/lexical/ui/icons/Link/index.js.map +1 -1
  371. package/dist/field/lexical/ui/icons/OrderedList/index.js +29 -21
  372. package/dist/field/lexical/ui/icons/OrderedList/index.js.map +1 -1
  373. package/dist/field/lexical/ui/icons/Relationship/index.js +26 -17
  374. package/dist/field/lexical/ui/icons/Relationship/index.js.map +1 -1
  375. package/dist/field/lexical/ui/icons/Strikethrough/index.js +14 -9
  376. package/dist/field/lexical/ui/icons/Strikethrough/index.js.map +1 -1
  377. package/dist/field/lexical/ui/icons/Subscript/index.js +8 -6
  378. package/dist/field/lexical/ui/icons/Subscript/index.js.map +1 -1
  379. package/dist/field/lexical/ui/icons/Superscript/index.js +8 -6
  380. package/dist/field/lexical/ui/icons/Superscript/index.js.map +1 -1
  381. package/dist/field/lexical/ui/icons/Text/index.js +8 -6
  382. package/dist/field/lexical/ui/icons/Text/index.js.map +1 -1
  383. package/dist/field/lexical/ui/icons/Underline/index.js +14 -9
  384. package/dist/field/lexical/ui/icons/Underline/index.js.map +1 -1
  385. package/dist/field/lexical/ui/icons/UnorderedList/index.js +45 -36
  386. package/dist/field/lexical/ui/icons/UnorderedList/index.js.map +1 -1
  387. package/dist/field/lexical/ui/icons/Upload/index.js +24 -18
  388. package/dist/field/lexical/ui/icons/Upload/index.js.map +1 -1
  389. package/dist/field/lexical/utils/url.d.ts.map +1 -1
  390. package/dist/field/lexical/utils/url.js +10 -2
  391. package/dist/field/lexical/utils/url.js.map +1 -1
  392. package/dist/generateComponentMap.js +8 -8
  393. package/dist/generateComponentMap.js.map +1 -1
  394. package/dist/i18n.d.ts +3 -0
  395. package/dist/i18n.d.ts.map +1 -0
  396. package/dist/i18n.js +164 -0
  397. package/dist/i18n.js.map +1 -0
  398. package/dist/index.d.ts.map +1 -1
  399. package/dist/index.js +13 -0
  400. package/dist/index.js.map +1 -1
  401. package/dist/types.d.ts +7 -0
  402. package/dist/types.d.ts.map +1 -1
  403. package/dist/types.js.map +1 -1
  404. package/package.json +20 -15
  405. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.d.ts.map +0 -1
  406. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js.map +0 -1
@@ -0,0 +1,132 @@
1
+ export const i18n = {
2
+ ar: {
3
+ decreaseLabel: 'تقليل المسافة البادئة',
4
+ increaseLabel: 'زيادة المسافة البادئة'
5
+ },
6
+ az: {
7
+ decreaseLabel: 'İntervalı Azaltın',
8
+ increaseLabel: 'Girintiyi Artırın'
9
+ },
10
+ bg: {
11
+ decreaseLabel: 'Намали отстоянието',
12
+ increaseLabel: 'Увеличете отстоянието'
13
+ },
14
+ cs: {
15
+ decreaseLabel: 'Zmenšit odsazení',
16
+ increaseLabel: 'Zvětšit odsazení'
17
+ },
18
+ de: {
19
+ decreaseLabel: 'Einzug verkleinern',
20
+ increaseLabel: 'Einzug erhöhen'
21
+ },
22
+ en: {
23
+ decreaseLabel: 'Decrease Indent',
24
+ increaseLabel: 'Increase Indent'
25
+ },
26
+ es: {
27
+ decreaseLabel: 'Disminuir Sangría',
28
+ increaseLabel: 'Aumentar Sangría'
29
+ },
30
+ fa: {
31
+ decreaseLabel: 'کاهش تورفتگی',
32
+ increaseLabel: 'افزایش تورفتگی'
33
+ },
34
+ fr: {
35
+ decreaseLabel: "Diminuer l'indentation",
36
+ increaseLabel: "Augmenter l'indentation"
37
+ },
38
+ he: {
39
+ decreaseLabel: 'הקטן הזחה',
40
+ increaseLabel: 'הגדל כניסה'
41
+ },
42
+ hr: {
43
+ decreaseLabel: 'Smanji uvlačenje',
44
+ increaseLabel: 'Povećaj uvlačenje'
45
+ },
46
+ hu: {
47
+ decreaseLabel: 'Csökkentse a behúzást',
48
+ increaseLabel: 'Behúzás növelése'
49
+ },
50
+ it: {
51
+ decreaseLabel: 'Diminuisci rientro',
52
+ increaseLabel: 'Aumenta Rientro'
53
+ },
54
+ ja: {
55
+ decreaseLabel: 'インデントを減らす',
56
+ increaseLabel: 'インデントを増やす'
57
+ },
58
+ ko: {
59
+ decreaseLabel: '들여쓰기 줄이기',
60
+ increaseLabel: '들여쓰기 늘리기'
61
+ },
62
+ my: {
63
+ decreaseLabel: 'Kurangkan Inden',
64
+ increaseLabel: 'Tingkatkan Inden'
65
+ },
66
+ nb: {
67
+ decreaseLabel: 'Reduser innrykk',
68
+ increaseLabel: 'Øke innrykk'
69
+ },
70
+ nl: {
71
+ decreaseLabel: 'Verminder Inspringing',
72
+ increaseLabel: 'Inspring verhogen'
73
+ },
74
+ pl: {
75
+ decreaseLabel: 'Zmniejsz wcięcie',
76
+ increaseLabel: 'Zwiększ wcięcie'
77
+ },
78
+ pt: {
79
+ decreaseLabel: 'Diminuir recuo',
80
+ increaseLabel: 'Aumentar Indentação'
81
+ },
82
+ ro: {
83
+ decreaseLabel: 'Reducere indentare',
84
+ increaseLabel: 'Crește indentarea'
85
+ },
86
+ rs: {
87
+ decreaseLabel: 'Smanji uvlačenje',
88
+ increaseLabel: 'Povećaj uvlačenje'
89
+ },
90
+ 'rs-latin': {
91
+ decreaseLabel: 'Smanji uvlačenje',
92
+ increaseLabel: 'Povećaj uvlačenje'
93
+ },
94
+ ru: {
95
+ decreaseLabel: 'Уменьшить отступ',
96
+ increaseLabel: 'Увеличить отступ'
97
+ },
98
+ sk: {
99
+ decreaseLabel: 'Znížiť odsadenie',
100
+ increaseLabel: 'Zväčšiť odsadenie'
101
+ },
102
+ sv: {
103
+ decreaseLabel: 'Minska indrag',
104
+ increaseLabel: 'Öka indrag'
105
+ },
106
+ th: {
107
+ decreaseLabel: 'ลดการเยื้อง',
108
+ increaseLabel: 'เพิ่มการเยื้อง'
109
+ },
110
+ tr: {
111
+ decreaseLabel: 'Girintiyi Azalt',
112
+ increaseLabel: 'Girintiyi Artır'
113
+ },
114
+ uk: {
115
+ decreaseLabel: 'Зменшити відступ',
116
+ increaseLabel: 'Збільшити відступ'
117
+ },
118
+ vi: {
119
+ decreaseLabel: 'Giảm lề',
120
+ increaseLabel: 'Tăng lề'
121
+ },
122
+ zh: {
123
+ decreaseLabel: '减少缩进',
124
+ increaseLabel: '增加缩进'
125
+ },
126
+ 'zh-TW': {
127
+ decreaseLabel: '減少縮排',
128
+ increaseLabel: '增加縮排'
129
+ }
130
+ };
131
+
132
+ //# sourceMappingURL=i18n.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/field/features/indent/i18n.ts"],"sourcesContent":["import type { GenericLanguages } from '@payloadcms/translations'\n\nexport const i18n: Partial<GenericLanguages> = {\n ar: {\n decreaseLabel: 'تقليل المسافة البادئة',\n increaseLabel: 'زيادة المسافة البادئة',\n },\n az: {\n decreaseLabel: 'İntervalı Azaltın',\n increaseLabel: 'Girintiyi Artırın',\n },\n bg: {\n decreaseLabel: 'Намали отстоянието',\n increaseLabel: 'Увеличете отстоянието',\n },\n cs: {\n decreaseLabel: 'Zmenšit odsazení',\n increaseLabel: 'Zvětšit odsazení',\n },\n de: {\n decreaseLabel: 'Einzug verkleinern',\n increaseLabel: 'Einzug erhöhen',\n },\n en: {\n decreaseLabel: 'Decrease Indent',\n increaseLabel: 'Increase Indent',\n },\n es: {\n decreaseLabel: 'Disminuir Sangría',\n increaseLabel: 'Aumentar Sangría',\n },\n fa: {\n decreaseLabel: 'کاهش تورفتگی',\n increaseLabel: 'افزایش تورفتگی',\n },\n fr: {\n decreaseLabel: \"Diminuer l'indentation\",\n increaseLabel: \"Augmenter l'indentation\",\n },\n he: {\n decreaseLabel: 'הקטן הזחה',\n increaseLabel: 'הגדל כניסה',\n },\n hr: {\n decreaseLabel: 'Smanji uvlačenje',\n increaseLabel: 'Povećaj uvlačenje',\n },\n hu: {\n decreaseLabel: 'Csökkentse a behúzást',\n increaseLabel: 'Behúzás növelése',\n },\n it: {\n decreaseLabel: 'Diminuisci rientro',\n increaseLabel: 'Aumenta Rientro',\n },\n ja: {\n decreaseLabel: 'インデントを減らす',\n increaseLabel: 'インデントを増やす',\n },\n ko: {\n decreaseLabel: '들여쓰기 줄이기',\n increaseLabel: '들여쓰기 늘리기',\n },\n my: {\n decreaseLabel: 'Kurangkan Inden',\n increaseLabel: 'Tingkatkan Inden',\n },\n nb: {\n decreaseLabel: 'Reduser innrykk',\n increaseLabel: 'Øke innrykk',\n },\n nl: {\n decreaseLabel: 'Verminder Inspringing',\n increaseLabel: 'Inspring verhogen',\n },\n pl: {\n decreaseLabel: 'Zmniejsz wcięcie',\n increaseLabel: 'Zwiększ wcięcie',\n },\n pt: {\n decreaseLabel: 'Diminuir recuo',\n increaseLabel: 'Aumentar Indentação',\n },\n ro: {\n decreaseLabel: 'Reducere indentare',\n increaseLabel: 'Crește indentarea',\n },\n rs: {\n decreaseLabel: 'Smanji uvlačenje',\n increaseLabel: 'Povećaj uvlačenje',\n },\n 'rs-latin': {\n decreaseLabel: 'Smanji uvlačenje',\n increaseLabel: 'Povećaj uvlačenje',\n },\n ru: {\n decreaseLabel: 'Уменьшить отступ',\n increaseLabel: 'Увеличить отступ',\n },\n sk: {\n decreaseLabel: 'Znížiť odsadenie',\n increaseLabel: 'Zväčšiť odsadenie',\n },\n sv: {\n decreaseLabel: 'Minska indrag',\n increaseLabel: 'Öka indrag',\n },\n th: {\n decreaseLabel: 'ลดการเยื้อง',\n increaseLabel: 'เพิ่มการเยื้อง',\n },\n tr: {\n decreaseLabel: 'Girintiyi Azalt',\n increaseLabel: 'Girintiyi Artır',\n },\n uk: {\n decreaseLabel: 'Зменшити відступ',\n increaseLabel: 'Збільшити відступ',\n },\n vi: {\n decreaseLabel: 'Giảm lề',\n increaseLabel: 'Tăng lề',\n },\n zh: {\n decreaseLabel: '减少缩进',\n increaseLabel: '增加缩进',\n },\n 'zh-TW': {\n decreaseLabel: '減少縮排',\n increaseLabel: '增加縮排',\n },\n}\n"],"names":["i18n","ar","decreaseLabel","increaseLabel","az","bg","cs","de","en","es","fa","fr","he","hr","hu","it","ja","ko","my","nb","nl","pl","pt","ro","rs","ru","sk","sv","th","tr","uk","vi","zh"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,OAAO,MAAMA,OAAkC;IAC7CC,IAAI;QACFC,eAAe;QACfC,eAAe;IACjB;IACAC,IAAI;QACFF,eAAe;QACfC,eAAe;IACjB;IACAE,IAAI;QACFH,eAAe;QACfC,eAAe;IACjB;IACAG,IAAI;QACFJ,eAAe;QACfC,eAAe;IACjB;IACAI,IAAI;QACFL,eAAe;QACfC,eAAe;IACjB;IACAK,IAAI;QACFN,eAAe;QACfC,eAAe;IACjB;IACAM,IAAI;QACFP,eAAe;QACfC,eAAe;IACjB;IACAO,IAAI;QACFR,eAAe;QACfC,eAAe;IACjB;IACAQ,IAAI;QACFT,eAAe;QACfC,eAAe;IACjB;IACAS,IAAI;QACFV,eAAe;QACfC,eAAe;IACjB;IACAU,IAAI;QACFX,eAAe;QACfC,eAAe;IACjB;IACAW,IAAI;QACFZ,eAAe;QACfC,eAAe;IACjB;IACAY,IAAI;QACFb,eAAe;QACfC,eAAe;IACjB;IACAa,IAAI;QACFd,eAAe;QACfC,eAAe;IACjB;IACAc,IAAI;QACFf,eAAe;QACfC,eAAe;IACjB;IACAe,IAAI;QACFhB,eAAe;QACfC,eAAe;IACjB;IACAgB,IAAI;QACFjB,eAAe;QACfC,eAAe;IACjB;IACAiB,IAAI;QACFlB,eAAe;QACfC,eAAe;IACjB;IACAkB,IAAI;QACFnB,eAAe;QACfC,eAAe;IACjB;IACAmB,IAAI;QACFpB,eAAe;QACfC,eAAe;IACjB;IACAoB,IAAI;QACFrB,eAAe;QACfC,eAAe;IACjB;IACAqB,IAAI;QACFtB,eAAe;QACfC,eAAe;IACjB;IACA,YAAY;QACVD,eAAe;QACfC,eAAe;IACjB;IACAsB,IAAI;QACFvB,eAAe;QACfC,eAAe;IACjB;IACAuB,IAAI;QACFxB,eAAe;QACfC,eAAe;IACjB;IACAwB,IAAI;QACFzB,eAAe;QACfC,eAAe;IACjB;IACAyB,IAAI;QACF1B,eAAe;QACfC,eAAe;IACjB;IACA0B,IAAI;QACF3B,eAAe;QACfC,eAAe;IACjB;IACA2B,IAAI;QACF5B,eAAe;QACfC,eAAe;IACjB;IACA4B,IAAI;QACF7B,eAAe;QACfC,eAAe;IACjB;IACA6B,IAAI;QACF9B,eAAe;QACfC,eAAe;IACjB;IACA,SAAS;QACPD,eAAe;QACfC,eAAe;IACjB;AACF,EAAC"}
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
1
2
  import { Drawer } from '@payloadcms/ui/elements/Drawer';
2
3
  import { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider';
3
4
  import { Form } from '@payloadcms/ui/forms/Form';
@@ -65,30 +66,37 @@ export const LinkDrawer = ({ drawerSlug, handleModalSubmit, stateData })=>{
65
66
  schemaFieldsPath,
66
67
  id
67
68
  ]);
68
- return /*#__PURE__*/ React.createElement(Drawer, {
69
+ return /*#__PURE__*/ _jsx(Drawer, {
69
70
  className: baseClass,
70
71
  slug: drawerSlug,
71
- title: t('fields:editLink') ?? ''
72
- }, initialState !== false && /*#__PURE__*/ React.createElement(Form, {
73
- beforeSubmit: [
74
- onChange
75
- ],
76
- disableValidationOnSubmit: true,
77
- fields: Array.isArray(fieldMap) ? fieldMap : [],
78
- initialState: initialState,
79
- onChange: [
80
- onChange
81
- ],
82
- onSubmit: handleModalSubmit,
83
- uuid: uuid()
84
- }, /*#__PURE__*/ React.createElement(RenderFields, {
85
- fieldMap: Array.isArray(fieldMap) ? fieldMap : [],
86
- forceRender: true,
87
- path: "" // See Blocks feature path for details as for why this is empty
88
- ,
89
- readOnly: false,
90
- schemaPath: schemaFieldsPath
91
- }), /*#__PURE__*/ React.createElement(FormSubmit, null, t('general:submit'))));
72
+ title: t('fields:editLink') ?? '',
73
+ children: initialState !== false && /*#__PURE__*/ _jsxs(Form, {
74
+ beforeSubmit: [
75
+ onChange
76
+ ],
77
+ disableValidationOnSubmit: true,
78
+ fields: Array.isArray(fieldMap) ? fieldMap : [],
79
+ initialState: initialState,
80
+ onChange: [
81
+ onChange
82
+ ],
83
+ onSubmit: handleModalSubmit,
84
+ uuid: uuid(),
85
+ children: [
86
+ /*#__PURE__*/ _jsx(RenderFields, {
87
+ fieldMap: Array.isArray(fieldMap) ? fieldMap : [],
88
+ forceRender: true,
89
+ path: "" // See Blocks feature path for details as for why this is empty
90
+ ,
91
+ readOnly: false,
92
+ schemaPath: schemaFieldsPath
93
+ }),
94
+ /*#__PURE__*/ _jsx(FormSubmit, {
95
+ children: t('general:submit')
96
+ })
97
+ ]
98
+ })
99
+ });
92
100
  };
93
101
 
94
102
  //# sourceMappingURL=index.js.map
@@ -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=\"\" // 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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AAIF;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,GAAG,+DAA+D;;QACvEC,UAAU;QACVjC,YAAYO;sBAGd,oBAAC1B,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,yDAAwD;AAC/F,OAAO,eAAc;AAGrB,MAAMC,YAAY;AAElB,OAAO,MAAMC,aAA8B,CAAC,EAAEC,UAAU,EAAEC,iBAAiB,EAAEC,SAAS,EAAE;IACtF,MAAM,EAAEC,CAAC,EAAE,GAAGd;IACd,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BO,yBAAyB;YACzBC,QAAQC,MAAMC,OAAO,CAACrB,YAAYA,WAAW,EAAE;YAC/CN,cAAcA;YACdiB,UAAU;gBAACA;aAAS;YACpBW,UAAUlC;YACVL,MAAMA;;8BAEN,KAACX;oBACC4B,UAAUoB,MAAMC,OAAO,CAACrB,YAAYA,WAAW,EAAE;oBACjDuB,WAAW;oBACXC,MAAK,GAAG,+DAA+D;;oBACvEC,UAAU;oBACVjC,YAAYO;;8BAGd,KAAC1B;8BAAYiB,EAAE;;;;;AAKzB,EAAC"}
@@ -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;AAyFvD,eAAO,MAAM,0BAA0B;;;;;;;;;;;;GAA2C,CAAA"}
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;AAgBxE,MAAM,MAAM,WAAW,GAAG,6BAA6B,CAAA;AA4FvD,eAAO,MAAM,0BAA0B;;;;;;;;;;;;GAA2C,CAAA"}
@@ -5,6 +5,7 @@ import { LinkIcon } from '../../lexical/ui/icons/Link/index.js';
5
5
  import { getSelectedNode } from '../../lexical/utils/getSelectedNode.js';
6
6
  import { createClientComponent } from '../createClientComponent.js';
7
7
  import { toolbarFeatureButtonsGroupWithItems } from '../shared/toolbar/featureButtonsGroup.js';
8
+ import { LinkMarkdownTransformer } from './markdownTransformer.js';
8
9
  import { AutoLinkNode } from './nodes/AutoLinkNode.js';
9
10
  import { $isLinkNode, LinkNode, TOGGLE_LINK_COMMAND } from './nodes/LinkNode.js';
10
11
  import { AutoLinkPlugin } from './plugins/autoLink/index.js';
@@ -28,7 +29,9 @@ const toolbarGroups = [
28
29
  return !!($isRangeSelection(selection) && $getSelection()?.getTextContent()?.length);
29
30
  },
30
31
  key: 'link',
31
- label: `Link`,
32
+ label: ({ i18n })=>{
33
+ return i18n.t('lexical:link:label');
34
+ },
32
35
  onSelect: ({ editor, isActive })=>{
33
36
  if (!isActive) {
34
37
  let selectedText = null;
@@ -66,6 +69,9 @@ const LinkFeatureClient = (props)=>{
66
69
  clientFeatureProps: props,
67
70
  feature: ()=>({
68
71
  clientFeatureProps: props,
72
+ markdownTransformers: [
73
+ LinkMarkdownTransformer
74
+ ],
69
75
  nodes: [
70
76
  LinkNode,
71
77
  AutoLinkNode
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/field/features/link/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport type { LexicalNode } from 'lexical'\n\nimport { $findMatchingParent } from '@lexical/utils'\nimport { $getSelection, $isRangeSelection } from 'lexical'\n\nimport type { ToolbarGroup } from '../toolbars/types.js'\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 { createClientComponent } from '../createClientComponent.js'\nimport { toolbarFeatureButtonsGroupWithItems } from '../shared/toolbar/featureButtonsGroup.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 toolbarGroups: ToolbarGroup[] = [\n toolbarFeatureButtonsGroupWithItems([\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 isEnabled: ({ selection }) => {\n return !!($isRangeSelection(selection) && $getSelection()?.getTextContent()?.length)\n },\n key: 'link',\n label: `Link`,\n onSelect: ({ editor, isActive }) => {\n if (!isActive) {\n let selectedText: string = null\n let selectedNodes: LexicalNode[] = []\n editor.getEditorState().read(() => {\n selectedText = $getSelection()?.getTextContent()\n // We need to selected nodes here before the drawer opens, as clicking around in the drawer may change the original selection\n selectedNodes = $getSelection()?.getNodes() ?? []\n })\n\n if (!selectedText?.length) {\n return\n }\n\n const linkFields: LinkFields = {\n doc: null,\n linkType: 'custom',\n newTab: false,\n url: 'https://',\n }\n\n editor.dispatchCommand(TOGGLE_LINK_WITH_MODAL_COMMAND, {\n fields: linkFields,\n selectedNodes,\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\nconst LinkFeatureClient: FeatureProviderProviderClient<ClientProps> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\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 toolbarFixed: {\n groups: toolbarGroups,\n },\n toolbarInline: {\n groups: toolbarGroups,\n },\n }),\n }\n}\n\nexport const LinkFeatureClientComponent = createClientComponent(LinkFeatureClient)\n"],"names":["$findMatchingParent","$getSelection","$isRangeSelection","LinkIcon","getSelectedNode","createClientComponent","toolbarFeatureButtonsGroupWithItems","AutoLinkNode","$isLinkNode","LinkNode","TOGGLE_LINK_COMMAND","AutoLinkPlugin","ClickableLinkPlugin","TOGGLE_LINK_WITH_MODAL_COMMAND","FloatingLinkEditorPlugin","LinkPlugin","toolbarGroups","ChildComponent","isActive","selection","selectedNode","linkParent","isEnabled","getTextContent","length","key","label","onSelect","editor","selectedText","selectedNodes","getEditorState","read","getNodes","linkFields","doc","linkType","newTab","url","dispatchCommand","fields","text","order","LinkFeatureClient","props","clientFeatureProps","feature","nodes","plugins","Component","position","toolbarFixed","groups","toolbarInline","LinkFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,SAASA,mBAAmB,QAAQ,iBAAgB;AACpD,SAASC,aAAa,EAAEC,iBAAiB,QAAQ,UAAS;AAO1D,SAASC,QAAQ,QAAQ,uCAAsC;AAC/D,SAASC,eAAe,QAAQ,yCAAwC;AACxE,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,mCAAmC,QAAQ,2CAA0C;AAC9F,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,gBAAgC;IACpCV,oCAAoC;QAClC;YACEW,gBAAgBd;YAChBe,UAAU,CAAC,EAAEC,SAAS,EAAE;gBACtB,IAAIjB,kBAAkBiB,YAAY;oBAChC,MAAMC,eAAehB,gBAAgBe;oBACrC,MAAME,aAAarB,oBAAoBoB,cAAcZ;oBACrD,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BjD,sBAAsBsC,mBAAkB"}
1
+ {"version":3,"sources":["../../../../src/field/features/link/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport type { LexicalNode } from 'lexical'\n\nimport { $findMatchingParent } from '@lexical/utils'\nimport { $getSelection, $isRangeSelection } from 'lexical'\n\nimport type { ToolbarGroup } from '../toolbars/types.js'\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 { createClientComponent } from '../createClientComponent.js'\nimport { toolbarFeatureButtonsGroupWithItems } from '../shared/toolbar/featureButtonsGroup.js'\nimport { LinkMarkdownTransformer } from './markdownTransformer.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 toolbarGroups: ToolbarGroup[] = [\n toolbarFeatureButtonsGroupWithItems([\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 isEnabled: ({ selection }) => {\n return !!($isRangeSelection(selection) && $getSelection()?.getTextContent()?.length)\n },\n key: 'link',\n label: ({ i18n }) => {\n return i18n.t('lexical:link:label')\n },\n onSelect: ({ editor, isActive }) => {\n if (!isActive) {\n let selectedText: string = null\n let selectedNodes: LexicalNode[] = []\n editor.getEditorState().read(() => {\n selectedText = $getSelection()?.getTextContent()\n // We need to selected nodes here before the drawer opens, as clicking around in the drawer may change the original selection\n selectedNodes = $getSelection()?.getNodes() ?? []\n })\n\n if (!selectedText?.length) {\n return\n }\n\n const linkFields: LinkFields = {\n doc: null,\n linkType: 'custom',\n newTab: false,\n url: 'https://',\n }\n\n editor.dispatchCommand(TOGGLE_LINK_WITH_MODAL_COMMAND, {\n fields: linkFields,\n selectedNodes,\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\nconst LinkFeatureClient: FeatureProviderProviderClient<ClientProps> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n markdownTransformers: [LinkMarkdownTransformer],\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 toolbarFixed: {\n groups: toolbarGroups,\n },\n toolbarInline: {\n groups: toolbarGroups,\n },\n }),\n }\n}\n\nexport const LinkFeatureClientComponent = createClientComponent(LinkFeatureClient)\n"],"names":["$findMatchingParent","$getSelection","$isRangeSelection","LinkIcon","getSelectedNode","createClientComponent","toolbarFeatureButtonsGroupWithItems","LinkMarkdownTransformer","AutoLinkNode","$isLinkNode","LinkNode","TOGGLE_LINK_COMMAND","AutoLinkPlugin","ClickableLinkPlugin","TOGGLE_LINK_WITH_MODAL_COMMAND","FloatingLinkEditorPlugin","LinkPlugin","toolbarGroups","ChildComponent","isActive","selection","selectedNode","linkParent","isEnabled","getTextContent","length","key","label","i18n","t","onSelect","editor","selectedText","selectedNodes","getEditorState","read","getNodes","linkFields","doc","linkType","newTab","url","dispatchCommand","fields","text","order","LinkFeatureClient","props","clientFeatureProps","feature","markdownTransformers","nodes","plugins","Component","position","toolbarFixed","groups","toolbarInline","LinkFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,SAASA,mBAAmB,QAAQ,iBAAgB;AACpD,SAASC,aAAa,EAAEC,iBAAiB,QAAQ,UAAS;AAO1D,SAASC,QAAQ,QAAQ,uCAAsC;AAC/D,SAASC,eAAe,QAAQ,yCAAwC;AACxE,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,mCAAmC,QAAQ,2CAA0C;AAC9F,SAASC,uBAAuB,QAAQ,2BAA0B;AAClE,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,gBAAgC;IACpCX,oCAAoC;QAClC;YACEY,gBAAgBf;YAChBgB,UAAU,CAAC,EAAEC,SAAS,EAAE;gBACtB,IAAIlB,kBAAkBkB,YAAY;oBAChC,MAAMC,eAAejB,gBAAgBgB;oBACrC,MAAME,aAAatB,oBAAoBqB,cAAcZ;oBACrD,OAAOa,cAAc;gBACvB;gBACA,OAAO;YACT;YACAC,WAAW,CAAC,EAAEH,SAAS,EAAE;gBACvB,OAAO,CAAC,CAAElB,CAAAA,kBAAkBkB,cAAcnB,iBAAiBuB,kBAAkBC,MAAK;YACpF;YACAC,KAAK;YACLC,OAAO,CAAC,EAAEC,IAAI,EAAE;gBACd,OAAOA,KAAKC,CAAC,CAAC;YAChB;YACAC,UAAU,CAAC,EAAEC,MAAM,EAAEZ,QAAQ,EAAE;gBAC7B,IAAI,CAACA,UAAU;oBACb,IAAIa,eAAuB;oBAC3B,IAAIC,gBAA+B,EAAE;oBACrCF,OAAOG,cAAc,GAAGC,IAAI,CAAC;wBAC3BH,eAAe/B,iBAAiBuB;wBAChC,6HAA6H;wBAC7HS,gBAAgBhC,iBAAiBmC,cAAc,EAAE;oBACnD;oBAEA,IAAI,CAACJ,cAAcP,QAAQ;wBACzB;oBACF;oBAEA,MAAMY,aAAyB;wBAC7BC,KAAK;wBACLC,UAAU;wBACVC,QAAQ;wBACRC,KAAK;oBACP;oBAEAV,OAAOW,eAAe,CAAC5B,gCAAgC;wBACrD6B,QAAQN;wBACRJ;wBACAW,MAAMZ;oBACR;gBACF,OAAO;oBACL,cAAc;oBACdD,OAAOW,eAAe,CAAC/B,qBAAqB;gBAC9C;YACF;YACAkC,OAAO;QACT;KACD;CACF;AAED,MAAMC,oBAAgE,CAACC;IACrE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,sBAAsB;oBAAC3C;iBAAwB;gBAC/C4C,OAAO;oBAACzC;oBAAUF;iBAAa;gBAC/B4C,SAAS;oBACP;wBACEC,WAAWrC;wBACXsC,UAAU;oBACZ;oBACA;wBACED,WAAWzC;wBACX0C,UAAU;oBACZ;oBACA;wBACED,WAAWxC;wBACXyC,UAAU;oBACZ;oBACA;wBACED,WAAWtC;wBACXuC,UAAU;oBACZ;iBACD;gBACDC,cAAc;oBACZC,QAAQvC;gBACV;gBACAwC,eAAe;oBACbD,QAAQvC;gBACV;YACF,CAAA;IACF;AACF;AAEA,OAAO,MAAMyC,6BAA6BrD,sBAAsByC,mBAAkB"}
@@ -1 +1 @@
1
- {"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../../src/field/features/link/feature.server.ts"],"names":[],"mappings":"AAAA,OAAO,KA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AE,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,EAAE,CAAC,CAAC,IAAI,EAAE;QAAE,MAAM,EAAE,eAAe,CAAC;QAAC,aAAa,EAAE,KAAK,EAAE,CAAA;KAAE,KAAK,KAAK,EAAE,CAAC,GAAG,KAAK,EAAE,CAAA;IAC3F;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,6BAA6B,CAAC,sBAAsB,EAAE,WAAW,CAwI1F,CAAA"}
@@ -4,6 +4,8 @@ import { deepCopyObject } from 'payload/utilities';
4
4
  import { convertLexicalNodesToHTML } from '../converters/html/converter/index.js';
5
5
  import { createNode } from '../typeUtilities.js';
6
6
  import { LinkFeatureClientComponent } from './feature.client.js';
7
+ import { i18n } from './i18n.js';
8
+ import { LinkMarkdownTransformer } from './markdownTransformer.js';
7
9
  import { AutoLinkNode } from './nodes/AutoLinkNode.js';
8
10
  import { LinkNode } from './nodes/LinkNode.js';
9
11
  import { transformExtraFields } from './plugins/floatingLinkEditor/utilities.js';
@@ -47,6 +49,10 @@ export const LinkFeature = (props)=>{
47
49
  });
48
50
  return schemaMap;
49
51
  },
52
+ i18n,
53
+ markdownTransformers: [
54
+ LinkMarkdownTransformer
55
+ ],
50
56
  nodes: [
51
57
  createNode({
52
58
  converters: {
@@ -62,11 +68,12 @@ export const LinkFeature = (props)=>{
62
68
  payload
63
69
  });
64
70
  const rel = node.fields.newTab ? ' rel="noopener noreferrer"' : '';
71
+ const target = node.fields.newTab ? ' target="_blank"' : '';
65
72
  let href = node.fields.url;
66
73
  if (node.fields.linkType === 'internal') {
67
74
  href = typeof node.fields.doc?.value === 'string' ? node.fields.doc?.value : node.fields.doc?.value?.id;
68
75
  }
69
- return `<a href="${href}"${rel}>${childrenText}</a>`;
76
+ return `<a href="${href}"${target}${rel}>${childrenText}</a>`;
70
77
  },
71
78
  nodeTypes: [
72
79
  AutoLinkNode.getType()
@@ -102,8 +109,9 @@ export const LinkFeature = (props)=>{
102
109
  payload
103
110
  });
104
111
  const rel = node.fields.newTab ? ' rel="noopener noreferrer"' : '';
112
+ const target = node.fields.newTab ? ' target="_blank"' : '';
105
113
  const href = node.fields.linkType === 'custom' ? node.fields.url : node.fields.doc?.value;
106
- return `<a href="${href}"${rel}>${childrenText}</a>`;
114
+ return `<a href="${href}"${target}${rel}>${childrenText}</a>`;
107
115
  },
108
116
  nodeTypes: [
109
117
  LinkNode.getType()
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/field/features/link/feature.server.ts"],"sourcesContent":["import type { Config, SanitizedConfig } from 'payload/config'\nimport type { Field } 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?: ((args: { config: SanitizedConfig; defaultFields: Field[] }) => Field[]) | Field[]\n /**\n * Sets a maximum population depth for the internal doc default field of link, regardless of the remaining depth when the field is reached.\n * This behaves exactly like the maxDepth properties of relationship and upload fields.\n *\n * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth}\n */\n maxDepth?: number\n}\n\nexport const LinkFeature: FeatureProviderProviderServer<LinkFeatureServerProps, ClientProps> = (\n props,\n) => {\n if (!props) {\n props = {}\n }\n return {\n feature: async ({ config: _config, isRoot }) => {\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 props.maxDepth,\n )\n\n const sanitizedFields = await sanitizeFields({\n config: _config as unknown as Config,\n fields: _transformedFields,\n requireFieldLevelRichTextEditor: isRoot,\n validRelationships,\n })\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","isRoot","validRelationships","collections","map","c","slug","_transformedFields","fields","enabledCollections","disabledCollections","maxDepth","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,SAASC,0BAA0B,QAAQ,sBAAqB;AAChE,SAASC,YAAY,QAAQ,0BAAyB;AACtD,SAASC,QAAQ,QAAQ,sBAAqB;AAC9C,SAASC,oBAAoB,QAAQ,4CAA2C;AAChF,SAASC,wBAAwB,QAAQ,yBAAwB;AACjE,SAASC,cAAc,QAAQ,gBAAe;AAuC9C,OAAO,MAAMC,cAAkF,CAC7FC;IAEA,IAAI,CAACA,OAAO;QACVA,QAAQ,CAAC;IACX;IACA,OAAO;QACLC,SAAS,OAAO,EAAEC,QAAQC,OAAO,EAAEC,MAAM,EAAE;YACzC,MAAMC,qBAAqBF,QAAQG,WAAW,CAACC,GAAG,CAAC,CAACC,IAAMA,EAAEC,IAAI,KAAK,EAAE;YAEvE,MAAMC,qBAAqBd,qBACzBN,eAAeU,MAAMW,MAAM,GAC3BR,SACAH,MAAMY,kBAAkB,EACxBZ,MAAMa,mBAAmB,EACzBb,MAAMc,QAAQ;YAGhB,MAAMC,kBAAkB,MAAM1B,eAAe;gBAC3Ca,QAAQC;gBACRQ,QAAQD;gBACRM,iCAAiCZ;gBACjCC;YACF;YACAL,MAAMW,MAAM,GAAGI;YAEf,OAAO;gBACLE,iBAAiBxB;gBACjByB,oBAAoB;oBAClBL,qBAAqBb,MAAMa,mBAAmB;oBA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wBACAC,OAAO;4BACLC,WAAW;gCACT,CAAC,EAAEjB,IAAI,EAAE;oCACP,OAAOA;gCACT;6BACD;wBACH;wBACAA,MAAMtC;wBACNwD,oBAAoB;4BAACrD,yBAAyBG;yBAAO;wBACrDmD,aAAa;4BAACrD,eAAeE;yBAAO;oBACtC;oBACAR,WAAW;wBACTqC,YAAY;4BACVC,MAAM;gCACJC,WAAW,OAAO,EAAEF,UAAU,EAAEG,IAAI,EAAEC,MAAM,EAAEC,OAAO,EAAE;oCACrD,MAAMC,eAAe,MAAM5C,0BAA0B;wCACnDsC;wCACAO,cAAcJ,KAAKK,QAAQ;wCAC3BJ,QAAQ;4CACN,GAAGD,IAAI;4CACPC;wCACF;wCACAC;oCACF;oCAEA,MAAMI,MAAcN,KAAKrB,MAAM,CAAC4B,MAAM,GAAG,+BAA+B;oCAExE,MAAMC,OACJR,KAAKrB,MAAM,CAAC+B,QAAQ,KAAK,WACrBV,KAAKrB,MAAM,CAAC8B,GAAG,GACdT,KAAKrB,MAAM,CAACgC,GAAG,EAAEC;oCAExB,OAAO,CAAC,SAAS,EAAEJ,KAAK,CAAC,EAAEF,IAAI,CAAC,EAAEH,aAAa,IAAI,CAAC;gCACtD;gCACAW,WAAW;oCAACnD,SAASoD,OAAO;iCAAG;4BACjC;wBACF;wBACAf,MAAMrC;wBACNuD,oBAAoB;4BAACrD,yBAAyBG;yBAAO;wBACrDmD,aAAa;4BAACrD,eAAeE;yBAAO;oBACtC;iBACD;gBACDoD,oBAAoBpD;YACtB;QACF;QACAqD,KAAK;QACLD,oBAAoBpD;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 } 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 { i18n } from './i18n.js'\nimport { LinkMarkdownTransformer } from './markdownTransformer.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?: ((args: { config: SanitizedConfig; defaultFields: Field[] }) => Field[]) | Field[]\n /**\n * Sets a maximum population depth for the internal doc default field of link, regardless of the remaining depth when the field is reached.\n * This behaves exactly like the maxDepth properties of relationship and upload fields.\n *\n * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth}\n */\n maxDepth?: number\n}\n\nexport const LinkFeature: FeatureProviderProviderServer<LinkFeatureServerProps, ClientProps> = (\n props,\n) => {\n if (!props) {\n props = {}\n }\n return {\n feature: async ({ config: _config, isRoot }) => {\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 props.maxDepth,\n )\n\n const sanitizedFields = await sanitizeFields({\n config: _config as unknown as Config,\n fields: _transformedFields,\n requireFieldLevelRichTextEditor: isRoot,\n validRelationships,\n })\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 i18n,\n markdownTransformers: [LinkMarkdownTransformer],\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 const target: string = node.fields.newTab ? ' target=\"_blank\"' : ''\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}\"${target}${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 const target: string = node.fields.newTab ? ' target=\"_blank\"' : ''\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}\"${target}${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","i18n","LinkMarkdownTransformer","AutoLinkNode","LinkNode","transformExtraFields","linkPopulationPromiseHOC","linkValidation","LinkFeature","props","feature","config","_config","isRoot","validRelationships","collections","map","c","slug","_transformedFields","fields","enabledCollections","disabledCollections","maxDepth","sanitizedFields","requireFieldLevelRichTextEditor","ClientComponent","clientFeatureProps","generateSchemaMap","Array","isArray","length","schemaMap","Map","set","schemaPath","markdownTransformers","nodes","converters","html","converter","node","parent","payload","childrenText","lexicalNodes","children","rel","newTab","target","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,SAASC,0BAA0B,QAAQ,sBAAqB;AAChE,SAASC,IAAI,QAAQ,YAAW;AAChC,SAASC,uBAAuB,QAAQ,2BAA0B;AAClE,SAAS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nDwC;wCACAO,cAAcJ,KAAKK,QAAQ;wCAC3BJ,QAAQ;4CACN,GAAGD,IAAI;4CACPC;wCACF;wCACAC;oCACF;oCAEA,MAAMI,MAAcN,KAAKrB,MAAM,CAAC4B,MAAM,GAAG,+BAA+B;oCACxE,MAAMC,SAAiBR,KAAKrB,MAAM,CAAC4B,MAAM,GAAG,qBAAqB;oCAEjE,MAAME,OACJT,KAAKrB,MAAM,CAACgC,QAAQ,KAAK,WACrBX,KAAKrB,MAAM,CAAC+B,GAAG,GACdV,KAAKrB,MAAM,CAACiC,GAAG,EAAEC;oCAExB,OAAO,CAAC,SAAS,EAAEJ,KAAK,CAAC,EAAED,OAAO,EAAEF,IAAI,CAAC,EAAEH,aAAa,IAAI,CAAC;gCAC/D;gCACAY,WAAW;oCAACpD,SAASqD,OAAO;iCAAG;4BACjC;wBACF;wBACAhB,MAAMrC;wBACNwD,oBAAoB;4BAACtD,yBAAyBG;yBAAO;wBACrDoD,aAAa;4BAACtD,eAAeE;yBAAO;oBACtC;iBACD;gBACDqD,oBAAoBrD;YACtB;QACF;QACAsD,KAAK;QACLD,oBAAoBrD;IACtB;AACF,EAAC"}
@@ -0,0 +1,3 @@
1
+ import type { GenericLanguages } from '@payloadcms/translations';
2
+ export declare const i18n: Partial<GenericLanguages>;
3
+ //# sourceMappingURL=i18n.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../../src/field/features/link/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAEhE,eAAO,MAAM,IAAI,EAAE,OAAO,CAAC,gBAAgB,CAiG1C,CAAA"}
@@ -0,0 +1,100 @@
1
+ export const i18n = {
2
+ ar: {
3
+ label: 'رابط'
4
+ },
5
+ az: {
6
+ label: 'Keçid'
7
+ },
8
+ bg: {
9
+ label: 'Връзка'
10
+ },
11
+ cs: {
12
+ label: 'Odkaz'
13
+ },
14
+ de: {
15
+ label: 'Verknüpfung'
16
+ },
17
+ en: {
18
+ label: 'Link'
19
+ },
20
+ es: {
21
+ label: 'Enlace'
22
+ },
23
+ fa: {
24
+ label: 'پیوند'
25
+ },
26
+ fr: {
27
+ label: 'Lien'
28
+ },
29
+ he: {
30
+ label: 'קישור'
31
+ },
32
+ hr: {
33
+ label: 'Poveznica'
34
+ },
35
+ hu: {
36
+ label: 'Hivatkozás'
37
+ },
38
+ it: {
39
+ label: 'Collegamento'
40
+ },
41
+ ja: {
42
+ label: 'リンク'
43
+ },
44
+ ko: {
45
+ label: '링크'
46
+ },
47
+ my: {
48
+ label: 'လင့်'
49
+ },
50
+ nb: {
51
+ label: 'Lenke'
52
+ },
53
+ nl: {
54
+ label: 'Link'
55
+ },
56
+ pl: {
57
+ label: 'Łącze'
58
+ },
59
+ pt: {
60
+ label: 'Ligação'
61
+ },
62
+ ro: {
63
+ label: 'Legătură'
64
+ },
65
+ rs: {
66
+ label: 'Veza'
67
+ },
68
+ 'rs-latin': {
69
+ label: 'Veza'
70
+ },
71
+ ru: {
72
+ label: 'Ссылка'
73
+ },
74
+ sk: {
75
+ label: 'Odkaz'
76
+ },
77
+ sv: {
78
+ label: 'Länk'
79
+ },
80
+ th: {
81
+ label: 'ลิงค์'
82
+ },
83
+ tr: {
84
+ label: 'Bağlantı'
85
+ },
86
+ uk: {
87
+ label: 'Посилання'
88
+ },
89
+ vi: {
90
+ label: 'Liên kết'
91
+ },
92
+ zh: {
93
+ label: '链接'
94
+ },
95
+ 'zh-TW': {
96
+ label: '連結'
97
+ }
98
+ };
99
+
100
+ //# sourceMappingURL=i18n.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/field/features/link/i18n.ts"],"sourcesContent":["import type { GenericLanguages } from '@payloadcms/translations'\n\nexport const i18n: Partial<GenericLanguages> = {\n ar: {\n label: 'رابط',\n },\n az: {\n label: 'Keçid',\n },\n bg: {\n label: 'Връзка',\n },\n cs: {\n label: 'Odkaz',\n },\n de: {\n label: 'Verknüpfung',\n },\n en: {\n label: 'Link',\n },\n es: {\n label: 'Enlace',\n },\n fa: {\n label: 'پیوند',\n },\n fr: {\n label: 'Lien',\n },\n he: {\n label: 'קישור',\n },\n hr: {\n label: 'Poveznica',\n },\n hu: {\n label: 'Hivatkozás',\n },\n it: {\n label: 'Collegamento',\n },\n ja: {\n label: 'リンク',\n },\n ko: {\n label: '링크',\n },\n my: {\n label: 'လင့်',\n },\n nb: {\n label: 'Lenke',\n },\n nl: {\n label: 'Link',\n },\n pl: {\n label: 'Łącze',\n },\n pt: {\n label: 'Ligação',\n },\n ro: {\n label: 'Legătură',\n },\n rs: {\n label: 'Veza',\n },\n 'rs-latin': {\n label: 'Veza',\n },\n ru: {\n label: 'Ссылка',\n },\n sk: {\n label: 'Odkaz',\n },\n sv: {\n label: 'Länk',\n },\n th: {\n label: 'ลิงค์',\n },\n tr: {\n label: 'Bağlantı',\n },\n uk: {\n label: 'Посилання',\n },\n vi: {\n label: 'Liên kết',\n },\n zh: {\n label: '链接',\n },\n 'zh-TW': {\n label: '連結',\n },\n}\n"],"names":["i18n","ar","label","az","bg","cs","de","en","es","fa","fr","he","hr","hu","it","ja","ko","my","nb","nl","pl","pt","ro","rs","ru","sk","sv","th","tr","uk","vi","zh"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,OAAO,MAAMA,OAAkC;IAC7CC,IAAI;QACFC,OAAO;IACT;IACAC,IAAI;QACFD,OAAO;IACT;IACAE,IAAI;QACFF,OAAO;IACT;IACAG,IAAI;QACFH,OAAO;IACT;IACAI,IAAI;QACFJ,OAAO;IACT;IACAK,IAAI;QACFL,OAAO;IACT;IACAM,IAAI;QACFN,OAAO;IACT;IACAO,IAAI;QACFP,OAAO;IACT;IACAQ,IAAI;QACFR,OAAO;IACT;IACAS,IAAI;QACFT,OAAO;IACT;IACAU,IAAI;QACFV,OAAO;IACT;IACAW,IAAI;QACFX,OAAO;IACT;IACAY,IAAI;QACFZ,OAAO;IACT;IACAa,IAAI;QACFb,OAAO;IACT;IACAc,IAAI;QACFd,OAAO;IACT;IACAe,IAAI;QACFf,OAAO;IACT;IACAgB,IAAI;QACFhB,OAAO;IACT;IACAiB,IAAI;QACFjB,OAAO;IACT;IACAkB,IAAI;QACFlB,OAAO;IACT;IACAmB,IAAI;QACFnB,OAAO;IACT;IACAoB,IAAI;QACFpB,OAAO;IACT;IACAqB,IAAI;QACFrB,OAAO;IACT;IACA,YAAY;QACVA,OAAO;IACT;IACAsB,IAAI;QACFtB,OAAO;IACT;IACAuB,IAAI;QACFvB,OAAO;IACT;IACAwB,IAAI;QACFxB,OAAO;IACT;IACAyB,IAAI;QACFzB,OAAO;IACT;IACA0B,IAAI;QACF1B,OAAO;IACT;IACA2B,IAAI;QACF3B,OAAO;IACT;IACA4B,IAAI;QACF5B,OAAO;IACT;IACA6B,IAAI;QACF7B,OAAO;IACT;IACA,SAAS;QACPA,OAAO;IACT;AACF,EAAC"}
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Code taken from https://github.com/facebook/lexical/blob/main/packages/lexical-markdown/src/MarkdownTransformers.ts#L357
3
+ */
4
+ import type { TextMatchTransformer } from '@lexical/markdown';
5
+ export declare const LinkMarkdownTransformer: TextMatchTransformer;
6
+ //# sourceMappingURL=markdownTransformer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdownTransformer.d.ts","sourceRoot":"","sources":["../../../../src/field/features/link/markdownTransformer.ts"],"names":[],"mappings":"AAAA;;GAEG;AAMH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAA;AAO7D,eAAO,MAAM,uBAAuB,EAAE,oBAqCrC,CAAA"}
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Code taken from https://github.com/facebook/lexical/blob/main/packages/lexical-markdown/src/MarkdownTransformers.ts#L357
3
+ */ // Order of text transformers matters:
4
+ //
5
+ // - code should go first as it prevents any transformations inside
6
+ import { $createTextNode, $isTextNode } from 'lexical';
7
+ import { $createLinkNode, $isLinkNode, LinkNode } from './nodes/LinkNode.js';
8
+ // - then longer tags match (e.g. ** or __ should go before * or _)
9
+ export const LinkMarkdownTransformer = {
10
+ type: 'text-match',
11
+ dependencies: [
12
+ LinkNode
13
+ ],
14
+ export: (_node, exportChildren, exportFormat)=>{
15
+ if (!$isLinkNode(_node)) {
16
+ return null;
17
+ }
18
+ const node = _node;
19
+ const { url } = node.getFields();
20
+ const linkContent = `[${node.getTextContent()}](${url})`;
21
+ const firstChild = node.getFirstChild();
22
+ // Add text styles only if link has single text node inside. If it's more
23
+ // then one we ignore it as markdown does not support nested styles for links
24
+ if (node.getChildrenSize() === 1 && $isTextNode(firstChild)) {
25
+ return exportFormat(firstChild, linkContent);
26
+ } else {
27
+ return linkContent;
28
+ }
29
+ },
30
+ importRegExp: /\[([^[]+)\]\(([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?\)/,
31
+ regExp: /\[([^[]+)\]\(([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?\)$/,
32
+ replace: (textNode, match)=>{
33
+ const [, linkText, linkUrl] = match;
34
+ const linkNode = $createLinkNode({
35
+ fields: {
36
+ doc: null,
37
+ linkType: 'custom',
38
+ newTab: false,
39
+ url: linkUrl
40
+ }
41
+ });
42
+ const linkTextNode = $createTextNode(linkText);
43
+ linkTextNode.setFormat(textNode.getFormat());
44
+ linkNode.append(linkTextNode);
45
+ textNode.replace(linkNode);
46
+ },
47
+ trigger: ')'
48
+ };
49
+
50
+ //# sourceMappingURL=markdownTransformer.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/field/features/link/markdownTransformer.ts"],"sourcesContent":["/**\n * Code taken from https://github.com/facebook/lexical/blob/main/packages/lexical-markdown/src/MarkdownTransformers.ts#L357\n */\n\n// Order of text transformers matters:\n//\n// - code should go first as it prevents any transformations inside\n\nimport type { TextMatchTransformer } from '@lexical/markdown'\n\nimport { $createTextNode, $isTextNode } from 'lexical'\n\nimport { $createLinkNode, $isLinkNode, LinkNode } from './nodes/LinkNode.js'\n\n// - then longer tags match (e.g. ** or __ should go before * or _)\nexport const LinkMarkdownTransformer: TextMatchTransformer = {\n type: 'text-match',\n dependencies: [LinkNode],\n export: (_node, exportChildren, exportFormat) => {\n if (!$isLinkNode(_node)) {\n return null\n }\n const node: LinkNode = _node\n const { url } = node.getFields()\n const linkContent = `[${node.getTextContent()}](${url})`\n const firstChild = node.getFirstChild()\n // Add text styles only if link has single text node inside. If it's more\n // then one we ignore it as markdown does not support nested styles for links\n if (node.getChildrenSize() === 1 && $isTextNode(firstChild)) {\n return exportFormat(firstChild, linkContent)\n } else {\n return linkContent\n }\n },\n importRegExp: /\\[([^[]+)\\]\\(([^()\\s]+)(?:\\s\"((?:[^\"]*\\\\\")*[^\"]*)\"\\s*)?\\)/,\n regExp: /\\[([^[]+)\\]\\(([^()\\s]+)(?:\\s\"((?:[^\"]*\\\\\")*[^\"]*)\"\\s*)?\\)$/,\n replace: (textNode, match) => {\n const [, linkText, linkUrl] = match\n const linkNode = $createLinkNode({\n fields: {\n doc: null,\n linkType: 'custom',\n newTab: false,\n url: linkUrl,\n },\n })\n const linkTextNode = $createTextNode(linkText)\n linkTextNode.setFormat(textNode.getFormat())\n linkNode.append(linkTextNode)\n textNode.replace(linkNode)\n },\n trigger: ')',\n}\n"],"names":["$createTextNode","$isTextNode","$createLinkNode","$isLinkNode","LinkNode","LinkMarkdownTransformer","type","dependencies","export","_node","exportChildren","exportFormat","node","url","getFields","linkContent","getTextContent","firstChild","getFirstChild","getChildrenSize","importRegExp","regExp","replace","textNode","match","linkText","linkUrl","linkNode","fields","doc","linkType","newTab","linkTextNode","setFormat","getFormat","append","trigger"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;CAEC,GAED,sCAAsC;AACtC,EAAE;AACF,mEAAmE;AAInE,SAASA,eAAe,EAAEC,WAAW,QAAQ,UAAS;AAEtD,SAASC,eAAe,EAAEC,WAAW,EAAEC,QAAQ,QAAQ,sBAAqB;AAE5E,mEAAmE;AACnE,OAAO,MAAMC,0BAAgD;IAC3DC,MAAM;IACNC,cAAc;QAACH;KAAS;IACxBI,QAAQ,CAACC,OAAOC,gBAAgBC;QAC9B,IAAI,CAACR,YAAYM,QAAQ;YACvB,OAAO;QACT;QACA,MAAMG,OAAiBH;QACvB,MAAM,EAAEI,GAAG,EAAE,GAAGD,KAAKE,SAAS;QAC9B,MAAMC,cAAc,CAAC,CAAC,EAAEH,KAAKI,cAAc,GAAG,EAAE,EAAEH,IAAI,CAAC,CAAC;QACxD,MAAMI,aAAaL,KAAKM,aAAa;QACrC,yEAAyE;QACzE,6EAA6E;QAC7E,IAAIN,KAAKO,eAAe,OAAO,KAAKlB,YAAYgB,aAAa;YAC3D,OAAON,aAAaM,YAAYF;QAClC,OAAO;YACL,OAAOA;QACT;IACF;IACAK,cAAc;IACdC,QAAQ;IACRC,SAAS,CAACC,UAAUC;QAClB,MAAM,GAAGC,UAAUC,QAAQ,GAAGF;QAC9B,MAAMG,WAAWzB,gBAAgB;YAC/B0B,QAAQ;gBACNC,KAAK;gBACLC,UAAU;gBACVC,QAAQ;gBACRlB,KAAKa;YACP;QACF;QACA,MAAMM,eAAehC,gBAAgByB;QACrCO,aAAaC,SAAS,CAACV,SAASW,SAAS;QACzCP,SAASQ,MAAM,CAACH;QAChBT,SAASD,OAAO,CAACK;IACnB;IACAS,SAAS;AACX,EAAC"}