@strapi/content-manager 0.0.0-experimental.e60ec1829240dae21c1e1d29076681c322288813 → 0.0.0-experimental.eba25ec571b091c6bde1104eb6c753debdf15462
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.
- package/LICENSE +18 -3
- package/dist/_chunks/{CardDragPreview-DSVYodBX.js → CardDragPreview-C0QyJgRA.js} +10 -14
- package/dist/_chunks/CardDragPreview-C0QyJgRA.js.map +1 -0
- package/dist/_chunks/{CardDragPreview-ikSG4M46.mjs → CardDragPreview-DOxamsuj.mjs} +7 -9
- package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +1 -0
- package/dist/_chunks/{ComponentConfigurationPage-BPvzFjM7.mjs → ComponentConfigurationPage-BaJMOQyq.mjs} +4 -4
- package/dist/_chunks/{ComponentConfigurationPage-BPvzFjM7.mjs.map → ComponentConfigurationPage-BaJMOQyq.mjs.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-DjWJdz6Y.js → ComponentConfigurationPage-N-CTtgQa.js} +4 -4
- package/dist/_chunks/{ComponentConfigurationPage-DjWJdz6Y.js.map → ComponentConfigurationPage-N-CTtgQa.js.map} +1 -1
- package/dist/_chunks/{ComponentIcon-BBQsYCVn.js → ComponentIcon-BXdiCGQp.js} +8 -2
- package/dist/_chunks/ComponentIcon-BXdiCGQp.js.map +1 -0
- package/dist/_chunks/{ComponentIcon-BOFnK76n.mjs → ComponentIcon-u4bIXTFY.mjs} +9 -3
- package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +1 -0
- package/dist/_chunks/{EditConfigurationPage-Dmv83RlS.js → EditConfigurationPage-BHkjAbxH.js} +4 -4
- package/dist/_chunks/{EditConfigurationPage-Dmv83RlS.js.map → EditConfigurationPage-BHkjAbxH.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-DacbqQ_f.mjs → EditConfigurationPage-CKK-5LfX.mjs} +4 -4
- package/dist/_chunks/{EditConfigurationPage-DacbqQ_f.mjs.map → EditConfigurationPage-CKK-5LfX.mjs.map} +1 -1
- package/dist/_chunks/EditViewPage-B11aeMcf.mjs +254 -0
- package/dist/_chunks/EditViewPage-B11aeMcf.mjs.map +1 -0
- package/dist/_chunks/{EditViewPage-DvNpQkam.js → EditViewPage-QPUftxUd.js} +101 -52
- package/dist/_chunks/EditViewPage-QPUftxUd.js.map +1 -0
- package/dist/_chunks/{Field-6gvGdPBV.mjs → Field-Bj_RgtGo.mjs} +1077 -814
- package/dist/_chunks/Field-Bj_RgtGo.mjs.map +1 -0
- package/dist/_chunks/{Field-DmVKIAOo.js → Field-DUK83cfh.js} +1121 -859
- package/dist/_chunks/Field-DUK83cfh.js.map +1 -0
- package/dist/_chunks/{Form-CPZC9vWa.js → Form-DHmBRlHd.js} +66 -46
- package/dist/_chunks/Form-DHmBRlHd.js.map +1 -0
- package/dist/_chunks/{Form-DW6K1IH-.mjs → Form-DLMSoXV7.mjs} +66 -45
- package/dist/_chunks/Form-DLMSoXV7.mjs.map +1 -0
- package/dist/_chunks/{History-Dmr9fmUA.mjs → History-CfCSNlG9.mjs} +181 -144
- package/dist/_chunks/History-CfCSNlG9.mjs.map +1 -0
- package/dist/_chunks/{History-DeAPlvtv.js → History-Di3zm4HT.js} +181 -145
- package/dist/_chunks/History-Di3zm4HT.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-DhwvYcNv.mjs → ListConfigurationPage-0mtv_iqk.mjs} +67 -56
- package/dist/_chunks/ListConfigurationPage-0mtv_iqk.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-DPCwW5Vr.js → ListConfigurationPage-Cq361KIt.js} +70 -60
- package/dist/_chunks/ListConfigurationPage-Cq361KIt.js.map +1 -0
- package/dist/_chunks/{ListViewPage-BtAwuYLE.mjs → ListViewPage-BxLVROX8.mjs} +175 -159
- package/dist/_chunks/ListViewPage-BxLVROX8.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-5ySZ-VUs.js → ListViewPage-DFDcG8gM.js} +178 -162
- package/dist/_chunks/ListViewPage-DFDcG8gM.js.map +1 -0
- package/dist/_chunks/{NoContentTypePage-DSPxnxxp.mjs → NoContentTypePage-BRfDd67_.mjs} +3 -3
- package/dist/_chunks/NoContentTypePage-BRfDd67_.mjs.map +1 -0
- package/dist/_chunks/{NoContentTypePage-DOC_yWOf.js → NoContentTypePage-BSyvnDZZ.js} +3 -3
- package/dist/_chunks/NoContentTypePage-BSyvnDZZ.js.map +1 -0
- package/dist/_chunks/{NoPermissionsPage-UWDC-1Tw.mjs → NoPermissionsPage-CV9V8KWa.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-UWDC-1Tw.mjs.map → NoPermissionsPage-CV9V8KWa.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-Dwu8rRJu.js → NoPermissionsPage-DyLphsn_.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-Dwu8rRJu.js.map → NoPermissionsPage-DyLphsn_.js.map} +1 -1
- package/dist/_chunks/Preview-C_B1nx3g.mjs +272 -0
- package/dist/_chunks/Preview-C_B1nx3g.mjs.map +1 -0
- package/dist/_chunks/Preview-D_3aO6Ly.js +291 -0
- package/dist/_chunks/Preview-D_3aO6Ly.js.map +1 -0
- package/dist/_chunks/{Relations-J8cscLlR.mjs → Relations-C6pwmDXh.mjs} +135 -89
- package/dist/_chunks/Relations-C6pwmDXh.mjs.map +1 -0
- package/dist/_chunks/{Relations-CgWtgnPe.js → Relations-Cne2AlrL.js} +138 -93
- package/dist/_chunks/Relations-Cne2AlrL.js.map +1 -0
- package/dist/_chunks/{en-MBPul9Su.mjs → en-DhFUjrNW.mjs} +37 -18
- package/dist/_chunks/{en-MBPul9Su.mjs.map → en-DhFUjrNW.mjs.map} +1 -1
- package/dist/_chunks/{en-C-V1_90f.js → en-Ic0kXjxB.js} +37 -18
- package/dist/_chunks/{en-C-V1_90f.js.map → en-Ic0kXjxB.js.map} +1 -1
- package/dist/_chunks/{es-EUonQTon.js → es-9K52xZIr.js} +2 -2
- package/dist/_chunks/{ja-CcFe8diO.js.map → es-9K52xZIr.js.map} +1 -1
- package/dist/_chunks/{es-CeXiYflN.mjs → es-D34tqjMw.mjs} +2 -2
- package/dist/_chunks/{es-CeXiYflN.mjs.map → es-D34tqjMw.mjs.map} +1 -1
- package/dist/_chunks/{fr-CD9VFbPM.mjs → fr--pg5jUbt.mjs} +13 -3
- package/dist/_chunks/{fr-CD9VFbPM.mjs.map → fr--pg5jUbt.mjs.map} +1 -1
- package/dist/_chunks/{fr-B7kGGg3E.js → fr-B2Kyv8Z9.js} +13 -3
- package/dist/_chunks/{fr-B7kGGg3E.js.map → fr-B2Kyv8Z9.js.map} +1 -1
- package/dist/_chunks/{index-CwRRo1V9.mjs → index-BpxR3En4.mjs} +1835 -824
- package/dist/_chunks/index-BpxR3En4.mjs.map +1 -0
- package/dist/_chunks/{index-C6AH2hEl.js → index-T-aWjbj2.js} +1788 -777
- package/dist/_chunks/index-T-aWjbj2.js.map +1 -0
- package/dist/_chunks/{ja-CcFe8diO.js → ja-7sfIbjxE.js} +2 -2
- package/dist/_chunks/{es-EUonQTon.js.map → ja-7sfIbjxE.js.map} +1 -1
- package/dist/_chunks/{ja-CtsUxOvk.mjs → ja-BHqhDq4V.mjs} +2 -2
- package/dist/_chunks/{ja-CtsUxOvk.mjs.map → ja-BHqhDq4V.mjs.map} +1 -1
- package/dist/_chunks/{layout-B_SXLhqf.js → layout-BEuNwv-F.js} +45 -29
- package/dist/_chunks/layout-BEuNwv-F.js.map +1 -0
- package/dist/_chunks/{layout-jIDzX0Fp.mjs → layout-DhMZ_lDx.mjs} +45 -27
- package/dist/_chunks/layout-DhMZ_lDx.mjs.map +1 -0
- package/dist/_chunks/{objects-gigeqt7s.js → objects-BcXOv6_9.js} +2 -4
- package/dist/_chunks/{objects-gigeqt7s.js.map → objects-BcXOv6_9.js.map} +1 -1
- package/dist/_chunks/{objects-mKMAmfec.mjs → objects-D6yBsdmx.mjs} +2 -4
- package/dist/_chunks/{objects-mKMAmfec.mjs.map → objects-D6yBsdmx.mjs.map} +1 -1
- package/dist/_chunks/{relations-CuvIgCqI.mjs → relations-BdnxoX6f.mjs} +6 -7
- package/dist/_chunks/relations-BdnxoX6f.mjs.map +1 -0
- package/dist/_chunks/{relations-iBMa_OFG.js → relations-kLcuobLk.js} +6 -7
- package/dist/_chunks/relations-kLcuobLk.js.map +1 -0
- package/dist/_chunks/useDebounce-CtcjDB3L.js +28 -0
- package/dist/_chunks/useDebounce-CtcjDB3L.js.map +1 -0
- package/dist/_chunks/useDebounce-DmuSJIF3.mjs +29 -0
- package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +1 -0
- package/dist/_chunks/useDragAndDrop-DdHgKsqq.mjs.map +1 -1
- package/dist/_chunks/useDragAndDrop-J0TUUbR6.js.map +1 -1
- package/dist/admin/index.js +3 -1
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +9 -7
- package/dist/admin/src/components/ComponentIcon.d.ts +6 -3
- package/dist/admin/src/content-manager.d.ts +3 -3
- package/dist/admin/src/exports.d.ts +2 -1
- package/dist/admin/src/history/components/VersionInputRenderer.d.ts +1 -1
- package/dist/admin/src/history/index.d.ts +3 -0
- package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
- package/dist/admin/src/hooks/useDocument.d.ts +37 -9
- package/dist/admin/src/hooks/useDocumentActions.d.ts +24 -3
- package/dist/admin/src/hooks/useDocumentLayout.d.ts +2 -2
- package/dist/admin/src/hooks/useDragAndDrop.d.ts +4 -4
- package/dist/admin/src/hooks/useKeyboardDragAndDrop.d.ts +1 -1
- package/dist/admin/src/index.d.ts +1 -0
- package/dist/admin/src/pages/EditView/EditViewPage.d.ts +9 -1
- package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +11 -4
- package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/BlocksInput.d.ts +3 -3
- package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +4 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/Component/Input.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/ComponentCategory.d.ts +3 -5
- package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/Field.d.ts +1 -1
- package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +30 -18
- package/dist/admin/src/pages/EditView/components/FormInputs/UID.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +3 -49
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/Field.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +16 -53
- package/dist/admin/src/pages/EditView/components/Header.d.ts +11 -11
- package/dist/admin/src/pages/EditView/components/InputRenderer.d.ts +2 -10
- package/dist/admin/src/pages/ListView/components/BulkActions/Actions.d.ts +3 -30
- package/dist/admin/src/pages/ListView/components/BulkActions/ConfirmBulkActionDialog.d.ts +2 -2
- package/dist/admin/src/pages/ListView/components/BulkActions/PublishAction.d.ts +9 -26
- package/dist/admin/src/preview/components/PreviewContent.d.ts +2 -0
- package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -0
- package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
- package/dist/admin/src/preview/constants.d.ts +1 -0
- package/dist/admin/src/preview/index.d.ts +4 -0
- package/dist/admin/src/preview/pages/Preview.d.ts +11 -0
- package/dist/admin/src/preview/routes.d.ts +3 -0
- package/dist/admin/src/preview/services/preview.d.ts +3 -0
- package/dist/admin/src/router.d.ts +1 -1
- package/dist/admin/src/services/api.d.ts +2 -3
- package/dist/admin/src/services/components.d.ts +2 -2
- package/dist/admin/src/services/contentTypes.d.ts +5 -5
- package/dist/admin/src/services/documents.d.ts +31 -20
- package/dist/admin/src/services/init.d.ts +2 -2
- package/dist/admin/src/services/relations.d.ts +3 -3
- package/dist/admin/src/services/uid.d.ts +3 -3
- package/dist/admin/src/utils/api.d.ts +4 -18
- package/dist/admin/src/utils/validation.d.ts +5 -7
- package/dist/server/index.js +852 -436
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +859 -443
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/bootstrap.d.ts.map +1 -1
- package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
- package/dist/server/src/controllers/index.d.ts.map +1 -1
- package/dist/server/src/controllers/relations.d.ts.map +1 -1
- package/dist/server/src/controllers/single-types.d.ts.map +1 -1
- package/dist/server/src/controllers/uid.d.ts.map +1 -1
- package/dist/server/src/controllers/utils/metadata.d.ts +22 -0
- package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -0
- package/dist/server/src/controllers/validation/dimensions.d.ts +11 -0
- package/dist/server/src/controllers/validation/dimensions.d.ts.map +1 -0
- package/dist/server/src/controllers/validation/index.d.ts +1 -1
- package/dist/server/src/history/services/history.d.ts.map +1 -1
- package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
- package/dist/server/src/history/services/utils.d.ts +4 -4
- package/dist/server/src/history/services/utils.d.ts.map +1 -1
- package/dist/server/src/index.d.ts +21 -42
- package/dist/server/src/index.d.ts.map +1 -1
- package/dist/server/src/policies/hasPermissions.d.ts.map +1 -1
- package/dist/server/src/preview/constants.d.ts +2 -0
- package/dist/server/src/preview/constants.d.ts.map +1 -0
- package/dist/server/src/preview/controllers/index.d.ts +2 -0
- package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
- package/dist/server/src/preview/controllers/preview.d.ts +13 -0
- package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
- package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
- package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
- package/dist/server/src/preview/index.d.ts +4 -0
- package/dist/server/src/preview/index.d.ts.map +1 -0
- package/dist/server/src/preview/routes/index.d.ts +8 -0
- package/dist/server/src/preview/routes/index.d.ts.map +1 -0
- package/dist/server/src/preview/routes/preview.d.ts +4 -0
- package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
- package/dist/server/src/preview/services/index.d.ts +16 -0
- package/dist/server/src/preview/services/index.d.ts.map +1 -0
- package/dist/server/src/preview/services/preview-config.d.ts +32 -0
- package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
- package/dist/server/src/preview/services/preview.d.ts +12 -0
- package/dist/server/src/preview/services/preview.d.ts.map +1 -0
- package/dist/server/src/preview/utils.d.ts +19 -0
- package/dist/server/src/preview/utils.d.ts.map +1 -0
- package/dist/server/src/register.d.ts.map +1 -1
- package/dist/server/src/routes/index.d.ts.map +1 -1
- package/dist/server/src/services/document-manager.d.ts +13 -12
- package/dist/server/src/services/document-manager.d.ts.map +1 -1
- package/dist/server/src/services/document-metadata.d.ts +14 -35
- package/dist/server/src/services/document-metadata.d.ts.map +1 -1
- package/dist/server/src/services/index.d.ts +21 -42
- package/dist/server/src/services/index.d.ts.map +1 -1
- package/dist/server/src/services/permission-checker.d.ts.map +1 -1
- package/dist/server/src/services/utils/configuration/index.d.ts +2 -2
- package/dist/server/src/services/utils/configuration/layouts.d.ts +2 -2
- package/dist/server/src/services/utils/populate.d.ts +8 -1
- package/dist/server/src/services/utils/populate.d.ts.map +1 -1
- package/dist/server/src/utils/index.d.ts +2 -0
- package/dist/server/src/utils/index.d.ts.map +1 -1
- package/dist/shared/contracts/collection-types.d.ts +17 -7
- package/dist/shared/contracts/collection-types.d.ts.map +1 -1
- package/dist/shared/contracts/index.d.ts +1 -0
- package/dist/shared/contracts/index.d.ts.map +1 -1
- package/dist/shared/contracts/preview.d.ts +27 -0
- package/dist/shared/contracts/preview.d.ts.map +1 -0
- package/dist/shared/contracts/relations.d.ts +2 -2
- package/dist/shared/contracts/relations.d.ts.map +1 -1
- package/dist/shared/index.js +4 -0
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/index.mjs +4 -0
- package/dist/shared/index.mjs.map +1 -1
- package/package.json +19 -20
- package/dist/_chunks/CardDragPreview-DSVYodBX.js.map +0 -1
- package/dist/_chunks/CardDragPreview-ikSG4M46.mjs.map +0 -1
- package/dist/_chunks/ComponentIcon-BBQsYCVn.js.map +0 -1
- package/dist/_chunks/ComponentIcon-BOFnK76n.mjs.map +0 -1
- package/dist/_chunks/EditViewPage-DDS6H9HO.mjs +0 -203
- package/dist/_chunks/EditViewPage-DDS6H9HO.mjs.map +0 -1
- package/dist/_chunks/EditViewPage-DvNpQkam.js.map +0 -1
- package/dist/_chunks/Field-6gvGdPBV.mjs.map +0 -1
- package/dist/_chunks/Field-DmVKIAOo.js.map +0 -1
- package/dist/_chunks/Form-CPZC9vWa.js.map +0 -1
- package/dist/_chunks/Form-DW6K1IH-.mjs.map +0 -1
- package/dist/_chunks/History-DeAPlvtv.js.map +0 -1
- package/dist/_chunks/History-Dmr9fmUA.mjs.map +0 -1
- package/dist/_chunks/ListConfigurationPage-DPCwW5Vr.js.map +0 -1
- package/dist/_chunks/ListConfigurationPage-DhwvYcNv.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-5ySZ-VUs.js.map +0 -1
- package/dist/_chunks/ListViewPage-BtAwuYLE.mjs.map +0 -1
- package/dist/_chunks/NoContentTypePage-DOC_yWOf.js.map +0 -1
- package/dist/_chunks/NoContentTypePage-DSPxnxxp.mjs.map +0 -1
- package/dist/_chunks/Relations-CgWtgnPe.js.map +0 -1
- package/dist/_chunks/Relations-J8cscLlR.mjs.map +0 -1
- package/dist/_chunks/index-C6AH2hEl.js.map +0 -1
- package/dist/_chunks/index-CwRRo1V9.mjs.map +0 -1
- package/dist/_chunks/layout-B_SXLhqf.js.map +0 -1
- package/dist/_chunks/layout-jIDzX0Fp.mjs.map +0 -1
- package/dist/_chunks/relations-CuvIgCqI.mjs.map +0 -1
- package/dist/_chunks/relations-iBMa_OFG.js.map +0 -1
- package/dist/_chunks/urls-CbOsUOoW.mjs +0 -7
- package/dist/_chunks/urls-CbOsUOoW.mjs.map +0 -1
- package/dist/_chunks/urls-DzZya_gm.js +0 -6
- package/dist/_chunks/urls-DzZya_gm.js.map +0 -1
- package/dist/server/src/controllers/utils/dimensions.d.ts +0 -5
- package/dist/server/src/controllers/utils/dimensions.d.ts.map +0 -1
- package/strapi-server.js +0 -3
@@ -9,13 +9,13 @@ const isEqual = require("lodash/isEqual");
|
|
9
9
|
const qs = require("qs");
|
10
10
|
const reactIntl = require("react-intl");
|
11
11
|
const reactRouterDom = require("react-router-dom");
|
12
|
-
const
|
13
|
-
const index = require("./index-
|
12
|
+
const styledComponents = require("styled-components");
|
13
|
+
const index = require("./index-T-aWjbj2.js");
|
14
|
+
const useDebounce = require("./useDebounce-CtcjDB3L.js");
|
14
15
|
const isEmpty = require("lodash/isEmpty");
|
15
16
|
const parseISO = require("date-fns/parseISO");
|
16
17
|
const toString = require("lodash/toString");
|
17
|
-
const
|
18
|
-
const relations = require("./relations-iBMa_OFG.js");
|
18
|
+
const relations = require("./relations-kLcuobLk.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) {
|
@@ -38,17 +38,9 @@ function _interopNamespace(e) {
|
|
38
38
|
}
|
39
39
|
const React__namespace = /* @__PURE__ */ _interopNamespace(React);
|
40
40
|
const isEqual__default = /* @__PURE__ */ _interopDefault(isEqual);
|
41
|
-
const styled__default = /* @__PURE__ */ _interopDefault(styled);
|
42
41
|
const isEmpty__default = /* @__PURE__ */ _interopDefault(isEmpty);
|
43
42
|
const parseISO__default = /* @__PURE__ */ _interopDefault(parseISO);
|
44
43
|
const toString__default = /* @__PURE__ */ _interopDefault(toString);
|
45
|
-
const usePrev = (value) => {
|
46
|
-
const ref = React.useRef();
|
47
|
-
React.useEffect(() => {
|
48
|
-
ref.current = value;
|
49
|
-
}, [value]);
|
50
|
-
return ref.current;
|
51
|
-
};
|
52
44
|
const NOT_ALLOWED_FILTERS = [
|
53
45
|
"json",
|
54
46
|
"component",
|
@@ -155,6 +147,15 @@ const FiltersImpl = ({ disabled, schema }) => {
|
|
155
147
|
}
|
156
148
|
};
|
157
149
|
}
|
150
|
+
if (attribute.type === "enumeration") {
|
151
|
+
filter = {
|
152
|
+
...filter,
|
153
|
+
options: attribute.enum.map((value) => ({
|
154
|
+
label: value,
|
155
|
+
value
|
156
|
+
}))
|
157
|
+
};
|
158
|
+
}
|
158
159
|
return filter;
|
159
160
|
}).filter(Boolean).toSorted((a, b) => formatter.compare(a.label, b.label));
|
160
161
|
}, [
|
@@ -197,18 +198,22 @@ const FiltersImpl = ({ disabled, schema }) => {
|
|
197
198
|
);
|
198
199
|
};
|
199
200
|
const AdminUsersFilter = ({ name }) => {
|
200
|
-
const [
|
201
|
+
const [pageSize, setPageSize] = React__namespace.useState(10);
|
202
|
+
const [search, setSearch] = React__namespace.useState("");
|
201
203
|
const { formatMessage } = reactIntl.useIntl();
|
204
|
+
const debouncedSearch = useDebounce.useDebounce(search, 300);
|
202
205
|
const { data, isLoading } = strapiAdmin.useAdminUsers({
|
203
|
-
|
206
|
+
pageSize,
|
207
|
+
_q: debouncedSearch
|
204
208
|
});
|
205
209
|
const field = strapiAdmin.useField(name);
|
206
210
|
const handleOpenChange = (isOpen) => {
|
207
211
|
if (!isOpen) {
|
208
|
-
|
212
|
+
setPageSize(10);
|
209
213
|
}
|
210
214
|
};
|
211
|
-
const users = data
|
215
|
+
const { users = [], pagination } = data ?? {};
|
216
|
+
const { pageCount = 1, page = 1 } = pagination ?? {};
|
212
217
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
213
218
|
designSystem.Combobox,
|
214
219
|
{
|
@@ -220,7 +225,11 @@ const AdminUsersFilter = ({ name }) => {
|
|
220
225
|
onOpenChange: handleOpenChange,
|
221
226
|
onChange: (value) => field.onChange(name, value),
|
222
227
|
loading: isLoading,
|
223
|
-
onLoadMore: () =>
|
228
|
+
onLoadMore: () => setPageSize(pageSize + 10),
|
229
|
+
hasMoreItems: page < pageCount,
|
230
|
+
onInputChange: (e) => {
|
231
|
+
setSearch(e.currentTarget.value);
|
232
|
+
},
|
224
233
|
children: users.map((user) => {
|
225
234
|
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: user.id.toString(), children: index.getDisplayName(user) }, user.id);
|
226
235
|
})
|
@@ -262,20 +271,16 @@ const SingleComponent = ({ content, mainField }) => {
|
|
262
271
|
if (!mainField) {
|
263
272
|
return null;
|
264
273
|
}
|
265
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { label: content[mainField.name], children: /* @__PURE__ */ jsxRuntime.jsx(
|
274
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { label: content[mainField.name], children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { maxWidth: "25rem", textColor: "neutral800", ellipsis: true, children: /* @__PURE__ */ jsxRuntime.jsx(CellValue, { type: mainField.type, value: content[mainField.name] }) }) });
|
266
275
|
};
|
267
|
-
const SingleComponentTypography = styled__default.default(designSystem.Typography)`
|
268
|
-
max-width: 250px;
|
269
|
-
`;
|
270
276
|
const RepeatableComponent = ({ content, mainField }) => {
|
271
277
|
const { formatMessage } = reactIntl.useIntl();
|
272
278
|
if (!mainField) {
|
273
279
|
return null;
|
274
280
|
}
|
275
281
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Root, { children: [
|
276
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
282
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Trigger, { onClick: (e) => e.stopPropagation(), children: [
|
277
283
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { children: content.length }),
|
278
|
-
" ",
|
279
284
|
formatMessage(
|
280
285
|
{
|
281
286
|
id: "content-manager.containers.list.items",
|
@@ -284,25 +289,24 @@ const RepeatableComponent = ({ content, mainField }) => {
|
|
284
289
|
{ number: content.length }
|
285
290
|
)
|
286
291
|
] }),
|
287
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Menu.Content, { children: content.map((item) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Menu.Item, { disabled: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
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)) })
|
288
293
|
] });
|
289
294
|
};
|
290
|
-
const RepeatableComponentTypography = styled__default.default(designSystem.Typography)`
|
291
|
-
max-width: 500px;
|
292
|
-
`;
|
293
|
-
const MenuTrigger$1 = styled__default.default(designSystem.Menu.Trigger)`
|
294
|
-
svg {
|
295
|
-
width: 0.6rem;
|
296
|
-
height: 0.4rem;
|
297
|
-
}
|
298
|
-
`;
|
299
295
|
const getFileExtension = (ext) => ext && ext[0] === "." ? ext.substring(1) : ext;
|
300
296
|
const MediaSingle = ({ url, mime, alternativeText, name, ext, formats }) => {
|
301
|
-
const fileURL =
|
297
|
+
const fileURL = useDebounce.prefixFileUrlWithBackendUrl(url);
|
302
298
|
if (mime.includes("image")) {
|
303
299
|
const thumbnail = formats?.thumbnail?.url;
|
304
|
-
const mediaURL =
|
305
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
300
|
+
const mediaURL = useDebounce.prefixFileUrlWithBackendUrl(thumbnail) || fileURL;
|
301
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
302
|
+
designSystem.Avatar.Item,
|
303
|
+
{
|
304
|
+
src: mediaURL,
|
305
|
+
alt: alternativeText || name,
|
306
|
+
fallback: alternativeText || name,
|
307
|
+
preview: true
|
308
|
+
}
|
309
|
+
);
|
306
310
|
}
|
307
311
|
const fileExtension = getFileExtension(ext);
|
308
312
|
const fileName = name.length > 100 ? `${name.substring(0, 100)}...` : name;
|
@@ -312,7 +316,7 @@ const FileWrapper = ({ children }) => {
|
|
312
316
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
313
317
|
designSystem.Flex,
|
314
318
|
{
|
315
|
-
|
319
|
+
tag: "span",
|
316
320
|
position: "relative",
|
317
321
|
borderRadius: "50%",
|
318
322
|
width: "26px",
|
@@ -326,12 +330,12 @@ const FileWrapper = ({ children }) => {
|
|
326
330
|
}
|
327
331
|
);
|
328
332
|
};
|
329
|
-
const FileTypography =
|
333
|
+
const FileTypography = styledComponents.styled(designSystem.Typography)`
|
330
334
|
font-size: 0.9rem;
|
331
335
|
line-height: 0.9rem;
|
332
336
|
`;
|
333
337
|
const MediaMultiple = ({ content }) => {
|
334
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
338
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Avatar.Group, { children: content.map((file, index2) => {
|
335
339
|
const key = `${file.id}${index2}`;
|
336
340
|
if (index2 === 3) {
|
337
341
|
const remainingFiles = `+${content.length - 3}`;
|
@@ -344,11 +348,8 @@ const MediaMultiple = ({ content }) => {
|
|
344
348
|
}) });
|
345
349
|
};
|
346
350
|
const RelationSingle = ({ mainField, content }) => {
|
347
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
351
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { maxWidth: "50rem", textColor: "neutral800", ellipsis: true, children: relations.getRelationLabel(content, mainField) });
|
348
352
|
};
|
349
|
-
const TypographyMaxWidth$1 = styled__default.default(designSystem.Typography)`
|
350
|
-
max-width: 500px;
|
351
|
-
`;
|
352
353
|
const RelationMultiple = ({ mainField, content, rowId, name }) => {
|
353
354
|
const { model } = index.useDoc();
|
354
355
|
const { formatMessage } = reactIntl.useIntl();
|
@@ -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,23 +379,20 @@ 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(
|
381
|
-
|
382
|
-
|
383
|
-
{
|
384
|
-
|
385
|
-
|
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"),
|
393
392
|
defaultMessage: "Relations are loading"
|
394
393
|
}) }) }),
|
395
394
|
data?.results && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
396
|
-
data.results.map((entry) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Menu.Item, { disabled: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
395
|
+
data.results.map((entry) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Menu.Item, { disabled: true, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { maxWidth: "50rem", ellipsis: true, children: relations.getRelationLabel(entry, mainField) }) }, entry.documentId)),
|
397
396
|
data?.pagination && data?.pagination.total > 10 && /* @__PURE__ */ jsxRuntime.jsx(
|
398
397
|
designSystem.Menu.Item,
|
399
398
|
{
|
@@ -409,15 +408,17 @@ const RelationMultiple = ({ mainField, content, rowId, name }) => {
|
|
409
408
|
] })
|
410
409
|
] });
|
411
410
|
};
|
412
|
-
const MenuTrigger = styled__default.default(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(
|
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":
|
@@ -437,14 +438,11 @@ const CellContent = ({ content, mainField, attribute, rowId, name }) => {
|
|
437
438
|
}
|
438
439
|
return /* @__PURE__ */ jsxRuntime.jsx(SingleComponent, { mainField, content });
|
439
440
|
case "string":
|
440
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { description: content, children: /* @__PURE__ */ jsxRuntime.jsx(
|
441
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { description: content, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { maxWidth: "30rem", ellipsis: true, textColor: "neutral800", children: /* @__PURE__ */ jsxRuntime.jsx(CellValue, { type: attribute.type, value: content }) }) });
|
441
442
|
default:
|
442
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
443
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { maxWidth: "30rem", ellipsis: true, textColor: "neutral800", children: /* @__PURE__ */ jsxRuntime.jsx(CellValue, { type: attribute.type, value: content }) });
|
443
444
|
}
|
444
445
|
};
|
445
|
-
const TypographyMaxWidth = styled__default.default(designSystem.Typography)`
|
446
|
-
max-width: 300px;
|
447
|
-
`;
|
448
446
|
const hasContent = (content, mainField, attribute) => {
|
449
447
|
if (attribute.type === "component") {
|
450
448
|
if (attribute.repeatable || !mainField) {
|
@@ -460,6 +458,9 @@ const hasContent = (content, mainField, attribute) => {
|
|
460
458
|
if (isSingleRelation(attribute.relation)) {
|
461
459
|
return !isEmpty__default.default(content);
|
462
460
|
}
|
461
|
+
if (Array.isArray(content)) {
|
462
|
+
return content.length > 0;
|
463
|
+
}
|
463
464
|
return content?.count > 0;
|
464
465
|
}
|
465
466
|
if (["integer", "decimal", "float", "number"].includes(attribute.type)) {
|
@@ -472,8 +473,6 @@ const hasContent = (content, mainField, attribute) => {
|
|
472
473
|
};
|
473
474
|
const isSingleRelation = (type) => ["oneToOne", "manyToOne", "oneToOneMorph"].includes(type);
|
474
475
|
const ViewSettingsMenu = (props) => {
|
475
|
-
const [isVisible, setIsVisible] = React__namespace.useState(false);
|
476
|
-
const cogButtonRef = React__namespace.useRef(null);
|
477
476
|
const permissions = hooks.useTypedSelector(
|
478
477
|
(state) => state.admin_app.permissions.contentManager?.collectionTypesConfigurations ?? []
|
479
478
|
);
|
@@ -482,52 +481,37 @@ const ViewSettingsMenu = (props) => {
|
|
482
481
|
const {
|
483
482
|
allowedActions: { canConfigureView }
|
484
483
|
} = strapiAdmin.useRBAC(permissions);
|
485
|
-
|
486
|
-
|
487
|
-
};
|
488
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
489
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
484
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Popover.Root, { children: [
|
485
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
490
486
|
designSystem.IconButton,
|
491
487
|
{
|
492
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(Icons.Cog, {}),
|
493
488
|
label: formatMessage({
|
494
489
|
id: "components.ViewSettings.tooltip",
|
495
490
|
defaultMessage: "View Settings"
|
496
491
|
}),
|
497
|
-
|
498
|
-
onClick: handleToggle
|
492
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Cog, {})
|
499
493
|
}
|
500
|
-
),
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
children: formatMessage({
|
522
|
-
id: "app.links.configure-view",
|
523
|
-
defaultMessage: "Configure the view"
|
524
|
-
})
|
525
|
-
}
|
526
|
-
) : null,
|
527
|
-
/* @__PURE__ */ jsxRuntime.jsx(FieldPicker, { ...props })
|
528
|
-
] })
|
529
|
-
}
|
530
|
-
)
|
494
|
+
) }),
|
495
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Content, { side: "bottom", align: "end", sideOffset: 4, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "stretch", direction: "column", padding: 3, gap: 3, children: [
|
496
|
+
canConfigureView ? /* @__PURE__ */ jsxRuntime.jsx(
|
497
|
+
designSystem.LinkButton,
|
498
|
+
{
|
499
|
+
size: "S",
|
500
|
+
startIcon: /* @__PURE__ */ jsxRuntime.jsx(Icons.ListPlus, {}),
|
501
|
+
variant: "secondary",
|
502
|
+
tag: reactRouterDom.NavLink,
|
503
|
+
to: {
|
504
|
+
pathname: "configurations/list",
|
505
|
+
search: query.plugins ? qs.stringify({ plugins: query.plugins }, { encode: false }) : ""
|
506
|
+
},
|
507
|
+
children: formatMessage({
|
508
|
+
id: "app.links.configure-view",
|
509
|
+
defaultMessage: "Configure the view"
|
510
|
+
})
|
511
|
+
}
|
512
|
+
) : null,
|
513
|
+
/* @__PURE__ */ jsxRuntime.jsx(FieldPicker, { ...props })
|
514
|
+
] }) })
|
531
515
|
] });
|
532
516
|
};
|
533
517
|
const FieldPicker = ({ headers = [], resetHeaders, setHeaders }) => {
|
@@ -551,51 +535,58 @@ const FieldPicker = ({ headers = [], resetHeaders, setHeaders }) => {
|
|
551
535
|
const handleReset = () => {
|
552
536
|
resetHeaders();
|
553
537
|
};
|
554
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
538
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
539
|
+
designSystem.Flex,
|
540
|
+
{
|
541
|
+
tag: "fieldset",
|
542
|
+
direction: "column",
|
543
|
+
alignItems: "stretch",
|
544
|
+
gap: 3,
|
545
|
+
borderWidth: 0,
|
546
|
+
maxHeight: "240px",
|
547
|
+
overflow: "scroll",
|
548
|
+
children: [
|
549
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", children: [
|
550
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "legend", variant: "pi", fontWeight: "bold", children: formatMessage({
|
551
|
+
id: "containers.list.displayedFields",
|
552
|
+
defaultMessage: "Displayed fields"
|
553
|
+
}) }),
|
554
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.TextButton, { onClick: handleReset, children: formatMessage({
|
555
|
+
id: "app.components.Button.reset",
|
556
|
+
defaultMessage: "Reset"
|
557
|
+
}) })
|
558
|
+
] }),
|
559
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", children: columns.map((header) => {
|
560
|
+
const isActive = headers.includes(header.name);
|
561
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
562
|
+
designSystem.Flex,
|
563
|
+
{
|
564
|
+
wrap: "wrap",
|
565
|
+
gap: 2,
|
566
|
+
background: isActive ? "primary100" : "transparent",
|
567
|
+
hasRadius: true,
|
568
|
+
padding: 2,
|
569
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
570
|
+
designSystem.Checkbox,
|
571
|
+
{
|
572
|
+
onCheckedChange: () => handleChange(header.name),
|
573
|
+
checked: isActive,
|
574
|
+
name: header.name,
|
575
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontSize: 1, children: header.label })
|
576
|
+
}
|
577
|
+
)
|
578
|
+
},
|
579
|
+
header.name
|
580
|
+
);
|
581
|
+
}) })
|
582
|
+
]
|
583
|
+
}
|
584
|
+
);
|
592
585
|
};
|
593
|
-
const ChackboxWrapper = styled__default.default(designSystem.Flex)`
|
594
|
-
:hover {
|
595
|
-
background-color: ${(props) => props.theme.colors.primary100};
|
596
|
-
}
|
597
|
-
`;
|
598
586
|
const { INJECT_COLUMN_IN_TABLE } = index.HOOKS;
|
587
|
+
const LayoutsHeaderCustom = styledComponents.styled(strapiAdmin.Layouts.Header)`
|
588
|
+
overflow-wrap: anywhere;
|
589
|
+
`;
|
599
590
|
const ListViewPage = () => {
|
600
591
|
const { trackUsage } = strapiAdmin.useTracking();
|
601
592
|
const navigate = reactRouterDom.useNavigate();
|
@@ -605,7 +596,7 @@ const ListViewPage = () => {
|
|
605
596
|
const { collectionType, model, schema } = index.useDoc();
|
606
597
|
const { list } = index.useDocumentLayout(model);
|
607
598
|
const [displayedHeaders, setDisplayedHeaders] = React__namespace.useState([]);
|
608
|
-
const listLayout = usePrev(list.layout);
|
599
|
+
const listLayout = useDebounce.usePrev(list.layout);
|
609
600
|
React__namespace.useEffect(() => {
|
610
601
|
if (!isEqual__default.default(listLayout, list.layout)) {
|
611
602
|
setDisplayedHeaders(list.layout);
|
@@ -622,7 +613,7 @@ const ListViewPage = () => {
|
|
622
613
|
sort: list.settings.defaultSortBy ? `${list.settings.defaultSortBy}:${list.settings.defaultSortOrder}` : ""
|
623
614
|
});
|
624
615
|
const params = React__namespace.useMemo(() => index.buildValidParams(query), [query]);
|
625
|
-
const { data, error,
|
616
|
+
const { data, error, isFetching } = index.useGetAllDocumentsQuery({
|
626
617
|
model,
|
627
618
|
params
|
628
619
|
});
|
@@ -658,10 +649,14 @@ const ListViewPage = () => {
|
|
658
649
|
layout: list
|
659
650
|
});
|
660
651
|
const formattedHeaders = headers.displayedHeaders.map((header) => {
|
652
|
+
const translation = typeof header.label === "string" ? {
|
653
|
+
id: `content-manager.content-types.${model}.${header.name}`,
|
654
|
+
defaultMessage: header.label
|
655
|
+
} : header.label;
|
661
656
|
return {
|
662
657
|
...header,
|
663
|
-
label:
|
664
|
-
name: `${header.name}${header.mainField ? `.${header.mainField}` : ""}`
|
658
|
+
label: formatMessage(translation),
|
659
|
+
name: `${header.name}${header.mainField?.name ? `.${header.mainField.name}` : ""}`
|
665
660
|
};
|
666
661
|
});
|
667
662
|
if (schema?.options?.draftAndPublish) {
|
@@ -679,8 +674,15 @@ const ListViewPage = () => {
|
|
679
674
|
});
|
680
675
|
}
|
681
676
|
return formattedHeaders;
|
682
|
-
}, [
|
683
|
-
|
677
|
+
}, [
|
678
|
+
displayedHeaders,
|
679
|
+
formatMessage,
|
680
|
+
list,
|
681
|
+
runHookWaterfall,
|
682
|
+
schema?.options?.draftAndPublish,
|
683
|
+
model
|
684
|
+
]);
|
685
|
+
if (isFetching) {
|
684
686
|
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Loading, {});
|
685
687
|
}
|
686
688
|
if (error) {
|
@@ -697,7 +699,7 @@ const ListViewPage = () => {
|
|
697
699
|
return /* @__PURE__ */ jsxRuntime.jsxs(strapiAdmin.Page.Main, { children: [
|
698
700
|
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Title, { children: `${contentTypeTitle}` }),
|
699
701
|
/* @__PURE__ */ jsxRuntime.jsx(
|
700
|
-
|
702
|
+
LayoutsHeaderCustom,
|
701
703
|
{
|
702
704
|
primaryAction: canCreate ? /* @__PURE__ */ jsxRuntime.jsx(CreateButton, {}) : null,
|
703
705
|
subtitle: formatMessage(
|
@@ -746,8 +748,8 @@ const ListViewPage = () => {
|
|
746
748
|
}
|
747
749
|
),
|
748
750
|
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Layouts.Content, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 4, direction: "column", alignItems: "stretch", children: [
|
749
|
-
/* @__PURE__ */ jsxRuntime.jsxs(strapiAdmin.Table.Root, { rows: results, headers: tableHeaders, isLoading, children: [
|
750
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
751
|
+
/* @__PURE__ */ jsxRuntime.jsxs(strapiAdmin.Table.Root, { rows: results, headers: tableHeaders, isLoading: isFetching, children: [
|
752
|
+
/* @__PURE__ */ jsxRuntime.jsx(TableActionsBar, {}),
|
751
753
|
/* @__PURE__ */ jsxRuntime.jsxs(strapiAdmin.Table.Content, { children: [
|
752
754
|
/* @__PURE__ */ jsxRuntime.jsxs(strapiAdmin.Table.Head, { children: [
|
753
755
|
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.HeaderCheckboxCell, {}),
|
@@ -805,10 +807,22 @@ const ListViewPage = () => {
|
|
805
807
|
] }) })
|
806
808
|
] });
|
807
809
|
};
|
808
|
-
const ActionsCell =
|
810
|
+
const ActionsCell = styledComponents.styled(strapiAdmin.Table.Cell)`
|
809
811
|
display: flex;
|
810
812
|
justify-content: flex-end;
|
811
813
|
`;
|
814
|
+
const TableActionsBar = () => {
|
815
|
+
const selectRow = strapiAdmin.useTable("TableActionsBar", (state) => state.selectRow);
|
816
|
+
const [{ query }] = strapiAdmin.useQueryParams();
|
817
|
+
const locale = query?.plugins?.i18n?.locale;
|
818
|
+
const prevLocale = useDebounce.usePrev(locale);
|
819
|
+
React__namespace.useEffect(() => {
|
820
|
+
if (prevLocale !== locale) {
|
821
|
+
selectRow([]);
|
822
|
+
}
|
823
|
+
}, [selectRow, prevLocale, locale]);
|
824
|
+
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.ActionBar, { children: /* @__PURE__ */ jsxRuntime.jsx(index.BulkActionsRenderer, {}) });
|
825
|
+
};
|
812
826
|
const CreateButton = ({ variant }) => {
|
813
827
|
const { formatMessage } = reactIntl.useIntl();
|
814
828
|
const { trackUsage } = strapiAdmin.useTracking();
|
@@ -817,7 +831,7 @@ const CreateButton = ({ variant }) => {
|
|
817
831
|
designSystem.Button,
|
818
832
|
{
|
819
833
|
variant,
|
820
|
-
|
834
|
+
tag: reactRouterDom.Link,
|
821
835
|
onClick: () => {
|
822
836
|
trackUsage("willCreateEntry", { status: "draft" });
|
823
837
|
},
|
@@ -827,6 +841,8 @@ const CreateButton = ({ variant }) => {
|
|
827
841
|
pathname: "create",
|
828
842
|
search: qs.stringify({ plugins: query.plugins })
|
829
843
|
},
|
844
|
+
minWidth: "max-content",
|
845
|
+
marginLeft: 2,
|
830
846
|
children: formatMessage({
|
831
847
|
id: index.getTranslation("HeaderLayout.button.label-add-entry"),
|
832
848
|
defaultMessage: "Create new entry"
|
@@ -856,4 +872,4 @@ const ProtectedListViewPage = () => {
|
|
856
872
|
};
|
857
873
|
exports.ListViewPage = ListViewPage;
|
858
874
|
exports.ProtectedListViewPage = ProtectedListViewPage;
|
859
|
-
//# sourceMappingURL=ListViewPage-
|
875
|
+
//# sourceMappingURL=ListViewPage-DFDcG8gM.js.map
|