@strapi/content-manager 0.0.0-experimental.e60ec1829240dae21c1e1d29076681c322288813 → 0.0.0-experimental.e9122b401c96877b6707775c4f893660eab93ae3

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 (180) hide show
  1. package/LICENSE +18 -3
  2. package/dist/_chunks/{CardDragPreview-DSVYodBX.js → CardDragPreview-C0QyJgRA.js} +10 -14
  3. package/dist/_chunks/CardDragPreview-C0QyJgRA.js.map +1 -0
  4. package/dist/_chunks/{CardDragPreview-ikSG4M46.mjs → CardDragPreview-DOxamsuj.mjs} +7 -9
  5. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +1 -0
  6. package/dist/_chunks/{ComponentConfigurationPage-BPvzFjM7.mjs → ComponentConfigurationPage-CpBFh6_r.mjs} +3 -3
  7. package/dist/_chunks/{ComponentConfigurationPage-BPvzFjM7.mjs.map → ComponentConfigurationPage-CpBFh6_r.mjs.map} +1 -1
  8. package/dist/_chunks/{ComponentConfigurationPage-DjWJdz6Y.js → ComponentConfigurationPage-_zF8p6CY.js} +3 -3
  9. package/dist/_chunks/{ComponentConfigurationPage-DjWJdz6Y.js.map → ComponentConfigurationPage-_zF8p6CY.js.map} +1 -1
  10. package/dist/_chunks/{ComponentIcon-BBQsYCVn.js → ComponentIcon-BXdiCGQp.js} +8 -2
  11. package/dist/_chunks/ComponentIcon-BXdiCGQp.js.map +1 -0
  12. package/dist/_chunks/{ComponentIcon-BOFnK76n.mjs → ComponentIcon-u4bIXTFY.mjs} +9 -3
  13. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +1 -0
  14. package/dist/_chunks/{EditConfigurationPage-DacbqQ_f.mjs → EditConfigurationPage-CE_yavTi.mjs} +3 -3
  15. package/dist/_chunks/{EditConfigurationPage-DacbqQ_f.mjs.map → EditConfigurationPage-CE_yavTi.mjs.map} +1 -1
  16. package/dist/_chunks/{EditConfigurationPage-Dmv83RlS.js → EditConfigurationPage-_aG2DJSU.js} +3 -3
  17. package/dist/_chunks/{EditConfigurationPage-Dmv83RlS.js.map → EditConfigurationPage-_aG2DJSU.js.map} +1 -1
  18. package/dist/_chunks/{EditViewPage-DDS6H9HO.mjs → EditViewPage-DeTn7rAF.mjs} +59 -48
  19. package/dist/_chunks/EditViewPage-DeTn7rAF.mjs.map +1 -0
  20. package/dist/_chunks/{EditViewPage-DvNpQkam.js → EditViewPage-G9uNzwYL.js} +58 -49
  21. package/dist/_chunks/EditViewPage-G9uNzwYL.js.map +1 -0
  22. package/dist/_chunks/{Field-6gvGdPBV.mjs → Field-CnCKhI1R.mjs} +995 -795
  23. package/dist/_chunks/Field-CnCKhI1R.mjs.map +1 -0
  24. package/dist/_chunks/{Field-DmVKIAOo.js → Field-DDHUWEfV.js} +1041 -842
  25. package/dist/_chunks/Field-DDHUWEfV.js.map +1 -0
  26. package/dist/_chunks/{Form-CPZC9vWa.js → Form-DYETaKUX.js} +65 -45
  27. package/dist/_chunks/Form-DYETaKUX.js.map +1 -0
  28. package/dist/_chunks/{Form-DW6K1IH-.mjs → Form-IvVVwqRL.mjs} +65 -44
  29. package/dist/_chunks/Form-IvVVwqRL.mjs.map +1 -0
  30. package/dist/_chunks/{History-Dmr9fmUA.mjs → History-BMunT-do.mjs} +148 -54
  31. package/dist/_chunks/History-BMunT-do.mjs.map +1 -0
  32. package/dist/_chunks/{History-DeAPlvtv.js → History-CnZDctSO.js} +149 -56
  33. package/dist/_chunks/History-CnZDctSO.js.map +1 -0
  34. package/dist/_chunks/{ListConfigurationPage-DPCwW5Vr.js → ListConfigurationPage-BynalOp8.js} +67 -58
  35. package/dist/_chunks/ListConfigurationPage-BynalOp8.js.map +1 -0
  36. package/dist/_chunks/{ListConfigurationPage-DhwvYcNv.mjs → ListConfigurationPage-CDqkCxgV.mjs} +63 -53
  37. package/dist/_chunks/ListConfigurationPage-CDqkCxgV.mjs.map +1 -0
  38. package/dist/_chunks/{ListViewPage-5ySZ-VUs.js → ListViewPage-I88Ouzoq.js} +126 -137
  39. package/dist/_chunks/ListViewPage-I88Ouzoq.js.map +1 -0
  40. package/dist/_chunks/{ListViewPage-BtAwuYLE.mjs → ListViewPage-_5gS-DOF.mjs} +123 -134
  41. package/dist/_chunks/ListViewPage-_5gS-DOF.mjs.map +1 -0
  42. package/dist/_chunks/{NoContentTypePage-DOC_yWOf.js → NoContentTypePage-BaWQ7HsA.js} +3 -3
  43. package/dist/_chunks/NoContentTypePage-BaWQ7HsA.js.map +1 -0
  44. package/dist/_chunks/{NoContentTypePage-DSPxnxxp.mjs → NoContentTypePage-Dht-55hr.mjs} +3 -3
  45. package/dist/_chunks/NoContentTypePage-Dht-55hr.mjs.map +1 -0
  46. package/dist/_chunks/{NoPermissionsPage-UWDC-1Tw.mjs → NoPermissionsPage-Bs8D5W_v.mjs} +2 -2
  47. package/dist/_chunks/{NoPermissionsPage-UWDC-1Tw.mjs.map → NoPermissionsPage-Bs8D5W_v.mjs.map} +1 -1
  48. package/dist/_chunks/{NoPermissionsPage-Dwu8rRJu.js → NoPermissionsPage-DCVUh5at.js} +2 -2
  49. package/dist/_chunks/{NoPermissionsPage-Dwu8rRJu.js.map → NoPermissionsPage-DCVUh5at.js.map} +1 -1
  50. package/dist/_chunks/{Relations-CgWtgnPe.js → Relations-BPgFQeGj.js} +71 -62
  51. package/dist/_chunks/Relations-BPgFQeGj.js.map +1 -0
  52. package/dist/_chunks/{Relations-J8cscLlR.mjs → Relations-Chdt5qWc.mjs} +67 -57
  53. package/dist/_chunks/Relations-Chdt5qWc.mjs.map +1 -0
  54. package/dist/_chunks/{en-C-V1_90f.js → en-BVzUkPxZ.js} +16 -8
  55. package/dist/_chunks/{en-C-V1_90f.js.map → en-BVzUkPxZ.js.map} +1 -1
  56. package/dist/_chunks/{en-MBPul9Su.mjs → en-CPTj6CjC.mjs} +16 -8
  57. package/dist/_chunks/{en-MBPul9Su.mjs.map → en-CPTj6CjC.mjs.map} +1 -1
  58. package/dist/_chunks/{index-C6AH2hEl.js → index-BhbLFX4l.js} +1752 -903
  59. package/dist/_chunks/index-BhbLFX4l.js.map +1 -0
  60. package/dist/_chunks/{index-CwRRo1V9.mjs → index-D4UGPFZC.mjs} +1778 -928
  61. package/dist/_chunks/index-D4UGPFZC.mjs.map +1 -0
  62. package/dist/_chunks/{layout-B_SXLhqf.js → layout-CYA7s0qO.js} +45 -29
  63. package/dist/_chunks/layout-CYA7s0qO.js.map +1 -0
  64. package/dist/_chunks/{layout-jIDzX0Fp.mjs → layout-D4HI4_PS.mjs} +45 -27
  65. package/dist/_chunks/layout-D4HI4_PS.mjs.map +1 -0
  66. package/dist/_chunks/{relations-CuvIgCqI.mjs → relations-1pXaYpBK.mjs} +2 -2
  67. package/dist/_chunks/{relations-CuvIgCqI.mjs.map → relations-1pXaYpBK.mjs.map} +1 -1
  68. package/dist/_chunks/{relations-iBMa_OFG.js → relations-DDZ9OxNo.js} +2 -2
  69. package/dist/_chunks/{relations-iBMa_OFG.js.map → relations-DDZ9OxNo.js.map} +1 -1
  70. package/dist/_chunks/useDebounce-CtcjDB3L.js +28 -0
  71. package/dist/_chunks/useDebounce-CtcjDB3L.js.map +1 -0
  72. package/dist/_chunks/useDebounce-DmuSJIF3.mjs +29 -0
  73. package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +1 -0
  74. package/dist/_chunks/useDragAndDrop-DdHgKsqq.mjs.map +1 -1
  75. package/dist/_chunks/useDragAndDrop-J0TUUbR6.js.map +1 -1
  76. package/dist/admin/index.js +2 -1
  77. package/dist/admin/index.js.map +1 -1
  78. package/dist/admin/index.mjs +8 -7
  79. package/dist/admin/src/components/ComponentIcon.d.ts +6 -3
  80. package/dist/admin/src/content-manager.d.ts +3 -3
  81. package/dist/admin/src/exports.d.ts +1 -0
  82. package/dist/admin/src/history/components/VersionInputRenderer.d.ts +1 -1
  83. package/dist/admin/src/history/index.d.ts +3 -0
  84. package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
  85. package/dist/admin/src/hooks/useDocument.d.ts +5 -8
  86. package/dist/admin/src/hooks/useDocumentActions.d.ts +24 -3
  87. package/dist/admin/src/hooks/useDocumentLayout.d.ts +2 -2
  88. package/dist/admin/src/hooks/useDragAndDrop.d.ts +4 -4
  89. package/dist/admin/src/hooks/useKeyboardDragAndDrop.d.ts +1 -1
  90. package/dist/admin/src/index.d.ts +1 -0
  91. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +11 -4
  92. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/BlocksInput.d.ts +3 -3
  93. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +4 -0
  94. package/dist/admin/src/pages/EditView/components/FormInputs/Component/Input.d.ts +2 -2
  95. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/ComponentCategory.d.ts +3 -5
  96. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/Field.d.ts +1 -1
  97. package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +30 -18
  98. package/dist/admin/src/pages/EditView/components/FormInputs/UID.d.ts +2 -2
  99. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +3 -49
  100. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/Field.d.ts +2 -2
  101. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.d.ts +2 -2
  102. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +16 -53
  103. package/dist/admin/src/pages/EditView/components/Header.d.ts +10 -11
  104. package/dist/admin/src/pages/EditView/components/InputRenderer.d.ts +2 -10
  105. package/dist/admin/src/pages/ListView/components/BulkActions/Actions.d.ts +3 -30
  106. package/dist/admin/src/pages/ListView/components/BulkActions/ConfirmBulkActionDialog.d.ts +2 -2
  107. package/dist/admin/src/pages/ListView/components/BulkActions/PublishAction.d.ts +9 -26
  108. package/dist/admin/src/services/api.d.ts +2 -3
  109. package/dist/admin/src/services/components.d.ts +2 -2
  110. package/dist/admin/src/services/contentTypes.d.ts +5 -5
  111. package/dist/admin/src/services/documents.d.ts +31 -17
  112. package/dist/admin/src/services/init.d.ts +2 -2
  113. package/dist/admin/src/services/relations.d.ts +3 -3
  114. package/dist/admin/src/services/uid.d.ts +3 -3
  115. package/dist/admin/src/utils/api.d.ts +4 -18
  116. package/dist/admin/src/utils/validation.d.ts +5 -7
  117. package/dist/server/index.js +436 -281
  118. package/dist/server/index.js.map +1 -1
  119. package/dist/server/index.mjs +444 -289
  120. package/dist/server/index.mjs.map +1 -1
  121. package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
  122. package/dist/server/src/controllers/relations.d.ts.map +1 -1
  123. package/dist/server/src/controllers/single-types.d.ts.map +1 -1
  124. package/dist/server/src/controllers/uid.d.ts.map +1 -1
  125. package/dist/server/src/controllers/utils/metadata.d.ts +8 -0
  126. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -0
  127. package/dist/server/src/controllers/validation/dimensions.d.ts +11 -0
  128. package/dist/server/src/controllers/validation/dimensions.d.ts.map +1 -0
  129. package/dist/server/src/controllers/validation/index.d.ts +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 +2 -1
  133. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  134. package/dist/server/src/index.d.ts +18 -39
  135. package/dist/server/src/index.d.ts.map +1 -1
  136. package/dist/server/src/policies/hasPermissions.d.ts.map +1 -1
  137. package/dist/server/src/services/document-manager.d.ts +13 -12
  138. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  139. package/dist/server/src/services/document-metadata.d.ts +8 -29
  140. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  141. package/dist/server/src/services/index.d.ts +18 -39
  142. package/dist/server/src/services/index.d.ts.map +1 -1
  143. package/dist/server/src/services/permission-checker.d.ts.map +1 -1
  144. package/dist/server/src/services/utils/populate.d.ts +8 -1
  145. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  146. package/dist/shared/contracts/collection-types.d.ts +17 -7
  147. package/dist/shared/contracts/collection-types.d.ts.map +1 -1
  148. package/dist/shared/contracts/relations.d.ts +2 -2
  149. package/dist/shared/contracts/relations.d.ts.map +1 -1
  150. package/package.json +14 -15
  151. package/dist/_chunks/CardDragPreview-DSVYodBX.js.map +0 -1
  152. package/dist/_chunks/CardDragPreview-ikSG4M46.mjs.map +0 -1
  153. package/dist/_chunks/ComponentIcon-BBQsYCVn.js.map +0 -1
  154. package/dist/_chunks/ComponentIcon-BOFnK76n.mjs.map +0 -1
  155. package/dist/_chunks/EditViewPage-DDS6H9HO.mjs.map +0 -1
  156. package/dist/_chunks/EditViewPage-DvNpQkam.js.map +0 -1
  157. package/dist/_chunks/Field-6gvGdPBV.mjs.map +0 -1
  158. package/dist/_chunks/Field-DmVKIAOo.js.map +0 -1
  159. package/dist/_chunks/Form-CPZC9vWa.js.map +0 -1
  160. package/dist/_chunks/Form-DW6K1IH-.mjs.map +0 -1
  161. package/dist/_chunks/History-DeAPlvtv.js.map +0 -1
  162. package/dist/_chunks/History-Dmr9fmUA.mjs.map +0 -1
  163. package/dist/_chunks/ListConfigurationPage-DPCwW5Vr.js.map +0 -1
  164. package/dist/_chunks/ListConfigurationPage-DhwvYcNv.mjs.map +0 -1
  165. package/dist/_chunks/ListViewPage-5ySZ-VUs.js.map +0 -1
  166. package/dist/_chunks/ListViewPage-BtAwuYLE.mjs.map +0 -1
  167. package/dist/_chunks/NoContentTypePage-DOC_yWOf.js.map +0 -1
  168. package/dist/_chunks/NoContentTypePage-DSPxnxxp.mjs.map +0 -1
  169. package/dist/_chunks/Relations-CgWtgnPe.js.map +0 -1
  170. package/dist/_chunks/Relations-J8cscLlR.mjs.map +0 -1
  171. package/dist/_chunks/index-C6AH2hEl.js.map +0 -1
  172. package/dist/_chunks/index-CwRRo1V9.mjs.map +0 -1
  173. package/dist/_chunks/layout-B_SXLhqf.js.map +0 -1
  174. package/dist/_chunks/layout-jIDzX0Fp.mjs.map +0 -1
  175. package/dist/_chunks/urls-CbOsUOoW.mjs +0 -7
  176. package/dist/_chunks/urls-CbOsUOoW.mjs.map +0 -1
  177. package/dist/_chunks/urls-DzZya_gm.js +0 -6
  178. package/dist/_chunks/urls-DzZya_gm.js.map +0 -1
  179. package/dist/server/src/controllers/utils/dimensions.d.ts +0 -5
  180. package/dist/server/src/controllers/utils/dimensions.d.ts.map +0 -1
@@ -1,28 +1,20 @@
1
1
  import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
2
  import * as React from "react";
3
- import { useRef, useEffect } from "react";
4
- import { useTracking, useAuth, useQueryParams, useAdminUsers, Filters, useField, useRBAC, useNotification, useAPIErrorHandler, useStrapiApp, Page, Layouts, BackButton, SearchInput, Table, Pagination } from "@strapi/admin/strapi-admin";
5
- import { useCollator, Combobox, ComboboxOption, Typography, Menu, Tooltip, Badge, Avatar, Flex, AvatarGroup, useNotifyAT, Loader, IconButton, Popover, LinkButton, TextButton, BaseCheckbox, 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";
6
5
  import { Cog, ListPlus, Plus } from "@strapi/icons";
7
6
  import isEqual from "lodash/isEqual";
8
7
  import { stringify } from "qs";
9
8
  import { useIntl } from "react-intl";
10
9
  import { NavLink, useNavigate, Link, useParams } from "react-router-dom";
11
- import styled from "styled-components";
12
- import { n as useContentTypeSchema, o as useGetContentTypeConfigurationQuery, p as CREATOR_FIELDS, q as getMainField, t as getDisplayName, b as useDoc, g as getTranslation, f as useDocumentLayout, v as checkIfAttributeIsDisplayable, c as buildValidParams, w as useGetAllDocumentsQuery, e as useDocumentRBAC, I as InjectionZone, D as DocumentStatus, T as TableActions, j as PERMISSIONS, k as DocumentRBAC, H as HOOKS, x as convertListLayoutToFieldLayouts } from "./index-CwRRo1V9.mjs";
10
+ import { styled } from "styled-components";
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-D4UGPFZC.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 { p as prefixFileUrlWithBackendUrl } from "./urls-CbOsUOoW.mjs";
17
- import { g as getRelationLabel, u as useGetRelationsQuery } from "./relations-CuvIgCqI.mjs";
16
+ import { g as getRelationLabel, u as useGetRelationsQuery } from "./relations-1pXaYpBK.mjs";
18
17
  import { u as useTypedSelector } from "./hooks-E5u1mcgM.mjs";
19
- const usePrev = (value) => {
20
- const ref = useRef();
21
- useEffect(() => {
22
- ref.current = value;
23
- }, [value]);
24
- return ref.current;
25
- };
26
18
  const NOT_ALLOWED_FILTERS = [
27
19
  "json",
28
20
  "component",
@@ -129,6 +121,15 @@ const FiltersImpl = ({ disabled, schema }) => {
129
121
  }
130
122
  };
131
123
  }
124
+ if (attribute.type === "enumeration") {
125
+ filter = {
126
+ ...filter,
127
+ options: attribute.enum.map((value) => ({
128
+ label: value,
129
+ value
130
+ }))
131
+ };
132
+ }
132
133
  return filter;
133
134
  }).filter(Boolean).toSorted((a, b) => formatter.compare(a.label, b.label));
134
135
  }, [
@@ -171,18 +172,22 @@ const FiltersImpl = ({ disabled, schema }) => {
171
172
  );
172
173
  };
173
174
  const AdminUsersFilter = ({ name }) => {
174
- const [page, setPage] = React.useState(1);
175
+ const [pageSize, setPageSize] = React.useState(10);
176
+ const [search, setSearch] = React.useState("");
175
177
  const { formatMessage } = useIntl();
178
+ const debouncedSearch = useDebounce(search, 300);
176
179
  const { data, isLoading } = useAdminUsers({
177
- page
180
+ pageSize,
181
+ _q: debouncedSearch
178
182
  });
179
183
  const field = useField(name);
180
184
  const handleOpenChange = (isOpen) => {
181
185
  if (!isOpen) {
182
- setPage(1);
186
+ setPageSize(10);
183
187
  }
184
188
  };
185
- const users = data?.users || [];
189
+ const { users = [], pagination } = data ?? {};
190
+ const { pageCount = 1, page = 1 } = pagination ?? {};
186
191
  return /* @__PURE__ */ jsx(
187
192
  Combobox,
188
193
  {
@@ -194,7 +199,11 @@ const AdminUsersFilter = ({ name }) => {
194
199
  onOpenChange: handleOpenChange,
195
200
  onChange: (value) => field.onChange(name, value),
196
201
  loading: isLoading,
197
- onLoadMore: () => setPage((prev) => prev + 1),
202
+ onLoadMore: () => setPageSize(pageSize + 10),
203
+ hasMoreItems: page < pageCount,
204
+ onInputChange: (e) => {
205
+ setSearch(e.currentTarget.value);
206
+ },
198
207
  children: users.map((user) => {
199
208
  return /* @__PURE__ */ jsx(ComboboxOption, { value: user.id.toString(), children: getDisplayName(user) }, user.id);
200
209
  })
@@ -236,20 +245,16 @@ const SingleComponent = ({ content, mainField }) => {
236
245
  if (!mainField) {
237
246
  return null;
238
247
  }
239
- return /* @__PURE__ */ jsx(Tooltip, { label: content[mainField.name], children: /* @__PURE__ */ jsx(SingleComponentTypography, { textColor: "neutral800", ellipsis: true, children: /* @__PURE__ */ jsx(CellValue, { type: mainField.type, value: content[mainField.name] }) }) });
248
+ return /* @__PURE__ */ jsx(Tooltip, { label: content[mainField.name], children: /* @__PURE__ */ jsx(Typography, { maxWidth: "25rem", textColor: "neutral800", ellipsis: true, children: /* @__PURE__ */ jsx(CellValue, { type: mainField.type, value: content[mainField.name] }) }) });
240
249
  };
241
- const SingleComponentTypography = styled(Typography)`
242
- max-width: 250px;
243
- `;
244
250
  const RepeatableComponent = ({ content, mainField }) => {
245
251
  const { formatMessage } = useIntl();
246
252
  if (!mainField) {
247
253
  return null;
248
254
  }
249
255
  return /* @__PURE__ */ jsxs(Menu.Root, { children: [
250
- /* @__PURE__ */ jsxs(MenuTrigger$1, { onClick: (e) => e.stopPropagation(), children: [
256
+ /* @__PURE__ */ jsxs(Menu.Trigger, { onClick: (e) => e.stopPropagation(), children: [
251
257
  /* @__PURE__ */ jsx(Badge, { children: content.length }),
252
- " ",
253
258
  formatMessage(
254
259
  {
255
260
  id: "content-manager.containers.list.items",
@@ -258,25 +263,24 @@ const RepeatableComponent = ({ content, mainField }) => {
258
263
  { number: content.length }
259
264
  )
260
265
  ] }),
261
- /* @__PURE__ */ jsx(Menu.Content, { children: content.map((item) => /* @__PURE__ */ jsx(Menu.Item, { disabled: true, children: /* @__PURE__ */ jsx(RepeatableComponentTypography, { ellipsis: true, children: /* @__PURE__ */ jsx(CellValue, { type: mainField.type, value: item[mainField.name] }) }) }, item.id)) })
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)) })
262
267
  ] });
263
268
  };
264
- const RepeatableComponentTypography = styled(Typography)`
265
- max-width: 500px;
266
- `;
267
- const MenuTrigger$1 = styled(Menu.Trigger)`
268
- svg {
269
- width: 0.6rem;
270
- height: 0.4rem;
271
- }
272
- `;
273
269
  const getFileExtension = (ext) => ext && ext[0] === "." ? ext.substring(1) : ext;
274
270
  const MediaSingle = ({ url, mime, alternativeText, name, ext, formats }) => {
275
271
  const fileURL = prefixFileUrlWithBackendUrl(url);
276
272
  if (mime.includes("image")) {
277
273
  const thumbnail = formats?.thumbnail?.url;
278
274
  const mediaURL = prefixFileUrlWithBackendUrl(thumbnail) || fileURL;
279
- return /* @__PURE__ */ jsx(Avatar, { src: mediaURL, alt: alternativeText || name, preview: true });
275
+ return /* @__PURE__ */ jsx(
276
+ Avatar.Item,
277
+ {
278
+ src: mediaURL,
279
+ alt: alternativeText || name,
280
+ fallback: alternativeText || name,
281
+ preview: true
282
+ }
283
+ );
280
284
  }
281
285
  const fileExtension = getFileExtension(ext);
282
286
  const fileName = name.length > 100 ? `${name.substring(0, 100)}...` : name;
@@ -286,7 +290,7 @@ const FileWrapper = ({ children }) => {
286
290
  return /* @__PURE__ */ jsx(
287
291
  Flex,
288
292
  {
289
- as: "span",
293
+ tag: "span",
290
294
  position: "relative",
291
295
  borderRadius: "50%",
292
296
  width: "26px",
@@ -305,7 +309,7 @@ const FileTypography = styled(Typography)`
305
309
  line-height: 0.9rem;
306
310
  `;
307
311
  const MediaMultiple = ({ content }) => {
308
- return /* @__PURE__ */ jsx(AvatarGroup, { children: content.map((file, index) => {
312
+ return /* @__PURE__ */ jsx(Avatar.Group, { children: content.map((file, index) => {
309
313
  const key = `${file.id}${index}`;
310
314
  if (index === 3) {
311
315
  const remainingFiles = `+${content.length - 3}`;
@@ -318,11 +322,8 @@ const MediaMultiple = ({ content }) => {
318
322
  }) });
319
323
  };
320
324
  const RelationSingle = ({ mainField, content }) => {
321
- return /* @__PURE__ */ jsx(TypographyMaxWidth$1, { textColor: "neutral800", ellipsis: true, children: getRelationLabel(content, mainField) });
325
+ return /* @__PURE__ */ jsx(Typography, { maxWidth: "50rem", textColor: "neutral800", ellipsis: true, children: getRelationLabel(content, mainField) });
322
326
  };
323
- const TypographyMaxWidth$1 = styled(Typography)`
324
- max-width: 500px;
325
- `;
326
327
  const RelationMultiple = ({ mainField, content, rowId, name }) => {
327
328
  const { model } = useDoc();
328
329
  const { formatMessage } = useIntl();
@@ -351,23 +352,20 @@ const RelationMultiple = ({ mainField, content, rowId, name }) => {
351
352
  }
352
353
  }, [data, formatMessage, notifyStatus]);
353
354
  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
- ] }) }),
355
+ /* @__PURE__ */ jsx(Menu.Trigger, { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsx(Typography, { style: { cursor: "pointer" }, textColor: "neutral800", fontWeight: "regular", children: content.count > 0 ? formatMessage(
356
+ {
357
+ id: "content-manager.containers.list.items",
358
+ defaultMessage: "{number} {number, plural, =0 {items} one {item} other {items}}"
359
+ },
360
+ { number: content.count }
361
+ ) : "-" }) }),
364
362
  /* @__PURE__ */ jsxs(Menu.Content, { children: [
365
363
  isLoading && /* @__PURE__ */ jsx(Menu.Item, { disabled: true, children: /* @__PURE__ */ jsx(Loader, { small: true, children: formatMessage({
366
364
  id: getTranslation("ListViewTable.relation-loading"),
367
365
  defaultMessage: "Relations are loading"
368
366
  }) }) }),
369
367
  data?.results && /* @__PURE__ */ jsxs(Fragment, { children: [
370
- data.results.map((entry) => /* @__PURE__ */ jsx(Menu.Item, { disabled: true, children: /* @__PURE__ */ jsx(TypographyMaxWidth$1, { ellipsis: true, children: getRelationLabel(entry, mainField) }) }, entry.documentId)),
368
+ data.results.map((entry) => /* @__PURE__ */ jsx(Menu.Item, { disabled: true, children: /* @__PURE__ */ jsx(Typography, { maxWidth: "50rem", ellipsis: true, children: getRelationLabel(entry, mainField) }) }, entry.documentId)),
371
369
  data?.pagination && data?.pagination.total > 10 && /* @__PURE__ */ jsx(
372
370
  Menu.Item,
373
371
  {
@@ -383,15 +381,17 @@ const RelationMultiple = ({ mainField, content, rowId, name }) => {
383
381
  ] })
384
382
  ] });
385
383
  };
386
- const MenuTrigger = styled(Menu.Trigger)`
387
- svg {
388
- width: 0.6rem;
389
- height: 0.4rem;
390
- }
391
- `;
392
384
  const CellContent = ({ content, mainField, attribute, rowId, name }) => {
393
385
  if (!hasContent(content, mainField, attribute)) {
394
- return /* @__PURE__ */ jsx(Typography, { textColor: "neutral800", children: "-" });
386
+ return /* @__PURE__ */ jsx(
387
+ Typography,
388
+ {
389
+ textColor: "neutral800",
390
+ paddingLeft: attribute.type === "relation" ? "1.6rem" : 0,
391
+ paddingRight: attribute.type === "relation" ? "1.6rem" : 0,
392
+ children: "-"
393
+ }
394
+ );
395
395
  }
396
396
  switch (attribute.type) {
397
397
  case "media":
@@ -411,14 +411,11 @@ const CellContent = ({ content, mainField, attribute, rowId, name }) => {
411
411
  }
412
412
  return /* @__PURE__ */ jsx(SingleComponent, { mainField, content });
413
413
  case "string":
414
- return /* @__PURE__ */ jsx(Tooltip, { description: content, children: /* @__PURE__ */ jsx(TypographyMaxWidth, { ellipsis: true, textColor: "neutral800", children: /* @__PURE__ */ jsx(CellValue, { type: attribute.type, value: content }) }) });
414
+ return /* @__PURE__ */ jsx(Tooltip, { description: content, children: /* @__PURE__ */ jsx(Typography, { maxWidth: "30rem", ellipsis: true, textColor: "neutral800", children: /* @__PURE__ */ jsx(CellValue, { type: attribute.type, value: content }) }) });
415
415
  default:
416
- return /* @__PURE__ */ jsx(TypographyMaxWidth, { ellipsis: true, textColor: "neutral800", children: /* @__PURE__ */ jsx(CellValue, { type: attribute.type, value: content }) });
416
+ return /* @__PURE__ */ jsx(Typography, { maxWidth: "30rem", ellipsis: true, textColor: "neutral800", children: /* @__PURE__ */ jsx(CellValue, { type: attribute.type, value: content }) });
417
417
  }
418
418
  };
419
- const TypographyMaxWidth = styled(Typography)`
420
- max-width: 300px;
421
- `;
422
419
  const hasContent = (content, mainField, attribute) => {
423
420
  if (attribute.type === "component") {
424
421
  if (attribute.repeatable || !mainField) {
@@ -446,8 +443,6 @@ const hasContent = (content, mainField, attribute) => {
446
443
  };
447
444
  const isSingleRelation = (type) => ["oneToOne", "manyToOne", "oneToOneMorph"].includes(type);
448
445
  const ViewSettingsMenu = (props) => {
449
- const [isVisible, setIsVisible] = React.useState(false);
450
- const cogButtonRef = React.useRef(null);
451
446
  const permissions = useTypedSelector(
452
447
  (state) => state.admin_app.permissions.contentManager?.collectionTypesConfigurations ?? []
453
448
  );
@@ -456,52 +451,37 @@ const ViewSettingsMenu = (props) => {
456
451
  const {
457
452
  allowedActions: { canConfigureView }
458
453
  } = useRBAC(permissions);
459
- const handleToggle = () => {
460
- setIsVisible((prev) => !prev);
461
- };
462
- return /* @__PURE__ */ jsxs(Fragment, { children: [
463
- /* @__PURE__ */ jsx(
454
+ return /* @__PURE__ */ jsxs(Popover.Root, { children: [
455
+ /* @__PURE__ */ jsx(Popover.Trigger, { children: /* @__PURE__ */ jsx(
464
456
  IconButton,
465
457
  {
466
- icon: /* @__PURE__ */ jsx(Cog, {}),
467
458
  label: formatMessage({
468
459
  id: "components.ViewSettings.tooltip",
469
460
  defaultMessage: "View Settings"
470
461
  }),
471
- ref: cogButtonRef,
472
- onClick: handleToggle
473
- }
474
- ),
475
- isVisible && /* @__PURE__ */ jsx(
476
- Popover,
477
- {
478
- placement: "bottom-end",
479
- source: cogButtonRef,
480
- onDismiss: handleToggle,
481
- spacing: 4,
482
- padding: 3,
483
- children: /* @__PURE__ */ jsxs(Flex, { alignItems: "stretch", direction: "column", gap: 3, children: [
484
- canConfigureView ? /* @__PURE__ */ jsx(
485
- LinkButton,
486
- {
487
- size: "S",
488
- startIcon: /* @__PURE__ */ jsx(ListPlus, {}),
489
- variant: "secondary",
490
- as: NavLink,
491
- to: {
492
- pathname: "configurations/list",
493
- search: query.plugins ? stringify({ plugins: query.plugins }, { encode: false }) : ""
494
- },
495
- children: formatMessage({
496
- id: "app.links.configure-view",
497
- defaultMessage: "Configure the view"
498
- })
499
- }
500
- ) : null,
501
- /* @__PURE__ */ jsx(FieldPicker, { ...props })
502
- ] })
462
+ children: /* @__PURE__ */ jsx(Cog, {})
503
463
  }
504
- )
464
+ ) }),
465
+ /* @__PURE__ */ jsx(Popover.Content, { side: "bottom", align: "end", sideOffset: 4, children: /* @__PURE__ */ jsxs(Flex, { alignItems: "stretch", direction: "column", padding: 3, gap: 3, children: [
466
+ canConfigureView ? /* @__PURE__ */ jsx(
467
+ LinkButton,
468
+ {
469
+ size: "S",
470
+ startIcon: /* @__PURE__ */ jsx(ListPlus, {}),
471
+ variant: "secondary",
472
+ tag: NavLink,
473
+ to: {
474
+ pathname: "configurations/list",
475
+ search: query.plugins ? stringify({ plugins: query.plugins }, { encode: false }) : ""
476
+ },
477
+ children: formatMessage({
478
+ id: "app.links.configure-view",
479
+ defaultMessage: "Configure the view"
480
+ })
481
+ }
482
+ ) : null,
483
+ /* @__PURE__ */ jsx(FieldPicker, { ...props })
484
+ ] }) })
505
485
  ] });
506
486
  };
507
487
  const FieldPicker = ({ headers = [], resetHeaders, setHeaders }) => {
@@ -525,9 +505,9 @@ const FieldPicker = ({ headers = [], resetHeaders, setHeaders }) => {
525
505
  const handleReset = () => {
526
506
  resetHeaders();
527
507
  };
528
- return /* @__PURE__ */ jsxs(Flex, { as: "fieldset", direction: "column", alignItems: "stretch", gap: 3, children: [
508
+ return /* @__PURE__ */ jsxs(Flex, { tag: "fieldset", direction: "column", alignItems: "stretch", gap: 3, borderWidth: 0, children: [
529
509
  /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", children: [
530
- /* @__PURE__ */ jsx(Typography, { as: "legend", variant: "pi", fontWeight: "bold", children: formatMessage({
510
+ /* @__PURE__ */ jsx(Typography, { tag: "legend", variant: "pi", fontWeight: "bold", children: formatMessage({
531
511
  id: "containers.list.displayedFields",
532
512
  defaultMessage: "Displayed fields"
533
513
  }) }),
@@ -538,38 +518,33 @@ const FieldPicker = ({ headers = [], resetHeaders, setHeaders }) => {
538
518
  ] }),
539
519
  /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", children: columns.map((header) => {
540
520
  const isActive = headers.includes(header.name);
541
- return /* @__PURE__ */ jsxs(
542
- ChackboxWrapper,
521
+ return /* @__PURE__ */ jsx(
522
+ Flex,
543
523
  {
544
524
  wrap: "wrap",
545
525
  gap: 2,
546
- as: "label",
547
526
  background: isActive ? "primary100" : "transparent",
548
527
  hasRadius: true,
549
528
  padding: 2,
550
- children: [
551
- /* @__PURE__ */ jsx(
552
- BaseCheckbox,
553
- {
554
- onChange: () => handleChange(header.name),
555
- value: isActive,
556
- name: header.name
557
- }
558
- ),
559
- /* @__PURE__ */ jsx(Typography, { fontSize: 1, children: header.label })
560
- ]
529
+ children: /* @__PURE__ */ jsx(
530
+ Checkbox,
531
+ {
532
+ onCheckedChange: () => handleChange(header.name),
533
+ checked: isActive,
534
+ name: header.name,
535
+ children: /* @__PURE__ */ jsx(Typography, { fontSize: 1, children: header.label })
536
+ }
537
+ )
561
538
  },
562
539
  header.name
563
540
  );
564
541
  }) })
565
542
  ] });
566
543
  };
567
- const ChackboxWrapper = styled(Flex)`
568
- :hover {
569
- background-color: ${(props) => props.theme.colors.primary100};
570
- }
571
- `;
572
544
  const { INJECT_COLUMN_IN_TABLE } = HOOKS;
545
+ const LayoutsHeaderCustom = styled(Layouts.Header)`
546
+ overflow-wrap: anywhere;
547
+ `;
573
548
  const ListViewPage = () => {
574
549
  const { trackUsage } = useTracking();
575
550
  const navigate = useNavigate();
@@ -596,7 +571,7 @@ const ListViewPage = () => {
596
571
  sort: list.settings.defaultSortBy ? `${list.settings.defaultSortBy}:${list.settings.defaultSortOrder}` : ""
597
572
  });
598
573
  const params = React.useMemo(() => buildValidParams(query), [query]);
599
- const { data, error, isLoading } = useGetAllDocumentsQuery({
574
+ const { data, error, isFetching } = useGetAllDocumentsQuery({
600
575
  model,
601
576
  params
602
577
  });
@@ -654,7 +629,7 @@ const ListViewPage = () => {
654
629
  }
655
630
  return formattedHeaders;
656
631
  }, [displayedHeaders, formatMessage, list, runHookWaterfall, schema?.options?.draftAndPublish]);
657
- if (isLoading) {
632
+ if (isFetching) {
658
633
  return /* @__PURE__ */ jsx(Page.Loading, {});
659
634
  }
660
635
  if (error) {
@@ -671,7 +646,7 @@ const ListViewPage = () => {
671
646
  return /* @__PURE__ */ jsxs(Page.Main, { children: [
672
647
  /* @__PURE__ */ jsx(Page.Title, { children: `${contentTypeTitle}` }),
673
648
  /* @__PURE__ */ jsx(
674
- Layouts.Header,
649
+ LayoutsHeaderCustom,
675
650
  {
676
651
  primaryAction: canCreate ? /* @__PURE__ */ jsx(CreateButton, {}) : null,
677
652
  subtitle: formatMessage(
@@ -720,8 +695,8 @@ const ListViewPage = () => {
720
695
  }
721
696
  ),
722
697
  /* @__PURE__ */ jsx(Layouts.Content, { children: /* @__PURE__ */ jsxs(Flex, { gap: 4, direction: "column", alignItems: "stretch", children: [
723
- /* @__PURE__ */ jsxs(Table.Root, { rows: results, headers: tableHeaders, isLoading, children: [
724
- /* @__PURE__ */ jsx(Table.ActionBar, {}),
698
+ /* @__PURE__ */ jsxs(Table.Root, { rows: results, headers: tableHeaders, isLoading: isFetching, children: [
699
+ /* @__PURE__ */ jsx(TableActionsBar, {}),
725
700
  /* @__PURE__ */ jsxs(Table.Content, { children: [
726
701
  /* @__PURE__ */ jsxs(Table.Head, { children: [
727
702
  /* @__PURE__ */ jsx(Table.HeaderCheckboxCell, {}),
@@ -783,6 +758,18 @@ const ActionsCell = styled(Table.Cell)`
783
758
  display: flex;
784
759
  justify-content: flex-end;
785
760
  `;
761
+ const TableActionsBar = () => {
762
+ const selectRow = useTable("TableActionsBar", (state) => state.selectRow);
763
+ const [{ query }] = useQueryParams();
764
+ const locale = query?.plugins?.i18n?.locale;
765
+ const prevLocale = usePrev(locale);
766
+ React.useEffect(() => {
767
+ if (prevLocale !== locale) {
768
+ selectRow([]);
769
+ }
770
+ }, [selectRow, prevLocale, locale]);
771
+ return /* @__PURE__ */ jsx(Table.ActionBar, { children: /* @__PURE__ */ jsx(BulkActionsRenderer, {}) });
772
+ };
786
773
  const CreateButton = ({ variant }) => {
787
774
  const { formatMessage } = useIntl();
788
775
  const { trackUsage } = useTracking();
@@ -791,7 +778,7 @@ const CreateButton = ({ variant }) => {
791
778
  Button,
792
779
  {
793
780
  variant,
794
- forwardedAs: Link,
781
+ tag: Link,
795
782
  onClick: () => {
796
783
  trackUsage("willCreateEntry", { status: "draft" });
797
784
  },
@@ -801,6 +788,8 @@ const CreateButton = ({ variant }) => {
801
788
  pathname: "create",
802
789
  search: stringify({ plugins: query.plugins })
803
790
  },
791
+ minWidth: "max-content",
792
+ marginLeft: 2,
804
793
  children: formatMessage({
805
794
  id: getTranslation("HeaderLayout.button.label-add-entry"),
806
795
  defaultMessage: "Create new entry"
@@ -832,4 +821,4 @@ export {
832
821
  ListViewPage,
833
822
  ProtectedListViewPage
834
823
  };
835
- //# sourceMappingURL=ListViewPage-BtAwuYLE.mjs.map
824
+ //# sourceMappingURL=ListViewPage-_5gS-DOF.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ListViewPage-_5gS-DOF.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 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 {content.count > 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: content.count }\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 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 { data, error, isFetching } = useGetAllDocumentsQuery({\n model,\n params,\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 ? `.${header.mainField}` : ''}`,\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,WAAW,oBAAwB,IAAA;A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