@strapi/content-manager 0.0.0-experimental.ce3ce68ff05de341bbdb48e7164d5367cffa839c → 0.0.0-experimental.cf8bb33f3f3ac8c6469f469802867e9fc2005e58

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 (192) hide show
  1. package/dist/admin/chunks/{CardDragPreview-DwuraT0K.mjs → CardDragPreview-DwuraT0K.js} +1 -1
  2. package/dist/admin/chunks/CardDragPreview-DwuraT0K.js.map +1 -0
  3. package/dist/admin/chunks/{ComponentConfigurationPage-DKPNz7kC.mjs → ComponentConfigurationPage-Co2eC_-C.js} +8 -8
  4. package/dist/admin/chunks/ComponentConfigurationPage-Co2eC_-C.js.map +1 -0
  5. package/dist/admin/chunks/{ComponentConfigurationPage-DLYW6wzP.js → ComponentConfigurationPage-Dj1bNvEF.js} +3 -3
  6. package/dist/admin/chunks/{ComponentConfigurationPage-DLYW6wzP.js.map → ComponentConfigurationPage-Dj1bNvEF.js.map} +1 -1
  7. package/dist/admin/chunks/{ComponentIcon-BZcTc4rj.mjs → ComponentIcon-BZcTc4rj.js} +1 -1
  8. package/dist/admin/chunks/ComponentIcon-BZcTc4rj.js.map +1 -0
  9. package/dist/admin/chunks/{EditConfigurationPage-D6MAzDx9.js → EditConfigurationPage-Dm5woBp9.js} +3 -3
  10. package/dist/admin/chunks/{EditConfigurationPage-D6MAzDx9.js.map → EditConfigurationPage-Dm5woBp9.js.map} +1 -1
  11. package/dist/admin/chunks/{EditConfigurationPage-QUYChTGp.mjs → EditConfigurationPage-zd9OLaVh.js} +8 -8
  12. package/dist/admin/chunks/EditConfigurationPage-zd9OLaVh.js.map +1 -0
  13. package/dist/admin/chunks/{EditViewPage-BEiXdIh3.js → EditViewPage-DsBKmSPb.js} +5 -5
  14. package/dist/admin/chunks/{EditViewPage-BEiXdIh3.js.map → EditViewPage-DsBKmSPb.js.map} +1 -1
  15. package/dist/admin/chunks/{EditViewPage-CVSmF6vY.mjs → EditViewPage-kAIaYTg0.js} +9 -9
  16. package/dist/admin/chunks/EditViewPage-kAIaYTg0.js.map +1 -0
  17. package/dist/admin/chunks/{FieldTypeIcon-BY6MrVF4.mjs → FieldTypeIcon-BY6MrVF4.js} +1 -1
  18. package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.js.map +1 -0
  19. package/dist/admin/chunks/{Form-D3aRL8pG.mjs → Form-BO69oITe.js} +5 -5
  20. package/dist/admin/chunks/Form-BO69oITe.js.map +1 -0
  21. package/dist/admin/chunks/{Form-DT-mJpeC.js → Form-BPIhJKyf.js} +2 -2
  22. package/dist/admin/chunks/{Form-DT-mJpeC.js.map → Form-BPIhJKyf.js.map} +1 -1
  23. package/dist/admin/chunks/{History-Cev65qhQ.mjs → History-BzvpM-Gw.js} +10 -10
  24. package/dist/admin/chunks/History-BzvpM-Gw.js.map +1 -0
  25. package/dist/admin/chunks/{History-DcmMS40h.js → History-DBQ96jv2.js} +5 -5
  26. package/dist/admin/chunks/{History-DcmMS40h.js.map → History-DBQ96jv2.js.map} +1 -1
  27. package/dist/admin/chunks/{Input-DmdcvKcy.mjs → Input-BlDcbhUC.js} +9 -9
  28. package/dist/admin/chunks/Input-BlDcbhUC.js.map +1 -0
  29. package/dist/admin/chunks/{Input-DKc071zK.js → Input-Dh1MtWno.js} +7 -6
  30. package/dist/admin/chunks/Input-Dh1MtWno.js.map +1 -0
  31. package/dist/admin/chunks/{ListConfigurationPage-9g-kIzuq.js → ListConfigurationPage-8d3BsQIr.js} +2 -2
  32. package/dist/admin/chunks/{ListConfigurationPage-9g-kIzuq.js.map → ListConfigurationPage-8d3BsQIr.js.map} +1 -1
  33. package/dist/admin/chunks/{ListConfigurationPage-yidhkI_g.mjs → ListConfigurationPage-DK0ARecn.js} +7 -7
  34. package/dist/admin/chunks/ListConfigurationPage-DK0ARecn.js.map +1 -0
  35. package/dist/admin/chunks/{ListViewPage-kGaMwPGl.mjs → ListViewPage-BF2q7N6W.js} +5 -5
  36. package/dist/admin/chunks/ListViewPage-BF2q7N6W.js.map +1 -0
  37. package/dist/admin/chunks/{ListViewPage-CkbK_jTo.js → ListViewPage-CS1ED-vI.js} +3 -3
  38. package/dist/admin/chunks/{ListViewPage-CkbK_jTo.js.map → ListViewPage-CS1ED-vI.js.map} +1 -1
  39. package/dist/admin/chunks/{NoContentTypePage-B2sy8eF1.js → NoContentTypePage-C5Qxz3I4.js} +2 -2
  40. package/dist/admin/chunks/{NoContentTypePage-B2sy8eF1.js.map → NoContentTypePage-C5Qxz3I4.js.map} +1 -1
  41. package/dist/admin/chunks/{NoContentTypePage-DotejDdi.mjs → NoContentTypePage-DjdXr1-j.js} +2 -2
  42. package/dist/admin/chunks/NoContentTypePage-DjdXr1-j.js.map +1 -0
  43. package/dist/admin/chunks/{NoPermissionsPage-CSGCioeQ.mjs → NoPermissionsPage-BUwtKUEP.js} +2 -2
  44. package/dist/admin/chunks/NoPermissionsPage-BUwtKUEP.js.map +1 -0
  45. package/dist/admin/chunks/{NoPermissionsPage-BZp87Adj.js → NoPermissionsPage-C5dC0MtL.js} +2 -2
  46. package/dist/admin/chunks/{NoPermissionsPage-BZp87Adj.js.map → NoPermissionsPage-C5dC0MtL.js.map} +1 -1
  47. package/dist/admin/chunks/{Preview-CPJ1hVQG.mjs → Preview-C9kXTY6C.js} +10 -10
  48. package/dist/admin/chunks/Preview-C9kXTY6C.js.map +1 -0
  49. package/dist/admin/chunks/{Preview-C7doSaZl.js → Preview-DBvmhR7Q.js} +6 -6
  50. package/dist/admin/chunks/{Preview-C7doSaZl.js.map → Preview-DBvmhR7Q.js.map} +1 -1
  51. package/dist/admin/chunks/{Relations-C8ytFTHV.mjs → Relations-Cn0atFpd.js} +4 -4
  52. package/dist/admin/chunks/Relations-Cn0atFpd.js.map +1 -0
  53. package/dist/admin/chunks/{Relations-DFmdcIeQ.js → Relations-XHxDKEvT.js} +3 -3
  54. package/dist/admin/chunks/{Relations-DFmdcIeQ.js.map → Relations-XHxDKEvT.js.map} +1 -1
  55. package/dist/admin/chunks/{ar-DckYq_WK.mjs → ar-DckYq_WK.js} +1 -1
  56. package/dist/admin/chunks/ar-DckYq_WK.js.map +1 -0
  57. package/dist/admin/chunks/{ca-DviY7mRj.mjs → ca-DviY7mRj.js} +1 -1
  58. package/dist/admin/chunks/ca-DviY7mRj.js.map +1 -0
  59. package/dist/admin/chunks/{cs-C7OSYFQ7.mjs → cs-C7OSYFQ7.js} +1 -1
  60. package/dist/admin/chunks/cs-C7OSYFQ7.js.map +1 -0
  61. package/dist/admin/chunks/{de-5QRlDHyR.mjs → de-5QRlDHyR.js} +1 -1
  62. package/dist/admin/chunks/de-5QRlDHyR.js.map +1 -0
  63. package/dist/admin/chunks/{en-LfhocNG2.mjs → en-LfhocNG2.js} +1 -1
  64. package/dist/admin/chunks/{en-LfhocNG2.mjs.map → en-LfhocNG2.js.map} +1 -1
  65. package/dist/admin/chunks/{es-DkoWSExG.mjs → es-DkoWSExG.js} +1 -1
  66. package/dist/admin/chunks/es-DkoWSExG.js.map +1 -0
  67. package/dist/admin/chunks/{eu-BG1xX7HK.mjs → eu-BG1xX7HK.js} +1 -1
  68. package/dist/admin/chunks/eu-BG1xX7HK.js.map +1 -0
  69. package/dist/admin/chunks/{fr-CFdRaRVj.mjs → fr-CFdRaRVj.js} +1 -1
  70. package/dist/admin/chunks/fr-CFdRaRVj.js.map +1 -0
  71. package/dist/admin/chunks/{gu-D5MMMXRs.mjs → gu-D5MMMXRs.js} +1 -1
  72. package/dist/admin/chunks/gu-D5MMMXRs.js.map +1 -0
  73. package/dist/admin/chunks/{hi-lp17SCjr.mjs → hi-lp17SCjr.js} +1 -1
  74. package/dist/admin/chunks/hi-lp17SCjr.js.map +1 -0
  75. package/dist/admin/chunks/{hooks-DMvik5y_.mjs → hooks-DMvik5y_.js} +1 -1
  76. package/dist/admin/chunks/hooks-DMvik5y_.js.map +1 -0
  77. package/dist/admin/chunks/{hu-CLka1U2C.mjs → hu-CLka1U2C.js} +1 -1
  78. package/dist/admin/chunks/hu-CLka1U2C.js.map +1 -0
  79. package/dist/admin/chunks/{id-USfY9m1g.mjs → id-USfY9m1g.js} +1 -1
  80. package/dist/admin/chunks/id-USfY9m1g.js.map +1 -0
  81. package/dist/admin/chunks/{index-OSrndyon.js → index-BczuAULz.js} +11 -11
  82. package/dist/admin/chunks/{index-OSrndyon.js.map → index-BczuAULz.js.map} +1 -1
  83. package/dist/admin/chunks/{index-Deb5-YKG.mjs → index-BkyR-Bnu.js} +42 -42
  84. package/dist/admin/chunks/index-BkyR-Bnu.js.map +1 -0
  85. package/dist/admin/chunks/{it-BAHrwmYS.mjs → it-BAHrwmYS.js} +1 -1
  86. package/dist/admin/chunks/it-BAHrwmYS.js.map +1 -0
  87. package/dist/admin/chunks/{ja-BWKmBJFT.mjs → ja-BWKmBJFT.js} +1 -1
  88. package/dist/admin/chunks/ja-BWKmBJFT.js.map +1 -0
  89. package/dist/admin/chunks/{ko-CgADGBNt.mjs → ko-CgADGBNt.js} +1 -1
  90. package/dist/admin/chunks/ko-CgADGBNt.js.map +1 -0
  91. package/dist/admin/chunks/{layout-ixNm7FpJ.js → layout-DcDoRT8g.js} +4 -4
  92. package/dist/admin/chunks/{layout-ixNm7FpJ.js.map → layout-DcDoRT8g.js.map} +1 -1
  93. package/dist/admin/chunks/{layout-MkippATC.mjs → layout-fghBgRgX.js} +7 -7
  94. package/dist/admin/chunks/layout-fghBgRgX.js.map +1 -0
  95. package/dist/admin/chunks/{ml-CnhCfOn_.mjs → ml-CnhCfOn_.js} +1 -1
  96. package/dist/admin/chunks/ml-CnhCfOn_.js.map +1 -0
  97. package/dist/admin/chunks/{ms-Bh09NFff.mjs → ms-Bh09NFff.js} +1 -1
  98. package/dist/admin/chunks/ms-Bh09NFff.js.map +1 -0
  99. package/dist/admin/chunks/{nl-C8HYflTc.mjs → nl-C8HYflTc.js} +1 -1
  100. package/dist/admin/chunks/nl-C8HYflTc.js.map +1 -0
  101. package/dist/admin/chunks/{objects-wl73iEma.mjs → objects-wl73iEma.js} +1 -1
  102. package/dist/admin/chunks/objects-wl73iEma.js.map +1 -0
  103. package/dist/admin/chunks/{pl-MFCZJZuZ.mjs → pl-MFCZJZuZ.js} +1 -1
  104. package/dist/admin/chunks/pl-MFCZJZuZ.js.map +1 -0
  105. package/dist/admin/chunks/{pt-BR-CcotyBGJ.mjs → pt-BR-CcotyBGJ.js} +1 -1
  106. package/dist/admin/chunks/pt-BR-CcotyBGJ.js.map +1 -0
  107. package/dist/admin/chunks/{pt-HbmgeiYO.mjs → pt-HbmgeiYO.js} +1 -1
  108. package/dist/admin/chunks/pt-HbmgeiYO.js.map +1 -0
  109. package/dist/admin/chunks/{relations-CQOKwshG.js → relations-CgaydhiM.js} +2 -2
  110. package/dist/admin/chunks/{relations-CQOKwshG.js.map → relations-CgaydhiM.js.map} +1 -1
  111. package/dist/admin/chunks/{relations-BwFH-RZe.mjs → relations-DPVgU_rq.js} +2 -2
  112. package/dist/admin/chunks/relations-DPVgU_rq.js.map +1 -0
  113. package/dist/admin/chunks/{ru-CB4BUyQp.mjs → ru-CB4BUyQp.js} +1 -1
  114. package/dist/admin/chunks/{ru-CB4BUyQp.mjs.map → ru-CB4BUyQp.js.map} +1 -1
  115. package/dist/admin/chunks/{sa-n_aPA-pU.mjs → sa-n_aPA-pU.js} +1 -1
  116. package/dist/admin/chunks/sa-n_aPA-pU.js.map +1 -0
  117. package/dist/admin/chunks/{sk-tn_BDjE2.mjs → sk-tn_BDjE2.js} +1 -1
  118. package/dist/admin/chunks/sk-tn_BDjE2.js.map +1 -0
  119. package/dist/admin/chunks/{sv-cq4ZrQRd.mjs → sv-cq4ZrQRd.js} +1 -1
  120. package/dist/admin/chunks/sv-cq4ZrQRd.js.map +1 -0
  121. package/dist/admin/chunks/{th-mUH7hEtc.mjs → th-mUH7hEtc.js} +1 -1
  122. package/dist/admin/chunks/th-mUH7hEtc.js.map +1 -0
  123. package/dist/admin/chunks/{tr-Yt38daxh.mjs → tr-Yt38daxh.js} +1 -1
  124. package/dist/admin/chunks/tr-Yt38daxh.js.map +1 -0
  125. package/dist/admin/chunks/{uk-Cpgmm7gE.mjs → uk-Cpgmm7gE.js} +1 -1
  126. package/dist/admin/chunks/uk-Cpgmm7gE.js.map +1 -0
  127. package/dist/admin/chunks/{useDragAndDrop-HYwNDExe.mjs → useDragAndDrop-HYwNDExe.js} +1 -1
  128. package/dist/admin/chunks/useDragAndDrop-HYwNDExe.js.map +1 -0
  129. package/dist/admin/chunks/{usePrev-Bjw2dhmq.mjs → usePrev-Bjw2dhmq.js} +1 -1
  130. package/dist/admin/chunks/usePrev-Bjw2dhmq.js.map +1 -0
  131. package/dist/admin/chunks/{vi-CvBGlTjr.mjs → vi-CvBGlTjr.js} +1 -1
  132. package/dist/admin/chunks/vi-CvBGlTjr.js.map +1 -0
  133. package/dist/admin/chunks/{zh-BmF-sHaT.mjs → zh-BmF-sHaT.js} +1 -1
  134. package/dist/admin/chunks/zh-BmF-sHaT.js.map +1 -0
  135. package/dist/admin/chunks/{zh-Hans-CI0HKio3.mjs → zh-Hans-CI0HKio3.js} +1 -1
  136. package/dist/admin/chunks/{zh-Hans-CI0HKio3.mjs.map → zh-Hans-CI0HKio3.js.map} +1 -1
  137. package/dist/admin/index.js +1 -1
  138. package/dist/admin/index.mjs +1 -1
  139. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +1 -49
  140. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/utils/prismLanguages.d.ts +50 -0
  141. package/package.json +5 -5
  142. package/dist/admin/chunks/CardDragPreview-DwuraT0K.mjs.map +0 -1
  143. package/dist/admin/chunks/ComponentConfigurationPage-DKPNz7kC.mjs.map +0 -1
  144. package/dist/admin/chunks/ComponentIcon-BZcTc4rj.mjs.map +0 -1
  145. package/dist/admin/chunks/EditConfigurationPage-QUYChTGp.mjs.map +0 -1
  146. package/dist/admin/chunks/EditViewPage-CVSmF6vY.mjs.map +0 -1
  147. package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.mjs.map +0 -1
  148. package/dist/admin/chunks/Form-D3aRL8pG.mjs.map +0 -1
  149. package/dist/admin/chunks/History-Cev65qhQ.mjs.map +0 -1
  150. package/dist/admin/chunks/Input-DKc071zK.js.map +0 -1
  151. package/dist/admin/chunks/Input-DmdcvKcy.mjs.map +0 -1
  152. package/dist/admin/chunks/ListConfigurationPage-yidhkI_g.mjs.map +0 -1
  153. package/dist/admin/chunks/ListViewPage-kGaMwPGl.mjs.map +0 -1
  154. package/dist/admin/chunks/NoContentTypePage-DotejDdi.mjs.map +0 -1
  155. package/dist/admin/chunks/NoPermissionsPage-CSGCioeQ.mjs.map +0 -1
  156. package/dist/admin/chunks/Preview-CPJ1hVQG.mjs.map +0 -1
  157. package/dist/admin/chunks/Relations-C8ytFTHV.mjs.map +0 -1
  158. package/dist/admin/chunks/ar-DckYq_WK.mjs.map +0 -1
  159. package/dist/admin/chunks/ca-DviY7mRj.mjs.map +0 -1
  160. package/dist/admin/chunks/cs-C7OSYFQ7.mjs.map +0 -1
  161. package/dist/admin/chunks/de-5QRlDHyR.mjs.map +0 -1
  162. package/dist/admin/chunks/es-DkoWSExG.mjs.map +0 -1
  163. package/dist/admin/chunks/eu-BG1xX7HK.mjs.map +0 -1
  164. package/dist/admin/chunks/fr-CFdRaRVj.mjs.map +0 -1
  165. package/dist/admin/chunks/gu-D5MMMXRs.mjs.map +0 -1
  166. package/dist/admin/chunks/hi-lp17SCjr.mjs.map +0 -1
  167. package/dist/admin/chunks/hooks-DMvik5y_.mjs.map +0 -1
  168. package/dist/admin/chunks/hu-CLka1U2C.mjs.map +0 -1
  169. package/dist/admin/chunks/id-USfY9m1g.mjs.map +0 -1
  170. package/dist/admin/chunks/index-Deb5-YKG.mjs.map +0 -1
  171. package/dist/admin/chunks/it-BAHrwmYS.mjs.map +0 -1
  172. package/dist/admin/chunks/ja-BWKmBJFT.mjs.map +0 -1
  173. package/dist/admin/chunks/ko-CgADGBNt.mjs.map +0 -1
  174. package/dist/admin/chunks/layout-MkippATC.mjs.map +0 -1
  175. package/dist/admin/chunks/ml-CnhCfOn_.mjs.map +0 -1
  176. package/dist/admin/chunks/ms-Bh09NFff.mjs.map +0 -1
  177. package/dist/admin/chunks/nl-C8HYflTc.mjs.map +0 -1
  178. package/dist/admin/chunks/objects-wl73iEma.mjs.map +0 -1
  179. package/dist/admin/chunks/pl-MFCZJZuZ.mjs.map +0 -1
  180. package/dist/admin/chunks/pt-BR-CcotyBGJ.mjs.map +0 -1
  181. package/dist/admin/chunks/pt-HbmgeiYO.mjs.map +0 -1
  182. package/dist/admin/chunks/relations-BwFH-RZe.mjs.map +0 -1
  183. package/dist/admin/chunks/sa-n_aPA-pU.mjs.map +0 -1
  184. package/dist/admin/chunks/sk-tn_BDjE2.mjs.map +0 -1
  185. package/dist/admin/chunks/sv-cq4ZrQRd.mjs.map +0 -1
  186. package/dist/admin/chunks/th-mUH7hEtc.mjs.map +0 -1
  187. package/dist/admin/chunks/tr-Yt38daxh.mjs.map +0 -1
  188. package/dist/admin/chunks/uk-Cpgmm7gE.mjs.map +0 -1
  189. package/dist/admin/chunks/useDragAndDrop-HYwNDExe.mjs.map +0 -1
  190. package/dist/admin/chunks/usePrev-Bjw2dhmq.mjs.map +0 -1
  191. package/dist/admin/chunks/vi-CvBGlTjr.mjs.map +0 -1
  192. package/dist/admin/chunks/zh-BmF-sHaT.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"relations-CQOKwshG.js","sources":["../../../admin/src/hooks/useDebounce.ts","../../../admin/src/services/relations.ts","../../../admin/src/utils/relations.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nexport function useDebounce<TValue>(value: TValue, delay: number): TValue {\n const [debouncedValue, setDebouncedValue] = useState(value);\n\n useEffect(() => {\n const handler = setTimeout(() => {\n setDebouncedValue(value);\n }, delay);\n\n return () => {\n clearTimeout(handler);\n };\n }, [value, delay]);\n\n return debouncedValue;\n}\n","import { generateNKeysBetween } from 'fractional-indexing';\n\nimport {\n RelationResult as RelResult,\n FindAvailable,\n FindExisting,\n} from '../../../shared/contracts/relations';\n\nimport { contentManagerApi } from './api';\n\nimport type { Modules } from '@strapi/types';\nimport type { errors } from '@strapi/utils';\n\ninterface RelationResult extends RelResult {\n __temp_key__: string;\n}\n\ntype GetRelationsResponse =\n | {\n results: Array<RelationResult>;\n pagination: {\n page: NonNullable<Modules.EntityService.Params.Pagination.PageNotation['page']>;\n pageSize: NonNullable<Modules.EntityService.Params.Pagination.PageNotation['pageSize']>;\n pageCount: number;\n total: number;\n } | null;\n error?: never;\n }\n | {\n results?: never;\n pagination?: never;\n error: errors.ApplicationError | errors.YupValidationError;\n };\n\nconst relationsApi = contentManagerApi.injectEndpoints({\n endpoints: (build) => ({\n getRelations: build.query<\n GetRelationsResponse,\n FindExisting.Params & {\n params?: FindExisting.Request['query'];\n }\n >({\n query: ({ model, id, targetField, params }) => {\n return {\n url: `/content-manager/relations/${model}/${id}/${targetField}`,\n method: 'GET',\n config: {\n params,\n },\n };\n },\n serializeQueryArgs: (args) => {\n const { endpointName, queryArgs } = args;\n return {\n endpointName,\n model: queryArgs.model,\n id: queryArgs.id,\n targetField: queryArgs.targetField,\n locale: queryArgs.params?.locale,\n status: queryArgs.params?.status,\n };\n },\n merge: (currentCache, newItems) => {\n if (currentCache.pagination && newItems.pagination) {\n if (currentCache.pagination.page < newItems.pagination.page) {\n /**\n * Relations will always have unique IDs, so we can therefore assume\n * that we only need to push the new items to the cache.\n *\n * Push new items at the beginning as latest items are shown first\n */\n currentCache.results = [\n ...prepareTempKeys(newItems.results, currentCache.results),\n ...currentCache.results,\n ];\n currentCache.pagination = newItems.pagination;\n } else if (newItems.pagination.page === 1) {\n /**\n * We're resetting the relations\n */\n currentCache.results = prepareTempKeys(newItems.results);\n currentCache.pagination = newItems.pagination;\n }\n }\n },\n forceRefetch({ currentArg, previousArg }) {\n if (!currentArg?.params && !previousArg?.params) {\n return false;\n }\n\n return (\n currentArg?.params?.page !== previousArg?.params?.page ||\n currentArg?.params?.pageSize !== previousArg?.params?.pageSize\n );\n },\n transformResponse: (response: FindExisting.Response) => {\n if ('results' in response && response.results) {\n return {\n ...response,\n results: prepareTempKeys(response.results.toReversed()),\n };\n } else {\n return response;\n }\n },\n providesTags: ['Relations'],\n }),\n searchRelations: build.query<\n FindAvailable.Response,\n FindAvailable.Params & {\n params?: FindAvailable.Request['query'];\n }\n >({\n query: ({ model, targetField, params }) => {\n return {\n url: `/content-manager/relations/${model}/${targetField}`,\n method: 'GET',\n config: {\n params,\n },\n };\n },\n serializeQueryArgs: (args) => {\n const { endpointName, queryArgs } = args;\n return {\n endpointName,\n model: queryArgs.model,\n targetField: queryArgs.targetField,\n _q: queryArgs.params?._q,\n idsToOmit: queryArgs.params?.idsToOmit,\n idsToInclude: queryArgs.params?.idsToInclude,\n };\n },\n merge: (currentCache, newItems) => {\n if (currentCache.pagination && newItems.pagination) {\n if (currentCache.pagination.page < newItems.pagination.page) {\n /**\n * Relations will always have unique IDs, so we can therefore assume\n * that we only need to push the new items to the cache.\n */\n const existingIds = currentCache.results.map((item) => item.documentId);\n const uniqueNewItems = newItems.results.filter(\n (item) => !existingIds.includes(item.documentId)\n );\n currentCache.results.push(...uniqueNewItems);\n currentCache.pagination = newItems.pagination;\n } else if (newItems.pagination.page === 1) {\n /**\n * We're resetting the relations\n */\n currentCache.results = newItems.results;\n currentCache.pagination = newItems.pagination;\n }\n }\n },\n forceRefetch({ currentArg, previousArg }) {\n if (!currentArg?.params && !previousArg?.params) {\n return false;\n }\n\n return (\n currentArg?.params?.page !== previousArg?.params?.page ||\n currentArg?.params?.pageSize !== previousArg?.params?.pageSize\n );\n },\n transformResponse: (response: FindAvailable.Response) => {\n if (response.results) {\n return {\n ...response,\n results: response.results,\n };\n } else {\n return response;\n }\n },\n }),\n }),\n});\n\n/**\n * @internal\n * @description Adds a `__temp_key__` to each relation item. This gives us\n * a stable identifier regardless of it's ids etc. that we can then use for drag and drop.\n */\nconst prepareTempKeys = (relations: RelResult[], existingRelations: RelationResult[] = []) => {\n const [firstItem] = existingRelations.slice(0);\n const keys = generateNKeysBetween(null, firstItem?.__temp_key__ ?? null, relations.length);\n\n return relations.map((datum, index) => ({\n ...datum,\n __temp_key__: keys[index],\n }));\n};\n\nconst { useGetRelationsQuery, useLazySearchRelationsQuery } = relationsApi;\n\nexport { useGetRelationsQuery, useLazySearchRelationsQuery };\nexport type { RelationResult };\n","import type { MainField } from './attributes';\nimport type { RelationResult } from '../../../shared/contracts/relations';\n\n/**\n * @internal\n * @description Get the label of a relation, the contract has [key: string]: unknown,\n * so we need to check if the mainFieldKey is defined and if the relation has a value\n * under that property. If it does, we then verify it's type of string and return it.\n *\n * We fallback to the documentId.\n */\nconst getRelationLabel = (relation: RelationResult, mainField?: MainField): string => {\n const label = mainField && relation[mainField.name] ? relation[mainField.name] : null;\n\n if (typeof label === 'string') {\n return label;\n }\n\n return relation.documentId;\n};\n\nexport { getRelationLabel };\n"],"names":["useDebounce","value","delay","debouncedValue","setDebouncedValue","useState","useEffect","handler","setTimeout","clearTimeout","relationsApi","contentManagerApi","injectEndpoints","endpoints","build","getRelations","query","model","id","targetField","params","url","method","config","serializeQueryArgs","args","endpointName","queryArgs","locale","status","merge","currentCache","newItems","pagination","page","results","prepareTempKeys","forceRefetch","currentArg","previousArg","pageSize","transformResponse","response","toReversed","providesTags","searchRelations","_q","idsToOmit","idsToInclude","existingIds","map","item","documentId","uniqueNewItems","filter","includes","push","relations","existingRelations","firstItem","slice","keys","generateNKeysBetween","__temp_key__","length","datum","index","useGetRelationsQuery","useLazySearchRelationsQuery","getRelationLabel","relation","mainField","label","name"],"mappings":";;;;;;AAEO,SAASA,WAAAA,CAAoBC,KAAa,EAAEC,KAAa,EAAA;AAC9D,IAAA,MAAM,CAACC,cAAAA,EAAgBC,iBAAkB,CAAA,GAAGC,cAASJ,CAAAA,KAAAA,CAAAA;IAErDK,eAAU,CAAA,IAAA;AACR,QAAA,MAAMC,UAAUC,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AAAA,CAAkBE,KAAK,CAAC,CAAA,CAAA;AAC5C,IAAA,MAAMC,OAAOC,uCAAqB,CAAA,IAAA,EAAMH,WAAWI,YAAgB,IAAA,IAAA,EAAMN,UAAUO,MAAM,CAAA;AAEzF,IAAA,OAAOP,UAAUP,GAAG,CAAC,CAACe,KAAAA,EAAOC,SAAW;AACtC,YAAA,GAAGD,KAAK;YACRF,YAAcF,EAAAA,IAAI,CAACK,KAAM;SAC3B,CAAA,CAAA;AACF,CAAA;AAEA,MAAM,EAAEC,oBAAoB,EAAEC,2BAA2B,EAAE,GAAG1D;;AC/L9D;;;;;;;IAQA,MAAM2D,gBAAmB,GAAA,CAACC,QAA0BC,EAAAA,SAAAA,GAAAA;AAClD,IAAA,MAAMC,KAAQD,GAAAA,SAAAA,IAAaD,QAAQ,CAACC,SAAUE,CAAAA,IAAI,CAAC,GAAGH,QAAQ,CAACC,SAAUE,CAAAA,IAAI,CAAC,GAAG,IAAA;IAEjF,IAAI,OAAOD,UAAU,QAAU,EAAA;QAC7B,OAAOA,KAAAA;AACT;AAEA,IAAA,OAAOF,SAASlB,UAAU;AAC5B;;;;;;;"}
1
+ {"version":3,"file":"relations-CgaydhiM.js","sources":["../../../admin/src/hooks/useDebounce.ts","../../../admin/src/services/relations.ts","../../../admin/src/utils/relations.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nexport function useDebounce<TValue>(value: TValue, delay: number): TValue {\n const [debouncedValue, setDebouncedValue] = useState(value);\n\n useEffect(() => {\n const handler = setTimeout(() => {\n setDebouncedValue(value);\n }, delay);\n\n return () => {\n clearTimeout(handler);\n };\n }, [value, delay]);\n\n return debouncedValue;\n}\n","import { generateNKeysBetween } from 'fractional-indexing';\n\nimport {\n RelationResult as RelResult,\n FindAvailable,\n FindExisting,\n} from '../../../shared/contracts/relations';\n\nimport { contentManagerApi } from './api';\n\nimport type { Modules } from '@strapi/types';\nimport type { errors } from '@strapi/utils';\n\ninterface RelationResult extends RelResult {\n __temp_key__: string;\n}\n\ntype GetRelationsResponse =\n | {\n results: Array<RelationResult>;\n pagination: {\n page: NonNullable<Modules.EntityService.Params.Pagination.PageNotation['page']>;\n pageSize: NonNullable<Modules.EntityService.Params.Pagination.PageNotation['pageSize']>;\n pageCount: number;\n total: number;\n } | null;\n error?: never;\n }\n | {\n results?: never;\n pagination?: never;\n error: errors.ApplicationError | errors.YupValidationError;\n };\n\nconst relationsApi = contentManagerApi.injectEndpoints({\n endpoints: (build) => ({\n getRelations: build.query<\n GetRelationsResponse,\n FindExisting.Params & {\n params?: FindExisting.Request['query'];\n }\n >({\n query: ({ model, id, targetField, params }) => {\n return {\n url: `/content-manager/relations/${model}/${id}/${targetField}`,\n method: 'GET',\n config: {\n params,\n },\n };\n },\n serializeQueryArgs: (args) => {\n const { endpointName, queryArgs } = args;\n return {\n endpointName,\n model: queryArgs.model,\n id: queryArgs.id,\n targetField: queryArgs.targetField,\n locale: queryArgs.params?.locale,\n status: queryArgs.params?.status,\n };\n },\n merge: (currentCache, newItems) => {\n if (currentCache.pagination && newItems.pagination) {\n if (currentCache.pagination.page < newItems.pagination.page) {\n /**\n * Relations will always have unique IDs, so we can therefore assume\n * that we only need to push the new items to the cache.\n *\n * Push new items at the beginning as latest items are shown first\n */\n currentCache.results = [\n ...prepareTempKeys(newItems.results, currentCache.results),\n ...currentCache.results,\n ];\n currentCache.pagination = newItems.pagination;\n } else if (newItems.pagination.page === 1) {\n /**\n * We're resetting the relations\n */\n currentCache.results = prepareTempKeys(newItems.results);\n currentCache.pagination = newItems.pagination;\n }\n }\n },\n forceRefetch({ currentArg, previousArg }) {\n if (!currentArg?.params && !previousArg?.params) {\n return false;\n }\n\n return (\n currentArg?.params?.page !== previousArg?.params?.page ||\n currentArg?.params?.pageSize !== previousArg?.params?.pageSize\n );\n },\n transformResponse: (response: FindExisting.Response) => {\n if ('results' in response && response.results) {\n return {\n ...response,\n results: prepareTempKeys(response.results.toReversed()),\n };\n } else {\n return response;\n }\n },\n providesTags: ['Relations'],\n }),\n searchRelations: build.query<\n FindAvailable.Response,\n FindAvailable.Params & {\n params?: FindAvailable.Request['query'];\n }\n >({\n query: ({ model, targetField, params }) => {\n return {\n url: `/content-manager/relations/${model}/${targetField}`,\n method: 'GET',\n config: {\n params,\n },\n };\n },\n serializeQueryArgs: (args) => {\n const { endpointName, queryArgs } = args;\n return {\n endpointName,\n model: queryArgs.model,\n targetField: queryArgs.targetField,\n _q: queryArgs.params?._q,\n idsToOmit: queryArgs.params?.idsToOmit,\n idsToInclude: queryArgs.params?.idsToInclude,\n };\n },\n merge: (currentCache, newItems) => {\n if (currentCache.pagination && newItems.pagination) {\n if (currentCache.pagination.page < newItems.pagination.page) {\n /**\n * Relations will always have unique IDs, so we can therefore assume\n * that we only need to push the new items to the cache.\n */\n const existingIds = currentCache.results.map((item) => item.documentId);\n const uniqueNewItems = newItems.results.filter(\n (item) => !existingIds.includes(item.documentId)\n );\n currentCache.results.push(...uniqueNewItems);\n currentCache.pagination = newItems.pagination;\n } else if (newItems.pagination.page === 1) {\n /**\n * We're resetting the relations\n */\n currentCache.results = newItems.results;\n currentCache.pagination = newItems.pagination;\n }\n }\n },\n forceRefetch({ currentArg, previousArg }) {\n if (!currentArg?.params && !previousArg?.params) {\n return false;\n }\n\n return (\n currentArg?.params?.page !== previousArg?.params?.page ||\n currentArg?.params?.pageSize !== previousArg?.params?.pageSize\n );\n },\n transformResponse: (response: FindAvailable.Response) => {\n if (response.results) {\n return {\n ...response,\n results: response.results,\n };\n } else {\n return response;\n }\n },\n }),\n }),\n});\n\n/**\n * @internal\n * @description Adds a `__temp_key__` to each relation item. This gives us\n * a stable identifier regardless of it's ids etc. that we can then use for drag and drop.\n */\nconst prepareTempKeys = (relations: RelResult[], existingRelations: RelationResult[] = []) => {\n const [firstItem] = existingRelations.slice(0);\n const keys = generateNKeysBetween(null, firstItem?.__temp_key__ ?? null, relations.length);\n\n return relations.map((datum, index) => ({\n ...datum,\n __temp_key__: keys[index],\n }));\n};\n\nconst { useGetRelationsQuery, useLazySearchRelationsQuery } = relationsApi;\n\nexport { useGetRelationsQuery, useLazySearchRelationsQuery };\nexport type { RelationResult };\n","import type { MainField } from './attributes';\nimport type { RelationResult } from '../../../shared/contracts/relations';\n\n/**\n * @internal\n * @description Get the label of a relation, the contract has [key: string]: unknown,\n * so we need to check if the mainFieldKey is defined and if the relation has a value\n * under that property. If it does, we then verify it's type of string and return it.\n *\n * We fallback to the documentId.\n */\nconst getRelationLabel = (relation: RelationResult, mainField?: MainField): string => {\n const label = mainField && relation[mainField.name] ? relation[mainField.name] : null;\n\n if (typeof label === 'string') {\n return label;\n }\n\n return relation.documentId;\n};\n\nexport { getRelationLabel };\n"],"names":["useDebounce","value","delay","debouncedValue","setDebouncedValue","useState","useEffect","handler","setTimeout","clearTimeout","relationsApi","contentManagerApi","injectEndpoints","endpoints","build","getRelations","query","model","id","targetField","params","url","method","config","serializeQueryArgs","args","endpointName","queryArgs","locale","status","merge","currentCache","newItems","pagination","page","results","prepareTempKeys","forceRefetch","currentArg","previousArg","pageSize","transformResponse","response","toReversed","providesTags","searchRelations","_q","idsToOmit","idsToInclude","existingIds","map","item","documentId","uniqueNewItems","filter","includes","push","relations","existingRelations","firstItem","slice","keys","generateNKeysBetween","__temp_key__","length","datum","index","useGetRelationsQuery","useLazySearchRelationsQuery","getRelationLabel","relation","mainField","label","name"],"mappings":";;;;;;AAEO,SAASA,WAAAA,CAAoBC,KAAa,EAAEC,KAAa,EAAA;AAC9D,IAAA,MAAM,CAACC,cAAAA,EAAgBC,iBAAkB,CAAA,GAAGC,cAASJ,CAAAA,KAAAA,CAAAA;IAErDK,eAAU,CAAA,IAAA;AACR,QAAA,MAAMC,UAAUC,UAAW,CAAA,IAAA;YACzBJ,iBAAkBH,CAAAA,KAAAA,CAAAA;SACjBC,EAAAA,KAAAA,CAAAA;QAEH,OAAO,IAAA;YACLO,YAAaF,CAAAA,OAAAA,CAAAA;AACf,SAAA;KACC,EAAA;AAACN,QAAAA,KAAAA;AA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C,CAACe,KAAAA,EAAOC,SAAW;AACtC,YAAA,GAAGD,KAAK;YACRF,YAAcF,EAAAA,IAAI,CAACK,KAAM;SAC3B,CAAA,CAAA;AACF,CAAA;AAEA,MAAM,EAAEC,oBAAoB,EAAEC,2BAA2B,EAAE,GAAG1D;;AC/L9D;;;;;;;IAQA,MAAM2D,gBAAmB,GAAA,CAACC,QAA0BC,EAAAA,SAAAA,GAAAA;AAClD,IAAA,MAAMC,KAAQD,GAAAA,SAAAA,IAAaD,QAAQ,CAACC,SAAUE,CAAAA,IAAI,CAAC,GAAGH,QAAQ,CAACC,SAAUE,CAAAA,IAAI,CAAC,GAAG,IAAA;IAEjF,IAAI,OAAOD,UAAU,QAAU,EAAA;QAC7B,OAAOA,KAAAA;AACT;AAEA,IAAA,OAAOF,SAASlB,UAAU;AAC5B;;;;;;;"}
@@ -1,6 +1,6 @@
1
1
  import { useState, useEffect } from 'react';
2
2
  import { generateNKeysBetween } from 'fractional-indexing';
3
- import { e as contentManagerApi } from './index-Deb5-YKG.mjs';
3
+ import { e as contentManagerApi } from './index-BkyR-Bnu.js';
4
4
 
5
5
  function useDebounce(value, delay) {
6
6
  const [debouncedValue, setDebouncedValue] = useState(value);
@@ -170,4 +170,4 @@ const { useGetRelationsQuery, useLazySearchRelationsQuery } = relationsApi;
170
170
  };
171
171
 
172
172
  export { useDebounce as a, useLazySearchRelationsQuery as b, getRelationLabel as g, useGetRelationsQuery as u };
173
- //# sourceMappingURL=relations-BwFH-RZe.mjs.map
173
+ //# sourceMappingURL=relations-DPVgU_rq.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"relations-DPVgU_rq.js","sources":["../../../admin/src/hooks/useDebounce.ts","../../../admin/src/services/relations.ts","../../../admin/src/utils/relations.ts"],"sourcesContent":["import { useEffect, useState } from 'react';\n\nexport function useDebounce<TValue>(value: TValue, delay: number): TValue {\n const [debouncedValue, setDebouncedValue] = useState(value);\n\n useEffect(() => {\n const handler = setTimeout(() => {\n setDebouncedValue(value);\n }, delay);\n\n return () => {\n clearTimeout(handler);\n };\n }, [value, delay]);\n\n return debouncedValue;\n}\n","import { generateNKeysBetween } from 'fractional-indexing';\n\nimport {\n RelationResult as RelResult,\n FindAvailable,\n FindExisting,\n} from '../../../shared/contracts/relations';\n\nimport { contentManagerApi } from './api';\n\nimport type { Modules } from '@strapi/types';\nimport type { errors } from '@strapi/utils';\n\ninterface RelationResult extends RelResult {\n __temp_key__: string;\n}\n\ntype GetRelationsResponse =\n | {\n results: Array<RelationResult>;\n pagination: {\n page: NonNullable<Modules.EntityService.Params.Pagination.PageNotation['page']>;\n pageSize: NonNullable<Modules.EntityService.Params.Pagination.PageNotation['pageSize']>;\n pageCount: number;\n total: number;\n } | null;\n error?: never;\n }\n | {\n results?: never;\n pagination?: never;\n error: errors.ApplicationError | errors.YupValidationError;\n };\n\nconst relationsApi = contentManagerApi.injectEndpoints({\n endpoints: (build) => ({\n getRelations: build.query<\n GetRelationsResponse,\n FindExisting.Params & {\n params?: FindExisting.Request['query'];\n }\n >({\n query: ({ model, id, targetField, params }) => {\n return {\n url: `/content-manager/relations/${model}/${id}/${targetField}`,\n method: 'GET',\n config: {\n params,\n },\n };\n },\n serializeQueryArgs: (args) => {\n const { endpointName, queryArgs } = args;\n return {\n endpointName,\n model: queryArgs.model,\n id: queryArgs.id,\n targetField: queryArgs.targetField,\n locale: queryArgs.params?.locale,\n status: queryArgs.params?.status,\n };\n },\n merge: (currentCache, newItems) => {\n if (currentCache.pagination && newItems.pagination) {\n if (currentCache.pagination.page < newItems.pagination.page) {\n /**\n * Relations will always have unique IDs, so we can therefore assume\n * that we only need to push the new items to the cache.\n *\n * Push new items at the beginning as latest items are shown first\n */\n currentCache.results = [\n ...prepareTempKeys(newItems.results, currentCache.results),\n ...currentCache.results,\n ];\n currentCache.pagination = newItems.pagination;\n } else if (newItems.pagination.page === 1) {\n /**\n * We're resetting the relations\n */\n currentCache.results = prepareTempKeys(newItems.results);\n currentCache.pagination = newItems.pagination;\n }\n }\n },\n forceRefetch({ currentArg, previousArg }) {\n if (!currentArg?.params && !previousArg?.params) {\n return false;\n }\n\n return (\n currentArg?.params?.page !== previousArg?.params?.page ||\n currentArg?.params?.pageSize !== previousArg?.params?.pageSize\n );\n },\n transformResponse: (response: FindExisting.Response) => {\n if ('results' in response && response.results) {\n return {\n ...response,\n results: prepareTempKeys(response.results.toReversed()),\n };\n } else {\n return response;\n }\n },\n providesTags: ['Relations'],\n }),\n searchRelations: build.query<\n FindAvailable.Response,\n FindAvailable.Params & {\n params?: FindAvailable.Request['query'];\n }\n >({\n query: ({ model, targetField, params }) => {\n return {\n url: `/content-manager/relations/${model}/${targetField}`,\n method: 'GET',\n config: {\n params,\n },\n };\n },\n serializeQueryArgs: (args) => {\n const { endpointName, queryArgs } = args;\n return {\n endpointName,\n model: queryArgs.model,\n targetField: queryArgs.targetField,\n _q: queryArgs.params?._q,\n idsToOmit: queryArgs.params?.idsToOmit,\n idsToInclude: queryArgs.params?.idsToInclude,\n };\n },\n merge: (currentCache, newItems) => {\n if (currentCache.pagination && newItems.pagination) {\n if (currentCache.pagination.page < newItems.pagination.page) {\n /**\n * Relations will always have unique IDs, so we can therefore assume\n * that we only need to push the new items to the cache.\n */\n const existingIds = currentCache.results.map((item) => item.documentId);\n const uniqueNewItems = newItems.results.filter(\n (item) => !existingIds.includes(item.documentId)\n );\n currentCache.results.push(...uniqueNewItems);\n currentCache.pagination = newItems.pagination;\n } else if (newItems.pagination.page === 1) {\n /**\n * We're resetting the relations\n */\n currentCache.results = newItems.results;\n currentCache.pagination = newItems.pagination;\n }\n }\n },\n forceRefetch({ currentArg, previousArg }) {\n if (!currentArg?.params && !previousArg?.params) {\n return false;\n }\n\n return (\n currentArg?.params?.page !== previousArg?.params?.page ||\n currentArg?.params?.pageSize !== previousArg?.params?.pageSize\n );\n },\n transformResponse: (response: FindAvailable.Response) => {\n if (response.results) {\n return {\n ...response,\n results: response.results,\n };\n } else {\n return response;\n }\n },\n }),\n }),\n});\n\n/**\n * @internal\n * @description Adds a `__temp_key__` to each relation item. This gives us\n * a stable identifier regardless of it's ids etc. that we can then use for drag and drop.\n */\nconst prepareTempKeys = (relations: RelResult[], existingRelations: RelationResult[] = []) => {\n const [firstItem] = existingRelations.slice(0);\n const keys = generateNKeysBetween(null, firstItem?.__temp_key__ ?? null, relations.length);\n\n return relations.map((datum, index) => ({\n ...datum,\n __temp_key__: keys[index],\n }));\n};\n\nconst { useGetRelationsQuery, useLazySearchRelationsQuery } = relationsApi;\n\nexport { useGetRelationsQuery, useLazySearchRelationsQuery };\nexport type { RelationResult };\n","import type { MainField } from './attributes';\nimport type { RelationResult } from '../../../shared/contracts/relations';\n\n/**\n * @internal\n * @description Get the label of a relation, the contract has [key: string]: unknown,\n * so we need to check if the mainFieldKey is defined and if the relation has a value\n * under that property. If it does, we then verify it's type of string and return it.\n *\n * We fallback to the documentId.\n */\nconst getRelationLabel = (relation: RelationResult, mainField?: MainField): string => {\n const label = mainField && relation[mainField.name] ? relation[mainField.name] : null;\n\n if (typeof label === 'string') {\n return label;\n }\n\n return relation.documentId;\n};\n\nexport { getRelationLabel };\n"],"names":["useDebounce","value","delay","debouncedValue","setDebouncedValue","useState","useEffect","handler","setTimeout","clearTimeout","relationsApi","contentManagerApi","injectEndpoints","endpoints","build","getRelations","query","model","id","targetField","params","url","method","config","serializeQueryArgs","args","endpointName","queryArgs","locale","status","merge","currentCache","newItems","pagination","page","results","prepareTempKeys","forceRefetch","currentArg","previousArg","pageSize","transformResponse","response","toReversed","providesTags","searchRelations","_q","idsToOmit","idsToInclude","existingIds","map","item","documentId","uniqueNewItems","filter","includes","push","relations","existingRelations","firstItem","slice","keys","generateNKeysBetween","__temp_key__","length","datum","index","useGetRelationsQuery","useLazySearchRelationsQuery","getRelationLabel","relation","mainField","label","name"],"mappings":";;;;AAEO,SAASA,WAAAA,CAAoBC,KAAa,EAAEC,KAAa,EAAA;AAC9D,IAAA,MAAM,CAACC,cAAAA,EAAgBC,iBAAkB,C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,CAACqB,SAAAA,EAAwBC,oBAAsC,EAAE,GAAA;AACvF,IAAA,MAAM,CAACC,SAAAA,CAAU,GAAGD,iBAAAA,CAAkBE,KAAK,CAAC,CAAA,CAAA;AAC5C,IAAA,MAAMC,OAAOC,oBAAqB,CAAA,IAAA,EAAMH,WAAWI,YAAgB,IAAA,IAAA,EAAMN,UAAUO,MAAM,CAAA;AAEzF,IAAA,OAAOP,UAAUP,GAAG,CAAC,CAACe,KAAAA,EAAOC,SAAW;AACtC,YAAA,GAAGD,KAAK;YACRF,YAAcF,EAAAA,IAAI,CAACK,KAAM;SAC3B,CAAA,CAAA;AACF,CAAA;AAEA,MAAM,EAAEC,oBAAoB,EAAEC,2BAA2B,EAAE,GAAG1D;;AC/L9D;;;;;;;IAQA,MAAM2D,gBAAmB,GAAA,CAACC,QAA0BC,EAAAA,SAAAA,GAAAA;AAClD,IAAA,MAAMC,KAAQD,GAAAA,SAAAA,IAAaD,QAAQ,CAACC,SAAUE,CAAAA,IAAI,CAAC,GAAGH,QAAQ,CAACC,SAAUE,CAAAA,IAAI,CAAC,GAAG,IAAA;IAEjF,IAAI,OAAOD,UAAU,QAAU,EAAA;QAC7B,OAAOA,KAAAA;AACT;AAEA,IAAA,OAAOF,SAASlB,UAAU;AAC5B;;;;"}
@@ -227,4 +227,4 @@ var ru = {
227
227
  };
228
228
 
229
229
  export { ru as default };
230
- //# sourceMappingURL=ru-CB4BUyQp.mjs.map
230
+ //# sourceMappingURL=ru-CB4BUyQp.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ru-CB4BUyQp.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"ru-CB4BUyQp.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -193,4 +193,4 @@ var sa = {
193
193
  };
194
194
 
195
195
  export { sa as default, groups, models, pageNotFound };
196
- //# sourceMappingURL=sa-n_aPA-pU.mjs.map
196
+ //# sourceMappingURL=sa-n_aPA-pU.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sa-n_aPA-pU.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -195,4 +195,4 @@ var sk = {
195
195
  };
196
196
 
197
197
  export { sk as default, groups, models, pageNotFound };
198
- //# sourceMappingURL=sk-tn_BDjE2.mjs.map
198
+ //# sourceMappingURL=sk-tn_BDjE2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sk-tn_BDjE2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -195,4 +195,4 @@ var sv = {
195
195
  };
196
196
 
197
197
  export { sv as default, groups, models, pageNotFound };
198
- //# sourceMappingURL=sv-cq4ZrQRd.mjs.map
198
+ //# sourceMappingURL=sv-cq4ZrQRd.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sv-cq4ZrQRd.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -141,4 +141,4 @@ var th = {
141
141
  };
142
142
 
143
143
  export { th as default, groups, models, pageNotFound };
144
- //# sourceMappingURL=th-mUH7hEtc.mjs.map
144
+ //# sourceMappingURL=th-mUH7hEtc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"th-mUH7hEtc.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -192,4 +192,4 @@ var tr = {
192
192
  };
193
193
 
194
194
  export { tr as default, groups, models, pageNotFound };
195
- //# sourceMappingURL=tr-Yt38daxh.mjs.map
195
+ //# sourceMappingURL=tr-Yt38daxh.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tr-Yt38daxh.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -137,4 +137,4 @@ var uk = {
137
137
  };
138
138
 
139
139
  export { uk as default, groups, models, pageNotFound };
140
- //# sourceMappingURL=uk-Cpgmm7gE.mjs.map
140
+ //# sourceMappingURL=uk-Cpgmm7gE.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uk-Cpgmm7gE.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -244,4 +244,4 @@ const DROP_SENSITIVITY = {
244
244
  };
245
245
 
246
246
  export { DROP_SENSITIVITY as D, ItemTypes as I, DIRECTIONS as a, useDragAndDrop as u };
247
- //# sourceMappingURL=useDragAndDrop-HYwNDExe.mjs.map
247
+ //# sourceMappingURL=useDragAndDrop-HYwNDExe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useDragAndDrop-HYwNDExe.js","sources":["../../../admin/src/constants/dragAndDrop.ts","../../../admin/src/hooks/useKeyboardDragAndDrop.ts","../../../admin/src/hooks/useDragAndDrop.ts"],"sourcesContent":["export const ItemTypes = {\n COMPONENT: 'component',\n EDIT_FIELD: 'editField',\n FIELD: 'field',\n DYNAMIC_ZONE: 'dynamicZone',\n RELATION: 'relation',\n BLOCKS: 'blocks',\n} as const;\n","import * as React from 'react';\n\nexport type UseKeyboardDragAndDropCallbacks<TIndex extends number | Array<number> = number> = {\n onCancel?: (index: TIndex) => void;\n onDropItem?: (currentIndex: TIndex, newIndex?: TIndex) => void;\n onGrabItem?: (index: TIndex) => void;\n onMoveItem?: (newIndex: TIndex, currentIndex: TIndex) => void;\n};\n\n/**\n * Utility hook designed to implement keyboard accessibile drag and drop by\n * returning an onKeyDown handler to be passed to the drag icon button.\n *\n * @internal - You should use `useDragAndDrop` instead.\n */\nexport const useKeyboardDragAndDrop = <TIndex extends number | Array<number> = number>(\n active: boolean,\n index: TIndex,\n { onCancel, onDropItem, onGrabItem, onMoveItem }: UseKeyboardDragAndDropCallbacks<TIndex>\n) => {\n const [isSelected, setIsSelected] = React.useState(false);\n\n const handleMove = (movement: 'UP' | 'DOWN') => {\n if (!isSelected) {\n return;\n }\n if (typeof index === 'number' && onMoveItem) {\n if (movement === 'UP') {\n onMoveItem((index - 1) as TIndex, index);\n } else if (movement === 'DOWN') {\n onMoveItem((index + 1) as TIndex, index);\n }\n }\n };\n\n const handleDragClick = () => {\n if (isSelected) {\n if (onDropItem) {\n onDropItem(index);\n }\n setIsSelected(false);\n } else {\n if (onGrabItem) {\n onGrabItem(index);\n }\n setIsSelected(true);\n }\n };\n\n const handleCancel = () => {\n if (isSelected) {\n setIsSelected(false);\n\n if (onCancel) {\n onCancel(index);\n }\n }\n };\n\n const handleKeyDown = <E extends Element>(e: React.KeyboardEvent<E>) => {\n if (!active) {\n return;\n }\n\n if (e.key === 'Tab' && !isSelected) {\n return;\n }\n\n e.preventDefault();\n\n switch (e.key) {\n case ' ':\n case 'Enter':\n handleDragClick();\n break;\n\n case 'Escape':\n handleCancel();\n break;\n\n case 'ArrowDown':\n case 'ArrowRight':\n handleMove('DOWN');\n break;\n\n case 'ArrowUp':\n case 'ArrowLeft':\n handleMove('UP');\n break;\n\n default:\n }\n };\n\n return handleKeyDown;\n};\n","import * as React from 'react';\n\nimport {\n useDrag,\n useDrop,\n type HandlerManager,\n type ConnectDragSource,\n type ConnectDropTarget,\n type ConnectDragPreview,\n type DragSourceMonitor,\n} from 'react-dnd';\n\nimport {\n useKeyboardDragAndDrop,\n type UseKeyboardDragAndDropCallbacks,\n} from './useKeyboardDragAndDrop';\n\nimport type { Data } from '@strapi/types';\n\nconst DIRECTIONS = {\n UPWARD: 'upward',\n DOWNWARD: 'downward',\n} as const;\n\nconst DROP_SENSITIVITY = {\n REGULAR: 'regular',\n IMMEDIATE: 'immediate',\n} as const;\n\ninterface UseDragAndDropOptions<\n TIndex extends number | Array<number> = number,\n TItem extends { index: TIndex } = { index: TIndex },\n> extends UseKeyboardDragAndDropCallbacks<TIndex> {\n type?: string;\n index: TIndex;\n item?: TItem;\n onStart?: () => void;\n onEnd?: () => void;\n dropSensitivity?: (typeof DROP_SENSITIVITY)[keyof typeof DROP_SENSITIVITY];\n}\n\ntype Identifier = ReturnType<HandlerManager['getHandlerId']>;\n\ntype UseDragAndDropReturn<E extends Element = HTMLElement> = [\n props: {\n handlerId: Identifier;\n isDragging: boolean;\n handleKeyDown: <E extends Element>(event: React.KeyboardEvent<E>) => void;\n isOverDropTarget: boolean;\n direction: (typeof DIRECTIONS)[keyof typeof DIRECTIONS] | null;\n },\n objectRef: React.RefObject<E>,\n dropRef: ConnectDropTarget,\n dragRef: ConnectDragSource,\n dragPreviewRef: ConnectDragPreview,\n];\n\ntype DropCollectedProps = {\n handlerId: Identifier;\n isOver: boolean;\n};\n\n/**\n * A utility hook abstracting the general drag and drop hooks from react-dnd.\n * Centralising the same behaviours and by default offering keyboard support.\n */\nconst useDragAndDrop = <\n TIndex extends number | Array<number>,\n TItem extends { index: TIndex; id?: Data.ID; [key: string]: unknown } = {\n index: TIndex;\n [key: string]: unknown;\n },\n E extends Element = HTMLElement,\n>(\n active: boolean,\n {\n type = 'STRAPI_DND',\n index,\n item,\n onStart,\n onEnd,\n onGrabItem,\n onDropItem,\n onCancel,\n onMoveItem,\n dropSensitivity = DROP_SENSITIVITY.REGULAR,\n }: UseDragAndDropOptions<TIndex, TItem>\n): UseDragAndDropReturn<E> => {\n const objectRef = React.useRef<E>(null);\n\n const [{ handlerId, isOver }, dropRef] = useDrop<TItem, void, DropCollectedProps>({\n accept: type,\n collect(monitor) {\n return {\n handlerId: monitor.getHandlerId(),\n isOver: monitor.isOver({ shallow: true }),\n };\n },\n drop(item) {\n const draggedIndex = item.index;\n const newIndex = index;\n\n if (isOver && onDropItem) {\n onDropItem(draggedIndex, newIndex);\n }\n },\n hover(item, monitor) {\n if (!objectRef.current || !onMoveItem) {\n return;\n }\n\n const dragIndex = item.index;\n const newIndex = index;\n\n const hoverBoundingRect = objectRef.current?.getBoundingClientRect();\n const hoverMiddleY = (hoverBoundingRect.bottom - hoverBoundingRect.top) / 2;\n const clientOffset = monitor.getClientOffset();\n if (!clientOffset) return;\n\n const hoverClientY = clientOffset && clientOffset.y - hoverBoundingRect.top;\n if (typeof dragIndex === 'number' && typeof newIndex === 'number') {\n if (dragIndex === newIndex) {\n // Don't replace items with themselves\n return;\n }\n\n if (dropSensitivity === DROP_SENSITIVITY.REGULAR) {\n // Dragging downwards\n if (dragIndex < newIndex && hoverClientY < hoverMiddleY) {\n return;\n }\n\n // Dragging upwards\n if (dragIndex > newIndex && hoverClientY > hoverMiddleY) {\n return;\n }\n }\n\n // Time to actually perform the action\n onMoveItem(newIndex, dragIndex);\n item.index = newIndex;\n } else {\n // Using numbers as indices doesn't work for nested list items with path like [1, 1, 0]\n if (Array.isArray(dragIndex) && Array.isArray(newIndex)) {\n // Indices comparison to find item position in nested list\n const minLength = Math.min(dragIndex.length, newIndex.length);\n let areEqual = true;\n let isLessThan = false;\n let isGreaterThan = false;\n\n for (let i = 0; i < minLength; i++) {\n if (dragIndex[i] < newIndex[i]) {\n isLessThan = true;\n areEqual = false;\n break;\n } else if (dragIndex[i] > newIndex[i]) {\n isGreaterThan = true;\n areEqual = false;\n break;\n }\n }\n\n // Don't replace items with themselves\n if (areEqual && dragIndex.length === newIndex.length) {\n return;\n }\n\n if (dropSensitivity === DROP_SENSITIVITY.REGULAR) {\n // Dragging downwards\n if (isLessThan && !isGreaterThan && hoverClientY < hoverMiddleY) {\n return;\n }\n\n // Dragging upwards\n if (isGreaterThan && !isLessThan && hoverClientY > hoverMiddleY) {\n return;\n }\n }\n }\n\n onMoveItem(newIndex, dragIndex);\n item.index = newIndex;\n }\n },\n });\n\n const getDragDirection = (monitor: DragSourceMonitor<TItem, void>) => {\n if (\n monitor &&\n monitor.isDragging() &&\n !monitor.didDrop() &&\n monitor.getInitialClientOffset() &&\n monitor.getClientOffset()\n ) {\n const deltaY = monitor.getInitialClientOffset()!.y - monitor.getClientOffset()!.y;\n\n if (deltaY > 0) return DIRECTIONS.UPWARD;\n\n if (deltaY < 0) return DIRECTIONS.DOWNWARD;\n\n return null;\n }\n\n return null;\n };\n\n const [{ isDragging, direction }, dragRef, dragPreviewRef] = useDrag({\n type,\n item() {\n if (onStart) {\n onStart();\n }\n\n /**\n * This will be attached and it helps define the preview sizes\n * when a component is flexy e.g. Relations\n */\n const { width } = objectRef.current?.getBoundingClientRect() ?? {};\n\n return { index, width, ...item };\n },\n end() {\n if (onEnd) {\n onEnd();\n }\n },\n canDrag: active,\n /**\n * This is useful when the item is in a virtualized list.\n * However, if we don't have an ID then we want the libraries\n * defaults to take care of this.\n */\n isDragging: item?.id\n ? (monitor) => {\n return item.id === monitor.getItem().id;\n }\n : undefined,\n collect: (monitor) => ({\n isDragging: monitor.isDragging(),\n initialOffset: monitor.getInitialClientOffset(),\n currentOffset: monitor.getClientOffset(),\n direction: getDragDirection(monitor),\n }),\n });\n\n const handleKeyDown = useKeyboardDragAndDrop(active, index, {\n onGrabItem,\n onDropItem,\n onCancel,\n onMoveItem,\n });\n\n return [\n { handlerId, isDragging, handleKeyDown, isOverDropTarget: isOver, direction },\n objectRef,\n dropRef,\n dragRef,\n dragPreviewRef,\n ];\n};\n\nexport {\n useDragAndDrop,\n UseDragAndDropReturn,\n UseDragAndDropOptions,\n DIRECTIONS,\n DROP_SENSITIVITY,\n};\n"],"names":["ItemTypes","COMPONENT","EDIT_FIELD","FIELD","DYNAMIC_ZONE","RELATION","BLOCKS","useKeyboardDragAndDrop","active","index","onCancel","onDropItem","onGrabItem","onMoveItem","isSelected","setIsSelected","React","useState","handleMove","movement","handleDragClick","handleCancel","handleKeyDown","e","key","preventDefault","DIRECTIONS","UPWARD","DOWNWARD","DROP_SENSITIVITY","REGULAR","IMMEDIATE","useDragAndDrop","type","item","onStart","onEnd","dropSensitivity","objectRef","useRef","handlerId","isOver","dropRef","useDrop","accept","collect","monitor","getHandlerId","shallow","drop","draggedIndex","newIndex","hover","current","dragIndex","hoverBoundingRect","getBoundingClientRect","hoverMiddleY","bottom","top","clientOffset","getClientOffset","hoverClientY","y","Array","isArray","minLength","Math","min","length","areEqual","isLessThan","isGreaterThan","i","getDragDirection","isDragging","didDrop","getInitialClientOffset","deltaY","direction","dragRef","dragPreviewRef","useDrag","width","end","canDrag","id","getItem","undefined","initialOffset","currentOffset","isOverDropTarget"],"mappings":";;;MAAaA,SAAY,GAAA;IACvBC,SAAW,EAAA,WAAA;IACXC,UAAY,EAAA,WAAA;IACZC,KAAO,EAAA,OAAA;IACPC,YAAc,EAAA,aAAA;IACdC,QAAU,EAAA,UAAA;IACVC,MAAQ,EAAA;AACV;;ACEA;;;;;AAKC,IACM,MAAMC,sBAAyB,GAAA,CACpCC,QACAC,KACA,EAAA,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,UAAU,EAAEC,UAAU,EAA2C,GAAA;AAEzF,IAAA,MAAM,CAACC,UAAYC,EAAAA,aAAAA,CAAc,GAAGC,KAAAA,CAAMC,QAAQ,CAAC,KAAA,CAAA;AAEnD,IAAA,MAAMC,aAAa,CAACC,QAAAA,GAAAA;AAClB,QAAA,IAAI,CAACL,UAAY,EAAA;AACf,YAAA;AACF;QACA,IAAI,OAAOL,KAAU,KAAA,QAAA,IAAYI,UAAY,EAAA;AAC3C,YAAA,IAAIM,aAAa,IAAM,EAAA;AACrBN,gBAAAA,UAAAA,CAAYJ,QAAQ,CAAcA,EAAAA,KAAAA,CAAAA;aAC7B,MAAA,IAAIU,aAA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B,aAAAA,GAAgBf,sBAAuBC,CAAAA,MAAAA,EAAQC,KAAO,EAAA;AAC1DG,QAAAA,UAAAA;AACAD,QAAAA,UAAAA;AACAD,QAAAA,QAAAA;AACAG,QAAAA;AACF,KAAA,CAAA;IAEA,OAAO;AACL,QAAA;AAAE2B,YAAAA,SAAAA;AAAWmC,YAAAA,UAAAA;AAAYrD,YAAAA,aAAAA;YAAeqE,gBAAkBlD,EAAAA,MAAAA;AAAQsC,YAAAA;AAAU,SAAA;AAC5EzC,QAAAA,SAAAA;AACAI,QAAAA,OAAAA;AACAsC,QAAAA,OAAAA;AACAC,QAAAA;AACD,KAAA;AACH;;;;"}
@@ -15,4 +15,4 @@ const usePrev = (value)=>{
15
15
  };
16
16
 
17
17
  export { prefixFileUrlWithBackendUrl as p, usePrev as u };
18
- //# sourceMappingURL=usePrev-Bjw2dhmq.mjs.map
18
+ //# sourceMappingURL=usePrev-Bjw2dhmq.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usePrev-Bjw2dhmq.js","sources":["../../../admin/src/utils/urls.ts","../../../admin/src/hooks/usePrev.ts"],"sourcesContent":["const prefixFileUrlWithBackendUrl = (fileURL?: string): string | undefined => {\n return !!fileURL && fileURL.startsWith('/') ? `${window.strapi.backendURL}${fileURL}` : fileURL;\n};\n\nexport { prefixFileUrlWithBackendUrl };\n","import { useEffect, useRef } from 'react';\n\nexport const usePrev = <T>(value: T): T | undefined => {\n const ref = useRef<T>();\n\n useEffect(() => {\n ref.current = value;\n }, [value]);\n\n return ref.current;\n};\n"],"names":["prefixFileUrlWithBackendUrl","fileURL","startsWith","window","strapi","backendURL","usePrev","value","ref","useRef","useEffect","current"],"mappings":";;AAAA,MAAMA,8BAA8B,CAACC,OAAAA,GAAAA;AACnC,IAAA,OAAO,CAAC,CAACA,OAAAA,IAAWA,OAAQC,CAAAA,UAAU,CAAC,GAAO,CAAA,GAAA,CAAC,EAAEC,MAAAA,CAAOC,MAAM,CAACC,UAAU,CAAC,EAAEJ,OAAAA,CAAQ,CAAC,GAAGA,OAAAA;AAC1F;;ACAO,MAAMK,UAAU,CAAIC,KAAAA,GAAAA;AACzB,IAAA,MAAMC,GAAMC,GAAAA,MAAAA,EAAAA;IAEZC,SAAU,CAAA,IAAA;AACRF,QAAAA,GAAAA,CAAIG,OAAO,GAAGJ,KAAAA;KACb,EAAA;AAACA,QAAAA;AAAM,KAAA,CAAA;AAEV,IAAA,OAAOC,IAAIG,OAAO;AACpB;;;;"}
@@ -105,4 +105,4 @@ var vi = {
105
105
  };
106
106
 
107
107
  export { vi as default, groups, pageNotFound };
108
- //# sourceMappingURL=vi-CvBGlTjr.mjs.map
108
+ //# sourceMappingURL=vi-CvBGlTjr.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vi-CvBGlTjr.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -202,4 +202,4 @@ var zh = {
202
202
  };
203
203
 
204
204
  export { zh as default, groups, models, pageNotFound };
205
- //# sourceMappingURL=zh-BmF-sHaT.mjs.map
205
+ //# sourceMappingURL=zh-BmF-sHaT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"zh-BmF-sHaT.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -931,4 +931,4 @@ var zhHans = {
931
931
  };
932
932
 
933
933
  export { Analytics, Documentation, Email, Password, Provider, ResetPasswordToken, Role, Username, Users, anErrorOccurred, clearLabel, dark, zhHans as default, light, or, selectButtonTitle, skipToContent, submit };
934
- //# sourceMappingURL=zh-Hans-CI0HKio3.mjs.map
934
+ //# sourceMappingURL=zh-Hans-CI0HKio3.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"zh-Hans-CI0HKio3.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  require('@strapi/icons');
6
- var index = require('./chunks/index-OSrndyon.js');
6
+ var index = require('./chunks/index-BczuAULz.js');
7
7
  require('react/jsx-runtime');
8
8
  require('@strapi/admin/strapi-admin');
9
9
  require('react');
@@ -1,5 +1,5 @@
1
1
  import '@strapi/icons';
2
- export { l as DocumentRBAC, D as DocumentStatus, d as buildValidParams, O as default, Q as unstable_useContentManagerContext, M as unstable_useDocument, U as unstable_useDocumentActions, h as unstable_useDocumentLayout, f as useDocumentRBAC } from './chunks/index-Deb5-YKG.mjs';
2
+ export { l as DocumentRBAC, D as DocumentStatus, d as buildValidParams, O as default, Q as unstable_useContentManagerContext, M as unstable_useDocument, U as unstable_useDocumentActions, h as unstable_useDocumentLayout, f as useDocumentRBAC } from './chunks/index-BkyR-Bnu.js';
3
3
  import 'react/jsx-runtime';
4
4
  import '@strapi/admin/strapi-admin';
5
5
  import 'react';
@@ -1,55 +1,7 @@
1
1
  import { BaseRange, NodeEntry } from 'slate';
2
2
  import { type BlocksStore } from '../BlocksEditor';
3
3
  import 'prismjs/themes/prism-solarizedlight.css';
4
- import 'prismjs/components/prism-asmatmel';
5
- import 'prismjs/components/prism-bash';
6
- import 'prismjs/components/prism-basic';
7
- import 'prismjs/components/prism-c';
8
- import 'prismjs/components/prism-clojure';
9
- import 'prismjs/components/prism-cobol';
10
- import 'prismjs/components/prism-cpp';
11
- import 'prismjs/components/prism-csharp';
12
- import 'prismjs/components/prism-dart';
13
- import 'prismjs/components/prism-docker';
14
- import 'prismjs/components/prism-elixir';
15
- import 'prismjs/components/prism-erlang';
16
- import 'prismjs/components/prism-fortran';
17
- import 'prismjs/components/prism-fsharp';
18
- import 'prismjs/components/prism-go';
19
- import 'prismjs/components/prism-graphql';
20
- import 'prismjs/components/prism-groovy';
21
- import 'prismjs/components/prism-haskell';
22
- import 'prismjs/components/prism-haxe';
23
- import 'prismjs/components/prism-ini';
24
- import 'prismjs/components/prism-java';
25
- import 'prismjs/components/prism-javascript';
26
- import 'prismjs/components/prism-jsx';
27
- import 'prismjs/components/prism-json';
28
- import 'prismjs/components/prism-julia';
29
- import 'prismjs/components/prism-kotlin';
30
- import 'prismjs/components/prism-latex';
31
- import 'prismjs/components/prism-lua';
32
- import 'prismjs/components/prism-markdown';
33
- import 'prismjs/components/prism-matlab';
34
- import 'prismjs/components/prism-makefile';
35
- import 'prismjs/components/prism-objectivec';
36
- import 'prismjs/components/prism-perl';
37
- import 'prismjs/components/prism-php';
38
- import 'prismjs/components/prism-powershell';
39
- import 'prismjs/components/prism-python';
40
- import 'prismjs/components/prism-r';
41
- import 'prismjs/components/prism-ruby';
42
- import 'prismjs/components/prism-rust';
43
- import 'prismjs/components/prism-sas';
44
- import 'prismjs/components/prism-scala';
45
- import 'prismjs/components/prism-scheme';
46
- import 'prismjs/components/prism-sql';
47
- import 'prismjs/components/prism-stata';
48
- import 'prismjs/components/prism-swift';
49
- import 'prismjs/components/prism-typescript';
50
- import 'prismjs/components/prism-tsx';
51
- import 'prismjs/components/prism-vbnet';
52
- import 'prismjs/components/prism-yaml';
4
+ import './utils/prismLanguages';
53
5
  type BaseRangeCustom = BaseRange & {
54
6
  className: string;
55
7
  };
@@ -0,0 +1,50 @@
1
+ import 'prismjs';
2
+ import 'prismjs/components/prism-asmatmel';
3
+ import 'prismjs/components/prism-bash';
4
+ import 'prismjs/components/prism-basic';
5
+ import 'prismjs/components/prism-c';
6
+ import 'prismjs/components/prism-clojure';
7
+ import 'prismjs/components/prism-cobol';
8
+ import 'prismjs/components/prism-cpp';
9
+ import 'prismjs/components/prism-csharp';
10
+ import 'prismjs/components/prism-dart';
11
+ import 'prismjs/components/prism-docker';
12
+ import 'prismjs/components/prism-elixir';
13
+ import 'prismjs/components/prism-erlang';
14
+ import 'prismjs/components/prism-fortran';
15
+ import 'prismjs/components/prism-fsharp';
16
+ import 'prismjs/components/prism-go';
17
+ import 'prismjs/components/prism-graphql';
18
+ import 'prismjs/components/prism-groovy';
19
+ import 'prismjs/components/prism-haskell';
20
+ import 'prismjs/components/prism-haxe';
21
+ import 'prismjs/components/prism-ini';
22
+ import 'prismjs/components/prism-java';
23
+ import 'prismjs/components/prism-javascript';
24
+ import 'prismjs/components/prism-jsx';
25
+ import 'prismjs/components/prism-json';
26
+ import 'prismjs/components/prism-julia';
27
+ import 'prismjs/components/prism-kotlin';
28
+ import 'prismjs/components/prism-latex';
29
+ import 'prismjs/components/prism-lua';
30
+ import 'prismjs/components/prism-markdown';
31
+ import 'prismjs/components/prism-matlab';
32
+ import 'prismjs/components/prism-makefile';
33
+ import 'prismjs/components/prism-objectivec';
34
+ import 'prismjs/components/prism-perl';
35
+ import 'prismjs/components/prism-php';
36
+ import 'prismjs/components/prism-powershell';
37
+ import 'prismjs/components/prism-python';
38
+ import 'prismjs/components/prism-r';
39
+ import 'prismjs/components/prism-ruby';
40
+ import 'prismjs/components/prism-rust';
41
+ import 'prismjs/components/prism-sas';
42
+ import 'prismjs/components/prism-scala';
43
+ import 'prismjs/components/prism-scheme';
44
+ import 'prismjs/components/prism-sql';
45
+ import 'prismjs/components/prism-stata';
46
+ import 'prismjs/components/prism-swift';
47
+ import 'prismjs/components/prism-typescript';
48
+ import 'prismjs/components/prism-tsx';
49
+ import 'prismjs/components/prism-vbnet';
50
+ import 'prismjs/components/prism-yaml';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/content-manager",
3
- "version": "0.0.0-experimental.ce3ce68ff05de341bbdb48e7164d5367cffa839c",
3
+ "version": "0.0.0-experimental.cf8bb33f3f3ac8c6469f469802867e9fc2005e58",
4
4
  "description": "A powerful UI to easily manage your data.",
5
5
  "repository": {
6
6
  "type": "git",
@@ -66,8 +66,8 @@
66
66
  "@sindresorhus/slugify": "1.1.0",
67
67
  "@strapi/design-system": "2.0.0-rc.14",
68
68
  "@strapi/icons": "2.0.0-rc.14",
69
- "@strapi/types": "0.0.0-experimental.ce3ce68ff05de341bbdb48e7164d5367cffa839c",
70
- "@strapi/utils": "0.0.0-experimental.ce3ce68ff05de341bbdb48e7164d5367cffa839c",
69
+ "@strapi/types": "0.0.0-experimental.cf8bb33f3f3ac8c6469f469802867e9fc2005e58",
70
+ "@strapi/utils": "0.0.0-experimental.cf8bb33f3f3ac8c6469f469802867e9fc2005e58",
71
71
  "codemirror5": "npm:codemirror@^5.65.11",
72
72
  "date-fns": "2.30.0",
73
73
  "fractional-indexing": "3.2.0",
@@ -102,8 +102,8 @@
102
102
  "yup": "0.32.9"
103
103
  },
104
104
  "devDependencies": {
105
- "@strapi/admin": "0.0.0-experimental.ce3ce68ff05de341bbdb48e7164d5367cffa839c",
106
- "@strapi/database": "0.0.0-experimental.ce3ce68ff05de341bbdb48e7164d5367cffa839c",
105
+ "@strapi/admin": "0.0.0-experimental.cf8bb33f3f3ac8c6469f469802867e9fc2005e58",
106
+ "@strapi/database": "0.0.0-experimental.cf8bb33f3f3ac8c6469f469802867e9fc2005e58",
107
107
  "@testing-library/react": "15.0.7",
108
108
  "@types/jest": "29.5.2",
109
109
  "@types/lodash": "^4.14.191",
@@ -1 +0,0 @@
1
- {"version":3,"file":"CardDragPreview-DwuraT0K.mjs","sources":["../../../admin/src/components/DragPreviews/CardDragPreview.tsx"],"sourcesContent":["import { Flex, FlexComponent, Typography } from '@strapi/design-system';\nimport { Cross, Drag, Pencil } from '@strapi/icons';\nimport { styled } from 'styled-components';\n\ninterface CardDragPreviewProps {\n label: string;\n isSibling?: boolean;\n}\n\nconst CardDragPreview = ({ label, isSibling = false }: CardDragPreviewProps) => {\n return (\n <FieldContainer\n background={isSibling ? 'neutral100' : 'primary100'}\n display=\"inline-flex\"\n gap={3}\n hasRadius\n justifyContent=\"space-between\"\n $isSibling={isSibling}\n max-height={`3.2rem`}\n maxWidth=\"min-content\"\n >\n <Flex gap={3}>\n <DragButton alignItems=\"center\" cursor=\"all-scroll\" padding={3}>\n <Drag />\n </DragButton>\n\n <Typography\n textColor={isSibling ? undefined : 'primary600'}\n fontWeight=\"bold\"\n ellipsis\n maxWidth=\"7.2rem\"\n >\n {label}\n </Typography>\n </Flex>\n\n <Flex>\n <ActionBox alignItems=\"center\">\n <Pencil />\n </ActionBox>\n\n <ActionBox alignItems=\"center\">\n <Cross />\n </ActionBox>\n </Flex>\n </FieldContainer>\n );\n};\n\nconst ActionBox = styled<FlexComponent>(Flex)`\n height: ${({ theme }) => theme.spaces[7]};\n\n &:last-child {\n padding: 0 ${({ theme }) => theme.spaces[3]};\n }\n`;\n\nconst DragButton = styled(ActionBox)`\n border-right: 1px solid ${({ theme }) => theme.colors.primary200};\n\n svg {\n width: 1.2rem;\n height: 1.2rem;\n }\n`;\n\nconst FieldContainer = styled<FlexComponent>(Flex)<{ $isSibling: boolean }>`\n border: 1px solid\n ${({ theme, $isSibling }) => ($isSibling ? theme.colors.neutral150 : theme.colors.primary200)};\n\n svg {\n width: 1rem;\n height: 1rem;\n\n path {\n fill: ${({ theme, $isSibling }) => ($isSibling ? undefined : theme.colors.primary600)};\n }\n }\n`;\n\nexport { CardDragPreview };\nexport type { CardDragPreviewProps };\n"],"names":["CardDragPreview","label","isSibling","_jsxs","FieldContainer","background","display","gap","hasRadius","justifyContent","$isSibling","max-height","maxWidth","Flex","_jsx","DragButton","alignItems","cursor","padding","Drag","Typography","textColor","undefined","fontWeight","ellipsis","ActionBox","Pencil","Cross","styled","theme","spaces","colors","primary200","neutral150","primary600"],"mappings":";;;;;AASA,MAAMA,kBAAkB,CAAC,EAAEC,KAAK,EAAEC,SAAAA,GAAY,KAAK,EAAwB,GAAA;AACzE,IAAA,qBACEC,IAACC,CAAAA,cAAAA,EAAAA;AACCC,QAAAA,UAAAA,EAAYH,YAAY,YAAe,GAAA,YAAA;QACvCI,OAAQ,EAAA,aAAA;QACRC,GAAK,EAAA,CAAA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AKA,KAAME,CAAAA,MAAM,CAACC,UAAU,CAAC;;;;;;AAMnE,CAAC;AAED,MAAM5B,cAAAA,GAAiBwB,MAAsBf,CAAAA,IAAAA,CAA8B;;AAEvE,IAAA,EAAE,CAAC,EAAEgB,KAAK,EAAEnB,UAAU,EAAE,GAAMA,UAAAA,GAAamB,KAAME,CAAAA,MAAM,CAACE,UAAU,GAAGJ,MAAME,MAAM,CAACC,UAAU,CAAE;;;;;;;AAOtF,YAAA,EAAE,CAAC,EAAEH,KAAK,EAAEnB,UAAU,EAAE,GAAMA,UAAAA,GAAaY,SAAYO,GAAAA,KAAAA,CAAME,MAAM,CAACG,UAAU,CAAE;;;AAG5F,CAAC;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"ComponentConfigurationPage-DKPNz7kC.mjs","sources":["../../../admin/src/services/components.ts","../../../admin/src/pages/ComponentConfigurationPage.tsx"],"sourcesContent":["import { contentManagerApi } from './api';\n\nimport type {\n FindComponentConfiguration,\n UpdateComponentConfiguration,\n} from '../../../shared/contracts/components';\n\nconst componentsApi = contentManagerApi.injectEndpoints({\n endpoints: (builder) => ({\n getComponentConfiguration: builder.query<\n FindComponentConfiguration.Response['data'],\n FindComponentConfiguration.Params['uid']\n >({\n query: (uid) => `/content-manager/components/${uid}/configuration`,\n transformResponse: (response: FindComponentConfiguration.Response) => response.data,\n providesTags: (_result, _error, uid) => [{ type: 'ComponentConfiguration', id: uid }],\n }),\n updateComponentConfiguration: builder.mutation({\n query: ({ uid, ...body }) => ({\n url: `/content-manager/components/${uid}/configuration`,\n method: 'PUT',\n data: body,\n }),\n transformResponse: (response: UpdateComponentConfiguration.Response) => response.data,\n invalidatesTags: (_result, _error, { uid }) => [\n { type: 'ComponentConfiguration', id: uid },\n // otherwise layouts already fetched will have stale component configuration data.\n { type: 'ContentTypeSettings', id: 'LIST' },\n ],\n }),\n }),\n});\n\nconst { useGetComponentConfigurationQuery, useUpdateComponentConfigurationMutation } =\n componentsApi;\n\nexport { useGetComponentConfigurationQuery, useUpdateComponentConfigurationMutation };\n","import * as React from 'react';\n\nimport { Page, useNotification, useAPIErrorHandler } from '@strapi/admin/strapi-admin';\nimport { useIntl } from 'react-intl';\nimport { useParams } from 'react-router-dom';\n\nimport { TEMP_FIELD_NAME } from '../components/ConfigurationForm/Fields';\nimport { ConfigurationForm, ConfigurationFormProps } from '../components/ConfigurationForm/Form';\nimport { ComponentsDictionary, extractContentTypeComponents } from '../hooks/useContentTypeSchema';\nimport {\n DEFAULT_SETTINGS,\n EditLayout,\n convertEditLayoutToFieldLayouts,\n} from '../hooks/useDocumentLayout';\nimport { useTypedSelector } from '../modules/hooks';\nimport {\n useGetComponentConfigurationQuery,\n useUpdateComponentConfigurationMutation,\n} from '../services/components';\nimport { useGetInitialDataQuery } from '../services/init';\nimport { setIn } from '../utils/objects';\n\nimport type { Component, FindComponentConfiguration } from '../../../shared/contracts/components';\nimport type { Metadatas } from '../../../shared/contracts/content-types';\n\n/* -------------------------------------------------------------------------------------------------\n * ComponentConfigurationPage\n * -----------------------------------------------------------------------------------------------*/\n\nconst ComponentConfigurationPage = () => {\n /**\n * useDocumentLayout only works for documents, not components,\n * it feels weird to make that hook work for both when this is SUCH\n * a unique use case and we only do it here, so in short, we essentially\n * just extracted the logic to make an edit view layout and reproduced it here.\n */\n const { slug: model } = useParams<{ slug: string }>();\n const { toggleNotification } = useNotification();\n const { formatMessage } = useIntl();\n const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();\n\n const {\n components,\n fieldSizes,\n schema,\n error: errorSchema,\n isLoading: isLoadingSchema,\n isFetching: isFetchingSchema,\n } = useGetInitialDataQuery(undefined, {\n selectFromResult: (res) => {\n const schema = res.data?.components.find((ct) => ct.uid === model);\n\n const componentsByKey = res.data?.components.reduce<ComponentsDictionary>(\n (acc, component) => {\n acc[component.uid] = component;\n\n return acc;\n },\n {}\n );\n\n const components = extractContentTypeComponents(schema?.attributes, componentsByKey);\n\n const fieldSizes = Object.entries(res.data?.fieldSizes ?? {}).reduce<\n ConfigurationFormProps['fieldSizes']\n >((acc, [attributeName, { default: size }]) => {\n acc[attributeName] = size;\n\n return acc;\n }, {});\n\n return {\n isFetching: res.isFetching,\n isLoading: res.isLoading,\n error: res.error,\n components,\n schema,\n fieldSizes,\n };\n },\n });\n\n React.useEffect(() => {\n if (errorSchema) {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(errorSchema),\n });\n }\n }, [errorSchema, formatAPIError, toggleNotification]);\n\n const {\n data,\n isLoading: isLoadingConfig,\n isFetching: isFetchingConfig,\n error,\n } = useGetComponentConfigurationQuery(model ?? '');\n\n React.useEffect(() => {\n if (error) {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(error),\n });\n }\n }, [error, formatAPIError, toggleNotification]);\n\n /**\n * you **must** check if we're loading or fetching in case the component gets new props\n * but nothing was unmounted, it then becomes a fetch, not a load.\n */\n const isLoading = isLoadingConfig || isLoadingSchema || isFetchingConfig || isFetchingSchema;\n\n const editLayout = React.useMemo(\n () =>\n data && !isLoading\n ? formatEditLayout(data, { schema, components })\n : ({\n layout: [],\n components: {},\n metadatas: {},\n options: {},\n settings: DEFAULT_SETTINGS,\n } as EditLayout),\n [data, isLoading, schema, components]\n );\n\n const [updateConfiguration] = useUpdateComponentConfigurationMutation();\n const handleSubmit: ConfigurationFormProps['onSubmit'] = async (formData) => {\n try {\n /**\n * We reconstruct the metadatas object by taking the existing list metadatas\n * and re-merging that by attribute name with the current list metadatas, whilst overwriting\n * the data from the form we've built.\n */\n const meta = Object.entries(data?.component.metadatas ?? {}).reduce<Metadatas>(\n (acc, [name, { edit, list }]) => {\n const {\n __temp_key__,\n size: _size,\n name: _name,\n ...editedMetadata\n } = formData.layout.flatMap((row) => row.children).find((field) => field.name === name) ??\n {};\n\n acc[name] = {\n edit: {\n ...edit,\n ...editedMetadata,\n },\n list,\n };\n\n return acc;\n },\n {}\n );\n\n const res = await updateConfiguration({\n layouts: {\n edit: formData.layout.map((row) =>\n row.children.reduce<Array<{ name: string; size: number }>>((acc, { name, size }) => {\n if (name !== TEMP_FIELD_NAME) {\n return [...acc, { name, size }];\n }\n\n return acc;\n }, [])\n ),\n list: data?.component.layouts.list,\n },\n settings: setIn(formData.settings, 'displayName', undefined),\n metadatas: meta,\n uid: model,\n });\n\n if ('data' in res) {\n toggleNotification({\n type: 'success',\n message: formatMessage({ id: 'notification.success.saved', defaultMessage: 'Saved' }),\n });\n } else {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(res.error),\n });\n }\n } catch {\n toggleNotification({\n type: 'danger',\n message: formatMessage({ id: 'notification.error', defaultMessage: 'An error occurred' }),\n });\n }\n };\n\n if (isLoading) {\n return <Page.Loading />;\n }\n\n if (error || errorSchema || !schema) {\n return <Page.Error />;\n }\n\n return (\n <>\n <Page.Title>{`Configure ${editLayout.settings.displayName} Edit View`}</Page.Title>\n <ConfigurationForm\n onSubmit={handleSubmit}\n attributes={schema.attributes}\n fieldSizes={fieldSizes}\n layout={editLayout}\n />\n </>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * Header\n * -----------------------------------------------------------------------------------------------*/\n\nconst formatEditLayout = (\n data: FindComponentConfiguration.Response['data'],\n { schema, components }: { schema?: Component; components: ComponentsDictionary }\n) => {\n const editAttributes = convertEditLayoutToFieldLayouts(\n data.component.layouts.edit,\n schema?.attributes,\n data.component.metadatas,\n { configurations: data.components, schemas: components }\n );\n\n const componentEditAttributes = Object.entries(data.components).reduce<EditLayout['components']>(\n (acc, [uid, configuration]) => {\n acc[uid] = {\n layout: convertEditLayoutToFieldLayouts(\n configuration.layouts.edit,\n components[uid].attributes,\n configuration.metadatas\n ),\n settings: {\n ...configuration.settings,\n icon: components[uid].info.icon,\n displayName: components[uid].info.displayName,\n },\n };\n return acc;\n },\n {}\n );\n\n const editMetadatas = Object.entries(data.component.metadatas).reduce<EditLayout['metadatas']>(\n (acc, [attribute, metadata]) => {\n return {\n ...acc,\n [attribute]: metadata.edit,\n };\n },\n {}\n );\n\n return {\n layout: [editAttributes],\n components: componentEditAttributes,\n metadatas: editMetadatas,\n options: {\n ...schema?.options,\n ...schema?.pluginOptions,\n },\n settings: {\n ...data.component.settings,\n displayName: schema?.info.displayName,\n },\n };\n};\n\n/* -------------------------------------------------------------------------------------------------\n * Header\n * -----------------------------------------------------------------------------------------------*/\n\nconst ProtectedComponentConfigurationPage = () => {\n const permissions = useTypedSelector(\n (state) => state.admin_app.permissions.contentManager?.componentsConfigurations\n );\n\n return (\n <Page.Protect permissions={permissions}>\n <ComponentConfigurationPage />\n </Page.Protect>\n );\n};\n\nexport { ComponentConfigurationPage, ProtectedComponentConfigurationPage };\n"],"names":["componentsApi","contentManagerApi","injectEndpoints","endpoints","builder","getComponentConfiguration","query","uid","transformResponse","response","data","providesTags","_result","_error","type","id","updateComponentConfiguration","mutation","body","url","method","invalidatesTags","useGetComponentConfigurationQuery","useUpdateComponentConfigurationMutation","ComponentConfigurationPage","slug","model","useParams","toggleNotification","useNotification","formatMessage","useIntl","_unstableFormatAPIError","formatAPIError","useAPIErrorHandler","components","fieldSizes","schema","error","errorSchema","isLoading","isLoadingSchema","isFetching","isFetchingSchema","useGetInitialDataQuery","undefined","selectFromResult","res","find","ct","componentsByKey","reduce","acc","component","extractContentTypeComponents","attributes","Object","entries","attributeName","default","size","React","useEffect","message","isLoadingConfig","isFetchingConfig","editLayout","useMemo","formatEditLayout","layout","metadatas","options","settings","DEFAULT_SETTINGS","updateConfiguration","handleSubmit","formData","meta","name","edit","list","__temp_key__","_size","_name","editedMetadata","flatMap","row","children","field","layouts","map","TEMP_FIELD_NAME","setIn","defaultMessage","_jsx","Page","Loading","Error","_jsxs","_Fragment","Title","displayName","ConfigurationForm","onSubmit","editAttributes","convertEditLayoutToFieldLayouts","configurations","schemas","componentEditAttributes","configuration","icon","info","editMetadatas","attribute","metadata","pluginOptions","ProtectedComponentConfigurationPage","permissions","useTypedSelector","state","admin_app","contentManager","componentsConfigurations","Protect"],"mappings":";;;;;;;;;;;;;;;;;;;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0 @@
1
- {"version":3,"file":"ComponentIcon-BZcTc4rj.mjs","sources":["../../../admin/src/components/ComponentIcon.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { Flex, FlexProps } from '@strapi/design-system';\nimport * as Icons from '@strapi/icons';\nimport * as Symbols from '@strapi/icons/symbols';\n\nimport type { Struct } from '@strapi/types';\n\ninterface ComponentIconProps extends FlexProps {\n showBackground?: boolean;\n icon?: Struct.ContentTypeSchemaInfo['icon'];\n}\n\nconst ComponentIcon = ({\n showBackground = true,\n icon = 'dashboard',\n ...props\n}: ComponentIconProps) => {\n const Icon = COMPONENT_ICONS[icon as keyof typeof COMPONENT_ICONS] || COMPONENT_ICONS.dashboard;\n\n return (\n <Flex\n alignItems=\"center\"\n background={showBackground ? 'neutral200' : undefined}\n justifyContent=\"center\"\n height={8}\n width={8}\n color=\"neutral600\"\n borderRadius={showBackground ? '50%' : 0}\n {...props}\n >\n <Icon height=\"2rem\" width=\"2rem\" />\n </Flex>\n );\n};\n\nconst COMPONENT_ICONS: Record<string, React.ComponentType<any>> = {\n alien: Icons.Alien,\n apps: Icons.GridNine,\n archive: Icons.Archive,\n arrowDown: Icons.ArrowDown,\n arrowLeft: Icons.ArrowLeft,\n arrowRight: Icons.ArrowRight,\n arrowUp: Icons.ArrowUp,\n attachment: Icons.Paperclip,\n bell: Icons.Bell,\n bold: Icons.Bold,\n book: Icons.Book,\n briefcase: Icons.Briefcase,\n brush: Icons.PaintBrush,\n bulletList: Icons.BulletList,\n calendar: Icons.Calendar,\n car: Icons.Car,\n cast: Icons.Cast,\n chartBubble: Icons.ChartBubble,\n chartCircle: Icons.ChartCircle,\n chartPie: Icons.ChartPie,\n check: Icons.Check,\n clock: Icons.Clock,\n cloud: Icons.Cloud,\n code: Icons.Code,\n cog: Icons.Cog,\n collapse: Icons.Collapse,\n command: Icons.Command,\n connector: Icons.Faders,\n crop: Icons.Crop,\n crown: Icons.Crown,\n cup: Icons.Coffee,\n cursor: Icons.Cursor,\n dashboard: Icons.SquaresFour,\n database: Icons.Database,\n discuss: Icons.Discuss,\n doctor: Icons.Stethoscope,\n earth: Icons.Earth,\n emotionHappy: Icons.EmotionHappy,\n emotionUnhappy: Icons.EmotionUnhappy,\n envelop: Icons.Mail,\n exit: Icons.SignOut,\n expand: Icons.Expand,\n eye: Icons.Eye,\n feather: Icons.Feather,\n file: Icons.File,\n fileError: Icons.FileError,\n filePdf: Icons.FilePdf,\n filter: Icons.Filter,\n folder: Icons.Folder,\n gate: Icons.CastleTurret,\n gift: Icons.Gift,\n globe: Icons.Globe,\n grid: Icons.GridFour,\n handHeart: Icons.HandHeart,\n hashtag: Icons.Hashtag,\n headphone: Icons.Headphones,\n heart: Icons.Heart,\n house: Icons.House,\n information: Icons.Information,\n italic: Icons.Italic,\n key: Icons.Key,\n landscape: Icons.Images,\n layer: Icons.ListPlus,\n layout: Icons.Layout,\n lightbulb: Icons.Lightbulb,\n link: Icons.Link,\n lock: Icons.Lock,\n magic: Icons.Magic,\n manyToMany: Icons.ManyToMany,\n manyToOne: Icons.ManyToOne,\n manyWays: Icons.ManyWays,\n medium: Symbols.Medium,\n message: Icons.Message,\n microphone: Icons.Microphone,\n monitor: Icons.Monitor,\n moon: Icons.Moon,\n music: Icons.MusicNotes,\n oneToMany: Icons.OneToMany,\n oneToOne: Icons.OneToOne,\n oneWay: Icons.OneWay,\n paint: Icons.PaintBrush,\n paintBrush: Icons.PaintBrush,\n paperPlane: Icons.PaperPlane,\n pencil: Icons.Pencil,\n phone: Icons.Phone,\n picture: Icons.Image,\n pin: Icons.Pin,\n pinMap: Icons.PinMap,\n plane: Icons.Plane,\n play: Icons.Play,\n plus: Icons.Plus,\n priceTag: Icons.PriceTag,\n puzzle: Icons.PuzzlePiece,\n question: Icons.Question,\n quote: Icons.Quotes,\n refresh: Icons.ArrowClockwise,\n restaurant: Icons.Restaurant,\n rocket: Icons.Rocket,\n rotate: Icons.ArrowsCounterClockwise,\n scissors: Icons.Scissors,\n search: Icons.Search,\n seed: Icons.Plant,\n server: Icons.Server,\n shield: Icons.Shield,\n shirt: Icons.Shirt,\n shoppingCart: Icons.ShoppingCart,\n slideshow: Icons.PresentationChart,\n stack: Icons.Stack,\n star: Icons.Star,\n store: Icons.Store,\n strikeThrough: Icons.StrikeThrough,\n sun: Icons.Sun,\n television: Icons.Television,\n thumbDown: Icons.ThumbDown,\n thumbUp: Icons.ThumbUp,\n train: Icons.Train,\n twitter: Symbols.X,\n typhoon: Icons.Typhoon,\n underline: Icons.Underline,\n user: Icons.User,\n volumeMute: Icons.VolumeMute,\n volumeUp: Icons.VolumeUp,\n walk: Icons.Walk,\n wheelchair: Icons.Wheelchair,\n write: Icons.Feather,\n};\n\nexport { ComponentIcon, COMPONENT_ICONS };\nexport type { ComponentIconProps };\n"],"names":["ComponentIcon","showBackground","icon","props","Icon","COMPONENT_ICONS","dashboard","_jsx","Flex","alignItems","background","undefined","justifyContent","height","width","color","borderRadius","alien","Icons","Alien","apps","GridNine","archive","Archive","arrowDown","ArrowDown","arrowLeft","ArrowLeft","arrowRight","ArrowRight","arrowUp","ArrowUp","attachment","Paperclip","bell","Bell","bold","Bold","book","Book","briefcase","Briefcase","brush","PaintBrush","bulletList","BulletList","calendar","Calendar","car","Car","cast","Cast","chartBubble","ChartBubble","chartCircle","ChartCircle","chartPie","ChartPie","check","Check","clock","Clock","cloud","Cloud","code","Code","cog","Cog","collapse","Collapse","command","Command","connector","Faders","crop","Crop","crown","Crown","cup","Coffee","cursor","Cursor","SquaresFour","database","Database","discuss","Discuss","doctor","Stethoscope","earth","Earth","emotionHappy","EmotionHappy","emotionUnhappy","EmotionUnhappy","envelop","Mail","exit","SignOut","expand","Expand","eye","Eye","feather","Feather","file","File","fileError","FileError","filePdf","FilePdf","filter","Filter","folder","Folder","gate","CastleTurret","gift","Gift","globe","Globe","grid","GridFour","handHeart","HandHeart","hashtag","Hashtag","headphone","Headphones","heart","Heart","house","House","information","Information","italic","Italic","key","Key","landscape","Images","layer","ListPlus","layout","Layout","lightbulb","Lightbulb","link","Link","lock","Lock","magic","Magic","manyToMany","ManyToMany","manyToOne","ManyToOne","manyWays","ManyWays","medium","Symbols","Medium","message","Message","microphone","Microphone","monitor","Monitor","moon","Moon","music","MusicNotes","oneToMany","OneToMany","oneToOne","OneToOne","oneWay","OneWay","paint","paintBrush","paperPlane","PaperPlane","pencil","Pencil","phone","Phone","picture","Image","pin","Pin","pinMap","PinMap","plane","Plane","play","Play","plus","Plus","priceTag","PriceTag","puzzle","PuzzlePiece","question","Question","quote","Quotes","refresh","ArrowClockwise","restaurant","Restaurant","rocket","Rocket","rotate","ArrowsCounterClockwise","scissors","Scissors","search","Search","seed","Plant","server","Server","shield","Shield","shirt","Shirt","shoppingCart","ShoppingCart","slideshow","PresentationChart","stack","Stack","star","Star","store","Store","strikeThrough","StrikeThrough","sun","Sun","television","Television","thumbDown","ThumbDown","thumbUp","ThumbUp","train","Train","twitter","X","typhoon","Typhoon","underline","Underline","user","User","volumeMute","VolumeMute","volumeUp","VolumeUp","walk","Walk","wheelchair","Wheelchair","write"],"mappings":";;;;;;AAaMA,MAAAA,aAAAA,GAAgB,CAAC,EACrBC,cAAiB,GAAA,IAAI,EACrBC,IAAO,GAAA,WAAW,EAClB,GAAGC,KACgB,EAAA,GAAA;AACnB,IAAA,MAAMC,OAAOC,eAAe,CAACH,IAAqC,CAAA,IAAIG,gBAAgBC,SAAS;AAE/F,IAAA,qBACEC,GAACC,CAAAA,IAAAA,EAAAA;QACCC,UAAW,EAAA,QAAA;AACXC,QAAAA,UAAAA,EAAYT,iBAAiB,YAAeU,GAAAA,SAAAA;QAC5CC,cAAe,EAAA,QAAA;QACfC,MAAQ,EAAA,CAAA;QACRC,KAAO,EAAA,CAAA;QACPC,KAAM,EAAA,YAAA;AACNC,QAAAA,YAAAA,EAAcf,iBAAiB,KAAQ,GAAA,CAAA;AACtC,QAAA,GAAGE,KAAK;AAET,QAAA,QAAA,gBAAAI,GAACH,CAAAA,IAAAA,EAAAA;YAAKS,MAA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