@payloadcms/richtext-lexical 3.68.0-internal-debug.2eb12b9 → 3.68.0-internal-debug.dafc24d

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 (306) hide show
  1. package/dist/cell/rscEntry.js +13 -5
  2. package/dist/cell/rscEntry.js.map +1 -1
  3. package/dist/features/blocks/client/component/BlockContent.js +29 -9
  4. package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
  5. package/dist/features/blocks/client/component/components/BlockCollapsible.js +7 -3
  6. package/dist/features/blocks/client/component/components/BlockCollapsible.js.map +1 -1
  7. package/dist/features/blocks/client/component/components/BlockEditButton.js +6 -2
  8. package/dist/features/blocks/client/component/components/BlockEditButton.js.map +1 -1
  9. package/dist/features/blocks/client/component/components/BlockRemoveButton.js +6 -2
  10. package/dist/features/blocks/client/component/components/BlockRemoveButton.js.map +1 -1
  11. package/dist/features/blocks/client/component/index.js +124 -43
  12. package/dist/features/blocks/client/component/index.js.map +1 -1
  13. package/dist/features/blocks/client/component/index.scss +188 -0
  14. package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.js +7 -3
  15. package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.js.map +1 -1
  16. package/dist/features/blocks/client/componentInline/components/InlineBlockEditButton.js +6 -2
  17. package/dist/features/blocks/client/componentInline/components/InlineBlockEditButton.js.map +1 -1
  18. package/dist/features/blocks/client/componentInline/components/InlineBlockLabel.js +6 -2
  19. package/dist/features/blocks/client/componentInline/components/InlineBlockLabel.js.map +1 -1
  20. package/dist/features/blocks/client/componentInline/components/InlineBlockRemoveButton.js +6 -2
  21. package/dist/features/blocks/client/componentInline/components/InlineBlockRemoveButton.js.map +1 -1
  22. package/dist/features/blocks/client/componentInline/index.js +118 -37
  23. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  24. package/dist/features/blocks/client/componentInline/index.scss +90 -0
  25. package/dist/features/blocks/client/getBlockImageComponent.js +7 -3
  26. package/dist/features/blocks/client/getBlockImageComponent.js.map +1 -1
  27. package/dist/features/blocks/client/markdown/markdownTransformer.js +1 -0
  28. package/dist/features/blocks/client/markdown/markdownTransformer.js.map +1 -1
  29. package/dist/features/blocks/client/nodes/BlocksNode.js +7 -3
  30. package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
  31. package/dist/features/blocks/client/nodes/InlineBlocksNode.js +7 -3
  32. package/dist/features/blocks/client/nodes/InlineBlocksNode.js.map +1 -1
  33. package/dist/features/blocks/premade/CodeBlock/Component/Block.js +88 -27
  34. package/dist/features/blocks/premade/CodeBlock/Component/Block.js.map +1 -1
  35. package/dist/features/blocks/premade/CodeBlock/Component/Code.js +7 -3
  36. package/dist/features/blocks/premade/CodeBlock/Component/Code.js.map +1 -1
  37. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.js +13 -4
  38. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.js.map +1 -1
  39. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.scss +6 -0
  40. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.js +19 -6
  41. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.js.map +1 -1
  42. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.scss +29 -0
  43. package/dist/features/blocks/premade/CodeBlock/Component/index.scss +97 -0
  44. package/dist/features/blocks/server/markdown/markdownTransformer.js +1 -0
  45. package/dist/features/blocks/server/markdown/markdownTransformer.js.map +1 -1
  46. package/dist/features/converters/lexicalToJSX/Component/index.js +9 -5
  47. package/dist/features/converters/lexicalToJSX/Component/index.js.map +1 -1
  48. package/dist/features/converters/lexicalToJSX/converter/converters/blockquote.js +7 -3
  49. package/dist/features/converters/lexicalToJSX/converter/converters/blockquote.js.map +1 -1
  50. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js +7 -3
  51. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -1
  52. package/dist/features/converters/lexicalToJSX/converter/converters/horizontalRule.js +6 -2
  53. package/dist/features/converters/lexicalToJSX/converter/converters/horizontalRule.js.map +1 -1
  54. package/dist/features/converters/lexicalToJSX/converter/converters/linebreak.js +6 -2
  55. package/dist/features/converters/lexicalToJSX/converter/converters/linebreak.js.map +1 -1
  56. package/dist/features/converters/lexicalToJSX/converter/converters/link.js +13 -5
  57. package/dist/features/converters/lexicalToJSX/converter/converters/link.js.map +1 -1
  58. package/dist/features/converters/lexicalToJSX/converter/converters/list.js +38 -14
  59. package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -1
  60. package/dist/features/converters/lexicalToJSX/converter/converters/paragraph.js +18 -6
  61. package/dist/features/converters/lexicalToJSX/converter/converters/paragraph.js.map +1 -1
  62. package/dist/features/converters/lexicalToJSX/converter/converters/table.js +31 -11
  63. package/dist/features/converters/lexicalToJSX/converter/converters/table.js.map +1 -1
  64. package/dist/features/converters/lexicalToJSX/converter/converters/text.js +43 -15
  65. package/dist/features/converters/lexicalToJSX/converter/converters/text.js.map +1 -1
  66. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js +31 -11
  67. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js.map +1 -1
  68. package/dist/features/converters/lexicalToJSX/converter/index.js +8 -4
  69. package/dist/features/converters/lexicalToJSX/converter/index.js.map +1 -1
  70. package/dist/features/debug/jsxConverter/client/plugin/index.js +14 -5
  71. package/dist/features/debug/jsxConverter/client/plugin/index.js.map +1 -1
  72. package/dist/features/debug/jsxConverter/client/plugin/style.scss +12 -0
  73. package/dist/features/debug/testRecorder/client/plugin/index.js +62 -21
  74. package/dist/features/debug/testRecorder/client/plugin/index.js.map +1 -1
  75. package/dist/features/debug/testRecorder/client/plugin/index.scss +53 -0
  76. package/dist/features/debug/treeView/client/plugin/index.js +8 -3
  77. package/dist/features/debug/treeView/client/plugin/index.js.map +1 -1
  78. package/dist/features/debug/treeView/client/plugin/index.scss +80 -0
  79. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js +225 -72
  80. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +1 -1
  81. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.scss +87 -0
  82. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js +32 -11
  83. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +1 -1
  84. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.scss +11 -0
  85. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js +21 -9
  86. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -1
  87. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js +26 -9
  88. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +1 -1
  89. package/dist/features/experimental_table/client/plugins/TablePlugin/index.scss +233 -0
  90. package/dist/features/horizontalRule/client/plugin/index.js +1 -0
  91. package/dist/features/horizontalRule/client/plugin/index.js.map +1 -1
  92. package/dist/features/horizontalRule/client/plugin/index.scss +23 -0
  93. package/dist/features/indent/client/IndentPlugin.js +6 -2
  94. package/dist/features/indent/client/IndentPlugin.js.map +1 -1
  95. package/dist/features/link/client/plugins/autoLink/index.js +3 -0
  96. package/dist/features/link/client/plugins/autoLink/index.js.map +1 -1
  97. package/dist/features/link/client/plugins/clickableLink/index.js +6 -2
  98. package/dist/features/link/client/plugins/clickableLink/index.js.map +1 -1
  99. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +76 -24
  100. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  101. package/dist/features/link/client/plugins/floatingLinkEditor/index.js +8 -3
  102. package/dist/features/link/client/plugins/floatingLinkEditor/index.js.map +1 -1
  103. package/dist/features/link/client/plugins/floatingLinkEditor/index.scss +92 -0
  104. package/dist/features/link/server/baseFields.js +1 -0
  105. package/dist/features/link/server/baseFields.js.map +1 -1
  106. package/dist/features/lists/checklist/client/plugin/index.js +6 -2
  107. package/dist/features/lists/checklist/client/plugin/index.js.map +1 -1
  108. package/dist/features/lists/plugin/index.js +6 -2
  109. package/dist/features/lists/plugin/index.js.map +1 -1
  110. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js +14 -5
  111. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  112. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +7 -3
  113. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  114. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.scss +16 -0
  115. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js +14 -5
  116. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  117. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +7 -3
  118. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  119. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.scss +16 -0
  120. package/dist/features/relationship/client/components/RelationshipComponent.js +56 -19
  121. package/dist/features/relationship/client/components/RelationshipComponent.js.map +1 -1
  122. package/dist/features/relationship/client/components/index.scss +95 -0
  123. package/dist/features/relationship/client/drawer/index.js +18 -6
  124. package/dist/features/relationship/client/drawer/index.js.map +1 -1
  125. package/dist/features/relationship/client/nodes/RelationshipNode.js +7 -3
  126. package/dist/features/relationship/client/nodes/RelationshipNode.js.map +1 -1
  127. package/dist/features/relationship/client/plugins/index.js +7 -3
  128. package/dist/features/relationship/client/plugins/index.js.map +1 -1
  129. package/dist/features/textState/feature.client.js +18 -6
  130. package/dist/features/textState/feature.client.js.map +1 -1
  131. package/dist/features/toolbars/fixed/client/Toolbar/index.js +72 -23
  132. package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
  133. package/dist/features/toolbars/fixed/client/Toolbar/index.scss +113 -0
  134. package/dist/features/toolbars/inline/client/Toolbar/index.js +72 -23
  135. package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
  136. package/dist/features/toolbars/inline/client/Toolbar/index.scss +58 -0
  137. package/dist/features/toolbars/shared/ToolbarButton/index.js +8 -3
  138. package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  139. package/dist/features/toolbars/shared/ToolbarButton/index.scss +46 -0
  140. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +60 -20
  141. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  142. package/dist/features/toolbars/shared/ToolbarDropdown/index.js +37 -12
  143. package/dist/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
  144. package/dist/features/toolbars/shared/ToolbarDropdown/index.scss +129 -0
  145. package/dist/features/upload/client/component/index.js +92 -31
  146. package/dist/features/upload/client/component/index.js.map +1 -1
  147. package/dist/features/upload/client/component/index.scss +191 -0
  148. package/dist/features/upload/client/component/pending/index.js +14 -5
  149. package/dist/features/upload/client/component/pending/index.js.map +1 -1
  150. package/dist/features/upload/client/drawer/index.js +18 -6
  151. package/dist/features/upload/client/drawer/index.js.map +1 -1
  152. package/dist/features/upload/client/nodes/UploadNode.js +12 -4
  153. package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
  154. package/dist/features/upload/client/plugin/index.js +7 -3
  155. package/dist/features/upload/client/plugin/index.js.map +1 -1
  156. package/dist/field/Diff/converters/listitem/index.js +37 -12
  157. package/dist/field/Diff/converters/listitem/index.js.map +1 -1
  158. package/dist/field/Diff/converters/listitem/index.scss +47 -0
  159. package/dist/field/Diff/converters/relationship/index.js +37 -12
  160. package/dist/field/Diff/converters/relationship/index.js.map +1 -1
  161. package/dist/field/Diff/converters/relationship/index.scss +73 -0
  162. package/dist/field/Diff/converters/unknown/index.js +31 -10
  163. package/dist/field/Diff/converters/unknown/index.js.map +1 -1
  164. package/dist/field/Diff/converters/unknown/index.scss +40 -0
  165. package/dist/field/Diff/converters/upload/index.js +60 -19
  166. package/dist/field/Diff/converters/upload/index.js.map +1 -1
  167. package/dist/field/Diff/converters/upload/index.scss +115 -0
  168. package/dist/field/Diff/index.js +8 -3
  169. package/dist/field/Diff/index.js.map +1 -1
  170. package/dist/field/Diff/index.scss +102 -0
  171. package/dist/field/Field.js +81 -27
  172. package/dist/field/Field.js.map +1 -1
  173. package/dist/field/RenderLexical/index.js +36 -12
  174. package/dist/field/RenderLexical/index.js.map +1 -1
  175. package/dist/field/index.js +19 -7
  176. package/dist/field/index.js.map +1 -1
  177. package/dist/field/index.scss +41 -0
  178. package/dist/field/rscEntry.js +7 -3
  179. package/dist/field/rscEntry.js.map +1 -1
  180. package/dist/index.js +2 -0
  181. package/dist/index.js.map +1 -1
  182. package/dist/lexical/EditorPlugin.js +13 -5
  183. package/dist/lexical/EditorPlugin.js.map +1 -1
  184. package/dist/lexical/LexicalEditor.js +163 -50
  185. package/dist/lexical/LexicalEditor.js.map +1 -1
  186. package/dist/lexical/LexicalEditor.scss +54 -0
  187. package/dist/lexical/LexicalProvider.js +49 -17
  188. package/dist/lexical/LexicalProvider.js.map +1 -1
  189. package/dist/lexical/config/client/EditorConfigProvider.js +7 -3
  190. package/dist/lexical/config/client/EditorConfigProvider.js.map +1 -1
  191. package/dist/lexical/plugins/DecoratorPlugin/index.js +1 -0
  192. package/dist/lexical/plugins/DecoratorPlugin/index.js.map +1 -1
  193. package/dist/lexical/plugins/DecoratorPlugin/index.scss +13 -0
  194. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js +20 -7
  195. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
  196. package/dist/lexical/plugins/InsertParagraphAtEnd/index.scss +54 -0
  197. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +2 -0
  198. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  199. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +7 -3
  200. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
  201. package/dist/lexical/plugins/SlashMenu/index.js +50 -16
  202. package/dist/lexical/plugins/SlashMenu/index.js.map +1 -1
  203. package/dist/lexical/plugins/SlashMenu/index.scss +68 -0
  204. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +20 -7
  205. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  206. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.scss +35 -0
  207. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +32 -11
  208. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  209. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.scss +80 -0
  210. package/dist/lexical/theme/EditorTheme.scss +357 -0
  211. package/dist/lexical/ui/ContentEditable.js +14 -5
  212. package/dist/lexical/ui/ContentEditable.js.map +1 -1
  213. package/dist/lexical/ui/ContentEditable.scss +105 -0
  214. package/dist/lexical/ui/icons/AI/index.js +37 -13
  215. package/dist/lexical/ui/icons/AI/index.js.map +1 -1
  216. package/dist/lexical/ui/icons/Add/index.js +19 -7
  217. package/dist/lexical/ui/icons/Add/index.js.map +1 -1
  218. package/dist/lexical/ui/icons/AlignCenter/index.js +25 -9
  219. package/dist/lexical/ui/icons/AlignCenter/index.js.map +1 -1
  220. package/dist/lexical/ui/icons/AlignJustify/index.js +25 -9
  221. package/dist/lexical/ui/icons/AlignJustify/index.js.map +1 -1
  222. package/dist/lexical/ui/icons/AlignLeft/index.js +25 -9
  223. package/dist/lexical/ui/icons/AlignLeft/index.js.map +1 -1
  224. package/dist/lexical/ui/icons/AlignRight/index.js +25 -9
  225. package/dist/lexical/ui/icons/AlignRight/index.js.map +1 -1
  226. package/dist/lexical/ui/icons/Block/index.js +25 -9
  227. package/dist/lexical/ui/icons/Block/index.js.map +1 -1
  228. package/dist/lexical/ui/icons/Blockquote/index.js +13 -5
  229. package/dist/lexical/ui/icons/Blockquote/index.js.map +1 -1
  230. package/dist/lexical/ui/icons/Bold/index.js +13 -5
  231. package/dist/lexical/ui/icons/Bold/index.js.map +1 -1
  232. package/dist/lexical/ui/icons/Checklist/index.js +19 -7
  233. package/dist/lexical/ui/icons/Checklist/index.js.map +1 -1
  234. package/dist/lexical/ui/icons/Code/index.js +19 -7
  235. package/dist/lexical/ui/icons/Code/index.js.map +1 -1
  236. package/dist/lexical/ui/icons/CodeBlock/index.js +13 -5
  237. package/dist/lexical/ui/icons/CodeBlock/index.js.map +1 -1
  238. package/dist/lexical/ui/icons/Collapse/index.js +13 -5
  239. package/dist/lexical/ui/icons/Collapse/index.js.map +1 -1
  240. package/dist/lexical/ui/icons/H1/index.js +13 -5
  241. package/dist/lexical/ui/icons/H1/index.js.map +1 -1
  242. package/dist/lexical/ui/icons/H2/index.js +13 -5
  243. package/dist/lexical/ui/icons/H2/index.js.map +1 -1
  244. package/dist/lexical/ui/icons/H3/index.js +13 -5
  245. package/dist/lexical/ui/icons/H3/index.js.map +1 -1
  246. package/dist/lexical/ui/icons/H4/index.js +13 -5
  247. package/dist/lexical/ui/icons/H4/index.js.map +1 -1
  248. package/dist/lexical/ui/icons/H5/index.js +13 -5
  249. package/dist/lexical/ui/icons/H5/index.js.map +1 -1
  250. package/dist/lexical/ui/icons/H6/index.js +13 -5
  251. package/dist/lexical/ui/icons/H6/index.js.map +1 -1
  252. package/dist/lexical/ui/icons/HorizontalRule/index.js +13 -5
  253. package/dist/lexical/ui/icons/HorizontalRule/index.js.map +1 -1
  254. package/dist/lexical/ui/icons/IndentDecrease/index.js +31 -11
  255. package/dist/lexical/ui/icons/IndentDecrease/index.js.map +1 -1
  256. package/dist/lexical/ui/icons/IndentIncrease/index.js +31 -11
  257. package/dist/lexical/ui/icons/IndentIncrease/index.js.map +1 -1
  258. package/dist/lexical/ui/icons/InlineBlocks/index.js +13 -5
  259. package/dist/lexical/ui/icons/InlineBlocks/index.js.map +1 -1
  260. package/dist/lexical/ui/icons/Italic/index.js +13 -5
  261. package/dist/lexical/ui/icons/Italic/index.js.map +1 -1
  262. package/dist/lexical/ui/icons/Link/index.js +13 -5
  263. package/dist/lexical/ui/icons/Link/index.js.map +1 -1
  264. package/dist/lexical/ui/icons/Meatballs/index.js +25 -9
  265. package/dist/lexical/ui/icons/Meatballs/index.js.map +1 -1
  266. package/dist/lexical/ui/icons/OrderedList/index.js +37 -13
  267. package/dist/lexical/ui/icons/OrderedList/index.js.map +1 -1
  268. package/dist/lexical/ui/icons/Relationship/index.js +37 -13
  269. package/dist/lexical/ui/icons/Relationship/index.js.map +1 -1
  270. package/dist/lexical/ui/icons/Strikethrough/index.js +19 -7
  271. package/dist/lexical/ui/icons/Strikethrough/index.js.map +1 -1
  272. package/dist/lexical/ui/icons/Subscript/index.js +13 -5
  273. package/dist/lexical/ui/icons/Subscript/index.js.map +1 -1
  274. package/dist/lexical/ui/icons/Superscript/index.js +13 -5
  275. package/dist/lexical/ui/icons/Superscript/index.js.map +1 -1
  276. package/dist/lexical/ui/icons/Table/index.js +13 -5
  277. package/dist/lexical/ui/icons/Table/index.js.map +1 -1
  278. package/dist/lexical/ui/icons/Text/index.js +13 -5
  279. package/dist/lexical/ui/icons/Text/index.js.map +1 -1
  280. package/dist/lexical/ui/icons/TextState/index.js +7 -3
  281. package/dist/lexical/ui/icons/TextState/index.js.map +1 -1
  282. package/dist/lexical/ui/icons/Underline/index.js +19 -7
  283. package/dist/lexical/ui/icons/Underline/index.js.map +1 -1
  284. package/dist/lexical/ui/icons/UnorderedList/index.js +43 -15
  285. package/dist/lexical/ui/icons/UnorderedList/index.js.map +1 -1
  286. package/dist/lexical/ui/icons/Upload/index.js +25 -9
  287. package/dist/lexical/ui/icons/Upload/index.js.map +1 -1
  288. package/dist/packages/@lexical/markdown/MarkdownShortcuts.js +2 -0
  289. package/dist/packages/@lexical/markdown/MarkdownShortcuts.js.map +1 -1
  290. package/dist/packages/@lexical/markdown/importTextFormatTransformer.js +2 -0
  291. package/dist/packages/@lexical/markdown/importTextFormatTransformer.js.map +1 -1
  292. package/dist/packages/@lexical/markdown/importTextMatchTransformer.js +2 -0
  293. package/dist/packages/@lexical/markdown/importTextMatchTransformer.js.map +1 -1
  294. package/dist/utilities/fieldsDrawer/Drawer.js +19 -7
  295. package/dist/utilities/fieldsDrawer/Drawer.js.map +1 -1
  296. package/dist/utilities/fieldsDrawer/DrawerContent.js +19 -7
  297. package/dist/utilities/fieldsDrawer/DrawerContent.js.map +1 -1
  298. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js +7 -3
  299. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js.map +1 -1
  300. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.js +7 -3
  301. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.js.map +1 -1
  302. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js +2 -0
  303. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js.map +1 -1
  304. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js +2 -0
  305. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js.map +1 -1
  306. package/package.json +8 -7
@@ -1,9 +1,13 @@
1
1
  'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
3
3
  import { CheckListPlugin } from '@lexical/react/LexicalCheckListPlugin.js';
4
4
  import React from 'react';
5
5
  export const LexicalCheckListPlugin = ()=>{
6
- return /*#__PURE__*/ _jsx(CheckListPlugin, {});
6
+ return /*#__PURE__*/ _jsxDEV(CheckListPlugin, {}, void 0, false, {
7
+ fileName: "src/features/lists/checklist/client/plugin/index.tsx",
8
+ lineNumber: 8,
9
+ columnNumber: 10
10
+ }, this);
7
11
  };
8
12
 
9
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/features/lists/checklist/client/plugin/index.tsx"],"sourcesContent":["'use client'\nimport { CheckListPlugin } from '@lexical/react/LexicalCheckListPlugin.js'\nimport React from 'react'\n\nimport type { PluginComponent } from '../../../../typesClient.js'\n\nexport const LexicalCheckListPlugin: PluginComponent<undefined> = () => {\n return <CheckListPlugin />\n}\n"],"names":["CheckListPlugin","React","LexicalCheckListPlugin"],"mappings":"AAAA;;AACA,SAASA,eAAe,QAAQ,2CAA0C;AAC1E,OAAOC,WAAW,QAAO;AAIzB,OAAO,MAAMC,yBAAqD;IAChE,qBAAO,KAACF;AACV,EAAC"}
1
+ {"version":3,"sources":["../../../../../../src/features/lists/checklist/client/plugin/index.tsx"],"sourcesContent":["'use client'\nimport { CheckListPlugin } from '@lexical/react/LexicalCheckListPlugin.js'\nimport React from 'react'\n\nimport type { PluginComponent } from '../../../../typesClient.js'\n\nexport const LexicalCheckListPlugin: PluginComponent<undefined> = () => {\n return <CheckListPlugin />\n}\n"],"names":["CheckListPlugin","React","LexicalCheckListPlugin"],"mappings":"AAAA;;AACA,SAASA,eAAe,QAAQ,2CAA0C;AAC1E,OAAOC,WAAW,QAAO;AAIzB,OAAO,MAAMC,yBAAqD;IAChE,qBAAO,QAACF;;;;;AACV,EAAC"}
@@ -1,9 +1,13 @@
1
1
  'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
3
3
  import { ListPlugin } from '@lexical/react/LexicalListPlugin.js';
4
4
  import React from 'react';
5
5
  export const LexicalListPlugin = ()=>{
6
- return /*#__PURE__*/ _jsx(ListPlugin, {});
6
+ return /*#__PURE__*/ _jsxDEV(ListPlugin, {}, void 0, false, {
7
+ fileName: "src/features/lists/plugin/index.tsx",
8
+ lineNumber: 23,
9
+ columnNumber: 10
10
+ }, this);
7
11
  };
8
12
 
9
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/features/lists/plugin/index.tsx"],"sourcesContent":["'use client'\nimport type {\n SerializedListItemNode as _SerializedListItemNode,\n SerializedListNode as _SerializedListNode,\n} from '@lexical/list'\nimport type { SerializedLexicalNode } from 'lexical'\n\nimport { ListPlugin } from '@lexical/react/LexicalListPlugin.js'\nimport React from 'react'\n\nimport type { StronglyTypedElementNode } from '../../../nodeTypes.js'\nimport type { PluginComponent } from '../../typesClient.js'\n\nexport type SerializedListItemNode<T extends SerializedLexicalNode = SerializedLexicalNode> = {\n checked?: boolean\n} & StronglyTypedElementNode<_SerializedListItemNode, 'listitem', T>\n\nexport type SerializedListNode<T extends SerializedLexicalNode = SerializedLexicalNode> = {\n checked?: boolean\n} & StronglyTypedElementNode<_SerializedListNode, 'list', T>\n\nexport const LexicalListPlugin: PluginComponent<undefined> = () => {\n return <ListPlugin />\n}\n"],"names":["ListPlugin","React","LexicalListPlugin"],"mappings":"AAAA;;AAOA,SAASA,UAAU,QAAQ,sCAAqC;AAChE,OAAOC,WAAW,QAAO;AAazB,OAAO,MAAMC,oBAAgD;IAC3D,qBAAO,KAACF;AACV,EAAC"}
1
+ {"version":3,"sources":["../../../../src/features/lists/plugin/index.tsx"],"sourcesContent":["'use client'\nimport type {\n SerializedListItemNode as _SerializedListItemNode,\n SerializedListNode as _SerializedListNode,\n} from '@lexical/list'\nimport type { SerializedLexicalNode } from 'lexical'\n\nimport { ListPlugin } from '@lexical/react/LexicalListPlugin.js'\nimport React from 'react'\n\nimport type { StronglyTypedElementNode } from '../../../nodeTypes.js'\nimport type { PluginComponent } from '../../typesClient.js'\n\nexport type SerializedListItemNode<T extends SerializedLexicalNode = SerializedLexicalNode> = {\n checked?: boolean\n} & StronglyTypedElementNode<_SerializedListItemNode, 'listitem', T>\n\nexport type SerializedListNode<T extends SerializedLexicalNode = SerializedLexicalNode> = {\n checked?: boolean\n} & StronglyTypedElementNode<_SerializedListNode, 'list', T>\n\nexport const LexicalListPlugin: PluginComponent<undefined> = () => {\n return <ListPlugin />\n}\n"],"names":["ListPlugin","React","LexicalListPlugin"],"mappings":"AAAA;;AAOA,SAASA,UAAU,QAAQ,sCAAqC;AAChE,OAAOC,WAAW,QAAO;AAazB,OAAO,MAAMC,oBAAgD;IAC3D,qBAAO,QAACF;;;;;AACV,EAAC"}
@@ -1,16 +1,25 @@
1
1
  'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
3
3
  import React from 'react';
4
+ import './index.scss';
4
5
  export const UnknownConvertedNodeComponent = (props)=>{
5
6
  const { data } = props;
6
- return /*#__PURE__*/ _jsxs("div", {
7
+ return /*#__PURE__*/ _jsxDEV("div", {
7
8
  children: [
8
9
  "Unknown converted payload-plugin-lexical node: ",
9
- /*#__PURE__*/ _jsx("strong", {
10
+ /*#__PURE__*/ _jsxDEV("strong", {
10
11
  children: data?.nodeType
11
- })
12
+ }, void 0, false, {
13
+ fileName: "src/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.tsx",
14
+ lineNumber: 17,
15
+ columnNumber: 54
16
+ }, this)
12
17
  ]
13
- });
18
+ }, void 0, true, {
19
+ fileName: "src/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.tsx",
20
+ lineNumber: 16,
21
+ columnNumber: 5
22
+ }, this);
14
23
  };
15
24
 
16
25
  //# sourceMappingURL=Component.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nimport type { UnknownConvertedNodeData } from './index.js'\n\nimport './index.scss'\n\ntype Props = {\n data: UnknownConvertedNodeData\n}\n\nexport const UnknownConvertedNodeComponent: React.FC<Props> = (props) => {\n const { data } = props\n\n return (\n <div>\n Unknown converted payload-plugin-lexical node: <strong>{data?.nodeType}</strong>\n </div>\n )\n}\n"],"names":["React","UnknownConvertedNodeComponent","props","data","div","strong","nodeType"],"mappings":"AAAA;;AACA,OAAOA,WAAW,QAAO;AAUzB,OAAO,MAAMC,gCAAiD,CAACC;IAC7D,MAAM,EAAEC,IAAI,EAAE,GAAGD;IAEjB,qBACE,MAACE;;YAAI;0BAC4C,KAACC;0BAAQF,MAAMG;;;;AAGpE,EAAC"}
1
+ {"version":3,"sources":["../../../../../../src/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nimport type { UnknownConvertedNodeData } from './index.js'\n\nimport './index.scss'\n\ntype Props = {\n data: UnknownConvertedNodeData\n}\n\nexport const UnknownConvertedNodeComponent: React.FC<Props> = (props) => {\n const { data } = props\n\n return (\n <div>\n Unknown converted payload-plugin-lexical node: <strong>{data?.nodeType}</strong>\n </div>\n )\n}\n"],"names":["React","UnknownConvertedNodeComponent","props","data","div","strong","nodeType"],"mappings":"AAAA;;AACA,OAAOA,WAAW,QAAO;AAIzB,OAAO,eAAc;AAMrB,OAAO,MAAMC,gCAAiD,CAACC;IAC7D,MAAM,EAAEC,IAAI,EAAE,GAAGD;IAEjB,qBACE,QAACE;;YAAI;0BAC4C,QAACC;0BAAQF,MAAMG;;;;;;;;;;;;AAGpE,EAAC"}
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
2
2
  import { addClassNamesToElement } from '@lexical/utils';
3
3
  import { $applyNodeReplacement, DecoratorNode } from 'lexical';
4
4
  import * as React from 'react';
@@ -38,9 +38,13 @@ const Component = /*#__PURE__*/ React.lazy(()=>import('./Component.js').then((mo
38
38
  return element;
39
39
  }
40
40
  decorate() {
41
- return /*#__PURE__*/ _jsx(Component, {
41
+ return /*#__PURE__*/ _jsxDEV(Component, {
42
42
  data: this.__data
43
- });
43
+ }, void 0, false, {
44
+ fileName: "src/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.tsx",
45
+ lineNumber: 66,
46
+ columnNumber: 12
47
+ }, this);
44
48
  }
45
49
  exportJSON() {
46
50
  return {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.tsx"],"sourcesContent":["import type { EditorConfig, LexicalNode, NodeKey, SerializedLexicalNode, Spread } from 'lexical'\nimport type { JSX } from 'react'\n\nimport { addClassNamesToElement } from '@lexical/utils'\nimport { $applyNodeReplacement, DecoratorNode } from 'lexical'\nimport * as React from 'react'\n\nexport type UnknownConvertedNodeData = {\n nodeData: unknown\n nodeType: string\n}\n\nexport type SerializedUnknownConvertedNode = Spread<\n {\n data: UnknownConvertedNodeData\n },\n SerializedLexicalNode\n>\n\nconst Component = React.lazy(() =>\n import('./Component.js').then((module) => ({\n default: module.UnknownConvertedNodeComponent,\n })),\n)\n\n/** @noInheritDoc */\nexport class UnknownConvertedNode extends DecoratorNode<JSX.Element> {\n __data: UnknownConvertedNodeData\n\n constructor({ data, key }: { data: UnknownConvertedNodeData; key?: NodeKey }) {\n super(key)\n this.__data = data\n }\n\n static override clone(node: UnknownConvertedNode): UnknownConvertedNode {\n return new this({\n data: node.__data,\n key: node.__key,\n })\n }\n\n static override getType(): string {\n return 'unknownConverted'\n }\n\n static override importJSON(serializedNode: SerializedUnknownConvertedNode): UnknownConvertedNode {\n const node = $createUnknownConvertedNode({ data: serializedNode.data })\n return node\n }\n\n canInsertTextAfter(): true {\n return true\n }\n\n canInsertTextBefore(): true {\n return true\n }\n\n override createDOM(config: EditorConfig): HTMLElement {\n const element = document.createElement('span')\n addClassNamesToElement(element, 'unknownConverted')\n return element\n }\n\n override decorate(): JSX.Element {\n return <Component data={this.__data} />\n }\n\n override exportJSON(): SerializedUnknownConvertedNode {\n return {\n type: this.getType(),\n data: this.__data,\n version: 1,\n }\n }\n\n // Mutation\n\n override isInline(): boolean {\n return true\n }\n\n override updateDOM(prevNode: this, dom: HTMLElement): boolean {\n return false\n }\n}\n\nexport function $createUnknownConvertedNode({\n data,\n}: {\n data: UnknownConvertedNodeData\n}): UnknownConvertedNode {\n return $applyNodeReplacement(\n new UnknownConvertedNode({\n data,\n }),\n )\n}\n\nexport function $isUnknownConvertedNode(\n node: LexicalNode | null | undefined,\n): node is UnknownConvertedNode {\n return node instanceof UnknownConvertedNode\n}\n"],"names":["addClassNamesToElement","$applyNodeReplacement","DecoratorNode","React","Component","lazy","then","module","default","UnknownConvertedNodeComponent","UnknownConvertedNode","__data","constructor","data","key","clone","node","__key","getType","importJSON","serializedNode","$createUnknownConvertedNode","canInsertTextAfter","canInsertTextBefore","createDOM","config","element","document","createElement","decorate","exportJSON","type","version","isInline","updateDOM","prevNode","dom","$isUnknownConvertedNode"],"mappings":";AAGA,SAASA,sBAAsB,QAAQ,iBAAgB;AACvD,SAASC,qBAAqB,EAAEC,aAAa,QAAQ,UAAS;AAC9D,YAAYC,WAAW,QAAO;AAc9B,MAAMC,0BAAYD,MAAME,IAAI,CAAC,IAC3B,MAAM,CAAC,kBAAkBC,IAAI,CAAC,CAACC,SAAY,CAAA;YACzCC,SAASD,OAAOE,6BAA6B;QAC/C,CAAA;AAGF,kBAAkB,GAClB,OAAO,MAAMC,6BAA6BR;IACxCS,OAAgC;IAEhCC,YAAY,EAAEC,IAAI,EAAEC,GAAG,EAAqD,CAAE;QAC5E,KAAK,CAACA;QACN,IAAI,CAACH,MAAM,GAAGE;IAChB;IAEA,OAAgBE,MAAMC,IAA0B,EAAwB;QACtE,OAAO,IAAI,IAAI,CAAC;YACdH,MAAMG,KAAKL,MAAM;YACjBG,KAAKE,KAAKC,KAAK;QACjB;IACF;IAEA,OAAgBC,UAAkB;QAChC,OAAO;IACT;IAEA,OAAgBC,WAAWC,cAA8C,EAAwB;QAC/F,MAAMJ,OAAOK,4BAA4B;YAAER,MAAMO,eAAeP,IAAI;QAAC;QACrE,OAAOG;IACT;IAEAM,qBAA2B;QACzB,OAAO;IACT;IAEAC,sBAA4B;QAC1B,OAAO;IACT;IAESC,UAAUC,MAAoB,EAAe;QACpD,MAAMC,UAAUC,SAASC,aAAa,CAAC;QACvC5B,uBAAuB0B,SAAS;QAChC,OAAOA;IACT;IAESG,WAAwB;QAC/B,qBAAO,KAACzB;YAAUS,MAAM,IAAI,CAACF,MAAM;;IACrC;IAESmB,aAA6C;QACpD,OAAO;YACLC,MAAM,IAAI,CAACb,OAAO;YAClBL,MAAM,IAAI,CAACF,MAAM;YACjBqB,SAAS;QACX;IACF;IAEA,WAAW;IAEFC,WAAoB;QAC3B,OAAO;IACT;IAESC,UAAUC,QAAc,EAAEC,GAAgB,EAAW;QAC5D,OAAO;IACT;AACF;AAEA,OAAO,SAASf,4BAA4B,EAC1CR,IAAI,EAGL;IACC,OAAOZ,sBACL,IAAIS,qBAAqB;QACvBG;IACF;AAEJ;AAEA,OAAO,SAASwB,wBACdrB,IAAoC;IAEpC,OAAOA,gBAAgBN;AACzB"}
1
+ {"version":3,"sources":["../../../../../../src/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.tsx"],"sourcesContent":["import type { EditorConfig, LexicalNode, NodeKey, SerializedLexicalNode, Spread } from 'lexical'\nimport type { JSX } from 'react'\n\nimport { addClassNamesToElement } from '@lexical/utils'\nimport { $applyNodeReplacement, DecoratorNode } from 'lexical'\nimport * as React from 'react'\n\nexport type UnknownConvertedNodeData = {\n nodeData: unknown\n nodeType: string\n}\n\nexport type SerializedUnknownConvertedNode = Spread<\n {\n data: UnknownConvertedNodeData\n },\n SerializedLexicalNode\n>\n\nconst Component = React.lazy(() =>\n import('./Component.js').then((module) => ({\n default: module.UnknownConvertedNodeComponent,\n })),\n)\n\n/** @noInheritDoc */\nexport class UnknownConvertedNode extends DecoratorNode<JSX.Element> {\n __data: UnknownConvertedNodeData\n\n constructor({ data, key }: { data: UnknownConvertedNodeData; key?: NodeKey }) {\n super(key)\n this.__data = data\n }\n\n static override clone(node: UnknownConvertedNode): UnknownConvertedNode {\n return new this({\n data: node.__data,\n key: node.__key,\n })\n }\n\n static override getType(): string {\n return 'unknownConverted'\n }\n\n static override importJSON(serializedNode: SerializedUnknownConvertedNode): UnknownConvertedNode {\n const node = $createUnknownConvertedNode({ data: serializedNode.data })\n return node\n }\n\n canInsertTextAfter(): true {\n return true\n }\n\n canInsertTextBefore(): true {\n return true\n }\n\n override createDOM(config: EditorConfig): HTMLElement {\n const element = document.createElement('span')\n addClassNamesToElement(element, 'unknownConverted')\n return element\n }\n\n override decorate(): JSX.Element {\n return <Component data={this.__data} />\n }\n\n override exportJSON(): SerializedUnknownConvertedNode {\n return {\n type: this.getType(),\n data: this.__data,\n version: 1,\n }\n }\n\n // Mutation\n\n override isInline(): boolean {\n return true\n }\n\n override updateDOM(prevNode: this, dom: HTMLElement): boolean {\n return false\n }\n}\n\nexport function $createUnknownConvertedNode({\n data,\n}: {\n data: UnknownConvertedNodeData\n}): UnknownConvertedNode {\n return $applyNodeReplacement(\n new UnknownConvertedNode({\n data,\n }),\n )\n}\n\nexport function $isUnknownConvertedNode(\n node: LexicalNode | null | undefined,\n): node is UnknownConvertedNode {\n return node instanceof UnknownConvertedNode\n}\n"],"names":["addClassNamesToElement","$applyNodeReplacement","DecoratorNode","React","Component","lazy","then","module","default","UnknownConvertedNodeComponent","UnknownConvertedNode","__data","constructor","data","key","clone","node","__key","getType","importJSON","serializedNode","$createUnknownConvertedNode","canInsertTextAfter","canInsertTextBefore","createDOM","config","element","document","createElement","decorate","exportJSON","type","version","isInline","updateDOM","prevNode","dom","$isUnknownConvertedNode"],"mappings":";AAGA,SAASA,sBAAsB,QAAQ,iBAAgB;AACvD,SAASC,qBAAqB,EAAEC,aAAa,QAAQ,UAAS;AAC9D,YAAYC,WAAW,QAAO;AAc9B,MAAMC,0BAAYD,MAAME,IAAI,CAAC,IAC3B,MAAM,CAAC,kBAAkBC,IAAI,CAAC,CAACC,SAAY,CAAA;YACzCC,SAASD,OAAOE,6BAA6B;QAC/C,CAAA;AAGF,kBAAkB,GAClB,OAAO,MAAMC,6BAA6BR;IACxCS,OAAgC;IAEhCC,YAAY,EAAEC,IAAI,EAAEC,GAAG,EAAqD,CAAE;QAC5E,KAAK,CAACA;QACN,IAAI,CAACH,MAAM,GAAGE;IAChB;IAEA,OAAgBE,MAAMC,IAA0B,EAAwB;QACtE,OAAO,IAAI,IAAI,CAAC;YACdH,MAAMG,KAAKL,MAAM;YACjBG,KAAKE,KAAKC,KAAK;QACjB;IACF;IAEA,OAAgBC,UAAkB;QAChC,OAAO;IACT;IAEA,OAAgBC,WAAWC,cAA8C,EAAwB;QAC/F,MAAMJ,OAAOK,4BAA4B;YAAER,MAAMO,eAAeP,IAAI;QAAC;QACrE,OAAOG;IACT;IAEAM,qBAA2B;QACzB,OAAO;IACT;IAEAC,sBAA4B;QAC1B,OAAO;IACT;IAESC,UAAUC,MAAoB,EAAe;QACpD,MAAMC,UAAUC,SAASC,aAAa,CAAC;QACvC5B,uBAAuB0B,SAAS;QAChC,OAAOA;IACT;IAESG,WAAwB;QAC/B,qBAAO,QAACzB;YAAUS,MAAM,IAAI,CAACF,MAAM;;;;;;IACrC;IAESmB,aAA6C;QACpD,OAAO;YACLC,MAAM,IAAI,CAACb,OAAO;YAClBL,MAAM,IAAI,CAACF,MAAM;YACjBqB,SAAS;QACX;IACF;IAEA,WAAW;IAEFC,WAAoB;QAC3B,OAAO;IACT;IAESC,UAAUC,QAAc,EAAEC,GAAgB,EAAW;QAC5D,OAAO;IACT;AACF;AAEA,OAAO,SAASf,4BAA4B,EAC1CR,IAAI,EAGL;IACC,OAAOZ,sBACL,IAAIS,qBAAqB;QACvBG;IACF;AAEJ;AAEA,OAAO,SAASwB,wBACdrB,IAAoC;IAEpC,OAAOA,gBAAgBN;AACzB"}
@@ -0,0 +1,16 @@
1
+ @layer payload-default {
2
+ span.unknownConverted {
3
+ text-transform: uppercase;
4
+ font-family: 'Roboto Mono', monospace;
5
+ letter-spacing: 2px;
6
+ font-size: calc(var(--base) * 0.5);
7
+ margin: 0 0 var(--base);
8
+ background: red;
9
+ color: white;
10
+ display: inline-block;
11
+
12
+ div {
13
+ background: red;
14
+ }
15
+ }
16
+ }
@@ -1,16 +1,25 @@
1
1
  'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
3
3
  import React from 'react';
4
+ import './index.scss';
4
5
  export const UnknownConvertedNodeComponent = (props)=>{
5
6
  const { data } = props;
6
- return /*#__PURE__*/ _jsxs("div", {
7
+ return /*#__PURE__*/ _jsxDEV("div", {
7
8
  children: [
8
9
  "Unknown converted Slate node: ",
9
- /*#__PURE__*/ _jsx("strong", {
10
+ /*#__PURE__*/ _jsxDEV("strong", {
10
11
  children: data?.nodeType
11
- })
12
+ }, void 0, false, {
13
+ fileName: "src/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.tsx",
14
+ lineNumber: 17,
15
+ columnNumber: 37
16
+ }, this)
12
17
  ]
13
- });
18
+ }, void 0, true, {
19
+ fileName: "src/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.tsx",
20
+ lineNumber: 16,
21
+ columnNumber: 5
22
+ }, this);
14
23
  };
15
24
 
16
25
  //# sourceMappingURL=Component.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nimport type { UnknownConvertedNodeData } from './index.js'\n\nimport './index.scss'\n\ntype Props = {\n data: UnknownConvertedNodeData\n}\n\nexport const UnknownConvertedNodeComponent: React.FC<Props> = (props) => {\n const { data } = props\n\n return (\n <div>\n Unknown converted Slate node: <strong>{data?.nodeType}</strong>\n </div>\n )\n}\n"],"names":["React","UnknownConvertedNodeComponent","props","data","div","strong","nodeType"],"mappings":"AAAA;;AACA,OAAOA,WAAW,QAAO;AAUzB,OAAO,MAAMC,gCAAiD,CAACC;IAC7D,MAAM,EAAEC,IAAI,EAAE,GAAGD;IAEjB,qBACE,MAACE;;YAAI;0BAC2B,KAACC;0BAAQF,MAAMG;;;;AAGnD,EAAC"}
1
+ {"version":3,"sources":["../../../../../../src/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nimport type { UnknownConvertedNodeData } from './index.js'\n\nimport './index.scss'\n\ntype Props = {\n data: UnknownConvertedNodeData\n}\n\nexport const UnknownConvertedNodeComponent: React.FC<Props> = (props) => {\n const { data } = props\n\n return (\n <div>\n Unknown converted Slate node: <strong>{data?.nodeType}</strong>\n </div>\n )\n}\n"],"names":["React","UnknownConvertedNodeComponent","props","data","div","strong","nodeType"],"mappings":"AAAA;;AACA,OAAOA,WAAW,QAAO;AAIzB,OAAO,eAAc;AAMrB,OAAO,MAAMC,gCAAiD,CAACC;IAC7D,MAAM,EAAEC,IAAI,EAAE,GAAGD;IAEjB,qBACE,QAACE;;YAAI;0BAC2B,QAACC;0BAAQF,MAAMG;;;;;;;;;;;;AAGnD,EAAC"}
@@ -1,4 +1,4 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
1
+ import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
2
2
  import { addClassNamesToElement } from '@lexical/utils';
3
3
  import { $applyNodeReplacement, DecoratorNode } from 'lexical';
4
4
  import * as React from 'react';
@@ -38,9 +38,13 @@ const Component = /*#__PURE__*/ React.lazy(()=>import('./Component.js').then((mo
38
38
  return element;
39
39
  }
40
40
  decorate() {
41
- return /*#__PURE__*/ _jsx(Component, {
41
+ return /*#__PURE__*/ _jsxDEV(Component, {
42
42
  data: this.__data
43
- });
43
+ }, void 0, false, {
44
+ fileName: "src/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.tsx",
45
+ lineNumber: 66,
46
+ columnNumber: 12
47
+ }, this);
44
48
  }
45
49
  exportJSON() {
46
50
  return {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.tsx"],"sourcesContent":["import type { EditorConfig, LexicalNode, NodeKey, SerializedLexicalNode, Spread } from 'lexical'\nimport type { JSX } from 'react'\n\nimport { addClassNamesToElement } from '@lexical/utils'\nimport { $applyNodeReplacement, DecoratorNode } from 'lexical'\nimport * as React from 'react'\n\nexport type UnknownConvertedNodeData = {\n nodeData: unknown\n nodeType: string\n}\n\nexport type SerializedUnknownConvertedNode = Spread<\n {\n data: UnknownConvertedNodeData\n },\n SerializedLexicalNode\n>\n\nconst Component = React.lazy(() =>\n import('./Component.js').then((module) => ({\n default: module.UnknownConvertedNodeComponent,\n })),\n)\n\n/** @noInheritDoc */\nexport class UnknownConvertedNode extends DecoratorNode<JSX.Element> {\n __data: UnknownConvertedNodeData\n\n constructor({ data, key }: { data: UnknownConvertedNodeData; key?: NodeKey }) {\n super(key)\n this.__data = data\n }\n\n static override clone(node: UnknownConvertedNode): UnknownConvertedNode {\n return new this({\n data: node.__data,\n key: node.__key,\n })\n }\n\n static override getType(): string {\n return 'unknownConverted'\n }\n\n static override importJSON(serializedNode: SerializedUnknownConvertedNode): UnknownConvertedNode {\n const node = $createUnknownConvertedNode({ data: serializedNode.data })\n return node\n }\n\n canInsertTextAfter(): true {\n return true\n }\n\n canInsertTextBefore(): true {\n return true\n }\n\n override createDOM(config: EditorConfig): HTMLElement {\n const element = document.createElement('span')\n addClassNamesToElement(element, 'unknownConverted')\n return element\n }\n\n override decorate(): JSX.Element {\n return <Component data={this.__data} />\n }\n\n override exportJSON(): SerializedUnknownConvertedNode {\n return {\n type: this.getType(),\n data: this.__data,\n version: 1,\n }\n }\n\n // Mutation\n\n override isInline(): boolean {\n return true\n }\n\n override updateDOM(prevNode: this, dom: HTMLElement): boolean {\n return false\n }\n}\n\nexport function $createUnknownConvertedNode({\n data,\n}: {\n data: UnknownConvertedNodeData\n}): UnknownConvertedNode {\n return $applyNodeReplacement(\n new UnknownConvertedNode({\n data,\n }),\n )\n}\n\nexport function $isUnknownConvertedNode(\n node: LexicalNode | null | undefined,\n): node is UnknownConvertedNode {\n return node instanceof UnknownConvertedNode\n}\n"],"names":["addClassNamesToElement","$applyNodeReplacement","DecoratorNode","React","Component","lazy","then","module","default","UnknownConvertedNodeComponent","UnknownConvertedNode","__data","constructor","data","key","clone","node","__key","getType","importJSON","serializedNode","$createUnknownConvertedNode","canInsertTextAfter","canInsertTextBefore","createDOM","config","element","document","createElement","decorate","exportJSON","type","version","isInline","updateDOM","prevNode","dom","$isUnknownConvertedNode"],"mappings":";AAGA,SAASA,sBAAsB,QAAQ,iBAAgB;AACvD,SAASC,qBAAqB,EAAEC,aAAa,QAAQ,UAAS;AAC9D,YAAYC,WAAW,QAAO;AAc9B,MAAMC,0BAAYD,MAAME,IAAI,CAAC,IAC3B,MAAM,CAAC,kBAAkBC,IAAI,CAAC,CAACC,SAAY,CAAA;YACzCC,SAASD,OAAOE,6BAA6B;QAC/C,CAAA;AAGF,kBAAkB,GAClB,OAAO,MAAMC,6BAA6BR;IACxCS,OAAgC;IAEhCC,YAAY,EAAEC,IAAI,EAAEC,GAAG,EAAqD,CAAE;QAC5E,KAAK,CAACA;QACN,IAAI,CAACH,MAAM,GAAGE;IAChB;IAEA,OAAgBE,MAAMC,IAA0B,EAAwB;QACtE,OAAO,IAAI,IAAI,CAAC;YACdH,MAAMG,KAAKL,MAAM;YACjBG,KAAKE,KAAKC,KAAK;QACjB;IACF;IAEA,OAAgBC,UAAkB;QAChC,OAAO;IACT;IAEA,OAAgBC,WAAWC,cAA8C,EAAwB;QAC/F,MAAMJ,OAAOK,4BAA4B;YAAER,MAAMO,eAAeP,IAAI;QAAC;QACrE,OAAOG;IACT;IAEAM,qBAA2B;QACzB,OAAO;IACT;IAEAC,sBAA4B;QAC1B,OAAO;IACT;IAESC,UAAUC,MAAoB,EAAe;QACpD,MAAMC,UAAUC,SAASC,aAAa,CAAC;QACvC5B,uBAAuB0B,SAAS;QAChC,OAAOA;IACT;IAESG,WAAwB;QAC/B,qBAAO,KAACzB;YAAUS,MAAM,IAAI,CAACF,MAAM;;IACrC;IAESmB,aAA6C;QACpD,OAAO;YACLC,MAAM,IAAI,CAACb,OAAO;YAClBL,MAAM,IAAI,CAACF,MAAM;YACjBqB,SAAS;QACX;IACF;IAEA,WAAW;IAEFC,WAAoB;QAC3B,OAAO;IACT;IAESC,UAAUC,QAAc,EAAEC,GAAgB,EAAW;QAC5D,OAAO;IACT;AACF;AAEA,OAAO,SAASf,4BAA4B,EAC1CR,IAAI,EAGL;IACC,OAAOZ,sBACL,IAAIS,qBAAqB;QACvBG;IACF;AAEJ;AAEA,OAAO,SAASwB,wBACdrB,IAAoC;IAEpC,OAAOA,gBAAgBN;AACzB"}
1
+ {"version":3,"sources":["../../../../../../src/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.tsx"],"sourcesContent":["import type { EditorConfig, LexicalNode, NodeKey, SerializedLexicalNode, Spread } from 'lexical'\nimport type { JSX } from 'react'\n\nimport { addClassNamesToElement } from '@lexical/utils'\nimport { $applyNodeReplacement, DecoratorNode } from 'lexical'\nimport * as React from 'react'\n\nexport type UnknownConvertedNodeData = {\n nodeData: unknown\n nodeType: string\n}\n\nexport type SerializedUnknownConvertedNode = Spread<\n {\n data: UnknownConvertedNodeData\n },\n SerializedLexicalNode\n>\n\nconst Component = React.lazy(() =>\n import('./Component.js').then((module) => ({\n default: module.UnknownConvertedNodeComponent,\n })),\n)\n\n/** @noInheritDoc */\nexport class UnknownConvertedNode extends DecoratorNode<JSX.Element> {\n __data: UnknownConvertedNodeData\n\n constructor({ data, key }: { data: UnknownConvertedNodeData; key?: NodeKey }) {\n super(key)\n this.__data = data\n }\n\n static override clone(node: UnknownConvertedNode): UnknownConvertedNode {\n return new this({\n data: node.__data,\n key: node.__key,\n })\n }\n\n static override getType(): string {\n return 'unknownConverted'\n }\n\n static override importJSON(serializedNode: SerializedUnknownConvertedNode): UnknownConvertedNode {\n const node = $createUnknownConvertedNode({ data: serializedNode.data })\n return node\n }\n\n canInsertTextAfter(): true {\n return true\n }\n\n canInsertTextBefore(): true {\n return true\n }\n\n override createDOM(config: EditorConfig): HTMLElement {\n const element = document.createElement('span')\n addClassNamesToElement(element, 'unknownConverted')\n return element\n }\n\n override decorate(): JSX.Element {\n return <Component data={this.__data} />\n }\n\n override exportJSON(): SerializedUnknownConvertedNode {\n return {\n type: this.getType(),\n data: this.__data,\n version: 1,\n }\n }\n\n // Mutation\n\n override isInline(): boolean {\n return true\n }\n\n override updateDOM(prevNode: this, dom: HTMLElement): boolean {\n return false\n }\n}\n\nexport function $createUnknownConvertedNode({\n data,\n}: {\n data: UnknownConvertedNodeData\n}): UnknownConvertedNode {\n return $applyNodeReplacement(\n new UnknownConvertedNode({\n data,\n }),\n )\n}\n\nexport function $isUnknownConvertedNode(\n node: LexicalNode | null | undefined,\n): node is UnknownConvertedNode {\n return node instanceof UnknownConvertedNode\n}\n"],"names":["addClassNamesToElement","$applyNodeReplacement","DecoratorNode","React","Component","lazy","then","module","default","UnknownConvertedNodeComponent","UnknownConvertedNode","__data","constructor","data","key","clone","node","__key","getType","importJSON","serializedNode","$createUnknownConvertedNode","canInsertTextAfter","canInsertTextBefore","createDOM","config","element","document","createElement","decorate","exportJSON","type","version","isInline","updateDOM","prevNode","dom","$isUnknownConvertedNode"],"mappings":";AAGA,SAASA,sBAAsB,QAAQ,iBAAgB;AACvD,SAASC,qBAAqB,EAAEC,aAAa,QAAQ,UAAS;AAC9D,YAAYC,WAAW,QAAO;AAc9B,MAAMC,0BAAYD,MAAME,IAAI,CAAC,IAC3B,MAAM,CAAC,kBAAkBC,IAAI,CAAC,CAACC,SAAY,CAAA;YACzCC,SAASD,OAAOE,6BAA6B;QAC/C,CAAA;AAGF,kBAAkB,GAClB,OAAO,MAAMC,6BAA6BR;IACxCS,OAAgC;IAEhCC,YAAY,EAAEC,IAAI,EAAEC,GAAG,EAAqD,CAAE;QAC5E,KAAK,CAACA;QACN,IAAI,CAACH,MAAM,GAAGE;IAChB;IAEA,OAAgBE,MAAMC,IAA0B,EAAwB;QACtE,OAAO,IAAI,IAAI,CAAC;YACdH,MAAMG,KAAKL,MAAM;YACjBG,KAAKE,KAAKC,KAAK;QACjB;IACF;IAEA,OAAgBC,UAAkB;QAChC,OAAO;IACT;IAEA,OAAgBC,WAAWC,cAA8C,EAAwB;QAC/F,MAAMJ,OAAOK,4BAA4B;YAAER,MAAMO,eAAeP,IAAI;QAAC;QACrE,OAAOG;IACT;IAEAM,qBAA2B;QACzB,OAAO;IACT;IAEAC,sBAA4B;QAC1B,OAAO;IACT;IAESC,UAAUC,MAAoB,EAAe;QACpD,MAAMC,UAAUC,SAASC,aAAa,CAAC;QACvC5B,uBAAuB0B,SAAS;QAChC,OAAOA;IACT;IAESG,WAAwB;QAC/B,qBAAO,QAACzB;YAAUS,MAAM,IAAI,CAACF,MAAM;;;;;;IACrC;IAESmB,aAA6C;QACpD,OAAO;YACLC,MAAM,IAAI,CAACb,OAAO;YAClBL,MAAM,IAAI,CAACF,MAAM;YACjBqB,SAAS;QACX;IACF;IAEA,WAAW;IAEFC,WAAoB;QAC3B,OAAO;IACT;IAESC,UAAUC,QAAc,EAAEC,GAAgB,EAAW;QAC5D,OAAO;IACT;AACF;AAEA,OAAO,SAASf,4BAA4B,EAC1CR,IAAI,EAGL;IACC,OAAOZ,sBACL,IAAIS,qBAAqB;QACvBG;IACF;AAEJ;AAEA,OAAO,SAASwB,wBACdrB,IAAoC;IAEpC,OAAOA,gBAAgBN;AACzB"}
@@ -0,0 +1,16 @@
1
+ @layer payload-default {
2
+ span.unknownConverted {
3
+ text-transform: uppercase;
4
+ font-family: 'Roboto Mono', monospace;
5
+ letter-spacing: 2px;
6
+ font-size: calc(var(--base) * 0.5);
7
+ margin: 0 0 var(--base);
8
+ background: red;
9
+ color: white;
10
+ display: inline-block;
11
+
12
+ div {
13
+ background: red;
14
+ }
15
+ }
16
+ }
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
3
3
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js';
4
4
  import { useLexicalEditable } from '@lexical/react/useLexicalEditable';
5
5
  import { getTranslation } from '@payloadcms/translations';
@@ -7,6 +7,7 @@ import { Button, useConfig, usePayloadAPI, useTranslation } from '@payloadcms/ui
7
7
  import { $getNodeByKey } from 'lexical';
8
8
  import React, { useCallback, useReducer, useRef, useState } from 'react';
9
9
  import { useLexicalDocumentDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDocumentDrawer.js';
10
+ import './index.scss';
10
11
  import { INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND } from '../drawer/commands.js';
11
12
  const initialParams = {
12
13
  depth: 0
@@ -53,33 +54,49 @@ export const RelationshipComponent = (props)=>{
53
54
  setParams,
54
55
  closeDocumentDrawer
55
56
  ]);
56
- return /*#__PURE__*/ _jsxs("div", {
57
+ return /*#__PURE__*/ _jsxDEV("div", {
57
58
  className: `${baseClass}__contents`,
58
59
  contentEditable: false,
59
60
  ref: relationshipElemRef,
60
61
  children: [
61
- /*#__PURE__*/ _jsxs("div", {
62
+ /*#__PURE__*/ _jsxDEV("div", {
62
63
  className: `${baseClass}__wrap`,
63
64
  children: [
64
- /*#__PURE__*/ _jsx("p", {
65
+ /*#__PURE__*/ _jsxDEV("p", {
65
66
  className: `${baseClass}__label`,
66
67
  children: t('fields:labelRelationship', {
67
68
  label: relatedCollection.labels?.singular ? getTranslation(relatedCollection.labels?.singular, i18n) : relatedCollection.slug
68
69
  })
69
- }),
70
- /*#__PURE__*/ _jsx(DocumentDrawerToggler, {
70
+ }, void 0, false, {
71
+ fileName: "src/features/relationship/client/components/RelationshipComponent.tsx",
72
+ lineNumber: 86,
73
+ columnNumber: 9
74
+ }, this),
75
+ /*#__PURE__*/ _jsxDEV(DocumentDrawerToggler, {
71
76
  className: `${baseClass}__doc-drawer-toggler`,
72
- children: /*#__PURE__*/ _jsx("p", {
77
+ children: /*#__PURE__*/ _jsxDEV("p", {
73
78
  className: `${baseClass}__title`,
74
79
  children: data ? data[relatedCollection?.admin?.useAsTitle || 'id'] : value
75
- })
76
- })
80
+ }, void 0, false, {
81
+ fileName: "src/features/relationship/client/components/RelationshipComponent.tsx",
82
+ lineNumber: 94,
83
+ columnNumber: 11
84
+ }, this)
85
+ }, void 0, false, {
86
+ fileName: "src/features/relationship/client/components/RelationshipComponent.tsx",
87
+ lineNumber: 93,
88
+ columnNumber: 9
89
+ }, this)
77
90
  ]
78
- }),
79
- isEditable && /*#__PURE__*/ _jsxs("div", {
91
+ }, void 0, true, {
92
+ fileName: "src/features/relationship/client/components/RelationshipComponent.tsx",
93
+ lineNumber: 85,
94
+ columnNumber: 7
95
+ }, this),
96
+ isEditable && /*#__PURE__*/ _jsxDEV("div", {
80
97
  className: `${baseClass}__actions`,
81
98
  children: [
82
- /*#__PURE__*/ _jsx(Button, {
99
+ /*#__PURE__*/ _jsxDEV(Button, {
83
100
  buttonStyle: "icon-label",
84
101
  className: `${baseClass}__swapButton`,
85
102
  disabled: !isEditable,
@@ -96,8 +113,12 @@ export const RelationshipComponent = (props)=>{
96
113
  },
97
114
  round: true,
98
115
  tooltip: t('fields:swapRelationship')
99
- }),
100
- /*#__PURE__*/ _jsx(Button, {
116
+ }, void 0, false, {
117
+ fileName: "src/features/relationship/client/components/RelationshipComponent.tsx",
118
+ lineNumber: 101,
119
+ columnNumber: 11
120
+ }, this),
121
+ /*#__PURE__*/ _jsxDEV(Button, {
101
122
  buttonStyle: "icon-label",
102
123
  className: `${baseClass}__removeButton`,
103
124
  disabled: !isEditable,
@@ -108,14 +129,30 @@ export const RelationshipComponent = (props)=>{
108
129
  },
109
130
  round: true,
110
131
  tooltip: t('fields:removeRelationship')
111
- })
132
+ }, void 0, false, {
133
+ fileName: "src/features/relationship/client/components/RelationshipComponent.tsx",
134
+ lineNumber: 117,
135
+ columnNumber: 11
136
+ }, this)
112
137
  ]
113
- }),
114
- !!value && /*#__PURE__*/ _jsx(DocumentDrawer, {
138
+ }, void 0, true, {
139
+ fileName: "src/features/relationship/client/components/RelationshipComponent.tsx",
140
+ lineNumber: 100,
141
+ columnNumber: 9
142
+ }, this),
143
+ !!value && /*#__PURE__*/ _jsxDEV(DocumentDrawer, {
115
144
  onSave: updateRelationship
116
- })
145
+ }, void 0, false, {
146
+ fileName: "src/features/relationship/client/components/RelationshipComponent.tsx",
147
+ lineNumber: 132,
148
+ columnNumber: 19
149
+ }, this)
117
150
  ]
118
- });
151
+ }, void 0, true, {
152
+ fileName: "src/features/relationship/client/components/RelationshipComponent.tsx",
153
+ lineNumber: 84,
154
+ columnNumber: 5
155
+ }, this);
119
156
  };
120
157
 
121
158
  //# sourceMappingURL=RelationshipComponent.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/features/relationship/client/components/RelationshipComponent.tsx"],"sourcesContent":["'use client'\nimport type { ElementFormatType } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable'\nimport { getTranslation } from '@payloadcms/translations'\nimport { Button, useConfig, usePayloadAPI, useTranslation } from '@payloadcms/ui'\nimport { $getNodeByKey } from 'lexical'\nimport React, { useCallback, useReducer, useRef, useState } from 'react'\n\nimport type { RelationshipData } from '../../server/nodes/RelationshipNode.js'\n\nimport { useLexicalDocumentDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDocumentDrawer.js'\nimport './index.scss'\nimport { INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND } from '../drawer/commands.js'\n\nconst initialParams = {\n depth: 0,\n}\n\ntype Props = {\n className: string\n data: RelationshipData\n format?: ElementFormatType\n nodeKey?: string\n}\n\nexport const RelationshipComponent: React.FC<Props> = (props) => {\n const {\n className: baseClass,\n data: { relationTo, value },\n nodeKey,\n } = props\n\n if (typeof value === 'object') {\n throw new Error(\n 'Relationship value should be a string or number. The Lexical Relationship component should not receive the populated value object.',\n )\n }\n\n const relationshipElemRef = useRef<HTMLDivElement | null>(null)\n\n const [editor] = useLexicalComposerContext()\n const isEditable = useLexicalEditable()\n const {\n config: {\n routes: { api },\n serverURL,\n },\n getEntityConfig,\n } = useConfig()\n\n const [relatedCollection] = useState(() => getEntityConfig({ collectionSlug: relationTo }))\n\n const { i18n, t } = useTranslation()\n const [cacheBust, dispatchCacheBust] = useReducer((state) => state + 1, 0)\n const [{ data }, { setParams }] = usePayloadAPI(\n `${serverURL}${api}/${relatedCollection.slug}/${value}`,\n { initialParams },\n )\n\n const { closeDocumentDrawer, DocumentDrawer, DocumentDrawerToggler } = useLexicalDocumentDrawer({\n id: value,\n collectionSlug: relatedCollection.slug,\n })\n\n const removeRelationship = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey!)?.remove()\n })\n }, [editor, nodeKey])\n\n const updateRelationship = React.useCallback(() => {\n setParams({\n ...initialParams,\n cacheBust, // do this to get the usePayloadAPI to re-fetch the data even though the URL string hasn't changed\n })\n\n closeDocumentDrawer()\n dispatchCacheBust()\n }, [cacheBust, setParams, closeDocumentDrawer])\n\n return (\n <div className={`${baseClass}__contents`} contentEditable={false} ref={relationshipElemRef}>\n <div className={`${baseClass}__wrap`}>\n <p className={`${baseClass}__label`}>\n {t('fields:labelRelationship', {\n label: relatedCollection.labels?.singular\n ? getTranslation(relatedCollection.labels?.singular, i18n)\n : relatedCollection.slug,\n })}\n </p>\n <DocumentDrawerToggler className={`${baseClass}__doc-drawer-toggler`}>\n <p className={`${baseClass}__title`}>\n {data ? data[relatedCollection?.admin?.useAsTitle || 'id'] : value}\n </p>\n </DocumentDrawerToggler>\n </div>\n {isEditable && (\n <div className={`${baseClass}__actions`}>\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__swapButton`}\n disabled={!isEditable}\n el=\"button\"\n icon=\"swap\"\n onClick={() => {\n if (nodeKey) {\n editor.dispatchCommand(INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND, {\n replace: { nodeKey },\n })\n }\n }}\n round\n tooltip={t('fields:swapRelationship')}\n />\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__removeButton`}\n disabled={!isEditable}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n removeRelationship()\n }}\n round\n tooltip={t('fields:removeRelationship')}\n />\n </div>\n )}\n\n {!!value && <DocumentDrawer onSave={updateRelationship} />}\n </div>\n )\n}\n"],"names":["useLexicalComposerContext","useLexicalEditable","getTranslation","Button","useConfig","usePayloadAPI","useTranslation","$getNodeByKey","React","useCallback","useReducer","useRef","useState","useLexicalDocumentDrawer","INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND","initialParams","depth","RelationshipComponent","props","className","baseClass","data","relationTo","value","nodeKey","Error","relationshipElemRef","editor","isEditable","config","routes","api","serverURL","getEntityConfig","relatedCollection","collectionSlug","i18n","t","cacheBust","dispatchCacheBust","state","setParams","slug","closeDocumentDrawer","DocumentDrawer","DocumentDrawerToggler","id","removeRelationship","update","remove","updateRelationship","div","contentEditable","ref","p","label","labels","singular","admin","useAsTitle","buttonStyle","disabled","el","icon","onClick","dispatchCommand","replace","round","tooltip","e","preventDefault","onSave"],"mappings":"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"}
1
+ {"version":3,"sources":["../../../../../src/features/relationship/client/components/RelationshipComponent.tsx"],"sourcesContent":["'use client'\nimport type { ElementFormatType } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable'\nimport { getTranslation } from '@payloadcms/translations'\nimport { Button, useConfig, usePayloadAPI, useTranslation } from '@payloadcms/ui'\nimport { $getNodeByKey } from 'lexical'\nimport React, { useCallback, useReducer, useRef, useState } from 'react'\n\nimport type { RelationshipData } from '../../server/nodes/RelationshipNode.js'\n\nimport { useLexicalDocumentDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDocumentDrawer.js'\nimport './index.scss'\nimport { INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND } from '../drawer/commands.js'\n\nconst initialParams = {\n depth: 0,\n}\n\ntype Props = {\n className: string\n data: RelationshipData\n format?: ElementFormatType\n nodeKey?: string\n}\n\nexport const RelationshipComponent: React.FC<Props> = (props) => {\n const {\n className: baseClass,\n data: { relationTo, value },\n nodeKey,\n } = props\n\n if (typeof value === 'object') {\n throw new Error(\n 'Relationship value should be a string or number. The Lexical Relationship component should not receive the populated value object.',\n )\n }\n\n const relationshipElemRef = useRef<HTMLDivElement | null>(null)\n\n const [editor] = useLexicalComposerContext()\n const isEditable = useLexicalEditable()\n const {\n config: {\n routes: { api },\n serverURL,\n },\n getEntityConfig,\n } = useConfig()\n\n const [relatedCollection] = useState(() => getEntityConfig({ collectionSlug: relationTo }))\n\n const { i18n, t } = useTranslation()\n const [cacheBust, dispatchCacheBust] = useReducer((state) => state + 1, 0)\n const [{ data }, { setParams }] = usePayloadAPI(\n `${serverURL}${api}/${relatedCollection.slug}/${value}`,\n { initialParams },\n )\n\n const { closeDocumentDrawer, DocumentDrawer, DocumentDrawerToggler } = useLexicalDocumentDrawer({\n id: value,\n collectionSlug: relatedCollection.slug,\n })\n\n const removeRelationship = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey!)?.remove()\n })\n }, [editor, nodeKey])\n\n const updateRelationship = React.useCallback(() => {\n setParams({\n ...initialParams,\n cacheBust, // do this to get the usePayloadAPI to re-fetch the data even though the URL string hasn't changed\n })\n\n closeDocumentDrawer()\n dispatchCacheBust()\n }, [cacheBust, setParams, closeDocumentDrawer])\n\n return (\n <div className={`${baseClass}__contents`} contentEditable={false} ref={relationshipElemRef}>\n <div className={`${baseClass}__wrap`}>\n <p className={`${baseClass}__label`}>\n {t('fields:labelRelationship', {\n label: relatedCollection.labels?.singular\n ? getTranslation(relatedCollection.labels?.singular, i18n)\n : relatedCollection.slug,\n })}\n </p>\n <DocumentDrawerToggler className={`${baseClass}__doc-drawer-toggler`}>\n <p className={`${baseClass}__title`}>\n {data ? data[relatedCollection?.admin?.useAsTitle || 'id'] : value}\n </p>\n </DocumentDrawerToggler>\n </div>\n {isEditable && (\n <div className={`${baseClass}__actions`}>\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__swapButton`}\n disabled={!isEditable}\n el=\"button\"\n icon=\"swap\"\n onClick={() => {\n if (nodeKey) {\n editor.dispatchCommand(INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND, {\n replace: { nodeKey },\n })\n }\n }}\n round\n tooltip={t('fields:swapRelationship')}\n />\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__removeButton`}\n disabled={!isEditable}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n removeRelationship()\n }}\n round\n tooltip={t('fields:removeRelationship')}\n />\n </div>\n )}\n\n {!!value && <DocumentDrawer onSave={updateRelationship} />}\n </div>\n )\n}\n"],"names":["useLexicalComposerContext","useLexicalEditable","getTranslation","Button","useConfig","usePayloadAPI","useTranslation","$getNodeByKey","React","useCallback","useReducer","useRef","useState","useLexicalDocumentDrawer","INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND","initialParams","depth","RelationshipComponent","props","className","baseClass","data","relationTo","value","nodeKey","Error","relationshipElemRef","editor","isEditable","config","routes","api","serverURL","getEntityConfig","relatedCollection","collectionSlug","i18n","t","cacheBust","dispatchCacheBust","state","setParams","slug","closeDocumentDrawer","DocumentDrawer","DocumentDrawerToggler","id","removeRelationship","update","remove","updateRelationship","div","contentEditable","ref","p","label","labels","singular","admin","useAsTitle","buttonStyle","disabled","el","icon","onClick","dispatchCommand","replace","round","tooltip","e","preventDefault","onSave"],"mappings":"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"}
@@ -0,0 +1,95 @@
1
+ @import '~@payloadcms/ui/scss';
2
+
3
+ @layer payload-default {
4
+ .LexicalEditorTheme__relationship {
5
+ @extend %body;
6
+ @include shadow-sm;
7
+ padding: calc(var(--base) * 0.75);
8
+ background: var(--theme-input-bg);
9
+ border: 1px solid var(--theme-elevation-100);
10
+ border-radius: $style-radius-m;
11
+ max-width: calc(var(--base) * 15);
12
+ font-family: var(--font-body);
13
+ margin-block: base(0.5);
14
+ color: var(--theme-text);
15
+
16
+ &__contents {
17
+ display: flex;
18
+ align-items: center;
19
+ }
20
+
21
+ &:hover {
22
+ border: 1px solid var(--theme-elevation-150);
23
+ }
24
+
25
+ &__label {
26
+ margin-bottom: calc(var(--base) * 0.25);
27
+ }
28
+
29
+ &__title {
30
+ margin: 0;
31
+ }
32
+
33
+ &__label,
34
+ &__title {
35
+ white-space: nowrap;
36
+ text-overflow: ellipsis;
37
+ overflow: hidden;
38
+ line-height: 1 !important;
39
+ }
40
+
41
+ &__title {
42
+ font-weight: bold;
43
+ }
44
+
45
+ &__wrap {
46
+ flex-grow: 1;
47
+ overflow: hidden;
48
+ }
49
+
50
+ &__doc-drawer-toggler {
51
+ text-decoration: underline;
52
+ pointer-events: all;
53
+ line-height: inherit;
54
+ & > * {
55
+ margin: 0;
56
+ }
57
+ }
58
+
59
+ &__swapButton.btn {
60
+ margin: 0;
61
+ }
62
+
63
+ &__doc-drawer-toggler,
64
+ &__swapButton {
65
+ &:disabled {
66
+ color: var(--theme-elevation-300);
67
+ pointer-events: none;
68
+ }
69
+ }
70
+
71
+ &__actions {
72
+ display: flex;
73
+ align-items: center;
74
+ flex-shrink: 0;
75
+ margin-left: calc(var(--base) * 0.5);
76
+
77
+ & > *:not(:last-child) {
78
+ margin-right: calc(var(--base) * 0.25);
79
+ }
80
+ }
81
+
82
+ &__removeButton.btn {
83
+ margin: 0;
84
+
85
+ line {
86
+ stroke-width: $style-stroke-width-m;
87
+ }
88
+
89
+ &:disabled {
90
+ color: var(--theme-elevation-300);
91
+ pointer-events: none;
92
+ }
93
+ }
94
+ }
95
+ }
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
3
3
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js';
4
4
  import { toast } from '@payloadcms/ui';
5
5
  import { $getNodeByKey, COMMAND_PRIORITY_EDITOR } from 'lexical';
@@ -56,9 +56,13 @@ const RelationshipDrawerComponent = ({ enabledCollectionSlugs })=>{
56
56
  closeListDrawer,
57
57
  replaceNodeKey
58
58
  ]);
59
- return /*#__PURE__*/ _jsx(ListDrawer, {
59
+ return /*#__PURE__*/ _jsxDEV(ListDrawer, {
60
60
  onSelect: onSelect
61
- });
61
+ }, void 0, false, {
62
+ fileName: "src/features/relationship/client/drawer/index.tsx",
63
+ lineNumber: 82,
64
+ columnNumber: 10
65
+ }, this);
62
66
  };
63
67
  const RelationshipDrawerComponentFallback = ()=>{
64
68
  const [editor] = useLexicalComposerContext();
@@ -74,11 +78,19 @@ const RelationshipDrawerComponentFallback = ()=>{
74
78
  };
75
79
  export const RelationshipDrawer = ({ enabledCollectionSlugs })=>{
76
80
  if (!enabledCollectionSlugs?.length) {
77
- return /*#__PURE__*/ _jsx(RelationshipDrawerComponentFallback, {});
81
+ return /*#__PURE__*/ _jsxDEV(RelationshipDrawerComponentFallback, {}, void 0, false, {
82
+ fileName: "src/features/relationship/client/drawer/index.tsx",
83
+ lineNumber: 106,
84
+ columnNumber: 12
85
+ }, this);
78
86
  }
79
- return /*#__PURE__*/ _jsx(RelationshipDrawerComponent, {
87
+ return /*#__PURE__*/ _jsxDEV(RelationshipDrawerComponent, {
80
88
  enabledCollectionSlugs: enabledCollectionSlugs
81
- });
89
+ }, void 0, false, {
90
+ fileName: "src/features/relationship/client/drawer/index.tsx",
91
+ lineNumber: 109,
92
+ columnNumber: 10
93
+ }, this);
82
94
  };
83
95
 
84
96
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/features/relationship/client/drawer/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalEditor } from 'lexical'\nimport type { CollectionSlug } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { type ListDrawerProps, toast } from '@payloadcms/ui'\nimport { $getNodeByKey, COMMAND_PRIORITY_EDITOR } from 'lexical'\nimport React, { useCallback, useEffect, useState } from 'react'\n\nimport { useLexicalListDrawer } from '../../../../utilities/fieldsDrawer/useLexicalListDrawer.js'\nimport { $createRelationshipNode } from '../nodes/RelationshipNode.js'\nimport { INSERT_RELATIONSHIP_COMMAND } from '../plugins/index.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: CollectionSlug[]\n}\n\nconst RelationshipDrawerComponent: React.FC<Props> = ({ enabledCollectionSlugs }) => {\n const [editor] = useLexicalComposerContext()\n\n const [replaceNodeKey, setReplaceNodeKey] = useState<null | string>(null)\n\n const { closeListDrawer, ListDrawer, openListDrawer } = useLexicalListDrawer({\n collectionSlugs: enabledCollectionSlugs,\n selectedCollection: enabledCollectionSlugs?.[0],\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 openListDrawer()\n return true\n },\n COMMAND_PRIORITY_EDITOR,\n )\n }, [editor, openListDrawer])\n\n const onSelect = useCallback<NonNullable<ListDrawerProps['onSelect']>>(\n ({ collectionSlug, doc }) => {\n insertRelationship({\n editor,\n relationTo: collectionSlug,\n replaceNodeKey,\n value: doc.id,\n })\n closeListDrawer()\n },\n [editor, closeListDrawer, replaceNodeKey],\n )\n\n return <ListDrawer onSelect={onSelect} />\n}\n\nconst RelationshipDrawerComponentFallback: React.FC = () => {\n const [editor] = useLexicalComposerContext()\n\n useEffect(() => {\n return editor.registerCommand<{\n replace: { nodeKey: string } | false\n }>(\n INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND,\n () => {\n toast.error('No relationship collections enabled')\n return true\n },\n COMMAND_PRIORITY_EDITOR,\n )\n }, [editor])\n\n return null\n}\n\nexport const RelationshipDrawer = ({ enabledCollectionSlugs }: Props): React.ReactNode => {\n if (!enabledCollectionSlugs?.length) {\n return <RelationshipDrawerComponentFallback />\n }\n\n return <RelationshipDrawerComponent enabledCollectionSlugs={enabledCollectionSlugs} />\n}\n"],"names":["useLexicalComposerContext","toast","$getNodeByKey","COMMAND_PRIORITY_EDITOR","React","useCallback","useEffect","useState","useLexicalListDrawer","$createRelationshipNode","INSERT_RELATIONSHIP_COMMAND","INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND","insertRelationship","editor","relationTo","replaceNodeKey","value","dispatchCommand","update","node","replace","RelationshipDrawerComponent","enabledCollectionSlugs","setReplaceNodeKey","closeListDrawer","ListDrawer","openListDrawer","collectionSlugs","selectedCollection","registerCommand","payload","nodeKey","onSelect","collectionSlug","doc","id","RelationshipDrawerComponentFallback","error","RelationshipDrawer","length"],"mappings":"AAAA;;AAIA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,SAA+BC,KAAK,QAAQ,iBAAgB;AAC5D,SAASC,aAAa,EAAEC,uBAAuB,QAAQ,UAAS;AAChE,OAAOC,SAASC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AAE/D,SAASC,oBAAoB,QAAQ,6DAA4D;AACjG,SAASC,uBAAuB,QAAQ,+BAA8B;AACtE,SAASC,2BAA2B,QAAQ,sBAAqB;AACjE,SAASC,uCAAuC,QAAQ,gBAAe;AAEvE,MAAMC,qBAAqB,CAAC,EAC1BC,MAAM,EACNC,UAAU,EACVC,cAAc,EACdC,KAAK,EAMN;IACC,IAAI,CAACD,gBAAgB;QACnBF,OAAOI,eAAe,CAACP,6BAA6B;YAClDI;YACAE;QACF;IACF,OAAO;QACLH,OAAOK,MAAM,CAAC;YACZ,MAAMC,OAAOjB,cAAca;YAC3B,IAAII,MAAM;gBACRA,KAAKC,OAAO,CAACX,wBAAwB;oBAAEK;oBAAYE;gBAAM;YAC3D;QACF;IACF;AACF;AAMA,MAAMK,8BAA+C,CAAC,EAAEC,sBAAsB,EAAE;IAC9E,MAAM,CAACT,OAAO,GAAGb;IAEjB,MAAM,CAACe,gBAAgBQ,kBAAkB,GAAGhB,SAAwB;IAEpE,MAAM,EAAEiB,eAAe,EAAEC,UAAU,EAAEC,cAAc,EAAE,GAAGlB,qBAAqB;QAC3EmB,iBAAiBL;QACjBM,oBAAoBN,wBAAwB,CAAC,EAAE;IACjD;IAEAhB,UAAU;QACR,OAAOO,OAAOgB,eAAe,CAG3BlB,yCACA,CAACmB;YACCP,kBAAkBO,SAASV,UAAUU,SAASV,QAAQW,UAAU;YAChEL;YACA,OAAO;QACT,GACAvB;IAEJ,GAAG;QAACU;QAAQa;KAAe;IAE3B,MAAMM,WAAW3B,YACf,CAAC,EAAE4B,cAAc,EAAEC,GAAG,EAAE;QACtBtB,mBAAmB;YACjBC;YACAC,YAAYmB;YACZlB;YACAC,OAAOkB,IAAIC,EAAE;QACf;QACAX;IACF,GACA;QAACX;QAAQW;QAAiBT;KAAe;IAG3C,qBAAO,KAACU;QAAWO,UAAUA;;AAC/B;AAEA,MAAMI,sCAAgD;IACpD,MAAM,CAACvB,OAAO,GAAGb;IAEjBM,UAAU;QACR,OAAOO,OAAOgB,eAAe,CAG3BlB,yCACA;YACEV,MAAMoC,KAAK,CAAC;YACZ,OAAO;QACT,GACAlC;IAEJ,GAAG;QAACU;KAAO;IAEX,OAAO;AACT;AAEA,OAAO,MAAMyB,qBAAqB,CAAC,EAAEhB,sBAAsB,EAAS;IAClE,IAAI,CAACA,wBAAwBiB,QAAQ;QACnC,qBAAO,KAACH;IACV;IAEA,qBAAO,KAACf;QAA4BC,wBAAwBA;;AAC9D,EAAC"}
1
+ {"version":3,"sources":["../../../../../src/features/relationship/client/drawer/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalEditor } from 'lexical'\nimport type { CollectionSlug } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { type ListDrawerProps, toast } from '@payloadcms/ui'\nimport { $getNodeByKey, COMMAND_PRIORITY_EDITOR } from 'lexical'\nimport React, { useCallback, useEffect, useState } from 'react'\n\nimport { useLexicalListDrawer } from '../../../../utilities/fieldsDrawer/useLexicalListDrawer.js'\nimport { $createRelationshipNode } from '../nodes/RelationshipNode.js'\nimport { INSERT_RELATIONSHIP_COMMAND } from '../plugins/index.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: CollectionSlug[]\n}\n\nconst RelationshipDrawerComponent: React.FC<Props> = ({ enabledCollectionSlugs }) => {\n const [editor] = useLexicalComposerContext()\n\n const [replaceNodeKey, setReplaceNodeKey] = useState<null | string>(null)\n\n const { closeListDrawer, ListDrawer, openListDrawer } = useLexicalListDrawer({\n collectionSlugs: enabledCollectionSlugs,\n selectedCollection: enabledCollectionSlugs?.[0],\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 openListDrawer()\n return true\n },\n COMMAND_PRIORITY_EDITOR,\n )\n }, [editor, openListDrawer])\n\n const onSelect = useCallback<NonNullable<ListDrawerProps['onSelect']>>(\n ({ collectionSlug, doc }) => {\n insertRelationship({\n editor,\n relationTo: collectionSlug,\n replaceNodeKey,\n value: doc.id,\n })\n closeListDrawer()\n },\n [editor, closeListDrawer, replaceNodeKey],\n )\n\n return <ListDrawer onSelect={onSelect} />\n}\n\nconst RelationshipDrawerComponentFallback: React.FC = () => {\n const [editor] = useLexicalComposerContext()\n\n useEffect(() => {\n return editor.registerCommand<{\n replace: { nodeKey: string } | false\n }>(\n INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND,\n () => {\n toast.error('No relationship collections enabled')\n return true\n },\n COMMAND_PRIORITY_EDITOR,\n )\n }, [editor])\n\n return null\n}\n\nexport const RelationshipDrawer = ({ enabledCollectionSlugs }: Props): React.ReactNode => {\n if (!enabledCollectionSlugs?.length) {\n return <RelationshipDrawerComponentFallback />\n }\n\n return <RelationshipDrawerComponent enabledCollectionSlugs={enabledCollectionSlugs} />\n}\n"],"names":["useLexicalComposerContext","toast","$getNodeByKey","COMMAND_PRIORITY_EDITOR","React","useCallback","useEffect","useState","useLexicalListDrawer","$createRelationshipNode","INSERT_RELATIONSHIP_COMMAND","INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND","insertRelationship","editor","relationTo","replaceNodeKey","value","dispatchCommand","update","node","replace","RelationshipDrawerComponent","enabledCollectionSlugs","setReplaceNodeKey","closeListDrawer","ListDrawer","openListDrawer","collectionSlugs","selectedCollection","registerCommand","payload","nodeKey","onSelect","collectionSlug","doc","id","RelationshipDrawerComponentFallback","error","RelationshipDrawer","length"],"mappings":"AAAA;;AAIA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,SAA+BC,KAAK,QAAQ,iBAAgB;AAC5D,SAASC,aAAa,EAAEC,uBAAuB,QAAQ,UAAS;AAChE,OAAOC,SAASC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AAE/D,SAASC,oBAAoB,QAAQ,6DAA4D;AACjG,SAASC,uBAAuB,QAAQ,+BAA8B;AACtE,SAASC,2BAA2B,QAAQ,sBAAqB;AACjE,SAASC,uCAAuC,QAAQ,gBAAe;AAEvE,MAAMC,qBAAqB,CAAC,EAC1BC,MAAM,EACNC,UAAU,EACVC,cAAc,EACdC,KAAK,EAMN;IACC,IAAI,CAACD,gBAAgB;QACnBF,OAAOI,eAAe,CAACP,6BAA6B;YAClDI;YACAE;QACF;IACF,OAAO;QACLH,OAAOK,MAAM,CAAC;YACZ,MAAMC,OAAOjB,cAAca;YAC3B,IAAII,MAAM;gBACRA,KAAKC,OAAO,CAACX,wBAAwB;oBAAEK;oBAAYE;gBAAM;YAC3D;QACF;IACF;AACF;AAMA,MAAMK,8BAA+C,CAAC,EAAEC,sBAAsB,EAAE;IAC9E,MAAM,CAACT,OAAO,GAAGb;IAEjB,MAAM,CAACe,gBAAgBQ,kBAAkB,GAAGhB,SAAwB;IAEpE,MAAM,EAAEiB,eAAe,EAAEC,UAAU,EAAEC,cAAc,EAAE,GAAGlB,qBAAqB;QAC3EmB,iBAAiBL;QACjBM,oBAAoBN,wBAAwB,CAAC,EAAE;IACjD;IAEAhB,UAAU;QACR,OAAOO,OAAOgB,eAAe,CAG3BlB,yCACA,CAACmB;YACCP,kBAAkBO,SAASV,UAAUU,SAASV,QAAQW,UAAU;YAChEL;YACA,OAAO;QACT,GACAvB;IAEJ,GAAG;QAACU;QAAQa;KAAe;IAE3B,MAAMM,WAAW3B,YACf,CAAC,EAAE4B,cAAc,EAAEC,GAAG,EAAE;QACtBtB,mBAAmB;YACjBC;YACAC,YAAYmB;YACZlB;YACAC,OAAOkB,IAAIC,EAAE;QACf;QACAX;IACF,GACA;QAACX;QAAQW;QAAiBT;KAAe;IAG3C,qBAAO,QAACU;QAAWO,UAAUA;;;;;;AAC/B;AAEA,MAAMI,sCAAgD;IACpD,MAAM,CAACvB,OAAO,GAAGb;IAEjBM,UAAU;QACR,OAAOO,OAAOgB,eAAe,CAG3BlB,yCACA;YACEV,MAAMoC,KAAK,CAAC;YACZ,OAAO;QACT,GACAlC;IAEJ,GAAG;QAACU;KAAO;IAEX,OAAO;AACT;AAEA,OAAO,MAAMyB,qBAAqB,CAAC,EAAEhB,sBAAsB,EAAS;IAClE,IAAI,CAACA,wBAAwBiB,QAAQ;QACnC,qBAAO,QAACH;;;;;IACV;IAEA,qBAAO,QAACf;QAA4BC,wBAAwBA;;;;;;AAC9D,EAAC"}
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
3
3
  import { $applyNodeReplacement } from 'lexical';
4
4
  import * as React from 'react';
5
5
  import { RelationshipServerNode } from '../../server/nodes/RelationshipNode.js';
@@ -53,12 +53,16 @@ export class RelationshipNode extends RelationshipServerNode {
53
53
  return node;
54
54
  }
55
55
  decorate(editor, config) {
56
- return /*#__PURE__*/ _jsx(RelationshipComponent, {
56
+ return /*#__PURE__*/ _jsxDEV(RelationshipComponent, {
57
57
  className: config.theme.relationship ?? 'LexicalEditorTheme__relationship',
58
58
  data: this.__data,
59
59
  format: this.__format,
60
60
  nodeKey: this.getKey()
61
- });
61
+ }, void 0, false, {
62
+ fileName: "src/features/relationship/client/nodes/RelationshipNode.tsx",
63
+ lineNumber: 83,
64
+ columnNumber: 7
65
+ }, this);
62
66
  }
63
67
  exportJSON() {
64
68
  return super.exportJSON();