@payloadcms/richtext-lexical 3.0.0-beta.24 → 3.0.0-beta.26

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 (359) hide show
  1. package/dist/exports/components.d.ts +8 -2
  2. package/dist/exports/components.d.ts.map +1 -1
  3. package/dist/exports/components.js +8 -2
  4. package/dist/exports/components.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 +126 -46
  7. package/dist/field/features/align/feature.client.js.map +1 -1
  8. package/dist/field/features/align/toolbarAlignGroup.d.ts +3 -0
  9. package/dist/field/features/align/toolbarAlignGroup.d.ts.map +1 -0
  10. package/dist/field/features/align/{inlineToolbarAlignGroup.js → toolbarAlignGroup.js} +3 -3
  11. package/dist/field/features/align/toolbarAlignGroup.js.map +1 -0
  12. package/dist/field/features/blockquote/feature.client.d.ts +1 -1
  13. package/dist/field/features/blockquote/feature.client.d.ts.map +1 -1
  14. package/dist/field/features/blockquote/feature.client.js +39 -25
  15. package/dist/field/features/blockquote/feature.client.js.map +1 -1
  16. package/dist/field/features/blockquote/feature.server.d.ts +1 -1
  17. package/dist/field/features/blockquote/feature.server.js +3 -3
  18. package/dist/field/features/blockquote/feature.server.js.map +1 -1
  19. package/dist/field/features/blocks/component/index.d.ts.map +1 -1
  20. package/dist/field/features/blocks/component/index.js +1 -1
  21. package/dist/field/features/blocks/component/index.js.map +1 -1
  22. package/dist/field/features/blocks/feature.client.d.ts.map +1 -1
  23. package/dist/field/features/blocks/feature.client.js +39 -8
  24. package/dist/field/features/blocks/feature.client.js.map +1 -1
  25. package/dist/field/features/blocks/feature.server.d.ts +2 -5
  26. package/dist/field/features/blocks/feature.server.d.ts.map +1 -1
  27. package/dist/field/features/blocks/feature.server.js +2 -2
  28. package/dist/field/features/blocks/feature.server.js.map +1 -1
  29. package/dist/field/features/blocks/plugin/index.d.ts +3 -2
  30. package/dist/field/features/blocks/plugin/index.d.ts.map +1 -1
  31. package/dist/field/features/blocks/plugin/index.js +2 -2
  32. package/dist/field/features/blocks/plugin/index.js.map +1 -1
  33. package/dist/field/features/blocks/populationPromise.d.ts.map +1 -1
  34. package/dist/field/features/blocks/populationPromise.js +2 -1
  35. package/dist/field/features/blocks/populationPromise.js.map +1 -1
  36. package/dist/field/features/debug/testRecorder/plugin/index.d.ts +2 -2
  37. package/dist/field/features/debug/testRecorder/plugin/index.d.ts.map +1 -1
  38. package/dist/field/features/debug/testRecorder/plugin/index.js.map +1 -1
  39. package/dist/field/features/debug/treeView/plugin/index.d.ts +2 -2
  40. package/dist/field/features/debug/treeView/plugin/index.d.ts.map +1 -1
  41. package/dist/field/features/debug/treeView/plugin/index.js +2 -2
  42. package/dist/field/features/debug/treeView/plugin/index.js.map +1 -1
  43. package/dist/field/features/format/bold/feature.client.d.ts.map +1 -1
  44. package/dist/field/features/format/bold/feature.client.js +23 -19
  45. package/dist/field/features/format/bold/feature.client.js.map +1 -1
  46. package/dist/field/features/format/inlineCode/feature.client.d.ts.map +1 -1
  47. package/dist/field/features/format/inlineCode/feature.client.js +23 -19
  48. package/dist/field/features/format/inlineCode/feature.client.js.map +1 -1
  49. package/dist/field/features/format/italic/feature.client.d.ts.map +1 -1
  50. package/dist/field/features/format/italic/feature.client.js +23 -19
  51. package/dist/field/features/format/italic/feature.client.js.map +1 -1
  52. package/dist/field/features/format/shared/toolbarFormatGroup.d.ts +3 -0
  53. package/dist/field/features/format/shared/toolbarFormatGroup.d.ts.map +1 -0
  54. package/dist/field/features/format/shared/toolbarFormatGroup.js +10 -0
  55. package/dist/field/features/format/shared/toolbarFormatGroup.js.map +1 -0
  56. package/dist/field/features/format/strikethrough/feature.client.d.ts.map +1 -1
  57. package/dist/field/features/format/strikethrough/feature.client.js +23 -19
  58. package/dist/field/features/format/strikethrough/feature.client.js.map +1 -1
  59. package/dist/field/features/format/subscript/feature.client.d.ts.map +1 -1
  60. package/dist/field/features/format/subscript/feature.client.js +23 -19
  61. package/dist/field/features/format/subscript/feature.client.js.map +1 -1
  62. package/dist/field/features/format/superscript/feature.client.d.ts.map +1 -1
  63. package/dist/field/features/format/superscript/feature.client.js +23 -19
  64. package/dist/field/features/format/superscript/feature.client.js.map +1 -1
  65. package/dist/field/features/format/underline/feature.client.d.ts.map +1 -1
  66. package/dist/field/features/format/underline/feature.client.js +23 -19
  67. package/dist/field/features/format/underline/feature.client.js.map +1 -1
  68. package/dist/field/features/heading/feature.client.d.ts.map +1 -1
  69. package/dist/field/features/heading/feature.client.js +49 -29
  70. package/dist/field/features/heading/feature.client.js.map +1 -1
  71. package/dist/field/features/horizontalRule/feature.client.d.ts.map +1 -1
  72. package/dist/field/features/horizontalRule/feature.client.js +27 -4
  73. package/dist/field/features/horizontalRule/feature.client.js.map +1 -1
  74. package/dist/field/features/horizontalRule/plugin/index.d.ts +2 -1
  75. package/dist/field/features/horizontalRule/plugin/index.d.ts.map +1 -1
  76. package/dist/field/features/horizontalRule/plugin/index.js +2 -2
  77. package/dist/field/features/horizontalRule/plugin/index.js.map +1 -1
  78. package/dist/field/features/indent/feature.client.d.ts.map +1 -1
  79. package/dist/field/features/indent/feature.client.js +41 -37
  80. package/dist/field/features/indent/feature.client.js.map +1 -1
  81. package/dist/field/features/indent/toolbarIndentGroup.d.ts +3 -0
  82. package/dist/field/features/indent/toolbarIndentGroup.d.ts.map +1 -0
  83. package/dist/field/features/indent/toolbarIndentGroup.js +10 -0
  84. package/dist/field/features/indent/toolbarIndentGroup.js.map +1 -0
  85. package/dist/field/features/link/drawer/baseFields.d.ts +2 -2
  86. package/dist/field/features/link/drawer/baseFields.d.ts.map +1 -1
  87. package/dist/field/features/link/drawer/baseFields.js +2 -1
  88. package/dist/field/features/link/drawer/baseFields.js.map +1 -1
  89. package/dist/field/features/link/drawer/types.d.ts +2 -2
  90. package/dist/field/features/link/drawer/types.d.ts.map +1 -1
  91. package/dist/field/features/link/drawer/types.js.map +1 -1
  92. package/dist/field/features/link/feature.client.d.ts.map +1 -1
  93. package/dist/field/features/link/feature.client.js +54 -40
  94. package/dist/field/features/link/feature.client.js.map +1 -1
  95. package/dist/field/features/link/feature.server.d.ts +10 -3
  96. package/dist/field/features/link/feature.server.d.ts.map +1 -1
  97. package/dist/field/features/link/feature.server.js +3 -3
  98. package/dist/field/features/link/feature.server.js.map +1 -1
  99. package/dist/field/features/link/plugins/autoLink/index.d.ts +3 -2
  100. package/dist/field/features/link/plugins/autoLink/index.d.ts.map +1 -1
  101. package/dist/field/features/link/plugins/autoLink/index.js +2 -2
  102. package/dist/field/features/link/plugins/autoLink/index.js.map +1 -1
  103. package/dist/field/features/link/plugins/clickableLink/index.d.ts +3 -2
  104. package/dist/field/features/link/plugins/clickableLink/index.d.ts.map +1 -1
  105. package/dist/field/features/link/plugins/clickableLink/index.js +2 -2
  106. package/dist/field/features/link/plugins/clickableLink/index.js.map +1 -1
  107. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  108. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js +75 -68
  109. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  110. package/dist/field/features/link/plugins/floatingLinkEditor/index.d.ts +3 -4
  111. package/dist/field/features/link/plugins/floatingLinkEditor/index.d.ts.map +1 -1
  112. package/dist/field/features/link/plugins/floatingLinkEditor/index.js.map +1 -1
  113. package/dist/field/features/link/plugins/floatingLinkEditor/index.scss +2 -2
  114. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts +3 -3
  115. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts.map +1 -1
  116. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js +2 -2
  117. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js.map +1 -1
  118. package/dist/field/features/link/plugins/link/index.d.ts +3 -1
  119. package/dist/field/features/link/plugins/link/index.d.ts.map +1 -1
  120. package/dist/field/features/link/plugins/link/index.js +2 -2
  121. package/dist/field/features/link/plugins/link/index.js.map +1 -1
  122. package/dist/field/features/link/populationPromise.d.ts.map +1 -1
  123. package/dist/field/features/link/populationPromise.js +2 -1
  124. package/dist/field/features/link/populationPromise.js.map +1 -1
  125. package/dist/field/features/link/validate.js.map +1 -1
  126. package/dist/field/features/lists/checklist/feature.client.d.ts.map +1 -1
  127. package/dist/field/features/lists/checklist/feature.client.js +44 -19
  128. package/dist/field/features/lists/checklist/feature.client.js.map +1 -1
  129. package/dist/field/features/lists/checklist/plugin/index.d.ts +2 -2
  130. package/dist/field/features/lists/checklist/plugin/index.d.ts.map +1 -1
  131. package/dist/field/features/lists/checklist/plugin/index.js +2 -2
  132. package/dist/field/features/lists/checklist/plugin/index.js.map +1 -1
  133. package/dist/field/features/lists/orderedList/feature.client.d.ts.map +1 -1
  134. package/dist/field/features/lists/orderedList/feature.client.js +44 -19
  135. package/dist/field/features/lists/orderedList/feature.client.js.map +1 -1
  136. package/dist/field/features/lists/plugin/index.d.ts +2 -2
  137. package/dist/field/features/lists/plugin/index.d.ts.map +1 -1
  138. package/dist/field/features/lists/plugin/index.js +2 -2
  139. package/dist/field/features/lists/plugin/index.js.map +1 -1
  140. package/dist/field/features/lists/unorderedList/feature.client.d.ts.map +1 -1
  141. package/dist/field/features/lists/unorderedList/feature.client.js +44 -19
  142. package/dist/field/features/lists/unorderedList/feature.client.js.map +1 -1
  143. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.d.ts +1 -1
  144. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.js +1 -1
  145. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.js.map +1 -1
  146. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/index.js +2 -2
  147. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/index.js.map +1 -1
  148. package/dist/field/features/paragraph/feature.client.d.ts.map +1 -1
  149. package/dist/field/features/paragraph/feature.client.js +36 -22
  150. package/dist/field/features/paragraph/feature.client.js.map +1 -1
  151. package/dist/field/features/relationship/feature.client.d.ts.map +1 -1
  152. package/dist/field/features/relationship/feature.client.js +31 -9
  153. package/dist/field/features/relationship/feature.client.js.map +1 -1
  154. package/dist/field/features/relationship/feature.server.d.ts +10 -1
  155. package/dist/field/features/relationship/feature.server.d.ts.map +1 -1
  156. package/dist/field/features/relationship/feature.server.js +2 -2
  157. package/dist/field/features/relationship/feature.server.js.map +1 -1
  158. package/dist/field/features/relationship/nodes/components/RelationshipComponent.d.ts.map +1 -1
  159. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js +4 -2
  160. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js.map +1 -1
  161. package/dist/field/features/relationship/plugins/index.d.ts +2 -2
  162. package/dist/field/features/relationship/plugins/index.d.ts.map +1 -1
  163. package/dist/field/features/relationship/plugins/index.js +6 -6
  164. package/dist/field/features/relationship/plugins/index.js.map +1 -1
  165. package/dist/field/features/relationship/populationPromise.d.ts +2 -1
  166. package/dist/field/features/relationship/populationPromise.d.ts.map +1 -1
  167. package/dist/field/features/relationship/populationPromise.js +25 -20
  168. package/dist/field/features/relationship/populationPromise.js.map +1 -1
  169. package/dist/field/features/shared/toolbar/addDropdownGroup.d.ts +3 -0
  170. package/dist/field/features/shared/toolbar/addDropdownGroup.d.ts.map +1 -0
  171. package/dist/field/features/shared/toolbar/addDropdownGroup.js +12 -0
  172. package/dist/field/features/shared/toolbar/addDropdownGroup.js.map +1 -0
  173. package/dist/field/features/shared/toolbar/featureButtonsGroup.d.ts +3 -0
  174. package/dist/field/features/shared/toolbar/featureButtonsGroup.d.ts.map +1 -0
  175. package/dist/field/features/shared/toolbar/featureButtonsGroup.js +10 -0
  176. package/dist/field/features/shared/toolbar/featureButtonsGroup.js.map +1 -0
  177. package/dist/field/features/shared/toolbar/textDropdownGroup.d.ts +3 -0
  178. package/dist/field/features/shared/toolbar/textDropdownGroup.d.ts.map +1 -0
  179. package/dist/field/features/shared/{inlineToolbar → toolbar}/textDropdownGroup.js +2 -2
  180. package/dist/field/features/shared/toolbar/textDropdownGroup.js.map +1 -0
  181. package/dist/field/features/toolbars/fixed/Toolbar/index.d.ts +4 -0
  182. package/dist/field/features/toolbars/fixed/Toolbar/index.d.ts.map +1 -0
  183. package/dist/field/features/toolbars/fixed/Toolbar/index.js +152 -0
  184. package/dist/field/features/toolbars/fixed/Toolbar/index.js.map +1 -0
  185. package/dist/field/features/toolbars/fixed/Toolbar/index.scss +81 -0
  186. package/dist/field/features/toolbars/fixed/feature.client.d.ts +3 -0
  187. package/dist/field/features/toolbars/fixed/feature.client.d.ts.map +1 -0
  188. package/dist/field/features/toolbars/fixed/feature.client.js +20 -0
  189. package/dist/field/features/toolbars/fixed/feature.client.js.map +1 -0
  190. package/dist/field/features/toolbars/fixed/feature.server.d.ts +3 -0
  191. package/dist/field/features/toolbars/fixed/feature.server.d.ts.map +1 -0
  192. package/dist/field/features/toolbars/fixed/feature.server.js +16 -0
  193. package/dist/field/features/toolbars/fixed/feature.server.js.map +1 -0
  194. package/dist/field/features/toolbars/inline/Toolbar/index.d.ts +4 -0
  195. package/dist/field/features/toolbars/inline/Toolbar/index.d.ts.map +1 -0
  196. package/dist/field/{lexical/plugins → features}/toolbars/inline/Toolbar/index.js +67 -23
  197. package/dist/field/features/toolbars/inline/Toolbar/index.js.map +1 -0
  198. package/dist/field/{lexical/plugins → features}/toolbars/inline/Toolbar/index.scss +3 -8
  199. package/dist/field/features/toolbars/inline/feature.client.d.ts +3 -0
  200. package/dist/field/features/toolbars/inline/feature.client.d.ts.map +1 -0
  201. package/dist/field/features/toolbars/inline/feature.client.js +20 -0
  202. package/dist/field/features/toolbars/inline/feature.client.js.map +1 -0
  203. package/dist/field/features/toolbars/inline/feature.server.d.ts +3 -0
  204. package/dist/field/features/toolbars/inline/feature.server.d.ts.map +1 -0
  205. package/dist/field/features/toolbars/inline/feature.server.js +16 -0
  206. package/dist/field/features/toolbars/inline/feature.server.js.map +1 -0
  207. package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts +10 -0
  208. package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -0
  209. package/dist/field/{lexical/plugins/toolbars/inline → features/toolbars/shared}/ToolbarButton/index.js +21 -8
  210. package/dist/field/features/toolbars/shared/ToolbarButton/index.js.map +1 -0
  211. package/dist/field/{lexical/plugins/toolbars/inline → features/toolbars/shared}/ToolbarButton/index.scss +3 -1
  212. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts +23 -0
  213. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -0
  214. package/dist/field/{lexical/plugins/toolbars/inline → features/toolbars/shared}/ToolbarDropdown/DropDown.js +25 -67
  215. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -0
  216. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts +23 -0
  217. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -0
  218. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js +139 -0
  219. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -0
  220. package/dist/field/{lexical/plugins/toolbars/inline → features/toolbars/shared}/ToolbarDropdown/index.scss +25 -13
  221. package/dist/field/{lexical/plugins/toolbars/inline → features/toolbars}/types.d.ts +16 -8
  222. package/dist/field/features/toolbars/types.d.ts.map +1 -0
  223. package/dist/field/features/toolbars/types.js.map +1 -0
  224. package/dist/field/features/types.d.ts +27 -19
  225. package/dist/field/features/types.d.ts.map +1 -1
  226. package/dist/field/features/types.js.map +1 -1
  227. package/dist/field/features/upload/component/index.d.ts.map +1 -1
  228. package/dist/field/features/upload/component/index.js +6 -2
  229. package/dist/field/features/upload/component/index.js.map +1 -1
  230. package/dist/field/features/upload/feature.client.d.ts.map +1 -1
  231. package/dist/field/features/upload/feature.client.js +29 -4
  232. package/dist/field/features/upload/feature.client.js.map +1 -1
  233. package/dist/field/features/upload/feature.server.d.ts +10 -3
  234. package/dist/field/features/upload/feature.server.d.ts.map +1 -1
  235. package/dist/field/features/upload/feature.server.js +2 -2
  236. package/dist/field/features/upload/feature.server.js.map +1 -1
  237. package/dist/field/features/upload/nodes/UploadNode.d.ts.map +1 -1
  238. package/dist/field/features/upload/nodes/UploadNode.js +18 -2
  239. package/dist/field/features/upload/nodes/UploadNode.js.map +1 -1
  240. package/dist/field/features/upload/plugin/index.d.ts +3 -2
  241. package/dist/field/features/upload/plugin/index.d.ts.map +1 -1
  242. package/dist/field/features/upload/plugin/index.js +2 -2
  243. package/dist/field/features/upload/plugin/index.js.map +1 -1
  244. package/dist/field/features/upload/populationPromise.d.ts.map +1 -1
  245. package/dist/field/features/upload/populationPromise.js +5 -2
  246. package/dist/field/features/upload/populationPromise.js.map +1 -1
  247. package/dist/field/features/upload/validate.d.ts.map +1 -1
  248. package/dist/field/features/upload/validate.js +3 -0
  249. package/dist/field/features/upload/validate.js.map +1 -1
  250. package/dist/field/lexical/EditorFocusProvider.d.ts +20 -0
  251. package/dist/field/lexical/EditorFocusProvider.d.ts.map +1 -0
  252. package/dist/field/lexical/EditorFocusProvider.js +78 -0
  253. package/dist/field/lexical/EditorFocusProvider.js.map +1 -0
  254. package/dist/field/lexical/EditorPlugin.d.ts +1 -0
  255. package/dist/field/lexical/EditorPlugin.d.ts.map +1 -1
  256. package/dist/field/lexical/EditorPlugin.js +6 -3
  257. package/dist/field/lexical/EditorPlugin.js.map +1 -1
  258. package/dist/field/lexical/LexicalEditor.d.ts.map +1 -1
  259. package/dist/field/lexical/LexicalEditor.js +25 -4
  260. package/dist/field/lexical/LexicalEditor.js.map +1 -1
  261. package/dist/field/lexical/LexicalProvider.d.ts.map +1 -1
  262. package/dist/field/lexical/LexicalProvider.js +3 -2
  263. package/dist/field/lexical/LexicalProvider.js.map +1 -1
  264. package/dist/field/lexical/config/client/EditorConfigProvider.d.ts +2 -3
  265. package/dist/field/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
  266. package/dist/field/lexical/config/client/EditorConfigProvider.js.map +1 -1
  267. package/dist/field/lexical/config/client/sanitize.d.ts.map +1 -1
  268. package/dist/field/lexical/config/client/sanitize.js +1 -0
  269. package/dist/field/lexical/config/client/sanitize.js.map +1 -1
  270. package/dist/field/lexical/config/server/default.d.ts.map +1 -1
  271. package/dist/field/lexical/config/server/default.js +5 -3
  272. package/dist/field/lexical/config/server/default.js.map +1 -1
  273. package/dist/field/lexical/config/server/loader.d.ts +2 -1
  274. package/dist/field/lexical/config/server/loader.d.ts.map +1 -1
  275. package/dist/field/lexical/config/server/loader.js +2 -1
  276. package/dist/field/lexical/config/server/loader.js.map +1 -1
  277. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts +6 -6
  278. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts.map +1 -1
  279. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
  280. package/dist/field/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
  281. package/dist/field/lexical/plugins/SlashMenu/index.js +10 -10
  282. package/dist/field/lexical/plugins/SlashMenu/index.js.map +1 -1
  283. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.d.ts +1 -1
  284. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.d.ts.map +1 -1
  285. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js +2 -2
  286. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js.map +1 -1
  287. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  288. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js +6 -3
  289. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  290. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.scss +8 -0
  291. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts.map +1 -1
  292. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js +25 -6
  293. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
  294. package/dist/field/lexical/ui/icons/Add/index.d.ts +3 -0
  295. package/dist/field/lexical/ui/icons/Add/index.d.ts.map +1 -0
  296. package/dist/field/lexical/ui/icons/Add/index.js +16 -0
  297. package/dist/field/lexical/ui/icons/Add/index.js.map +1 -0
  298. package/dist/field/lexical/utils/setFloatingElemPosition.d.ts +11 -1
  299. package/dist/field/lexical/utils/setFloatingElemPosition.d.ts.map +1 -1
  300. package/dist/field/lexical/utils/setFloatingElemPosition.js +3 -2
  301. package/dist/field/lexical/utils/setFloatingElemPosition.js.map +1 -1
  302. package/dist/index.d.ts +11 -9
  303. package/dist/index.d.ts.map +1 -1
  304. package/dist/index.js +11 -7
  305. package/dist/index.js.map +1 -1
  306. package/dist/populate/populate.d.ts +2 -1
  307. package/dist/populate/populate.d.ts.map +1 -1
  308. package/dist/populate/populate.js +13 -11
  309. package/dist/populate/populate.js.map +1 -1
  310. package/dist/populate/populateLexicalPopulationPromises.d.ts +1 -1
  311. package/dist/populate/populateLexicalPopulationPromises.d.ts.map +1 -1
  312. package/dist/populate/populateLexicalPopulationPromises.js +2 -1
  313. package/dist/populate/populateLexicalPopulationPromises.js.map +1 -1
  314. package/dist/populate/recurseNestedFields.d.ts +2 -1
  315. package/dist/populate/recurseNestedFields.d.ts.map +1 -1
  316. package/dist/populate/recurseNestedFields.js +2 -1
  317. package/dist/populate/recurseNestedFields.js.map +1 -1
  318. package/dist/types.d.ts +2 -1
  319. package/dist/types.d.ts.map +1 -1
  320. package/dist/types.js.map +1 -1
  321. package/package.json +11 -11
  322. package/dist/field/features/align/inlineToolbarAlignGroup.d.ts +0 -3
  323. package/dist/field/features/align/inlineToolbarAlignGroup.d.ts.map +0 -1
  324. package/dist/field/features/align/inlineToolbarAlignGroup.js.map +0 -1
  325. package/dist/field/features/format/shared/inlineToolbarFormatGroup.d.ts +0 -3
  326. package/dist/field/features/format/shared/inlineToolbarFormatGroup.d.ts.map +0 -1
  327. package/dist/field/features/format/shared/inlineToolbarFormatGroup.js +0 -10
  328. package/dist/field/features/format/shared/inlineToolbarFormatGroup.js.map +0 -1
  329. package/dist/field/features/indent/inlineToolbarIndentGroup.d.ts +0 -3
  330. package/dist/field/features/indent/inlineToolbarIndentGroup.d.ts.map +0 -1
  331. package/dist/field/features/indent/inlineToolbarIndentGroup.js +0 -10
  332. package/dist/field/features/indent/inlineToolbarIndentGroup.js.map +0 -1
  333. package/dist/field/features/shared/inlineToolbar/featureButtonsGroup.d.ts +0 -3
  334. package/dist/field/features/shared/inlineToolbar/featureButtonsGroup.d.ts.map +0 -1
  335. package/dist/field/features/shared/inlineToolbar/featureButtonsGroup.js +0 -10
  336. package/dist/field/features/shared/inlineToolbar/featureButtonsGroup.js.map +0 -1
  337. package/dist/field/features/shared/inlineToolbar/textDropdownGroup.d.ts +0 -3
  338. package/dist/field/features/shared/inlineToolbar/textDropdownGroup.d.ts.map +0 -1
  339. package/dist/field/features/shared/inlineToolbar/textDropdownGroup.js.map +0 -1
  340. package/dist/field/lexical/plugins/toolbars/fixed/types.d.ts +0 -40
  341. package/dist/field/lexical/plugins/toolbars/fixed/types.d.ts.map +0 -1
  342. package/dist/field/lexical/plugins/toolbars/fixed/types.js.map +0 -1
  343. package/dist/field/lexical/plugins/toolbars/inline/Toolbar/index.d.ts +0 -6
  344. package/dist/field/lexical/plugins/toolbars/inline/Toolbar/index.d.ts.map +0 -1
  345. package/dist/field/lexical/plugins/toolbars/inline/Toolbar/index.js.map +0 -1
  346. package/dist/field/lexical/plugins/toolbars/inline/ToolbarButton/index.d.ts +0 -8
  347. package/dist/field/lexical/plugins/toolbars/inline/ToolbarButton/index.d.ts.map +0 -1
  348. package/dist/field/lexical/plugins/toolbars/inline/ToolbarButton/index.js.map +0 -1
  349. package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/DropDown.d.ts +0 -17
  350. package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/DropDown.d.ts.map +0 -1
  351. package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/DropDown.js.map +0 -1
  352. package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/index.d.ts +0 -18
  353. package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/index.d.ts.map +0 -1
  354. package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/index.js +0 -42
  355. package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/index.js.map +0 -1
  356. package/dist/field/lexical/plugins/toolbars/inline/types.d.ts.map +0 -1
  357. package/dist/field/lexical/plugins/toolbars/inline/types.js +0 -3
  358. package/dist/field/lexical/plugins/toolbars/inline/types.js.map +0 -1
  359. /package/dist/field/{lexical/plugins/toolbars/fixed → features/toolbars}/types.js +0 -0
@@ -1,7 +1,8 @@
1
1
  'use client';
2
+ import { $isHeadingNode } from '@lexical/rich-text';
2
3
  import { $createHeadingNode, HeadingNode } from '@lexical/rich-text';
3
4
  import { $setBlocksType } from '@lexical/selection';
4
- import { $getSelection } from 'lexical';
5
+ import { $getSelection, $isRangeSelection } from 'lexical';
5
6
  import { H1Icon } from '../../lexical/ui/icons/H1/index.js';
6
7
  import { H2Icon } from '../../lexical/ui/icons/H2/index.js';
7
8
  import { H3Icon } from '../../lexical/ui/icons/H3/index.js';
@@ -9,7 +10,7 @@ import { H4Icon } from '../../lexical/ui/icons/H4/index.js';
9
10
  import { H5Icon } from '../../lexical/ui/icons/H5/index.js';
10
11
  import { H6Icon } from '../../lexical/ui/icons/H6/index.js';
11
12
  import { createClientComponent } from '../createClientComponent.js';
12
- import { inlineToolbarTextDropdownGroupWithItems } from '../shared/inlineToolbar/textDropdownGroup.js';
13
+ import { toolbarTextDropdownGroupWithItems } from '../shared/toolbar/textDropdownGroup.js';
13
14
  import { MarkdownTransformer } from './markdownTransformer.js';
14
15
  const setHeading = (headingSize)=>{
15
16
  const selection = $getSelection();
@@ -24,17 +25,48 @@ const iconImports = {
24
25
  h6: H6Icon
25
26
  };
26
27
  const HeadingFeatureClient = (props)=>{
27
- const { enabledHeadingSizes = [
28
- 'h1',
29
- 'h2',
30
- 'h3',
31
- 'h4',
32
- 'h5',
33
- 'h6'
34
- ] } = props;
35
28
  return {
36
29
  clientFeatureProps: props,
37
30
  feature: ()=>{
31
+ const { enabledHeadingSizes = [
32
+ 'h1',
33
+ 'h2',
34
+ 'h3',
35
+ 'h4',
36
+ 'h5',
37
+ 'h6'
38
+ ] } = props;
39
+ const toolbarGroups = [
40
+ toolbarTextDropdownGroupWithItems(enabledHeadingSizes.map((headingSize, i)=>{
41
+ return {
42
+ ChildComponent: iconImports[headingSize],
43
+ isActive: ({ selection })=>{
44
+ if (!$isRangeSelection(selection)) {
45
+ return false;
46
+ }
47
+ for (const node of selection.getNodes()){
48
+ if ($isHeadingNode(node) && node.getTag() === headingSize) {
49
+ continue;
50
+ }
51
+ const parent = node.getParent();
52
+ if ($isHeadingNode(parent) && parent.getTag() === headingSize) {
53
+ continue;
54
+ }
55
+ return false;
56
+ }
57
+ return true;
58
+ },
59
+ key: headingSize,
60
+ label: `Heading ${headingSize.charAt(1)}`,
61
+ onSelect: ({ editor })=>{
62
+ editor.update(()=>{
63
+ setHeading(headingSize);
64
+ });
65
+ },
66
+ order: i + 2
67
+ };
68
+ }))
69
+ ];
38
70
  return {
39
71
  clientFeatureProps: props,
40
72
  markdownTransformers: [
@@ -46,16 +78,15 @@ const HeadingFeatureClient = (props)=>{
46
78
  slashMenu: {
47
79
  groups: enabledHeadingSizes?.length ? [
48
80
  {
49
- displayName: 'Basic',
50
81
  items: enabledHeadingSizes.map((headingSize)=>{
51
82
  return {
52
83
  Icon: iconImports[headingSize],
53
- displayName: `Heading ${headingSize.charAt(1)}`,
54
84
  key: `heading-${headingSize.charAt(1)}`,
55
85
  keywords: [
56
86
  'heading',
57
87
  headingSize
58
88
  ],
89
+ label: `Heading ${headingSize.charAt(1)}`,
59
90
  onSelect: ({ editor })=>{
60
91
  editor.update(()=>{
61
92
  setHeading(headingSize);
@@ -63,27 +94,16 @@ const HeadingFeatureClient = (props)=>{
63
94
  }
64
95
  };
65
96
  }),
66
- key: 'basic'
97
+ key: 'basic',
98
+ label: 'Basic'
67
99
  }
68
100
  ] : []
69
101
  },
102
+ toolbarFixed: {
103
+ groups: enabledHeadingSizes?.length ? toolbarGroups : []
104
+ },
70
105
  toolbarInline: {
71
- groups: enabledHeadingSizes?.length ? [
72
- inlineToolbarTextDropdownGroupWithItems(enabledHeadingSizes.map((headingSize, i)=>{
73
- return {
74
- ChildComponent: iconImports[headingSize],
75
- isActive: ()=>false,
76
- key: headingSize,
77
- label: `Heading ${headingSize.charAt(1)}`,
78
- onSelect: ({ editor })=>{
79
- editor.update(()=>{
80
- setHeading(headingSize);
81
- });
82
- },
83
- order: i + 2
84
- };
85
- }))
86
- ] : []
106
+ groups: enabledHeadingSizes?.length ? toolbarGroups : []
87
107
  }
88
108
  };
89
109
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/field/features/heading/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport type { HeadingTagType } from '@lexical/rich-text'\n\nimport { $createHeadingNode, HeadingNode } from '@lexical/rich-text'\nimport { $setBlocksType } from '@lexical/selection'\nimport { $getSelection } from 'lexical'\n\nimport type { FeatureProviderProviderClient } from '../types.js'\nimport type { HeadingFeatureProps } from './feature.server.js'\n\nimport { H1Icon } from '../../lexical/ui/icons/H1/index.js'\nimport { H2Icon } from '../../lexical/ui/icons/H2/index.js'\nimport { H3Icon } from '../../lexical/ui/icons/H3/index.js'\nimport { H4Icon } from '../../lexical/ui/icons/H4/index.js'\nimport { H5Icon } from '../../lexical/ui/icons/H5/index.js'\nimport { H6Icon } from '../../lexical/ui/icons/H6/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { inlineToolbarTextDropdownGroupWithItems } from '../shared/inlineToolbar/textDropdownGroup.js'\nimport { MarkdownTransformer } from './markdownTransformer.js'\n\nconst setHeading = (headingSize: HeadingTagType) => {\n const selection = $getSelection()\n $setBlocksType(selection, () => $createHeadingNode(headingSize))\n}\n\nconst iconImports = {\n h1: H1Icon,\n h2: H2Icon,\n h3: H3Icon,\n h4: H4Icon,\n h5: H5Icon,\n h6: H6Icon,\n}\n\nconst HeadingFeatureClient: FeatureProviderProviderClient<HeadingFeatureProps> = (props) => {\n const { enabledHeadingSizes = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] } = props\n\n return {\n clientFeatureProps: props,\n feature: () => {\n return {\n clientFeatureProps: props,\n markdownTransformers: [MarkdownTransformer(enabledHeadingSizes)],\n nodes: [HeadingNode],\n slashMenu: {\n groups: enabledHeadingSizes?.length\n ? [\n {\n displayName: 'Basic',\n items: enabledHeadingSizes.map((headingSize) => {\n return {\n Icon: iconImports[headingSize],\n displayName: `Heading ${headingSize.charAt(1)}`,\n key: `heading-${headingSize.charAt(1)}`,\n keywords: ['heading', headingSize],\n onSelect: ({ editor }) => {\n editor.update(() => {\n setHeading(headingSize)\n })\n },\n }\n }),\n key: 'basic',\n },\n ]\n : [],\n },\n toolbarInline: {\n groups: enabledHeadingSizes?.length\n ? [\n inlineToolbarTextDropdownGroupWithItems(\n enabledHeadingSizes.map((headingSize, i) => {\n return {\n ChildComponent: iconImports[headingSize],\n isActive: () => false,\n key: headingSize,\n label: `Heading ${headingSize.charAt(1)}`,\n onSelect: ({ editor }) => {\n editor.update(() => {\n setHeading(headingSize)\n })\n },\n order: i + 2,\n }\n }),\n ),\n ]\n : [],\n },\n }\n },\n }\n}\n\nexport const HeadingFeatureClientComponent = createClientComponent(HeadingFeatureClient)\n"],"names":["$createHeadingNode","HeadingNode","$setBlocksType","$getSelection","H1Icon","H2Icon","H3Icon","H4Icon","H5Icon","H6Icon","createClientComponent","inlineToolbarTextDropdownGroupWithItems","MarkdownTransformer","setHeading","headingSize","selection","iconImports","h1","h2","h3","h4","h5","h6","HeadingFeatureClient","props","enabledHeadingSizes","clientFeatureProps","feature","markdownTransformers","nodes","slashMenu","groups","length","displayName","items","map","Icon","charAt","key","keywords","onSelect","editor","update","toolbarInline","i","ChildComponent","isActive","label","order","HeadingFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,SAASA,kBAAkB,EAAEC,WAAW,QAAQ,qBAAoB;AACpE,SAASC,cAAc,QAAQ,qBAAoB;AACnD,SAASC,aAAa,QAAQ,UAAS;AAKvC,SAASC,MAAM,QAAQ,qCAAoC;AAC3D,SAASC,MAAM,QAAQ,qCAAoC;AAC3D,SAASC,MAAM,QAAQ,qCAAoC;AAC3D,SAASC,MAAM,QAAQ,qCAAoC;AAC3D,SAASC,MAAM,QAAQ,qCAAoC;AAC3D,SAASC,MAAM,QAAQ,qCAAoC;AAC3D,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,uCAAuC,QAAQ,+CAA8C;AACtG,SAASC,mBAAmB,QAAQ,2BAA0B;AAE9D,MAAMC,aAAa,CAACC;IAClB,MAAMC,YAAYZ;IAClBD,eAAea,WAAW,IAAMf,mBAAmBc;AACrD;AAEA,MAAME,cAAc;IAClBC,IAAIb;IACJc,IAAIb;IACJc,IAAIb;IACJc,IAAIb;IACJc,IAAIb;IACJc,IAAIb;AACN;AAEA,MAAMc,uBAA2E,CAACC;IAChF,MAAM,EAAEC,sBAAsB;QAAC;QAAM;QAAM;QAAM;QAAM;QAAM;KAAK,EAAE,GAAGD;IAEvE,OAAO;QACLE,oBAAoBF;QACpBG,SAAS;YACP,OAAO;gBACLD,oBAAoBF;gBACpBI,sBAAsB;oBAAChB,oBAAoBa;iBAAqB;gBAChEI,OAAO;oBAAC5B;iBAAY;gBACpB6B,WAAW;oBACTC,QAAQN,qBAAqBO,SACzB;wBACE;4BACEC,aAAa;4BACbC,OAAOT,oBAAoBU,GAAG,CAAC,CAACrB;gCAC9B,OAAO;oCACLsB,MAAMpB,WAAW,CAACF,YAAY;oCAC9BmB,aAAa,CAAC,QAAQ,EAAEnB,YAAYuB,MAAM,CAAC,GAAG,CAAC;oCAC/CC,KAAK,CAAC,QAAQ,EAAExB,YAAYuB,MAAM,CAAC,GAAG,CAAC;oCACvCE,UAAU;wCAAC;wCAAWzB;qCAAY;oCAClC0B,UAAU,CAAC,EAAEC,MAAM,EAAE;wCACnBA,OAAOC,MAAM,CAAC;4CACZ7B,WAAWC;wCACb;oCACF;gCACF;4BACF;4BACAwB,KAAK;wBACP;qBACD,GACD,EAAE;gBACR;gBACAK,eAAe;oBACbZ,QAAQN,qBAAqBO,SACzB;wBACErB,wCACEc,oBAAoBU,GAAG,CAAC,CAACrB,aAAa8B;4BACpC,OAAO;gCACLC,gBAAgB7B,WAAW,CAACF,YAAY;gCACxCgC,UAAU,IAAM;gCAChBR,KAAKxB;gCACLiC,OAAO,CAAC,QAAQ,EAAEjC,YAAYuB,MAAM,CAAC,GAAG,CAAC;gCACzCG,UAAU,CAAC,EAAEC,MAAM,EAAE;oCACnBA,OAAOC,MAAM,CAAC;wCACZ7B,WAAWC;oCACb;gCACF;gCACAkC,OAAOJ,IAAI;4BACb;wBACF;qBAEH,GACD,EAAE;gBACR;YACF;QACF;IACF;AACF;AAEA,OAAO,MAAMK,gCAAgCvC,sBAAsBa,sBAAqB"}
1
+ {"version":3,"sources":["../../../../src/field/features/heading/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport type { HeadingTagType } from '@lexical/rich-text'\n\nimport { $isHeadingNode } from '@lexical/rich-text'\nimport { $createHeadingNode, HeadingNode } from '@lexical/rich-text'\nimport { $setBlocksType } from '@lexical/selection'\nimport { $getSelection, $isRangeSelection } from 'lexical'\n\nimport type { ToolbarGroup } from '../toolbars/types.js'\nimport type { FeatureProviderProviderClient } from '../types.js'\nimport type { HeadingFeatureProps } from './feature.server.js'\n\nimport { H1Icon } from '../../lexical/ui/icons/H1/index.js'\nimport { H2Icon } from '../../lexical/ui/icons/H2/index.js'\nimport { H3Icon } from '../../lexical/ui/icons/H3/index.js'\nimport { H4Icon } from '../../lexical/ui/icons/H4/index.js'\nimport { H5Icon } from '../../lexical/ui/icons/H5/index.js'\nimport { H6Icon } from '../../lexical/ui/icons/H6/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { toolbarTextDropdownGroupWithItems } from '../shared/toolbar/textDropdownGroup.js'\nimport { MarkdownTransformer } from './markdownTransformer.js'\n\nconst setHeading = (headingSize: HeadingTagType) => {\n const selection = $getSelection()\n $setBlocksType(selection, () => $createHeadingNode(headingSize))\n}\n\nconst iconImports = {\n h1: H1Icon,\n h2: H2Icon,\n h3: H3Icon,\n h4: H4Icon,\n h5: H5Icon,\n h6: H6Icon,\n}\n\nconst HeadingFeatureClient: FeatureProviderProviderClient<HeadingFeatureProps> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => {\n const { enabledHeadingSizes = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] } = props\n\n const toolbarGroups: ToolbarGroup[] = [\n toolbarTextDropdownGroupWithItems(\n enabledHeadingSizes.map((headingSize, i) => {\n return {\n ChildComponent: iconImports[headingSize],\n isActive: ({ selection }) => {\n if (!$isRangeSelection(selection)) {\n return false\n }\n for (const node of selection.getNodes()) {\n if ($isHeadingNode(node) && node.getTag() === headingSize) {\n continue\n }\n\n const parent = node.getParent()\n if ($isHeadingNode(parent) && parent.getTag() === headingSize) {\n continue\n }\n\n return false\n }\n return true\n },\n key: headingSize,\n label: `Heading ${headingSize.charAt(1)}`,\n onSelect: ({ editor }) => {\n editor.update(() => {\n setHeading(headingSize)\n })\n },\n order: i + 2,\n }\n }),\n ),\n ]\n\n return {\n clientFeatureProps: props,\n markdownTransformers: [MarkdownTransformer(enabledHeadingSizes)],\n nodes: [HeadingNode],\n slashMenu: {\n groups: enabledHeadingSizes?.length\n ? [\n {\n items: enabledHeadingSizes.map((headingSize) => {\n return {\n Icon: iconImports[headingSize],\n key: `heading-${headingSize.charAt(1)}`,\n keywords: ['heading', headingSize],\n label: `Heading ${headingSize.charAt(1)}`,\n onSelect: ({ editor }) => {\n editor.update(() => {\n setHeading(headingSize)\n })\n },\n }\n }),\n key: 'basic',\n label: 'Basic',\n },\n ]\n : [],\n },\n toolbarFixed: {\n groups: enabledHeadingSizes?.length ? toolbarGroups : [],\n },\n toolbarInline: {\n groups: enabledHeadingSizes?.length ? toolbarGroups : [],\n },\n }\n },\n }\n}\n\nexport const HeadingFeatureClientComponent = createClientComponent(HeadingFeatureClient)\n"],"names":["$isHeadingNode","$createHeadingNode","HeadingNode","$setBlocksType","$getSelection","$isRangeSelection","H1Icon","H2Icon","H3Icon","H4Icon","H5Icon","H6Icon","createClientComponent","toolbarTextDropdownGroupWithItems","MarkdownTransformer","setHeading","headingSize","selection","iconImports","h1","h2","h3","h4","h5","h6","HeadingFeatureClient","props","clientFeatureProps","feature","enabledHeadingSizes","toolbarGroups","map","i","ChildComponent","isActive","node","getNodes","getTag","parent","getParent","key","label","charAt","onSelect","editor","update","order","markdownTransformers","nodes","slashMenu","groups","length","items","Icon","keywords","toolbarFixed","toolbarInline","HeadingFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,SAASA,cAAc,QAAQ,qBAAoB;AACnD,SAASC,kBAAkB,EAAEC,WAAW,QAAQ,qBAAoB;AACpE,SAASC,cAAc,QAAQ,qBAAoB;AACnD,SAASC,aAAa,EAAEC,iBAAiB,QAAQ,UAAS;AAM1D,SAASC,MAAM,QAAQ,qCAAoC;AAC3D,SAASC,MAAM,QAAQ,qCAAoC;AAC3D,SAASC,MAAM,QAAQ,qCAAoC;AAC3D,SAASC,MAAM,QAAQ,qCAAoC;AAC3D,SAASC,MAAM,QAAQ,qCAAoC;AAC3D,SAASC,MAAM,QAAQ,qCAAoC;AAC3D,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,iCAAiC,QAAQ,yCAAwC;AAC1F,SAASC,mBAAmB,QAAQ,2BAA0B;AAE9D,MAAMC,aAAa,CAACC;IAClB,MAAMC,YAAYb;IAClBD,eAAec,WAAW,IAAMhB,mBAAmBe;AACrD;AAEA,MAAME,cAAc;IAClBC,IAAIb;IACJc,IAAIb;IACJc,IAAIb;IACJc,IAAIb;IACJc,IAAIb;IACJc,IAAIb;AACN;AAEA,MAAMc,uBAA2E,CAACC;IAChF,OAAO;QACLC,oBAAoBD;QACpBE,SAAS;YACP,MAAM,EAAEC,sBAAsB;gBAAC;gBAAM;gBAAM;gBAAM;gBAAM;gBAAM;aAAK,EAAE,GAAGH;YAEvE,MAAMI,gBAAgC;gBACpCjB,kCACEgB,oBAAoBE,GAAG,CAAC,CAACf,aAAagB;oBACpC,OAAO;wBACLC,gBAAgBf,WAAW,CAACF,YAAY;wBACxCkB,UAAU,CAAC,EAAEjB,SAAS,EAAE;4BACtB,IAAI,CAACZ,kBAAkBY,YAAY;gCACjC,OAAO;4BACT;4BACA,KAAK,MAAMkB,QAAQlB,UAAUmB,QAAQ,GAAI;gCACvC,IAAIpC,eAAemC,SAASA,KAAKE,MAAM,OAAOrB,aAAa;oCACzD;gCACF;gCAEA,MAAMsB,SAASH,KAAKI,SAAS;gCAC7B,IAAIvC,eAAesC,WAAWA,OAAOD,MAAM,OAAOrB,aAAa;oCAC7D;gCACF;gCAEA,OAAO;4BACT;4BACA,OAAO;wBACT;wBACAwB,KAAKxB;wBACLyB,OAAO,CAAC,QAAQ,EAAEzB,YAAY0B,MAAM,CAAC,GAAG,CAAC;wBACzCC,UAAU,CAAC,EAAEC,MAAM,EAAE;4BACnBA,OAAOC,MAAM,CAAC;gCACZ9B,WAAWC;4BACb;wBACF;wBACA8B,OAAOd,IAAI;oBACb;gBACF;aAEH;YAED,OAAO;gBACLL,oBAAoBD;gBACpBqB,sBAAsB;oBAACjC,oBAAoBe;iBAAqB;gBAChEmB,OAAO;oBAAC9C;iBAAY;gBACpB+C,WAAW;oBACTC,QAAQrB,qBAAqBsB,SACzB;wBACE;4BACEC,OAAOvB,oBAAoBE,GAAG,CAAC,CAACf;gCAC9B,OAAO;oCACLqC,MAAMnC,WAAW,CAACF,YAAY;oCAC9BwB,KAAK,CAAC,QAAQ,EAAExB,YAAY0B,MAAM,CAAC,GAAG,CAAC;oCACvCY,UAAU;wCAAC;wCAAWtC;qCAAY;oCAClCyB,OAAO,CAAC,QAAQ,EAAEzB,YAAY0B,MAAM,CAAC,GAAG,CAAC;oCACzCC,UAAU,CAAC,EAAEC,MAAM,EAAE;wCACnBA,OAAOC,MAAM,CAAC;4CACZ9B,WAAWC;wCACb;oCACF;gCACF;4BACF;4BACAwB,KAAK;4BACLC,OAAO;wBACT;qBACD,GACD,EAAE;gBACR;gBACAc,cAAc;oBACZL,QAAQrB,qBAAqBsB,SAASrB,gBAAgB,EAAE;gBAC1D;gBACA0B,eAAe;oBACbN,QAAQrB,qBAAqBsB,SAASrB,gBAAgB,EAAE;gBAC1D;YACF;QACF;IACF;AACF;AAEA,OAAO,MAAM2B,gCAAgC7C,sBAAsBa,sBAAqB"}
@@ -1 +1 @@
1
- {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/field/features/horizontalRule/feature.client.tsx"],"names":[],"mappings":";AA8CA,eAAO,MAAM,oCAAoC,+BAEhD,CAAA"}
1
+ {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/field/features/horizontalRule/feature.client.tsx"],"names":[],"mappings":";AA2EA,eAAO,MAAM,oCAAoC,+BAEhD,CAAA"}
@@ -1,8 +1,10 @@
1
1
  'use client';
2
+ import { $isNodeSelection } from 'lexical';
2
3
  import { HorizontalRuleIcon } from '../../lexical/ui/icons/HorizontalRule/index.js';
3
4
  import { createClientComponent } from '../createClientComponent.js';
5
+ import { toolbarAddDropdownGroupWithItems } from '../shared/toolbar/addDropdownGroup.js';
4
6
  import { MarkdownTransformer } from './markdownTransformer.js';
5
- import { HorizontalRuleNode, INSERT_HORIZONTAL_RULE_COMMAND } from './nodes/HorizontalRuleNode.js';
7
+ import { $isHorizontalRuleNode, HorizontalRuleNode, INSERT_HORIZONTAL_RULE_COMMAND } from './nodes/HorizontalRuleNode.js';
6
8
  import { HorizontalRulePlugin } from './plugin/index.js';
7
9
  const HorizontalRuleFeatureClient = (props)=>{
8
10
  return {
@@ -24,11 +26,9 @@ const HorizontalRuleFeatureClient = (props)=>{
24
26
  slashMenu: {
25
27
  groups: [
26
28
  {
27
- displayName: 'Basic',
28
29
  items: [
29
30
  {
30
31
  Icon: HorizontalRuleIcon,
31
- displayName: `Horizontal Rule`,
32
32
  key: 'horizontalRule',
33
33
  keywords: [
34
34
  'hr',
@@ -36,14 +36,37 @@ const HorizontalRuleFeatureClient = (props)=>{
36
36
  'line',
37
37
  'separator'
38
38
  ],
39
+ label: `Horizontal Rule`,
39
40
  onSelect: ({ editor })=>{
40
41
  editor.dispatchCommand(INSERT_HORIZONTAL_RULE_COMMAND, undefined);
41
42
  }
42
43
  }
43
44
  ],
44
- key: 'basic'
45
+ key: 'basic',
46
+ label: 'Basic'
45
47
  }
46
48
  ]
49
+ },
50
+ toolbarFixed: {
51
+ groups: [
52
+ toolbarAddDropdownGroupWithItems([
53
+ {
54
+ ChildComponent: HorizontalRuleIcon,
55
+ isActive: ({ selection })=>{
56
+ if (!$isNodeSelection(selection) || !selection.getNodes().length) {
57
+ return false;
58
+ }
59
+ const firstNode = selection.getNodes()[0];
60
+ return $isHorizontalRuleNode(firstNode);
61
+ },
62
+ key: 'horizontalRule',
63
+ label: `Horizontal Rule`,
64
+ onSelect: ({ editor })=>{
65
+ editor.dispatchCommand(INSERT_HORIZONTAL_RULE_COMMAND, undefined);
66
+ }
67
+ }
68
+ ])
69
+ ]
47
70
  }
48
71
  })
49
72
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/field/features/horizontalRule/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport type { FeatureProviderProviderClient } from '../types.js'\n\nimport { HorizontalRuleIcon } from '../../lexical/ui/icons/HorizontalRule/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { MarkdownTransformer } from './markdownTransformer.js'\nimport { HorizontalRuleNode, INSERT_HORIZONTAL_RULE_COMMAND } from './nodes/HorizontalRuleNode.js'\nimport { HorizontalRulePlugin } from './plugin/index.js'\n\nconst HorizontalRuleFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n markdownTransformers: [MarkdownTransformer],\n nodes: [HorizontalRuleNode],\n plugins: [\n {\n Component: HorizontalRulePlugin,\n position: 'normal',\n },\n ],\n slashMenu: {\n groups: [\n {\n displayName: 'Basic',\n items: [\n {\n Icon: HorizontalRuleIcon,\n displayName: `Horizontal Rule`,\n key: 'horizontalRule',\n keywords: ['hr', 'horizontal rule', 'line', 'separator'],\n onSelect: ({ editor }) => {\n editor.dispatchCommand(INSERT_HORIZONTAL_RULE_COMMAND, undefined)\n },\n },\n ],\n key: 'basic',\n },\n ],\n },\n }),\n }\n}\n\nexport const HorizontalRuleFeatureClientComponent = createClientComponent(\n HorizontalRuleFeatureClient,\n)\n"],"names":["HorizontalRuleIcon","createClientComponent","MarkdownTransformer","HorizontalRuleNode","INSERT_HORIZONTAL_RULE_COMMAND","HorizontalRulePlugin","HorizontalRuleFeatureClient","props","clientFeatureProps","feature","markdownTransformers","nodes","plugins","Component","position","slashMenu","groups","displayName","items","Icon","key","keywords","onSelect","editor","dispatchCommand","undefined","HorizontalRuleFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,SAASA,kBAAkB,QAAQ,iDAAgD;AACnF,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,mBAAmB,QAAQ,2BAA0B;AAC9D,SAASC,kBAAkB,EAAEC,8BAA8B,QAAQ,gCAA+B;AAClG,SAASC,oBAAoB,QAAQ,oBAAmB;AAExD,MAAMC,8BAAwE,CAACC;IAC7E,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,sBAAsB;oBAACR;iBAAoB;gBAC3CS,OAAO;oBAACR;iBAAmB;gBAC3BS,SAAS;oBACP;wBACEC,WAAWR;wBACXS,UAAU;oBACZ;iBACD;gBACDC,WAAW;oBACTC,QAAQ;wBACN;4BACEC,aAAa;4BACbC,OAAO;gCACL;oCACEC,MAAMnB;oCACNiB,aAAa,CAAC,eAAe,CAAC;oCAC9BG,KAAK;oCACLC,UAAU;wCAAC;wCAAM;wCAAmB;wCAAQ;qCAAY;oCACxDC,UAAU,CAAC,EAAEC,MAAM,EAAE;wCACnBA,OAAOC,eAAe,CAACpB,gCAAgCqB;oCACzD;gCACF;6BACD;4BACDL,KAAK;wBACP;qBACD;gBACH;YACF,CAAA;IACF;AACF;AAEA,OAAO,MAAMM,uCAAuCzB,sBAClDK,6BACD"}
1
+ {"version":3,"sources":["../../../../src/field/features/horizontalRule/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport { $isNodeSelection } from 'lexical'\n\nimport type { FeatureProviderProviderClient } from '../types.js'\n\nimport { HorizontalRuleIcon } from '../../lexical/ui/icons/HorizontalRule/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { toolbarAddDropdownGroupWithItems } from '../shared/toolbar/addDropdownGroup.js'\nimport { MarkdownTransformer } from './markdownTransformer.js'\nimport {\n $isHorizontalRuleNode,\n HorizontalRuleNode,\n INSERT_HORIZONTAL_RULE_COMMAND,\n} from './nodes/HorizontalRuleNode.js'\nimport { HorizontalRulePlugin } from './plugin/index.js'\n\nconst HorizontalRuleFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n markdownTransformers: [MarkdownTransformer],\n nodes: [HorizontalRuleNode],\n plugins: [\n {\n Component: HorizontalRulePlugin,\n position: 'normal',\n },\n ],\n slashMenu: {\n groups: [\n {\n items: [\n {\n Icon: HorizontalRuleIcon,\n key: 'horizontalRule',\n keywords: ['hr', 'horizontal rule', 'line', 'separator'],\n label: `Horizontal Rule`,\n onSelect: ({ editor }) => {\n editor.dispatchCommand(INSERT_HORIZONTAL_RULE_COMMAND, undefined)\n },\n },\n ],\n key: 'basic',\n label: 'Basic',\n },\n ],\n },\n toolbarFixed: {\n groups: [\n toolbarAddDropdownGroupWithItems([\n {\n ChildComponent: HorizontalRuleIcon,\n isActive: ({ selection }) => {\n if (!$isNodeSelection(selection) || !selection.getNodes().length) {\n return false\n }\n\n const firstNode = selection.getNodes()[0]\n return $isHorizontalRuleNode(firstNode)\n },\n key: 'horizontalRule',\n label: `Horizontal Rule`,\n onSelect: ({ editor }) => {\n editor.dispatchCommand(INSERT_HORIZONTAL_RULE_COMMAND, undefined)\n },\n },\n ]),\n ],\n },\n }),\n }\n}\n\nexport const HorizontalRuleFeatureClientComponent = createClientComponent(\n HorizontalRuleFeatureClient,\n)\n"],"names":["$isNodeSelection","HorizontalRuleIcon","createClientComponent","toolbarAddDropdownGroupWithItems","MarkdownTransformer","$isHorizontalRuleNode","HorizontalRuleNode","INSERT_HORIZONTAL_RULE_COMMAND","HorizontalRulePlugin","HorizontalRuleFeatureClient","props","clientFeatureProps","feature","markdownTransformers","nodes","plugins","Component","position","slashMenu","groups","items","Icon","key","keywords","label","onSelect","editor","dispatchCommand","undefined","toolbarFixed","ChildComponent","isActive","selection","getNodes","length","firstNode","HorizontalRuleFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,gBAAgB,QAAQ,UAAS;AAI1C,SAASC,kBAAkB,QAAQ,iDAAgD;AACnF,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,gCAAgC,QAAQ,wCAAuC;AACxF,SAASC,mBAAmB,QAAQ,2BAA0B;AAC9D,SACEC,qBAAqB,EACrBC,kBAAkB,EAClBC,8BAA8B,QACzB,gCAA+B;AACtC,SAASC,oBAAoB,QAAQ,oBAAmB;AAExD,MAAMC,8BAAwE,CAACC;IAC7E,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,sBAAsB;oBAACT;iBAAoB;gBAC3CU,OAAO;oBAACR;iBAAmB;gBAC3BS,SAAS;oBACP;wBACEC,WAAWR;wBACXS,UAAU;oBACZ;iBACD;gBACDC,WAAW;oBACTC,QAAQ;wBACN;4BACEC,OAAO;gCACL;oCACEC,MAAMpB;oCACNqB,KAAK;oCACLC,UAAU;wCAAC;wCAAM;wCAAmB;wCAAQ;qCAAY;oCACxDC,OAAO,CAAC,eAAe,CAAC;oCACxBC,UAAU,CAAC,EAAEC,MAAM,EAAE;wCACnBA,OAAOC,eAAe,CAACpB,gCAAgCqB;oCACzD;gCACF;6BACD;4BACDN,KAAK;4BACLE,OAAO;wBACT;qBACD;gBACH;gBACAK,cAAc;oBACZV,QAAQ;wBACNhB,iCAAiC;4BAC/B;gCACE2B,gBAAgB7B;gCAChB8B,UAAU,CAAC,EAAEC,SAAS,EAAE;oCACtB,IAAI,CAAChC,iBAAiBgC,cAAc,CAACA,UAAUC,QAAQ,GAAGC,MAAM,EAAE;wCAChE,OAAO;oCACT;oCAEA,MAAMC,YAAYH,UAAUC,QAAQ,EAAE,CAAC,EAAE;oCACzC,OAAO5B,sBAAsB8B;gCAC/B;gCACAb,KAAK;gCACLE,OAAO,CAAC,eAAe,CAAC;gCACxBC,UAAU,CAAC,EAAEC,MAAM,EAAE;oCACnBA,OAAOC,eAAe,CAACpB,gCAAgCqB;gCACzD;4BACF;yBACD;qBACF;gBACH;YACF,CAAA;IACF;AACF;AAEA,OAAO,MAAMQ,uCAAuClC,sBAClDO,6BACD"}
@@ -1,6 +1,7 @@
1
+ import type { PluginComponent } from '../../types.js';
1
2
  import './index.scss';
2
3
  /**
3
4
  * Registers the INSERT_HORIZONTAL_RULE_COMMAND lexical command and defines the behavior for when it is called.
4
5
  */
5
- export declare function HorizontalRulePlugin(): null;
6
+ export declare const HorizontalRulePlugin: PluginComponent<undefined>;
6
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/horizontalRule/plugin/index.tsx"],"names":[],"mappings":"AAWA,OAAO,cAAc,CAAA;AAErB;;GAEG;AACH,wBAAgB,oBAAoB,IAAI,IAAI,CA2B3C"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/horizontalRule/plugin/index.tsx"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAMrD,OAAO,cAAc,CAAA;AAErB;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,eAAe,CAAC,SAAS,CA2B3D,CAAA"}
@@ -7,7 +7,7 @@ import { $createHorizontalRuleNode, INSERT_HORIZONTAL_RULE_COMMAND } from '../no
7
7
  import './index.scss';
8
8
  /**
9
9
  * Registers the INSERT_HORIZONTAL_RULE_COMMAND lexical command and defines the behavior for when it is called.
10
- */ export function HorizontalRulePlugin() {
10
+ */ export const HorizontalRulePlugin = ()=>{
11
11
  const [editor] = useLexicalComposerContext();
12
12
  useEffect(()=>{
13
13
  return editor.registerCommand(INSERT_HORIZONTAL_RULE_COMMAND, (type)=>{
@@ -26,6 +26,6 @@ import './index.scss';
26
26
  editor
27
27
  ]);
28
28
  return null;
29
- }
29
+ };
30
30
 
31
31
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/horizontalRule/plugin/index.tsx"],"sourcesContent":["'use client'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { $insertNodeToNearestRoot } from '@lexical/utils'\nimport { $getSelection, $isRangeSelection, COMMAND_PRIORITY_EDITOR } from 'lexical'\nimport { useEffect } from 'react'\n\nimport {\n $createHorizontalRuleNode,\n INSERT_HORIZONTAL_RULE_COMMAND,\n} from '../nodes/HorizontalRuleNode.js'\nimport './index.scss'\n\n/**\n * Registers the INSERT_HORIZONTAL_RULE_COMMAND lexical command and defines the behavior for when it is called.\n */\nexport function HorizontalRulePlugin(): null {\n const [editor] = useLexicalComposerContext()\n\n useEffect(() => {\n return editor.registerCommand(\n INSERT_HORIZONTAL_RULE_COMMAND,\n (type) => {\n const selection = $getSelection()\n\n if (!$isRangeSelection(selection)) {\n return false\n }\n\n const focusNode = selection.focus.getNode()\n\n if (focusNode !== null) {\n const horizontalRuleNode = $createHorizontalRuleNode()\n $insertNodeToNearestRoot(horizontalRuleNode)\n }\n\n return true\n },\n COMMAND_PRIORITY_EDITOR,\n )\n }, [editor])\n\n return null\n}\n"],"names":["useLexicalComposerContext","$insertNodeToNearestRoot","$getSelection","$isRangeSelection","COMMAND_PRIORITY_EDITOR","useEffect","$createHorizontalRuleNode","INSERT_HORIZONTAL_RULE_COMMAND","HorizontalRulePlugin","editor","registerCommand","type","selection","focusNode","focus","getNode","horizontalRuleNode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,SAASC,wBAAwB,QAAQ,iBAAgB;AACzD,SAASC,aAAa,EAAEC,iBAAiB,EAAEC,uBAAuB,QAAQ,UAAS;AACnF,SAASC,SAAS,QAAQ,QAAO;AAEjC,SACEC,yBAAyB,EACzBC,8BAA8B,QACzB,iCAAgC;AACvC,OAAO,eAAc;AAErB;;CAEC,GACD,OAAO,SAASC;IACd,MAAM,CAACC,OAAO,GAAGT;IAEjBK,UAAU;QACR,OAAOI,OAAOC,eAAe,CAC3BH,gCACA,CAACI;YACC,MAAMC,YAAYV;YAElB,IAAI,CAACC,kBAAkBS,YAAY;gBACjC,OAAO;YACT;YAEA,MAAMC,YAAYD,UAAUE,KAAK,CAACC,OAAO;YAEzC,IAAIF,cAAc,MAAM;gBACtB,MAAMG,qBAAqBV;gBAC3BL,yBAAyBe;YAC3B;YAEA,OAAO;QACT,GACAZ;IAEJ,GAAG;QAACK;KAAO;IAEX,OAAO;AACT"}
1
+ {"version":3,"sources":["../../../../../src/field/features/horizontalRule/plugin/index.tsx"],"sourcesContent":["'use client'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { $insertNodeToNearestRoot } from '@lexical/utils'\nimport { $getSelection, $isRangeSelection, COMMAND_PRIORITY_EDITOR } from 'lexical'\nimport { useEffect } from 'react'\n\nimport type { PluginComponent } from '../../types.js'\n\nimport {\n $createHorizontalRuleNode,\n INSERT_HORIZONTAL_RULE_COMMAND,\n} from '../nodes/HorizontalRuleNode.js'\nimport './index.scss'\n\n/**\n * Registers the INSERT_HORIZONTAL_RULE_COMMAND lexical command and defines the behavior for when it is called.\n */\nexport const HorizontalRulePlugin: PluginComponent<undefined> = () => {\n const [editor] = useLexicalComposerContext()\n\n useEffect(() => {\n return editor.registerCommand(\n INSERT_HORIZONTAL_RULE_COMMAND,\n (type) => {\n const selection = $getSelection()\n\n if (!$isRangeSelection(selection)) {\n return false\n }\n\n const focusNode = selection.focus.getNode()\n\n if (focusNode !== null) {\n const horizontalRuleNode = $createHorizontalRuleNode()\n $insertNodeToNearestRoot(horizontalRuleNode)\n }\n\n return true\n },\n COMMAND_PRIORITY_EDITOR,\n )\n }, [editor])\n\n return null\n}\n"],"names":["useLexicalComposerContext","$insertNodeToNearestRoot","$getSelection","$isRangeSelection","COMMAND_PRIORITY_EDITOR","useEffect","$createHorizontalRuleNode","INSERT_HORIZONTAL_RULE_COMMAND","HorizontalRulePlugin","editor","registerCommand","type","selection","focusNode","focus","getNode","horizontalRuleNode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,SAASC,wBAAwB,QAAQ,iBAAgB;AACzD,SAASC,aAAa,EAAEC,iBAAiB,EAAEC,uBAAuB,QAAQ,UAAS;AACnF,SAASC,SAAS,QAAQ,QAAO;AAIjC,SACEC,yBAAyB,EACzBC,8BAA8B,QACzB,iCAAgC;AACvC,OAAO,eAAc;AAErB;;CAEC,GACD,OAAO,MAAMC,uBAAmD;IAC9D,MAAM,CAACC,OAAO,GAAGT;IAEjBK,UAAU;QACR,OAAOI,OAAOC,eAAe,CAC3BH,gCACA,CAACI;YACC,MAAMC,YAAYV;YAElB,IAAI,CAACC,kBAAkBS,YAAY;gBACjC,OAAO;YACT;YAEA,MAAMC,YAAYD,UAAUE,KAAK,CAACC,OAAO;YAEzC,IAAIF,cAAc,MAAM;gBACtB,MAAMG,qBAAqBV;gBAC3BL,yBAAyBe;YAC3B;YAEA,OAAO;QACT,GACAZ;IAEJ,GAAG;QAACK;KAAO;IAEX,OAAO;AACT,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/field/features/indent/feature.client.tsx"],"names":[],"mappings":";AA+DA,eAAO,MAAM,4BAA4B,+BAA6C,CAAA"}
1
+ {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/field/features/indent/feature.client.tsx"],"names":[],"mappings":";AAmEA,eAAO,MAAM,4BAA4B,+BAA6C,CAAA"}
@@ -3,49 +3,53 @@ import { INDENT_CONTENT_COMMAND, OUTDENT_CONTENT_COMMAND } from 'lexical';
3
3
  import { IndentDecreaseIcon } from '../../lexical/ui/icons/IndentDecrease/index.js';
4
4
  import { IndentIncreaseIcon } from '../../lexical/ui/icons/IndentIncrease/index.js';
5
5
  import { createClientComponent } from '../createClientComponent.js';
6
- import { indentGroupWithItems } from './inlineToolbarIndentGroup.js';
6
+ import { toolbarIndentGroupWithItems } from './toolbarIndentGroup.js';
7
+ const toolbarGroups = [
8
+ toolbarIndentGroupWithItems([
9
+ {
10
+ ChildComponent: IndentDecreaseIcon,
11
+ isActive: ()=>false,
12
+ isEnabled: ({ selection })=>{
13
+ if (!selection || !selection?.getNodes()?.length) {
14
+ return false;
15
+ }
16
+ for (const node of selection.getNodes()){
17
+ // If at least one node is indented, this should be active
18
+ if ('__indent' in node && node.__indent > 0 || node.getParent() && '__indent' in node.getParent() && node.getParent().__indent > 0) {
19
+ return true;
20
+ }
21
+ }
22
+ return false;
23
+ },
24
+ key: 'indentDecrease',
25
+ label: `Decrease Indent`,
26
+ onSelect: ({ editor })=>{
27
+ editor.dispatchCommand(OUTDENT_CONTENT_COMMAND, undefined);
28
+ },
29
+ order: 1
30
+ },
31
+ {
32
+ ChildComponent: IndentIncreaseIcon,
33
+ isActive: ()=>false,
34
+ key: 'indentIncrease',
35
+ label: `Increase Indent`,
36
+ onSelect: ({ editor })=>{
37
+ editor.dispatchCommand(INDENT_CONTENT_COMMAND, undefined);
38
+ },
39
+ order: 2
40
+ }
41
+ ])
42
+ ];
7
43
  const IndentFeatureClient = (props)=>{
8
44
  return {
9
45
  clientFeatureProps: props,
10
46
  feature: ()=>({
11
47
  clientFeatureProps: props,
48
+ toolbarFixed: {
49
+ groups: toolbarGroups
50
+ },
12
51
  toolbarInline: {
13
- groups: [
14
- indentGroupWithItems([
15
- {
16
- ChildComponent: IndentDecreaseIcon,
17
- isActive: ()=>false,
18
- isEnabled: ({ selection })=>{
19
- if (!selection || !selection?.getNodes()?.length) {
20
- return false;
21
- }
22
- for (const node of selection.getNodes()){
23
- // If at least one node is indented, this should be active
24
- if ('__indent' in node && node.__indent > 0 || node.getParent() && '__indent' in node.getParent() && node.getParent().__indent > 0) {
25
- return true;
26
- }
27
- }
28
- return false;
29
- },
30
- key: 'indentDecrease',
31
- label: `Decrease Indent`,
32
- onSelect: ({ editor })=>{
33
- editor.dispatchCommand(OUTDENT_CONTENT_COMMAND, undefined);
34
- },
35
- order: 1
36
- },
37
- {
38
- ChildComponent: IndentIncreaseIcon,
39
- isActive: ()=>false,
40
- key: 'indentIncrease',
41
- label: `Increase Indent`,
42
- onSelect: ({ editor })=>{
43
- editor.dispatchCommand(INDENT_CONTENT_COMMAND, undefined);
44
- },
45
- order: 2
46
- }
47
- ])
48
- ]
52
+ groups: toolbarGroups
49
53
  }
50
54
  })
51
55
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/field/features/indent/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport { INDENT_CONTENT_COMMAND, OUTDENT_CONTENT_COMMAND } from 'lexical'\n\nimport type { FeatureProviderProviderClient } from '../types.js'\n\nimport { IndentDecreaseIcon } from '../../lexical/ui/icons/IndentDecrease/index.js'\nimport { IndentIncreaseIcon } from '../../lexical/ui/icons/IndentIncrease/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { indentGroupWithItems } from './inlineToolbarIndentGroup.js'\n\nconst IndentFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n toolbarInline: {\n groups: [\n indentGroupWithItems([\n {\n ChildComponent: IndentDecreaseIcon,\n isActive: () => false,\n isEnabled: ({ selection }) => {\n if (!selection || !selection?.getNodes()?.length) {\n return false\n }\n for (const node of selection.getNodes()) {\n // If at least one node is indented, this should be active\n if (\n ('__indent' in node && (node.__indent as number) > 0) ||\n (node.getParent() &&\n '__indent' in node.getParent() &&\n node.getParent().__indent > 0)\n ) {\n return true\n }\n }\n return false\n },\n key: 'indentDecrease',\n label: `Decrease Indent`,\n onSelect: ({ editor }) => {\n editor.dispatchCommand(OUTDENT_CONTENT_COMMAND, undefined)\n },\n order: 1,\n },\n {\n ChildComponent: IndentIncreaseIcon,\n isActive: () => false,\n key: 'indentIncrease',\n label: `Increase Indent`,\n onSelect: ({ editor }) => {\n editor.dispatchCommand(INDENT_CONTENT_COMMAND, undefined)\n },\n order: 2,\n },\n ]),\n ],\n },\n }),\n }\n}\n\nexport const IndentFeatureClientComponent = createClientComponent(IndentFeatureClient)\n"],"names":["INDENT_CONTENT_COMMAND","OUTDENT_CONTENT_COMMAND","IndentDecreaseIcon","IndentIncreaseIcon","createClientComponent","indentGroupWithItems","IndentFeatureClient","props","clientFeatureProps","feature","toolbarInline","groups","ChildComponent","isActive","isEnabled","selection","getNodes","length","node","__indent","getParent","key","label","onSelect","editor","dispatchCommand","undefined","order","IndentFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,sBAAsB,EAAEC,uBAAuB,QAAQ,UAAS;AAIzE,SAASC,kBAAkB,QAAQ,iDAAgD;AACnF,SAASC,kBAAkB,QAAQ,iDAAgD;AACnF,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,oBAAoB,QAAQ,gCAA+B;AAEpE,MAAMC,sBAAgE,CAACC;IACrE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,eAAe;oBACbC,QAAQ;wBACNN,qBAAqB;4BACnB;gCACEO,gBAAgBV;gCAChBW,UAAU,IAAM;gCAChBC,WAAW,CAAC,EAAEC,SAAS,EAAE;oCACvB,IAAI,CAACA,aAAa,CAACA,WAAWC,YAAYC,QAAQ;wCAChD,OAAO;oCACT;oCACA,KAAK,MAAMC,QAAQH,UAAUC,QAAQ,GAAI;wCACvC,0DAA0D;wCAC1D,IACE,AAAC,cAAcE,QAAQ,AAACA,KAAKC,QAAQ,GAAc,KAClDD,KAAKE,SAAS,MACb,cAAcF,KAAKE,SAAS,MAC5BF,KAAKE,SAAS,GAAGD,QAAQ,GAAG,GAC9B;4CACA,OAAO;wCACT;oCACF;oCACA,OAAO;gCACT;gCACAE,KAAK;gCACLC,OAAO,CAAC,eAAe,CAAC;gCACxBC,UAAU,CAAC,EAAEC,MAAM,EAAE;oCACnBA,OAAOC,eAAe,CAACxB,yBAAyByB;gCAClD;gCACAC,OAAO;4BACT;4BACA;gCACEf,gBAAgBT;gCAChBU,UAAU,IAAM;gCAChBQ,KAAK;gCACLC,OAAO,CAAC,eAAe,CAAC;gCACxBC,UAAU,CAAC,EAAEC,MAAM,EAAE;oCACnBA,OAAOC,eAAe,CAACzB,wBAAwB0B;gCACjD;gCACAC,OAAO;4BACT;yBACD;qBACF;gBACH;YACF,CAAA;IACF;AACF;AAEA,OAAO,MAAMC,+BAA+BxB,sBAAsBE,qBAAoB"}
1
+ {"version":3,"sources":["../../../../src/field/features/indent/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport { INDENT_CONTENT_COMMAND, OUTDENT_CONTENT_COMMAND } from 'lexical'\n\nimport type { ToolbarGroup } from '../toolbars/types.js'\nimport type { FeatureProviderProviderClient } from '../types.js'\n\nimport { IndentDecreaseIcon } from '../../lexical/ui/icons/IndentDecrease/index.js'\nimport { IndentIncreaseIcon } from '../../lexical/ui/icons/IndentIncrease/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { toolbarIndentGroupWithItems } from './toolbarIndentGroup.js'\n\nconst toolbarGroups: ToolbarGroup[] = [\n toolbarIndentGroupWithItems([\n {\n ChildComponent: IndentDecreaseIcon,\n isActive: () => false,\n isEnabled: ({ selection }) => {\n if (!selection || !selection?.getNodes()?.length) {\n return false\n }\n for (const node of selection.getNodes()) {\n // If at least one node is indented, this should be active\n if (\n ('__indent' in node && (node.__indent as number) > 0) ||\n (node.getParent() && '__indent' in node.getParent() && node.getParent().__indent > 0)\n ) {\n return true\n }\n }\n return false\n },\n key: 'indentDecrease',\n label: `Decrease Indent`,\n onSelect: ({ editor }) => {\n editor.dispatchCommand(OUTDENT_CONTENT_COMMAND, undefined)\n },\n order: 1,\n },\n {\n ChildComponent: IndentIncreaseIcon,\n isActive: () => false,\n key: 'indentIncrease',\n label: `Increase Indent`,\n onSelect: ({ editor }) => {\n editor.dispatchCommand(INDENT_CONTENT_COMMAND, undefined)\n },\n order: 2,\n },\n ]),\n]\n\nconst IndentFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n toolbarFixed: {\n groups: toolbarGroups,\n },\n toolbarInline: {\n groups: toolbarGroups,\n },\n }),\n }\n}\n\nexport const IndentFeatureClientComponent = createClientComponent(IndentFeatureClient)\n"],"names":["INDENT_CONTENT_COMMAND","OUTDENT_CONTENT_COMMAND","IndentDecreaseIcon","IndentIncreaseIcon","createClientComponent","toolbarIndentGroupWithItems","toolbarGroups","ChildComponent","isActive","isEnabled","selection","getNodes","length","node","__indent","getParent","key","label","onSelect","editor","dispatchCommand","undefined","order","IndentFeatureClient","props","clientFeatureProps","feature","toolbarFixed","groups","toolbarInline","IndentFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,sBAAsB,EAAEC,uBAAuB,QAAQ,UAAS;AAKzE,SAASC,kBAAkB,QAAQ,iDAAgD;AACnF,SAASC,kBAAkB,QAAQ,iDAAgD;AACnF,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,2BAA2B,QAAQ,0BAAyB;AAErE,MAAMC,gBAAgC;IACpCD,4BAA4B;QAC1B;YACEE,gBAAgBL;YAChBM,UAAU,IAAM;YAChBC,WAAW,CAAC,EAAEC,SAAS,EAAE;gBACvB,IAAI,CAACA,aAAa,CAACA,WAAWC,YAAYC,QAAQ;oBAChD,OAAO;gBACT;gBACA,KAAK,MAAMC,QAAQH,UAAUC,QAAQ,GAAI;oBACvC,0DAA0D;oBAC1D,IACE,AAAC,cAAcE,QAAQ,AAACA,KAAKC,QAAQ,GAAc,KAClDD,KAAKE,SAAS,MAAM,cAAcF,KAAKE,SAAS,MAAMF,KAAKE,SAAS,GAAGD,QAAQ,GAAG,GACnF;wBACA,OAAO;oBACT;gBACF;gBACA,OAAO;YACT;YACAE,KAAK;YACLC,OAAO,CAAC,eAAe,CAAC;YACxBC,UAAU,CAAC,EAAEC,MAAM,EAAE;gBACnBA,OAAOC,eAAe,CAACnB,yBAAyBoB;YAClD;YACAC,OAAO;QACT;QACA;YACEf,gBAAgBJ;YAChBK,UAAU,IAAM;YAChBQ,KAAK;YACLC,OAAO,CAAC,eAAe,CAAC;YACxBC,UAAU,CAAC,EAAEC,MAAM,EAAE;gBACnBA,OAAOC,eAAe,CAACpB,wBAAwBqB;YACjD;YACAC,OAAO;QACT;KACD;CACF;AAED,MAAMC,sBAAgE,CAACC;IACrE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,cAAc;oBACZC,QAAQtB;gBACV;gBACAuB,eAAe;oBACbD,QAAQtB;gBACV;YACF,CAAA;IACF;AACF;AAEA,OAAO,MAAMwB,+BAA+B1B,sBAAsBmB,qBAAoB"}
@@ -0,0 +1,3 @@
1
+ import type { ToolbarGroup, ToolbarGroupItem } from '../toolbars/types.js';
2
+ export declare const toolbarIndentGroupWithItems: (items: ToolbarGroupItem[]) => ToolbarGroup;
3
+ //# sourceMappingURL=toolbarIndentGroup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolbarIndentGroup.d.ts","sourceRoot":"","sources":["../../../../src/field/features/indent/toolbarIndentGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAE1E,eAAO,MAAM,2BAA2B,UAAW,gBAAgB,EAAE,KAAG,YAOvE,CAAA"}
@@ -0,0 +1,10 @@
1
+ export const toolbarIndentGroupWithItems = (items)=>{
2
+ return {
3
+ type: 'buttons',
4
+ items,
5
+ key: 'indent',
6
+ order: 35
7
+ };
8
+ };
9
+
10
+ //# sourceMappingURL=toolbarIndentGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/field/features/indent/toolbarIndentGroup.ts"],"sourcesContent":["import type { ToolbarGroup, ToolbarGroupItem } from '../toolbars/types.js'\n\nexport const toolbarIndentGroupWithItems = (items: ToolbarGroupItem[]): ToolbarGroup => {\n return {\n type: 'buttons',\n items,\n key: 'indent',\n order: 35,\n }\n}\n"],"names":["toolbarIndentGroupWithItems","items","type","key","order"],"rangeMappings":";;;;;;;","mappings":"AAEA,OAAO,MAAMA,8BAA8B,CAACC;IAC1C,OAAO;QACLC,MAAM;QACND;QACAE,KAAK;QACLC,OAAO;IACT;AACF,EAAC"}
@@ -1,4 +1,4 @@
1
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[];
2
+ import type { Field } from 'payload/types';
3
+ export declare const getBaseFields: (config: SanitizedConfig, enabledCollections: false | string[], disabledCollections: false | string[], maxDepth?: number) => Field[];
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,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"}
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,EAAE,KAAK,EAAyB,MAAM,eAAe,CAAA;AAIjE,eAAO,MAAM,aAAa,WAChB,eAAe,sBACH,KAAK,GAAG,MAAM,EAAE,uBACf,KAAK,GAAG,MAAM,EAAE,aAC1B,MAAM,KAChB,KAAK,EAsGP,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { validateUrl } from '../../../lexical/utils/url.js';
2
- export const getBaseFields = (config, enabledCollections, disabledCollections)=>{
2
+ export const getBaseFields = (config, enabledCollections, disabledCollections, maxDepth)=>{
3
3
  let enabledRelations;
4
4
  /**
5
5
  * Figure out which relations should be enabled (enabledRelations) based on a collection's admin.enableRichTextLink property,
@@ -78,6 +78,7 @@ export const getBaseFields = (config, enabledCollections, disabledCollections)=>
78
78
  }
79
79
  } : null,
80
80
  label: ({ t })=>t('fields:chooseDocumentToLink'),
81
+ maxDepth,
81
82
  relationTo: enabledRelations,
82
83
  required: true
83
84
  });
@@ -1 +1 @@
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,GAAKA,EAAE;oBACpBK,OAAO;gBACT;aACD;YACDJ,UAAU;QACZ;QACA;YACEJ,MAAM;YACNC,MAAM;YACNC,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;YACpBC,UAAU;YACVK,UAAU,CAACD;gBACT,IAAI,CAACvB,YAAYuB,QAAQ;oBACvB,OAAO;gBACT;YACF;QACF;KACD;IAED,mGAAmG;IACnG,IAAIlB,kBAAkBoB,QAAQ;QAC1BX,UAAU,CAAC,EAAE,CAAgBQ,OAAO,CAACI,IAAI,CAAC;YAC1CT,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;YACpBK,OAAO;QACT;QACET,UAAU,CAAC,EAAE,CAAeH,KAAK,GAAG;YACpCgB,WAAW,CAAC,EAAEC,QAAQ,EAAE,GAAKA,aAAa;QAC5C;QAEAd,WAAWY,IAAI,CAAC;YACdX,MAAM;YACNJ,OAAO;gBACLgB,WAAW,CAAC,EAAEC,QAAQ,EAAE;oBACtB,OAAOA,aAAa;gBACtB;YACF;YACA,6HAA6H;YAC7HZ,MAAM;YACNa,eACE,CAAC1B,sBAAsB,CAACC,sBACpB,CAAC,EAAE0B,UAAU,EAAEC,IAAI,EAAE;gBACnB,MAAMlB,SAASX,OAAOI,WAAW,CAAC0B,IAAI,CAAC,CAAC,EAAExB,IAAI,EAAE,GAAKA,SAASsB,YAAYnB,KAAK,CAACE,MAAM;gBACtF,IAAI,OAAOA,WAAW,cAAcA,OAAO;oBAAEkB;gBAAK,IAAsB;oBACtE,OAAO;gBACT;YACF,IACA;YACNd,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;YACpBY,YAAYzB;YACZc,UAAU;QACZ;IACF;IAEAL,WAAWY,IAAI,CAAC;QACdX,MAAM;QACNC,MAAM;QACNC,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;IACtB;IAEA,OAAOJ;AACT,EAAC"}
1
+ {"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, 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 maxDepth?: number,\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: 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 maxDepth,\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\n}\n"],"names":["validateUrl","getBaseFields","config","enabledCollections","disabledCollections","maxDepth","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,qBACAC;IAEA,IAAIC;IAEJ;;;GAGC,GACD,IAAIH,oBAAoB;QACtBG,mBAAmBH;IACrB,OAAO,IAAIC,qBAAqB;QAC9BE,mBAAmBJ,OAAOK,WAAW,CAClCC,MAAM,CAAC,CAAC,EAAEC,IAAI,EAAE,GAAK,CAACL,oBAAoBM,QAAQ,CAACD,OACnDE,GAAG,CAAC,CAAC,EAAEF,IAAI,EAAE,GAAKA;IACvB,OAAO;QACLH,mBAAmBJ,OAAOK,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,GAAKA,EAAE;oBACpBK,OAAO;gBACT;aACD;YACDJ,UAAU;QACZ;QACA;YACEJ,MAAM;YACNC,MAAM;YACNC,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;YACpBC,UAAU;YACVK,UAAU,CAACD;gBACT,IAAI,CAACxB,YAAYwB,QAAQ;oBACvB,OAAO;gBACT;YACF;QACF;KACD;IAED,mGAAmG;IACnG,IAAIlB,kBAAkBoB,QAAQ;QAC1BX,UAAU,CAAC,EAAE,CAAgBQ,OAAO,CAACI,IAAI,CAAC;YAC1CT,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;YACpBK,OAAO;QACT;QACET,UAAU,CAAC,EAAE,CAAeH,KAAK,GAAG;YACpCgB,WAAW,CAAC,EAAEC,QAAQ,EAAE,GAAKA,aAAa;QAC5C;QAEAd,WAAWY,IAAI,CAAC;YACdX,MAAM;YACNJ,OAAO;gBACLgB,WAAW,CAAC,EAAEC,QAAQ,EAAE;oBACtB,OAAOA,aAAa;gBACtB;YACF;YACA,6HAA6H;YAC7HZ,MAAM;YACNa,eACE,CAAC3B,sBAAsB,CAACC,sBACpB,CAAC,EAAE2B,UAAU,EAAEC,IAAI,EAAE;gBACnB,MAAMlB,SAASZ,OAAOK,WAAW,CAAC0B,IAAI,CAAC,CAAC,EAAExB,IAAI,EAAE,GAAKA,SAASsB,YAAYnB,KAAK,CAACE,MAAM;gBACtF,IAAI,OAAOA,WAAW,cAAcA,OAAO;oBAAEkB;gBAAK,IAAsB;oBACtE,OAAO;gBACT;YACF,IACA;YACNd,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;YACpBd;YACA0B,YAAYzB;YACZc,UAAU;QACZ;IACF;IAEAL,WAAWY,IAAI,CAAC;QACdX,MAAM;QACNC,MAAM;QACNC,OAAO,CAAC,EAAEC,CAAC,EAAE,GAAKA,EAAE;IACtB;IAEA,OAAOJ;AACT,EAAC"}
@@ -3,8 +3,8 @@ 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?: LinkFields & {
6
+ stateData: {} | (LinkFields & {
7
7
  text: string;
8
- };
8
+ });
9
9
  }
10
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,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
+ {"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,EAAE,EAAE,GAAG,CAAC,UAAU,GAAG;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;CAChD"}
@@ -1 +1 @@
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
+ {"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":";AAMA,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":";AASA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,qBAAqB,CAAA;AAexE,MAAM,MAAM,WAAW,GAAG,6BAA6B,CAAA;AAyFvD,eAAO,MAAM,0BAA0B,+FAA2C,CAAA"}