@strapi/content-manager 0.0.0-experimental.edc24aaa3bb5a90fa5fd4fee208167dd4e2e38d4 → 0.0.0-experimental.f0d3b2d782e972f1dcb8acf0dce31d4090d1e420

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 (175) hide show
  1. package/dist/_chunks/{ComponentConfigurationPage-5ukroXAh.js → ComponentConfigurationPage-D2_cVxXK.js} +4 -4
  2. package/dist/_chunks/{ComponentConfigurationPage-5ukroXAh.js.map → ComponentConfigurationPage-D2_cVxXK.js.map} +1 -1
  3. package/dist/_chunks/{ComponentConfigurationPage-BAgyHiMm.mjs → ComponentConfigurationPage-suSMW3KC.mjs} +4 -4
  4. package/dist/_chunks/{ComponentConfigurationPage-BAgyHiMm.mjs.map → ComponentConfigurationPage-suSMW3KC.mjs.map} +1 -1
  5. package/dist/_chunks/{EditConfigurationPage-DmoXawIh.mjs → EditConfigurationPage-CBscKbxt.mjs} +4 -4
  6. package/dist/_chunks/{EditConfigurationPage-DmoXawIh.mjs.map → EditConfigurationPage-CBscKbxt.mjs.map} +1 -1
  7. package/dist/_chunks/{EditConfigurationPage-Xp7lun0f.js → EditConfigurationPage-Z_VzHVH4.js} +4 -4
  8. package/dist/_chunks/{EditConfigurationPage-Xp7lun0f.js.map → EditConfigurationPage-Z_VzHVH4.js.map} +1 -1
  9. package/dist/_chunks/{EditViewPage-BLsjc5F-.mjs → EditViewPage-D5Zhyw_q.mjs} +30 -9
  10. package/dist/_chunks/EditViewPage-D5Zhyw_q.mjs.map +1 -0
  11. package/dist/_chunks/{EditViewPage-C-ukDOB7.js → EditViewPage-DzDDKiF5.js} +30 -9
  12. package/dist/_chunks/EditViewPage-DzDDKiF5.js.map +1 -0
  13. package/dist/_chunks/{Field-Bfph5SOd.js → Field-CZHNLm_m.js} +175 -103
  14. package/dist/_chunks/Field-CZHNLm_m.js.map +1 -0
  15. package/dist/_chunks/{Field-Cs7duwWd.mjs → Field-FNlyAbcI.mjs} +173 -101
  16. package/dist/_chunks/Field-FNlyAbcI.mjs.map +1 -0
  17. package/dist/_chunks/{Form-CPYqIWDG.js → Form-DqPHDLuK.js} +36 -17
  18. package/dist/_chunks/Form-DqPHDLuK.js.map +1 -0
  19. package/dist/_chunks/{Form-Dg_GS5TQ.mjs → Form-Sq_OVNv-.mjs} +36 -17
  20. package/dist/_chunks/Form-Sq_OVNv-.mjs.map +1 -0
  21. package/dist/_chunks/{History-DNQkXANT.js → History-B-ZiOAEg.js} +37 -40
  22. package/dist/_chunks/History-B-ZiOAEg.js.map +1 -0
  23. package/dist/_chunks/{History-wrnHqf09.mjs → History-DlL3k_OW.mjs} +38 -41
  24. package/dist/_chunks/History-DlL3k_OW.mjs.map +1 -0
  25. package/dist/_chunks/{ListConfigurationPage-CUQxfpjT.js → ListConfigurationPage-Cc0hLAoS.js} +15 -5
  26. package/dist/_chunks/ListConfigurationPage-Cc0hLAoS.js.map +1 -0
  27. package/dist/_chunks/{ListConfigurationPage-DScmJVkW.mjs → ListConfigurationPage-xj3cSF5M.mjs} +15 -5
  28. package/dist/_chunks/ListConfigurationPage-xj3cSF5M.mjs.map +1 -0
  29. package/dist/_chunks/{ListViewPage-C4IvrMgY.mjs → ListViewPage-C9STpcYd.mjs} +59 -39
  30. package/dist/_chunks/ListViewPage-C9STpcYd.mjs.map +1 -0
  31. package/dist/_chunks/{ListViewPage-BsLiH2-2.js → ListViewPage-D48T84aT.js} +61 -41
  32. package/dist/_chunks/ListViewPage-D48T84aT.js.map +1 -0
  33. package/dist/_chunks/{NoContentTypePage-BZ-PnGAf.js → NoContentTypePage-BnUmUnXQ.js} +2 -2
  34. package/dist/_chunks/{NoContentTypePage-BZ-PnGAf.js.map → NoContentTypePage-BnUmUnXQ.js.map} +1 -1
  35. package/dist/_chunks/{NoContentTypePage-Djg8nPlj.mjs → NoContentTypePage-DpV_ouD6.mjs} +2 -2
  36. package/dist/_chunks/{NoContentTypePage-Djg8nPlj.mjs.map → NoContentTypePage-DpV_ouD6.mjs.map} +1 -1
  37. package/dist/_chunks/{NoPermissionsPage-DSP7R-hv.mjs → NoPermissionsPage-BeDixsE9.mjs} +2 -2
  38. package/dist/_chunks/{NoPermissionsPage-DSP7R-hv.mjs.map → NoPermissionsPage-BeDixsE9.mjs.map} +1 -1
  39. package/dist/_chunks/{NoPermissionsPage-_lUqjGW3.js → NoPermissionsPage-z-CpOFfh.js} +2 -2
  40. package/dist/_chunks/{NoPermissionsPage-_lUqjGW3.js.map → NoPermissionsPage-z-CpOFfh.js.map} +1 -1
  41. package/dist/_chunks/{Relations-BZr8tL0R.mjs → Relations-CTiimSAg.mjs} +73 -37
  42. package/dist/_chunks/Relations-CTiimSAg.mjs.map +1 -0
  43. package/dist/_chunks/{Relations-CtELXYIK.js → Relations-Cs5vJLAp.js} +72 -36
  44. package/dist/_chunks/Relations-Cs5vJLAp.js.map +1 -0
  45. package/dist/_chunks/{en-uOUIxfcQ.js → en-Bm0D0IWz.js} +13 -12
  46. package/dist/_chunks/{en-uOUIxfcQ.js.map → en-Bm0D0IWz.js.map} +1 -1
  47. package/dist/_chunks/{en-BrCTWlZv.mjs → en-DKV44jRb.mjs} +13 -12
  48. package/dist/_chunks/{en-BrCTWlZv.mjs.map → en-DKV44jRb.mjs.map} +1 -1
  49. package/dist/_chunks/{fr-B7kGGg3E.js → fr-C6t7ywEg.js} +12 -2
  50. package/dist/_chunks/{fr-B7kGGg3E.js.map → fr-C6t7ywEg.js.map} +1 -1
  51. package/dist/_chunks/{fr-CD9VFbPM.mjs → fr-DxrTDLl6.mjs} +12 -2
  52. package/dist/_chunks/{fr-CD9VFbPM.mjs.map → fr-DxrTDLl6.mjs.map} +1 -1
  53. package/dist/_chunks/{index-c_5DdJi-.mjs → index-DUZzV11o.mjs} +1987 -1801
  54. package/dist/_chunks/index-DUZzV11o.mjs.map +1 -0
  55. package/dist/_chunks/{index-OerGjbAN.js → index-dFQ_8EM3.js} +1968 -1781
  56. package/dist/_chunks/index-dFQ_8EM3.js.map +1 -0
  57. package/dist/_chunks/{layout-Ci7qHlFb.js → layout-Bu-ET7w6.js} +21 -8
  58. package/dist/_chunks/layout-Bu-ET7w6.js.map +1 -0
  59. package/dist/_chunks/{layout-oPBiO7RY.mjs → layout-C-eg7m9Y.mjs} +22 -9
  60. package/dist/_chunks/layout-C-eg7m9Y.mjs.map +1 -0
  61. package/dist/_chunks/{objects-gigeqt7s.js → objects-BcXOv6_9.js} +2 -4
  62. package/dist/_chunks/{objects-gigeqt7s.js.map → objects-BcXOv6_9.js.map} +1 -1
  63. package/dist/_chunks/{objects-mKMAmfec.mjs → objects-D6yBsdmx.mjs} +2 -4
  64. package/dist/_chunks/{objects-mKMAmfec.mjs.map → objects-D6yBsdmx.mjs.map} +1 -1
  65. package/dist/_chunks/{relations-BIdWFjdq.mjs → relations-Cj61Oyt2.mjs} +3 -7
  66. package/dist/_chunks/relations-Cj61Oyt2.mjs.map +1 -0
  67. package/dist/_chunks/{relations-COBpStiF.js → relations-isLeDaA0.js} +3 -7
  68. package/dist/_chunks/relations-isLeDaA0.js.map +1 -0
  69. package/dist/_chunks/{usePrev-B9w_-eYc.js → useDebounce-CtcjDB3L.js} +14 -1
  70. package/dist/_chunks/useDebounce-CtcjDB3L.js.map +1 -0
  71. package/dist/_chunks/useDebounce-DmuSJIF3.mjs +29 -0
  72. package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +1 -0
  73. package/dist/admin/index.js +2 -1
  74. package/dist/admin/index.js.map +1 -1
  75. package/dist/admin/index.mjs +5 -4
  76. package/dist/admin/src/exports.d.ts +1 -1
  77. package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
  78. package/dist/admin/src/hooks/useDocument.d.ts +32 -1
  79. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +2 -2
  80. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.d.ts +2 -2
  81. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +4 -48
  82. package/dist/admin/src/pages/EditView/components/Header.d.ts +11 -11
  83. package/dist/admin/src/preview/constants.d.ts +1 -0
  84. package/dist/admin/src/preview/index.d.ts +4 -0
  85. package/dist/admin/src/services/api.d.ts +1 -1
  86. package/dist/admin/src/services/components.d.ts +2 -2
  87. package/dist/admin/src/services/contentTypes.d.ts +3 -3
  88. package/dist/admin/src/services/documents.d.ts +19 -17
  89. package/dist/admin/src/services/init.d.ts +1 -1
  90. package/dist/admin/src/services/relations.d.ts +2 -2
  91. package/dist/admin/src/services/uid.d.ts +3 -3
  92. package/dist/admin/src/utils/validation.d.ts +4 -1
  93. package/dist/server/index.js +513 -235
  94. package/dist/server/index.js.map +1 -1
  95. package/dist/server/index.mjs +514 -236
  96. package/dist/server/index.mjs.map +1 -1
  97. package/dist/server/src/bootstrap.d.ts.map +1 -1
  98. package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
  99. package/dist/server/src/controllers/index.d.ts.map +1 -1
  100. package/dist/server/src/controllers/relations.d.ts.map +1 -1
  101. package/dist/server/src/controllers/utils/metadata.d.ts +15 -1
  102. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  103. package/dist/server/src/history/services/history.d.ts.map +1 -1
  104. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  105. package/dist/server/src/history/services/utils.d.ts +4 -4
  106. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  107. package/dist/server/src/index.d.ts +4 -4
  108. package/dist/server/src/policies/hasPermissions.d.ts.map +1 -1
  109. package/dist/server/src/preview/constants.d.ts +2 -0
  110. package/dist/server/src/preview/constants.d.ts.map +1 -0
  111. package/dist/server/src/preview/controllers/index.d.ts +2 -0
  112. package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
  113. package/dist/server/src/preview/controllers/preview.d.ts +13 -0
  114. package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
  115. package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
  116. package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
  117. package/dist/server/src/preview/index.d.ts +4 -0
  118. package/dist/server/src/preview/index.d.ts.map +1 -0
  119. package/dist/server/src/preview/routes/index.d.ts +8 -0
  120. package/dist/server/src/preview/routes/index.d.ts.map +1 -0
  121. package/dist/server/src/preview/routes/preview.d.ts +4 -0
  122. package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
  123. package/dist/server/src/preview/services/index.d.ts +15 -0
  124. package/dist/server/src/preview/services/index.d.ts.map +1 -0
  125. package/dist/server/src/preview/services/preview-config.d.ts +30 -0
  126. package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
  127. package/dist/server/src/preview/services/preview.d.ts +12 -0
  128. package/dist/server/src/preview/services/preview.d.ts.map +1 -0
  129. package/dist/server/src/preview/utils.d.ts +18 -0
  130. package/dist/server/src/preview/utils.d.ts.map +1 -0
  131. package/dist/server/src/routes/index.d.ts.map +1 -1
  132. package/dist/server/src/services/document-metadata.d.ts +8 -8
  133. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  134. package/dist/server/src/services/index.d.ts +4 -4
  135. package/dist/server/src/services/index.d.ts.map +1 -1
  136. package/dist/server/src/services/permission-checker.d.ts.map +1 -1
  137. package/dist/server/src/services/utils/configuration/index.d.ts +2 -2
  138. package/dist/server/src/services/utils/configuration/layouts.d.ts +2 -2
  139. package/dist/server/src/utils/index.d.ts +2 -0
  140. package/dist/server/src/utils/index.d.ts.map +1 -1
  141. package/dist/shared/contracts/collection-types.d.ts +3 -1
  142. package/dist/shared/contracts/collection-types.d.ts.map +1 -1
  143. package/dist/shared/contracts/index.d.ts +1 -0
  144. package/dist/shared/contracts/index.d.ts.map +1 -1
  145. package/dist/shared/contracts/preview.d.ts +27 -0
  146. package/dist/shared/contracts/preview.d.ts.map +1 -0
  147. package/dist/shared/index.js +4 -0
  148. package/dist/shared/index.js.map +1 -1
  149. package/dist/shared/index.mjs +4 -0
  150. package/dist/shared/index.mjs.map +1 -1
  151. package/package.json +13 -13
  152. package/dist/_chunks/EditViewPage-BLsjc5F-.mjs.map +0 -1
  153. package/dist/_chunks/EditViewPage-C-ukDOB7.js.map +0 -1
  154. package/dist/_chunks/Field-Bfph5SOd.js.map +0 -1
  155. package/dist/_chunks/Field-Cs7duwWd.mjs.map +0 -1
  156. package/dist/_chunks/Form-CPYqIWDG.js.map +0 -1
  157. package/dist/_chunks/Form-Dg_GS5TQ.mjs.map +0 -1
  158. package/dist/_chunks/History-DNQkXANT.js.map +0 -1
  159. package/dist/_chunks/History-wrnHqf09.mjs.map +0 -1
  160. package/dist/_chunks/ListConfigurationPage-CUQxfpjT.js.map +0 -1
  161. package/dist/_chunks/ListConfigurationPage-DScmJVkW.mjs.map +0 -1
  162. package/dist/_chunks/ListViewPage-BsLiH2-2.js.map +0 -1
  163. package/dist/_chunks/ListViewPage-C4IvrMgY.mjs.map +0 -1
  164. package/dist/_chunks/Relations-BZr8tL0R.mjs.map +0 -1
  165. package/dist/_chunks/Relations-CtELXYIK.js.map +0 -1
  166. package/dist/_chunks/index-OerGjbAN.js.map +0 -1
  167. package/dist/_chunks/index-c_5DdJi-.mjs.map +0 -1
  168. package/dist/_chunks/layout-Ci7qHlFb.js.map +0 -1
  169. package/dist/_chunks/layout-oPBiO7RY.mjs.map +0 -1
  170. package/dist/_chunks/relations-BIdWFjdq.mjs.map +0 -1
  171. package/dist/_chunks/relations-COBpStiF.js.map +0 -1
  172. package/dist/_chunks/usePrev-B9w_-eYc.js.map +0 -1
  173. package/dist/_chunks/usePrev-DH6iah0A.mjs +0 -16
  174. package/dist/_chunks/usePrev-DH6iah0A.mjs.map +0 -1
  175. package/strapi-server.js +0 -3
@@ -1,19 +1,19 @@
1
1
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
- import { useTracking, useAuth, useQueryParams, useAdminUsers, Filters, useField, useRBAC, useNotification, useAPIErrorHandler, useStrapiApp, Page, Layouts, BackButton, SearchInput, Table, Pagination, useTable } from "@strapi/admin/strapi-admin";
4
- import { useCollator, Combobox, ComboboxOption, Menu, Tooltip, Typography, Badge, Avatar, Flex, useNotifyAT, Loader, Popover, IconButton, LinkButton, TextButton, Checkbox, Button } from "@strapi/design-system";
3
+ import { useTracking, useAuth, useQueryParams, useAdminUsers, Filters, useField, useRBAC, Layouts, useNotification, useAPIErrorHandler, useStrapiApp, Page, BackButton, SearchInput, Table, Pagination, useTable } from "@strapi/admin/strapi-admin";
4
+ import { useCollator, Combobox, ComboboxOption, Tooltip, Typography, Menu, Badge, Avatar, Flex, useNotifyAT, Loader, Popover, IconButton, LinkButton, TextButton, Checkbox, Button } from "@strapi/design-system";
5
5
  import { Cog, ListPlus, Plus } from "@strapi/icons";
6
6
  import isEqual from "lodash/isEqual";
7
7
  import { stringify } from "qs";
8
8
  import { useIntl } from "react-intl";
9
9
  import { NavLink, useNavigate, Link, useParams } from "react-router-dom";
10
10
  import { styled } from "styled-components";
11
- import { u as useContentTypeSchema, o as useGetContentTypeConfigurationQuery, p as CREATOR_FIELDS, q as getMainField, r as getDisplayName, c as useDoc, g as getTranslation, h as useDocumentLayout, t as checkIfAttributeIsDisplayable, d as buildValidParams, v as useGetAllDocumentsQuery, f as useDocumentRBAC, I as InjectionZone, D as DocumentStatus, T as TableActions, B as BulkActionsRenderer, k as PERMISSIONS, l as DocumentRBAC, H as HOOKS, w as convertListLayoutToFieldLayouts } from "./index-c_5DdJi-.mjs";
12
- import { p as prefixFileUrlWithBackendUrl, u as usePrev } from "./usePrev-DH6iah0A.mjs";
11
+ import { u as useContentTypeSchema, p as useGetContentTypeConfigurationQuery, q as CREATOR_FIELDS, r as getMainField, t as getDisplayName, c as useDoc, g as getTranslation, h as useDocumentLayout, v as checkIfAttributeIsDisplayable, d as buildValidParams, w as useGetAllDocumentsQuery, f as useDocumentRBAC, I as InjectionZone, D as DocumentStatus, T as TableActions, B as BulkActionsRenderer, k as PERMISSIONS, l as DocumentRBAC, H as HOOKS, x as convertListLayoutToFieldLayouts } from "./index-DUZzV11o.mjs";
12
+ import { a as useDebounce, p as prefixFileUrlWithBackendUrl, u as usePrev } from "./useDebounce-DmuSJIF3.mjs";
13
13
  import isEmpty from "lodash/isEmpty";
14
14
  import parseISO from "date-fns/parseISO";
15
15
  import toString from "lodash/toString";
16
- import { g as getRelationLabel, u as useGetRelationsQuery } from "./relations-BIdWFjdq.mjs";
16
+ import { g as getRelationLabel, u as useGetRelationsQuery } from "./relations-Cj61Oyt2.mjs";
17
17
  import { u as useTypedSelector } from "./hooks-E5u1mcgM.mjs";
18
18
  const NOT_ALLOWED_FILTERS = [
19
19
  "json",
@@ -172,18 +172,22 @@ const FiltersImpl = ({ disabled, schema }) => {
172
172
  );
173
173
  };
174
174
  const AdminUsersFilter = ({ name }) => {
175
- const [page, setPage] = React.useState(1);
175
+ const [pageSize, setPageSize] = React.useState(10);
176
+ const [search, setSearch] = React.useState("");
176
177
  const { formatMessage } = useIntl();
178
+ const debouncedSearch = useDebounce(search, 300);
177
179
  const { data, isLoading } = useAdminUsers({
178
- page
180
+ pageSize,
181
+ _q: debouncedSearch
179
182
  });
180
183
  const field = useField(name);
181
184
  const handleOpenChange = (isOpen) => {
182
185
  if (!isOpen) {
183
- setPage(1);
186
+ setPageSize(10);
184
187
  }
185
188
  };
186
- const users = data?.users || [];
189
+ const { users = [], pagination } = data ?? {};
190
+ const { pageCount = 1, page = 1 } = pagination ?? {};
187
191
  return /* @__PURE__ */ jsx(
188
192
  Combobox,
189
193
  {
@@ -195,7 +199,11 @@ const AdminUsersFilter = ({ name }) => {
195
199
  onOpenChange: handleOpenChange,
196
200
  onChange: (value) => field.onChange(name, value),
197
201
  loading: isLoading,
198
- onLoadMore: () => setPage((prev) => prev + 1),
202
+ onLoadMore: () => setPageSize(pageSize + 10),
203
+ hasMoreItems: page < pageCount,
204
+ onInputChange: (e) => {
205
+ setSearch(e.currentTarget.value);
206
+ },
199
207
  children: users.map((user) => {
200
208
  return /* @__PURE__ */ jsx(ComboboxOption, { value: user.id.toString(), children: getDisplayName(user) }, user.id);
201
209
  })
@@ -245,9 +253,8 @@ const RepeatableComponent = ({ content, mainField }) => {
245
253
  return null;
246
254
  }
247
255
  return /* @__PURE__ */ jsxs(Menu.Root, { children: [
248
- /* @__PURE__ */ jsxs(MenuTrigger$1, { onClick: (e) => e.stopPropagation(), children: [
256
+ /* @__PURE__ */ jsxs(Menu.Trigger, { onClick: (e) => e.stopPropagation(), children: [
249
257
  /* @__PURE__ */ jsx(Badge, { children: content.length }),
250
- " ",
251
258
  formatMessage(
252
259
  {
253
260
  id: "content-manager.containers.list.items",
@@ -259,12 +266,6 @@ const RepeatableComponent = ({ content, mainField }) => {
259
266
  /* @__PURE__ */ jsx(Menu.Content, { children: content.map((item) => /* @__PURE__ */ jsx(Menu.Item, { disabled: true, children: /* @__PURE__ */ jsx(Typography, { maxWidth: "50rem", ellipsis: true, children: /* @__PURE__ */ jsx(CellValue, { type: mainField.type, value: item[mainField.name] }) }) }, item.id)) })
260
267
  ] });
261
268
  };
262
- const MenuTrigger$1 = styled(Menu.Trigger)`
263
- svg {
264
- width: 0.6rem;
265
- height: 0.4rem;
266
- }
267
- `;
268
269
  const getFileExtension = (ext) => ext && ext[0] === "." ? ext.substring(1) : ext;
269
270
  const MediaSingle = ({ url, mime, alternativeText, name, ext, formats }) => {
270
271
  const fileURL = prefixFileUrlWithBackendUrl(url);
@@ -340,6 +341,7 @@ const RelationMultiple = ({ mainField, content, rowId, name }) => {
340
341
  refetchOnMountOrArgChange: true
341
342
  }
342
343
  );
344
+ const contentCount = Array.isArray(content) ? content.length : content.count;
343
345
  React.useEffect(() => {
344
346
  if (data) {
345
347
  notifyStatus(
@@ -351,16 +353,13 @@ const RelationMultiple = ({ mainField, content, rowId, name }) => {
351
353
  }
352
354
  }, [data, formatMessage, notifyStatus]);
353
355
  return /* @__PURE__ */ jsxs(Menu.Root, { onOpenChange: (isOpen2) => setIsOpen(isOpen2), children: [
354
- /* @__PURE__ */ jsx(MenuTrigger, { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsxs(Flex, { gap: 1, wrap: "nowrap", children: [
355
- /* @__PURE__ */ jsx(Badge, { children: content.count }),
356
- formatMessage(
357
- {
358
- id: "content-manager.containers.list.items",
359
- defaultMessage: "{number, plural, =0 {items} one {item} other {items}}"
360
- },
361
- { number: content.count }
362
- )
363
- ] }) }),
356
+ /* @__PURE__ */ jsx(Menu.Trigger, { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsx(Typography, { style: { cursor: "pointer" }, textColor: "neutral800", fontWeight: "regular", children: contentCount > 0 ? formatMessage(
357
+ {
358
+ id: "content-manager.containers.list.items",
359
+ defaultMessage: "{number} {number, plural, =0 {items} one {item} other {items}}"
360
+ },
361
+ { number: contentCount }
362
+ ) : "-" }) }),
364
363
  /* @__PURE__ */ jsxs(Menu.Content, { children: [
365
364
  isLoading && /* @__PURE__ */ jsx(Menu.Item, { disabled: true, children: /* @__PURE__ */ jsx(Loader, { small: true, children: formatMessage({
366
365
  id: getTranslation("ListViewTable.relation-loading"),
@@ -383,15 +382,17 @@ const RelationMultiple = ({ mainField, content, rowId, name }) => {
383
382
  ] })
384
383
  ] });
385
384
  };
386
- const MenuTrigger = styled(Menu.Trigger)`
387
- svg {
388
- width: 0.6rem;
389
- height: 0.4rem;
390
- }
391
- `;
392
385
  const CellContent = ({ content, mainField, attribute, rowId, name }) => {
393
386
  if (!hasContent(content, mainField, attribute)) {
394
- return /* @__PURE__ */ jsx(Typography, { textColor: "neutral800", children: "-" });
387
+ return /* @__PURE__ */ jsx(
388
+ Typography,
389
+ {
390
+ textColor: "neutral800",
391
+ paddingLeft: attribute.type === "relation" ? "1.6rem" : 0,
392
+ paddingRight: attribute.type === "relation" ? "1.6rem" : 0,
393
+ children: "-"
394
+ }
395
+ );
395
396
  }
396
397
  switch (attribute.type) {
397
398
  case "media":
@@ -431,6 +432,9 @@ const hasContent = (content, mainField, attribute) => {
431
432
  if (isSingleRelation(attribute.relation)) {
432
433
  return !isEmpty(content);
433
434
  }
435
+ if (Array.isArray(content)) {
436
+ return content.length > 0;
437
+ }
434
438
  return content?.count > 0;
435
439
  }
436
440
  if (["integer", "decimal", "float", "number"].includes(attribute.type)) {
@@ -542,6 +546,9 @@ const FieldPicker = ({ headers = [], resetHeaders, setHeaders }) => {
542
546
  ] });
543
547
  };
544
548
  const { INJECT_COLUMN_IN_TABLE } = HOOKS;
549
+ const LayoutsHeaderCustom = styled(Layouts.Header)`
550
+ overflow-wrap: anywhere;
551
+ `;
545
552
  const ListViewPage = () => {
546
553
  const { trackUsage } = useTracking();
547
554
  const navigate = useNavigate();
@@ -568,9 +575,20 @@ const ListViewPage = () => {
568
575
  sort: list.settings.defaultSortBy ? `${list.settings.defaultSortBy}:${list.settings.defaultSortOrder}` : ""
569
576
  });
570
577
  const params = React.useMemo(() => buildValidParams(query), [query]);
578
+ const queryString = React.useMemo(
579
+ () => stringify(params, { encode: true, encodeValuesOnly: true }),
580
+ [params]
581
+ );
582
+ const paramObject = React.useMemo(() => {
583
+ const pairs = queryString.split("&").map((param) => {
584
+ const [key, value] = param.split("=");
585
+ return { [key]: value };
586
+ });
587
+ return Object.assign({}, ...pairs);
588
+ }, [queryString]);
571
589
  const { data, error, isFetching } = useGetAllDocumentsQuery({
572
590
  model,
573
- params
591
+ params: paramObject
574
592
  });
575
593
  React.useEffect(() => {
576
594
  if (error) {
@@ -607,7 +625,7 @@ const ListViewPage = () => {
607
625
  return {
608
626
  ...header,
609
627
  label: typeof header.label === "string" ? header.label : formatMessage(header.label),
610
- name: `${header.name}${header.mainField ? `.${header.mainField}` : ""}`
628
+ name: `${header.name}${header.mainField?.name ? `.${header.mainField.name}` : ""}`
611
629
  };
612
630
  });
613
631
  if (schema?.options?.draftAndPublish) {
@@ -643,7 +661,7 @@ const ListViewPage = () => {
643
661
  return /* @__PURE__ */ jsxs(Page.Main, { children: [
644
662
  /* @__PURE__ */ jsx(Page.Title, { children: `${contentTypeTitle}` }),
645
663
  /* @__PURE__ */ jsx(
646
- Layouts.Header,
664
+ LayoutsHeaderCustom,
647
665
  {
648
666
  primaryAction: canCreate ? /* @__PURE__ */ jsx(CreateButton, {}) : null,
649
667
  subtitle: formatMessage(
@@ -785,6 +803,8 @@ const CreateButton = ({ variant }) => {
785
803
  pathname: "create",
786
804
  search: stringify({ plugins: query.plugins })
787
805
  },
806
+ minWidth: "max-content",
807
+ marginLeft: 2,
788
808
  children: formatMessage({
789
809
  id: getTranslation("HeaderLayout.button.label-add-entry"),
790
810
  defaultMessage: "Create new entry"
@@ -816,4 +836,4 @@ export {
816
836
  ListViewPage,
817
837
  ProtectedListViewPage
818
838
  };
819
- //# sourceMappingURL=ListViewPage-C4IvrMgY.mjs.map
839
+ //# sourceMappingURL=ListViewPage-C9STpcYd.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListViewPage-C9STpcYd.mjs","sources":["../../admin/src/pages/ListView/components/Filters.tsx","../../admin/src/pages/ListView/components/TableCells/CellValue.tsx","../../admin/src/pages/ListView/components/TableCells/Components.tsx","../../admin/src/pages/ListView/components/TableCells/Media.tsx","../../admin/src/pages/ListView/components/TableCells/Relations.tsx","../../admin/src/pages/ListView/components/TableCells/CellContent.tsx","../../admin/src/pages/ListView/components/ViewSettingsMenu.tsx","../../admin/src/pages/ListView/ListViewPage.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport {\n Filters,\n useField,\n useAuth,\n useTracking,\n useQueryParams,\n useAdminUsers,\n} from '@strapi/admin/strapi-admin';\nimport { Combobox, ComboboxOption, useCollator } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\n\nimport { CREATOR_FIELDS } from '../../../constants/attributes';\nimport { useContentTypeSchema } from '../../../hooks/useContentTypeSchema';\nimport { useDebounce } from '../../../hooks/useDebounce';\nimport { Schema } from '../../../hooks/useDocument';\nimport { useGetContentTypeConfigurationQuery } from '../../../services/contentTypes';\nimport { getMainField } from '../../../utils/attributes';\nimport { getDisplayName } from '../../../utils/users';\n\n/**\n * If new attributes are added, this list needs to be updated.\n */\nconst NOT_ALLOWED_FILTERS = [\n 'json',\n 'component',\n 'media',\n 'richtext',\n 'dynamiczone',\n 'password',\n 'blocks',\n];\nconst DEFAULT_ALLOWED_FILTERS = ['createdAt', 'updatedAt'];\nconst USER_FILTER_ATTRIBUTES = [...CREATOR_FIELDS, 'strapi_assignee'];\n\n/* -------------------------------------------------------------------------------------------------\n * Filters\n * -----------------------------------------------------------------------------------------------*/\ninterface FiltersProps {\n disabled?: boolean;\n schema: Schema;\n}\n\nconst FiltersImpl = ({ disabled, schema }: FiltersProps) => {\n const { attributes, uid: model, options } = schema;\n const { formatMessage, locale } = useIntl();\n const { trackUsage } = useTracking();\n const allPermissions = useAuth('FiltersImpl', (state) => state.permissions);\n const [{ query }] = useQueryParams<Filters.Query>();\n const { schemas } = useContentTypeSchema();\n\n const canReadAdminUsers = React.useMemo(\n () =>\n allPermissions.filter(\n (permission) => permission.action === 'admin::users.read' && permission.subject === null\n ).length > 0,\n [allPermissions]\n );\n\n const selectedUserIds = (query?.filters?.$and ?? []).reduce<string[]>((acc, filter) => {\n const [key, value] = Object.entries(filter)[0];\n if (typeof value.id !== 'object') {\n return acc;\n }\n\n const id = value.id.$eq || value.id.$ne;\n\n if (id && USER_FILTER_ATTRIBUTES.includes(key) && !acc.includes(id)) {\n acc.push(id);\n }\n\n return acc;\n }, []);\n\n const { data: userData, isLoading: isLoadingAdminUsers } = useAdminUsers(\n { filters: { id: { $in: selectedUserIds } } },\n {\n // fetch the list of admin users only if the filter contains users and the\n // current user has permissions to display users\n skip: selectedUserIds.length === 0 || !canReadAdminUsers,\n }\n );\n\n const { users = [] } = userData ?? {};\n\n const { metadata } = useGetContentTypeConfigurationQuery(model, {\n selectFromResult: ({ data }) => ({ metadata: data?.contentType.metadatas ?? {} }),\n });\n\n const formatter = useCollator(locale, {\n sensitivity: 'base',\n });\n\n const displayedFilters = React.useMemo(() => {\n const [{ properties: { fields = [] } = { fields: [] } }] = allPermissions.filter(\n (permission) =>\n permission.action === 'plugin::content-manager.explorer.read' &&\n permission.subject === model\n );\n\n const allowedFields = fields.filter((field) => {\n const attribute = attributes[field] ?? {};\n\n return attribute.type && !NOT_ALLOWED_FILTERS.includes(attribute.type);\n });\n\n return (\n [\n 'id',\n ...allowedFields,\n ...DEFAULT_ALLOWED_FILTERS,\n ...(canReadAdminUsers ? CREATOR_FIELDS : []),\n ]\n .map((name) => {\n const attribute = attributes[name];\n\n if (NOT_ALLOWED_FILTERS.includes(attribute.type)) {\n return null;\n }\n\n const { mainField: mainFieldName = '', label } = metadata[name].list;\n\n let filter: Filters.Filter = {\n name,\n label: label ?? '',\n mainField: getMainField(attribute, mainFieldName, { schemas, components: {} }),\n // @ts-expect-error – TODO: this is filtered out above in the `allowedFields` call but TS complains, is there a better way to solve this?\n type: attribute.type,\n };\n\n if (\n attribute.type === 'relation' &&\n 'target' in attribute &&\n attribute.target === 'admin::user'\n ) {\n filter = {\n ...filter,\n input: AdminUsersFilter,\n options: users.map((user) => ({\n label: getDisplayName(user),\n value: user.id.toString(),\n })),\n operators: [\n {\n label: formatMessage({\n id: 'components.FilterOptions.FILTER_TYPES.$eq',\n defaultMessage: 'is',\n }),\n value: '$eq',\n },\n {\n label: formatMessage({\n id: 'components.FilterOptions.FILTER_TYPES.$ne',\n defaultMessage: 'is not',\n }),\n value: '$ne',\n },\n ],\n mainField: {\n name: 'id',\n type: 'integer',\n },\n };\n }\n\n if (attribute.type === 'enumeration') {\n filter = {\n ...filter,\n options: attribute.enum.map((value) => ({\n label: value,\n value,\n })),\n };\n }\n\n return filter;\n })\n .filter(Boolean) as Filters.Filter[]\n ).toSorted((a, b) => formatter.compare(a.label, b.label));\n }, [\n allPermissions,\n canReadAdminUsers,\n model,\n attributes,\n metadata,\n schemas,\n users,\n formatMessage,\n formatter,\n ]);\n\n const onOpenChange = (isOpen: boolean) => {\n if (isOpen) {\n trackUsage('willFilterEntries');\n }\n };\n\n const handleFilterChange: Filters.Props['onChange'] = (data) => {\n const attribute = attributes[data.name];\n\n if (attribute) {\n trackUsage('didFilterEntries', {\n useRelation: attribute.type === 'relation',\n });\n }\n };\n\n return (\n <Filters.Root\n disabled={disabled}\n options={displayedFilters}\n onOpenChange={onOpenChange}\n onChange={handleFilterChange}\n >\n <Filters.Trigger />\n <Filters.Popover />\n <Filters.List />\n </Filters.Root>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * AdminUsersFilter\n * -----------------------------------------------------------------------------------------------*/\n\nconst AdminUsersFilter = ({ name }: Filters.ValueInputProps) => {\n const [pageSize, setPageSize] = React.useState(10);\n const [search, setSearch] = React.useState('');\n const { formatMessage } = useIntl();\n\n const debouncedSearch = useDebounce(search, 300);\n\n const { data, isLoading } = useAdminUsers({\n pageSize,\n _q: debouncedSearch,\n });\n const field = useField(name);\n\n const handleOpenChange = (isOpen?: boolean) => {\n if (!isOpen) {\n setPageSize(10);\n }\n };\n\n const { users = [], pagination } = data ?? {};\n const { pageCount = 1, page = 1 } = pagination ?? {};\n\n return (\n <Combobox\n value={field.value}\n aria-label={formatMessage({\n id: 'content-manager.components.Filters.usersSelect.label',\n defaultMessage: 'Search and select a user to filter',\n })}\n onOpenChange={handleOpenChange}\n onChange={(value) => field.onChange(name, value)}\n loading={isLoading}\n onLoadMore={() => setPageSize(pageSize + 10)}\n hasMoreItems={page < pageCount}\n onInputChange={(e: React.ChangeEvent<HTMLInputElement>) => {\n setSearch(e.currentTarget.value);\n }}\n >\n {users.map((user) => {\n return (\n <ComboboxOption key={user.id} value={user.id.toString()}>\n {getDisplayName(user)}\n </ComboboxOption>\n );\n })}\n </Combobox>\n );\n};\n\nexport { FiltersImpl as Filters };\nexport type { FiltersProps };\n","import parseISO from 'date-fns/parseISO';\nimport toString from 'lodash/toString';\nimport { useIntl } from 'react-intl';\n\nimport type { Schema } from '@strapi/types';\n\ninterface CellValueProps {\n type: Schema.Attribute.Kind | 'custom';\n value: any;\n}\n\nconst CellValue = ({ type, value }: CellValueProps) => {\n const { formatDate, formatTime, formatNumber } = useIntl();\n let formattedValue = value;\n\n if (type === 'date') {\n formattedValue = formatDate(parseISO(value), { dateStyle: 'full' });\n }\n\n if (type === 'datetime') {\n formattedValue = formatDate(value, { dateStyle: 'full', timeStyle: 'short' });\n }\n\n if (type === 'time') {\n const [hour, minute, second] = value.split(':');\n const date = new Date();\n date.setHours(hour);\n date.setMinutes(minute);\n date.setSeconds(second);\n\n formattedValue = formatTime(date, {\n timeStyle: 'short',\n });\n }\n\n if (['float', 'decimal'].includes(type)) {\n formattedValue = formatNumber(value, {\n // Should be kept in sync with the corresponding value\n // in the design-system/NumberInput: https://github.com/strapi/design-system/blob/main/packages/strapi-design-system/src/NumberInput/NumberInput.js#L53\n maximumFractionDigits: 20,\n });\n }\n\n if (['integer', 'biginteger'].includes(type)) {\n formattedValue = formatNumber(value, { maximumFractionDigits: 0 });\n }\n\n return toString(formattedValue);\n};\n\nexport { CellValue };\nexport type { CellValueProps };\n","import { Badge, Tooltip, Typography, Menu } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport { styled } from 'styled-components';\n\nimport { CellContentProps } from './CellContent';\nimport { CellValue } from './CellValue';\n\nimport type { Schema } from '@strapi/types';\n\n/* -------------------------------------------------------------------------------------------------\n * SingleComponent\n * -----------------------------------------------------------------------------------------------*/\n\ninterface SingleComponentProps extends Pick<CellContentProps, 'mainField'> {\n content: Schema.Attribute.Value<Schema.Attribute.Component<`${string}.${string}`, false>>;\n}\n\nconst SingleComponent = ({ content, mainField }: SingleComponentProps) => {\n if (!mainField) {\n return null;\n }\n\n return (\n <Tooltip label={content[mainField.name]}>\n <Typography maxWidth=\"25rem\" textColor=\"neutral800\" ellipsis>\n <CellValue type={mainField.type} value={content[mainField.name]} />\n </Typography>\n </Tooltip>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * RepeatableComponent\n * -----------------------------------------------------------------------------------------------*/\n\ninterface RepeatableComponentProps extends Pick<CellContentProps, 'mainField'> {\n content: Schema.Attribute.Value<Schema.Attribute.Component<`${string}.${string}`, true>>;\n}\n\nconst RepeatableComponent = ({ content, mainField }: RepeatableComponentProps) => {\n const { formatMessage } = useIntl();\n\n if (!mainField) {\n return null;\n }\n\n return (\n <Menu.Root>\n <Menu.Trigger onClick={(e) => e.stopPropagation()}>\n <Badge>{content.length}</Badge>\n {formatMessage(\n {\n id: 'content-manager.containers.list.items',\n defaultMessage: '{number, plural, =0 {items} one {item} other {items}}',\n },\n { number: content.length }\n )}\n </Menu.Trigger>\n <Menu.Content>\n {content.map((item) => (\n <Menu.Item key={item.id} disabled>\n <Typography maxWidth=\"50rem\" ellipsis>\n <CellValue type={mainField.type} value={item[mainField.name]} />\n </Typography>\n </Menu.Item>\n ))}\n </Menu.Content>\n </Menu.Root>\n );\n};\n\nexport { SingleComponent, RepeatableComponent };\nexport type { SingleComponentProps, RepeatableComponentProps };\n","import * as React from 'react';\n\nimport { Avatar, Flex, Tooltip, Typography, TypographyComponent } from '@strapi/design-system';\nimport { styled } from 'styled-components';\n\nimport { prefixFileUrlWithBackendUrl } from '../../../../utils/urls';\n\nimport type { Data } from '@strapi/types';\n\ninterface MediaFile {\n id?: Data.ID;\n alternativeText?: string;\n ext: string;\n formats: {\n thumbnail?: {\n url?: string;\n };\n };\n mime: string;\n name: string;\n url: string;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * Media\n * -----------------------------------------------------------------------------------------------*/\n\ninterface MediaSingleProps extends MediaFile {}\n\nconst getFileExtension = (ext: string) => (ext && ext[0] === '.' ? ext.substring(1) : ext);\n\nconst MediaSingle = ({ url, mime, alternativeText, name, ext, formats }: MediaSingleProps) => {\n const fileURL = prefixFileUrlWithBackendUrl(url)!;\n\n if (mime.includes('image')) {\n const thumbnail = formats?.thumbnail?.url;\n const mediaURL = prefixFileUrlWithBackendUrl(thumbnail) || fileURL;\n\n return (\n <Avatar.Item\n src={mediaURL}\n alt={alternativeText || name}\n fallback={alternativeText || name}\n preview\n />\n );\n }\n\n const fileExtension = getFileExtension(ext);\n const fileName = name.length > 100 ? `${name.substring(0, 100)}...` : name;\n\n return (\n <Tooltip description={fileName}>\n <FileWrapper>{fileExtension}</FileWrapper>\n </Tooltip>\n );\n};\n\nconst FileWrapper = ({ children }: { children: React.ReactNode }) => {\n return (\n <Flex\n tag=\"span\"\n position=\"relative\"\n borderRadius=\"50%\"\n width=\"26px\"\n height=\"26px\"\n borderColor=\"neutral200\"\n background=\"neutral150\"\n paddingLeft=\"1px\"\n justifyContent=\"center\"\n alignItems=\"center\"\n >\n <FileTypography variant=\"sigma\" textColor=\"neutral600\">\n {children}\n </FileTypography>\n </Flex>\n );\n};\n\nconst FileTypography = styled<TypographyComponent>(Typography)`\n font-size: 0.9rem;\n line-height: 0.9rem;\n`;\n\n/* -------------------------------------------------------------------------------------------------\n * MediaMultiple\n * -----------------------------------------------------------------------------------------------*/\n\ninterface MediaMultipleProps {\n content: MediaFile[];\n}\n\nconst MediaMultiple = ({ content }: MediaMultipleProps) => {\n return (\n <Avatar.Group>\n {content.map((file, index) => {\n const key = `${file.id}${index}`;\n\n if (index === 3) {\n const remainingFiles = `+${content.length - 3}`;\n\n return <FileWrapper key={key}>{remainingFiles}</FileWrapper>;\n }\n\n if (index > 3) {\n return null;\n }\n\n return <MediaSingle key={key} {...file} />;\n })}\n </Avatar.Group>\n );\n};\n\nexport { MediaMultiple, MediaSingle };\nexport type { MediaMultipleProps, MediaSingleProps };\n","import * as React from 'react';\n\nimport { Typography, Loader, useNotifyAT, Menu } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\n\nimport { useDoc } from '../../../../hooks/useDocument';\nimport { useGetRelationsQuery } from '../../../../services/relations';\nimport { getRelationLabel } from '../../../../utils/relations';\nimport { getTranslation } from '../../../../utils/translations';\n\nimport type { CellContentProps } from './CellContent';\n\n/* -------------------------------------------------------------------------------------------------\n * RelationSingle\n * -----------------------------------------------------------------------------------------------*/\n\ninterface RelationSingleProps extends Pick<CellContentProps, 'mainField' | 'content'> {}\n\nconst RelationSingle = ({ mainField, content }: RelationSingleProps) => {\n return (\n <Typography maxWidth=\"50rem\" textColor=\"neutral800\" ellipsis>\n {getRelationLabel(content, mainField)}\n </Typography>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * RelationMultiple\n * -----------------------------------------------------------------------------------------------*/\n\ninterface RelationMultipleProps\n extends Pick<CellContentProps, 'mainField' | 'content' | 'name' | 'rowId'> {}\n\n/**\n * TODO: fix this component – tracking issue https://strapi-inc.atlassian.net/browse/CONTENT-2184\n */\nconst RelationMultiple = ({ mainField, content, rowId, name }: RelationMultipleProps) => {\n const { model } = useDoc();\n const { formatMessage } = useIntl();\n const { notifyStatus } = useNotifyAT();\n const [isOpen, setIsOpen] = React.useState(false);\n\n const [targetField] = name.split('.');\n\n const { data, isLoading } = useGetRelationsQuery(\n {\n model,\n id: rowId,\n targetField,\n },\n {\n skip: !isOpen,\n refetchOnMountOrArgChange: true,\n }\n );\n\n const contentCount = Array.isArray(content) ? content.length : content.count;\n\n React.useEffect(() => {\n if (data) {\n notifyStatus(\n formatMessage({\n id: getTranslation('DynamicTable.relation-loaded'),\n defaultMessage: 'Relations have been loaded',\n })\n );\n }\n }, [data, formatMessage, notifyStatus]);\n\n return (\n <Menu.Root onOpenChange={(isOpen) => setIsOpen(isOpen)}>\n <Menu.Trigger onClick={(e) => e.stopPropagation()}>\n <Typography style={{ cursor: 'pointer' }} textColor=\"neutral800\" fontWeight=\"regular\">\n {contentCount > 0\n ? formatMessage(\n {\n id: 'content-manager.containers.list.items',\n defaultMessage: '{number} {number, plural, =0 {items} one {item} other {items}}',\n },\n { number: contentCount }\n )\n : '-'}\n </Typography>\n </Menu.Trigger>\n <Menu.Content>\n {isLoading && (\n <Menu.Item disabled>\n <Loader small>\n {formatMessage({\n id: getTranslation('ListViewTable.relation-loading'),\n defaultMessage: 'Relations are loading',\n })}\n </Loader>\n </Menu.Item>\n )}\n {data?.results && (\n <>\n {data.results.map((entry) => (\n <Menu.Item key={entry.documentId} disabled>\n <Typography maxWidth=\"50rem\" ellipsis>\n {getRelationLabel(entry, mainField)}\n </Typography>\n </Menu.Item>\n ))}\n\n {data?.pagination && data?.pagination.total > 10 && (\n <Menu.Item\n aria-disabled\n aria-label={formatMessage({\n id: getTranslation('ListViewTable.relation-more'),\n defaultMessage: 'This relation contains more entities than displayed',\n })}\n >\n <Typography>…</Typography>\n </Menu.Item>\n )}\n </>\n )}\n </Menu.Content>\n </Menu.Root>\n );\n};\n\nexport { RelationSingle, RelationMultiple };\nexport type { RelationSingleProps, RelationMultipleProps };\n","import { Tooltip, Typography } from '@strapi/design-system';\nimport isEmpty from 'lodash/isEmpty';\n\nimport { CellValue } from './CellValue';\nimport { SingleComponent, RepeatableComponent } from './Components';\nimport { MediaSingle, MediaMultiple } from './Media';\nimport { RelationMultiple, RelationSingle } from './Relations';\n\nimport type { ListFieldLayout } from '../../../../hooks/useDocumentLayout';\nimport type { Schema, Data } from '@strapi/types';\n\ninterface CellContentProps extends Omit<ListFieldLayout, 'cellFormatter'> {\n content: Schema.Attribute.Value<Schema.Attribute.AnyAttribute>;\n rowId: Data.ID;\n}\n\nconst CellContent = ({ content, mainField, attribute, rowId, name }: CellContentProps) => {\n if (!hasContent(content, mainField, attribute)) {\n return (\n <Typography\n textColor=\"neutral800\"\n paddingLeft={attribute.type === ('relation' || 'component') ? '1.6rem' : 0}\n paddingRight={attribute.type === ('relation' || 'component') ? '1.6rem' : 0}\n >\n -\n </Typography>\n );\n }\n\n switch (attribute.type) {\n case 'media':\n if (!attribute.multiple) {\n return <MediaSingle {...content} />;\n }\n\n return <MediaMultiple content={content} />;\n\n case 'relation': {\n if (isSingleRelation(attribute.relation)) {\n return <RelationSingle mainField={mainField} content={content} />;\n }\n\n return <RelationMultiple rowId={rowId} mainField={mainField} content={content} name={name} />;\n }\n\n case 'component':\n if (attribute.repeatable) {\n return <RepeatableComponent mainField={mainField} content={content} />;\n }\n\n return <SingleComponent mainField={mainField} content={content} />;\n\n case 'string':\n return (\n <Tooltip description={content}>\n <Typography maxWidth=\"30rem\" ellipsis textColor=\"neutral800\">\n <CellValue type={attribute.type} value={content} />\n </Typography>\n </Tooltip>\n );\n\n default:\n return (\n <Typography maxWidth=\"30rem\" ellipsis textColor=\"neutral800\">\n <CellValue type={attribute.type} value={content} />\n </Typography>\n );\n }\n};\n\nconst hasContent = (\n content: CellContentProps['content'],\n mainField: CellContentProps['mainField'],\n attribute: CellContentProps['attribute']\n) => {\n if (attribute.type === 'component') {\n // Repeatable fields show the ID as fallback, in case the mainField\n // doesn't have any content\n if (attribute.repeatable || !mainField) {\n return content?.length > 0;\n }\n\n const value = content?.[mainField.name];\n\n // relations, media ... show the id as fallback\n if (mainField.name === 'id' && ![undefined, null].includes(value)) {\n return true;\n }\n\n return !isEmpty(value);\n }\n\n if (attribute.type === 'relation') {\n if (isSingleRelation(attribute.relation)) {\n return !isEmpty(content);\n }\n\n if (Array.isArray(content)) {\n return content.length > 0;\n }\n\n return content?.count > 0;\n }\n\n /*\n Biginteger fields need to be treated as strings, as `isNumber`\n doesn't deal with them.\n */\n if (['integer', 'decimal', 'float', 'number'].includes(attribute.type)) {\n return typeof content === 'number';\n }\n\n if (attribute.type === 'boolean') {\n return content !== null;\n }\n\n return !isEmpty(content);\n};\n\nconst isSingleRelation = (\n type: Extract<CellContentProps['attribute'], { type: 'relation' }>['relation']\n) => ['oneToOne', 'manyToOne', 'oneToOneMorph'].includes(type);\n\nexport { CellContent };\nexport type { CellContentProps };\n","import * as React from 'react';\n\nimport { useTracking, useRBAC, useQueryParams } from '@strapi/admin/strapi-admin';\nimport {\n Flex,\n IconButton,\n Popover,\n Checkbox,\n TextButton,\n Typography,\n useCollator,\n LinkButton,\n} from '@strapi/design-system';\nimport { Cog, ListPlus } from '@strapi/icons';\nimport { stringify } from 'qs';\nimport { useIntl } from 'react-intl';\nimport { NavLink } from 'react-router-dom';\n\nimport { useDoc } from '../../../hooks/useDocument';\nimport { useDocumentLayout } from '../../../hooks/useDocumentLayout';\nimport { useTypedSelector } from '../../../modules/hooks';\nimport { checkIfAttributeIsDisplayable } from '../../../utils/attributes';\n\ninterface ViewSettingsMenuProps extends FieldPickerProps {}\n\nconst ViewSettingsMenu = (props: ViewSettingsMenuProps) => {\n const permissions = useTypedSelector(\n (state) => state.admin_app.permissions.contentManager?.collectionTypesConfigurations ?? []\n );\n const [{ query }] = useQueryParams<{ plugins?: Record<string, unknown> }>();\n const { formatMessage } = useIntl();\n const {\n allowedActions: { canConfigureView },\n } = useRBAC(permissions);\n\n return (\n <Popover.Root>\n <Popover.Trigger>\n <IconButton\n label={formatMessage({\n id: 'components.ViewSettings.tooltip',\n defaultMessage: 'View Settings',\n })}\n >\n <Cog />\n </IconButton>\n </Popover.Trigger>\n <Popover.Content side=\"bottom\" align=\"end\" sideOffset={4}>\n <Flex alignItems=\"stretch\" direction=\"column\" padding={3} gap={3}>\n {canConfigureView ? (\n <LinkButton\n size=\"S\"\n startIcon={<ListPlus />}\n variant=\"secondary\"\n tag={NavLink}\n to={{\n pathname: 'configurations/list',\n search: query.plugins\n ? stringify({ plugins: query.plugins }, { encode: false })\n : '',\n }}\n >\n {formatMessage({\n id: 'app.links.configure-view',\n defaultMessage: 'Configure the view',\n })}\n </LinkButton>\n ) : null}\n <FieldPicker {...props} />\n </Flex>\n </Popover.Content>\n </Popover.Root>\n );\n};\n\ninterface FieldPickerProps {\n headers?: string[];\n setHeaders: (headers: string[]) => void;\n resetHeaders: () => void;\n}\n\nconst FieldPicker = ({ headers = [], resetHeaders, setHeaders }: FieldPickerProps) => {\n const { trackUsage } = useTracking();\n const { formatMessage, locale } = useIntl();\n\n const { schema, model } = useDoc();\n const { list } = useDocumentLayout(model);\n\n const formatter = useCollator(locale, {\n sensitivity: 'base',\n });\n\n const attributes = schema?.attributes ?? {};\n\n const columns = Object.keys(attributes)\n .filter((name) => checkIfAttributeIsDisplayable(attributes[name]))\n .map((name) => ({\n name,\n label: list.metadatas[name]?.label ?? '',\n }))\n .sort((a, b) => formatter.compare(a.label, b.label));\n\n const handleChange = (name: string) => {\n trackUsage('didChangeDisplayedFields');\n\n /**\n * create an array of the new headers, if the new name exists it should be removed,\n * otherwise it should be added\n */\n const newHeaders = headers.includes(name)\n ? headers.filter((header) => header !== name)\n : [...headers, name];\n\n setHeaders(newHeaders);\n };\n\n const handleReset = () => {\n resetHeaders();\n };\n\n return (\n <Flex tag=\"fieldset\" direction=\"column\" alignItems=\"stretch\" gap={3} borderWidth={0}>\n <Flex justifyContent=\"space-between\">\n <Typography tag=\"legend\" variant=\"pi\" fontWeight=\"bold\">\n {formatMessage({\n id: 'containers.list.displayedFields',\n defaultMessage: 'Displayed fields',\n })}\n </Typography>\n\n <TextButton onClick={handleReset}>\n {formatMessage({\n id: 'app.components.Button.reset',\n defaultMessage: 'Reset',\n })}\n </TextButton>\n </Flex>\n\n <Flex direction=\"column\" alignItems=\"stretch\">\n {columns.map((header) => {\n const isActive = headers.includes(header.name);\n\n return (\n <Flex\n wrap=\"wrap\"\n gap={2}\n background={isActive ? 'primary100' : 'transparent'}\n hasRadius\n padding={2}\n key={header.name}\n >\n <Checkbox\n onCheckedChange={() => handleChange(header.name)}\n checked={isActive}\n name={header.name}\n >\n <Typography fontSize={1}>{header.label}</Typography>\n </Checkbox>\n </Flex>\n );\n })}\n </Flex>\n </Flex>\n );\n};\n\nexport { ViewSettingsMenu };\nexport type { ViewSettingsMenuProps, FieldPickerProps };\n","import * as React from 'react';\n\nimport {\n Page,\n Pagination,\n SearchInput,\n Table,\n BackButton,\n useNotification,\n useStrapiApp,\n useTracking,\n useAPIErrorHandler,\n useQueryParams,\n useRBAC,\n Layouts,\n useTable,\n} from '@strapi/admin/strapi-admin';\nimport { Button, Flex, Typography, ButtonProps } from '@strapi/design-system';\nimport { Plus } from '@strapi/icons';\nimport isEqual from 'lodash/isEqual';\nimport { stringify } from 'qs';\nimport { useIntl } from 'react-intl';\nimport { useNavigate, Link as ReactRouterLink, useParams } from 'react-router-dom';\nimport { styled } from 'styled-components';\n\nimport { InjectionZone } from '../../components/InjectionZone';\nimport { HOOKS } from '../../constants/hooks';\nimport { PERMISSIONS } from '../../constants/plugin';\nimport { DocumentRBAC, useDocumentRBAC } from '../../features/DocumentRBAC';\nimport { useDoc } from '../../hooks/useDocument';\nimport {\n ListFieldLayout,\n convertListLayoutToFieldLayouts,\n useDocumentLayout,\n} from '../../hooks/useDocumentLayout';\nimport { usePrev } from '../../hooks/usePrev';\nimport { useGetAllDocumentsQuery } from '../../services/documents';\nimport { buildValidParams } from '../../utils/api';\nimport { getTranslation } from '../../utils/translations';\nimport { getDisplayName } from '../../utils/users';\nimport { DocumentStatus } from '../EditView/components/DocumentStatus';\n\nimport { BulkActionsRenderer } from './components/BulkActions/Actions';\nimport { Filters } from './components/Filters';\nimport { TableActions } from './components/TableActions';\nimport { CellContent } from './components/TableCells/CellContent';\nimport { ViewSettingsMenu } from './components/ViewSettingsMenu';\n\nimport type { Modules } from '@strapi/types';\n\nconst { INJECT_COLUMN_IN_TABLE } = HOOKS;\n\n/* -------------------------------------------------------------------------------------------------\n * ListViewPage\n * -----------------------------------------------------------------------------------------------*/\nconst LayoutsHeaderCustom = styled(Layouts.Header)`\n overflow-wrap: anywhere;\n`;\n\nconst ListViewPage = () => {\n const { trackUsage } = useTracking();\n const navigate = useNavigate();\n const { formatMessage } = useIntl();\n const { toggleNotification } = useNotification();\n const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler(getTranslation);\n\n const { collectionType, model, schema } = useDoc();\n const { list } = useDocumentLayout(model);\n\n const [displayedHeaders, setDisplayedHeaders] = React.useState<ListFieldLayout[]>([]);\n\n const listLayout = usePrev(list.layout);\n React.useEffect(() => {\n /**\n * ONLY update the displayedHeaders if the document\n * layout has actually changed in value.\n */\n if (!isEqual(listLayout, list.layout)) {\n setDisplayedHeaders(list.layout);\n }\n }, [list.layout, listLayout]);\n\n const handleSetHeaders = (headers: string[]) => {\n setDisplayedHeaders(\n convertListLayoutToFieldLayouts(headers, schema!.attributes, list.metadatas)\n );\n };\n\n const [{ query }] = useQueryParams<{\n plugins?: Record<string, unknown>;\n page?: string;\n pageSize?: string;\n sort?: string;\n }>({\n page: '1',\n pageSize: list.settings.pageSize.toString(),\n sort: list.settings.defaultSortBy\n ? `${list.settings.defaultSortBy}:${list.settings.defaultSortOrder}`\n : '',\n });\n\n const params = React.useMemo(() => buildValidParams(query), [query]);\n const queryString = React.useMemo(\n () => stringify(params, { encode: true, encodeValuesOnly: true }),\n [params]\n );\n const paramObject = React.useMemo(() => {\n const pairs = queryString.split('&').map((param) => {\n const [key, value] = param.split('=');\n return { [key]: value };\n });\n return Object.assign({}, ...pairs);\n }, [queryString]);\n\n const { data, error, isFetching } = useGetAllDocumentsQuery({\n model,\n params: paramObject,\n });\n\n /**\n * If the API returns an error, display a notification\n */\n React.useEffect(() => {\n if (error) {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(error),\n });\n }\n }, [error, formatAPIError, toggleNotification]);\n\n const { results = [], pagination } = data ?? {};\n\n React.useEffect(() => {\n if (pagination && pagination.pageCount > 0 && pagination.page > pagination.pageCount) {\n navigate(\n {\n search: stringify({\n ...query,\n page: pagination.pageCount,\n }),\n },\n { replace: true }\n );\n }\n }, [pagination, formatMessage, query, navigate]);\n\n const { canCreate } = useDocumentRBAC('ListViewPage', ({ canCreate }) => ({\n canCreate,\n }));\n\n const runHookWaterfall = useStrapiApp('ListViewPage', ({ runHookWaterfall }) => runHookWaterfall);\n /**\n * Run the waterfall and then inject our additional table headers.\n */\n const tableHeaders = React.useMemo(() => {\n const headers = runHookWaterfall(INJECT_COLUMN_IN_TABLE, {\n displayedHeaders,\n layout: list,\n });\n\n const formattedHeaders = headers.displayedHeaders.map<ListFieldLayout>((header) => {\n return {\n ...header,\n label: typeof header.label === 'string' ? header.label : formatMessage(header.label),\n name: `${header.name}${header.mainField?.name ? `.${header.mainField.name}` : ''}`,\n };\n });\n\n if (schema?.options?.draftAndPublish) {\n formattedHeaders.push({\n attribute: {\n type: 'custom',\n },\n name: 'status',\n label: formatMessage({\n id: getTranslation(`containers.list.table-headers.status`),\n defaultMessage: 'status',\n }),\n searchable: false,\n sortable: false,\n } satisfies ListFieldLayout);\n }\n\n return formattedHeaders;\n }, [displayedHeaders, formatMessage, list, runHookWaterfall, schema?.options?.draftAndPublish]);\n\n if (isFetching) {\n return <Page.Loading />;\n }\n\n if (error) {\n return <Page.Error />;\n }\n\n const contentTypeTitle = schema?.info.displayName ?? 'Untitled';\n\n const handleRowClick = (id: Modules.Documents.ID) => () => {\n trackUsage('willEditEntryFromList');\n navigate({\n pathname: id.toString(),\n search: stringify({ plugins: query.plugins }),\n });\n };\n\n return (\n <Page.Main>\n <Page.Title>{`${contentTypeTitle}`}</Page.Title>\n <LayoutsHeaderCustom\n primaryAction={canCreate ? <CreateButton /> : null}\n subtitle={formatMessage(\n {\n id: getTranslation('pages.ListView.header-subtitle'),\n defaultMessage:\n '{number, plural, =0 {# entries} one {# entry} other {# entries}} found',\n },\n { number: pagination?.total }\n )}\n title={contentTypeTitle}\n navigationAction={<BackButton />}\n />\n <Layouts.Action\n endActions={\n <>\n <InjectionZone area=\"listView.actions\" />\n <ViewSettingsMenu\n setHeaders={handleSetHeaders}\n resetHeaders={() => setDisplayedHeaders(list.layout)}\n headers={displayedHeaders.map((header) => header.name)}\n />\n </>\n }\n startActions={\n <>\n {list.settings.searchable && (\n <SearchInput\n disabled={results.length === 0}\n label={formatMessage(\n { id: 'app.component.search.label', defaultMessage: 'Search for {target}' },\n { target: contentTypeTitle }\n )}\n placeholder={formatMessage({\n id: 'global.search',\n defaultMessage: 'Search',\n })}\n trackedEvent=\"didSearch\"\n />\n )}\n {list.settings.filterable && schema ? (\n <Filters disabled={results.length === 0} schema={schema} />\n ) : null}\n </>\n }\n />\n <Layouts.Content>\n <Flex gap={4} direction=\"column\" alignItems=\"stretch\">\n <Table.Root rows={results} headers={tableHeaders} isLoading={isFetching}>\n <TableActionsBar />\n <Table.Content>\n <Table.Head>\n <Table.HeaderCheckboxCell />\n {tableHeaders.map((header: ListFieldLayout) => (\n <Table.HeaderCell key={header.name} {...header} />\n ))}\n </Table.Head>\n <Table.Loading />\n <Table.Empty action={canCreate ? <CreateButton variant=\"secondary\" /> : null} />\n <Table.Body>\n {results.map((row) => {\n return (\n <Table.Row\n cursor=\"pointer\"\n key={row.id}\n onClick={handleRowClick(row.documentId)}\n >\n <Table.CheckboxCell id={row.id} />\n {tableHeaders.map(({ cellFormatter, ...header }) => {\n if (header.name === 'status') {\n const { status } = row;\n\n return (\n <Table.Cell key={header.name}>\n <DocumentStatus status={status} maxWidth={'min-content'} />\n </Table.Cell>\n );\n }\n if (['createdBy', 'updatedBy'].includes(header.name.split('.')[0])) {\n // Display the users full name\n // Some entries doesn't have a user assigned as creator/updater (ex: entries created through content API)\n // In this case, we display a dash\n return (\n <Table.Cell key={header.name}>\n <Typography textColor=\"neutral800\">\n {row[header.name.split('.')[0]]\n ? getDisplayName(row[header.name.split('.')[0]])\n : '-'}\n </Typography>\n </Table.Cell>\n );\n }\n if (typeof cellFormatter === 'function') {\n return (\n <Table.Cell key={header.name}>\n {/* @ts-expect-error – TODO: fix this TS error */}\n {cellFormatter(row, header, { collectionType, model })}\n </Table.Cell>\n );\n }\n return (\n <Table.Cell key={header.name}>\n <CellContent\n content={row[header.name.split('.')[0]]}\n rowId={row.documentId}\n {...header}\n />\n </Table.Cell>\n );\n })}\n {/* we stop propogation here to allow the menu to trigger it's events without triggering the row redirect */}\n <ActionsCell onClick={(e) => e.stopPropagation()}>\n <TableActions document={row} />\n </ActionsCell>\n </Table.Row>\n );\n })}\n </Table.Body>\n </Table.Content>\n </Table.Root>\n <Pagination.Root\n {...pagination}\n onPageSizeChange={() => trackUsage('willChangeNumberOfEntriesPerPage')}\n >\n <Pagination.PageSize />\n <Pagination.Links />\n </Pagination.Root>\n </Flex>\n </Layouts.Content>\n </Page.Main>\n );\n};\n\nconst ActionsCell = styled(Table.Cell)`\n display: flex;\n justify-content: flex-end;\n`;\n\n/* -------------------------------------------------------------------------------------------------\n * TableActionsBar\n * -----------------------------------------------------------------------------------------------*/\n\nconst TableActionsBar = () => {\n const selectRow = useTable('TableActionsBar', (state) => state.selectRow);\n const [{ query }] = useQueryParams<{ plugins: { i18n: { locale: string } } }>();\n const locale = query?.plugins?.i18n?.locale;\n const prevLocale = usePrev(locale);\n\n // TODO: find a better way to reset the selected rows when the locale changes across all the app\n React.useEffect(() => {\n if (prevLocale !== locale) {\n selectRow([]);\n }\n }, [selectRow, prevLocale, locale]);\n\n return (\n <Table.ActionBar>\n <BulkActionsRenderer />\n </Table.ActionBar>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * CreateButton\n * -----------------------------------------------------------------------------------------------*/\n\ninterface CreateButtonProps extends Pick<ButtonProps, 'variant'> {}\n\nconst CreateButton = ({ variant }: CreateButtonProps) => {\n const { formatMessage } = useIntl();\n const { trackUsage } = useTracking();\n const [{ query }] = useQueryParams<{ plugins: object }>();\n\n return (\n <Button\n variant={variant}\n tag={ReactRouterLink}\n onClick={() => {\n trackUsage('willCreateEntry', { status: 'draft' });\n }}\n startIcon={<Plus />}\n style={{ textDecoration: 'none' }}\n to={{\n pathname: 'create',\n search: stringify({ plugins: query.plugins }),\n }}\n minWidth=\"max-content\"\n marginLeft={2}\n >\n {formatMessage({\n id: getTranslation('HeaderLayout.button.label-add-entry'),\n defaultMessage: 'Create new entry',\n })}\n </Button>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * ProtectedListViewPage\n * -----------------------------------------------------------------------------------------------*/\n\nconst ProtectedListViewPage = () => {\n const { slug = '' } = useParams<{\n slug: string;\n }>();\n const {\n permissions = [],\n isLoading,\n error,\n } = useRBAC(\n PERMISSIONS.map((action) => ({\n action,\n subject: slug,\n }))\n );\n\n if (isLoading) {\n return <Page.Loading />;\n }\n\n if (error || !slug) {\n return <Page.Error />;\n }\n\n return (\n <Page.Protect permissions={permissions}>\n {({ permissions }) => (\n <DocumentRBAC permissions={permissions}>\n <ListViewPage />\n </DocumentRBAC>\n )}\n </Page.Protect>\n );\n};\n\nexport { ListViewPage, ProtectedListViewPage };\n"],"names":["isOpen","canCreate","runHookWaterfall","Filters","ReactRouterLink","permissions"],"mappings":";;;;;;;;;;;;;;;;;AAwBA,MAAM,sBAAsB;AAAA,EAC1B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AACA,MAAM,0BAA0B,CAAC,aAAa,WAAW;AACzD,MAAM,yBAAyB,CAAC,GAAG,gBAAgB,iBAAiB;AAUpE,MAAM,cAAc,CAAC,EAAE,UAAU,aAA2B;AAC1D,QAAM,EAAE,YAAY,KAAK,OAAO,YAAY;AAC5C,QAAM,EAAE,eAAe,OAAO,IAAI,QAAQ;AACpC,QAAA,EAAE,eAAe;AACvB,QAAM,iBAAiB,QAAQ,eAAe,CAAC,UAAU,MAAM,WAAW;AAC1E,QAAM,CAAC,EAAE,OAAO,IAAI,eAA8B;AAC5C,QAAA,EAAE,YAAY;AAEpB,QAAM,oBAAoB,MAAM;AAAA,IAC9B,MACE,eAAe;AAAA,MACb,CAAC,eAAe,WAAW,WAAW,uBAAuB,WAAW,YAAY;AAAA,MACpF,SAAS;AAAA,IACb,CAAC,cAAc;AAAA,EAAA;AAGX,QAAA,mBAAmB,OAAO,SAAS,QAAQ,CAAA,GAAI,OAAiB,CAAC,KAAK,WAAW;AAC/E,UAAA,CAAC,KAAK,KAAK,IAAI,OAAO,QAAQ,MAAM,EAAE,CAAC;AACzC,QAAA,OAAO,MAAM,OAAO,UAAU;AACzB,aAAA;AAAA,IACT;AAEA,UAAM,KAAK,MAAM,GAAG,OAAO,MAAM,GAAG;AAEhC,QAAA,MAAM,uBAAuB,SAAS,GAAG,KAAK,CAAC,IAAI,SAAS,EAAE,GAAG;AACnE,UAAI,KAAK,EAAE;AAAA,IACb;AAEO,WAAA;AAAA,EACT,GAAG,CAAE,CAAA;AAEL,QAAM,EAAE,MAAM,UAAU,W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A,MACjB,OAAO,EAAE,gBAAgB,OAAO;AAAA,MAChC,IAAI;AAAA,QACF,UAAU;AAAA,QACV,QAAQ,UAAU,EAAE,SAAS,MAAM,SAAS;AAAA,MAC9C;AAAA,MACA,UAAS;AAAA,MACT,YAAY;AAAA,MAEX,UAAc,cAAA;AAAA,QACb,IAAI,eAAe,qCAAqC;AAAA,QACxD,gBAAgB;AAAA,MAAA,CACjB;AAAA,IAAA;AAAA,EAAA;AAGP;AAMA,MAAM,wBAAwB,MAAM;AAClC,QAAM,EAAE,OAAO,GAAG,IAAI,UAEnB;AACG,QAAA;AAAA,IACJ,cAAc,CAAC;AAAA,IACf;AAAA,IACA;AAAA,EAAA,IACE;AAAA,IACF,YAAY,IAAI,CAAC,YAAY;AAAA,MAC3B;AAAA,MACA,SAAS;AAAA,IAAA,EACT;AAAA,EAAA;AAGJ,MAAI,WAAW;AACN,WAAA,oBAAC,KAAK,SAAL,CAAa,CAAA;AAAA,EACvB;AAEI,MAAA,SAAS,CAAC,MAAM;AACX,WAAA,oBAAC,KAAK,OAAL,CAAW,CAAA;AAAA,EACrB;AAEA,6BACG,KAAK,SAAL,EAAa,aACX,WAAC,EAAE,aAAAC,uCACD,cAAa,EAAA,aAAaA,cACzB,UAAC,oBAAA,cAAA,CAAa,CAAA,GAChB,EAEJ,CAAA;AAEJ;"}
@@ -10,12 +10,12 @@ 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-OerGjbAN.js");
14
- const usePrev = require("./usePrev-B9w_-eYc.js");
13
+ const index = require("./index-dFQ_8EM3.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-COBpStiF.js");
18
+ const relations = require("./relations-isLeDaA0.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) {
@@ -198,18 +198,22 @@ const FiltersImpl = ({ disabled, schema }) => {
198
198
  );
199
199
  };
200
200
  const AdminUsersFilter = ({ name }) => {
201
- const [page, setPage] = React__namespace.useState(1);
201
+ const [pageSize, setPageSize] = React__namespace.useState(10);
202
+ const [search, setSearch] = React__namespace.useState("");
202
203
  const { formatMessage } = reactIntl.useIntl();
204
+ const debouncedSearch = useDebounce.useDebounce(search, 300);
203
205
  const { data, isLoading } = strapiAdmin.useAdminUsers({
204
- page
206
+ pageSize,
207
+ _q: debouncedSearch
205
208
  });
206
209
  const field = strapiAdmin.useField(name);
207
210
  const handleOpenChange = (isOpen) => {
208
211
  if (!isOpen) {
209
- setPage(1);
212
+ setPageSize(10);
210
213
  }
211
214
  };
212
- const users = data?.users || [];
215
+ const { users = [], pagination } = data ?? {};
216
+ const { pageCount = 1, page = 1 } = pagination ?? {};
213
217
  return /* @__PURE__ */ jsxRuntime.jsx(
214
218
  designSystem.Combobox,
215
219
  {
@@ -221,7 +225,11 @@ const AdminUsersFilter = ({ name }) => {
221
225
  onOpenChange: handleOpenChange,
222
226
  onChange: (value) => field.onChange(name, value),
223
227
  loading: isLoading,
224
- onLoadMore: () => setPage((prev) => prev + 1),
228
+ onLoadMore: () => setPageSize(pageSize + 10),
229
+ hasMoreItems: page < pageCount,
230
+ onInputChange: (e) => {
231
+ setSearch(e.currentTarget.value);
232
+ },
225
233
  children: users.map((user) => {
226
234
  return /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: user.id.toString(), children: index.getDisplayName(user) }, user.id);
227
235
  })
@@ -271,9 +279,8 @@ const RepeatableComponent = ({ content, mainField }) => {
271
279
  return null;
272
280
  }
273
281
  return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Root, { children: [
274
- /* @__PURE__ */ jsxRuntime.jsxs(MenuTrigger$1, { onClick: (e) => e.stopPropagation(), children: [
282
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Trigger, { onClick: (e) => e.stopPropagation(), children: [
275
283
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { children: content.length }),
276
- " ",
277
284
  formatMessage(
278
285
  {
279
286
  id: "content-manager.containers.list.items",
@@ -285,18 +292,12 @@ const RepeatableComponent = ({ content, mainField }) => {
285
292
  /* @__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
293
  ] });
287
294
  };
288
- const MenuTrigger$1 = styledComponents.styled(designSystem.Menu.Trigger)`
289
- svg {
290
- width: 0.6rem;
291
- height: 0.4rem;
292
- }
293
- `;
294
295
  const getFileExtension = (ext) => ext && ext[0] === "." ? ext.substring(1) : ext;
295
296
  const MediaSingle = ({ url, mime, alternativeText, name, ext, formats }) => {
296
- const fileURL = usePrev.prefixFileUrlWithBackendUrl(url);
297
+ const fileURL = useDebounce.prefixFileUrlWithBackendUrl(url);
297
298
  if (mime.includes("image")) {
298
299
  const thumbnail = formats?.thumbnail?.url;
299
- const mediaURL = usePrev.prefixFileUrlWithBackendUrl(thumbnail) || fileURL;
300
+ const mediaURL = useDebounce.prefixFileUrlWithBackendUrl(thumbnail) || fileURL;
300
301
  return /* @__PURE__ */ jsxRuntime.jsx(
301
302
  designSystem.Avatar.Item,
302
303
  {
@@ -366,6 +367,7 @@ const RelationMultiple = ({ mainField, content, rowId, name }) => {
366
367
  refetchOnMountOrArgChange: true
367
368
  }
368
369
  );
370
+ const contentCount = Array.isArray(content) ? content.length : content.count;
369
371
  React__namespace.useEffect(() => {
370
372
  if (data) {
371
373
  notifyStatus(
@@ -377,16 +379,13 @@ const RelationMultiple = ({ mainField, content, rowId, name }) => {
377
379
  }
378
380
  }, [data, formatMessage, notifyStatus]);
379
381
  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
- ] }) }),
382
+ /* @__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(
383
+ {
384
+ id: "content-manager.containers.list.items",
385
+ defaultMessage: "{number} {number, plural, =0 {items} one {item} other {items}}"
386
+ },
387
+ { number: contentCount }
388
+ ) : "-" }) }),
390
389
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Content, { children: [
391
390
  isLoading && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Menu.Item, { disabled: true, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Loader, { small: true, children: formatMessage({
392
391
  id: index.getTranslation("ListViewTable.relation-loading"),
@@ -409,15 +408,17 @@ const RelationMultiple = ({ mainField, content, rowId, name }) => {
409
408
  ] })
410
409
  ] });
411
410
  };
412
- const MenuTrigger = styledComponents.styled(designSystem.Menu.Trigger)`
413
- svg {
414
- width: 0.6rem;
415
- height: 0.4rem;
416
- }
417
- `;
418
411
  const CellContent = ({ content, mainField, attribute, rowId, name }) => {
419
412
  if (!hasContent(content, mainField, attribute)) {
420
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: "-" });
413
+ return /* @__PURE__ */ jsxRuntime.jsx(
414
+ designSystem.Typography,
415
+ {
416
+ textColor: "neutral800",
417
+ paddingLeft: attribute.type === "relation" ? "1.6rem" : 0,
418
+ paddingRight: attribute.type === "relation" ? "1.6rem" : 0,
419
+ children: "-"
420
+ }
421
+ );
421
422
  }
422
423
  switch (attribute.type) {
423
424
  case "media":
@@ -457,6 +458,9 @@ const hasContent = (content, mainField, attribute) => {
457
458
  if (isSingleRelation(attribute.relation)) {
458
459
  return !isEmpty__default.default(content);
459
460
  }
461
+ if (Array.isArray(content)) {
462
+ return content.length > 0;
463
+ }
460
464
  return content?.count > 0;
461
465
  }
462
466
  if (["integer", "decimal", "float", "number"].includes(attribute.type)) {
@@ -568,6 +572,9 @@ const FieldPicker = ({ headers = [], resetHeaders, setHeaders }) => {
568
572
  ] });
569
573
  };
570
574
  const { INJECT_COLUMN_IN_TABLE } = index.HOOKS;
575
+ const LayoutsHeaderCustom = styledComponents.styled(strapiAdmin.Layouts.Header)`
576
+ overflow-wrap: anywhere;
577
+ `;
571
578
  const ListViewPage = () => {
572
579
  const { trackUsage } = strapiAdmin.useTracking();
573
580
  const navigate = reactRouterDom.useNavigate();
@@ -577,7 +584,7 @@ const ListViewPage = () => {
577
584
  const { collectionType, model, schema } = index.useDoc();
578
585
  const { list } = index.useDocumentLayout(model);
579
586
  const [displayedHeaders, setDisplayedHeaders] = React__namespace.useState([]);
580
- const listLayout = usePrev.usePrev(list.layout);
587
+ const listLayout = useDebounce.usePrev(list.layout);
581
588
  React__namespace.useEffect(() => {
582
589
  if (!isEqual__default.default(listLayout, list.layout)) {
583
590
  setDisplayedHeaders(list.layout);
@@ -594,9 +601,20 @@ const ListViewPage = () => {
594
601
  sort: list.settings.defaultSortBy ? `${list.settings.defaultSortBy}:${list.settings.defaultSortOrder}` : ""
595
602
  });
596
603
  const params = React__namespace.useMemo(() => index.buildValidParams(query), [query]);
604
+ const queryString = React__namespace.useMemo(
605
+ () => qs.stringify(params, { encode: true, encodeValuesOnly: true }),
606
+ [params]
607
+ );
608
+ const paramObject = React__namespace.useMemo(() => {
609
+ const pairs = queryString.split("&").map((param) => {
610
+ const [key, value] = param.split("=");
611
+ return { [key]: value };
612
+ });
613
+ return Object.assign({}, ...pairs);
614
+ }, [queryString]);
597
615
  const { data, error, isFetching } = index.useGetAllDocumentsQuery({
598
616
  model,
599
- params
617
+ params: paramObject
600
618
  });
601
619
  React__namespace.useEffect(() => {
602
620
  if (error) {
@@ -633,7 +651,7 @@ const ListViewPage = () => {
633
651
  return {
634
652
  ...header,
635
653
  label: typeof header.label === "string" ? header.label : formatMessage(header.label),
636
- name: `${header.name}${header.mainField ? `.${header.mainField}` : ""}`
654
+ name: `${header.name}${header.mainField?.name ? `.${header.mainField.name}` : ""}`
637
655
  };
638
656
  });
639
657
  if (schema?.options?.draftAndPublish) {
@@ -669,7 +687,7 @@ const ListViewPage = () => {
669
687
  return /* @__PURE__ */ jsxRuntime.jsxs(strapiAdmin.Page.Main, { children: [
670
688
  /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Title, { children: `${contentTypeTitle}` }),
671
689
  /* @__PURE__ */ jsxRuntime.jsx(
672
- strapiAdmin.Layouts.Header,
690
+ LayoutsHeaderCustom,
673
691
  {
674
692
  primaryAction: canCreate ? /* @__PURE__ */ jsxRuntime.jsx(CreateButton, {}) : null,
675
693
  subtitle: formatMessage(
@@ -785,7 +803,7 @@ const TableActionsBar = () => {
785
803
  const selectRow = strapiAdmin.useTable("TableActionsBar", (state) => state.selectRow);
786
804
  const [{ query }] = strapiAdmin.useQueryParams();
787
805
  const locale = query?.plugins?.i18n?.locale;
788
- const prevLocale = usePrev.usePrev(locale);
806
+ const prevLocale = useDebounce.usePrev(locale);
789
807
  React__namespace.useEffect(() => {
790
808
  if (prevLocale !== locale) {
791
809
  selectRow([]);
@@ -811,6 +829,8 @@ const CreateButton = ({ variant }) => {
811
829
  pathname: "create",
812
830
  search: qs.stringify({ plugins: query.plugins })
813
831
  },
832
+ minWidth: "max-content",
833
+ marginLeft: 2,
814
834
  children: formatMessage({
815
835
  id: index.getTranslation("HeaderLayout.button.label-add-entry"),
816
836
  defaultMessage: "Create new entry"
@@ -840,4 +860,4 @@ const ProtectedListViewPage = () => {
840
860
  };
841
861
  exports.ListViewPage = ListViewPage;
842
862
  exports.ProtectedListViewPage = ProtectedListViewPage;
843
- //# sourceMappingURL=ListViewPage-BsLiH2-2.js.map
863
+ //# sourceMappingURL=ListViewPage-D48T84aT.js.map