@strapi/content-manager 0.0.0 → 5.0.0-beta.6

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 (505) hide show
  1. package/README.md +9 -1
  2. package/dist/_chunks/CardDragPreview-DSVYodBX.js +73 -0
  3. package/dist/_chunks/CardDragPreview-DSVYodBX.js.map +1 -0
  4. package/dist/_chunks/CardDragPreview-ikSG4M46.mjs +72 -0
  5. package/dist/_chunks/CardDragPreview-ikSG4M46.mjs.map +1 -0
  6. package/dist/_chunks/ComponentConfigurationPage--2aLCv-G.mjs +236 -0
  7. package/dist/_chunks/ComponentConfigurationPage--2aLCv-G.mjs.map +1 -0
  8. package/dist/_chunks/ComponentConfigurationPage-43KmCNQE.js +255 -0
  9. package/dist/_chunks/ComponentConfigurationPage-43KmCNQE.js.map +1 -0
  10. package/dist/_chunks/ComponentIcon-BBQsYCVn.js +170 -0
  11. package/dist/_chunks/ComponentIcon-BBQsYCVn.js.map +1 -0
  12. package/dist/_chunks/ComponentIcon-BOFnK76n.mjs +151 -0
  13. package/dist/_chunks/ComponentIcon-BOFnK76n.mjs.map +1 -0
  14. package/dist/_chunks/EditConfigurationPage-BfFzJ4Br.js +151 -0
  15. package/dist/_chunks/EditConfigurationPage-BfFzJ4Br.js.map +1 -0
  16. package/dist/_chunks/EditConfigurationPage-CUcGHHvQ.mjs +132 -0
  17. package/dist/_chunks/EditConfigurationPage-CUcGHHvQ.mjs.map +1 -0
  18. package/dist/_chunks/EditViewPage-Bm8lgcm6.mjs +203 -0
  19. package/dist/_chunks/EditViewPage-Bm8lgcm6.mjs.map +1 -0
  20. package/dist/_chunks/EditViewPage-CzOT5Kpj.js +224 -0
  21. package/dist/_chunks/EditViewPage-CzOT5Kpj.js.map +1 -0
  22. package/dist/_chunks/Field-Caef4JjM.js +5352 -0
  23. package/dist/_chunks/Field-Caef4JjM.js.map +1 -0
  24. package/dist/_chunks/Field-Dlh0uGnL.mjs +5319 -0
  25. package/dist/_chunks/Field-Dlh0uGnL.mjs.map +1 -0
  26. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs +50 -0
  27. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs.map +1 -0
  28. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js +49 -0
  29. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js.map +1 -0
  30. package/dist/_chunks/Form-BzuAjtRq.js +759 -0
  31. package/dist/_chunks/Form-BzuAjtRq.js.map +1 -0
  32. package/dist/_chunks/Form-EnaQL_6L.mjs +737 -0
  33. package/dist/_chunks/Form-EnaQL_6L.mjs.map +1 -0
  34. package/dist/_chunks/History-C17LiyRg.js +960 -0
  35. package/dist/_chunks/History-C17LiyRg.js.map +1 -0
  36. package/dist/_chunks/History-D6sbCJvo.mjs +938 -0
  37. package/dist/_chunks/History-D6sbCJvo.mjs.map +1 -0
  38. package/dist/_chunks/ListConfigurationPage-Ce4qs7qE.mjs +622 -0
  39. package/dist/_chunks/ListConfigurationPage-Ce4qs7qE.mjs.map +1 -0
  40. package/dist/_chunks/ListConfigurationPage-Dks5SX6f.js +643 -0
  41. package/dist/_chunks/ListConfigurationPage-Dks5SX6f.js.map +1 -0
  42. package/dist/_chunks/ListViewPage-Be7S5aKL.mjs +835 -0
  43. package/dist/_chunks/ListViewPage-Be7S5aKL.mjs.map +1 -0
  44. package/dist/_chunks/ListViewPage-BwrZrPsh.js +859 -0
  45. package/dist/_chunks/ListViewPage-BwrZrPsh.js.map +1 -0
  46. package/dist/_chunks/NoContentTypePage-CIPmYQMm.mjs +51 -0
  47. package/dist/_chunks/NoContentTypePage-CIPmYQMm.mjs.map +1 -0
  48. package/dist/_chunks/NoContentTypePage-Cu5r1-JT.js +51 -0
  49. package/dist/_chunks/NoContentTypePage-Cu5r1-JT.js.map +1 -0
  50. package/dist/_chunks/NoPermissionsPage-C-j6TEUF.js +24 -0
  51. package/dist/_chunks/NoPermissionsPage-C-j6TEUF.js.map +1 -0
  52. package/dist/_chunks/NoPermissionsPage-DhJ7LYrr.mjs +24 -0
  53. package/dist/_chunks/NoPermissionsPage-DhJ7LYrr.mjs.map +1 -0
  54. package/dist/_chunks/Relations-CY7AtkDA.mjs +684 -0
  55. package/dist/_chunks/Relations-CY7AtkDA.mjs.map +1 -0
  56. package/dist/_chunks/Relations-Czs-uZ-s.js +705 -0
  57. package/dist/_chunks/Relations-Czs-uZ-s.js.map +1 -0
  58. package/dist/_chunks/ar-BUUWXIYu.js +226 -0
  59. package/dist/_chunks/ar-BUUWXIYu.js.map +1 -0
  60. package/dist/_chunks/ar-CCEVvqGG.mjs +226 -0
  61. package/dist/_chunks/ar-CCEVvqGG.mjs.map +1 -0
  62. package/dist/_chunks/ca-5U32ON2v.mjs +201 -0
  63. package/dist/_chunks/ca-5U32ON2v.mjs.map +1 -0
  64. package/dist/_chunks/ca-Cmk45QO6.js +201 -0
  65. package/dist/_chunks/ca-Cmk45QO6.js.map +1 -0
  66. package/dist/_chunks/cs-CM2aBUar.mjs +125 -0
  67. package/dist/_chunks/cs-CM2aBUar.mjs.map +1 -0
  68. package/dist/_chunks/cs-CkJy6B2v.js +125 -0
  69. package/dist/_chunks/cs-CkJy6B2v.js.map +1 -0
  70. package/dist/_chunks/de-C72KDNOl.mjs +199 -0
  71. package/dist/_chunks/de-C72KDNOl.mjs.map +1 -0
  72. package/dist/_chunks/de-CCEmbAah.js +199 -0
  73. package/dist/_chunks/de-CCEmbAah.js.map +1 -0
  74. package/dist/_chunks/en-C-V1_90f.js +285 -0
  75. package/dist/_chunks/en-C-V1_90f.js.map +1 -0
  76. package/dist/_chunks/en-MBPul9Su.mjs +285 -0
  77. package/dist/_chunks/en-MBPul9Su.mjs.map +1 -0
  78. package/dist/_chunks/es-CeXiYflN.mjs +196 -0
  79. package/dist/_chunks/es-CeXiYflN.mjs.map +1 -0
  80. package/dist/_chunks/es-EUonQTon.js +196 -0
  81. package/dist/_chunks/es-EUonQTon.js.map +1 -0
  82. package/dist/_chunks/eu-CdALomew.mjs +202 -0
  83. package/dist/_chunks/eu-CdALomew.mjs.map +1 -0
  84. package/dist/_chunks/eu-VDH-3ovk.js +202 -0
  85. package/dist/_chunks/eu-VDH-3ovk.js.map +1 -0
  86. package/dist/_chunks/fr-B7kGGg3E.js +206 -0
  87. package/dist/_chunks/fr-B7kGGg3E.js.map +1 -0
  88. package/dist/_chunks/fr-CD9VFbPM.mjs +206 -0
  89. package/dist/_chunks/fr-CD9VFbPM.mjs.map +1 -0
  90. package/dist/_chunks/gu-BRmF601H.js +200 -0
  91. package/dist/_chunks/gu-BRmF601H.js.map +1 -0
  92. package/dist/_chunks/gu-CNpaMDpH.mjs +200 -0
  93. package/dist/_chunks/gu-CNpaMDpH.mjs.map +1 -0
  94. package/dist/_chunks/hi-CCJBptSq.js +200 -0
  95. package/dist/_chunks/hi-CCJBptSq.js.map +1 -0
  96. package/dist/_chunks/hi-Dwvd04m3.mjs +200 -0
  97. package/dist/_chunks/hi-Dwvd04m3.mjs.map +1 -0
  98. package/dist/_chunks/hooks-BAaaKPS_.js +7 -0
  99. package/dist/_chunks/hooks-BAaaKPS_.js.map +1 -0
  100. package/dist/_chunks/hooks-E5u1mcgM.mjs +8 -0
  101. package/dist/_chunks/hooks-E5u1mcgM.mjs.map +1 -0
  102. package/dist/_chunks/hu-CeYvaaO0.mjs +202 -0
  103. package/dist/_chunks/hu-CeYvaaO0.mjs.map +1 -0
  104. package/dist/_chunks/hu-sNV_yLYy.js +202 -0
  105. package/dist/_chunks/hu-sNV_yLYy.js.map +1 -0
  106. package/dist/_chunks/id-B5Ser98A.js +160 -0
  107. package/dist/_chunks/id-B5Ser98A.js.map +1 -0
  108. package/dist/_chunks/id-BtwA9WJT.mjs +160 -0
  109. package/dist/_chunks/id-BtwA9WJT.mjs.map +1 -0
  110. package/dist/_chunks/index-DNVx8ssZ.mjs +3175 -0
  111. package/dist/_chunks/index-DNVx8ssZ.mjs.map +1 -0
  112. package/dist/_chunks/index-X_2tafck.js +3195 -0
  113. package/dist/_chunks/index-X_2tafck.js.map +1 -0
  114. package/dist/_chunks/it-BrVPqaf1.mjs +162 -0
  115. package/dist/_chunks/it-BrVPqaf1.mjs.map +1 -0
  116. package/dist/_chunks/it-DkBIs7vD.js +162 -0
  117. package/dist/_chunks/it-DkBIs7vD.js.map +1 -0
  118. package/dist/_chunks/ja-CcFe8diO.js +196 -0
  119. package/dist/_chunks/ja-CcFe8diO.js.map +1 -0
  120. package/dist/_chunks/ja-CtsUxOvk.mjs +196 -0
  121. package/dist/_chunks/ja-CtsUxOvk.mjs.map +1 -0
  122. package/dist/_chunks/ko-HVQRlfUI.mjs +195 -0
  123. package/dist/_chunks/ko-HVQRlfUI.mjs.map +1 -0
  124. package/dist/_chunks/ko-woFZPmLk.js +195 -0
  125. package/dist/_chunks/ko-woFZPmLk.js.map +1 -0
  126. package/dist/_chunks/layout-Dnh0PNp9.mjs +453 -0
  127. package/dist/_chunks/layout-Dnh0PNp9.mjs.map +1 -0
  128. package/dist/_chunks/layout-dBc7wN7L.js +473 -0
  129. package/dist/_chunks/layout-dBc7wN7L.js.map +1 -0
  130. package/dist/_chunks/ml-BihZwQit.mjs +200 -0
  131. package/dist/_chunks/ml-BihZwQit.mjs.map +1 -0
  132. package/dist/_chunks/ml-C2W8N8k1.js +200 -0
  133. package/dist/_chunks/ml-C2W8N8k1.js.map +1 -0
  134. package/dist/_chunks/ms-BuFotyP_.js +144 -0
  135. package/dist/_chunks/ms-BuFotyP_.js.map +1 -0
  136. package/dist/_chunks/ms-m_WjyWx7.mjs +144 -0
  137. package/dist/_chunks/ms-m_WjyWx7.mjs.map +1 -0
  138. package/dist/_chunks/nl-D4R9gHx5.mjs +202 -0
  139. package/dist/_chunks/nl-D4R9gHx5.mjs.map +1 -0
  140. package/dist/_chunks/nl-bbEOHChV.js +202 -0
  141. package/dist/_chunks/nl-bbEOHChV.js.map +1 -0
  142. package/dist/_chunks/objects-gigeqt7s.js +49 -0
  143. package/dist/_chunks/objects-gigeqt7s.js.map +1 -0
  144. package/dist/_chunks/objects-mKMAmfec.mjs +47 -0
  145. package/dist/_chunks/objects-mKMAmfec.mjs.map +1 -0
  146. package/dist/_chunks/pl-sbx9mSt_.mjs +199 -0
  147. package/dist/_chunks/pl-sbx9mSt_.mjs.map +1 -0
  148. package/dist/_chunks/pl-uzwG-hk7.js +199 -0
  149. package/dist/_chunks/pl-uzwG-hk7.js.map +1 -0
  150. package/dist/_chunks/pt-BR-BiOz37D9.js +201 -0
  151. package/dist/_chunks/pt-BR-BiOz37D9.js.map +1 -0
  152. package/dist/_chunks/pt-BR-C71iDxnh.mjs +201 -0
  153. package/dist/_chunks/pt-BR-C71iDxnh.mjs.map +1 -0
  154. package/dist/_chunks/pt-BsaFvS8-.mjs +95 -0
  155. package/dist/_chunks/pt-BsaFvS8-.mjs.map +1 -0
  156. package/dist/_chunks/pt-CeXQuq50.js +95 -0
  157. package/dist/_chunks/pt-CeXQuq50.js.map +1 -0
  158. package/dist/_chunks/relations-4pHtBrHJ.js +134 -0
  159. package/dist/_chunks/relations-4pHtBrHJ.js.map +1 -0
  160. package/dist/_chunks/relations-Dx7tMKJN.mjs +135 -0
  161. package/dist/_chunks/relations-Dx7tMKJN.mjs.map +1 -0
  162. package/dist/_chunks/ru-BE6A4Exp.mjs +231 -0
  163. package/dist/_chunks/ru-BE6A4Exp.mjs.map +1 -0
  164. package/dist/_chunks/ru-BT3ybNny.js +231 -0
  165. package/dist/_chunks/ru-BT3ybNny.js.map +1 -0
  166. package/dist/_chunks/sa-CcvkYInH.js +200 -0
  167. package/dist/_chunks/sa-CcvkYInH.js.map +1 -0
  168. package/dist/_chunks/sa-Dag0k-Z8.mjs +200 -0
  169. package/dist/_chunks/sa-Dag0k-Z8.mjs.map +1 -0
  170. package/dist/_chunks/sk-BFg-R8qJ.mjs +202 -0
  171. package/dist/_chunks/sk-BFg-R8qJ.mjs.map +1 -0
  172. package/dist/_chunks/sk-CvY09Xjv.js +202 -0
  173. package/dist/_chunks/sk-CvY09Xjv.js.map +1 -0
  174. package/dist/_chunks/sv-CUnfWGsh.mjs +202 -0
  175. package/dist/_chunks/sv-CUnfWGsh.mjs.map +1 -0
  176. package/dist/_chunks/sv-MYDuzgvT.js +202 -0
  177. package/dist/_chunks/sv-MYDuzgvT.js.map +1 -0
  178. package/dist/_chunks/th-BqbI8lIT.mjs +148 -0
  179. package/dist/_chunks/th-BqbI8lIT.mjs.map +1 -0
  180. package/dist/_chunks/th-D9_GfAjc.js +148 -0
  181. package/dist/_chunks/th-D9_GfAjc.js.map +1 -0
  182. package/dist/_chunks/tr-CgeK3wJM.mjs +199 -0
  183. package/dist/_chunks/tr-CgeK3wJM.mjs.map +1 -0
  184. package/dist/_chunks/tr-D9UH-O_R.js +199 -0
  185. package/dist/_chunks/tr-D9UH-O_R.js.map +1 -0
  186. package/dist/_chunks/uk-C8EiqJY7.js +144 -0
  187. package/dist/_chunks/uk-C8EiqJY7.js.map +1 -0
  188. package/dist/_chunks/uk-CR-zDhAY.mjs +144 -0
  189. package/dist/_chunks/uk-CR-zDhAY.mjs.map +1 -0
  190. package/dist/_chunks/urls-CbOsUOoW.mjs +7 -0
  191. package/dist/_chunks/urls-CbOsUOoW.mjs.map +1 -0
  192. package/dist/_chunks/urls-DzZya_gm.js +6 -0
  193. package/dist/_chunks/urls-DzZya_gm.js.map +1 -0
  194. package/dist/_chunks/useDragAndDrop-DdHgKsqq.mjs +231 -0
  195. package/dist/_chunks/useDragAndDrop-DdHgKsqq.mjs.map +1 -0
  196. package/dist/_chunks/useDragAndDrop-J0TUUbR6.js +249 -0
  197. package/dist/_chunks/useDragAndDrop-J0TUUbR6.js.map +1 -0
  198. package/dist/_chunks/vi-CJlYDheJ.js +111 -0
  199. package/dist/_chunks/vi-CJlYDheJ.js.map +1 -0
  200. package/dist/_chunks/vi-DUXIk_fw.mjs +111 -0
  201. package/dist/_chunks/vi-DUXIk_fw.mjs.map +1 -0
  202. package/dist/_chunks/zh-BWZspA60.mjs +209 -0
  203. package/dist/_chunks/zh-BWZspA60.mjs.map +1 -0
  204. package/dist/_chunks/zh-CQQfszqR.js +209 -0
  205. package/dist/_chunks/zh-CQQfszqR.js.map +1 -0
  206. package/dist/_chunks/zh-Hans-9kOncHGw.js +952 -0
  207. package/dist/_chunks/zh-Hans-9kOncHGw.js.map +1 -0
  208. package/dist/_chunks/zh-Hans-BPQcRIyH.mjs +952 -0
  209. package/dist/_chunks/zh-Hans-BPQcRIyH.mjs.map +1 -0
  210. package/dist/admin/index.js +11 -0
  211. package/dist/admin/index.js.map +1 -0
  212. package/dist/admin/index.mjs +11 -0
  213. package/dist/admin/index.mjs.map +1 -0
  214. package/dist/admin/src/components/ComponentIcon.d.ts +8 -0
  215. package/dist/admin/src/components/ConfigurationForm/EditFieldForm.d.ts +9 -0
  216. package/dist/admin/src/components/ConfigurationForm/Fields.d.ts +21 -0
  217. package/dist/admin/src/components/ConfigurationForm/Form.d.ts +32 -0
  218. package/dist/admin/src/components/DragLayer.d.ts +13 -0
  219. package/dist/admin/src/components/DragPreviews/CardDragPreview.d.ts +7 -0
  220. package/dist/admin/src/components/DragPreviews/ComponentDragPreview.d.ts +6 -0
  221. package/dist/admin/src/components/DragPreviews/RelationDragPreview.d.ts +11 -0
  222. package/dist/admin/src/components/FieldTypeIcon.d.ts +9 -0
  223. package/dist/admin/src/components/InjectionZone.d.ts +45 -0
  224. package/dist/admin/src/components/LeftMenu.d.ts +2 -0
  225. package/dist/admin/src/components/RelativeTime.d.ts +28 -0
  226. package/dist/admin/src/constants/attributes.d.ts +14 -0
  227. package/dist/admin/src/constants/collections.d.ts +3 -0
  228. package/dist/admin/src/constants/dragAndDrop.d.ts +8 -0
  229. package/dist/admin/src/constants/hooks.d.ts +26 -0
  230. package/dist/admin/src/constants/plugin.d.ts +3 -0
  231. package/dist/admin/src/content-manager.d.ts +133 -0
  232. package/dist/admin/src/exports.d.ts +11 -0
  233. package/dist/admin/src/features/DocumentRBAC.d.ts +36 -0
  234. package/dist/admin/src/history/components/HistoryAction.d.ts +3 -0
  235. package/dist/admin/src/history/components/VersionContent.d.ts +17 -0
  236. package/dist/admin/src/history/components/VersionHeader.d.ts +5 -0
  237. package/dist/admin/src/history/components/VersionInputRenderer.d.ts +19 -0
  238. package/dist/admin/src/history/components/VersionsList.d.ts +2 -0
  239. package/dist/admin/src/history/pages/History.d.ts +27 -0
  240. package/dist/admin/src/history/routes.d.ts +6 -0
  241. package/dist/admin/src/history/services/historyVersion.d.ts +12 -0
  242. package/dist/admin/src/hooks/useContentManagerInitData.d.ts +15 -0
  243. package/dist/admin/src/hooks/useContentTypeSchema.d.ts +25 -0
  244. package/dist/admin/src/hooks/useDebounce.d.ts +1 -0
  245. package/dist/admin/src/hooks/useDocument.d.ts +90 -0
  246. package/dist/admin/src/hooks/useDocumentActions.d.ts +102 -0
  247. package/dist/admin/src/hooks/useDocumentLayout.d.ts +137 -0
  248. package/dist/admin/src/hooks/useDragAndDrop.d.ts +51 -0
  249. package/dist/admin/src/hooks/useKeyboardDragAndDrop.d.ts +14 -0
  250. package/dist/admin/src/hooks/useLazyComponents.d.ts +13 -0
  251. package/dist/admin/src/hooks/useOnce.d.ts +2 -0
  252. package/dist/admin/src/hooks/usePrev.d.ts +1 -0
  253. package/dist/admin/src/index.d.ts +16 -0
  254. package/dist/admin/src/layout.d.ts +2 -0
  255. package/dist/admin/src/modules/app.d.ts +20 -0
  256. package/dist/admin/src/modules/hooks.d.ts +10 -0
  257. package/dist/admin/src/modules/reducers.d.ts +6 -0
  258. package/dist/admin/src/pages/ComponentConfigurationPage.d.ts +3 -0
  259. package/dist/admin/src/pages/EditConfigurationPage.d.ts +3 -0
  260. package/dist/admin/src/pages/EditView/EditViewPage.d.ts +3 -0
  261. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +69 -0
  262. package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +16 -0
  263. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +3 -0
  264. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Heading.d.ts +3 -0
  265. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Image.d.ts +3 -0
  266. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Link.d.ts +3 -0
  267. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/List.d.ts +3 -0
  268. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Paragraph.d.ts +3 -0
  269. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Quote.d.ts +3 -0
  270. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/BlocksContent.d.ts +6 -0
  271. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/BlocksEditor.d.ts +61 -0
  272. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/BlocksInput.d.ts +11 -0
  273. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/BlocksToolbar.d.ts +10 -0
  274. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/EditorLayout.d.ts +10 -0
  275. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Modifiers.d.ts +16 -0
  276. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/plugins/withImages.d.ts +11 -0
  277. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/plugins/withLinks.d.ts +9 -0
  278. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/plugins/withStrapiSchema.d.ts +8 -0
  279. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/conversions.d.ts +13 -0
  280. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/enterKey.d.ts +6 -0
  281. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/links.d.ts +10 -0
  282. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/types.d.ts +10 -0
  283. package/dist/admin/src/pages/EditView/components/FormInputs/Component/Initializer.d.ts +9 -0
  284. package/dist/admin/src/pages/EditView/components/FormInputs/Component/Input.d.ts +18 -0
  285. package/dist/admin/src/pages/EditView/components/FormInputs/Component/NonRepeatable.d.ts +5 -0
  286. package/dist/admin/src/pages/EditView/components/FormInputs/Component/Repeatable.d.ts +5 -0
  287. package/dist/admin/src/pages/EditView/components/FormInputs/ComponentContext.d.ts +42 -0
  288. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/AddComponentButton.d.ts +11 -0
  289. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/ComponentCard.d.ts +9 -0
  290. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/ComponentCategory.d.ts +17 -0
  291. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/ComponentPicker.d.ts +9 -0
  292. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.d.ts +14 -0
  293. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/DynamicZoneLabel.d.ts +12 -0
  294. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/Field.d.ts +14 -0
  295. package/dist/admin/src/pages/EditView/components/FormInputs/NotAllowed.d.ts +7 -0
  296. package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +26 -0
  297. package/dist/admin/src/pages/EditView/components/FormInputs/UID.d.ts +9 -0
  298. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/Editor.d.ts +17 -0
  299. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +60 -0
  300. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/Field.d.ts +11 -0
  301. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/PreviewWysiwyg.d.ts +5 -0
  302. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.d.ts +7 -0
  303. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygNav.d.ts +17 -0
  304. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +55 -0
  305. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/utils/continueList.d.ts +5 -0
  306. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/utils/mdRenderer.d.ts +4 -0
  307. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/utils/utils.d.ts +16 -0
  308. package/dist/admin/src/pages/EditView/components/FormLayout.d.ts +5 -0
  309. package/dist/admin/src/pages/EditView/components/Header.d.ts +35 -0
  310. package/dist/admin/src/pages/EditView/components/InputRenderer.d.ts +17 -0
  311. package/dist/admin/src/pages/EditView/components/Panels.d.ts +10 -0
  312. package/dist/admin/src/pages/EditView/utils/data.d.ts +33 -0
  313. package/dist/admin/src/pages/EditView/utils/forms.d.ts +9 -0
  314. package/dist/admin/src/pages/ListConfiguration/ListConfigurationPage.d.ts +10 -0
  315. package/dist/admin/src/pages/ListConfiguration/components/DraggableCard.d.ts +12 -0
  316. package/dist/admin/src/pages/ListConfiguration/components/EditFieldForm.d.ts +8 -0
  317. package/dist/admin/src/pages/ListConfiguration/components/Header.d.ts +8 -0
  318. package/dist/admin/src/pages/ListConfiguration/components/Settings.d.ts +19 -0
  319. package/dist/admin/src/pages/ListConfiguration/components/SortDisplayedFields.d.ts +6 -0
  320. package/dist/admin/src/pages/ListView/ListViewPage.d.ts +3 -0
  321. package/dist/admin/src/pages/ListView/components/AutoCloneFailureModal.d.ts +7 -0
  322. package/dist/admin/src/pages/ListView/components/BulkActions/Actions.d.ts +51 -0
  323. package/dist/admin/src/pages/ListView/components/BulkActions/ConfirmBulkActionDialog.d.ts +15 -0
  324. package/dist/admin/src/pages/ListView/components/BulkActions/PublishAction.d.ts +31 -0
  325. package/dist/admin/src/pages/ListView/components/Filters.d.ts +8 -0
  326. package/dist/admin/src/pages/ListView/components/TableActions.d.ts +8 -0
  327. package/dist/admin/src/pages/ListView/components/TableCells/CellContent.d.ts +9 -0
  328. package/dist/admin/src/pages/ListView/components/TableCells/CellValue.d.ts +8 -0
  329. package/dist/admin/src/pages/ListView/components/TableCells/Components.d.ts +12 -0
  330. package/dist/admin/src/pages/ListView/components/TableCells/Media.d.ts +23 -0
  331. package/dist/admin/src/pages/ListView/components/TableCells/Relations.d.ts +12 -0
  332. package/dist/admin/src/pages/ListView/components/ViewSettingsMenu.d.ts +10 -0
  333. package/dist/admin/src/pages/NoContentTypePage.d.ts +2 -0
  334. package/dist/admin/src/pages/NoPermissionsPage.d.ts +2 -0
  335. package/dist/admin/src/router.d.ts +5 -0
  336. package/dist/admin/src/services/api.d.ts +3 -0
  337. package/dist/admin/src/services/components.d.ts +5 -0
  338. package/dist/admin/src/services/contentTypes.d.ts +17 -0
  339. package/dist/admin/src/services/documents.d.ts +89 -0
  340. package/dist/admin/src/services/init.d.ts +9 -0
  341. package/dist/admin/src/services/relations.d.ts +49 -0
  342. package/dist/admin/src/services/uid.d.ts +32 -0
  343. package/dist/admin/src/utils/api.d.ts +38 -0
  344. package/dist/admin/src/utils/attributes.d.ts +19 -0
  345. package/dist/admin/src/utils/objects.d.ts +33 -0
  346. package/dist/admin/src/utils/relations.d.ts +12 -0
  347. package/dist/admin/src/utils/strings.d.ts +2 -0
  348. package/dist/admin/src/utils/translations.d.ts +4 -0
  349. package/dist/admin/src/utils/urls.d.ts +2 -0
  350. package/dist/admin/src/utils/users.d.ts +6 -0
  351. package/dist/admin/src/utils/validation.d.ts +12 -0
  352. package/dist/server/index.js +4238 -0
  353. package/dist/server/index.js.map +1 -0
  354. package/dist/server/index.mjs +4214 -0
  355. package/dist/server/index.mjs.map +1 -0
  356. package/dist/server/src/bootstrap.d.ts +3 -0
  357. package/dist/server/src/bootstrap.d.ts.map +1 -0
  358. package/dist/server/src/config.d.ts +6 -0
  359. package/dist/server/src/config.d.ts.map +1 -0
  360. package/dist/server/src/constants/index.d.ts +6 -0
  361. package/dist/server/src/constants/index.d.ts.map +1 -0
  362. package/dist/server/src/controllers/collection-types.d.ts +23 -0
  363. package/dist/server/src/controllers/collection-types.d.ts.map +1 -0
  364. package/dist/server/src/controllers/components.d.ts +7 -0
  365. package/dist/server/src/controllers/components.d.ts.map +1 -0
  366. package/dist/server/src/controllers/content-types.d.ts +8 -0
  367. package/dist/server/src/controllers/content-types.d.ts.map +1 -0
  368. package/dist/server/src/controllers/index.d.ts +53 -0
  369. package/dist/server/src/controllers/index.d.ts.map +1 -0
  370. package/dist/server/src/controllers/init.d.ts +5 -0
  371. package/dist/server/src/controllers/init.d.ts.map +1 -0
  372. package/dist/server/src/controllers/relations.d.ts +13 -0
  373. package/dist/server/src/controllers/relations.d.ts.map +1 -0
  374. package/dist/server/src/controllers/single-types.d.ts +11 -0
  375. package/dist/server/src/controllers/single-types.d.ts.map +1 -0
  376. package/dist/server/src/controllers/uid.d.ts +6 -0
  377. package/dist/server/src/controllers/uid.d.ts.map +1 -0
  378. package/dist/server/src/controllers/utils/clone.d.ts +12 -0
  379. package/dist/server/src/controllers/utils/clone.d.ts.map +1 -0
  380. package/dist/server/src/controllers/utils/dimensions.d.ts +5 -0
  381. package/dist/server/src/controllers/utils/dimensions.d.ts.map +1 -0
  382. package/dist/server/src/controllers/validation/index.d.ts +20 -0
  383. package/dist/server/src/controllers/validation/index.d.ts.map +1 -0
  384. package/dist/server/src/controllers/validation/model-configuration.d.ts +22 -0
  385. package/dist/server/src/controllers/validation/model-configuration.d.ts.map +1 -0
  386. package/dist/server/src/controllers/validation/relations.d.ts +4 -0
  387. package/dist/server/src/controllers/validation/relations.d.ts.map +1 -0
  388. package/dist/server/src/destroy.d.ts +4 -0
  389. package/dist/server/src/destroy.d.ts.map +1 -0
  390. package/dist/server/src/history/constants.d.ts +3 -0
  391. package/dist/server/src/history/constants.d.ts.map +1 -0
  392. package/dist/server/src/history/controllers/history-version.d.ts +19 -0
  393. package/dist/server/src/history/controllers/history-version.d.ts.map +1 -0
  394. package/dist/server/src/history/controllers/index.d.ts +2 -0
  395. package/dist/server/src/history/controllers/index.d.ts.map +1 -0
  396. package/dist/server/src/history/controllers/validation/history-version.d.ts +2 -0
  397. package/dist/server/src/history/controllers/validation/history-version.d.ts.map +1 -0
  398. package/dist/server/src/history/index.d.ts +4 -0
  399. package/dist/server/src/history/index.d.ts.map +1 -0
  400. package/dist/server/src/history/models/history-version.d.ts +4 -0
  401. package/dist/server/src/history/models/history-version.d.ts.map +1 -0
  402. package/dist/server/src/history/routes/history-version.d.ts +4 -0
  403. package/dist/server/src/history/routes/history-version.d.ts.map +1 -0
  404. package/dist/server/src/history/routes/index.d.ts +8 -0
  405. package/dist/server/src/history/routes/index.d.ts.map +1 -0
  406. package/dist/server/src/history/services/history.d.ts +18 -0
  407. package/dist/server/src/history/services/history.d.ts.map +1 -0
  408. package/dist/server/src/history/services/index.d.ts +15 -0
  409. package/dist/server/src/history/services/index.d.ts.map +1 -0
  410. package/dist/server/src/history/services/utils.d.ts +12 -0
  411. package/dist/server/src/history/services/utils.d.ts.map +1 -0
  412. package/dist/server/src/history/utils.d.ts +18 -0
  413. package/dist/server/src/history/utils.d.ts.map +1 -0
  414. package/dist/server/src/index.d.ts +374 -0
  415. package/dist/server/src/index.d.ts.map +1 -0
  416. package/dist/server/src/middlewares/index.d.ts +3 -0
  417. package/dist/server/src/middlewares/index.d.ts.map +1 -0
  418. package/dist/server/src/middlewares/routing.d.ts +4 -0
  419. package/dist/server/src/middlewares/routing.d.ts.map +1 -0
  420. package/dist/server/src/policies/hasPermissions.d.ts +7 -0
  421. package/dist/server/src/policies/hasPermissions.d.ts.map +1 -0
  422. package/dist/server/src/policies/index.d.ts +9 -0
  423. package/dist/server/src/policies/index.d.ts.map +1 -0
  424. package/dist/server/src/register.d.ts +4 -0
  425. package/dist/server/src/register.d.ts.map +1 -0
  426. package/dist/server/src/routes/admin.d.ts +41 -0
  427. package/dist/server/src/routes/admin.d.ts.map +1 -0
  428. package/dist/server/src/routes/index.d.ts +43 -0
  429. package/dist/server/src/routes/index.d.ts.map +1 -0
  430. package/dist/server/src/services/components.d.ts +32 -0
  431. package/dist/server/src/services/components.d.ts.map +1 -0
  432. package/dist/server/src/services/configuration.d.ts +20 -0
  433. package/dist/server/src/services/configuration.d.ts.map +1 -0
  434. package/dist/server/src/services/content-types.d.ts +18 -0
  435. package/dist/server/src/services/content-types.d.ts.map +1 -0
  436. package/dist/server/src/services/data-mapper.d.ts +20 -0
  437. package/dist/server/src/services/data-mapper.d.ts.map +1 -0
  438. package/dist/server/src/services/document-manager.d.ts +47 -0
  439. package/dist/server/src/services/document-manager.d.ts.map +1 -0
  440. package/dist/server/src/services/document-metadata.d.ts +88 -0
  441. package/dist/server/src/services/document-metadata.d.ts.map +1 -0
  442. package/dist/server/src/services/field-sizes.d.ts +19 -0
  443. package/dist/server/src/services/field-sizes.d.ts.map +1 -0
  444. package/dist/server/src/services/index.d.ts +266 -0
  445. package/dist/server/src/services/index.d.ts.map +1 -0
  446. package/dist/server/src/services/metrics.d.ts +9 -0
  447. package/dist/server/src/services/metrics.d.ts.map +1 -0
  448. package/dist/server/src/services/permission-checker.d.ts +54 -0
  449. package/dist/server/src/services/permission-checker.d.ts.map +1 -0
  450. package/dist/server/src/services/permission.d.ts +12 -0
  451. package/dist/server/src/services/permission.d.ts.map +1 -0
  452. package/dist/server/src/services/populate-builder.d.ts +30 -0
  453. package/dist/server/src/services/populate-builder.d.ts.map +1 -0
  454. package/dist/server/src/services/uid.d.ts +25 -0
  455. package/dist/server/src/services/uid.d.ts.map +1 -0
  456. package/dist/server/src/services/utils/configuration/attributes.d.ts +17 -0
  457. package/dist/server/src/services/utils/configuration/attributes.d.ts.map +1 -0
  458. package/dist/server/src/services/utils/configuration/index.d.ts +21 -0
  459. package/dist/server/src/services/utils/configuration/index.d.ts.map +1 -0
  460. package/dist/server/src/services/utils/configuration/layouts.d.ts +14 -0
  461. package/dist/server/src/services/utils/configuration/layouts.d.ts.map +1 -0
  462. package/dist/server/src/services/utils/configuration/metadatas.d.ts +5 -0
  463. package/dist/server/src/services/utils/configuration/metadatas.d.ts.map +1 -0
  464. package/dist/server/src/services/utils/configuration/settings.d.ts +5 -0
  465. package/dist/server/src/services/utils/configuration/settings.d.ts.map +1 -0
  466. package/dist/server/src/services/utils/count.d.ts +5 -0
  467. package/dist/server/src/services/utils/count.d.ts.map +1 -0
  468. package/dist/server/src/services/utils/draft.d.ts +11 -0
  469. package/dist/server/src/services/utils/draft.d.ts.map +1 -0
  470. package/dist/server/src/services/utils/populate.d.ts +35 -0
  471. package/dist/server/src/services/utils/populate.d.ts.map +1 -0
  472. package/dist/server/src/services/utils/store.d.ts +16 -0
  473. package/dist/server/src/services/utils/store.d.ts.map +1 -0
  474. package/dist/server/src/utils/index.d.ts +9 -0
  475. package/dist/server/src/utils/index.d.ts.map +1 -0
  476. package/dist/server/src/validation/policies/hasPermissions.d.ts +2 -0
  477. package/dist/server/src/validation/policies/hasPermissions.d.ts.map +1 -0
  478. package/dist/shared/contracts/collection-types.d.ts +328 -0
  479. package/dist/shared/contracts/collection-types.d.ts.map +1 -0
  480. package/dist/shared/contracts/components.d.ts +65 -0
  481. package/dist/shared/contracts/components.d.ts.map +1 -0
  482. package/dist/shared/contracts/content-types.d.ts +113 -0
  483. package/dist/shared/contracts/content-types.d.ts.map +1 -0
  484. package/dist/shared/contracts/history-versions.d.ts +92 -0
  485. package/dist/shared/contracts/history-versions.d.ts.map +1 -0
  486. package/dist/shared/contracts/index.d.ts +10 -0
  487. package/dist/shared/contracts/index.d.ts.map +1 -0
  488. package/dist/shared/contracts/init.d.ts +24 -0
  489. package/dist/shared/contracts/init.d.ts.map +1 -0
  490. package/dist/shared/contracts/relations.d.ts +70 -0
  491. package/dist/shared/contracts/relations.d.ts.map +1 -0
  492. package/dist/shared/contracts/review-workflows.d.ts +78 -0
  493. package/dist/shared/contracts/review-workflows.d.ts.map +1 -0
  494. package/dist/shared/contracts/single-types.d.ts +113 -0
  495. package/dist/shared/contracts/single-types.d.ts.map +1 -0
  496. package/dist/shared/contracts/uid.d.ts +48 -0
  497. package/dist/shared/contracts/uid.d.ts.map +1 -0
  498. package/dist/shared/index.d.ts +2 -0
  499. package/dist/shared/index.d.ts.map +1 -0
  500. package/dist/shared/index.js +43 -0
  501. package/dist/shared/index.js.map +1 -0
  502. package/dist/shared/index.mjs +43 -0
  503. package/dist/shared/index.mjs.map +1 -0
  504. package/package.json +114 -2
  505. package/strapi-server.js +3 -0
@@ -0,0 +1,705 @@
1
+ "use strict";
2
+ const jsxRuntime = require("react/jsx-runtime");
3
+ const React = require("react");
4
+ const strapiAdmin = require("@strapi/admin/strapi-admin");
5
+ const designSystem = require("@strapi/design-system");
6
+ const Icons = require("@strapi/icons");
7
+ const fractionalIndexing = require("fractional-indexing");
8
+ const pipe = require("lodash/fp/pipe");
9
+ const reactDndHtml5Backend = require("react-dnd-html5-backend");
10
+ const reactIntl = require("react-intl");
11
+ const reactRouterDom = require("react-router-dom");
12
+ const reactWindow = require("react-window");
13
+ const styled = require("styled-components");
14
+ const index = require("./index-X_2tafck.js");
15
+ const useDragAndDrop = require("./useDragAndDrop-J0TUUbR6.js");
16
+ const relations = require("./relations-4pHtBrHJ.js");
17
+ const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
18
+ function _interopNamespace(e) {
19
+ if (e && e.__esModule)
20
+ return e;
21
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
22
+ if (e) {
23
+ for (const k in e) {
24
+ if (k !== "default") {
25
+ const d = Object.getOwnPropertyDescriptor(e, k);
26
+ Object.defineProperty(n, k, d.get ? d : {
27
+ enumerable: true,
28
+ get: () => e[k]
29
+ });
30
+ }
31
+ }
32
+ }
33
+ n.default = e;
34
+ return Object.freeze(n);
35
+ }
36
+ const React__namespace = /* @__PURE__ */ _interopNamespace(React);
37
+ const pipe__default = /* @__PURE__ */ _interopDefault(pipe);
38
+ const styled__default = /* @__PURE__ */ _interopDefault(styled);
39
+ const [ComponentProvider, useComponent] = strapiAdmin.createContext("ComponentContext", {
40
+ id: void 0,
41
+ level: -1,
42
+ uid: void 0,
43
+ type: void 0
44
+ });
45
+ const RELATIONS_TO_DISPLAY = 5;
46
+ const ONE_WAY_RELATIONS = ["oneWay", "oneToOne", "manyToOne", "oneToManyMorph", "oneToOneMorph"];
47
+ const RelationsField = React__namespace.forwardRef(
48
+ ({ disabled, label, ...props }, ref) => {
49
+ const [currentPage, setCurrentPage] = React__namespace.useState(1);
50
+ const { document, model: documentModel } = index.useDoc();
51
+ const documentId = document?.documentId;
52
+ const { formatMessage } = reactIntl.useIntl();
53
+ const [{ query }] = strapiAdmin.useQueryParams();
54
+ const params = index.buildValidParams(query);
55
+ const isMorph = props.attribute.relation.toLowerCase().includes("morph");
56
+ const isDisabled = isMorph || disabled;
57
+ const { id: componentId, uid } = useComponent("RelationsField", ({ uid: uid2, id: id2 }) => ({ id: id2, uid: uid2 }));
58
+ const id = componentId ? componentId.toString() : documentId;
59
+ const model = uid ?? documentModel;
60
+ const [targetField] = props.name.split(".").slice(-1);
61
+ const { data, isLoading, isFetching } = relations.useGetRelationsQuery(
62
+ {
63
+ model,
64
+ targetField,
65
+ // below we don't run the query if there is no id.
66
+ id,
67
+ params: {
68
+ ...params,
69
+ pageSize: RELATIONS_TO_DISPLAY,
70
+ page: currentPage
71
+ }
72
+ },
73
+ {
74
+ refetchOnMountOrArgChange: true,
75
+ skip: !id,
76
+ selectFromResult: (result) => {
77
+ return {
78
+ ...result,
79
+ data: {
80
+ ...result.data,
81
+ results: result.data?.results ? result.data.results : []
82
+ }
83
+ };
84
+ }
85
+ }
86
+ );
87
+ const handleLoadMore = () => {
88
+ setCurrentPage((prev) => prev + 1);
89
+ };
90
+ const field = strapiAdmin.useField(props.name);
91
+ const isFetchingMoreRelations = isLoading || isFetching;
92
+ const realServerRelationsCount = "pagination" in data && data.pagination ? data.pagination.total : 0;
93
+ const relationsConnected = (field.value?.connect ?? []).filter(
94
+ (rel) => data.results.findIndex((relation) => relation.id === rel.id) === -1
95
+ ).length ?? 0;
96
+ const relationsDisconnected = field.value?.disconnect?.length ?? 0;
97
+ const relationsCount = realServerRelationsCount + relationsConnected - relationsDisconnected;
98
+ const relations$1 = React__namespace.useMemo(() => {
99
+ const ctx = {
100
+ field: field.value,
101
+ // @ts-expect-error – targetModel does exist on the attribute. But it's not typed.
102
+ href: `../${index.COLLECTION_TYPES}/${props.attribute.targetModel}`,
103
+ mainField: props.mainField
104
+ };
105
+ const transformations = pipe__default.default(
106
+ removeConnected(ctx),
107
+ removeDisconnected(ctx),
108
+ addLabelAndHref(ctx)
109
+ );
110
+ const transformedRels = transformations([...data.results]);
111
+ return [...transformedRels, ...field.value?.connect ?? []].sort((a, b) => {
112
+ if (a.__temp_key__ < b.__temp_key__)
113
+ return -1;
114
+ if (a.__temp_key__ > b.__temp_key__)
115
+ return 1;
116
+ return 0;
117
+ });
118
+ }, [
119
+ data.results,
120
+ field.value,
121
+ // @ts-expect-error – targetModel does exist on the attribute. But it's not typed.
122
+ props.attribute.targetModel,
123
+ props.mainField
124
+ ]);
125
+ const handleConnect = (relation) => {
126
+ const [lastItemInList] = relations$1.slice(-1);
127
+ const item = {
128
+ id: relation.id,
129
+ status: relation.status,
130
+ /**
131
+ * If there's a last item, that's the first key we use to generate out next one.
132
+ */
133
+ __temp_key__: fractionalIndexing.generateNKeysBetween(lastItemInList?.__temp_key__ ?? null, null, 1)[0],
134
+ // Fallback to `id` if there is no `mainField` value, which will overwrite the above `id` property with the exact same data.
135
+ [props.mainField?.name ?? "documentId"]: relation[props.mainField?.name ?? "documentId"],
136
+ label: relations.getRelationLabel(relation, props.mainField),
137
+ // @ts-expect-error – targetModel does exist on the attribute, but it's not typed.
138
+ href: `../${index.COLLECTION_TYPES}/${props.attribute.targetModel}/${relation.documentId}`
139
+ };
140
+ if (ONE_WAY_RELATIONS.includes(props.attribute.relation)) {
141
+ field.onChange(`${props.name}.connect`, [item]);
142
+ } else {
143
+ field.onChange(`${props.name}.connect`, [...field.value?.connect ?? [], item]);
144
+ }
145
+ };
146
+ return /* @__PURE__ */ jsxRuntime.jsxs(
147
+ designSystem.Flex,
148
+ {
149
+ ref,
150
+ direction: "column",
151
+ gap: 3,
152
+ justifyContent: "space-between",
153
+ alignItems: "stretch",
154
+ wrap: "wrap",
155
+ children: [
156
+ /* @__PURE__ */ jsxRuntime.jsxs(StyledFlex, { direction: "column", alignItems: "start", gap: 2, width: "100%", children: [
157
+ /* @__PURE__ */ jsxRuntime.jsx(
158
+ RelationsInput,
159
+ {
160
+ disabled: isDisabled,
161
+ id,
162
+ label: `${label} ${relationsCount > 0 ? `(${relationsCount})` : ""}`,
163
+ model,
164
+ onChange: handleConnect,
165
+ ...props
166
+ }
167
+ ),
168
+ "pagination" in data && data.pagination && data.pagination.pageCount > data.pagination.page ? /* @__PURE__ */ jsxRuntime.jsx(
169
+ designSystem.TextButton,
170
+ {
171
+ disabled: isFetchingMoreRelations,
172
+ onClick: handleLoadMore,
173
+ loading: isFetchingMoreRelations,
174
+ startIcon: /* @__PURE__ */ jsxRuntime.jsx(Icons.ArrowClockwise, {}),
175
+ shrink: 0,
176
+ children: formatMessage({
177
+ id: index.getTranslation("relation.loadMore"),
178
+ defaultMessage: "Load More"
179
+ })
180
+ }
181
+ ) : null
182
+ ] }),
183
+ /* @__PURE__ */ jsxRuntime.jsx(
184
+ RelationsList,
185
+ {
186
+ data: relations$1,
187
+ serverData: data.results,
188
+ disabled: isDisabled,
189
+ name: props.name,
190
+ isLoading: isFetchingMoreRelations,
191
+ relationType: props.attribute.relation
192
+ }
193
+ )
194
+ ]
195
+ }
196
+ );
197
+ }
198
+ );
199
+ const StyledFlex = styled__default.default(designSystem.Flex)`
200
+ & > div {
201
+ width: 100%;
202
+ }
203
+ `;
204
+ const removeConnected = ({ field }) => (relations2) => {
205
+ return relations2.filter((relation) => {
206
+ const connectedRelations = field?.connect ?? [];
207
+ return connectedRelations.findIndex((rel) => rel.id === relation.id) === -1;
208
+ });
209
+ };
210
+ const removeDisconnected = ({ field }) => (relations2) => relations2.filter((relation) => {
211
+ const disconnectedRelations = field?.disconnect ?? [];
212
+ return disconnectedRelations.findIndex((rel) => rel.id === relation.id) === -1;
213
+ });
214
+ const addLabelAndHref = ({ mainField, href }) => (relations$1) => relations$1.map((relation) => {
215
+ return {
216
+ ...relation,
217
+ // Fallback to `id` if there is no `mainField` value, which will overwrite the above `documentId` property with the exact same data.
218
+ [mainField?.name ?? "documentId"]: relation[mainField?.name ?? "documentId"],
219
+ label: relations.getRelationLabel(relation, mainField),
220
+ href: `${href}/${relation.documentId}`
221
+ };
222
+ });
223
+ const RelationsInput = ({
224
+ id,
225
+ model,
226
+ name,
227
+ mainField,
228
+ placeholder,
229
+ unique: _unique,
230
+ "aria-label": _ariaLabel,
231
+ onChange,
232
+ ...props
233
+ }) => {
234
+ const [textValue, setTextValue] = React__namespace.useState("");
235
+ const [searchParams, setSearchParams] = React__namespace.useState({
236
+ _q: "",
237
+ page: 1
238
+ });
239
+ const { toggleNotification } = strapiAdmin.useNotification();
240
+ const [{ query }] = strapiAdmin.useQueryParams();
241
+ const { formatMessage } = reactIntl.useIntl();
242
+ const fieldRef = strapiAdmin.useFocusInputField(name);
243
+ const field = strapiAdmin.useField(name);
244
+ const [searchForTrigger, { data, isLoading }] = relations.useLazySearchRelationsQuery();
245
+ React__namespace.useEffect(() => {
246
+ const [targetField] = name.split(".").slice(-1);
247
+ searchForTrigger({
248
+ model,
249
+ targetField,
250
+ params: {
251
+ ...index.buildValidParams(query),
252
+ id: id ?? "",
253
+ pageSize: 10,
254
+ idsToInclude: field.value?.disconnect?.map((rel) => rel.id.toString()) ?? [],
255
+ idsToOmit: field.value?.connect?.map((rel) => rel.id.toString()) ?? [],
256
+ ...searchParams
257
+ }
258
+ });
259
+ }, [
260
+ field.value?.connect,
261
+ field.value?.disconnect,
262
+ id,
263
+ model,
264
+ name,
265
+ query,
266
+ searchForTrigger,
267
+ searchParams
268
+ ]);
269
+ const handleSearch = async (search) => {
270
+ setSearchParams((s) => ({ ...s, _q: search, page: 1 }));
271
+ };
272
+ const hasNextPage = data?.pagination ? data.pagination.page < data.pagination.pageCount : false;
273
+ const options = data?.results ?? [];
274
+ const handleChange = (relationId) => {
275
+ if (!relationId) {
276
+ return;
277
+ }
278
+ const relation = options.find((opt) => opt.id.toString() === relationId);
279
+ if (!relation) {
280
+ console.error(
281
+ "You've tried to add a relation with an id that does not exist in the options you can see, this is likely a bug with Strapi. Please open an issue."
282
+ );
283
+ toggleNotification({
284
+ message: formatMessage({
285
+ id: index.getTranslation("relation.error-adding-relation"),
286
+ defaultMessage: "An error occurred while trying to add the relation."
287
+ }),
288
+ type: "danger"
289
+ });
290
+ return;
291
+ }
292
+ onChange(relation);
293
+ };
294
+ const handleLoadMore = () => {
295
+ if (!data || !data.pagination) {
296
+ return;
297
+ } else if (data.pagination.page < data.pagination.pageCount) {
298
+ setSearchParams((s) => ({ ...s, page: s.page + 1 }));
299
+ }
300
+ };
301
+ React__namespace.useLayoutEffect(() => {
302
+ setTextValue("");
303
+ }, [field.value]);
304
+ return /* @__PURE__ */ jsxRuntime.jsx(
305
+ designSystem.Combobox,
306
+ {
307
+ ref: fieldRef,
308
+ name,
309
+ autocomplete: "none",
310
+ error: field.error,
311
+ placeholder: placeholder || formatMessage({
312
+ id: index.getTranslation("relation.add"),
313
+ defaultMessage: "Add relation"
314
+ }),
315
+ hasMoreItems: hasNextPage,
316
+ loading: isLoading,
317
+ onOpenChange: () => {
318
+ handleSearch(textValue ?? "");
319
+ },
320
+ noOptionsMessage: () => formatMessage({
321
+ id: index.getTranslation("relation.notAvailable"),
322
+ defaultMessage: "No relations available"
323
+ }),
324
+ loadingMessage: formatMessage({
325
+ id: index.getTranslation("relation.isLoading"),
326
+ defaultMessage: "Relations are loading"
327
+ }),
328
+ onLoadMore: handleLoadMore,
329
+ textValue,
330
+ onChange: handleChange,
331
+ onTextValueChange: (text) => {
332
+ setTextValue(text);
333
+ },
334
+ onInputChange: (event) => {
335
+ handleSearch(event.currentTarget.value);
336
+ },
337
+ ...props,
338
+ children: options.map((opt) => {
339
+ const textValue2 = relations.getRelationLabel(opt, mainField);
340
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: opt.id.toString(), textValue: textValue2, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, justifyContent: "space-between", children: [
341
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { ellipsis: true, children: textValue2 }),
342
+ opt.status ? /* @__PURE__ */ jsxRuntime.jsx(index.DocumentStatus, { status: opt.status }) : null
343
+ ] }) }, opt.id);
344
+ })
345
+ }
346
+ );
347
+ };
348
+ const RELATION_ITEM_HEIGHT = 50;
349
+ const RELATION_GUTTER = 4;
350
+ const RelationsList = ({
351
+ data,
352
+ serverData,
353
+ disabled,
354
+ name,
355
+ isLoading,
356
+ relationType
357
+ }) => {
358
+ const ariaDescriptionId = React__namespace.useId();
359
+ const { formatMessage } = reactIntl.useIntl();
360
+ const listRef = React__namespace.useRef(null);
361
+ const outerListRef = React__namespace.useRef(null);
362
+ const [overflow, setOverflow] = React__namespace.useState();
363
+ const [liveText, setLiveText] = React__namespace.useState("");
364
+ const field = strapiAdmin.useField(name);
365
+ const removeFieldRow = strapiAdmin.useForm("RelationsList", (state) => state.removeFieldRow);
366
+ const addFieldRow = strapiAdmin.useForm("RelationsList", (state) => state.addFieldRow);
367
+ React__namespace.useEffect(() => {
368
+ if (data.length <= RELATIONS_TO_DISPLAY) {
369
+ return setOverflow(void 0);
370
+ }
371
+ const handleNativeScroll = (e) => {
372
+ const el = e.target;
373
+ const parentScrollContainerHeight = el.parentNode.scrollHeight;
374
+ const maxScrollBottom = el.scrollHeight - el.scrollTop;
375
+ if (el.scrollTop === 0) {
376
+ return setOverflow("bottom");
377
+ }
378
+ if (maxScrollBottom === parentScrollContainerHeight) {
379
+ return setOverflow("top");
380
+ }
381
+ return setOverflow("top-bottom");
382
+ };
383
+ const outerListRefCurrent = outerListRef?.current;
384
+ if (!isLoading && data.length > 0 && outerListRefCurrent) {
385
+ outerListRef.current.addEventListener("scroll", handleNativeScroll);
386
+ }
387
+ return () => {
388
+ if (outerListRefCurrent) {
389
+ outerListRefCurrent.removeEventListener("scroll", handleNativeScroll);
390
+ }
391
+ };
392
+ }, [isLoading, data.length]);
393
+ const getItemPos = (index2) => `${index2 + 1} of ${data.length}`;
394
+ const handleMoveItem = (newIndex, oldIndex) => {
395
+ const item = data[oldIndex];
396
+ setLiveText(
397
+ formatMessage(
398
+ {
399
+ id: index.getTranslation("dnd.reorder"),
400
+ defaultMessage: "{item}, moved. New position in list: {position}."
401
+ },
402
+ {
403
+ item: item.label ?? item.documentId,
404
+ position: getItemPos(newIndex)
405
+ }
406
+ )
407
+ );
408
+ const newData = [...data];
409
+ const currentRow = data[oldIndex];
410
+ const startKey = oldIndex > newIndex ? newData[newIndex - 1]?.__temp_key__ : newData[newIndex]?.__temp_key__;
411
+ const endKey = oldIndex > newIndex ? newData[newIndex]?.__temp_key__ : newData[newIndex + 1]?.__temp_key__;
412
+ const [newKey] = fractionalIndexing.generateNKeysBetween(startKey, endKey, 1);
413
+ newData.splice(oldIndex, 1);
414
+ newData.splice(newIndex, 0, { ...currentRow, __temp_key__: newKey });
415
+ const connectedRelations = newData.reduce((acc, relation, currentIndex, array) => {
416
+ const relationOnServer = serverData.find(
417
+ (oldRelation) => oldRelation.documentId === relation.documentId
418
+ );
419
+ const relationInFront = array[currentIndex + 1];
420
+ if (!relationOnServer || relationOnServer.__temp_key__ !== relation.__temp_key__) {
421
+ const position = relationInFront ? {
422
+ before: relationInFront.documentId,
423
+ locale: relationInFront.locale,
424
+ status: relationInFront.status
425
+ } : { end: true };
426
+ const relationWithPosition = { ...relation, position };
427
+ return [...acc, relationWithPosition];
428
+ }
429
+ return acc;
430
+ }, []).toReversed();
431
+ field.onChange(`${name}.connect`, connectedRelations);
432
+ };
433
+ const handleGrabItem = (index$1) => {
434
+ const item = data[index$1];
435
+ setLiveText(
436
+ formatMessage(
437
+ {
438
+ id: index.getTranslation("dnd.grab-item"),
439
+ defaultMessage: `{item}, grabbed. Current position in list: {position}. Press up and down arrow to change position, Spacebar to drop, Escape to cancel.`
440
+ },
441
+ {
442
+ item: item.label ?? item.documentId,
443
+ position: getItemPos(index$1)
444
+ }
445
+ )
446
+ );
447
+ };
448
+ const handleDropItem = (index$1) => {
449
+ const { href: _href, label, ...item } = data[index$1];
450
+ setLiveText(
451
+ formatMessage(
452
+ {
453
+ id: index.getTranslation("dnd.drop-item"),
454
+ defaultMessage: `{item}, dropped. Final position in list: {position}.`
455
+ },
456
+ {
457
+ item: label ?? item.documentId,
458
+ position: getItemPos(index$1)
459
+ }
460
+ )
461
+ );
462
+ };
463
+ const handleCancel = (index$1) => {
464
+ const item = data[index$1];
465
+ setLiveText(
466
+ formatMessage(
467
+ {
468
+ id: index.getTranslation("dnd.cancel-item"),
469
+ defaultMessage: "{item}, dropped. Re-order cancelled."
470
+ },
471
+ {
472
+ item: item.label ?? item.documentId
473
+ }
474
+ )
475
+ );
476
+ };
477
+ const handleDisconnect = (relation) => {
478
+ if (field.value && field.value.connect) {
479
+ const indexOfRelationInConnectArray = field.value.connect.findIndex(
480
+ (rel) => rel.id === relation.id
481
+ );
482
+ if (indexOfRelationInConnectArray >= 0) {
483
+ removeFieldRow(`${name}.connect`, indexOfRelationInConnectArray);
484
+ return;
485
+ }
486
+ }
487
+ addFieldRow(`${name}.disconnect`, { id: relation.id });
488
+ };
489
+ const canReorder = !ONE_WAY_RELATIONS.includes(relationType);
490
+ const dynamicListHeight = data.length > RELATIONS_TO_DISPLAY ? Math.min(data.length, RELATIONS_TO_DISPLAY) * (RELATION_ITEM_HEIGHT + RELATION_GUTTER) + RELATION_ITEM_HEIGHT / 2 : Math.min(data.length, RELATIONS_TO_DISPLAY) * (RELATION_ITEM_HEIGHT + RELATION_GUTTER);
491
+ return /* @__PURE__ */ jsxRuntime.jsxs(ShadowBox, { overflowDirection: overflow, children: [
492
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.VisuallyHidden, { id: ariaDescriptionId, children: formatMessage({
493
+ id: index.getTranslation("dnd.instructions"),
494
+ defaultMessage: `Press spacebar to grab and re-order`
495
+ }) }),
496
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.VisuallyHidden, { "aria-live": "assertive", children: liveText }),
497
+ /* @__PURE__ */ jsxRuntime.jsx(
498
+ reactWindow.FixedSizeList,
499
+ {
500
+ height: dynamicListHeight,
501
+ ref: listRef,
502
+ outerRef: outerListRef,
503
+ itemCount: data.length,
504
+ itemSize: RELATION_ITEM_HEIGHT + RELATION_GUTTER,
505
+ itemData: {
506
+ ariaDescribedBy: ariaDescriptionId,
507
+ canDrag: canReorder,
508
+ disabled,
509
+ handleCancel,
510
+ handleDropItem,
511
+ handleGrabItem,
512
+ handleMoveItem,
513
+ name,
514
+ handleDisconnect,
515
+ relations: data
516
+ },
517
+ itemKey: (index2) => data[index2].id,
518
+ innerElementType: "ol",
519
+ children: ListItem
520
+ }
521
+ )
522
+ ] });
523
+ };
524
+ const ShadowBox = styled__default.default(designSystem.Box)`
525
+ position: relative;
526
+ overflow: hidden;
527
+ flex: 1;
528
+
529
+ &:before,
530
+ &:after {
531
+ position: absolute;
532
+ width: 100%;
533
+ height: 4px;
534
+ z-index: 1;
535
+ }
536
+
537
+ &:before {
538
+ /* TODO: as for DS Table component we would need this to be handled by the DS theme */
539
+ content: '';
540
+ background: linear-gradient(rgba(3, 3, 5, 0.2) 0%, rgba(0, 0, 0, 0) 100%);
541
+ top: 0;
542
+ opacity: ${({ overflowDirection }) => overflowDirection === "top-bottom" || overflowDirection === "top" ? 1 : 0};
543
+ transition: opacity 0.2s ease-in-out;
544
+ }
545
+
546
+ &:after {
547
+ /* TODO: as for DS Table component we would need this to be handled by the DS theme */
548
+ content: '';
549
+ background: linear-gradient(0deg, rgba(3, 3, 5, 0.2) 0%, rgba(0, 0, 0, 0) 100%);
550
+ bottom: 0;
551
+ opacity: ${({ overflowDirection }) => overflowDirection === "top-bottom" || overflowDirection === "bottom" ? 1 : 0};
552
+ transition: opacity 0.2s ease-in-out;
553
+ }
554
+ `;
555
+ const ListItem = ({ data, index: index$1, style }) => {
556
+ const {
557
+ ariaDescribedBy,
558
+ canDrag = false,
559
+ disabled = false,
560
+ handleCancel,
561
+ handleDisconnect,
562
+ handleDropItem,
563
+ handleGrabItem,
564
+ handleMoveItem,
565
+ name,
566
+ relations: relations2
567
+ } = data;
568
+ const { formatMessage } = reactIntl.useIntl();
569
+ const { href, documentId, label, status } = relations2[index$1];
570
+ const [{ handlerId, isDragging, handleKeyDown }, relationRef, dropRef, dragRef, dragPreviewRef] = useDragAndDrop.useDragAndDrop(
571
+ canDrag && !disabled,
572
+ {
573
+ type: `${useDragAndDrop.ItemTypes.RELATION}_${name}`,
574
+ index: index$1,
575
+ item: {
576
+ displayedValue: label,
577
+ status,
578
+ id: documentId,
579
+ index: index$1
580
+ },
581
+ onMoveItem: handleMoveItem,
582
+ onDropItem: handleDropItem,
583
+ onGrabItem: handleGrabItem,
584
+ onCancel: handleCancel,
585
+ dropSensitivity: useDragAndDrop.DROP_SENSITIVITY.REGULAR
586
+ }
587
+ );
588
+ const composedRefs = designSystem.useComposedRefs(relationRef, dragRef);
589
+ React__namespace.useEffect(() => {
590
+ dragPreviewRef(reactDndHtml5Backend.getEmptyImage());
591
+ }, [dragPreviewRef]);
592
+ return /* @__PURE__ */ jsxRuntime.jsx(
593
+ designSystem.Box,
594
+ {
595
+ style,
596
+ as: "li",
597
+ ref: dropRef,
598
+ "aria-describedby": ariaDescribedBy,
599
+ cursor: canDrag ? "all-scroll" : "default",
600
+ children: isDragging ? /* @__PURE__ */ jsxRuntime.jsx(RelationItemPlaceholder, {}) : /* @__PURE__ */ jsxRuntime.jsxs(
601
+ designSystem.Flex,
602
+ {
603
+ paddingTop: 2,
604
+ paddingBottom: 2,
605
+ paddingLeft: canDrag ? 2 : 4,
606
+ paddingRight: 4,
607
+ hasRadius: true,
608
+ borderColor: "neutral200",
609
+ background: disabled ? "neutral150" : "neutral0",
610
+ justifyContent: "space-between",
611
+ ref: composedRefs,
612
+ "data-handler-id": handlerId,
613
+ children: [
614
+ /* @__PURE__ */ jsxRuntime.jsxs(FlexWrapper, { gap: 1, children: [
615
+ canDrag ? /* @__PURE__ */ jsxRuntime.jsx(
616
+ designSystem.IconButton,
617
+ {
618
+ forwardedAs: "div",
619
+ role: "button",
620
+ tabIndex: 0,
621
+ "aria-label": formatMessage({
622
+ id: index.getTranslation("components.RelationInput.icon-button-aria-label"),
623
+ defaultMessage: "Drag"
624
+ }),
625
+ borderWidth: 0,
626
+ onKeyDown: handleKeyDown,
627
+ disabled,
628
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Drag, {})
629
+ }
630
+ ) : null,
631
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { width: "100%", minWidth: 0, justifyContent: "space-between", children: [
632
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { minWidth: 0, paddingTop: 1, paddingBottom: 1, paddingRight: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { description: label, children: href ? /* @__PURE__ */ jsxRuntime.jsx(LinkEllipsis, { forwardedAs: reactRouterDom.NavLink, to: href, children: label }) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: disabled ? "neutral600" : "primary600", ellipsis: true, children: label }) }) }),
633
+ status ? /* @__PURE__ */ jsxRuntime.jsx(index.DocumentStatus, { status }) : null
634
+ ] })
635
+ ] }),
636
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 4, children: /* @__PURE__ */ jsxRuntime.jsx(
637
+ DisconnectButton,
638
+ {
639
+ disabled,
640
+ type: "button",
641
+ onClick: () => handleDisconnect(relations2[index$1]),
642
+ "aria-label": formatMessage({
643
+ id: index.getTranslation("relation.disconnect"),
644
+ defaultMessage: "Remove"
645
+ }),
646
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Cross, { width: "12px" })
647
+ }
648
+ ) })
649
+ ]
650
+ }
651
+ )
652
+ }
653
+ );
654
+ };
655
+ const FlexWrapper = styled__default.default(designSystem.Flex)`
656
+ width: 100%;
657
+ /* Used to prevent endAction to be pushed out of container */
658
+ min-width: 0;
659
+
660
+ & > div[role='button'] {
661
+ cursor: all-scroll;
662
+ }
663
+ `;
664
+ const DisconnectButton = styled__default.default.button`
665
+ svg path {
666
+ fill: ${({ theme, disabled }) => disabled ? theme.colors.neutral600 : theme.colors.neutral500};
667
+ }
668
+
669
+ &:hover svg path,
670
+ &:focus svg path {
671
+ fill: ${({ theme, disabled }) => !disabled && theme.colors.neutral600};
672
+ }
673
+ `;
674
+ const LinkEllipsis = styled__default.default(designSystem.Link)`
675
+ display: block;
676
+
677
+ & > span {
678
+ white-space: nowrap;
679
+ overflow: hidden;
680
+ text-overflow: ellipsis;
681
+ display: block;
682
+ }
683
+ `;
684
+ const RelationItemPlaceholder = () => /* @__PURE__ */ jsxRuntime.jsx(
685
+ designSystem.Box,
686
+ {
687
+ paddingTop: 2,
688
+ paddingBottom: 2,
689
+ paddingLeft: 4,
690
+ paddingRight: 4,
691
+ hasRadius: true,
692
+ borderStyle: "dashed",
693
+ borderColor: "primary600",
694
+ borderWidth: "1px",
695
+ background: "primary100",
696
+ height: `calc(100% - ${RELATION_GUTTER}px)`
697
+ }
698
+ );
699
+ exports.ComponentProvider = ComponentProvider;
700
+ exports.DisconnectButton = DisconnectButton;
701
+ exports.FlexWrapper = FlexWrapper;
702
+ exports.LinkEllipsis = LinkEllipsis;
703
+ exports.RelationsField = RelationsField;
704
+ exports.useComponent = useComponent;
705
+ //# sourceMappingURL=Relations-Czs-uZ-s.js.map