@strapi/i18n 0.0.0-experimental.afa3b513b8f95459043f33fb94f4bac03af1474f → 0.0.0-experimental.b05633daea1bf090c66312b8ab30ec13bdb52f57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (40) hide show
  1. package/dist/_chunks/{SettingsPage-BjxjwEOb.mjs → SettingsPage-BAx9nmep.mjs} +4 -4
  2. package/dist/_chunks/SettingsPage-BAx9nmep.mjs.map +1 -0
  3. package/dist/_chunks/{SettingsPage-CfTmCkup.js → SettingsPage-BTgjb2KS.js} +5 -6
  4. package/dist/_chunks/SettingsPage-BTgjb2KS.js.map +1 -0
  5. package/dist/_chunks/{en-DWpfm8h5.js → en-BKBz3tro.js} +5 -4
  6. package/dist/_chunks/en-BKBz3tro.js.map +1 -0
  7. package/dist/_chunks/{en-2xztdZE1.mjs → en-DlXfy6Gy.mjs} +5 -4
  8. package/dist/_chunks/en-DlXfy6Gy.mjs.map +1 -0
  9. package/dist/_chunks/{index-5XLZwzwx.js → index-3yyF237r.js} +94 -36
  10. package/dist/_chunks/index-3yyF237r.js.map +1 -0
  11. package/dist/_chunks/{index-D-qx3tz4.mjs → index-B0NijiBB.mjs} +94 -35
  12. package/dist/_chunks/index-B0NijiBB.mjs.map +1 -0
  13. package/dist/admin/index.js +1 -1
  14. package/dist/admin/index.mjs +1 -1
  15. package/dist/admin/src/components/CMHeaderActions.d.ts +5 -3
  16. package/dist/admin/src/components/CreateLocale.d.ts +6 -6
  17. package/dist/server/index.js +398 -421
  18. package/dist/server/index.js.map +1 -1
  19. package/dist/server/index.mjs +399 -421
  20. package/dist/server/index.mjs.map +1 -1
  21. package/dist/server/src/index.d.ts +6 -0
  22. package/dist/server/src/index.d.ts.map +1 -1
  23. package/dist/server/src/register.d.ts.map +1 -1
  24. package/dist/server/src/services/index.d.ts +6 -0
  25. package/dist/server/src/services/index.d.ts.map +1 -1
  26. package/dist/server/src/services/sanitize/index.d.ts +11 -0
  27. package/dist/server/src/services/sanitize/index.d.ts.map +1 -0
  28. package/dist/server/src/utils/index.d.ts +2 -0
  29. package/dist/server/src/utils/index.d.ts.map +1 -1
  30. package/package.json +13 -13
  31. package/dist/_chunks/SettingsPage-BjxjwEOb.mjs.map +0 -1
  32. package/dist/_chunks/SettingsPage-CfTmCkup.js.map +0 -1
  33. package/dist/_chunks/en-2xztdZE1.mjs.map +0 -1
  34. package/dist/_chunks/en-DWpfm8h5.js.map +0 -1
  35. package/dist/_chunks/index-5XLZwzwx.js.map +0 -1
  36. package/dist/_chunks/index-D-qx3tz4.mjs.map +0 -1
  37. package/dist/server/src/migrations/content-type/disable/index.d.ts +0 -3
  38. package/dist/server/src/migrations/content-type/disable/index.d.ts.map +0 -1
  39. package/dist/server/src/migrations/content-type/enable/index.d.ts +0 -3
  40. package/dist/server/src/migrations/content-type/enable/index.d.ts.map +0 -1
@@ -6,7 +6,7 @@ import { EmptyDocuments } from "@strapi/icons/symbols";
6
6
  import { useIntl } from "react-intl";
7
7
  import { Plus, Check, Trash, Pencil } from "@strapi/icons";
8
8
  import * as yup from "yup";
9
- import { g as getTranslation, u as useCreateLocaleMutation, a as useGetDefaultLocalesQuery, b as useDeleteLocaleMutation, c as useUpdateLocaleMutation, d as useGetLocalesQuery, P as PERMISSIONS } from "./index-D-qx3tz4.mjs";
9
+ import { g as getTranslation, u as useCreateLocaleMutation, a as useGetDefaultLocalesQuery, b as useDeleteLocaleMutation, c as useUpdateLocaleMutation, d as useGetLocalesQuery, P as PERMISSIONS } from "./index-B0NijiBB.mjs";
10
10
  const isBaseQueryError = (error) => {
11
11
  return error.name !== void 0;
12
12
  };
@@ -32,11 +32,11 @@ const CreateLocale = ({ disabled, variant = "default" }) => {
32
32
  ] });
33
33
  };
34
34
  const LOCALE_SCHEMA = yup.object().shape({
35
- code: yup.string().required({
35
+ code: yup.string().nullable().required({
36
36
  id: "Settings.locales.modal.create.code.error",
37
37
  defaultMessage: "Please select a locale"
38
38
  }),
39
- name: yup.string().max(50, {
39
+ name: yup.string().nullable().max(50, {
40
40
  id: "Settings.locales.modal.create.name.error.min",
41
41
  defaultMessage: "The locale display name can only be less than 50 characters."
42
42
  }).required({
@@ -551,4 +551,4 @@ export {
551
551
  ProtectedSettingsPage,
552
552
  SettingsPage
553
553
  };
554
- //# sourceMappingURL=SettingsPage-BjxjwEOb.mjs.map
554
+ //# sourceMappingURL=SettingsPage-BAx9nmep.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SettingsPage-BAx9nmep.mjs","sources":["../../admin/src/utils/baseQuery.ts","../../admin/src/components/CreateLocale.tsx","../../admin/src/components/DeleteLocale.tsx","../../admin/src/components/EditLocale.tsx","../../admin/src/components/LocaleTable.tsx","../../admin/src/pages/SettingsPage.tsx"],"sourcesContent":["import { SerializedError } from '@reduxjs/toolkit';\nimport { type ApiError, type UnknownApiError } from '@strapi/admin/strapi-admin';\n\ntype BaseQueryError = ApiError | UnknownApiError | SerializedError;\n\nconst isBaseQueryError = (error: BaseQueryError): error is ApiError | UnknownApiError => {\n return error.name !== undefined;\n};\n\nexport { isBaseQueryError };\n","import * as React from 'react';\n\nimport {\n Form,\n type InputProps,\n InputRenderer,\n useField,\n type FormHelpers,\n useForm,\n useAPIErrorHandler,\n useNotification,\n useAuth,\n} from '@strapi/admin/strapi-admin';\nimport {\n Box,\n Button,\n ButtonProps,\n Divider,\n Field,\n Flex,\n Grid,\n Modal,\n SingleSelect,\n SingleSelectOption,\n Tabs,\n Typography,\n useId,\n} from '@strapi/design-system';\nimport { Check, Plus } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\nimport * as yup from 'yup';\n\nimport { CreateLocale } from '../../../shared/contracts/locales';\nimport { useCreateLocaleMutation, useGetDefaultLocalesQuery } from '../services/locales';\nimport { isBaseQueryError } from '../utils/baseQuery';\nimport { getTranslation } from '../utils/getTranslation';\n\n/* -------------------------------------------------------------------------------------------------\n * CreateLocale\n * -----------------------------------------------------------------------------------------------*/\n\ninterface CreateLocaleProps extends Pick<ButtonProps, 'disabled' | 'variant'> {}\n\nconst CreateLocale = ({ disabled, variant = 'default' }: CreateLocaleProps) => {\n const { formatMessage } = useIntl();\n const [visible, setVisible] = React.useState(false);\n\n return (\n <Modal.Root open={visible} onOpenChange={setVisible}>\n <Modal.Trigger>\n <Button\n variant={variant}\n disabled={disabled}\n startIcon={<Plus />}\n onClick={() => setVisible(true)}\n size=\"S\"\n >\n {formatMessage({\n id: getTranslation('Settings.list.actions.add'),\n defaultMessage: 'Add new locale',\n })}\n </Button>\n </Modal.Trigger>\n <CreateModal onClose={() => setVisible(false)} />\n </Modal.Root>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * CreateModal\n * -----------------------------------------------------------------------------------------------*/\n\nconst LOCALE_SCHEMA = yup.object().shape({\n code: yup.string().nullable().required({\n id: 'Settings.locales.modal.create.code.error',\n defaultMessage: 'Please select a locale',\n }),\n name: yup\n .string()\n .nullable()\n .max(50, {\n id: 'Settings.locales.modal.create.name.error.min',\n defaultMessage: 'The locale display name can only be less than 50 characters.',\n })\n .required({\n id: 'Settings.locales.modal.create.name.error.required',\n defaultMessage: 'Please give the locale a display name',\n }),\n isDefault: yup.boolean(),\n});\n\ntype FormValues = CreateLocale.Request['body'];\n\nconst initialFormValues = {\n code: '',\n name: '',\n isDefault: false,\n} satisfies FormValues;\n\ntype ModalCreateProps = {\n onClose: () => void;\n};\n\nconst CreateModal = ({ onClose }: ModalCreateProps) => {\n const titleId = useId();\n const { toggleNotification } = useNotification();\n const {\n _unstableFormatAPIError: formatAPIError,\n _unstableFormatValidationErrors: formatValidationErrors,\n } = useAPIErrorHandler();\n const [createLocale] = useCreateLocaleMutation();\n const { formatMessage } = useIntl();\n const refetchPermissions = useAuth('CreateModal', (state) => state.refetchPermissions);\n\n const handleSubmit = async (values: FormValues, helpers: FormHelpers<FormValues>) => {\n try {\n const res = await createLocale(values);\n\n if ('error' in res) {\n if (isBaseQueryError(res.error) && res.error.name === 'ValidationError') {\n helpers.setErrors(formatValidationErrors(res.error));\n } else {\n toggleNotification({ type: 'danger', message: formatAPIError(res.error) });\n }\n\n return;\n }\n\n toggleNotification({\n type: 'success',\n message: formatMessage({\n id: getTranslation('Settings.locales.modal.create.success'),\n defaultMessage: 'Created locale',\n }),\n });\n\n refetchPermissions();\n onClose();\n } catch (err) {\n toggleNotification({\n type: 'danger',\n message: formatMessage({\n id: 'notification.error',\n defaultMessage: 'An error occurred, please try again',\n }),\n });\n }\n };\n\n return (\n <Modal.Content>\n <Form\n method=\"POST\"\n initialValues={initialFormValues}\n validationSchema={LOCALE_SCHEMA}\n onSubmit={handleSubmit}\n >\n <Modal.Header>\n <Modal.Title>\n {formatMessage({\n id: getTranslation('Settings.list.actions.add'),\n defaultMessage: 'Add new locale',\n })}\n </Modal.Title>\n </Modal.Header>\n <Modal.Body>\n <Tabs.Root variant=\"simple\" defaultValue=\"basic\">\n <Flex justifyContent=\"space-between\">\n <Typography tag=\"h2\" variant=\"beta\" id={titleId}>\n {formatMessage({\n id: getTranslation('Settings.locales.modal.title'),\n defaultMessage: 'Configuration',\n })}\n </Typography>\n <Tabs.List aria-labelledby={titleId}>\n <Tabs.Trigger value=\"basic\">\n {formatMessage({\n id: getTranslation('Settings.locales.modal.base'),\n defaultMessage: 'Basic settings',\n })}\n </Tabs.Trigger>\n <Tabs.Trigger value=\"advanced\">\n {formatMessage({\n id: getTranslation('Settings.locales.modal.advanced'),\n defaultMessage: 'Advanced settings',\n })}\n </Tabs.Trigger>\n </Tabs.List>\n </Flex>\n\n <Divider />\n\n <Box paddingTop={7} paddingBottom={7}>\n <Tabs.Content value=\"basic\">\n <BaseForm />\n </Tabs.Content>\n <Tabs.Content value=\"advanced\">\n <AdvancedForm />\n </Tabs.Content>\n </Box>\n </Tabs.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 <SubmitButton />\n </Modal.Footer>\n </Form>\n </Modal.Content>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * SubmitButton\n * -----------------------------------------------------------------------------------------------*/\n\nconst SubmitButton = () => {\n const { formatMessage } = useIntl();\n const isSubmitting = useForm('SubmitButton', (state) => state.isSubmitting);\n const modified = useForm('SubmitButton', (state) => state.modified);\n\n return (\n <Button type=\"submit\" startIcon={<Check />} disabled={isSubmitting || !modified}>\n {formatMessage({ id: 'global.save', defaultMessage: 'Save' })}\n </Button>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * BaseForm\n * -----------------------------------------------------------------------------------------------*/\n\ninterface BaseFormProps {\n mode?: 'create' | 'edit';\n}\n\nconst BaseForm = ({ mode = 'create' }: BaseFormProps) => {\n const { formatMessage } = useIntl();\n const { toggleNotification } = useNotification();\n const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();\n\n const { data: defaultLocales, error } = useGetDefaultLocalesQuery();\n\n React.useEffect(() => {\n if (error) {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(error),\n });\n }\n }, [error, formatAPIError, toggleNotification]);\n\n if (!Array.isArray(defaultLocales)) {\n return null;\n }\n\n const options = defaultLocales.map((locale) => ({\n label: locale.name,\n value: locale.code,\n }));\n\n const translatedForm = [\n {\n disabled: mode !== 'create',\n label: {\n id: getTranslation('Settings.locales.modal.create.code.label'),\n defaultMessage: 'Locales',\n },\n name: 'code',\n options,\n placeholder: {\n id: 'components.placeholder.select',\n defaultMessage: 'Select',\n },\n required: true,\n size: 6,\n type: 'enumeration' as const,\n },\n {\n hint: {\n id: getTranslation('Settings.locales.modal.create.name.label.description'),\n defaultMessage: 'Locale will be displayed under that name in the administration panel',\n },\n label: {\n id: getTranslation('Settings.locales.modal.create.name.label'),\n defaultMessage: 'Locale display name',\n },\n name: 'name',\n required: true,\n size: 6,\n type: 'string' as const,\n },\n ].map((field) => ({\n ...field,\n hint: field.hint ? formatMessage(field.hint) : undefined,\n label: formatMessage(field.label),\n placeholder: field.placeholder ? formatMessage(field.placeholder) : undefined,\n }));\n\n return (\n <Grid.Root gap={4}>\n {translatedForm.map(({ size, ...field }) => (\n <Grid.Item key={field.name} col={size} direction=\"column\" alignItems=\"stretch\">\n <FormRenderer {...field} />\n </Grid.Item>\n ))}\n </Grid.Root>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * AdvancedForm\n * -----------------------------------------------------------------------------------------------*/\n\ntype AdvancedFormProps = {\n isDefaultLocale?: boolean;\n};\n\nconst AdvancedForm = ({ isDefaultLocale }: AdvancedFormProps) => {\n const { formatMessage } = useIntl();\n\n const form = [\n {\n disabled: isDefaultLocale,\n hint: {\n id: getTranslation('Settings.locales.modal.advanced.setAsDefault.hint'),\n defaultMessage: 'One default locale is required, change it by selecting another one',\n },\n label: {\n id: getTranslation('Settings.locales.modal.advanced.setAsDefault'),\n defaultMessage: 'Set as default locale',\n },\n name: 'isDefault',\n size: 6,\n type: 'boolean' as const,\n },\n ].map((field) => ({\n ...field,\n hint: field.hint ? formatMessage(field.hint) : undefined,\n label: formatMessage(field.label),\n })) satisfies InputProps[];\n\n return (\n <Grid.Root gap={4}>\n {form.map(({ size, ...field }) => (\n <Grid.Item key={field.name} col={size} direction=\"column\" alignItems=\"stretch\">\n <FormRenderer {...field} />\n </Grid.Item>\n ))}\n </Grid.Root>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * FormRenderer\n * -----------------------------------------------------------------------------------------------*/\n\nconst FormRenderer = (field: InputProps) => {\n switch (field.type) {\n /**\n * This will override the default input renderer\n * choice for `enumeration`.\n */\n case 'enumeration':\n return <EnumerationInput {...field} />;\n default:\n return <InputRenderer {...field} />;\n }\n};\n\nconst EnumerationInput = ({\n disabled,\n hint,\n label,\n name,\n options,\n placeholder,\n required,\n}: Extract<InputProps, { type: 'enumeration' }>) => {\n const { value, error, onChange } = useField(name);\n const { data: defaultLocales = [] } = useGetDefaultLocalesQuery();\n\n const handleChange = (value: string) => {\n if (Array.isArray(defaultLocales)) {\n // We know it exists because the options are created from the list of default locales\n const locale = defaultLocales.find((locale) => locale.code === value)!;\n\n onChange(name, value);\n // This lets us automatically fill the name field with the locale name\n onChange('name', locale.name);\n } else {\n onChange(name, value);\n }\n };\n\n return (\n <Field.Root error={error} hint={hint} name={name} required={required}>\n <Field.Label>{label}</Field.Label>\n <SingleSelect\n disabled={disabled}\n // @ts-expect-error – This will dissapear when the DS removes support for numbers to be returned by SingleSelect.\n onChange={handleChange}\n placeholder={placeholder}\n value={value}\n >\n {options.map((option) => (\n <SingleSelectOption value={option.value} key={option.value}>\n {option.label}\n </SingleSelectOption>\n ))}\n </SingleSelect>\n <Field.Error />\n <Field.Hint />\n </Field.Root>\n );\n};\n\nexport { CreateLocale, BaseForm, AdvancedForm, SubmitButton, LOCALE_SCHEMA };\n","import * as React from 'react';\n\nimport { ConfirmDialog, useAPIErrorHandler, useNotification } from '@strapi/admin/strapi-admin';\nimport { Dialog, IconButton } from '@strapi/design-system';\nimport { Trash } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\n\nimport { useDeleteLocaleMutation } from '../services/locales';\nimport { getTranslation } from '../utils/getTranslation';\n\nimport type { Locale } from '../../../shared/contracts/locales';\n\n/* -------------------------------------------------------------------------------------------------\n * DeleteLocale\n * -----------------------------------------------------------------------------------------------*/\n\ninterface DeleteLocaleProps extends Locale {}\n\nconst DeleteLocale = ({ id, name }: DeleteLocaleProps) => {\n const { formatMessage } = useIntl();\n const { toggleNotification } = useNotification();\n const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();\n\n const [visible, setVisible] = React.useState(false);\n\n const [deleteLocale] = useDeleteLocaleMutation();\n const handleConfirm = async () => {\n try {\n const res = await deleteLocale(id);\n\n if ('error' in res) {\n toggleNotification({ type: 'danger', message: formatAPIError(res.error) });\n\n return;\n }\n\n toggleNotification({\n type: 'success',\n message: formatMessage({\n id: getTranslation('Settings.locales.modal.delete.success'),\n defaultMessage: 'Deleted locale',\n }),\n });\n\n setVisible(false);\n } catch (err) {\n toggleNotification({\n type: 'danger',\n message: formatMessage({\n id: 'notification.error',\n defaultMessage: 'An error occurred, please try again',\n }),\n });\n }\n };\n\n return (\n <Dialog.Root open={visible} onOpenChange={setVisible}>\n <Dialog.Trigger>\n <IconButton\n onClick={() => setVisible(true)}\n label={formatMessage(\n {\n id: getTranslation('Settings.list.actions.delete'),\n defaultMessage: 'Delete {name} locale',\n },\n {\n name,\n }\n )}\n variant=\"ghost\"\n >\n <Trash />\n </IconButton>\n </Dialog.Trigger>\n <ConfirmDialog onConfirm={handleConfirm} />\n </Dialog.Root>\n );\n};\n\nexport { DeleteLocale };\n","import * as React from 'react';\n\nimport {\n useNotification,\n useAPIErrorHandler,\n Form,\n FormHelpers,\n useAuth,\n} from '@strapi/admin/strapi-admin';\nimport {\n Box,\n Button,\n Divider,\n Flex,\n IconButton,\n Modal,\n Tabs,\n Typography,\n useId,\n} from '@strapi/design-system';\nimport { Pencil } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\n\nimport { Locale, UpdateLocale } from '../../../shared/contracts/locales';\nimport { useUpdateLocaleMutation } from '../services/locales';\nimport { isBaseQueryError } from '../utils/baseQuery';\nimport { getTranslation } from '../utils/getTranslation';\n\nimport { AdvancedForm, BaseForm, LOCALE_SCHEMA, SubmitButton } from './CreateLocale';\n\n/* -------------------------------------------------------------------------------------------------\n * EditLocale\n * -----------------------------------------------------------------------------------------------*/\n\ninterface EditLocaleProps extends Omit<EditModalProps, 'open' | 'onOpenChange'> {}\n\nconst EditLocale = (props: EditLocaleProps) => {\n const { formatMessage } = useIntl();\n const [visible, setVisible] = React.useState(false);\n\n return (\n <>\n <IconButton\n onClick={() => setVisible(true)}\n label={formatMessage(\n {\n id: getTranslation('Settings.list.actions.edit'),\n defaultMessage: 'Edit {name} locale',\n },\n {\n name: props.name,\n }\n )}\n variant=\"ghost\"\n >\n <Pencil />\n </IconButton>\n <EditModal {...props} open={visible} onOpenChange={setVisible} />\n </>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * EditModal\n * -----------------------------------------------------------------------------------------------*/\n\ninterface EditModalProps extends Pick<Locale, 'id' | 'isDefault' | 'name' | 'code'> {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n}\n\ntype FormValues = UpdateLocale.Request['body'] & { code: string };\n\n/**\n * @internal\n * @description Exported to be used when someone clicks on a table row.\n */\nconst EditModal = ({ id, code, isDefault, name, open, onOpenChange }: EditModalProps) => {\n const { toggleNotification } = useNotification();\n const {\n _unstableFormatAPIError: formatAPIError,\n _unstableFormatValidationErrors: formatValidationErrors,\n } = useAPIErrorHandler();\n const refetchPermissions = useAuth('EditModal', (state) => state.refetchPermissions);\n const { formatMessage } = useIntl();\n const titleId = useId();\n\n const [updateLocale] = useUpdateLocaleMutation();\n const handleSubmit = async (\n { code: _code, ...data }: FormValues,\n helpers: FormHelpers<FormValues>\n ) => {\n try {\n /**\n * We don't need to send the code, because the\n * code can never be changed.\n */\n const res = await updateLocale({\n id,\n ...data,\n });\n\n if ('error' in res) {\n if (isBaseQueryError(res.error) && res.error.name === 'ValidationError') {\n helpers.setErrors(formatValidationErrors(res.error));\n } else {\n toggleNotification({ type: 'danger', message: formatAPIError(res.error) });\n }\n\n return;\n }\n\n toggleNotification({\n type: 'success',\n message: formatMessage({\n id: getTranslation('Settings.locales.modal.edit.success'),\n defaultMessage: 'Updated locale',\n }),\n });\n\n refetchPermissions();\n onOpenChange(false);\n } catch (err) {\n toggleNotification({\n type: 'danger',\n message: formatMessage({\n id: 'notification.error',\n defaultMessage: 'An error occurred, please try again',\n }),\n });\n }\n };\n\n return (\n <Modal.Root open={open} onOpenChange={onOpenChange}>\n <Modal.Content>\n <Form\n method=\"PUT\"\n onSubmit={handleSubmit}\n initialValues={{\n code,\n name,\n isDefault,\n }}\n validationSchema={LOCALE_SCHEMA}\n >\n <Modal.Header>\n <Modal.Title>\n {formatMessage(\n {\n id: getTranslation('Settings.list.actions.edit'),\n defaultMessage: 'Edit a locale',\n },\n {\n name,\n }\n )}\n </Modal.Title>\n </Modal.Header>\n <Modal.Body>\n <Tabs.Root variant=\"simple\" defaultValue=\"basic\">\n <Flex justifyContent=\"space-between\">\n <Typography tag=\"h2\" variant=\"beta\" id={titleId}>\n {formatMessage({\n id: getTranslation('Settings.locales.modal.title'),\n defaultMessage: 'Configuration',\n })}\n </Typography>\n <Tabs.List aria-labelledby={titleId}>\n <Tabs.Trigger value=\"basic\">\n {formatMessage({\n id: getTranslation('Settings.locales.modal.base'),\n defaultMessage: 'Basic settings',\n })}\n </Tabs.Trigger>\n <Tabs.Trigger value=\"advanced\">\n {formatMessage({\n id: getTranslation('Settings.locales.modal.advanced'),\n defaultMessage: 'Advanced settings',\n })}\n </Tabs.Trigger>\n </Tabs.List>\n </Flex>\n <Divider />\n <Box paddingTop={7} paddingBottom={7}>\n <Tabs.Content value=\"basic\">\n <BaseForm mode=\"edit\" />\n </Tabs.Content>\n <Tabs.Content value=\"advanced\">\n <AdvancedForm isDefaultLocale={isDefault} />\n </Tabs.Content>\n </Box>\n </Tabs.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 <SubmitButton />\n </Modal.Footer>\n </Form>\n </Modal.Content>\n </Modal.Root>\n );\n};\n\nexport { EditLocale, EditModal };\n","import * as React from 'react';\n\nimport {\n Flex,\n Table,\n Tbody,\n Td,\n Th,\n Thead,\n Tr,\n Typography,\n VisuallyHidden,\n} from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\n\nimport { getTranslation } from '../utils/getTranslation';\n\nimport { DeleteLocale } from './DeleteLocale';\nimport { EditLocale, EditModal } from './EditLocale';\n\nimport type { Locale } from '../../../shared/contracts/locales';\n\n/* -------------------------------------------------------------------------------------------------\n * LocaleTable\n * -----------------------------------------------------------------------------------------------*/\n\ntype LocaleTableProps = {\n locales?: Locale[];\n canDelete?: boolean;\n canUpdate?: boolean;\n onDeleteLocale?: (locale: Locale) => void;\n onEditLocale?: (locale: Locale) => void;\n};\n\nconst LocaleTable = ({ locales = [], canDelete, canUpdate }: LocaleTableProps) => {\n const [editLocaleId, setEditLocaleId] = React.useState<Locale['id']>();\n const { formatMessage } = useIntl();\n\n const handleClick = (localeId: Locale['id']) => () => {\n if (canUpdate) {\n setEditLocaleId(localeId);\n }\n };\n\n return (\n <Table colCount={4} rowCount={locales.length + 1}>\n <Thead>\n <Tr>\n <Th>\n <Typography variant=\"sigma\" textColor=\"neutral600\">\n {formatMessage({\n id: getTranslation('Settings.locales.row.id'),\n defaultMessage: 'ID',\n })}\n </Typography>\n </Th>\n <Th>\n <Typography variant=\"sigma\" textColor=\"neutral600\">\n {formatMessage({\n id: getTranslation('Settings.locales.row.displayName'),\n defaultMessage: 'Display name',\n })}\n </Typography>\n </Th>\n <Th>\n <Typography variant=\"sigma\" textColor=\"neutral600\">\n {formatMessage({\n id: getTranslation('Settings.locales.row.default-locale'),\n defaultMessage: 'Default locale',\n })}\n </Typography>\n </Th>\n <Th>\n <VisuallyHidden>Actions</VisuallyHidden>\n </Th>\n </Tr>\n </Thead>\n <Tbody>\n {locales.map((locale) => (\n <React.Fragment key={locale.id}>\n <Tr\n onClick={handleClick(locale.id)}\n style={{ cursor: canUpdate ? 'pointer' : 'default' }}\n >\n <Td>\n <Typography textColor=\"neutral800\">{locale.id}</Typography>\n </Td>\n <Td>\n <Typography textColor=\"neutral800\">{locale.name}</Typography>\n </Td>\n <Td>\n <Typography textColor=\"neutral800\">\n {locale.isDefault\n ? formatMessage({\n id: getTranslation('Settings.locales.default'),\n defaultMessage: 'Default',\n })\n : null}\n </Typography>\n </Td>\n <Td>\n <Flex gap={1} justifyContent=\"flex-end\" onClick={(e) => e.stopPropagation()}>\n {canUpdate && <EditLocale {...locale} />}\n {canDelete && !locale.isDefault && <DeleteLocale {...locale} />}\n </Flex>\n </Td>\n </Tr>\n <EditModal\n {...locale}\n onOpenChange={() => setEditLocaleId(undefined)}\n open={editLocaleId === locale.id}\n />\n </React.Fragment>\n ))}\n </Tbody>\n </Table>\n );\n};\n\nexport { LocaleTable };\nexport type { LocaleTableProps };\n","import * as React from 'react';\n\nimport {\n Page,\n useAPIErrorHandler,\n useNotification,\n useRBAC,\n Layouts,\n} from '@strapi/admin/strapi-admin';\nimport { EmptyStateLayout } from '@strapi/design-system';\nimport { EmptyDocuments } from '@strapi/icons/symbols';\nimport { useIntl } from 'react-intl';\n\nimport { CreateLocale } from '../components/CreateLocale';\nimport { LocaleTable } from '../components/LocaleTable';\nimport { PERMISSIONS } from '../constants';\nimport { useGetLocalesQuery } from '../services/locales';\nimport { getTranslation } from '../utils/getTranslation';\n\nconst SettingsPage = () => {\n const { formatMessage } = useIntl();\n const { toggleNotification } = useNotification();\n const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();\n const { data: locales, isLoading: isLoadingLocales, error } = useGetLocalesQuery();\n const {\n isLoading: isLoadingRBAC,\n allowedActions: { canUpdate, canCreate, canDelete },\n } = useRBAC(PERMISSIONS);\n\n React.useEffect(() => {\n if (error) {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(error),\n });\n }\n }, [error, formatAPIError, toggleNotification]);\n\n const isLoading = isLoadingLocales || isLoadingRBAC;\n\n if (isLoading) {\n return <Page.Loading />;\n }\n\n if (error || !Array.isArray(locales)) {\n return <Page.Error />;\n }\n\n return (\n <Page.Main tabIndex={-1}>\n <Layouts.Header\n primaryAction={<CreateLocale disabled={!canCreate} />}\n title={formatMessage({\n id: getTranslation('plugin.name'),\n defaultMessage: 'Internationalization',\n })}\n subtitle={formatMessage({\n id: getTranslation('Settings.list.description'),\n defaultMessage: 'Configure the settings',\n })}\n />\n <Layouts.Content>\n {locales.length > 0 ? (\n <LocaleTable locales={locales} canDelete={canDelete} canUpdate={canUpdate} />\n ) : (\n <EmptyStateLayout\n icon={<EmptyDocuments width={undefined} height={undefined} />}\n content={formatMessage({\n id: getTranslation('Settings.list.empty.title'),\n defaultMessage: 'There are no locales',\n })}\n action={<CreateLocale disabled={!canCreate} variant=\"secondary\" />}\n />\n )}\n </Layouts.Content>\n </Page.Main>\n );\n};\n\nconst ProtectedSettingsPage = () => {\n return (\n <Page.Protect permissions={PERMISSIONS.read}>\n <SettingsPage />\n </Page.Protect>\n );\n};\n\nexport { ProtectedSettingsPage, SettingsPage };\n"],"names":["value","locale"],"mappings":";;;;;;;;;AAKA,MAAM,mBAAmB,CAAC,UAA+D;AACvF,SAAO,MAAM,SAAS;AACxB;ACoCA,MAAM,eAAe,CAAC,EAAE,UAAU,UAAU,gBAAmC;AACvE,QAAA,EAAE,cAAc,IAAI,QAAQ;AAClC,QAAM,CAAC,SAAS,UAAU,IAAI,MAAM,SAAS,KAAK;AAElD,8BACG,MAAM,MAAN,EAAW,MAAM,SAAS,cAAc,YACvC,UAAA;AAAA,IAAC,oBAAA,MAAM,SAAN,EACC,UAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,+BAAY,MAAK,EAAA;AAAA,QACjB,SAAS,MAAM,WAAW,IAAI;AAAA,QAC9B,MAAK;AAAA,QAEJ,UAAc,cAAA;AAAA,UACb,IAAI,eAAe,2BAA2B;AAAA,UAC9C,gBAAgB;AAAA,QACjB,CAAA;AAAA,MAAA;AAAA,IAAA,GAEL;AAAA,wBACC,aAAY,EAAA,SAAS,MAAM,WAAW,KAAK,EAAG,CAAA;AAAA,EAAA,GACjD;AAEJ;AAMA,MAAM,gBAAgB,IAAI,OAAO,EAAE,MAAM;AAAA,EACvC,MAAM,IAAI,OAAS,EAAA,SAAA,EAAW,SAAS;AAAA,IACrC,IAAI;AAAA,IACJ,gBAAgB;AAAA,EAAA,CACjB;AAAA,EACD,MAAM,IACH,OAAA,EACA,SAAS,EACT,IAAI,IAAI;AAAA,IACP,IAAI;AAAA,IACJ,gBAAgB;AAAA,EACjB,CAAA,EACA,SAAS;AAAA,IACR,IAAI;AAAA,IACJ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,GACF;AAEJ;AAEA,MAAM,wBAAwB,MAAM;AAEhC,SAAA,oBAAC,KAAK,SAAL,EAAa,aAAa,YAAY,MACrC,UAAC,oBAAA,cAAA,CAAA,CAAa,EAChB,CAAA;AAEJ;"}
@@ -8,10 +8,9 @@ const symbols = require("@strapi/icons/symbols");
8
8
  const reactIntl = require("react-intl");
9
9
  const icons = require("@strapi/icons");
10
10
  const yup = require("yup");
11
- const index = require("./index-5XLZwzwx.js");
11
+ const index = require("./index-3yyF237r.js");
12
12
  function _interopNamespace(e) {
13
- if (e && e.__esModule)
14
- return e;
13
+ if (e && e.__esModule) return e;
15
14
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
16
15
  if (e) {
17
16
  for (const k in e) {
@@ -54,11 +53,11 @@ const CreateLocale = ({ disabled, variant = "default" }) => {
54
53
  ] });
55
54
  };
56
55
  const LOCALE_SCHEMA = yup__namespace.object().shape({
57
- code: yup__namespace.string().required({
56
+ code: yup__namespace.string().nullable().required({
58
57
  id: "Settings.locales.modal.create.code.error",
59
58
  defaultMessage: "Please select a locale"
60
59
  }),
61
- name: yup__namespace.string().max(50, {
60
+ name: yup__namespace.string().nullable().max(50, {
62
61
  id: "Settings.locales.modal.create.name.error.min",
63
62
  defaultMessage: "The locale display name can only be less than 50 characters."
64
63
  }).required({
@@ -571,4 +570,4 @@ const ProtectedSettingsPage = () => {
571
570
  };
572
571
  exports.ProtectedSettingsPage = ProtectedSettingsPage;
573
572
  exports.SettingsPage = SettingsPage;
574
- //# sourceMappingURL=SettingsPage-CfTmCkup.js.map
573
+ //# sourceMappingURL=SettingsPage-BTgjb2KS.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SettingsPage-BTgjb2KS.js","sources":["../../admin/src/utils/baseQuery.ts","../../admin/src/components/CreateLocale.tsx","../../admin/src/components/DeleteLocale.tsx","../../admin/src/components/EditLocale.tsx","../../admin/src/components/LocaleTable.tsx","../../admin/src/pages/SettingsPage.tsx"],"sourcesContent":["import { SerializedError } from '@reduxjs/toolkit';\nimport { type ApiError, type UnknownApiError } from '@strapi/admin/strapi-admin';\n\ntype BaseQueryError = ApiError | UnknownApiError | SerializedError;\n\nconst isBaseQueryError = (error: BaseQueryError): error is ApiError | UnknownApiError => {\n return error.name !== undefined;\n};\n\nexport { isBaseQueryError };\n","import * as React from 'react';\n\nimport {\n Form,\n type InputProps,\n InputRenderer,\n useField,\n type FormHelpers,\n useForm,\n useAPIErrorHandler,\n useNotification,\n useAuth,\n} from '@strapi/admin/strapi-admin';\nimport {\n Box,\n Button,\n ButtonProps,\n Divider,\n Field,\n Flex,\n Grid,\n Modal,\n SingleSelect,\n SingleSelectOption,\n Tabs,\n Typography,\n useId,\n} from '@strapi/design-system';\nimport { Check, Plus } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\nimport * as yup from 'yup';\n\nimport { CreateLocale } from '../../../shared/contracts/locales';\nimport { useCreateLocaleMutation, useGetDefaultLocalesQuery } from '../services/locales';\nimport { isBaseQueryError } from '../utils/baseQuery';\nimport { getTranslation } from '../utils/getTranslation';\n\n/* -------------------------------------------------------------------------------------------------\n * CreateLocale\n * -----------------------------------------------------------------------------------------------*/\n\ninterface CreateLocaleProps extends Pick<ButtonProps, 'disabled' | 'variant'> {}\n\nconst CreateLocale = ({ disabled, variant = 'default' }: CreateLocaleProps) => {\n const { formatMessage } = useIntl();\n const [visible, setVisible] = React.useState(false);\n\n return (\n <Modal.Root open={visible} onOpenChange={setVisible}>\n <Modal.Trigger>\n <Button\n variant={variant}\n disabled={disabled}\n startIcon={<Plus />}\n onClick={() => setVisible(true)}\n size=\"S\"\n >\n {formatMessage({\n id: getTranslation('Settings.list.actions.add'),\n defaultMessage: 'Add new locale',\n })}\n </Button>\n </Modal.Trigger>\n <CreateModal onClose={() => setVisible(false)} />\n </Modal.Root>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * CreateModal\n * -----------------------------------------------------------------------------------------------*/\n\nconst LOCALE_SCHEMA = yup.object().shape({\n code: yup.string().nullable().required({\n id: 'Settings.locales.modal.create.code.error',\n defaultMessage: 'Please select a locale',\n }),\n name: yup\n .string()\n .nullable()\n .max(50, {\n id: 'Settings.locales.modal.create.name.error.min',\n defaultMessage: 'The locale display name can only be less than 50 characters.',\n })\n .required({\n id: 'Settings.locales.modal.create.name.error.required',\n defaultMessage: 'Please give the locale a display name',\n }),\n isDefault: yup.boolean(),\n});\n\ntype FormValues = CreateLocale.Request['body'];\n\nconst initialFormValues = {\n code: '',\n name: '',\n isDefault: false,\n} satisfies FormValues;\n\ntype ModalCreateProps = {\n onClose: () => void;\n};\n\nconst CreateModal = ({ onClose }: ModalCreateProps) => {\n const titleId = useId();\n const { toggleNotification } = useNotification();\n const {\n _unstableFormatAPIError: formatAPIError,\n _unstableFormatValidationErrors: formatValidationErrors,\n } = useAPIErrorHandler();\n const [createLocale] = useCreateLocaleMutation();\n const { formatMessage } = useIntl();\n const refetchPermissions = useAuth('CreateModal', (state) => state.refetchPermissions);\n\n const handleSubmit = async (values: FormValues, helpers: FormHelpers<FormValues>) => {\n try {\n const res = await createLocale(values);\n\n if ('error' in res) {\n if (isBaseQueryError(res.error) && res.error.name === 'ValidationError') {\n helpers.setErrors(formatValidationErrors(res.error));\n } else {\n toggleNotification({ type: 'danger', message: formatAPIError(res.error) });\n }\n\n return;\n }\n\n toggleNotification({\n type: 'success',\n message: formatMessage({\n id: getTranslation('Settings.locales.modal.create.success'),\n defaultMessage: 'Created locale',\n }),\n });\n\n refetchPermissions();\n onClose();\n } catch (err) {\n toggleNotification({\n type: 'danger',\n message: formatMessage({\n id: 'notification.error',\n defaultMessage: 'An error occurred, please try again',\n }),\n });\n }\n };\n\n return (\n <Modal.Content>\n <Form\n method=\"POST\"\n initialValues={initialFormValues}\n validationSchema={LOCALE_SCHEMA}\n onSubmit={handleSubmit}\n >\n <Modal.Header>\n <Modal.Title>\n {formatMessage({\n id: getTranslation('Settings.list.actions.add'),\n defaultMessage: 'Add new locale',\n })}\n </Modal.Title>\n </Modal.Header>\n <Modal.Body>\n <Tabs.Root variant=\"simple\" defaultValue=\"basic\">\n <Flex justifyContent=\"space-between\">\n <Typography tag=\"h2\" variant=\"beta\" id={titleId}>\n {formatMessage({\n id: getTranslation('Settings.locales.modal.title'),\n defaultMessage: 'Configuration',\n })}\n </Typography>\n <Tabs.List aria-labelledby={titleId}>\n <Tabs.Trigger value=\"basic\">\n {formatMessage({\n id: getTranslation('Settings.locales.modal.base'),\n defaultMessage: 'Basic settings',\n })}\n </Tabs.Trigger>\n <Tabs.Trigger value=\"advanced\">\n {formatMessage({\n id: getTranslation('Settings.locales.modal.advanced'),\n defaultMessage: 'Advanced settings',\n })}\n </Tabs.Trigger>\n </Tabs.List>\n </Flex>\n\n <Divider />\n\n <Box paddingTop={7} paddingBottom={7}>\n <Tabs.Content value=\"basic\">\n <BaseForm />\n </Tabs.Content>\n <Tabs.Content value=\"advanced\">\n <AdvancedForm />\n </Tabs.Content>\n </Box>\n </Tabs.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 <SubmitButton />\n </Modal.Footer>\n </Form>\n </Modal.Content>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * SubmitButton\n * -----------------------------------------------------------------------------------------------*/\n\nconst SubmitButton = () => {\n const { formatMessage } = useIntl();\n const isSubmitting = useForm('SubmitButton', (state) => state.isSubmitting);\n const modified = useForm('SubmitButton', (state) => state.modified);\n\n return (\n <Button type=\"submit\" startIcon={<Check />} disabled={isSubmitting || !modified}>\n {formatMessage({ id: 'global.save', defaultMessage: 'Save' })}\n </Button>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * BaseForm\n * -----------------------------------------------------------------------------------------------*/\n\ninterface BaseFormProps {\n mode?: 'create' | 'edit';\n}\n\nconst BaseForm = ({ mode = 'create' }: BaseFormProps) => {\n const { formatMessage } = useIntl();\n const { toggleNotification } = useNotification();\n const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();\n\n const { data: defaultLocales, error } = useGetDefaultLocalesQuery();\n\n React.useEffect(() => {\n if (error) {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(error),\n });\n }\n }, [error, formatAPIError, toggleNotification]);\n\n if (!Array.isArray(defaultLocales)) {\n return null;\n }\n\n const options = defaultLocales.map((locale) => ({\n label: locale.name,\n value: locale.code,\n }));\n\n const translatedForm = [\n {\n disabled: mode !== 'create',\n label: {\n id: getTranslation('Settings.locales.modal.create.code.label'),\n defaultMessage: 'Locales',\n },\n name: 'code',\n options,\n placeholder: {\n id: 'components.placeholder.select',\n defaultMessage: 'Select',\n },\n required: true,\n size: 6,\n type: 'enumeration' as const,\n },\n {\n hint: {\n id: getTranslation('Settings.locales.modal.create.name.label.description'),\n defaultMessage: 'Locale will be displayed under that name in the administration panel',\n },\n label: {\n id: getTranslation('Settings.locales.modal.create.name.label'),\n defaultMessage: 'Locale display name',\n },\n name: 'name',\n required: true,\n size: 6,\n type: 'string' as const,\n },\n ].map((field) => ({\n ...field,\n hint: field.hint ? formatMessage(field.hint) : undefined,\n label: formatMessage(field.label),\n placeholder: field.placeholder ? formatMessage(field.placeholder) : undefined,\n }));\n\n return (\n <Grid.Root gap={4}>\n {translatedForm.map(({ size, ...field }) => (\n <Grid.Item key={field.name} col={size} direction=\"column\" alignItems=\"stretch\">\n <FormRenderer {...field} />\n </Grid.Item>\n ))}\n </Grid.Root>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * AdvancedForm\n * -----------------------------------------------------------------------------------------------*/\n\ntype AdvancedFormProps = {\n isDefaultLocale?: boolean;\n};\n\nconst AdvancedForm = ({ isDefaultLocale }: AdvancedFormProps) => {\n const { formatMessage } = useIntl();\n\n const form = [\n {\n disabled: isDefaultLocale,\n hint: {\n id: getTranslation('Settings.locales.modal.advanced.setAsDefault.hint'),\n defaultMessage: 'One default locale is required, change it by selecting another one',\n },\n label: {\n id: getTranslation('Settings.locales.modal.advanced.setAsDefault'),\n defaultMessage: 'Set as default locale',\n },\n name: 'isDefault',\n size: 6,\n type: 'boolean' as const,\n },\n ].map((field) => ({\n ...field,\n hint: field.hint ? formatMessage(field.hint) : undefined,\n label: formatMessage(field.label),\n })) satisfies InputProps[];\n\n return (\n <Grid.Root gap={4}>\n {form.map(({ size, ...field }) => (\n <Grid.Item key={field.name} col={size} direction=\"column\" alignItems=\"stretch\">\n <FormRenderer {...field} />\n </Grid.Item>\n ))}\n </Grid.Root>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * FormRenderer\n * -----------------------------------------------------------------------------------------------*/\n\nconst FormRenderer = (field: InputProps) => {\n switch (field.type) {\n /**\n * This will override the default input renderer\n * choice for `enumeration`.\n */\n case 'enumeration':\n return <EnumerationInput {...field} />;\n default:\n return <InputRenderer {...field} />;\n }\n};\n\nconst EnumerationInput = ({\n disabled,\n hint,\n label,\n name,\n options,\n placeholder,\n required,\n}: Extract<InputProps, { type: 'enumeration' }>) => {\n const { value, error, onChange } = useField(name);\n const { data: defaultLocales = [] } = useGetDefaultLocalesQuery();\n\n const handleChange = (value: string) => {\n if (Array.isArray(defaultLocales)) {\n // We know it exists because the options are created from the list of default locales\n const locale = defaultLocales.find((locale) => locale.code === value)!;\n\n onChange(name, value);\n // This lets us automatically fill the name field with the locale name\n onChange('name', locale.name);\n } else {\n onChange(name, value);\n }\n };\n\n return (\n <Field.Root error={error} hint={hint} name={name} required={required}>\n <Field.Label>{label}</Field.Label>\n <SingleSelect\n disabled={disabled}\n // @ts-expect-error – This will dissapear when the DS removes support for numbers to be returned by SingleSelect.\n onChange={handleChange}\n placeholder={placeholder}\n value={value}\n >\n {options.map((option) => (\n <SingleSelectOption value={option.value} key={option.value}>\n {option.label}\n </SingleSelectOption>\n ))}\n </SingleSelect>\n <Field.Error />\n <Field.Hint />\n </Field.Root>\n );\n};\n\nexport { CreateLocale, BaseForm, AdvancedForm, SubmitButton, LOCALE_SCHEMA };\n","import * as React from 'react';\n\nimport { ConfirmDialog, useAPIErrorHandler, useNotification } from '@strapi/admin/strapi-admin';\nimport { Dialog, IconButton } from '@strapi/design-system';\nimport { Trash } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\n\nimport { useDeleteLocaleMutation } from '../services/locales';\nimport { getTranslation } from '../utils/getTranslation';\n\nimport type { Locale } from '../../../shared/contracts/locales';\n\n/* -------------------------------------------------------------------------------------------------\n * DeleteLocale\n * -----------------------------------------------------------------------------------------------*/\n\ninterface DeleteLocaleProps extends Locale {}\n\nconst DeleteLocale = ({ id, name }: DeleteLocaleProps) => {\n const { formatMessage } = useIntl();\n const { toggleNotification } = useNotification();\n const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();\n\n const [visible, setVisible] = React.useState(false);\n\n const [deleteLocale] = useDeleteLocaleMutation();\n const handleConfirm = async () => {\n try {\n const res = await deleteLocale(id);\n\n if ('error' in res) {\n toggleNotification({ type: 'danger', message: formatAPIError(res.error) });\n\n return;\n }\n\n toggleNotification({\n type: 'success',\n message: formatMessage({\n id: getTranslation('Settings.locales.modal.delete.success'),\n defaultMessage: 'Deleted locale',\n }),\n });\n\n setVisible(false);\n } catch (err) {\n toggleNotification({\n type: 'danger',\n message: formatMessage({\n id: 'notification.error',\n defaultMessage: 'An error occurred, please try again',\n }),\n });\n }\n };\n\n return (\n <Dialog.Root open={visible} onOpenChange={setVisible}>\n <Dialog.Trigger>\n <IconButton\n onClick={() => setVisible(true)}\n label={formatMessage(\n {\n id: getTranslation('Settings.list.actions.delete'),\n defaultMessage: 'Delete {name} locale',\n },\n {\n name,\n }\n )}\n variant=\"ghost\"\n >\n <Trash />\n </IconButton>\n </Dialog.Trigger>\n <ConfirmDialog onConfirm={handleConfirm} />\n </Dialog.Root>\n );\n};\n\nexport { DeleteLocale };\n","import * as React from 'react';\n\nimport {\n useNotification,\n useAPIErrorHandler,\n Form,\n FormHelpers,\n useAuth,\n} from '@strapi/admin/strapi-admin';\nimport {\n Box,\n Button,\n Divider,\n Flex,\n IconButton,\n Modal,\n Tabs,\n Typography,\n useId,\n} from '@strapi/design-system';\nimport { Pencil } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\n\nimport { Locale, UpdateLocale } from '../../../shared/contracts/locales';\nimport { useUpdateLocaleMutation } from '../services/locales';\nimport { isBaseQueryError } from '../utils/baseQuery';\nimport { getTranslation } from '../utils/getTranslation';\n\nimport { AdvancedForm, BaseForm, LOCALE_SCHEMA, SubmitButton } from './CreateLocale';\n\n/* -------------------------------------------------------------------------------------------------\n * EditLocale\n * -----------------------------------------------------------------------------------------------*/\n\ninterface EditLocaleProps extends Omit<EditModalProps, 'open' | 'onOpenChange'> {}\n\nconst EditLocale = (props: EditLocaleProps) => {\n const { formatMessage } = useIntl();\n const [visible, setVisible] = React.useState(false);\n\n return (\n <>\n <IconButton\n onClick={() => setVisible(true)}\n label={formatMessage(\n {\n id: getTranslation('Settings.list.actions.edit'),\n defaultMessage: 'Edit {name} locale',\n },\n {\n name: props.name,\n }\n )}\n variant=\"ghost\"\n >\n <Pencil />\n </IconButton>\n <EditModal {...props} open={visible} onOpenChange={setVisible} />\n </>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * EditModal\n * -----------------------------------------------------------------------------------------------*/\n\ninterface EditModalProps extends Pick<Locale, 'id' | 'isDefault' | 'name' | 'code'> {\n open: boolean;\n onOpenChange: (open: boolean) => void;\n}\n\ntype FormValues = UpdateLocale.Request['body'] & { code: string };\n\n/**\n * @internal\n * @description Exported to be used when someone clicks on a table row.\n */\nconst EditModal = ({ id, code, isDefault, name, open, onOpenChange }: EditModalProps) => {\n const { toggleNotification } = useNotification();\n const {\n _unstableFormatAPIError: formatAPIError,\n _unstableFormatValidationErrors: formatValidationErrors,\n } = useAPIErrorHandler();\n const refetchPermissions = useAuth('EditModal', (state) => state.refetchPermissions);\n const { formatMessage } = useIntl();\n const titleId = useId();\n\n const [updateLocale] = useUpdateLocaleMutation();\n const handleSubmit = async (\n { code: _code, ...data }: FormValues,\n helpers: FormHelpers<FormValues>\n ) => {\n try {\n /**\n * We don't need to send the code, because the\n * code can never be changed.\n */\n const res = await updateLocale({\n id,\n ...data,\n });\n\n if ('error' in res) {\n if (isBaseQueryError(res.error) && res.error.name === 'ValidationError') {\n helpers.setErrors(formatValidationErrors(res.error));\n } else {\n toggleNotification({ type: 'danger', message: formatAPIError(res.error) });\n }\n\n return;\n }\n\n toggleNotification({\n type: 'success',\n message: formatMessage({\n id: getTranslation('Settings.locales.modal.edit.success'),\n defaultMessage: 'Updated locale',\n }),\n });\n\n refetchPermissions();\n onOpenChange(false);\n } catch (err) {\n toggleNotification({\n type: 'danger',\n message: formatMessage({\n id: 'notification.error',\n defaultMessage: 'An error occurred, please try again',\n }),\n });\n }\n };\n\n return (\n <Modal.Root open={open} onOpenChange={onOpenChange}>\n <Modal.Content>\n <Form\n method=\"PUT\"\n onSubmit={handleSubmit}\n initialValues={{\n code,\n name,\n isDefault,\n }}\n validationSchema={LOCALE_SCHEMA}\n >\n <Modal.Header>\n <Modal.Title>\n {formatMessage(\n {\n id: getTranslation('Settings.list.actions.edit'),\n defaultMessage: 'Edit a locale',\n },\n {\n name,\n }\n )}\n </Modal.Title>\n </Modal.Header>\n <Modal.Body>\n <Tabs.Root variant=\"simple\" defaultValue=\"basic\">\n <Flex justifyContent=\"space-between\">\n <Typography tag=\"h2\" variant=\"beta\" id={titleId}>\n {formatMessage({\n id: getTranslation('Settings.locales.modal.title'),\n defaultMessage: 'Configuration',\n })}\n </Typography>\n <Tabs.List aria-labelledby={titleId}>\n <Tabs.Trigger value=\"basic\">\n {formatMessage({\n id: getTranslation('Settings.locales.modal.base'),\n defaultMessage: 'Basic settings',\n })}\n </Tabs.Trigger>\n <Tabs.Trigger value=\"advanced\">\n {formatMessage({\n id: getTranslation('Settings.locales.modal.advanced'),\n defaultMessage: 'Advanced settings',\n })}\n </Tabs.Trigger>\n </Tabs.List>\n </Flex>\n <Divider />\n <Box paddingTop={7} paddingBottom={7}>\n <Tabs.Content value=\"basic\">\n <BaseForm mode=\"edit\" />\n </Tabs.Content>\n <Tabs.Content value=\"advanced\">\n <AdvancedForm isDefaultLocale={isDefault} />\n </Tabs.Content>\n </Box>\n </Tabs.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 <SubmitButton />\n </Modal.Footer>\n </Form>\n </Modal.Content>\n </Modal.Root>\n );\n};\n\nexport { EditLocale, EditModal };\n","import * as React from 'react';\n\nimport {\n Flex,\n Table,\n Tbody,\n Td,\n Th,\n Thead,\n Tr,\n Typography,\n VisuallyHidden,\n} from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\n\nimport { getTranslation } from '../utils/getTranslation';\n\nimport { DeleteLocale } from './DeleteLocale';\nimport { EditLocale, EditModal } from './EditLocale';\n\nimport type { Locale } from '../../../shared/contracts/locales';\n\n/* -------------------------------------------------------------------------------------------------\n * LocaleTable\n * -----------------------------------------------------------------------------------------------*/\n\ntype LocaleTableProps = {\n locales?: Locale[];\n canDelete?: boolean;\n canUpdate?: boolean;\n onDeleteLocale?: (locale: Locale) => void;\n onEditLocale?: (locale: Locale) => void;\n};\n\nconst LocaleTable = ({ locales = [], canDelete, canUpdate }: LocaleTableProps) => {\n const [editLocaleId, setEditLocaleId] = React.useState<Locale['id']>();\n const { formatMessage } = useIntl();\n\n const handleClick = (localeId: Locale['id']) => () => {\n if (canUpdate) {\n setEditLocaleId(localeId);\n }\n };\n\n return (\n <Table colCount={4} rowCount={locales.length + 1}>\n <Thead>\n <Tr>\n <Th>\n <Typography variant=\"sigma\" textColor=\"neutral600\">\n {formatMessage({\n id: getTranslation('Settings.locales.row.id'),\n defaultMessage: 'ID',\n })}\n </Typography>\n </Th>\n <Th>\n <Typography variant=\"sigma\" textColor=\"neutral600\">\n {formatMessage({\n id: getTranslation('Settings.locales.row.displayName'),\n defaultMessage: 'Display name',\n })}\n </Typography>\n </Th>\n <Th>\n <Typography variant=\"sigma\" textColor=\"neutral600\">\n {formatMessage({\n id: getTranslation('Settings.locales.row.default-locale'),\n defaultMessage: 'Default locale',\n })}\n </Typography>\n </Th>\n <Th>\n <VisuallyHidden>Actions</VisuallyHidden>\n </Th>\n </Tr>\n </Thead>\n <Tbody>\n {locales.map((locale) => (\n <React.Fragment key={locale.id}>\n <Tr\n onClick={handleClick(locale.id)}\n style={{ cursor: canUpdate ? 'pointer' : 'default' }}\n >\n <Td>\n <Typography textColor=\"neutral800\">{locale.id}</Typography>\n </Td>\n <Td>\n <Typography textColor=\"neutral800\">{locale.name}</Typography>\n </Td>\n <Td>\n <Typography textColor=\"neutral800\">\n {locale.isDefault\n ? formatMessage({\n id: getTranslation('Settings.locales.default'),\n defaultMessage: 'Default',\n })\n : null}\n </Typography>\n </Td>\n <Td>\n <Flex gap={1} justifyContent=\"flex-end\" onClick={(e) => e.stopPropagation()}>\n {canUpdate && <EditLocale {...locale} />}\n {canDelete && !locale.isDefault && <DeleteLocale {...locale} />}\n </Flex>\n </Td>\n </Tr>\n <EditModal\n {...locale}\n onOpenChange={() => setEditLocaleId(undefined)}\n open={editLocaleId === locale.id}\n />\n </React.Fragment>\n ))}\n </Tbody>\n </Table>\n );\n};\n\nexport { LocaleTable };\nexport type { LocaleTableProps };\n","import * as React from 'react';\n\nimport {\n Page,\n useAPIErrorHandler,\n useNotification,\n useRBAC,\n Layouts,\n} from '@strapi/admin/strapi-admin';\nimport { EmptyStateLayout } from '@strapi/design-system';\nimport { EmptyDocuments } from '@strapi/icons/symbols';\nimport { useIntl } from 'react-intl';\n\nimport { CreateLocale } from '../components/CreateLocale';\nimport { LocaleTable } from '../components/LocaleTable';\nimport { PERMISSIONS } from '../constants';\nimport { useGetLocalesQuery } from '../services/locales';\nimport { getTranslation } from '../utils/getTranslation';\n\nconst SettingsPage = () => {\n const { formatMessage } = useIntl();\n const { toggleNotification } = useNotification();\n const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();\n const { data: locales, isLoading: isLoadingLocales, error } = useGetLocalesQuery();\n const {\n isLoading: isLoadingRBAC,\n allowedActions: { canUpdate, canCreate, canDelete },\n } = useRBAC(PERMISSIONS);\n\n React.useEffect(() => {\n if (error) {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(error),\n });\n }\n }, [error, formatAPIError, toggleNotification]);\n\n const isLoading = isLoadingLocales || isLoadingRBAC;\n\n if (isLoading) {\n return <Page.Loading />;\n }\n\n if (error || !Array.isArray(locales)) {\n return <Page.Error />;\n }\n\n return (\n <Page.Main tabIndex={-1}>\n <Layouts.Header\n primaryAction={<CreateLocale disabled={!canCreate} />}\n title={formatMessage({\n id: getTranslation('plugin.name'),\n defaultMessage: 'Internationalization',\n })}\n subtitle={formatMessage({\n id: getTranslation('Settings.list.description'),\n defaultMessage: 'Configure the settings',\n })}\n />\n <Layouts.Content>\n {locales.length > 0 ? (\n <LocaleTable locales={locales} canDelete={canDelete} canUpdate={canUpdate} />\n ) : (\n <EmptyStateLayout\n icon={<EmptyDocuments width={undefined} height={undefined} />}\n content={formatMessage({\n id: getTranslation('Settings.list.empty.title'),\n defaultMessage: 'There are no locales',\n })}\n action={<CreateLocale disabled={!canCreate} variant=\"secondary\" />}\n />\n )}\n </Layouts.Content>\n </Page.Main>\n );\n};\n\nconst ProtectedSettingsPage = () => {\n return (\n <Page.Protect permissions={PERMISSIONS.read}>\n <SettingsPage />\n </Page.Protect>\n );\n};\n\nexport { ProtectedSettingsPage, SettingsPage };\n"],"names":["useIntl","React","Modal","jsx","Button","Plus","getTranslation","yup","useId","useNotification","useAPIErrorHandler","useCreateLocaleMutation","useAuth","jsxs","Form","Tabs","Flex","Typography","Divider","Box","useForm","Check","useGetDefaultLocalesQuery","Grid","InputRenderer","useField","value","locale","Field","SingleSelect","SingleSelectOption","useDeleteLocaleMutation","Dialog","IconButton","Trash","ConfirmDialog","Fragment","Pencil","useUpdateLocaleMutation","Table","Thead","Tr","Th","VisuallyHidden","Tbody","Td","useGetLocalesQuery","useRBAC","PERMISSIONS","Page","Layouts","EmptyStateLayout","EmptyDocuments"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,MAAM,mBAAmB,CAAC,UAA+D;AACvF,SAAO,MAAM,SAAS;AACxB;ACoCA,MAAM,eAAe,CAAC,EAAE,UAAU,UAAU,gBAAmC;AACvE,QAAA,EAAE,cAAc,IAAIA,kBAAQ;AAClC,QAAM,CAAC,SAAS,UAAU,IAAIC,iBAAM,SAAS,KAAK;AAElD,yCACGC,aAAM,MAAA,MAAN,EAAW,MAAM,SAAS,cAAc,YACvC,UAAA;AAAA,IAACC,2BAAAA,IAAAD,aAAA,MAAM,SAAN,EACC,UAAAC,2BAAA;AAAA,MAACC,aAAA;AAAA,MAAA;AAAA,QACC;AAAA,QACA;AAAA,QACA,0CAAYC,MAAK,MAAA,EAAA;AAAA,QACjB,SAAS,MAAM,WAAW,IAAI;AAAA,QAC9B,MAAK;AAAA,QAEJ,UAAc,cAAA;AAAA,UACb,IAAIC,qBAAe,2BAA2B;AAAA,UAC9C,gBAAgB;AAAA,QACjB,CAAA;AAAA,MAAA;AAAA,IAAA,GAEL;AAAA,mCACC,aAAY,EAAA,SAAS,MAAM,WAAW,KAAK,EAAG,CAAA;AAAA,EAAA,GACjD;AAEJ;AAMA,MAAM,gBAAgBC,eAAI,OAAO,EAAE,MAAM;AAAA,EACvC,MAAMA,eAAI,OAAS,EAAA,SAAA,EAAW,SAAS;AAAA,IACrC,IAAI;AAAA,IACJ,gBAAgB;AAAA,EAAA,CACjB;AAAA,EACD,MAAMA,eACH,OAAA,EACA,SAAS,EACT,IAAI,IAAI;AAAA,IACP,IAAI;AAAA,IACJ,gBAAgB;AAAA,EACjB,CAAA,EACA,SAAS;AAAA,IACR,IAAI;AAAA,IACJ,gBAAgB;AAAA,EAAA,CACjB;AAAA,EACH,WAAWA,eAAI,QAAQ;AACzB,C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C9C,gBAAgB;AAAA,QAAA,CACjB;AAAA,QACD,QAASH,2BAAA,IAAA,cAAA,EAAa,UAAU,CAAC,WAAW,SAAQ,YAAY,CAAA;AAAA,MAAA;AAAA,IAAA,EAGtE,CAAA;AAAA,EAAA,GACF;AAEJ;AAEA,MAAM,wBAAwB,MAAM;AAEhC,SAAAA,+BAAC8C,YAAAA,KAAK,SAAL,EAAa,aAAaD,MAAAA,YAAY,MACrC,UAAC7C,2BAAA,IAAA,cAAA,CAAA,CAAa,EAChB,CAAA;AAEJ;;;"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const en = {
4
- "actions.delete.label": "Delete locale",
4
+ "actions.delete.label": "Delete entry ({locale})",
5
5
  "actions.delete.dialog.title": "Confirmation",
6
6
  "actions.delete.dialog.body": "Are you sure you want to delete this locale?",
7
7
  "actions.delete.error": "An error occurred while trying to delete the document locale.",
@@ -14,12 +14,13 @@ const en = {
14
14
  "CMEditViewCopyLocale.dialog.body": "Your current content will be erased and filled by the content of the selected locale:",
15
15
  "CMEditViewCopyLocale.dialog.field.label": "Locale",
16
16
  "CMEditViewCopyLocale.dialog.field.placeholder": "Select one locale...",
17
- "CMEditViewBulkLocale.publish-title": "Publish Multiple Locales",
18
- "CMEditViewBulkLocale.unpublish-title": "Unpublish Multiple Locales",
17
+ "CMEditViewBulkLocale.publish-title": "Publish multiple locales",
18
+ "CMEditViewBulkLocale.unpublish-title": "Unpublish multiple locales",
19
19
  "CMEditViewBulkLocale.status": "Status",
20
20
  "CMEditViewBulkLocale.publication-status": "Publication Status",
21
21
  "CMEditViewBulkLocale.draft-relation-warning": "Some locales are related to draft entries. Publishing them could leave broken links in your app.",
22
22
  "CMEditViewBulkLocale.continue-confirmation": "Are you sure you want to continue?",
23
+ "CMEditViewLocalePicker.locale.create": "Create <bold>{locale}</bold> locale",
23
24
  "CMListView.popover.display-locales.label": "Display translated locales",
24
25
  "CheckboxConfirmation.Modal.body": "Do you want to disable it?",
25
26
  "CheckboxConfirmation.Modal.button-confirm": "Yes, disable",
@@ -77,4 +78,4 @@ const en = {
77
78
  "plugin.schema.i18n.localized.label-field": "Enable localization for this field"
78
79
  };
79
80
  exports.default = en;
80
- //# sourceMappingURL=en-DWpfm8h5.js.map
81
+ //# sourceMappingURL=en-BKBz3tro.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"en-BKBz3tro.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  const en = {
2
- "actions.delete.label": "Delete locale",
2
+ "actions.delete.label": "Delete entry ({locale})",
3
3
  "actions.delete.dialog.title": "Confirmation",
4
4
  "actions.delete.dialog.body": "Are you sure you want to delete this locale?",
5
5
  "actions.delete.error": "An error occurred while trying to delete the document locale.",
@@ -12,12 +12,13 @@ const en = {
12
12
  "CMEditViewCopyLocale.dialog.body": "Your current content will be erased and filled by the content of the selected locale:",
13
13
  "CMEditViewCopyLocale.dialog.field.label": "Locale",
14
14
  "CMEditViewCopyLocale.dialog.field.placeholder": "Select one locale...",
15
- "CMEditViewBulkLocale.publish-title": "Publish Multiple Locales",
16
- "CMEditViewBulkLocale.unpublish-title": "Unpublish Multiple Locales",
15
+ "CMEditViewBulkLocale.publish-title": "Publish multiple locales",
16
+ "CMEditViewBulkLocale.unpublish-title": "Unpublish multiple locales",
17
17
  "CMEditViewBulkLocale.status": "Status",
18
18
  "CMEditViewBulkLocale.publication-status": "Publication Status",
19
19
  "CMEditViewBulkLocale.draft-relation-warning": "Some locales are related to draft entries. Publishing them could leave broken links in your app.",
20
20
  "CMEditViewBulkLocale.continue-confirmation": "Are you sure you want to continue?",
21
+ "CMEditViewLocalePicker.locale.create": "Create <bold>{locale}</bold> locale",
21
22
  "CMListView.popover.display-locales.label": "Display translated locales",
22
23
  "CheckboxConfirmation.Modal.body": "Do you want to disable it?",
23
24
  "CheckboxConfirmation.Modal.button-confirm": "Yes, disable",
@@ -77,4 +78,4 @@ const en = {
77
78
  export {
78
79
  en as default
79
80
  };
80
- //# sourceMappingURL=en-2xztdZE1.mjs.map
81
+ //# sourceMappingURL=en-DlXfy6Gy.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"en-DlXfy6Gy.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -15,8 +15,7 @@ const qs = require("qs");
15
15
  const omit = require("lodash/omit");
16
16
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
17
17
  function _interopNamespace(e) {
18
- if (e && e.__esModule)
19
- return e;
18
+ if (e && e.__esModule) return e;
20
19
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
21
20
  if (e) {
22
21
  for (const k in e) {
@@ -37,13 +36,20 @@ const yup__namespace = /* @__PURE__ */ _interopNamespace(yup);
37
36
  const React__namespace = /* @__PURE__ */ _interopNamespace(React);
38
37
  const qs__namespace = /* @__PURE__ */ _interopNamespace(qs);
39
38
  const omit__default = /* @__PURE__ */ _interopDefault(omit);
40
- const __variableDynamicImportRuntimeHelper = (glob, path) => {
39
+ const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
41
40
  const v = glob[path];
42
41
  if (v) {
43
42
  return typeof v === "function" ? v() : Promise.resolve(v);
44
43
  }
45
44
  return new Promise((_, reject) => {
46
- (typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(reject.bind(null, new Error("Unknown variable dynamic import: " + path)));
45
+ (typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
46
+ reject.bind(
47
+ null,
48
+ new Error(
49
+ "Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "")
50
+ )
51
+ )
52
+ );
47
53
  });
48
54
  };
49
55
  const pluginId = "i18n";
@@ -252,7 +258,8 @@ const cleanData = (data, schema, components) => {
252
258
  "publishedAt",
253
259
  "strapi_stage",
254
260
  "strapi_assignee",
255
- "locale"
261
+ "locale",
262
+ "status"
256
263
  ]);
257
264
  const cleanedDataWithoutPasswordAndRelation = recursiveRemoveFieldTypes(
258
265
  cleanedData,
@@ -482,7 +489,6 @@ const BulkLocaleActionModal = ({
482
489
  paddingRight: "6px",
483
490
  paddingTop: "2px",
484
491
  paddingBottom: "2px",
485
- showBullet: false,
486
492
  size: "S",
487
493
  variant: statusVariant,
488
494
  children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "span", variant: "pi", fontWeight: "bold", children: capitalize(status) })
@@ -514,6 +520,47 @@ const BulkLocaleActionModal = ({
514
520
  ] }) })
515
521
  ] });
516
522
  };
523
+ const statusVariants = {
524
+ draft: "secondary",
525
+ published: "success",
526
+ modified: "alternative"
527
+ };
528
+ const LocaleOption = ({
529
+ isDraftAndPublishEnabled,
530
+ locale,
531
+ status,
532
+ entryExists
533
+ }) => {
534
+ const { formatMessage } = reactIntl.useIntl();
535
+ if (!entryExists) {
536
+ return formatMessage(
537
+ {
538
+ id: getTranslation("CMEditViewLocalePicker.locale.create"),
539
+ defaultMessage: "Create <bold>{locale}</bold> locale"
540
+ },
541
+ {
542
+ bold: (locale2) => /* @__PURE__ */ jsxRuntime.jsx("b", { children: locale2 }),
543
+ locale: locale.name
544
+ }
545
+ );
546
+ }
547
+ return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { width: "100%", gap: 1, justifyContent: "space-between", children: [
548
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: locale.name }),
549
+ isDraftAndPublishEnabled ? /* @__PURE__ */ jsxRuntime.jsx(
550
+ designSystem.Status,
551
+ {
552
+ display: "flex",
553
+ paddingLeft: "6px",
554
+ paddingRight: "6px",
555
+ paddingTop: "2px",
556
+ paddingBottom: "2px",
557
+ size: "S",
558
+ variant: statusVariants[status],
559
+ children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "span", variant: "pi", fontWeight: "bold", children: capitalize(status) })
560
+ }
561
+ ) : null
562
+ ] });
563
+ };
517
564
  const LocalePickerAction = ({
518
565
  document,
519
566
  meta,
@@ -555,46 +602,44 @@ const LocalePickerAction = ({
555
602
  handleSelect(defaultLocale.code);
556
603
  }
557
604
  }, [handleSelect, hasI18n, locales, currentDesiredLocale]);
558
- const currentLocale = Array.isArray(locales) ? locales.find((locale) => locale.code === currentDesiredLocale)?.code : void 0;
605
+ const currentLocale = Array.isArray(locales) ? locales.find((locale) => locale.code === currentDesiredLocale) : void 0;
559
606
  const allCurrentLocales = [
560
- { status: getDocumentStatus(document, meta), locale: currentLocale },
607
+ { status: getDocumentStatus(document, meta), locale: currentLocale?.code },
561
608
  ...meta?.availableLocales ?? []
562
609
  ];
563
610
  if (!hasI18n || !Array.isArray(locales) || locales.length === 0) {
564
611
  return null;
565
612
  }
613
+ const displayedLocales = locales.filter((locale) => {
614
+ return canRead.includes(locale.code);
615
+ });
566
616
  return {
567
617
  label: formatMessage({
568
618
  id: getTranslation("Settings.locales.modal.locales.label"),
569
619
  defaultMessage: "Locales"
570
620
  }),
571
- options: locales.map((locale) => {
621
+ options: displayedLocales.map((locale) => {
622
+ const entryWithLocaleExists = allCurrentLocales.some((doc) => doc.locale === locale.code);
572
623
  const currentLocaleDoc = allCurrentLocales.find(
573
624
  (doc) => "locale" in doc ? doc.locale === locale.code : false
574
625
  );
575
- const status = currentLocaleDoc?.status ?? "draft";
576
- const permissionsToCheck = currentLocaleDoc ? canCreate : canRead;
577
- const statusVariant = status === "draft" ? "secondary" : status === "published" ? "success" : "alternative";
626
+ const permissionsToCheck = currentLocaleDoc ? canRead : canCreate;
578
627
  return {
579
628
  disabled: !permissionsToCheck.includes(locale.code),
580
629
  value: locale.code,
581
- label: locale.name,
582
- startIcon: schema?.options?.draftAndPublish ? /* @__PURE__ */ jsxRuntime.jsx(
583
- designSystem.Status,
630
+ label: /* @__PURE__ */ jsxRuntime.jsx(
631
+ LocaleOption,
584
632
  {
585
- display: "flex",
586
- paddingLeft: "6px",
587
- paddingRight: "6px",
588
- paddingTop: "2px",
589
- paddingBottom: "2px",
590
- showBullet: false,
591
- size: "S",
592
- variant: statusVariant,
593
- children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "span", variant: "pi", fontWeight: "bold", children: capitalize(status) })
633
+ isDraftAndPublishEnabled: !!schema?.options?.draftAndPublish,
634
+ locale,
635
+ status: currentLocaleDoc?.status,
636
+ entryExists: entryWithLocaleExists
594
637
  }
595
- ) : null
638
+ ),
639
+ startIcon: !entryWithLocaleExists ? /* @__PURE__ */ jsxRuntime.jsx(icons.Plus, {}) : null
596
640
  };
597
641
  }),
642
+ customizeContent: () => currentLocale?.name,
598
643
  onSelect: handleSelect,
599
644
  value: currentLocale
600
645
  };
@@ -618,6 +663,7 @@ const FillFromAnotherLocaleAction = ({
618
663
  }) => {
619
664
  const { formatMessage } = reactIntl.useIntl();
620
665
  const [{ query: query2 }] = strapiAdmin.useQueryParams();
666
+ const { hasI18n } = useI18n();
621
667
  const currentDesiredLocale = query2.plugins?.i18n?.locale;
622
668
  const [localeSelected, setLocaleSelected] = React__namespace.useState(null);
623
669
  const setValues = strapiAdmin.useForm("FillFromAnotherLocale", (state) => state.setValues);
@@ -645,6 +691,9 @@ const FillFromAnotherLocaleAction = ({
645
691
  setValues(cleanedData);
646
692
  onClose();
647
693
  };
694
+ if (!hasI18n) {
695
+ return null;
696
+ }
648
697
  return {
649
698
  type: "icon",
650
699
  icon: /* @__PURE__ */ jsxRuntime.jsx(icons.Download, {}),
@@ -710,16 +759,23 @@ const DeleteLocaleAction = ({
710
759
  const { toggleNotification } = strapiAdmin.useNotification();
711
760
  const { delete: deleteAction } = strapiAdmin$1.unstable_useDocumentActions();
712
761
  const { hasI18n, canDelete } = useI18n();
762
+ const [{ query: query2 }] = strapiAdmin.useQueryParams();
763
+ const { data: locales = [] } = useGetLocalesQuery();
764
+ const currentDesiredLocale = query2.plugins?.i18n?.locale;
765
+ const locale = !("error" in locales) && locales.find((loc) => loc.code === currentDesiredLocale);
713
766
  if (!hasI18n) {
714
767
  return null;
715
768
  }
716
769
  return {
717
770
  disabled: document?.locale && !canDelete.includes(document.locale) || !document || !document.id,
718
771
  position: ["header", "table-row"],
719
- label: formatMessage({
720
- id: getTranslation("actions.delete.label"),
721
- defaultMessage: "Delete locale"
722
- }),
772
+ label: formatMessage(
773
+ {
774
+ id: getTranslation("actions.delete.label"),
775
+ defaultMessage: "Delete entry ({locale})"
776
+ },
777
+ { locale: locale && locale.name }
778
+ ),
723
779
  icon: /* @__PURE__ */ jsxRuntime.jsx(StyledTrash, {}),
724
780
  variant: "danger",
725
781
  dialog: {
@@ -736,7 +792,12 @@ const DeleteLocaleAction = ({
736
792
  }) })
737
793
  ] }),
738
794
  onConfirm: async () => {
739
- if (!documentId || !document?.locale) {
795
+ const unableToDelete = (
796
+ // We are unable to delete a collection type without a document ID
797
+ // & unable to delete generally if there is no document locale
798
+ collectionType !== "single-types" && !documentId || !document?.locale
799
+ );
800
+ if (unableToDelete) {
740
801
  console.error(
741
802
  "You're trying to delete a document without an id or locale, this is likely a bug with Strapi. Please open an issue."
742
803
  );
@@ -1369,9 +1430,6 @@ const localeMiddleware = (ctx) => (next) => (permissions) => {
1369
1430
  return next(revisedPermissions);
1370
1431
  };
1371
1432
  const prefixPluginTranslations = (trad, pluginId2) => {
1372
- if (!pluginId2) {
1373
- throw new TypeError("pluginId can't be empty");
1374
- }
1375
1433
  return Object.keys(trad).reduce((acc, current) => {
1376
1434
  acc[`${pluginId2}.${current}`] = trad[current];
1377
1435
  return acc;
@@ -1441,7 +1499,7 @@ const index = {
1441
1499
  },
1442
1500
  id: "internationalization",
1443
1501
  to: "internationalization",
1444
- Component: () => Promise.resolve().then(() => require("./SettingsPage-CfTmCkup.js")).then((mod) => ({ default: mod.ProtectedSettingsPage })),
1502
+ Component: () => Promise.resolve().then(() => require("./SettingsPage-BTgjb2KS.js")).then((mod) => ({ default: mod.ProtectedSettingsPage })),
1445
1503
  permissions: PERMISSIONS.accessMain
1446
1504
  });
1447
1505
  const contentManager = app.getPlugin("content-manager");
@@ -1559,7 +1617,7 @@ const index = {
1559
1617
  async registerTrads({ locales }) {
1560
1618
  const importedTrads = await Promise.all(
1561
1619
  locales.map((locale) => {
1562
- return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/de.json": () => Promise.resolve().then(() => require("./de-DtWiGdHl.js")), "./translations/dk.json": () => Promise.resolve().then(() => require("./dk-D8C-casx.js")), "./translations/en.json": () => Promise.resolve().then(() => require("./en-DWpfm8h5.js")), "./translations/es.json": () => Promise.resolve().then(() => require("./es-DS-XFGSw.js")), "./translations/fr.json": () => Promise.resolve().then(() => require("./fr-BTjekDpq.js")), "./translations/ko.json": () => Promise.resolve().then(() => require("./ko-DmcGUBQ3.js")), "./translations/pl.json": () => Promise.resolve().then(() => require("./pl-Cn5RYonZ.js")), "./translations/ru.json": () => Promise.resolve().then(() => require("./ru-BMBgVL3s.js")), "./translations/tr.json": () => Promise.resolve().then(() => require("./tr-CarUU76c.js")), "./translations/zh-Hans.json": () => Promise.resolve().then(() => require("./zh-Hans-DSHIXAa3.js")), "./translations/zh.json": () => Promise.resolve().then(() => require("./zh-CukOviB0.js")) }), `./translations/${locale}.json`).then(({ default: data }) => {
1620
+ return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/de.json": () => Promise.resolve().then(() => require("./de-DtWiGdHl.js")), "./translations/dk.json": () => Promise.resolve().then(() => require("./dk-D8C-casx.js")), "./translations/en.json": () => Promise.resolve().then(() => require("./en-BKBz3tro.js")), "./translations/es.json": () => Promise.resolve().then(() => require("./es-DS-XFGSw.js")), "./translations/fr.json": () => Promise.resolve().then(() => require("./fr-BTjekDpq.js")), "./translations/ko.json": () => Promise.resolve().then(() => require("./ko-DmcGUBQ3.js")), "./translations/pl.json": () => Promise.resolve().then(() => require("./pl-Cn5RYonZ.js")), "./translations/ru.json": () => Promise.resolve().then(() => require("./ru-BMBgVL3s.js")), "./translations/tr.json": () => Promise.resolve().then(() => require("./tr-CarUU76c.js")), "./translations/zh-Hans.json": () => Promise.resolve().then(() => require("./zh-Hans-DSHIXAa3.js")), "./translations/zh.json": () => Promise.resolve().then(() => require("./zh-CukOviB0.js")) }), `./translations/${locale}.json`, 3).then(({ default: data }) => {
1563
1621
  return {
1564
1622
  data: prefixPluginTranslations(data, pluginId),
1565
1623
  locale
@@ -1583,4 +1641,4 @@ exports.useDeleteLocaleMutation = useDeleteLocaleMutation;
1583
1641
  exports.useGetDefaultLocalesQuery = useGetDefaultLocalesQuery;
1584
1642
  exports.useGetLocalesQuery = useGetLocalesQuery;
1585
1643
  exports.useUpdateLocaleMutation = useUpdateLocaleMutation;
1586
- //# sourceMappingURL=index-5XLZwzwx.js.map
1644
+ //# sourceMappingURL=index-3yyF237r.js.map