@payloadcms/richtext-lexical 3.0.0-beta.4 → 3.0.0-beta.41

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 (840) hide show
  1. package/dist/cell/index.d.ts +5 -2
  2. package/dist/cell/index.d.ts.map +1 -1
  3. package/dist/cell/index.js +44 -29
  4. package/dist/cell/index.js.map +1 -1
  5. package/dist/exports/components.d.ts +7 -2
  6. package/dist/exports/components.d.ts.map +1 -1
  7. package/dist/exports/components.js +7 -2
  8. package/dist/exports/components.js.map +1 -1
  9. package/dist/field/Field.d.ts +0 -2
  10. package/dist/field/Field.d.ts.map +1 -1
  11. package/dist/field/Field.js +66 -47
  12. package/dist/field/Field.js.map +1 -1
  13. package/dist/field/features/align/feature.client.d.ts +4 -1
  14. package/dist/field/features/align/feature.client.d.ts.map +1 -1
  15. package/dist/field/features/align/feature.client.js +135 -54
  16. package/dist/field/features/align/feature.client.js.map +1 -1
  17. package/dist/field/features/align/feature.server.d.ts.map +1 -1
  18. package/dist/field/features/align/feature.server.js +2 -0
  19. package/dist/field/features/align/feature.server.js.map +1 -1
  20. package/dist/field/features/align/i18n.d.ts +3 -0
  21. package/dist/field/features/align/i18n.d.ts.map +1 -0
  22. package/dist/field/features/align/i18n.js +196 -0
  23. package/dist/field/features/align/i18n.js.map +1 -0
  24. package/dist/field/features/align/toolbarAlignGroup.d.ts +3 -0
  25. package/dist/field/features/align/toolbarAlignGroup.d.ts.map +1 -0
  26. package/dist/field/features/align/toolbarAlignGroup.js +12 -0
  27. package/dist/field/features/align/toolbarAlignGroup.js.map +1 -0
  28. package/dist/field/features/blockquote/feature.client.d.ts +4 -1
  29. package/dist/field/features/blockquote/feature.client.d.ts.map +1 -1
  30. package/dist/field/features/blockquote/feature.client.js +60 -46
  31. package/dist/field/features/blockquote/feature.client.js.map +1 -1
  32. package/dist/field/features/blockquote/feature.server.d.ts +1 -1
  33. package/dist/field/features/blockquote/feature.server.d.ts.map +1 -1
  34. package/dist/field/features/blockquote/feature.server.js +9 -7
  35. package/dist/field/features/blockquote/feature.server.js.map +1 -1
  36. package/dist/field/features/blockquote/i18n.d.ts +3 -0
  37. package/dist/field/features/blockquote/i18n.d.ts.map +1 -0
  38. package/dist/field/features/blockquote/i18n.js +100 -0
  39. package/dist/field/features/blockquote/i18n.js.map +1 -0
  40. package/dist/field/features/blockquote/markdownTransformer.d.ts.map +1 -1
  41. package/dist/field/features/blockquote/markdownTransformer.js +2 -4
  42. package/dist/field/features/blockquote/markdownTransformer.js.map +1 -1
  43. package/dist/field/features/blocks/component/BlockContent.d.ts.map +1 -1
  44. package/dist/field/features/blocks/component/BlockContent.js +65 -50
  45. package/dist/field/features/blocks/component/BlockContent.js.map +1 -1
  46. package/dist/field/features/blocks/component/index.d.ts.map +1 -1
  47. package/dist/field/features/blocks/component/index.js +60 -17
  48. package/dist/field/features/blocks/component/index.js.map +1 -1
  49. package/dist/field/features/blocks/component/index.scss +0 -4
  50. package/dist/field/features/blocks/drawer/index.d.ts.map +1 -1
  51. package/dist/field/features/blocks/drawer/index.js +4 -5
  52. package/dist/field/features/blocks/drawer/index.js.map +1 -1
  53. package/dist/field/features/blocks/feature.client.d.ts +4 -1
  54. package/dist/field/features/blocks/feature.client.d.ts.map +1 -1
  55. package/dist/field/features/blocks/feature.client.js +58 -27
  56. package/dist/field/features/blocks/feature.client.js.map +1 -1
  57. package/dist/field/features/blocks/feature.server.d.ts +2 -5
  58. package/dist/field/features/blocks/feature.server.d.ts.map +1 -1
  59. package/dist/field/features/blocks/feature.server.js +111 -77
  60. package/dist/field/features/blocks/feature.server.js.map +1 -1
  61. package/dist/field/features/blocks/i18n.d.ts +3 -0
  62. package/dist/field/features/blocks/i18n.d.ts.map +1 -0
  63. package/dist/field/features/blocks/i18n.js +100 -0
  64. package/dist/field/features/blocks/i18n.js.map +1 -0
  65. package/dist/field/features/blocks/nodes/BlocksNode.d.ts +2 -4
  66. package/dist/field/features/blocks/nodes/BlocksNode.d.ts.map +1 -1
  67. package/dist/field/features/blocks/nodes/BlocksNode.js +3 -3
  68. package/dist/field/features/blocks/nodes/BlocksNode.js.map +1 -1
  69. package/dist/field/features/blocks/plugin/commands.d.ts.map +1 -1
  70. package/dist/field/features/blocks/plugin/commands.js +1 -2
  71. package/dist/field/features/blocks/plugin/commands.js.map +1 -1
  72. package/dist/field/features/blocks/plugin/index.d.ts +3 -2
  73. package/dist/field/features/blocks/plugin/index.d.ts.map +1 -1
  74. package/dist/field/features/blocks/plugin/index.js +10 -11
  75. package/dist/field/features/blocks/plugin/index.js.map +1 -1
  76. package/dist/field/features/blocks/populationPromise.d.ts.map +1 -1
  77. package/dist/field/features/blocks/populationPromise.js +5 -19
  78. package/dist/field/features/blocks/populationPromise.js.map +1 -1
  79. package/dist/field/features/blocks/validate.d.ts.map +1 -1
  80. package/dist/field/features/blocks/validate.js +22 -36
  81. package/dist/field/features/blocks/validate.js.map +1 -1
  82. package/dist/field/features/converters/html/field/index.d.ts +8 -2
  83. package/dist/field/features/converters/html/field/index.d.ts.map +1 -1
  84. package/dist/field/features/converters/html/field/index.js +36 -5
  85. package/dist/field/features/converters/html/field/index.js.map +1 -1
  86. package/dist/field/features/createFeaturePropComponent.d.ts.map +1 -1
  87. package/dist/field/features/createFeaturePropComponent.js +6 -1
  88. package/dist/field/features/createFeaturePropComponent.js.map +1 -1
  89. package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.d.ts +4 -1
  90. package/dist/field/features/debug/testRecorder/feature.client.d.ts.map +1 -0
  91. package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.js.map +1 -1
  92. package/dist/field/features/debug/{testrecorder → testRecorder}/feature.server.d.ts.map +1 -1
  93. package/dist/field/features/debug/{testrecorder → testRecorder}/feature.server.js +1 -1
  94. package/dist/field/features/debug/{testrecorder → testRecorder}/feature.server.js.map +1 -1
  95. package/dist/field/features/debug/testRecorder/plugin/index.d.ts +5 -0
  96. package/dist/field/features/debug/testRecorder/plugin/index.d.ts.map +1 -0
  97. package/dist/field/features/debug/{testrecorder → testRecorder}/plugin/index.js +68 -44
  98. package/dist/field/features/debug/testRecorder/plugin/index.js.map +1 -0
  99. package/dist/field/features/debug/{treeview → treeView}/feature.client.d.ts +4 -1
  100. package/dist/field/features/debug/treeView/feature.client.d.ts.map +1 -0
  101. package/dist/field/features/debug/{treeview → treeView}/feature.client.js.map +1 -1
  102. package/dist/field/features/debug/{treeview → treeView}/feature.server.d.ts.map +1 -1
  103. package/dist/field/features/debug/{treeview → treeView}/feature.server.js +1 -1
  104. package/dist/field/features/debug/{treeview → treeView}/feature.server.js.map +1 -1
  105. package/dist/field/features/debug/treeView/plugin/index.d.ts +4 -0
  106. package/dist/field/features/debug/treeView/plugin/index.d.ts.map +1 -0
  107. package/dist/field/features/debug/{treeview → treeView}/plugin/index.js +6 -7
  108. package/dist/field/features/debug/treeView/plugin/index.js.map +1 -0
  109. package/dist/field/features/format/bold/feature.client.d.ts +4 -1
  110. package/dist/field/features/format/bold/feature.client.d.ts.map +1 -1
  111. package/dist/field/features/format/bold/feature.client.js +26 -23
  112. package/dist/field/features/format/bold/feature.client.js.map +1 -1
  113. package/dist/field/features/format/{inlinecode → inlineCode}/feature.client.d.ts +4 -1
  114. package/dist/field/features/format/inlineCode/feature.client.d.ts.map +1 -0
  115. package/dist/field/features/format/inlineCode/feature.client.js +46 -0
  116. package/dist/field/features/format/inlineCode/feature.client.js.map +1 -0
  117. package/dist/field/features/format/{inlinecode → inlineCode}/feature.server.d.ts.map +1 -1
  118. package/dist/field/features/format/{inlinecode → inlineCode}/feature.server.js +1 -1
  119. package/dist/field/features/format/{inlinecode → inlineCode}/feature.server.js.map +1 -1
  120. package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.d.ts.map +1 -1
  121. package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.js.map +1 -1
  122. package/dist/field/features/format/italic/feature.client.d.ts +4 -1
  123. package/dist/field/features/format/italic/feature.client.d.ts.map +1 -1
  124. package/dist/field/features/format/italic/feature.client.js +27 -24
  125. package/dist/field/features/format/italic/feature.client.js.map +1 -1
  126. package/dist/field/features/format/shared/toolbarFormatGroup.d.ts +3 -0
  127. package/dist/field/features/format/shared/toolbarFormatGroup.d.ts.map +1 -0
  128. package/dist/field/features/format/shared/toolbarFormatGroup.js +10 -0
  129. package/dist/field/features/format/shared/toolbarFormatGroup.js.map +1 -0
  130. package/dist/field/features/format/strikethrough/feature.client.d.ts +4 -1
  131. package/dist/field/features/format/strikethrough/feature.client.d.ts.map +1 -1
  132. package/dist/field/features/format/strikethrough/feature.client.js +27 -24
  133. package/dist/field/features/format/strikethrough/feature.client.js.map +1 -1
  134. package/dist/field/features/format/subscript/feature.client.d.ts +4 -1
  135. package/dist/field/features/format/subscript/feature.client.d.ts.map +1 -1
  136. package/dist/field/features/format/subscript/feature.client.js +25 -22
  137. package/dist/field/features/format/subscript/feature.client.js.map +1 -1
  138. package/dist/field/features/format/superscript/feature.client.d.ts +4 -1
  139. package/dist/field/features/format/superscript/feature.client.d.ts.map +1 -1
  140. package/dist/field/features/format/superscript/feature.client.js +25 -22
  141. package/dist/field/features/format/superscript/feature.client.js.map +1 -1
  142. package/dist/field/features/format/underline/feature.client.d.ts +4 -1
  143. package/dist/field/features/format/underline/feature.client.d.ts.map +1 -1
  144. package/dist/field/features/format/underline/feature.client.js +25 -22
  145. package/dist/field/features/format/underline/feature.client.js.map +1 -1
  146. package/dist/field/features/heading/feature.client.d.ts +4 -1
  147. package/dist/field/features/heading/feature.client.d.ts.map +1 -1
  148. package/dist/field/features/heading/feature.client.js +76 -54
  149. package/dist/field/features/heading/feature.client.js.map +1 -1
  150. package/dist/field/features/heading/feature.server.d.ts.map +1 -1
  151. package/dist/field/features/heading/feature.server.js +7 -5
  152. package/dist/field/features/heading/feature.server.js.map +1 -1
  153. package/dist/field/features/heading/i18n.d.ts +3 -0
  154. package/dist/field/features/heading/i18n.d.ts.map +1 -0
  155. package/dist/field/features/heading/i18n.js +100 -0
  156. package/dist/field/features/heading/i18n.js.map +1 -0
  157. package/dist/field/features/heading/markdownTransformer.d.ts.map +1 -1
  158. package/dist/field/features/heading/markdownTransformer.js +1 -2
  159. package/dist/field/features/heading/markdownTransformer.js.map +1 -1
  160. package/dist/field/features/horizontalRule/component/index.d.ts +10 -0
  161. package/dist/field/features/horizontalRule/component/index.d.ts.map +1 -0
  162. package/dist/field/features/horizontalRule/component/index.js +67 -0
  163. package/dist/field/features/horizontalRule/component/index.js.map +1 -0
  164. package/dist/field/features/horizontalRule/feature.client.d.ts +6 -0
  165. package/dist/field/features/horizontalRule/feature.client.d.ts.map +1 -0
  166. package/dist/field/features/horizontalRule/feature.client.js +77 -0
  167. package/dist/field/features/horizontalRule/feature.client.js.map +1 -0
  168. package/dist/field/features/horizontalRule/feature.server.d.ts +3 -0
  169. package/dist/field/features/horizontalRule/feature.server.d.ts.map +1 -0
  170. package/dist/field/features/horizontalRule/feature.server.js +38 -0
  171. package/dist/field/features/horizontalRule/feature.server.js.map +1 -0
  172. package/dist/field/features/horizontalRule/i18n.d.ts +3 -0
  173. package/dist/field/features/horizontalRule/i18n.d.ts.map +1 -0
  174. package/dist/field/features/horizontalRule/i18n.js +100 -0
  175. package/dist/field/features/horizontalRule/i18n.js.map +1 -0
  176. package/dist/field/features/horizontalRule/markdownTransformer.d.ts +3 -0
  177. package/dist/field/features/horizontalRule/markdownTransformer.d.ts.map +1 -0
  178. package/dist/field/features/horizontalRule/markdownTransformer.js +23 -0
  179. package/dist/field/features/horizontalRule/markdownTransformer.js.map +1 -0
  180. package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.d.ts +53 -0
  181. package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.d.ts.map +1 -0
  182. package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.js +92 -0
  183. package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.js.map +1 -0
  184. package/dist/field/features/horizontalRule/plugin/index.d.ts +7 -0
  185. package/dist/field/features/horizontalRule/plugin/index.d.ts.map +1 -0
  186. package/dist/field/features/horizontalRule/plugin/index.js +31 -0
  187. package/dist/field/features/horizontalRule/plugin/index.js.map +1 -0
  188. package/dist/field/features/horizontalRule/plugin/index.scss +20 -0
  189. package/dist/field/features/indent/feature.client.d.ts +4 -1
  190. package/dist/field/features/indent/feature.client.d.ts.map +1 -1
  191. package/dist/field/features/indent/feature.client.js +47 -42
  192. package/dist/field/features/indent/feature.client.js.map +1 -1
  193. package/dist/field/features/indent/feature.server.d.ts.map +1 -1
  194. package/dist/field/features/indent/feature.server.js +2 -0
  195. package/dist/field/features/indent/feature.server.js.map +1 -1
  196. package/dist/field/features/indent/i18n.d.ts +3 -0
  197. package/dist/field/features/indent/i18n.d.ts.map +1 -0
  198. package/dist/field/features/indent/i18n.js +132 -0
  199. package/dist/field/features/indent/i18n.js.map +1 -0
  200. package/dist/field/features/indent/toolbarIndentGroup.d.ts +3 -0
  201. package/dist/field/features/indent/toolbarIndentGroup.d.ts.map +1 -0
  202. package/dist/field/features/indent/toolbarIndentGroup.js +10 -0
  203. package/dist/field/features/indent/toolbarIndentGroup.js.map +1 -0
  204. package/dist/field/features/link/drawer/baseFields.d.ts +2 -2
  205. package/dist/field/features/link/drawer/baseFields.d.ts.map +1 -1
  206. package/dist/field/features/link/drawer/baseFields.js +30 -43
  207. package/dist/field/features/link/drawer/baseFields.js.map +1 -1
  208. package/dist/field/features/link/drawer/index.js +30 -21
  209. package/dist/field/features/link/drawer/index.js.map +1 -1
  210. package/dist/field/features/link/drawer/types.d.ts +4 -2
  211. package/dist/field/features/link/drawer/types.d.ts.map +1 -1
  212. package/dist/field/features/link/drawer/types.js.map +1 -1
  213. package/dist/field/features/link/feature.client.d.ts +13 -1
  214. package/dist/field/features/link/feature.client.d.ts.map +1 -1
  215. package/dist/field/features/link/feature.client.js +65 -47
  216. package/dist/field/features/link/feature.client.js.map +1 -1
  217. package/dist/field/features/link/feature.server.d.ts +10 -5
  218. package/dist/field/features/link/feature.server.d.ts.map +1 -1
  219. package/dist/field/features/link/feature.server.js +58 -11
  220. package/dist/field/features/link/feature.server.js.map +1 -1
  221. package/dist/field/features/link/i18n.d.ts +3 -0
  222. package/dist/field/features/link/i18n.d.ts.map +1 -0
  223. package/dist/field/features/link/i18n.js +100 -0
  224. package/dist/field/features/link/i18n.js.map +1 -0
  225. package/dist/field/features/link/markdownTransformer.d.ts +6 -0
  226. package/dist/field/features/link/markdownTransformer.d.ts.map +1 -0
  227. package/dist/field/features/link/markdownTransformer.js +50 -0
  228. package/dist/field/features/link/markdownTransformer.js.map +1 -0
  229. package/dist/field/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  230. package/dist/field/features/link/nodes/AutoLinkNode.js +1 -2
  231. package/dist/field/features/link/nodes/AutoLinkNode.js.map +1 -1
  232. package/dist/field/features/link/nodes/LinkNode.d.ts +4 -4
  233. package/dist/field/features/link/nodes/LinkNode.d.ts.map +1 -1
  234. package/dist/field/features/link/nodes/LinkNode.js +6 -7
  235. package/dist/field/features/link/nodes/LinkNode.js.map +1 -1
  236. package/dist/field/features/link/plugins/autoLink/index.d.ts +3 -2
  237. package/dist/field/features/link/plugins/autoLink/index.d.ts.map +1 -1
  238. package/dist/field/features/link/plugins/autoLink/index.js +11 -12
  239. package/dist/field/features/link/plugins/autoLink/index.js.map +1 -1
  240. package/dist/field/features/link/plugins/clickableLink/index.d.ts +3 -2
  241. package/dist/field/features/link/plugins/clickableLink/index.d.ts.map +1 -1
  242. package/dist/field/features/link/plugins/clickableLink/index.js +5 -6
  243. package/dist/field/features/link/plugins/clickableLink/index.js.map +1 -1
  244. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.d.ts.map +1 -1
  245. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.js +1 -2
  246. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.js.map +1 -1
  247. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  248. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js +177 -135
  249. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  250. package/dist/field/features/link/plugins/floatingLinkEditor/index.d.ts +3 -4
  251. package/dist/field/features/link/plugins/floatingLinkEditor/index.d.ts.map +1 -1
  252. package/dist/field/features/link/plugins/floatingLinkEditor/index.js +2 -1
  253. package/dist/field/features/link/plugins/floatingLinkEditor/index.js.map +1 -1
  254. package/dist/field/features/link/plugins/floatingLinkEditor/index.scss +11 -3
  255. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts +1 -3
  256. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts.map +1 -1
  257. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js +12 -30
  258. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js.map +1 -1
  259. package/dist/field/features/link/plugins/link/index.d.ts +3 -1
  260. package/dist/field/features/link/plugins/link/index.d.ts.map +1 -1
  261. package/dist/field/features/link/plugins/link/index.js +5 -14
  262. package/dist/field/features/link/plugins/link/index.js.map +1 -1
  263. package/dist/field/features/link/populationPromise.d.ts.map +1 -1
  264. package/dist/field/features/link/populationPromise.js +11 -26
  265. package/dist/field/features/link/populationPromise.js.map +1 -1
  266. package/dist/field/features/link/validate.d.ts +5 -0
  267. package/dist/field/features/link/validate.d.ts.map +1 -0
  268. package/dist/field/features/link/validate.js +32 -0
  269. package/dist/field/features/link/validate.js.map +1 -0
  270. package/dist/field/features/lists/checklist/feature.client.d.ts +4 -1
  271. package/dist/field/features/lists/checklist/feature.client.d.ts.map +1 -1
  272. package/dist/field/features/lists/checklist/feature.client.js +69 -44
  273. package/dist/field/features/lists/checklist/feature.client.js.map +1 -1
  274. package/dist/field/features/lists/checklist/feature.server.d.ts +1 -1
  275. package/dist/field/features/lists/checklist/feature.server.d.ts.map +1 -1
  276. package/dist/field/features/lists/checklist/feature.server.js +12 -10
  277. package/dist/field/features/lists/checklist/feature.server.js.map +1 -1
  278. package/dist/field/features/lists/checklist/i18n.d.ts +3 -0
  279. package/dist/field/features/lists/checklist/i18n.d.ts.map +1 -0
  280. package/dist/field/features/lists/checklist/i18n.js +100 -0
  281. package/dist/field/features/lists/checklist/i18n.js.map +1 -0
  282. package/dist/field/features/lists/checklist/markdownTransformers.d.ts.map +1 -1
  283. package/dist/field/features/lists/checklist/markdownTransformers.js +2 -3
  284. package/dist/field/features/lists/checklist/markdownTransformers.js.map +1 -1
  285. package/dist/field/features/lists/checklist/plugin/index.d.ts +2 -2
  286. package/dist/field/features/lists/checklist/plugin/index.d.ts.map +1 -1
  287. package/dist/field/features/lists/checklist/plugin/index.js +5 -5
  288. package/dist/field/features/lists/checklist/plugin/index.js.map +1 -1
  289. package/dist/field/features/lists/htmlConverter.d.ts.map +1 -1
  290. package/dist/field/features/lists/htmlConverter.js +13 -6
  291. package/dist/field/features/lists/htmlConverter.js.map +1 -1
  292. package/dist/field/features/lists/{orderedlist → orderedList}/feature.client.d.ts +4 -1
  293. package/dist/field/features/lists/orderedList/feature.client.d.ts.map +1 -0
  294. package/dist/field/features/lists/orderedList/feature.client.js +97 -0
  295. package/dist/field/features/lists/orderedList/feature.client.js.map +1 -0
  296. package/dist/field/features/lists/orderedList/feature.server.d.ts.map +1 -0
  297. package/dist/field/features/lists/{orderedlist → orderedList}/feature.server.js +10 -8
  298. package/dist/field/features/lists/orderedList/feature.server.js.map +1 -0
  299. package/dist/field/features/lists/orderedList/i18n.d.ts +3 -0
  300. package/dist/field/features/lists/orderedList/i18n.d.ts.map +1 -0
  301. package/dist/field/features/lists/orderedList/i18n.js +100 -0
  302. package/dist/field/features/lists/orderedList/i18n.js.map +1 -0
  303. package/dist/field/features/lists/orderedList/markdownTransformer.d.ts.map +1 -0
  304. package/dist/field/features/lists/{orderedlist → orderedList}/markdownTransformer.js +2 -3
  305. package/dist/field/features/lists/orderedList/markdownTransformer.js.map +1 -0
  306. package/dist/field/features/lists/plugin/index.d.ts +2 -2
  307. package/dist/field/features/lists/plugin/index.d.ts.map +1 -1
  308. package/dist/field/features/lists/plugin/index.js +5 -5
  309. package/dist/field/features/lists/plugin/index.js.map +1 -1
  310. package/dist/field/features/lists/{common → shared}/markdown.d.ts.map +1 -1
  311. package/dist/field/features/lists/{common → shared}/markdown.js +1 -2
  312. package/dist/field/features/lists/shared/markdown.js.map +1 -0
  313. package/dist/field/features/lists/shared/slashMenuListGroup.d.ts +3 -0
  314. package/dist/field/features/lists/shared/slashMenuListGroup.d.ts.map +1 -0
  315. package/dist/field/features/lists/shared/slashMenuListGroup.js +11 -0
  316. package/dist/field/features/lists/shared/slashMenuListGroup.js.map +1 -0
  317. package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.client.d.ts +4 -1
  318. package/dist/field/features/lists/unorderedList/feature.client.d.ts.map +1 -0
  319. package/dist/field/features/lists/unorderedList/feature.client.js +97 -0
  320. package/dist/field/features/lists/unorderedList/feature.client.js.map +1 -0
  321. package/dist/field/features/lists/unorderedList/feature.server.d.ts.map +1 -0
  322. package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.server.js +9 -7
  323. package/dist/field/features/lists/unorderedList/feature.server.js.map +1 -0
  324. package/dist/field/features/lists/unorderedList/i18n.d.ts +3 -0
  325. package/dist/field/features/lists/unorderedList/i18n.d.ts.map +1 -0
  326. package/dist/field/features/lists/unorderedList/i18n.js +100 -0
  327. package/dist/field/features/lists/unorderedList/i18n.js.map +1 -0
  328. package/dist/field/features/lists/unorderedList/markdownTransformer.d.ts.map +1 -0
  329. package/dist/field/features/lists/{unorderedlist → unorderedList}/markdownTransformer.js +2 -3
  330. package/dist/field/features/lists/unorderedList/markdownTransformer.js.map +1 -0
  331. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.d.ts.map +1 -1
  332. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js +2 -4
  333. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js.map +1 -1
  334. package/dist/field/features/migrations/lexicalPluginToLexical/feature.client.d.ts +4 -1
  335. package/dist/field/features/migrations/lexicalPluginToLexical/feature.client.d.ts.map +1 -1
  336. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js +9 -1
  337. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  338. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts +2 -4
  339. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  340. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +4 -5
  341. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  342. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.d.ts +1 -1
  343. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.js +1 -1
  344. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.js.map +1 -1
  345. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/index.js +2 -2
  346. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/index.js.map +1 -1
  347. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.d.ts.map +1 -1
  348. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.js +2 -4
  349. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.js.map +1 -1
  350. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.d.ts.map +1 -1
  351. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.js +2 -4
  352. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.js.map +1 -1
  353. package/dist/field/features/migrations/slateToLexical/converter/index.d.ts.map +1 -1
  354. package/dist/field/features/migrations/slateToLexical/converter/index.js +2 -1
  355. package/dist/field/features/migrations/slateToLexical/converter/index.js.map +1 -1
  356. package/dist/field/features/migrations/slateToLexical/feature.client.d.ts +4 -1
  357. package/dist/field/features/migrations/slateToLexical/feature.client.d.ts.map +1 -1
  358. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js +9 -1
  359. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  360. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts +2 -4
  361. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  362. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +4 -5
  363. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  364. package/dist/field/features/paragraph/feature.client.d.ts +4 -1
  365. package/dist/field/features/paragraph/feature.client.d.ts.map +1 -1
  366. package/dist/field/features/paragraph/feature.client.js +54 -41
  367. package/dist/field/features/paragraph/feature.client.js.map +1 -1
  368. package/dist/field/features/paragraph/feature.server.d.ts.map +1 -1
  369. package/dist/field/features/paragraph/feature.server.js +2 -0
  370. package/dist/field/features/paragraph/feature.server.js.map +1 -1
  371. package/dist/field/features/paragraph/i18n.d.ts +3 -0
  372. package/dist/field/features/paragraph/i18n.d.ts.map +1 -0
  373. package/dist/field/features/paragraph/i18n.js +132 -0
  374. package/dist/field/features/paragraph/i18n.js.map +1 -0
  375. package/dist/field/features/relationship/drawer/commands.d.ts.map +1 -1
  376. package/dist/field/features/relationship/drawer/commands.js +1 -2
  377. package/dist/field/features/relationship/drawer/commands.js.map +1 -1
  378. package/dist/field/features/relationship/drawer/index.d.ts.map +1 -1
  379. package/dist/field/features/relationship/drawer/index.js +17 -15
  380. package/dist/field/features/relationship/drawer/index.js.map +1 -1
  381. package/dist/field/features/relationship/feature.client.d.ts +17 -2
  382. package/dist/field/features/relationship/feature.client.d.ts.map +1 -1
  383. package/dist/field/features/relationship/feature.client.js +51 -28
  384. package/dist/field/features/relationship/feature.client.js.map +1 -1
  385. package/dist/field/features/relationship/feature.server.d.ts +10 -1
  386. package/dist/field/features/relationship/feature.server.d.ts.map +1 -1
  387. package/dist/field/features/relationship/feature.server.js +7 -4
  388. package/dist/field/features/relationship/feature.server.js.map +1 -1
  389. package/dist/field/features/relationship/i18n.d.ts +3 -0
  390. package/dist/field/features/relationship/i18n.d.ts.map +1 -0
  391. package/dist/field/features/relationship/i18n.js +100 -0
  392. package/dist/field/features/relationship/i18n.js.map +1 -0
  393. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts +4 -9
  394. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts.map +1 -1
  395. package/dist/field/features/relationship/nodes/RelationshipNode.js +12 -11
  396. package/dist/field/features/relationship/nodes/RelationshipNode.js.map +1 -1
  397. package/dist/field/features/relationship/nodes/components/RelationshipComponent.d.ts.map +1 -1
  398. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js +119 -50
  399. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js.map +1 -1
  400. package/dist/field/features/relationship/plugins/index.d.ts +2 -2
  401. package/dist/field/features/relationship/plugins/index.d.ts.map +1 -1
  402. package/dist/field/features/relationship/plugins/index.js +14 -15
  403. package/dist/field/features/relationship/plugins/index.js.map +1 -1
  404. package/dist/field/features/relationship/populationPromise.d.ts +2 -1
  405. package/dist/field/features/relationship/populationPromise.d.ts.map +1 -1
  406. package/dist/field/features/relationship/populationPromise.js +25 -19
  407. package/dist/field/features/relationship/populationPromise.js.map +1 -1
  408. package/dist/field/features/shared/slashMenu/basicGroup.d.ts +3 -0
  409. package/dist/field/features/shared/slashMenu/basicGroup.d.ts.map +1 -0
  410. package/dist/field/features/shared/slashMenu/basicGroup.js +11 -0
  411. package/dist/field/features/shared/slashMenu/basicGroup.js.map +1 -0
  412. package/dist/field/features/shared/toolbar/addDropdownGroup.d.ts +3 -0
  413. package/dist/field/features/shared/toolbar/addDropdownGroup.d.ts.map +1 -0
  414. package/dist/field/features/shared/toolbar/addDropdownGroup.js +12 -0
  415. package/dist/field/features/shared/toolbar/addDropdownGroup.js.map +1 -0
  416. package/dist/field/features/shared/toolbar/featureButtonsGroup.d.ts +3 -0
  417. package/dist/field/features/shared/toolbar/featureButtonsGroup.d.ts.map +1 -0
  418. package/dist/field/features/shared/toolbar/featureButtonsGroup.js +10 -0
  419. package/dist/field/features/shared/toolbar/featureButtonsGroup.js.map +1 -0
  420. package/dist/field/features/shared/toolbar/textDropdownGroup.d.ts +3 -0
  421. package/dist/field/features/shared/toolbar/textDropdownGroup.d.ts.map +1 -0
  422. package/dist/field/features/shared/toolbar/textDropdownGroup.js +12 -0
  423. package/dist/field/features/shared/toolbar/textDropdownGroup.js.map +1 -0
  424. package/dist/field/features/toolbars/fixed/Toolbar/index.d.ts +5 -0
  425. package/dist/field/features/toolbars/fixed/Toolbar/index.d.ts.map +1 -0
  426. package/dist/field/features/toolbars/fixed/Toolbar/index.js +211 -0
  427. package/dist/field/features/toolbars/fixed/Toolbar/index.js.map +1 -0
  428. package/dist/field/features/toolbars/fixed/Toolbar/index.scss +119 -0
  429. package/dist/field/features/toolbars/fixed/feature.client.d.ts +7 -0
  430. package/dist/field/features/toolbars/fixed/feature.client.d.ts.map +1 -0
  431. package/dist/field/features/toolbars/fixed/feature.client.js +20 -0
  432. package/dist/field/features/toolbars/fixed/feature.client.js.map +1 -0
  433. package/dist/field/features/toolbars/fixed/feature.server.d.ts +19 -0
  434. package/dist/field/features/toolbars/fixed/feature.server.d.ts.map +1 -0
  435. package/dist/field/features/toolbars/fixed/feature.server.js +20 -0
  436. package/dist/field/features/toolbars/fixed/feature.server.js.map +1 -0
  437. package/dist/field/features/toolbars/inline/Toolbar/index.d.ts +4 -0
  438. package/dist/field/features/toolbars/inline/Toolbar/index.d.ts.map +1 -0
  439. package/dist/field/features/toolbars/inline/Toolbar/index.js +320 -0
  440. package/dist/field/features/toolbars/inline/Toolbar/index.js.map +1 -0
  441. package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/inline/Toolbar}/index.scss +7 -11
  442. package/dist/field/features/toolbars/inline/feature.client.d.ts +6 -0
  443. package/dist/field/features/toolbars/inline/feature.client.d.ts.map +1 -0
  444. package/dist/field/features/toolbars/inline/feature.client.js +20 -0
  445. package/dist/field/features/toolbars/inline/feature.client.js.map +1 -0
  446. package/dist/field/features/toolbars/inline/feature.server.d.ts +3 -0
  447. package/dist/field/features/toolbars/inline/feature.server.d.ts.map +1 -0
  448. package/dist/field/features/toolbars/inline/feature.server.js +15 -0
  449. package/dist/field/features/toolbars/inline/feature.server.js.map +1 -0
  450. package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts +10 -0
  451. package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -0
  452. package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/shared}/ToolbarButton/index.js +34 -22
  453. package/dist/field/features/toolbars/shared/ToolbarButton/index.js.map +1 -0
  454. package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/shared}/ToolbarButton/index.scss +3 -1
  455. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts +23 -0
  456. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -0
  457. package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/shared}/ToolbarDropdown/DropDown.js +74 -100
  458. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -0
  459. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts +23 -0
  460. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -0
  461. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js +142 -0
  462. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -0
  463. package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/shared}/ToolbarDropdown/index.scss +25 -13
  464. package/dist/field/features/toolbars/types.d.ts +48 -0
  465. package/dist/field/features/toolbars/types.d.ts.map +1 -0
  466. package/dist/field/features/toolbars/types.js.map +1 -0
  467. package/dist/field/features/typeUtilities.d.ts +8 -0
  468. package/dist/field/features/typeUtilities.d.ts.map +1 -0
  469. package/dist/field/features/typeUtilities.js +8 -0
  470. package/dist/field/features/typeUtilities.js.map +1 -0
  471. package/dist/field/features/types.d.ts +172 -63
  472. package/dist/field/features/types.d.ts.map +1 -1
  473. package/dist/field/features/types.js.map +1 -1
  474. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.d.ts.map +1 -1
  475. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js +32 -25
  476. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js.map +1 -1
  477. package/dist/field/features/upload/component/index.d.ts.map +1 -1
  478. package/dist/field/features/upload/component/index.js +159 -76
  479. package/dist/field/features/upload/component/index.js.map +1 -1
  480. package/dist/field/features/upload/drawer/commands.d.ts.map +1 -1
  481. package/dist/field/features/upload/drawer/commands.js +1 -2
  482. package/dist/field/features/upload/drawer/commands.js.map +1 -1
  483. package/dist/field/features/upload/drawer/index.d.ts.map +1 -1
  484. package/dist/field/features/upload/drawer/index.js +16 -16
  485. package/dist/field/features/upload/drawer/index.js.map +1 -1
  486. package/dist/field/features/upload/feature.client.d.ts +4 -1
  487. package/dist/field/features/upload/feature.client.d.ts.map +1 -1
  488. package/dist/field/features/upload/feature.client.js +52 -26
  489. package/dist/field/features/upload/feature.client.js.map +1 -1
  490. package/dist/field/features/upload/feature.server.d.ts +10 -3
  491. package/dist/field/features/upload/feature.server.d.ts.map +1 -1
  492. package/dist/field/features/upload/feature.server.js +41 -11
  493. package/dist/field/features/upload/feature.server.js.map +1 -1
  494. package/dist/field/features/upload/i18n.d.ts +3 -0
  495. package/dist/field/features/upload/i18n.d.ts.map +1 -0
  496. package/dist/field/features/upload/i18n.js +100 -0
  497. package/dist/field/features/upload/i18n.js.map +1 -0
  498. package/dist/field/features/upload/nodes/UploadNode.d.ts +3 -15
  499. package/dist/field/features/upload/nodes/UploadNode.d.ts.map +1 -1
  500. package/dist/field/features/upload/nodes/UploadNode.js +35 -14
  501. package/dist/field/features/upload/nodes/UploadNode.js.map +1 -1
  502. package/dist/field/features/upload/plugin/index.d.ts +5 -4
  503. package/dist/field/features/upload/plugin/index.d.ts.map +1 -1
  504. package/dist/field/features/upload/plugin/index.js +16 -19
  505. package/dist/field/features/upload/plugin/index.js.map +1 -1
  506. package/dist/field/features/upload/populationPromise.d.ts.map +1 -1
  507. package/dist/field/features/upload/populationPromise.js +16 -10
  508. package/dist/field/features/upload/populationPromise.js.map +1 -1
  509. package/dist/field/features/upload/validate.d.ts +2 -1
  510. package/dist/field/features/upload/validate.d.ts.map +1 -1
  511. package/dist/field/features/upload/validate.js +36 -9
  512. package/dist/field/features/upload/validate.js.map +1 -1
  513. package/dist/field/index.d.ts +3 -1
  514. package/dist/field/index.d.ts.map +1 -1
  515. package/dist/field/index.js +39 -26
  516. package/dist/field/index.js.map +1 -1
  517. package/dist/field/index.scss +1 -22
  518. package/dist/field/lexical/EditorPlugin.d.ts +1 -0
  519. package/dist/field/lexical/EditorPlugin.d.ts.map +1 -1
  520. package/dist/field/lexical/EditorPlugin.js +8 -4
  521. package/dist/field/lexical/EditorPlugin.js.map +1 -1
  522. package/dist/field/lexical/LexicalEditor.d.ts +3 -1
  523. package/dist/field/lexical/LexicalEditor.d.ts.map +1 -1
  524. package/dist/field/lexical/LexicalEditor.js +157 -76
  525. package/dist/field/lexical/LexicalEditor.js.map +1 -1
  526. package/dist/field/lexical/LexicalEditor.scss +13 -20
  527. package/dist/field/lexical/LexicalProvider.d.ts +1 -1
  528. package/dist/field/lexical/LexicalProvider.d.ts.map +1 -1
  529. package/dist/field/lexical/LexicalProvider.js +52 -41
  530. package/dist/field/lexical/LexicalProvider.js.map +1 -1
  531. package/dist/field/lexical/config/client/EditorConfigProvider.d.ts +15 -4
  532. package/dist/field/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
  533. package/dist/field/lexical/config/client/EditorConfigProvider.js +61 -11
  534. package/dist/field/lexical/config/client/EditorConfigProvider.js.map +1 -1
  535. package/dist/field/lexical/config/client/default.d.ts +1 -1
  536. package/dist/field/lexical/config/client/default.d.ts.map +1 -1
  537. package/dist/field/lexical/config/client/default.js.map +1 -1
  538. package/dist/field/lexical/config/client/sanitize.d.ts +3 -2
  539. package/dist/field/lexical/config/client/sanitize.d.ts.map +1 -1
  540. package/dist/field/lexical/config/client/sanitize.js +83 -33
  541. package/dist/field/lexical/config/client/sanitize.js.map +1 -1
  542. package/dist/field/lexical/config/server/default.d.ts +2 -3
  543. package/dist/field/lexical/config/server/default.d.ts.map +1 -1
  544. package/dist/field/lexical/config/server/default.js +12 -10
  545. package/dist/field/lexical/config/server/default.js.map +1 -1
  546. package/dist/field/lexical/config/server/loader.d.ts +5 -2
  547. package/dist/field/lexical/config/server/loader.d.ts.map +1 -1
  548. package/dist/field/lexical/config/server/loader.js +4 -2
  549. package/dist/field/lexical/config/server/loader.js.map +1 -1
  550. package/dist/field/lexical/config/server/sanitize.d.ts +2 -1
  551. package/dist/field/lexical/config/server/sanitize.d.ts.map +1 -1
  552. package/dist/field/lexical/config/server/sanitize.js +32 -6
  553. package/dist/field/lexical/config/server/sanitize.js.map +1 -1
  554. package/dist/field/lexical/config/types.d.ts +3 -1
  555. package/dist/field/lexical/config/types.d.ts.map +1 -1
  556. package/dist/field/lexical/config/types.js.map +1 -1
  557. package/dist/field/lexical/plugins/MarkdownShortcut/index.d.ts.map +1 -1
  558. package/dist/field/lexical/plugins/MarkdownShortcut/index.js +3 -3
  559. package/dist/field/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  560. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +10 -10
  561. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  562. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +74 -77
  563. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  564. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts +5 -5
  565. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts.map +1 -1
  566. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +8 -10
  567. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
  568. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts +19 -27
  569. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts.map +1 -1
  570. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js +1 -37
  571. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
  572. package/dist/field/lexical/plugins/SlashMenu/index.d.ts +2 -2
  573. package/dist/field/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
  574. package/dist/field/lexical/plugins/SlashMenu/index.js +108 -92
  575. package/dist/field/lexical/plugins/SlashMenu/index.js.map +1 -1
  576. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts +2 -2
  577. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts.map +1 -1
  578. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js +47 -125
  579. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  580. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.scss +2 -2
  581. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.d.ts +1 -1
  582. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.d.ts.map +1 -1
  583. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.js.map +1 -1
  584. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts +2 -2
  585. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  586. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js +116 -66
  587. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  588. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.scss +20 -3
  589. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts +8 -1
  590. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts.map +1 -1
  591. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js +83 -16
  592. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
  593. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts +5 -0
  594. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts.map +1 -0
  595. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.js +21 -0
  596. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.js.map +1 -0
  597. package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.d.ts +9 -0
  598. package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.d.ts.map +1 -0
  599. package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.js +35 -0
  600. package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.js.map +1 -0
  601. package/dist/field/lexical/plugins/handles/{DraggableBlockPlugin → utils}/getNodeCloseToPoint.d.ts +5 -1
  602. package/dist/field/lexical/plugins/handles/utils/getNodeCloseToPoint.d.ts.map +1 -0
  603. package/dist/field/lexical/plugins/handles/{DraggableBlockPlugin → utils}/getNodeCloseToPoint.js +5 -18
  604. package/dist/field/lexical/plugins/handles/utils/getNodeCloseToPoint.js.map +1 -0
  605. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.d.ts.map +1 -1
  606. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.js +1 -2
  607. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.js.map +1 -1
  608. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.d.ts +1 -1
  609. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
  610. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js +19 -7
  611. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  612. package/dist/field/lexical/theme/EditorTheme.d.ts.map +1 -1
  613. package/dist/field/lexical/theme/EditorTheme.js +1 -0
  614. package/dist/field/lexical/theme/EditorTheme.js.map +1 -1
  615. package/dist/field/lexical/theme/EditorTheme.scss +18 -14
  616. package/dist/field/lexical/ui/ContentEditable.d.ts +1 -1
  617. package/dist/field/lexical/ui/ContentEditable.d.ts.map +1 -1
  618. package/dist/field/lexical/ui/ContentEditable.js +3 -3
  619. package/dist/field/lexical/ui/ContentEditable.js.map +1 -1
  620. package/dist/field/lexical/ui/ContentEditable.scss +55 -4
  621. package/dist/field/lexical/ui/icons/AI/index.js +26 -17
  622. package/dist/field/lexical/ui/icons/AI/index.js.map +1 -1
  623. package/dist/field/lexical/ui/icons/Add/index.d.ts +3 -0
  624. package/dist/field/lexical/ui/icons/Add/index.d.ts.map +1 -0
  625. package/dist/field/lexical/ui/icons/Add/index.js +21 -0
  626. package/dist/field/lexical/ui/icons/Add/index.js.map +1 -0
  627. package/dist/field/lexical/ui/icons/Add/light.svg +4 -0
  628. package/dist/field/lexical/ui/icons/AlignCenter/index.js +21 -15
  629. package/dist/field/lexical/ui/icons/AlignCenter/index.js.map +1 -1
  630. package/dist/field/lexical/ui/icons/AlignJustify/index.js +21 -15
  631. package/dist/field/lexical/ui/icons/AlignJustify/index.js.map +1 -1
  632. package/dist/field/lexical/ui/icons/AlignLeft/index.js +21 -15
  633. package/dist/field/lexical/ui/icons/AlignLeft/index.js.map +1 -1
  634. package/dist/field/lexical/ui/icons/AlignRight/index.js +21 -15
  635. package/dist/field/lexical/ui/icons/AlignRight/index.js.map +1 -1
  636. package/dist/field/lexical/ui/icons/Block/index.js +30 -24
  637. package/dist/field/lexical/ui/icons/Block/index.js.map +1 -1
  638. package/dist/field/lexical/ui/icons/Blockquote/index.js +8 -6
  639. package/dist/field/lexical/ui/icons/Blockquote/index.js.map +1 -1
  640. package/dist/field/lexical/ui/icons/Bold/index.js +8 -6
  641. package/dist/field/lexical/ui/icons/Bold/index.js.map +1 -1
  642. package/dist/field/lexical/ui/icons/Checklist/index.js +19 -14
  643. package/dist/field/lexical/ui/icons/Checklist/index.js.map +1 -1
  644. package/dist/field/lexical/ui/icons/Code/index.js +14 -9
  645. package/dist/field/lexical/ui/icons/Code/index.js.map +1 -1
  646. package/dist/field/lexical/ui/icons/CodeBlock/index.js +14 -9
  647. package/dist/field/lexical/ui/icons/CodeBlock/index.js.map +1 -1
  648. package/dist/field/lexical/ui/icons/DraggableBlock/light.svg +9 -0
  649. package/dist/field/lexical/ui/icons/H1/index.js +8 -6
  650. package/dist/field/lexical/ui/icons/H1/index.js.map +1 -1
  651. package/dist/field/lexical/ui/icons/H2/index.js +8 -6
  652. package/dist/field/lexical/ui/icons/H2/index.js.map +1 -1
  653. package/dist/field/lexical/ui/icons/H3/index.js +8 -6
  654. package/dist/field/lexical/ui/icons/H3/index.js.map +1 -1
  655. package/dist/field/lexical/ui/icons/H4/index.js +8 -6
  656. package/dist/field/lexical/ui/icons/H4/index.js.map +1 -1
  657. package/dist/field/lexical/ui/icons/H5/index.js +8 -6
  658. package/dist/field/lexical/ui/icons/H5/index.js.map +1 -1
  659. package/dist/field/lexical/ui/icons/H6/index.js +8 -6
  660. package/dist/field/lexical/ui/icons/H6/index.js.map +1 -1
  661. package/dist/field/lexical/ui/icons/HorizontalRule/index.d.ts +3 -0
  662. package/dist/field/lexical/ui/icons/HorizontalRule/index.d.ts.map +1 -0
  663. package/dist/field/lexical/ui/icons/HorizontalRule/index.js +21 -0
  664. package/dist/field/lexical/ui/icons/HorizontalRule/index.js.map +1 -0
  665. package/dist/field/lexical/ui/icons/IndentDecrease/index.js +25 -18
  666. package/dist/field/lexical/ui/icons/IndentDecrease/index.js.map +1 -1
  667. package/dist/field/lexical/ui/icons/IndentIncrease/index.js +25 -18
  668. package/dist/field/lexical/ui/icons/IndentIncrease/index.js.map +1 -1
  669. package/dist/field/lexical/ui/icons/Italic/index.js +8 -6
  670. package/dist/field/lexical/ui/icons/Italic/index.js.map +1 -1
  671. package/dist/field/lexical/ui/icons/Link/index.d.ts.map +1 -1
  672. package/dist/field/lexical/ui/icons/Link/index.js +10 -18
  673. package/dist/field/lexical/ui/icons/Link/index.js.map +1 -1
  674. package/dist/field/lexical/ui/icons/OrderedList/index.js +29 -21
  675. package/dist/field/lexical/ui/icons/OrderedList/index.js.map +1 -1
  676. package/dist/field/lexical/ui/icons/Relationship/index.js +26 -17
  677. package/dist/field/lexical/ui/icons/Relationship/index.js.map +1 -1
  678. package/dist/field/lexical/ui/icons/Strikethrough/index.js +14 -9
  679. package/dist/field/lexical/ui/icons/Strikethrough/index.js.map +1 -1
  680. package/dist/field/lexical/ui/icons/Subscript/index.js +8 -6
  681. package/dist/field/lexical/ui/icons/Subscript/index.js.map +1 -1
  682. package/dist/field/lexical/ui/icons/Superscript/index.js +8 -6
  683. package/dist/field/lexical/ui/icons/Superscript/index.js.map +1 -1
  684. package/dist/field/lexical/ui/icons/Text/index.js +8 -6
  685. package/dist/field/lexical/ui/icons/Text/index.js.map +1 -1
  686. package/dist/field/lexical/ui/icons/Underline/index.js +14 -9
  687. package/dist/field/lexical/ui/icons/Underline/index.js.map +1 -1
  688. package/dist/field/lexical/ui/icons/UnorderedList/index.js +45 -36
  689. package/dist/field/lexical/ui/icons/UnorderedList/index.js.map +1 -1
  690. package/dist/field/lexical/ui/icons/Upload/index.js +24 -18
  691. package/dist/field/lexical/ui/icons/Upload/index.js.map +1 -1
  692. package/dist/field/lexical/utils/getSelectedNode.d.ts.map +1 -1
  693. package/dist/field/lexical/utils/getSelectedNode.js +1 -2
  694. package/dist/field/lexical/utils/getSelectedNode.js.map +1 -1
  695. package/dist/field/lexical/utils/nodeFormat.d.ts +2 -1
  696. package/dist/field/lexical/utils/nodeFormat.d.ts.map +1 -1
  697. package/dist/field/lexical/utils/nodeFormat.js.map +1 -1
  698. package/dist/field/lexical/utils/setFloatingElemPosition.d.ts +11 -1
  699. package/dist/field/lexical/utils/setFloatingElemPosition.d.ts.map +1 -1
  700. package/dist/field/lexical/utils/setFloatingElemPosition.js +16 -13
  701. package/dist/field/lexical/utils/setFloatingElemPosition.js.map +1 -1
  702. package/dist/field/lexical/utils/url.d.ts.map +1 -1
  703. package/dist/field/lexical/utils/url.js +13 -2
  704. package/dist/field/lexical/utils/url.js.map +1 -1
  705. package/dist/forEachNodeRecursively.d.ts +10 -0
  706. package/dist/forEachNodeRecursively.d.ts.map +1 -0
  707. package/dist/forEachNodeRecursively.js +24 -0
  708. package/dist/forEachNodeRecursively.js.map +1 -0
  709. package/dist/generateComponentMap.d.ts.map +1 -1
  710. package/dist/generateComponentMap.js +21 -29
  711. package/dist/generateComponentMap.js.map +1 -1
  712. package/dist/generateSchemaMap.d.ts.map +1 -1
  713. package/dist/generateSchemaMap.js +4 -12
  714. package/dist/generateSchemaMap.js.map +1 -1
  715. package/dist/i18n.d.ts +3 -0
  716. package/dist/i18n.d.ts.map +1 -0
  717. package/dist/i18n.js +164 -0
  718. package/dist/i18n.js.map +1 -0
  719. package/dist/index.d.ts +25 -21
  720. package/dist/index.d.ts.map +1 -1
  721. package/dist/index.js +296 -183
  722. package/dist/index.js.map +1 -1
  723. package/dist/populate/defaultValue.d.ts +0 -1
  724. package/dist/populate/defaultValue.d.ts.map +1 -1
  725. package/dist/populate/defaultValue.js +1 -19
  726. package/dist/populate/defaultValue.js.map +1 -1
  727. package/dist/populate/populate.d.ts +5 -4
  728. package/dist/populate/populate.d.ts.map +1 -1
  729. package/dist/populate/populate.js +13 -11
  730. package/dist/populate/populate.js.map +1 -1
  731. package/dist/populate/populateLexicalPopulationPromises.d.ts +12 -0
  732. package/dist/populate/populateLexicalPopulationPromises.d.ts.map +1 -0
  733. package/dist/populate/populateLexicalPopulationPromises.js +36 -0
  734. package/dist/populate/populateLexicalPopulationPromises.js.map +1 -0
  735. package/dist/populate/recurseNestedFields.d.ts +8 -4
  736. package/dist/populate/recurseNestedFields.d.ts.map +1 -1
  737. package/dist/populate/recurseNestedFields.js +4 -5
  738. package/dist/populate/recurseNestedFields.js.map +1 -1
  739. package/dist/scss/app.scss +2 -3
  740. package/dist/scss/vars.scss +0 -7
  741. package/dist/types.d.ts +45 -6
  742. package/dist/types.d.ts.map +1 -1
  743. package/dist/types.js.map +1 -1
  744. package/dist/useLexicalFeature.d.ts.map +1 -1
  745. package/dist/useLexicalFeature.js +6 -1
  746. package/dist/useLexicalFeature.js.map +1 -1
  747. package/dist/validate/index.d.ts +1 -1
  748. package/dist/validate/index.d.ts.map +1 -1
  749. package/dist/validate/index.js +3 -2
  750. package/dist/validate/index.js.map +1 -1
  751. package/dist/validate/validateNodes.js +1 -1
  752. package/dist/validate/validateNodes.js.map +1 -1
  753. package/package.json +71 -51
  754. package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.d.ts +0 -3
  755. package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.d.ts.map +0 -1
  756. package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.js +0 -12
  757. package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.js.map +0 -1
  758. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.d.ts +0 -3
  759. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.d.ts.map +0 -1
  760. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.js +0 -10
  761. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.js.map +0 -1
  762. package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.d.ts +0 -3
  763. package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.d.ts.map +0 -1
  764. package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.js +0 -12
  765. package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.js.map +0 -1
  766. package/dist/field/features/debug/testrecorder/feature.client.d.ts.map +0 -1
  767. package/dist/field/features/debug/testrecorder/plugin/index.d.ts +0 -5
  768. package/dist/field/features/debug/testrecorder/plugin/index.d.ts.map +0 -1
  769. package/dist/field/features/debug/testrecorder/plugin/index.js.map +0 -1
  770. package/dist/field/features/debug/treeview/feature.client.d.ts.map +0 -1
  771. package/dist/field/features/debug/treeview/plugin/index.d.ts +0 -4
  772. package/dist/field/features/debug/treeview/plugin/index.d.ts.map +0 -1
  773. package/dist/field/features/debug/treeview/plugin/index.js.map +0 -1
  774. package/dist/field/features/format/common/floatingSelectToolbarSection.d.ts +0 -3
  775. package/dist/field/features/format/common/floatingSelectToolbarSection.d.ts.map +0 -1
  776. package/dist/field/features/format/common/floatingSelectToolbarSection.js +0 -10
  777. package/dist/field/features/format/common/floatingSelectToolbarSection.js.map +0 -1
  778. package/dist/field/features/format/inlinecode/feature.client.d.ts.map +0 -1
  779. package/dist/field/features/format/inlinecode/feature.client.js +0 -43
  780. package/dist/field/features/format/inlinecode/feature.client.js.map +0 -1
  781. package/dist/field/features/indent/floatingSelectToolbarIndentSection.d.ts +0 -3
  782. package/dist/field/features/indent/floatingSelectToolbarIndentSection.d.ts.map +0 -1
  783. package/dist/field/features/indent/floatingSelectToolbarIndentSection.js +0 -10
  784. package/dist/field/features/indent/floatingSelectToolbarIndentSection.js.map +0 -1
  785. package/dist/field/features/indent/index.scss +0 -4
  786. package/dist/field/features/lists/common/markdown.js.map +0 -1
  787. package/dist/field/features/lists/orderedlist/feature.client.d.ts.map +0 -1
  788. package/dist/field/features/lists/orderedlist/feature.client.js +0 -72
  789. package/dist/field/features/lists/orderedlist/feature.client.js.map +0 -1
  790. package/dist/field/features/lists/orderedlist/feature.server.d.ts.map +0 -1
  791. package/dist/field/features/lists/orderedlist/feature.server.js.map +0 -1
  792. package/dist/field/features/lists/orderedlist/markdownTransformer.d.ts.map +0 -1
  793. package/dist/field/features/lists/orderedlist/markdownTransformer.js.map +0 -1
  794. package/dist/field/features/lists/unorderedlist/feature.client.d.ts.map +0 -1
  795. package/dist/field/features/lists/unorderedlist/feature.client.js +0 -72
  796. package/dist/field/features/lists/unorderedlist/feature.client.js.map +0 -1
  797. package/dist/field/features/lists/unorderedlist/feature.server.d.ts.map +0 -1
  798. package/dist/field/features/lists/unorderedlist/feature.server.js.map +0 -1
  799. package/dist/field/features/lists/unorderedlist/markdownTransformer.d.ts.map +0 -1
  800. package/dist/field/features/lists/unorderedlist/markdownTransformer.js.map +0 -1
  801. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.d.ts +0 -8
  802. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.d.ts.map +0 -1
  803. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.js.map +0 -1
  804. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.d.ts +0 -17
  805. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.d.ts.map +0 -1
  806. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.js.map +0 -1
  807. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.d.ts +0 -18
  808. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.d.ts.map +0 -1
  809. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.js +0 -42
  810. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.js.map +0 -1
  811. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.d.ts +0 -6
  812. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.d.ts.map +0 -1
  813. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.js +0 -270
  814. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.js.map +0 -1
  815. package/dist/field/lexical/plugins/FloatingSelectToolbar/types.d.ts +0 -40
  816. package/dist/field/lexical/plugins/FloatingSelectToolbar/types.d.ts.map +0 -1
  817. package/dist/field/lexical/plugins/FloatingSelectToolbar/types.js.map +0 -1
  818. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.d.ts.map +0 -1
  819. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js.map +0 -1
  820. package/dist/populate/richTextRelationshipPromise.d.ts +0 -23
  821. package/dist/populate/richTextRelationshipPromise.d.ts.map +0 -1
  822. package/dist/populate/richTextRelationshipPromise.js +0 -68
  823. package/dist/populate/richTextRelationshipPromise.js.map +0 -1
  824. package/dist/scss/fonts.scss +0 -75
  825. package/src/index.ts +0 -423
  826. /package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.js +0 -0
  827. /package/dist/field/features/debug/{testrecorder → testRecorder}/feature.server.d.ts +0 -0
  828. /package/dist/field/features/debug/{testrecorder → testRecorder}/plugin/index.scss +0 -0
  829. /package/dist/field/features/debug/{treeview → treeView}/feature.client.js +0 -0
  830. /package/dist/field/features/debug/{treeview → treeView}/feature.server.d.ts +0 -0
  831. /package/dist/field/features/debug/{treeview → treeView}/plugin/index.scss +0 -0
  832. /package/dist/field/features/format/{inlinecode → inlineCode}/feature.server.d.ts +0 -0
  833. /package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.d.ts +0 -0
  834. /package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.js +0 -0
  835. /package/dist/field/features/lists/{orderedlist → orderedList}/feature.server.d.ts +0 -0
  836. /package/dist/field/features/lists/{orderedlist → orderedList}/markdownTransformer.d.ts +0 -0
  837. /package/dist/field/features/lists/{common → shared}/markdown.d.ts +0 -0
  838. /package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.server.d.ts +0 -0
  839. /package/dist/field/features/lists/{unorderedlist → unorderedList}/markdownTransformer.d.ts +0 -0
  840. /package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars}/types.js +0 -0
@@ -1,21 +1,18 @@
1
1
  'use client';
2
- import lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js';
3
- const { useLexicalComposerContext } = lexicalComposerContextImport;
4
- import lexicalImport from 'lexical';
5
- const { $getNodeByKey, COMMAND_PRIORITY_EDITOR } = lexicalImport;
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js';
6
4
  import { useListDrawer } from '@payloadcms/ui/elements/ListDrawer';
5
+ import { $getNodeByKey, COMMAND_PRIORITY_EDITOR } from 'lexical';
7
6
  import React, { useCallback, useEffect, useState } from 'react';
8
7
  import { $createRelationshipNode } from '../nodes/RelationshipNode.js';
9
8
  import { INSERT_RELATIONSHIP_COMMAND } from '../plugins/index.js';
10
9
  import { EnabledRelationshipsCondition } from '../utils/EnabledRelationshipsCondition.js';
11
10
  import { INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND } from './commands.js';
12
- const insertRelationship = ({ id, editor, relationTo, replaceNodeKey })=>{
11
+ const insertRelationship = ({ editor, relationTo, replaceNodeKey, value })=>{
13
12
  if (!replaceNodeKey) {
14
13
  editor.dispatchCommand(INSERT_RELATIONSHIP_COMMAND, {
15
14
  relationTo,
16
- value: {
17
- id
18
- }
15
+ value
19
16
  });
20
17
  } else {
21
18
  editor.update(()=>{
@@ -23,9 +20,7 @@ const insertRelationship = ({ id, editor, relationTo, replaceNodeKey })=>{
23
20
  if (node) {
24
21
  node.replace($createRelationshipNode({
25
22
  relationTo,
26
- value: {
27
- id
28
- }
23
+ value
29
24
  }));
30
25
  }
31
26
  });
@@ -51,10 +46,10 @@ const RelationshipDrawerComponent = ({ enabledCollectionSlugs })=>{
51
46
  ]);
52
47
  const onSelect = useCallback(({ collectionSlug, docID })=>{
53
48
  insertRelationship({
54
- id: docID,
55
49
  editor,
56
50
  relationTo: collectionSlug,
57
- replaceNodeKey
51
+ replaceNodeKey,
52
+ value: docID
58
53
  });
59
54
  closeDrawer();
60
55
  }, [
@@ -70,12 +65,19 @@ const RelationshipDrawerComponent = ({ enabledCollectionSlugs })=>{
70
65
  isDrawerOpen,
71
66
  enabledCollectionSlugs
72
67
  ]);
73
- return /*#__PURE__*/ React.createElement(ListDrawer, {
68
+ return /*#__PURE__*/ _jsx(ListDrawer, {
74
69
  onSelect: onSelect
75
70
  });
76
71
  };
77
72
  export const RelationshipDrawer = (props)=>{
78
- return props?.enabledCollectionSlugs?.length > 0 ? /*#__PURE__*/ React.createElement(RelationshipDrawerComponent, props) : /*#__PURE__*/ React.createElement(EnabledRelationshipsCondition, props, /*#__PURE__*/ React.createElement(RelationshipDrawerComponent, props));
73
+ return props?.enabledCollectionSlugs?.length > 0 ? /*#__PURE__*/ _jsx(RelationshipDrawerComponent, {
74
+ ...props
75
+ }) : /*#__PURE__*/ _jsx(EnabledRelationshipsCondition, {
76
+ ...props,
77
+ children: /*#__PURE__*/ _jsx(RelationshipDrawerComponent, {
78
+ ...props
79
+ })
80
+ });
79
81
  };
80
82
 
81
83
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/relationship/drawer/index.tsx"],"sourcesContent":["'use client'\nimport lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'\nconst { useLexicalComposerContext } = lexicalComposerContextImport\nimport lexicalImport from 'lexical'\nconst { $getNodeByKey, COMMAND_PRIORITY_EDITOR } = lexicalImport\n\nimport type { LexicalEditor } from 'lexical'\n\nimport { useListDrawer } from '@payloadcms/ui/elements/ListDrawer'\nimport React, { useCallback, useEffect, useState } from 'react'\n\nimport { $createRelationshipNode } from '../nodes/RelationshipNode.js'\nimport { INSERT_RELATIONSHIP_COMMAND } from '../plugins/index.js'\nimport { EnabledRelationshipsCondition } from '../utils/EnabledRelationshipsCondition.js'\nimport { INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND } from './commands.js'\n\nconst insertRelationship = ({\n id,\n editor,\n relationTo,\n replaceNodeKey,\n}: {\n editor: LexicalEditor\n id: string\n relationTo: string\n replaceNodeKey: null | string\n}) => {\n if (!replaceNodeKey) {\n editor.dispatchCommand(INSERT_RELATIONSHIP_COMMAND, {\n relationTo,\n value: {\n id,\n },\n })\n } else {\n editor.update(() => {\n const node = $getNodeByKey(replaceNodeKey)\n if (node) {\n node.replace($createRelationshipNode({ relationTo, value: { id } }))\n }\n })\n }\n}\n\ntype Props = {\n enabledCollectionSlugs: null | string[]\n}\n\nconst RelationshipDrawerComponent: React.FC<Props> = ({ enabledCollectionSlugs }) => {\n const [editor] = useLexicalComposerContext()\n const [selectedCollectionSlug, setSelectedCollectionSlug] = useState(\n () => enabledCollectionSlugs[0],\n )\n const [replaceNodeKey, setReplaceNodeKey] = useState<null | string>(null)\n\n const [ListDrawer, ListDrawerToggler, { closeDrawer, isDrawerOpen, openDrawer }] = useListDrawer({\n collectionSlugs: enabledCollectionSlugs,\n selectedCollection: selectedCollectionSlug,\n })\n\n useEffect(() => {\n return editor.registerCommand<{\n replace: { nodeKey: string } | false\n }>(\n INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND,\n (payload) => {\n setReplaceNodeKey(payload?.replace ? payload?.replace.nodeKey : null)\n openDrawer()\n return true\n },\n COMMAND_PRIORITY_EDITOR,\n )\n }, [editor, openDrawer])\n\n const onSelect = useCallback(\n ({ collectionSlug, docID }) => {\n insertRelationship({\n id: docID,\n editor,\n relationTo: collectionSlug,\n replaceNodeKey,\n })\n closeDrawer()\n },\n [editor, closeDrawer, replaceNodeKey],\n )\n\n useEffect(() => {\n // always reset back to first option\n // TODO: this is not working, see the ListDrawer component\n setSelectedCollectionSlug(enabledCollectionSlugs[0])\n }, [isDrawerOpen, enabledCollectionSlugs])\n\n return <ListDrawer onSelect={onSelect} />\n}\n\nexport const RelationshipDrawer = (props: Props): React.ReactNode => {\n return props?.enabledCollectionSlugs?.length > 0 ? ( // If enabledCollectionSlugs it overrides what EnabledRelationshipsCondition is doing\n <RelationshipDrawerComponent {...props} />\n ) : (\n <EnabledRelationshipsCondition {...props}>\n <RelationshipDrawerComponent {...props} />\n </EnabledRelationshipsCondition>\n )\n}\n"],"names":["lexicalComposerContextImport","useLexicalComposerContext","lexicalImport","$getNodeByKey","COMMAND_PRIORITY_EDITOR","useListDrawer","React","useCallback","useEffect","useState","$createRelationshipNode","INSERT_RELATIONSHIP_COMMAND","EnabledRelationshipsCondition","INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND","insertRelationship","id","editor","relationTo","replaceNodeKey","dispatchCommand","value","update","node","replace","RelationshipDrawerComponent","enabledCollectionSlugs","selectedCollectionSlug","setSelectedCollectionSlug","setReplaceNodeKey","ListDrawer","ListDrawerToggler","closeDrawer","isDrawerOpen","openDrawer","collectionSlugs","selectedCollection","registerCommand","payload","nodeKey","onSelect","collectionSlug","docID","RelationshipDrawer","props","length"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AACA,OAAOA,kCAAkC,2CAA0C;AACnF,MAAM,EAAEC,yBAAyB,EAAE,GAAGD;AACtC,OAAOE,mBAAmB,UAAS;AACnC,MAAM,EAAEC,aAAa,EAAEC,uBAAuB,EAAE,GAAGF;AAInD,SAASG,aAAa,QAAQ,qCAAoC;AAClE,OAAOC,SAASC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AAE/D,SAASC,uBAAuB,QAAQ,+BAA8B;AACtE,SAASC,2BAA2B,QAAQ,sBAAqB;AACjE,SAASC,6BAA6B,QAAQ,4CAA2C;AACzF,SAASC,uCAAuC,QAAQ,gBAAe;AAEvE,MAAMC,qBAAqB,CAAC,EAC1BC,EAAE,EACFC,MAAM,EACNC,UAAU,EACVC,cAAc,EAMf;IACC,IAAI,CAACA,gBAAgB;QACnBF,OAAOG,eAAe,CAACR,6BAA6B;YAClDM;YACAG,OAAO;gBACLL;YACF;QACF;IACF,OAAO;QACLC,OAAOK,MAAM,CAAC;YACZ,MAAMC,OAAOnB,cAAce;YAC3B,IAAII,MAAM;gBACRA,KAAKC,OAAO,CAACb,wBAAwB;oBAAEO;oBAAYG,OAAO;wBAAEL;oBAAG;gBAAE;YACnE;QACF;IACF;AACF;AAMA,MAAMS,8BAA+C,CAAC,EAAEC,sBAAsB,EAAE;IAC9E,MAAM,CAACT,OAAO,GAAGf;IACjB,MAAM,CAACyB,wBAAwBC,0BAA0B,GAAGlB,SAC1D,IAAMgB,sBAAsB,CAAC,EAAE;IAEjC,MAAM,CAACP,gBAAgBU,kBAAkB,GAAGnB,SAAwB;IAEpE,MAAM,CAACoB,YAAYC,mBAAmB,EAAEC,WAAW,EAAEC,YAAY,EAAEC,UAAU,EAAE,CAAC,GAAG5B,cAAc;QAC/F6B,iBAAiBT;QACjBU,oBAAoBT;IACtB;IAEAlB,UAAU;QACR,OAAOQ,OAAOoB,eAAe,CAG3BvB,yCACA,CAACwB;YACCT,kBAAkBS,SAASd,UAAUc,SAASd,QAAQe,UAAU;YAChEL;YACA,OAAO;QACT,GACA7B;IAEJ,GAAG;QAACY;QAAQiB;KAAW;IAEvB,MAAMM,WAAWhC,YACf,CAAC,EAAEiC,cAAc,EAAEC,KAAK,EAAE;QACxB3B,mBAAmB;YACjBC,IAAI0B;YACJzB;YACAC,YAAYuB;YACZtB;QACF;QACAa;IACF,GACA;QAACf;QAAQe;QAAab;KAAe;IAGvCV,UAAU;QACR,oCAAoC;QACpC,0DAA0D;QAC1DmB,0BAA0BF,sBAAsB,CAAC,EAAE;IACrD,GAAG;QAACO;QAAcP;KAAuB;IAEzC,qBAAO,oBAACI;QAAWU,UAAUA;;AAC/B;AAEA,OAAO,MAAMG,qBAAqB,CAACC;IACjC,OAAOA,OAAOlB,wBAAwBmB,SAAS,kBAC7C,oBAACpB,6BAAgCmB,uBAEjC,oBAAC/B,+BAAkC+B,qBACjC,oBAACnB,6BAAgCmB;AAGvC,EAAC"}
1
+ {"version":3,"sources":["../../../../../src/field/features/relationship/drawer/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalEditor } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useListDrawer } from '@payloadcms/ui/elements/ListDrawer'\nimport { $getNodeByKey, COMMAND_PRIORITY_EDITOR } from 'lexical'\nimport React, { useCallback, useEffect, useState } from 'react'\n\nimport { $createRelationshipNode } from '../nodes/RelationshipNode.js'\nimport { INSERT_RELATIONSHIP_COMMAND } from '../plugins/index.js'\nimport { EnabledRelationshipsCondition } from '../utils/EnabledRelationshipsCondition.js'\nimport { INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND } from './commands.js'\n\nconst insertRelationship = ({\n editor,\n relationTo,\n replaceNodeKey,\n value,\n}: {\n editor: LexicalEditor\n relationTo: string\n replaceNodeKey: null | string\n value: number | string\n}) => {\n if (!replaceNodeKey) {\n editor.dispatchCommand(INSERT_RELATIONSHIP_COMMAND, {\n relationTo,\n value,\n })\n } else {\n editor.update(() => {\n const node = $getNodeByKey(replaceNodeKey)\n if (node) {\n node.replace($createRelationshipNode({ relationTo, value }))\n }\n })\n }\n}\n\ntype Props = {\n enabledCollectionSlugs: null | string[]\n}\n\nconst RelationshipDrawerComponent: React.FC<Props> = ({ enabledCollectionSlugs }) => {\n const [editor] = useLexicalComposerContext()\n const [selectedCollectionSlug, setSelectedCollectionSlug] = useState(\n () => enabledCollectionSlugs[0],\n )\n const [replaceNodeKey, setReplaceNodeKey] = useState<null | string>(null)\n\n const [ListDrawer, ListDrawerToggler, { closeDrawer, isDrawerOpen, openDrawer }] = useListDrawer({\n collectionSlugs: enabledCollectionSlugs,\n selectedCollection: selectedCollectionSlug,\n })\n\n useEffect(() => {\n return editor.registerCommand<{\n replace: { nodeKey: string } | false\n }>(\n INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND,\n (payload) => {\n setReplaceNodeKey(payload?.replace ? payload?.replace.nodeKey : null)\n openDrawer()\n return true\n },\n COMMAND_PRIORITY_EDITOR,\n )\n }, [editor, openDrawer])\n\n const onSelect = useCallback(\n ({ collectionSlug, docID }) => {\n insertRelationship({\n editor,\n relationTo: collectionSlug,\n replaceNodeKey,\n value: docID,\n })\n closeDrawer()\n },\n [editor, closeDrawer, replaceNodeKey],\n )\n\n useEffect(() => {\n // always reset back to first option\n // TODO: this is not working, see the ListDrawer component\n setSelectedCollectionSlug(enabledCollectionSlugs[0])\n }, [isDrawerOpen, enabledCollectionSlugs])\n\n return <ListDrawer onSelect={onSelect} />\n}\n\nexport const RelationshipDrawer = (props: Props): React.ReactNode => {\n return props?.enabledCollectionSlugs?.length > 0 ? ( // If enabledCollectionSlugs it overrides what EnabledRelationshipsCondition is doing\n <RelationshipDrawerComponent {...props} />\n ) : (\n <EnabledRelationshipsCondition {...props}>\n <RelationshipDrawerComponent {...props} />\n </EnabledRelationshipsCondition>\n )\n}\n"],"names":["useLexicalComposerContext","useListDrawer","$getNodeByKey","COMMAND_PRIORITY_EDITOR","React","useCallback","useEffect","useState","$createRelationshipNode","INSERT_RELATIONSHIP_COMMAND","EnabledRelationshipsCondition","INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND","insertRelationship","editor","relationTo","replaceNodeKey","value","dispatchCommand","update","node","replace","RelationshipDrawerComponent","enabledCollectionSlugs","selectedCollectionSlug","setSelectedCollectionSlug","setReplaceNodeKey","ListDrawer","ListDrawerToggler","closeDrawer","isDrawerOpen","openDrawer","collectionSlugs","selectedCollection","registerCommand","payload","nodeKey","onSelect","collectionSlug","docID","RelationshipDrawer","props","length"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AAGA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,SAASC,aAAa,QAAQ,qCAAoC;AAClE,SAASC,aAAa,EAAEC,uBAAuB,QAAQ,UAAS;AAChE,OAAOC,SAASC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AAE/D,SAASC,uBAAuB,QAAQ,+BAA8B;AACtE,SAASC,2BAA2B,QAAQ,sBAAqB;AACjE,SAASC,6BAA6B,QAAQ,4CAA2C;AACzF,SAASC,uCAAuC,QAAQ,gBAAe;AAEvE,MAAMC,qBAAqB,CAAC,EAC1BC,MAAM,EACNC,UAAU,EACVC,cAAc,EACdC,KAAK,EAMN;IACC,IAAI,CAACD,gBAAgB;QACnBF,OAAOI,eAAe,CAACR,6BAA6B;YAClDK;YACAE;QACF;IACF,OAAO;QACLH,OAAOK,MAAM,CAAC;YACZ,MAAMC,OAAOjB,cAAca;YAC3B,IAAII,MAAM;gBACRA,KAAKC,OAAO,CAACZ,wBAAwB;oBAAEM;oBAAYE;gBAAM;YAC3D;QACF;IACF;AACF;AAMA,MAAMK,8BAA+C,CAAC,EAAEC,sBAAsB,EAAE;IAC9E,MAAM,CAACT,OAAO,GAAGb;IACjB,MAAM,CAACuB,wBAAwBC,0BAA0B,GAAGjB,SAC1D,IAAMe,sBAAsB,CAAC,EAAE;IAEjC,MAAM,CAACP,gBAAgBU,kBAAkB,GAAGlB,SAAwB;IAEpE,MAAM,CAACmB,YAAYC,mBAAmB,EAAEC,WAAW,EAAEC,YAAY,EAAEC,UAAU,EAAE,CAAC,GAAG7B,cAAc;QAC/F8B,iBAAiBT;QACjBU,oBAAoBT;IACtB;IAEAjB,UAAU;QACR,OAAOO,OAAOoB,eAAe,CAG3BtB,yCACA,CAACuB;YACCT,kBAAkBS,SAASd,UAAUc,SAASd,QAAQe,UAAU;YAChEL;YACA,OAAO;QACT,GACA3B;IAEJ,GAAG;QAACU;QAAQiB;KAAW;IAEvB,MAAMM,WAAW/B,YACf,CAAC,EAAEgC,cAAc,EAAEC,KAAK,EAAE;QACxB1B,mBAAmB;YACjBC;YACAC,YAAYuB;YACZtB;YACAC,OAAOsB;QACT;QACAV;IACF,GACA;QAACf;QAAQe;QAAab;KAAe;IAGvCT,UAAU;QACR,oCAAoC;QACpC,0DAA0D;QAC1DkB,0BAA0BF,sBAAsB,CAAC,EAAE;IACrD,GAAG;QAACO;QAAcP;KAAuB;IAEzC,qBAAO,KAACI;QAAWU,UAAUA;;AAC/B;AAEA,OAAO,MAAMG,qBAAqB,CAACC;IACjC,OAAOA,OAAOlB,wBAAwBmB,SAAS,kBAC7C,KAACpB;QAA6B,GAAGmB,KAAK;uBAEtC,KAAC9B;QAA+B,GAAG8B,KAAK;kBACtC,cAAA,KAACnB;YAA6B,GAAGmB,KAAK;;;AAG5C,EAAC"}
@@ -1,4 +1,19 @@
1
1
  /// <reference types="react" resolution-mode="require"/>
2
- import type { RelationshipFeatureProps } from './feature.server.js';
3
- export declare const RelationshipFeatureClientComponent: import("react").FC<import("../types.js").ClientComponentProps<RelationshipFeatureProps>>;
2
+ export declare const RelationshipFeatureClientComponent: import("react").FC<({
3
+ featureKey: string;
4
+ order: number;
5
+ } & {
6
+ disabledCollections?: string[];
7
+ enabledCollections?: never;
8
+ } & {
9
+ maxDepth?: number;
10
+ }) | ({
11
+ featureKey: string;
12
+ order: number;
13
+ } & {
14
+ disabledCollections?: never;
15
+ enabledCollections?: string[];
16
+ } & {
17
+ maxDepth?: number;
18
+ })>;
4
19
  //# sourceMappingURL=feature.client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/field/features/relationship/feature.client.tsx"],"names":[],"mappings":";AAKA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAA;AAmDnE,eAAO,MAAM,kCAAkC,0FAAmD,CAAA"}
1
+ {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/field/features/relationship/feature.client.tsx"],"names":[],"mappings":";AAgFA,eAAO,MAAM,kCAAkC;;;;;;;;;;;;;;;;GAAmD,CAAA"}
@@ -1,10 +1,11 @@
1
1
  'use client';
2
- import { withMergedProps } from '@payloadcms/ui/elements/withMergedProps';
3
- import { SlashMenuOption } from '../../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js';
2
+ import { $isNodeSelection } from 'lexical';
4
3
  import { RelationshipIcon } from '../../lexical/ui/icons/Relationship/index.js';
5
4
  import { createClientComponent } from '../createClientComponent.js';
5
+ import { slashMenuBasicGroupWithItems } from '../shared/slashMenu/basicGroup.js';
6
+ import { toolbarAddDropdownGroupWithItems } from '../shared/toolbar/addDropdownGroup.js';
6
7
  import { INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND } from './drawer/commands.js';
7
- import { RelationshipNode } from './nodes/RelationshipNode.js';
8
+ import { $isRelationshipNode, RelationshipNode } from './nodes/RelationshipNode.js';
8
9
  import { RelationshipPlugin } from './plugins/index.js';
9
10
  const RelationshipFeatureClient = (props)=>{
10
11
  return {
@@ -16,36 +17,58 @@ const RelationshipFeatureClient = (props)=>{
16
17
  ],
17
18
  plugins: [
18
19
  {
19
- Component: withMergedProps({
20
- Component: RelationshipPlugin,
21
- toMergeIntoProps: props
22
- }),
20
+ Component: RelationshipPlugin,
23
21
  position: 'normal'
24
22
  }
25
23
  ],
26
24
  slashMenu: {
27
- options: [
28
- {
29
- displayName: 'Basic',
30
- key: 'basic',
31
- options: [
32
- new SlashMenuOption('relationship', {
33
- Icon: RelationshipIcon,
34
- displayName: 'Relationship',
35
- keywords: [
36
- 'relationship',
37
- 'relation',
38
- 'rel'
39
- ],
40
- onSelect: ({ editor })=>{
41
- // dispatch INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND
42
- editor.dispatchCommand(INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND, {
43
- replace: false
44
- });
25
+ groups: [
26
+ slashMenuBasicGroupWithItems([
27
+ {
28
+ Icon: RelationshipIcon,
29
+ key: 'relationship',
30
+ keywords: [
31
+ 'relationship',
32
+ 'relation',
33
+ 'rel'
34
+ ],
35
+ label: ({ i18n })=>{
36
+ return i18n.t('lexical:relationship:label');
37
+ },
38
+ onSelect: ({ editor })=>{
39
+ // dispatch INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND
40
+ editor.dispatchCommand(INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND, {
41
+ replace: false
42
+ });
43
+ }
44
+ }
45
+ ])
46
+ ]
47
+ },
48
+ toolbarFixed: {
49
+ groups: [
50
+ toolbarAddDropdownGroupWithItems([
51
+ {
52
+ ChildComponent: RelationshipIcon,
53
+ isActive: ({ selection })=>{
54
+ if (!$isNodeSelection(selection) || !selection.getNodes().length) {
55
+ return false;
45
56
  }
46
- })
47
- ]
48
- }
57
+ const firstNode = selection.getNodes()[0];
58
+ return $isRelationshipNode(firstNode);
59
+ },
60
+ key: 'relationship',
61
+ label: ({ i18n })=>{
62
+ return i18n.t('lexical:relationship:label');
63
+ },
64
+ onSelect: ({ editor })=>{
65
+ // dispatch INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND
66
+ editor.dispatchCommand(INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND, {
67
+ replace: false
68
+ });
69
+ }
70
+ }
71
+ ])
49
72
  ]
50
73
  }
51
74
  })
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/field/features/relationship/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport { withMergedProps } from '@payloadcms/ui/elements/withMergedProps'\n\nimport type { FeatureProviderProviderClient } from '../types.js'\nimport type { RelationshipFeatureProps } from './feature.server.js'\n\nimport { SlashMenuOption } from '../../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js'\nimport { RelationshipIcon } from '../../lexical/ui/icons/Relationship/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND } from './drawer/commands.js'\nimport { RelationshipNode } from './nodes/RelationshipNode.js'\nimport { RelationshipPlugin } from './plugins/index.js'\n\nconst RelationshipFeatureClient: FeatureProviderProviderClient<RelationshipFeatureProps> = (\n props,\n) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n nodes: [RelationshipNode],\n plugins: [\n {\n Component: withMergedProps({\n Component: RelationshipPlugin,\n toMergeIntoProps: props,\n }),\n position: 'normal',\n },\n ],\n slashMenu: {\n options: [\n {\n displayName: 'Basic',\n key: 'basic',\n options: [\n new SlashMenuOption('relationship', {\n Icon: RelationshipIcon,\n displayName: 'Relationship',\n keywords: ['relationship', 'relation', 'rel'],\n onSelect: ({ editor }) => {\n // dispatch INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND\n editor.dispatchCommand(INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND, {\n replace: false,\n })\n },\n }),\n ],\n },\n ],\n },\n }),\n }\n}\n\nexport const RelationshipFeatureClientComponent = createClientComponent(RelationshipFeatureClient)\n"],"names":["withMergedProps","SlashMenuOption","RelationshipIcon","createClientComponent","INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND","RelationshipNode","RelationshipPlugin","RelationshipFeatureClient","props","clientFeatureProps","feature","nodes","plugins","Component","toMergeIntoProps","position","slashMenu","options","displayName","key","Icon","keywords","onSelect","editor","dispatchCommand","replace","RelationshipFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,eAAe,QAAQ,0CAAyC;AAKzE,SAASC,eAAe,QAAQ,sEAAqE;AACrG,SAASC,gBAAgB,QAAQ,+CAA8C;AAC/E,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,uCAAuC,QAAQ,uBAAsB;AAC9E,SAASC,gBAAgB,QAAQ,8BAA6B;AAC9D,SAASC,kBAAkB,QAAQ,qBAAoB;AAEvD,MAAMC,4BAAqF,CACzFC;IAEA,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,OAAO;oBAACN;iBAAiB;gBACzBO,SAAS;oBACP;wBACEC,WAAWb,gBAAgB;4BACzBa,WAAWP;4BACXQ,kBAAkBN;wBACpB;wBACAO,UAAU;oBACZ;iBACD;gBACDC,WAAW;oBACTC,SAAS;wBACP;4BACEC,aAAa;4BACbC,KAAK;4BACLF,SAAS;gCACP,IAAIhB,gBAAgB,gBAAgB;oCAClCmB,MAAMlB;oCACNgB,aAAa;oCACbG,UAAU;wCAAC;wCAAgB;wCAAY;qCAAM;oCAC7CC,UAAU,CAAC,EAAEC,MAAM,EAAE;wCACnB,mDAAmD;wCACnDA,OAAOC,eAAe,CAACpB,yCAAyC;4CAC9DqB,SAAS;wCACX;oCACF;gCACF;6BACD;wBACH;qBACD;gBACH;YACF,CAAA;IACF;AACF;AAEA,OAAO,MAAMC,qCAAqCvB,sBAAsBI,2BAA0B"}
1
+ {"version":3,"sources":["../../../../src/field/features/relationship/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport { $isNodeSelection } from 'lexical'\n\nimport type { FeatureProviderProviderClient } from '../types.js'\nimport type { RelationshipFeatureProps } from './feature.server.js'\n\nimport { RelationshipIcon } from '../../lexical/ui/icons/Relationship/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { slashMenuBasicGroupWithItems } from '../shared/slashMenu/basicGroup.js'\nimport { toolbarAddDropdownGroupWithItems } from '../shared/toolbar/addDropdownGroup.js'\nimport { INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND } from './drawer/commands.js'\nimport { $isRelationshipNode, RelationshipNode } from './nodes/RelationshipNode.js'\nimport { RelationshipPlugin } from './plugins/index.js'\n\nconst RelationshipFeatureClient: FeatureProviderProviderClient<RelationshipFeatureProps> = (\n props,\n) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n nodes: [RelationshipNode],\n plugins: [\n {\n Component: RelationshipPlugin,\n position: 'normal',\n },\n ],\n slashMenu: {\n groups: [\n slashMenuBasicGroupWithItems([\n {\n Icon: RelationshipIcon,\n key: 'relationship',\n keywords: ['relationship', 'relation', 'rel'],\n label: ({ i18n }) => {\n return i18n.t('lexical:relationship:label')\n },\n onSelect: ({ editor }) => {\n // dispatch INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND\n editor.dispatchCommand(INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND, {\n replace: false,\n })\n },\n },\n ]),\n ],\n },\n toolbarFixed: {\n groups: [\n toolbarAddDropdownGroupWithItems([\n {\n ChildComponent: RelationshipIcon,\n isActive: ({ selection }) => {\n if (!$isNodeSelection(selection) || !selection.getNodes().length) {\n return false\n }\n\n const firstNode = selection.getNodes()[0]\n return $isRelationshipNode(firstNode)\n },\n key: 'relationship',\n label: ({ i18n }) => {\n return i18n.t('lexical:relationship:label')\n },\n onSelect: ({ editor }) => {\n // dispatch INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND\n editor.dispatchCommand(INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND, {\n replace: false,\n })\n },\n },\n ]),\n ],\n },\n }),\n }\n}\n\nexport const RelationshipFeatureClientComponent = createClientComponent(RelationshipFeatureClient)\n"],"names":["$isNodeSelection","RelationshipIcon","createClientComponent","slashMenuBasicGroupWithItems","toolbarAddDropdownGroupWithItems","INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND","$isRelationshipNode","RelationshipNode","RelationshipPlugin","RelationshipFeatureClient","props","clientFeatureProps","feature","nodes","plugins","Component","position","slashMenu","groups","Icon","key","keywords","label","i18n","t","onSelect","editor","dispatchCommand","replace","toolbarFixed","ChildComponent","isActive","selection","getNodes","length","firstNode","RelationshipFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,gBAAgB,QAAQ,UAAS;AAK1C,SAASC,gBAAgB,QAAQ,+CAA8C;AAC/E,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,4BAA4B,QAAQ,oCAAmC;AAChF,SAASC,gCAAgC,QAAQ,wCAAuC;AACxF,SAASC,uCAAuC,QAAQ,uBAAsB;AAC9E,SAASC,mBAAmB,EAAEC,gBAAgB,QAAQ,8BAA6B;AACnF,SAASC,kBAAkB,QAAQ,qBAAoB;AAEvD,MAAMC,4BAAqF,CACzFC;IAEA,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,OAAO;oBAACN;iBAAiB;gBACzBO,SAAS;oBACP;wBACEC,WAAWP;wBACXQ,UAAU;oBACZ;iBACD;gBACDC,WAAW;oBACTC,QAAQ;wBACNf,6BAA6B;4BAC3B;gCACEgB,MAAMlB;gCACNmB,KAAK;gCACLC,UAAU;oCAAC;oCAAgB;oCAAY;iCAAM;gCAC7CC,OAAO,CAAC,EAAEC,IAAI,EAAE;oCACd,OAAOA,KAAKC,CAAC,CAAC;gCAChB;gCACAC,UAAU,CAAC,EAAEC,MAAM,EAAE;oCACnB,mDAAmD;oCACnDA,OAAOC,eAAe,CAACtB,yCAAyC;wCAC9DuB,SAAS;oCACX;gCACF;4BACF;yBACD;qBACF;gBACH;gBACAC,cAAc;oBACZX,QAAQ;wBACNd,iCAAiC;4BAC/B;gCACE0B,gBAAgB7B;gCAChB8B,UAAU,CAAC,EAAEC,SAAS,EAAE;oCACtB,IAAI,CAAChC,iBAAiBgC,cAAc,CAACA,UAAUC,QAAQ,GAAGC,MAAM,EAAE;wCAChE,OAAO;oCACT;oCAEA,MAAMC,YAAYH,UAAUC,QAAQ,EAAE,CAAC,EAAE;oCACzC,OAAO3B,oBAAoB6B;gCAC7B;gCACAf,KAAK;gCACLE,OAAO,CAAC,EAAEC,IAAI,EAAE;oCACd,OAAOA,KAAKC,CAAC,CAAC;gCAChB;gCACAC,UAAU,CAAC,EAAEC,MAAM,EAAE;oCACnB,mDAAmD;oCACnDA,OAAOC,eAAe,CAACtB,yCAAyC;wCAC9DuB,SAAS;oCACX;gCACF;4BACF;yBACD;qBACF;gBACH;YACF,CAAA;IACF;AACF;AAEA,OAAO,MAAMQ,qCAAqClC,sBAAsBO,2BAA0B"}
@@ -1,5 +1,5 @@
1
1
  import type { FeatureProviderProviderServer } from '../types.js';
2
- export type RelationshipFeatureProps = {
2
+ export type ExclusiveRelationshipFeatureProps = {
3
3
  /**
4
4
  * The collections that should be disabled. Overrides the `enableRichTextRelationship` property in the collection config.
5
5
  * When this property is set, `enabledCollections` will not be available.
@@ -14,5 +14,14 @@ export type RelationshipFeatureProps = {
14
14
  **/
15
15
  enabledCollections?: string[];
16
16
  };
17
+ export type RelationshipFeatureProps = ExclusiveRelationshipFeatureProps & {
18
+ /**
19
+ * Sets a maximum population depth for this relationship, regardless of the remaining depth when the respective field is reached.
20
+ * This behaves exactly like the maxDepth properties of relationship and upload fields.
21
+ *
22
+ * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth}
23
+ */
24
+ maxDepth?: number;
25
+ };
17
26
  export declare const RelationshipFeature: FeatureProviderProviderServer<RelationshipFeatureProps, RelationshipFeatureProps>;
18
27
  //# sourceMappingURL=feature.server.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../../src/field/features/relationship/feature.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAA;AAMhE,MAAM,MAAM,wBAAwB,GAChC;IACE;;;QAGI;IACJ,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAA;IAG9B,kBAAkB,CAAC,EAAE,KAAK,CAAA;CAC3B,GACD;IAEE,mBAAmB,CAAC,EAAE,KAAK,CAAA;IAE3B;;;QAGI;IACJ,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;CAC9B,CAAA;AAEL,eAAO,MAAM,mBAAmB,EAAE,6BAA6B,CAC7D,wBAAwB,EACxB,wBAAwB,CAoBzB,CAAA"}
1
+ {"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../../src/field/features/relationship/feature.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAA;AAQhE,MAAM,MAAM,iCAAiC,GACzC;IACE;;;QAGI;IACJ,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAA;IAG9B,kBAAkB,CAAC,EAAE,KAAK,CAAA;CAC3B,GACD;IAEE,mBAAmB,CAAC,EAAE,KAAK,CAAA;IAE3B;;;QAGI;IACJ,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;CAC9B,CAAA;AAEL,MAAM,MAAM,wBAAwB,GAAG,iCAAiC,GAAG;IACzE;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,6BAA6B,CAC7D,wBAAwB,EACxB,wBAAwB,CAoBzB,CAAA"}
@@ -1,19 +1,22 @@
1
+ import { createNode } from '../typeUtilities.js';
1
2
  import { RelationshipFeatureClientComponent } from './feature.client.js';
3
+ import { i18n } from './i18n.js';
2
4
  import { RelationshipNode } from './nodes/RelationshipNode.js';
3
- import { relationshipPopulationPromise } from './populationPromise.js';
5
+ import { relationshipPopulationPromiseHOC } from './populationPromise.js';
4
6
  export const RelationshipFeature = (props)=>{
5
7
  return {
6
8
  feature: ()=>{
7
9
  return {
8
10
  ClientComponent: RelationshipFeatureClientComponent,
9
11
  clientFeatureProps: props,
12
+ i18n,
10
13
  nodes: [
11
- {
14
+ createNode({
12
15
  node: RelationshipNode,
13
16
  populationPromises: [
14
- relationshipPopulationPromise
17
+ relationshipPopulationPromiseHOC(props)
15
18
  ]
16
- }
19
+ })
17
20
  ],
18
21
  serverFeatureProps: props
19
22
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/field/features/relationship/feature.server.ts"],"sourcesContent":["import type { FeatureProviderProviderServer } from '../types.js'\n\nimport { RelationshipFeatureClientComponent } from './feature.client.js'\nimport { RelationshipNode } from './nodes/RelationshipNode.js'\nimport { relationshipPopulationPromise } from './populationPromise.js'\n\nexport type RelationshipFeatureProps =\n | {\n /**\n * The collections that should be disabled. Overrides the `enableRichTextRelationship` property in the collection config.\n * When this property is set, `enabledCollections` will not be available.\n **/\n disabledCollections?: string[]\n\n // Ensures that enabledCollections is not available when disabledCollections is set\n enabledCollections?: never\n }\n | {\n // Ensures that disabledCollections is not available when enabledCollections is set\n disabledCollections?: never\n\n /**\n * The collections that should be enabled. Overrides the `enableRichTextRelationship` property in the collection config\n * When this property is set, `disabledCollections` will not be available.\n **/\n enabledCollections?: string[]\n }\n\nexport const RelationshipFeature: FeatureProviderProviderServer<\n RelationshipFeatureProps,\n RelationshipFeatureProps\n> = (props) => {\n return {\n feature: () => {\n return {\n ClientComponent: RelationshipFeatureClientComponent,\n clientFeatureProps: props,\n nodes: [\n {\n node: RelationshipNode,\n populationPromises: [relationshipPopulationPromise],\n // TODO: Add validation similar to upload\n },\n ],\n serverFeatureProps: props,\n }\n },\n key: 'relationship',\n serverFeatureProps: props,\n }\n}\n"],"names":["RelationshipFeatureClientComponent","RelationshipNode","relationshipPopulationPromise","RelationshipFeature","props","feature","ClientComponent","clientFeatureProps","nodes","node","populationPromises","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,SAASA,kCAAkC,QAAQ,sBAAqB;AACxE,SAASC,gBAAgB,QAAQ,8BAA6B;AAC9D,SAASC,6BAA6B,QAAQ,yBAAwB;AAwBtE,OAAO,MAAMC,sBAGT,CAACC;IACH,OAAO;QACLC,SAAS;YACP,OAAO;gBACLC,iBAAiBN;gBACjBO,oBAAoBH;gBACpBI,OAAO;oBACL;wBACEC,MAAMR;wBACNS,oBAAoB;4BAACR;yBAA8B;oBAErD;iBACD;gBACDS,oBAAoBP;YACtB;QACF;QACAQ,KAAK;QACLD,oBAAoBP;IACtB;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../src/field/features/relationship/feature.server.ts"],"sourcesContent":["import type { FeatureProviderProviderServer } from '../types.js'\n\nimport { createNode } from '../typeUtilities.js'\nimport { RelationshipFeatureClientComponent } from './feature.client.js'\nimport { i18n } from './i18n.js'\nimport { RelationshipNode } from './nodes/RelationshipNode.js'\nimport { relationshipPopulationPromiseHOC } from './populationPromise.js'\n\nexport type ExclusiveRelationshipFeatureProps =\n | {\n /**\n * The collections that should be disabled. Overrides the `enableRichTextRelationship` property in the collection config.\n * When this property is set, `enabledCollections` will not be available.\n **/\n disabledCollections?: string[]\n\n // Ensures that enabledCollections is not available when disabledCollections is set\n enabledCollections?: never\n }\n | {\n // Ensures that disabledCollections is not available when enabledCollections is set\n disabledCollections?: never\n\n /**\n * The collections that should be enabled. Overrides the `enableRichTextRelationship` property in the collection config\n * When this property is set, `disabledCollections` will not be available.\n **/\n enabledCollections?: string[]\n }\n\nexport type RelationshipFeatureProps = ExclusiveRelationshipFeatureProps & {\n /**\n * Sets a maximum population depth for this relationship, regardless of the remaining depth when the respective field is reached.\n * This behaves exactly like the maxDepth properties of relationship and upload fields.\n *\n * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth}\n */\n maxDepth?: number\n}\n\nexport const RelationshipFeature: FeatureProviderProviderServer<\n RelationshipFeatureProps,\n RelationshipFeatureProps\n> = (props) => {\n return {\n feature: () => {\n return {\n ClientComponent: RelationshipFeatureClientComponent,\n clientFeatureProps: props,\n i18n,\n nodes: [\n createNode({\n node: RelationshipNode,\n populationPromises: [relationshipPopulationPromiseHOC(props)],\n }),\n ],\n serverFeatureProps: props,\n }\n },\n key: 'relationship',\n serverFeatureProps: props,\n }\n}\n"],"names":["createNode","RelationshipFeatureClientComponent","i18n","RelationshipNode","relationshipPopulationPromiseHOC","RelationshipFeature","props","feature","ClientComponent","clientFeatureProps","nodes","node","populationPromises","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,SAASA,UAAU,QAAQ,sBAAqB;AAChD,SAASC,kCAAkC,QAAQ,sBAAqB;AACxE,SAASC,IAAI,QAAQ,YAAW;AAChC,SAASC,gBAAgB,QAAQ,8BAA6B;AAC9D,SAASC,gCAAgC,QAAQ,yBAAwB;AAkCzE,OAAO,MAAMC,sBAGT,CAACC;IACH,OAAO;QACLC,SAAS;YACP,OAAO;gBACLC,iBAAiBP;gBACjBQ,oBAAoBH;gBACpBJ;gBACAQ,OAAO;oBACLV,WAAW;wBACTW,MAAMR;wBACNS,oBAAoB;4BAACR,iCAAiCE;yBAAO;oBAC/D;iBACD;gBACDO,oBAAoBP;YACtB;QACF;QACAQ,KAAK;QACLD,oBAAoBP;IACtB;AACF,EAAC"}
@@ -0,0 +1,3 @@
1
+ import type { GenericLanguages } from '@payloadcms/translations';
2
+ export declare const i18n: Partial<GenericLanguages>;
3
+ //# sourceMappingURL=i18n.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../../src/field/features/relationship/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAEhE,eAAO,MAAM,IAAI,EAAE,OAAO,CAAC,gBAAgB,CAiG1C,CAAA"}
@@ -0,0 +1,100 @@
1
+ export const i18n = {
2
+ ar: {
3
+ label: 'العلاقة'
4
+ },
5
+ az: {
6
+ label: 'Münasibət'
7
+ },
8
+ bg: {
9
+ label: 'Връзка'
10
+ },
11
+ cs: {
12
+ label: 'Vztah'
13
+ },
14
+ de: {
15
+ label: 'Beziehung'
16
+ },
17
+ en: {
18
+ label: 'Relationship'
19
+ },
20
+ es: {
21
+ label: 'Relación'
22
+ },
23
+ fa: {
24
+ label: 'روابط'
25
+ },
26
+ fr: {
27
+ label: 'Relation'
28
+ },
29
+ he: {
30
+ label: 'יחסים'
31
+ },
32
+ hr: {
33
+ label: 'Odnos'
34
+ },
35
+ hu: {
36
+ label: 'Kapcsolat'
37
+ },
38
+ it: {
39
+ label: 'Relazione'
40
+ },
41
+ ja: {
42
+ label: '関係性'
43
+ },
44
+ ko: {
45
+ label: '관계'
46
+ },
47
+ my: {
48
+ label: 'Hubungan'
49
+ },
50
+ nb: {
51
+ label: 'Forhold'
52
+ },
53
+ nl: {
54
+ label: 'Relatie'
55
+ },
56
+ pl: {
57
+ label: 'Relacja'
58
+ },
59
+ pt: {
60
+ label: 'Relacionamento'
61
+ },
62
+ ro: {
63
+ label: 'Relație'
64
+ },
65
+ rs: {
66
+ label: 'Veza'
67
+ },
68
+ 'rs-latin': {
69
+ label: 'Odnos'
70
+ },
71
+ ru: {
72
+ label: 'Отношения'
73
+ },
74
+ sk: {
75
+ label: 'Vzťah'
76
+ },
77
+ sv: {
78
+ label: 'Relation'
79
+ },
80
+ th: {
81
+ label: 'ความสัมพันธ์'
82
+ },
83
+ tr: {
84
+ label: 'İlişki'
85
+ },
86
+ uk: {
87
+ label: 'Стосунки'
88
+ },
89
+ vi: {
90
+ label: 'Mối quan hệ'
91
+ },
92
+ zh: {
93
+ label: '关系'
94
+ },
95
+ 'zh-TW': {
96
+ label: '關係'
97
+ }
98
+ };
99
+
100
+ //# sourceMappingURL=i18n.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/field/features/relationship/i18n.ts"],"sourcesContent":["import type { GenericLanguages } from '@payloadcms/translations'\n\nexport const i18n: Partial<GenericLanguages> = {\n ar: {\n label: 'العلاقة',\n },\n az: {\n label: 'Münasibət',\n },\n bg: {\n label: 'Връзка',\n },\n cs: {\n label: 'Vztah',\n },\n de: {\n label: 'Beziehung',\n },\n en: {\n label: 'Relationship',\n },\n es: {\n label: 'Relación',\n },\n fa: {\n label: 'روابط',\n },\n fr: {\n label: 'Relation',\n },\n he: {\n label: 'יחסים',\n },\n hr: {\n label: 'Odnos',\n },\n hu: {\n label: 'Kapcsolat',\n },\n it: {\n label: 'Relazione',\n },\n ja: {\n label: '関係性',\n },\n ko: {\n label: '관계',\n },\n my: {\n label: 'Hubungan',\n },\n nb: {\n label: 'Forhold',\n },\n nl: {\n label: 'Relatie',\n },\n pl: {\n label: 'Relacja',\n },\n pt: {\n label: 'Relacionamento',\n },\n ro: {\n label: 'Relație',\n },\n rs: {\n label: 'Veza',\n },\n 'rs-latin': {\n label: 'Odnos',\n },\n ru: {\n label: 'Отношения',\n },\n sk: {\n label: 'Vzťah',\n },\n sv: {\n label: 'Relation',\n },\n th: {\n label: 'ความสัมพันธ์',\n },\n tr: {\n label: 'İlişki',\n },\n uk: {\n label: 'Стосунки',\n },\n vi: {\n label: 'Mối quan hệ',\n },\n zh: {\n label: '关系',\n },\n 'zh-TW': {\n label: '關係',\n },\n}\n"],"names":["i18n","ar","label","az","bg","cs","de","en","es","fa","fr","he","hr","hu","it","ja","ko","my","nb","nl","pl","pt","ro","rs","ru","sk","sv","th","tr","uk","vi","zh"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,OAAO,MAAMA,OAAkC;IAC7CC,IAAI;QACFC,OAAO;IACT;IACAC,IAAI;QACFD,OAAO;IACT;IACAE,IAAI;QACFF,OAAO;IACT;IACAG,IAAI;QACFH,OAAO;IACT;IACAI,IAAI;QACFJ,OAAO;IACT;IACAK,IAAI;QACFL,OAAO;IACT;IACAM,IAAI;QACFN,OAAO;IACT;IACAO,IAAI;QACFP,OAAO;IACT;IACAQ,IAAI;QACFR,OAAO;IACT;IACAS,IAAI;QACFT,OAAO;IACT;IACAU,IAAI;QACFV,OAAO;IACT;IACAW,IAAI;QACFX,OAAO;IACT;IACAY,IAAI;QACFZ,OAAO;IACT;IACAa,IAAI;QACFb,OAAO;IACT;IACAc,IAAI;QACFd,OAAO;IACT;IACAe,IAAI;QACFf,OAAO;IACT;IACAgB,IAAI;QACFhB,OAAO;IACT;IACAiB,IAAI;QACFjB,OAAO;IACT;IACAkB,IAAI;QACFlB,OAAO;IACT;IACAmB,IAAI;QACFnB,OAAO;IACT;IACAoB,IAAI;QACFpB,OAAO;IACT;IACAqB,IAAI;QACFrB,OAAO;IACT;IACA,YAAY;QACVA,OAAO;IACT;IACAsB,IAAI;QACFtB,OAAO;IACT;IACAuB,IAAI;QACFvB,OAAO;IACT;IACAwB,IAAI;QACFxB,OAAO;IACT;IACAyB,IAAI;QACFzB,OAAO;IACT;IACA0B,IAAI;QACF1B,OAAO;IACT;IACA2B,IAAI;QACF3B,OAAO;IACT;IACA4B,IAAI;QACF5B,OAAO;IACT;IACA6B,IAAI;QACF7B,OAAO;IACT;IACA,SAAS;QACPA,OAAO;IACT;AACF,EAAC"}
@@ -1,14 +1,10 @@
1
- /// <reference types="react" resolution-mode="require"/>
2
- import type { DOMConversionMap, DOMExportOutput, EditorConfig, ElementFormatType, LexicalEditor, LexicalNode, NodeKey, Spread } from 'lexical';
3
- import lexicalDecoratorBlockNodeImport from '@lexical/react/LexicalDecoratorBlockNode.js';
4
- declare const DecoratorBlockNode: typeof lexicalDecoratorBlockNodeImport.DecoratorBlockNode;
5
1
  import type { SerializedDecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js';
2
+ import type { DOMConversionMap, DOMExportOutput, EditorConfig, ElementFormatType, LexicalEditor, LexicalNode, NodeKey, Spread } from 'lexical';
3
+ import type { JSX } from 'react';
4
+ import { DecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js';
6
5
  export type RelationshipData = {
7
6
  relationTo: string;
8
- value: {
9
- [key: string]: unknown;
10
- id: string;
11
- };
7
+ value: number | string;
12
8
  };
13
9
  export type SerializedRelationshipNode = Spread<RelationshipData, SerializedDecoratorBlockNode>;
14
10
  export declare class RelationshipNode extends DecoratorBlockNode {
@@ -32,5 +28,4 @@ export declare class RelationshipNode extends DecoratorBlockNode {
32
28
  }
33
29
  export declare function $createRelationshipNode(data: RelationshipData): RelationshipNode;
34
30
  export declare function $isRelationshipNode(node: LexicalNode | RelationshipNode | null | undefined): node is RelationshipNode;
35
- export {};
36
31
  //# sourceMappingURL=RelationshipNode.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RelationshipNode.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/relationship/nodes/RelationshipNode.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EACV,gBAAgB,EAEhB,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,OAAO,EACP,MAAM,EACP,MAAM,SAAS,CAAA;AAEhB,OAAO,+BAA+B,MAAM,6CAA6C,CAAA;AACzF,QAAA,MAAQ,kBAAkB,2DAAoC,CAAA;AAE9D,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAA;AAU/F,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE;QAEL,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;QACtB,EAAE,EAAE,MAAM,CAAA;KACX,CAAA;CACF,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG,MAAM,CAAC,gBAAgB,EAAE,4BAA4B,CAAC,CAAA;AAkB/F,qBAAa,gBAAiB,SAAQ,kBAAkB;IACtD,MAAM,EAAE,gBAAgB,CAAA;gBAEZ,EACV,IAAI,EACJ,MAAM,EACN,GAAG,GACJ,EAAE;QACD,IAAI,EAAE,gBAAgB,CAAA;QACtB,MAAM,CAAC,EAAE,iBAAiB,CAAA;QAC1B,GAAG,CAAC,EAAE,OAAO,CAAA;KACd;IAKD,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,gBAAgB,GAAG,gBAAgB;IAQtD,MAAM,CAAC,OAAO,IAAI,MAAM;IAIxB,MAAM,CAAC,SAAS,IAAI,gBAAgB,CAAC,cAAc,CAAC,GAAG,IAAI;IAiB3D,MAAM,CAAC,UAAU,CAAC,cAAc,EAAE,0BAA0B,GAAG,gBAAgB;IAU/E,MAAM,CAAC,QAAQ,IAAI,KAAK;IAGxB,QAAQ,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,GAAG,GAAG,CAAC,OAAO;IAWlE,SAAS,IAAI,eAAe;IAU5B,UAAU,IAAI,0BAA0B;IASxC,OAAO,IAAI,gBAAgB;IAI3B,cAAc,IAAI,MAAM;IAIxB,OAAO,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI;CAItC;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,gBAAgB,GAAG,gBAAgB,CAIhF;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,WAAW,GAAG,gBAAgB,GAAG,IAAI,GAAG,SAAS,GACtD,IAAI,IAAI,gBAAgB,CAE1B"}
1
+ {"version":3,"file":"RelationshipNode.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/relationship/nodes/RelationshipNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAA;AAC/F,OAAO,KAAK,EACV,gBAAgB,EAEhB,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,WAAW,EACX,OAAO,EACP,MAAM,EACP,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAA;AAShF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,GAAG,MAAM,CAAA;CACvB,CAAA;AAED,MAAM,MAAM,0BAA0B,GAAG,MAAM,CAAC,gBAAgB,EAAE,4BAA4B,CAAC,CAAA;AAgB/F,qBAAa,gBAAiB,SAAQ,kBAAkB;IACtD,MAAM,EAAE,gBAAgB,CAAA;gBAEZ,EACV,IAAI,EACJ,MAAM,EACN,GAAG,GACJ,EAAE;QACD,IAAI,EAAE,gBAAgB,CAAA;QACtB,MAAM,CAAC,EAAE,iBAAiB,CAAA;QAC1B,GAAG,CAAC,EAAE,OAAO,CAAA;KACd;IAKD,MAAM,CAAC,KAAK,CAAC,IAAI,EAAE,gBAAgB,GAAG,gBAAgB;IAQtD,MAAM,CAAC,OAAO,IAAI,MAAM;IAIxB,MAAM,CAAC,SAAS,IAAI,gBAAgB,CAAC,cAAc,CAAC,GAAG,IAAI;IAiB3D,MAAM,CAAC,UAAU,CAAC,cAAc,EAAE,0BAA0B,GAAG,gBAAgB;IAc/E,MAAM,CAAC,QAAQ,IAAI,KAAK;IAIxB,QAAQ,CAAC,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,YAAY,GAAG,GAAG,CAAC,OAAO;IAUlE,SAAS,IAAI,eAAe;IAU5B,UAAU,IAAI,0BAA0B;IASxC,OAAO,IAAI,gBAAgB;IAI3B,cAAc,IAAI,MAAM;IAIxB,OAAO,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI;CAItC;AAED,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,gBAAgB,GAAG,gBAAgB,CAIhF;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,WAAW,GAAG,gBAAgB,GAAG,IAAI,GAAG,SAAS,GACtD,IAAI,IAAI,gBAAgB,CAE1B"}
@@ -1,18 +1,16 @@
1
- import lexicalDecoratorBlockNodeImport from '@lexical/react/LexicalDecoratorBlockNode.js';
2
- const { DecoratorBlockNode } = lexicalDecoratorBlockNodeImport;
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { DecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js';
3
3
  import * as React from 'react';
4
4
  const RelationshipComponent = /*#__PURE__*/ React.lazy(()=>import('./components/RelationshipComponent.js').then((module)=>({
5
5
  default: module.RelationshipComponent
6
6
  })));
7
- function relationshipElementToNode(domNode) {
7
+ function $relationshipElementToNode(domNode) {
8
8
  const id = domNode.getAttribute('data-lexical-relationship-id');
9
9
  const relationTo = domNode.getAttribute('data-lexical-relationship-relationTo');
10
10
  if (id != null && relationTo != null) {
11
11
  const node = $createRelationshipNode({
12
12
  relationTo,
13
- value: {
14
- id
15
- }
13
+ value: id
16
14
  });
17
15
  return {
18
16
  node
@@ -43,13 +41,16 @@ export class RelationshipNode extends DecoratorBlockNode {
43
41
  return null;
44
42
  }
45
43
  return {
46
- conversion: relationshipElementToNode,
44
+ conversion: $relationshipElementToNode,
47
45
  priority: 2
48
46
  };
49
47
  }
50
48
  };
51
49
  }
52
50
  static importJSON(serializedNode) {
51
+ if (serializedNode.version === 1 && serializedNode?.value?.id) {
52
+ serializedNode.value = serializedNode.value.id;
53
+ }
53
54
  const importedData = {
54
55
  relationTo: serializedNode.relationTo,
55
56
  value: serializedNode.value
@@ -62,7 +63,7 @@ export class RelationshipNode extends DecoratorBlockNode {
62
63
  return false;
63
64
  }
64
65
  decorate(editor, config) {
65
- return /*#__PURE__*/ React.createElement(RelationshipComponent, {
66
+ return /*#__PURE__*/ _jsx(RelationshipComponent, {
66
67
  className: config.theme.relationship ?? 'LexicalEditorTheme__relationship',
67
68
  data: this.__data,
68
69
  format: this.__format,
@@ -71,7 +72,7 @@ export class RelationshipNode extends DecoratorBlockNode {
71
72
  }
72
73
  exportDOM() {
73
74
  const element = document.createElement('div');
74
- element.setAttribute('data-lexical-relationship-id', this.__data?.value?.id);
75
+ element.setAttribute('data-lexical-relationship-id', String(this.__data?.value));
75
76
  element.setAttribute('data-lexical-relationship-relationTo', this.__data?.relationTo);
76
77
  const text = document.createTextNode(this.getTextContent());
77
78
  element.append(text);
@@ -84,14 +85,14 @@ export class RelationshipNode extends DecoratorBlockNode {
84
85
  ...super.exportJSON(),
85
86
  ...this.getData(),
86
87
  type: this.getType(),
87
- version: 1
88
+ version: 2
88
89
  };
89
90
  }
90
91
  getData() {
91
92
  return this.getLatest().__data;
92
93
  }
93
94
  getTextContent() {
94
- return `${this.__data?.relationTo} relation to ${this.__data?.value?.id}`;
95
+ return `${this.__data?.relationTo} relation to ${this.__data?.value}`;
95
96
  }
96
97
  setData(data) {
97
98
  const writable = this.getWritable();
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/relationship/nodes/RelationshipNode.tsx"],"sourcesContent":["import type {\n DOMConversionMap,\n DOMConversionOutput,\n DOMExportOutput,\n EditorConfig,\n ElementFormatType,\n LexicalEditor,\n LexicalNode,\n NodeKey,\n Spread,\n} from 'lexical'\n\nimport lexicalDecoratorBlockNodeImport from '@lexical/react/LexicalDecoratorBlockNode.js'\nconst { DecoratorBlockNode } = lexicalDecoratorBlockNodeImport\n\nimport type { SerializedDecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\n\nimport * as React from 'react'\n\nconst RelationshipComponent = React.lazy(() =>\n import('./components/RelationshipComponent.js').then((module) => ({\n default: module.RelationshipComponent,\n })),\n)\n\nexport type RelationshipData = {\n relationTo: string\n value: {\n // Actual relationship, populated in afterRead hook\n [key: string]: unknown\n id: string\n }\n}\n\nexport type SerializedRelationshipNode = Spread<RelationshipData, SerializedDecoratorBlockNode>\n\nfunction relationshipElementToNode(domNode: HTMLDivElement): DOMConversionOutput | null {\n const id = domNode.getAttribute('data-lexical-relationship-id')\n const relationTo = domNode.getAttribute('data-lexical-relationship-relationTo')\n\n if (id != null && relationTo != null) {\n const node = $createRelationshipNode({\n relationTo,\n value: {\n id,\n },\n })\n return { node }\n }\n return null\n}\n\nexport class RelationshipNode extends DecoratorBlockNode {\n __data: RelationshipData\n\n constructor({\n data,\n format,\n key,\n }: {\n data: RelationshipData\n format?: ElementFormatType\n key?: NodeKey\n }) {\n super(format, key)\n this.__data = data\n }\n\n static clone(node: RelationshipNode): RelationshipNode {\n return new RelationshipNode({\n data: node.__data,\n format: node.__format,\n key: node.__key,\n })\n }\n\n static getType(): string {\n return 'relationship'\n }\n\n static importDOM(): DOMConversionMap<HTMLDivElement> | null {\n return {\n div: (domNode: HTMLDivElement) => {\n if (\n !domNode.hasAttribute('data-lexical-relationship-relationTo') ||\n !domNode.hasAttribute('data-lexical-relationship-id')\n ) {\n return null\n }\n return {\n conversion: relationshipElementToNode,\n priority: 2,\n }\n },\n }\n }\n\n static importJSON(serializedNode: SerializedRelationshipNode): RelationshipNode {\n const importedData: RelationshipData = {\n relationTo: serializedNode.relationTo,\n value: serializedNode.value,\n }\n const node = $createRelationshipNode(importedData)\n node.setFormat(serializedNode.format)\n return node\n }\n\n static isInline(): false {\n return false\n }\n decorate(editor: LexicalEditor, config: EditorConfig): JSX.Element {\n return (\n <RelationshipComponent\n className={config.theme.relationship ?? 'LexicalEditorTheme__relationship'}\n data={this.__data}\n format={this.__format}\n nodeKey={this.getKey()}\n />\n )\n }\n\n exportDOM(): DOMExportOutput {\n const element = document.createElement('div')\n element.setAttribute('data-lexical-relationship-id', this.__data?.value?.id)\n element.setAttribute('data-lexical-relationship-relationTo', this.__data?.relationTo)\n\n const text = document.createTextNode(this.getTextContent())\n element.append(text)\n return { element }\n }\n\n exportJSON(): SerializedRelationshipNode {\n return {\n ...super.exportJSON(),\n ...this.getData(),\n type: this.getType(),\n version: 1,\n }\n }\n\n getData(): RelationshipData {\n return this.getLatest().__data\n }\n\n getTextContent(): string {\n return `${this.__data?.relationTo} relation to ${this.__data?.value?.id}`\n }\n\n setData(data: RelationshipData): void {\n const writable = this.getWritable()\n writable.__data = data\n }\n}\n\nexport function $createRelationshipNode(data: RelationshipData): RelationshipNode {\n return new RelationshipNode({\n data,\n })\n}\n\nexport function $isRelationshipNode(\n node: LexicalNode | RelationshipNode | null | undefined,\n): node is RelationshipNode {\n return node instanceof RelationshipNode\n}\n"],"names":["lexicalDecoratorBlockNodeImport","DecoratorBlockNode","React","RelationshipComponent","lazy","then","module","default","relationshipElementToNode","domNode","id","getAttribute","relationTo","node","$createRelationshipNode","value","RelationshipNode","__data","constructor","data","format","key","clone","__format","__key","getType","importDOM","div","hasAttribute","conversion","priority","importJSON","serializedNode","importedData","setFormat","isInline","decorate","editor","config","className","theme","relationship","nodeKey","getKey","exportDOM","element","document","createElement","setAttribute","text","createTextNode","getTextContent","append","exportJSON","getData","type","version","getLatest","setData","writable","getWritable","$isRelationshipNode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAYA,OAAOA,qCAAqC,8CAA6C;AACzF,MAAM,EAAEC,kBAAkB,EAAE,GAAGD;AAI/B,YAAYE,WAAW,QAAO;AAE9B,MAAMC,sCAAwBD,MAAME,IAAI,CAAC,IACvC,MAAM,CAAC,yCAAyCC,IAAI,CAAC,CAACC,SAAY,CAAA;YAChEC,SAASD,OAAOH,qBAAqB;QACvC,CAAA;AAcF,SAASK,0BAA0BC,OAAuB;IACxD,MAAMC,KAAKD,QAAQE,YAAY,CAAC;IAChC,MAAMC,aAAaH,QAAQE,YAAY,CAAC;IAExC,IAAID,MAAM,QAAQE,cAAc,MAAM;QACpC,MAAMC,OAAOC,wBAAwB;YACnCF;YACAG,OAAO;gBACLL;YACF;QACF;QACA,OAAO;YAAEG;QAAK;IAChB;IACA,OAAO;AACT;AAEA,OAAO,MAAMG,yBAAyBf;IACpCgB,OAAwB;IAExBC,YAAY,EACVC,IAAI,EACJC,MAAM,EACNC,GAAG,EAKJ,CAAE;QACD,KAAK,CAACD,QAAQC;QACd,IAAI,CAACJ,MAAM,GAAGE;IAChB;IAEA,OAAOG,MAAMT,IAAsB,EAAoB;QACrD,OAAO,IAAIG,iBAAiB;YAC1BG,MAAMN,KAAKI,MAAM;YACjBG,QAAQP,KAAKU,QAAQ;YACrBF,KAAKR,KAAKW,KAAK;QACjB;IACF;IAEA,OAAOC,UAAkB;QACvB,OAAO;IACT;IAEA,OAAOC,YAAqD;QAC1D,OAAO;YACLC,KAAK,CAAClB;gBACJ,IACE,CAACA,QAAQmB,YAAY,CAAC,2CACtB,CAACnB,QAAQmB,YAAY,CAAC,iCACtB;oBACA,OAAO;gBACT;gBACA,OAAO;oBACLC,YAAYrB;oBACZsB,UAAU;gBACZ;YACF;QACF;IACF;IAEA,OAAOC,WAAWC,cAA0C,EAAoB;QAC9E,MAAMC,eAAiC;YACrCrB,YAAYoB,eAAepB,UAAU;YACrCG,OAAOiB,eAAejB,KAAK;QAC7B;QACA,MAAMF,OAAOC,wBAAwBmB;QACrCpB,KAAKqB,SAAS,CAACF,eAAeZ,MAAM;QACpC,OAAOP;IACT;IAEA,OAAOsB,WAAkB;QACvB,OAAO;IACT;IACAC,SAASC,MAAqB,EAAEC,MAAoB,EAAe;QACjE,qBACE,oBAACnC;YACCoC,WAAWD,OAAOE,KAAK,CAACC,YAAY,IAAI;YACxCtB,MAAM,IAAI,CAACF,MAAM;YACjBG,QAAQ,IAAI,CAACG,QAAQ;YACrBmB,SAAS,IAAI,CAACC,MAAM;;IAG1B;IAEAC,YAA6B;QAC3B,MAAMC,UAAUC,SAASC,aAAa,CAAC;QACvCF,QAAQG,YAAY,CAAC,gCAAgC,IAAI,CAAC/B,MAAM,EAAEF,OAAOL;QACzEmC,QAAQG,YAAY,CAAC,wCAAwC,IAAI,CAAC/B,MAAM,EAAEL;QAE1E,MAAMqC,OAAOH,SAASI,cAAc,CAAC,IAAI,CAACC,cAAc;QACxDN,QAAQO,MAAM,CAACH;QACf,OAAO;YAAEJ;QAAQ;IACnB;IAEAQ,aAAyC;QACvC,OAAO;YACL,GAAG,KAAK,CAACA,YAAY;YACrB,GAAG,IAAI,CAACC,OAAO,EAAE;YACjBC,MAAM,IAAI,CAAC9B,OAAO;YAClB+B,SAAS;QACX;IACF;IAEAF,UAA4B;QAC1B,OAAO,IAAI,CAACG,SAAS,GAAGxC,MAAM;IAChC;IAEAkC,iBAAyB;QACvB,OAAO,CAAC,EAAE,IAAI,CAAClC,MAAM,EAAEL,WAAW,aAAa,EAAE,IAAI,CAACK,MAAM,EAAEF,OAAOL,GAAG,CAAC;IAC3E;IAEAgD,QAAQvC,IAAsB,EAAQ;QACpC,MAAMwC,WAAW,IAAI,CAACC,WAAW;QACjCD,SAAS1C,MAAM,GAAGE;IACpB;AACF;AAEA,OAAO,SAASL,wBAAwBK,IAAsB;IAC5D,OAAO,IAAIH,iBAAiB;QAC1BG;IACF;AACF;AAEA,OAAO,SAAS0C,oBACdhD,IAAuD;IAEvD,OAAOA,gBAAgBG;AACzB"}
1
+ {"version":3,"sources":["../../../../../src/field/features/relationship/nodes/RelationshipNode.tsx"],"sourcesContent":["import type { SerializedDecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\nimport type {\n DOMConversionMap,\n DOMConversionOutput,\n DOMExportOutput,\n EditorConfig,\n ElementFormatType,\n LexicalEditor,\n LexicalNode,\n NodeKey,\n Spread,\n} from 'lexical'\nimport type { JSX } from 'react'\n\nimport { DecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\nimport * as React from 'react'\n\nconst RelationshipComponent = React.lazy(() =>\n import('./components/RelationshipComponent.js').then((module) => ({\n default: module.RelationshipComponent,\n })),\n)\n\nexport type RelationshipData = {\n relationTo: string\n value: number | string\n}\n\nexport type SerializedRelationshipNode = Spread<RelationshipData, SerializedDecoratorBlockNode>\n\nfunction $relationshipElementToNode(domNode: HTMLDivElement): DOMConversionOutput | null {\n const id = domNode.getAttribute('data-lexical-relationship-id')\n const relationTo = domNode.getAttribute('data-lexical-relationship-relationTo')\n\n if (id != null && relationTo != null) {\n const node = $createRelationshipNode({\n relationTo,\n value: id,\n })\n return { node }\n }\n return null\n}\n\nexport class RelationshipNode extends DecoratorBlockNode {\n __data: RelationshipData\n\n constructor({\n data,\n format,\n key,\n }: {\n data: RelationshipData\n format?: ElementFormatType\n key?: NodeKey\n }) {\n super(format, key)\n this.__data = data\n }\n\n static clone(node: RelationshipNode): RelationshipNode {\n return new RelationshipNode({\n data: node.__data,\n format: node.__format,\n key: node.__key,\n })\n }\n\n static getType(): string {\n return 'relationship'\n }\n\n static importDOM(): DOMConversionMap<HTMLDivElement> | null {\n return {\n div: (domNode: HTMLDivElement) => {\n if (\n !domNode.hasAttribute('data-lexical-relationship-relationTo') ||\n !domNode.hasAttribute('data-lexical-relationship-id')\n ) {\n return null\n }\n return {\n conversion: $relationshipElementToNode,\n priority: 2,\n }\n },\n }\n }\n\n static importJSON(serializedNode: SerializedRelationshipNode): RelationshipNode {\n if (serializedNode.version === 1 && (serializedNode?.value as unknown as { id: string })?.id) {\n serializedNode.value = (serializedNode.value as unknown as { id: string }).id\n }\n\n const importedData: RelationshipData = {\n relationTo: serializedNode.relationTo,\n value: serializedNode.value,\n }\n const node = $createRelationshipNode(importedData)\n node.setFormat(serializedNode.format)\n return node\n }\n\n static isInline(): false {\n return false\n }\n\n decorate(editor: LexicalEditor, config: EditorConfig): JSX.Element {\n return (\n <RelationshipComponent\n className={config.theme.relationship ?? 'LexicalEditorTheme__relationship'}\n data={this.__data}\n format={this.__format}\n nodeKey={this.getKey()}\n />\n )\n }\n exportDOM(): DOMExportOutput {\n const element = document.createElement('div')\n element.setAttribute('data-lexical-relationship-id', String(this.__data?.value))\n element.setAttribute('data-lexical-relationship-relationTo', this.__data?.relationTo)\n\n const text = document.createTextNode(this.getTextContent())\n element.append(text)\n return { element }\n }\n\n exportJSON(): SerializedRelationshipNode {\n return {\n ...super.exportJSON(),\n ...this.getData(),\n type: this.getType(),\n version: 2,\n }\n }\n\n getData(): RelationshipData {\n return this.getLatest().__data\n }\n\n getTextContent(): string {\n return `${this.__data?.relationTo} relation to ${this.__data?.value}`\n }\n\n setData(data: RelationshipData): void {\n const writable = this.getWritable()\n writable.__data = data\n }\n}\n\nexport function $createRelationshipNode(data: RelationshipData): RelationshipNode {\n return new RelationshipNode({\n data,\n })\n}\n\nexport function $isRelationshipNode(\n node: LexicalNode | RelationshipNode | null | undefined,\n): node is RelationshipNode {\n return node instanceof RelationshipNode\n}\n"],"names":["DecoratorBlockNode","React","RelationshipComponent","lazy","then","module","default","$relationshipElementToNode","domNode","id","getAttribute","relationTo","node","$createRelationshipNode","value","RelationshipNode","__data","constructor","data","format","key","clone","__format","__key","getType","importDOM","div","hasAttribute","conversion","priority","importJSON","serializedNode","version","importedData","setFormat","isInline","decorate","editor","config","className","theme","relationship","nodeKey","getKey","exportDOM","element","document","createElement","setAttribute","String","text","createTextNode","getTextContent","append","exportJSON","getData","type","getLatest","setData","writable","getWritable","$isRelationshipNode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAcA,SAASA,kBAAkB,QAAQ,8CAA6C;AAChF,YAAYC,WAAW,QAAO;AAE9B,MAAMC,sCAAwBD,MAAME,IAAI,CAAC,IACvC,MAAM,CAAC,yCAAyCC,IAAI,CAAC,CAACC,SAAY,CAAA;YAChEC,SAASD,OAAOH,qBAAqB;QACvC,CAAA;AAUF,SAASK,2BAA2BC,OAAuB;IACzD,MAAMC,KAAKD,QAAQE,YAAY,CAAC;IAChC,MAAMC,aAAaH,QAAQE,YAAY,CAAC;IAExC,IAAID,MAAM,QAAQE,cAAc,MAAM;QACpC,MAAMC,OAAOC,wBAAwB;YACnCF;YACAG,OAAOL;QACT;QACA,OAAO;YAAEG;QAAK;IAChB;IACA,OAAO;AACT;AAEA,OAAO,MAAMG,yBAAyBf;IACpCgB,OAAwB;IAExBC,YAAY,EACVC,IAAI,EACJC,MAAM,EACNC,GAAG,EAKJ,CAAE;QACD,KAAK,CAACD,QAAQC;QACd,IAAI,CAACJ,MAAM,GAAGE;IAChB;IAEA,OAAOG,MAAMT,IAAsB,EAAoB;QACrD,OAAO,IAAIG,iBAAiB;YAC1BG,MAAMN,KAAKI,MAAM;YACjBG,QAAQP,KAAKU,QAAQ;YACrBF,KAAKR,KAAKW,KAAK;QACjB;IACF;IAEA,OAAOC,UAAkB;QACvB,OAAO;IACT;IAEA,OAAOC,YAAqD;QAC1D,OAAO;YACLC,KAAK,CAAClB;gBACJ,IACE,CAACA,QAAQmB,YAAY,CAAC,2CACtB,CAACnB,QAAQmB,YAAY,CAAC,iCACtB;oBACA,OAAO;gBACT;gBACA,OAAO;oBACLC,YAAYrB;oBACZsB,UAAU;gBACZ;YACF;QACF;IACF;IAEA,OAAOC,WAAWC,cAA0C,EAAoB;QAC9E,IAAIA,eAAeC,OAAO,KAAK,KAAMD,gBAAgBjB,OAAqCL,IAAI;YAC5FsB,eAAejB,KAAK,GAAG,AAACiB,eAAejB,KAAK,CAA+BL,EAAE;QAC/E;QAEA,MAAMwB,eAAiC;YACrCtB,YAAYoB,eAAepB,UAAU;YACrCG,OAAOiB,eAAejB,KAAK;QAC7B;QACA,MAAMF,OAAOC,wBAAwBoB;QACrCrB,KAAKsB,SAAS,CAACH,eAAeZ,MAAM;QACpC,OAAOP;IACT;IAEA,OAAOuB,WAAkB;QACvB,OAAO;IACT;IAEAC,SAASC,MAAqB,EAAEC,MAAoB,EAAe;QACjE,qBACE,KAACpC;YACCqC,WAAWD,OAAOE,KAAK,CAACC,YAAY,IAAI;YACxCvB,MAAM,IAAI,CAACF,MAAM;YACjBG,QAAQ,IAAI,CAACG,QAAQ;YACrBoB,SAAS,IAAI,CAACC,MAAM;;IAG1B;IACAC,YAA6B;QAC3B,MAAMC,UAAUC,SAASC,aAAa,CAAC;QACvCF,QAAQG,YAAY,CAAC,gCAAgCC,OAAO,IAAI,CAACjC,MAAM,EAAEF;QACzE+B,QAAQG,YAAY,CAAC,wCAAwC,IAAI,CAAChC,MAAM,EAAEL;QAE1E,MAAMuC,OAAOJ,SAASK,cAAc,CAAC,IAAI,CAACC,cAAc;QACxDP,QAAQQ,MAAM,CAACH;QACf,OAAO;YAAEL;QAAQ;IACnB;IAEAS,aAAyC;QACvC,OAAO;YACL,GAAG,KAAK,CAACA,YAAY;YACrB,GAAG,IAAI,CAACC,OAAO,EAAE;YACjBC,MAAM,IAAI,CAAChC,OAAO;YAClBQ,SAAS;QACX;IACF;IAEAuB,UAA4B;QAC1B,OAAO,IAAI,CAACE,SAAS,GAAGzC,MAAM;IAChC;IAEAoC,iBAAyB;QACvB,OAAO,CAAC,EAAE,IAAI,CAACpC,MAAM,EAAEL,WAAW,aAAa,EAAE,IAAI,CAACK,MAAM,EAAEF,MAAM,CAAC;IACvE;IAEA4C,QAAQxC,IAAsB,EAAQ;QACpC,MAAMyC,WAAW,IAAI,CAACC,WAAW;QACjCD,SAAS3C,MAAM,GAAGE;IACpB;AACF;AAEA,OAAO,SAASL,wBAAwBK,IAAsB;IAC5D,OAAO,IAAIH,iBAAiB;QAC1BG;IACF;AACF;AAEA,OAAO,SAAS2C,oBACdjD,IAAuD;IAEvD,OAAOA,gBAAgBG;AACzB"}
@@ -1 +1 @@
1
- {"version":3,"file":"RelationshipComponent.d.ts","sourceRoot":"","sources":["../../../../../../src/field/features/relationship/nodes/components/RelationshipComponent.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAOhD,OAAO,KAA4C,MAAM,OAAO,CAAA;AAEhE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAI9D,OAAO,cAAc,CAAA;AAQrB,KAAK,KAAK,GAAG;IACX,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,gBAAgB,CAAA;IACtB,MAAM,CAAC,EAAE,iBAAiB,CAAA;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AA8GD,eAAO,MAAM,qBAAqB,UAAW,KAAK,KAAG,MAAM,SAE1D,CAAA"}
1
+ {"version":3,"file":"RelationshipComponent.d.ts","sourceRoot":"","sources":["../../../../../../src/field/features/relationship/nodes/components/RelationshipComponent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAoBhD,OAAO,KAA+D,MAAM,OAAO,CAAA;AAEnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAK9D,OAAO,cAAc,CAAA;AAQrB,KAAK,KAAK,GAAG;IACX,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,gBAAgB,CAAA;IACtB,MAAM,CAAC,EAAE,iBAAiB,CAAA;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AA8JD,eAAO,MAAM,qBAAqB,UAAW,KAAK,KAAG,MAAM,SAE1D,CAAA"}