@payloadcms/richtext-lexical 3.0.0-canary.3bd3027 → 3.0.0-canary.483db21

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 (734) hide show
  1. package/dist/cell/index.d.ts +2 -2
  2. package/dist/cell/index.d.ts.map +1 -1
  3. package/dist/cell/index.js +2 -2
  4. package/dist/cell/index.js.map +1 -1
  5. package/dist/exports/client/Field-5GGTGCKC.js +2 -0
  6. package/dist/exports/client/Field-5GGTGCKC.js.map +7 -0
  7. package/dist/exports/client/RelationshipComponent-ZR2OCBGL.js +2 -0
  8. package/dist/exports/client/RelationshipComponent-ZR2OCBGL.js.map +7 -0
  9. package/dist/exports/client/bundled.css +1 -1
  10. package/dist/exports/client/{chunk-OSR74ZNW.js → chunk-6QXGZYUK.js} +2 -2
  11. package/dist/exports/client/chunk-6QXGZYUK.js.map +7 -0
  12. package/dist/exports/client/chunk-EBB2CEB6.js +2 -0
  13. package/dist/exports/client/chunk-EBB2CEB6.js.map +7 -0
  14. package/dist/exports/client/chunk-IPCJ5EVK.js +2 -0
  15. package/dist/exports/client/chunk-IPCJ5EVK.js.map +7 -0
  16. package/dist/exports/client/{chunk-3K3B6PJM.js → chunk-IWZVO3AI.js} +2 -2
  17. package/dist/exports/client/chunk-IWZVO3AI.js.map +7 -0
  18. package/dist/exports/client/{chunk-MLIITFAS.js → chunk-Q5DYR7MH.js} +2 -2
  19. package/dist/exports/client/chunk-Q5DYR7MH.js.map +7 -0
  20. package/dist/exports/client/chunk-VUVXZJJR.js +2 -0
  21. package/dist/exports/client/chunk-VUVXZJJR.js.map +7 -0
  22. package/dist/exports/client/component-D4GWDXK5.js +2 -0
  23. package/dist/exports/client/component-D4GWDXK5.js.map +7 -0
  24. package/dist/exports/client/component-KA7FDRMA.js +2 -0
  25. package/dist/exports/client/component-KA7FDRMA.js.map +7 -0
  26. package/dist/exports/client/{component-QWIGEOVD.js → component-VM36FRT2.js} +2 -2
  27. package/dist/exports/client/componentInline-6EKPZSCV.js +2 -0
  28. package/dist/exports/client/componentInline-6EKPZSCV.js.map +7 -0
  29. package/dist/exports/client/index.d.ts +17 -6
  30. package/dist/exports/client/index.d.ts.map +1 -1
  31. package/dist/exports/client/index.js +8 -6
  32. package/dist/exports/client/index.js.map +4 -4
  33. package/dist/features/align/feature.client.js.map +1 -1
  34. package/dist/features/align/feature.server.d.ts +1 -1
  35. package/dist/features/align/feature.server.d.ts.map +1 -1
  36. package/dist/features/align/feature.server.js.map +1 -1
  37. package/dist/features/align/i18n.js.map +1 -1
  38. package/dist/features/align/toolbarAlignGroup.js.map +1 -1
  39. package/dist/features/blockquote/feature.client.js.map +1 -1
  40. package/dist/features/blockquote/feature.server.d.ts +6 -1
  41. package/dist/features/blockquote/feature.server.d.ts.map +1 -1
  42. package/dist/features/blockquote/feature.server.js +5 -2
  43. package/dist/features/blockquote/feature.server.js.map +1 -1
  44. package/dist/features/blockquote/i18n.js.map +1 -1
  45. package/dist/features/blockquote/markdownTransformer.js.map +1 -1
  46. package/dist/features/blocks/component/BlockContent.d.ts +5 -5
  47. package/dist/features/blocks/component/BlockContent.d.ts.map +1 -1
  48. package/dist/features/blocks/component/BlockContent.js +7 -4
  49. package/dist/features/blocks/component/BlockContent.js.map +1 -1
  50. package/dist/features/blocks/component/FormSavePlugin.js +1 -1
  51. package/dist/features/blocks/component/FormSavePlugin.js.map +1 -1
  52. package/dist/features/blocks/component/index.d.ts +0 -4
  53. package/dist/features/blocks/component/index.d.ts.map +1 -1
  54. package/dist/features/blocks/component/index.js +10 -6
  55. package/dist/features/blocks/component/index.js.map +1 -1
  56. package/dist/features/blocks/component/removeEmptyArrayValues.js.map +1 -1
  57. package/dist/features/blocks/componentInline/index.d.ts +10 -0
  58. package/dist/features/blocks/componentInline/index.d.ts.map +1 -0
  59. package/dist/features/blocks/componentInline/index.js +133 -0
  60. package/dist/features/blocks/componentInline/index.js.map +1 -0
  61. package/dist/features/blocks/feature.client.d.ts +6 -2
  62. package/dist/features/blocks/feature.client.d.ts.map +1 -1
  63. package/dist/features/blocks/feature.client.js +70 -8
  64. package/dist/features/blocks/feature.client.js.map +1 -1
  65. package/dist/features/blocks/feature.server.d.ts +3 -2
  66. package/dist/features/blocks/feature.server.d.ts.map +1 -1
  67. package/dist/features/blocks/feature.server.js +100 -45
  68. package/dist/features/blocks/feature.server.js.map +1 -1
  69. package/dist/features/blocks/graphQLPopulationPromise.d.ts +4 -3
  70. package/dist/features/blocks/graphQLPopulationPromise.d.ts.map +1 -1
  71. package/dist/features/blocks/graphQLPopulationPromise.js +2 -2
  72. package/dist/features/blocks/graphQLPopulationPromise.js.map +1 -1
  73. package/dist/features/blocks/i18n.d.ts.map +1 -1
  74. package/dist/features/blocks/i18n.js +192 -0
  75. package/dist/features/blocks/i18n.js.map +1 -1
  76. package/dist/features/blocks/nodes/BlocksNode.d.ts +7 -5
  77. package/dist/features/blocks/nodes/BlocksNode.d.ts.map +1 -1
  78. package/dist/features/blocks/nodes/BlocksNode.js +3 -3
  79. package/dist/features/blocks/nodes/BlocksNode.js.map +1 -1
  80. package/dist/features/blocks/nodes/InlineBlocksNode.d.ts +39 -0
  81. package/dist/features/blocks/nodes/InlineBlocksNode.d.ts.map +1 -0
  82. package/dist/features/blocks/nodes/InlineBlocksNode.js +94 -0
  83. package/dist/features/blocks/nodes/InlineBlocksNode.js.map +1 -0
  84. package/dist/features/blocks/plugin/commands.d.ts +5 -0
  85. package/dist/features/blocks/plugin/commands.d.ts.map +1 -1
  86. package/dist/features/blocks/plugin/commands.js +2 -0
  87. package/dist/features/blocks/plugin/commands.js.map +1 -1
  88. package/dist/features/blocks/plugin/index.d.ts +1 -1
  89. package/dist/features/blocks/plugin/index.d.ts.map +1 -1
  90. package/dist/features/blocks/plugin/index.js +76 -7
  91. package/dist/features/blocks/plugin/index.js.map +1 -1
  92. package/dist/features/blocks/validate.d.ts +4 -3
  93. package/dist/features/blocks/validate.d.ts.map +1 -1
  94. package/dist/features/blocks/validate.js +4 -3
  95. package/dist/features/blocks/validate.js.map +1 -1
  96. package/dist/features/converters/html/converter/converters/linebreak.js.map +1 -1
  97. package/dist/features/converters/html/converter/converters/paragraph.d.ts.map +1 -1
  98. package/dist/features/converters/html/converter/converters/paragraph.js +5 -2
  99. package/dist/features/converters/html/converter/converters/paragraph.js.map +1 -1
  100. package/dist/features/converters/html/converter/converters/text.js.map +1 -1
  101. package/dist/features/converters/html/converter/defaultConverters.js.map +1 -1
  102. package/dist/features/converters/html/converter/index.d.ts +8 -2
  103. package/dist/features/converters/html/converter/index.d.ts.map +1 -1
  104. package/dist/features/converters/html/converter/index.js +14 -5
  105. package/dist/features/converters/html/converter/index.js.map +1 -1
  106. package/dist/features/converters/html/converter/types.d.ts +7 -4
  107. package/dist/features/converters/html/converter/types.d.ts.map +1 -1
  108. package/dist/features/converters/html/converter/types.js.map +1 -1
  109. package/dist/features/converters/html/feature.server.d.ts +3 -3
  110. package/dist/features/converters/html/feature.server.d.ts.map +1 -1
  111. package/dist/features/converters/html/feature.server.js.map +1 -1
  112. package/dist/features/converters/html/field/index.d.ts.map +1 -1
  113. package/dist/features/converters/html/field/index.js +5 -2
  114. package/dist/features/converters/html/field/index.js.map +1 -1
  115. package/dist/features/createClientComponent.d.ts +2 -1
  116. package/dist/features/createClientComponent.d.ts.map +1 -1
  117. package/dist/features/createClientComponent.js.map +1 -1
  118. package/dist/features/createFeaturePropComponent.js +1 -1
  119. package/dist/features/createFeaturePropComponent.js.map +1 -1
  120. package/dist/features/debug/testRecorder/feature.client.js.map +1 -1
  121. package/dist/features/debug/testRecorder/feature.server.d.ts +1 -1
  122. package/dist/features/debug/testRecorder/feature.server.d.ts.map +1 -1
  123. package/dist/features/debug/testRecorder/feature.server.js.map +1 -1
  124. package/dist/features/debug/testRecorder/plugin/index.d.ts +1 -1
  125. package/dist/features/debug/testRecorder/plugin/index.d.ts.map +1 -1
  126. package/dist/features/debug/testRecorder/plugin/index.js.map +1 -1
  127. package/dist/features/debug/treeView/feature.client.js.map +1 -1
  128. package/dist/features/debug/treeView/feature.server.d.ts +1 -1
  129. package/dist/features/debug/treeView/feature.server.d.ts.map +1 -1
  130. package/dist/features/debug/treeView/feature.server.js.map +1 -1
  131. package/dist/features/debug/treeView/plugin/index.d.ts +1 -1
  132. package/dist/features/debug/treeView/plugin/index.d.ts.map +1 -1
  133. package/dist/features/debug/treeView/plugin/index.js.map +1 -1
  134. package/dist/features/experimental_table/feature.client.d.ts +2 -0
  135. package/dist/features/experimental_table/feature.client.d.ts.map +1 -0
  136. package/dist/features/experimental_table/feature.client.js +71 -0
  137. package/dist/features/experimental_table/feature.client.js.map +1 -0
  138. package/dist/features/experimental_table/feature.server.d.ts +13 -0
  139. package/dist/features/experimental_table/feature.server.d.ts.map +1 -0
  140. package/dist/features/experimental_table/feature.server.js +125 -0
  141. package/dist/features/experimental_table/feature.server.js.map +1 -0
  142. package/dist/features/experimental_table/plugins/TableActionMenuPlugin/index.d.ts +4 -0
  143. package/dist/features/experimental_table/plugins/TableActionMenuPlugin/index.d.ts.map +1 -0
  144. package/dist/features/experimental_table/plugins/TableActionMenuPlugin/index.js +604 -0
  145. package/dist/features/experimental_table/plugins/TableActionMenuPlugin/index.js.map +1 -0
  146. package/dist/features/experimental_table/plugins/TableCellResizerPlugin/index.d.ts +3 -0
  147. package/dist/features/experimental_table/plugins/TableCellResizerPlugin/index.d.ts.map +1 -0
  148. package/dist/features/experimental_table/plugins/TableCellResizerPlugin/index.js +327 -0
  149. package/dist/features/experimental_table/plugins/TableCellResizerPlugin/index.js.map +1 -0
  150. package/dist/features/experimental_table/plugins/TableHoverActionsPlugin/index.d.ts +12 -0
  151. package/dist/features/experimental_table/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -0
  152. package/dist/features/experimental_table/plugins/TableHoverActionsPlugin/index.js +181 -0
  153. package/dist/features/experimental_table/plugins/TableHoverActionsPlugin/index.js.map +1 -0
  154. package/dist/features/experimental_table/plugins/TablePlugin/index.d.ts +24 -0
  155. package/dist/features/experimental_table/plugins/TablePlugin/index.d.ts.map +1 -0
  156. package/dist/features/experimental_table/plugins/TablePlugin/index.js +98 -0
  157. package/dist/features/experimental_table/plugins/TablePlugin/index.js.map +1 -0
  158. package/dist/features/experimental_table/utils/debounce.d.ts +61 -0
  159. package/dist/features/experimental_table/utils/debounce.d.ts.map +1 -0
  160. package/dist/features/experimental_table/utils/debounce.js +202 -0
  161. package/dist/features/experimental_table/utils/debounce.js.map +1 -0
  162. package/dist/features/experimental_table/utils/useDebounce.d.ts +6 -0
  163. package/dist/features/experimental_table/utils/useDebounce.d.ts.map +1 -0
  164. package/dist/features/experimental_table/utils/useDebounce.js +18 -0
  165. package/dist/features/experimental_table/utils/useDebounce.js.map +1 -0
  166. package/dist/features/format/bold/feature.client.js.map +1 -1
  167. package/dist/features/format/bold/feature.server.d.ts +1 -1
  168. package/dist/features/format/bold/feature.server.d.ts.map +1 -1
  169. package/dist/features/format/bold/feature.server.js.map +1 -1
  170. package/dist/features/format/bold/markdownTransformers.js.map +1 -1
  171. package/dist/features/format/inlineCode/feature.client.js.map +1 -1
  172. package/dist/features/format/inlineCode/feature.server.d.ts +1 -1
  173. package/dist/features/format/inlineCode/feature.server.d.ts.map +1 -1
  174. package/dist/features/format/inlineCode/feature.server.js.map +1 -1
  175. package/dist/features/format/inlineCode/markdownTransformers.js.map +1 -1
  176. package/dist/features/format/italic/feature.client.js.map +1 -1
  177. package/dist/features/format/italic/feature.server.d.ts +1 -1
  178. package/dist/features/format/italic/feature.server.d.ts.map +1 -1
  179. package/dist/features/format/italic/feature.server.js.map +1 -1
  180. package/dist/features/format/italic/markdownTransformers.js.map +1 -1
  181. package/dist/features/format/shared/toolbarFormatGroup.js.map +1 -1
  182. package/dist/features/format/strikethrough/feature.client.js.map +1 -1
  183. package/dist/features/format/strikethrough/feature.server.d.ts +1 -1
  184. package/dist/features/format/strikethrough/feature.server.d.ts.map +1 -1
  185. package/dist/features/format/strikethrough/feature.server.js.map +1 -1
  186. package/dist/features/format/strikethrough/markdownTransformers.js.map +1 -1
  187. package/dist/features/format/subscript/feature.client.js.map +1 -1
  188. package/dist/features/format/subscript/feature.server.d.ts +1 -1
  189. package/dist/features/format/subscript/feature.server.d.ts.map +1 -1
  190. package/dist/features/format/subscript/feature.server.js.map +1 -1
  191. package/dist/features/format/superscript/feature.client.js.map +1 -1
  192. package/dist/features/format/superscript/feature.server.d.ts +1 -1
  193. package/dist/features/format/superscript/feature.server.d.ts.map +1 -1
  194. package/dist/features/format/superscript/feature.server.js.map +1 -1
  195. package/dist/features/format/underline/feature.client.js.map +1 -1
  196. package/dist/features/format/underline/feature.server.d.ts +1 -1
  197. package/dist/features/format/underline/feature.server.d.ts.map +1 -1
  198. package/dist/features/format/underline/feature.server.js.map +1 -1
  199. package/dist/features/heading/feature.client.js.map +1 -1
  200. package/dist/features/heading/feature.server.d.ts +6 -2
  201. package/dist/features/heading/feature.server.d.ts.map +1 -1
  202. package/dist/features/heading/feature.server.js +5 -2
  203. package/dist/features/heading/feature.server.js.map +1 -1
  204. package/dist/features/heading/i18n.js +2 -2
  205. package/dist/features/heading/i18n.js.map +1 -1
  206. package/dist/features/heading/markdownTransformer.js.map +1 -1
  207. package/dist/features/horizontalRule/component/index.js.map +1 -1
  208. package/dist/features/horizontalRule/feature.client.js.map +1 -1
  209. package/dist/features/horizontalRule/feature.server.d.ts +1 -1
  210. package/dist/features/horizontalRule/feature.server.d.ts.map +1 -1
  211. package/dist/features/horizontalRule/feature.server.js.map +1 -1
  212. package/dist/features/horizontalRule/i18n.js.map +1 -1
  213. package/dist/features/horizontalRule/markdownTransformer.js.map +1 -1
  214. package/dist/features/horizontalRule/nodes/HorizontalRuleNode.d.ts +5 -2
  215. package/dist/features/horizontalRule/nodes/HorizontalRuleNode.d.ts.map +1 -1
  216. package/dist/features/horizontalRule/nodes/HorizontalRuleNode.js.map +1 -1
  217. package/dist/features/horizontalRule/plugin/index.d.ts +1 -1
  218. package/dist/features/horizontalRule/plugin/index.d.ts.map +1 -1
  219. package/dist/features/horizontalRule/plugin/index.js.map +1 -1
  220. package/dist/features/indent/feature.client.js.map +1 -1
  221. package/dist/features/indent/feature.server.d.ts +1 -1
  222. package/dist/features/indent/feature.server.d.ts.map +1 -1
  223. package/dist/features/indent/feature.server.js.map +1 -1
  224. package/dist/features/indent/i18n.js.map +1 -1
  225. package/dist/features/indent/toolbarIndentGroup.js.map +1 -1
  226. package/dist/features/link/drawer/baseFields.d.ts +2 -2
  227. package/dist/features/link/drawer/baseFields.d.ts.map +1 -1
  228. package/dist/features/link/drawer/baseFields.js.map +1 -1
  229. package/dist/features/link/feature.client.d.ts +2 -2
  230. package/dist/features/link/feature.client.js.map +1 -1
  231. package/dist/features/link/feature.server.d.ts +6 -6
  232. package/dist/features/link/feature.server.d.ts.map +1 -1
  233. package/dist/features/link/feature.server.js +12 -16
  234. package/dist/features/link/feature.server.js.map +1 -1
  235. package/dist/features/link/graphQLPopulationPromise.d.ts +1 -1
  236. package/dist/features/link/graphQLPopulationPromise.d.ts.map +1 -1
  237. package/dist/features/link/graphQLPopulationPromise.js.map +1 -1
  238. package/dist/features/link/i18n.js.map +1 -1
  239. package/dist/features/link/markdownTransformer.js.map +1 -1
  240. package/dist/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  241. package/dist/features/link/nodes/AutoLinkNode.js +7 -1
  242. package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
  243. package/dist/features/link/nodes/LinkNode.js +1 -2
  244. package/dist/features/link/nodes/LinkNode.js.map +1 -1
  245. package/dist/features/link/nodes/types.d.ts +10 -6
  246. package/dist/features/link/nodes/types.d.ts.map +1 -1
  247. package/dist/features/link/nodes/types.js.map +1 -1
  248. package/dist/features/link/plugins/autoLink/index.d.ts +1 -1
  249. package/dist/features/link/plugins/autoLink/index.d.ts.map +1 -1
  250. package/dist/features/link/plugins/autoLink/index.js +21 -5
  251. package/dist/features/link/plugins/autoLink/index.js.map +1 -1
  252. package/dist/features/link/plugins/clickableLink/index.d.ts +1 -1
  253. package/dist/features/link/plugins/clickableLink/index.d.ts.map +1 -1
  254. package/dist/features/link/plugins/clickableLink/index.js.map +1 -1
  255. package/dist/features/link/plugins/floatingLinkEditor/LinkEditor/commands.js.map +1 -1
  256. package/dist/features/link/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  257. package/dist/features/link/plugins/floatingLinkEditor/LinkEditor/index.js +11 -7
  258. package/dist/features/link/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  259. package/dist/features/link/plugins/floatingLinkEditor/index.d.ts +1 -1
  260. package/dist/features/link/plugins/floatingLinkEditor/index.d.ts.map +1 -1
  261. package/dist/features/link/plugins/floatingLinkEditor/index.js.map +1 -1
  262. package/dist/features/link/plugins/floatingLinkEditor/types.js.map +1 -1
  263. package/dist/features/link/plugins/floatingLinkEditor/utilities.d.ts +2 -2
  264. package/dist/features/link/plugins/floatingLinkEditor/utilities.d.ts.map +1 -1
  265. package/dist/features/link/plugins/floatingLinkEditor/utilities.js.map +1 -1
  266. package/dist/features/link/plugins/link/index.d.ts +1 -1
  267. package/dist/features/link/plugins/link/index.d.ts.map +1 -1
  268. package/dist/features/link/plugins/link/index.js.map +1 -1
  269. package/dist/features/link/validate.d.ts +1 -1
  270. package/dist/features/link/validate.d.ts.map +1 -1
  271. package/dist/features/link/validate.js +2 -1
  272. package/dist/features/link/validate.js.map +1 -1
  273. package/dist/features/lists/checklist/feature.client.js.map +1 -1
  274. package/dist/features/lists/checklist/feature.server.d.ts +1 -1
  275. package/dist/features/lists/checklist/feature.server.d.ts.map +1 -1
  276. package/dist/features/lists/checklist/feature.server.js.map +1 -1
  277. package/dist/features/lists/checklist/i18n.js.map +1 -1
  278. package/dist/features/lists/checklist/markdownTransformers.js.map +1 -1
  279. package/dist/features/lists/checklist/plugin/index.d.ts +1 -1
  280. package/dist/features/lists/checklist/plugin/index.d.ts.map +1 -1
  281. package/dist/features/lists/checklist/plugin/index.js.map +1 -1
  282. package/dist/features/lists/htmlConverter.d.ts +1 -1
  283. package/dist/features/lists/htmlConverter.d.ts.map +1 -1
  284. package/dist/features/lists/htmlConverter.js +10 -4
  285. package/dist/features/lists/htmlConverter.js.map +1 -1
  286. package/dist/features/lists/orderedList/feature.client.js.map +1 -1
  287. package/dist/features/lists/orderedList/feature.server.d.ts +1 -2
  288. package/dist/features/lists/orderedList/feature.server.d.ts.map +1 -1
  289. package/dist/features/lists/orderedList/feature.server.js.map +1 -1
  290. package/dist/features/lists/orderedList/i18n.js.map +1 -1
  291. package/dist/features/lists/orderedList/markdownTransformer.js.map +1 -1
  292. package/dist/features/lists/plugin/index.d.ts +11 -1
  293. package/dist/features/lists/plugin/index.d.ts.map +1 -1
  294. package/dist/features/lists/plugin/index.js.map +1 -1
  295. package/dist/features/lists/shared/markdown.js.map +1 -1
  296. package/dist/features/lists/shared/slashMenuListGroup.js.map +1 -1
  297. package/dist/features/lists/unorderedList/feature.client.js.map +1 -1
  298. package/dist/features/lists/unorderedList/feature.server.d.ts +1 -1
  299. package/dist/features/lists/unorderedList/feature.server.d.ts.map +1 -1
  300. package/dist/features/lists/unorderedList/feature.server.js.map +1 -1
  301. package/dist/features/lists/unorderedList/i18n.js.map +1 -1
  302. package/dist/features/lists/unorderedList/markdownTransformer.js.map +1 -1
  303. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/client.js.map +1 -1
  304. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.d.ts.map +1 -1
  305. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.js.map +1 -1
  306. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/index.js.map +1 -1
  307. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/client.js.map +1 -1
  308. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.js.map +1 -1
  309. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/index.js.map +1 -1
  310. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/client.js.map +1 -1
  311. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.d.ts.map +1 -1
  312. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.js.map +1 -1
  313. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/index.js.map +1 -1
  314. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/client.js.map +1 -1
  315. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.d.ts.map +1 -1
  316. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.js.map +1 -1
  317. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/index.js.map +1 -1
  318. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/client.js.map +1 -1
  319. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.d.ts.map +1 -1
  320. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.js.map +1 -1
  321. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/index.js.map +1 -1
  322. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/client.js.map +1 -1
  323. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.js.map +1 -1
  324. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/index.js.map +1 -1
  325. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/client.js.map +1 -1
  326. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js.map +1 -1
  327. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/index.js.map +1 -1
  328. package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.js.map +1 -1
  329. package/dist/features/migrations/lexicalPluginToLexical/converter/index.js.map +1 -1
  330. package/dist/features/migrations/lexicalPluginToLexical/converter/types.d.ts +2 -2
  331. package/dist/features/migrations/lexicalPluginToLexical/converter/types.d.ts.map +1 -1
  332. package/dist/features/migrations/lexicalPluginToLexical/converter/types.js.map +1 -1
  333. package/dist/features/migrations/lexicalPluginToLexical/feature.client.js.map +1 -1
  334. package/dist/features/migrations/lexicalPluginToLexical/feature.server.d.ts +1 -1
  335. package/dist/features/migrations/lexicalPluginToLexical/feature.server.d.ts.map +1 -1
  336. package/dist/features/migrations/lexicalPluginToLexical/feature.server.js.map +1 -1
  337. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  338. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  339. package/dist/features/migrations/slateToLexical/converter/converters/blockquote/client.js.map +1 -1
  340. package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.d.ts.map +1 -1
  341. package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.js.map +1 -1
  342. package/dist/features/migrations/slateToLexical/converter/converters/blockquote/index.js.map +1 -1
  343. package/dist/features/migrations/slateToLexical/converter/converters/heading/client.js.map +1 -1
  344. package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.d.ts.map +1 -1
  345. package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.js.map +1 -1
  346. package/dist/features/migrations/slateToLexical/converter/converters/heading/index.js.map +1 -1
  347. package/dist/features/migrations/slateToLexical/converter/converters/indent/client.js.map +1 -1
  348. package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.js.map +1 -1
  349. package/dist/features/migrations/slateToLexical/converter/converters/indent/index.js.map +1 -1
  350. package/dist/features/migrations/slateToLexical/converter/converters/link/client.js.map +1 -1
  351. package/dist/features/migrations/slateToLexical/converter/converters/link/converter.js.map +1 -1
  352. package/dist/features/migrations/slateToLexical/converter/converters/link/index.js.map +1 -1
  353. package/dist/features/migrations/slateToLexical/converter/converters/listItem/client.js.map +1 -1
  354. package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.d.ts.map +1 -1
  355. package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.js.map +1 -1
  356. package/dist/features/migrations/slateToLexical/converter/converters/listItem/index.js.map +1 -1
  357. package/dist/features/migrations/slateToLexical/converter/converters/orderedList/client.js.map +1 -1
  358. package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.d.ts.map +1 -1
  359. package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.js.map +1 -1
  360. package/dist/features/migrations/slateToLexical/converter/converters/orderedList/index.js.map +1 -1
  361. package/dist/features/migrations/slateToLexical/converter/converters/relationship/client.js.map +1 -1
  362. package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.js.map +1 -1
  363. package/dist/features/migrations/slateToLexical/converter/converters/relationship/index.js.map +1 -1
  364. package/dist/features/migrations/slateToLexical/converter/converters/unknown/client.js.map +1 -1
  365. package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.js.map +1 -1
  366. package/dist/features/migrations/slateToLexical/converter/converters/unknown/index.js.map +1 -1
  367. package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/client.js.map +1 -1
  368. package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.d.ts.map +1 -1
  369. package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.js.map +1 -1
  370. package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/index.js.map +1 -1
  371. package/dist/features/migrations/slateToLexical/converter/converters/upload/client.js.map +1 -1
  372. package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.js.map +1 -1
  373. package/dist/features/migrations/slateToLexical/converter/converters/upload/index.js.map +1 -1
  374. package/dist/features/migrations/slateToLexical/converter/defaultConverters.js.map +1 -1
  375. package/dist/features/migrations/slateToLexical/converter/index.d.ts.map +1 -1
  376. package/dist/features/migrations/slateToLexical/converter/index.js +1 -0
  377. package/dist/features/migrations/slateToLexical/converter/index.js.map +1 -1
  378. package/dist/features/migrations/slateToLexical/converter/types.js.map +1 -1
  379. package/dist/features/migrations/slateToLexical/feature.client.js.map +1 -1
  380. package/dist/features/migrations/slateToLexical/feature.server.d.ts +3 -1
  381. package/dist/features/migrations/slateToLexical/feature.server.d.ts.map +1 -1
  382. package/dist/features/migrations/slateToLexical/feature.server.js +3 -1
  383. package/dist/features/migrations/slateToLexical/feature.server.js.map +1 -1
  384. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  385. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  386. package/dist/features/paragraph/feature.client.js.map +1 -1
  387. package/dist/features/paragraph/feature.server.d.ts +1 -1
  388. package/dist/features/paragraph/feature.server.d.ts.map +1 -1
  389. package/dist/features/paragraph/feature.server.js.map +1 -1
  390. package/dist/features/paragraph/i18n.js.map +1 -1
  391. package/dist/features/relationship/drawer/commands.js.map +1 -1
  392. package/dist/features/relationship/drawer/index.js.map +1 -1
  393. package/dist/features/relationship/feature.client.d.ts +6 -6
  394. package/dist/features/relationship/feature.client.js.map +1 -1
  395. package/dist/features/relationship/feature.server.d.ts +6 -5
  396. package/dist/features/relationship/feature.server.d.ts.map +1 -1
  397. package/dist/features/relationship/feature.server.js.map +1 -1
  398. package/dist/features/relationship/graphQLPopulationPromise.d.ts +1 -1
  399. package/dist/features/relationship/graphQLPopulationPromise.d.ts.map +1 -1
  400. package/dist/features/relationship/graphQLPopulationPromise.js.map +1 -1
  401. package/dist/features/relationship/i18n.js.map +1 -1
  402. package/dist/features/relationship/nodes/RelationshipNode.d.ts +6 -2
  403. package/dist/features/relationship/nodes/RelationshipNode.d.ts.map +1 -1
  404. package/dist/features/relationship/nodes/RelationshipNode.js +1 -1
  405. package/dist/features/relationship/nodes/RelationshipNode.js.map +1 -1
  406. package/dist/features/relationship/nodes/components/RelationshipComponent.d.ts +0 -1
  407. package/dist/features/relationship/nodes/components/RelationshipComponent.d.ts.map +1 -1
  408. package/dist/features/relationship/nodes/components/RelationshipComponent.js +2 -3
  409. package/dist/features/relationship/nodes/components/RelationshipComponent.js.map +1 -1
  410. package/dist/features/relationship/plugins/index.d.ts +1 -1
  411. package/dist/features/relationship/plugins/index.d.ts.map +1 -1
  412. package/dist/features/relationship/plugins/index.js.map +1 -1
  413. package/dist/features/relationship/utils/EnabledRelationshipsCondition.js.map +1 -1
  414. package/dist/features/shared/slashMenu/basicGroup.js.map +1 -1
  415. package/dist/features/shared/toolbar/addDropdownGroup.js.map +1 -1
  416. package/dist/features/shared/toolbar/featureButtonsGroup.js.map +1 -1
  417. package/dist/features/shared/toolbar/textDropdownGroup.js.map +1 -1
  418. package/dist/features/toolbars/fixed/Toolbar/index.d.ts +1 -1
  419. package/dist/features/toolbars/fixed/Toolbar/index.d.ts.map +1 -1
  420. package/dist/features/toolbars/fixed/Toolbar/index.js.map +1 -1
  421. package/dist/features/toolbars/fixed/feature.client.d.ts +1 -1
  422. package/dist/features/toolbars/fixed/feature.client.d.ts.map +1 -1
  423. package/dist/features/toolbars/fixed/feature.client.js +8 -15
  424. package/dist/features/toolbars/fixed/feature.client.js.map +1 -1
  425. package/dist/features/toolbars/fixed/feature.server.d.ts +1 -2
  426. package/dist/features/toolbars/fixed/feature.server.d.ts.map +1 -1
  427. package/dist/features/toolbars/fixed/feature.server.js +16 -18
  428. package/dist/features/toolbars/fixed/feature.server.js.map +1 -1
  429. package/dist/features/toolbars/inline/Toolbar/index.d.ts +1 -1
  430. package/dist/features/toolbars/inline/Toolbar/index.d.ts.map +1 -1
  431. package/dist/features/toolbars/inline/Toolbar/index.js.map +1 -1
  432. package/dist/features/toolbars/inline/feature.client.d.ts +1 -1
  433. package/dist/features/toolbars/inline/feature.client.d.ts.map +1 -1
  434. package/dist/features/toolbars/inline/feature.client.js +9 -16
  435. package/dist/features/toolbars/inline/feature.client.js.map +1 -1
  436. package/dist/features/toolbars/inline/feature.server.d.ts +1 -2
  437. package/dist/features/toolbars/inline/feature.server.d.ts.map +1 -1
  438. package/dist/features/toolbars/inline/feature.server.js +8 -11
  439. package/dist/features/toolbars/inline/feature.server.js.map +1 -1
  440. package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  441. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
  442. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +0 -1
  443. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  444. package/dist/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
  445. package/dist/features/toolbars/types.d.ts +37 -5
  446. package/dist/features/toolbars/types.d.ts.map +1 -1
  447. package/dist/features/toolbars/types.js.map +1 -1
  448. package/dist/features/typeUtilities.d.ts +1 -1
  449. package/dist/features/typeUtilities.d.ts.map +1 -1
  450. package/dist/features/typeUtilities.js.map +1 -1
  451. package/dist/features/typesClient.d.ts +186 -0
  452. package/dist/features/typesClient.d.ts.map +1 -0
  453. package/dist/features/typesClient.js +3 -0
  454. package/dist/features/typesClient.js.map +1 -0
  455. package/dist/features/{types.d.ts → typesServer.d.ts} +50 -202
  456. package/dist/features/typesServer.d.ts.map +1 -0
  457. package/dist/features/typesServer.js +3 -0
  458. package/dist/features/typesServer.js.map +1 -0
  459. package/dist/features/upload/component/index.d.ts.map +1 -1
  460. package/dist/features/upload/component/index.js +34 -11
  461. package/dist/features/upload/component/index.js.map +1 -1
  462. package/dist/features/upload/drawer/commands.js.map +1 -1
  463. package/dist/features/upload/drawer/index.js.map +1 -1
  464. package/dist/features/upload/feature.client.d.ts +1 -1
  465. package/dist/features/upload/feature.client.d.ts.map +1 -1
  466. package/dist/features/upload/feature.client.js +62 -69
  467. package/dist/features/upload/feature.client.js.map +1 -1
  468. package/dist/features/upload/feature.server.d.ts +3 -4
  469. package/dist/features/upload/feature.server.d.ts.map +1 -1
  470. package/dist/features/upload/feature.server.js +157 -169
  471. package/dist/features/upload/feature.server.js.map +1 -1
  472. package/dist/features/upload/graphQLPopulationPromise.d.ts +1 -1
  473. package/dist/features/upload/graphQLPopulationPromise.d.ts.map +1 -1
  474. package/dist/features/upload/graphQLPopulationPromise.js.map +1 -1
  475. package/dist/features/upload/i18n.js.map +1 -1
  476. package/dist/features/upload/nodes/UploadNode.d.ts +7 -5
  477. package/dist/features/upload/nodes/UploadNode.d.ts.map +1 -1
  478. package/dist/features/upload/nodes/UploadNode.js +1 -2
  479. package/dist/features/upload/nodes/UploadNode.js.map +1 -1
  480. package/dist/features/upload/plugin/index.d.ts +1 -1
  481. package/dist/features/upload/plugin/index.d.ts.map +1 -1
  482. package/dist/features/upload/plugin/index.js.map +1 -1
  483. package/dist/features/upload/validate.d.ts +1 -1
  484. package/dist/features/upload/validate.d.ts.map +1 -1
  485. package/dist/features/upload/validate.js +1 -0
  486. package/dist/features/upload/validate.js.map +1 -1
  487. package/dist/field/Field.d.ts +3 -3
  488. package/dist/field/Field.d.ts.map +1 -1
  489. package/dist/field/Field.js +14 -12
  490. package/dist/field/Field.js.map +1 -1
  491. package/dist/field/index.d.ts +3 -3
  492. package/dist/field/index.d.ts.map +1 -1
  493. package/dist/field/index.js +11 -9
  494. package/dist/field/index.js.map +1 -1
  495. package/dist/i18n.js.map +1 -1
  496. package/dist/index.d.ts +14 -9
  497. package/dist/index.d.ts.map +1 -1
  498. package/dist/index.js +16 -16
  499. package/dist/index.js.map +1 -1
  500. package/dist/lexical/EditorPlugin.d.ts +1 -1
  501. package/dist/lexical/EditorPlugin.d.ts.map +1 -1
  502. package/dist/lexical/EditorPlugin.js.map +1 -1
  503. package/dist/lexical/LexicalEditor.d.ts +2 -2
  504. package/dist/lexical/LexicalEditor.d.ts.map +1 -1
  505. package/dist/lexical/LexicalEditor.js +0 -6
  506. package/dist/lexical/LexicalEditor.js.map +1 -1
  507. package/dist/lexical/LexicalProvider.d.ts +3 -3
  508. package/dist/lexical/LexicalProvider.d.ts.map +1 -1
  509. package/dist/lexical/LexicalProvider.js +26 -6
  510. package/dist/lexical/LexicalProvider.js.map +1 -1
  511. package/dist/lexical/config/client/EditorConfigProvider.d.ts +5 -5
  512. package/dist/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
  513. package/dist/lexical/config/client/EditorConfigProvider.js.map +1 -1
  514. package/dist/lexical/config/client/default.js.map +1 -1
  515. package/dist/lexical/config/client/loader.d.ts +1 -1
  516. package/dist/lexical/config/client/loader.d.ts.map +1 -1
  517. package/dist/lexical/config/client/loader.js.map +1 -1
  518. package/dist/lexical/config/client/sanitize.d.ts +1 -1
  519. package/dist/lexical/config/client/sanitize.d.ts.map +1 -1
  520. package/dist/lexical/config/client/sanitize.js +4 -0
  521. package/dist/lexical/config/client/sanitize.js.map +1 -1
  522. package/dist/lexical/config/server/default.d.ts +2 -2
  523. package/dist/lexical/config/server/default.d.ts.map +1 -1
  524. package/dist/lexical/config/server/default.js.map +1 -1
  525. package/dist/lexical/config/server/loader.d.ts +1 -1
  526. package/dist/lexical/config/server/loader.d.ts.map +1 -1
  527. package/dist/lexical/config/server/loader.js.map +1 -1
  528. package/dist/lexical/config/server/sanitize.d.ts +1 -1
  529. package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
  530. package/dist/lexical/config/server/sanitize.js.map +1 -1
  531. package/dist/lexical/config/types.d.ts +4 -3
  532. package/dist/lexical/config/types.d.ts.map +1 -1
  533. package/dist/lexical/config/types.js.map +1 -1
  534. package/dist/lexical/nodes/index.js.map +1 -1
  535. package/dist/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  536. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +4 -4
  537. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  538. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +0 -2
  539. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  540. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts +0 -1
  541. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts.map +1 -1
  542. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +1 -20
  543. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
  544. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts +23 -8
  545. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts.map +1 -1
  546. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
  547. package/dist/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
  548. package/dist/lexical/plugins/SlashMenu/index.js +43 -41
  549. package/dist/lexical/plugins/SlashMenu/index.js.map +1 -1
  550. package/dist/lexical/plugins/SlashMenu/useMenuTriggerMatch.js.map +1 -1
  551. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  552. package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.js.map +1 -1
  553. package/dist/lexical/plugins/handles/DraggableBlockPlugin/getBoundingRectWithoutTransform.js.map +1 -1
  554. package/dist/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.js.map +1 -1
  555. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +1 -1
  556. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  557. package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
  558. package/dist/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.js.map +1 -1
  559. package/dist/lexical/plugins/handles/utils/doesLineHeightAffectElement.js.map +1 -1
  560. package/dist/lexical/plugins/handles/utils/getCollapsedMargins.js.map +1 -1
  561. package/dist/lexical/plugins/handles/utils/getNodeCloseToPoint.js.map +1 -1
  562. package/dist/lexical/plugins/handles/utils/getTopLevelNodeKeys.js.map +1 -1
  563. package/dist/lexical/plugins/handles/utils/isOnHandleElement.js.map +1 -1
  564. package/dist/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  565. package/dist/lexical/theme/EditorTheme.js.map +1 -1
  566. package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
  567. package/dist/lexical/ui/ContentEditable.js +8 -1
  568. package/dist/lexical/ui/ContentEditable.js.map +1 -1
  569. package/dist/lexical/ui/icons/AI/index.js.map +1 -1
  570. package/dist/lexical/ui/icons/Add/index.js.map +1 -1
  571. package/dist/lexical/ui/icons/AlignCenter/index.js.map +1 -1
  572. package/dist/lexical/ui/icons/AlignJustify/index.js.map +1 -1
  573. package/dist/lexical/ui/icons/AlignLeft/index.js.map +1 -1
  574. package/dist/lexical/ui/icons/AlignRight/index.js.map +1 -1
  575. package/dist/lexical/ui/icons/Block/index.js.map +1 -1
  576. package/dist/lexical/ui/icons/Blockquote/index.js.map +1 -1
  577. package/dist/lexical/ui/icons/Bold/index.js.map +1 -1
  578. package/dist/lexical/ui/icons/Checklist/index.js.map +1 -1
  579. package/dist/lexical/ui/icons/Code/index.js.map +1 -1
  580. package/dist/lexical/ui/icons/CodeBlock/index.js.map +1 -1
  581. package/dist/lexical/ui/icons/H1/index.js.map +1 -1
  582. package/dist/lexical/ui/icons/H2/index.js.map +1 -1
  583. package/dist/lexical/ui/icons/H3/index.js.map +1 -1
  584. package/dist/lexical/ui/icons/H4/index.js.map +1 -1
  585. package/dist/lexical/ui/icons/H5/index.js.map +1 -1
  586. package/dist/lexical/ui/icons/H6/index.js.map +1 -1
  587. package/dist/lexical/ui/icons/HorizontalRule/index.js.map +1 -1
  588. package/dist/lexical/ui/icons/IndentDecrease/index.js.map +1 -1
  589. package/dist/lexical/ui/icons/IndentIncrease/index.js.map +1 -1
  590. package/dist/lexical/ui/icons/InlineBlocks/index.d.ts +3 -0
  591. package/dist/lexical/ui/icons/InlineBlocks/index.d.ts.map +1 -0
  592. package/dist/lexical/ui/icons/InlineBlocks/index.js +20 -0
  593. package/dist/lexical/ui/icons/InlineBlocks/index.js.map +1 -0
  594. package/dist/lexical/ui/icons/Italic/index.js.map +1 -1
  595. package/dist/lexical/ui/icons/Link/index.js.map +1 -1
  596. package/dist/lexical/ui/icons/Meatballs/index.d.ts +3 -0
  597. package/dist/lexical/ui/icons/Meatballs/index.d.ts.map +1 -0
  598. package/dist/lexical/ui/icons/Meatballs/index.js +25 -0
  599. package/dist/lexical/ui/icons/Meatballs/index.js.map +1 -0
  600. package/dist/lexical/ui/icons/OrderedList/index.js.map +1 -1
  601. package/dist/lexical/ui/icons/Relationship/index.js.map +1 -1
  602. package/dist/lexical/ui/icons/Strikethrough/index.js.map +1 -1
  603. package/dist/lexical/ui/icons/Subscript/index.js.map +1 -1
  604. package/dist/lexical/ui/icons/Superscript/index.js.map +1 -1
  605. package/dist/lexical/ui/icons/Table/index.d.ts +3 -0
  606. package/dist/lexical/ui/icons/Table/index.d.ts.map +1 -0
  607. package/dist/lexical/ui/icons/Table/index.js +20 -0
  608. package/dist/lexical/ui/icons/Table/index.js.map +1 -0
  609. package/dist/lexical/ui/icons/Text/index.js.map +1 -1
  610. package/dist/lexical/ui/icons/Underline/index.js.map +1 -1
  611. package/dist/lexical/ui/icons/UnorderedList/index.js.map +1 -1
  612. package/dist/lexical/ui/icons/Upload/index.js +1 -1
  613. package/dist/lexical/ui/icons/Upload/index.js.map +1 -1
  614. package/dist/lexical/utils/canUseDOM.js.map +1 -1
  615. package/dist/lexical/utils/environment.js.map +1 -1
  616. package/dist/lexical/utils/getDOMRangeRect.js.map +1 -1
  617. package/dist/lexical/utils/getSelectedNode.js.map +1 -1
  618. package/dist/lexical/utils/guard.js.map +1 -1
  619. package/dist/lexical/utils/invariant.js.map +1 -1
  620. package/dist/lexical/utils/joinClasses.js.map +1 -1
  621. package/dist/lexical/utils/markdown/createBlockNode.js.map +1 -1
  622. package/dist/lexical/utils/nodeFormat.js.map +1 -1
  623. package/dist/lexical/utils/point.js.map +1 -1
  624. package/dist/lexical/utils/rect.js.map +1 -1
  625. package/dist/lexical/utils/setFloatingElemPosition.js.map +1 -1
  626. package/dist/lexical/utils/setFloatingElemPositionForLinkEditor.js.map +1 -1
  627. package/dist/lexical/utils/swipe.js.map +1 -1
  628. package/dist/lexical/utils/url.js.map +1 -1
  629. package/dist/nodeTypes.d.ts +32 -0
  630. package/dist/nodeTypes.d.ts.map +1 -0
  631. package/dist/nodeTypes.js +3 -0
  632. package/dist/nodeTypes.js.map +1 -0
  633. package/dist/populateGraphQL/defaultValue.d.ts.map +1 -1
  634. package/dist/populateGraphQL/defaultValue.js +1 -0
  635. package/dist/populateGraphQL/defaultValue.js.map +1 -1
  636. package/dist/populateGraphQL/populate.d.ts +4 -4
  637. package/dist/populateGraphQL/populate.d.ts.map +1 -1
  638. package/dist/populateGraphQL/populate.js.map +1 -1
  639. package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts +3 -3
  640. package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts.map +1 -1
  641. package/dist/populateGraphQL/populateLexicalPopulationPromises.js.map +1 -1
  642. package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.d.ts +4 -4
  643. package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.d.ts.map +1 -1
  644. package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.js.map +1 -1
  645. package/dist/types.d.ts +6 -6
  646. package/dist/types.d.ts.map +1 -1
  647. package/dist/types.js.map +1 -1
  648. package/dist/utilities/createClientFeature.d.ts +1 -1
  649. package/dist/utilities/createClientFeature.d.ts.map +1 -1
  650. package/dist/utilities/createClientFeature.js.map +1 -1
  651. package/dist/utilities/createServerFeature.d.ts +3 -3
  652. package/dist/utilities/createServerFeature.d.ts.map +1 -1
  653. package/dist/utilities/createServerFeature.js.map +1 -1
  654. package/dist/utilities/fieldsDrawer/Drawer.d.ts +18 -0
  655. package/dist/utilities/fieldsDrawer/Drawer.d.ts.map +1 -0
  656. package/dist/utilities/fieldsDrawer/Drawer.js +26 -0
  657. package/dist/utilities/fieldsDrawer/Drawer.js.map +1 -0
  658. package/dist/utilities/fieldsDrawer/DrawerContent.d.ts +4 -0
  659. package/dist/utilities/fieldsDrawer/DrawerContent.d.ts.map +1 -0
  660. package/dist/utilities/fieldsDrawer/DrawerContent.js +90 -0
  661. package/dist/utilities/fieldsDrawer/DrawerContent.js.map +1 -0
  662. package/dist/utilities/forEachNodeRecursively.js.map +1 -1
  663. package/dist/utilities/generateComponentMap.d.ts +1 -1
  664. package/dist/utilities/generateComponentMap.d.ts.map +1 -1
  665. package/dist/utilities/generateComponentMap.js +6 -4
  666. package/dist/utilities/generateComponentMap.js.map +1 -1
  667. package/dist/utilities/generateSchemaMap.d.ts +1 -1
  668. package/dist/utilities/generateSchemaMap.d.ts.map +1 -1
  669. package/dist/utilities/generateSchemaMap.js +10 -1
  670. package/dist/utilities/generateSchemaMap.js.map +1 -1
  671. package/dist/utilities/migrateSlateToLexical/index.d.ts +15 -0
  672. package/dist/utilities/migrateSlateToLexical/index.d.ts.map +1 -0
  673. package/dist/utilities/migrateSlateToLexical/index.js +105 -0
  674. package/dist/utilities/migrateSlateToLexical/index.js.map +1 -0
  675. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.d.ts +9 -0
  676. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.d.ts.map +1 -0
  677. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js +77 -0
  678. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js.map +1 -0
  679. package/dist/utilities/recurseNodeTree.js.map +1 -1
  680. package/dist/utilities/upgradeLexicalData/index.d.ts +11 -0
  681. package/dist/utilities/upgradeLexicalData/index.d.ts.map +1 -0
  682. package/dist/utilities/upgradeLexicalData/index.js +101 -0
  683. package/dist/utilities/upgradeLexicalData/index.js.map +1 -0
  684. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.d.ts +9 -0
  685. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.d.ts.map +1 -0
  686. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js +74 -0
  687. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js.map +1 -0
  688. package/dist/utilities/useLexicalFeature.d.ts +1 -1
  689. package/dist/utilities/useLexicalFeature.d.ts.map +1 -1
  690. package/dist/utilities/useLexicalFeature.js.map +1 -1
  691. package/dist/validate/index.js.map +1 -1
  692. package/dist/validate/validateNodes.d.ts +2 -2
  693. package/dist/validate/validateNodes.d.ts.map +1 -1
  694. package/dist/validate/validateNodes.js.map +1 -1
  695. package/package.json +44 -43
  696. package/dist/exports/client/Field-YMWNSE3A.js +0 -2
  697. package/dist/exports/client/Field-YMWNSE3A.js.map +0 -7
  698. package/dist/exports/client/RelationshipComponent-5OU5HATX.js +0 -2
  699. package/dist/exports/client/RelationshipComponent-5OU5HATX.js.map +0 -7
  700. package/dist/exports/client/chunk-3K3B6PJM.js.map +0 -7
  701. package/dist/exports/client/chunk-MLIITFAS.js.map +0 -7
  702. package/dist/exports/client/chunk-OSR74ZNW.js.map +0 -7
  703. package/dist/exports/client/chunk-WDKKMO4H.js +0 -2
  704. package/dist/exports/client/chunk-WDKKMO4H.js.map +0 -7
  705. package/dist/exports/client/chunk-ZITHDR53.js +0 -2
  706. package/dist/exports/client/chunk-ZITHDR53.js.map +0 -7
  707. package/dist/exports/client/component-IAKI3GRY.js +0 -2
  708. package/dist/exports/client/component-IAKI3GRY.js.map +0 -7
  709. package/dist/exports/client/component-W3PV5MJ7.js +0 -2
  710. package/dist/exports/client/component-W3PV5MJ7.js.map +0 -7
  711. package/dist/features/blocks/drawer/index.d.ts +0 -9
  712. package/dist/features/blocks/drawer/index.d.ts.map +0 -1
  713. package/dist/features/blocks/drawer/index.js +0 -78
  714. package/dist/features/blocks/drawer/index.js.map +0 -1
  715. package/dist/features/link/drawer/index.d.ts +0 -5
  716. package/dist/features/link/drawer/index.d.ts.map +0 -1
  717. package/dist/features/link/drawer/index.js +0 -94
  718. package/dist/features/link/drawer/index.js.map +0 -1
  719. package/dist/features/link/drawer/types.d.ts +0 -10
  720. package/dist/features/link/drawer/types.d.ts.map +0 -1
  721. package/dist/features/link/drawer/types.js +0 -3
  722. package/dist/features/link/drawer/types.js.map +0 -1
  723. package/dist/features/types.d.ts.map +0 -1
  724. package/dist/features/types.js +0 -3
  725. package/dist/features/types.js.map +0 -1
  726. package/dist/features/upload/component/ExtraFieldsDrawer/index.d.ts +0 -12
  727. package/dist/features/upload/component/ExtraFieldsDrawer/index.d.ts.map +0 -1
  728. package/dist/features/upload/component/ExtraFieldsDrawer/index.js +0 -123
  729. package/dist/features/upload/component/ExtraFieldsDrawer/index.js.map +0 -1
  730. package/dist/lexical/utils/cloneDeep.d.ts +0 -2
  731. package/dist/lexical/utils/cloneDeep.d.ts.map +0 -1
  732. package/dist/lexical/utils/cloneDeep.js +0 -50
  733. package/dist/lexical/utils/cloneDeep.js.map +0 -1
  734. /package/dist/exports/client/{component-QWIGEOVD.js.map → component-VM36FRT2.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lexical/utils/rect.ts"],"sourcesContent":["import { type Point, isPoint } from './point.js'\n\ninterface ContainsPointReturn {\n reason: {\n isOnBottomSide: boolean\n isOnLeftSide: boolean\n isOnRightSide: boolean\n isOnTopSide: boolean\n }\n result: boolean\n}\n\nexport class Rect {\n private readonly _bottom: number\n\n private readonly _left: number\n\n private readonly _right: number\n\n private readonly _top: number\n\n constructor(left: number, top: number, right: number, bottom: number) {\n const [physicTop, physicBottom] = top <= bottom ? [top, bottom] : [bottom, top]\n\n const [physicLeft, physicRight] = left <= right ? [left, right] : [right, left]\n\n this._top = physicTop\n this._right = physicRight\n this._left = physicLeft\n this._bottom = physicBottom\n }\n\n static fromDOM(dom: HTMLElement): Rect {\n const { height, left, top, width } = dom.getBoundingClientRect()\n return Rect.fromLWTH(left, width, top, height)\n }\n\n static fromDOMRect(domRect: DOMRect): Rect {\n const { height, left, top, width } = domRect\n return Rect.fromLWTH(left, width, top, height)\n }\n\n static fromLTRB(left: number, top: number, right: number, bottom: number): Rect {\n return new Rect(left, top, right, bottom)\n }\n\n static fromLWTH(left: number, width: number, top: number, height: number): Rect {\n return new Rect(left, top, left + width, top + height)\n }\n\n static fromPoints(startPoint: Point, endPoint: Point): Rect {\n const { x: left, y: top } = startPoint\n const { x: right, y: bottom } = endPoint\n return Rect.fromLTRB(left, top, right, bottom)\n }\n\n public contains({ x, y }: Point): ContainsPointReturn\n\n public contains({ bottom, left, right, top }: Rect): boolean\n\n public contains(target: Point | Rect): ContainsPointReturn | boolean {\n if (isPoint(target)) {\n const { x, y } = target\n\n const isOnTopSide = y < this._top\n const isOnBottomSide = y > this._bottom\n const isOnLeftSide = x < this._left\n const isOnRightSide = x > this._right\n\n const result = !isOnTopSide && !isOnBottomSide && !isOnLeftSide && !isOnRightSide\n\n return {\n reason: {\n isOnBottomSide,\n isOnLeftSide,\n isOnRightSide,\n isOnTopSide,\n },\n result,\n }\n }\n const { bottom, left, right, top } = target\n\n return (\n top >= this._top &&\n top <= this._bottom &&\n bottom >= this._top &&\n bottom <= this._bottom &&\n left >= this._left &&\n left <= this._right &&\n right >= this._left &&\n right <= this._right\n )\n }\n\n public distanceFromPoint(point: Point): {\n distance: number\n isOnBottomSide: boolean\n isOnLeftSide: boolean\n isOnRightSide: boolean\n isOnTopSide: boolean\n } {\n const containsResult = this.contains(point)\n if (containsResult.result) {\n return {\n distance: 0,\n isOnBottomSide: containsResult.reason.isOnBottomSide,\n isOnLeftSide: containsResult.reason.isOnLeftSide,\n isOnRightSide: containsResult.reason.isOnRightSide,\n isOnTopSide: containsResult.reason.isOnTopSide,\n }\n }\n\n let dx = 0 // Horizontal distance to the closest edge\n let dy = 0 // Vertical distance to the closest edge\n\n // If the point is to the left of the rectangle\n if (point.x < this._left) {\n dx = this._left - point.x\n }\n // If the point is to the right of the rectangle\n else if (point.x > this._right) {\n dx = point.x - this._right\n }\n\n // If the point is above the rectangle\n if (point.y < this._top) {\n dy = this._top - point.y\n }\n // If the point is below the rectangle\n else if (point.y > this._bottom) {\n dy = point.y - this._bottom\n }\n\n // Use the Pythagorean theorem to calculate the distance\n return {\n distance: Math.sqrt(dx * dx + dy * dy),\n isOnBottomSide: point.y > this._bottom,\n isOnLeftSide: point.x < this._left,\n isOnRightSide: point.x > this._right,\n isOnTopSide: point.y < this._top,\n }\n }\n\n public equals({ bottom, left, right, top }: Rect): boolean {\n return (\n top === this._top && bottom === this._bottom && left === this._left && right === this._right\n )\n }\n\n public generateNewRect({\n bottom = this.bottom,\n left = this.left,\n right = this.right,\n top = this.top,\n }): Rect {\n return new Rect(left, top, right, bottom)\n }\n\n public intersectsWith(rect: Rect): boolean {\n const { height: h1, left: x1, top: y1, width: w1 } = rect\n const { height: h2, left: x2, top: y2, width: w2 } = this\n const maxX = x1 + w1 >= x2 + w2 ? x1 + w1 : x2 + w2\n const maxY = y1 + h1 >= y2 + h2 ? y1 + h1 : y2 + h2\n const minX = x1 <= x2 ? x1 : x2\n const minY = y1 <= y2 ? y1 : y2\n return maxX - minX <= w1 + w2 && maxY - minY <= h1 + h2\n }\n\n get bottom(): number {\n return this._bottom\n }\n\n get height(): number {\n return Math.abs(this._bottom - this._top)\n }\n\n get left(): number {\n return this._left\n }\n\n get right(): number {\n return this._right\n }\n\n get top(): number {\n return this._top\n }\n\n get width(): number {\n return Math.abs(this._left - this._right)\n }\n}\n"],"names":["isPoint","Rect","_bottom","_left","_right","_top","constructor","left","top","right","bottom","physicTop","physicBottom","physicLeft","physicRight","fromDOM","dom","height","width","getBoundingClientRect","fromLWTH","fromDOMRect","domRect","fromLTRB","fromPoints","startPoint","endPoint","x","y","contains","target","isOnTopSide","isOnBottomSide","isOnLeftSide","isOnRightSide","result","reason","distanceFromPoint","point","containsResult","distance","dx","dy","Math","sqrt","equals","generateNewRect","intersectsWith","rect","h1","x1","y1","w1","h2","x2","y2","w2","maxX","maxY","minX","minY","abs"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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import { type Point, isPoint } from './point.js'\n\ninterface ContainsPointReturn {\n reason: {\n isOnBottomSide: boolean\n isOnLeftSide: boolean\n isOnRightSide: boolean\n isOnTopSide: boolean\n }\n result: boolean\n}\n\nexport class Rect {\n private readonly _bottom: number\n\n private readonly _left: number\n\n private readonly _right: number\n\n private readonly _top: number\n\n constructor(left: number, top: number, right: number, bottom: number) {\n const [physicTop, physicBottom] = top <= bottom ? [top, bottom] : [bottom, top]\n\n const [physicLeft, physicRight] = left <= right ? [left, right] : [right, left]\n\n this._top = physicTop\n this._right = physicRight\n this._left = physicLeft\n this._bottom = physicBottom\n }\n\n static fromDOM(dom: HTMLElement): Rect {\n const { height, left, top, width } = dom.getBoundingClientRect()\n return Rect.fromLWTH(left, width, top, height)\n }\n\n static fromDOMRect(domRect: DOMRect): Rect {\n const { height, left, top, width } = domRect\n return Rect.fromLWTH(left, width, top, height)\n }\n\n static fromLTRB(left: number, top: number, right: number, bottom: number): Rect {\n return new Rect(left, top, right, bottom)\n }\n\n static fromLWTH(left: number, width: number, top: number, height: number): Rect {\n return new Rect(left, top, left + width, top + height)\n }\n\n static fromPoints(startPoint: Point, endPoint: Point): Rect {\n const { x: left, y: top } = startPoint\n const { x: right, y: bottom } = endPoint\n return Rect.fromLTRB(left, top, right, bottom)\n }\n\n public contains({ x, y }: Point): ContainsPointReturn\n\n public contains({ bottom, left, right, top }: Rect): boolean\n\n public contains(target: Point | Rect): ContainsPointReturn | boolean {\n if (isPoint(target)) {\n const { x, y } = target\n\n const isOnTopSide = y < this._top\n const isOnBottomSide = y > this._bottom\n const isOnLeftSide = x < this._left\n const isOnRightSide = x > this._right\n\n const result = !isOnTopSide && !isOnBottomSide && !isOnLeftSide && !isOnRightSide\n\n return {\n reason: {\n isOnBottomSide,\n isOnLeftSide,\n isOnRightSide,\n isOnTopSide,\n },\n result,\n }\n }\n const { bottom, left, right, top } = target\n\n return (\n top >= this._top &&\n top <= this._bottom &&\n bottom >= this._top &&\n bottom <= this._bottom &&\n left >= this._left &&\n left <= this._right &&\n right >= this._left &&\n right <= this._right\n )\n }\n\n public distanceFromPoint(point: Point): {\n distance: number\n isOnBottomSide: boolean\n isOnLeftSide: boolean\n isOnRightSide: boolean\n isOnTopSide: boolean\n } {\n const containsResult = this.contains(point)\n if (containsResult.result) {\n return {\n distance: 0,\n isOnBottomSide: containsResult.reason.isOnBottomSide,\n isOnLeftSide: containsResult.reason.isOnLeftSide,\n isOnRightSide: containsResult.reason.isOnRightSide,\n isOnTopSide: containsResult.reason.isOnTopSide,\n }\n }\n\n let dx = 0 // Horizontal distance to the closest edge\n let dy = 0 // Vertical distance to the closest edge\n\n // If the point is to the left of the rectangle\n if (point.x < this._left) {\n dx = this._left - point.x\n }\n // If the point is to the right of the rectangle\n else if (point.x > this._right) {\n dx = point.x - this._right\n }\n\n // If the point is above the rectangle\n if (point.y < this._top) {\n dy = this._top - point.y\n }\n // If the point is below the rectangle\n else if (point.y > this._bottom) {\n dy = point.y - this._bottom\n }\n\n // Use the Pythagorean theorem to calculate the distance\n return {\n distance: Math.sqrt(dx * dx + dy * dy),\n isOnBottomSide: point.y > this._bottom,\n isOnLeftSide: point.x < this._left,\n isOnRightSide: point.x > this._right,\n isOnTopSide: point.y < this._top,\n }\n }\n\n public equals({ bottom, left, right, top }: Rect): boolean {\n return (\n top === this._top && bottom === this._bottom && left === this._left && right === this._right\n )\n }\n\n public generateNewRect({\n bottom = this.bottom,\n left = this.left,\n right = this.right,\n top = this.top,\n }): Rect {\n return new Rect(left, top, right, bottom)\n }\n\n public intersectsWith(rect: Rect): boolean {\n const { height: h1, left: x1, top: y1, width: w1 } = rect\n const { height: h2, left: x2, top: y2, width: w2 } = this\n const maxX = x1 + w1 >= x2 + w2 ? x1 + w1 : x2 + w2\n const maxY = y1 + h1 >= y2 + h2 ? y1 + h1 : y2 + h2\n const minX = x1 <= x2 ? x1 : x2\n const minY = y1 <= y2 ? y1 : y2\n return maxX - minX <= w1 + w2 && maxY - minY <= h1 + h2\n }\n\n get bottom(): number {\n return this._bottom\n }\n\n get height(): number {\n return Math.abs(this._bottom - this._top)\n }\n\n get left(): number {\n return this._left\n }\n\n get right(): number {\n return this._right\n }\n\n get top(): number {\n return this._top\n }\n\n get width(): number {\n return Math.abs(this._left - this._right)\n }\n}\n"],"names":["isPoint","Rect","_bottom","_left","_right","_top","constructor","left","top","right","bottom","physicTop","physicBottom","physicLeft","physicRight","fromDOM","dom","height","width","getBoundingClientRect","fromLWTH","fromDOMRect","domRect","fromLTRB","fromPoints","startPoint","endPoint","x","y","contains","target","isOnTopSide","isOnBottomSide","isOnLeftSide","isOnRightSide","result","reason","distanceFromPoint","point","containsResult","distance","dx","dy","Math","sqrt","equals","generateNewRect","intersectsWith","rect","h1","x1","y1","w1","h2","x2","y2","w2","maxX","maxY","minX","minY","abs"],"mappings":"AAAA,SAAqBA,OAAO,QAAQ,aAAY;AAYhD,OAAO,MAAMC;IACMC,QAAe;IAEfC,MAAa;IAEbC,OAAc;IAEdC,KAAY;IAE7BC,YAAYC,IAAY,EAAEC,GAAW,EAAEC,KAAa,EAAEC,MAAc,CAAE;QACpE,MAAM,CAACC,WAAWC,aAAa,GAAGJ,OAAOE,SAAS;YAACF;YAAKE;SAAO,GAAG;YAACA;YAAQF;SAAI;QAE/E,MAAM,CAACK,YAAYC,YAAY,GAAGP,QAAQE,QAAQ;YAACF;YAAME;SAAM,GAAG;YAACA;YAAOF;SAAK;QAE/E,IAAI,CAACF,IAAI,GAAGM;QACZ,IAAI,CAACP,MAAM,GAAGU;QACd,IAAI,CAACX,KAAK,GAAGU;QACb,IAAI,CAACX,OAAO,GAAGU;IACjB;IAEA,OAAOG,QAAQC,GAAgB,EAAQ;QACrC,MAAM,EAAEC,MAAM,EAAEV,IAAI,EAAEC,GAAG,EAAEU,KAAK,EAAE,GAAGF,IAAIG,qBAAqB;QAC9D,OAAOlB,KAAKmB,QAAQ,CAACb,MAAMW,OAAOV,KAAKS;IACzC;IAEA,OAAOI,YAAYC,OAAgB,EAA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AAiB;QACnB,OAAO,IAAI,CAACR,OAAO;IACrB;IAEA,IAAIe,SAAiB;QACnB,OAAO0B,KAAKkB,GAAG,CAAC,IAAI,CAAC3D,OAAO,GAAG,IAAI,CAACG,IAAI;IAC1C;IAEA,IAAIE,OAAe;QACjB,OAAO,IAAI,CAACJ,KAAK;IACnB;IAEA,IAAIM,QAAgB;QAClB,OAAO,IAAI,CAACL,MAAM;IACpB;IAEA,IAAII,MAAc;QAChB,OAAO,IAAI,CAACH,IAAI;IAClB;IAEA,IAAIa,QAAgB;QAClB,OAAOyB,KAAKkB,GAAG,CAAC,IAAI,CAAC1D,KAAK,GAAG,IAAI,CAACC,MAAM;IAC1C;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lexical/utils/setFloatingElemPosition.ts"],"sourcesContent":["const VERTICAL_GAP = 10\nconst HORIZONTAL_OFFSET = 5\n\n// TODO: needs refactoring\n// This is supposed to position the floatingElem based on the parent (anchorElem) and the target (targetRect) which is usually the selected text.\n// So basically, it positions the floatingElem either below or above the target (targetRect) and aligns it to the left or center of the target (targetRect).\n// This is used for positioning the floating toolbar (anchor: richtext editor) and its caret (anchor: floating toolbar)\nexport function setFloatingElemPosition(args: {\n alwaysDisplayOnTop?: boolean\n anchorElem: HTMLElement\n anchorFlippedOffset?: number // Offset which was added to the anchor (for caret, floating toolbar) if it was flipped\n floatingElem: HTMLElement\n horizontalOffset?: number\n horizontalPosition?: 'center' | 'left'\n specialHandlingForCaret?: boolean\n targetRect: ClientRect | null\n verticalGap?: number\n}): number {\n const {\n alwaysDisplayOnTop = false,\n anchorElem,\n anchorFlippedOffset = 0, // Offset which was added to the anchor (for caret, floating toolbar) if it was flipped\n floatingElem,\n horizontalOffset = HORIZONTAL_OFFSET,\n horizontalPosition = 'left',\n specialHandlingForCaret = false,\n targetRect,\n verticalGap = VERTICAL_GAP,\n } = args\n // Returns the top offset if the target was flipped\n const scrollerElem = anchorElem.parentElement\n\n if (targetRect === null || scrollerElem == null) {\n floatingElem.style.opacity = '0'\n floatingElem.style.transform = 'translate(-10000px, -10000px)'\n return\n }\n\n const floatingElemRect = floatingElem.getBoundingClientRect()\n const anchorElementRect = anchorElem.getBoundingClientRect()\n const editorScrollerRect = scrollerElem.getBoundingClientRect()\n\n let top = targetRect.top - floatingElemRect.height - verticalGap\n let left = targetRect.left - horizontalOffset\n\n if (horizontalPosition === 'center') {\n // Calculate left to position floatingElem to the horizontal middle of targetRect\n left = targetRect.left + targetRect.width / 2 - floatingElemRect.width / 2\n }\n\n let addedToTop = 0\n if (!alwaysDisplayOnTop && top < editorScrollerRect.top && !specialHandlingForCaret) {\n addedToTop = floatingElemRect.height + targetRect.height + verticalGap * 2\n\n top += addedToTop\n }\n\n if (horizontalPosition === 'center') {\n if (left + floatingElemRect.width > editorScrollerRect.right) {\n left = editorScrollerRect.right - floatingElemRect.width - horizontalOffset\n } else if (left < editorScrollerRect.left) {\n left = editorScrollerRect.left + horizontalOffset\n }\n } else {\n if (left + floatingElemRect.width > editorScrollerRect.right) {\n left = editorScrollerRect.right - floatingElemRect.width - horizontalOffset\n }\n }\n\n left -= anchorElementRect.left\n\n floatingElem.style.opacity = '1'\n\n if (specialHandlingForCaret && anchorFlippedOffset !== 0) {\n // Floating select toolbar was flipped (positioned below text rather than above). Thus, the caret now needs to be positioned\n // on the other side and rotated.\n top -= anchorElementRect.bottom - anchorFlippedOffset + floatingElemRect.height - 3\n // top += anchorFlippedOffset - anchorElementRect.height - floatingElemRect.height + 2\n floatingElem.style.transform = `translate(${left}px, ${top}px) rotate(180deg)`\n } else {\n top -= anchorElementRect.top\n\n floatingElem.style.transform = `translate(${left}px, ${top}px)`\n }\n\n return addedToTop\n}\n"],"names":["VERTICAL_GAP","HORIZONTAL_OFFSET","setFloatingElemPosition","args","alwaysDisplayOnTop","anchorElem","anchorFlippedOffset","floatingElem","horizontalOffset","horizontalPosition","specialHandlingForCaret","targetRect","verticalGap","scrollerElem","parentElement","style","opacity","transform","floatingElemRect","getBoundingClientRect","anchorElementRect","editorScrollerRect","top","height","left","width","addedToTop","right","bottom"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,MAAMA,eAAe;AACrB,MAAMC,oBAAoB;AAE1B,0BAA0B;AAC1B,iJAAiJ;AACjJ,4JAA4J;AAC5J,uHAAuH;AACvH,OAAO,SAASC,wBAAwBC,IAUvC;IACC,MAAM,EACJC,qBAAqB,KAAK,EAC1BC,UAAU,EACVC,sBAAsB,CAAC,EACvBC,YAAY,EACZC,mBAAmBP,iBAAiB,EACpCQ,qBAAqB,MAAM,EAC3BC,0BAA0B,KAAK,EAC/BC,UAAU,EACVC,cAAcZ,YAAY,EAC3B,GAAGG;IACJ,mDAAmD;IACnD,MAAMU,eAAeR,WAAWS,aAAa;IAE7C,IAAIH,eAAe,QAAQE,gBAAgB,MAAM;QAC/CN,aAAaQ,KAAK,CAACC,OAAO,GAAG;QAC7BT,aAAaQ,KAAK,CAACE,SAAS,GAAG;QAC/B;IACF;IAEA,MAAMC,mBAAmBX,aAAaY,qBAAqB;IAC3D,MAAMC,oBAAoBf,WAAWc,qBAAqB;IAC1D,MAAME,qBAAqBR,aAAaM,qBAAqB;IAE7D,IAAIG,MAAMX,WAAWW,GAAG,GAAGJ,iBAAiBK,MAAM,GAAGX;IACrD,IAAIY,OAAOb,WAAWa,IAAI,GAAGhB;IAE7B,IAAIC,uBAAuB,UAAU;QACnC,iFAAiF;QACjFe,OAAOb,WAAWa,IAAI,GAAGb,WAAWc,KAAK,GAAG,IAAIP,iBAAiBO,KAAK,GAAG;IAC3E;IAEA,IAAIC,aAAa;IACjB,IAAI,CAACtB,sBAAsBkB,MAAMD,mBAAmBC,GAAG,IAAI,CAACZ,yBAAyB;QACnFgB,aAAaR,iBAAiBK,MAAM,GAAGZ,WAAWY,MAAM,GAAGX,cAAc;QAEzEU,OAAOI;IACT;IAEA,IAAIjB,uBAAuB,UAAU;QACnC,IAAIe,OAAON,iBAAiBO,KAAK,GAAGJ,mBAAmBM,KAAK,EAAE;YAC5DH,OAAOH,mBAAmBM,KAAK,GAAGT,iBAAiBO,KAAK,GAAGjB;QAC7D,OAAO,IAAIgB,OAAOH,mBAAmBG,IAAI,EAAE;YACzCA,OAAOH,mBAAmBG,IAAI,GAAGhB;QACnC;IACF,OAAO;QACL,IAAIgB,OAAON,iBAAiBO,KAAK,GAAGJ,mBAAmBM,KAAK,EAAE;YAC5DH,OAAOH,mBAAmBM,KAAK,GAAGT,iBAAiBO,KAAK,GAAGjB;QAC7D;IACF;IAEAgB,QAAQJ,kBAAkBI,IAAI;IAE9BjB,aAAaQ,KAAK,CAACC,OAAO,GAAG;IAE7B,IAAIN,2BAA2BJ,wBAAwB,GAAG;QACxD,4HAA4H;QAC5H,iCAAiC;QACjCgB,OAAOF,kBAAkBQ,MAAM,GAAGtB,sBAAsBY,iBAAiBK,MAAM,GAAG;QAClF,sFAAsF;QACtFhB,aAAaQ,KAAK,CAACE,SAAS,GAAG,CAAC,UAAU,EAAEO,KAAK,IAAI,EAAEF,IAAI,kBAAkB,CAAC;IAChF,OAAO;QACLA,OAAOF,kBAAkBE,GAAG;QAE5Bf,aAAaQ,KAAK,CAACE,SAAS,GAAG,CAAC,UAAU,EAAEO,KAAK,IAAI,EAAEF,IAAI,GAAG,CAAC;IACjE;IAEA,OAAOI;AACT"}
1
+ {"version":3,"sources":["../../../src/lexical/utils/setFloatingElemPosition.ts"],"sourcesContent":["const VERTICAL_GAP = 10\nconst HORIZONTAL_OFFSET = 5\n\n// TODO: needs refactoring\n// This is supposed to position the floatingElem based on the parent (anchorElem) and the target (targetRect) which is usually the selected text.\n// So basically, it positions the floatingElem either below or above the target (targetRect) and aligns it to the left or center of the target (targetRect).\n// This is used for positioning the floating toolbar (anchor: richtext editor) and its caret (anchor: floating toolbar)\nexport function setFloatingElemPosition(args: {\n alwaysDisplayOnTop?: boolean\n anchorElem: HTMLElement\n anchorFlippedOffset?: number // Offset which was added to the anchor (for caret, floating toolbar) if it was flipped\n floatingElem: HTMLElement\n horizontalOffset?: number\n horizontalPosition?: 'center' | 'left'\n specialHandlingForCaret?: boolean\n targetRect: ClientRect | null\n verticalGap?: number\n}): number {\n const {\n alwaysDisplayOnTop = false,\n anchorElem,\n anchorFlippedOffset = 0, // Offset which was added to the anchor (for caret, floating toolbar) if it was flipped\n floatingElem,\n horizontalOffset = HORIZONTAL_OFFSET,\n horizontalPosition = 'left',\n specialHandlingForCaret = false,\n targetRect,\n verticalGap = VERTICAL_GAP,\n } = args\n // Returns the top offset if the target was flipped\n const scrollerElem = anchorElem.parentElement\n\n if (targetRect === null || scrollerElem == null) {\n floatingElem.style.opacity = '0'\n floatingElem.style.transform = 'translate(-10000px, -10000px)'\n return\n }\n\n const floatingElemRect = floatingElem.getBoundingClientRect()\n const anchorElementRect = anchorElem.getBoundingClientRect()\n const editorScrollerRect = scrollerElem.getBoundingClientRect()\n\n let top = targetRect.top - floatingElemRect.height - verticalGap\n let left = targetRect.left - horizontalOffset\n\n if (horizontalPosition === 'center') {\n // Calculate left to position floatingElem to the horizontal middle of targetRect\n left = targetRect.left + targetRect.width / 2 - floatingElemRect.width / 2\n }\n\n let addedToTop = 0\n if (!alwaysDisplayOnTop && top < editorScrollerRect.top && !specialHandlingForCaret) {\n addedToTop = floatingElemRect.height + targetRect.height + verticalGap * 2\n\n top += addedToTop\n }\n\n if (horizontalPosition === 'center') {\n if (left + floatingElemRect.width > editorScrollerRect.right) {\n left = editorScrollerRect.right - floatingElemRect.width - horizontalOffset\n } else if (left < editorScrollerRect.left) {\n left = editorScrollerRect.left + horizontalOffset\n }\n } else {\n if (left + floatingElemRect.width > editorScrollerRect.right) {\n left = editorScrollerRect.right - floatingElemRect.width - horizontalOffset\n }\n }\n\n left -= anchorElementRect.left\n\n floatingElem.style.opacity = '1'\n\n if (specialHandlingForCaret && anchorFlippedOffset !== 0) {\n // Floating select toolbar was flipped (positioned below text rather than above). Thus, the caret now needs to be positioned\n // on the other side and rotated.\n top -= anchorElementRect.bottom - anchorFlippedOffset + floatingElemRect.height - 3\n // top += anchorFlippedOffset - anchorElementRect.height - floatingElemRect.height + 2\n floatingElem.style.transform = `translate(${left}px, ${top}px) rotate(180deg)`\n } else {\n top -= anchorElementRect.top\n\n floatingElem.style.transform = `translate(${left}px, ${top}px)`\n }\n\n return addedToTop\n}\n"],"names":["VERTICAL_GAP","HORIZONTAL_OFFSET","setFloatingElemPosition","args","alwaysDisplayOnTop","anchorElem","anchorFlippedOffset","floatingElem","horizontalOffset","horizontalPosition","specialHandlingForCaret","targetRect","verticalGap","scrollerElem","parentElement","style","opacity","transform","floatingElemRect","getBoundingClientRect","anchorElementRect","editorScrollerRect","top","height","left","width","addedToTop","right","bottom"],"mappings":"AAAA,MAAMA,eAAe;AACrB,MAAMC,oBAAoB;AAE1B,0BAA0B;AAC1B,iJAAiJ;AACjJ,4JAA4J;AAC5J,uHAAuH;AACvH,OAAO,SAASC,wBAAwBC,IAUvC;IACC,MAAM,EACJC,qBAAqB,KAAK,EAC1BC,UAAU,EACVC,sBAAsB,CAAC,EACvBC,YAAY,EACZC,mBAAmBP,iBAAiB,EACpCQ,qBAAqB,MAAM,EAC3BC,0BAA0B,KAAK,EAC/BC,UAAU,EACVC,cAAcZ,YAAY,EAC3B,GAAGG;IACJ,mDAAmD;IACnD,MAAMU,eAAeR,WAAWS,aAAa;IAE7C,IAAIH,eAAe,QAAQE,gBAAgB,MAAM;QAC/CN,aAAaQ,KAAK,CAACC,OAAO,GAAG;QAC7BT,aAAaQ,KAAK,CAACE,SAAS,GAAG;QAC/B;IACF;IAEA,MAAMC,mBAAmBX,aAAaY,qBAAqB;IAC3D,MAAMC,oBAAoBf,WAAWc,qBAAqB;IAC1D,MAAME,qBAAqBR,aAAaM,qBAAqB;IAE7D,IAAIG,MAAMX,WAAWW,GAAG,GAAGJ,iBAAiBK,MAAM,GAAGX;IACrD,IAAIY,OAAOb,WAAWa,IAAI,GAAGhB;IAE7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,"sources":["../../../src/lexical/utils/setFloatingElemPositionForLinkEditor.ts"],"sourcesContent":["const VERTICAL_GAP = 10\nconst HORIZONTAL_OFFSET = 5\n\nexport function setFloatingElemPositionForLinkEditor(\n targetRect: DOMRect | null,\n floatingElem: HTMLElement,\n anchorElem: HTMLElement,\n verticalGap: number = VERTICAL_GAP,\n horizontalOffset: number = HORIZONTAL_OFFSET,\n): void {\n const scrollerElem = anchorElem.parentElement\n\n if (targetRect === null || scrollerElem == null) {\n floatingElem.style.opacity = '0'\n floatingElem.style.transform = 'translate(-10000px, -10000px)'\n return\n }\n\n const floatingElemRect = floatingElem.getBoundingClientRect()\n const anchorElementRect = anchorElem.getBoundingClientRect()\n const editorScrollerRect = scrollerElem.getBoundingClientRect()\n\n let top = targetRect.top - verticalGap\n let left = targetRect.left - horizontalOffset\n\n if (top < editorScrollerRect.top) {\n top += floatingElemRect.height + targetRect.height + verticalGap * 2\n }\n\n if (left + floatingElemRect.width > editorScrollerRect.right) {\n left = editorScrollerRect.right - floatingElemRect.width - horizontalOffset\n }\n\n top -= anchorElementRect.top\n left -= anchorElementRect.left\n\n floatingElem.style.opacity = '1'\n floatingElem.style.transform = `translate(${left}px, ${top}px)`\n}\n"],"names":["VERTICAL_GAP","HORIZONTAL_OFFSET","setFloatingElemPositionForLinkEditor","targetRect","floatingElem","anchorElem","verticalGap","horizontalOffset","scrollerElem","parentElement","style","opacity","transform","floatingElemRect","getBoundingClientRect","anchorElementRect","editorScrollerRect","top","left","height","width","right"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,MAAMA,eAAe;AACrB,MAAMC,oBAAoB;AAE1B,OAAO,SAASC,qCACdC,UAA0B,EAC1BC,YAAyB,EACzBC,UAAuB,EACvBC,cAAsBN,YAAY,EAClCO,mBAA2BN,iBAAiB;IAE5C,MAAMO,eAAeH,WAAWI,aAAa;IAE7C,IAAIN,eAAe,QAAQK,gBAAgB,MAAM;QAC/CJ,aAAaM,KAAK,CAACC,OAAO,GAAG;QAC7BP,aAAaM,KAAK,CAACE,SAAS,GAAG;QAC/B;IACF;IAEA,MAAMC,mBAAmBT,aAAaU,qBAAqB;IAC3D,MAAMC,oBAAoBV,WAAWS,qBAAqB;IAC1D,MAAME,qBAAqBR,aAAaM,qBAAqB;IAE7D,IAAIG,MAAMd,WAAWc,GAAG,GAAGX;IAC3B,IAAIY,OAAOf,WAAWe,IAAI,GAAGX;IAE7B,IAAIU,MAAMD,mBAAmBC,GAAG,EAAE;QAChCA,OAAOJ,iBAAiBM,MAAM,GAAGhB,WAAWgB,MAAM,GAAGb,cAAc;IACrE;IAEA,IAAIY,OAAOL,iBAAiBO,KAAK,GAAGJ,mBAAmBK,KAAK,EAAE;QAC5DH,OAAOF,mBAAmBK,KAAK,GAAGR,iBAAiBO,KAAK,GAAGb;IAC7D;IAEAU,OAAOF,kBAAkBE,GAAG;IAC5BC,QAAQH,kBAAkBG,IAAI;IAE9Bd,aAAaM,KAAK,CAACC,OAAO,GAAG;IAC7BP,aAAaM,KAAK,CAACE,SAAS,GAAG,CAAC,UAAU,EAAEM,KAAK,IAAI,EAAED,IAAI,GAAG,CAAC;AACjE"}
1
+ {"version":3,"sources":["../../../src/lexical/utils/setFloatingElemPositionForLinkEditor.ts"],"sourcesContent":["const VERTICAL_GAP = 10\nconst HORIZONTAL_OFFSET = 5\n\nexport function setFloatingElemPositionForLinkEditor(\n targetRect: DOMRect | null,\n floatingElem: HTMLElement,\n anchorElem: HTMLElement,\n verticalGap: number = VERTICAL_GAP,\n horizontalOffset: number = HORIZONTAL_OFFSET,\n): void {\n const scrollerElem = anchorElem.parentElement\n\n if (targetRect === null || scrollerElem == null) {\n floatingElem.style.opacity = '0'\n floatingElem.style.transform = 'translate(-10000px, -10000px)'\n return\n }\n\n const floatingElemRect = floatingElem.getBoundingClientRect()\n const anchorElementRect = anchorElem.getBoundingClientRect()\n const editorScrollerRect = scrollerElem.getBoundingClientRect()\n\n let top = targetRect.top - verticalGap\n let left = targetRect.left - horizontalOffset\n\n if (top < editorScrollerRect.top) {\n top += floatingElemRect.height + targetRect.height + verticalGap * 2\n }\n\n if (left + floatingElemRect.width > editorScrollerRect.right) {\n left = editorScrollerRect.right - floatingElemRect.width - horizontalOffset\n }\n\n top -= anchorElementRect.top\n left -= anchorElementRect.left\n\n floatingElem.style.opacity = '1'\n floatingElem.style.transform = `translate(${left}px, ${top}px)`\n}\n"],"names":["VERTICAL_GAP","HORIZONTAL_OFFSET","setFloatingElemPositionForLinkEditor","targetRect","floatingElem","anchorElem","verticalGap","horizontalOffset","scrollerElem","parentElement","style","opacity","transform","floatingElemRect","getBoundingClientRect","anchorElementRect","editorScrollerRect","top","left","height","width","right"],"mappings":"AAAA,MAAMA,eAAe;AACrB,MAAMC,oBAAoB;AAE1B,OAAO,SAASC,qCACdC,UAA0B,EAC1BC,YAAyB,EACzBC,UAAuB,EACvBC,cAAsBN,YAAY,EAClCO,mBAA2BN,iBAAiB;IAE5C,MAAMO,eAAeH,WAAWI,aAAa;IAE7C,IAAIN,eAAe,QAAQK,gBAAgB,MAAM;QAC/CJ,aAAaM,KAAK,CAACC,OAAO,GAAG;QAC7BP,aAAaM,KAAK,CAACE,SAAS,GAAG;QAC/B;IACF;IAEA,MAAMC,mBAAmBT,aAAaU,qBAAqB;IAC3D,MAAMC,oBAAoBV,WAAWS,qBAAqB;IAC1D,MAAME,qBAAqBR,aAAaM,qBAAqB;IAE7D,IAAIG,MAAMd,WAAWc,GAAG,GAAGX;IAC3B,IAAIY,OAAOf,WAAWe,IAAI,GAAGX;IAE7B,IAAIU,MAAMD,mBAAmBC,GAAG,EAAE;QAChCA,OAAOJ,iBAAiBM,MAAM,GAAGhB,WAAWgB,MAAM,GAAGb,cAAc;IACrE;IAEA,IAAIY,OAAOL,iBAAiBO,KAAK,GAAGJ,mBAAmBK,KAAK,EAAE;QAC5DH,OAAOF,mBAAmBK,KAAK,GAAGR,iBAAiBO,KAAK,GAAGb;IAC7D;IAEAU,OAAOF,kBAAkBE,GAAG;IAC5BC,QAAQH,kBAAkBG,IAAI;IAE9Bd,aAAaM,KAAK,CAACC,OAAO,GAAG;IAC7BP,aAAaM,KAAK,CAACE,SAAS,GAAG,CAAC,UAAU,EAAEM,KAAK,IAAI,EAAED,IAAI,GAAG,CAAC;AACjE"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lexical/utils/swipe.ts"],"sourcesContent":["type Force = [number, number]\ntype Listener = (force: Force, e: TouchEvent) => void\ninterface ElementValues {\n handleTouchend: (e: TouchEvent) => void\n handleTouchstart: (e: TouchEvent) => void\n listeners: Set<Listener>\n start: Force | null\n}\n\nconst elements = new WeakMap<HTMLElement, ElementValues>()\n\nfunction readTouch(e: TouchEvent): [number, number] | null {\n const touch = e.changedTouches[0]\n if (touch === undefined) {\n return null\n }\n return [touch.clientX, touch.clientY]\n}\n\nfunction addListener(element: HTMLElement, cb: Listener): () => void {\n let elementValues = elements.get(element)\n if (elementValues === undefined) {\n const listeners = new Set<Listener>()\n const handleTouchstart = (e: TouchEvent): void => {\n if (elementValues !== undefined) {\n elementValues.start = readTouch(e)\n }\n }\n const handleTouchend = (e: TouchEvent): void => {\n if (elementValues === undefined) {\n return\n }\n const { start } = elementValues\n if (start === null) {\n return\n }\n const end = readTouch(e)\n for (const listener of listeners) {\n if (end !== null) {\n listener([end[0] - start[0], end[1] - start[1]], e)\n }\n }\n }\n element.addEventListener('touchstart', handleTouchstart)\n element.addEventListener('touchend', handleTouchend)\n\n elementValues = {\n handleTouchend,\n handleTouchstart,\n listeners,\n start: null,\n }\n elements.set(element, elementValues)\n }\n elementValues.listeners.add(cb)\n return () => {\n deleteListener(element, cb)\n }\n}\n\nfunction deleteListener(element: HTMLElement, cb: Listener): void {\n const elementValues = elements.get(element)\n if (elementValues === undefined) {\n return\n }\n const { listeners } = elementValues\n listeners.delete(cb)\n if (listeners.size === 0) {\n elements.delete(element)\n element.removeEventListener('touchstart', elementValues.handleTouchstart)\n element.removeEventListener('touchend', elementValues.handleTouchend)\n }\n}\n\nexport function addSwipeLeftListener(\n element: HTMLElement,\n cb: (_force: number, e: TouchEvent) => void,\n): () => void {\n return addListener(element, (force, e) => {\n const [x, y] = force\n if (x < 0 && -x > Math.abs(y)) {\n cb(x, e)\n }\n })\n}\n\nexport function addSwipeRightListener(\n element: HTMLElement,\n cb: (_force: number, e: TouchEvent) => void,\n): () => void {\n return addListener(element, (force, e) => {\n const [x, y] = force\n if (x > 0 && x > Math.abs(y)) {\n cb(x, e)\n }\n })\n}\n\nexport function addSwipeUpListener(\n element: HTMLElement,\n cb: (_force: number, e: TouchEvent) => void,\n): () => void {\n return addListener(element, (force, e) => {\n const [x, y] = force\n if (y < 0 && -y > Math.abs(x)) {\n cb(x, e)\n }\n })\n}\n\nexport function addSwipeDownListener(\n element: HTMLElement,\n cb: (_force: number, e: TouchEvent) => void,\n): () => void {\n return addListener(element, (force, e) => {\n const [x, y] = force\n if (y > 0 && y > Math.abs(x)) {\n cb(x, e)\n }\n })\n}\n"],"names":["elements","WeakMap","readTouch","e","touch","changedTouches","undefined","clientX","clientY","addListener","element","cb","elementValues","get","listeners","Set","handleTouchstart","start","handleTouchend","end","listener","addEventListener","set","add","deleteListener","delete","size","removeEventListener","addSwipeLeftListener","force","x","y","Math","abs","addSwipeRightListener","addSwipeUpListener","addSwipeDownListener"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AASA,MAAMA,WAAW,IAAIC;AAErB,SAASC,UAAUC,CAAa;IAC9B,MAAMC,QAAQD,EAAEE,cAAc,CAAC,EAAE;IACjC,IAAID,UAAUE,WAAW;QACvB,OAAO;IACT;IACA,OAAO;QAACF,MAAMG,OAAO;QAAEH,MAAMI,OAAO;KAAC;AACvC;AAEA,SAASC,YAAYC,OAAoB,EAAEC,EAAY;IACrD,IAAIC,gBAAgBZ,SAASa,GAAG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S,CAACmB,OAAO1B;QAClC,MAAM,CAAC2B,GAAGC,EAAE,GAAGF;QACf,IAAIC,IAAI,KAAK,CAACA,IAAIE,KAAKC,GAAG,CAACF,IAAI;YAC7BpB,GAAGmB,GAAG3B;QACR;IACF;AACF;AAEA,OAAO,SAAS+B,sBACdxB,OAAoB,EACpBC,EAA2C;IAE3C,OAAOF,YAAYC,SAAS,CAACmB,OAAO1B;QAClC,MAAM,CAAC2B,GAAGC,EAAE,GAAGF;QACf,IAAIC,IAAI,KAAKA,IAAIE,KAAKC,GAAG,CAACF,IAAI;YAC5BpB,GAAGmB,GAAG3B;QACR;IACF;AACF;AAEA,OAAO,SAASgC,mBACdzB,OAAoB,EACpBC,EAA2C;IAE3C,OAAOF,YAAYC,SAAS,CAACmB,OAAO1B;QAClC,MAAM,CAAC2B,GAAGC,EAAE,GAAGF;QACf,IAAIE,IAAI,KAAK,CAACA,IAAIC,KAAKC,GAAG,CAACH,IAAI;YAC7BnB,GAAGmB,GAAG3B;QACR;IACF;AACF;AAEA,OAAO,SAASiC,qBACd1B,OAAoB,EACpBC,EAA2C;IAE3C,OAAOF,YAAYC,SAAS,CAACmB,OAAO1B;QAClC,MAAM,CAAC2B,GAAGC,EAAE,GAAGF;QACf,IAAIE,IAAI,KAAKA,IAAIC,KAAKC,GAAG,CAACH,IAAI;YAC5BnB,GAAGmB,GAAG3B;QACR;IACF;AACF"}
1
+ {"version":3,"sources":["../../../src/lexical/utils/swipe.ts"],"sourcesContent":["type Force = [number, number]\ntype Listener = (force: Force, e: TouchEvent) => void\ninterface ElementValues {\n handleTouchend: (e: TouchEvent) => void\n handleTouchstart: (e: TouchEvent) => void\n listeners: Set<Listener>\n start: Force | null\n}\n\nconst elements = new WeakMap<HTMLElement, ElementValues>()\n\nfunction readTouch(e: TouchEvent): [number, number] | null {\n const touch = e.changedTouches[0]\n if (touch === undefined) {\n return null\n }\n return [touch.clientX, touch.clientY]\n}\n\nfunction addListener(element: HTMLElement, cb: Listener): () => void {\n let elementValues = elements.get(element)\n if (elementValues === undefined) {\n const listeners = new Set<Listener>()\n const handleTouchstart = (e: TouchEvent): void => {\n if (elementValues !== undefined) {\n elementValues.start = readTouch(e)\n }\n }\n const handleTouchend = (e: TouchEvent): void => {\n if (elementValues === undefined) {\n return\n }\n const { start } = elementValues\n if (start === null) {\n return\n }\n const end = readTouch(e)\n for (const listener of listeners) {\n if (end !== null) {\n listener([end[0] - start[0], end[1] - start[1]], e)\n }\n }\n }\n element.addEventListener('touchstart', handleTouchstart)\n element.addEventListener('touchend', handleTouchend)\n\n elementValues = {\n handleTouchend,\n handleTouchstart,\n listeners,\n start: null,\n }\n elements.set(element, elementValues)\n }\n elementValues.listeners.add(cb)\n return () => {\n deleteListener(element, cb)\n }\n}\n\nfunction deleteListener(element: HTMLElement, cb: Listener): void {\n const elementValues = elements.get(element)\n if (elementValues === undefined) {\n return\n }\n const { listeners } = elementValues\n listeners.delete(cb)\n if (listeners.size === 0) {\n elements.delete(element)\n element.removeEventListener('touchstart', elementValues.handleTouchstart)\n element.removeEventListener('touchend', elementValues.handleTouchend)\n }\n}\n\nexport function addSwipeLeftListener(\n element: HTMLElement,\n cb: (_force: number, e: TouchEvent) => void,\n): () => void {\n return addListener(element, (force, e) => {\n const [x, y] = force\n if (x < 0 && -x > Math.abs(y)) {\n cb(x, e)\n }\n })\n}\n\nexport function addSwipeRightListener(\n element: HTMLElement,\n cb: (_force: number, e: TouchEvent) => void,\n): () => void {\n return addListener(element, (force, e) => {\n const [x, y] = force\n if (x > 0 && x > Math.abs(y)) {\n cb(x, e)\n }\n })\n}\n\nexport function addSwipeUpListener(\n element: HTMLElement,\n cb: (_force: number, e: TouchEvent) => void,\n): () => void {\n return addListener(element, (force, e) => {\n const [x, y] = force\n if (y < 0 && -y > Math.abs(x)) {\n cb(x, e)\n }\n })\n}\n\nexport function addSwipeDownListener(\n element: HTMLElement,\n cb: (_force: number, e: TouchEvent) => void,\n): () => void {\n return addListener(element, (force, e) => {\n const [x, y] = force\n if (y > 0 && y > Math.abs(x)) {\n cb(x, e)\n }\n })\n}\n"],"names":["elements","WeakMap","readTouch","e","touch","changedTouches","undefined","clientX","clientY","addListener","element","cb","elementValues","get","listeners","Set","handleTouchstart","start","handleTouchend","end","listener","addEventListener","set","add","deleteListener","delete","size","removeEventListener","addSwipeLeftListener","force","x","y","Math","abs","addSwipeRightListener","addSwipeUpListener","addSwipeDownListener"],"mappings":"AASA,MAAMA,WAAW,IAAIC;AAErB,SAASC,UAAUC,CAAa;IAC9B,MAAMC,QAAQD,EAAEE,cAAc,CAAC,EAAE;IACjC,IAAID,UAAUE,WAAW;QACvB,OAAO;IACT;IACA,OAAO;QAACF,MAAMG,OAAO;QAAEH,MAAMI,OAAO;KAAC;AACvC;AAEA,SAASC,YAAYC,OAAoB,EAAEC,EAAY;IACrD,IAAIC,gBAAgBZ,SAASa,GAAG,CAACH;IACjC,IAAIE,kBAAkBN,WAAW;QAC/B,MAAMQ,YAAY,IAAIC;QACtB,MAAMC,mBAAmB,CAACb;YACxB,IAAIS,kBAAkBN,WAAW;gBAC/BM,cAAcK,KAAK,GAAGf,UAAUC;YAClC;QACF;QACA,MAAMe,iBAAiB,CAACf;YACtB,IAAIS,kBAAkBN,WAAW;gBAC/B;YACF;YACA,MAAM,EAAEW,KAAK,EAAE,GAAGL;YAClB,IAAIK,UAAU,MAAM;gBAClB;YACF;YACA,MAAME,MAAMjB,UAAUC;YACtB,KAAK,MAAMiB,YAAYN,UAAW;gBAChC,IAAIK,QAAQ,MAAM;oBAChBC,SAAS;wBAACD,GAAG,CAAC,EAAE,GAAGF,KAAK,CAAC,EAAE;wBAAEE,GAAG,CAAC,EAAE,GAAGF,KAAK,CAAC,EAAE;qBAAC,EAAEd;gBACnD;YACF;QACF;QACAO,QAAQW,gBAAgB,CAAC,cAAcL;QACvCN,QAAQW,gBAAgB,CAAC,YAAYH;QAErCN,gBAAgB;YACdM;YACAF;YACAF;YACAG,OAAO;QACT;QACAjB,SAASsB,GAAG,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AAOF,YAAYC,SAAS,CAACmB,OAAO1B;QAClC,MAAM,CAAC2B,GAAGC,EAAE,GAAGF;QACf,IAAIE,IAAI,KAAKA,IAAIC,KAAKC,GAAG,CAACH,IAAI;YAC5BnB,GAAGmB,GAAG3B;QACR;IACF;AACF"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/lexical/utils/url.ts"],"sourcesContent":["export function sanitizeUrl(url: string): string {\n /** A pattern that matches safe URLs. */\n const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi\n\n /** A pattern that matches safe data URLs. */\n const DATA_URL_PATTERN =\n /^data:(?:image\\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\\/(?:mpeg|mp4|ogg|webm)|audio\\/(?:mp3|oga|ogg|opus));base64,[a-z\\d+/]+=*$/i\n\n url = String(url).trim()\n\n if (url.match(SAFE_URL_PATTERN) != null || url.match(DATA_URL_PATTERN) != null) return url\n\n return 'https://'\n}\n\n// Source: https://stackoverflow.com/a/8234912/2013580\nconst absoluteRegExp =\n /(?:[A-Za-z]{3,9}:(?:\\/\\/)?(?:[-;:&=+$,\\w]+@)?[A-Za-z\\d.-]+|(?:www.|[-;:&=+$,\\w]+@)[A-Za-z\\d.-]+)(?:\\/[+~%/.\\w-]*)?\\??[-+=&;%@.\\w]*#?\\w*/\n\n/**\n * This regex checks for relative URLs starting with / or anchor links starting with # in a string. Tested for the following use cases:\n * - /privacy-policy\n * - /privacy-policy#primary-terms\n * - #primary-terms\n * */\nconst relativeOrAnchorRegExp = /^[\\w\\-./]*(?:#\\w[\\w-]*)?$/\n\n// Do not keep validateUrl function too loose. This is run when pasting in text, to determine if links are in that text and if it should create AutoLinkNodes.\n// This is why we do not allow stuff like anchors here, as we don't want copied anchors to be turned into AutoLinkNodes.\nexport function validateUrl(url: string): boolean {\n // TODO Fix UI for link insertion; it should never default to an invalid URL such as https://.\n // Maybe show a dialog where they user can type the URL before inserting it.\n\n if (!url) return false\n\n if (url === 'https://') return true\n\n // This makes sure URLs starting with www. instead of https are valid too\n if (absoluteRegExp.test(url)) return true\n\n // Check relative or anchor links\n if (relativeOrAnchorRegExp.test(url)) return true\n\n // While this doesn't allow URLs starting with www (which is why we use the regex above), it does properly handle tel: URLs\n try {\n new URL(url)\n return true\n } catch {\n /* empty */\n }\n\n return false\n}\n"],"names":["sanitizeUrl","url","SAFE_URL_PATTERN","DATA_URL_PATTERN","String","trim","match","absoluteRegExp","relativeOrAnchorRegExp","validateUrl","test","URL"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,OAAO,SAASA,YAAYC,GAAW;IACrC,uCAAuC,GACvC,MAAMC,mBAAmB;IAEzB,2CAA2C,GAC3C,MAAMC,mBACJ;IAEFF,MAAMG,OAAOH,KAAKI,IAAI;IAEtB,IAAIJ,IAAIK,KAAK,CAACJ,qBAAqB,QAAQD,IAAIK,KAAK,CAACH,qBAAqB,MAAM,OAAOF;IAEvF,OAAO;AACT;AAEA,sDAAsD;AACtD,MAAMM,iBACJ;AAEF;;;;;IAKI,GACJ,MAAMC,yBAAyB;AAE/B,8JAA8J;AAC9J,wHAAwH;AACxH,OAAO,SAASC,YAAYR,GAAW;IACrC,8FAA8F;IAC9F,4EAA4E;IAE5E,IAAI,CAACA,KAAK,OAAO;IAEjB,IAAIA,QAAQ,YAAY,OAAO;IAE/B,yEAAyE;IACzE,IAAIM,eAAeG,IAAI,CAACT,MAAM,OAAO;IAErC,iCAAiC;IACjC,IAAIO,uBAAuBE,IAAI,CAACT,MAAM,OAAO;IAE7C,2HAA2H;IAC3H,IAAI;QACF,IAAIU,IAAIV;QACR,OAAO;IACT,EAAE,OAAM;IACN,SAAS,GACX;IAEA,OAAO;AACT"}
1
+ {"version":3,"sources":["../../../src/lexical/utils/url.ts"],"sourcesContent":["export function sanitizeUrl(url: string): string {\n /** A pattern that matches safe URLs. */\n const SAFE_URL_PATTERN = /^(?:(?:https?|mailto|ftp|tel|file|sms):|[^&:/?#]*(?:[/?#]|$))/gi\n\n /** A pattern that matches safe data URLs. */\n const DATA_URL_PATTERN =\n /^data:(?:image\\/(?:bmp|gif|jpeg|jpg|png|tiff|webp)|video\\/(?:mpeg|mp4|ogg|webm)|audio\\/(?:mp3|oga|ogg|opus));base64,[a-z\\d+/]+=*$/i\n\n url = String(url).trim()\n\n if (url.match(SAFE_URL_PATTERN) != null || url.match(DATA_URL_PATTERN) != null) return url\n\n return 'https://'\n}\n\n// Source: https://stackoverflow.com/a/8234912/2013580\nconst absoluteRegExp =\n /(?:[A-Za-z]{3,9}:(?:\\/\\/)?(?:[-;:&=+$,\\w]+@)?[A-Za-z\\d.-]+|(?:www.|[-;:&=+$,\\w]+@)[A-Za-z\\d.-]+)(?:\\/[+~%/.\\w-]*)?\\??[-+=&;%@.\\w]*#?\\w*/\n\n/**\n * This regex checks for relative URLs starting with / or anchor links starting with # in a string. Tested for the following use cases:\n * - /privacy-policy\n * - /privacy-policy#primary-terms\n * - #primary-terms\n * */\nconst relativeOrAnchorRegExp = /^[\\w\\-./]*(?:#\\w[\\w-]*)?$/\n\n// Do not keep validateUrl function too loose. This is run when pasting in text, to determine if links are in that text and if it should create AutoLinkNodes.\n// This is why we do not allow stuff like anchors here, as we don't want copied anchors to be turned into AutoLinkNodes.\nexport function validateUrl(url: string): boolean {\n // TODO Fix UI for link insertion; it should never default to an invalid URL such as https://.\n // Maybe show a dialog where they user can type the URL before inserting it.\n\n if (!url) return false\n\n if (url === 'https://') return true\n\n // This makes sure URLs starting with www. instead of https are valid too\n if (absoluteRegExp.test(url)) return true\n\n // Check relative or anchor links\n if (relativeOrAnchorRegExp.test(url)) return true\n\n // While this doesn't allow URLs starting with www (which is why we use the regex above), it does properly handle tel: URLs\n try {\n new URL(url)\n return true\n } catch {\n /* empty */\n }\n\n return false\n}\n"],"names":["sanitizeUrl","url","SAFE_URL_PATTERN","DATA_URL_PATTERN","String","trim","match","absoluteRegExp","relativeOrAnchorRegExp","validateUrl","test","URL"],"mappings":"AAAA,OAAO,SAASA,YAAYC,GAAW;IACrC,uCAAuC,GACvC,MAAMC,mBAAmB;IAEzB,2CAA2C,GAC3C,MAAMC,mBACJ;IAEFF,MAAMG,OAAOH,KAAKI,IAAI;IAEtB,IAAIJ,IAAIK,KAAK,CAACJ,qBAAqB,QAAQD,IAAIK,KAAK,CAACH,qBAAqB,MAAM,OAAOF;IAEvF,OAAO;AACT;AAEA,sDAAsD;AACtD,MAAMM,iBACJ;AAEF;;;;;IAKI,GACJ,MAAMC,yBAAyB;AAE/B,8JAA8J;AAC9J,wHAAwH;AACxH,OAAO,SAASC,YAAYR,GAAW;IACrC,8FAA8F;IAC9F,4EAA4E;IAE5E,IAAI,CAACA,KAAK,OAAO;IAEjB,IAAIA,QAAQ,YAAY,OAAO;IAE/B,yEAAyE;IACzE,IAAIM,eAAeG,IAAI,CAACT,MAAM,OAAO;IAErC,iCAAiC;IACjC,IAAIO,uBAAuBE,IAAI,CAACT,MAAM,OAAO;IAE7C,2HAA2H;IAC3H,IAAI;QACF,IAAIU,IAAIV;QACR,OAAO;IACT,EAAE,OAAM;IACN,SAAS,GACX;IAEA,OAAO;AACT"}
@@ -0,0 +1,32 @@
1
+ import type { SerializedLineBreakNode as _SerializedLineBreakNode, SerializedTextNode as _SerializedTextNode, SerializedEditorState, SerializedElementNode, SerializedLexicalNode, Spread } from 'lexical';
2
+ import type { SerializedQuoteNode } from './features/blockquote/feature.server.js';
3
+ import type { SerializedBlockNode } from './features/blocks/nodes/BlocksNode.js';
4
+ import type { SerializedInlineBlockNode } from './features/blocks/nodes/InlineBlocksNode.js';
5
+ import type { SerializedTableCellNode, SerializedTableNode, SerializedTableRowNode } from './features/experimental_table/feature.server.js';
6
+ import type { SerializedHeadingNode } from './features/heading/feature.server.js';
7
+ import type { SerializedHorizontalRuleNode } from './features/horizontalRule/nodes/HorizontalRuleNode.js';
8
+ import type { SerializedAutoLinkNode, SerializedLinkNode } from './features/link/nodes/types.js';
9
+ import type { SerializedListItemNode, SerializedListNode } from './features/lists/plugin/index.js';
10
+ import type { SerializedRelationshipNode } from './features/relationship/nodes/RelationshipNode.js';
11
+ import type { SerializedUploadNode } from './features/upload/nodes/UploadNode.js';
12
+ export type { SerializedAutoLinkNode, SerializedBlockNode, SerializedHeadingNode, SerializedHorizontalRuleNode, SerializedInlineBlockNode, SerializedLinkNode, SerializedListItemNode, SerializedListNode, SerializedQuoteNode, SerializedRelationshipNode, SerializedTableCellNode, SerializedTableNode, SerializedTableRowNode, SerializedUploadNode, };
13
+ export type SerializedParagraphNode<T extends SerializedLexicalNode = SerializedLexicalNode> = Spread<{
14
+ textFormat: number;
15
+ type: 'paragraph';
16
+ }, SerializedElementNode<T>>;
17
+ export type SerializedTextNode = Spread<{
18
+ children?: never;
19
+ type: 'text';
20
+ }, _SerializedTextNode>;
21
+ export type SerializedLineBreakNode = Spread<{
22
+ children?: never;
23
+ type: 'linebreak';
24
+ }, _SerializedLineBreakNode>;
25
+ type RecursiveNodes<T extends SerializedLexicalNode, Depth extends number = 4> = Depth extends 0 ? T : {
26
+ children?: RecursiveNodes<T, DecrementDepth<Depth>>[];
27
+ } & T;
28
+ type DecrementDepth<N extends number> = [0, 0, 1, 2, 3, 4][N];
29
+ export type TypedEditorState<T extends SerializedLexicalNode = SerializedLexicalNode> = SerializedEditorState<RecursiveNodes<T>>;
30
+ export type DefaultNodeTypes = SerializedAutoLinkNode | SerializedHeadingNode | SerializedHorizontalRuleNode | SerializedLineBreakNode | SerializedLinkNode | SerializedListItemNode | SerializedListNode | SerializedParagraphNode | SerializedQuoteNode | SerializedRelationshipNode | SerializedTextNode | SerializedUploadNode;
31
+ export type DefaultTypedEditorState<T extends SerializedLexicalNode = SerializedLexicalNode> = TypedEditorState<DefaultNodeTypes | T>;
32
+ //# sourceMappingURL=nodeTypes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"nodeTypes.d.ts","sourceRoot":"","sources":["../src/nodeTyp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,"sources":["../src/nodeTypes.ts"],"sourcesContent":["import type {\n SerializedLineBreakNode as _SerializedLineBreakNode,\n SerializedTextNode as _SerializedTextNode,\n SerializedEditorState,\n SerializedElementNode,\n SerializedLexicalNode,\n Spread,\n} from 'lexical'\n\nimport type { SerializedQuoteNode } from './features/blockquote/feature.server.js'\nimport type { SerializedBlockNode } from './features/blocks/nodes/BlocksNode.js'\nimport type { SerializedInlineBlockNode } from './features/blocks/nodes/InlineBlocksNode.js'\nimport type {\n SerializedTableCellNode,\n SerializedTableNode,\n SerializedTableRowNode,\n} from './features/experimental_table/feature.server.js'\nimport type { SerializedHeadingNode } from './features/heading/feature.server.js'\nimport type { SerializedHorizontalRuleNode } from './features/horizontalRule/nodes/HorizontalRuleNode.js'\nimport type { SerializedAutoLinkNode, SerializedLinkNode } from './features/link/nodes/types.js'\nimport type { SerializedListItemNode, SerializedListNode } from './features/lists/plugin/index.js'\nimport type { SerializedRelationshipNode } from './features/relationship/nodes/RelationshipNode.js'\nimport type { SerializedUploadNode } from './features/upload/nodes/UploadNode.js'\n\nexport type {\n SerializedAutoLinkNode,\n SerializedBlockNode,\n SerializedHeadingNode,\n SerializedHorizontalRuleNode,\n SerializedInlineBlockNode,\n SerializedLinkNode,\n SerializedListItemNode,\n SerializedListNode,\n SerializedQuoteNode,\n SerializedRelationshipNode,\n SerializedTableCellNode,\n SerializedTableNode,\n SerializedTableRowNode,\n SerializedUploadNode,\n}\n\nexport type SerializedParagraphNode<T extends SerializedLexicalNode = SerializedLexicalNode> =\n Spread<\n {\n textFormat: number\n type: 'paragraph'\n },\n SerializedElementNode<T>\n >\nexport type SerializedTextNode = Spread<\n {\n children?: never // required so that our typed editor state doesn't automatically add children\n type: 'text'\n },\n _SerializedTextNode\n>\n\nexport type SerializedLineBreakNode = Spread<\n {\n children?: never // required so that our typed editor state doesn't automatically add children\n type: 'linebreak'\n },\n _SerializedLineBreakNode\n>\n\ntype RecursiveNodes<T extends SerializedLexicalNode, Depth extends number = 4> = Depth extends 0\n ? T\n : { children?: RecursiveNodes<T, DecrementDepth<Depth>>[] } & T\n\ntype DecrementDepth<N extends number> = [0, 0, 1, 2, 3, 4][N]\n\nexport type TypedEditorState<T extends SerializedLexicalNode = SerializedLexicalNode> =\n SerializedEditorState<RecursiveNodes<T>>\n\nexport type DefaultNodeTypes =\n | SerializedAutoLinkNode\n //| SerializedBlockNode // Not included by default\n | SerializedHeadingNode\n | SerializedHorizontalRuleNode\n | SerializedLineBreakNode\n | SerializedLinkNode\n | SerializedListItemNode\n | SerializedListNode\n | SerializedParagraphNode\n | SerializedQuoteNode\n | SerializedRelationshipNode\n | SerializedTextNode\n | SerializedUploadNode\n\nexport type DefaultTypedEditorState<T extends SerializedLexicalNode = SerializedLexicalNode> =\n TypedEditorState<DefaultNodeTypes | T>\n"],"names":[],"mappings":"AAyFA,WACwC"}
@@ -1 +1 @@
1
- {"version":3,"file":"defaultValue.d.ts","sourceRoot":"","sources":["../../src/populateGraphQL/defaultValue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAA+C,MAAM,SAAS,CAAA;AAEjG,eAAO,MAAM,oBAAoB,EAAE,qBA6BlC,CAAA"}
1
+ {"version":3,"file":"defaultValue.d.ts","sourceRoot":"","sources":["../../src/populateGraphQL/defaultValue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAA+C,MAAM,SAAS,CAAA;AAEjG,eAAO,MAAM,oBAAoB,EAAE,qBA8BlC,CAAA"}
@@ -19,6 +19,7 @@ export const defaultRichTextValue = {
19
19
  format: '',
20
20
  indent: 0,
21
21
  textFormat: 0,
22
+ textStyle: '',
22
23
  version: 1
23
24
  }
24
25
  ],
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/populateGraphQL/defaultValue.ts"],"sourcesContent":["import type { SerializedEditorState, SerializedParagraphNode, SerializedTextNode } from 'lexical'\n\nexport const defaultRichTextValue: SerializedEditorState = {\n root: {\n type: 'root',\n children: [\n {\n type: 'paragraph',\n children: [\n {\n type: 'text',\n detail: 0,\n format: 0,\n mode: 'normal',\n style: '',\n text: '',\n version: 1,\n } as SerializedTextNode,\n ],\n direction: null,\n format: '',\n indent: 0,\n textFormat: 0,\n version: 1,\n } as SerializedParagraphNode,\n ],\n direction: null,\n format: '',\n indent: 0,\n version: 1,\n },\n}\n"],"names":["defaultRichTextValue","root","type","children","detail","format","mode","style","text","version","direction","indent","textFormat"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,OAAO,MAAMA,uBAA8C;IACzDC,MAAM;QACJC,MAAM;QACNC,UAAU;YACR;gBACED,MAAM;gBACNC,UAAU;oBACR;wBACED,MAAM;wBACNE,QAAQ;wBACRC,QAAQ;wBACRC,MAAM;wBACNC,OAAO;wBACPC,MAAM;wBACNC,SAAS;oBACX;iBACD;gBACDC,WAAW;gBACXL,QAAQ;gBACRM,QAAQ;gBACRC,YAAY;gBACZH,SAAS;YACX;SACD;QACDC,WAAW;QACXL,QAAQ;QACRM,QAAQ;QACRF,SAAS;IACX;AACF,EAAC"}
1
+ {"version":3,"sources":["../../src/populateGraphQL/defaultValue.ts"],"sourcesContent":["import type { SerializedEditorState, SerializedParagraphNode, SerializedTextNode } from 'lexical'\n\nexport const defaultRichTextValue: SerializedEditorState = {\n root: {\n type: 'root',\n children: [\n {\n type: 'paragraph',\n children: [\n {\n type: 'text',\n detail: 0,\n format: 0,\n mode: 'normal',\n style: '',\n text: '',\n version: 1,\n } as SerializedTextNode,\n ],\n direction: null,\n format: '',\n indent: 0,\n textFormat: 0,\n textStyle: '',\n version: 1,\n } as SerializedParagraphNode,\n ],\n direction: null,\n format: '',\n indent: 0,\n version: 1,\n },\n}\n"],"names":["defaultRichTextValue","root","type","children","detail","format","mode","style","text","version","direction","indent","textFormat","textStyle"],"mappings":"AAEA,OAAO,MAAMA,uBAA8C;IACzDC,MAAM;QACJC,MAAM;QACNC,UAAU;YACR;gBACED,MAAM;gBACNC,UAAU;oBACR;wBACED,MAAM;wBACNE,QAAQ;wBACRC,QAAQ;wBACRC,MAAM;wBACNC,OAAO;wBACPC,MAAM;wBACNC,SAAS;oBACX;iBACD;gBACDC,WAAW;gBACXL,QAAQ;gBACRM,QAAQ;gBACRC,YAAY;gBACZC,WAAW;gBACXJ,SAAS;YACX;SACD;QACDC,WAAW;QACXL,QAAQ;QACRM,QAAQ;QACRF,SAAS;IACX;AACF,EAAC"}
@@ -1,4 +1,4 @@
1
- import type { PayloadRequestWithData } from 'payload';
1
+ import type { PayloadRequest } from 'payload';
2
2
  type Arguments = {
3
3
  currentDepth?: number;
4
4
  data: unknown;
@@ -6,12 +6,12 @@ type Arguments = {
6
6
  draft: boolean;
7
7
  key: number | string;
8
8
  overrideAccess: boolean;
9
- req: PayloadRequestWithData;
9
+ req: PayloadRequest;
10
10
  showHiddenFields: boolean;
11
11
  };
12
- export declare const populate: ({ id, collectionSlug, currentDepth, data, depth, draft, key, overrideAccess, req, showHiddenFields, }: Arguments & {
12
+ export declare const populate: ({ id, collectionSlug, currentDepth, data, depth, draft, key, overrideAccess, req, showHiddenFields, }: {
13
13
  collectionSlug: string;
14
14
  id: number | string;
15
- }) => Promise<void>;
15
+ } & Arguments) => Promise<void>;
16
16
  export {};
17
17
  //# sourceMappingURL=populate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"populate.d.ts","sourceRoot":"","sources":["../../src/populateGraphQL/populate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAIjE,KAAK,SAAS,GAAG;IACf,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,OAAO,CAAA;IACd,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,cAAc,EAAE,OAAO,CAAA;IACvB,GAAG,EAAE,sBAAsB,CAAA;IAC3B,gBAAgB,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,QAAQ,0GAWlB,SAAS,GAAG;IACb,cAAc,EAAE,MAAM,CAAA;IACtB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;CACpB,KAAG,OAAO,CAAC,IAAI,CA6Bf,CAAA"}
1
+ {"version":3,"file":"populate.d.ts","sourceRoot":"","sources":["../../src/populateGraphQL/populate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAI7C,KAAK,SAAS,GAAG;IACf,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,IAAI,EAAE,OAAO,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE,OAAO,CAAA;IACd,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,cAAc,EAAE,OAAO,CAAA;IACvB,GAAG,EAAE,cAAc,CAAA;IACnB,gBAAgB,EAAE,OAAO,CAAA;CAC1B,CAAA;AAED,eAAO,MAAM,QAAQ,0GAWlB;IACD,cAAc,EAAE,MAAM,CAAA;IACtB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAA;CACpB,GAAG,SAAS,KAAG,OAAO,CAAC,IAAI,CA6B3B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/populateGraphQL/populate.ts"],"sourcesContent":["import type { Collection, PayloadRequestWithData } from 'payload'\n\nimport { createDataloaderCacheKey } from 'payload'\n\ntype Arguments = {\n currentDepth?: number\n data: unknown\n depth: number\n draft: boolean\n key: number | string\n overrideAccess: boolean\n req: PayloadRequestWithData\n showHiddenFields: boolean\n}\n\nexport const populate = async ({\n id,\n collectionSlug,\n currentDepth,\n data,\n depth,\n draft,\n key,\n overrideAccess,\n req,\n showHiddenFields,\n}: Arguments & {\n collectionSlug: string\n id: number | string\n}): Promise<void> => {\n const shouldPopulate = depth && currentDepth <= depth\n // usually depth is checked within recursivelyPopulateFieldsForGraphQL. But since this populate function can be called outside of that (in rest afterRead node hooks) we need to check here too\n if (!shouldPopulate) {\n return\n }\n\n const dataRef = data as Record<string, unknown>\n\n const doc = await req.payloadDataLoader.load(\n createDataloaderCacheKey({\n collectionSlug,\n currentDepth: currentDepth + 1,\n depth,\n docID: id as string,\n draft,\n fallbackLocale: req.fallbackLocale,\n locale: req.locale,\n overrideAccess,\n showHiddenFields,\n transactionID: req.transactionID,\n }),\n )\n\n if (doc) {\n dataRef[key] = doc\n } else {\n dataRef[key] = null\n }\n}\n"],"names":["createDataloaderCacheKey","populate","id","collectionSlug","currentDepth","data","depth","draft","key","overrideAccess","req","showHiddenFields","shouldPopulate","dataRef","doc","payloadDataLoader","load","docID","fallbackLocale","locale","transactionID"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,SAASA,wBAAwB,QAAQ,UAAS;AAalD,OAAO,MAAMC,WAAW,OAAO,EAC7BC,EAAE,EACFC,cAAc,EACdC,YAAY,EACZC,IAAI,EACJC,KAAK,EACLC,KAAK,EACLC,GAAG,EACHC,cAAc,EACdC,GAAG,EACHC,gBAAgB,EAIjB;IACC,MAAMC,iBAAiBN,SAASF,gBAAgBE;IAChD,+LAA+L;IAC/L,IAAI,CAACM,gBAAgB;QACnB;IACF;IAEA,MAAMC,UAAUR;IAEhB,MAAMS,MAAM,MAAMJ,IAAIK,iBAAiB,CAACC,IAAI,CAC1ChB,yBAAyB;QACvBG;QACAC,cAAcA,eAAe;QAC7BE;QACAW,OAAOf;QACPK;QACAW,gBAAgBR,IAAIQ,cAAc;QAClCC,QAAQT,IAAIS,MAAM;QAClBV;QACAE;QACAS,eAAeV,IAAIU,aAAa;IAClC;IAGF,IAAIN,KAAK;QACPD,OAAO,CAACL,IAAI,GAAGM;IACjB,OAAO;QACLD,OAAO,CAACL,IAAI,GAAG;IACjB;AACF,EAAC"}
1
+ {"version":3,"sources":["../../src/populateGraphQL/populate.ts"],"sourcesContent":["import type { PayloadRequest } from 'payload'\n\nimport { createDataloaderCacheKey } from 'payload'\n\ntype Arguments = {\n currentDepth?: number\n data: unknown\n depth: number\n draft: boolean\n key: number | string\n overrideAccess: boolean\n req: PayloadRequest\n showHiddenFields: boolean\n}\n\nexport const populate = async ({\n id,\n collectionSlug,\n currentDepth,\n data,\n depth,\n draft,\n key,\n overrideAccess,\n req,\n showHiddenFields,\n}: {\n collectionSlug: string\n id: number | string\n} & Arguments): Promise<void> => {\n const shouldPopulate = depth && currentDepth <= depth\n // usually depth is checked within recursivelyPopulateFieldsForGraphQL. But since this populate function can be called outside of that (in rest afterRead node hooks) we need to check here too\n if (!shouldPopulate) {\n return\n }\n\n const dataRef = data as Record<string, unknown>\n\n const doc = await req.payloadDataLoader.load(\n createDataloaderCacheKey({\n collectionSlug,\n currentDepth: currentDepth + 1,\n depth,\n docID: id as string,\n draft,\n fallbackLocale: req.fallbackLocale,\n locale: req.locale,\n overrideAccess,\n showHiddenFields,\n transactionID: req.transactionID,\n }),\n )\n\n if (doc) {\n dataRef[key] = doc\n } else {\n dataRef[key] = null\n }\n}\n"],"names":["createDataloaderCacheKey","populate","id","collectionSlug","currentDepth","data","depth","draft","key","overrideAccess","req","showHiddenFields","shouldPopulate","dataRef","doc","payloadDataLoader","load","docID","fallbackLocale","locale","transactionID"],"mappings":"AAEA,SAASA,wBAAwB,QAAQ,UAAS;AAalD,OAAO,MAAMC,WAAW,OAAO,EAC7BC,EAAE,EACFC,cAAc,EACdC,YAAY,EACZC,IAAI,EACJC,KAAK,EACLC,KAAK,EACLC,GAAG,EACHC,cAAc,EACdC,GAAG,EACHC,gBAAgB,EAIL;IACX,MAAMC,iBAAiBN,SAASF,gBAAgBE;IAChD,+LAA+L;IAC/L,IAAI,CAACM,gBAAgB;QACnB;IACF;IAEA,MAAMC,UAAUR;IAEhB,MAAMS,MAAM,MAAMJ,IAAIK,iBAAiB,CAACC,IAAI,CAC1ChB,yBAAyB;QACvBG;QACAC,cAAcA,eAAe;QAC7BE;QACAW,OAAOf;QACPK;QACAW,gBAAgBR,IAAIQ,cAAc;QAClCC,QAAQT,IAAIS,MAAM;QAClBV;QACAE;QACAS,eAAeV,IAAIU,aAAa;IAClC;IAGF,IAAIN,KAAK;QACPD,OAAO,CAACL,IAAI,GAAGM;IACjB,OAAO;QACLD,OAAO,CAACL,IAAI,GAAG;IACjB;AACF,EAAC"}
@@ -1,10 +1,10 @@
1
1
  import type { SerializedEditorState } from 'lexical';
2
2
  import type { RichTextAdapter } from 'payload';
3
- import type { PopulationPromise } from '../features/types.js';
3
+ import type { PopulationPromise } from '../features/typesServer.js';
4
4
  import type { AdapterProps } from '../types.js';
5
- export type Args = Parameters<RichTextAdapter<SerializedEditorState, AdapterProps>['graphQLPopulationPromises']>[0] & {
5
+ export type Args = {
6
6
  editorPopulationPromises: Map<string, Array<PopulationPromise>>;
7
- };
7
+ } & Parameters<RichTextAdapter<SerializedEditorState, AdapterProps>['graphQLPopulationPromises']>[0];
8
8
  /**
9
9
  * Appends all new populationPromises to the populationPromises prop
10
10
  */
@@ -1 +1 @@
1
- {"version":3,"file":"populateLexicalPopulationPromises.d.ts","sourceRoot":"","sources":["../../src/populateGraphQL/populateLexicalPopulationPromises.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAI/C,MAAM,MAAM,IAAI,GAAG,UAAU,CAC3B,eAAe,CAAC,qBAAqB,EAAE,YAAY,CAAC,CAAC,2BAA2B,CAAC,CAClF,CAAC,CAAC,CAAC,GAAG;IACL,wBAAwB,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAA;CAChE,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,iCAAiC,8LAe3C,IAAI,SAiCN,CAAA"}
1
+ {"version":3,"file":"populateLexicalPopulationPromises.d.ts","sourceRoot":"","sources":["../../src/populateGraphQL/populateLexicalPopulationPromises.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AACpD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AACnE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAI/C,MAAM,MAAM,IAAI,GAAG;IACjB,wBAAwB,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAC,CAAA;CAChE,GAAG,UAAU,CAAC,eAAe,CAAC,qBAAqB,EAAE,YAAY,CAAC,CAAC,2BAA2B,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;AAEpG;;GAEG;AACH,eAAO,MAAM,iCAAiC,8LAe3C,IAAI,SAkCN,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/populateGraphQL/populateLexicalPopulationPromises.ts"],"sourcesContent":["import type { SerializedEditorState } from 'lexical'\nimport type { RichTextAdapter } from 'payload'\n\nimport type { PopulationPromise } from '../features/types.js'\nimport type { AdapterProps } from '../types.js'\n\nimport { recurseNodes } from '../utilities/forEachNodeRecursively.js'\n\nexport type Args = Parameters<\n RichTextAdapter<SerializedEditorState, AdapterProps>['graphQLPopulationPromises']\n>[0] & {\n editorPopulationPromises: Map<string, Array<PopulationPromise>>\n}\n\n/**\n * Appends all new populationPromises to the populationPromises prop\n */\nexport const populateLexicalPopulationPromises = ({\n context,\n currentDepth,\n depth,\n draft,\n editorPopulationPromises,\n field,\n fieldPromises,\n findMany,\n flattenLocales,\n overrideAccess,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n}: Args) => {\n const shouldPopulate = depth && currentDepth <= depth\n\n if (!shouldPopulate) {\n return\n }\n\n recurseNodes({\n callback: (node) => {\n if (editorPopulationPromises?.has(node.type)) {\n for (const promise of editorPopulationPromises.get(node.type)) {\n promise({\n context,\n currentDepth,\n depth,\n draft,\n editorPopulationPromises,\n field,\n fieldPromises,\n findMany,\n flattenLocales,\n node,\n overrideAccess,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n })\n }\n }\n },\n nodes: (siblingDoc[field?.name] as SerializedEditorState)?.root?.children ?? [],\n })\n}\n"],"names":["recurseNodes","populateLexicalPopulationPromises","context","currentDepth","depth","draft","editorPopulationPromises","field","fieldPromises","findMany","flattenLocales","overrideAccess","populationPromises","req","showHiddenFields","siblingDoc","shouldPopulate","callback","node","has","type","promise","get","nodes","name","root","children"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAMA,SAASA,YAAY,QAAQ,yCAAwC;AAQrE;;CAEC,GACD,OAAO,MAAMC,oCAAoC,CAAC,EAChDC,OAAO,EACPC,YAAY,EACZC,KAAK,EACLC,KAAK,EACLC,wBAAwB,EACxBC,KAAK,EACLC,aAAa,EACbC,QAAQ,EACRC,cAAc,EACdC,cAAc,EACdC,kBAAkB,EAClBC,GAAG,EACHC,gBAAgB,EAChBC,UAAU,EACL;IACL,MAAMC,iBAAiBZ,SAASD,gBAAgBC;IAEhD,IAAI,CAACY,gBAAgB;QACnB;IACF;IAEAhB,aAAa;QACXiB,UAAU,CAACC;YACT,IAAIZ,0BAA0Ba,IAAID,KAAKE,IAAI,GAAG;gBAC5C,KAAK,MAAMC,WAAWf,yBAAyBgB,GAAG,CAACJ,KAAKE,IAAI,EAAG;oBAC7DC,QAAQ;wBACNnB;wBACAC;wBACAC;wBACAC;wBACAC;wBACAC;wBACAC;wBACAC;wBACAC;wBACAQ;wBACAP;wBACAC;wBACAC;wBACAC;wBACAC;oBACF;gBACF;YACF;QACF;QACAQ,OAAO,AAACR,UAAU,CAACR,OAAOiB,KAAK,EAA4BC,MAAMC,YAAY,EAAE;IACjF;AACF,EAAC"}
1
+ {"version":3,"sources":["../../src/populateGraphQL/populateLexicalPopulationPromises.ts"],"sourcesContent":["import type { SerializedEditorState } from 'lexical'\nimport type { RichTextAdapter } from 'payload'\n\nimport type { PopulationPromise } from '../features/typesServer.js'\nimport type { AdapterProps } from '../types.js'\n\nimport { recurseNodes } from '../utilities/forEachNodeRecursively.js'\n\nexport type Args = {\n editorPopulationPromises: Map<string, Array<PopulationPromise>>\n} & Parameters<RichTextAdapter<SerializedEditorState, AdapterProps>['graphQLPopulationPromises']>[0]\n\n/**\n * Appends all new populationPromises to the populationPromises prop\n */\nexport const populateLexicalPopulationPromises = ({\n context,\n currentDepth,\n depth,\n draft,\n editorPopulationPromises,\n field,\n fieldPromises,\n findMany,\n flattenLocales,\n overrideAccess,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n}: Args) => {\n const shouldPopulate = depth && currentDepth <= depth\n\n if (!shouldPopulate) {\n return\n }\n\n recurseNodes({\n callback: (node) => {\n if (editorPopulationPromises?.has(node.type)) {\n for (const promise of editorPopulationPromises.get(node.type)) {\n promise({\n context,\n currentDepth,\n depth,\n draft,\n editorPopulationPromises,\n field,\n fieldPromises,\n findMany,\n flattenLocales,\n node,\n overrideAccess,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n })\n }\n }\n },\n\n nodes: (siblingDoc[field?.name] as SerializedEditorState)?.root?.children ?? [],\n })\n}\n"],"names":["recurseNodes","populateLexicalPopulationPromises","context","currentDepth","depth","draft","editorPopulationPromises","field","fieldPromises","findMany","flattenLocales","overrideAccess","populationPromises","req","showHiddenFields","siblingDoc","shouldPopulate","callback","node","has","type","promise","get","nodes","name","root","children"],"mappings":"AAMA,SAASA,YAAY,QAAQ,yCAAwC;AAMrE;;CAEC,GACD,OAAO,MAAMC,oCAAoC,CAAC,EAChDC,OAAO,EACPC,YAAY,EACZC,KAAK,EACLC,KAAK,EACLC,wBAAwB,EACxBC,KAAK,EACLC,aAAa,EACbC,QAAQ,EACRC,cAAc,EACdC,cAAc,EACdC,kBAAkB,EAClBC,GAAG,EACHC,gBAAgB,EAChBC,UAAU,EACL;IACL,MAAMC,iBAAiBZ,SAASD,gBAAgBC;IAEhD,IAAI,CAACY,gBAAgB;QACnB;IACF;IAEAhB,aAAa;QACXiB,UAAU,CAACC;YACT,IAAIZ,0BAA0Ba,IAAID,KAAKE,IAAI,GAAG;gBAC5C,KAAK,MAAMC,WAAWf,yBAAyBgB,GAAG,CAACJ,KAAKE,IAAI,EAAG;oBAC7DC,QAAQ;wBACNnB;wBACAC;wBACAC;wBACAC;wBACAC;wBACAC;wBACAC;wBACAC;wBACAC;wBACAQ;wBACAP;wBACAC;wBACAC;wBACAC;wBACAC;oBACF;gBACF;YACF;QACF;QAEAQ,OAAO,AAACR,UAAU,CAACR,OAAOiB,KAAK,EAA4BC,MAAMC,YAAY,EAAE;IACjF;AACF,EAAC"}
@@ -1,5 +1,5 @@
1
- import type { Field, PayloadRequestWithData, RequestContext } from 'payload';
2
- import type { PopulationPromise } from '../features/types.js';
1
+ import type { Field, JsonObject, PayloadRequest, RequestContext } from 'payload';
2
+ import type { PopulationPromise } from '../features/typesServer.js';
3
3
  type NestedRichTextFieldsArgs = {
4
4
  context: RequestContext;
5
5
  currentDepth?: number;
@@ -19,9 +19,9 @@ type NestedRichTextFieldsArgs = {
19
19
  flattenLocales: boolean;
20
20
  overrideAccess: boolean;
21
21
  populationPromises: Promise<void>[];
22
- req: PayloadRequestWithData;
22
+ req: PayloadRequest;
23
23
  showHiddenFields: boolean;
24
- siblingDoc: Record<string, unknown>;
24
+ siblingDoc: JsonObject;
25
25
  };
26
26
  export declare const recursivelyPopulateFieldsForGraphQL: ({ context, currentDepth, data, depth, draft, fieldPromises, fields, findMany, flattenLocales, overrideAccess, populationPromises, req, showHiddenFields, siblingDoc, }: NestedRichTextFieldsArgs) => void;
27
27
  export {};
@@ -1 +1 @@
1
- {"version":3,"file":"recursivelyPopulateFieldsForGraphQL.d.ts","sourceRoot":"","sources":["../../src/populateGraphQL/recursivelyPopulateFieldsForGraphQL.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAI5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAE7D,KAAK,wBAAwB,GAAG;IAC9B,OAAO,EAAE,cAAc,CAAA;IACvB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,IAAI,EAAE,OAAO,CAAA;IACb,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;;OAEG;IACH,aAAa,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,CAAA;IAC9B,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,QAAQ,EAAE,OAAO,CAAA;IACjB,cAAc,EAAE,OAAO,CAAA;IACvB,cAAc,EAAE,OAAO,CAAA;IACvB,kBAAkB,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,CAAA;IACnC,GAAG,EAAE,sBAAsB,CAAA;IAC3B,gBAAgB,EAAE,OAAO,CAAA;IACzB,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CACpC,CAAA;AAED,eAAO,MAAM,mCAAmC,2KAe7C,wBAAwB,KAAG,IAwB7B,CAAA"}
1
+ {"version":3,"file":"recursivelyPopulateFieldsForGraphQL.d.ts","sourceRoot":"","sources":["../../src/populateGraphQL/recursivelyPopulateFieldsForGraphQL.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAIhF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAEnE,KAAK,wBAAwB,GAAG;IAC9B,OAAO,EAAE,cAAc,CAAA;IACvB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,IAAI,EAAE,OAAO,CAAA;IACb,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;;OAEG;IACH,aAAa,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,CAAA;IAC9B,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,QAAQ,EAAE,OAAO,CAAA;IACjB,cAAc,EAAE,OAAO,CAAA;IACvB,cAAc,EAAE,OAAO,CAAA;IACvB,kBAAkB,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,CAAA;IACnC,GAAG,EAAE,cAAc,CAAA;IACnB,gBAAgB,EAAE,OAAO,CAAA;IACzB,UAAU,EAAE,UAAU,CAAA;CACvB,CAAA;AAED,eAAO,MAAM,mCAAmC,2KAe7C,wBAAwB,KAAG,IAwB7B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/populateGraphQL/recursivelyPopulateFieldsForGraphQL.ts"],"sourcesContent":["import type { Field, PayloadRequestWithData, RequestContext } from 'payload'\n\nimport { afterReadTraverseFields } from 'payload'\n\nimport type { PopulationPromise } from '../features/types.js'\n\ntype NestedRichTextFieldsArgs = {\n context: RequestContext\n currentDepth?: number\n data: unknown\n depth: number\n draft: boolean\n /**\n * This maps all the population promises to the node types\n */\n editorPopulationPromises: Map<string, Array<PopulationPromise>>\n /**\n * fieldPromises are used for things like field hooks. They should be awaited before awaiting populationPromises\n */\n fieldPromises: Promise<void>[]\n fields: Field[]\n findMany: boolean\n flattenLocales: boolean\n overrideAccess: boolean\n populationPromises: Promise<void>[]\n req: PayloadRequestWithData\n showHiddenFields: boolean\n siblingDoc: Record<string, unknown>\n}\n\nexport const recursivelyPopulateFieldsForGraphQL = ({\n context,\n currentDepth = 0,\n data,\n depth,\n draft,\n fieldPromises,\n fields,\n findMany,\n flattenLocales,\n overrideAccess = false,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n}: NestedRichTextFieldsArgs): void => {\n afterReadTraverseFields({\n collection: null, // Pass from core? This is only needed for hooks, so we can leave this null for now\n context,\n currentDepth,\n depth,\n doc: data as any, // Looks like it's only needed for hooks and access control, so doesn't matter what we pass here right now\n draft,\n fallbackLocale: req.fallbackLocale,\n fieldPromises,\n fields,\n findMany,\n flattenLocales,\n global: null, // Pass from core? This is only needed for hooks, so we can leave this null for now\n locale: req.locale,\n overrideAccess,\n path: [],\n populationPromises, // This is not the same as populationPromises passed into this recurseNestedFields. These are just promises resolved at the very end.\n req,\n schemaPath: [],\n showHiddenFields,\n siblingDoc,\n triggerHooks: false,\n })\n}\n"],"names":["afterReadTraverseFields","recursivelyPopulateFieldsForGraphQL","context","currentDepth","data","depth","draft","fieldPromises","fields","findMany","flattenLocales","overrideAccess","populationPromises","req","showHiddenFields","siblingDoc","collection","doc","fallbackLocale","global","locale","path","schemaPath","triggerHooks"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,SAASA,uBAAuB,QAAQ,UAAS;AA4BjD,OAAO,MAAMC,sCAAsC,CAAC,EAClDC,OAAO,EACPC,eAAe,CAAC,EAChBC,IAAI,EACJC,KAAK,EACLC,KAAK,EACLC,aAAa,EACbC,MAAM,EACNC,QAAQ,EACRC,cAAc,EACdC,iBAAiB,KAAK,EACtBC,kBAAkB,EAClBC,GAAG,EACHC,gBAAgB,EAChBC,UAAU,EACe;IACzBf,wBAAwB;QACtBgB,YAAY;QACZd;QACAC;QACAE;QACAY,KAAKb;QACLE;QACAY,gBAAgBL,IAAIK,cAAc;QAClCX;QACAC;QACAC;QACAC;QACAS,QAAQ;QACRC,QAAQP,IAAIO,MAAM;QAClBT;QACAU,MAAM,EAAE;QACRT;QACAC;QACAS,YAAY,EAAE;QACdR;QACAC;QACAQ,cAAc;IAChB;AACF,EAAC"}
1
+ {"version":3,"sources":["../../src/populateGraphQL/recursivelyPopulateFieldsForGraphQL.ts"],"sourcesContent":["import type { Field, JsonObject, PayloadRequest, RequestContext } from 'payload'\n\nimport { afterReadTraverseFields } from 'payload'\n\nimport type { PopulationPromise } from '../features/typesServer.js'\n\ntype NestedRichTextFieldsArgs = {\n context: RequestContext\n currentDepth?: number\n data: unknown\n depth: number\n draft: boolean\n /**\n * This maps all the population promises to the node types\n */\n editorPopulationPromises: Map<string, Array<PopulationPromise>>\n /**\n * fieldPromises are used for things like field hooks. They should be awaited before awaiting populationPromises\n */\n fieldPromises: Promise<void>[]\n fields: Field[]\n findMany: boolean\n flattenLocales: boolean\n overrideAccess: boolean\n populationPromises: Promise<void>[]\n req: PayloadRequest\n showHiddenFields: boolean\n siblingDoc: JsonObject\n}\n\nexport const recursivelyPopulateFieldsForGraphQL = ({\n context,\n currentDepth = 0,\n data,\n depth,\n draft,\n fieldPromises,\n fields,\n findMany,\n flattenLocales,\n overrideAccess = false,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n}: NestedRichTextFieldsArgs): void => {\n afterReadTraverseFields({\n collection: null, // Pass from core? This is only needed for hooks, so we can leave this null for now\n context,\n currentDepth,\n depth,\n doc: data as any, // Looks like it's only needed for hooks and access control, so doesn't matter what we pass here right now\n draft,\n fallbackLocale: req.fallbackLocale,\n fieldPromises,\n fields,\n findMany,\n flattenLocales,\n global: null, // Pass from core? This is only needed for hooks, so we can leave this null for now\n locale: req.locale,\n overrideAccess,\n path: [],\n populationPromises, // This is not the same as populationPromises passed into this recurseNestedFields. These are just promises resolved at the very end.\n req,\n schemaPath: [],\n showHiddenFields,\n siblingDoc,\n triggerHooks: false,\n })\n}\n"],"names":["afterReadTraverseFields","recursivelyPopulateFieldsForGraphQL","context","currentDepth","data","depth","draft","fieldPromises","fields","findMany","flattenLocales","overrideAccess","populationPromises","req","showHiddenFields","siblingDoc","collection","doc","fallbackLocale","global","locale","path","schemaPath","triggerHooks"],"mappings":"AAEA,SAASA,uBAAuB,QAAQ,UAAS;AA4BjD,OAAO,MAAMC,sCAAsC,CAAC,EAClDC,OAAO,EACPC,eAAe,CAAC,EAChBC,IAAI,EACJC,KAAK,EACLC,KAAK,EACLC,aAAa,EACbC,MAAM,EACNC,QAAQ,EACRC,cAAc,EACdC,iBAAiB,KAAK,EACtBC,kBAAkB,EAClBC,GAAG,EACHC,gBAAgB,EAChBC,UAAU,EACe;IACzBf,wBAAwB;QACtBgB,YAAY;QACZd;QACAC;QACAE;QACAY,KAAKb;QACLE;QACAY,gBAAgBL,IAAIK,cAAc;QAClCX;QACAC;QACAC;QACAC;QACAS,QAAQ;QACRC,QAAQP,IAAIO,MAAM;QAClBT;QACAU,MAAM,EAAE;QACRT;QACAC;QACAS,YAAY,EAAE;QACdR;QACAC;QACAQ,cAAc;IAChB;AACF,EAAC"}
package/dist/types.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import type { EditorConfig as LexicalEditorConfig, SerializedEditorState } from 'lexical';
2
2
  import type { FieldPermissions, FieldTypes, RichTextAdapter, RichTextFieldProps, SanitizedConfig } from 'payload';
3
3
  import type React from 'react';
4
- import type { FeatureProviderServer } from './features/types.js';
4
+ import type { FeatureProviderServer } from './features/typesServer.js';
5
5
  import type { SanitizedServerEditorConfig } from './lexical/config/types.js';
6
6
  export type LexicalFieldAdminProps = {
7
7
  /**
@@ -26,7 +26,7 @@ export type LexicalEditorProps = {
26
26
  defaultFeatures: FeatureProviderServer<any, any, any>[];
27
27
  /**
28
28
  * This array contains all features that are enabled in the root richText editor (the one defined in the payload.config.ts).
29
- * If this field is the root richText editor, or if the root richText editor is not a lexical editor, this array will be empty
29
+ * If this field is the root richText editor, or if the root richText editor is not a lexical editor, this array will be empty.
30
30
  *
31
31
  * @Example
32
32
  *
@@ -40,10 +40,10 @@ export type LexicalEditorProps = {
40
40
  }) => FeatureProviderServer<any, any, any>[]) | FeatureProviderServer<any, any, any>[];
41
41
  lexical?: LexicalEditorConfig;
42
42
  };
43
- export type LexicalRichTextAdapter = RichTextAdapter<SerializedEditorState, AdapterProps, any> & {
43
+ export type LexicalRichTextAdapter = {
44
44
  editorConfig: SanitizedServerEditorConfig;
45
45
  features: FeatureProviderServer<any, any, any>[];
46
- };
46
+ } & RichTextAdapter<SerializedEditorState, AdapterProps, any>;
47
47
  export type LexicalRichTextAdapterProvider =
48
48
  /**
49
49
  * This is being called during the payload sanitization process
@@ -52,12 +52,12 @@ export type LexicalRichTextAdapterProvider =
52
52
  config: SanitizedConfig;
53
53
  isRoot?: boolean;
54
54
  }) => Promise<LexicalRichTextAdapter>;
55
- export type FieldProps = RichTextFieldProps<SerializedEditorState, AdapterProps, AdapterProps> & {
55
+ export type FieldProps = {
56
56
  fieldTypes: FieldTypes;
57
57
  indexPath: string;
58
58
  path?: string;
59
59
  permissions: FieldPermissions;
60
- };
60
+ } & RichTextFieldProps<SerializedEditorState, AdapterProps, AdapterProps>;
61
61
  export type AdapterProps = {
62
62
  editorConfig: SanitizedServerEditorConfig;
63
63
  };
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AACzF,OAAO,KAAK,EACV,gBAAgB,EAChB,UAAU,EACV,eAAe,EACf,kBAAkB,EAClB,eAAe,EAChB,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAChE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAA;AAE5E,MAAM,MAAM,sBAAsB,GAAG;IACnC;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,CAA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AAA;IACzC,QAAQ,EAAE,qBAAqB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAA;CACjD,GAAG,eAAe,CAAC,qBAAqB,EAAE,YAAY,EAAE,GAAG,CAAC,CAAA;AAE7D,MAAM,MAAM,8BAA8B;AACxC;;GAEG;AACH,CAAC,EACC,MAAM,EACN,MAAM,GACP,EAAE;IACD,MAAM,EAAE,eAAe,CAAA;IACvB,MAAM,CAAC,EAAE,OAAO,CAAA;CACjB,KAAK,OAAO,CAAC,sBAAsB,CAAC,CAAA;AAEvC,MAAM,MAAM,UAAU,GAAG;IACvB,UAAU,EAAE,UAAU,CAAA;IACtB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,WAAW,EAAE,gBAAgB,CAAA;CAC9B,GAAG,kBAAkB,CAAC,qBAAqB,EAAE,YAAY,EAAE,YAAY,CAAC,CAAA;AAEzE,MAAM,MAAM,YAAY,GAAG;IACzB,YAAY,EAAE,2BAA2B,CAAA;CAC1C,CAAA;AAED,MAAM,MAAM,iCAAiC,GAAG;IAC9C,aAAa,EAAE,KAAK,CAAC,SAAS,CAAA;IAC9B,GAAG,EAAE,MAAM,CAAA;IACX,KAAK,EAAE,MAAM,CAAA;CACd,CAAA"}
package/dist/types.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { EditorConfig as LexicalEditorConfig, SerializedEditorState } from 'lexical'\nimport type {\n FieldPermissions,\n FieldTypes,\n RichTextAdapter,\n RichTextFieldProps,\n SanitizedConfig,\n} from 'payload'\nimport type React from 'react'\n\nimport type { FeatureProviderServer } from './features/types.js'\nimport type { SanitizedServerEditorConfig } from './lexical/config/types.js'\n\nexport type LexicalFieldAdminProps = {\n /**\n * Controls if the gutter (padding to the left & gray vertical line) should be hidden. @default false\n */\n hideGutter?: boolean\n}\n\nexport type LexicalEditorProps = {\n admin?: LexicalFieldAdminProps\n features?:\n | (({\n defaultFeatures,\n rootFeatures,\n }: {\n /**\n * This opinionated array contains all \"recommended\" default features.\n *\n * @Example\n *\n * ```ts\n * editor: lexicalEditor({\n * features: ({ defaultFeatures }) => [...defaultFeatures, FixedToolbarFeature()],\n * })\n * ```\n */\n defaultFeatures: FeatureProviderServer<any, any, any>[]\n /**\n * This array contains all features that are enabled in the root richText editor (the one defined in the payload.config.ts).\n * If this field is the root richText editor, or if the root richText editor is not a lexical editor, this array will be empty\n *\n * @Example\n *\n * ```ts\n * editor: lexicalEditor({\n * features: ({ rootFeatures }) => [...rootFeatures, FixedToolbarFeature()],\n * })\n * ```\n */\n rootFeatures: FeatureProviderServer<any, any, any>[]\n }) => FeatureProviderServer<any, any, any>[])\n | FeatureProviderServer<any, any, any>[]\n lexical?: LexicalEditorConfig\n}\n\nexport type LexicalRichTextAdapter = RichTextAdapter<SerializedEditorState, AdapterProps, any> & {\n editorConfig: SanitizedServerEditorConfig\n features: FeatureProviderServer<any, any, any>[]\n}\n\nexport type LexicalRichTextAdapterProvider =\n /**\n * This is being called during the payload sanitization process\n */\n ({\n config,\n isRoot,\n }: {\n config: SanitizedConfig\n isRoot?: boolean\n }) => Promise<LexicalRichTextAdapter>\n\nexport type FieldProps = RichTextFieldProps<SerializedEditorState, AdapterProps, AdapterProps> & {\n fieldTypes: FieldTypes\n indexPath: string\n path?: string\n permissions: FieldPermissions\n}\n\nexport type AdapterProps = {\n editorConfig: SanitizedServerEditorConfig\n}\n\nexport type GeneratedFeatureProviderComponent = {\n ClientFeature: React.ReactNode\n key: string\n order: number\n}\n"],"names":[],"rangeMappings":"","mappings":"AAqFA,WAIC"}
1
+ {"version":3,"sources":["../src/types.ts"],"sourcesContent":["import type { EditorConfig as LexicalEditorConfig, SerializedEditorState } from 'lexical'\nimport type {\n FieldPermissions,\n FieldTypes,\n RichTextAdapter,\n RichTextFieldProps,\n SanitizedConfig,\n} from 'payload'\nimport type React from 'react'\n\nimport type { FeatureProviderServer } from './features/typesServer.js'\nimport type { SanitizedServerEditorConfig } from './lexical/config/types.js'\n\nexport type LexicalFieldAdminProps = {\n /**\n * Controls if the gutter (padding to the left & gray vertical line) should be hidden. @default false\n */\n hideGutter?: boolean\n}\n\nexport type LexicalEditorProps = {\n admin?: LexicalFieldAdminProps\n features?:\n | (({\n defaultFeatures,\n rootFeatures,\n }: {\n /**\n * This opinionated array contains all \"recommended\" default features.\n *\n * @Example\n *\n * ```ts\n * editor: lexicalEditor({\n * features: ({ defaultFeatures }) => [...defaultFeatures, FixedToolbarFeature()],\n * })\n * ```\n */\n defaultFeatures: FeatureProviderServer<any, any, any>[]\n /**\n * This array contains all features that are enabled in the root richText editor (the one defined in the payload.config.ts).\n * If this field is the root richText editor, or if the root richText editor is not a lexical editor, this array will be empty.\n *\n * @Example\n *\n * ```ts\n * editor: lexicalEditor({\n * features: ({ rootFeatures }) => [...rootFeatures, FixedToolbarFeature()],\n * })\n * ```\n */\n rootFeatures: FeatureProviderServer<any, any, any>[]\n }) => FeatureProviderServer<any, any, any>[])\n | FeatureProviderServer<any, any, any>[]\n lexical?: LexicalEditorConfig\n}\n\nexport type LexicalRichTextAdapter = {\n editorConfig: SanitizedServerEditorConfig\n features: FeatureProviderServer<any, any, any>[]\n} & RichTextAdapter<SerializedEditorState, AdapterProps, any>\n\nexport type LexicalRichTextAdapterProvider =\n /**\n * This is being called during the payload sanitization process\n */\n ({\n config,\n isRoot,\n }: {\n config: SanitizedConfig\n isRoot?: boolean\n }) => Promise<LexicalRichTextAdapter>\n\nexport type FieldProps = {\n fieldTypes: FieldTypes\n indexPath: string\n path?: string\n permissions: FieldPermissions\n} & RichTextFieldProps<SerializedEditorState, AdapterProps, AdapterProps>\n\nexport type AdapterProps = {\n editorConfig: SanitizedServerEditorConfig\n}\n\nexport type GeneratedFeatureProviderComponent = {\n ClientFeature: React.ReactNode\n key: string\n order: number\n}\n"],"names":[],"mappings":"AAqFA,WAIC"}
@@ -1,5 +1,5 @@
1
1
  import type React from 'react';
2
- import type { ClientComponentProps, ClientFeature, ClientFeatureProviderMap, ResolvedClientFeatureMap } from '../features/types.js';
2
+ import type { ClientComponentProps, ClientFeature, ClientFeatureProviderMap, ResolvedClientFeatureMap } from '../features/typesClient.js';
3
3
  import type { ClientEditorConfig } from '../lexical/config/types.js';
4
4
  export type CreateClientFeatureArgs<UnSanitizedClientProps, ClientProps> = ((props: {
5
5
  clientFunctions: Record<string, any>;
@@ -1 +1 @@
1
- {"version":3,"file":"createClientFeature.d.ts","sourceRoot":"","sources":["../../src/utilities/createClientFeature.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EACV,oBAAoB,EACpB,aAAa,EACb,wBAAwB,EAGxB,wBAAwB,EACzB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAIpE,MAAM,MAAM,uBAAuB,CAAC,sBAAsB,EAAE,WAAW,IACnE,CAAC,CAAC,KAAK,EAAE;IACP,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACpC,mDAAmD;IACnD,kBAAkB,EAAE,wBAAwB,CAAA;IAC5C,KAAK,EAAE,oBAAoB,CAAC,sBAAsB,CAAC,CAAA;IAEnD,gBAAgB,EAAE,wBAAwB,CAAA;IAE1C,uBAAuB,EAAE,kBAAkB,CAAA;CAC5C,KAAK,aAAa,CAAC,WAAW,CAAC,CAAC,GACjC,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,EAAE,6BAA6B,CAAC,CAAA;AAEnE,eAAO,MAAM,mBAAmB,EAAE,CAChC,sBAAsB,GAAG,SAAS,EAClC,WAAW,GAAG,sBAAsB,EAEpC,IAAI,EAAE,uBAAuB,CAAC,sBAAsB,EAAE,WAAW,CAAC,KAC/D,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAmC9C,CAAA"}
1
+ {"version":3,"file":"createClientFeature.d.ts","sourceRoot":"","sources":["../../src/utilities/createClientFeature.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EACV,oBAAoB,EACpB,aAAa,EACb,wBAAwB,EAGxB,wBAAwB,EACzB,MAAM,4BAA4B,CAAA;AACnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAIpE,MAAM,MAAM,uBAAuB,CAAC,sBAAsB,EAAE,WAAW,IACnE,CAAC,CAAC,KAAK,EAAE;IACP,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IACpC,mDAAmD;IACnD,kBAAkB,EAAE,wBAAwB,CAAA;IAC5C,KAAK,EAAE,oBAAoB,CAAC,sBAAsB,CAAC,CAAA;IAEnD,gBAAgB,EAAE,wBAAwB,CAAA;IAE1C,uBAAuB,EAAE,kBAAkB,CAAA;CAC5C,KAAK,aAAa,CAAC,WAAW,CAAC,CAAC,GACjC,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,EAAE,6BAA6B,CAAC,CAAA;AAEnE,eAAO,MAAM,mBAAmB,EAAE,CAChC,sBAAsB,GAAG,SAAS,EAClC,WAAW,GAAG,sBAAsB,EAEpC,IAAI,EAAE,uBAAuB,CAAC,sBAAsB,EAAE,WAAW,CAAC,KAC/D,KAAK,CAAC,EAAE,CAAC,oBAAoB,CAAC,WAAW,CAAC,CAmC9C,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utilities/createClientFeature.ts"],"sourcesContent":["import type React from 'react'\n\nimport type {\n ClientComponentProps,\n ClientFeature,\n ClientFeatureProviderMap,\n FeatureProviderClient,\n FeatureProviderProviderClient,\n ResolvedClientFeatureMap,\n} from '../features/types.js'\nimport type { ClientEditorConfig } from '../lexical/config/types.js'\n\nimport { createClientComponent } from '../features/createClientComponent.js'\n\nexport type CreateClientFeatureArgs<UnSanitizedClientProps, ClientProps> =\n | ((props: {\n clientFunctions: Record<string, any>\n /** unSanitizedEditorConfig.features, but mapped */\n featureProviderMap: ClientFeatureProviderMap\n props: ClientComponentProps<UnSanitizedClientProps>\n // other resolved features, which have been loaded before this one. All features declared in 'dependencies' should be available here\n resolvedFeatures: ResolvedClientFeatureMap\n // unSanitized EditorConfig,\n unSanitizedEditorConfig: ClientEditorConfig\n }) => ClientFeature<ClientProps>)\n | Omit<ClientFeature<ClientProps>, 'sanitizedClientFeatureProps'>\n\nexport const createClientFeature: <\n UnSanitizedClientProps = undefined,\n ClientProps = UnSanitizedClientProps,\n>(\n args: CreateClientFeatureArgs<UnSanitizedClientProps, ClientProps>,\n) => React.FC<ClientComponentProps<ClientProps>> = (feature) => {\n const featureProviderProvideClient: FeatureProviderProviderClient<any, any> = (props) => {\n const featureProviderClient: Partial<FeatureProviderClient<any, any>> = {\n clientFeatureProps: props,\n }\n\n if (typeof feature === 'function') {\n featureProviderClient.feature = ({\n clientFunctions,\n featureProviderMap,\n resolvedFeatures,\n unSanitizedEditorConfig,\n }) => {\n const toReturn = feature({\n clientFunctions,\n featureProviderMap,\n props,\n resolvedFeatures,\n unSanitizedEditorConfig,\n })\n\n if (toReturn.sanitizedClientFeatureProps === null) {\n toReturn.sanitizedClientFeatureProps = props\n }\n\n return toReturn\n }\n } else {\n ;(feature as ClientFeature<any>).sanitizedClientFeatureProps = props\n featureProviderClient.feature = feature as ClientFeature<any>\n }\n return featureProviderClient as FeatureProviderClient<any, any>\n }\n\n return createClientComponent(featureProviderProvideClient)\n}\n"],"names":["createClientComponent","createClientFeature","feature","featureProviderProvideClient","props","featureProviderClient","clientFeatureProps","clientFunctions","featureProviderMap","resolvedFeatures","unSanitizedEditorConfig","toReturn","sanitizedClientFeatureProps"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAYA,SAASA,qBAAqB,QAAQ,uCAAsC;AAe5E,OAAO,MAAMC,sBAKsC,CAACC;IAClD,MAAMC,+BAAwE,CAACC;QAC7E,MAAMC,wBAAkE;YACtEC,oBAAoBF;QACtB;QAEA,IAAI,OAAOF,YAAY,YAAY;YACjCG,sBAAsBH,OAAO,GAAG,CAAC,EAC/BK,eAAe,EACfC,kBAAkB,EAClBC,gBAAgB,EAChBC,uBAAuB,EACxB;gBACC,MAAMC,WAAWT,QAAQ;oBACvBK;oBACAC;oBACAJ;oBACAK;oBACAC;gBACF;gBAEA,IAAIC,SAASC,2BAA2B,KAAK,MAAM;oBACjDD,SAASC,2BAA2B,GAAGR;gBACzC;gBAEA,OAAOO;YACT;QACF,OAAO;YACHT,QAA+BU,2BAA2B,GAAGR;YAC/DC,sBAAsBH,OAAO,GAAGA;QAClC;QACA,OAAOG;IACT;IAEA,OAAOL,sBAAsBG;AAC/B,EAAC"}
1
+ {"version":3,"sources":["../../src/utilities/createClientFeature.ts"],"sourcesContent":["import type React from 'react'\n\nimport type {\n ClientComponentProps,\n ClientFeature,\n ClientFeatureProviderMap,\n FeatureProviderClient,\n FeatureProviderProviderClient,\n ResolvedClientFeatureMap,\n} from '../features/typesClient.js'\nimport type { ClientEditorConfig } from '../lexical/config/types.js'\n\nimport { createClientComponent } from '../features/createClientComponent.js'\n\nexport type CreateClientFeatureArgs<UnSanitizedClientProps, ClientProps> =\n | ((props: {\n clientFunctions: Record<string, any>\n /** unSanitizedEditorConfig.features, but mapped */\n featureProviderMap: ClientFeatureProviderMap\n props: ClientComponentProps<UnSanitizedClientProps>\n // other resolved features, which have been loaded before this one. All features declared in 'dependencies' should be available here\n resolvedFeatures: ResolvedClientFeatureMap\n // unSanitized EditorConfig,\n unSanitizedEditorConfig: ClientEditorConfig\n }) => ClientFeature<ClientProps>)\n | Omit<ClientFeature<ClientProps>, 'sanitizedClientFeatureProps'>\n\nexport const createClientFeature: <\n UnSanitizedClientProps = undefined,\n ClientProps = UnSanitizedClientProps,\n>(\n args: CreateClientFeatureArgs<UnSanitizedClientProps, ClientProps>,\n) => React.FC<ClientComponentProps<ClientProps>> = (feature) => {\n const featureProviderProvideClient: FeatureProviderProviderClient<any, any> = (props) => {\n const featureProviderClient: Partial<FeatureProviderClient<any, any>> = {\n clientFeatureProps: props,\n }\n\n if (typeof feature === 'function') {\n featureProviderClient.feature = ({\n clientFunctions,\n featureProviderMap,\n resolvedFeatures,\n unSanitizedEditorConfig,\n }) => {\n const toReturn = feature({\n clientFunctions,\n featureProviderMap,\n props,\n resolvedFeatures,\n unSanitizedEditorConfig,\n })\n\n if (toReturn.sanitizedClientFeatureProps === null) {\n toReturn.sanitizedClientFeatureProps = props\n }\n\n return toReturn\n }\n } else {\n ;(feature as ClientFeature<any>).sanitizedClientFeatureProps = props\n featureProviderClient.feature = feature as ClientFeature<any>\n }\n return featureProviderClient as FeatureProviderClient<any, any>\n }\n\n return createClientComponent(featureProviderProvideClient)\n}\n"],"names":["createClientComponent","createClientFeature","feature","featureProviderProvideClient","props","featureProviderClient","clientFeatureProps","clientFunctions","featureProviderMap","resolvedFeatures","unSanitizedEditorConfig","toReturn","sanitizedClientFeatureProps"],"mappings":"AAYA,SAASA,qBAAqB,QAAQ,uCAAsC;AAe5E,OAAO,MAAMC,sBAKsC,CAACC;IAClD,MAAMC,+BAAwE,CAACC;QAC7E,MAAMC,wBAAkE;YACtEC,oBAAoBF;QACtB;QAEA,IAAI,OAAOF,YAAY,YAAY;YACjCG,sBAAsBH,OAAO,GAAG,CAAC,EAC/BK,eAAe,EACfC,kBAAkB,EAClBC,gBAAgB,EAChBC,uBAAuB,EACxB;gBACC,MAAMC,WAAWT,QAAQ;oBACvBK;oBACAC;oBACAJ;oBACAK;oBACAC;gBACF;gBAEA,IAAIC,SAASC,2BAA2B,KAAK,MAAM;oBACjDD,SAASC,2BAA2B,GAAGR;gBACzC;gBAEA,OAAOO;YACT;QACF,OAAO;YACHT,QAA+BU,2BAA2B,GAAGR;YAC/DC,sBAAsBH,OAAO,GAAGA;QAClC;QACA,OAAOG;IACT;IAEA,OAAOL,sBAAsBG;AAC/B,EAAC"}
@@ -1,7 +1,7 @@
1
1
  import type { SanitizedConfig } from 'payload';
2
- import type { FeatureProviderProviderServer, FeatureProviderServer, ResolvedServerFeatureMap, ServerFeature, ServerFeatureProviderMap } from '../features/types.js';
2
+ import type { FeatureProviderProviderServer, FeatureProviderServer, ResolvedServerFeatureMap, ServerFeature, ServerFeatureProviderMap } from '../features/typesServer.js';
3
3
  import type { ServerEditorConfig } from '../lexical/config/types.js';
4
- export type CreateServerFeatureArgs<UnSanitizedProps, SanitizedProps, ClientProps> = Pick<FeatureProviderServer<UnSanitizedProps, ClientProps>, 'dependencies' | 'dependenciesPriority' | 'dependenciesSoft' | 'key'> & {
4
+ export type CreateServerFeatureArgs<UnSanitizedProps, SanitizedProps, ClientProps> = {
5
5
  feature: ((props: {
6
6
  config: SanitizedConfig;
7
7
  /** unSanitizedEditorConfig.features, but mapped */
@@ -11,6 +11,6 @@ export type CreateServerFeatureArgs<UnSanitizedProps, SanitizedProps, ClientProp
11
11
  resolvedFeatures: ResolvedServerFeatureMap;
12
12
  unSanitizedEditorConfig: ServerEditorConfig;
13
13
  }) => Promise<ServerFeature<SanitizedProps, ClientProps>> | ServerFeature<SanitizedProps, ClientProps>) | Omit<ServerFeature<SanitizedProps, ClientProps>, 'sanitizedServerFeatureProps'>;
14
- };
14
+ } & Pick<FeatureProviderServer<UnSanitizedProps, ClientProps>, 'dependencies' | 'dependenciesPriority' | 'dependenciesSoft' | 'key'>;
15
15
  export declare const createServerFeature: <UnSanitizedProps = undefined, SanitizedProps = UnSanitizedProps, ClientProps = undefined>(args: CreateServerFeatureArgs<UnSanitizedProps, SanitizedProps, ClientProps>) => FeatureProviderProviderServer<UnSanitizedProps, SanitizedProps, ClientProps>;
16
16
  //# sourceMappingURL=createServerFeature.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createServerFeature.d.ts","sourceRoot":"","sources":["../../src/utilities/createServerFeature.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,OAA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V,6BAA6B,EAC7B,qBAAqB,EACrB,wBAAwB,EACxB,aAAa,EACb,wBAAwB,EACzB,MAAM,4BAA4B,CAAA;AACnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AAEpE,MAAM,MAAM,uBAAuB,CAAC,gBAAgB,EAAE,cAAc,EAAE,WAAW,IAAI;IACnF,OAAO,EACH,CAAC,CAAC,KAAK,EAAE;QACP,MAAM,EAAE,eAAe,CAAA;QACvB,mDAAmD;QACnD,kBAAkB,EAAE,wBAAwB,CAAA;QAC5C,MAAM,CAAC,EAAE,OAAO,CAAA;QAChB,KAAK,EAAE,gBAAgB,CAAA;QAEvB,gBAAgB,EAAE,wBAAwB,CAAA;QAE1C,uBAAuB,EAAE,kBAAkB,CAAA;KAC5C,KACG,OAAO,CAAC,aAAa,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC,GACnD,aAAa,CAAC,cAAc,EAAE,WAAW,CAAC,CAAC,GAC/C,IAAI,CAAC,aAAa,CAAC,cAAc,EAAE,WAAW,CAAC,EAAE,6BAA6B,CAAC,CAAA;CACpF,GAAG,IAAI,CACN,qBAAqB,CAAC,gBAAgB,EAAE,WAAW,CAAC,EACpD,cAAc,GAAG,sBAAsB,GAAG,kBAAkB,GAAG,KAAK,CACrE,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,CAChC,gBAAgB,GAAG,SAAS,EAC5B,cAAc,GAAG,gBAAgB,EACjC,WAAW,GAAG,SAAS,EAEvB,IAAI,EAAE,uBAAuB,CAAC,gBAAgB,EAAE,cAAc,EAAE,WAAW,CAAC,KACzE,6BAA6B,CAAC,gBAAgB,EAAE,cAAc,EAAE,WAAW,CA8C/E,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utilities/createServerFeature.ts"],"sourcesContent":["import type { SanitizedConfig } from 'payload'\n\nimport type {\n FeatureProviderProviderServer,\n FeatureProviderServer,\n ResolvedServerFeatureMap,\n ServerFeature,\n ServerFeatureProviderMap,\n} from '../features/types.js'\nimport type { ServerEditorConfig } from '../lexical/config/types.js'\n\nexport type CreateServerFeatureArgs<UnSanitizedProps, SanitizedProps, ClientProps> = Pick<\n FeatureProviderServer<UnSanitizedProps, ClientProps>,\n 'dependencies' | 'dependenciesPriority' | 'dependenciesSoft' | 'key'\n> & {\n feature:\n | ((props: {\n config: SanitizedConfig\n /** unSanitizedEditorConfig.features, but mapped */\n featureProviderMap: ServerFeatureProviderMap\n isRoot?: boolean\n props: UnSanitizedProps\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<SanitizedProps, ClientProps>>\n | ServerFeature<SanitizedProps, ClientProps>)\n | Omit<ServerFeature<SanitizedProps, ClientProps>, 'sanitizedServerFeatureProps'>\n}\n\nexport const createServerFeature: <\n UnSanitizedProps = undefined,\n SanitizedProps = UnSanitizedProps,\n ClientProps = undefined,\n>(\n args: CreateServerFeatureArgs<UnSanitizedProps, SanitizedProps, ClientProps>,\n) => FeatureProviderProviderServer<UnSanitizedProps, SanitizedProps, ClientProps> = ({\n dependencies,\n dependenciesPriority,\n dependenciesSoft,\n feature,\n key,\n}) => {\n const featureProviderProviderServer: FeatureProviderProviderServer<any, any, any> = (props) => {\n const featureProviderServer: Partial<FeatureProviderServer<any, any, any>> = {\n dependencies,\n dependenciesPriority,\n dependenciesSoft,\n key,\n serverFeatureProps: props,\n }\n\n if (typeof feature === 'function') {\n featureProviderServer.feature = async ({\n config,\n featureProviderMap,\n isRoot,\n resolvedFeatures,\n unSanitizedEditorConfig,\n }) => {\n const toReturn = await feature({\n config,\n featureProviderMap,\n isRoot,\n props,\n resolvedFeatures,\n unSanitizedEditorConfig,\n })\n\n if (toReturn.sanitizedServerFeatureProps === null) {\n toReturn.sanitizedServerFeatureProps = props\n }\n return toReturn\n }\n } else {\n ;(feature as ServerFeature<any, any>).sanitizedServerFeatureProps = props\n featureProviderServer.feature = feature as ServerFeature<any, any>\n }\n return featureProviderServer as FeatureProviderServer<any, any, any>\n }\n\n return featureProviderProviderServer\n}\n"],"names":["createServerFeature","dependencies","dependenciesPriority","dependenciesSoft","feature","key","featureProviderProviderServer","props","featureProviderServer","serverFeatureProps","config","featureProviderMap","isRoot","resolvedFeatures","unSanitizedEditorConfig","toReturn","sanitizedServerFeatureProps"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAgCA,OAAO,MAAMA,sBAMuE,CAAC,EACnFC,YAAY,EACZC,oBAAoB,EACpBC,gBAAgB,EAChBC,OAAO,EACPC,GAAG,EACJ;IACC,MAAMC,gCAA8E,CAACC;QACnF,MAAMC,wBAAuE;YAC3EP;YACAC;YACAC;YACAE;YACAI,oBAAoBF;QACtB;QAEA,IAAI,OAAOH,YAAY,YAAY;YACjCI,sBAAsBJ,OAAO,GAAG,OAAO,EACrCM,MAAM,EACNC,kBAAkB,EAClBC,MAAM,EACNC,gBAAgB,EAChBC,uBAAuB,EACxB;gBACC,MAAMC,WAAW,MAAMX,QAAQ;oBAC7BM;oBACAC;oBACAC;oBACAL;oBACAM;oBACAC;gBACF;gBAEA,IAAIC,SAASC,2BAA2B,KAAK,MAAM;oBACjDD,SAASC,2BAA2B,GAAGT;gBACzC;gBACA,OAAOQ;YACT;QACF,OAAO;YACHX,QAAoCY,2BAA2B,GAAGT;YACpEC,sBAAsBJ,OAAO,GAAGA;QAClC;QACA,OAAOI;IACT;IAEA,OAAOF;AACT,EAAC"}
1
+ {"version":3,"sources":["../../src/utilities/createServerFeature.ts"],"sourcesContent":["import type { SanitizedConfig } from 'payload'\n\nimport type {\n FeatureProviderProviderServer,\n FeatureProviderServer,\n ResolvedServerFeatureMap,\n ServerFeature,\n ServerFeatureProviderMap,\n} from '../features/typesServer.js'\nimport type { ServerEditorConfig } from '../lexical/config/types.js'\n\nexport type CreateServerFeatureArgs<UnSanitizedProps, SanitizedProps, ClientProps> = {\n feature:\n | ((props: {\n config: SanitizedConfig\n /** unSanitizedEditorConfig.features, but mapped */\n featureProviderMap: ServerFeatureProviderMap\n isRoot?: boolean\n props: UnSanitizedProps\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<SanitizedProps, ClientProps>>\n | ServerFeature<SanitizedProps, ClientProps>)\n | Omit<ServerFeature<SanitizedProps, ClientProps>, 'sanitizedServerFeatureProps'>\n} & Pick<\n FeatureProviderServer<UnSanitizedProps, ClientProps>,\n 'dependencies' | 'dependenciesPriority' | 'dependenciesSoft' | 'key'\n>\n\nexport const createServerFeature: <\n UnSanitizedProps = undefined,\n SanitizedProps = UnSanitizedProps,\n ClientProps = undefined,\n>(\n args: CreateServerFeatureArgs<UnSanitizedProps, SanitizedProps, ClientProps>,\n) => FeatureProviderProviderServer<UnSanitizedProps, SanitizedProps, ClientProps> = ({\n dependencies,\n dependenciesPriority,\n dependenciesSoft,\n feature,\n key,\n}) => {\n const featureProviderProviderServer: FeatureProviderProviderServer<any, any, any> = (props) => {\n const featureProviderServer: Partial<FeatureProviderServer<any, any, any>> = {\n dependencies,\n dependenciesPriority,\n dependenciesSoft,\n key,\n serverFeatureProps: props,\n }\n\n if (typeof feature === 'function') {\n featureProviderServer.feature = async ({\n config,\n featureProviderMap,\n isRoot,\n resolvedFeatures,\n unSanitizedEditorConfig,\n }) => {\n const toReturn = await feature({\n config,\n featureProviderMap,\n isRoot,\n props,\n resolvedFeatures,\n unSanitizedEditorConfig,\n })\n\n if (toReturn.sanitizedServerFeatureProps === null) {\n toReturn.sanitizedServerFeatureProps = props\n }\n return toReturn\n }\n } else {\n ;(feature as ServerFeature<any, any>).sanitizedServerFeatureProps = props\n featureProviderServer.feature = feature as ServerFeature<any, any>\n }\n return featureProviderServer as FeatureProviderServer<any, any, any>\n }\n\n return featureProviderProviderServer\n}\n"],"names":["createServerFeature","dependencies","dependenciesPriority","dependenciesSoft","feature","key","featureProviderProviderServer","props","featureProviderServer","serverFeatureProps","config","featureProviderMap","isRoot","resolvedFeatures","unSanitizedEditorConfig","toReturn","sanitizedServerFeatureProps"],"mappings":"AAgCA,OAAO,MAAMA,sBAMuE,CAAC,EACnFC,YAAY,EACZC,oBAAoB,EACpBC,gBAAgB,EAChBC,OAAO,EACPC,GAAG,EACJ;IACC,MAAMC,gCAA8E,CAACC;QACnF,MAAMC,wBAAuE;YAC3EP;YACAC;YACAC;YACAE;YACAI,oBAAoBF;QACtB;QAEA,IAAI,OAAOH,YAAY,YAAY;YACjCI,sBAAsBJ,OAAO,GAAG,OAAO,EACrCM,MAAM,EACNC,kBAAkB,EAClBC,MAAM,EACNC,gBAAgB,EAChBC,uBAAuB,EACxB;gBACC,MAAMC,WAAW,MAAMX,QAAQ;oBAC7BM;oBACAC;oBACAC;oBACAL;oBACAM;oBACAC;gBACF;gBAEA,IAAIC,SAASC,2BAA2B,KAAK,MAAM;oBACjDD,SAASC,2BAA2B,GAAGT;gBACzC;gBACA,OAAOQ;YACT;QACF,OAAO;YACHX,QAAoCY,2BAA2B,GAAGT;YACpEC,sBAAsBJ,OAAO,GAAGA;QAClC;QACA,OAAOI;IACT;IAEA,OAAOF;AACT,EAAC"}
@@ -0,0 +1,18 @@
1
+ import type { Data, FormState, JsonObject } from 'payload';
2
+ import React from 'react';
3
+ export type FieldsDrawerProps = {
4
+ className?: string;
5
+ data?: Data;
6
+ drawerSlug: string;
7
+ drawerTitle?: string;
8
+ featureKey: string;
9
+ handleDrawerSubmit: (fields: FormState, data: JsonObject) => void;
10
+ schemaPathSuffix?: string;
11
+ };
12
+ /**
13
+ * This FieldsDrawer component can be used to easily create a Drawer that contains a form with fields within your feature.
14
+ * The fields are taken directly from the schema map based on your `featureKey` and `schemaPathSuffix`. Thus, this can only
15
+ * be used if you provide your field schema inside the `generateSchemaMap` prop of your feature.server.ts.
16
+ */
17
+ export declare const FieldsDrawer: React.FC<FieldsDrawerProps>;
18
+ //# sourceMappingURL=Drawer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Drawer.d.ts","sourceRoot":"","sources":["../../../src/utilities/fieldsDrawer/Drawer.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAG1D,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,MAAM,MAAM,iBAAiB,GAAG;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,CAAC,EAAE,IAAI,CAAA;IACX,UAAU,EAAE,MAAM,CAAA;IAClB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,kBAAkB,EAAE,CAAC,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,KAAK,IAAI,CAAA;IACjE,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CAqBpD,CAAA"}