@strapi/content-manager 0.0.0-experimental.e14656d3b8681880212c13260b9a2b340c182f2d → 0.0.0-experimental.e350eaa6073e65190102b4b798c32c287053cc02

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 (198) hide show
  1. package/dist/_chunks/CardDragPreview-C0QyJgRA.js.map +1 -1
  2. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +1 -1
  3. package/dist/_chunks/{ComponentConfigurationPage-D_M8iBw5.js → ComponentConfigurationPage-BTR_hQow.js} +5 -6
  4. package/dist/_chunks/{ComponentConfigurationPage-D_M8iBw5.js.map → ComponentConfigurationPage-BTR_hQow.js.map} +1 -1
  5. package/dist/_chunks/{ComponentConfigurationPage-qemkOlnj.mjs → ComponentConfigurationPage-bLQr82ce.mjs} +4 -4
  6. package/dist/_chunks/{ComponentConfigurationPage-qemkOlnj.mjs.map → ComponentConfigurationPage-bLQr82ce.mjs.map} +1 -1
  7. package/dist/_chunks/{ComponentIcon-BXdiCGQp.js → ComponentIcon-CRbtQEUV.js} +2 -3
  8. package/dist/_chunks/{ComponentIcon-BXdiCGQp.js.map → ComponentIcon-CRbtQEUV.js.map} +1 -1
  9. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +1 -1
  10. package/dist/_chunks/{EditConfigurationPage-CjUrEewK.mjs → EditConfigurationPage-BhRSnUsL.mjs} +4 -4
  11. package/dist/_chunks/{EditConfigurationPage-CjUrEewK.mjs.map → EditConfigurationPage-BhRSnUsL.mjs.map} +1 -1
  12. package/dist/_chunks/{EditConfigurationPage-BePwPuHy.js → EditConfigurationPage-z39Wv3E6.js} +5 -6
  13. package/dist/_chunks/{EditConfigurationPage-BePwPuHy.js.map → EditConfigurationPage-z39Wv3E6.js.map} +1 -1
  14. package/dist/_chunks/{EditViewPage-De8GyU8P.mjs → EditViewPage-BCjNxNlY.mjs} +50 -10
  15. package/dist/_chunks/EditViewPage-BCjNxNlY.mjs.map +1 -0
  16. package/dist/_chunks/{EditViewPage-B-RJeiJD.js → EditViewPage-wujOq90c.js} +50 -11
  17. package/dist/_chunks/EditViewPage-wujOq90c.js.map +1 -0
  18. package/dist/_chunks/{Field-dq8Tg1M_.js → Field-B5QXnctJ.js} +238 -153
  19. package/dist/_chunks/Field-B5QXnctJ.js.map +1 -0
  20. package/dist/_chunks/{Field-pb2o8uBe.mjs → Field-Byr3mPTl.mjs} +232 -147
  21. package/dist/_chunks/Field-Byr3mPTl.mjs.map +1 -0
  22. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs.map +1 -1
  23. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js.map +1 -1
  24. package/dist/_chunks/{Form-DJn0Dxha.mjs → Form-BZgvE8C8.mjs} +17 -9
  25. package/dist/_chunks/Form-BZgvE8C8.mjs.map +1 -0
  26. package/dist/_chunks/{Form-DGIf4jQU.js → Form-D7mexvm3.js} +19 -12
  27. package/dist/_chunks/Form-D7mexvm3.js.map +1 -0
  28. package/dist/_chunks/{History-BowL3JKP.mjs → History-CqNgxkqK.mjs} +43 -100
  29. package/dist/_chunks/History-CqNgxkqK.mjs.map +1 -0
  30. package/dist/_chunks/{History-Dh2NEHnR.js → History-DYl2A8Z_.js} +42 -100
  31. package/dist/_chunks/History-DYl2A8Z_.js.map +1 -0
  32. package/dist/_chunks/{ListConfigurationPage-BxYCWz9e.js → ListConfigurationPage-BXnu_OoY.js} +7 -7
  33. package/dist/_chunks/ListConfigurationPage-BXnu_OoY.js.map +1 -0
  34. package/dist/_chunks/{ListConfigurationPage-BpVOB-hn.mjs → ListConfigurationPage-BbQjzKkQ.mjs} +7 -6
  35. package/dist/_chunks/ListConfigurationPage-BbQjzKkQ.mjs.map +1 -0
  36. package/dist/_chunks/{ListViewPage-4XsciqHZ.js → ListViewPage-BtSi8C1l.js} +103 -77
  37. package/dist/_chunks/ListViewPage-BtSi8C1l.js.map +1 -0
  38. package/dist/_chunks/{ListViewPage-CXFUjZQC.mjs → ListViewPage-D4ofkbjR.mjs} +99 -72
  39. package/dist/_chunks/ListViewPage-D4ofkbjR.mjs.map +1 -0
  40. package/dist/_chunks/{NoContentTypePage-C8OpoHeU.js → NoContentTypePage-CitJeOq4.js} +2 -2
  41. package/dist/_chunks/{NoContentTypePage-C8OpoHeU.js.map → NoContentTypePage-CitJeOq4.js.map} +1 -1
  42. package/dist/_chunks/{NoContentTypePage-DuhOTp3x.mjs → NoContentTypePage-DyUx5mXh.mjs} +2 -2
  43. package/dist/_chunks/{NoContentTypePage-DuhOTp3x.mjs.map → NoContentTypePage-DyUx5mXh.mjs.map} +1 -1
  44. package/dist/_chunks/{NoPermissionsPage-DVz3mzDz.mjs → NoPermissionsPage-DhIiyWkk.mjs} +2 -2
  45. package/dist/_chunks/{NoPermissionsPage-DVz3mzDz.mjs.map → NoPermissionsPage-DhIiyWkk.mjs.map} +1 -1
  46. package/dist/_chunks/{NoPermissionsPage-y_r7DVA2.js → NoPermissionsPage-DzgWz0M-.js} +2 -2
  47. package/dist/_chunks/{NoPermissionsPage-y_r7DVA2.js.map → NoPermissionsPage-DzgWz0M-.js.map} +1 -1
  48. package/dist/_chunks/Preview-BaYGJ0nb.mjs +293 -0
  49. package/dist/_chunks/Preview-BaYGJ0nb.mjs.map +1 -0
  50. package/dist/_chunks/Preview-DfNx8Ke-.js +311 -0
  51. package/dist/_chunks/Preview-DfNx8Ke-.js.map +1 -0
  52. package/dist/_chunks/{Relations-CVNLrn1Y.mjs → Relations-DM2yUTST.mjs} +75 -41
  53. package/dist/_chunks/Relations-DM2yUTST.mjs.map +1 -0
  54. package/dist/_chunks/{Relations-DPFCAa7b.js → Relations-DuKCaXrv.js} +75 -42
  55. package/dist/_chunks/Relations-DuKCaXrv.js.map +1 -0
  56. package/dist/_chunks/{en-uOUIxfcQ.js → en-BK8Xyl5I.js} +28 -15
  57. package/dist/_chunks/{en-uOUIxfcQ.js.map → en-BK8Xyl5I.js.map} +1 -1
  58. package/dist/_chunks/{en-BrCTWlZv.mjs → en-Dtk_ot79.mjs} +28 -15
  59. package/dist/_chunks/{en-BrCTWlZv.mjs.map → en-Dtk_ot79.mjs.map} +1 -1
  60. package/dist/_chunks/{es-EUonQTon.js → es-9K52xZIr.js} +2 -2
  61. package/dist/_chunks/{ja-CcFe8diO.js.map → es-9K52xZIr.js.map} +1 -1
  62. package/dist/_chunks/{es-CeXiYflN.mjs → es-D34tqjMw.mjs} +2 -2
  63. package/dist/_chunks/{es-CeXiYflN.mjs.map → es-D34tqjMw.mjs.map} +1 -1
  64. package/dist/_chunks/{fr-CD9VFbPM.mjs → fr--pg5jUbt.mjs} +13 -3
  65. package/dist/_chunks/{fr-CD9VFbPM.mjs.map → fr--pg5jUbt.mjs.map} +1 -1
  66. package/dist/_chunks/{fr-B7kGGg3E.js → fr-B2Kyv8Z9.js} +13 -3
  67. package/dist/_chunks/{fr-B7kGGg3E.js.map → fr-B2Kyv8Z9.js.map} +1 -1
  68. package/dist/_chunks/hooks-BAaaKPS_.js.map +1 -1
  69. package/dist/_chunks/{index-C3fJE-1-.js → index-BUWEmX8m.js} +1273 -996
  70. package/dist/_chunks/index-BUWEmX8m.js.map +1 -0
  71. package/dist/_chunks/{index-DiMrfcfy.mjs → index-DVAIIsOs.mjs} +1276 -999
  72. package/dist/_chunks/index-DVAIIsOs.mjs.map +1 -0
  73. package/dist/_chunks/{ja-CcFe8diO.js → ja-7sfIbjxE.js} +2 -2
  74. package/dist/_chunks/{es-EUonQTon.js.map → ja-7sfIbjxE.js.map} +1 -1
  75. package/dist/_chunks/{ja-CtsUxOvk.mjs → ja-BHqhDq4V.mjs} +2 -2
  76. package/dist/_chunks/{ja-CtsUxOvk.mjs.map → ja-BHqhDq4V.mjs.map} +1 -1
  77. package/dist/_chunks/{layout-ls3gxfpH.mjs → layout-Bxsv5mP7.mjs} +6 -5
  78. package/dist/_chunks/{layout-ls3gxfpH.mjs.map → layout-Bxsv5mP7.mjs.map} +1 -1
  79. package/dist/_chunks/{layout-C788OmNr.js → layout-C3fN7Ejz.js} +7 -7
  80. package/dist/_chunks/{layout-C788OmNr.js.map → layout-C3fN7Ejz.js.map} +1 -1
  81. package/dist/_chunks/{objects-gigeqt7s.js → objects-BcXOv6_9.js} +2 -4
  82. package/dist/_chunks/{objects-gigeqt7s.js.map → objects-BcXOv6_9.js.map} +1 -1
  83. package/dist/_chunks/{objects-mKMAmfec.mjs → objects-D6yBsdmx.mjs} +2 -4
  84. package/dist/_chunks/{objects-mKMAmfec.mjs.map → objects-D6yBsdmx.mjs.map} +1 -1
  85. package/dist/_chunks/{relations-DYeotliT.js → relations-BPZKAoEY.js} +6 -7
  86. package/dist/_chunks/relations-BPZKAoEY.js.map +1 -0
  87. package/dist/_chunks/{relations-CLcOmGO0.mjs → relations-o3pPhzY4.mjs} +6 -7
  88. package/dist/_chunks/relations-o3pPhzY4.mjs.map +1 -0
  89. package/dist/_chunks/{usePrev-B9w_-eYc.js → useDebounce-CtcjDB3L.js} +14 -1
  90. package/dist/_chunks/useDebounce-CtcjDB3L.js.map +1 -0
  91. package/dist/_chunks/useDebounce-DmuSJIF3.mjs +29 -0
  92. package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +1 -0
  93. package/dist/_chunks/{useDragAndDrop-J0TUUbR6.js → useDragAndDrop-BMtgCYzL.js} +5 -9
  94. package/dist/_chunks/{useDragAndDrop-J0TUUbR6.js.map → useDragAndDrop-BMtgCYzL.js.map} +1 -1
  95. package/dist/_chunks/{useDragAndDrop-DdHgKsqq.mjs → useDragAndDrop-DJ6jqvZN.mjs} +4 -7
  96. package/dist/_chunks/{useDragAndDrop-DdHgKsqq.mjs.map → useDragAndDrop-DJ6jqvZN.mjs.map} +1 -1
  97. package/dist/admin/index.js +2 -1
  98. package/dist/admin/index.js.map +1 -1
  99. package/dist/admin/index.mjs +4 -3
  100. package/dist/admin/src/content-manager.d.ts +3 -2
  101. package/dist/admin/src/exports.d.ts +1 -1
  102. package/dist/admin/src/hooks/useDocument.d.ts +32 -1
  103. package/dist/admin/src/pages/EditView/EditViewPage.d.ts +9 -1
  104. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +1 -1
  105. package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +2 -2
  106. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +7 -0
  107. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/utils/prismLanguages.d.ts +49 -0
  108. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +1 -0
  109. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +0 -32
  110. package/dist/admin/src/pages/EditView/components/Header.d.ts +11 -11
  111. package/dist/admin/src/preview/components/PreviewContent.d.ts +2 -0
  112. package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -0
  113. package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
  114. package/dist/admin/src/preview/index.d.ts +4 -0
  115. package/dist/admin/src/preview/pages/Preview.d.ts +11 -0
  116. package/dist/admin/src/preview/routes.d.ts +3 -0
  117. package/dist/admin/src/preview/services/preview.d.ts +3 -0
  118. package/dist/admin/src/router.d.ts +1 -1
  119. package/dist/admin/src/services/documents.d.ts +3 -4
  120. package/dist/server/index.js +453 -201
  121. package/dist/server/index.js.map +1 -1
  122. package/dist/server/index.mjs +453 -200
  123. package/dist/server/index.mjs.map +1 -1
  124. package/dist/server/src/bootstrap.d.ts.map +1 -1
  125. package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
  126. package/dist/server/src/controllers/index.d.ts.map +1 -1
  127. package/dist/server/src/controllers/relations.d.ts.map +1 -1
  128. package/dist/server/src/controllers/utils/metadata.d.ts +15 -1
  129. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  130. package/dist/server/src/history/services/history.d.ts.map +1 -1
  131. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  132. package/dist/server/src/history/services/utils.d.ts +3 -3
  133. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  134. package/dist/server/src/index.d.ts +4 -4
  135. package/dist/server/src/preview/controllers/index.d.ts +2 -0
  136. package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
  137. package/dist/server/src/preview/controllers/preview.d.ts +13 -0
  138. package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
  139. package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
  140. package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
  141. package/dist/server/src/preview/index.d.ts +4 -0
  142. package/dist/server/src/preview/index.d.ts.map +1 -0
  143. package/dist/server/src/preview/routes/index.d.ts +8 -0
  144. package/dist/server/src/preview/routes/index.d.ts.map +1 -0
  145. package/dist/server/src/preview/routes/preview.d.ts +4 -0
  146. package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
  147. package/dist/server/src/preview/services/index.d.ts +16 -0
  148. package/dist/server/src/preview/services/index.d.ts.map +1 -0
  149. package/dist/server/src/preview/services/preview-config.d.ts +32 -0
  150. package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
  151. package/dist/server/src/preview/services/preview.d.ts +12 -0
  152. package/dist/server/src/preview/services/preview.d.ts.map +1 -0
  153. package/dist/server/src/preview/utils.d.ts +19 -0
  154. package/dist/server/src/preview/utils.d.ts.map +1 -0
  155. package/dist/server/src/register.d.ts.map +1 -1
  156. package/dist/server/src/routes/index.d.ts.map +1 -1
  157. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  158. package/dist/server/src/services/document-metadata.d.ts +8 -8
  159. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  160. package/dist/server/src/services/index.d.ts +4 -4
  161. package/dist/server/src/services/index.d.ts.map +1 -1
  162. package/dist/server/src/services/utils/configuration/index.d.ts +2 -2
  163. package/dist/server/src/services/utils/configuration/layouts.d.ts +2 -2
  164. package/dist/server/src/utils/index.d.ts +2 -0
  165. package/dist/server/src/utils/index.d.ts.map +1 -1
  166. package/dist/shared/contracts/collection-types.d.ts +3 -1
  167. package/dist/shared/contracts/collection-types.d.ts.map +1 -1
  168. package/dist/shared/contracts/index.d.ts +1 -0
  169. package/dist/shared/contracts/index.d.ts.map +1 -1
  170. package/dist/shared/contracts/preview.d.ts +27 -0
  171. package/dist/shared/contracts/preview.d.ts.map +1 -0
  172. package/dist/shared/index.js +4 -0
  173. package/dist/shared/index.js.map +1 -1
  174. package/dist/shared/index.mjs +4 -0
  175. package/dist/shared/index.mjs.map +1 -1
  176. package/package.json +17 -15
  177. package/dist/_chunks/EditViewPage-B-RJeiJD.js.map +0 -1
  178. package/dist/_chunks/EditViewPage-De8GyU8P.mjs.map +0 -1
  179. package/dist/_chunks/Field-dq8Tg1M_.js.map +0 -1
  180. package/dist/_chunks/Field-pb2o8uBe.mjs.map +0 -1
  181. package/dist/_chunks/Form-DGIf4jQU.js.map +0 -1
  182. package/dist/_chunks/Form-DJn0Dxha.mjs.map +0 -1
  183. package/dist/_chunks/History-BowL3JKP.mjs.map +0 -1
  184. package/dist/_chunks/History-Dh2NEHnR.js.map +0 -1
  185. package/dist/_chunks/ListConfigurationPage-BpVOB-hn.mjs.map +0 -1
  186. package/dist/_chunks/ListConfigurationPage-BxYCWz9e.js.map +0 -1
  187. package/dist/_chunks/ListViewPage-4XsciqHZ.js.map +0 -1
  188. package/dist/_chunks/ListViewPage-CXFUjZQC.mjs.map +0 -1
  189. package/dist/_chunks/Relations-CVNLrn1Y.mjs.map +0 -1
  190. package/dist/_chunks/Relations-DPFCAa7b.js.map +0 -1
  191. package/dist/_chunks/index-C3fJE-1-.js.map +0 -1
  192. package/dist/_chunks/index-DiMrfcfy.mjs.map +0 -1
  193. package/dist/_chunks/relations-CLcOmGO0.mjs.map +0 -1
  194. package/dist/_chunks/relations-DYeotliT.js.map +0 -1
  195. package/dist/_chunks/usePrev-B9w_-eYc.js.map +0 -1
  196. package/dist/_chunks/usePrev-DH6iah0A.mjs +0 -16
  197. package/dist/_chunks/usePrev-DH6iah0A.mjs.map +0 -1
  198. package/strapi-server.js +0 -3
@@ -3,25 +3,26 @@ import * as React from "react";
3
3
  import { useForm, Layouts, BackButton, InputRenderer, useNotification, useField, Form, useTracking, useAPIErrorHandler, Page } from "@strapi/admin/strapi-admin";
4
4
  import { Button, useCollator, Flex, Typography, Grid, Modal, Box, useComposedRefs, Menu, VisuallyHidden, Main, Divider } from "@strapi/design-system";
5
5
  import { useIntl } from "react-intl";
6
- import { Navigate } from "react-router-dom";
7
- import { g as getTranslation, y as capitalise, c as useDoc, p as useGetContentTypeConfigurationQuery, v as checkIfAttributeIsDisplayable, o as useDocLayout, z as useUpdateContentTypeConfigurationMutation, S as SINGLE_TYPES } from "./index-DiMrfcfy.mjs";
6
+ import { useParams, Navigate } from "react-router-dom";
7
+ import { C as COLLECTION_TYPES, g as getTranslation, y as capitalise, c as useDoc, p as useGetContentTypeConfigurationQuery, v as checkIfAttributeIsDisplayable, o as useDocLayout, z as useUpdateContentTypeConfigurationMutation, S as SINGLE_TYPES } from "./index-DVAIIsOs.mjs";
8
8
  import { u as useTypedSelector } from "./hooks-E5u1mcgM.mjs";
9
- import { s as setIn } from "./objects-mKMAmfec.mjs";
9
+ import { s as setIn } from "./objects-D6yBsdmx.mjs";
10
10
  import { Drag, Pencil, Cross, Plus } from "@strapi/icons";
11
11
  import { getEmptyImage } from "react-dnd-html5-backend";
12
12
  import { styled } from "styled-components";
13
13
  import { C as CardDragPreview } from "./CardDragPreview-DOxamsuj.mjs";
14
- import { u as useDragAndDrop, I as ItemTypes } from "./useDragAndDrop-DdHgKsqq.mjs";
14
+ import { u as useDragAndDrop, I as ItemTypes } from "./useDragAndDrop-DJ6jqvZN.mjs";
15
15
  import * as yup from "yup";
16
16
  import { F as FieldTypeIcon } from "./FieldTypeIcon-CMlNO8PE.mjs";
17
17
  const Header = ({ name }) => {
18
18
  const { formatMessage } = useIntl();
19
+ const params = useParams();
19
20
  const modified = useForm("Header", (state) => state.modified);
20
21
  const isSubmitting = useForm("Header", (state) => state.isSubmitting);
21
22
  return /* @__PURE__ */ jsx(
22
23
  Layouts.Header,
23
24
  {
24
- navigationAction: /* @__PURE__ */ jsx(BackButton, {}),
25
+ navigationAction: /* @__PURE__ */ jsx(BackButton, { fallback: `../${COLLECTION_TYPES}/${params.slug}` }),
25
26
  primaryAction: /* @__PURE__ */ jsx(Button, { size: "S", disabled: !modified, type: "submit", loading: isSubmitting, children: formatMessage({ id: "global.save", defaultMessage: "Save" }) }),
26
27
  subtitle: formatMessage({
27
28
  id: getTranslation("components.SettingsViewWrapper.pluginHeader.description.list-settings"),
@@ -629,4 +630,4 @@ export {
629
630
  ListConfiguration,
630
631
  ProtectedListConfiguration
631
632
  };
632
- //# sourceMappingURL=ListConfigurationPage-BpVOB-hn.mjs.map
633
+ //# sourceMappingURL=ListConfigurationPage-BbQjzKkQ.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListConfigurationPage-BbQjzKkQ.mjs","sources":["../../admin/src/pages/ListConfiguration/components/Header.tsx","../../admin/src/pages/ListConfiguration/components/Settings.tsx","../../admin/src/pages/ListConfiguration/components/EditFieldForm.tsx","../../admin/src/pages/ListConfiguration/components/DraggableCard.tsx","../../admin/src/pages/ListConfiguration/components/SortDisplayedFields.tsx","../../admin/src/pages/ListConfiguration/ListConfigurationPage.tsx"],"sourcesContent":["import { useForm, BackButton, Layouts } from '@strapi/admin/strapi-admin';\nimport { Button } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport { useParams } from 'react-router-dom';\n\nimport { COLLECTION_TYPES } from '../../../constants/collections';\nimport { capitalise } from '../../../utils/strings';\nimport { getTranslation } from '../../../utils/translations';\n\ninterface HeaderProps {\n collectionType: string;\n name: string;\n model: string;\n}\n\nconst Header = ({ name }: HeaderProps) => {\n const { formatMessage } = useIntl();\n const params = useParams<{ slug: string }>();\n\n const modified = useForm('Header', (state) => state.modified);\n const isSubmitting = useForm('Header', (state) => state.isSubmitting);\n\n return (\n <Layouts.Header\n navigationAction={<BackButton fallback={`../${COLLECTION_TYPES}/${params.slug}`} />}\n primaryAction={\n <Button size=\"S\" disabled={!modified} type=\"submit\" loading={isSubmitting}>\n {formatMessage({ id: 'global.save', defaultMessage: 'Save' })}\n </Button>\n }\n subtitle={formatMessage({\n id: getTranslation('components.SettingsViewWrapper.pluginHeader.description.list-settings'),\n defaultMessage: 'Define the settings of the list view.',\n })}\n title={formatMessage(\n {\n id: getTranslation('components.SettingsViewWrapper.pluginHeader.title'),\n defaultMessage: 'Configure the view - {name}',\n },\n { name: capitalise(name) }\n )}\n />\n );\n};\n\nexport { Header };\nexport type { HeaderProps };\n","import * as React from 'react';\n\nimport { useForm, InputRenderer, type InputProps } from '@strapi/admin/strapi-admin';\nimport { Flex, Grid, Typography, useCollator } from '@strapi/design-system';\nimport { type MessageDescriptor, useIntl } from 'react-intl';\n\nimport { useDoc } from '../../../hooks/useDocument';\nimport { type EditFieldLayout } from '../../../hooks/useDocumentLayout';\nimport { getTranslation } from '../../../utils/translations';\nimport { type FormData } from '../ListConfigurationPage';\n\nimport type { DistributiveOmit } from 'react-redux';\n\nexport type InputPropsWithMessageDescriptors = DistributiveOmit<\n InputProps,\n 'hint' | 'label' | 'placeholder'\n> & {\n hint?: MessageDescriptor;\n label: MessageDescriptor;\n placeholder?: MessageDescriptor;\n};\n\n/**\n * @internal\n * @description Form inputs are always displayed in a grid, so we need\n * to use the size property to determine how many columns the input should\n * take up.\n */\nexport type FormLayoutInputProps = InputPropsWithMessageDescriptors & { size: number };\n\nconst EXCLUDED_SORT_ATTRIBUTE_TYPES = [\n 'media',\n 'richtext',\n 'dynamiczone',\n 'relation',\n 'component',\n 'json',\n 'blocks',\n];\n\ninterface SortOption {\n value: string;\n label: string;\n}\n\nconst Settings = () => {\n const { formatMessage, locale } = useIntl();\n const formatter = useCollator(locale, {\n sensitivity: 'base',\n });\n const { schema } = useDoc();\n\n const layout = useForm<FormData['layout']>('Settings', (state) => state.values.layout ?? []);\n const currentSortBy = useForm<FormData['settings']['defaultSortBy']>(\n 'Settings',\n (state) => state.values.settings.defaultSortBy\n );\n const onChange = useForm('Settings', (state) => state.onChange);\n\n const sortOptions = React.useMemo(\n () =>\n Object.values(layout).reduce<SortOption[]>((acc, field) => {\n if (schema && !EXCLUDED_SORT_ATTRIBUTE_TYPES.includes(schema.attributes[field.name].type)) {\n acc.push({\n value: field.name,\n label: typeof field.label !== 'string' ? formatMessage(field.label) : field.label,\n });\n }\n\n return acc;\n }, []),\n [formatMessage, layout, schema]\n );\n\n const sortOptionsSorted = sortOptions.sort((a, b) => formatter.compare(a.label, b.label));\n\n React.useEffect(() => {\n if (sortOptionsSorted.findIndex((opt) => opt.value === currentSortBy) === -1) {\n onChange('settings.defaultSortBy', sortOptionsSorted[0]?.value);\n }\n }, [currentSortBy, onChange, sortOptionsSorted]);\n\n const formLayout = React.useMemo(\n () =>\n SETTINGS_FORM_LAYOUT.map((row) =>\n row.map((field) => {\n if (field.type === 'enumeration') {\n return {\n ...field,\n hint: field.hint ? formatMessage(field.hint) : undefined,\n label: formatMessage(field.label),\n options: field.name === 'settings.defaultSortBy' ? sortOptionsSorted : field.options,\n };\n } else {\n return {\n ...field,\n hint: field.hint ? formatMessage(field.hint) : undefined,\n label: formatMessage(field.label),\n };\n }\n })\n ) as [top: EditFieldLayout[], bottom: EditFieldLayout[]],\n [formatMessage, sortOptionsSorted]\n );\n\n return (\n <Flex direction=\"column\" alignItems=\"stretch\" gap={4}>\n <Typography variant=\"delta\" tag=\"h2\">\n {formatMessage({\n id: getTranslation('containers.SettingPage.settings'),\n defaultMessage: 'Settings',\n })}\n </Typography>\n <Grid.Root key=\"bottom\" gap={4}>\n {formLayout.map((row) =>\n row.map(({ size, ...field }) => (\n <Grid.Item key={field.name} s={12} col={size} direction=\"column\" alignItems=\"stretch\">\n {/* @ts-expect-error – issue with EnumerationProps conflicting with InputProps */}\n <InputRenderer {...field} />\n </Grid.Item>\n ))\n )}\n </Grid.Root>\n </Flex>\n );\n};\n\nconst SETTINGS_FORM_LAYOUT: FormLayoutInputProps[][] = [\n [\n {\n label: {\n id: getTranslation('form.Input.search'),\n defaultMessage: 'Enable search',\n },\n name: 'settings.searchable',\n size: 4,\n type: 'boolean' as const,\n },\n {\n label: {\n id: getTranslation('form.Input.filters'),\n defaultMessage: 'Enable filters',\n },\n name: 'settings.filterable',\n size: 4,\n type: 'boolean' as const,\n },\n {\n label: {\n id: getTranslation('form.Input.bulkActions'),\n defaultMessage: 'Enable bulk actions',\n },\n name: 'settings.bulkable',\n size: 4,\n type: 'boolean' as const,\n },\n ],\n [\n {\n hint: {\n id: getTranslation('form.Input.pageEntries.inputDescription'),\n defaultMessage: 'Note: You can override this value in the Collection Type settings page.',\n },\n label: {\n id: getTranslation('form.Input.pageEntries'),\n defaultMessage: 'Entries per page',\n },\n name: 'settings.pageSize',\n options: ['10', '20', '50', '100'].map((value) => ({ value, label: value })),\n size: 6,\n type: 'enumeration' as const,\n },\n {\n label: {\n id: getTranslation('form.Input.defaultSort'),\n defaultMessage: 'Default sort attribute',\n },\n name: 'settings.defaultSortBy',\n options: [],\n size: 3,\n type: 'enumeration' as const,\n },\n {\n label: {\n id: getTranslation('form.Input.sort.order'),\n defaultMessage: 'Default sort order',\n },\n name: 'settings.defaultSortOrder',\n options: ['ASC', 'DESC'].map((value) => ({ value, label: value })),\n size: 3,\n type: 'enumeration' as const,\n },\n ],\n];\n\nexport { Settings };\n","import { Form, useField, InputRenderer, useNotification } from '@strapi/admin/strapi-admin';\nimport { Button, Flex, FlexComponent, Grid, Modal } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport { styled } from 'styled-components';\nimport * as yup from 'yup';\n\nimport { FieldTypeIcon } from '../../../components/FieldTypeIcon';\nimport { capitalise } from '../../../utils/strings';\nimport { getTranslation } from '../../../utils/translations';\n\nimport type { ListFieldLayout } from '../../../hooks/useDocumentLayout';\nimport type { FormData } from '../ListConfigurationPage';\n\ninterface EditFieldFormProps extends Pick<ListFieldLayout, 'attribute'> {\n name: string;\n onClose: () => void;\n}\n\nconst FIELD_SCHEMA = yup.object().shape({\n label: yup.string().required(),\n sortable: yup.boolean(),\n});\n\nconst EditFieldForm = ({ attribute, name, onClose }: EditFieldFormProps) => {\n const { formatMessage } = useIntl();\n const { toggleNotification } = useNotification();\n\n const { value, onChange } = useField<FormData['layout'][number]>(name);\n\n if (!value) {\n // This is very unlikely to happen, but it ensures the form is not opened without a value.\n console.error(\n \"You've opened a field to edit without it being part of the form, this is likely a bug with Strapi. Please open an issue.\"\n );\n\n toggleNotification({\n message: formatMessage({\n id: 'content-manager.containers.list-settings.modal-form.error',\n defaultMessage: 'An error occurred while trying to open the form.',\n }),\n type: 'danger',\n });\n\n return null;\n }\n\n let shouldDisplaySortToggle = !['media', 'relation'].includes(attribute.type);\n\n if ('relation' in attribute && ['oneWay', 'oneToOne', 'manyToOne'].includes(attribute.relation)) {\n shouldDisplaySortToggle = true;\n }\n\n return (\n <Modal.Content>\n <Form\n method=\"PUT\"\n initialValues={value}\n validationSchema={FIELD_SCHEMA}\n onSubmit={(data) => {\n onChange(name, data);\n onClose();\n }}\n >\n <Modal.Header>\n <HeaderContainer>\n {/* @ts-expect-error attribute.type === custom does not work here */}\n <FieldTypeIcon type={attribute.type} />\n <Modal.Title>\n {formatMessage(\n {\n id: getTranslation('containers.list-settings.modal-form.label'),\n defaultMessage: 'Edit {fieldName}',\n },\n { fieldName: capitalise(value.label) }\n )}\n </Modal.Title>\n </HeaderContainer>\n </Modal.Header>\n <Modal.Body>\n <Grid.Root gap={4}>\n {[\n {\n name: 'label',\n label: formatMessage({\n id: getTranslation('form.Input.label'),\n defaultMessage: 'Label',\n }),\n hint: formatMessage({\n id: getTranslation('form.Input.label.inputDescription'),\n defaultMessage: \"This value overrides the label displayed in the table's head\",\n }),\n size: 6,\n type: 'string' as const,\n },\n {\n label: formatMessage({\n id: getTranslation('form.Input.sort.field'),\n defaultMessage: 'Enable sort on this field',\n }),\n name: 'sortable',\n size: 6,\n type: 'boolean' as const,\n },\n ]\n .filter(\n (field) =>\n field.name !== 'sortable' ||\n (field.name === 'sortable' && shouldDisplaySortToggle)\n )\n .map(({ size, ...field }) => (\n <Grid.Item\n key={field.name}\n s={12}\n col={size}\n direction=\"column\"\n alignItems=\"stretch\"\n >\n <InputRenderer {...field} />\n </Grid.Item>\n ))}\n </Grid.Root>\n </Modal.Body>\n <Modal.Footer>\n <Button onClick={onClose} variant=\"tertiary\">\n {formatMessage({ id: 'app.components.Button.cancel', defaultMessage: 'Cancel' })}\n </Button>\n <Button type=\"submit\">\n {formatMessage({ id: 'global.finish', defaultMessage: 'Finish' })}\n </Button>\n </Modal.Footer>\n </Form>\n </Modal.Content>\n );\n};\n\nconst HeaderContainer = styled<FlexComponent>(Flex)`\n svg {\n width: 3.2rem;\n margin-right: ${({ theme }) => theme.spaces[3]};\n }\n`;\n\nexport { EditFieldForm };\nexport type { EditFieldFormProps };\n","import * as React from 'react';\n\nimport {\n Box,\n BoxComponent,\n Flex,\n FlexComponent,\n Modal,\n Typography,\n useComposedRefs,\n} from '@strapi/design-system';\nimport { Cross, Drag, Pencil } from '@strapi/icons';\nimport { getEmptyImage } from 'react-dnd-html5-backend';\nimport { useIntl } from 'react-intl';\nimport { styled } from 'styled-components';\n\nimport { CardDragPreview } from '../../../components/DragPreviews/CardDragPreview';\nimport { ItemTypes } from '../../../constants/dragAndDrop';\nimport { useDragAndDrop } from '../../../hooks/useDragAndDrop';\nimport { getTranslation } from '../../../utils/translations';\n\nimport { EditFieldForm } from './EditFieldForm';\n\nimport type { ListFieldLayout } from '../../../hooks/useDocumentLayout';\n\ntype DraggableCardProps = Omit<ListFieldLayout, 'label'> & {\n label: string;\n index: number;\n isDraggingSibling: boolean;\n onMoveField: (dragIndex: number, hoverIndex: number) => void;\n onRemoveField: () => void;\n setIsDraggingSibling: (isDragging: boolean) => void;\n};\n\nconst DraggableCard = ({\n attribute,\n index,\n isDraggingSibling,\n label,\n name,\n onMoveField,\n onRemoveField,\n setIsDraggingSibling,\n}: DraggableCardProps) => {\n const [isModalOpen, setIsModalOpen] = React.useState(false);\n const { formatMessage } = useIntl();\n const [, forceRerenderAfterDnd] = React.useState(false);\n\n const [{ isDragging }, objectRef, dropRef, dragRef, dragPreviewRef] = useDragAndDrop(true, {\n type: ItemTypes.FIELD,\n item: { index, label, name },\n index,\n onMoveItem: onMoveField,\n onEnd: () => setIsDraggingSibling(false),\n });\n\n React.useEffect(() => {\n dragPreviewRef(getEmptyImage(), { captureDraggingState: false });\n }, [dragPreviewRef]);\n\n React.useEffect(() => {\n if (isDragging) {\n setIsDraggingSibling(true);\n }\n }, [isDragging, setIsDraggingSibling]);\n\n // Effect in order to force a rerender after reordering the components\n // Since we are removing the Accordion when doing the DnD we are losing the dragRef, therefore the replaced element cannot be dragged\n // anymore, this hack forces a rerender in order to apply the dragRef\n React.useEffect(() => {\n if (!isDraggingSibling) {\n forceRerenderAfterDnd((prev) => !prev);\n }\n }, [isDraggingSibling]);\n\n const composedRefs = useComposedRefs<HTMLButtonElement>(\n dropRef,\n objectRef as React.RefObject<HTMLButtonElement>\n );\n\n return (\n <FieldWrapper ref={composedRefs}>\n {isDragging && <CardDragPreview label={label} />}\n {!isDragging && isDraggingSibling && <CardDragPreview isSibling label={label} />}\n\n {!isDragging && !isDraggingSibling && (\n <FieldContainer\n borderColor=\"neutral150\"\n background=\"neutral100\"\n hasRadius\n justifyContent=\"space-between\"\n onClick={() => setIsModalOpen(true)}\n >\n <Flex gap={3}>\n <DragButton\n ref={dragRef}\n aria-label={formatMessage(\n {\n id: getTranslation('components.DraggableCard.move.field'),\n defaultMessage: 'Move {item}',\n },\n { item: label }\n )}\n onClick={(e) => e.stopPropagation()}\n >\n <Drag />\n </DragButton>\n <Typography fontWeight=\"bold\">{label}</Typography>\n </Flex>\n <Flex paddingLeft={3} onClick={(e) => e.stopPropagation()}>\n <Modal.Root open={isModalOpen} onOpenChange={setIsModalOpen}>\n <Modal.Trigger>\n <ActionButton\n onClick={(e) => {\n e.stopPropagation();\n }}\n aria-label={formatMessage(\n {\n id: getTranslation('components.DraggableCard.edit.field'),\n defaultMessage: 'Edit {item}',\n },\n { item: label }\n )}\n type=\"button\"\n >\n <Pencil width=\"1.2rem\" height=\"1.2rem\" />\n </ActionButton>\n </Modal.Trigger>\n <EditFieldForm\n attribute={attribute}\n name={`layout.${index}`}\n onClose={() => {\n setIsModalOpen(false);\n }}\n />\n </Modal.Root>\n <ActionButton\n onClick={onRemoveField}\n data-testid={`delete-${name}`}\n aria-label={formatMessage(\n {\n id: getTranslation('components.DraggableCard.delete.field'),\n defaultMessage: 'Delete {item}',\n },\n { item: label }\n )}\n type=\"button\"\n >\n <Cross width=\"1.2rem\" height=\"1.2rem\" />\n </ActionButton>\n </Flex>\n </FieldContainer>\n )}\n </FieldWrapper>\n );\n};\n\nconst ActionButton = styled.button`\n display: flex;\n align-items: center;\n height: ${({ theme }) => theme.spaces[7]};\n color: ${({ theme }) => theme.colors.neutral600};\n\n &:hover {\n color: ${({ theme }) => theme.colors.neutral700};\n }\n\n &:last-child {\n padding: 0 ${({ theme }) => theme.spaces[3]};\n }\n`;\n\nconst DragButton = styled(ActionButton)`\n padding: 0 ${({ theme }) => theme.spaces[3]};\n border-right: 1px solid ${({ theme }) => theme.colors.neutral150};\n cursor: all-scroll;\n`;\n\nconst FieldContainer = styled<FlexComponent>(Flex)`\n max-height: 3.2rem;\n cursor: pointer;\n`;\n\nconst FieldWrapper = styled<BoxComponent>(Box)`\n &:last-child {\n padding-right: ${({ theme }) => theme.spaces[3]};\n }\n`;\n\nexport { DraggableCard };\nexport type { DraggableCardProps };\n","import * as React from 'react';\n\nimport { useForm } from '@strapi/admin/strapi-admin';\nimport { Box, Flex, VisuallyHidden, Typography, Menu } from '@strapi/design-system';\nimport { Plus } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\n\nimport { useDoc } from '../../../hooks/useDocument';\nimport { useGetContentTypeConfigurationQuery } from '../../../services/contentTypes';\nimport { checkIfAttributeIsDisplayable } from '../../../utils/attributes';\nimport { getTranslation } from '../../../utils/translations';\n\nimport { DraggableCard, DraggableCardProps } from './DraggableCard';\n\nimport type { ListLayout } from '../../../hooks/useDocumentLayout';\nimport type { FormData } from '../ListConfigurationPage';\n\ninterface SortDisplayedFieldsProps extends Pick<ListLayout, 'layout'> {}\n\nconst SortDisplayedFields = () => {\n const { formatMessage } = useIntl();\n const { model, schema } = useDoc();\n const [isDraggingSibling, setIsDraggingSibling] = React.useState(false);\n const [lastAction, setLastAction] = React.useState<string | null>(null);\n const scrollableContainerRef = React.useRef<HTMLDivElement>(null);\n\n const values = useForm<FormData['layout']>(\n 'SortDisplayedFields',\n (state) => state.values.layout ?? []\n );\n const addFieldRow = useForm('SortDisplayedFields', (state) => state.addFieldRow);\n const removeFieldRow = useForm('SortDisplayedFields', (state) => state.removeFieldRow);\n const moveFieldRow = useForm('SortDisplayedFields', (state) => state.moveFieldRow);\n\n const { metadata: allMetadata } = useGetContentTypeConfigurationQuery(model, {\n selectFromResult: ({ data }) => ({ metadata: data?.contentType.metadatas ?? {} }),\n });\n\n /**\n * This is our list of fields that are not displayed in the current layout\n * so we create their default state to be added to the layout.\n */\n const nonDisplayedFields = React.useMemo(() => {\n if (!schema) {\n return [];\n }\n\n const displayedFieldNames = values.map((field) => field.name);\n\n return Object.entries(schema.attributes).reduce<Array<FormData['layout'][number]>>(\n (acc, [name, attribute]) => {\n if (!displayedFieldNames.includes(name) && checkIfAttributeIsDisplayable(attribute)) {\n const { list: metadata } = allMetadata[name];\n\n acc.push({\n name,\n label: metadata.label || name,\n sortable: metadata.sortable,\n });\n }\n\n return acc;\n },\n []\n );\n }, [allMetadata, values, schema]);\n\n const handleAddField = (field: FormData['layout'][number]) => {\n setLastAction('add');\n addFieldRow('layout', field);\n };\n\n const handleRemoveField = (index: number) => {\n setLastAction('remove');\n removeFieldRow('layout', index);\n };\n\n const handleMoveField: DraggableCardProps['onMoveField'] = (dragIndex, hoverIndex) => {\n moveFieldRow('layout', dragIndex, hoverIndex);\n };\n\n React.useEffect(() => {\n if (lastAction === 'add' && scrollableContainerRef?.current) {\n scrollableContainerRef.current.scrollLeft = scrollableContainerRef.current.scrollWidth;\n }\n }, [lastAction]);\n\n return (\n <Flex alignItems=\"stretch\" direction=\"column\" gap={4}>\n <Typography variant=\"delta\" tag=\"h2\">\n {formatMessage({\n id: getTranslation('containers.SettingPage.view'),\n defaultMessage: 'View',\n })}\n </Typography>\n\n <Flex padding={4} borderColor=\"neutral300\" borderStyle=\"dashed\" borderWidth=\"1px\" hasRadius>\n <Box flex=\"1\" overflow=\"auto hidden\" ref={scrollableContainerRef}>\n <Flex gap={3}>\n {values.map((field, index) => (\n <DraggableCard\n key={field.name}\n index={index}\n isDraggingSibling={isDraggingSibling}\n onMoveField={handleMoveField}\n onRemoveField={() => handleRemoveField(index)}\n setIsDraggingSibling={setIsDraggingSibling}\n {...field}\n attribute={schema!.attributes[field.name]}\n label={typeof field.label === 'object' ? formatMessage(field.label) : field.label}\n />\n ))}\n </Flex>\n </Box>\n\n <Menu.Root>\n <Menu.Trigger\n paddingLeft={2}\n paddingRight={2}\n justifyContent=\"center\"\n endIcon={null}\n disabled={nonDisplayedFields.length === 0}\n variant=\"tertiary\"\n >\n <VisuallyHidden tag=\"span\">\n {formatMessage({\n id: getTranslation('components.FieldSelect.label'),\n defaultMessage: 'Add a field',\n })}\n </VisuallyHidden>\n <Plus aria-hidden focusable={false} style={{ position: 'relative', top: 2 }} />\n </Menu.Trigger>\n <Menu.Content>\n {nonDisplayedFields.map((field) => (\n <Menu.Item key={field.name} onSelect={() => handleAddField(field)}>\n {typeof field.label === 'object' ? formatMessage(field.label) : field.label}\n </Menu.Item>\n ))}\n </Menu.Content>\n </Menu.Root>\n </Flex>\n </Flex>\n );\n};\n\nexport { SortDisplayedFields };\nexport type { SortDisplayedFieldsProps };\n","import * as React from 'react';\n\nimport {\n Form,\n type FormProps,\n useNotification,\n useTracking,\n useAPIErrorHandler,\n Page,\n Layouts,\n} from '@strapi/admin/strapi-admin';\nimport { Divider, Flex, Main } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport { Navigate } from 'react-router-dom';\n\nimport { SINGLE_TYPES } from '../../constants/collections';\nimport { useDoc } from '../../hooks/useDocument';\nimport { ListFieldLayout, ListLayout, useDocLayout } from '../../hooks/useDocumentLayout';\nimport { useTypedSelector } from '../../modules/hooks';\nimport { useUpdateContentTypeConfigurationMutation } from '../../services/contentTypes';\nimport { setIn } from '../../utils/objects';\n\nimport { Header } from './components/Header';\nimport { Settings } from './components/Settings';\nimport { SortDisplayedFields } from './components/SortDisplayedFields';\n\nimport type { Metadatas } from '../../../../shared/contracts/content-types';\n\ninterface FormData extends Pick<ListLayout, 'settings'> {\n layout: Array<Pick<ListFieldLayout, 'sortable' | 'name'> & { label: string }>;\n}\n\nconst ListConfiguration = () => {\n const { formatMessage } = useIntl();\n const { trackUsage } = useTracking();\n const { toggleNotification } = useNotification();\n const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();\n\n const { model, collectionType } = useDoc();\n\n const { isLoading: isLoadingLayout, list, edit } = useDocLayout();\n\n const [updateContentTypeConfiguration] = useUpdateContentTypeConfigurationMutation();\n const handleSubmit: FormProps<FormData>['onSubmit'] = async (data) => {\n try {\n trackUsage('willSaveContentTypeLayout');\n const layoutData = data.layout ?? [];\n /**\n * We reconstruct the metadatas object by taking the existing edit 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(edit.metadatas).reduce<Metadatas>((acc, [name, editMeta]) => {\n const { mainField: _mainField, ...listMeta } = list.metadatas[name];\n\n const { label, sortable } = layoutData.find((field) => field.name === name) ?? {};\n\n acc[name] = {\n edit: editMeta,\n list: {\n ...listMeta,\n label: label || listMeta.label,\n sortable: sortable || listMeta.sortable,\n },\n };\n\n return acc;\n }, {});\n\n const res = await updateContentTypeConfiguration({\n layouts: {\n edit: edit.layout.flatMap((panel) =>\n panel.map((row) => row.map(({ name, size }) => ({ name, size })))\n ),\n list: layoutData.map((field) => field.name),\n },\n settings: setIn(data.settings, 'displayName', undefined),\n metadatas: meta,\n uid: model,\n });\n\n if ('data' in res) {\n trackUsage('didEditListSettings');\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 (err) {\n console.error(err);\n toggleNotification({\n type: 'danger',\n message: formatMessage({ id: 'notification.error', defaultMessage: 'An error occurred' }),\n });\n }\n };\n\n const initialValues = React.useMemo(() => {\n return {\n layout: list.layout.map(({ label, sortable, name }) => ({\n label: typeof label === 'string' ? label : formatMessage(label),\n sortable,\n name,\n })),\n settings: list.settings,\n } satisfies FormData;\n }, [formatMessage, list.layout, list.settings]);\n\n if (collectionType === SINGLE_TYPES) {\n return <Navigate to={`/single-types/${model}`} />;\n }\n\n if (isLoadingLayout) {\n return <Page.Loading />;\n }\n\n return (\n <Layouts.Root>\n <Page.Title>{`Configure ${list.settings.displayName} List View`}</Page.Title>\n <Main>\n <Form initialValues={initialValues} onSubmit={handleSubmit} method=\"PUT\">\n <Header\n collectionType={collectionType}\n model={model}\n name={list.settings.displayName ?? ''}\n />\n <Layouts.Content>\n <Flex\n alignItems=\"stretch\"\n background=\"neutral0\"\n direction=\"column\"\n gap={6}\n hasRadius\n shadow=\"tableShadow\"\n paddingTop={6}\n paddingBottom={6}\n paddingLeft={7}\n paddingRight={7}\n >\n <Settings />\n <Divider />\n <SortDisplayedFields />\n </Flex>\n </Layouts.Content>\n </Form>\n </Main>\n </Layouts.Root>\n );\n};\n\nconst ProtectedListConfiguration = () => {\n const permissions = useTypedSelector(\n (state) => state.admin_app.permissions.contentManager?.collectionTypesConfigurations\n );\n\n return (\n <Page.Protect permissions={permissions}>\n <ListConfiguration />\n </Page.Protect>\n );\n};\n\nexport { ProtectedListConfiguration, ListConfiguration };\nexport type { FormData };\n"],"names":[],"mappings":";;;;;;;;;;;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e;AAAA,QAAA;AAAA,MACrC;AAAA,MACA,oBAAC,QAAQ,SAAR,EACC,UAAA;AAAA,QAAC;AAAA,QAAA;AAAA,UACC,YAAW;AAAA,UACX,YAAW;AAAA,UACX,WAAU;AAAA,UACV,KAAK;AAAA,UACL,WAAS;AAAA,UACT,QAAO;AAAA,UACP,YAAY;AAAA,UACZ,eAAe;AAAA,UACf,aAAa;AAAA,UACb,cAAc;AAAA,UAEd,UAAA;AAAA,YAAA,oBAAC,UAAS,EAAA;AAAA,gCACT,SAAQ,EAAA;AAAA,gCACR,qBAAoB,CAAA,CAAA;AAAA,UAAA;AAAA,QAAA;AAAA,MAAA,EAEzB,CAAA;AAAA,IAAA,EAAA,CACF,EACF,CAAA;AAAA,EAAA,GACF;AAEJ;AAEA,MAAM,6BAA6B,MAAM;AACvC,QAAM,cAAc;AAAA,IAClB,CAAC,UAAU,MAAM,UAAU,YAAY,gBAAgB;AAAA,EACzD;AAEA,6BACG,KAAK,SAAL,EAAa,aACZ,UAAA,oBAAC,oBAAkB,CAAA,GACrB;AAEJ;"}
@@ -10,17 +10,16 @@ const qs = require("qs");
10
10
  const reactIntl = require("react-intl");
11
11
  const reactRouterDom = require("react-router-dom");
12
12
  const styledComponents = require("styled-components");
13
- const index = require("./index-C3fJE-1-.js");
14
- const usePrev = require("./usePrev-B9w_-eYc.js");
13
+ const index = require("./index-BUWEmX8m.js");
14
+ const useDebounce = require("./useDebounce-CtcjDB3L.js");
15
15
  const isEmpty = require("lodash/isEmpty");
16
16
  const parseISO = require("date-fns/parseISO");
17
17
  const toString = require("lodash/toString");
18
- const relations = require("./relations-DYeotliT.js");
18
+ const relations = require("./relations-BPZKAoEY.js");
19
19
  const hooks = require("./hooks-BAaaKPS_.js");
20
20
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
21
21
  function _interopNamespace(e) {
22
- if (e && e.__esModule)
23
- return e;
22
+ if (e && e.__esModule) return e;
24
23
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
25
24
  if (e) {
26
25
  for (const k in e) {
@@ -198,18 +197,22 @@ const FiltersImpl = ({ disabled, schema }) => {
198
197
  );
199
198
  };
200
199
  const AdminUsersFilter = ({ name }) => {
201
- const [page, setPage] = React__namespace.useState(1);
200
+ const [pageSize, setPageSize] = React__namespace.useState(10);
201
+ const [search, setSearch] = React__namespace.useState("");
202
202
  const { formatMessage } = reactIntl.useIntl();
203
+ const debouncedSearch = useDebounce.useDebounce(search, 300);
203
204
  const { data, isLoading } = strapiAdmin.useAdminUsers({
204
- page
205
+ pageSize,
206
+ _q: debouncedSearch
205
207
  });
206
208
  const field = strapiAdmin.useField(name);
207
209
  const handleOpenChange = (isOpen) => {
208
210
  if (!isOpen) {
209
- setPage(1);
211
+ setPageSize(10);
210
212
  }
211
213
  };
212
- const users = data?.users || [];
214
+ const { users = [], pagination } = data ?? {};
215
+ const { pageCount = 1, page = 1 } = pagination ?? {};
213
216
  return /* @__PURE__ */ jsxRuntime.jsx(
214
217
  designSystem.Combobox,
215
218
  {
@@ -221,7 +224,11 @@ const AdminUsersFilter = ({ name }) => {
221
224
  onOpenChange: handleOpenChange,
222
225
  onChange: (value) => field.onChange(name, value),
223
226
  loading: isLoading,
224
- onLoadMore: () => setPage((prev) => prev + 1),
227
+ onLoadMore: () => setPageSize(pageSize + 10),
228
+ hasMoreItems: page < pageCount,
229
+ onInputChange: (e) => {
230
+ setSearch(e.currentTarget.value);
231
+ },
225
232
  children: users.map((user) => {
226
233
  return /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: user.id.toString(), children: index.getDisplayName(user) }, user.id);
227
234
  })
@@ -271,9 +278,8 @@ const RepeatableComponent = ({ content, mainField }) => {
271
278
  return null;
272
279
  }
273
280
  return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Root, { children: [
274
- /* @__PURE__ */ jsxRuntime.jsxs(MenuTrigger$1, { onClick: (e) => e.stopPropagation(), children: [
281
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Trigger, { onClick: (e) => e.stopPropagation(), children: [
275
282
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { children: content.length }),
276
- " ",
277
283
  formatMessage(
278
284
  {
279
285
  id: "content-manager.containers.list.items",
@@ -285,18 +291,12 @@ const RepeatableComponent = ({ content, mainField }) => {
285
291
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Menu.Content, { children: content.map((item) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Menu.Item, { disabled: true, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { maxWidth: "50rem", ellipsis: true, children: /* @__PURE__ */ jsxRuntime.jsx(CellValue, { type: mainField.type, value: item[mainField.name] }) }) }, item.id)) })
286
292
  ] });
287
293
  };
288
- const MenuTrigger$1 = styledComponents.styled(designSystem.Menu.Trigger)`
289
- svg {
290
- width: 0.6rem;
291
- height: 0.4rem;
292
- }
293
- `;
294
294
  const getFileExtension = (ext) => ext && ext[0] === "." ? ext.substring(1) : ext;
295
295
  const MediaSingle = ({ url, mime, alternativeText, name, ext, formats }) => {
296
- const fileURL = usePrev.prefixFileUrlWithBackendUrl(url);
296
+ const fileURL = useDebounce.prefixFileUrlWithBackendUrl(url);
297
297
  if (mime.includes("image")) {
298
298
  const thumbnail = formats?.thumbnail?.url;
299
- const mediaURL = usePrev.prefixFileUrlWithBackendUrl(thumbnail) || fileURL;
299
+ const mediaURL = useDebounce.prefixFileUrlWithBackendUrl(thumbnail) || fileURL;
300
300
  return /* @__PURE__ */ jsxRuntime.jsx(
301
301
  designSystem.Avatar.Item,
302
302
  {
@@ -366,6 +366,7 @@ const RelationMultiple = ({ mainField, content, rowId, name }) => {
366
366
  refetchOnMountOrArgChange: true
367
367
  }
368
368
  );
369
+ const contentCount = Array.isArray(content) ? content.length : content.count;
369
370
  React__namespace.useEffect(() => {
370
371
  if (data) {
371
372
  notifyStatus(
@@ -377,16 +378,13 @@ const RelationMultiple = ({ mainField, content, rowId, name }) => {
377
378
  }
378
379
  }, [data, formatMessage, notifyStatus]);
379
380
  return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Root, { onOpenChange: (isOpen2) => setIsOpen(isOpen2), children: [
380
- /* @__PURE__ */ jsxRuntime.jsx(MenuTrigger, { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 1, wrap: "nowrap", children: [
381
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { children: content.count }),
382
- formatMessage(
383
- {
384
- id: "content-manager.containers.list.items",
385
- defaultMessage: "{number, plural, =0 {items} one {item} other {items}}"
386
- },
387
- { number: content.count }
388
- )
389
- ] }) }),
381
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Menu.Trigger, { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { style: { cursor: "pointer" }, textColor: "neutral800", fontWeight: "regular", children: contentCount > 0 ? formatMessage(
382
+ {
383
+ id: "content-manager.containers.list.items",
384
+ defaultMessage: "{number} {number, plural, =0 {items} one {item} other {items}}"
385
+ },
386
+ { number: contentCount }
387
+ ) : "-" }) }),
390
388
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Content, { children: [
391
389
  isLoading && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Menu.Item, { disabled: true, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Loader, { small: true, children: formatMessage({
392
390
  id: index.getTranslation("ListViewTable.relation-loading"),
@@ -409,15 +407,17 @@ const RelationMultiple = ({ mainField, content, rowId, name }) => {
409
407
  ] })
410
408
  ] });
411
409
  };
412
- const MenuTrigger = styledComponents.styled(designSystem.Menu.Trigger)`
413
- svg {
414
- width: 0.6rem;
415
- height: 0.4rem;
416
- }
417
- `;
418
410
  const CellContent = ({ content, mainField, attribute, rowId, name }) => {
419
411
  if (!hasContent(content, mainField, attribute)) {
420
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: "-" });
412
+ return /* @__PURE__ */ jsxRuntime.jsx(
413
+ designSystem.Typography,
414
+ {
415
+ textColor: "neutral800",
416
+ paddingLeft: attribute.type === "relation" ? "1.6rem" : 0,
417
+ paddingRight: attribute.type === "relation" ? "1.6rem" : 0,
418
+ children: "-"
419
+ }
420
+ );
421
421
  }
422
422
  switch (attribute.type) {
423
423
  case "media":
@@ -457,6 +457,9 @@ const hasContent = (content, mainField, attribute) => {
457
457
  if (isSingleRelation(attribute.relation)) {
458
458
  return !isEmpty__default.default(content);
459
459
  }
460
+ if (Array.isArray(content)) {
461
+ return content.length > 0;
462
+ }
460
463
  return content?.count > 0;
461
464
  }
462
465
  if (["integer", "decimal", "float", "number"].includes(attribute.type)) {
@@ -531,41 +534,53 @@ const FieldPicker = ({ headers = [], resetHeaders, setHeaders }) => {
531
534
  const handleReset = () => {
532
535
  resetHeaders();
533
536
  };
534
- return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { tag: "fieldset", direction: "column", alignItems: "stretch", gap: 3, borderWidth: 0, children: [
535
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", children: [
536
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "legend", variant: "pi", fontWeight: "bold", children: formatMessage({
537
- id: "containers.list.displayedFields",
538
- defaultMessage: "Displayed fields"
539
- }) }),
540
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.TextButton, { onClick: handleReset, children: formatMessage({
541
- id: "app.components.Button.reset",
542
- defaultMessage: "Reset"
543
- }) })
544
- ] }),
545
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", children: columns.map((header) => {
546
- const isActive = headers.includes(header.name);
547
- return /* @__PURE__ */ jsxRuntime.jsx(
548
- designSystem.Flex,
549
- {
550
- wrap: "wrap",
551
- gap: 2,
552
- background: isActive ? "primary100" : "transparent",
553
- hasRadius: true,
554
- padding: 2,
555
- children: /* @__PURE__ */ jsxRuntime.jsx(
556
- designSystem.Checkbox,
537
+ return /* @__PURE__ */ jsxRuntime.jsxs(
538
+ designSystem.Flex,
539
+ {
540
+ tag: "fieldset",
541
+ direction: "column",
542
+ alignItems: "stretch",
543
+ gap: 3,
544
+ borderWidth: 0,
545
+ maxHeight: "240px",
546
+ overflow: "scroll",
547
+ children: [
548
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", children: [
549
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "legend", variant: "pi", fontWeight: "bold", children: formatMessage({
550
+ id: "containers.list.displayedFields",
551
+ defaultMessage: "Displayed fields"
552
+ }) }),
553
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.TextButton, { onClick: handleReset, children: formatMessage({
554
+ id: "app.components.Button.reset",
555
+ defaultMessage: "Reset"
556
+ }) })
557
+ ] }),
558
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", children: columns.map((header) => {
559
+ const isActive = headers.includes(header.name);
560
+ return /* @__PURE__ */ jsxRuntime.jsx(
561
+ designSystem.Flex,
557
562
  {
558
- onCheckedChange: () => handleChange(header.name),
559
- checked: isActive,
560
- name: header.name,
561
- children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontSize: 1, children: header.label })
562
- }
563
- )
564
- },
565
- header.name
566
- );
567
- }) })
568
- ] });
563
+ wrap: "wrap",
564
+ gap: 2,
565
+ background: isActive ? "primary100" : "transparent",
566
+ hasRadius: true,
567
+ padding: 2,
568
+ children: /* @__PURE__ */ jsxRuntime.jsx(
569
+ designSystem.Checkbox,
570
+ {
571
+ onCheckedChange: () => handleChange(header.name),
572
+ checked: isActive,
573
+ name: header.name,
574
+ children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontSize: 1, children: header.label })
575
+ }
576
+ )
577
+ },
578
+ header.name
579
+ );
580
+ }) })
581
+ ]
582
+ }
583
+ );
569
584
  };
570
585
  const { INJECT_COLUMN_IN_TABLE } = index.HOOKS;
571
586
  const LayoutsHeaderCustom = styledComponents.styled(strapiAdmin.Layouts.Header)`
@@ -580,7 +595,7 @@ const ListViewPage = () => {
580
595
  const { collectionType, model, schema } = index.useDoc();
581
596
  const { list } = index.useDocumentLayout(model);
582
597
  const [displayedHeaders, setDisplayedHeaders] = React__namespace.useState([]);
583
- const listLayout = usePrev.usePrev(list.layout);
598
+ const listLayout = useDebounce.usePrev(list.layout);
584
599
  React__namespace.useEffect(() => {
585
600
  if (!isEqual__default.default(listLayout, list.layout)) {
586
601
  setDisplayedHeaders(list.layout);
@@ -633,10 +648,14 @@ const ListViewPage = () => {
633
648
  layout: list
634
649
  });
635
650
  const formattedHeaders = headers.displayedHeaders.map((header) => {
651
+ const translation = typeof header.label === "string" ? {
652
+ id: `content-manager.content-types.${model}.${header.name}`,
653
+ defaultMessage: header.label
654
+ } : header.label;
636
655
  return {
637
656
  ...header,
638
- label: typeof header.label === "string" ? header.label : formatMessage(header.label),
639
- name: `${header.name}${header.mainField ? `.${header.mainField}` : ""}`
657
+ label: formatMessage(translation),
658
+ name: `${header.name}${header.mainField?.name ? `.${header.mainField.name}` : ""}`
640
659
  };
641
660
  });
642
661
  if (schema?.options?.draftAndPublish) {
@@ -654,7 +673,14 @@ const ListViewPage = () => {
654
673
  });
655
674
  }
656
675
  return formattedHeaders;
657
- }, [displayedHeaders, formatMessage, list, runHookWaterfall, schema?.options?.draftAndPublish]);
676
+ }, [
677
+ displayedHeaders,
678
+ formatMessage,
679
+ list,
680
+ runHookWaterfall,
681
+ schema?.options?.draftAndPublish,
682
+ model
683
+ ]);
658
684
  if (isFetching) {
659
685
  return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Loading, {});
660
686
  }
@@ -788,7 +814,7 @@ const TableActionsBar = () => {
788
814
  const selectRow = strapiAdmin.useTable("TableActionsBar", (state) => state.selectRow);
789
815
  const [{ query }] = strapiAdmin.useQueryParams();
790
816
  const locale = query?.plugins?.i18n?.locale;
791
- const prevLocale = usePrev.usePrev(locale);
817
+ const prevLocale = useDebounce.usePrev(locale);
792
818
  React__namespace.useEffect(() => {
793
819
  if (prevLocale !== locale) {
794
820
  selectRow([]);
@@ -845,4 +871,4 @@ const ProtectedListViewPage = () => {
845
871
  };
846
872
  exports.ListViewPage = ListViewPage;
847
873
  exports.ProtectedListViewPage = ProtectedListViewPage;
848
- //# sourceMappingURL=ListViewPage-4XsciqHZ.js.map
874
+ //# sourceMappingURL=ListViewPage-BtSi8C1l.js.map