@strapi/content-manager 0.0.0-experimental.e60ec1829240dae21c1e1d29076681c322288813 → 0.0.0-experimental.f31889311d753b5f7d95198ae84d8fce1d156cd6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +18 -3
- package/dist/_chunks/{CardDragPreview-DSVYodBX.js → CardDragPreview-C0QyJgRA.js} +10 -14
- package/dist/_chunks/CardDragPreview-C0QyJgRA.js.map +1 -0
- package/dist/_chunks/{CardDragPreview-ikSG4M46.mjs → CardDragPreview-DOxamsuj.mjs} +7 -9
- package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +1 -0
- package/dist/_chunks/{ComponentConfigurationPage-DjWJdz6Y.js → ComponentConfigurationPage-BNxtMIfV.js} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-DjWJdz6Y.js.map → ComponentConfigurationPage-BNxtMIfV.js.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-BPvzFjM7.mjs → ComponentConfigurationPage-BWOQWCv2.mjs} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-BPvzFjM7.mjs.map → ComponentConfigurationPage-BWOQWCv2.mjs.map} +1 -1
- package/dist/_chunks/{ComponentIcon-BBQsYCVn.js → ComponentIcon-BXdiCGQp.js} +8 -2
- package/dist/_chunks/ComponentIcon-BXdiCGQp.js.map +1 -0
- package/dist/_chunks/{ComponentIcon-BOFnK76n.mjs → ComponentIcon-u4bIXTFY.mjs} +9 -3
- package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +1 -0
- package/dist/_chunks/{EditConfigurationPage-Dmv83RlS.js → EditConfigurationPage-D340bYlT.js} +3 -3
- package/dist/_chunks/{EditConfigurationPage-Dmv83RlS.js.map → EditConfigurationPage-D340bYlT.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-DacbqQ_f.mjs → EditConfigurationPage-GTp-Ucnw.mjs} +3 -3
- package/dist/_chunks/{EditConfigurationPage-DacbqQ_f.mjs.map → EditConfigurationPage-GTp-Ucnw.mjs.map} +1 -1
- package/dist/_chunks/{EditViewPage-DDS6H9HO.mjs → EditViewPage-BVMS5hT-.mjs} +47 -47
- package/dist/_chunks/EditViewPage-BVMS5hT-.mjs.map +1 -0
- package/dist/_chunks/{EditViewPage-DvNpQkam.js → EditViewPage-CXkmnAvI.js} +46 -48
- package/dist/_chunks/EditViewPage-CXkmnAvI.js.map +1 -0
- package/dist/_chunks/{Field-DmVKIAOo.js → Field-Ibi32diw.js} +953 -782
- package/dist/_chunks/Field-Ibi32diw.js.map +1 -0
- package/dist/_chunks/{Field-6gvGdPBV.mjs → Field-nNgv5bpd.mjs} +901 -729
- package/dist/_chunks/Field-nNgv5bpd.mjs.map +1 -0
- package/dist/_chunks/{Form-CPZC9vWa.js → Form-Dhnh34ym.js} +39 -38
- package/dist/_chunks/Form-Dhnh34ym.js.map +1 -0
- package/dist/_chunks/{Form-DW6K1IH-.mjs → Form-DodJsI2A.mjs} +39 -37
- package/dist/_chunks/Form-DodJsI2A.mjs.map +1 -0
- package/dist/_chunks/{History-DeAPlvtv.js → History-C9auUkDi.js} +149 -56
- package/dist/_chunks/History-C9auUkDi.js.map +1 -0
- package/dist/_chunks/{History-Dmr9fmUA.mjs → History-CKCSQXz_.mjs} +148 -54
- package/dist/_chunks/History-CKCSQXz_.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-DPCwW5Vr.js → ListConfigurationPage-Bg4rWUjX.js} +58 -59
- package/dist/_chunks/ListConfigurationPage-Bg4rWUjX.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-DhwvYcNv.mjs → ListConfigurationPage-CKEC4ttG.mjs} +54 -54
- package/dist/_chunks/ListConfigurationPage-CKEC4ttG.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-BtAwuYLE.mjs → ListViewPage-B7_WJUjG.mjs} +93 -104
- package/dist/_chunks/ListViewPage-B7_WJUjG.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-5ySZ-VUs.js → ListViewPage-C2gIeYHG.js} +98 -109
- package/dist/_chunks/ListViewPage-C2gIeYHG.js.map +1 -0
- package/dist/_chunks/{NoContentTypePage-DSPxnxxp.mjs → NoContentTypePage-Ckem6Ll6.mjs} +3 -3
- package/dist/_chunks/NoContentTypePage-Ckem6Ll6.mjs.map +1 -0
- package/dist/_chunks/{NoContentTypePage-DOC_yWOf.js → NoContentTypePage-DqgdUfyn.js} +3 -3
- package/dist/_chunks/NoContentTypePage-DqgdUfyn.js.map +1 -0
- package/dist/_chunks/{NoPermissionsPage-UWDC-1Tw.mjs → NoPermissionsPage-BO-GEjA4.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-UWDC-1Tw.mjs.map → NoPermissionsPage-BO-GEjA4.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-Dwu8rRJu.js → NoPermissionsPage-CF29Q-sW.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-Dwu8rRJu.js.map → NoPermissionsPage-CF29Q-sW.js.map} +1 -1
- package/dist/_chunks/{Relations-CgWtgnPe.js → Relations-C0uC9J4f.js} +70 -61
- package/dist/_chunks/Relations-C0uC9J4f.js.map +1 -0
- package/dist/_chunks/{Relations-J8cscLlR.mjs → Relations-DItV5eow.mjs} +66 -56
- package/dist/_chunks/Relations-DItV5eow.mjs.map +1 -0
- package/dist/_chunks/{en-MBPul9Su.mjs → en-BrCTWlZv.mjs} +11 -4
- package/dist/_chunks/{en-MBPul9Su.mjs.map → en-BrCTWlZv.mjs.map} +1 -1
- package/dist/_chunks/{en-C-V1_90f.js → en-uOUIxfcQ.js} +11 -4
- package/dist/_chunks/{en-C-V1_90f.js.map → en-uOUIxfcQ.js.map} +1 -1
- package/dist/_chunks/{index-C6AH2hEl.js → index-Dd0nXyJF.js} +1649 -905
- package/dist/_chunks/index-Dd0nXyJF.js.map +1 -0
- package/dist/_chunks/{index-CwRRo1V9.mjs → index-DrNe6ctw.mjs} +1671 -926
- package/dist/_chunks/index-DrNe6ctw.mjs.map +1 -0
- package/dist/_chunks/{layout-jIDzX0Fp.mjs → layout-B3ez7kvr.mjs} +43 -26
- package/dist/_chunks/layout-B3ez7kvr.mjs.map +1 -0
- package/dist/_chunks/{layout-B_SXLhqf.js → layout-CLLtt_5O.js} +43 -28
- package/dist/_chunks/layout-CLLtt_5O.js.map +1 -0
- package/dist/_chunks/{relations-CuvIgCqI.mjs → relations-B0hlsUU_.mjs} +2 -2
- package/dist/_chunks/{relations-CuvIgCqI.mjs.map → relations-B0hlsUU_.mjs.map} +1 -1
- package/dist/_chunks/{relations-iBMa_OFG.js → relations-bRxcNv1q.js} +2 -2
- package/dist/_chunks/{relations-iBMa_OFG.js.map → relations-bRxcNv1q.js.map} +1 -1
- package/dist/_chunks/useDragAndDrop-DdHgKsqq.mjs.map +1 -1
- package/dist/_chunks/useDragAndDrop-J0TUUbR6.js.map +1 -1
- package/dist/_chunks/usePrev-B9w_-eYc.js +15 -0
- package/dist/_chunks/usePrev-B9w_-eYc.js.map +1 -0
- package/dist/_chunks/usePrev-DH6iah0A.mjs +16 -0
- package/dist/_chunks/usePrev-DH6iah0A.mjs.map +1 -0
- package/dist/admin/index.js +2 -1
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +5 -4
- package/dist/admin/src/components/ComponentIcon.d.ts +6 -3
- package/dist/admin/src/content-manager.d.ts +3 -3
- package/dist/admin/src/exports.d.ts +1 -0
- package/dist/admin/src/history/components/VersionInputRenderer.d.ts +1 -1
- package/dist/admin/src/history/index.d.ts +3 -0
- package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
- package/dist/admin/src/hooks/useDocument.d.ts +5 -8
- package/dist/admin/src/hooks/useDocumentActions.d.ts +24 -3
- package/dist/admin/src/hooks/useDocumentLayout.d.ts +2 -2
- package/dist/admin/src/hooks/useDragAndDrop.d.ts +4 -4
- package/dist/admin/src/hooks/useKeyboardDragAndDrop.d.ts +1 -1
- package/dist/admin/src/index.d.ts +1 -0
- package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +11 -4
- package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/BlocksInput.d.ts +3 -3
- package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +4 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/Component/Input.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/ComponentCategory.d.ts +3 -5
- package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/Field.d.ts +1 -1
- package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +30 -18
- package/dist/admin/src/pages/EditView/components/FormInputs/UID.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +3 -49
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/Field.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +59 -52
- package/dist/admin/src/pages/EditView/components/InputRenderer.d.ts +2 -10
- package/dist/admin/src/pages/ListView/components/BulkActions/Actions.d.ts +3 -30
- package/dist/admin/src/pages/ListView/components/BulkActions/ConfirmBulkActionDialog.d.ts +2 -2
- package/dist/admin/src/pages/ListView/components/BulkActions/PublishAction.d.ts +9 -26
- package/dist/admin/src/services/api.d.ts +2 -3
- package/dist/admin/src/services/components.d.ts +2 -2
- package/dist/admin/src/services/contentTypes.d.ts +5 -5
- package/dist/admin/src/services/documents.d.ts +29 -17
- package/dist/admin/src/services/init.d.ts +2 -2
- package/dist/admin/src/services/relations.d.ts +3 -3
- package/dist/admin/src/services/uid.d.ts +3 -3
- package/dist/admin/src/utils/api.d.ts +4 -18
- package/dist/admin/src/utils/validation.d.ts +1 -6
- package/dist/server/index.js +392 -261
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +400 -269
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
- package/dist/server/src/controllers/single-types.d.ts.map +1 -1
- package/dist/server/src/controllers/uid.d.ts.map +1 -1
- package/dist/server/src/controllers/utils/metadata.d.ts +8 -0
- package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -0
- package/dist/server/src/controllers/validation/dimensions.d.ts +11 -0
- package/dist/server/src/controllers/validation/dimensions.d.ts.map +1 -0
- package/dist/server/src/controllers/validation/index.d.ts +1 -1
- package/dist/server/src/history/services/history.d.ts.map +1 -1
- package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
- package/dist/server/src/history/services/utils.d.ts +1 -1
- package/dist/server/src/history/services/utils.d.ts.map +1 -1
- package/dist/server/src/index.d.ts +18 -39
- package/dist/server/src/index.d.ts.map +1 -1
- package/dist/server/src/services/document-manager.d.ts +13 -12
- package/dist/server/src/services/document-manager.d.ts.map +1 -1
- package/dist/server/src/services/document-metadata.d.ts +8 -29
- package/dist/server/src/services/document-metadata.d.ts.map +1 -1
- package/dist/server/src/services/index.d.ts +18 -39
- package/dist/server/src/services/index.d.ts.map +1 -1
- package/dist/server/src/services/utils/populate.d.ts +8 -1
- package/dist/server/src/services/utils/populate.d.ts.map +1 -1
- package/dist/shared/contracts/collection-types.d.ts +14 -6
- package/dist/shared/contracts/collection-types.d.ts.map +1 -1
- package/dist/shared/contracts/relations.d.ts +2 -2
- package/dist/shared/contracts/relations.d.ts.map +1 -1
- package/package.json +13 -14
- package/dist/_chunks/CardDragPreview-DSVYodBX.js.map +0 -1
- package/dist/_chunks/CardDragPreview-ikSG4M46.mjs.map +0 -1
- package/dist/_chunks/ComponentIcon-BBQsYCVn.js.map +0 -1
- package/dist/_chunks/ComponentIcon-BOFnK76n.mjs.map +0 -1
- package/dist/_chunks/EditViewPage-DDS6H9HO.mjs.map +0 -1
- package/dist/_chunks/EditViewPage-DvNpQkam.js.map +0 -1
- package/dist/_chunks/Field-6gvGdPBV.mjs.map +0 -1
- package/dist/_chunks/Field-DmVKIAOo.js.map +0 -1
- package/dist/_chunks/Form-CPZC9vWa.js.map +0 -1
- package/dist/_chunks/Form-DW6K1IH-.mjs.map +0 -1
- package/dist/_chunks/History-DeAPlvtv.js.map +0 -1
- package/dist/_chunks/History-Dmr9fmUA.mjs.map +0 -1
- package/dist/_chunks/ListConfigurationPage-DPCwW5Vr.js.map +0 -1
- package/dist/_chunks/ListConfigurationPage-DhwvYcNv.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-5ySZ-VUs.js.map +0 -1
- package/dist/_chunks/ListViewPage-BtAwuYLE.mjs.map +0 -1
- package/dist/_chunks/NoContentTypePage-DOC_yWOf.js.map +0 -1
- package/dist/_chunks/NoContentTypePage-DSPxnxxp.mjs.map +0 -1
- package/dist/_chunks/Relations-CgWtgnPe.js.map +0 -1
- package/dist/_chunks/Relations-J8cscLlR.mjs.map +0 -1
- package/dist/_chunks/index-C6AH2hEl.js.map +0 -1
- package/dist/_chunks/index-CwRRo1V9.mjs.map +0 -1
- package/dist/_chunks/layout-B_SXLhqf.js.map +0 -1
- package/dist/_chunks/layout-jIDzX0Fp.mjs.map +0 -1
- package/dist/_chunks/urls-CbOsUOoW.mjs +0 -7
- package/dist/_chunks/urls-CbOsUOoW.mjs.map +0 -1
- package/dist/_chunks/urls-DzZya_gm.js +0 -6
- package/dist/_chunks/urls-DzZya_gm.js.map +0 -1
- package/dist/server/src/controllers/utils/dimensions.d.ts +0 -5
- package/dist/server/src/controllers/utils/dimensions.d.ts.map +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"Form-DodJsI2A.mjs","sources":["../../admin/src/components/ConfigurationForm/EditFieldForm.tsx","../../admin/src/components/ConfigurationForm/Fields.tsx","../../admin/src/components/ConfigurationForm/Form.tsx"],"sourcesContent":["import {\n useNotification,\n InputRenderer,\n Form,\n InputProps,\n useField,\n} from '@strapi/admin/strapi-admin';\nimport { Button, Flex, Grid, Modal } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport * as yup from 'yup';\n\nimport { ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD } from '../../constants/attributes';\nimport { useGetInitialDataQuery } from '../../services/init';\nimport { capitalise } from '../../utils/strings';\nimport { getTranslation } from '../../utils/translations';\nimport { FieldTypeIcon } from '../FieldTypeIcon';\n\nimport { TEMP_FIELD_NAME } from './Fields';\n\nimport type { ConfigurationFormData } from './Form';\nimport type { Schema } from '@strapi/types';\n\n/* -------------------------------------------------------------------------------------------------\n * Constants\n * -----------------------------------------------------------------------------------------------*/\n\nconst FIELD_SCHEMA = yup.object().shape({\n label: yup.string().required(),\n description: yup.string(),\n editable: yup.boolean(),\n size: yup.number().required(),\n});\n\n/* -------------------------------------------------------------------------------------------------\n * EditFieldForm\n * -----------------------------------------------------------------------------------------------*/\n\ninterface EditFieldFormProps {\n attribute?: Schema.Attribute.AnyAttribute;\n name: string;\n onClose: () => void;\n}\n\nconst EditFieldForm = ({ attribute, name, onClose }: EditFieldFormProps) => {\n const { formatMessage } = useIntl();\n const { toggleNotification } = useNotification();\n\n const { value, onChange } =\n useField<ConfigurationFormData['layout'][number]['children'][number]>(name);\n\n const { data: mainFieldOptions } = useGetInitialDataQuery(undefined, {\n selectFromResult: (res) => {\n if (attribute?.type !== 'relation' || !res.data) {\n return { data: [] };\n }\n\n if ('targetModel' in attribute && typeof attribute.targetModel === 'string') {\n const targetSchema = res.data.contentTypes.find(\n (schema) => schema.uid === attribute.targetModel\n );\n\n if (targetSchema) {\n return {\n data: Object.entries(targetSchema.attributes).reduce<\n Array<{ label: string; value: string }>\n >((acc, [key, attribute]) => {\n /**\n * Create the list of attributes from the schema as to which can\n * be our `mainField` and dictate the display name of the schema\n * we're editing.\n */\n if (!ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD.includes(attribute.type)) {\n acc.push({\n label: key,\n value: key,\n });\n }\n\n return acc;\n }, []),\n };\n }\n }\n\n return { data: [] };\n },\n skip: attribute?.type !== 'relation',\n });\n\n if (!value || value.name === TEMP_FIELD_NAME || !attribute) {\n // This is very unlikely to happen, but it ensures the form is not opened without a value.\n console.error(\n \"You've opened a field to edit without it being part of the form, this is likely a bug with Strapi. Please open an issue.\"\n );\n\n toggleNotification({\n message: formatMessage({\n id: 'content-manager.containers.edit-settings.modal-form.error',\n defaultMessage: 'An error occurred while trying to open the form.',\n }),\n type: 'danger',\n });\n\n return null;\n }\n\n return (\n <Modal.Content>\n <Form\n method=\"PUT\"\n initialValues={value}\n validationSchema={FIELD_SCHEMA}\n onSubmit={(data) => {\n onChange(name, data);\n onClose();\n }}\n >\n <Modal.Header>\n <Flex gap={3}>\n <FieldTypeIcon type={attribute.type} />\n <Modal.Title>\n {formatMessage(\n {\n id: 'content-manager.containers.edit-settings.modal-form.label',\n defaultMessage: 'Edit {fieldName}',\n },\n { fieldName: capitalise(value.name) }\n )}\n </Modal.Title>\n </Flex>\n </Modal.Header>\n <Modal.Body>\n <Grid.Root gap={4}>\n {[\n {\n name: 'label',\n label: formatMessage({\n id: getTranslation('containers.edit-settings.modal-form.label'),\n defaultMessage: 'Label',\n }),\n size: 6,\n type: 'string' as const,\n },\n {\n name: 'description',\n label: formatMessage({\n id: getTranslation('containers.edit-settings.modal-form.description'),\n defaultMessage: 'Description',\n }),\n size: 6,\n type: 'string' as const,\n },\n {\n name: 'placeholder',\n label: formatMessage({\n id: getTranslation('containers.edit-settings.modal-form.placeholder'),\n defaultMessage: 'Placeholder',\n }),\n size: 6,\n type: 'string' as const,\n },\n {\n name: 'editable',\n label: formatMessage({\n id: getTranslation('containers.edit-settings.modal-form.editable'),\n defaultMessage: 'Editable',\n }),\n size: 6,\n type: 'boolean' as const,\n },\n {\n name: 'mainField',\n label: formatMessage({\n id: getTranslation('containers.edit-settings.modal-form.mainField'),\n defaultMessage: 'Entry title',\n }),\n hint: formatMessage({\n id: getTranslation(\n 'containers.SettingPage.edit-settings.modal-form.mainField.hint'\n ),\n defaultMessage: 'Set the displayed field',\n }),\n size: 6,\n options: mainFieldOptions,\n type: 'enumeration' as const,\n },\n {\n name: 'size',\n label: formatMessage({\n id: getTranslation('containers.ListSettingsView.modal-form.size'),\n defaultMessage: 'Size',\n }),\n size: 6,\n options: [\n { value: '4', label: '33%' },\n { value: '6', label: '50%' },\n { value: '8', label: '66%' },\n { value: '12', label: '100%' },\n ],\n type: 'enumeration' as const,\n },\n ]\n .filter(filterFieldsBasedOnAttributeType(attribute.type))\n .map(({ size, ...field }) => (\n <Grid.Item key={field.name} col={size}>\n <InputRenderer {...field} />\n </Grid.Item>\n ))}\n </Grid.Root>\n </Modal.Body>\n <Modal.Footer>\n <Modal.Close>\n <Button variant=\"tertiary\">\n {formatMessage({ id: 'app.components.Button.cancel', defaultMessage: 'Cancel' })}\n </Button>\n </Modal.Close>\n <Button type=\"submit\">\n {formatMessage({ id: 'global.finish', defaultMessage: 'Finish' })}\n </Button>\n </Modal.Footer>\n </Form>\n </Modal.Content>\n );\n};\n\n/**\n * @internal\n * @description not all edit fields have the same editable properties, it depends on the type\n * e.g. a dynamic zone can only change it's label.\n */\nconst filterFieldsBasedOnAttributeType = (type: Schema.Attribute.Kind) => (field: InputProps) => {\n switch (type) {\n case 'blocks':\n case 'richtext':\n return field.name !== 'size' && field.name !== 'mainField';\n case 'boolean':\n case 'media':\n return field.name !== 'placeholder' && field.name !== 'mainField';\n case 'component':\n case 'dynamiczone':\n return field.name === 'label' || field.name === 'editable';\n case 'json':\n return field.name !== 'placeholder' && field.name !== 'mainField' && field.name !== 'size';\n case 'relation':\n return true;\n default:\n return field.name !== 'mainField';\n }\n};\n\nexport { EditFieldForm };\nexport type { EditFieldFormProps };\n","import * as React from 'react';\n\nimport { useField, useForm } from '@strapi/admin/strapi-admin';\nimport {\n Modal,\n Box,\n Flex,\n Grid,\n IconButton,\n IconButtonComponent,\n Typography,\n useComposedRefs,\n Link,\n Menu,\n} from '@strapi/design-system';\nimport { Cog, Cross, Drag, Pencil, Plus } from '@strapi/icons';\nimport { generateNKeysBetween as generateNKeysBetweenImpl } from 'fractional-indexing';\nimport { getEmptyImage } from 'react-dnd-html5-backend';\nimport { useIntl } from 'react-intl';\nimport { NavLink } from 'react-router-dom';\nimport { styled } from 'styled-components';\n\nimport { ItemTypes } from '../../constants/dragAndDrop';\nimport { type UseDragAndDropOptions, useDragAndDrop } from '../../hooks/useDragAndDrop';\nimport { getTranslation } from '../../utils/translations';\nimport { ComponentIcon } from '../ComponentIcon';\n\nimport { EditFieldForm, EditFieldFormProps } from './EditFieldForm';\n\nimport type { ConfigurationFormData, EditFieldSpacerLayout } from './Form';\nimport type { EditLayout } from '../../hooks/useDocumentLayout';\n\ntype FormField = ConfigurationFormData['layout'][number]['children'][number];\ntype Field = Omit<ConfigurationFormData['layout'][number]['children'][number], '__temp_key__'>;\n\n/* -------------------------------------------------------------------------------------------------\n * Fields\n * -----------------------------------------------------------------------------------------------*/\n\ninterface FieldsProps extends Pick<EditLayout, 'metadatas'>, Pick<FieldProps, 'components'> {\n attributes: {\n [key: string]: FieldProps['attribute'];\n };\n fieldSizes: Record<string, number>;\n components: EditLayout['components'];\n}\n\nconst Fields = ({ attributes, fieldSizes, components, metadatas = {} }: FieldsProps) => {\n const { formatMessage } = useIntl();\n\n const layout = useForm<ConfigurationFormData['layout']>(\n 'Fields',\n (state) => state.values.layout ?? []\n );\n const onChange = useForm('Fields', (state) => state.onChange);\n const addFieldRow = useForm('Fields', (state) => state.addFieldRow);\n const removeFieldRow = useForm('Fields', (state) => state.removeFieldRow);\n\n const existingFields = layout.map((row) => row.children.map((field) => field.name)).flat();\n\n /**\n * Get the fields that are not already in the layout\n * But also check that they are visible before we give users\n * the option to display them. e.g. `id` is not visible.\n */\n const remainingFields = Object.entries(metadatas).reduce<Field[]>((acc, current) => {\n const [name, { visible, ...field }] = current;\n\n if (!existingFields.includes(name) && visible === true) {\n const type = attributes[name]?.type;\n const size = type ? fieldSizes[type] : 12;\n\n acc.push({\n ...field,\n label: field.label ?? name,\n name,\n size,\n });\n }\n\n return acc;\n }, []);\n\n const handleMoveField: FieldProps['onMoveField'] = (\n [newRowIndex, newFieldIndex],\n [currentRowIndex, currentFieldIndex]\n ) => {\n /**\n * Because this view has the constraint that the sum of field sizes cannot be greater\n * than 12, we don't use the form's method to move field rows, instead, we calculate\n * the new layout and set the entire form.\n */\n const newLayout = structuredClone(layout);\n\n /**\n * Remove field from the current layout space using splice so we have the item\n */\n const [field] = newLayout[currentRowIndex].children.splice(currentFieldIndex, 1);\n\n if (!field || field.name === TEMP_FIELD_NAME) {\n return;\n }\n\n const newRow = newLayout[newRowIndex].children;\n const [newFieldKey] = generateNKeysBetween(newRow, 1, currentFieldIndex, newFieldIndex);\n\n /**\n * Next we inject the field into it's new row at it's specified index, we then remove the spaces\n * if they exist and recalculate into potentially two arrays ONLY if the sizing is now over 12,\n * the row and the rest of the row that couldn't fit.\n *\n * for example, if i have a row of `[{size: 4}, {size: 6}]` and i add `{size: 8}` a index 0,\n * the new array will look like `[{size: 8}, {size: 4}, {size: 6}]` which breaks the limit of 12,\n * so instead we make two arrays for the new rows `[[{size: 8}, {size: 4}], [{size: 6}]]` which we\n * then inject at the original row point with spacers included.\n */\n newRow.splice(newFieldIndex, 0, { ...field, __temp_key__: newFieldKey });\n\n if (newLayout[newRowIndex].children.reduce((acc, curr) => acc + curr.size, 0) > 12) {\n const recalculatedRows = chunkArray(\n newLayout[newRowIndex].children.filter((field) => field.name !== TEMP_FIELD_NAME)\n );\n\n const rowKeys = generateNKeysBetween(\n newLayout,\n recalculatedRows.length,\n currentRowIndex,\n newRowIndex\n );\n\n newLayout.splice(\n newRowIndex,\n 1,\n ...recalculatedRows.map((row, index) => ({\n __temp_key__: rowKeys[index],\n children: row,\n }))\n );\n }\n\n /**\n * Now we remove our spacers from the rows so we can understand what dead rows exist:\n * - if there's only spacers left\n * - there's nothing in the row, e.g. a size 12 field left it.\n * These rows are then filtered out.\n * After that, we recalculate the spacers for the rows that need them.\n */\n const newLayoutWithSpacers = newLayout\n .map((row) => ({\n ...row,\n children: row.children.filter((field) => field.name !== TEMP_FIELD_NAME),\n }))\n .filter((row) => row.children.length > 0)\n .map((row) => {\n const totalSpaceTaken = row.children.reduce((acc, curr) => acc + curr.size, 0);\n\n if (totalSpaceTaken < 12) {\n const [spacerKey] = generateNKeysBetweenImpl(\n row.children.at(-1)?.__temp_key__,\n undefined,\n 1\n );\n\n return {\n ...row,\n children: [\n ...row.children,\n {\n name: TEMP_FIELD_NAME,\n size: 12 - totalSpaceTaken,\n __temp_key__: spacerKey,\n } satisfies EditFieldSpacerLayout,\n ],\n };\n }\n\n return row;\n });\n\n onChange('layout', newLayoutWithSpacers);\n };\n\n const handleRemoveField =\n (rowIndex: number, fieldIndex: number): FieldProps['onRemoveField'] =>\n () => {\n if (layout[rowIndex].children.length === 1) {\n removeFieldRow(`layout`, rowIndex);\n } else {\n onChange(`layout.${rowIndex}.children.${fieldIndex}`, undefined);\n }\n };\n\n const handleAddField = (field: Field) => () => {\n addFieldRow('layout', { children: [field] });\n };\n\n return (\n <Flex paddingTop={6} direction=\"column\" alignItems=\"stretch\" gap={4}>\n <Flex alignItems=\"flex-start\" direction=\"column\" justifyContent=\"space-between\">\n <Typography fontWeight=\"bold\">\n {formatMessage({\n id: getTranslation('containers.list.displayedFields'),\n defaultMessage: 'Displayed fields',\n })}\n </Typography>\n <Typography variant=\"pi\" textColor=\"neutral600\">\n {formatMessage({\n id: 'containers.SettingPage.editSettings.description',\n defaultMessage: 'Drag & drop the fields to build the layout',\n })}\n </Typography>\n </Flex>\n <Box padding={4} hasRadius borderStyle=\"dashed\" borderWidth=\"1px\" borderColor=\"neutral300\">\n <Flex direction=\"column\" alignItems=\"stretch\" gap={2}>\n {layout.map((row, rowIndex) => (\n <Grid.Root gap={2} key={row.__temp_key__}>\n {row.children.map(({ size, ...field }, fieldIndex) => (\n <Grid.Item key={field.name} col={size}>\n <Field\n attribute={attributes[field.name]}\n components={components}\n index={[rowIndex, fieldIndex]}\n name={`layout.${rowIndex}.children.${fieldIndex}`}\n onMoveField={handleMoveField}\n onRemoveField={handleRemoveField(rowIndex, fieldIndex)}\n />\n </Grid.Item>\n ))}\n </Grid.Root>\n ))}\n <Menu.Root>\n <Menu.Trigger\n startIcon={<Plus />}\n endIcon={null}\n disabled={remainingFields.length === 0}\n fullWidth\n variant=\"secondary\"\n >\n {formatMessage({\n id: getTranslation('containers.SettingPage.add.field'),\n defaultMessage: 'Insert another field',\n })}\n </Menu.Trigger>\n <Menu.Content>\n {remainingFields.map((field) => (\n <Menu.Item key={field.name} onSelect={handleAddField(field)}>\n {field.label}\n </Menu.Item>\n ))}\n </Menu.Content>\n </Menu.Root>\n </Flex>\n </Box>\n </Flex>\n );\n};\n\n/**\n * @internal\n * @description Small abstraction to solve within an array of fields where you can\n * add a field to the beginning or start, move back and forth what it's index range\n * should be when calculating it's new temp key\n */\nconst generateNKeysBetween = <Field extends { __temp_key__: string }>(\n field: Field[],\n count: number,\n currInd: number,\n newInd: number\n) => {\n const startKey = currInd > newInd ? field[newInd - 1]?.__temp_key__ : field[newInd]?.__temp_key__;\n const endKey = currInd > newInd ? field[newInd]?.__temp_key__ : field[newInd + 1]?.__temp_key__;\n\n return generateNKeysBetweenImpl(startKey, endKey, count);\n};\n\n/**\n * @internal\n * @description chunks a row of layouts by the max size we allow, 12. It does not add the\n * spacers again, that should be added separately.\n */\nconst chunkArray = (array: FormField[]) => {\n const result: Array<FormField[]> = [];\n let temp: FormField[] = [];\n\n array.reduce((acc, field) => {\n if (acc + field.size > 12) {\n result.push(temp);\n temp = [field];\n return field.size;\n } else {\n temp.push(field);\n return acc + field.size;\n }\n }, 0);\n\n if (temp.length > 0) {\n result.push(temp);\n }\n\n return result;\n};\n\n/* -------------------------------------------------------------------------------------------------\n * Field\n * -----------------------------------------------------------------------------------------------*/\n\ninterface FieldProps extends Pick<EditFieldFormProps, 'name' | 'attribute'> {\n components: EditLayout['components'];\n index: [row: number, index: number];\n onMoveField: UseDragAndDropOptions<number[]>['onMoveItem'];\n onRemoveField: React.MouseEventHandler<HTMLButtonElement>;\n}\n\nconst TEMP_FIELD_NAME = '_TEMP_';\n\n/**\n * Displays a field in the layout with drag options, also\n * opens a modal to edit the details of said field.\n */\nconst Field = ({ attribute, components, name, index, onMoveField, onRemoveField }: FieldProps) => {\n const [isModalOpen, setIsModalOpen] = React.useState(false);\n const { formatMessage } = useIntl();\n\n const { value } = useField<FormField>(name);\n\n const [{ isDragging }, objectRef, dropRef, dragRef, dragPreviewRef] = useDragAndDrop<\n Array<number>\n >(true, {\n dropSensitivity: 'immediate',\n type: ItemTypes.EDIT_FIELD,\n item: { index, label: value?.label, name },\n index,\n onMoveItem: onMoveField,\n });\n\n React.useEffect(() => {\n dragPreviewRef(getEmptyImage(), { captureDraggingState: false });\n }, [dragPreviewRef]);\n\n const composedRefs = useComposedRefs<HTMLSpanElement>(dragRef, objectRef);\n\n const handleRemoveField: React.MouseEventHandler<HTMLButtonElement> = (e) => {\n e.stopPropagation();\n onRemoveField(e);\n };\n\n const tempRefs = useComposedRefs<HTMLSpanElement>(dropRef, objectRef);\n\n if (!value) {\n return null;\n }\n\n if (value.name === TEMP_FIELD_NAME) {\n return <Flex tag=\"span\" height=\"100%\" style={{ opacity: 0 }} ref={tempRefs} />;\n }\n\n return (\n <Modal.Root open={isModalOpen} onOpenChange={setIsModalOpen}>\n <Flex\n borderColor=\"neutral150\"\n background=\"neutral100\"\n hasRadius\n style={{ opacity: isDragging ? 0.5 : 1 }}\n ref={dropRef}\n gap={3}\n cursor=\"pointer\"\n onClick={() => {\n setIsModalOpen(true);\n }}\n >\n <DragButton\n tag=\"span\"\n withTooltip={false}\n label={formatMessage(\n {\n id: getTranslation('components.DraggableCard.move.field'),\n defaultMessage: 'Move {item}',\n },\n { item: value.label }\n )}\n onClick={(e) => e.stopPropagation()}\n ref={composedRefs}\n >\n <Drag />\n </DragButton>\n <Flex direction=\"column\" alignItems=\"flex-start\" grow={1} overflow=\"hidden\">\n <Flex gap={3} justifyContent=\"space-between\" width=\"100%\">\n <Typography ellipsis fontWeight=\"bold\">\n {value.label}\n </Typography>\n <Flex>\n <IconButton\n borderWidth={0}\n background=\"transparent\"\n onClick={(e) => {\n e.stopPropagation();\n setIsModalOpen(true);\n }}\n withTooltip={false}\n label={formatMessage(\n {\n id: getTranslation('components.DraggableCard.edit.field'),\n defaultMessage: 'Edit {item}',\n },\n { item: value.label }\n )}\n >\n <Pencil />\n </IconButton>\n <IconButton\n borderWidth={0}\n onClick={handleRemoveField}\n background=\"transparent\"\n withTooltip={false}\n label={formatMessage(\n {\n id: getTranslation('components.DraggableCard.delete.field'),\n defaultMessage: 'Delete {item}',\n },\n { item: value.label }\n )}\n >\n <Cross />\n </IconButton>\n </Flex>\n </Flex>\n {attribute?.type === 'component' ? (\n <Flex\n paddingTop={3}\n paddingRight={3}\n paddingBottom={3}\n paddingLeft={0}\n alignItems=\"flex-start\"\n direction=\"column\"\n gap={2}\n width=\"100%\"\n >\n <Grid.Root gap={4} width=\"100%\">\n {components[attribute.component].layout.map((row) =>\n row.map(({ size, ...field }) => (\n <Grid.Item key={field.name} col={size}>\n <Flex\n alignItems=\"center\"\n background=\"neutral0\"\n paddingTop={2}\n paddingBottom={2}\n paddingLeft={3}\n paddingRight={3}\n hasRadius\n borderColor=\"neutral200\"\n >\n <Typography textColor=\"neutral800\">{field.name}</Typography>\n </Flex>\n </Grid.Item>\n ))\n )}\n </Grid.Root>\n <Link\n // used to stop the edit form from appearing when we click here.\n onClick={(e) => e.stopPropagation()}\n startIcon={<Cog />}\n tag={NavLink}\n to={`../components/${attribute.component}/configurations/edit`}\n >\n {formatMessage({\n id: getTranslation('components.FieldItem.linkToComponentLayout'),\n defaultMessage: \"Set the component's layout\",\n })}\n </Link>\n </Flex>\n ) : null}\n {attribute?.type === 'dynamiczone' ? (\n <Flex\n paddingTop={3}\n paddingRight={3}\n paddingBottom={3}\n paddingLeft={0}\n alignItems=\"flex-start\"\n gap={2}\n width=\"100%\"\n >\n {attribute?.components.map((uid) => (\n <ComponentLink\n // used to stop the edit form from appearing when we click here.\n onClick={(e) => e.stopPropagation()}\n key={uid}\n to={`../components/${uid}/configurations/edit`}\n >\n <ComponentIcon icon={components[uid].settings.icon} />\n <Typography fontSize={1} textColor=\"neutral600\" fontWeight=\"bold\">\n {components[uid].settings.displayName}\n </Typography>\n </ComponentLink>\n ))}\n </Flex>\n ) : null}\n </Flex>\n </Flex>\n {value.name !== TEMP_FIELD_NAME && (\n <EditFieldForm attribute={attribute} name={name} onClose={() => setIsModalOpen(false)} />\n )}\n </Modal.Root>\n );\n};\n\nconst DragButton = styled<IconButtonComponent<'span'>>(IconButton)`\n height: unset;\n align-self: stretch;\n display: flex;\n align-items: center;\n padding: 0;\n border: none;\n background-color: transparent;\n border-radius: 0px;\n border-right: 1px solid ${({ theme }) => theme.colors.neutral150};\n cursor: all-scroll;\n\n svg {\n width: 1.2rem;\n height: 1.2rem;\n }\n`;\n\nconst ComponentLink = styled(NavLink)`\n display: flex;\n flex-direction: column;\n align-items: center;\n gap: ${({ theme }) => theme.spaces[1]};\n padding: ${(props) => props.theme.spaces[2]};\n border: 1px solid ${({ theme }) => theme.colors.neutral200};\n background: ${({ theme }) => theme.colors.neutral0};\n width: 14rem;\n border-radius: ${({ theme }) => theme.borderRadius};\n text-decoration: none;\n\n &:focus,\n &:hover {\n ${({ theme }) => `\n background-color: ${theme.colors.primary100};\n border-color: ${theme.colors.primary200};\n\n ${Typography} {\n color: ${theme.colors.primary600};\n }\n `}\n\n /* > ComponentIcon */\n > div:first-child {\n background: ${({ theme }) => theme.colors.primary200};\n color: ${({ theme }) => theme.colors.primary600};\n\n svg {\n path {\n fill: ${({ theme }) => theme.colors.primary600};\n }\n }\n }\n }\n`;\n\nexport { Fields, TEMP_FIELD_NAME };\nexport type { FieldsProps };\n","import * as React from 'react';\n\nimport {\n Form,\n FormProps,\n useForm,\n InputRenderer,\n BackButton,\n Layouts,\n} from '@strapi/admin/strapi-admin';\nimport { Button, Divider, Flex, Grid, Main, Typography } from '@strapi/design-system';\nimport { generateNKeysBetween } from 'fractional-indexing';\nimport pipe from 'lodash/fp/pipe';\nimport { useIntl } from 'react-intl';\n\nimport { ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD } from '../../constants/attributes';\nimport { capitalise } from '../../utils/strings';\nimport { getTranslation } from '../../utils/translations';\n\nimport { Fields, FieldsProps, TEMP_FIELD_NAME } from './Fields';\n\nimport type { EditFieldLayout, EditLayout } from '../../hooks/useDocumentLayout';\n\n/* -------------------------------------------------------------------------------------------------\n * ConfigurationForm\n * -----------------------------------------------------------------------------------------------*/\n\ninterface ConfigurationFormProps extends Pick<FieldsProps, 'attributes' | 'fieldSizes'> {\n layout: EditLayout;\n onSubmit: FormProps<ConfigurationFormData>['onSubmit'];\n}\n\n/**\n * Every key in EditFieldLayout is turned to optional never and then we overwrite the ones we are using.\n */\n\ntype EditFieldSpacerLayout = {\n [key in keyof Omit<EditFieldLayout, 'name' | 'size'>]?: never;\n} & {\n description?: never;\n editable?: never;\n name: '_TEMP_';\n size: number;\n __temp_key__: string;\n};\n\ninterface ConfigurationFormData extends Pick<EditLayout, 'settings'> {\n layout: Array<{\n __temp_key__: string;\n children: Array<\n | (Pick<EditFieldLayout, 'label' | 'size' | 'name' | 'placeholder' | 'mainField'> & {\n description: EditFieldLayout['hint'];\n editable: EditFieldLayout['disabled'];\n __temp_key__: string;\n })\n | EditFieldSpacerLayout\n >;\n }>;\n}\n\nconst ConfigurationForm = ({\n attributes,\n fieldSizes,\n layout: editLayout,\n onSubmit,\n}: ConfigurationFormProps) => {\n const { components, settings, layout, metadatas } = editLayout;\n\n const { formatMessage } = useIntl();\n\n const initialValues: ConfigurationFormData = React.useMemo(() => {\n const transformations = pipe(\n flattenPanels,\n replaceMainFieldWithNameOnly,\n extractMetadata,\n addTmpSpaceToLayout,\n addTmpKeysToLayout\n );\n\n return {\n layout: transformations(layout),\n settings,\n };\n }, [layout, settings]);\n\n return (\n <Layouts.Root>\n <Main>\n <Form initialValues={initialValues} onSubmit={onSubmit} method=\"PUT\">\n <Header name={settings.displayName ?? ''} />\n <Layouts.Content>\n <Flex\n alignItems=\"stretch\"\n background=\"neutral0\"\n direction=\"column\"\n gap={6}\n hasRadius\n shadow=\"tableShadow\"\n paddingTop={6}\n paddingBottom={6}\n paddingLeft={7}\n paddingRight={7}\n >\n <Typography variant=\"delta\" tag=\"h2\">\n {formatMessage({\n id: getTranslation('containers.SettingPage.settings'),\n defaultMessage: 'Settings',\n })}\n </Typography>\n <Grid.Root>\n <Grid.Item col={6} s={12}>\n <InputRenderer\n type=\"enumeration\"\n label={formatMessage({\n id: getTranslation('containers.SettingPage.editSettings.entry.title'),\n defaultMessage: 'Entry title',\n })}\n hint={formatMessage({\n id: getTranslation(\n 'containers.SettingPage.editSettings.entry.title.description'\n ),\n defaultMessage: 'Set the display field of your entry',\n })}\n name=\"settings.mainField\"\n options={Object.entries(attributes).reduce<\n Array<{ label: string; value: string }>\n >((acc, [key, attribute]) => {\n if (!attribute) {\n return acc;\n }\n\n /**\n * Create the list of attributes from the schema as to which can\n * be our `mainField` and dictate the display name of the schema\n * we're editing.\n */\n if (!ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD.includes(attribute.type)) {\n acc.push({\n label: key,\n value: key,\n });\n }\n\n return acc;\n }, [])}\n />\n </Grid.Item>\n <Grid.Item paddingTop={6} paddingBottom={6} col={12} s={12}>\n <Divider />\n </Grid.Item>\n <Grid.Item col={12} s={12}>\n <Typography variant=\"delta\" tag=\"h3\">\n {formatMessage({\n id: getTranslation('containers.SettingPage.view'),\n defaultMessage: 'View',\n })}\n </Typography>\n </Grid.Item>\n <Grid.Item col={12} s={12}>\n <Fields\n attributes={attributes}\n components={components}\n fieldSizes={fieldSizes}\n metadatas={metadatas}\n />\n </Grid.Item>\n </Grid.Root>\n </Flex>\n </Layouts.Content>\n </Form>\n </Main>\n </Layouts.Root>\n );\n};\n\n/**\n * @internal\n * @description Panels don't exist in the layout, so we flatten by one.\n */\nconst flattenPanels = (layout: EditLayout['layout']): EditLayout['layout'][number] =>\n layout.flat(1);\n\n/**\n * @internal\n * @description We don't need the mainField object in the layout, we only need the name.\n */\nconst replaceMainFieldWithNameOnly = (layout: EditLayout['layout'][number]) =>\n layout.map((row) =>\n row.map((field) => ({\n ...field,\n mainField: field.mainField?.name,\n }))\n );\n\n/**\n * @internal\n * @description We extract the metadata values from the field layout, because these are editable by the user.\n */\nconst extractMetadata = (\n layout: EditLayout['layout'][number]\n): Array<Exclude<ConfigurationFormData['layout'], { name: '_TEMP_' }>[number]['children']> => {\n return layout.map((row) =>\n row.map(({ label, disabled, hint, placeholder, size, name, mainField }) => ({\n label,\n editable: !disabled,\n description: hint,\n mainField,\n placeholder,\n size,\n name,\n __temp_key__: '',\n }))\n );\n};\n\n/**\n * @internal\n * @description Each row of the layout has a max size of 12 (based on bootstrap grid system)\n * So in order to offer a better drop zone we add the _TEMP_ div to complete the remaining substract (12 - existing)\n */\nconst addTmpSpaceToLayout = (\n layout: ReturnType<typeof extractMetadata>\n): Array<ConfigurationFormData['layout'][number]['children']> => [\n ...layout.map((row) => {\n const totalSpaceTaken = row.reduce((acc, field) => acc + field.size, 0);\n\n if (totalSpaceTaken < 12) {\n return [\n ...row,\n {\n name: TEMP_FIELD_NAME,\n size: 12 - totalSpaceTaken,\n __temp_key__: '',\n } satisfies EditFieldSpacerLayout,\n ];\n }\n\n return row;\n }),\n];\n\n/**\n * @internal\n * @description At this point of the transformations we have Field[][], but each row for the form should have a __temp_key__\n * applied. This means we need to change it so `Field` is nested under the children property.\n */\nconst addTmpKeysToLayout = (\n layout: ReturnType<typeof addTmpSpaceToLayout>\n): ConfigurationFormData['layout'] => {\n const keys = generateNKeysBetween(undefined, undefined, layout.length);\n\n return layout.map((row, rowIndex) => {\n const fieldKeys = generateNKeysBetween(undefined, undefined, row.length);\n\n return {\n __temp_key__: keys[rowIndex],\n children: row.map((field, fieldIndex) => {\n return {\n ...field,\n __temp_key__: fieldKeys[fieldIndex],\n };\n }),\n };\n });\n};\n\n/* -------------------------------------------------------------------------------------------------\n * Header\n * -----------------------------------------------------------------------------------------------*/\n\ninterface HeaderProps {\n name: string;\n}\n\nconst Header = ({ name }: HeaderProps) => {\n const { formatMessage } = useIntl();\n const modified = useForm('Header', (state) => state.modified);\n const isSubmitting = useForm('Header', (state) => state.isSubmitting);\n\n return (\n <Layouts.Header\n title={formatMessage(\n {\n id: getTranslation('components.SettingsViewWrapper.pluginHeader.title'),\n defaultMessage: `Configure the view - {name}`,\n },\n { name: capitalise(name) }\n )}\n subtitle={formatMessage({\n id: getTranslation('components.SettingsViewWrapper.pluginHeader.description.edit-settings'),\n defaultMessage: 'Customize how the edit view will look like.',\n })}\n navigationAction={<BackButton />}\n primaryAction={\n <Button disabled={!modified} loading={isSubmitting} type=\"submit\">\n {formatMessage({ id: 'global.save', defaultMessage: 'Save' })}\n </Button>\n }\n />\n );\n};\n\nexport { ConfigurationForm };\nexport type { ConfigurationFormProps, ConfigurationFormData, EditFieldSpacerLayout };\n"],"names":["attribute","field","generateNKeysBetweenImpl","generateNKeysBetween"],"mappings":";;;;;;;;;;;;;;;;AA0BA,MAAM,eAAe,IAAI,OAAO,EAAE,MAAM;AAAA,EACtC,OAAO,IAAI,OAAO,EAAE,SAAS;AAAA,EAC7B,aAAa,IAAI,OAAO;AAAA,EACxB,UAAU,IAAI,QAAQ;AAAA,EACtB,MAAM,IAAI,OAAO,EAAE,SAAS;AAC9B,CAAC;AAYD,MAAM,gBAAgB,CAAC,EAAE,WAAW,MAAM,cAAkC;AACpE,QAAA,EAAE,kBAAkB;AACpB,QAAA,EAAE,uBAAuB;AAE/B,QAAM,EAAE,OAAO,SAAS,IACtB,SAAsE,IAAI;AAE5E,QAAM,EAAE,MAAM,iBAAiB,IAAI,uBAAuB,QAAW;AAAA,IACnE,kBAAkB,CAAC,QAAQ;AACzB,UAAI,WAAW,SAAS,cAAc,CAAC,IAAI,MAAM;AACxC,eAAA,EAAE,MAAM,CAAA;MACjB;AAEA,UAAI,iBAAiB,aAAa,OAAO,UAAU,gB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CACzB,WACoC;AACpC,QAAM,OAAOC,uBAAqB,QAAW,QAAW,OAAO,MAAM;AAErE,SAAO,OAAO,IAAI,CAAC,KAAK,aAAa;AACnC,UAAM,YAAYA,uBAAqB,QAAW,QAAW,IAAI,MAAM;AAEhE,WAAA;AAAA,MACL,cAAc,KAAK,QAAQ;AAAA,MAC3B,UAAU,IAAI,IAAI,CAAC,OAAO,eAAe;AAChC,eAAA;AAAA,UACL,GAAG;AAAA,UACH,cAAc,UAAU,UAAU;AAAA,QAAA;AAAA,MACpC,CACD;AAAA,IAAA;AAAA,EACH,CACD;AACH;AAUA,MAAM,SAAS,CAAC,EAAE,WAAwB;AAClC,QAAA,EAAE,kBAAkB;AAC1B,QAAM,WAAW,QAAQ,UAAU,CAAC,UAAU,MAAM,QAAQ;AAC5D,QAAM,eAAe,QAAQ,UAAU,CAAC,UAAU,MAAM,YAAY;AAGlE,SAAA;AAAA,IAAC,QAAQ;AAAA,IAAR;AAAA,MACC,OAAO;AAAA,QACL;AAAA,UACE,IAAI,eAAe,mDAAmD;AAAA,UACtE,gBAAgB;AAAA,QAClB;AAAA,QACA,EAAE,MAAM,WAAW,IAAI,EAAE;AAAA,MAC3B;AAAA,MACA,UAAU,cAAc;AAAA,QACtB,IAAI,eAAe,uEAAuE;AAAA,QAC1F,gBAAgB;AAAA,MAAA,CACjB;AAAA,MACD,sCAAmB,YAAW,EAAA;AAAA,MAC9B,eACG,oBAAA,QAAA,EAAO,UAAU,CAAC,UAAU,SAAS,cAAc,MAAK,UACtD,wBAAc,EAAE,IAAI,eAAe,gBAAgB,OAAQ,CAAA,GAC9D;AAAA,IAAA;AAAA,EAAA;AAIR;"}
|
@@ -7,13 +7,13 @@ const designSystem = require("@strapi/design-system");
|
|
7
7
|
const qs = require("qs");
|
8
8
|
const reactIntl = require("react-intl");
|
9
9
|
const reactRouterDom = require("react-router-dom");
|
10
|
-
const index = require("./index-
|
10
|
+
const index = require("./index-Dd0nXyJF.js");
|
11
11
|
const pipe = require("lodash/fp/pipe");
|
12
12
|
const hooks = require("./hooks-BAaaKPS_.js");
|
13
|
-
const Field = require("./Field-
|
13
|
+
const Field = require("./Field-Ibi32diw.js");
|
14
14
|
const Icons = require("@strapi/icons");
|
15
|
-
const
|
16
|
-
const relations = require("./relations-
|
15
|
+
const styledComponents = require("styled-components");
|
16
|
+
const relations = require("./relations-bRxcNv1q.js");
|
17
17
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
18
18
|
function _interopNamespace(e) {
|
19
19
|
if (e && e.__esModule)
|
@@ -35,14 +35,13 @@ function _interopNamespace(e) {
|
|
35
35
|
}
|
36
36
|
const React__namespace = /* @__PURE__ */ _interopNamespace(React);
|
37
37
|
const pipe__default = /* @__PURE__ */ _interopDefault(pipe);
|
38
|
-
const
|
39
|
-
const StyledAlert = styled__default.default(designSystem.Alert).attrs({ closeLabel: "Close", onClose: () => {
|
38
|
+
const StyledAlert = styledComponents.styled(designSystem.Alert).attrs({ closeLabel: "Close", onClose: () => {
|
40
39
|
} })`
|
41
40
|
button {
|
42
41
|
display: none;
|
43
42
|
}
|
44
43
|
`;
|
45
|
-
const LinkEllipsis =
|
44
|
+
const LinkEllipsis = styledComponents.styled(designSystem.Link)`
|
46
45
|
display: block;
|
47
46
|
|
48
47
|
& > span {
|
@@ -55,13 +54,13 @@ const LinkEllipsis = styled__default.default(designSystem.Link)`
|
|
55
54
|
const CustomRelationInput = (props) => {
|
56
55
|
const { formatMessage } = reactIntl.useIntl();
|
57
56
|
const field = strapiAdmin.useField(props.name);
|
58
|
-
|
59
|
-
|
60
|
-
meta: { missingCount: 0 }
|
61
|
-
}
|
62
|
-
if (!formattedFieldValue || formattedFieldValue.results.length === 0) {
|
57
|
+
let formattedFieldValue;
|
58
|
+
if (field) {
|
59
|
+
formattedFieldValue = Array.isArray(field.value) ? { results: field.value, meta: { missingCount: 0 } } : field.value;
|
60
|
+
}
|
61
|
+
if (!formattedFieldValue || formattedFieldValue.results.length === 0 && formattedFieldValue.meta.missingCount === 0) {
|
63
62
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
64
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
63
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { action: props.labelAction, children: props.label }),
|
65
64
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { marginTop: 1, children: /* @__PURE__ */ jsxRuntime.jsx(StyledAlert, { variant: "default", children: formatMessage({
|
66
65
|
id: "content-manager.history.content.no-relations",
|
67
66
|
defaultMessage: "No relations."
|
@@ -70,7 +69,7 @@ const CustomRelationInput = (props) => {
|
|
70
69
|
}
|
71
70
|
const { results, meta } = formattedFieldValue;
|
72
71
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
|
73
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
72
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: props.label }),
|
74
73
|
results.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", gap: 2, marginTop: 1, alignItems: "stretch", children: results.map((relationData) => {
|
75
74
|
const href = `../${index.COLLECTION_TYPES}/${props.attribute.targetModel}/${relationData.documentId}`;
|
76
75
|
const label = relations.getRelationLabel(relationData, props.mainField);
|
@@ -86,14 +85,15 @@ const CustomRelationInput = (props) => {
|
|
86
85
|
background: "neutral150",
|
87
86
|
justifyContent: "space-between",
|
88
87
|
children: [
|
89
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { minWidth: 0, paddingTop: 1, paddingBottom: 1, paddingRight: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { description: label, children: /* @__PURE__ */ jsxRuntime.jsx(LinkEllipsis, {
|
88
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { minWidth: 0, paddingTop: 1, paddingBottom: 1, paddingRight: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { description: label, children: /* @__PURE__ */ jsxRuntime.jsx(LinkEllipsis, { tag: reactRouterDom.NavLink, to: href, children: label }) }) }),
|
90
89
|
/* @__PURE__ */ jsxRuntime.jsx(index.DocumentStatus, { status: relationData.status })
|
91
90
|
]
|
92
91
|
},
|
93
92
|
relationData.documentId
|
94
93
|
);
|
95
94
|
}) }),
|
96
|
-
meta.missingCount > 0 && /* @
|
95
|
+
meta.missingCount > 0 && /* @ts-expect-error – we dont need closeLabel */
|
96
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
97
97
|
StyledAlert,
|
98
98
|
{
|
99
99
|
marginTop: 1,
|
@@ -113,17 +113,13 @@ const CustomRelationInput = (props) => {
|
|
113
113
|
{ number: meta.missingCount }
|
114
114
|
)
|
115
115
|
}
|
116
|
-
)
|
117
|
-
results.length === 0 && meta.missingCount === 0 && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { marginTop: 1, children: /* @__PURE__ */ jsxRuntime.jsx(StyledAlert, { variant: "default", children: formatMessage({
|
118
|
-
id: "content-manager.history.content.no-relations",
|
119
|
-
defaultMessage: "No relations."
|
120
|
-
}) }) })
|
116
|
+
)
|
121
117
|
] });
|
122
118
|
};
|
123
119
|
const CustomMediaInput = (props) => {
|
124
|
-
const {
|
125
|
-
|
126
|
-
|
120
|
+
const { value } = strapiAdmin.useField(props.name);
|
121
|
+
const results = value ? value.results : [];
|
122
|
+
const meta = value ? value.meta : { missingCount: 0 };
|
127
123
|
const { formatMessage } = reactIntl.useIntl();
|
128
124
|
const fields = strapiAdmin.useStrapiApp("CustomMediaInput", (state) => state.fields);
|
129
125
|
const MediaLibrary = fields.media;
|
@@ -154,12 +150,39 @@ const CustomMediaInput = (props) => {
|
|
154
150
|
)
|
155
151
|
] });
|
156
152
|
};
|
153
|
+
const getLabelAction = (labelAction) => {
|
154
|
+
if (!React__namespace.isValidElement(labelAction)) {
|
155
|
+
return labelAction;
|
156
|
+
}
|
157
|
+
const labelActionTitleId = labelAction.props.title.id;
|
158
|
+
if (labelActionTitleId === "i18n.Field.localized") {
|
159
|
+
return React__namespace.cloneElement(labelAction, {
|
160
|
+
...labelAction.props,
|
161
|
+
title: {
|
162
|
+
id: "history.content.localized",
|
163
|
+
defaultMessage: "This value is specific to this locale. If you restore this version, the content will not be replaced for other locales."
|
164
|
+
}
|
165
|
+
});
|
166
|
+
}
|
167
|
+
if (labelActionTitleId === "i18n.Field.not-localized") {
|
168
|
+
return React__namespace.cloneElement(labelAction, {
|
169
|
+
...labelAction.props,
|
170
|
+
title: {
|
171
|
+
id: "history.content.not-localized",
|
172
|
+
defaultMessage: "This value is common to all locales. If you restore this version and save the changes, the content will be replaced for all locales."
|
173
|
+
}
|
174
|
+
});
|
175
|
+
}
|
176
|
+
return labelAction;
|
177
|
+
};
|
157
178
|
const VersionInputRenderer = ({
|
158
179
|
visible,
|
159
180
|
hint: providedHint,
|
160
181
|
shouldIgnoreRBAC = false,
|
182
|
+
labelAction,
|
161
183
|
...props
|
162
184
|
}) => {
|
185
|
+
const customLabelAction = getLabelAction(labelAction);
|
163
186
|
const { formatMessage } = reactIntl.useIntl();
|
164
187
|
const version = useHistoryContext("VersionContent", (state) => state.selectedVersion);
|
165
188
|
const configuration = useHistoryContext("VersionContent", (state) => state.configuration);
|
@@ -193,7 +216,7 @@ const VersionInputRenderer = ({
|
|
193
216
|
const addedAttributes = version.meta.unknownAttributes.added;
|
194
217
|
if (Object.keys(addedAttributes).includes(props.name)) {
|
195
218
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "flex-start", gap: 1, children: [
|
196
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
219
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: props.label }),
|
197
220
|
/* @__PURE__ */ jsxRuntime.jsx(
|
198
221
|
StyledAlert,
|
199
222
|
{
|
@@ -217,29 +240,46 @@ const VersionInputRenderer = ({
|
|
217
240
|
if (attributeHasCustomFieldProperty(props.attribute)) {
|
218
241
|
const CustomInput = lazyComponentStore[props.attribute.customField];
|
219
242
|
if (CustomInput) {
|
220
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
243
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
244
|
+
CustomInput,
|
245
|
+
{
|
246
|
+
...props,
|
247
|
+
hint,
|
248
|
+
labelAction: customLabelAction,
|
249
|
+
disabled: fieldIsDisabled
|
250
|
+
}
|
251
|
+
);
|
221
252
|
}
|
222
253
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
223
254
|
strapiAdmin.InputRenderer,
|
224
255
|
{
|
225
256
|
...props,
|
226
257
|
hint,
|
258
|
+
labelAction: customLabelAction,
|
227
259
|
type: props.attribute.customField,
|
228
260
|
disabled: fieldIsDisabled
|
229
261
|
}
|
230
262
|
);
|
231
263
|
}
|
232
264
|
if (props.type === "media") {
|
233
|
-
return /* @__PURE__ */ jsxRuntime.jsx(CustomMediaInput, { ...props, disabled: fieldIsDisabled });
|
265
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CustomMediaInput, { ...props, labelAction: customLabelAction, disabled: fieldIsDisabled });
|
234
266
|
}
|
235
267
|
const addedInputTypes = Object.keys(fields);
|
236
268
|
if (!attributeHasCustomFieldProperty(props.attribute) && addedInputTypes.includes(props.type)) {
|
237
269
|
const CustomInput = fields[props.type];
|
238
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
270
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
271
|
+
CustomInput,
|
272
|
+
{
|
273
|
+
...props,
|
274
|
+
hint,
|
275
|
+
labelAction: customLabelAction,
|
276
|
+
disabled: fieldIsDisabled
|
277
|
+
}
|
278
|
+
);
|
239
279
|
}
|
240
280
|
switch (props.type) {
|
241
281
|
case "blocks":
|
242
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Field.
|
282
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Field.MemoizedBlocksInput, { ...props, hint, type: props.type, disabled: fieldIsDisabled });
|
243
283
|
case "component":
|
244
284
|
const { layout } = componentsLayout[props.attribute.component];
|
245
285
|
const [remainingFieldsLayout] = getRemaingFieldsLayout({
|
@@ -249,29 +289,65 @@ const VersionInputRenderer = ({
|
|
249
289
|
schemaAttributes: components[props.attribute.component].attributes
|
250
290
|
});
|
251
291
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
252
|
-
Field.
|
292
|
+
Field.MemoizedComponentInput,
|
253
293
|
{
|
254
294
|
...props,
|
255
295
|
layout: [...layout, ...remainingFieldsLayout || []],
|
256
296
|
hint,
|
297
|
+
labelAction: customLabelAction,
|
257
298
|
disabled: fieldIsDisabled,
|
258
299
|
children: (inputProps) => /* @__PURE__ */ jsxRuntime.jsx(VersionInputRenderer, { ...inputProps, shouldIgnoreRBAC: true })
|
259
300
|
}
|
260
301
|
);
|
261
302
|
case "dynamiczone":
|
262
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
303
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
304
|
+
Field.DynamicZone,
|
305
|
+
{
|
306
|
+
...props,
|
307
|
+
hint,
|
308
|
+
labelAction: customLabelAction,
|
309
|
+
disabled: fieldIsDisabled
|
310
|
+
}
|
311
|
+
);
|
263
312
|
case "relation":
|
264
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
313
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
314
|
+
CustomRelationInput,
|
315
|
+
{
|
316
|
+
...props,
|
317
|
+
hint,
|
318
|
+
labelAction: customLabelAction,
|
319
|
+
disabled: fieldIsDisabled
|
320
|
+
}
|
321
|
+
);
|
265
322
|
case "richtext":
|
266
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
323
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
324
|
+
Field.MemoizedWysiwyg,
|
325
|
+
{
|
326
|
+
...props,
|
327
|
+
hint,
|
328
|
+
type: props.type,
|
329
|
+
labelAction: customLabelAction,
|
330
|
+
disabled: fieldIsDisabled
|
331
|
+
}
|
332
|
+
);
|
267
333
|
case "uid":
|
268
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
334
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
335
|
+
Field.MemoizedUIDInput,
|
336
|
+
{
|
337
|
+
...props,
|
338
|
+
hint,
|
339
|
+
type: props.type,
|
340
|
+
labelAction: customLabelAction,
|
341
|
+
disabled: fieldIsDisabled
|
342
|
+
}
|
343
|
+
);
|
269
344
|
case "enumeration":
|
270
345
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
271
346
|
strapiAdmin.InputRenderer,
|
272
347
|
{
|
273
348
|
...props,
|
274
349
|
hint,
|
350
|
+
labelAction: customLabelAction,
|
275
351
|
options: props.attribute.enum.map((value) => ({ value })),
|
276
352
|
type: props.customField ? "custom-field" : props.type,
|
277
353
|
disabled: fieldIsDisabled
|
@@ -284,6 +360,7 @@ const VersionInputRenderer = ({
|
|
284
360
|
{
|
285
361
|
...restProps,
|
286
362
|
hint,
|
363
|
+
labelAction: customLabelAction,
|
287
364
|
type: props.customField ? "custom-field" : props.type,
|
288
365
|
disabled: fieldIsDisabled
|
289
366
|
}
|
@@ -337,7 +414,7 @@ const FormPanel = ({ panel }) => {
|
|
337
414
|
if (panel.some((row) => row.some((field) => field.type === "dynamiczone"))) {
|
338
415
|
const [row] = panel;
|
339
416
|
const [field] = row;
|
340
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid, { gap: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
417
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(VersionInputRenderer, { ...field }) }) }, field.name);
|
341
418
|
}
|
342
419
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
343
420
|
designSystem.Box,
|
@@ -350,8 +427,8 @@ const FormPanel = ({ panel }) => {
|
|
350
427
|
paddingTop: 6,
|
351
428
|
paddingBottom: 6,
|
352
429
|
borderColor: "neutral150",
|
353
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: panel.map((row, gridRowIndex) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid, { gap: 4, children: row.map(({ size, ...field }) => {
|
354
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
430
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: panel.map((row, gridRowIndex) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
431
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: size, s: 12, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(VersionInputRenderer, { ...field }) }, field.name);
|
355
432
|
}) }, gridRowIndex)) })
|
356
433
|
}
|
357
434
|
);
|
@@ -483,12 +560,12 @@ const VersionHeader = ({ headerId }) => {
|
|
483
560
|
const pluginsQueryParams = qs.stringify({ plugins: query.plugins }, { encode: false });
|
484
561
|
if (collectionType === index.COLLECTION_TYPES) {
|
485
562
|
return {
|
486
|
-
pathname:
|
563
|
+
pathname: "..",
|
487
564
|
search: pluginsQueryParams
|
488
565
|
};
|
489
566
|
}
|
490
567
|
return {
|
491
|
-
pathname:
|
568
|
+
pathname: "..",
|
492
569
|
search: pluginsQueryParams
|
493
570
|
};
|
494
571
|
};
|
@@ -504,7 +581,7 @@ const VersionHeader = ({ headerId }) => {
|
|
504
581
|
body: { contentType: version.contentType }
|
505
582
|
});
|
506
583
|
if ("data" in response) {
|
507
|
-
navigate(getNextNavigation());
|
584
|
+
navigate(getNextNavigation(), { relative: "path" });
|
508
585
|
toggleNotification({
|
509
586
|
type: "success",
|
510
587
|
title: formatMessage({
|
@@ -533,7 +610,7 @@ const VersionHeader = ({ headerId }) => {
|
|
533
610
|
});
|
534
611
|
}
|
535
612
|
};
|
536
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
613
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Root, { open: isConfirmDialogOpen, onOpenChange: setIsConfirmDialogOpen, children: [
|
537
614
|
/* @__PURE__ */ jsxRuntime.jsx(
|
538
615
|
strapiAdmin.Layouts.BaseHeader,
|
539
616
|
{
|
@@ -560,8 +637,10 @@ const VersionHeader = ({ headerId }) => {
|
|
560
637
|
designSystem.Link,
|
561
638
|
{
|
562
639
|
startIcon: /* @__PURE__ */ jsxRuntime.jsx(Icons.ArrowLeft, {}),
|
563
|
-
|
640
|
+
tag: reactRouterDom.NavLink,
|
564
641
|
to: getNextNavigation(),
|
642
|
+
relative: "path",
|
643
|
+
isExternal: false,
|
565
644
|
children: formatMessage({
|
566
645
|
id: "global.back",
|
567
646
|
defaultMessage: "Back"
|
@@ -569,7 +648,7 @@ const VersionHeader = ({ headerId }) => {
|
|
569
648
|
}
|
570
649
|
),
|
571
650
|
sticky: false,
|
572
|
-
primaryAction: /* @__PURE__ */ jsxRuntime.jsx(
|
651
|
+
primaryAction: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
573
652
|
designSystem.Button,
|
574
653
|
{
|
575
654
|
disabled: !allowedActions.canUpdate || isCurrentVersion,
|
@@ -581,16 +660,13 @@ const VersionHeader = ({ headerId }) => {
|
|
581
660
|
defaultMessage: "Restore"
|
582
661
|
})
|
583
662
|
}
|
584
|
-
)
|
663
|
+
) })
|
585
664
|
}
|
586
665
|
),
|
587
666
|
/* @__PURE__ */ jsxRuntime.jsx(
|
588
667
|
strapiAdmin.ConfirmDialog,
|
589
668
|
{
|
590
|
-
isOpen: isConfirmDialogOpen,
|
591
|
-
onClose: () => setIsConfirmDialogOpen(false),
|
592
669
|
onConfirm: handleRestore,
|
593
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(Icons.WarningCircle, {}),
|
594
670
|
endAction: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "secondary", onClick: handleRestore, loading: isLoading, children: formatMessage({
|
595
671
|
id: "content-manager.history.restore.confirm.button",
|
596
672
|
defaultMessage: "Restore"
|
@@ -604,6 +680,7 @@ const VersionHeader = ({ headerId }) => {
|
|
604
680
|
gap: 2,
|
605
681
|
textAlign: "center",
|
606
682
|
children: [
|
683
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.WarningCircle, { width: "24px", height: "24px", fill: "danger600" }) }),
|
607
684
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
|
608
685
|
id: "content-manager.history.restore.confirm.title",
|
609
686
|
defaultMessage: "Are you sure you want to restore this version?"
|
@@ -676,23 +753,24 @@ const VersionCard = ({ version, isCurrent }) => {
|
|
676
753
|
borderWidth: "1px",
|
677
754
|
borderStyle: "solid",
|
678
755
|
borderColor: isActive ? "primary600" : "neutral200",
|
756
|
+
color: "neutral800",
|
679
757
|
paddingTop: 4,
|
680
758
|
paddingBottom: 4,
|
681
759
|
paddingLeft: 5,
|
682
760
|
paddingRight: 5,
|
683
|
-
|
761
|
+
tag: reactRouterDom.Link,
|
684
762
|
to: `?${qs.stringify({ ...query, id: version.id })}`,
|
685
763
|
style: { textDecoration: "none" },
|
686
764
|
children: [
|
687
765
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 1, alignItems: "flex-start", children: [
|
688
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, {
|
766
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "h3", fontWeight: "semiBold", children: formatDate(version.createdAt, {
|
689
767
|
day: "numeric",
|
690
768
|
month: "numeric",
|
691
769
|
year: "numeric",
|
692
770
|
hour: "2-digit",
|
693
771
|
minute: "2-digit"
|
694
772
|
}) }),
|
695
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, {
|
773
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "p", variant: "pi", textColor: "neutral600", children: formatMessage(
|
696
774
|
{
|
697
775
|
id: "content-manager.history.sidebar.versionDescription",
|
698
776
|
defaultMessage: "{distanceToNow}{isAnonymous, select, true {} other { by {author}}}{isCurrent, select, true { <b>(current)</b>} other {}}"
|
@@ -748,7 +826,7 @@ const VersionsList = () => {
|
|
748
826
|
borderColor: "neutral200",
|
749
827
|
borderWidth: "0 0 0 1px",
|
750
828
|
borderStyle: "solid",
|
751
|
-
|
829
|
+
tag: "aside",
|
752
830
|
children: [
|
753
831
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
754
832
|
designSystem.Flex,
|
@@ -759,9 +837,9 @@ const VersionsList = () => {
|
|
759
837
|
borderColor: "neutral200",
|
760
838
|
borderWidth: "0 0 1px",
|
761
839
|
borderStyle: "solid",
|
762
|
-
|
840
|
+
tag: "header",
|
763
841
|
children: [
|
764
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, {
|
842
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "h2", variant: "omega", fontWeight: "semiBold", children: formatMessage({
|
765
843
|
id: "content-manager.history.sidebar.title",
|
766
844
|
defaultMessage: "Versions"
|
767
845
|
}) }),
|
@@ -783,7 +861,7 @@ const VersionsList = () => {
|
|
783
861
|
paddingBottom: 5,
|
784
862
|
paddingLeft: 4,
|
785
863
|
paddingRight: 4,
|
786
|
-
|
864
|
+
tag: "ul",
|
787
865
|
alignItems: "stretch",
|
788
866
|
children: versions.data.map((version, index2) => /* @__PURE__ */ jsxRuntime.jsx(
|
789
867
|
"li",
|
@@ -850,7 +928,22 @@ const HistoryPage = () => {
|
|
850
928
|
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Loading, {});
|
851
929
|
}
|
852
930
|
if (!versionsResponse.isError && !versionsResponse.data?.data?.length) {
|
853
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
931
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
932
|
+
strapiAdmin.Page.NoData,
|
933
|
+
{
|
934
|
+
action: /* @__PURE__ */ jsxRuntime.jsx(
|
935
|
+
designSystem.Link,
|
936
|
+
{
|
937
|
+
tag: reactRouterDom.NavLink,
|
938
|
+
to: `/content-manager/${collectionType}/${slug}${documentId ? `/${documentId}` : ""}`,
|
939
|
+
children: formatMessage({
|
940
|
+
id: "global.back",
|
941
|
+
defaultMessage: "Back"
|
942
|
+
})
|
943
|
+
}
|
944
|
+
)
|
945
|
+
}
|
946
|
+
) });
|
854
947
|
}
|
855
948
|
if (versionsResponse.data?.data?.length && !selectedVersionId) {
|
856
949
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
@@ -957,4 +1050,4 @@ const ProtectedHistoryPage = () => {
|
|
957
1050
|
exports.HistoryProvider = HistoryProvider;
|
958
1051
|
exports.ProtectedHistoryPage = ProtectedHistoryPage;
|
959
1052
|
exports.useHistoryContext = useHistoryContext;
|
960
|
-
//# sourceMappingURL=History-
|
1053
|
+
//# sourceMappingURL=History-C9auUkDi.js.map
|