@strapi/content-manager 5.61.1 → 5.62.0
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/dist/admin/components/ConfigurationForm/Fields.js +1 -1
- package/dist/admin/components/ConfigurationForm/Fields.js.map +1 -1
- package/dist/admin/components/ConfigurationForm/Fields.mjs +3 -3
- package/dist/admin/components/ConfigurationForm/Fields.mjs.map +1 -1
- package/dist/admin/features/I18nSharedFieldsLock.js +54 -0
- package/dist/admin/features/I18nSharedFieldsLock.js.map +1 -0
- package/dist/admin/features/I18nSharedFieldsLock.mjs +31 -0
- package/dist/admin/features/I18nSharedFieldsLock.mjs.map +1 -0
- package/dist/admin/history/components/VersionInputRenderer.js +7 -2
- package/dist/admin/history/components/VersionInputRenderer.js.map +1 -1
- package/dist/admin/history/components/VersionInputRenderer.mjs +7 -3
- package/dist/admin/history/components/VersionInputRenderer.mjs.map +1 -1
- package/dist/admin/hooks/useContentManagerInitData.js +27 -8
- package/dist/admin/hooks/useContentManagerInitData.js.map +1 -1
- package/dist/admin/hooks/useContentManagerInitData.mjs +29 -10
- package/dist/admin/hooks/useContentManagerInitData.mjs.map +1 -1
- package/dist/admin/hooks/useDocument.js +11 -13
- package/dist/admin/hooks/useDocument.js.map +1 -1
- package/dist/admin/hooks/useDocument.mjs +11 -13
- package/dist/admin/hooks/useDocument.mjs.map +1 -1
- package/dist/admin/hooks/useI18nFieldLock.js +169 -0
- package/dist/admin/hooks/useI18nFieldLock.js.map +1 -0
- package/dist/admin/hooks/useI18nFieldLock.mjs +140 -0
- package/dist/admin/hooks/useI18nFieldLock.mjs.map +1 -0
- package/dist/admin/hooks/usePersistentQueryParams.js +16 -3
- package/dist/admin/hooks/usePersistentQueryParams.js.map +1 -1
- package/dist/admin/hooks/usePersistentQueryParams.mjs +16 -3
- package/dist/admin/hooks/usePersistentQueryParams.mjs.map +1 -1
- package/dist/admin/index.js +5 -0
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +2 -0
- package/dist/admin/index.mjs.map +1 -1
- package/dist/admin/modules/app.js +8 -1
- package/dist/admin/modules/app.js.map +1 -1
- package/dist/admin/modules/app.mjs +8 -2
- package/dist/admin/modules/app.mjs.map +1 -1
- package/dist/admin/pages/EditView/EditViewPage.js +129 -127
- package/dist/admin/pages/EditView/EditViewPage.js.map +1 -1
- package/dist/admin/pages/EditView/EditViewPage.mjs +129 -127
- package/dist/admin/pages/EditView/EditViewPage.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/DocumentActions.js +11 -4
- package/dist/admin/pages/EditView/components/DocumentActions.js.map +1 -1
- package/dist/admin/pages/EditView/components/DocumentActions.mjs +12 -5
- package/dist/admin/pages/EditView/components/DocumentActions.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/EditorLayout.js +31 -21
- package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/EditorLayout.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/EditorLayout.mjs +32 -22
- package/dist/admin/pages/EditView/components/FormInputs/BlocksInput/EditorLayout.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Component/AddComponentMenu.js +98 -0
- package/dist/admin/pages/EditView/components/FormInputs/Component/AddComponentMenu.js.map +1 -0
- package/dist/admin/pages/EditView/components/FormInputs/Component/AddComponentMenu.mjs +96 -0
- package/dist/admin/pages/EditView/components/FormInputs/Component/AddComponentMenu.mjs.map +1 -0
- package/dist/admin/pages/EditView/components/FormInputs/Component/ComponentCopyModal.js +1103 -0
- package/dist/admin/pages/EditView/components/FormInputs/Component/ComponentCopyModal.js.map +1 -0
- package/dist/admin/pages/EditView/components/FormInputs/Component/ComponentCopyModal.mjs +1077 -0
- package/dist/admin/pages/EditView/components/FormInputs/Component/ComponentCopyModal.mjs.map +1 -0
- package/dist/admin/pages/EditView/components/FormInputs/Component/CopiedComponents.js +211 -0
- package/dist/admin/pages/EditView/components/FormInputs/Component/CopiedComponents.js.map +1 -0
- package/dist/admin/pages/EditView/components/FormInputs/Component/CopiedComponents.mjs +183 -0
- package/dist/admin/pages/EditView/components/FormInputs/Component/CopiedComponents.mjs.map +1 -0
- package/dist/admin/pages/EditView/components/FormInputs/Component/Initializer.js +84 -41
- package/dist/admin/pages/EditView/components/FormInputs/Component/Initializer.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Component/Initializer.mjs +86 -43
- package/dist/admin/pages/EditView/components/FormInputs/Component/Initializer.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Component/Input.js +86 -20
- package/dist/admin/pages/EditView/components/FormInputs/Component/Input.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Component/Input.mjs +89 -23
- package/dist/admin/pages/EditView/components/FormInputs/Component/Input.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Component/NonRepeatable.js +5 -2
- package/dist/admin/pages/EditView/components/FormInputs/Component/NonRepeatable.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Component/NonRepeatable.mjs +5 -2
- package/dist/admin/pages/EditView/components/FormInputs/Component/NonRepeatable.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Component/Repeatable.js +142 -22
- package/dist/admin/pages/EditView/components/FormInputs/Component/Repeatable.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Component/Repeatable.mjs +143 -23
- package/dist/admin/pages/EditView/components/FormInputs/Component/Repeatable.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Component/utils/componentCopy.js +402 -0
- package/dist/admin/pages/EditView/components/FormInputs/Component/utils/componentCopy.js.map +1 -0
- package/dist/admin/pages/EditView/components/FormInputs/Component/utils/componentCopy.mjs +389 -0
- package/dist/admin/pages/EditView/components/FormInputs/Component/utils/componentCopy.mjs.map +1 -0
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/ComponentCategory.js +84 -33
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/ComponentCategory.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/ComponentCategory.mjs +85 -34
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/ComponentCategory.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/ComponentPicker.js +5 -1
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/ComponentPicker.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/ComponentPicker.mjs +5 -1
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/ComponentPicker.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.js +17 -4
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.mjs +18 -5
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/Field.js +54 -6
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/Field.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/Field.mjs +54 -6
- package/dist/admin/pages/EditView/components/FormInputs/DynamicZone/Field.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Relations/RelationModal.js +11 -9
- package/dist/admin/pages/EditView/components/FormInputs/Relations/RelationModal.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Relations/RelationModal.mjs +12 -10
- package/dist/admin/pages/EditView/components/FormInputs/Relations/RelationModal.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Relations/Relations.js +9 -4
- package/dist/admin/pages/EditView/components/FormInputs/Relations/Relations.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormInputs/Relations/Relations.mjs +9 -4
- package/dist/admin/pages/EditView/components/FormInputs/Relations/Relations.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/FormLayout.js +66 -63
- package/dist/admin/pages/EditView/components/FormLayout.js.map +1 -1
- package/dist/admin/pages/EditView/components/FormLayout.mjs +66 -63
- package/dist/admin/pages/EditView/components/FormLayout.mjs.map +1 -1
- package/dist/admin/pages/EditView/components/InputRenderer.js +7 -1
- package/dist/admin/pages/EditView/components/InputRenderer.js.map +1 -1
- package/dist/admin/pages/EditView/components/InputRenderer.mjs +7 -1
- package/dist/admin/pages/EditView/components/InputRenderer.mjs.map +1 -1
- package/dist/admin/pages/EditView/utils/data.js +14 -9
- package/dist/admin/pages/EditView/utils/data.js.map +1 -1
- package/dist/admin/pages/EditView/utils/data.mjs +14 -9
- package/dist/admin/pages/EditView/utils/data.mjs.map +1 -1
- package/dist/admin/pages/EditView/utils/forms.js +34 -0
- package/dist/admin/pages/EditView/utils/forms.js.map +1 -1
- package/dist/admin/pages/EditView/utils/forms.mjs +34 -1
- package/dist/admin/pages/EditView/utils/forms.mjs.map +1 -1
- package/dist/admin/pages/ListConfiguration/components/DraggableCard.js +2 -1
- package/dist/admin/pages/ListConfiguration/components/DraggableCard.js.map +1 -1
- package/dist/admin/pages/ListConfiguration/components/DraggableCard.mjs +2 -1
- package/dist/admin/pages/ListConfiguration/components/DraggableCard.mjs.map +1 -1
- package/dist/admin/pages/ListConfiguration/components/EditFieldForm.js +7 -6
- package/dist/admin/pages/ListConfiguration/components/EditFieldForm.js.map +1 -1
- package/dist/admin/pages/ListConfiguration/components/EditFieldForm.mjs +7 -6
- package/dist/admin/pages/ListConfiguration/components/EditFieldForm.mjs.map +1 -1
- package/dist/admin/pages/ListView/ListViewPage.js +11 -2
- package/dist/admin/pages/ListView/ListViewPage.js.map +1 -1
- package/dist/admin/pages/ListView/ListViewPage.mjs +13 -4
- package/dist/admin/pages/ListView/ListViewPage.mjs.map +1 -1
- package/dist/admin/pages/ListView/components/Filters.js +15 -5
- package/dist/admin/pages/ListView/components/Filters.js.map +1 -1
- package/dist/admin/pages/ListView/components/Filters.mjs +16 -7
- package/dist/admin/pages/ListView/components/Filters.mjs.map +1 -1
- package/dist/admin/preview/components/InputPopover.js +18 -8
- package/dist/admin/preview/components/InputPopover.js.map +1 -1
- package/dist/admin/preview/components/InputPopover.mjs +19 -9
- package/dist/admin/preview/components/InputPopover.mjs.map +1 -1
- package/dist/admin/preview/pages/Preview.js +5 -16
- package/dist/admin/preview/pages/Preview.js.map +1 -1
- package/dist/admin/preview/pages/Preview.mjs +5 -16
- package/dist/admin/preview/pages/Preview.mjs.map +1 -1
- package/dist/admin/preview/utils/fieldUtils.js +2 -0
- package/dist/admin/preview/utils/fieldUtils.js.map +1 -1
- package/dist/admin/preview/utils/fieldUtils.mjs +2 -1
- package/dist/admin/preview/utils/fieldUtils.mjs.map +1 -1
- package/dist/admin/services/api.js +2 -1
- package/dist/admin/services/api.js.map +1 -1
- package/dist/admin/services/api.mjs +2 -1
- package/dist/admin/services/api.mjs.map +1 -1
- package/dist/admin/services/documents.js +21 -1
- package/dist/admin/services/documents.js.map +1 -1
- package/dist/admin/services/documents.mjs +21 -2
- package/dist/admin/services/documents.mjs.map +1 -1
- package/dist/admin/services/relations.js +47 -1
- package/dist/admin/services/relations.js.map +1 -1
- package/dist/admin/services/relations.mjs +47 -2
- package/dist/admin/services/relations.mjs.map +1 -1
- package/dist/admin/src/exports.d.ts +2 -0
- package/dist/admin/src/features/I18nSharedFieldsLock.d.ts +22 -0
- package/dist/admin/src/history/components/VersionInputRenderer.d.ts +7 -1
- package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
- package/dist/admin/src/hooks/useI18nFieldLock.d.ts +61 -0
- package/dist/admin/src/modules/app.d.ts +4 -1
- package/dist/admin/src/pages/EditView/components/FormInputs/Component/AddComponentMenu.d.ts +15 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/Component/ComponentCopyModal.d.ts +58 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/Component/CopiedComponents.d.ts +41 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/Component/Initializer.d.ts +7 -3
- package/dist/admin/src/pages/EditView/components/FormInputs/Component/NonRepeatable.d.ts +1 -1
- package/dist/admin/src/pages/EditView/components/FormInputs/Component/Repeatable.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Component/utils/componentCopy.d.ts +115 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/ComponentCategory.d.ts +6 -3
- package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/ComponentPicker.d.ts +2 -1
- package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.d.ts +5 -1
- package/dist/admin/src/pages/EditView/utils/forms.d.ts +13 -2
- package/dist/admin/src/pages/ListView/components/Filters.d.ts +12 -3
- package/dist/admin/src/preview/services/preview.d.ts +1 -1
- package/dist/admin/src/preview/utils/fieldUtils.d.ts +1 -0
- package/dist/admin/src/services/api.d.ts +1 -1
- package/dist/admin/src/services/components.d.ts +2 -2
- package/dist/admin/src/services/contentTypes.d.ts +3 -3
- package/dist/admin/src/services/documents.d.ts +25 -21
- package/dist/admin/src/services/homepage.d.ts +1 -1
- package/dist/admin/src/services/init.d.ts +1 -1
- package/dist/admin/src/services/relations.d.ts +5 -3
- package/dist/admin/src/services/uid.d.ts +3 -3
- package/dist/admin/translations/en.json.js +41 -0
- package/dist/admin/translations/en.json.js.map +1 -1
- package/dist/admin/translations/en.json.mjs +41 -0
- package/dist/admin/translations/en.json.mjs.map +1 -1
- package/dist/server/controllers/relations.js +4 -2
- package/dist/server/controllers/relations.js.map +1 -1
- package/dist/server/controllers/relations.mjs +4 -2
- package/dist/server/controllers/relations.mjs.map +1 -1
- package/dist/server/controllers/utils/metadata.js +3 -1
- package/dist/server/controllers/utils/metadata.js.map +1 -1
- package/dist/server/controllers/utils/metadata.mjs +3 -1
- package/dist/server/controllers/utils/metadata.mjs.map +1 -1
- package/dist/server/history/services/utils.js +3 -1
- package/dist/server/history/services/utils.js.map +1 -1
- package/dist/server/history/services/utils.mjs +3 -1
- package/dist/server/history/services/utils.mjs.map +1 -1
- package/dist/server/homepage/services/homepage-query-utils.js +14 -0
- package/dist/server/homepage/services/homepage-query-utils.js.map +1 -1
- package/dist/server/homepage/services/homepage-query-utils.mjs +14 -1
- package/dist/server/homepage/services/homepage-query-utils.mjs.map +1 -1
- package/dist/server/homepage/services/homepage.js +1 -1
- package/dist/server/homepage/services/homepage.js.map +1 -1
- package/dist/server/homepage/services/homepage.mjs +2 -2
- package/dist/server/homepage/services/homepage.mjs.map +1 -1
- package/dist/server/mcp/sanitizers/shape-relations.js +1 -3
- package/dist/server/mcp/sanitizers/shape-relations.js.map +1 -1
- package/dist/server/mcp/sanitizers/shape-relations.mjs +1 -3
- package/dist/server/mcp/sanitizers/shape-relations.mjs.map +1 -1
- package/dist/server/mcp/schemas/output-schemas.js +2 -1
- package/dist/server/mcp/schemas/output-schemas.js.map +1 -1
- package/dist/server/mcp/schemas/output-schemas.mjs +2 -1
- package/dist/server/mcp/schemas/output-schemas.mjs.map +1 -1
- package/dist/server/services/document-manager.js +3 -2
- package/dist/server/services/document-manager.js.map +1 -1
- package/dist/server/services/document-manager.mjs +3 -2
- package/dist/server/services/document-manager.mjs.map +1 -1
- package/dist/server/services/document-metadata.js +92 -4
- package/dist/server/services/document-metadata.js.map +1 -1
- package/dist/server/services/document-metadata.mjs +92 -4
- package/dist/server/services/document-metadata.mjs.map +1 -1
- package/dist/server/services/permission-checker.js +20 -8
- package/dist/server/services/permission-checker.js.map +1 -1
- package/dist/server/services/permission-checker.mjs +20 -8
- package/dist/server/services/permission-checker.mjs.map +1 -1
- package/dist/server/services/uid.js +2 -1
- package/dist/server/services/uid.js.map +1 -1
- package/dist/server/services/uid.mjs +2 -1
- package/dist/server/services/uid.mjs.map +1 -1
- package/dist/server/src/controllers/relations.d.ts.map +1 -1
- package/dist/server/src/controllers/utils/metadata.d.ts +1 -0
- package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
- package/dist/server/src/history/services/utils.d.ts.map +1 -1
- package/dist/server/src/homepage/services/homepage-query-utils.d.ts +6 -0
- package/dist/server/src/homepage/services/homepage-query-utils.d.ts.map +1 -1
- package/dist/server/src/homepage/services/homepage.d.ts.map +1 -1
- package/dist/server/src/index.d.ts +21 -7
- package/dist/server/src/index.d.ts.map +1 -1
- package/dist/server/src/mcp/sanitizers/shape-relations.d.ts.map +1 -1
- package/dist/server/src/mcp/schemas/output-schemas.d.ts.map +1 -1
- package/dist/server/src/services/document-manager.d.ts.map +1 -1
- package/dist/server/src/services/document-metadata.d.ts +5 -1
- package/dist/server/src/services/document-metadata.d.ts.map +1 -1
- package/dist/server/src/services/index.d.ts +21 -7
- package/dist/server/src/services/index.d.ts.map +1 -1
- package/dist/server/src/services/permission-checker.d.ts +6 -5
- package/dist/server/src/services/permission-checker.d.ts.map +1 -1
- package/dist/server/src/services/uid.d.ts.map +1 -1
- package/dist/shared/contracts/collection-types.d.ts +7 -0
- package/dist/shared/contracts/collection-types.d.ts.map +1 -1
- package/dist/shared/contracts/single-types.d.ts +4 -0
- package/dist/shared/contracts/single-types.d.ts.map +1 -1
- package/package.json +9 -9
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var strapiAdmin = require('@strapi/admin/strapi-admin');
|
|
6
|
+
|
|
7
|
+
function _interopNamespace(e) {
|
|
8
|
+
if (e && e.__esModule) return e;
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return e[k]; }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n.default = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* @alpha
|
|
29
|
+
* @public
|
|
30
|
+
* Reads or changes whether the editor unlocked shared fields on a secondary locale.
|
|
31
|
+
*/ const [I18nSharedFieldsLockProvider, useI18nSharedFieldsLock] = strapiAdmin.createContext('I18nSharedFieldsLock', {
|
|
32
|
+
isUnlocked: false,
|
|
33
|
+
unlock: ()=>undefined,
|
|
34
|
+
relock: ()=>undefined
|
|
35
|
+
});
|
|
36
|
+
/**
|
|
37
|
+
* Holds whether the editor accepted the warning to edit non-localized fields
|
|
38
|
+
* on a secondary locale. Always starts locked: key the provider by document
|
|
39
|
+
* and locale so a locale switch or a different entry relocks.
|
|
40
|
+
*/ const I18nSharedFieldsLock = ({ children })=>{
|
|
41
|
+
const [isUnlocked, setIsUnlocked] = React__namespace.useState(false);
|
|
42
|
+
const unlock = React__namespace.useCallback(()=>setIsUnlocked(true), []);
|
|
43
|
+
const relock = React__namespace.useCallback(()=>setIsUnlocked(false), []);
|
|
44
|
+
return /*#__PURE__*/ jsxRuntime.jsx(I18nSharedFieldsLockProvider, {
|
|
45
|
+
isUnlocked: isUnlocked,
|
|
46
|
+
unlock: unlock,
|
|
47
|
+
relock: relock,
|
|
48
|
+
children: children
|
|
49
|
+
});
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
exports.I18nSharedFieldsLock = I18nSharedFieldsLock;
|
|
53
|
+
exports.useI18nSharedFieldsLock = useI18nSharedFieldsLock;
|
|
54
|
+
//# sourceMappingURL=I18nSharedFieldsLock.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"I18nSharedFieldsLock.js","sources":["../../../admin/src/features/I18nSharedFieldsLock.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { createContext } from '@strapi/admin/strapi-admin';\n\ninterface I18nSharedFieldsLockContextValue {\n isUnlocked: boolean;\n unlock: () => void;\n relock: () => void;\n}\n\n/**\n * @alpha\n * @public\n * Reads or changes whether the editor unlocked shared fields on a secondary locale.\n */\nconst [I18nSharedFieldsLockProvider, useI18nSharedFieldsLock] =\n createContext<I18nSharedFieldsLockContextValue>('I18nSharedFieldsLock', {\n isUnlocked: false,\n unlock: () => undefined,\n relock: () => undefined,\n });\n\n/**\n * Holds whether the editor accepted the warning to edit non-localized fields\n * on a secondary locale. Always starts locked: key the provider by document\n * and locale so a locale switch or a different entry relocks.\n */\nconst I18nSharedFieldsLock = ({ children }: { children: React.ReactNode }) => {\n const [isUnlocked, setIsUnlocked] = React.useState(false);\n\n const unlock = React.useCallback(() => setIsUnlocked(true), []);\n const relock = React.useCallback(() => setIsUnlocked(false), []);\n\n return (\n <I18nSharedFieldsLockProvider isUnlocked={isUnlocked} unlock={unlock} relock={relock}>\n {children}\n </I18nSharedFieldsLockProvider>\n );\n};\n\nexport { I18nSharedFieldsLock, useI18nSharedFieldsLock };\nexport type { I18nSharedFieldsLockContextValue };\n"],"names":["I18nSharedFieldsLockProvider","useI18nSharedFieldsLock","createContext","isUnlocked","unlock","undefined","relock","I18nSharedFieldsLock","children","setIsUnlocked","React","useState","useCallback","_jsx"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAUA;;;;AAIC,UACK,CAACA,4BAAAA,EAA8BC,uBAAAA,CAAwB,GAC3DC,0BAAgD,sBAAA,EAAwB;IACtEC,UAAAA,EAAY,KAAA;AACZC,IAAAA,MAAAA,EAAQ,IAAMC,SAAAA;AACdC,IAAAA,MAAAA,EAAQ,IAAMD;AAChB,CAAA;AAEF;;;;AAIC,IACD,MAAME,oBAAAA,GAAuB,CAAC,EAAEC,QAAQ,EAAiC,GAAA;AACvE,IAAA,MAAM,CAACL,UAAAA,EAAYM,aAAAA,CAAc,GAAGC,gBAAAA,CAAMC,QAAQ,CAAC,KAAA,CAAA;AAEnD,IAAA,MAAMP,SAASM,gBAAAA,CAAME,WAAW,CAAC,IAAMH,aAAAA,CAAc,OAAO,EAAE,CAAA;AAC9D,IAAA,MAAMH,SAASI,gBAAAA,CAAME,WAAW,CAAC,IAAMH,aAAAA,CAAc,QAAQ,EAAE,CAAA;AAE/D,IAAA,qBACEI,cAAA,CAACb,4BAAAA,EAAAA;QAA6BG,UAAAA,EAAYA,UAAAA;QAAYC,MAAAA,EAAQA,MAAAA;QAAQE,MAAAA,EAAQA,MAAAA;AAC3EE,QAAAA,QAAAA,EAAAA;;AAGP;;;;;"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
import { createContext } from '@strapi/admin/strapi-admin';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @alpha
|
|
7
|
+
* @public
|
|
8
|
+
* Reads or changes whether the editor unlocked shared fields on a secondary locale.
|
|
9
|
+
*/ const [I18nSharedFieldsLockProvider, useI18nSharedFieldsLock] = createContext('I18nSharedFieldsLock', {
|
|
10
|
+
isUnlocked: false,
|
|
11
|
+
unlock: ()=>undefined,
|
|
12
|
+
relock: ()=>undefined
|
|
13
|
+
});
|
|
14
|
+
/**
|
|
15
|
+
* Holds whether the editor accepted the warning to edit non-localized fields
|
|
16
|
+
* on a secondary locale. Always starts locked: key the provider by document
|
|
17
|
+
* and locale so a locale switch or a different entry relocks.
|
|
18
|
+
*/ const I18nSharedFieldsLock = ({ children })=>{
|
|
19
|
+
const [isUnlocked, setIsUnlocked] = React.useState(false);
|
|
20
|
+
const unlock = React.useCallback(()=>setIsUnlocked(true), []);
|
|
21
|
+
const relock = React.useCallback(()=>setIsUnlocked(false), []);
|
|
22
|
+
return /*#__PURE__*/ jsx(I18nSharedFieldsLockProvider, {
|
|
23
|
+
isUnlocked: isUnlocked,
|
|
24
|
+
unlock: unlock,
|
|
25
|
+
relock: relock,
|
|
26
|
+
children: children
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export { I18nSharedFieldsLock, useI18nSharedFieldsLock };
|
|
31
|
+
//# sourceMappingURL=I18nSharedFieldsLock.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"I18nSharedFieldsLock.mjs","sources":["../../../admin/src/features/I18nSharedFieldsLock.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { createContext } from '@strapi/admin/strapi-admin';\n\ninterface I18nSharedFieldsLockContextValue {\n isUnlocked: boolean;\n unlock: () => void;\n relock: () => void;\n}\n\n/**\n * @alpha\n * @public\n * Reads or changes whether the editor unlocked shared fields on a secondary locale.\n */\nconst [I18nSharedFieldsLockProvider, useI18nSharedFieldsLock] =\n createContext<I18nSharedFieldsLockContextValue>('I18nSharedFieldsLock', {\n isUnlocked: false,\n unlock: () => undefined,\n relock: () => undefined,\n });\n\n/**\n * Holds whether the editor accepted the warning to edit non-localized fields\n * on a secondary locale. Always starts locked: key the provider by document\n * and locale so a locale switch or a different entry relocks.\n */\nconst I18nSharedFieldsLock = ({ children }: { children: React.ReactNode }) => {\n const [isUnlocked, setIsUnlocked] = React.useState(false);\n\n const unlock = React.useCallback(() => setIsUnlocked(true), []);\n const relock = React.useCallback(() => setIsUnlocked(false), []);\n\n return (\n <I18nSharedFieldsLockProvider isUnlocked={isUnlocked} unlock={unlock} relock={relock}>\n {children}\n </I18nSharedFieldsLockProvider>\n );\n};\n\nexport { I18nSharedFieldsLock, useI18nSharedFieldsLock };\nexport type { I18nSharedFieldsLockContextValue };\n"],"names":["I18nSharedFieldsLockProvider","useI18nSharedFieldsLock","createContext","isUnlocked","unlock","undefined","relock","I18nSharedFieldsLock","children","setIsUnlocked","React","useState","useCallback","_jsx"],"mappings":";;;;AAUA;;;;AAIC,UACK,CAACA,4BAAAA,EAA8BC,uBAAAA,CAAwB,GAC3DC,cAAgD,sBAAA,EAAwB;IACtEC,UAAAA,EAAY,KAAA;AACZC,IAAAA,MAAAA,EAAQ,IAAMC,SAAAA;AACdC,IAAAA,MAAAA,EAAQ,IAAMD;AAChB,CAAA;AAEF;;;;AAIC,IACD,MAAME,oBAAAA,GAAuB,CAAC,EAAEC,QAAQ,EAAiC,GAAA;AACvE,IAAA,MAAM,CAACL,UAAAA,EAAYM,aAAAA,CAAc,GAAGC,KAAAA,CAAMC,QAAQ,CAAC,KAAA,CAAA;AAEnD,IAAA,MAAMP,SAASM,KAAAA,CAAME,WAAW,CAAC,IAAMH,aAAAA,CAAc,OAAO,EAAE,CAAA;AAC9D,IAAA,MAAMH,SAASI,KAAAA,CAAME,WAAW,CAAC,IAAMH,aAAAA,CAAc,QAAQ,EAAE,CAAA;AAE/D,IAAA,qBACEI,GAAA,CAACb,4BAAAA,EAAAA;QAA6BG,UAAAA,EAAYA,UAAAA;QAAYC,MAAAA,EAAQA,MAAAA;QAAQE,MAAAA,EAAQA,MAAAA;AAC3EE,QAAAA,QAAAA,EAAAA;;AAGP;;;;"}
|
|
@@ -255,8 +255,12 @@ const CustomMediaInput = (props)=>{
|
|
|
255
255
|
if (!/*#__PURE__*/ React__namespace.isValidElement(labelAction)) {
|
|
256
256
|
return labelAction;
|
|
257
257
|
}
|
|
258
|
-
// TODO: find a better way to do this rather than access internals
|
|
259
|
-
|
|
258
|
+
// TODO: find a better way to do this rather than access internals.
|
|
259
|
+
// Shared-field lock actions can be stamped without a title; don't throw.
|
|
260
|
+
const labelActionTitleId = labelAction.props?.title?.id;
|
|
261
|
+
if (typeof labelActionTitleId !== 'string') {
|
|
262
|
+
return labelAction;
|
|
263
|
+
}
|
|
260
264
|
if (labelActionTitleId === 'i18n.Field.localized') {
|
|
261
265
|
return /*#__PURE__*/ React__namespace.cloneElement(labelAction, {
|
|
262
266
|
...labelAction.props,
|
|
@@ -530,5 +534,6 @@ const attributeHasCustomFieldProperty = (attribute)=>'customField' in attribute
|
|
|
530
534
|
|
|
531
535
|
exports.CustomRelationInput = CustomRelationInput;
|
|
532
536
|
exports.VersionInputRenderer = VersionInputRenderer;
|
|
537
|
+
exports.getLabelAction = getLabelAction;
|
|
533
538
|
exports.resolveComponentRenderResources = resolveComponentRenderResources;
|
|
534
539
|
//# sourceMappingURL=VersionInputRenderer.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VersionInputRenderer.js","sources":["../../../../admin/src/history/components/VersionInputRenderer.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport {\n useStrapiApp,\n useForm,\n InputRenderer as FormInputRenderer,\n useField,\n Form,\n} from '@strapi/admin/strapi-admin';\nimport { Alert, Box, Field, Flex, Link, Tooltip, Typography } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport { NavLink } from 'react-router-dom';\nimport { styled } from 'styled-components';\n\nimport { COLLECTION_TYPES } from '../../constants/collections';\nimport { useDocumentRBAC } from '../../features/DocumentRBAC';\nimport { useDoc } from '../../hooks/useDocument';\nimport { useDocLayout } from '../../hooks/useDocumentLayout';\nimport { useLazyComponents } from '../../hooks/useLazyComponents';\nimport { useTypedSelector } from '../../modules/hooks';\nimport { DocumentStatus } from '../../pages/EditView/components/DocumentStatus';\nimport { BlocksInput } from '../../pages/EditView/components/FormInputs/BlocksInput/BlocksInput';\nimport { ComponentInput } from '../../pages/EditView/components/FormInputs/Component/Input';\nimport {\n DynamicZone,\n useDynamicZone,\n} from '../../pages/EditView/components/FormInputs/DynamicZone/Field';\nimport { NotAllowedInput } from '../../pages/EditView/components/FormInputs/NotAllowed';\nimport { UIDInput } from '../../pages/EditView/components/FormInputs/UID';\nimport { Wysiwyg } from '../../pages/EditView/components/FormInputs/Wysiwyg/Field';\nimport { useFieldHint } from '../../pages/EditView/components/InputRenderer';\nimport { getRelationLabel } from '../../utils/relations';\nimport { useHistoryContext } from '../pages/History';\n\nimport { getRemaingFieldsLayout } from './VersionContent';\n\nimport type { EditFieldLayout } from '../../hooks/useDocumentLayout';\nimport type { RelationsFieldProps } from '../../pages/EditView/components/FormInputs/Relations/Relations';\nimport type { RelationResult } from '../../services/relations';\nimport type { Schema } from '@strapi/types';\nimport type { DistributiveOmit } from 'react-redux';\n\nconst StyledAlert = styled(Alert).attrs({ closeLabel: 'Close', onClose: () => {}, shadow: 'none' })`\n button {\n display: none;\n }\n`;\n\n/* -------------------------------------------------------------------------------------------------\n * CustomRelationInput\n * -----------------------------------------------------------------------------------------------*/\n\nconst LinkEllipsis = styled(Link)`\n display: block;\n\n & > span {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: block;\n }\n`;\n\nconst CustomRelationInput = (props: RelationsFieldProps) => {\n const { formatMessage } = useIntl();\n const emptyLabel = formatMessage({\n id: 'content-manager.containers.empty-label',\n defaultMessage: 'Untitled',\n });\n const field = useField<\n { results: RelationResult[]; meta: { missingCount: number } } | RelationResult[]\n >(props.name);\n\n /**\n * Ideally the server would return the correct shape, however, for admin user relations\n * it sanitizes everything out when it finds an object for the relation value.\n */\n let formattedFieldValue;\n if (field) {\n formattedFieldValue = Array.isArray(field.value)\n ? { results: field.value, meta: { missingCount: 0 } }\n : field.value;\n }\n\n // Be defensive about the shape: admin-user relations are sanitized to a\n // plain user object on the server, and historical version data can carry\n // shapes that pre-date the `{ results, meta }` contract. Treat anything\n // without an array `results` as \"no relations\".\n const hasResultsShape =\n !!formattedFieldValue &&\n typeof formattedFieldValue === 'object' &&\n Array.isArray((formattedFieldValue as { results?: unknown }).results);\n const missingCount =\n hasResultsShape &&\n typeof (formattedFieldValue as { meta?: { missingCount?: number } }).meta?.missingCount ===\n 'number'\n ? (formattedFieldValue as { meta: { missingCount: number } }).meta.missingCount\n : 0;\n\n if (\n !hasResultsShape ||\n ((formattedFieldValue as { results: unknown[] }).results.length === 0 && missingCount === 0)\n ) {\n return (\n <>\n <Field.Label action={props.labelAction}>{props.label}</Field.Label>\n <Box marginTop={1}>\n <StyledAlert variant=\"default\">\n {formatMessage({\n id: 'content-manager.history.content.no-relations',\n defaultMessage: 'No relations.',\n })}\n </StyledAlert>\n </Box>\n </>\n );\n }\n\n const { results, meta } = formattedFieldValue as {\n results: RelationResult[];\n meta: { missingCount: number };\n };\n\n return (\n <Box>\n <Field.Label>{props.label}</Field.Label>\n {results.length > 0 && (\n <Flex direction=\"column\" gap={2} marginTop={1} alignItems=\"stretch\">\n {results.map((relationData) => {\n // @ts-expect-error - targetModel does exist on the attribute. But it's not typed.\n const { targetModel } = props.attribute;\n const href = `../${COLLECTION_TYPES}/${targetModel}/${relationData.documentId}`;\n const label = getRelationLabel(relationData, props.mainField, emptyLabel);\n const isAdminUserRelation = targetModel === 'admin::user';\n\n return (\n <Flex\n key={relationData.documentId ?? relationData.id}\n paddingTop={2}\n paddingBottom={2}\n paddingLeft={4}\n paddingRight={4}\n hasRadius\n borderColor=\"neutral200\"\n background=\"neutral150\"\n justifyContent=\"space-between\"\n >\n <Box minWidth={0} paddingTop={1} paddingBottom={1} paddingRight={4}>\n <Tooltip label={label}>\n {isAdminUserRelation ? (\n <Typography>{label}</Typography>\n ) : (\n <LinkEllipsis tag={NavLink} to={href}>\n {label}\n </LinkEllipsis>\n )}\n </Tooltip>\n </Box>\n <DocumentStatus status={relationData.status as string} />\n </Flex>\n );\n })}\n </Flex>\n )}\n {meta.missingCount > 0 && (\n <StyledAlert\n marginTop={1}\n variant=\"warning\"\n title={formatMessage(\n {\n id: 'content-manager.history.content.missing-relations.title',\n defaultMessage:\n '{number, plural, =1 {Missing relation} other {{number} missing relations}}',\n },\n { number: meta.missingCount }\n )}\n >\n {formatMessage(\n {\n id: 'content-manager.history.content.missing-relations.message',\n defaultMessage:\n \"{number, plural, =1 {It has} other {They have}} been deleted and can't be restored.\",\n },\n { number: meta.missingCount }\n )}\n </StyledAlert>\n )}\n </Box>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * CustomMediaInput\n * -----------------------------------------------------------------------------------------------*/\n\n// Create an object with value at key path (i.e. 'a.b.c')\nconst createInitialValuesForPath = (keyPath: string, value: unknown) => {\n const keys = keyPath.split('.');\n // The root level object\n const root: Record<string, unknown> = {};\n\n // Make the first node the root\n let node = root;\n keys.forEach((key, index) => {\n // Skip prototype pollution keys\n if (key === '__proto__' || key === 'constructor') return;\n // If it's the last key, set the node value\n if (index === keys.length - 1) {\n node[key] = value;\n } else {\n // Ensure the key exists and is an object\n const nextNode =\n typeof node[key] === 'object' && node[key] !== null && Array.isArray(node[key]) === false\n ? (node[key] as Record<string, unknown>)\n : {};\n node[key] = nextNode;\n node = nextNode;\n }\n });\n\n return root;\n};\n\nconst CustomMediaInput = (props: VersionInputRendererProps) => {\n const { value } = useField<{ results: unknown[]; meta: { missingCount: number } }>(props.name);\n const results = value?.results ?? [];\n const meta = value?.meta ?? { missingCount: 0 };\n\n const { formatMessage } = useIntl();\n\n const fields = useStrapiApp('CustomMediaInput', (state) => state.fields);\n const MediaLibrary = fields.media as React.ComponentType<\n VersionInputRendererProps & { multiple: boolean }\n >;\n\n return (\n <Flex direction=\"column\" gap={2} alignItems=\"stretch\">\n <Form\n method=\"PUT\"\n disabled={true}\n initialValues={createInitialValuesForPath(props.name, results)}\n >\n <MediaLibrary {...props} disabled={true} multiple={results.length > 1} />\n </Form>\n {meta.missingCount > 0 && (\n <StyledAlert\n variant=\"warning\"\n closeLabel=\"Close\"\n onClose={() => {}}\n title={formatMessage(\n {\n id: 'content-manager.history.content.missing-assets.title',\n defaultMessage:\n '{number, plural, =1 {Missing asset} other {{number} missing assets}}',\n },\n { number: meta.missingCount }\n )}\n >\n {formatMessage(\n {\n id: 'content-manager.history.content.missing-assets.message',\n defaultMessage:\n \"{number, plural, =1 {It has} other {They have}} been deleted in the Media Library and can't be restored.\",\n },\n { number: meta.missingCount }\n )}\n </StyledAlert>\n )}\n </Flex>\n );\n};\n\ntype VersionInputRendererProps = DistributiveOmit<EditFieldLayout, 'size'> & {\n /**\n * In the context of content history, deleted fields need to ignore RBAC\n * @default false\n */\n shouldIgnoreRBAC?: boolean;\n /** Passed down by component and dynamic zone layouts; not used here. */\n size?: number;\n};\n\n/**\n * Checks if the i18n plugin added a label action to the field and modifies it\n * to adapt the wording for the history page.\n */\nconst getLabelAction = (labelAction: VersionInputRendererProps['labelAction']) => {\n if (!React.isValidElement(labelAction)) {\n return labelAction;\n }\n\n // TODO: find a better way to do this rather than access internals\n const labelActionTitleId = labelAction.props.title.id;\n\n if (labelActionTitleId === 'i18n.Field.localized') {\n return React.cloneElement(labelAction, {\n ...labelAction.props,\n title: {\n id: 'history.content.localized',\n defaultMessage:\n 'This value is specific to this locale. If you restore this version, the content will not be replaced for other locales.',\n },\n });\n }\n\n if (labelActionTitleId === 'i18n.Field.not-localized') {\n return React.cloneElement(labelAction, {\n ...labelAction.props,\n title: {\n id: 'history.content.not-localized',\n defaultMessage:\n 'This value is common to all locales. If you restore this version and save the changes, the content will be replaced for all locales.',\n },\n });\n }\n\n // Label action is unrelated to i18n, don't touch it.\n return labelAction;\n};\n\n/**\n * Resolve the layout, configuration metadata and schema attributes needed to\n * render a component field on the history page. Returns `null` when any of\n * those are missing — happens when the component schema referenced by the\n * version was deleted via the Content-Type Builder, in which case the caller\n * should render a fallback instead of crashing on the destructuring.\n */\nconst resolveComponentRenderResources = (\n componentUID: string,\n componentsLayout: { [uid: string]: { layout: unknown } | undefined },\n configurationComponents: { [uid: string]: { metadatas: unknown } | undefined },\n components: { [uid: string]: { attributes: unknown } | undefined }\n) => {\n const componentLayout = componentsLayout[componentUID];\n const componentConfiguration = configurationComponents[componentUID];\n const componentSchema = components[componentUID];\n\n if (!componentLayout || !componentConfiguration || !componentSchema) {\n return null;\n }\n\n return {\n layout: componentLayout.layout,\n metadatas: componentConfiguration.metadatas,\n schemaAttributes: componentSchema.attributes,\n };\n};\n\n/**\n * @internal\n *\n * @description An abstraction around the regular form input renderer designed specifically\n * to be used on the History page in the content-manager. It understands how to render specific\n * inputs within the context of a history version (i.e. relations, media, ignored RBAC, etc...)\n */\nconst VersionInputRenderer = ({\n visible,\n hint: providedHint,\n shouldIgnoreRBAC = false,\n labelAction,\n // Not spread with the rest: design-system inputs have a `size` prop of their own.\n size: _size,\n ...props\n}: VersionInputRendererProps) => {\n const customLabelAction = getLabelAction(labelAction);\n\n const { formatMessage } = useIntl();\n const version = useHistoryContext('VersionContent', (state) => state.selectedVersion);\n const configuration = useHistoryContext('VersionContent', (state) => state.configuration);\n const fieldSizes = useTypedSelector((state) => state['content-manager'].app.fieldSizes);\n\n const { id, components } = useDoc();\n const isFormDisabled = useForm('InputRenderer', (state) => state.disabled);\n\n const isInDynamicZone = useDynamicZone('isInDynamicZone', (state) => state.isInDynamicZone);\n\n const canCreateFields = useDocumentRBAC('InputRenderer', (rbac) => rbac.canCreateFields);\n const canReadFields = useDocumentRBAC('InputRenderer', (rbac) => rbac.canReadFields);\n const canUpdateFields = useDocumentRBAC('InputRenderer', (rbac) => rbac.canUpdateFields);\n const canUserAction = useDocumentRBAC('InputRenderer', (rbac) => rbac.canUserAction);\n\n const editableFields = id ? canUpdateFields : canCreateFields;\n const readableFields = id ? canReadFields : canCreateFields;\n /**\n * Component fields are always readable and editable,\n * however the fields within them may not be.\n */\n const canUserReadField = canUserAction(props.name, readableFields, props.type);\n const canUserEditField = canUserAction(props.name, editableFields, props.type);\n\n const fields = useStrapiApp('InputRenderer', (app) => app.fields);\n const { lazyComponentStore } = useLazyComponents(\n attributeHasCustomFieldProperty(props.attribute) ? [props.attribute.customField] : undefined\n );\n\n const hint = useFieldHint(providedHint, props.attribute);\n const {\n edit: { components: componentsLayout },\n } = useDocLayout();\n\n if (!visible) {\n return null;\n }\n\n /**\n * Don't render the field if the user can't read it.\n */\n if (!shouldIgnoreRBAC && !canUserReadField && !isInDynamicZone) {\n return <NotAllowedInput hint={hint} {...props} />;\n }\n\n const fieldIsDisabled =\n (!canUserEditField && !isInDynamicZone) || props.disabled || isFormDisabled;\n\n /**\n * Attributes found on the current content-type schema cannot be restored. We handle\n * this by displaying a warning alert to the user instead of the input for that field type.\n */\n const addedAttributes = version.meta.unknownAttributes.added;\n if (Object.keys(addedAttributes).includes(props.name)) {\n return (\n <Flex direction=\"column\" alignItems=\"flex-start\" gap={1}>\n <Field.Label>{props.label}</Field.Label>\n <StyledAlert\n width=\"100%\"\n closeLabel=\"Close\"\n onClose={() => {}}\n variant=\"warning\"\n title={formatMessage({\n id: 'content-manager.history.content.new-field.title',\n defaultMessage: 'New field',\n })}\n >\n {formatMessage({\n id: 'content-manager.history.content.new-field.message',\n defaultMessage:\n \"This field didn't exist when this version was saved. If you restore this version, it will be empty.\",\n })}\n </StyledAlert>\n </Flex>\n );\n }\n\n /**\n * Because a custom field has a unique prop but the type could be confused with either\n * the useField hook or the type of the field we need to handle it separately and first.\n */\n if (attributeHasCustomFieldProperty(props.attribute)) {\n const CustomInput = lazyComponentStore[props.attribute.customField];\n\n if (CustomInput) {\n return (\n <CustomInput\n {...props}\n // @ts-expect-error – TODO: fix this type error in the useLazyComponents hook.\n hint={hint}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n />\n );\n }\n\n return (\n <FormInputRenderer\n {...props}\n hint={hint}\n labelAction={customLabelAction}\n // @ts-expect-error – this workaround lets us display that the custom field is missing.\n type={props.attribute.customField}\n disabled={fieldIsDisabled}\n />\n );\n }\n\n /**\n * Since media fields use a custom input via the upload plugin provided by the useLibrary hook,\n * we need to handle the them before other custom inputs coming from the useLibrary hook.\n */\n if (props.type === 'media') {\n return (\n <CustomMediaInput {...props} labelAction={customLabelAction} disabled={fieldIsDisabled} />\n );\n }\n /**\n * This is where we handle ONLY the fields from the `useLibrary` hook.\n */\n const addedInputTypes = Object.keys(fields);\n if (!attributeHasCustomFieldProperty(props.attribute) && addedInputTypes.includes(props.type)) {\n const CustomInput = fields[props.type];\n return (\n <CustomInput\n {...props}\n // @ts-expect-error – TODO: fix this type error in the useLibrary hook.\n hint={hint}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n />\n );\n }\n\n /**\n * These include the content-manager specific fields, failing that we fall back\n * to the more generic form input renderer.\n */\n switch (props.type) {\n case 'blocks':\n return <BlocksInput {...props} hint={hint} type={props.type} disabled={fieldIsDisabled} />;\n case 'component': {\n const renderResources = resolveComponentRenderResources(\n props.attribute.component,\n componentsLayout,\n configuration.components,\n components\n );\n\n // The component schema referenced by this version is no longer present\n // (deleted via the Content-Type Builder). Render the label only so the\n // rest of the page still loads instead of crashing on the lookups below.\n if (!renderResources) {\n return <Field.Label>{props.label}</Field.Label>;\n }\n\n const { layout, metadatas, schemaAttributes } = renderResources as {\n layout: Array<EditFieldLayout[]>;\n metadatas: Parameters<typeof getRemaingFieldsLayout>[0]['metadatas'];\n schemaAttributes: Parameters<typeof getRemaingFieldsLayout>[0]['schemaAttributes'];\n };\n\n // Components can only have one panel, so only save the first layout item\n const [remainingFieldsLayout] = getRemaingFieldsLayout({\n layout: [layout],\n metadatas,\n fieldSizes,\n schemaAttributes,\n });\n\n return (\n <ComponentInput\n {...props}\n layout={[...layout, ...(remainingFieldsLayout || [])]}\n hint={hint}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n >\n {(inputProps) => <VersionInputRenderer {...inputProps} shouldIgnoreRBAC={true} />}\n </ComponentInput>\n );\n }\n case 'dynamiczone':\n return (\n <DynamicZone\n {...props}\n hint={hint}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n >\n {(inputProps) => <VersionInputRenderer {...inputProps} shouldIgnoreRBAC={true} />}\n </DynamicZone>\n );\n case 'relation':\n return (\n <CustomRelationInput\n {...props}\n hint={hint}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n />\n );\n case 'richtext':\n return (\n <Wysiwyg\n {...props}\n hint={hint}\n type={props.type}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n />\n );\n case 'uid':\n return (\n <UIDInput\n {...props}\n hint={hint}\n type={props.type}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n />\n );\n /**\n * Enumerations are a special case because they require options.\n */\n case 'enumeration':\n return (\n <FormInputRenderer\n {...props}\n hint={hint}\n labelAction={customLabelAction}\n options={props.attribute.enum.map((value) => ({ value }))}\n // @ts-expect-error – Temp workaround so we don't forget custom-fields don't work!\n type={props.customField ? 'custom-field' : props.type}\n disabled={fieldIsDisabled}\n />\n );\n default:\n // These props are not needed for the generic form input renderer.\n const { unique: _unique, mainField: _mainField, ...restProps } = props;\n return (\n <FormInputRenderer\n {...restProps}\n hint={hint}\n labelAction={customLabelAction}\n // @ts-expect-error – Temp workaround so we don't forget custom-fields don't work!\n type={props.customField ? 'custom-field' : props.type}\n disabled={fieldIsDisabled}\n />\n );\n }\n};\n\nconst attributeHasCustomFieldProperty = (\n attribute: Schema.Attribute.AnyAttribute\n): attribute is Schema.Attribute.AnyAttribute & Schema.Attribute.CustomField<string> =>\n 'customField' in attribute && typeof attribute.customField === 'string';\n\nexport type { VersionInputRendererProps };\nexport { VersionInputRenderer, CustomRelationInput, resolveComponentRenderResources };\n"],"names":["StyledAlert","styled","Alert","attrs","closeLabel","onClose","shadow","LinkEllipsis","Link","CustomRelationInput","props","formatMessage","useIntl","emptyLabel","id","defaultMessage","field","useField","name","formattedFieldValue","Array","isArray","value","results","meta","missingCount","hasResultsShape","length","_jsxs","_Fragment","_jsx","Field","Label","action","labelAction","label","Box","marginTop","variant","Flex","direction","gap","alignItems","map","relationData","targetModel","attribute","href","COLLECTION_TYPES","documentId","getRelationLabel","mainField","isAdminUserRelation","paddingTop","paddingBottom","paddingLeft","paddingRight","hasRadius","borderColor","background","justifyContent","minWidth","Tooltip","Typography","tag","NavLink","to","DocumentStatus","status","title","number","createInitialValuesForPath","keyPath","keys","split","root","node","forEach","key","index","nextNode","CustomMediaInput","fields","useStrapiApp","state","MediaLibrary","media","Form","method","disabled","initialValues","multiple","getLabelAction","React","isValidElement","labelActionTitleId","cloneElement","resolveComponentRenderResources","componentUID","componentsLayout","configurationComponents","components","componentLayout","componentConfiguration","componentSchema","layout","metadatas","schemaAttributes","attributes","VersionInputRenderer","visible","hint","providedHint","shouldIgnoreRBAC","size","_size","customLabelAction","version","useHistoryContext","selectedVersion","configuration","fieldSizes","useTypedSelector","app","useDoc","isFormDisabled","useForm","isInDynamicZone","useDynamicZone","canCreateFields","useDocumentRBAC","rbac","canReadFields","canUpdateFields","canUserAction","editableFields","readableFields","canUserReadField","type","canUserEditField","lazyComponentStore","useLazyComponents","attributeHasCustomFieldProperty","customField","undefined","useFieldHint","edit","useDocLayout","NotAllowedInput","fieldIsDisabled","addedAttributes","unknownAttributes","added","Object","includes","width","CustomInput","FormInputRenderer","addedInputTypes","BlocksInput","renderResources","component","remainingFieldsLayout","getRemaingFieldsLayout","ComponentInput","inputProps","DynamicZone","Wysiwyg","UIDInput","options","enum","unique","_unique","_mainField","restProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,MAAMA,WAAAA,GAAcC,uBAAAA,CAAOC,kBAAAA,CAAAA,CAAOC,KAAK,CAAC;IAAEC,UAAAA,EAAY,OAAA;AAASC,IAAAA,OAAAA,EAAS,IAAA,CAAO,CAAA;IAAGC,MAAAA,EAAQ;AAAO,CAAA,CAAE;;;;AAInG,CAAC;AAED;;AAEkG,qGAElG,MAAMC,YAAAA,GAAeN,uBAAAA,CAAOO,iBAAAA,CAAK;;;;;;;;;AASjC,CAAC;AAED,MAAMC,sBAAsB,CAACC,KAAAA,GAAAA;IAC3B,MAAM,EAAEC,aAAa,EAAE,GAAGC,iBAAAA,EAAAA;AAC1B,IAAA,MAAMC,aAAaF,aAAAA,CAAc;QAC/BG,EAAAA,EAAI,wCAAA;QACJC,cAAAA,EAAgB;AAClB,KAAA,CAAA;IACA,MAAMC,KAAAA,GAAQC,oBAAAA,CAEZP,KAAAA,CAAMQ,IAAI,CAAA;AAEZ;;;AAGC,MACD,IAAIC,mBAAAA;AACJ,IAAA,IAAIH,KAAAA,EAAO;AACTG,QAAAA,mBAAAA,GAAsBC,KAAAA,CAAMC,OAAO,CAACL,KAAAA,CAAMM,KAAK,CAAA,GAC3C;AAAEC,YAAAA,OAAAA,EAASP,MAAMM,KAAK;YAAEE,IAAAA,EAAM;gBAAEC,YAAAA,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BAAAA,EAAAA;AACE,gBAAA,GAAGnJ,KAAK;gBACTqG,IAAAA,EAAMA,IAAAA;gBACN7E,WAAAA,EAAakF,iBAAAA;gBACbqD,OAAAA,EAAS/J,KAAAA,CAAMoC,SAAS,CAAC4H,IAAI,CAAC/H,GAAG,CAAC,CAACrB,KAAAA,IAAW;AAAEA,wBAAAA;qBAAM,CAAA,CAAA;;AAEtDoH,gBAAAA,IAAAA,EAAMhI,KAAAA,CAAMqI,WAAW,GAAG,cAAA,GAAiBrI,MAAMgI,IAAI;gBACrDjD,QAAAA,EAAU4D;;AAGhB,QAAA;;YAEE,MAAM,EAAEsB,QAAQC,OAAO,EAAEzH,WAAW0H,UAAU,EAAE,GAAGC,SAAAA,EAAW,GAAGpK,KAAAA;AACjE,YAAA,qBACEoB,cAAA,CAAC+H,yBAAAA,EAAAA;AACE,gBAAA,GAAGiB,SAAS;gBACb/D,IAAAA,EAAMA,IAAAA;gBACN7E,WAAAA,EAAakF,iBAAAA;;AAEbsB,gBAAAA,IAAAA,EAAMhI,KAAAA,CAAMqI,WAAW,GAAG,cAAA,GAAiBrI,MAAMgI,IAAI;gBACrDjD,QAAAA,EAAU4D;;AAGlB;AACF;AAEA,MAAMP,+BAAAA,GAAkC,CACtChG,SAAAA,GAEA,aAAA,IAAiBA,aAAa,OAAOA,SAAAA,CAAUiG,WAAW,KAAK,QAAA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"VersionInputRenderer.js","sources":["../../../../admin/src/history/components/VersionInputRenderer.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport {\n useStrapiApp,\n useForm,\n InputRenderer as FormInputRenderer,\n useField,\n Form,\n} from '@strapi/admin/strapi-admin';\nimport { Alert, Box, Field, Flex, Link, Tooltip, Typography } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport { NavLink } from 'react-router-dom';\nimport { styled } from 'styled-components';\n\nimport { COLLECTION_TYPES } from '../../constants/collections';\nimport { useDocumentRBAC } from '../../features/DocumentRBAC';\nimport { useDoc } from '../../hooks/useDocument';\nimport { useDocLayout } from '../../hooks/useDocumentLayout';\nimport { useLazyComponents } from '../../hooks/useLazyComponents';\nimport { useTypedSelector } from '../../modules/hooks';\nimport { DocumentStatus } from '../../pages/EditView/components/DocumentStatus';\nimport { BlocksInput } from '../../pages/EditView/components/FormInputs/BlocksInput/BlocksInput';\nimport { ComponentInput } from '../../pages/EditView/components/FormInputs/Component/Input';\nimport {\n DynamicZone,\n useDynamicZone,\n} from '../../pages/EditView/components/FormInputs/DynamicZone/Field';\nimport { NotAllowedInput } from '../../pages/EditView/components/FormInputs/NotAllowed';\nimport { UIDInput } from '../../pages/EditView/components/FormInputs/UID';\nimport { Wysiwyg } from '../../pages/EditView/components/FormInputs/Wysiwyg/Field';\nimport { useFieldHint } from '../../pages/EditView/components/InputRenderer';\nimport { getRelationLabel } from '../../utils/relations';\nimport { useHistoryContext } from '../pages/History';\n\nimport { getRemaingFieldsLayout } from './VersionContent';\n\nimport type { EditFieldLayout } from '../../hooks/useDocumentLayout';\nimport type { RelationsFieldProps } from '../../pages/EditView/components/FormInputs/Relations/Relations';\nimport type { RelationResult } from '../../services/relations';\nimport type { Schema } from '@strapi/types';\nimport type { DistributiveOmit } from 'react-redux';\n\nconst StyledAlert = styled(Alert).attrs({ closeLabel: 'Close', onClose: () => {}, shadow: 'none' })`\n button {\n display: none;\n }\n`;\n\n/* -------------------------------------------------------------------------------------------------\n * CustomRelationInput\n * -----------------------------------------------------------------------------------------------*/\n\nconst LinkEllipsis = styled(Link)`\n display: block;\n\n & > span {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: block;\n }\n`;\n\nconst CustomRelationInput = (props: RelationsFieldProps) => {\n const { formatMessage } = useIntl();\n const emptyLabel = formatMessage({\n id: 'content-manager.containers.empty-label',\n defaultMessage: 'Untitled',\n });\n const field = useField<\n { results: RelationResult[]; meta: { missingCount: number } } | RelationResult[]\n >(props.name);\n\n /**\n * Ideally the server would return the correct shape, however, for admin user relations\n * it sanitizes everything out when it finds an object for the relation value.\n */\n let formattedFieldValue;\n if (field) {\n formattedFieldValue = Array.isArray(field.value)\n ? { results: field.value, meta: { missingCount: 0 } }\n : field.value;\n }\n\n // Be defensive about the shape: admin-user relations are sanitized to a\n // plain user object on the server, and historical version data can carry\n // shapes that pre-date the `{ results, meta }` contract. Treat anything\n // without an array `results` as \"no relations\".\n const hasResultsShape =\n !!formattedFieldValue &&\n typeof formattedFieldValue === 'object' &&\n Array.isArray((formattedFieldValue as { results?: unknown }).results);\n const missingCount =\n hasResultsShape &&\n typeof (formattedFieldValue as { meta?: { missingCount?: number } }).meta?.missingCount ===\n 'number'\n ? (formattedFieldValue as { meta: { missingCount: number } }).meta.missingCount\n : 0;\n\n if (\n !hasResultsShape ||\n ((formattedFieldValue as { results: unknown[] }).results.length === 0 && missingCount === 0)\n ) {\n return (\n <>\n <Field.Label action={props.labelAction}>{props.label}</Field.Label>\n <Box marginTop={1}>\n <StyledAlert variant=\"default\">\n {formatMessage({\n id: 'content-manager.history.content.no-relations',\n defaultMessage: 'No relations.',\n })}\n </StyledAlert>\n </Box>\n </>\n );\n }\n\n const { results, meta } = formattedFieldValue as {\n results: RelationResult[];\n meta: { missingCount: number };\n };\n\n return (\n <Box>\n <Field.Label>{props.label}</Field.Label>\n {results.length > 0 && (\n <Flex direction=\"column\" gap={2} marginTop={1} alignItems=\"stretch\">\n {results.map((relationData) => {\n // @ts-expect-error - targetModel does exist on the attribute. But it's not typed.\n const { targetModel } = props.attribute;\n const href = `../${COLLECTION_TYPES}/${targetModel}/${relationData.documentId}`;\n const label = getRelationLabel(relationData, props.mainField, emptyLabel);\n const isAdminUserRelation = targetModel === 'admin::user';\n\n return (\n <Flex\n key={relationData.documentId ?? relationData.id}\n paddingTop={2}\n paddingBottom={2}\n paddingLeft={4}\n paddingRight={4}\n hasRadius\n borderColor=\"neutral200\"\n background=\"neutral150\"\n justifyContent=\"space-between\"\n >\n <Box minWidth={0} paddingTop={1} paddingBottom={1} paddingRight={4}>\n <Tooltip label={label}>\n {isAdminUserRelation ? (\n <Typography>{label}</Typography>\n ) : (\n <LinkEllipsis tag={NavLink} to={href}>\n {label}\n </LinkEllipsis>\n )}\n </Tooltip>\n </Box>\n <DocumentStatus status={relationData.status as string} />\n </Flex>\n );\n })}\n </Flex>\n )}\n {meta.missingCount > 0 && (\n <StyledAlert\n marginTop={1}\n variant=\"warning\"\n title={formatMessage(\n {\n id: 'content-manager.history.content.missing-relations.title',\n defaultMessage:\n '{number, plural, =1 {Missing relation} other {{number} missing relations}}',\n },\n { number: meta.missingCount }\n )}\n >\n {formatMessage(\n {\n id: 'content-manager.history.content.missing-relations.message',\n defaultMessage:\n \"{number, plural, =1 {It has} other {They have}} been deleted and can't be restored.\",\n },\n { number: meta.missingCount }\n )}\n </StyledAlert>\n )}\n </Box>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * CustomMediaInput\n * -----------------------------------------------------------------------------------------------*/\n\n// Create an object with value at key path (i.e. 'a.b.c')\nconst createInitialValuesForPath = (keyPath: string, value: unknown) => {\n const keys = keyPath.split('.');\n // The root level object\n const root: Record<string, unknown> = {};\n\n // Make the first node the root\n let node = root;\n keys.forEach((key, index) => {\n // Skip prototype pollution keys\n if (key === '__proto__' || key === 'constructor') return;\n // If it's the last key, set the node value\n if (index === keys.length - 1) {\n node[key] = value;\n } else {\n // Ensure the key exists and is an object\n const nextNode =\n typeof node[key] === 'object' && node[key] !== null && Array.isArray(node[key]) === false\n ? (node[key] as Record<string, unknown>)\n : {};\n node[key] = nextNode;\n node = nextNode;\n }\n });\n\n return root;\n};\n\nconst CustomMediaInput = (props: VersionInputRendererProps) => {\n const { value } = useField<{ results: unknown[]; meta: { missingCount: number } }>(props.name);\n const results = value?.results ?? [];\n const meta = value?.meta ?? { missingCount: 0 };\n\n const { formatMessage } = useIntl();\n\n const fields = useStrapiApp('CustomMediaInput', (state) => state.fields);\n const MediaLibrary = fields.media as React.ComponentType<\n VersionInputRendererProps & { multiple: boolean }\n >;\n\n return (\n <Flex direction=\"column\" gap={2} alignItems=\"stretch\">\n <Form\n method=\"PUT\"\n disabled={true}\n initialValues={createInitialValuesForPath(props.name, results)}\n >\n <MediaLibrary {...props} disabled={true} multiple={results.length > 1} />\n </Form>\n {meta.missingCount > 0 && (\n <StyledAlert\n variant=\"warning\"\n closeLabel=\"Close\"\n onClose={() => {}}\n title={formatMessage(\n {\n id: 'content-manager.history.content.missing-assets.title',\n defaultMessage:\n '{number, plural, =1 {Missing asset} other {{number} missing assets}}',\n },\n { number: meta.missingCount }\n )}\n >\n {formatMessage(\n {\n id: 'content-manager.history.content.missing-assets.message',\n defaultMessage:\n \"{number, plural, =1 {It has} other {They have}} been deleted in the Media Library and can't be restored.\",\n },\n { number: meta.missingCount }\n )}\n </StyledAlert>\n )}\n </Flex>\n );\n};\n\ntype VersionInputRendererProps = DistributiveOmit<EditFieldLayout, 'size'> & {\n /**\n * In the context of content history, deleted fields need to ignore RBAC\n * @default false\n */\n shouldIgnoreRBAC?: boolean;\n /** Passed down by component and dynamic zone layouts; not used here. */\n size?: number;\n};\n\n/**\n * Checks if the i18n plugin added a label action to the field and modifies it\n * to adapt the wording for the history page.\n */\nconst getLabelAction = (labelAction: VersionInputRendererProps['labelAction']) => {\n if (!React.isValidElement(labelAction)) {\n return labelAction;\n }\n\n // TODO: find a better way to do this rather than access internals.\n // Shared-field lock actions can be stamped without a title; don't throw.\n const labelActionTitleId = labelAction.props?.title?.id;\n if (typeof labelActionTitleId !== 'string') {\n return labelAction;\n }\n\n if (labelActionTitleId === 'i18n.Field.localized') {\n return React.cloneElement(labelAction, {\n ...labelAction.props,\n title: {\n id: 'history.content.localized',\n defaultMessage:\n 'This value is specific to this locale. If you restore this version, the content will not be replaced for other locales.',\n },\n });\n }\n\n if (labelActionTitleId === 'i18n.Field.not-localized') {\n return React.cloneElement(labelAction, {\n ...labelAction.props,\n title: {\n id: 'history.content.not-localized',\n defaultMessage:\n 'This value is common to all locales. If you restore this version and save the changes, the content will be replaced for all locales.',\n },\n });\n }\n\n // Label action is unrelated to i18n, don't touch it.\n return labelAction;\n};\n\n/**\n * Resolve the layout, configuration metadata and schema attributes needed to\n * render a component field on the history page. Returns `null` when any of\n * those are missing — happens when the component schema referenced by the\n * version was deleted via the Content-Type Builder, in which case the caller\n * should render a fallback instead of crashing on the destructuring.\n */\nconst resolveComponentRenderResources = (\n componentUID: string,\n componentsLayout: { [uid: string]: { layout: unknown } | undefined },\n configurationComponents: { [uid: string]: { metadatas: unknown } | undefined },\n components: { [uid: string]: { attributes: unknown } | undefined }\n) => {\n const componentLayout = componentsLayout[componentUID];\n const componentConfiguration = configurationComponents[componentUID];\n const componentSchema = components[componentUID];\n\n if (!componentLayout || !componentConfiguration || !componentSchema) {\n return null;\n }\n\n return {\n layout: componentLayout.layout,\n metadatas: componentConfiguration.metadatas,\n schemaAttributes: componentSchema.attributes,\n };\n};\n\n/**\n * @internal\n *\n * @description An abstraction around the regular form input renderer designed specifically\n * to be used on the History page in the content-manager. It understands how to render specific\n * inputs within the context of a history version (i.e. relations, media, ignored RBAC, etc...)\n */\nconst VersionInputRenderer = ({\n visible,\n hint: providedHint,\n shouldIgnoreRBAC = false,\n labelAction,\n // Not spread with the rest: design-system inputs have a `size` prop of their own.\n size: _size,\n ...props\n}: VersionInputRendererProps) => {\n const customLabelAction = getLabelAction(labelAction);\n\n const { formatMessage } = useIntl();\n const version = useHistoryContext('VersionContent', (state) => state.selectedVersion);\n const configuration = useHistoryContext('VersionContent', (state) => state.configuration);\n const fieldSizes = useTypedSelector((state) => state['content-manager'].app.fieldSizes);\n\n const { id, components } = useDoc();\n const isFormDisabled = useForm('InputRenderer', (state) => state.disabled);\n\n const isInDynamicZone = useDynamicZone('isInDynamicZone', (state) => state.isInDynamicZone);\n\n const canCreateFields = useDocumentRBAC('InputRenderer', (rbac) => rbac.canCreateFields);\n const canReadFields = useDocumentRBAC('InputRenderer', (rbac) => rbac.canReadFields);\n const canUpdateFields = useDocumentRBAC('InputRenderer', (rbac) => rbac.canUpdateFields);\n const canUserAction = useDocumentRBAC('InputRenderer', (rbac) => rbac.canUserAction);\n\n const editableFields = id ? canUpdateFields : canCreateFields;\n const readableFields = id ? canReadFields : canCreateFields;\n /**\n * Component fields are always readable and editable,\n * however the fields within them may not be.\n */\n const canUserReadField = canUserAction(props.name, readableFields, props.type);\n const canUserEditField = canUserAction(props.name, editableFields, props.type);\n\n const fields = useStrapiApp('InputRenderer', (app) => app.fields);\n const { lazyComponentStore } = useLazyComponents(\n attributeHasCustomFieldProperty(props.attribute) ? [props.attribute.customField] : undefined\n );\n\n const hint = useFieldHint(providedHint, props.attribute);\n const {\n edit: { components: componentsLayout },\n } = useDocLayout();\n\n if (!visible) {\n return null;\n }\n\n /**\n * Don't render the field if the user can't read it.\n */\n if (!shouldIgnoreRBAC && !canUserReadField && !isInDynamicZone) {\n return <NotAllowedInput hint={hint} {...props} />;\n }\n\n const fieldIsDisabled =\n (!canUserEditField && !isInDynamicZone) || props.disabled || isFormDisabled;\n\n /**\n * Attributes found on the current content-type schema cannot be restored. We handle\n * this by displaying a warning alert to the user instead of the input for that field type.\n */\n const addedAttributes = version.meta.unknownAttributes.added;\n if (Object.keys(addedAttributes).includes(props.name)) {\n return (\n <Flex direction=\"column\" alignItems=\"flex-start\" gap={1}>\n <Field.Label>{props.label}</Field.Label>\n <StyledAlert\n width=\"100%\"\n closeLabel=\"Close\"\n onClose={() => {}}\n variant=\"warning\"\n title={formatMessage({\n id: 'content-manager.history.content.new-field.title',\n defaultMessage: 'New field',\n })}\n >\n {formatMessage({\n id: 'content-manager.history.content.new-field.message',\n defaultMessage:\n \"This field didn't exist when this version was saved. If you restore this version, it will be empty.\",\n })}\n </StyledAlert>\n </Flex>\n );\n }\n\n /**\n * Because a custom field has a unique prop but the type could be confused with either\n * the useField hook or the type of the field we need to handle it separately and first.\n */\n if (attributeHasCustomFieldProperty(props.attribute)) {\n const CustomInput = lazyComponentStore[props.attribute.customField];\n\n if (CustomInput) {\n return (\n <CustomInput\n {...props}\n // @ts-expect-error – TODO: fix this type error in the useLazyComponents hook.\n hint={hint}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n />\n );\n }\n\n return (\n <FormInputRenderer\n {...props}\n hint={hint}\n labelAction={customLabelAction}\n // @ts-expect-error – this workaround lets us display that the custom field is missing.\n type={props.attribute.customField}\n disabled={fieldIsDisabled}\n />\n );\n }\n\n /**\n * Since media fields use a custom input via the upload plugin provided by the useLibrary hook,\n * we need to handle the them before other custom inputs coming from the useLibrary hook.\n */\n if (props.type === 'media') {\n return (\n <CustomMediaInput {...props} labelAction={customLabelAction} disabled={fieldIsDisabled} />\n );\n }\n /**\n * This is where we handle ONLY the fields from the `useLibrary` hook.\n */\n const addedInputTypes = Object.keys(fields);\n if (!attributeHasCustomFieldProperty(props.attribute) && addedInputTypes.includes(props.type)) {\n const CustomInput = fields[props.type];\n return (\n <CustomInput\n {...props}\n // @ts-expect-error – TODO: fix this type error in the useLibrary hook.\n hint={hint}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n />\n );\n }\n\n /**\n * These include the content-manager specific fields, failing that we fall back\n * to the more generic form input renderer.\n */\n switch (props.type) {\n case 'blocks':\n return <BlocksInput {...props} hint={hint} type={props.type} disabled={fieldIsDisabled} />;\n case 'component': {\n const renderResources = resolveComponentRenderResources(\n props.attribute.component,\n componentsLayout,\n configuration.components,\n components\n );\n\n // The component schema referenced by this version is no longer present\n // (deleted via the Content-Type Builder). Render the label only so the\n // rest of the page still loads instead of crashing on the lookups below.\n if (!renderResources) {\n return <Field.Label>{props.label}</Field.Label>;\n }\n\n const { layout, metadatas, schemaAttributes } = renderResources as {\n layout: Array<EditFieldLayout[]>;\n metadatas: Parameters<typeof getRemaingFieldsLayout>[0]['metadatas'];\n schemaAttributes: Parameters<typeof getRemaingFieldsLayout>[0]['schemaAttributes'];\n };\n\n // Components can only have one panel, so only save the first layout item\n const [remainingFieldsLayout] = getRemaingFieldsLayout({\n layout: [layout],\n metadatas,\n fieldSizes,\n schemaAttributes,\n });\n\n return (\n <ComponentInput\n {...props}\n layout={[...layout, ...(remainingFieldsLayout || [])]}\n hint={hint}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n >\n {(inputProps) => <VersionInputRenderer {...inputProps} shouldIgnoreRBAC={true} />}\n </ComponentInput>\n );\n }\n case 'dynamiczone':\n return (\n <DynamicZone\n {...props}\n hint={hint}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n >\n {(inputProps) => <VersionInputRenderer {...inputProps} shouldIgnoreRBAC={true} />}\n </DynamicZone>\n );\n case 'relation':\n return (\n <CustomRelationInput\n {...props}\n hint={hint}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n />\n );\n case 'richtext':\n return (\n <Wysiwyg\n {...props}\n hint={hint}\n type={props.type}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n />\n );\n case 'uid':\n return (\n <UIDInput\n {...props}\n hint={hint}\n type={props.type}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n />\n );\n /**\n * Enumerations are a special case because they require options.\n */\n case 'enumeration':\n return (\n <FormInputRenderer\n {...props}\n hint={hint}\n labelAction={customLabelAction}\n options={props.attribute.enum.map((value) => ({ value }))}\n // @ts-expect-error – Temp workaround so we don't forget custom-fields don't work!\n type={props.customField ? 'custom-field' : props.type}\n disabled={fieldIsDisabled}\n />\n );\n default:\n // These props are not needed for the generic form input renderer.\n const { unique: _unique, mainField: _mainField, ...restProps } = props;\n return (\n <FormInputRenderer\n {...restProps}\n hint={hint}\n labelAction={customLabelAction}\n // @ts-expect-error – Temp workaround so we don't forget custom-fields don't work!\n type={props.customField ? 'custom-field' : props.type}\n disabled={fieldIsDisabled}\n />\n );\n }\n};\n\nconst attributeHasCustomFieldProperty = (\n attribute: Schema.Attribute.AnyAttribute\n): attribute is Schema.Attribute.AnyAttribute & Schema.Attribute.CustomField<string> =>\n 'customField' in attribute && typeof attribute.customField === 'string';\n\nexport type { VersionInputRendererProps };\nexport {\n VersionInputRenderer,\n CustomRelationInput,\n getLabelAction,\n resolveComponentRenderResources,\n};\n"],"names":["StyledAlert","styled","Alert","attrs","closeLabel","onClose","shadow","LinkEllipsis","Link","CustomRelationInput","props","formatMessage","useIntl","emptyLabel","id","defaultMessage","field","useField","name","formattedFieldValue","Array","isArray","value","results","meta","missingCount","hasResultsShape","length","_jsxs","_Fragment","_jsx","Field","Label","action","labelAction","label","Box","marginTop","variant","Flex","direction","gap","alignItems","map","relationData","targetModel","attribute","href","COLLECTION_TYPES","documentId","getRelationLabel","mainField","isAdminUserRelation","paddingTop","paddingBottom","paddingLeft","paddingRight","hasRadius","borderColor","background","justifyContent","minWidth","Tooltip","Typography","tag","NavLink","to","DocumentStatus","status","title","number","createInitialValuesForPath","keyPath","keys","split","root","node","forEach","key","index","nextNode","CustomMediaInput","fields","useStrapiApp","state","MediaLibrary","media","Form","method","disabled","initialValues","multiple","getLabelAction","React","isValidElement","labelActionTitleId","cloneElement","resolveComponentRenderResources","componentUID","componentsLayout","configurationComponents","components","componentLayout","componentConfiguration","componentSchema","layout","metadatas","schemaAttributes","attributes","VersionInputRenderer","visible","hint","providedHint","shouldIgnoreRBAC","size","_size","customLabelAction","version","useHistoryContext","selectedVersion","configuration","fieldSizes","useTypedSelector","app","useDoc","isFormDisabled","useForm","isInDynamicZone","useDynamicZone","canCreateFields","useDocumentRBAC","rbac","canReadFields","canUpdateFields","canUserAction","editableFields","readableFields","canUserReadField","type","canUserEditField","lazyComponentStore","useLazyComponents","attributeHasCustomFieldProperty","customField","undefined","useFieldHint","edit","useDocLayout","NotAllowedInput","fieldIsDisabled","addedAttributes","unknownAttributes","added","Object","includes","width","CustomInput","FormInputRenderer","addedInputTypes","BlocksInput","renderResources","component","remainingFieldsLayout","getRemaingFieldsLayout","ComponentInput","inputProps","DynamicZone","Wysiwyg","UIDInput","options","enum","unique","_unique","_mainField","restProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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MgI,IAAI;gBACrDjD,QAAAA,EAAU4D;;AAGhB,QAAA;;YAEE,MAAM,EAAEsB,QAAQC,OAAO,EAAEzH,WAAW0H,UAAU,EAAE,GAAGC,SAAAA,EAAW,GAAGpK,KAAAA;AACjE,YAAA,qBACEoB,cAAA,CAAC+H,yBAAAA,EAAAA;AACE,gBAAA,GAAGiB,SAAS;gBACb/D,IAAAA,EAAMA,IAAAA;gBACN7E,WAAAA,EAAakF,iBAAAA;;AAEbsB,gBAAAA,IAAAA,EAAMhI,KAAAA,CAAMqI,WAAW,GAAG,cAAA,GAAiBrI,MAAMgI,IAAI;gBACrDjD,QAAAA,EAAU4D;;AAGlB;AACF;AAEA,MAAMP,+BAAAA,GAAkC,CACtChG,SAAAA,GAEA,aAAA,IAAiBA,aAAa,OAAOA,SAAAA,CAAUiG,WAAW,KAAK,QAAA;;;;;;;"}
|
|
@@ -233,8 +233,12 @@ const CustomMediaInput = (props)=>{
|
|
|
233
233
|
if (!/*#__PURE__*/ React.isValidElement(labelAction)) {
|
|
234
234
|
return labelAction;
|
|
235
235
|
}
|
|
236
|
-
// TODO: find a better way to do this rather than access internals
|
|
237
|
-
|
|
236
|
+
// TODO: find a better way to do this rather than access internals.
|
|
237
|
+
// Shared-field lock actions can be stamped without a title; don't throw.
|
|
238
|
+
const labelActionTitleId = labelAction.props?.title?.id;
|
|
239
|
+
if (typeof labelActionTitleId !== 'string') {
|
|
240
|
+
return labelAction;
|
|
241
|
+
}
|
|
238
242
|
if (labelActionTitleId === 'i18n.Field.localized') {
|
|
239
243
|
return /*#__PURE__*/ React.cloneElement(labelAction, {
|
|
240
244
|
...labelAction.props,
|
|
@@ -506,5 +510,5 @@ size: _size, ...props })=>{
|
|
|
506
510
|
};
|
|
507
511
|
const attributeHasCustomFieldProperty = (attribute)=>'customField' in attribute && typeof attribute.customField === 'string';
|
|
508
512
|
|
|
509
|
-
export { CustomRelationInput, VersionInputRenderer, resolveComponentRenderResources };
|
|
513
|
+
export { CustomRelationInput, VersionInputRenderer, getLabelAction, resolveComponentRenderResources };
|
|
510
514
|
//# sourceMappingURL=VersionInputRenderer.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VersionInputRenderer.mjs","sources":["../../../../admin/src/history/components/VersionInputRenderer.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport {\n useStrapiApp,\n useForm,\n InputRenderer as FormInputRenderer,\n useField,\n Form,\n} from '@strapi/admin/strapi-admin';\nimport { Alert, Box, Field, Flex, Link, Tooltip, Typography } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport { NavLink } from 'react-router-dom';\nimport { styled } from 'styled-components';\n\nimport { COLLECTION_TYPES } from '../../constants/collections';\nimport { useDocumentRBAC } from '../../features/DocumentRBAC';\nimport { useDoc } from '../../hooks/useDocument';\nimport { useDocLayout } from '../../hooks/useDocumentLayout';\nimport { useLazyComponents } from '../../hooks/useLazyComponents';\nimport { useTypedSelector } from '../../modules/hooks';\nimport { DocumentStatus } from '../../pages/EditView/components/DocumentStatus';\nimport { BlocksInput } from '../../pages/EditView/components/FormInputs/BlocksInput/BlocksInput';\nimport { ComponentInput } from '../../pages/EditView/components/FormInputs/Component/Input';\nimport {\n DynamicZone,\n useDynamicZone,\n} from '../../pages/EditView/components/FormInputs/DynamicZone/Field';\nimport { NotAllowedInput } from '../../pages/EditView/components/FormInputs/NotAllowed';\nimport { UIDInput } from '../../pages/EditView/components/FormInputs/UID';\nimport { Wysiwyg } from '../../pages/EditView/components/FormInputs/Wysiwyg/Field';\nimport { useFieldHint } from '../../pages/EditView/components/InputRenderer';\nimport { getRelationLabel } from '../../utils/relations';\nimport { useHistoryContext } from '../pages/History';\n\nimport { getRemaingFieldsLayout } from './VersionContent';\n\nimport type { EditFieldLayout } from '../../hooks/useDocumentLayout';\nimport type { RelationsFieldProps } from '../../pages/EditView/components/FormInputs/Relations/Relations';\nimport type { RelationResult } from '../../services/relations';\nimport type { Schema } from '@strapi/types';\nimport type { DistributiveOmit } from 'react-redux';\n\nconst StyledAlert = styled(Alert).attrs({ closeLabel: 'Close', onClose: () => {}, shadow: 'none' })`\n button {\n display: none;\n }\n`;\n\n/* -------------------------------------------------------------------------------------------------\n * CustomRelationInput\n * -----------------------------------------------------------------------------------------------*/\n\nconst LinkEllipsis = styled(Link)`\n display: block;\n\n & > span {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: block;\n }\n`;\n\nconst CustomRelationInput = (props: RelationsFieldProps) => {\n const { formatMessage } = useIntl();\n const emptyLabel = formatMessage({\n id: 'content-manager.containers.empty-label',\n defaultMessage: 'Untitled',\n });\n const field = useField<\n { results: RelationResult[]; meta: { missingCount: number } } | RelationResult[]\n >(props.name);\n\n /**\n * Ideally the server would return the correct shape, however, for admin user relations\n * it sanitizes everything out when it finds an object for the relation value.\n */\n let formattedFieldValue;\n if (field) {\n formattedFieldValue = Array.isArray(field.value)\n ? { results: field.value, meta: { missingCount: 0 } }\n : field.value;\n }\n\n // Be defensive about the shape: admin-user relations are sanitized to a\n // plain user object on the server, and historical version data can carry\n // shapes that pre-date the `{ results, meta }` contract. Treat anything\n // without an array `results` as \"no relations\".\n const hasResultsShape =\n !!formattedFieldValue &&\n typeof formattedFieldValue === 'object' &&\n Array.isArray((formattedFieldValue as { results?: unknown }).results);\n const missingCount =\n hasResultsShape &&\n typeof (formattedFieldValue as { meta?: { missingCount?: number } }).meta?.missingCount ===\n 'number'\n ? (formattedFieldValue as { meta: { missingCount: number } }).meta.missingCount\n : 0;\n\n if (\n !hasResultsShape ||\n ((formattedFieldValue as { results: unknown[] }).results.length === 0 && missingCount === 0)\n ) {\n return (\n <>\n <Field.Label action={props.labelAction}>{props.label}</Field.Label>\n <Box marginTop={1}>\n <StyledAlert variant=\"default\">\n {formatMessage({\n id: 'content-manager.history.content.no-relations',\n defaultMessage: 'No relations.',\n })}\n </StyledAlert>\n </Box>\n </>\n );\n }\n\n const { results, meta } = formattedFieldValue as {\n results: RelationResult[];\n meta: { missingCount: number };\n };\n\n return (\n <Box>\n <Field.Label>{props.label}</Field.Label>\n {results.length > 0 && (\n <Flex direction=\"column\" gap={2} marginTop={1} alignItems=\"stretch\">\n {results.map((relationData) => {\n // @ts-expect-error - targetModel does exist on the attribute. But it's not typed.\n const { targetModel } = props.attribute;\n const href = `../${COLLECTION_TYPES}/${targetModel}/${relationData.documentId}`;\n const label = getRelationLabel(relationData, props.mainField, emptyLabel);\n const isAdminUserRelation = targetModel === 'admin::user';\n\n return (\n <Flex\n key={relationData.documentId ?? relationData.id}\n paddingTop={2}\n paddingBottom={2}\n paddingLeft={4}\n paddingRight={4}\n hasRadius\n borderColor=\"neutral200\"\n background=\"neutral150\"\n justifyContent=\"space-between\"\n >\n <Box minWidth={0} paddingTop={1} paddingBottom={1} paddingRight={4}>\n <Tooltip label={label}>\n {isAdminUserRelation ? (\n <Typography>{label}</Typography>\n ) : (\n <LinkEllipsis tag={NavLink} to={href}>\n {label}\n </LinkEllipsis>\n )}\n </Tooltip>\n </Box>\n <DocumentStatus status={relationData.status as string} />\n </Flex>\n );\n })}\n </Flex>\n )}\n {meta.missingCount > 0 && (\n <StyledAlert\n marginTop={1}\n variant=\"warning\"\n title={formatMessage(\n {\n id: 'content-manager.history.content.missing-relations.title',\n defaultMessage:\n '{number, plural, =1 {Missing relation} other {{number} missing relations}}',\n },\n { number: meta.missingCount }\n )}\n >\n {formatMessage(\n {\n id: 'content-manager.history.content.missing-relations.message',\n defaultMessage:\n \"{number, plural, =1 {It has} other {They have}} been deleted and can't be restored.\",\n },\n { number: meta.missingCount }\n )}\n </StyledAlert>\n )}\n </Box>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * CustomMediaInput\n * -----------------------------------------------------------------------------------------------*/\n\n// Create an object with value at key path (i.e. 'a.b.c')\nconst createInitialValuesForPath = (keyPath: string, value: unknown) => {\n const keys = keyPath.split('.');\n // The root level object\n const root: Record<string, unknown> = {};\n\n // Make the first node the root\n let node = root;\n keys.forEach((key, index) => {\n // Skip prototype pollution keys\n if (key === '__proto__' || key === 'constructor') return;\n // If it's the last key, set the node value\n if (index === keys.length - 1) {\n node[key] = value;\n } else {\n // Ensure the key exists and is an object\n const nextNode =\n typeof node[key] === 'object' && node[key] !== null && Array.isArray(node[key]) === false\n ? (node[key] as Record<string, unknown>)\n : {};\n node[key] = nextNode;\n node = nextNode;\n }\n });\n\n return root;\n};\n\nconst CustomMediaInput = (props: VersionInputRendererProps) => {\n const { value } = useField<{ results: unknown[]; meta: { missingCount: number } }>(props.name);\n const results = value?.results ?? [];\n const meta = value?.meta ?? { missingCount: 0 };\n\n const { formatMessage } = useIntl();\n\n const fields = useStrapiApp('CustomMediaInput', (state) => state.fields);\n const MediaLibrary = fields.media as React.ComponentType<\n VersionInputRendererProps & { multiple: boolean }\n >;\n\n return (\n <Flex direction=\"column\" gap={2} alignItems=\"stretch\">\n <Form\n method=\"PUT\"\n disabled={true}\n initialValues={createInitialValuesForPath(props.name, results)}\n >\n <MediaLibrary {...props} disabled={true} multiple={results.length > 1} />\n </Form>\n {meta.missingCount > 0 && (\n <StyledAlert\n variant=\"warning\"\n closeLabel=\"Close\"\n onClose={() => {}}\n title={formatMessage(\n {\n id: 'content-manager.history.content.missing-assets.title',\n defaultMessage:\n '{number, plural, =1 {Missing asset} other {{number} missing assets}}',\n },\n { number: meta.missingCount }\n )}\n >\n {formatMessage(\n {\n id: 'content-manager.history.content.missing-assets.message',\n defaultMessage:\n \"{number, plural, =1 {It has} other {They have}} been deleted in the Media Library and can't be restored.\",\n },\n { number: meta.missingCount }\n )}\n </StyledAlert>\n )}\n </Flex>\n );\n};\n\ntype VersionInputRendererProps = DistributiveOmit<EditFieldLayout, 'size'> & {\n /**\n * In the context of content history, deleted fields need to ignore RBAC\n * @default false\n */\n shouldIgnoreRBAC?: boolean;\n /** Passed down by component and dynamic zone layouts; not used here. */\n size?: number;\n};\n\n/**\n * Checks if the i18n plugin added a label action to the field and modifies it\n * to adapt the wording for the history page.\n */\nconst getLabelAction = (labelAction: VersionInputRendererProps['labelAction']) => {\n if (!React.isValidElement(labelAction)) {\n return labelAction;\n }\n\n // TODO: find a better way to do this rather than access internals\n const labelActionTitleId = labelAction.props.title.id;\n\n if (labelActionTitleId === 'i18n.Field.localized') {\n return React.cloneElement(labelAction, {\n ...labelAction.props,\n title: {\n id: 'history.content.localized',\n defaultMessage:\n 'This value is specific to this locale. If you restore this version, the content will not be replaced for other locales.',\n },\n });\n }\n\n if (labelActionTitleId === 'i18n.Field.not-localized') {\n return React.cloneElement(labelAction, {\n ...labelAction.props,\n title: {\n id: 'history.content.not-localized',\n defaultMessage:\n 'This value is common to all locales. If you restore this version and save the changes, the content will be replaced for all locales.',\n },\n });\n }\n\n // Label action is unrelated to i18n, don't touch it.\n return labelAction;\n};\n\n/**\n * Resolve the layout, configuration metadata and schema attributes needed to\n * render a component field on the history page. Returns `null` when any of\n * those are missing — happens when the component schema referenced by the\n * version was deleted via the Content-Type Builder, in which case the caller\n * should render a fallback instead of crashing on the destructuring.\n */\nconst resolveComponentRenderResources = (\n componentUID: string,\n componentsLayout: { [uid: string]: { layout: unknown } | undefined },\n configurationComponents: { [uid: string]: { metadatas: unknown } | undefined },\n components: { [uid: string]: { attributes: unknown } | undefined }\n) => {\n const componentLayout = componentsLayout[componentUID];\n const componentConfiguration = configurationComponents[componentUID];\n const componentSchema = components[componentUID];\n\n if (!componentLayout || !componentConfiguration || !componentSchema) {\n return null;\n }\n\n return {\n layout: componentLayout.layout,\n metadatas: componentConfiguration.metadatas,\n schemaAttributes: componentSchema.attributes,\n };\n};\n\n/**\n * @internal\n *\n * @description An abstraction around the regular form input renderer designed specifically\n * to be used on the History page in the content-manager. It understands how to render specific\n * inputs within the context of a history version (i.e. relations, media, ignored RBAC, etc...)\n */\nconst VersionInputRenderer = ({\n visible,\n hint: providedHint,\n shouldIgnoreRBAC = false,\n labelAction,\n // Not spread with the rest: design-system inputs have a `size` prop of their own.\n size: _size,\n ...props\n}: VersionInputRendererProps) => {\n const customLabelAction = getLabelAction(labelAction);\n\n const { formatMessage } = useIntl();\n const version = useHistoryContext('VersionContent', (state) => state.selectedVersion);\n const configuration = useHistoryContext('VersionContent', (state) => state.configuration);\n const fieldSizes = useTypedSelector((state) => state['content-manager'].app.fieldSizes);\n\n const { id, components } = useDoc();\n const isFormDisabled = useForm('InputRenderer', (state) => state.disabled);\n\n const isInDynamicZone = useDynamicZone('isInDynamicZone', (state) => state.isInDynamicZone);\n\n const canCreateFields = useDocumentRBAC('InputRenderer', (rbac) => rbac.canCreateFields);\n const canReadFields = useDocumentRBAC('InputRenderer', (rbac) => rbac.canReadFields);\n const canUpdateFields = useDocumentRBAC('InputRenderer', (rbac) => rbac.canUpdateFields);\n const canUserAction = useDocumentRBAC('InputRenderer', (rbac) => rbac.canUserAction);\n\n const editableFields = id ? canUpdateFields : canCreateFields;\n const readableFields = id ? canReadFields : canCreateFields;\n /**\n * Component fields are always readable and editable,\n * however the fields within them may not be.\n */\n const canUserReadField = canUserAction(props.name, readableFields, props.type);\n const canUserEditField = canUserAction(props.name, editableFields, props.type);\n\n const fields = useStrapiApp('InputRenderer', (app) => app.fields);\n const { lazyComponentStore } = useLazyComponents(\n attributeHasCustomFieldProperty(props.attribute) ? [props.attribute.customField] : undefined\n );\n\n const hint = useFieldHint(providedHint, props.attribute);\n const {\n edit: { components: componentsLayout },\n } = useDocLayout();\n\n if (!visible) {\n return null;\n }\n\n /**\n * Don't render the field if the user can't read it.\n */\n if (!shouldIgnoreRBAC && !canUserReadField && !isInDynamicZone) {\n return <NotAllowedInput hint={hint} {...props} />;\n }\n\n const fieldIsDisabled =\n (!canUserEditField && !isInDynamicZone) || props.disabled || isFormDisabled;\n\n /**\n * Attributes found on the current content-type schema cannot be restored. We handle\n * this by displaying a warning alert to the user instead of the input for that field type.\n */\n const addedAttributes = version.meta.unknownAttributes.added;\n if (Object.keys(addedAttributes).includes(props.name)) {\n return (\n <Flex direction=\"column\" alignItems=\"flex-start\" gap={1}>\n <Field.Label>{props.label}</Field.Label>\n <StyledAlert\n width=\"100%\"\n closeLabel=\"Close\"\n onClose={() => {}}\n variant=\"warning\"\n title={formatMessage({\n id: 'content-manager.history.content.new-field.title',\n defaultMessage: 'New field',\n })}\n >\n {formatMessage({\n id: 'content-manager.history.content.new-field.message',\n defaultMessage:\n \"This field didn't exist when this version was saved. If you restore this version, it will be empty.\",\n })}\n </StyledAlert>\n </Flex>\n );\n }\n\n /**\n * Because a custom field has a unique prop but the type could be confused with either\n * the useField hook or the type of the field we need to handle it separately and first.\n */\n if (attributeHasCustomFieldProperty(props.attribute)) {\n const CustomInput = lazyComponentStore[props.attribute.customField];\n\n if (CustomInput) {\n return (\n <CustomInput\n {...props}\n // @ts-expect-error – TODO: fix this type error in the useLazyComponents hook.\n hint={hint}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n />\n );\n }\n\n return (\n <FormInputRenderer\n {...props}\n hint={hint}\n labelAction={customLabelAction}\n // @ts-expect-error – this workaround lets us display that the custom field is missing.\n type={props.attribute.customField}\n disabled={fieldIsDisabled}\n />\n );\n }\n\n /**\n * Since media fields use a custom input via the upload plugin provided by the useLibrary hook,\n * we need to handle the them before other custom inputs coming from the useLibrary hook.\n */\n if (props.type === 'media') {\n return (\n <CustomMediaInput {...props} labelAction={customLabelAction} disabled={fieldIsDisabled} />\n );\n }\n /**\n * This is where we handle ONLY the fields from the `useLibrary` hook.\n */\n const addedInputTypes = Object.keys(fields);\n if (!attributeHasCustomFieldProperty(props.attribute) && addedInputTypes.includes(props.type)) {\n const CustomInput = fields[props.type];\n return (\n <CustomInput\n {...props}\n // @ts-expect-error – TODO: fix this type error in the useLibrary hook.\n hint={hint}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n />\n );\n }\n\n /**\n * These include the content-manager specific fields, failing that we fall back\n * to the more generic form input renderer.\n */\n switch (props.type) {\n case 'blocks':\n return <BlocksInput {...props} hint={hint} type={props.type} disabled={fieldIsDisabled} />;\n case 'component': {\n const renderResources = resolveComponentRenderResources(\n props.attribute.component,\n componentsLayout,\n configuration.components,\n components\n );\n\n // The component schema referenced by this version is no longer present\n // (deleted via the Content-Type Builder). Render the label only so the\n // rest of the page still loads instead of crashing on the lookups below.\n if (!renderResources) {\n return <Field.Label>{props.label}</Field.Label>;\n }\n\n const { layout, metadatas, schemaAttributes } = renderResources as {\n layout: Array<EditFieldLayout[]>;\n metadatas: Parameters<typeof getRemaingFieldsLayout>[0]['metadatas'];\n schemaAttributes: Parameters<typeof getRemaingFieldsLayout>[0]['schemaAttributes'];\n };\n\n // Components can only have one panel, so only save the first layout item\n const [remainingFieldsLayout] = getRemaingFieldsLayout({\n layout: [layout],\n metadatas,\n fieldSizes,\n schemaAttributes,\n });\n\n return (\n <ComponentInput\n {...props}\n layout={[...layout, ...(remainingFieldsLayout || [])]}\n hint={hint}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n >\n {(inputProps) => <VersionInputRenderer {...inputProps} shouldIgnoreRBAC={true} />}\n </ComponentInput>\n );\n }\n case 'dynamiczone':\n return (\n <DynamicZone\n {...props}\n hint={hint}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n >\n {(inputProps) => <VersionInputRenderer {...inputProps} shouldIgnoreRBAC={true} />}\n </DynamicZone>\n );\n case 'relation':\n return (\n <CustomRelationInput\n {...props}\n hint={hint}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n />\n );\n case 'richtext':\n return (\n <Wysiwyg\n {...props}\n hint={hint}\n type={props.type}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n />\n );\n case 'uid':\n return (\n <UIDInput\n {...props}\n hint={hint}\n type={props.type}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n />\n );\n /**\n * Enumerations are a special case because they require options.\n */\n case 'enumeration':\n return (\n <FormInputRenderer\n {...props}\n hint={hint}\n labelAction={customLabelAction}\n options={props.attribute.enum.map((value) => ({ value }))}\n // @ts-expect-error – Temp workaround so we don't forget custom-fields don't work!\n type={props.customField ? 'custom-field' : props.type}\n disabled={fieldIsDisabled}\n />\n );\n default:\n // These props are not needed for the generic form input renderer.\n const { unique: _unique, mainField: _mainField, ...restProps } = props;\n return (\n <FormInputRenderer\n {...restProps}\n hint={hint}\n labelAction={customLabelAction}\n // @ts-expect-error – Temp workaround so we don't forget custom-fields don't work!\n type={props.customField ? 'custom-field' : props.type}\n disabled={fieldIsDisabled}\n />\n );\n }\n};\n\nconst attributeHasCustomFieldProperty = (\n attribute: Schema.Attribute.AnyAttribute\n): attribute is Schema.Attribute.AnyAttribute & Schema.Attribute.CustomField<string> =>\n 'customField' in attribute && typeof attribute.customField === 'string';\n\nexport type { VersionInputRendererProps };\nexport { VersionInputRenderer, CustomRelationInput, resolveComponentRenderResources };\n"],"names":["StyledAlert","styled","Alert","attrs","closeLabel","onClose","shadow","LinkEllipsis","Link","CustomRelationInput","props","formatMessage","useIntl","emptyLabel","id","defaultMessage","field","useField","name","formattedFieldValue","Array","isArray","value","results","meta","missingCount","hasResultsShape","length","_jsxs","_Fragment","_jsx","Field","Label","action","labelAction","label","Box","marginTop","variant","Flex","direction","gap","alignItems","map","relationData","targetModel","attribute","href","COLLECTION_TYPES","documentId","getRelationLabel","mainField","isAdminUserRelation","paddingTop","paddingBottom","paddingLeft","paddingRight","hasRadius","borderColor","background","justifyContent","minWidth","Tooltip","Typography","tag","NavLink","to","DocumentStatus","status","title","number","createInitialValuesForPath","keyPath","keys","split","root","node","forEach","key","index","nextNode","CustomMediaInput","fields","useStrapiApp","state","MediaLibrary","media","Form","method","disabled","initialValues","multiple","getLabelAction","React","isValidElement","labelActionTitleId","cloneElement","resolveComponentRenderResources","componentUID","componentsLayout","configurationComponents","components","componentLayout","componentConfiguration","componentSchema","layout","metadatas","schemaAttributes","attributes","VersionInputRenderer","visible","hint","providedHint","shouldIgnoreRBAC","size","_size","customLabelAction","version","useHistoryContext","selectedVersion","configuration","fieldSizes","useTypedSelector","app","useDoc","isFormDisabled","useForm","isInDynamicZone","useDynamicZone","canCreateFields","useDocumentRBAC","rbac","canReadFields","canUpdateFields","canUserAction","editableFields","readableFields","canUserReadField","type","canUserEditField","lazyComponentStore","useLazyComponents","attributeHasCustomFieldProperty","customField","undefined","useFieldHint","edit","useDocLayout","NotAllowedInput","fieldIsDisabled","addedAttributes","unknownAttributes","added","Object","includes","width","CustomInput","FormInputRenderer","addedInputTypes","BlocksInput","renderResources","component","remainingFieldsLayout","getRemaingFieldsLayout","ComponentInput","inputProps","DynamicZone","Wysiwyg","UIDInput","options","enum","unique","_unique","_mainField","restProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,MAAMA,WAAAA,GAAcC,MAAAA,CAAOC,KAAAA,CAAAA,CAAOC,KAAK,CAAC;IAAEC,UAAAA,EAAY,OAAA;AAASC,IAAAA,OAAAA,EAAS,IAAA,CAAO,CAAA;IAAGC,MAAAA,EAAQ;AAAO,CAAA,CAAE;;;;AAInG,CAAC;AAED;;AAEkG,qGAElG,MAAMC,YAAAA,GAAeN,MAAAA,CAAOO,IAAAA,CAAK;;;;;;;;;AASjC,CAAC;AAED,MAAMC,sBAAsB,CAACC,KAAAA,GAAAA;IAC3B,MAAM,EAAEC,aAAa,EAAE,GAAGC,OAAAA,EAAAA;AAC1B,IAAA,MAAMC,aAAaF,aAAAA,CAAc;QAC/BG,EAAAA,EAAI,wCAAA;QACJC,cAAAA,EAAgB;AAClB,KAAA,CAAA;IACA,MAAMC,KAAAA,GAAQC,QAAAA,CAEZP,KAAAA,CAAMQ,IAAI,CAAA;AAEZ;;;AAGC,MACD,IAAIC,mBAAAA;AACJ,IAAA,IAAIH,KAAAA,EAAO;AACTG,QAAAA,mBAAAA,GAAsBC,KAAAA,CAAMC,OAAO,CAACL,KAAAA,CAAMM,KAAK,CAAA,GAC3C;AAAEC,YAAAA,OAAAA,EAASP,MAAMM,KAAK;YAAEE,IAAAA,EAAM;gBAAEC,YAAAA,EAAc;AAAE;AAAE,SAAA,GAClDT,MAAMM,KAAK;AACjB,IAA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AAA;gBACbqD,OAAAA,EAAS/J,KAAAA,CAAMoC,SAAS,CAAC4H,IAAI,CAAC/H,GAAG,CAAC,CAACrB,KAAAA,IAAW;AAAEA,wBAAAA;qBAAM,CAAA,CAAA;;AAEtDoH,gBAAAA,IAAAA,EAAMhI,KAAAA,CAAMqI,WAAW,GAAG,cAAA,GAAiBrI,MAAMgI,IAAI;gBACrDjD,QAAAA,EAAU4D;;AAGhB,QAAA;;YAEE,MAAM,EAAEsB,QAAQC,OAAO,EAAEzH,WAAW0H,UAAU,EAAE,GAAGC,SAAAA,EAAW,GAAGpK,KAAAA;AACjE,YAAA,qBACEoB,GAAA,CAAC+H,aAAAA,EAAAA;AACE,gBAAA,GAAGiB,SAAS;gBACb/D,IAAAA,EAAMA,IAAAA;gBACN7E,WAAAA,EAAakF,iBAAAA;;AAEbsB,gBAAAA,IAAAA,EAAMhI,KAAAA,CAAMqI,WAAW,GAAG,cAAA,GAAiBrI,MAAMgI,IAAI;gBACrDjD,QAAAA,EAAU4D;;AAGlB;AACF;AAEA,MAAMP,+BAAAA,GAAkC,CACtChG,SAAAA,GAEA,aAAA,IAAiBA,aAAa,OAAOA,SAAAA,CAAUiG,WAAW,KAAK,QAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"VersionInputRenderer.mjs","sources":["../../../../admin/src/history/components/VersionInputRenderer.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport {\n useStrapiApp,\n useForm,\n InputRenderer as FormInputRenderer,\n useField,\n Form,\n} from '@strapi/admin/strapi-admin';\nimport { Alert, Box, Field, Flex, Link, Tooltip, Typography } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport { NavLink } from 'react-router-dom';\nimport { styled } from 'styled-components';\n\nimport { COLLECTION_TYPES } from '../../constants/collections';\nimport { useDocumentRBAC } from '../../features/DocumentRBAC';\nimport { useDoc } from '../../hooks/useDocument';\nimport { useDocLayout } from '../../hooks/useDocumentLayout';\nimport { useLazyComponents } from '../../hooks/useLazyComponents';\nimport { useTypedSelector } from '../../modules/hooks';\nimport { DocumentStatus } from '../../pages/EditView/components/DocumentStatus';\nimport { BlocksInput } from '../../pages/EditView/components/FormInputs/BlocksInput/BlocksInput';\nimport { ComponentInput } from '../../pages/EditView/components/FormInputs/Component/Input';\nimport {\n DynamicZone,\n useDynamicZone,\n} from '../../pages/EditView/components/FormInputs/DynamicZone/Field';\nimport { NotAllowedInput } from '../../pages/EditView/components/FormInputs/NotAllowed';\nimport { UIDInput } from '../../pages/EditView/components/FormInputs/UID';\nimport { Wysiwyg } from '../../pages/EditView/components/FormInputs/Wysiwyg/Field';\nimport { useFieldHint } from '../../pages/EditView/components/InputRenderer';\nimport { getRelationLabel } from '../../utils/relations';\nimport { useHistoryContext } from '../pages/History';\n\nimport { getRemaingFieldsLayout } from './VersionContent';\n\nimport type { EditFieldLayout } from '../../hooks/useDocumentLayout';\nimport type { RelationsFieldProps } from '../../pages/EditView/components/FormInputs/Relations/Relations';\nimport type { RelationResult } from '../../services/relations';\nimport type { Schema } from '@strapi/types';\nimport type { DistributiveOmit } from 'react-redux';\n\nconst StyledAlert = styled(Alert).attrs({ closeLabel: 'Close', onClose: () => {}, shadow: 'none' })`\n button {\n display: none;\n }\n`;\n\n/* -------------------------------------------------------------------------------------------------\n * CustomRelationInput\n * -----------------------------------------------------------------------------------------------*/\n\nconst LinkEllipsis = styled(Link)`\n display: block;\n\n & > span {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: block;\n }\n`;\n\nconst CustomRelationInput = (props: RelationsFieldProps) => {\n const { formatMessage } = useIntl();\n const emptyLabel = formatMessage({\n id: 'content-manager.containers.empty-label',\n defaultMessage: 'Untitled',\n });\n const field = useField<\n { results: RelationResult[]; meta: { missingCount: number } } | RelationResult[]\n >(props.name);\n\n /**\n * Ideally the server would return the correct shape, however, for admin user relations\n * it sanitizes everything out when it finds an object for the relation value.\n */\n let formattedFieldValue;\n if (field) {\n formattedFieldValue = Array.isArray(field.value)\n ? { results: field.value, meta: { missingCount: 0 } }\n : field.value;\n }\n\n // Be defensive about the shape: admin-user relations are sanitized to a\n // plain user object on the server, and historical version data can carry\n // shapes that pre-date the `{ results, meta }` contract. Treat anything\n // without an array `results` as \"no relations\".\n const hasResultsShape =\n !!formattedFieldValue &&\n typeof formattedFieldValue === 'object' &&\n Array.isArray((formattedFieldValue as { results?: unknown }).results);\n const missingCount =\n hasResultsShape &&\n typeof (formattedFieldValue as { meta?: { missingCount?: number } }).meta?.missingCount ===\n 'number'\n ? (formattedFieldValue as { meta: { missingCount: number } }).meta.missingCount\n : 0;\n\n if (\n !hasResultsShape ||\n ((formattedFieldValue as { results: unknown[] }).results.length === 0 && missingCount === 0)\n ) {\n return (\n <>\n <Field.Label action={props.labelAction}>{props.label}</Field.Label>\n <Box marginTop={1}>\n <StyledAlert variant=\"default\">\n {formatMessage({\n id: 'content-manager.history.content.no-relations',\n defaultMessage: 'No relations.',\n })}\n </StyledAlert>\n </Box>\n </>\n );\n }\n\n const { results, meta } = formattedFieldValue as {\n results: RelationResult[];\n meta: { missingCount: number };\n };\n\n return (\n <Box>\n <Field.Label>{props.label}</Field.Label>\n {results.length > 0 && (\n <Flex direction=\"column\" gap={2} marginTop={1} alignItems=\"stretch\">\n {results.map((relationData) => {\n // @ts-expect-error - targetModel does exist on the attribute. But it's not typed.\n const { targetModel } = props.attribute;\n const href = `../${COLLECTION_TYPES}/${targetModel}/${relationData.documentId}`;\n const label = getRelationLabel(relationData, props.mainField, emptyLabel);\n const isAdminUserRelation = targetModel === 'admin::user';\n\n return (\n <Flex\n key={relationData.documentId ?? relationData.id}\n paddingTop={2}\n paddingBottom={2}\n paddingLeft={4}\n paddingRight={4}\n hasRadius\n borderColor=\"neutral200\"\n background=\"neutral150\"\n justifyContent=\"space-between\"\n >\n <Box minWidth={0} paddingTop={1} paddingBottom={1} paddingRight={4}>\n <Tooltip label={label}>\n {isAdminUserRelation ? (\n <Typography>{label}</Typography>\n ) : (\n <LinkEllipsis tag={NavLink} to={href}>\n {label}\n </LinkEllipsis>\n )}\n </Tooltip>\n </Box>\n <DocumentStatus status={relationData.status as string} />\n </Flex>\n );\n })}\n </Flex>\n )}\n {meta.missingCount > 0 && (\n <StyledAlert\n marginTop={1}\n variant=\"warning\"\n title={formatMessage(\n {\n id: 'content-manager.history.content.missing-relations.title',\n defaultMessage:\n '{number, plural, =1 {Missing relation} other {{number} missing relations}}',\n },\n { number: meta.missingCount }\n )}\n >\n {formatMessage(\n {\n id: 'content-manager.history.content.missing-relations.message',\n defaultMessage:\n \"{number, plural, =1 {It has} other {They have}} been deleted and can't be restored.\",\n },\n { number: meta.missingCount }\n )}\n </StyledAlert>\n )}\n </Box>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * CustomMediaInput\n * -----------------------------------------------------------------------------------------------*/\n\n// Create an object with value at key path (i.e. 'a.b.c')\nconst createInitialValuesForPath = (keyPath: string, value: unknown) => {\n const keys = keyPath.split('.');\n // The root level object\n const root: Record<string, unknown> = {};\n\n // Make the first node the root\n let node = root;\n keys.forEach((key, index) => {\n // Skip prototype pollution keys\n if (key === '__proto__' || key === 'constructor') return;\n // If it's the last key, set the node value\n if (index === keys.length - 1) {\n node[key] = value;\n } else {\n // Ensure the key exists and is an object\n const nextNode =\n typeof node[key] === 'object' && node[key] !== null && Array.isArray(node[key]) === false\n ? (node[key] as Record<string, unknown>)\n : {};\n node[key] = nextNode;\n node = nextNode;\n }\n });\n\n return root;\n};\n\nconst CustomMediaInput = (props: VersionInputRendererProps) => {\n const { value } = useField<{ results: unknown[]; meta: { missingCount: number } }>(props.name);\n const results = value?.results ?? [];\n const meta = value?.meta ?? { missingCount: 0 };\n\n const { formatMessage } = useIntl();\n\n const fields = useStrapiApp('CustomMediaInput', (state) => state.fields);\n const MediaLibrary = fields.media as React.ComponentType<\n VersionInputRendererProps & { multiple: boolean }\n >;\n\n return (\n <Flex direction=\"column\" gap={2} alignItems=\"stretch\">\n <Form\n method=\"PUT\"\n disabled={true}\n initialValues={createInitialValuesForPath(props.name, results)}\n >\n <MediaLibrary {...props} disabled={true} multiple={results.length > 1} />\n </Form>\n {meta.missingCount > 0 && (\n <StyledAlert\n variant=\"warning\"\n closeLabel=\"Close\"\n onClose={() => {}}\n title={formatMessage(\n {\n id: 'content-manager.history.content.missing-assets.title',\n defaultMessage:\n '{number, plural, =1 {Missing asset} other {{number} missing assets}}',\n },\n { number: meta.missingCount }\n )}\n >\n {formatMessage(\n {\n id: 'content-manager.history.content.missing-assets.message',\n defaultMessage:\n \"{number, plural, =1 {It has} other {They have}} been deleted in the Media Library and can't be restored.\",\n },\n { number: meta.missingCount }\n )}\n </StyledAlert>\n )}\n </Flex>\n );\n};\n\ntype VersionInputRendererProps = DistributiveOmit<EditFieldLayout, 'size'> & {\n /**\n * In the context of content history, deleted fields need to ignore RBAC\n * @default false\n */\n shouldIgnoreRBAC?: boolean;\n /** Passed down by component and dynamic zone layouts; not used here. */\n size?: number;\n};\n\n/**\n * Checks if the i18n plugin added a label action to the field and modifies it\n * to adapt the wording for the history page.\n */\nconst getLabelAction = (labelAction: VersionInputRendererProps['labelAction']) => {\n if (!React.isValidElement(labelAction)) {\n return labelAction;\n }\n\n // TODO: find a better way to do this rather than access internals.\n // Shared-field lock actions can be stamped without a title; don't throw.\n const labelActionTitleId = labelAction.props?.title?.id;\n if (typeof labelActionTitleId !== 'string') {\n return labelAction;\n }\n\n if (labelActionTitleId === 'i18n.Field.localized') {\n return React.cloneElement(labelAction, {\n ...labelAction.props,\n title: {\n id: 'history.content.localized',\n defaultMessage:\n 'This value is specific to this locale. If you restore this version, the content will not be replaced for other locales.',\n },\n });\n }\n\n if (labelActionTitleId === 'i18n.Field.not-localized') {\n return React.cloneElement(labelAction, {\n ...labelAction.props,\n title: {\n id: 'history.content.not-localized',\n defaultMessage:\n 'This value is common to all locales. If you restore this version and save the changes, the content will be replaced for all locales.',\n },\n });\n }\n\n // Label action is unrelated to i18n, don't touch it.\n return labelAction;\n};\n\n/**\n * Resolve the layout, configuration metadata and schema attributes needed to\n * render a component field on the history page. Returns `null` when any of\n * those are missing — happens when the component schema referenced by the\n * version was deleted via the Content-Type Builder, in which case the caller\n * should render a fallback instead of crashing on the destructuring.\n */\nconst resolveComponentRenderResources = (\n componentUID: string,\n componentsLayout: { [uid: string]: { layout: unknown } | undefined },\n configurationComponents: { [uid: string]: { metadatas: unknown } | undefined },\n components: { [uid: string]: { attributes: unknown } | undefined }\n) => {\n const componentLayout = componentsLayout[componentUID];\n const componentConfiguration = configurationComponents[componentUID];\n const componentSchema = components[componentUID];\n\n if (!componentLayout || !componentConfiguration || !componentSchema) {\n return null;\n }\n\n return {\n layout: componentLayout.layout,\n metadatas: componentConfiguration.metadatas,\n schemaAttributes: componentSchema.attributes,\n };\n};\n\n/**\n * @internal\n *\n * @description An abstraction around the regular form input renderer designed specifically\n * to be used on the History page in the content-manager. It understands how to render specific\n * inputs within the context of a history version (i.e. relations, media, ignored RBAC, etc...)\n */\nconst VersionInputRenderer = ({\n visible,\n hint: providedHint,\n shouldIgnoreRBAC = false,\n labelAction,\n // Not spread with the rest: design-system inputs have a `size` prop of their own.\n size: _size,\n ...props\n}: VersionInputRendererProps) => {\n const customLabelAction = getLabelAction(labelAction);\n\n const { formatMessage } = useIntl();\n const version = useHistoryContext('VersionContent', (state) => state.selectedVersion);\n const configuration = useHistoryContext('VersionContent', (state) => state.configuration);\n const fieldSizes = useTypedSelector((state) => state['content-manager'].app.fieldSizes);\n\n const { id, components } = useDoc();\n const isFormDisabled = useForm('InputRenderer', (state) => state.disabled);\n\n const isInDynamicZone = useDynamicZone('isInDynamicZone', (state) => state.isInDynamicZone);\n\n const canCreateFields = useDocumentRBAC('InputRenderer', (rbac) => rbac.canCreateFields);\n const canReadFields = useDocumentRBAC('InputRenderer', (rbac) => rbac.canReadFields);\n const canUpdateFields = useDocumentRBAC('InputRenderer', (rbac) => rbac.canUpdateFields);\n const canUserAction = useDocumentRBAC('InputRenderer', (rbac) => rbac.canUserAction);\n\n const editableFields = id ? canUpdateFields : canCreateFields;\n const readableFields = id ? canReadFields : canCreateFields;\n /**\n * Component fields are always readable and editable,\n * however the fields within them may not be.\n */\n const canUserReadField = canUserAction(props.name, readableFields, props.type);\n const canUserEditField = canUserAction(props.name, editableFields, props.type);\n\n const fields = useStrapiApp('InputRenderer', (app) => app.fields);\n const { lazyComponentStore } = useLazyComponents(\n attributeHasCustomFieldProperty(props.attribute) ? [props.attribute.customField] : undefined\n );\n\n const hint = useFieldHint(providedHint, props.attribute);\n const {\n edit: { components: componentsLayout },\n } = useDocLayout();\n\n if (!visible) {\n return null;\n }\n\n /**\n * Don't render the field if the user can't read it.\n */\n if (!shouldIgnoreRBAC && !canUserReadField && !isInDynamicZone) {\n return <NotAllowedInput hint={hint} {...props} />;\n }\n\n const fieldIsDisabled =\n (!canUserEditField && !isInDynamicZone) || props.disabled || isFormDisabled;\n\n /**\n * Attributes found on the current content-type schema cannot be restored. We handle\n * this by displaying a warning alert to the user instead of the input for that field type.\n */\n const addedAttributes = version.meta.unknownAttributes.added;\n if (Object.keys(addedAttributes).includes(props.name)) {\n return (\n <Flex direction=\"column\" alignItems=\"flex-start\" gap={1}>\n <Field.Label>{props.label}</Field.Label>\n <StyledAlert\n width=\"100%\"\n closeLabel=\"Close\"\n onClose={() => {}}\n variant=\"warning\"\n title={formatMessage({\n id: 'content-manager.history.content.new-field.title',\n defaultMessage: 'New field',\n })}\n >\n {formatMessage({\n id: 'content-manager.history.content.new-field.message',\n defaultMessage:\n \"This field didn't exist when this version was saved. If you restore this version, it will be empty.\",\n })}\n </StyledAlert>\n </Flex>\n );\n }\n\n /**\n * Because a custom field has a unique prop but the type could be confused with either\n * the useField hook or the type of the field we need to handle it separately and first.\n */\n if (attributeHasCustomFieldProperty(props.attribute)) {\n const CustomInput = lazyComponentStore[props.attribute.customField];\n\n if (CustomInput) {\n return (\n <CustomInput\n {...props}\n // @ts-expect-error – TODO: fix this type error in the useLazyComponents hook.\n hint={hint}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n />\n );\n }\n\n return (\n <FormInputRenderer\n {...props}\n hint={hint}\n labelAction={customLabelAction}\n // @ts-expect-error – this workaround lets us display that the custom field is missing.\n type={props.attribute.customField}\n disabled={fieldIsDisabled}\n />\n );\n }\n\n /**\n * Since media fields use a custom input via the upload plugin provided by the useLibrary hook,\n * we need to handle the them before other custom inputs coming from the useLibrary hook.\n */\n if (props.type === 'media') {\n return (\n <CustomMediaInput {...props} labelAction={customLabelAction} disabled={fieldIsDisabled} />\n );\n }\n /**\n * This is where we handle ONLY the fields from the `useLibrary` hook.\n */\n const addedInputTypes = Object.keys(fields);\n if (!attributeHasCustomFieldProperty(props.attribute) && addedInputTypes.includes(props.type)) {\n const CustomInput = fields[props.type];\n return (\n <CustomInput\n {...props}\n // @ts-expect-error – TODO: fix this type error in the useLibrary hook.\n hint={hint}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n />\n );\n }\n\n /**\n * These include the content-manager specific fields, failing that we fall back\n * to the more generic form input renderer.\n */\n switch (props.type) {\n case 'blocks':\n return <BlocksInput {...props} hint={hint} type={props.type} disabled={fieldIsDisabled} />;\n case 'component': {\n const renderResources = resolveComponentRenderResources(\n props.attribute.component,\n componentsLayout,\n configuration.components,\n components\n );\n\n // The component schema referenced by this version is no longer present\n // (deleted via the Content-Type Builder). Render the label only so the\n // rest of the page still loads instead of crashing on the lookups below.\n if (!renderResources) {\n return <Field.Label>{props.label}</Field.Label>;\n }\n\n const { layout, metadatas, schemaAttributes } = renderResources as {\n layout: Array<EditFieldLayout[]>;\n metadatas: Parameters<typeof getRemaingFieldsLayout>[0]['metadatas'];\n schemaAttributes: Parameters<typeof getRemaingFieldsLayout>[0]['schemaAttributes'];\n };\n\n // Components can only have one panel, so only save the first layout item\n const [remainingFieldsLayout] = getRemaingFieldsLayout({\n layout: [layout],\n metadatas,\n fieldSizes,\n schemaAttributes,\n });\n\n return (\n <ComponentInput\n {...props}\n layout={[...layout, ...(remainingFieldsLayout || [])]}\n hint={hint}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n >\n {(inputProps) => <VersionInputRenderer {...inputProps} shouldIgnoreRBAC={true} />}\n </ComponentInput>\n );\n }\n case 'dynamiczone':\n return (\n <DynamicZone\n {...props}\n hint={hint}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n >\n {(inputProps) => <VersionInputRenderer {...inputProps} shouldIgnoreRBAC={true} />}\n </DynamicZone>\n );\n case 'relation':\n return (\n <CustomRelationInput\n {...props}\n hint={hint}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n />\n );\n case 'richtext':\n return (\n <Wysiwyg\n {...props}\n hint={hint}\n type={props.type}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n />\n );\n case 'uid':\n return (\n <UIDInput\n {...props}\n hint={hint}\n type={props.type}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n />\n );\n /**\n * Enumerations are a special case because they require options.\n */\n case 'enumeration':\n return (\n <FormInputRenderer\n {...props}\n hint={hint}\n labelAction={customLabelAction}\n options={props.attribute.enum.map((value) => ({ value }))}\n // @ts-expect-error – Temp workaround so we don't forget custom-fields don't work!\n type={props.customField ? 'custom-field' : props.type}\n disabled={fieldIsDisabled}\n />\n );\n default:\n // These props are not needed for the generic form input renderer.\n const { unique: _unique, mainField: _mainField, ...restProps } = props;\n return (\n <FormInputRenderer\n {...restProps}\n hint={hint}\n labelAction={customLabelAction}\n // @ts-expect-error – Temp workaround so we don't forget custom-fields don't work!\n type={props.customField ? 'custom-field' : props.type}\n disabled={fieldIsDisabled}\n />\n );\n }\n};\n\nconst attributeHasCustomFieldProperty = (\n attribute: Schema.Attribute.AnyAttribute\n): attribute is Schema.Attribute.AnyAttribute & Schema.Attribute.CustomField<string> =>\n 'customField' in attribute && typeof attribute.customField === 'string';\n\nexport type { VersionInputRendererProps };\nexport {\n VersionInputRenderer,\n CustomRelationInput,\n getLabelAction,\n resolveComponentRenderResources,\n};\n"],"names":["StyledAlert","styled","Alert","attrs","closeLabel","onClose","shadow","LinkEllipsis","Link","CustomRelationInput","props","formatMessage","useIntl","emptyLabel","id","defaultMessage","field","useField","name","formattedFieldValue","Array","isArray","value","results","meta","missingCount","hasResultsShape","length","_jsxs","_Fragment","_jsx","Field","Label","action","labelAction","label","Box","marginTop","variant","Flex","direction","gap","alignItems","map","relationData","targetModel","attribute","href","COLLECTION_TYPES","documentId","getRelationLabel","mainField","isAdminUserRelation","paddingTop","paddingBottom","paddingLeft","paddingRight","hasRadius","borderColor","background","justifyContent","minWidth","Tooltip","Typography","tag","NavLink","to","DocumentStatus","status","title","number","createInitialValuesForPath","keyPath","keys","split","root","node","forEach","key","index","nextNode","CustomMediaInput","fields","useStrapiApp","state","MediaLibrary","media","Form","method","disabled","initialValues","multiple","getLabelAction","React","isValidElement","labelActionTitleId","cloneElement","resolveComponentRenderResources","componentUID","componentsLayout","configurationComponents","components","componentLayout","componentConfiguration","componentSchema","layout","metadatas","schemaAttributes","attributes","VersionInputRenderer","visible","hint","providedHint","shouldIgnoreRBAC","size","_size","customLabelAction","version","useHistoryContext","selectedVersion","configuration","fieldSizes","useTypedSelector","app","useDoc","isFormDisabled","useForm","isInDynamicZone","useDynamicZone","canCreateFields","useDocumentRBAC","rbac","canReadFields","canUpdateFields","canUserAction","editableFields","readableFields","canUserReadField","type","canUserEditField","lazyComponentStore","useLazyComponents","attributeHasCustomFieldProperty","customField","undefined","useFieldHint","edit","useDocLayout","NotAllowedInput","fieldIsDisabled","addedAttributes","unknownAttributes","added","Object","includes","width","CustomInput","FormInputRenderer","addedInputTypes","BlocksInput","renderResources","component","remainingFieldsLayout","getRemaingFieldsLayout","ComponentInput","inputProps","DynamicZone","Wysiwyg","UIDInput","options","enum","unique","_unique","_mainField","restProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AA0CA,MAAMA,WAAAA,GAAcC,MAAAA,CAAOC,KAAAA,CAAAA,CAAOC,KAAK,CAAC;IAAEC,UAAAA,EAAY,OAAA;AA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