@payloadcms/richtext-lexical 3.29.0-internal.0ad276c → 3.29.0-internal.3471e81

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 (459) hide show
  1. package/dist/exports/client/Field-5SZDDPZE.js +2 -0
  2. package/dist/exports/client/Field-5SZDDPZE.js.map +7 -0
  3. package/dist/exports/client/{RelationshipComponent-JPESGV4Q.js → RelationshipComponent-APF3CN47.js} +2 -2
  4. package/dist/exports/client/bundled.css +1 -1
  5. package/dist/exports/client/chunk-46KMRCKV.js +2 -0
  6. package/dist/exports/client/chunk-46KMRCKV.js.map +7 -0
  7. package/dist/exports/client/chunk-BZZVLW4U.js +2 -0
  8. package/dist/exports/client/chunk-BZZVLW4U.js.map +7 -0
  9. package/dist/exports/client/{chunk-PUXDVIHC.js → chunk-Y2GOLUGU.js} +2 -2
  10. package/dist/exports/client/{component-P5K7Z5NW.js → component-Y3OSWJM5.js} +2 -2
  11. package/dist/exports/client/componentInline-ZB4EY7EQ.js +2 -0
  12. package/dist/exports/client/index.js +10 -10
  13. package/dist/exports/client/index.js.map +3 -3
  14. package/dist/exports/html/index.d.ts +15 -15
  15. package/dist/exports/html/index.d.ts.map +1 -1
  16. package/dist/exports/html/index.js +13 -13
  17. package/dist/exports/html/index.js.map +1 -1
  18. package/dist/exports/html-async/index.d.ts +15 -15
  19. package/dist/exports/html-async/index.d.ts.map +1 -1
  20. package/dist/exports/html-async/index.js +13 -13
  21. package/dist/exports/html-async/index.js.map +1 -1
  22. package/dist/exports/plaintext/index.d.ts +3 -0
  23. package/dist/exports/plaintext/index.d.ts.map +1 -0
  24. package/dist/exports/plaintext/index.js +2 -0
  25. package/dist/exports/plaintext/index.js.map +1 -0
  26. package/dist/exports/react/index.d.ts +15 -15
  27. package/dist/exports/react/index.d.ts.map +1 -1
  28. package/dist/exports/react/index.js +14 -14
  29. package/dist/exports/react/index.js.map +1 -1
  30. package/dist/features/blockquote/server/index.js +1 -1
  31. package/dist/features/blockquote/server/index.js.map +1 -1
  32. package/dist/features/blocks/client/component/BlockContent.d.ts.map +1 -1
  33. package/dist/features/blocks/client/component/BlockContent.js +2 -4
  34. package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
  35. package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
  36. package/dist/features/blocks/client/componentInline/index.js +2 -4
  37. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  38. package/dist/features/blocks/server/linesFromMatchToContentAndPropsString.d.ts.map +1 -1
  39. package/dist/features/blocks/server/linesFromMatchToContentAndPropsString.js +1 -1
  40. package/dist/features/blocks/server/linesFromMatchToContentAndPropsString.js.map +1 -1
  41. package/dist/features/converters/htmlToLexical/index.d.ts.map +1 -1
  42. package/dist/features/converters/htmlToLexical/index.js +0 -1
  43. package/dist/features/converters/htmlToLexical/index.js.map +1 -1
  44. package/dist/features/converters/lexicalToHtml/async/converters/blockquote.d.ts.map +1 -0
  45. package/dist/features/converters/lexicalToHtml/async/converters/blockquote.js.map +1 -0
  46. package/dist/features/converters/lexicalToHtml/async/converters/heading.d.ts.map +1 -0
  47. package/dist/features/converters/lexicalToHtml/async/converters/heading.js.map +1 -0
  48. package/dist/features/converters/lexicalToHtml/async/converters/horizontalRule.d.ts.map +1 -0
  49. package/dist/features/converters/lexicalToHtml/async/converters/horizontalRule.js.map +1 -0
  50. package/dist/features/converters/lexicalToHtml/async/converters/linebreak.d.ts.map +1 -0
  51. package/dist/features/converters/lexicalToHtml/async/converters/linebreak.js.map +1 -0
  52. package/dist/features/converters/lexicalToHtml/async/converters/link.d.ts.map +1 -0
  53. package/dist/features/converters/{html → lexicalToHtml}/async/converters/link.js +4 -8
  54. package/dist/features/converters/lexicalToHtml/async/converters/link.js.map +1 -0
  55. package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts.map +1 -0
  56. package/dist/features/converters/lexicalToHtml/async/converters/list.js.map +1 -0
  57. package/dist/features/converters/lexicalToHtml/async/converters/paragraph.d.ts.map +1 -0
  58. package/dist/features/converters/lexicalToHtml/async/converters/paragraph.js.map +1 -0
  59. package/dist/features/converters/lexicalToHtml/async/converters/tab.d.ts.map +1 -0
  60. package/dist/features/converters/lexicalToHtml/async/converters/tab.js.map +1 -0
  61. package/dist/features/converters/lexicalToHtml/async/converters/table.d.ts.map +1 -0
  62. package/dist/features/converters/lexicalToHtml/async/converters/table.js.map +1 -0
  63. package/dist/features/converters/lexicalToHtml/async/converters/text.d.ts.map +1 -0
  64. package/dist/features/converters/lexicalToHtml/async/converters/text.js.map +1 -0
  65. package/dist/features/converters/lexicalToHtml/async/converters/upload.d.ts.map +1 -0
  66. package/dist/features/converters/lexicalToHtml/async/converters/upload.js.map +1 -0
  67. package/dist/features/converters/lexicalToHtml/async/defaultConverters.d.ts.map +1 -0
  68. package/dist/features/converters/lexicalToHtml/async/defaultConverters.js.map +1 -0
  69. package/dist/features/converters/lexicalToHtml/async/field/index.d.ts.map +1 -0
  70. package/dist/features/converters/{html → lexicalToHtml}/async/field/index.js +11 -11
  71. package/dist/features/converters/lexicalToHtml/async/field/index.js.map +1 -0
  72. package/dist/features/converters/lexicalToHtml/async/index.d.ts.map +1 -0
  73. package/dist/features/converters/lexicalToHtml/async/index.js.map +1 -0
  74. package/dist/features/converters/lexicalToHtml/async/types.d.ts.map +1 -0
  75. package/dist/features/converters/lexicalToHtml/async/types.js.map +1 -0
  76. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.d.ts.map +1 -0
  77. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js.map +1 -0
  78. package/dist/features/converters/lexicalToHtml/shared/types.d.ts.map +1 -0
  79. package/dist/features/converters/lexicalToHtml/shared/types.js.map +1 -0
  80. package/dist/features/converters/lexicalToHtml/sync/converters/blockquote.d.ts.map +1 -0
  81. package/dist/features/converters/lexicalToHtml/sync/converters/blockquote.js.map +1 -0
  82. package/dist/features/converters/lexicalToHtml/sync/converters/heading.d.ts.map +1 -0
  83. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js.map +1 -0
  84. package/dist/features/converters/lexicalToHtml/sync/converters/horizontalRule.d.ts.map +1 -0
  85. package/dist/features/converters/lexicalToHtml/sync/converters/horizontalRule.js.map +1 -0
  86. package/dist/features/converters/lexicalToHtml/sync/converters/linebreak.d.ts.map +1 -0
  87. package/dist/features/converters/lexicalToHtml/sync/converters/linebreak.js.map +1 -0
  88. package/dist/features/converters/lexicalToHtml/sync/converters/link.d.ts.map +1 -0
  89. package/dist/features/converters/{html → lexicalToHtml}/sync/converters/link.js +4 -8
  90. package/dist/features/converters/lexicalToHtml/sync/converters/link.js.map +1 -0
  91. package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts.map +1 -0
  92. package/dist/features/converters/lexicalToHtml/sync/converters/list.js.map +1 -0
  93. package/dist/features/converters/lexicalToHtml/sync/converters/paragraph.d.ts.map +1 -0
  94. package/dist/features/converters/lexicalToHtml/sync/converters/paragraph.js.map +1 -0
  95. package/dist/features/converters/lexicalToHtml/sync/converters/tab.d.ts.map +1 -0
  96. package/dist/features/converters/lexicalToHtml/sync/converters/tab.js.map +1 -0
  97. package/dist/features/converters/lexicalToHtml/sync/converters/table.d.ts.map +1 -0
  98. package/dist/features/converters/lexicalToHtml/sync/converters/table.js.map +1 -0
  99. package/dist/features/converters/lexicalToHtml/sync/converters/text.d.ts.map +1 -0
  100. package/dist/features/converters/lexicalToHtml/sync/converters/text.js.map +1 -0
  101. package/dist/features/converters/lexicalToHtml/sync/converters/upload.d.ts.map +1 -0
  102. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js.map +1 -0
  103. package/dist/features/converters/lexicalToHtml/sync/defaultConverters.d.ts.map +1 -0
  104. package/dist/features/converters/lexicalToHtml/sync/defaultConverters.js.map +1 -0
  105. package/dist/features/converters/lexicalToHtml/sync/index.d.ts.map +1 -0
  106. package/dist/features/converters/lexicalToHtml/sync/index.js.map +1 -0
  107. package/dist/features/converters/lexicalToHtml/sync/types.d.ts.map +1 -0
  108. package/dist/features/converters/lexicalToHtml/sync/types.js.map +1 -0
  109. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/linebreak.d.ts.map +1 -0
  110. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/linebreak.js.map +1 -0
  111. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/paragraph.d.ts.map +1 -0
  112. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/paragraph.js.map +1 -0
  113. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/tab.d.ts.map +1 -0
  114. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/tab.js.map +1 -0
  115. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/text.d.ts.map +1 -0
  116. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/text.js.map +1 -0
  117. package/dist/features/converters/lexicalToHtml_deprecated/converter/defaultConverters.d.ts.map +1 -0
  118. package/dist/features/converters/lexicalToHtml_deprecated/converter/defaultConverters.js.map +1 -0
  119. package/dist/features/converters/lexicalToHtml_deprecated/converter/index.d.ts.map +1 -0
  120. package/dist/features/converters/lexicalToHtml_deprecated/converter/index.js.map +1 -0
  121. package/dist/features/converters/lexicalToHtml_deprecated/converter/types.d.ts.map +1 -0
  122. package/dist/features/converters/lexicalToHtml_deprecated/converter/types.js.map +1 -0
  123. package/dist/features/converters/lexicalToHtml_deprecated/field/index.d.ts.map +1 -0
  124. package/dist/features/converters/lexicalToHtml_deprecated/field/index.js.map +1 -0
  125. package/dist/features/converters/lexicalToHtml_deprecated/index.d.ts.map +1 -0
  126. package/dist/features/converters/lexicalToHtml_deprecated/index.js.map +1 -0
  127. package/dist/features/converters/lexicalToJSX/Component/index.d.ts.map +1 -0
  128. package/dist/features/converters/lexicalToJSX/Component/index.js.map +1 -0
  129. package/dist/features/converters/lexicalToJSX/converter/converters/blockquote.d.ts.map +1 -0
  130. package/dist/features/converters/lexicalToJSX/converter/converters/blockquote.js.map +1 -0
  131. package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts.map +1 -0
  132. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -0
  133. package/dist/features/converters/lexicalToJSX/converter/converters/horizontalRule.d.ts.map +1 -0
  134. package/dist/features/converters/lexicalToJSX/converter/converters/horizontalRule.js.map +1 -0
  135. package/dist/features/converters/lexicalToJSX/converter/converters/linebreak.d.ts.map +1 -0
  136. package/dist/features/converters/lexicalToJSX/converter/converters/linebreak.js.map +1 -0
  137. package/dist/features/converters/lexicalToJSX/converter/converters/link.d.ts.map +1 -0
  138. package/dist/features/converters/lexicalToJSX/converter/converters/link.js.map +1 -0
  139. package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts.map +1 -0
  140. package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -0
  141. package/dist/features/converters/lexicalToJSX/converter/converters/paragraph.d.ts.map +1 -0
  142. package/dist/features/converters/lexicalToJSX/converter/converters/paragraph.js.map +1 -0
  143. package/dist/features/converters/lexicalToJSX/converter/converters/tab.d.ts.map +1 -0
  144. package/dist/features/converters/lexicalToJSX/converter/converters/tab.js.map +1 -0
  145. package/dist/features/converters/lexicalToJSX/converter/converters/table.d.ts.map +1 -0
  146. package/dist/features/converters/lexicalToJSX/converter/converters/table.js.map +1 -0
  147. package/dist/features/converters/lexicalToJSX/converter/converters/text.d.ts.map +1 -0
  148. package/dist/features/converters/lexicalToJSX/converter/converters/text.js.map +1 -0
  149. package/dist/features/converters/lexicalToJSX/converter/converters/upload.d.ts.map +1 -0
  150. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js.map +1 -0
  151. package/dist/features/converters/lexicalToJSX/converter/defaultConverters.d.ts.map +1 -0
  152. package/dist/features/converters/lexicalToJSX/converter/defaultConverters.js.map +1 -0
  153. package/dist/features/converters/lexicalToJSX/converter/index.d.ts.map +1 -0
  154. package/dist/features/converters/lexicalToJSX/converter/index.js.map +1 -0
  155. package/dist/features/converters/lexicalToJSX/converter/types.d.ts.map +1 -0
  156. package/dist/features/converters/lexicalToJSX/converter/types.js.map +1 -0
  157. package/dist/features/converters/lexicalToMarkdown/index.d.ts +7 -0
  158. package/dist/features/converters/lexicalToMarkdown/index.d.ts.map +1 -0
  159. package/dist/features/converters/lexicalToMarkdown/index.js +24 -0
  160. package/dist/features/converters/lexicalToMarkdown/index.js.map +1 -0
  161. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js +84 -0
  162. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js.map +1 -0
  163. package/dist/features/converters/lexicalToPlaintext/shared/findConverterForNode.d.ts +7 -0
  164. package/dist/features/converters/lexicalToPlaintext/shared/findConverterForNode.d.ts.map +1 -0
  165. package/dist/features/converters/lexicalToPlaintext/shared/findConverterForNode.js +15 -0
  166. package/dist/features/converters/lexicalToPlaintext/shared/findConverterForNode.js.map +1 -0
  167. package/dist/features/converters/lexicalToPlaintext/shared/types.d.ts +5 -0
  168. package/dist/features/converters/lexicalToPlaintext/shared/types.d.ts.map +1 -0
  169. package/dist/features/converters/lexicalToPlaintext/shared/types.js +2 -0
  170. package/dist/features/converters/lexicalToPlaintext/shared/types.js.map +1 -0
  171. package/dist/features/converters/lexicalToPlaintext/sync/index.d.ts +22 -0
  172. package/dist/features/converters/lexicalToPlaintext/sync/index.d.ts.map +1 -0
  173. package/dist/features/converters/lexicalToPlaintext/sync/index.js +79 -0
  174. package/dist/features/converters/lexicalToPlaintext/sync/index.js.map +1 -0
  175. package/dist/features/converters/lexicalToPlaintext/sync/types.d.ts +60 -0
  176. package/dist/features/converters/lexicalToPlaintext/sync/types.d.ts.map +1 -0
  177. package/dist/features/converters/lexicalToPlaintext/sync/types.js +2 -0
  178. package/dist/features/converters/lexicalToPlaintext/sync/types.js.map +1 -0
  179. package/dist/features/converters/markdownToLexical/index.d.ts +8 -0
  180. package/dist/features/converters/markdownToLexical/index.d.ts.map +1 -0
  181. package/dist/features/converters/markdownToLexical/index.js +21 -0
  182. package/dist/features/converters/markdownToLexical/index.js.map +1 -0
  183. package/dist/features/converters/utilities/payloadPopulateFn.d.ts +1 -1
  184. package/dist/features/converters/utilities/payloadPopulateFn.d.ts.map +1 -1
  185. package/dist/features/converters/utilities/payloadPopulateFn.js.map +1 -1
  186. package/dist/features/converters/utilities/restPopulateFn.d.ts +1 -1
  187. package/dist/features/converters/utilities/restPopulateFn.d.ts.map +1 -1
  188. package/dist/features/converters/utilities/restPopulateFn.js.map +1 -1
  189. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js +3 -3
  190. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +1 -1
  191. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts +1 -0
  192. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -1
  193. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js +5 -1
  194. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +1 -1
  195. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js +3 -3
  196. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +1 -1
  197. package/dist/features/experimental_table/server/index.js +1 -1
  198. package/dist/features/experimental_table/server/index.js.map +1 -1
  199. package/dist/features/heading/server/index.js +1 -1
  200. package/dist/features/heading/server/index.js.map +1 -1
  201. package/dist/features/indent/client/IndentPlugin.d.ts.map +1 -1
  202. package/dist/features/indent/client/IndentPlugin.js +26 -6
  203. package/dist/features/indent/client/IndentPlugin.js.map +1 -1
  204. package/dist/features/indent/server/index.d.ts +7 -0
  205. package/dist/features/indent/server/index.d.ts.map +1 -1
  206. package/dist/features/indent/server/index.js.map +1 -1
  207. package/dist/features/link/server/index.js +1 -1
  208. package/dist/features/link/server/index.js.map +1 -1
  209. package/dist/features/lists/htmlConverter.d.ts +1 -1
  210. package/dist/features/lists/htmlConverter.d.ts.map +1 -1
  211. package/dist/features/lists/htmlConverter.js +1 -1
  212. package/dist/features/lists/htmlConverter.js.map +1 -1
  213. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +2 -2
  214. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  215. package/dist/features/typesServer.d.ts +1 -1
  216. package/dist/features/typesServer.d.ts.map +1 -1
  217. package/dist/features/typesServer.js.map +1 -1
  218. package/dist/field/Field.d.ts.map +1 -1
  219. package/dist/field/Field.js +2 -3
  220. package/dist/field/Field.js.map +1 -1
  221. package/dist/field/bundled.css +1 -1
  222. package/dist/index.d.ts +13 -11
  223. package/dist/index.d.ts.map +1 -1
  224. package/dist/index.js +12 -10
  225. package/dist/index.js.map +1 -1
  226. package/dist/lexical/config/client/EditorConfigProvider.js +4 -4
  227. package/dist/lexical/config/client/EditorConfigProvider.js.map +1 -1
  228. package/dist/nodeTypes.d.ts +1 -1
  229. package/dist/nodeTypes.d.ts.map +1 -1
  230. package/dist/nodeTypes.js.map +1 -1
  231. package/package.json +24 -19
  232. package/dist/exports/client/Field-FLAQN6LU.js +0 -2
  233. package/dist/exports/client/Field-FLAQN6LU.js.map +0 -7
  234. package/dist/exports/client/chunk-3LGFOM34.js +0 -2
  235. package/dist/exports/client/chunk-3LGFOM34.js.map +0 -7
  236. package/dist/exports/client/chunk-QBDC3MVG.js +0 -2
  237. package/dist/exports/client/chunk-QBDC3MVG.js.map +0 -7
  238. package/dist/exports/client/componentInline-IBB73SHH.js +0 -2
  239. package/dist/features/converters/html/async/converters/blockquote.d.ts.map +0 -1
  240. package/dist/features/converters/html/async/converters/blockquote.js.map +0 -1
  241. package/dist/features/converters/html/async/converters/heading.d.ts.map +0 -1
  242. package/dist/features/converters/html/async/converters/heading.js.map +0 -1
  243. package/dist/features/converters/html/async/converters/horizontalRule.d.ts.map +0 -1
  244. package/dist/features/converters/html/async/converters/horizontalRule.js.map +0 -1
  245. package/dist/features/converters/html/async/converters/linebreak.d.ts.map +0 -1
  246. package/dist/features/converters/html/async/converters/linebreak.js.map +0 -1
  247. package/dist/features/converters/html/async/converters/link.d.ts.map +0 -1
  248. package/dist/features/converters/html/async/converters/link.js.map +0 -1
  249. package/dist/features/converters/html/async/converters/list.d.ts.map +0 -1
  250. package/dist/features/converters/html/async/converters/list.js.map +0 -1
  251. package/dist/features/converters/html/async/converters/paragraph.d.ts.map +0 -1
  252. package/dist/features/converters/html/async/converters/paragraph.js.map +0 -1
  253. package/dist/features/converters/html/async/converters/tab.d.ts.map +0 -1
  254. package/dist/features/converters/html/async/converters/tab.js.map +0 -1
  255. package/dist/features/converters/html/async/converters/table.d.ts.map +0 -1
  256. package/dist/features/converters/html/async/converters/table.js.map +0 -1
  257. package/dist/features/converters/html/async/converters/text.d.ts.map +0 -1
  258. package/dist/features/converters/html/async/converters/text.js.map +0 -1
  259. package/dist/features/converters/html/async/converters/upload.d.ts.map +0 -1
  260. package/dist/features/converters/html/async/converters/upload.js.map +0 -1
  261. package/dist/features/converters/html/async/defaultConverters.d.ts.map +0 -1
  262. package/dist/features/converters/html/async/defaultConverters.js.map +0 -1
  263. package/dist/features/converters/html/async/field/index.d.ts.map +0 -1
  264. package/dist/features/converters/html/async/field/index.js.map +0 -1
  265. package/dist/features/converters/html/async/index.d.ts.map +0 -1
  266. package/dist/features/converters/html/async/index.js.map +0 -1
  267. package/dist/features/converters/html/async/types.d.ts.map +0 -1
  268. package/dist/features/converters/html/async/types.js.map +0 -1
  269. package/dist/features/converters/html/shared/findConverterForNode.d.ts.map +0 -1
  270. package/dist/features/converters/html/shared/findConverterForNode.js.map +0 -1
  271. package/dist/features/converters/html/shared/types.d.ts.map +0 -1
  272. package/dist/features/converters/html/shared/types.js.map +0 -1
  273. package/dist/features/converters/html/sync/converters/blockquote.d.ts.map +0 -1
  274. package/dist/features/converters/html/sync/converters/blockquote.js.map +0 -1
  275. package/dist/features/converters/html/sync/converters/heading.d.ts.map +0 -1
  276. package/dist/features/converters/html/sync/converters/heading.js.map +0 -1
  277. package/dist/features/converters/html/sync/converters/horizontalRule.d.ts.map +0 -1
  278. package/dist/features/converters/html/sync/converters/horizontalRule.js.map +0 -1
  279. package/dist/features/converters/html/sync/converters/linebreak.d.ts.map +0 -1
  280. package/dist/features/converters/html/sync/converters/linebreak.js.map +0 -1
  281. package/dist/features/converters/html/sync/converters/link.d.ts.map +0 -1
  282. package/dist/features/converters/html/sync/converters/link.js.map +0 -1
  283. package/dist/features/converters/html/sync/converters/list.d.ts.map +0 -1
  284. package/dist/features/converters/html/sync/converters/list.js.map +0 -1
  285. package/dist/features/converters/html/sync/converters/paragraph.d.ts.map +0 -1
  286. package/dist/features/converters/html/sync/converters/paragraph.js.map +0 -1
  287. package/dist/features/converters/html/sync/converters/tab.d.ts.map +0 -1
  288. package/dist/features/converters/html/sync/converters/tab.js.map +0 -1
  289. package/dist/features/converters/html/sync/converters/table.d.ts.map +0 -1
  290. package/dist/features/converters/html/sync/converters/table.js.map +0 -1
  291. package/dist/features/converters/html/sync/converters/text.d.ts.map +0 -1
  292. package/dist/features/converters/html/sync/converters/text.js.map +0 -1
  293. package/dist/features/converters/html/sync/converters/upload.d.ts.map +0 -1
  294. package/dist/features/converters/html/sync/converters/upload.js.map +0 -1
  295. package/dist/features/converters/html/sync/defaultConverters.d.ts.map +0 -1
  296. package/dist/features/converters/html/sync/defaultConverters.js.map +0 -1
  297. package/dist/features/converters/html/sync/index.d.ts.map +0 -1
  298. package/dist/features/converters/html/sync/index.js.map +0 -1
  299. package/dist/features/converters/html/sync/types.d.ts.map +0 -1
  300. package/dist/features/converters/html/sync/types.js.map +0 -1
  301. package/dist/features/converters/html_deprecated/converter/converters/linebreak.d.ts.map +0 -1
  302. package/dist/features/converters/html_deprecated/converter/converters/linebreak.js.map +0 -1
  303. package/dist/features/converters/html_deprecated/converter/converters/paragraph.d.ts.map +0 -1
  304. package/dist/features/converters/html_deprecated/converter/converters/paragraph.js.map +0 -1
  305. package/dist/features/converters/html_deprecated/converter/converters/tab.d.ts.map +0 -1
  306. package/dist/features/converters/html_deprecated/converter/converters/tab.js.map +0 -1
  307. package/dist/features/converters/html_deprecated/converter/converters/text.d.ts.map +0 -1
  308. package/dist/features/converters/html_deprecated/converter/converters/text.js.map +0 -1
  309. package/dist/features/converters/html_deprecated/converter/defaultConverters.d.ts.map +0 -1
  310. package/dist/features/converters/html_deprecated/converter/defaultConverters.js.map +0 -1
  311. package/dist/features/converters/html_deprecated/converter/index.d.ts.map +0 -1
  312. package/dist/features/converters/html_deprecated/converter/index.js.map +0 -1
  313. package/dist/features/converters/html_deprecated/converter/types.d.ts.map +0 -1
  314. package/dist/features/converters/html_deprecated/converter/types.js.map +0 -1
  315. package/dist/features/converters/html_deprecated/field/index.d.ts.map +0 -1
  316. package/dist/features/converters/html_deprecated/field/index.js.map +0 -1
  317. package/dist/features/converters/html_deprecated/index.d.ts.map +0 -1
  318. package/dist/features/converters/html_deprecated/index.js.map +0 -1
  319. package/dist/features/converters/jsx/Component/index.d.ts.map +0 -1
  320. package/dist/features/converters/jsx/Component/index.js.map +0 -1
  321. package/dist/features/converters/jsx/converter/converters/blockquote.d.ts.map +0 -1
  322. package/dist/features/converters/jsx/converter/converters/blockquote.js.map +0 -1
  323. package/dist/features/converters/jsx/converter/converters/heading.d.ts.map +0 -1
  324. package/dist/features/converters/jsx/converter/converters/heading.js.map +0 -1
  325. package/dist/features/converters/jsx/converter/converters/horizontalRule.d.ts.map +0 -1
  326. package/dist/features/converters/jsx/converter/converters/horizontalRule.js.map +0 -1
  327. package/dist/features/converters/jsx/converter/converters/linebreak.d.ts.map +0 -1
  328. package/dist/features/converters/jsx/converter/converters/linebreak.js.map +0 -1
  329. package/dist/features/converters/jsx/converter/converters/link.d.ts.map +0 -1
  330. package/dist/features/converters/jsx/converter/converters/link.js.map +0 -1
  331. package/dist/features/converters/jsx/converter/converters/list.d.ts.map +0 -1
  332. package/dist/features/converters/jsx/converter/converters/list.js.map +0 -1
  333. package/dist/features/converters/jsx/converter/converters/paragraph.d.ts.map +0 -1
  334. package/dist/features/converters/jsx/converter/converters/paragraph.js.map +0 -1
  335. package/dist/features/converters/jsx/converter/converters/tab.d.ts.map +0 -1
  336. package/dist/features/converters/jsx/converter/converters/tab.js.map +0 -1
  337. package/dist/features/converters/jsx/converter/converters/table.d.ts.map +0 -1
  338. package/dist/features/converters/jsx/converter/converters/table.js.map +0 -1
  339. package/dist/features/converters/jsx/converter/converters/text.d.ts.map +0 -1
  340. package/dist/features/converters/jsx/converter/converters/text.js.map +0 -1
  341. package/dist/features/converters/jsx/converter/converters/upload.d.ts.map +0 -1
  342. package/dist/features/converters/jsx/converter/converters/upload.js.map +0 -1
  343. package/dist/features/converters/jsx/converter/defaultConverters.d.ts.map +0 -1
  344. package/dist/features/converters/jsx/converter/defaultConverters.js.map +0 -1
  345. package/dist/features/converters/jsx/converter/index.d.ts.map +0 -1
  346. package/dist/features/converters/jsx/converter/index.js.map +0 -1
  347. package/dist/features/converters/jsx/converter/types.d.ts.map +0 -1
  348. package/dist/features/converters/jsx/converter/types.js.map +0 -1
  349. /package/dist/exports/client/{RelationshipComponent-JPESGV4Q.js.map → RelationshipComponent-APF3CN47.js.map} +0 -0
  350. /package/dist/exports/client/{chunk-PUXDVIHC.js.map → chunk-Y2GOLUGU.js.map} +0 -0
  351. /package/dist/exports/client/{component-P5K7Z5NW.js.map → component-Y3OSWJM5.js.map} +0 -0
  352. /package/dist/exports/client/{componentInline-IBB73SHH.js.map → componentInline-ZB4EY7EQ.js.map} +0 -0
  353. /package/dist/features/converters/{html → lexicalToHtml}/async/converters/blockquote.d.ts +0 -0
  354. /package/dist/features/converters/{html → lexicalToHtml}/async/converters/blockquote.js +0 -0
  355. /package/dist/features/converters/{html → lexicalToHtml}/async/converters/heading.d.ts +0 -0
  356. /package/dist/features/converters/{html → lexicalToHtml}/async/converters/heading.js +0 -0
  357. /package/dist/features/converters/{html → lexicalToHtml}/async/converters/horizontalRule.d.ts +0 -0
  358. /package/dist/features/converters/{html → lexicalToHtml}/async/converters/horizontalRule.js +0 -0
  359. /package/dist/features/converters/{html → lexicalToHtml}/async/converters/linebreak.d.ts +0 -0
  360. /package/dist/features/converters/{html → lexicalToHtml}/async/converters/linebreak.js +0 -0
  361. /package/dist/features/converters/{html → lexicalToHtml}/async/converters/link.d.ts +0 -0
  362. /package/dist/features/converters/{html → lexicalToHtml}/async/converters/list.d.ts +0 -0
  363. /package/dist/features/converters/{html → lexicalToHtml}/async/converters/list.js +0 -0
  364. /package/dist/features/converters/{html → lexicalToHtml}/async/converters/paragraph.d.ts +0 -0
  365. /package/dist/features/converters/{html → lexicalToHtml}/async/converters/paragraph.js +0 -0
  366. /package/dist/features/converters/{html → lexicalToHtml}/async/converters/tab.d.ts +0 -0
  367. /package/dist/features/converters/{html → lexicalToHtml}/async/converters/tab.js +0 -0
  368. /package/dist/features/converters/{html → lexicalToHtml}/async/converters/table.d.ts +0 -0
  369. /package/dist/features/converters/{html → lexicalToHtml}/async/converters/table.js +0 -0
  370. /package/dist/features/converters/{html → lexicalToHtml}/async/converters/text.d.ts +0 -0
  371. /package/dist/features/converters/{html → lexicalToHtml}/async/converters/text.js +0 -0
  372. /package/dist/features/converters/{html → lexicalToHtml}/async/converters/upload.d.ts +0 -0
  373. /package/dist/features/converters/{html → lexicalToHtml}/async/converters/upload.js +0 -0
  374. /package/dist/features/converters/{html → lexicalToHtml}/async/defaultConverters.d.ts +0 -0
  375. /package/dist/features/converters/{html → lexicalToHtml}/async/defaultConverters.js +0 -0
  376. /package/dist/features/converters/{html → lexicalToHtml}/async/field/index.d.ts +0 -0
  377. /package/dist/features/converters/{html → lexicalToHtml}/async/index.d.ts +0 -0
  378. /package/dist/features/converters/{html → lexicalToHtml}/async/index.js +0 -0
  379. /package/dist/features/converters/{html → lexicalToHtml}/async/types.d.ts +0 -0
  380. /package/dist/features/converters/{html → lexicalToHtml}/async/types.js +0 -0
  381. /package/dist/features/converters/{html → lexicalToHtml}/shared/findConverterForNode.d.ts +0 -0
  382. /package/dist/features/converters/{html → lexicalToHtml}/shared/findConverterForNode.js +0 -0
  383. /package/dist/features/converters/{html → lexicalToHtml}/shared/types.d.ts +0 -0
  384. /package/dist/features/converters/{html → lexicalToHtml}/shared/types.js +0 -0
  385. /package/dist/features/converters/{html → lexicalToHtml}/sync/converters/blockquote.d.ts +0 -0
  386. /package/dist/features/converters/{html → lexicalToHtml}/sync/converters/blockquote.js +0 -0
  387. /package/dist/features/converters/{html → lexicalToHtml}/sync/converters/heading.d.ts +0 -0
  388. /package/dist/features/converters/{html → lexicalToHtml}/sync/converters/heading.js +0 -0
  389. /package/dist/features/converters/{html → lexicalToHtml}/sync/converters/horizontalRule.d.ts +0 -0
  390. /package/dist/features/converters/{html → lexicalToHtml}/sync/converters/horizontalRule.js +0 -0
  391. /package/dist/features/converters/{html → lexicalToHtml}/sync/converters/linebreak.d.ts +0 -0
  392. /package/dist/features/converters/{html → lexicalToHtml}/sync/converters/linebreak.js +0 -0
  393. /package/dist/features/converters/{html → lexicalToHtml}/sync/converters/link.d.ts +0 -0
  394. /package/dist/features/converters/{html → lexicalToHtml}/sync/converters/list.d.ts +0 -0
  395. /package/dist/features/converters/{html → lexicalToHtml}/sync/converters/list.js +0 -0
  396. /package/dist/features/converters/{html → lexicalToHtml}/sync/converters/paragraph.d.ts +0 -0
  397. /package/dist/features/converters/{html → lexicalToHtml}/sync/converters/paragraph.js +0 -0
  398. /package/dist/features/converters/{html → lexicalToHtml}/sync/converters/tab.d.ts +0 -0
  399. /package/dist/features/converters/{html → lexicalToHtml}/sync/converters/tab.js +0 -0
  400. /package/dist/features/converters/{html → lexicalToHtml}/sync/converters/table.d.ts +0 -0
  401. /package/dist/features/converters/{html → lexicalToHtml}/sync/converters/table.js +0 -0
  402. /package/dist/features/converters/{html → lexicalToHtml}/sync/converters/text.d.ts +0 -0
  403. /package/dist/features/converters/{html → lexicalToHtml}/sync/converters/text.js +0 -0
  404. /package/dist/features/converters/{html → lexicalToHtml}/sync/converters/upload.d.ts +0 -0
  405. /package/dist/features/converters/{html → lexicalToHtml}/sync/converters/upload.js +0 -0
  406. /package/dist/features/converters/{html → lexicalToHtml}/sync/defaultConverters.d.ts +0 -0
  407. /package/dist/features/converters/{html → lexicalToHtml}/sync/defaultConverters.js +0 -0
  408. /package/dist/features/converters/{html → lexicalToHtml}/sync/index.d.ts +0 -0
  409. /package/dist/features/converters/{html → lexicalToHtml}/sync/index.js +0 -0
  410. /package/dist/features/converters/{html → lexicalToHtml}/sync/types.d.ts +0 -0
  411. /package/dist/features/converters/{html → lexicalToHtml}/sync/types.js +0 -0
  412. /package/dist/features/converters/{html_deprecated → lexicalToHtml_deprecated}/converter/converters/linebreak.d.ts +0 -0
  413. /package/dist/features/converters/{html_deprecated → lexicalToHtml_deprecated}/converter/converters/linebreak.js +0 -0
  414. /package/dist/features/converters/{html_deprecated → lexicalToHtml_deprecated}/converter/converters/paragraph.d.ts +0 -0
  415. /package/dist/features/converters/{html_deprecated → lexicalToHtml_deprecated}/converter/converters/paragraph.js +0 -0
  416. /package/dist/features/converters/{html_deprecated → lexicalToHtml_deprecated}/converter/converters/tab.d.ts +0 -0
  417. /package/dist/features/converters/{html_deprecated → lexicalToHtml_deprecated}/converter/converters/tab.js +0 -0
  418. /package/dist/features/converters/{html_deprecated → lexicalToHtml_deprecated}/converter/converters/text.d.ts +0 -0
  419. /package/dist/features/converters/{html_deprecated → lexicalToHtml_deprecated}/converter/converters/text.js +0 -0
  420. /package/dist/features/converters/{html_deprecated → lexicalToHtml_deprecated}/converter/defaultConverters.d.ts +0 -0
  421. /package/dist/features/converters/{html_deprecated → lexicalToHtml_deprecated}/converter/defaultConverters.js +0 -0
  422. /package/dist/features/converters/{html_deprecated → lexicalToHtml_deprecated}/converter/index.d.ts +0 -0
  423. /package/dist/features/converters/{html_deprecated → lexicalToHtml_deprecated}/converter/index.js +0 -0
  424. /package/dist/features/converters/{html_deprecated → lexicalToHtml_deprecated}/converter/types.d.ts +0 -0
  425. /package/dist/features/converters/{html_deprecated → lexicalToHtml_deprecated}/converter/types.js +0 -0
  426. /package/dist/features/converters/{html_deprecated → lexicalToHtml_deprecated}/field/index.d.ts +0 -0
  427. /package/dist/features/converters/{html_deprecated → lexicalToHtml_deprecated}/field/index.js +0 -0
  428. /package/dist/features/converters/{html_deprecated → lexicalToHtml_deprecated}/index.d.ts +0 -0
  429. /package/dist/features/converters/{html_deprecated → lexicalToHtml_deprecated}/index.js +0 -0
  430. /package/dist/features/converters/{jsx → lexicalToJSX}/Component/index.d.ts +0 -0
  431. /package/dist/features/converters/{jsx → lexicalToJSX}/Component/index.js +0 -0
  432. /package/dist/features/converters/{jsx → lexicalToJSX}/converter/converters/blockquote.d.ts +0 -0
  433. /package/dist/features/converters/{jsx → lexicalToJSX}/converter/converters/blockquote.js +0 -0
  434. /package/dist/features/converters/{jsx → lexicalToJSX}/converter/converters/heading.d.ts +0 -0
  435. /package/dist/features/converters/{jsx → lexicalToJSX}/converter/converters/heading.js +0 -0
  436. /package/dist/features/converters/{jsx → lexicalToJSX}/converter/converters/horizontalRule.d.ts +0 -0
  437. /package/dist/features/converters/{jsx → lexicalToJSX}/converter/converters/horizontalRule.js +0 -0
  438. /package/dist/features/converters/{jsx → lexicalToJSX}/converter/converters/linebreak.d.ts +0 -0
  439. /package/dist/features/converters/{jsx → lexicalToJSX}/converter/converters/linebreak.js +0 -0
  440. /package/dist/features/converters/{jsx → lexicalToJSX}/converter/converters/link.d.ts +0 -0
  441. /package/dist/features/converters/{jsx → lexicalToJSX}/converter/converters/link.js +0 -0
  442. /package/dist/features/converters/{jsx → lexicalToJSX}/converter/converters/list.d.ts +0 -0
  443. /package/dist/features/converters/{jsx → lexicalToJSX}/converter/converters/list.js +0 -0
  444. /package/dist/features/converters/{jsx → lexicalToJSX}/converter/converters/paragraph.d.ts +0 -0
  445. /package/dist/features/converters/{jsx → lexicalToJSX}/converter/converters/paragraph.js +0 -0
  446. /package/dist/features/converters/{jsx → lexicalToJSX}/converter/converters/tab.d.ts +0 -0
  447. /package/dist/features/converters/{jsx → lexicalToJSX}/converter/converters/tab.js +0 -0
  448. /package/dist/features/converters/{jsx → lexicalToJSX}/converter/converters/table.d.ts +0 -0
  449. /package/dist/features/converters/{jsx → lexicalToJSX}/converter/converters/table.js +0 -0
  450. /package/dist/features/converters/{jsx → lexicalToJSX}/converter/converters/text.d.ts +0 -0
  451. /package/dist/features/converters/{jsx → lexicalToJSX}/converter/converters/text.js +0 -0
  452. /package/dist/features/converters/{jsx → lexicalToJSX}/converter/converters/upload.d.ts +0 -0
  453. /package/dist/features/converters/{jsx → lexicalToJSX}/converter/converters/upload.js +0 -0
  454. /package/dist/features/converters/{jsx → lexicalToJSX}/converter/defaultConverters.d.ts +0 -0
  455. /package/dist/features/converters/{jsx → lexicalToJSX}/converter/defaultConverters.js +0 -0
  456. /package/dist/features/converters/{jsx → lexicalToJSX}/converter/index.d.ts +0 -0
  457. /package/dist/features/converters/{jsx → lexicalToJSX}/converter/index.js +0 -0
  458. /package/dist/features/converters/{jsx → lexicalToJSX}/converter/types.d.ts +0 -0
  459. /package/dist/features/converters/{jsx → lexicalToJSX}/converter/types.js +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["HeadingNode","createServerFeature","convertLexicalNodesToHTML","createNode","MarkdownTransformer","i18n","HeadingFeature","feature","props","enabledHeadingSizes","ClientFeature","clientFeatureProps","markdownTransformers","nodes","converters","html","converter","currentDepth","depth","draft","node","overrideAccess","parent","req","showHiddenFields","childrenText","lexicalNodes","children","style","format","indent","filter","Boolean","join","tag","nodeTypes","getType","sanitizedServerFeatureProps","key"],"sources":["../../../../src/features/heading/server/index.ts"],"sourcesContent":["import type {\n SerializedHeadingNode as _SerializedHeadingNode,\n HeadingTagType,\n} from '@lexical/rich-text'\nimport type { Spread } from 'lexical'\n\nimport { HeadingNode } from '@lexical/rich-text'\n\nimport { createServerFeature } from '../../../utilities/createServerFeature.js'\nimport { convertLexicalNodesToHTML } from '../../converters/html_deprecated/converter/index.js'\nimport { createNode } from '../../typeUtilities.js'\nimport { MarkdownTransformer } from '../markdownTransformer.js'\nimport { i18n } from './i18n.js'\n\nexport type SerializedHeadingNode = Spread<\n {\n type: 'heading'\n },\n _SerializedHeadingNode\n>\n\nexport type HeadingFeatureProps = {\n enabledHeadingSizes?: HeadingTagType[]\n}\n\nexport const HeadingFeature = createServerFeature<\n HeadingFeatureProps,\n HeadingFeatureProps,\n HeadingFeatureProps\n>({\n feature: ({ props }) => {\n if (!props) {\n props = {}\n }\n\n const { enabledHeadingSizes = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] } = props\n\n return {\n ClientFeature: '@payloadcms/richtext-lexical/client#HeadingFeatureClient',\n clientFeatureProps: props,\n i18n,\n markdownTransformers: [MarkdownTransformer(enabledHeadingSizes)],\n nodes: [\n createNode({\n converters: {\n html: {\n converter: async ({\n converters,\n currentDepth,\n depth,\n draft,\n node,\n overrideAccess,\n parent,\n req,\n showHiddenFields,\n }) => {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n currentDepth,\n depth,\n draft,\n lexicalNodes: node.children,\n overrideAccess,\n parent: {\n ...node,\n parent,\n },\n req,\n showHiddenFields,\n })\n const style = [\n node.format ? `text-align: ${node.format};` : '',\n node.indent > 0 ? `padding-inline-start: ${node.indent * 40}px;` : '',\n ]\n .filter(Boolean)\n .join(' ')\n return `<${node?.tag}${style ? ` style='${style}'` : ''}>${childrenText}</${node?.tag}>`\n },\n nodeTypes: [HeadingNode.getType()],\n },\n },\n node: HeadingNode,\n }),\n ],\n sanitizedServerFeatureProps: props,\n }\n },\n key: 'heading',\n})\n"],"mappings":"AAMA,SAASA,WAAW,QAAQ;AAE5B,SAASC,mBAAmB,QAAQ;AACpC,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,UAAU,QAAQ;AAC3B,SAASC,mBAAmB,QAAQ;AACpC,SAASC,IAAI,QAAQ;AAarB,OAAO,MAAMC,cAAA,GAAiBL,mBAAA,CAI5B;EACAM,OAAA,EAASA,CAAC;IAAEC;EAAK,CAAE;IACjB,IAAI,CAACA,KAAA,EAAO;MACVA,KAAA,GAAQ,CAAC;IACX;I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["HeadingNode","createServerFeature","convertLexicalNodesToHTML","createNode","MarkdownTransformer","i18n","HeadingFeature","feature","props","enabledHeadingSizes","ClientFeature","clientFeatureProps","markdownTransformers","nodes","converters","html","converter","currentDepth","depth","draft","node","overrideAccess","parent","req","showHiddenFields","childrenText","lexicalNodes","children","style","format","indent","filter","Boolean","join","tag","nodeTypes","getType","sanitizedServerFeatureProps","key"],"sources":["../../../../src/features/heading/server/index.ts"],"sourcesContent":["import type {\n SerializedHeadingNode as _SerializedHeadingNode,\n HeadingTagType,\n} from '@lexical/rich-text'\nimport type { Spread } from 'lexical'\n\nimport { HeadingNode } from '@lexical/rich-text'\n\nimport { createServerFeature } from '../../../utilities/createServerFeature.js'\nimport { convertLexicalNodesToHTML } from '../../converters/lexicalToHtml_deprecated/converter/index.js'\nimport { createNode } from '../../typeUtilities.js'\nimport { MarkdownTransformer } from '../markdownTransformer.js'\nimport { i18n } from './i18n.js'\n\nexport type SerializedHeadingNode = Spread<\n {\n type: 'heading'\n },\n _SerializedHeadingNode\n>\n\nexport type HeadingFeatureProps = {\n enabledHeadingSizes?: HeadingTagType[]\n}\n\nexport const HeadingFeature = createServerFeature<\n HeadingFeatureProps,\n HeadingFeatureProps,\n HeadingFeatureProps\n>({\n feature: ({ props }) => {\n if (!props) {\n props = {}\n }\n\n const { enabledHeadingSizes = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6'] } = props\n\n return {\n ClientFeature: '@payloadcms/richtext-lexical/client#HeadingFeatureClient',\n clientFeatureProps: props,\n i18n,\n markdownTransformers: [MarkdownTransformer(enabledHeadingSizes)],\n nodes: [\n createNode({\n converters: {\n html: {\n converter: async ({\n converters,\n currentDepth,\n depth,\n draft,\n node,\n overrideAccess,\n parent,\n req,\n showHiddenFields,\n }) => {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n currentDepth,\n depth,\n draft,\n lexicalNodes: node.children,\n overrideAccess,\n parent: {\n ...node,\n parent,\n },\n req,\n showHiddenFields,\n })\n const style = [\n node.format ? `text-align: ${node.format};` : '',\n node.indent > 0 ? `padding-inline-start: ${node.indent * 40}px;` : '',\n ]\n .filter(Boolean)\n .join(' ')\n return `<${node?.tag}${style ? ` style='${style}'` : ''}>${childrenText}</${node?.tag}>`\n },\n nodeTypes: [HeadingNode.getType()],\n },\n },\n node: HeadingNode,\n }),\n ],\n sanitizedServerFeatureProps: props,\n }\n },\n key: 'heading',\n})\n"],"mappings":"AAMA,SAASA,WAAW,QAAQ;AAE5B,SAASC,mBAAmB,QAAQ;AACpC,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,UAAU,QAAQ;AAC3B,SAASC,mBAAmB,QAAQ;AACpC,SAASC,IAAI,QAAQ;AAarB,OAAO,MAAMC,cAAA,GAAiBL,mBAAA,CAI5B;EACAM,OAAA,EAASA,CAAC;IAAEC;EAAK,CAAE;IACjB,IAAI,CAACA,KAAA,EAAO;MACVA,KAAA,GAAQ,CAAC;IACX;IAEA,MAAM;MAAEC,mBAAA,GAAsB,CAAC,MAAM,MAAM,MAAM,MAAM,MAAM;IAAK,CAAE,GAAGD,KAAA;IAEvE,OAAO;MACLE,aAAA,EAAe;MACfC,kBAAA,EAAoBH,KAAA;MACpBH,IAAA;MACAO,oBAAA,EAAsB,CAACR,mBAAA,CAAoBK,mBAAA,EAAqB;MAChEI,KAAA,EAAO,CACLV,UAAA,CAAW;QACTW,UAAA,EAAY;UACVC,IAAA,EAAM;YACJC,SAAA,EAAW,MAAAA,CAAO;cAChBF,UAAU;cACVG,YAAY;cACZC,KAAK;cACLC,KAAK;cACLC,IAAI;cACJC,cAAc;cACdC,MAAM;cACNC,GAAG;cACHC;YAAgB,CACjB;cACC,MAAMC,YAAA,GAAe,MAAMvB,yBAAA,CAA0B;gBACnDY,UAAA;gBACAG,YAAA;gBACAC,KAAA;gBACAC,KAAA;gBACAO,YAAA,EAAcN,IAAA,CAAKO,QAAQ;gBAC3BN,cAAA;gBACAC,MAAA,EAAQ;kBACN,GAAGF,IAAI;kBACPE;gBACF;gBACAC,GAAA;gBACAC;cACF;cACA,MAAMI,KAAA,GAAQ,CACZR,IAAA,CAAKS,MAAM,GAAG,eAAeT,IAAA,CAAKS,MAAM,GAAG,GAAG,IAC9CT,IAAA,CAAKU,MAAM,GAAG,IAAI,yBAAyBV,IAAA,CAAKU,MAAM,GAAG,OAAO,GAAG,GACpE,CACEC,MAAM,CAACC,OAAA,EACPC,IAAI,CAAC;cACR,OAAO,IAAIb,IAAA,EAAMc,GAAA,GAAMN,KAAA,GAAQ,WAAWA,KAAA,GAAQ,GAAG,MAAMH,YAAA,KAAiBL,IAAA,EAAMc,GAAA,GAAM;YAC1F;YACAC,SAAA,EAAW,CAACnC,WAAA,CAAYoC,OAAO;UACjC;QACF;QACAhB,IAAA,EAAMpB;MACR,GACD;MACDqC,2BAAA,EAA6B7B;IAC/B;EACF;EACA8B,GAAA,EAAK;AACP","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"IndentPlugin.d.ts","sourceRoot":"","sources":["../../../../src/features/indent/client/IndentPlugin.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAE5D,eAAO,MAAM,YAAY,EAAE,eAAe,CAAC,kBAAkB,CAyB5D,CAAA"}
1
+ {"version":3,"file":"IndentPlugin.d.ts","sourceRoot":"","sources":["../../../../src/features/indent/client/IndentPlugin.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAA;AAE5D,eAAO,MAAM,YAAY,EAAE,eAAe,CAAC,kBAAkB,CAiD5D,CAAA"}
@@ -2,26 +2,46 @@ import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
3
3
  import { TabIndentationPlugin } from '@lexical/react/LexicalTabIndentationPlugin';
4
4
  import { $findMatchingParent, mergeRegister } from '@lexical/utils';
5
- import { $getSelection, $isElementNode, $isRangeSelection, COMMAND_PRIORITY_LOW, INDENT_CONTENT_COMMAND } from 'lexical';
5
+ import { $getSelection, $isElementNode, $isRangeSelection, COMMAND_PRIORITY_LOW, INDENT_CONTENT_COMMAND, KEY_TAB_COMMAND, OUTDENT_CONTENT_COMMAND, TabNode } from 'lexical';
6
6
  import { useEffect } from 'react';
7
- export const IndentPlugin = props => {
7
+ export const IndentPlugin = ({
8
+ clientProps
9
+ }) => {
8
10
  const [editor] = useLexicalComposerContext();
9
11
  const {
10
- disabledNodes
11
- } = props.clientProps;
12
+ disabledNodes,
13
+ disableTabNode
14
+ } = clientProps;
12
15
  useEffect(() => {
13
16
  if (!editor || !disabledNodes?.length) {
14
17
  return;
15
18
  }
16
- return mergeRegister(editor.registerCommand(INDENT_CONTENT_COMMAND, () => {
19
+ return editor.registerCommand(INDENT_CONTENT_COMMAND, () => {
17
20
  return $handleIndentAndOutdent(block => {
18
21
  if (!disabledNodes.includes(block.getType())) {
19
22
  const indent = block.getIndent();
20
23
  block.setIndent(indent + 1);
21
24
  }
22
25
  });
23
- }, COMMAND_PRIORITY_LOW));
26
+ }, COMMAND_PRIORITY_LOW);
24
27
  }, [editor, disabledNodes]);
28
+ useEffect(() => {
29
+ if (!editor || !disableTabNode) {
30
+ return;
31
+ }
32
+ return mergeRegister(
33
+ // This is so that when you press Tab in the middle of a paragraph,
34
+ // it indents the paragraph, instead of inserting a TabNode.
35
+ editor.registerCommand(KEY_TAB_COMMAND, event => {
36
+ event.preventDefault();
37
+ return editor.dispatchCommand(event.shiftKey ? OUTDENT_CONTENT_COMMAND : INDENT_CONTENT_COMMAND, undefined);
38
+ }, COMMAND_PRIORITY_LOW),
39
+ // Tab isn't the only way to insert a TabNode. We have to make sure
40
+ // it doesn't happen, for example, when pasting from the clipboard.
41
+ editor.registerNodeTransform(TabNode, node => {
42
+ node.remove();
43
+ }));
44
+ }, [editor, disableTabNode]);
25
45
  return /*#__PURE__*/_jsx(TabIndentationPlugin, {});
26
46
  };
27
47
  function $handleIndentAndOutdent(indentOrOutdent) {
@@ -1 +1 @@
1
- {"version":3,"file":"IndentPlugin.js","names":["useLexicalComposerContext","TabIndentationPlugin","$findMatchingParent","mergeRegister","$getSelection","$isElementNode","$isRangeSelection","COMMAND_PRIORITY_LOW","INDENT_CONTENT_COMMAND","useEffect","IndentPlugin","props","editor","disabledNodes","clientProps","length","registerCommand","$handleIndentAndOutdent","block","includes","getType","indent","getIndent","setIndent","_jsx","indentOrOutdent","selection","alreadyHandled","Set","nodes","getNodes","i","node","key","getKey","has","parentBlock","parentNode","isInline","parentKey","canIndent","add","size"],"sources":["../../../../src/features/indent/client/IndentPlugin.tsx"],"sourcesContent":["import type { ElementNode } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { TabIndentationPlugin } from '@lexical/react/LexicalTabIndentationPlugin'\nimport { $findMatchingParent, mergeRegister } from '@lexical/utils'\nimport {\n $getSelection,\n $isElementNode,\n $isRangeSelection,\n COMMAND_PRIORITY_LOW,\n INDENT_CONTENT_COMMAND,\n} from 'lexical'\nimport { useEffect } from 'react'\n\nimport type { PluginComponent } from '../../typesClient.js'\nimport type { IndentFeatureProps } from '../server/index.js'\n\nexport const IndentPlugin: PluginComponent<IndentFeatureProps> = (props) => {\n const [editor] = useLexicalComposerContext()\n const { disabledNodes } = props.clientProps\n\n useEffect(() => {\n if (!editor || !disabledNodes?.length) {\n return\n }\n return mergeRegister(\n editor.registerCommand(\n INDENT_CONTENT_COMMAND,\n () => {\n return $handleIndentAndOutdent((block) => {\n if (!disabledNodes.includes(block.getType())) {\n const indent = block.getIndent()\n block.setIndent(indent + 1)\n }\n })\n },\n COMMAND_PRIORITY_LOW,\n ),\n )\n }, [editor, disabledNodes])\n\n return <TabIndentationPlugin />\n}\n\nfunction $handleIndentAndOutdent(indentOrOutdent: (block: ElementNode) => void): boolean {\n const selection = $getSelection()\n if (!$isRangeSelection(selection)) {\n return false\n }\n const alreadyHandled = new Set()\n const nodes = selection.getNodes()\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i]!\n const key = node.getKey()\n if (alreadyHandled.has(key)) {\n continue\n }\n const parentBlock = $findMatchingParent(\n node,\n (parentNode): parentNode is ElementNode =>\n $isElementNode(parentNode) && !parentNode.isInline(),\n )\n if (parentBlock === null) {\n continue\n }\n const parentKey = parentBlock.getKey()\n if (parentBlock.canIndent() && !alreadyHandled.has(parentKey)) {\n alreadyHandled.add(parentKey)\n indentOrOutdent(parentBlock)\n }\n }\n return alreadyHandled.size > 0\n}\n"],"mappings":";AAEA,SAASA,yBAAyB,QAAQ;AAC1C,SAASC,oBAAoB,QAAQ;AACrC,SAASC,mBAAmB,EAAEC,aAAa,QAAQ;AACnD,SACEC,aAAa,EACbC,cAAc,EACdC,iBAAiB,EACjBC,oBAAoB,EACpBC,sBAAsB,QACjB;AACP,SAASC,SAAS,QAAQ;AAK1B,OAAO,MAAMC,YAAA,GAAqDC,KAAA;EAChE,MAAM,CAACC,MAAA,CAAO,GAAGZ,yBAAA;EACjB,MAAM;IAAEa;EAAa,CAAE,GAAGF,KAAA,CAAMG,WAAW;EAE3CL,SAAA,CAAU;IACR,IAAI,CAACG,MAAA,IAAU,CAACC,aAAA,EAAeE,MAAA,EAAQ;MACrC;IACF;IACA,OAAOZ,aAAA,CACLS,MAAA,CAAOI,eAAe,CACpBR,sBAAA,EACA;MACE,OAAOS,uBAAA,CAAyBC,KAAA;QAC9B,IAAI,CAACL,aAAA,CAAcM,QAAQ,CAACD,KAAA,CAAME,OAAO,KAAK;UAC5C,MAAMC,MAAA,GAASH,KAAA,CAAMI,SAAS;UAC9BJ,KAAA,CAAMK,SAAS,CAACF,MAAA,GAAS;QAC3B;MACF;IACF,GACAd,oBAAA;EAGN,GAAG,CAACK,MAAA,EAAQC,aAAA,CAAc;EAE1B,oBAAOW,IAAA,CAACvB,oBAAA;AACV;AAEA,SAASgB,wBAAwBQ,eAA6C;EAC5E,MAAMC,SAAA,GAAYtB,aAAA;EAClB,IAAI,CAACE,iBAAA,CAAkBoB,SAAA,GAAY;IACjC,OAAO;EACT;EACA,MAAMC,cAAA,GAAiB,IAAIC,GAAA;EAC3B,MAAMC,KAAA,GAAQH,SAAA,CAAUI,QAAQ;EAChC,KAAK,IAAIC,CAAA,GAAI,GAAGA,CAAA,GAAIF,KAAA,CAAMd,MAAM,EAAEgB,CAAA,IAAK;IACrC,MAAMC,IAAA,GAAOH,KAAK,CAACE,CAAA,CAAE;IACrB,MAAME,GAAA,GAAMD,IAAA,CAAKE,MAAM;IACvB,IAAIP,cAAA,CAAeQ,GAAG,CAACF,GAAA,GAAM;MAC3B;IACF;IACA,MAAMG,WAAA,GAAclC,mBAAA,CAClB8B,IAAA,EACCK,UAAA,IACChC,cAAA,CAAegC,UAAA,KAAe,CAACA,UAAA,CAAWC,QAAQ;IAEtD,IAAIF,WAAA,KAAgB,MAAM;MACxB;IACF;IACA,MAAMG,SAAA,GAAYH,WAAA,CAAYF,MAAM;IACpC,IAAIE,WAAA,CAAYI,SAAS,MAAM,CAACb,cAAA,CAAeQ,GAAG,CAACI,SAAA,GAAY;MAC7DZ,cAAA,CAAec,GAAG,CAACF,SAAA;MACnBd,eAAA,CAAgBW,WAAA;IAClB;EACF;EACA,OAAOT,cAAA,CAAee,IAAI,GAAG;AAC/B","ignoreList":[]}
1
+ {"version":3,"file":"IndentPlugin.js","names":["useLexicalComposerContext","TabIndentationPlugin","$findMatchingParent","mergeRegister","$getSelection","$isElementNode","$isRangeSelection","COMMAND_PRIORITY_LOW","INDENT_CONTENT_COMMAND","KEY_TAB_COMMAND","OUTDENT_CONTENT_COMMAND","TabNode","useEffect","IndentPlugin","clientProps","editor","disabledNodes","disableTabNode","length","registerCommand","$handleIndentAndOutdent","block","includes","getType","indent","getIndent","setIndent","event","preventDefault","dispatchCommand","shiftKey","undefined","registerNodeTransform","node","remove","_jsx","indentOrOutdent","selection","alreadyHandled","Set","nodes","getNodes","i","key","getKey","has","parentBlock","parentNode","isInline","parentKey","canIndent","add","size"],"sources":["../../../../src/features/indent/client/IndentPlugin.tsx"],"sourcesContent":["import type { ElementNode } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { TabIndentationPlugin } from '@lexical/react/LexicalTabIndentationPlugin'\nimport { $findMatchingParent, mergeRegister } from '@lexical/utils'\nimport {\n $getSelection,\n $isElementNode,\n $isRangeSelection,\n COMMAND_PRIORITY_LOW,\n INDENT_CONTENT_COMMAND,\n KEY_TAB_COMMAND,\n OUTDENT_CONTENT_COMMAND,\n TabNode,\n} from 'lexical'\nimport { useEffect } from 'react'\n\nimport type { PluginComponent } from '../../typesClient.js'\nimport type { IndentFeatureProps } from '../server/index.js'\n\nexport const IndentPlugin: PluginComponent<IndentFeatureProps> = ({ clientProps }) => {\n const [editor] = useLexicalComposerContext()\n const { disabledNodes, disableTabNode } = clientProps\n\n useEffect(() => {\n if (!editor || !disabledNodes?.length) {\n return\n }\n return editor.registerCommand(\n INDENT_CONTENT_COMMAND,\n () => {\n return $handleIndentAndOutdent((block) => {\n if (!disabledNodes.includes(block.getType())) {\n const indent = block.getIndent()\n block.setIndent(indent + 1)\n }\n })\n },\n COMMAND_PRIORITY_LOW,\n )\n }, [editor, disabledNodes])\n\n useEffect(() => {\n if (!editor || !disableTabNode) {\n return\n }\n return mergeRegister(\n // This is so that when you press Tab in the middle of a paragraph,\n // it indents the paragraph, instead of inserting a TabNode.\n editor.registerCommand<KeyboardEvent>(\n KEY_TAB_COMMAND,\n (event) => {\n event.preventDefault()\n return editor.dispatchCommand(\n event.shiftKey ? OUTDENT_CONTENT_COMMAND : INDENT_CONTENT_COMMAND,\n undefined,\n )\n },\n COMMAND_PRIORITY_LOW,\n ),\n // Tab isn't the only way to insert a TabNode. We have to make sure\n // it doesn't happen, for example, when pasting from the clipboard.\n editor.registerNodeTransform(TabNode, (node) => {\n node.remove()\n }),\n )\n }, [editor, disableTabNode])\n\n return <TabIndentationPlugin />\n}\n\nfunction $handleIndentAndOutdent(indentOrOutdent: (block: ElementNode) => void): boolean {\n const selection = $getSelection()\n if (!$isRangeSelection(selection)) {\n return false\n }\n const alreadyHandled = new Set()\n const nodes = selection.getNodes()\n for (let i = 0; i < nodes.length; i++) {\n const node = nodes[i]!\n const key = node.getKey()\n if (alreadyHandled.has(key)) {\n continue\n }\n const parentBlock = $findMatchingParent(\n node,\n (parentNode): parentNode is ElementNode =>\n $isElementNode(parentNode) && !parentNode.isInline(),\n )\n if (parentBlock === null) {\n continue\n }\n const parentKey = parentBlock.getKey()\n if (parentBlock.canIndent() && !alreadyHandled.has(parentKey)) {\n alreadyHandled.add(parentKey)\n indentOrOutdent(parentBlock)\n }\n }\n return alreadyHandled.size > 0\n}\n"],"mappings":";AAEA,SAASA,yBAAyB,QAAQ;AAC1C,SAASC,oBAAoB,QAAQ;AACrC,SAASC,mBAAmB,EAAEC,aAAa,QAAQ;AACnD,SACEC,aAAa,EACbC,cAAc,EACdC,iBAAiB,EACjBC,oBAAoB,EACpBC,sBAAsB,EACtBC,eAAe,EACfC,uBAAuB,EACvBC,OAAO,QACF;AACP,SAASC,SAAS,QAAQ;AAK1B,OAAO,MAAMC,YAAA,GAAoDA,CAAC;EAAEC;AAAW,CAAE;EAC/E,MAAM,CAACC,MAAA,CAAO,GAAGf,yBAAA;EACjB,MAAM;IAAEgB,aAAa;IAAEC;EAAc,CAAE,GAAGH,WAAA;EAE1CF,SAAA,CAAU;IACR,IAAI,CAACG,MAAA,IAAU,CAACC,aAAA,EAAeE,MAAA,EAAQ;MACrC;IACF;IACA,OAAOH,MAAA,CAAOI,eAAe,CAC3BX,sBAAA,EACA;MACE,OAAOY,uBAAA,CAAyBC,KAAA;QAC9B,IAAI,CAACL,aAAA,CAAcM,QAAQ,CAACD,KAAA,CAAME,OAAO,KAAK;UAC5C,MAAMC,MA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AAWC,QAAQ;IAEtD,IAAIF,WAAA,KAAgB,MAAM;MACxB;IACF;IACA,MAAMG,SAAA,GAAYH,WAAA,CAAYF,MAAM;IACpC,IAAIE,WAAA,CAAYI,SAAS,MAAM,CAACZ,cAAA,CAAeO,GAAG,CAACI,SAAA,GAAY;MAC7DX,cAAA,CAAea,GAAG,CAACF,SAAA;MACnBb,eAAA,CAAgBU,WAAA;IAClB;EACF;EACA,OAAOR,cAAA,CAAec,IAAI,GAAG;AAC/B","ignoreList":[]}
@@ -4,6 +4,13 @@ export type IndentFeatureProps = {
4
4
  * These can be: "paragraph", "heading", "listitem", "quote" or other indentable nodes if they exist.
5
5
  */
6
6
  disabledNodes?: string[];
7
+ /**
8
+ * If true, pressing Tab in the middle of a block such as a paragraph or heading will not insert a tabNode.
9
+ * Instead, Tab will only be used for block-level indentation.
10
+ *
11
+ * @default false
12
+ */
13
+ disableTabNode?: boolean;
7
14
  };
8
15
  export declare const IndentFeature: import("../../typesServer.js").FeatureProviderProviderServer<IndentFeatureProps, IndentFeatureProps, IndentFeatureProps>;
9
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/indent/server/index.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;CACzB,CAAA;AAED,eAAO,MAAM,aAAa,0HAaxB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/indent/server/index.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,kBAAkB,GAAG;IAC/B;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,EAAE,CAAA;IACxB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB,CAAA;AAED,eAAO,MAAM,aAAa,0HAaxB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["createServerFeature","i18n","IndentFeature","feature","props","ClientFeature","clientFeatureProps","key"],"sources":["../../../../src/features/indent/server/index.ts"],"sourcesContent":["import { createServerFeature } from '../../../utilities/createServerFeature.js'\nimport { i18n } from './i18n.js'\n\nexport type IndentFeatureProps = {\n /**\n * The nodes that should not be indented. \"type\" property of the nodes you don't want to be indented.\n * These can be: \"paragraph\", \"heading\", \"listitem\", \"quote\" or other indentable nodes if they exist.\n */\n disabledNodes?: string[]\n}\n\nexport const IndentFeature = createServerFeature<\n IndentFeatureProps,\n IndentFeatureProps,\n IndentFeatureProps\n>({\n feature: ({ props }) => {\n return {\n ClientFeature: '@payloadcms/richtext-lexical/client#IndentFeatureClient',\n clientFeatureProps: props,\n i18n,\n }\n },\n key: 'indent',\n})\n"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ;AACpC,SAASC,IAAI,QAAQ;AAUrB,OAAO,MAAMC,aAAA,GAAgBF,mBAAA,CAI3B;EACAG,OAAA,EAASA,CAAC;IAAEC;EAAK,CAAE;IACjB,OAAO;MACLC,aAAA,EAAe;MACfC,kBAAA,EAAoBF,KAAA;MACpBH;IACF;EACF;EACAM,GAAA,EAAK;AACP","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["createServerFeature","i18n","IndentFeature","feature","props","ClientFeature","clientFeatureProps","key"],"sources":["../../../../src/features/indent/server/index.ts"],"sourcesContent":["import { createServerFeature } from '../../../utilities/createServerFeature.js'\nimport { i18n } from './i18n.js'\n\nexport type IndentFeatureProps = {\n /**\n * The nodes that should not be indented. \"type\" property of the nodes you don't want to be indented.\n * These can be: \"paragraph\", \"heading\", \"listitem\", \"quote\" or other indentable nodes if they exist.\n */\n disabledNodes?: string[]\n /**\n * If true, pressing Tab in the middle of a block such as a paragraph or heading will not insert a tabNode.\n * Instead, Tab will only be used for block-level indentation.\n *\n * @default false\n */\n disableTabNode?: boolean\n}\n\nexport const IndentFeature = createServerFeature<\n IndentFeatureProps,\n IndentFeatureProps,\n IndentFeatureProps\n>({\n feature: ({ props }) => {\n return {\n ClientFeature: '@payloadcms/richtext-lexical/client#IndentFeatureClient',\n clientFeatureProps: props,\n i18n,\n }\n },\n key: 'indent',\n})\n"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ;AACpC,SAASC,IAAI,QAAQ;AAiBrB,OAAO,MAAMC,aAAA,GAAgBF,mBAAA,CAI3B;EACAG,OAAA,EAASA,CAAC;IAAEC;EAAK,CAAE;IACjB,OAAO;MACLC,aAAA,EAAe;MACfC,kBAAA,EAAoBF,KAAA;MACpBH;IACF;EACF;EACAM,GAAA,EAAK;AACP","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  import escapeHTML from 'escape-html';
2
2
  import { sanitizeFields } from 'payload';
3
3
  import { createServerFeature } from '../../../utilities/createServerFeature.js';
4
- import { convertLexicalNodesToHTML } from '../../converters/html_deprecated/converter/index.js';
4
+ import { convertLexicalNodesToHTML } from '../../converters/lexicalToHtml_deprecated/converter/index.js';
5
5
  import { createNode } from '../../typeUtilities.js';
6
6
  import { LinkMarkdownTransformer } from '../markdownTransformer.js';
7
7
  import { AutoLinkNode } from '../nodes/AutoLinkNode.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["escapeHTML","sanitizeFields","createServerFeature","convertLexicalNodesToHTML","createNode","LinkMarkdownTransformer","AutoLinkNode","LinkNode","linkPopulationPromiseHOC","i18n","transformExtraFields","linkValidation","LinkFeature","feature","config","_config","isRoot","parentIsLocalized","props","validRelationships","collections","map","c","slug","_transformedFields","fields","enabledCollections","disabledCollections","maxDepth","sanitizedFields","requireFieldLevelRichTextEditor","sanitizedFieldsWithoutText","filter","field","name","linkTypeField","linkURLField","defaultLinkType","defaultValue","undefined","defaultLinkURL","ClientFeature","clientFeatureProps","disableAutoLinks","generateSchemaMap","Array","isArray","length","schemaMap","Map","set","markdownTransformers","nodes","converters","html","converter","currentDepth","depth","draft","node","overrideAccess","parent","req","showHiddenFields","childrenText","lexicalNodes","children","rel","newTab","target","href","url","linkType","doc","value","String","id","nodeTypes","getType","validations","getSubFields","getSubFieldsData","graphQLPopulationPromises","Boolean","sanitizedServerFeatureProps","key"],"sources":["../../../../src/features/link/server/index.ts"],"sourcesContent":["import type {\n CollectionSlug,\n Config,\n Field,\n FieldAffectingData,\n FieldSchemaMap,\n SanitizedConfig,\n} from 'payload'\n\nimport escapeHTML from 'escape-html'\nimport { sanitizeFields } from 'payload'\n\nimport type { NodeWithHooks } from '../../typesServer.js'\nimport type { ClientProps } from '../client/index.js'\n\nimport { createServerFeature } from '../../../utilities/createServerFeature.js'\nimport { convertLexicalNodesToHTML } from '../../converters/html_deprecated/converter/index.js'\nimport { createNode } from '../../typeUtilities.js'\nimport { LinkMarkdownTransformer } from '../markdownTransformer.js'\nimport { AutoLinkNode } from '../nodes/AutoLinkNode.js'\nimport { LinkNode } from '../nodes/LinkNode.js'\nimport { linkPopulationPromiseHOC } from './graphQLPopulationPromise.js'\nimport { i18n } from './i18n.js'\nimport { transformExtraFields } from './transformExtraFields.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?: CollectionSlug[]\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?: CollectionSlug[]\n }\n\nexport type LinkFeatureServerProps = {\n /**\n * Disables the automatic creation of links from URLs pasted into the editor, as well\n * as auto link nodes.\n *\n * If set to 'creationOnly', only the creation of new auto link nodes will be disabled.\n * Existing auto link nodes will still be editable.\n *\n * @default false\n */\n disableAutoLinks?: 'creationOnly' | true\n /**\n * A function or array defining additional fields for the link feature. These will be\n * displayed in the link editor drawer.\n */\n fields?:\n | ((args: {\n config: SanitizedConfig\n defaultFields: FieldAffectingData[]\n }) => (Field | FieldAffectingData)[])\n | 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} & ExclusiveLinkCollectionsProps\n\nexport const LinkFeature = createServerFeature<\n LinkFeatureServerProps,\n LinkFeatureServerProps,\n ClientProps\n>({\n feature: async ({ config: _config, isRoot, parentIsLocalized, props }) => {\n if (!props) {\n props = {}\n }\n const validRelationships = _config.collections.map((c) => c.slug) || []\n\n const _transformedFields = transformExtraFields(\n props.fields ? props.fields : null,\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 parentIsLocalized,\n requireFieldLevelRichTextEditor: isRoot,\n validRelationships,\n })\n props.fields = sanitizedFields\n\n // the text field is not included in the node data.\n // Thus, for tasks like validation, we do not want to pass it a text field in the schema which will never have data.\n // Otherwise, it will cause a validation error (field is required).\n const sanitizedFieldsWithoutText = sanitizedFields.filter(\n (field) => !('name' in field) || field.name !== 'text',\n )\n\n let linkTypeField: Field | null = null\n let linkURLField: Field | null = null\n\n for (const field of sanitizedFields) {\n if ('name' in field && field.name === 'linkType') {\n linkTypeField = field\n }\n\n if ('name' in field && field.name === 'url') {\n linkURLField = field\n }\n }\n\n const defaultLinkType = linkTypeField\n ? 'defaultValue' in linkTypeField && typeof linkTypeField.defaultValue === 'string'\n ? linkTypeField.defaultValue\n : 'custom'\n : undefined\n\n const defaultLinkURL = linkURLField\n ? 'defaultValue' in linkURLField && typeof linkURLField.defaultValue === 'string'\n ? linkURLField.defaultValue\n : 'https://'\n : undefined\n\n return {\n ClientFeature: '@payloadcms/richtext-lexical/client#LinkFeatureClient',\n clientFeatureProps: {\n defaultLinkType,\n defaultLinkURL,\n disableAutoLinks: props.disableAutoLinks,\n disabledCollections: props.disabledCollections,\n enabledCollections: props.enabledCollections,\n } as ClientProps,\n generateSchemaMap: () => {\n if (!sanitizedFields || !Array.isArray(sanitizedFields) || sanitizedFields.length === 0) {\n return null\n }\n\n const schemaMap: FieldSchemaMap = new Map()\n schemaMap.set('fields', {\n fields: sanitizedFields,\n })\n\n return schemaMap\n },\n i18n,\n markdownTransformers: [LinkMarkdownTransformer],\n nodes: [\n props?.disableAutoLinks === true\n ? null\n : createNode({\n converters: {\n html: {\n converter: async ({\n converters,\n currentDepth,\n depth,\n draft,\n node,\n overrideAccess,\n parent,\n req,\n showHiddenFields,\n }) => {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n currentDepth,\n depth,\n draft,\n lexicalNodes: node.children,\n overrideAccess,\n parent: {\n ...node,\n parent,\n },\n req,\n showHiddenFields,\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 !== 'object'\n ? String(node.fields.doc?.value)\n : String(node.fields.doc?.value?.id)\n }\n\n return `<a href=\"${href}\"${target}${rel}>${childrenText}</a>`\n },\n nodeTypes: [AutoLinkNode.getType()],\n },\n },\n node: AutoLinkNode,\n // Since AutoLinkNodes are just internal links, they need no hooks or graphQL population promises\n validations: [linkValidation(props, sanitizedFieldsWithoutText)],\n }),\n createNode({\n converters: {\n html: {\n converter: async ({\n converters,\n currentDepth,\n depth,\n draft,\n node,\n overrideAccess,\n parent,\n req,\n showHiddenFields,\n }) => {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n currentDepth,\n depth,\n draft,\n lexicalNodes: node.children,\n overrideAccess,\n parent: {\n ...node,\n parent,\n },\n req,\n showHiddenFields,\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 ? escapeHTML(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 getSubFields: () => {\n return sanitizedFieldsWithoutText\n },\n getSubFieldsData: ({ node }) => {\n return node?.fields\n },\n graphQLPopulationPromises: [linkPopulationPromiseHOC(props)],\n node: LinkNode,\n validations: [linkValidation(props, sanitizedFieldsWithoutText)],\n }),\n ].filter(Boolean) as Array<NodeWithHooks>,\n sanitizedServerFeatureProps: props,\n }\n },\n key: 'link',\n})\n"],"mappings":"AASA,OAAOA,UAAA,MAAgB;AACvB,SAASC,cAAc,QAAQ;AAK/B,SAASC,mBAAmB,QAAQ;AACpC,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,UAAU,QAAQ;AAC3B,SAASC,uBAAuB,QAAQ;AACxC,SAASC,YAAY,QAAQ;AAC7B,SAASC,QAAQ,QAAQ;AACzB,SAASC,wBAAwB,QAAQ;AACzC,SAASC,IAAI,QAAQ;AACrB,SAASC,oBAAoB,QAAQ;AACrC,SAASC,cAAc,QAAQ;AAsD/B,OAAO,MAAMC,WAAA,GAAcV,mBAAA,CAIzB;EACAW,OAAA,EAAS,MAAAA,CAAO;IAAEC,MAAA,EAAQC,OAAO;IAAEC,MAAM;IAAEC,iBAAiB;IAAEC;EAAK,CAAE;IACnE,IAAI,CAACA,KAAA,EAAO;MACVA,KAAA,GAAQ,CAAC;IACX;IACA,MAAMC,kBAAA,GAAqBJ,OAAA,CAAQK,WAAW,CAACC,GAAG,CAAEC,CAAA,IAAMA,CAAA,CAAEC,IAAI,KAAK,EAAE;IAEvE,MAAMC,kBAAA,GAAqBd,oBAAA,CACzBQ,KAAA,CAAMO,MAAM,GAAGP,KAAA,CAAMO,MAAM,GAAG,MAC9BV,OAAA,EACAG,KAAA,CAAMQ,kBAAkB,EACxB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,YAAA,EAAcA,CAAA;UACZ,OAAOjD,0BAAA;QACT;QACAkD,gBAAA,EAAkBA,CAAC;UAAEtB;QAAI,CAAE;UACzB,OAAOA,IAAA,EAAMlC,MAAA;QACf;QACAyD,yBAAA,EAA2B,CAAC1E,wBAAA,CAAyBU,KAAA,EAAO;QAC5DyC,IAAA,EAAMpD,QAAA;QACNwE,WAAA,EAAa,CAACpE,cAAA,CAAeO,KAAA,EAAOa,0BAAA;MACtC,GACD,CAACC,MAAM,CAACmD,OAAA;MACTC,2BAAA,EAA6BlE;IAC/B;EACF;EACAmE,GAAA,EAAK;AACP","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["escapeHTML","sanitizeFields","createServerFeature","convertLexicalNodesToHTML","createNode","LinkMarkdownTransformer","AutoLinkNode","LinkNode","linkPopulationPromiseHOC","i18n","transformExtraFields","linkValidation","LinkFeature","feature","config","_config","isRoot","parentIsLocalized","props","validRelationships","collections","map","c","slug","_transformedFields","fields","enabledCollections","disabledCollections","maxDepth","sanitizedFields","requireFieldLevelRichTextEditor","sanitizedFieldsWithoutText","filter","field","name","linkTypeField","linkURLField","defaultLinkType","defaultValue","undefined","defaultLinkURL","ClientFeature","clientFeatureProps","disableAutoLinks","generateSchemaMap","Array","isArray","length","schemaMap","Map","set","markdownTransformers","nodes","converters","html","converter","currentDepth","depth","draft","node","overrideAccess","parent","req","showHiddenFields","childrenText","lexicalNodes","children","rel","newTab","target","href","url","linkType","doc","value","String","id","nodeTypes","getType","validations","getSubFields","getSubFieldsData","graphQLPopulationPromises","Boolean","sanitizedServerFeatureProps","key"],"sources":["../../../../src/features/link/server/index.ts"],"sourcesContent":["import type {\n CollectionSlug,\n Config,\n Field,\n FieldAffectingData,\n FieldSchemaMap,\n SanitizedConfig,\n} from 'payload'\n\nimport escapeHTML from 'escape-html'\nimport { sanitizeFields } from 'payload'\n\nimport type { NodeWithHooks } from '../../typesServer.js'\nimport type { ClientProps } from '../client/index.js'\n\nimport { createServerFeature } from '../../../utilities/createServerFeature.js'\nimport { convertLexicalNodesToHTML } from '../../converters/lexicalToHtml_deprecated/converter/index.js'\nimport { createNode } from '../../typeUtilities.js'\nimport { LinkMarkdownTransformer } from '../markdownTransformer.js'\nimport { AutoLinkNode } from '../nodes/AutoLinkNode.js'\nimport { LinkNode } from '../nodes/LinkNode.js'\nimport { linkPopulationPromiseHOC } from './graphQLPopulationPromise.js'\nimport { i18n } from './i18n.js'\nimport { transformExtraFields } from './transformExtraFields.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?: CollectionSlug[]\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?: CollectionSlug[]\n }\n\nexport type LinkFeatureServerProps = {\n /**\n * Disables the automatic creation of links from URLs pasted into the editor, as well\n * as auto link nodes.\n *\n * If set to 'creationOnly', only the creation of new auto link nodes will be disabled.\n * Existing auto link nodes will still be editable.\n *\n * @default false\n */\n disableAutoLinks?: 'creationOnly' | true\n /**\n * A function or array defining additional fields for the link feature. These will be\n * displayed in the link editor drawer.\n */\n fields?:\n | ((args: {\n config: SanitizedConfig\n defaultFields: FieldAffectingData[]\n }) => (Field | FieldAffectingData)[])\n | 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} & ExclusiveLinkCollectionsProps\n\nexport const LinkFeature = createServerFeature<\n LinkFeatureServerProps,\n LinkFeatureServerProps,\n ClientProps\n>({\n feature: async ({ config: _config, isRoot, parentIsLocalized, props }) => {\n if (!props) {\n props = {}\n }\n const validRelationships = _config.collections.map((c) => c.slug) || []\n\n const _transformedFields = transformExtraFields(\n props.fields ? props.fields : null,\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 parentIsLocalized,\n requireFieldLevelRichTextEditor: isRoot,\n validRelationships,\n })\n props.fields = sanitizedFields\n\n // the text field is not included in the node data.\n // Thus, for tasks like validation, we do not want to pass it a text field in the schema which will never have data.\n // Otherwise, it will cause a validation error (field is required).\n const sanitizedFieldsWithoutText = sanitizedFields.filter(\n (field) => !('name' in field) || field.name !== 'text',\n )\n\n let linkTypeField: Field | null = null\n let linkURLField: Field | null = null\n\n for (const field of sanitizedFields) {\n if ('name' in field && field.name === 'linkType') {\n linkTypeField = field\n }\n\n if ('name' in field && field.name === 'url') {\n linkURLField = field\n }\n }\n\n const defaultLinkType = linkTypeField\n ? 'defaultValue' in linkTypeField && typeof linkTypeField.defaultValue === 'string'\n ? linkTypeField.defaultValue\n : 'custom'\n : undefined\n\n const defaultLinkURL = linkURLField\n ? 'defaultValue' in linkURLField && typeof linkURLField.defaultValue === 'string'\n ? linkURLField.defaultValue\n : 'https://'\n : undefined\n\n return {\n ClientFeature: '@payloadcms/richtext-lexical/client#LinkFeatureClient',\n clientFeatureProps: {\n defaultLinkType,\n defaultLinkURL,\n disableAutoLinks: props.disableAutoLinks,\n disabledCollections: props.disabledCollections,\n enabledCollections: props.enabledCollections,\n } as ClientProps,\n generateSchemaMap: () => {\n if (!sanitizedFields || !Array.isArray(sanitizedFields) || sanitizedFields.length === 0) {\n return null\n }\n\n const schemaMap: FieldSchemaMap = new Map()\n schemaMap.set('fields', {\n fields: sanitizedFields,\n })\n\n return schemaMap\n },\n i18n,\n markdownTransformers: [LinkMarkdownTransformer],\n nodes: [\n props?.disableAutoLinks === true\n ? null\n : createNode({\n converters: {\n html: {\n converter: async ({\n converters,\n currentDepth,\n depth,\n draft,\n node,\n overrideAccess,\n parent,\n req,\n showHiddenFields,\n }) => {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n currentDepth,\n depth,\n draft,\n lexicalNodes: node.children,\n overrideAccess,\n parent: {\n ...node,\n parent,\n },\n req,\n showHiddenFields,\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 !== 'object'\n ? String(node.fields.doc?.value)\n : String(node.fields.doc?.value?.id)\n }\n\n return `<a href=\"${href}\"${target}${rel}>${childrenText}</a>`\n },\n nodeTypes: [AutoLinkNode.getType()],\n },\n },\n node: AutoLinkNode,\n // Since AutoLinkNodes are just internal links, they need no hooks or graphQL population promises\n validations: [linkValidation(props, sanitizedFieldsWithoutText)],\n }),\n createNode({\n converters: {\n html: {\n converter: async ({\n converters,\n currentDepth,\n depth,\n draft,\n node,\n overrideAccess,\n parent,\n req,\n showHiddenFields,\n }) => {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n currentDepth,\n depth,\n draft,\n lexicalNodes: node.children,\n overrideAccess,\n parent: {\n ...node,\n parent,\n },\n req,\n showHiddenFields,\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 ? escapeHTML(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 getSubFields: () => {\n return sanitizedFieldsWithoutText\n },\n getSubFieldsData: ({ node }) => {\n return node?.fields\n },\n graphQLPopulationPromises: [linkPopulationPromiseHOC(props)],\n node: LinkNode,\n validations: [linkValidation(props,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AA,EAA6BlE;IAC/B;EACF;EACAmE,GAAA,EAAK;AACP","ignoreList":[]}
@@ -1,4 +1,4 @@
1
- import type { HTMLConverter } from '../converters/html_deprecated/converter/types.js';
1
+ import type { HTMLConverter } from '../converters/lexicalToHtml_deprecated/converter/types.js';
2
2
  import type { SerializedListItemNode, SerializedListNode } from './plugin/index.js';
3
3
  export declare const ListHTMLConverter: HTMLConverter<SerializedListNode>;
4
4
  export declare const ListItemHTMLConverter: HTMLConverter<SerializedListItemNode>;
@@ -1 +1 @@
1
- {"version":3,"file":"htmlConverter.d.ts","sourceRoot":"","sources":["../../../src/features/lists/htmlConverter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,kDAAkD,CAAA;AACrF,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAInF,eAAO,MAAM,iBAAiB,EAAE,aAAa,CAAC,kBAAkB,CA8B/D,CAAA;AAED,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAAC,sBAAsB,CAyDvE,CAAA"}
1
+ {"version":3,"file":"htmlConverter.d.ts","sourceRoot":"","sources":["../../../src/features/lists/htmlConverter.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,2DAA2D,CAAA;AAC9F,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAInF,eAAO,MAAM,iBAAiB,EAAE,aAAa,CAAC,kBAAkB,CA8B/D,CAAA;AAED,eAAO,MAAM,qBAAqB,EAAE,aAAa,CAAC,sBAAsB,CAyDvE,CAAA"}
@@ -1,6 +1,6 @@
1
1
  import { ListItemNode, ListNode } from '@lexical/list';
2
2
  import { v4 as uuidv4 } from 'uuid';
3
- import { convertLexicalNodesToHTML } from '../converters/html_deprecated/converter/index.js';
3
+ import { convertLexicalNodesToHTML } from '../converters/lexicalToHtml_deprecated/converter/index.js';
4
4
  export const ListHTMLConverter = {
5
5
  converter: async ({
6
6
  converters,
@@ -1 +1 @@
1
- {"version":3,"file":"htmlConverter.js","names":["ListItemNode","ListNode","v4","uuidv4","convertLexicalNodesToHTML","ListHTMLConverter","converter","converters","currentDepth","depth","draft","node","overrideAccess","parent","req","showHiddenFields","childrenText","lexicalNodes","children","tag","listType","nodeTypes","getType","ListItemHTMLConverter","hasSubLists","some","child","type","uuid","checked","value"],"sources":["../../../src/features/lists/htmlConverter.ts"],"sourcesContent":["import { ListItemNode, ListNode } from '@lexical/list'\nimport { v4 as uuidv4 } from 'uuid'\n\nimport type { HTMLConverter } from '../converters/html_deprecated/converter/types.js'\nimport type { SerializedListItemNode, SerializedListNode } from './plugin/index.js'\n\nimport { convertLexicalNodesToHTML } from '../converters/html_deprecated/converter/index.js'\n\nexport const ListHTMLConverter: HTMLConverter<SerializedListNode> = {\n converter: async ({\n converters,\n currentDepth,\n depth,\n draft,\n node,\n overrideAccess,\n parent,\n req,\n showHiddenFields,\n }) => {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n currentDepth,\n depth,\n draft,\n lexicalNodes: node.children,\n overrideAccess,\n parent: {\n ...node,\n parent,\n },\n req,\n showHiddenFields,\n })\n\n return `<${node?.tag} class=\"list-${node?.listType}\">${childrenText}</${node?.tag}>`\n },\n nodeTypes: [ListNode.getType()],\n}\n\nexport const ListItemHTMLConverter: HTMLConverter<SerializedListItemNode> = {\n converter: async ({\n converters,\n currentDepth,\n depth,\n draft,\n node,\n overrideAccess,\n parent,\n req,\n showHiddenFields,\n }) => {\n const hasSubLists = node.children.some((child) => child.type === 'list')\n\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n currentDepth,\n depth,\n draft,\n lexicalNodes: node.children,\n overrideAccess,\n parent: {\n ...node,\n parent,\n },\n req,\n showHiddenFields,\n })\n\n if ('listType' in parent && parent?.listType === 'check') {\n const uuid = uuidv4()\n\n return `<li aria-checked=${node.checked ? 'true' : 'false'} class=\"${\n 'list-item-checkbox' +\n (node.checked ? ' list-item-checkbox-checked' : ' list-item-checkbox-unchecked') +\n (hasSubLists ? ' nestedListItem' : '')\n }\"\n role=\"checkbox\"\n tabIndex=${-1}\n value=${node?.value}\n >\n ${\n hasSubLists\n ? childrenText\n : `\n <input type=\"checkbox\" id=\"${uuid}\"${node.checked ? ' checked' : ''}>\n <label for=\"${uuid}\">${childrenText}</label><br>\n `\n }\n\n\n </li>`\n } else {\n return `<li ${hasSubLists ? `class=\"nestedListItem\" ` : ''}value=${node?.value}>${childrenText}</li>`\n }\n },\n nodeTypes: [ListItemNode.getType()],\n}\n"],"mappings":"AAAA,SAASA,YAAY,EAAEC,QAAQ,QAAQ;AACvC,SAASC,EAAA,IAAMC,MAAM,QAAQ;AAK7B,SAASC,yBAAyB,QAAQ;AAE1C,OAAO,MAAMC,iBAAA,GAAuD;EAClEC,SAAA,EAAW,MAAAA,CAAO;IAChBC,UAAU;IACVC,YAAY;IACZC,KAAK;IACLC,KAAK;IACLC,IAAI;IACJC,cAAc;IACdC,MAAM;IACNC,GAAG;IACHC;EAAgB,CACjB;IACC,MAAMC,YAAA,GAAe,MAAMZ,yBAAA,CAA0B;MACnDG,UAAA;MACAC,YAAA;MACAC,KAAA;MACAC,KAAA;MACAO,YAAA,EAAcN,IAAA,CAAKO,QAAQ;MAC3BN,cAAA;MACAC,MAAA,EAAQ;QACN,GAAGF,IAAI;QACPE;MACF;MACAC,GAAA;MACAC;IACF;IAEA,OAAO,IAAIJ,IAAA,EAAMQ,GAAA,gBAAmBR,IAAA,EAAMS,QAAA,KAAaJ,YAAA,KAAiBL,IAAA,EAAMQ,GAAA,GAAM;EACtF;EACAE,SAAA,EAAW,CAACpB,QAAA,CAASqB,OAAO;AAC9B;AAEA,OAAO,MAAMC,qBAAA,GAA+D;EAC1EjB,SAAA,EAAW,MAAAA,CAAO;IAChBC,UAAU;IACVC,YAAY;IACZC,KAAK;IACLC,KAAK;IACLC,IAAI;IACJC,cAAc;IACdC,MAAM;IACNC,GAAG;IACHC;EAAgB,CACjB;IACC,MAAMS,WAAA,GAAcb,IAAA,CAAKO,QAAQ,CAACO,IAAI,CAAEC,KAAA,IAAUA,KAAA,CAAMC,IAAI,KAAK;IAEjE,MAAMX,YAAA,GAAe,MAAMZ,yBAAA,CAA0B;MACnDG,UAAA;MACAC,YAAA;MACAC,KAAA;MACAC,KAAA;MACAO,YAAA,EAAcN,IAAA,CAAKO,QAAQ;MAC3BN,cAAA;MACAC,MAAA,EAAQ;QACN,GAAGF,IAAI;QACPE;MACF;MACAC,GAAA;MACAC;IACF;IAEA,IAAI,cAAcF,MAAA,IAAUA,MAAA,EAAQO,QAAA,KAAa,SAAS;MACxD,MAAMQ,IAAA,GAAOzB,MAAA;MAEb,OAAO,oBAAoBQ,IAAA,CAAKkB,OAAO,GAAG,SAAS,kBACjD,wBACClB,IAAA,CAAKkB,OAAO,GAAG,gCAAgC,+BAA8B,KAC7EL,WAAA,GAAc,oBAAoB,EAAC;;qBAGvB,CAAC;kBACJb,IAAA,EAAMmB,KAAA;;QAGhBN,WAAA,GACIR,YAAA,GACA;qCACyBY,IAAA,IAAQjB,IAAA,CAAKkB,OAAO,GAAG,aAAa;sBACnDD,IAAA,KAASZ,YAAA;OACxB;;;gBAIS;IACZ,OAAO;MACL,OAAO,OAAOQ,WAAA,GAAc,yBAAyB,GAAG,WAAWb,IAAA,EAAMmB,KAAA,IAASd,YAAA,OAAmB;IACvG;EACF;EACAK,SAAA,EAAW,CAACrB,YAAA,CAAasB,OAAO;AAClC","ignoreList":[]}
1
+ {"version":3,"file":"htmlConverter.js","names":["ListItemNode","ListNode","v4","uuidv4","convertLexicalNodesToHTML","ListHTMLConverter","converter","converters","currentDepth","depth","draft","node","overrideAccess","parent","req","showHiddenFields","childrenText","lexicalNodes","children","tag","listType","nodeTypes","getType","ListItemHTMLConverter","hasSubLists","some","child","type","uuid","checked","value"],"sources":["../../../src/features/lists/htmlConverter.ts"],"sourcesContent":["import { ListItemNode, ListNode } from '@lexical/list'\nimport { v4 as uuidv4 } from 'uuid'\n\nimport type { HTMLConverter } from '../converters/lexicalToHtml_deprecated/converter/types.js'\nimport type { SerializedListItemNode, SerializedListNode } from './plugin/index.js'\n\nimport { convertLexicalNodesToHTML } from '../converters/lexicalToHtml_deprecated/converter/index.js'\n\nexport const ListHTMLConverter: HTMLConverter<SerializedListNode> = {\n converter: async ({\n converters,\n currentDepth,\n depth,\n draft,\n node,\n overrideAccess,\n parent,\n req,\n showHiddenFields,\n }) => {\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n currentDepth,\n depth,\n draft,\n lexicalNodes: node.children,\n overrideAccess,\n parent: {\n ...node,\n parent,\n },\n req,\n showHiddenFields,\n })\n\n return `<${node?.tag} class=\"list-${node?.listType}\">${childrenText}</${node?.tag}>`\n },\n nodeTypes: [ListNode.getType()],\n}\n\nexport const ListItemHTMLConverter: HTMLConverter<SerializedListItemNode> = {\n converter: async ({\n converters,\n currentDepth,\n depth,\n draft,\n node,\n overrideAccess,\n parent,\n req,\n showHiddenFields,\n }) => {\n const hasSubLists = node.children.some((child) => child.type === 'list')\n\n const childrenText = await convertLexicalNodesToHTML({\n converters,\n currentDepth,\n depth,\n draft,\n lexicalNodes: node.children,\n overrideAccess,\n parent: {\n ...node,\n parent,\n },\n req,\n showHiddenFields,\n })\n\n if ('listType' in parent && parent?.listType === 'check') {\n const uuid = uuidv4()\n\n return `<li aria-checked=${node.checked ? 'true' : 'false'} class=\"${\n 'list-item-checkbox' +\n (node.checked ? ' list-item-checkbox-checked' : ' list-item-checkbox-unchecked') +\n (hasSubLists ? ' nestedListItem' : '')\n }\"\n role=\"checkbox\"\n tabIndex=${-1}\n value=${node?.value}\n >\n ${\n hasSubLists\n ? childrenText\n : `\n <input type=\"checkbox\" id=\"${uuid}\"${node.checked ? ' checked' : ''}>\n <label for=\"${uuid}\">${childrenText}</label><br>\n `\n }\n\n\n </li>`\n } else {\n return `<li ${hasSubLists ? `class=\"nestedListItem\" ` : ''}value=${node?.value}>${childrenText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;MACAC,GAAA;MACAC;IACF;IAEA,IAAI,cAAcF,MAAA,IAAUA,MAAA,EAAQO,QAAA,KAAa,SAAS;MACxD,MAAMQ,IAAA,GAAOzB,MAAA;MAEb,OAAO,oBAAoBQ,IAAA,CAAKkB,OAAO,GAAG,SAAS,kBACjD,wBACClB,IAAA,CAAKkB,OAAO,GAAG,gCAAgC,+BAA8B,KAC7EL,WAAA,GAAc,oBAAoB,EAAC;;qBAGvB,CAAC;kBACJb,IAAA,EAAMmB,KAAA;;QAGhBN,WAAA,GACIR,YAAA,GACA;qCACyBY,IAAA,IAAQjB,IAAA,CAAKkB,OAAO,GAAG,aAAa;sBACnDD,IAAA,KAASZ,YAAA;OACxB;;;gBAIS;IACZ,OAAO;MACL,OAAO,OAAOQ,WAAA,GAAc,yBAAyB,GAAG,WAAWb,IAAA,EAAMmB,KAAA,IAASd,YAAA,OAAmB;IACvG;EACF;EACAK,SAAA,EAAW,CAACrB,YAAA,CAAasB,OAAO;AAClC","ignoreList":[]}
@@ -21,7 +21,7 @@ export function DropDownItem({
21
21
  setClassName([baseClass, enabled === false ? 'disabled' : '', active ? 'active' : '', item?.key ? `${baseClass}-${item.key}` : ''].filter(Boolean).join(' '));
22
22
  }, [enabled, active, className, item.key]);
23
23
  const ref = useRef(null);
24
- const dropDownContext = React.useContext(DropDownContext);
24
+ const dropDownContext = React.use(DropDownContext);
25
25
  if (dropDownContext === null) {
26
26
  throw new Error('DropDownItem must be used within a DropDown');
27
27
  }
@@ -117,7 +117,7 @@ function DropDownItems({
117
117
  highlightedItem.current.focus();
118
118
  }
119
119
  }, [items, highlightedItem]);
120
- return /*#__PURE__*/_jsx(DropDownContext.Provider, {
120
+ return /*#__PURE__*/_jsx(DropDownContext, {
121
121
  value: contextValue,
122
122
  children: /*#__PURE__*/_jsx("div", {
123
123
  className: (itemsContainerClassNames ?? ['toolbar-popup__dropdown-items']).join(' '),
@@ -1 +1 @@
1
- {"version":3,"file":"DropDown.js","names":["Button","$addUpdateTag","isDOMNode","React","useCallback","useEffect","useMemo","useRef","useState","createPortal","baseClass","DropDownContext","createContext","DropDownItem","active","children","editor","enabled","Icon","item","tooltip","className","setClassName","key","filter","Boolean","join","ref","dropDownContext","useContext","Error","registerItem","current","_jsx","buttonStyle","disabled","icon","iconPosition","iconStyle","onClick","focus","update","onSelect","isActive","onMouseDown","e","preventDefault","type","DropDownItems","dropDownRef","itemsContainerClassNames","onClose","items","setItems","highlightedItem","setHighlightedItem","itemRef","prev","handleKeyDown","event","includes","index","indexOf","length","contextValue","Provider","value","onKeyDown","DropDown","buttonAriaLabel","buttonClassName","label","stopCloseOnClickSelf","buttonRef","showDropDown","setShowDropDown","handleClose","button","dropDown","left","top","getBoundingClientRect","scrollTopOffset","window","scrollY","document","documentElement","scrollTop","style","offsetHeight","Math","min","innerWidth","offsetWidth","handle","target","contains","addEventListener","removeEventListener","portal","body","_jsxs","Fragment"],"sources":["../../../../../src/features/toolbars/shared/ToolbarDropdown/DropDown.tsx"],"sourcesContent":["'use client'\nimport { Button } from '@payloadcms/ui'\nimport { $addUpdateTag, isDOMNode, type LexicalEditor } from 'lexical'\nimport React, { type ReactNode, useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport type { ToolbarGroupItem } from '../../types.js'\n\nconst baseClass = 'toolbar-popup__dropdown-item'\n\ninterface DropDownContextType {\n registerItem: (ref: React.RefObject<HTMLButtonElement | null>) => void\n}\n\nconst DropDownContext = React.createContext<DropDownContextType | null>(null)\n\nexport function DropDownItem({\n active,\n children,\n editor,\n enabled,\n Icon,\n item,\n tooltip,\n}: {\n active?: boolean\n children: React.ReactNode\n editor: LexicalEditor\n enabled?: boolean\n Icon: React.ReactNode\n item: ToolbarGroupItem\n tooltip?: string\n}): React.ReactNode {\n const [className, setClassName] = useState<string>(baseClass)\n\n useEffect(() => {\n setClassName(\n [\n baseClass,\n enabled === false ? 'disabled' : '',\n active ? 'active' : '',\n item?.key ? `${baseClass}-${item.key}` : '',\n ]\n .filter(Boolean)\n .join(' '),\n )\n }, [enabled, active, className, item.key])\n\n const ref = useRef<HTMLButtonElement>(null)\n\n const dropDownContext = React.useContext(DropDownContext)\n\n if (dropDownContext === null) {\n throw new Error('DropDownItem must be used within a DropDown')\n }\n\n const { registerItem } = dropDownContext\n\n useEffect(() => {\n if (ref?.current != null) {\n registerItem(ref)\n }\n }, [ref, registerItem])\n\n return (\n <Button\n aria-label={tooltip}\n buttonStyle=\"none\"\n className={className}\n disabled={enabled === false}\n icon={Icon}\n iconPosition=\"left\"\n iconStyle=\"none\"\n onClick={() => {\n if (enabled !== false) {\n editor.focus(() => {\n editor.update(() => {\n $addUpdateTag('toolbar')\n })\n // We need to wrap the onSelect in the callback, so the editor is properly focused before the onSelect is called.\n item.onSelect?.({\n editor,\n isActive: active!,\n })\n })\n }\n }}\n onMouseDown={(e) => {\n // This is required for Firefox compatibility. Without it, the dropdown will disappear without the onClick being called.\n // This only happens in Firefox. Must be something about how Firefox handles focus events differently.\n e.preventDefault()\n }}\n ref={ref}\n tooltip={tooltip}\n type=\"button\"\n >\n {children}\n </Button>\n )\n}\n\nfunction DropDownItems({\n children,\n dropDownRef,\n itemsContainerClassNames,\n onClose,\n}: {\n children: React.ReactNode\n dropDownRef: React.Ref<HTMLDivElement>\n itemsContainerClassNames?: string[]\n onClose: () => void\n}): React.ReactElement {\n const [items, setItems] = useState<Array<React.RefObject<HTMLButtonElement | null>>>()\n const [highlightedItem, setHighlightedItem] =\n useState<React.RefObject<HTMLButtonElement | null>>()\n\n const registerItem = useCallback(\n (itemRef: React.RefObject<HTMLButtonElement | null>) => {\n setItems((prev) => (prev != null ? [...prev, itemRef] : [itemRef]))\n },\n [setItems],\n )\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>): void => {\n if (items == null) {\n return\n }\n\n const { key } = event\n\n if (['ArrowDown', 'ArrowUp', 'Escape', 'Tab'].includes(key)) {\n event.preventDefault()\n }\n\n if (key === 'Escape' || key === 'Tab') {\n onClose()\n } else if (key === 'ArrowUp') {\n setHighlightedItem((prev) => {\n if (prev == null) {\n return items[0]\n }\n const index = items.indexOf(prev) - 1\n return items[index === -1 ? items.length - 1 : index]\n })\n } else if (key === 'ArrowDown') {\n setHighlightedItem((prev) => {\n if (prev == null) {\n return items[0]\n }\n return items[items.indexOf(prev) + 1]\n })\n }\n }\n\n const contextValue = useMemo(\n () => ({\n registerItem,\n }),\n [registerItem],\n )\n\n useEffect(() => {\n if (items != null && highlightedItem == null) {\n setHighlightedItem(items[0])\n }\n\n if (highlightedItem != null && highlightedItem?.current != null) {\n highlightedItem.current.focus()\n }\n }, [items, highlightedItem])\n\n return (\n <DropDownContext.Provider value={contextValue}>\n <div\n className={(itemsContainerClassNames ?? ['toolbar-popup__dropdown-items']).join(' ')}\n onKeyDown={handleKeyDown}\n ref={dropDownRef}\n >\n {children}\n </div>\n </DropDownContext.Provider>\n )\n}\n\nexport function DropDown({\n buttonAriaLabel,\n buttonClassName,\n children,\n disabled = false,\n Icon,\n itemsContainerClassNames,\n label,\n stopCloseOnClickSelf,\n}: {\n buttonAriaLabel?: string\n buttonClassName: string\n children: ReactNode\n disabled?: boolean\n Icon?: React.FC\n itemsContainerClassNames?: string[]\n label?: string\n stopCloseOnClickSelf?: boolean\n}): React.ReactNode {\n const dropDownRef = useRef<HTMLDivElement>(null)\n const buttonRef = useRef<HTMLButtonElement>(null)\n const [showDropDown, setShowDropDown] = useState(false)\n\n const handleClose = (): void => {\n setShowDropDown(false)\n if (buttonRef?.current != null) {\n buttonRef.current.focus()\n }\n }\n\n useEffect(() => {\n const button = buttonRef.current\n const dropDown = dropDownRef.current\n\n if (showDropDown && button !== null && dropDown !== null) {\n const { left, top } = button.getBoundingClientRect()\n const scrollTopOffset = window.scrollY || document.documentElement.scrollTop\n dropDown.style.top = `${top + scrollTopOffset + button.offsetHeight + 5}px`\n dropDown.style.left = `${Math.min(left - 5, window.innerWidth - dropDown.offsetWidth - 20)}px`\n }\n }, [dropDownRef, buttonRef, showDropDown])\n\n useEffect(() => {\n const button = buttonRef.current\n\n if (button !== null && showDropDown) {\n const handle = (event: MouseEvent): void => {\n const target = event.target\n if (!isDOMNode(target)) {\n return\n }\n if (stopCloseOnClickSelf) {\n if (dropDownRef.current && dropDownRef.current.contains(target)) {\n return\n }\n }\n if (!button.contains(target)) {\n setShowDropDown(false)\n }\n }\n document.addEventListener('click', handle)\n\n return () => {\n document.removeEventListener('click', handle)\n }\n }\n }, [dropDownRef, buttonRef, showDropDown, stopCloseOnClickSelf])\n\n const portal = createPortal(\n <DropDownItems\n dropDownRef={dropDownRef}\n itemsContainerClassNames={itemsContainerClassNames}\n onClose={handleClose}\n >\n {children}\n </DropDownItems>,\n document.body,\n )\n\n return (\n <React.Fragment>\n <button\n aria-label={buttonAriaLabel}\n className={buttonClassName + (showDropDown ? ' active' : '')}\n disabled={disabled}\n onClick={(event) => {\n event.preventDefault()\n setShowDropDown(!showDropDown)\n }}\n onMouseDown={(e) => {\n // This fixes a bug where you are unable to click the button if you are in a NESTED editor (editor in blocks field in editor).\n // Thus only happens if you click on the SVG of the button. Clicking on the outside works. Related issue: https://github.com/payloadcms/payload/issues/4025\n // TODO: Find out why exactly it happens and why e.preventDefault() on the mouseDown fixes it. Write that down here, or potentially fix a root cause, if there is any.\n e.preventDefault()\n }}\n ref={buttonRef}\n type=\"button\"\n >\n {Icon && <Icon />}\n {label && <span className=\"toolbar-popup__dropdown-label\">{label}</span>}\n <i className=\"toolbar-popup__dropdown-caret\" />\n </button>\n\n {showDropDown && <React.Fragment>{portal}</React.Fragment>}\n </React.Fragment>\n )\n}\n"],"mappings":"AAAA;;;AACA,SAASA,MAAM,QAAQ;AACvB,SAASC,aAAa,EAAEC,SAAS,QAA4B;AAC7D,OAAOC,KAAA,IAAyBC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AACzF,SAASC,YAAY,QAAQ;AAI7B,MAAMC,SAAA,GAAY;AAMl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,CAACD,MAAA,GAAS;UAC5BpB,eAAA,CAAgB;QAClB;MACF;MACAU,QAAA,CAASY,gBAAgB,CAAC,SAASH,MAAA;MAEnC,OAAO;QACLT,QAAA,CAASa,mBAAmB,CAAC,SAASJ,MAAA;MACxC;IACF;EACF,GAAG,CAAC7C,WAAA,EAAawB,SAAA,EAAWC,YAAA,EAAcF,oBAAA,CAAqB;EAE/D,MAAM2B,MAAA,gBAAS1F,YAAA,cACbwB,IAAA,CAACe,aAAA;IACCC,WAAA,EAAaA,WAAA;IACbC,wBAAA,EAA0BA,wBAAA;IAC1BC,OAAA,EAASyB,WAAA;cAER7D;MAEHsE,QAAA,CAASe,IAAI;EAGf,oBACEC,KAAA,CAAClG,KAAA,CAAMmG,QAAQ;4BACbD,KAAA,CAAC;MACC,cAAYhC,eAAA;MACZhD,SAAA,EAAWiD,eAAA,IAAmBI,YAAA,GAAe,YAAY,EAAC;MAC1DvC,QAAA,EAAUA,QAAA;MACVI,OAAA,EAAUoB,OAAA;QACRA,OAAA,CAAMb,cAAc;QACpB6B,eAAA,CAAgB,CAACD,YAAA;MACnB;MACA9B,WAAA,EAAcC,CAAA;QACZ;QACA;QACA;QACAA,CAAA,CAAEC,cAAc;MAClB;MACAnB,GAAA,EAAK8C,SAAA;MACL1B,IAAA,EAAK;iBAEJ7B,IAAA,iBAAQe,IAAA,CAACf,IAAA,OACTqD,KAAA,iBAAStC,IAAA,CAAC;QAAKZ,SAAA,EAAU;kBAAiCkD;uBAC3DtC,IAAA,CAAC;QAAEZ,SAAA,EAAU;;QAGdqD,YAAA,iBAAgBzC,IAAA,CAAC9B,KAAA,CAAMmG,QAAQ;gBAAEH;;;AAGxC","ignoreList":[]}
1
+ {"version":3,"file":"DropDown.js","names":["Button","$addUpdateTag","isDOMNode","React","useCallback","useEffect","useMemo","useRef","useState","createPortal","baseClass","DropDownContext","createContext","DropDownItem","active","children","editor","enabled","Icon","item","tooltip","className","setClassName","key","filter","Boolean","join","ref","dropDownContext","use","Error","registerItem","current","_jsx","buttonStyle","disabled","icon","iconPosition","iconStyle","onClick","focus","update","onSelect","isActive","onMouseDown","e","preventDefault","type","DropDownItems","dropDownRef","itemsContainerClassNames","onClose","items","setItems","highlightedItem","setHighlightedItem","itemRef","prev","handleKeyDown","event","includes","index","indexOf","length","contextValue","value","onKeyDown","DropDown","buttonAriaLabel","buttonClassName","label","stopCloseOnClickSelf","buttonRef","showDropDown","setShowDropDown","handleClose","button","dropDown","left","top","getBoundingClientRect","scrollTopOffset","window","scrollY","document","documentElement","scrollTop","style","offsetHeight","Math","min","innerWidth","offsetWidth","handle","target","contains","addEventListener","removeEventListener","portal","body","_jsxs","Fragment"],"sources":["../../../../../src/features/toolbars/shared/ToolbarDropdown/DropDown.tsx"],"sourcesContent":["'use client'\nimport { Button } from '@payloadcms/ui'\nimport { $addUpdateTag, isDOMNode, type LexicalEditor } from 'lexical'\nimport React, { type ReactNode, useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport type { ToolbarGroupItem } from '../../types.js'\n\nconst baseClass = 'toolbar-popup__dropdown-item'\n\ninterface DropDownContextType {\n registerItem: (ref: React.RefObject<HTMLButtonElement | null>) => void\n}\n\nconst DropDownContext = React.createContext<DropDownContextType | null>(null)\n\nexport function DropDownItem({\n active,\n children,\n editor,\n enabled,\n Icon,\n item,\n tooltip,\n}: {\n active?: boolean\n children: React.ReactNode\n editor: LexicalEditor\n enabled?: boolean\n Icon: React.ReactNode\n item: ToolbarGroupItem\n tooltip?: string\n}): React.ReactNode {\n const [className, setClassName] = useState<string>(baseClass)\n\n useEffect(() => {\n setClassName(\n [\n baseClass,\n enabled === false ? 'disabled' : '',\n active ? 'active' : '',\n item?.key ? `${baseClass}-${item.key}` : '',\n ]\n .filter(Boolean)\n .join(' '),\n )\n }, [enabled, active, className, item.key])\n\n const ref = useRef<HTMLButtonElement>(null)\n\n const dropDownContext = React.use(DropDownContext)\n\n if (dropDownContext === null) {\n throw new Error('DropDownItem must be used within a DropDown')\n }\n\n const { registerItem } = dropDownContext\n\n useEffect(() => {\n if (ref?.current != null) {\n registerItem(ref)\n }\n }, [ref, registerItem])\n\n return (\n <Button\n aria-label={tooltip}\n buttonStyle=\"none\"\n className={className}\n disabled={enabled === false}\n icon={Icon}\n iconPosition=\"left\"\n iconStyle=\"none\"\n onClick={() => {\n if (enabled !== false) {\n editor.focus(() => {\n editor.update(() => {\n $addUpdateTag('toolbar')\n })\n // We need to wrap the onSelect in the callback, so the editor is properly focused before the onSelect is called.\n item.onSelect?.({\n editor,\n isActive: active!,\n })\n })\n }\n }}\n onMouseDown={(e) => {\n // This is required for Firefox compatibility. Without it, the dropdown will disappear without the onClick being called.\n // This only happens in Firefox. Must be something about how Firefox handles focus events differently.\n e.preventDefault()\n }}\n ref={ref}\n tooltip={tooltip}\n type=\"button\"\n >\n {children}\n </Button>\n )\n}\n\nfunction DropDownItems({\n children,\n dropDownRef,\n itemsContainerClassNames,\n onClose,\n}: {\n children: React.ReactNode\n dropDownRef: React.Ref<HTMLDivElement>\n itemsContainerClassNames?: string[]\n onClose: () => void\n}): React.ReactElement {\n const [items, setItems] = useState<Array<React.RefObject<HTMLButtonElement | null>>>()\n const [highlightedItem, setHighlightedItem] =\n useState<React.RefObject<HTMLButtonElement | null>>()\n\n const registerItem = useCallback(\n (itemRef: React.RefObject<HTMLButtonElement | null>) => {\n setItems((prev) => (prev != null ? [...prev, itemRef] : [itemRef]))\n },\n [setItems],\n )\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>): void => {\n if (items == null) {\n return\n }\n\n const { key } = event\n\n if (['ArrowDown', 'ArrowUp', 'Escape', 'Tab'].includes(key)) {\n event.preventDefault()\n }\n\n if (key === 'Escape' || key === 'Tab') {\n onClose()\n } else if (key === 'ArrowUp') {\n setHighlightedItem((prev) => {\n if (prev == null) {\n return items[0]\n }\n const index = items.indexOf(prev) - 1\n return items[index === -1 ? items.length - 1 : index]\n })\n } else if (key === 'ArrowDown') {\n setHighlightedItem((prev) => {\n if (prev == null) {\n return items[0]\n }\n return items[items.indexOf(prev) + 1]\n })\n }\n }\n\n const contextValue = useMemo(\n () => ({\n registerItem,\n }),\n [registerItem],\n )\n\n useEffect(() => {\n if (items != null && highlightedItem == null) {\n setHighlightedItem(items[0])\n }\n\n if (highlightedItem != null && highlightedItem?.current != null) {\n highlightedItem.current.focus()\n }\n }, [items, highlightedItem])\n\n return (\n <DropDownContext value={contextValue}>\n <div\n className={(itemsContainerClassNames ?? ['toolbar-popup__dropdown-items']).join(' ')}\n onKeyDown={handleKeyDown}\n ref={dropDownRef}\n >\n {children}\n </div>\n </DropDownContext>\n )\n}\n\nexport function DropDown({\n buttonAriaLabel,\n buttonClassName,\n children,\n disabled = false,\n Icon,\n itemsContainerClassNames,\n label,\n stopCloseOnClickSelf,\n}: {\n buttonAriaLabel?: string\n buttonClassName: string\n children: ReactNode\n disabled?: boolean\n Icon?: React.FC\n itemsContainerClassNames?: string[]\n label?: string\n stopCloseOnClickSelf?: boolean\n}): React.ReactNode {\n const dropDownRef = useRef<HTMLDivElement>(null)\n const buttonRef = useRef<HTMLButtonElement>(null)\n const [showDropDown, setShowDropDown] = useState(false)\n\n const handleClose = (): void => {\n setShowDropDown(false)\n if (buttonRef?.current != null) {\n buttonRef.current.focus()\n }\n }\n\n useEffect(() => {\n const button = buttonRef.current\n const dropDown = dropDownRef.current\n\n if (showDropDown && button !== null && dropDown !== null) {\n const { left, top } = button.getBoundingClientRect()\n const scrollTopOffset = window.scrollY || document.documentElement.scrollTop\n dropDown.style.top = `${top + scrollTopOffset + button.offsetHeight + 5}px`\n dropDown.style.left = `${Math.min(left - 5, window.innerWidth - dropDown.offsetWidth - 20)}px`\n }\n }, [dropDownRef, buttonRef, showDropDown])\n\n useEffect(() => {\n const button = buttonRef.current\n\n if (button !== null && showDropDown) {\n const handle = (event: MouseEvent): void => {\n const target = event.target\n if (!isDOMNode(target)) {\n return\n }\n if (stopCloseOnClickSelf) {\n if (dropDownRef.current && dropDownRef.current.contains(target)) {\n return\n }\n }\n if (!button.contains(target)) {\n setShowDropDown(false)\n }\n }\n document.addEventListener('click', handle)\n\n return () => {\n document.removeEventListener('click', handle)\n }\n }\n }, [dropDownRef, buttonRef, showDropDown, stopCloseOnClickSelf])\n\n const portal = createPortal(\n <DropDownItems\n dropDownRef={dropDownRef}\n itemsContainerClassNames={itemsContainerClassNames}\n onClose={handleClose}\n >\n {children}\n </DropDownItems>,\n document.body,\n )\n\n return (\n <React.Fragment>\n <button\n aria-label={buttonAriaLabel}\n className={buttonClassName + (showDropDown ? ' active' : '')}\n disabled={disabled}\n onClick={(event) => {\n event.preventDefault()\n setShowDropDown(!showDropDown)\n }}\n onMouseDown={(e) => {\n // This fixes a bug where you are unable to click the button if you are in a NESTED editor (editor in blocks field in editor).\n // Thus only happens if you click on the SVG of the button. Clicking on the outside works. Related issue: https://github.com/payloadcms/payload/issues/4025\n // TODO: Find out why exactly it happens and why e.preventDefault() on the mouseDown fixes it. Write that down here, or potentially fix a root cause, if there is any.\n e.preventDefault()\n }}\n ref={buttonRef}\n type=\"button\"\n >\n {Icon && <Icon />}\n {label && <span className=\"toolbar-popup__dropdown-label\">{label}</span>}\n <i className=\"toolbar-popup__dropdown-caret\" />\n </button>\n\n {showDropDown && <React.Fragment>{portal}</React.Fragment>}\n </React.Fragment>\n )\n}\n"],"mappings":"AAAA;;;AACA,SAASA,MAAM,QAAQ;AACvB,SAASC,aAAa,EAAEC,SAAS,QAA4B;AAC7D,OAAOC,KAAA,IAAyBC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AACzF,SAASC,YAAY,QAAQ;AAI7B,MAAMC,SAAA,GAAY;AAMlB,MAAMC,eAAA,gBAAkBR,KAAA,CAAMS,aAAa,CAA6B;AAExE,OAAO,SAASC,aAAa;EAC3BC,MAAM;EACNC,QAAQ;EACRC,MAAM;EACNC,OAAO;EACPC,IAAI;EACJC,IAAI;EACJC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GAAG,CAAC5C,WAAA,EAAauB,SAAA,EAAWC,YAAA,EAAcF,oBAAA,CAAqB;EAE/D,MAAM2B,MAAA,gBAASzF,YAAA,cACbwB,IAAA,CAACe,aAAA;IACCC,WAAA,EAAaA,WAAA;IACbC,wBAAA,EAA0BA,wBAAA;IAC1BC,OAAA,EAASwB,WAAA;cAER5D;MAEHqE,QAAA,CAASe,IAAI;EAGf,oBACEC,KAAA,CAACjG,KAAA,CAAMkG,QAAQ;4BACbD,KAAA,CAAC;MACC,cAAYhC,eAAA;MACZ/C,SAAA,EAAWgD,eAAA,IAAmBI,YAAA,GAAe,YAAY,EAAC;MAC1DtC,QAAA,EAAUA,QAAA;MACVI,OAAA,EAAUoB,OAAA;QACRA,OAAA,CAAMb,cAAc;QACpB4B,eAAA,CAAgB,CAACD,YAAA;MACnB;MACA7B,WAAA,EAAcC,CAAA;QACZ;QACA;QACA;QACAA,CAAA,CAAEC,cAAc;MAClB;MACAnB,GAAA,EAAK6C,SAAA;MACLzB,IAAA,EAAK;iBAEJ7B,IAAA,iBAAQe,IAAA,CAACf,IAAA,OACToD,KAAA,iBAASrC,IAAA,CAAC;QAAKZ,SAAA,EAAU;kBAAiCiD;uBAC3DrC,IAAA,CAAC;QAAEZ,SAAA,EAAU;;QAGdoD,YAAA,iBAAgBxC,IAAA,CAAC9B,KAAA,CAAMkG,QAAQ;gBAAEH;;;AAGxC","ignoreList":[]}
@@ -5,7 +5,7 @@ import type { Config, Field, FieldSchemaMap, JsonObject, PayloadComponent, Paylo
5
5
  import type { ServerEditorConfig } from '../lexical/config/types.js';
6
6
  import type { Transformer } from '../packages/@lexical/markdown/index.js';
7
7
  import type { AdapterProps } from '../types.js';
8
- import type { HTMLConverter } from './converters/html_deprecated/converter/types.js';
8
+ import type { HTMLConverter } from './converters/lexicalToHtml_deprecated/converter/types.js';
9
9
  import type { BaseClientFeatureProps } from './typesClient.js';
10
10
  export type PopulationPromise<T extends SerializedLexicalNode = SerializedLexicalNode> = (args: {
11
11
  context: RequestContext;
@@ -1 +1 @@
1
- {"version":3,"file":"typesServer.d.ts","sourceRoot":"","sources":["../../src/features/typesServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,EACV,KAAK,EACL,WAAW,EACX,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EACV,MAAM,EACN,KAAK,EACL,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,UAAU,EACV,cAAc,EACd,aAAa,EACb,aAAa,EACb,eAAe,EACf,eAAe,EACf,oBAAoB,EACrB,MAAM,SAAS,CAAA;AAEhB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iDAAiD,CAAA;AACpF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAE9D,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,qBAAqB,GAAG,qBAAqB,IAAI,CAAC,IAAI,EAAE;IAC9F,OAAO,EAAE,cAAc,CAAA;IACvB,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,OAAO,CAAA;IACd;;OAEG;IACH,wBAAwB,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAA;IAC/D,KAAK,EAAE,aAAa,CAAC,qBAAqB,EAAE,YAAY,CAAC,CAAA;IACzD;;OAEG;IACH,aAAa,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AAG,CAAC,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAA;QACxE,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,oBAAoB,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAA;QAC9E,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,sBAAsB,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAA;KACnF,CAAA,CAAC,yDAAyD;IAC3D,kDAAkD;IAClD,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,CAAA;CAChD,GAAG,QAAQ,CAAC,IAAI,CAAC,qBAAqB,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"typesServer.js","names":[],"sources":["../../src/features/typesServer.ts"],"sourcesContent":["import type { GenericLanguages, I18n, I18nClient } from '@payloadcms/translations'\nimport type { JSONSchema4 } from 'json-schema'\nimport type {\n Klass,\n LexicalNode,\n LexicalNodeReplacement,\n SerializedEditorState,\n SerializedLexicalNode,\n} from 'lexical'\nimport type {\n Config,\n Field,\n FieldSchemaMap,\n JsonObject,\n PayloadComponent,\n PayloadRequest,\n PopulateType,\n ReplaceAny,\n RequestContext,\n RichTextField,\n RichTextHooks,\n SanitizedConfig,\n ValidateOptions,\n ValidationFieldError,\n} from 'payload'\n\nimport type { ServerEditorConfig } from '../lexical/config/types.js'\nimport type { Transformer } from '../packages/@lexical/markdown/index.js'\nimport type { AdapterProps } from '../types.js'\nimport type { HTMLConverter } from './converters/html_deprecated/converter/types.js'\nimport type { BaseClientFeatureProps } from './typesClient.js'\n\nexport type PopulationPromise<T extends SerializedLexicalNode = SerializedLexicalNode> = (args: {\n context: RequestContext\n currentDepth: number\n depth: number\n draft: boolean\n /**\n * This maps all population promises to the node type\n */\n editorPopulationPromises: Map<string, Array<PopulationPromise>>\n field: RichTextField<SerializedEditorState, AdapterProps>\n /**\n * fieldPromises are used for things like field hooks. They will be awaited before awaiting populationPromises\n */\n fieldPromises: Promise<void>[]\n findMany: boolean\n flattenLocales: boolean\n node: T\n overrideAccess: boolean\n parentIsLocalized: boolean\n populationPromises: Promise<void>[]\n req: PayloadRequest\n showHiddenFields: boolean\n siblingDoc: JsonObject\n}) => void\n\nexport type NodeValidation<T extends SerializedLexicalNode = SerializedLexicalNode> = ({\n node,\n nodeValidations,\n validation,\n}: {\n node: T\n nodeValidations: Map<string, Array<NodeValidation>>\n validation: {\n options: ValidateOptions<unknown, unknown, RichTextField, SerializedEditorState>\n value: SerializedEditorState\n }\n}) => Promise<string | true> | string | true\n\nexport type FeatureProviderProviderServer<\n UnSanitizedServerFeatureProps = undefined,\n ServerFeatureProps = UnSanitizedServerFeatureProps,\n ClientFeatureProps = undefined,\n> = (\n props?: UnSanitizedServerFeatureProps,\n) => FeatureProviderServer<UnSanitizedServerFeatureProps, ServerFeatureProps, ClientFeatureProps>\n\nexport type FeatureProviderServer<\n UnSanitizedServerFeatureProps = undefined,\n ServerFeatureProps = UnSanitizedServerFeatureProps,\n ClientFeatureProps = undefined,\n> = {\n /** Keys of dependencies needed for this feature. These dependencies do not have to be loaded first, but they have to exist, otherwise an error will be thrown. */\n dependencies?: string[]\n /** Keys of priority dependencies needed for this feature. These dependencies have to be loaded first AND have to exist, otherwise an error will be thrown. They will be available in the `feature` property. */\n dependenciesPriority?: string[]\n /** Keys of soft-dependencies needed for this feature. These are optional. Payload will attempt to load them before this feature, but doesn't throw an error if that's not possible. */\n dependenciesSoft?: string[]\n\n /**\n * This is being called during the payload sanitization process\n */\n feature:\n | ((props: {\n config: SanitizedConfig\n /** unSanitizedEditorConfig.features, but mapped */\n featureProviderMap: ServerFeatureProviderMap\n isRoot?: boolean\n parentIsLocalized: boolean\n // other resolved features, which have been loaded before this one. All features declared in 'dependencies' should be available here\n resolvedFeatures: ResolvedServerFeatureMap\n // unSanitized EditorConfig,\n unSanitizedEditorConfig: ServerEditorConfig\n }) =>\n | Promise<ServerFeature<ServerFeatureProps, ClientFeatureProps>>\n | ServerFeature<ServerFeatureProps, ClientFeatureProps>)\n | ServerFeature<ServerFeatureProps, ClientFeatureProps>\n key: string\n /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */\n serverFeatureProps: UnSanitizedServerFeatureProps\n}\n\nexport type AfterReadNodeHookArgs<T extends SerializedLexicalNode> = {\n /**\n * Only available in `afterRead` hooks.\n */\n currentDepth: number\n /**\n * Only available in `afterRead` hooks.\n */\n depth: number\n draft: boolean\n fallbackLocale: string\n /**\n * Only available in `afterRead` field hooks.\n */\n fieldPromises: Promise<void>[]\n /** Boolean to denote if this hook is running against finding one, or finding many within the afterRead hook. */\n findMany: boolean\n flattenLocales: boolean\n /**\n * The requested locale.\n */\n locale: string\n overrideAccess: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n populateArg?: PopulateType\n /**\n * Only available in `afterRead` field hooks.\n */\n populationPromises: Promise<void>[]\n /**\n * Only available in `afterRead` hooks.\n */\n showHiddenFields: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n triggerAccessControl: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n triggerHooks: boolean\n}\n\nexport type AfterChangeNodeHookArgs<T extends SerializedLexicalNode> = {\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n previousNode: T\n}\nexport type BeforeValidateNodeHookArgs<T extends SerializedLexicalNode> = {\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n overrideAccess: boolean\n}\n\nexport type BeforeChangeNodeHookArgs<T extends SerializedLexicalNode> = {\n /**\n * Only available in `beforeChange` hooks.\n */\n errors: ValidationFieldError[]\n mergeLocaleActions: (() => Promise<void> | void)[]\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n /**\n * The original node with locales (not modified by any hooks).\n */\n originalNodeWithLocales?: T\n previousNode: T\n\n skipValidation: boolean\n}\n\nexport type BaseNodeHookArgs<T extends SerializedLexicalNode> = {\n context: RequestContext\n /** The value of the node. */\n node: T\n parentRichTextFieldPath: (number | string)[]\n parentRichTextFieldSchemaPath: string[]\n /** The payload request object. It is mocked for Local API operations. */\n req: PayloadRequest\n}\n\nexport type AfterReadNodeHook<T extends SerializedLexicalNode> = (\n args: AfterReadNodeHookArgs<T> & BaseNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type AfterChangeNodeHook<T extends SerializedLexicalNode> = (\n args: AfterChangeNodeHookArgs<T> & BaseNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type BeforeChangeNodeHook<T extends SerializedLexicalNode> = (\n args: BaseNodeHookArgs<T> & BeforeChangeNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type BeforeValidateNodeHook<T extends SerializedLexicalNode> = (\n args: BaseNodeHookArgs<T> & BeforeValidateNodeHookArgs<T>,\n) => Promise<T> | T\n\n// Define the node with hooks that use the node's exportJSON return type\nexport type NodeWithHooks<T extends LexicalNode = any> = {\n /**\n * Allows you to define how a node can be serialized into different formats. Currently, only supports html.\n * Markdown converters are defined in `markdownTransformers` and not here.\n *\n * @deprecated - will be removed in 4.0\n */\n converters?: {\n /**\n * @deprecated - will be removed in 4.0\n */\n html?: HTMLConverter<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n }\n /**\n * If a node includes sub-fields (e.g. block and link nodes), passing those subFields here will make payload\n * automatically populate, run hooks, and generate component import maps for them\n */\n getSubFields?: (args: {\n /**\n * Optional. If not provided, all possible sub-fields should be returned.\n */\n node?: ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>\n req?: PayloadRequest\n }) => Field[] | null\n /**\n * If a node includes sub-fields, the sub-fields data needs to be returned here, alongside `getSubFields` which returns their schema.\n */\n getSubFieldsData?: (args: {\n node: ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>\n req: PayloadRequest\n }) => JsonObject\n /**\n * Allows you to run population logic when a node's data was requested from graphQL.\n * While `getSubFields` and `getSubFieldsData` automatically handle populating sub-fields (since they run hooks on them), those are only populated in the Rest API.\n * This is because the Rest API hooks do not have access to the 'depth' property provided by graphQL.\n * In order for them to be populated correctly in graphQL, the population logic needs to be provided here.\n */\n graphQLPopulationPromises?: Array<\n PopulationPromise<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n >\n /**\n * Just like payload fields, you can provide hooks which are run for this specific node. These are called Node Hooks.\n */\n hooks?: {\n afterChange?: Array<AfterChangeNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n afterRead?: Array<AfterReadNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n beforeChange?: Array<BeforeChangeNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n beforeValidate?: Array<\n BeforeValidateNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n >\n }\n /**\n * The actual lexical node needs to be provided here. This also supports [lexical node replacements](https://lexical.dev/docs/concepts/node-replacement).\n */\n node: Klass<T> | LexicalNodeReplacement\n /**\n * This allows you to provide node validations, which are run when your document is being validated, alongside other payload fields.\n * You can use it to throw a validation error for a specific node in case its data is incorrect.\n */\n validations?: Array<NodeValidation<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n}\n\nexport type ServerFeature<ServerProps, ClientFeatureProps> = {\n ClientFeature?: PayloadComponent<never, BaseClientFeatureProps<ClientFeatureProps>>\n /**\n * This determines what props will be available on the Client.\n */\n clientFeatureProps?: ClientFeatureProps\n /**\n * Adds payload components to the importMap.\n *\n * If an object is provided, the imported components will automatically be made available to the client feature, keyed by the object's keys.\n */\n componentImports?:\n | {\n [key: string]: PayloadComponent\n }\n // @ts-expect-error - TODO: fix this\n | Config['admin']['importMap']['generators'][0]\n | PayloadComponent[]\n generatedTypes?: {\n modifyOutputSchema: (args: {\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' }\n config?: SanitizedConfig\n /**\n * Current schema which will be modified by this function.\n */\n currentSchema: JSONSchema4\n field: RichTextField<SerializedEditorState, AdapterProps>\n i18n?: I18n\n /**\n * Allows you to define new top-level interfaces that can be re-used in the output schema.\n */\n interfaceNameDefinitions: Map<string, JSONSchema4>\n isRequired: boolean\n }) => JSONSchema4\n }\n generateSchemaMap?: (args: {\n config: SanitizedConfig\n field: RichTextField\n i18n: I18nClient\n props: ServerProps\n schemaMap: FieldSchemaMap\n schemaPath: string\n }) => FieldSchemaMap | null\n hooks?: RichTextHooks\n /**\n * Here you can provide i18n translations for your feature. These will only be available on the server and client.\n *\n * Translations here are automatically scoped to `lexical.featureKey.yourKey`\n *\n * @Example\n * ```ts\n * i18n: {\n * en: {\n * label: 'Horizontal Rule',\n * },\n * de: {\n * label: 'Trennlinie',\n * },\n * }\n * ```\n * In order to access these translations, you would use `i18n.t('lexical:horizontalRule:label')`.\n */\n i18n?: Partial<GenericLanguages>\n markdownTransformers?: (\n | ((props: { allNodes: Array<NodeWithHooks>; allTransformers: Transformer[] }) => Transformer)\n | Transformer\n )[]\n nodes?: Array<NodeWithHooks>\n\n /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */\n sanitizedServerFeatureProps?: ServerProps\n}\n\nexport type ResolvedServerFeature<ServerProps, ClientFeatureProps> = {\n order: number\n} & Required<\n Pick<\n FeatureProviderServer<ServerProps, ClientFeatureProps>,\n 'dependencies' | 'dependenciesPriority' | 'dependenciesSoft' | 'key'\n >\n> &\n ServerFeature<ServerProps, ClientFeatureProps>\n\nexport type ResolvedServerFeatureMap = Map<string, ResolvedServerFeature<any, any>>\n\nexport type ServerFeatureProviderMap = Map<string, FeatureProviderServer<any, any, any>>\n\nexport type SanitizedServerFeatures = {\n /** The node types mapped to their converters */\n converters: {\n html: HTMLConverter[]\n }\n /** The keys of all enabled features */\n enabledFeatures: string[]\n generatedTypes: {\n modifyOutputSchemas: Array<\n (args: {\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' }\n config?: SanitizedConfig\n /**\n * Current schema which will be modified by this function.\n */\n currentSchema: JSONSchema4\n field: RichTextField<SerializedEditorState, AdapterProps>\n i18n?: I18n\n /**\n * Allows you to define new top-level interfaces that can be re-used in the output schema.\n */\n interfaceNameDefinitions: Map<string, JSONSchema4>\n isRequired: boolean\n }) => JSONSchema4\n >\n }\n /** The node types mapped to their hooks */\n\n getSubFields?: Map<\n string,\n (args: { node: SerializedLexicalNode; req: PayloadRequest }) => Field[] | null\n >\n getSubFieldsData?: Map<\n string,\n (args: { node: SerializedLexicalNode; req: PayloadRequest }) => JsonObject\n >\n graphQLPopulationPromises: Map<string, Array<PopulationPromise>>\n hooks: RichTextHooks\n markdownTransformers: Transformer[]\n nodeHooks?: {\n afterChange?: Map<string, Array<AfterChangeNodeHook<SerializedLexicalNode>>>\n afterRead?: Map<string, Array<AfterReadNodeHook<SerializedLexicalNode>>>\n beforeChange?: Map<string, Array<BeforeChangeNodeHook<SerializedLexicalNode>>>\n beforeValidate?: Map<string, Array<BeforeValidateNodeHook<SerializedLexicalNode>>>\n } /** The node types mapped to their populationPromises */\n /** The node types mapped to their validations */\n validations: Map<string, Array<NodeValidation>>\n} & Required<Pick<ResolvedServerFeature<any, any>, 'i18n' | 'nodes'>>\n"],"mappings":"AAgXA","ignoreList":[]}
1
+ {"version":3,"file":"typesServer.js","names":[],"sources":["../../src/features/typesServer.ts"],"sourcesContent":["import type { GenericLanguages, I18n, I18nClient } from '@payloadcms/translations'\nimport type { JSONSchema4 } from 'json-schema'\nimport type {\n Klass,\n LexicalNode,\n LexicalNodeReplacement,\n SerializedEditorState,\n SerializedLexicalNode,\n} from 'lexical'\nimport type {\n Config,\n Field,\n FieldSchemaMap,\n JsonObject,\n PayloadComponent,\n PayloadRequest,\n PopulateType,\n ReplaceAny,\n RequestContext,\n RichTextField,\n RichTextHooks,\n SanitizedConfig,\n ValidateOptions,\n ValidationFieldError,\n} from 'payload'\n\nimport type { ServerEditorConfig } from '../lexical/config/types.js'\nimport type { Transformer } from '../packages/@lexical/markdown/index.js'\nimport type { AdapterProps } from '../types.js'\nimport type { HTMLConverter } from './converters/lexicalToHtml_deprecated/converter/types.js'\nimport type { BaseClientFeatureProps } from './typesClient.js'\n\nexport type PopulationPromise<T extends SerializedLexicalNode = SerializedLexicalNode> = (args: {\n context: RequestContext\n currentDepth: number\n depth: number\n draft: boolean\n /**\n * This maps all population promises to the node type\n */\n editorPopulationPromises: Map<string, Array<PopulationPromise>>\n field: RichTextField<SerializedEditorState, AdapterProps>\n /**\n * fieldPromises are used for things like field hooks. They will be awaited before awaiting populationPromises\n */\n fieldPromises: Promise<void>[]\n findMany: boolean\n flattenLocales: boolean\n node: T\n overrideAccess: boolean\n parentIsLocalized: boolean\n populationPromises: Promise<void>[]\n req: PayloadRequest\n showHiddenFields: boolean\n siblingDoc: JsonObject\n}) => void\n\nexport type NodeValidation<T extends SerializedLexicalNode = SerializedLexicalNode> = ({\n node,\n nodeValidations,\n validation,\n}: {\n node: T\n nodeValidations: Map<string, Array<NodeValidation>>\n validation: {\n options: ValidateOptions<unknown, unknown, RichTextField, SerializedEditorState>\n value: SerializedEditorState\n }\n}) => Promise<string | true> | string | true\n\nexport type FeatureProviderProviderServer<\n UnSanitizedServerFeatureProps = undefined,\n ServerFeatureProps = UnSanitizedServerFeatureProps,\n ClientFeatureProps = undefined,\n> = (\n props?: UnSanitizedServerFeatureProps,\n) => FeatureProviderServer<UnSanitizedServerFeatureProps, ServerFeatureProps, ClientFeatureProps>\n\nexport type FeatureProviderServer<\n UnSanitizedServerFeatureProps = undefined,\n ServerFeatureProps = UnSanitizedServerFeatureProps,\n ClientFeatureProps = undefined,\n> = {\n /** Keys of dependencies needed for this feature. These dependencies do not have to be loaded first, but they have to exist, otherwise an error will be thrown. */\n dependencies?: string[]\n /** Keys of priority dependencies needed for this feature. These dependencies have to be loaded first AND have to exist, otherwise an error will be thrown. They will be available in the `feature` property. */\n dependenciesPriority?: string[]\n /** Keys of soft-dependencies needed for this feature. These are optional. Payload will attempt to load them before this feature, but doesn't throw an error if that's not possible. */\n dependenciesSoft?: string[]\n\n /**\n * This is being called during the payload sanitization process\n */\n feature:\n | ((props: {\n config: SanitizedConfig\n /** unSanitizedEditorConfig.features, but mapped */\n featureProviderMap: ServerFeatureProviderMap\n isRoot?: boolean\n parentIsLocalized: boolean\n // other resolved features, which have been loaded before this one. All features declared in 'dependencies' should be available here\n resolvedFeatures: ResolvedServerFeatureMap\n // unSanitized EditorConfig,\n unSanitizedEditorConfig: ServerEditorConfig\n }) =>\n | Promise<ServerFeature<ServerFeatureProps, ClientFeatureProps>>\n | ServerFeature<ServerFeatureProps, ClientFeatureProps>)\n | ServerFeature<ServerFeatureProps, ClientFeatureProps>\n key: string\n /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */\n serverFeatureProps: UnSanitizedServerFeatureProps\n}\n\nexport type AfterReadNodeHookArgs<T extends SerializedLexicalNode> = {\n /**\n * Only available in `afterRead` hooks.\n */\n currentDepth: number\n /**\n * Only available in `afterRead` hooks.\n */\n depth: number\n draft: boolean\n fallbackLocale: string\n /**\n * Only available in `afterRead` field hooks.\n */\n fieldPromises: Promise<void>[]\n /** Boolean to denote if this hook is running against finding one, or finding many within the afterRead hook. */\n findMany: boolean\n flattenLocales: boolean\n /**\n * The requested locale.\n */\n locale: string\n overrideAccess: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n populateArg?: PopulateType\n /**\n * Only available in `afterRead` field hooks.\n */\n populationPromises: Promise<void>[]\n /**\n * Only available in `afterRead` hooks.\n */\n showHiddenFields: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n triggerAccessControl: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n triggerHooks: boolean\n}\n\nexport type AfterChangeNodeHookArgs<T extends SerializedLexicalNode> = {\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n previousNode: T\n}\nexport type BeforeValidateNodeHookArgs<T extends SerializedLexicalNode> = {\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n overrideAccess: boolean\n}\n\nexport type BeforeChangeNodeHookArgs<T extends SerializedLexicalNode> = {\n /**\n * Only available in `beforeChange` hooks.\n */\n errors: ValidationFieldError[]\n mergeLocaleActions: (() => Promise<void> | void)[]\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n /**\n * The original node with locales (not modified by any hooks).\n */\n originalNodeWithLocales?: T\n previousNode: T\n\n skipValidation: boolean\n}\n\nexport type BaseNodeHookArgs<T extends SerializedLexicalNode> = {\n context: RequestContext\n /** The value of the node. */\n node: T\n parentRichTextFieldPath: (number | string)[]\n parentRichTextFieldSchemaPath: string[]\n /** The payload request object. It is mocked for Local API operations. */\n req: PayloadRequest\n}\n\nexport type AfterReadNodeHook<T extends SerializedLexicalNode> = (\n args: AfterReadNodeHookArgs<T> & BaseNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type AfterChangeNodeHook<T extends SerializedLexicalNode> = (\n args: AfterChangeNodeHookArgs<T> & BaseNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type BeforeChangeNodeHook<T extends SerializedLexicalNode> = (\n args: BaseNodeHookArgs<T> & BeforeChangeNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type BeforeValidateNodeHook<T extends SerializedLexicalNode> = (\n args: BaseNodeHookArgs<T> & BeforeValidateNodeHookArgs<T>,\n) => Promise<T> | T\n\n// Define the node with hooks that use the node's exportJSON return type\nexport type NodeWithHooks<T extends LexicalNode = any> = {\n /**\n * Allows you to define how a node can be serialized into different formats. Currently, only supports html.\n * Markdown converters are defined in `markdownTransformers` and not here.\n *\n * @deprecated - will be removed in 4.0\n */\n converters?: {\n /**\n * @deprecated - will be removed in 4.0\n */\n html?: HTMLConverter<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n }\n /**\n * If a node includes sub-fields (e.g. block and link nodes), passing those subFields here will make payload\n * automatically populate, run hooks, and generate component import maps for them\n */\n getSubFields?: (args: {\n /**\n * Optional. If not provided, all possible sub-fields should be returned.\n */\n node?: ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>\n req?: PayloadRequest\n }) => Field[] | null\n /**\n * If a node includes sub-fields, the sub-fields data needs to be returned here, alongside `getSubFields` which returns their schema.\n */\n getSubFieldsData?: (args: {\n node: ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>\n req: PayloadRequest\n }) => JsonObject\n /**\n * Allows you to run population logic when a node's data was requested from graphQL.\n * While `getSubFields` and `getSubFieldsData` automatically handle populating sub-fields (since they run hooks on them), those are only populated in the Rest API.\n * This is because the Rest API hooks do not have access to the 'depth' property provided by graphQL.\n * In order for them to be populated correctly in graphQL, the population logic needs to be provided here.\n */\n graphQLPopulationPromises?: Array<\n PopulationPromise<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n >\n /**\n * Just like payload fields, you can provide hooks which are run for this specific node. These are called Node Hooks.\n */\n hooks?: {\n afterChange?: Array<AfterChangeNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n afterRead?: Array<AfterReadNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n beforeChange?: Array<BeforeChangeNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n beforeValidate?: Array<\n BeforeValidateNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n >\n }\n /**\n * The actual lexical node needs to be provided here. This also supports [lexical node replacements](https://lexical.dev/docs/concepts/node-replacement).\n */\n node: Klass<T> | LexicalNodeReplacement\n /**\n * This allows you to provide node validations, which are run when your document is being validated, alongside other payload fields.\n * You can use it to throw a validation error for a specific node in case its data is incorrect.\n */\n validations?: Array<NodeValidation<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n}\n\nexport type ServerFeature<ServerProps, ClientFeatureProps> = {\n ClientFeature?: PayloadComponent<never, BaseClientFeatureProps<ClientFeatureProps>>\n /**\n * This determines what props will be available on the Client.\n */\n clientFeatureProps?: ClientFeatureProps\n /**\n * Adds payload components to the importMap.\n *\n * If an object is provided, the imported components will automatically be made available to the client feature, keyed by the object's keys.\n */\n componentImports?:\n | {\n [key: string]: PayloadComponent\n }\n // @ts-expect-error - TODO: fix this\n | Config['admin']['importMap']['generators'][0]\n | PayloadComponent[]\n generatedTypes?: {\n modifyOutputSchema: (args: {\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' }\n config?: SanitizedConfig\n /**\n * Current schema which will be modified by this function.\n */\n currentSchema: JSONSchema4\n field: RichTextField<SerializedEditorState, AdapterProps>\n i18n?: I18n\n /**\n * Allows you to define new top-level interfaces that can be re-used in the output schema.\n */\n interfaceNameDefinitions: Map<string, JSONSchema4>\n isRequired: boolean\n }) => JSONSchema4\n }\n generateSchemaMap?: (args: {\n config: SanitizedConfig\n field: RichTextField\n i18n: I18nClient\n props: ServerProps\n schemaMap: FieldSchemaMap\n schemaPath: string\n }) => FieldSchemaMap | null\n hooks?: RichTextHooks\n /**\n * Here you can provide i18n translations for your feature. These will only be available on the server and client.\n *\n * Translations here are automatically scoped to `lexical.featureKey.yourKey`\n *\n * @Example\n * ```ts\n * i18n: {\n * en: {\n * label: 'Horizontal Rule',\n * },\n * de: {\n * label: 'Trennlinie',\n * },\n * }\n * ```\n * In order to access these translations, you would use `i18n.t('lexical:horizontalRule:label')`.\n */\n i18n?: Partial<GenericLanguages>\n markdownTransformers?: (\n | ((props: { allNodes: Array<NodeWithHooks>; allTransformers: Transformer[] }) => Transformer)\n | Transformer\n )[]\n nodes?: Array<NodeWithHooks>\n\n /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */\n sanitizedServerFeatureProps?: ServerProps\n}\n\nexport type ResolvedServerFeature<ServerProps, ClientFeatureProps> = {\n order: number\n} & Required<\n Pick<\n FeatureProviderServer<ServerProps, ClientFeatureProps>,\n 'dependencies' | 'dependenciesPriority' | 'dependenciesSoft' | 'key'\n >\n> &\n ServerFeature<ServerProps, ClientFeatureProps>\n\nexport type ResolvedServerFeatureMap = Map<string, ResolvedServerFeature<any, any>>\n\nexport type ServerFeatureProviderMap = Map<string, FeatureProviderServer<any, any, any>>\n\nexport type SanitizedServerFeatures = {\n /** The node types mapped to their converters */\n converters: {\n html: HTMLConverter[]\n }\n /** The keys of all enabled features */\n enabledFeatures: string[]\n generatedTypes: {\n modifyOutputSchemas: Array<\n (args: {\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' }\n config?: SanitizedConfig\n /**\n * Current schema which will be modified by this function.\n */\n currentSchema: JSONSchema4\n field: RichTextField<SerializedEditorState, AdapterProps>\n i18n?: I18n\n /**\n * Allows you to define new top-level interfaces that can be re-used in the output schema.\n */\n interfaceNameDefinitions: Map<string, JSONSchema4>\n isRequired: boolean\n }) => JSONSchema4\n >\n }\n /** The node types mapped to their hooks */\n\n getSubFields?: Map<\n string,\n (args: { node: SerializedLexicalNode; req: PayloadRequest }) => Field[] | null\n >\n getSubFieldsData?: Map<\n string,\n (args: { node: SerializedLexicalNode; req: PayloadRequest }) => JsonObject\n >\n graphQLPopulationPromises: Map<string, Array<PopulationPromise>>\n hooks: RichTextHooks\n markdownTransformers: Transformer[]\n nodeHooks?: {\n afterChange?: Map<string, Array<AfterChangeNodeHook<SerializedLexicalNode>>>\n afterRead?: Map<string, Array<AfterReadNodeHook<SerializedLexicalNode>>>\n beforeChange?: Map<string, Array<BeforeChangeNodeHook<SerializedLexicalNode>>>\n beforeValidate?: Map<string, Array<BeforeValidateNodeHook<SerializedLexicalNode>>>\n } /** The node types mapped to their populationPromises */\n /** The node types mapped to their validations */\n validations: Map<string, Array<NodeValidation>>\n} & Required<Pick<ResolvedServerFeature<any, any>, 'i18n' | 'nodes'>>\n"],"mappings":"AAgXA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../src/field/Field.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAoD,MAAM,OAAO,CAAA;AAGxE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAA;AAE7E,OAAO,mCAAmC,CAAA;AAC1C,OAAO,eAAe,CAAA;AACtB,OAAO,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAM5D,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAC/B;IACE,QAAQ,CAAC,YAAY,EAAE,2BAA2B,CAAA;CACnD,GAAG,yBAAyB,CA0J9B,CAAA;AAaD,eAAO,MAAM,QAAQ,EAAE,OAAO,iBAAqC,CAAA"}
1
+ {"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../src/field/Field.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAoD,MAAM,OAAO,CAAA;AAGxE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAA;AAE7E,OAAO,mCAAmC,CAAA;AAC1C,OAAO,eAAe,CAAA;AACtB,OAAO,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAM5D,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAC/B;IACE,QAAQ,CAAC,YAAY,EAAE,2BAA2B,CAAA;CACnD,GAAG,yBAAyB,CAyJ9B,CAAA;AAaD,eAAO,MAAM,QAAQ,EAAE,OAAO,iBAAqC,CAAA"}
@@ -52,8 +52,7 @@ const RichTextComponent = props => {
52
52
  Error,
53
53
  Label
54
54
  } = {},
55
- formInitializing,
56
- formProcessing,
55
+ disabled: disabledFromField,
57
56
  initialValue,
58
57
  setValue,
59
58
  showError,
@@ -62,7 +61,7 @@ const RichTextComponent = props => {
62
61
  path,
63
62
  validate: memoizedValidate
64
63
  });
65
- const disabled = readOnlyFromProps || formProcessing || formInitializing;
64
+ const disabled = readOnlyFromProps || disabledFromField;
66
65
  const [isSmallWidthViewport, setIsSmallWidthViewport] = useState(false);
67
66
  const [rerenderProviderKey, setRerenderProviderKey] = useState();
68
67
  const prevInitialValueRef = React.useRef(initialValue);