@strapi/i18n 0.0.0-next.959c5589d0d3efa25d7ca014656d9ff48c173399 → 0.0.0-next.96a532b33a712f19b498ed0a82a84752247cd899
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin/components/BulkLocaleActionModal.js +262 -0
- package/dist/admin/components/BulkLocaleActionModal.js.map +1 -0
- package/dist/admin/components/BulkLocaleActionModal.mjs +260 -0
- package/dist/admin/components/BulkLocaleActionModal.mjs.map +1 -0
- package/dist/admin/components/CMHeaderActions.js +836 -0
- package/dist/admin/components/CMHeaderActions.js.map +1 -0
- package/dist/admin/components/CMHeaderActions.mjs +810 -0
- package/dist/admin/components/CMHeaderActions.mjs.map +1 -0
- package/dist/admin/components/CMListViewModalsAdditionalInformation.js +69 -0
- package/dist/admin/components/CMListViewModalsAdditionalInformation.js.map +1 -0
- package/dist/admin/components/CMListViewModalsAdditionalInformation.mjs +65 -0
- package/dist/admin/components/CMListViewModalsAdditionalInformation.mjs.map +1 -0
- package/dist/admin/components/CheckboxConfirmation.js +155 -0
- package/dist/admin/components/CheckboxConfirmation.js.map +1 -0
- package/dist/admin/components/CheckboxConfirmation.mjs +134 -0
- package/dist/admin/components/CheckboxConfirmation.mjs.map +1 -0
- package/dist/admin/components/CreateLocale.js +395 -0
- package/dist/admin/components/CreateLocale.js.map +1 -0
- package/dist/admin/components/CreateLocale.mjs +369 -0
- package/dist/admin/components/CreateLocale.mjs.map +1 -0
- package/dist/admin/components/DeleteLocale.js +90 -0
- package/dist/admin/components/DeleteLocale.js.map +1 -0
- package/dist/admin/components/DeleteLocale.mjs +69 -0
- package/dist/admin/components/DeleteLocale.mjs.map +1 -0
- package/dist/admin/components/EditLocale.js +212 -0
- package/dist/admin/components/EditLocale.js.map +1 -0
- package/dist/admin/components/EditLocale.mjs +190 -0
- package/dist/admin/components/EditLocale.mjs.map +1 -0
- package/dist/admin/components/LocaleListCell.js +102 -0
- package/dist/admin/components/LocaleListCell.js.map +1 -0
- package/dist/admin/components/LocaleListCell.mjs +100 -0
- package/dist/admin/components/LocaleListCell.mjs.map +1 -0
- package/dist/admin/components/LocalePicker.js +105 -0
- package/dist/admin/components/LocalePicker.js.map +1 -0
- package/dist/admin/components/LocalePicker.mjs +84 -0
- package/dist/admin/components/LocalePicker.mjs.map +1 -0
- package/dist/admin/components/LocaleTable.js +143 -0
- package/dist/admin/components/LocaleTable.js.map +1 -0
- package/dist/admin/components/LocaleTable.mjs +122 -0
- package/dist/admin/components/LocaleTable.mjs.map +1 -0
- package/dist/admin/constants.js +37 -0
- package/dist/admin/constants.js.map +1 -0
- package/dist/admin/constants.mjs +35 -0
- package/dist/admin/constants.mjs.map +1 -0
- package/dist/admin/contentManagerHooks/editView.js +109 -0
- package/dist/admin/contentManagerHooks/editView.js.map +1 -0
- package/dist/admin/contentManagerHooks/editView.mjs +88 -0
- package/dist/admin/contentManagerHooks/editView.mjs.map +1 -0
- package/dist/admin/contentManagerHooks/listView.js +44 -0
- package/dist/admin/contentManagerHooks/listView.js.map +1 -0
- package/dist/admin/contentManagerHooks/listView.mjs +42 -0
- package/dist/admin/contentManagerHooks/listView.mjs.map +1 -0
- package/dist/admin/contentReleasesHooks/releaseDetailsView.js +20 -0
- package/dist/admin/contentReleasesHooks/releaseDetailsView.js.map +1 -0
- package/dist/admin/contentReleasesHooks/releaseDetailsView.mjs +18 -0
- package/dist/admin/contentReleasesHooks/releaseDetailsView.mjs.map +1 -0
- package/dist/admin/hooks/useI18n.js +78 -0
- package/dist/admin/hooks/useI18n.js.map +1 -0
- package/dist/admin/hooks/useI18n.mjs +57 -0
- package/dist/admin/hooks/useI18n.mjs.map +1 -0
- package/dist/admin/index.js +226 -5
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +202 -5
- package/dist/admin/index.mjs.map +1 -1
- package/dist/admin/middlewares/extendCTBAttributeInitialData.js +71 -0
- package/dist/admin/middlewares/extendCTBAttributeInitialData.js.map +1 -0
- package/dist/admin/middlewares/extendCTBAttributeInitialData.mjs +69 -0
- package/dist/admin/middlewares/extendCTBAttributeInitialData.mjs.map +1 -0
- package/dist/admin/middlewares/extendCTBInitialData.js +40 -0
- package/dist/admin/middlewares/extendCTBInitialData.js.map +1 -0
- package/dist/admin/middlewares/extendCTBInitialData.mjs +38 -0
- package/dist/admin/middlewares/extendCTBInitialData.mjs.map +1 -0
- package/dist/admin/middlewares/rbac-middleware.js +49 -0
- package/dist/admin/middlewares/rbac-middleware.js.map +1 -0
- package/dist/admin/middlewares/rbac-middleware.mjs +28 -0
- package/dist/admin/middlewares/rbac-middleware.mjs.map +1 -0
- package/dist/admin/pages/SettingsPage.js +182 -0
- package/dist/admin/pages/SettingsPage.js.map +1 -0
- package/dist/admin/pages/SettingsPage.mjs +179 -0
- package/dist/admin/pages/SettingsPage.mjs.map +1 -0
- package/dist/admin/pluginId.js +6 -0
- package/dist/admin/pluginId.js.map +1 -0
- package/dist/admin/pluginId.mjs +4 -0
- package/dist/admin/pluginId.mjs.map +1 -0
- package/dist/admin/services/api.js +14 -0
- package/dist/admin/services/api.js.map +1 -0
- package/dist/admin/services/api.mjs +12 -0
- package/dist/admin/services/api.mjs.map +1 -0
- package/dist/admin/services/locales.js +72 -0
- package/dist/admin/services/locales.js.map +1 -0
- package/dist/admin/services/locales.mjs +66 -0
- package/dist/admin/services/locales.mjs.map +1 -0
- package/dist/admin/services/relations.js +23 -0
- package/dist/admin/services/relations.js.map +1 -0
- package/dist/admin/services/relations.mjs +21 -0
- package/dist/admin/services/relations.mjs.map +1 -0
- package/dist/admin/services/settings.js +29 -0
- package/dist/admin/services/settings.js.map +1 -0
- package/dist/admin/services/settings.mjs +26 -0
- package/dist/admin/services/settings.mjs.map +1 -0
- package/dist/admin/src/components/CMHeaderActions.d.ts +9 -3
- package/dist/admin/src/components/LocaleListCell.d.ts +5 -4
- package/dist/admin/src/components/tests/CreateLocale.test.d.ts +1 -0
- package/dist/admin/src/components/tests/DeleteLocale.test.d.ts +1 -0
- package/dist/admin/src/components/tests/EditLocale.test.d.ts +1 -0
- package/dist/admin/src/components/tests/LocaleListCell.test.d.ts +1 -0
- package/dist/admin/src/contentReleasesHooks/releaseDetailsView.d.ts +1 -1
- package/dist/admin/src/pages/tests/SettingsPage.test.d.ts +1 -0
- package/dist/admin/src/services/api.d.ts +1 -1
- package/dist/admin/src/services/locales.d.ts +1 -1
- package/dist/admin/src/services/relations.d.ts +1 -1
- package/dist/admin/src/services/settings.d.ts +5 -0
- package/dist/admin/src/utils/schemas.d.ts +642 -16
- package/dist/admin/tests/server.d.ts +1 -0
- package/dist/admin/tests/utils.d.ts +6 -0
- package/dist/admin/translations/de.json.js +66 -0
- package/dist/admin/translations/de.json.js.map +1 -0
- package/dist/admin/translations/de.json.mjs +64 -0
- package/dist/admin/translations/de.json.mjs.map +1 -0
- package/dist/admin/translations/dk.json.js +66 -0
- package/dist/admin/translations/dk.json.js.map +1 -0
- package/dist/admin/translations/dk.json.mjs +64 -0
- package/dist/admin/translations/dk.json.mjs.map +1 -0
- package/dist/admin/translations/en.json.js +88 -0
- package/dist/admin/translations/en.json.js.map +1 -0
- package/dist/admin/translations/en.json.mjs +86 -0
- package/dist/admin/translations/en.json.mjs.map +1 -0
- package/dist/admin/translations/es.json.js +66 -0
- package/dist/admin/translations/es.json.js.map +1 -0
- package/dist/admin/translations/es.json.mjs +64 -0
- package/dist/admin/translations/es.json.mjs.map +1 -0
- package/dist/admin/translations/fr.json.js +66 -0
- package/dist/admin/translations/fr.json.js.map +1 -0
- package/dist/admin/translations/fr.json.mjs +64 -0
- package/dist/admin/translations/fr.json.mjs.map +1 -0
- package/dist/admin/translations/ko.json.js +65 -0
- package/dist/admin/translations/ko.json.js.map +1 -0
- package/dist/admin/translations/ko.json.mjs +63 -0
- package/dist/admin/translations/ko.json.mjs.map +1 -0
- package/dist/admin/translations/pl.json.js +66 -0
- package/dist/admin/translations/pl.json.js.map +1 -0
- package/dist/admin/translations/pl.json.mjs +64 -0
- package/dist/admin/translations/pl.json.mjs.map +1 -0
- package/dist/admin/translations/ru.json.js +68 -0
- package/dist/admin/translations/ru.json.js.map +1 -0
- package/dist/admin/translations/ru.json.mjs +66 -0
- package/dist/admin/translations/ru.json.mjs.map +1 -0
- package/dist/admin/translations/tr.json.js +66 -0
- package/dist/admin/translations/tr.json.js.map +1 -0
- package/dist/admin/translations/tr.json.mjs +64 -0
- package/dist/admin/translations/tr.json.mjs.map +1 -0
- package/dist/admin/translations/uk.json.js +82 -0
- package/dist/admin/translations/uk.json.js.map +1 -0
- package/dist/admin/translations/uk.json.mjs +80 -0
- package/dist/admin/translations/uk.json.mjs.map +1 -0
- package/dist/admin/translations/zh-Hans.json.js +57 -0
- package/dist/admin/translations/zh-Hans.json.js.map +1 -0
- package/dist/admin/translations/zh-Hans.json.mjs +55 -0
- package/dist/admin/translations/zh-Hans.json.mjs.map +1 -0
- package/dist/admin/translations/zh.json.js +66 -0
- package/dist/admin/translations/zh.json.js.map +1 -0
- package/dist/admin/translations/zh.json.mjs +64 -0
- package/dist/admin/translations/zh.json.mjs.map +1 -0
- package/dist/admin/utils/baseQuery.js +8 -0
- package/dist/admin/utils/baseQuery.js.map +1 -0
- package/dist/admin/utils/baseQuery.mjs +6 -0
- package/dist/admin/utils/baseQuery.mjs.map +1 -0
- package/dist/admin/utils/clean.js +70 -0
- package/dist/admin/utils/clean.js.map +1 -0
- package/dist/admin/utils/clean.mjs +68 -0
- package/dist/admin/utils/clean.mjs.map +1 -0
- package/dist/admin/utils/fields.js +34 -0
- package/dist/admin/utils/fields.js.map +1 -0
- package/dist/admin/utils/fields.mjs +31 -0
- package/dist/admin/utils/fields.mjs.map +1 -0
- package/dist/admin/utils/getTranslation.js +8 -0
- package/dist/admin/utils/getTranslation.js.map +1 -0
- package/dist/admin/utils/getTranslation.mjs +6 -0
- package/dist/admin/utils/getTranslation.mjs.map +1 -0
- package/dist/admin/utils/prefixPluginTranslations.js +11 -0
- package/dist/admin/utils/prefixPluginTranslations.js.map +1 -0
- package/dist/admin/utils/prefixPluginTranslations.mjs +9 -0
- package/dist/admin/utils/prefixPluginTranslations.mjs.map +1 -0
- package/dist/admin/utils/schemas.js +74 -0
- package/dist/admin/utils/schemas.js.map +1 -0
- package/dist/admin/utils/schemas.mjs +72 -0
- package/dist/admin/utils/schemas.mjs.map +1 -0
- package/dist/admin/utils/strings.js +6 -0
- package/dist/admin/utils/strings.js.map +1 -0
- package/dist/admin/utils/strings.mjs +4 -0
- package/dist/admin/utils/strings.mjs.map +1 -0
- package/dist/server/bootstrap.js +79 -0
- package/dist/server/bootstrap.js.map +1 -0
- package/dist/server/bootstrap.mjs +77 -0
- package/dist/server/bootstrap.mjs.map +1 -0
- package/dist/server/constants/index.js +29 -0
- package/dist/server/constants/index.js.map +1 -0
- package/dist/server/constants/index.mjs +25 -0
- package/dist/server/constants/index.mjs.map +1 -0
- package/dist/server/constants/iso-locales.json.js +2427 -0
- package/dist/server/constants/iso-locales.json.js.map +1 -0
- package/dist/server/constants/iso-locales.json.mjs +2425 -0
- package/dist/server/constants/iso-locales.json.mjs.map +1 -0
- package/dist/server/content-types/index.js +10 -0
- package/dist/server/content-types/index.js.map +1 -0
- package/dist/server/content-types/index.mjs +8 -0
- package/dist/server/content-types/index.mjs.map +1 -0
- package/dist/server/content-types/locale/index.js +10 -0
- package/dist/server/content-types/locale/index.js.map +1 -0
- package/dist/server/content-types/locale/index.mjs +8 -0
- package/dist/server/content-types/locale/index.mjs.map +1 -0
- package/dist/server/content-types/locale/schema.json.js +46 -0
- package/dist/server/content-types/locale/schema.json.js.map +1 -0
- package/dist/server/content-types/locale/schema.json.mjs +38 -0
- package/dist/server/content-types/locale/schema.json.mjs.map +1 -0
- package/dist/server/controllers/content-types.js +76 -0
- package/dist/server/controllers/content-types.js.map +1 -0
- package/dist/server/controllers/content-types.mjs +74 -0
- package/dist/server/controllers/content-types.mjs.map +1 -0
- package/dist/server/controllers/index.js +16 -0
- package/dist/server/controllers/index.js.map +1 -0
- package/dist/server/controllers/index.mjs +14 -0
- package/dist/server/controllers/index.mjs.map +1 -0
- package/dist/server/controllers/iso-locales.js +13 -0
- package/dist/server/controllers/iso-locales.js.map +1 -0
- package/dist/server/controllers/iso-locales.mjs +11 -0
- package/dist/server/controllers/iso-locales.mjs.map +1 -0
- package/dist/server/controllers/locales.js +108 -0
- package/dist/server/controllers/locales.js.map +1 -0
- package/dist/server/controllers/locales.mjs +87 -0
- package/dist/server/controllers/locales.mjs.map +1 -0
- package/dist/server/controllers/settings.js +24 -0
- package/dist/server/controllers/settings.js.map +1 -0
- package/dist/server/controllers/settings.mjs +22 -0
- package/dist/server/controllers/settings.mjs.map +1 -0
- package/dist/server/controllers/validate-locale-creation.js +47 -0
- package/dist/server/controllers/validate-locale-creation.js.map +1 -0
- package/dist/server/controllers/validate-locale-creation.mjs +45 -0
- package/dist/server/controllers/validate-locale-creation.mjs.map +1 -0
- package/dist/server/domain/locale.js +11 -0
- package/dist/server/domain/locale.js.map +1 -0
- package/dist/server/domain/locale.mjs +9 -0
- package/dist/server/domain/locale.mjs.map +1 -0
- package/dist/server/graphql.js +115 -0
- package/dist/server/graphql.js.map +1 -0
- package/dist/server/graphql.mjs +113 -0
- package/dist/server/graphql.mjs.map +1 -0
- package/dist/server/index.js +18 -3430
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +17 -3412
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/register.js +79 -0
- package/dist/server/register.js.map +1 -0
- package/dist/server/register.mjs +77 -0
- package/dist/server/register.mjs.map +1 -0
- package/dist/server/routes/admin.js +122 -0
- package/dist/server/routes/admin.js.map +1 -0
- package/dist/server/routes/admin.mjs +120 -0
- package/dist/server/routes/admin.mjs.map +1 -0
- package/dist/server/routes/content-api.js +19 -0
- package/dist/server/routes/content-api.js.map +1 -0
- package/dist/server/routes/content-api.mjs +17 -0
- package/dist/server/routes/content-api.mjs.map +1 -0
- package/dist/server/routes/index.js +12 -0
- package/dist/server/routes/index.js.map +1 -0
- package/dist/server/routes/index.mjs +10 -0
- package/dist/server/routes/index.mjs.map +1 -0
- package/dist/server/routes/validation/locale.js +57 -0
- package/dist/server/routes/validation/locale.js.map +1 -0
- package/dist/server/routes/validation/locale.mjs +36 -0
- package/dist/server/routes/validation/locale.mjs.map +1 -0
- package/dist/server/services/ai-localizations.js +143 -0
- package/dist/server/services/ai-localizations.js.map +1 -0
- package/dist/server/services/ai-localizations.mjs +141 -0
- package/dist/server/services/ai-localizations.mjs.map +1 -0
- package/dist/server/services/content-types.js +157 -0
- package/dist/server/services/content-types.js.map +1 -0
- package/dist/server/services/content-types.mjs +155 -0
- package/dist/server/services/content-types.mjs.map +1 -0
- package/dist/server/services/index.js +26 -0
- package/dist/server/services/index.js.map +1 -0
- package/dist/server/services/index.mjs +24 -0
- package/dist/server/services/index.mjs.map +1 -0
- package/dist/server/services/iso-locales.js +12 -0
- package/dist/server/services/iso-locales.js.map +1 -0
- package/dist/server/services/iso-locales.mjs +10 -0
- package/dist/server/services/iso-locales.mjs.map +1 -0
- package/dist/server/services/locales.js +114 -0
- package/dist/server/services/locales.js.map +1 -0
- package/dist/server/services/locales.mjs +112 -0
- package/dist/server/services/locales.mjs.map +1 -0
- package/dist/server/services/localizations.js +68 -0
- package/dist/server/services/localizations.js.map +1 -0
- package/dist/server/services/localizations.mjs +66 -0
- package/dist/server/services/localizations.mjs.map +1 -0
- package/dist/server/services/metrics.js +30 -0
- package/dist/server/services/metrics.js.map +1 -0
- package/dist/server/services/metrics.mjs +28 -0
- package/dist/server/services/metrics.mjs.map +1 -0
- package/dist/server/services/permissions/actions.js +136 -0
- package/dist/server/services/permissions/actions.js.map +1 -0
- package/dist/server/services/permissions/actions.mjs +134 -0
- package/dist/server/services/permissions/actions.mjs.map +1 -0
- package/dist/server/services/permissions/engine.js +52 -0
- package/dist/server/services/permissions/engine.js.map +1 -0
- package/dist/server/services/permissions/engine.mjs +50 -0
- package/dist/server/services/permissions/engine.mjs.map +1 -0
- package/dist/server/services/permissions/sections-builder.js +45 -0
- package/dist/server/services/permissions/sections-builder.js.map +1 -0
- package/dist/server/services/permissions/sections-builder.mjs +43 -0
- package/dist/server/services/permissions/sections-builder.mjs.map +1 -0
- package/dist/server/services/permissions.js +14 -0
- package/dist/server/services/permissions.js.map +1 -0
- package/dist/server/services/permissions.mjs +12 -0
- package/dist/server/services/permissions.mjs.map +1 -0
- package/dist/server/services/sanitize/index.js +34 -0
- package/dist/server/services/sanitize/index.js.map +1 -0
- package/dist/server/services/sanitize/index.mjs +32 -0
- package/dist/server/services/sanitize/index.mjs.map +1 -0
- package/dist/server/services/settings.js +25 -0
- package/dist/server/services/settings.js.map +1 -0
- package/dist/server/services/settings.mjs +23 -0
- package/dist/server/services/settings.mjs.map +1 -0
- package/dist/server/src/controllers/index.d.ts +4 -0
- package/dist/server/src/controllers/index.d.ts.map +1 -1
- package/dist/server/src/controllers/settings.d.ts +7 -0
- package/dist/server/src/controllers/settings.d.ts.map +1 -0
- package/dist/server/src/index.d.ts +32 -7
- package/dist/server/src/index.d.ts.map +1 -1
- package/dist/server/src/register.d.ts.map +1 -1
- package/dist/server/src/routes/admin.d.ts.map +1 -1
- package/dist/server/src/routes/content-api.d.ts +5 -8
- package/dist/server/src/routes/content-api.d.ts.map +1 -1
- package/dist/server/src/routes/index.d.ts +3 -7
- package/dist/server/src/routes/index.d.ts.map +1 -1
- package/dist/server/src/routes/validation/index.d.ts +2 -0
- package/dist/server/src/routes/validation/index.d.ts.map +1 -0
- package/dist/server/src/routes/validation/locale.d.ts +41 -0
- package/dist/server/src/routes/validation/locale.d.ts.map +1 -0
- package/dist/server/src/services/ai-localizations.d.ts +17 -0
- package/dist/server/src/services/ai-localizations.d.ts.map +1 -0
- package/dist/server/src/services/index.d.ts +25 -0
- package/dist/server/src/services/index.d.ts.map +1 -1
- package/dist/server/src/services/localizations.d.ts +1 -1
- package/dist/server/src/services/localizations.d.ts.map +1 -1
- package/dist/server/src/services/sanitize/index.d.ts +11 -0
- package/dist/server/src/services/sanitize/index.d.ts.map +1 -0
- package/dist/server/src/services/settings.d.ts +13 -0
- package/dist/server/src/services/settings.d.ts.map +1 -0
- package/dist/server/src/utils/index.d.ts +7 -1
- package/dist/server/src/utils/index.d.ts.map +1 -1
- package/dist/server/src/validation/settings.d.ts +12 -0
- package/dist/server/src/validation/settings.d.ts.map +1 -0
- package/dist/server/utils/index.js +16 -0
- package/dist/server/utils/index.js.map +1 -0
- package/dist/server/utils/index.mjs +13 -0
- package/dist/server/utils/index.mjs.map +1 -0
- package/dist/server/validation/content-types.js +18 -0
- package/dist/server/validation/content-types.js.map +1 -0
- package/dist/server/validation/content-types.mjs +16 -0
- package/dist/server/validation/content-types.mjs.map +1 -0
- package/dist/server/validation/locales.js +23 -0
- package/dist/server/validation/locales.js.map +1 -0
- package/dist/server/validation/locales.mjs +20 -0
- package/dist/server/validation/locales.mjs.map +1 -0
- package/dist/server/validation/settings.js +11 -0
- package/dist/server/validation/settings.js.map +1 -0
- package/dist/server/validation/settings.mjs +9 -0
- package/dist/server/validation/settings.mjs.map +1 -0
- package/dist/shared/contracts/content-manager.d.ts +1 -1
- package/dist/shared/contracts/settings.d.ts +40 -0
- package/dist/shared/contracts/shared.d.ts +1 -1
- package/package.json +21 -17
- package/dist/_chunks/SettingsPage-D_53Ao8I.mjs +0 -554
- package/dist/_chunks/SettingsPage-D_53Ao8I.mjs.map +0 -1
- package/dist/_chunks/SettingsPage-Z94BBMrV.js +0 -574
- package/dist/_chunks/SettingsPage-Z94BBMrV.js.map +0 -1
- package/dist/_chunks/de-9eCAqqrB.mjs +0 -66
- package/dist/_chunks/de-9eCAqqrB.mjs.map +0 -1
- package/dist/_chunks/de-DtWiGdHl.js +0 -66
- package/dist/_chunks/de-DtWiGdHl.js.map +0 -1
- package/dist/_chunks/dk-2qBjxt-P.mjs +0 -66
- package/dist/_chunks/dk-2qBjxt-P.mjs.map +0 -1
- package/dist/_chunks/dk-D8C-casx.js +0 -66
- package/dist/_chunks/dk-D8C-casx.js.map +0 -1
- package/dist/_chunks/en-BKBz3tro.js +0 -81
- package/dist/_chunks/en-BKBz3tro.js.map +0 -1
- package/dist/_chunks/en-DlXfy6Gy.mjs +0 -81
- package/dist/_chunks/en-DlXfy6Gy.mjs.map +0 -1
- package/dist/_chunks/es-DS-XFGSw.js +0 -66
- package/dist/_chunks/es-DS-XFGSw.js.map +0 -1
- package/dist/_chunks/es-DlmMVaBG.mjs +0 -66
- package/dist/_chunks/es-DlmMVaBG.mjs.map +0 -1
- package/dist/_chunks/fr-3S6ke71d.mjs +0 -66
- package/dist/_chunks/fr-3S6ke71d.mjs.map +0 -1
- package/dist/_chunks/fr-BTjekDpq.js +0 -66
- package/dist/_chunks/fr-BTjekDpq.js.map +0 -1
- package/dist/_chunks/index-BGhYo_Rs.mjs +0 -1611
- package/dist/_chunks/index-BGhYo_Rs.mjs.map +0 -1
- package/dist/_chunks/index-BOvOaxo-.js +0 -1633
- package/dist/_chunks/index-BOvOaxo-.js.map +0 -1
- package/dist/_chunks/ko-DmcGUBQ3.js +0 -65
- package/dist/_chunks/ko-DmcGUBQ3.js.map +0 -1
- package/dist/_chunks/ko-qTjQ8IMw.mjs +0 -65
- package/dist/_chunks/ko-qTjQ8IMw.mjs.map +0 -1
- package/dist/_chunks/pl-B67TSHqT.mjs +0 -66
- package/dist/_chunks/pl-B67TSHqT.mjs.map +0 -1
- package/dist/_chunks/pl-Cn5RYonZ.js +0 -66
- package/dist/_chunks/pl-Cn5RYonZ.js.map +0 -1
- package/dist/_chunks/ru-BMBgVL3s.js +0 -68
- package/dist/_chunks/ru-BMBgVL3s.js.map +0 -1
- package/dist/_chunks/ru-hagMa57T.mjs +0 -68
- package/dist/_chunks/ru-hagMa57T.mjs.map +0 -1
- package/dist/_chunks/tr-CarUU76c.js +0 -66
- package/dist/_chunks/tr-CarUU76c.js.map +0 -1
- package/dist/_chunks/tr-Dw_jmkG-.mjs +0 -66
- package/dist/_chunks/tr-Dw_jmkG-.mjs.map +0 -1
- package/dist/_chunks/zh-57YM4amO.mjs +0 -66
- package/dist/_chunks/zh-57YM4amO.mjs.map +0 -1
- package/dist/_chunks/zh-CukOviB0.js +0 -66
- package/dist/_chunks/zh-CukOviB0.js.map +0 -1
- package/dist/_chunks/zh-Hans-DSHIXAa3.js +0 -57
- package/dist/_chunks/zh-Hans-DSHIXAa3.js.map +0 -1
- package/dist/_chunks/zh-Hans-Dyc-aR-h.mjs +0 -57
- package/dist/_chunks/zh-Hans-Dyc-aR-h.mjs.map +0 -1
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import get from 'lodash/get';
|
|
2
|
+
|
|
3
|
+
const extendCTBAttributeInitialDataMiddleware = ()=>{
|
|
4
|
+
return ({ getState })=>(next)=>(action)=>{
|
|
5
|
+
const enhanceAction = ({ uid })=>{
|
|
6
|
+
// the block here is to catch the error when trying to access the state
|
|
7
|
+
// of the ctb when the plugin is not mounted
|
|
8
|
+
try {
|
|
9
|
+
const store = getState();
|
|
10
|
+
const type = get(store, [
|
|
11
|
+
'content-type-builder_dataManagerProvider',
|
|
12
|
+
'current',
|
|
13
|
+
'contentTypes',
|
|
14
|
+
uid
|
|
15
|
+
]);
|
|
16
|
+
if (!type || type.modelType !== 'contentType') {
|
|
17
|
+
return next(action);
|
|
18
|
+
}
|
|
19
|
+
const hasi18nEnabled = get(type, [
|
|
20
|
+
'pluginOptions',
|
|
21
|
+
'i18n',
|
|
22
|
+
'localized'
|
|
23
|
+
], false);
|
|
24
|
+
if (hasi18nEnabled) {
|
|
25
|
+
return next({
|
|
26
|
+
...action,
|
|
27
|
+
payload: {
|
|
28
|
+
...action.payload,
|
|
29
|
+
options: {
|
|
30
|
+
pluginOptions: {
|
|
31
|
+
...action?.payload?.options?.pluginOptions ?? {},
|
|
32
|
+
i18n: {
|
|
33
|
+
localized: true
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
return next(action);
|
|
41
|
+
} catch (err) {
|
|
42
|
+
return next(action);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
const { payload = {}, type } = action ?? {};
|
|
46
|
+
if (type === 'formModal/setAttributeDataSchema' && ![
|
|
47
|
+
'relation',
|
|
48
|
+
'component'
|
|
49
|
+
].includes(payload.attributeType) && !payload.isEditing) {
|
|
50
|
+
return enhanceAction({
|
|
51
|
+
uid: payload.uid
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
if (type === 'formModal/setCustomFieldDataSchema' && !payload.isEditing) {
|
|
55
|
+
return enhanceAction({
|
|
56
|
+
uid: payload.uid
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
if (type === 'formModal/resetPropsAndSetFormForAddingAnExistingCompo' || type === 'formModal/resetPropsAndSaveCurrentData') {
|
|
60
|
+
return enhanceAction({
|
|
61
|
+
uid: payload.uid
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
return next(action);
|
|
65
|
+
};
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export { extendCTBAttributeInitialDataMiddleware };
|
|
69
|
+
//# sourceMappingURL=extendCTBAttributeInitialData.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extendCTBAttributeInitialData.mjs","sources":["../../../admin/src/middlewares/extendCTBAttributeInitialData.ts"],"sourcesContent":["import get from 'lodash/get';\n\nimport type { Middleware } from '@reduxjs/toolkit';\nimport type { Store } from '@strapi/admin/strapi-admin';\n\nconst extendCTBAttributeInitialDataMiddleware: () => Middleware<\n object,\n ReturnType<Store['getState']>\n> = () => {\n return ({ getState }) =>\n (next) =>\n (action) => {\n const enhanceAction = ({ uid }: { uid: string }) => {\n // the block here is to catch the error when trying to access the state\n // of the ctb when the plugin is not mounted\n try {\n const store = getState();\n\n const type = get(store, [\n 'content-type-builder_dataManagerProvider',\n 'current',\n 'contentTypes',\n uid,\n ]);\n\n if (!type || type.modelType !== 'contentType') {\n return next(action);\n }\n\n const hasi18nEnabled = get(type, ['pluginOptions', 'i18n', 'localized'], false);\n\n if (hasi18nEnabled) {\n return next({\n ...action,\n payload: {\n ...action.payload,\n options: {\n pluginOptions: {\n ...(action?.payload?.options?.pluginOptions ?? {}),\n i18n: {\n localized: true,\n },\n },\n },\n },\n });\n }\n\n return next(action);\n } catch (err) {\n return next(action);\n }\n };\n\n const { payload = {}, type } = action ?? {};\n\n if (\n type === 'formModal/setAttributeDataSchema' &&\n !['relation', 'component'].includes(payload.attributeType) &&\n !payload.isEditing\n ) {\n return enhanceAction({\n uid: payload.uid,\n });\n }\n\n if (type === 'formModal/setCustomFieldDataSchema' && !payload.isEditing) {\n return enhanceAction({\n uid: payload.uid,\n });\n }\n\n if (\n type === 'formModal/resetPropsAndSetFormForAddingAnExistingCompo' ||\n type === 'formModal/resetPropsAndSaveCurrentData'\n ) {\n return enhanceAction({\n uid: payload.uid,\n });\n }\n\n return next(action);\n };\n};\n\nexport { extendCTBAttributeInitialDataMiddleware };\n"],"names":["extendCTBAttributeInitialDataMiddleware","getState","next","action","enhanceAction","uid","store","type","get","modelType","hasi18nEnabled","payload","options","pluginOptions","i18n","localized","err","includes","attributeType","isEditing"],"mappings":";;AAKA,MAAMA,uCAGF,GAAA,IAAA;AACF,IAAA,OAAO,CAAC,EAAEC,QAAQ,EAAE,GAClB,CAACC,OACD,CAACC,MAAAA,GAAAA;AACC,gBAAA,MAAMC,aAAgB,GAAA,CAAC,EAAEC,GAAG,EAAmB,GAAA;;;oBAG7C,IAAI;AACF,wBAAA,MAAMC,KAAQL,GAAAA,QAAAA,EAAAA;wBAEd,MAAMM,IAAAA,GAAOC,IAAIF,KAAO,EAAA;AACtB,4BAAA,0CAAA;AACA,4BAAA,SAAA;AACA,4BAAA,cAAA;AACAD,4BAAAA;AACD,yBAAA,CAAA;AAED,wBAAA,IAAI,CAACE,IAAAA,IAAQA,IAAKE,CAAAA,SAAS,KAAK,aAAe,EAAA;AAC7C,4BAAA,OAAOP,IAAKC,CAAAA,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,OAAOH,aAAc,CAAA;AACnBC,wBAAAA,GAAAA,EAAKM,QAAQN;AACf,qBAAA,CAAA;AACF;AAEA,gBAAA,OAAOH,IAAKC,CAAAA,MAAAA,CAAAA;AACd,aAAA;AACJ;;;;"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const extendCTBInitialDataMiddleware = ()=>{
|
|
4
|
+
return ()=>(next)=>(action)=>{
|
|
5
|
+
if (action.type === 'ContentTypeBuilder/FormModal/SET_DATA_TO_EDIT' && action.modalType === 'contentType') {
|
|
6
|
+
const i18n = {
|
|
7
|
+
localized: false
|
|
8
|
+
};
|
|
9
|
+
const pluginOptions = action.data.pluginOptions ? {
|
|
10
|
+
...action.data.pluginOptions,
|
|
11
|
+
i18n
|
|
12
|
+
} : {
|
|
13
|
+
i18n
|
|
14
|
+
};
|
|
15
|
+
const data = {
|
|
16
|
+
...action.data,
|
|
17
|
+
pluginOptions
|
|
18
|
+
};
|
|
19
|
+
if (action.actionType === 'create') {
|
|
20
|
+
return next({
|
|
21
|
+
...action,
|
|
22
|
+
data
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
// Override the action if the pluginOption config does not contain i18n
|
|
26
|
+
// In this case we need to set the proper initialData shape
|
|
27
|
+
if (!action.data.pluginOptions?.i18n?.localized) {
|
|
28
|
+
return next({
|
|
29
|
+
...action,
|
|
30
|
+
data
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
// action is not the one we want to override
|
|
35
|
+
return next(action);
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
exports.extendCTBInitialDataMiddleware = extendCTBInitialDataMiddleware;
|
|
40
|
+
//# sourceMappingURL=extendCTBInitialData.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extendCTBInitialData.js","sources":["../../../admin/src/middlewares/extendCTBInitialData.ts"],"sourcesContent":["import type { Middleware } from '@reduxjs/toolkit';\nimport type { Store } from '@strapi/admin/strapi-admin';\n\nconst extendCTBInitialDataMiddleware: () => Middleware<\n object,\n ReturnType<Store['getState']>\n> = () => {\n return () => (next) => (action) => {\n if (\n action.type === 'ContentTypeBuilder/FormModal/SET_DATA_TO_EDIT' &&\n action.modalType === 'contentType'\n ) {\n const i18n = { localized: false };\n\n const pluginOptions = action.data.pluginOptions\n ? { ...action.data.pluginOptions, i18n }\n : { i18n };\n\n const data = { ...action.data, pluginOptions };\n\n if (action.actionType === 'create') {\n return next({ ...action, data });\n }\n\n // Override the action if the pluginOption config does not contain i18n\n // In this case we need to set the proper initialData shape\n if (!action.data.pluginOptions?.i18n?.localized) {\n return next({ ...action, data });\n }\n }\n\n // action is not the one we want to override\n return next(action);\n };\n};\n\nexport { extendCTBInitialDataMiddleware };\n"],"names":["extendCTBInitialDataMiddleware","next","action","type","modalType","i18n","localized","pluginOptions","data","actionType"],"mappings":";;AAGA,MAAMA,8BAGF,GAAA,IAAA;IACF,OAAO,IAAM,CAACC,IAAAA,GAAS,CAACC,MAAAA,GAAAA;AACtB,gBAAA,IACEA,OAAOC,IAAI,KAAK,mDAChBD,MAAOE,CAAAA,SAAS,KAAK,aACrB,EAAA;AACA,oBAAA,MAAMC,IAAO,GAAA;wBAAEC,SAAW,EAAA;AAAM,qBAAA;AAEhC,oBAAA,MAAMC,aAAgBL,GAAAA,MAAAA,CAAOM,IAAI,CAACD,aAAa,GAC3C;wBAAE,GAAGL,MAAAA,CAAOM,IAAI,CAACD,aAAa;AAAEF,wBAAAA;qBAChC,GAAA;AAAEA,wBAAAA;AAAK,qBAAA;AAEX,oBAAA,MAAMG,IAAO,GAAA;AAAE,wBAAA,GAAGN,OAAOM,IAAI;AAAED,wBAAAA;AAAc,qBAAA;oBAE7C,IAAIL,MAAAA,CAAOO,UAAU,KAAK,QAAU,EAAA;AAClC,wBAAA,OAAOR,IAAK,CAAA;AAAE,4BAAA,GAAGC,MAAM;AAAEM,4BAAAA;AAAK,yBAAA,CAAA;AAChC;;;AAIA,oBAAA,IAAI,CAACN,MAAOM,CAAAA,IAAI,CAACD,aAAa,EAAEF,MAAMC,SAAW,EAAA;AAC/C,wBAAA,OAAOL,IAAK,CAAA;AAAE,4BAAA,GAAGC,MAAM;AAAEM,4BAAAA;AAAK,yBAAA,CAAA;AAChC;AACF;;AAGA,gBAAA,OAAOP,IAAKC,CAAAA,MAAAA,CAAAA;AACd,aAAA;AACF;;;;"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const extendCTBInitialDataMiddleware = ()=>{
|
|
2
|
+
return ()=>(next)=>(action)=>{
|
|
3
|
+
if (action.type === 'ContentTypeBuilder/FormModal/SET_DATA_TO_EDIT' && action.modalType === 'contentType') {
|
|
4
|
+
const i18n = {
|
|
5
|
+
localized: false
|
|
6
|
+
};
|
|
7
|
+
const pluginOptions = action.data.pluginOptions ? {
|
|
8
|
+
...action.data.pluginOptions,
|
|
9
|
+
i18n
|
|
10
|
+
} : {
|
|
11
|
+
i18n
|
|
12
|
+
};
|
|
13
|
+
const data = {
|
|
14
|
+
...action.data,
|
|
15
|
+
pluginOptions
|
|
16
|
+
};
|
|
17
|
+
if (action.actionType === 'create') {
|
|
18
|
+
return next({
|
|
19
|
+
...action,
|
|
20
|
+
data
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
// Override the action if the pluginOption config does not contain i18n
|
|
24
|
+
// In this case we need to set the proper initialData shape
|
|
25
|
+
if (!action.data.pluginOptions?.i18n?.localized) {
|
|
26
|
+
return next({
|
|
27
|
+
...action,
|
|
28
|
+
data
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
// action is not the one we want to override
|
|
33
|
+
return next(action);
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export { extendCTBInitialDataMiddleware };
|
|
38
|
+
//# sourceMappingURL=extendCTBInitialData.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extendCTBInitialData.mjs","sources":["../../../admin/src/middlewares/extendCTBInitialData.ts"],"sourcesContent":["import type { Middleware } from '@reduxjs/toolkit';\nimport type { Store } from '@strapi/admin/strapi-admin';\n\nconst extendCTBInitialDataMiddleware: () => Middleware<\n object,\n ReturnType<Store['getState']>\n> = () => {\n return () => (next) => (action) => {\n if (\n action.type === 'ContentTypeBuilder/FormModal/SET_DATA_TO_EDIT' &&\n action.modalType === 'contentType'\n ) {\n const i18n = { localized: false };\n\n const pluginOptions = action.data.pluginOptions\n ? { ...action.data.pluginOptions, i18n }\n : { i18n };\n\n const data = { ...action.data, pluginOptions };\n\n if (action.actionType === 'create') {\n return next({ ...action, data });\n }\n\n // Override the action if the pluginOption config does not contain i18n\n // In this case we need to set the proper initialData shape\n if (!action.data.pluginOptions?.i18n?.localized) {\n return next({ ...action, data });\n }\n }\n\n // action is not the one we want to override\n return next(action);\n };\n};\n\nexport { extendCTBInitialDataMiddleware };\n"],"names":["extendCTBInitialDataMiddleware","next","action","type","modalType","i18n","localized","pluginOptions","data","actionType"],"mappings":"AAGA,MAAMA,8BAGF,GAAA,IAAA;IACF,OAAO,IAAM,CAACC,IAAAA,GAAS,CAACC,MAAAA,GAAAA;AACtB,gBAAA,IACEA,OAAOC,IAAI,KAAK,mDAChBD,MAAOE,CAAAA,SAAS,KAAK,aACrB,EAAA;AACA,oBAAA,MAAMC,IAAO,GAAA;wBAAEC,SAAW,EAAA;AAAM,qBAAA;AAEhC,oBAAA,MAAMC,aAAgBL,GAAAA,MAAAA,CAAOM,IAAI,CAACD,aAAa,GAC3C;wBAAE,GAAGL,MAAAA,CAAOM,IAAI,CAACD,aAAa;AAAEF,wBAAAA;qBAChC,GAAA;AAAEA,wBAAAA;AAAK,qBAAA;AAEX,oBAAA,MAAMG,IAAO,GAAA;AAAE,wBAAA,GAAGN,OAAOM,IAAI;AAAED,wBAAAA;AAAc,qBAAA;oBAE7C,IAAIL,MAAAA,CAAOO,UAAU,KAAK,QAAU,EAAA;AAClC,wBAAA,OAAOR,IAAK,CAAA;AAAE,4BAAA,GAAGC,MAAM;AAAEM,4BAAAA;AAAK,yBAAA,CAAA;AAChC;;;AAIA,oBAAA,IAAI,CAACN,MAAOM,CAAAA,IAAI,CAACD,aAAa,EAAEF,MAAMC,SAAW,EAAA;AAC/C,wBAAA,OAAOL,IAAK,CAAA;AAAE,4BAAA,GAAGC,MAAM;AAAEM,4BAAAA;AAAK,yBAAA,CAAA;AAChC;AACF;;AAGA,gBAAA,OAAOP,IAAKC,CAAAA,MAAAA,CAAAA;AACd,aAAA;AACF;;;;"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var qs = require('qs');
|
|
4
|
+
var reactRouterDom = require('react-router-dom');
|
|
5
|
+
|
|
6
|
+
function _interopNamespaceDefault(e) {
|
|
7
|
+
var n = Object.create(null);
|
|
8
|
+
if (e) {
|
|
9
|
+
Object.keys(e).forEach(function (k) {
|
|
10
|
+
if (k !== 'default') {
|
|
11
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
12
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () { return e[k]; }
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
n.default = e;
|
|
20
|
+
return Object.freeze(n);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
var qs__namespace = /*#__PURE__*/_interopNamespaceDefault(qs);
|
|
24
|
+
|
|
25
|
+
const localeMiddleware = (ctx)=>(next)=>(permissions)=>{
|
|
26
|
+
const match = reactRouterDom.matchPath('/content-manager/:collectionType/:model?/:id', ctx.pathname);
|
|
27
|
+
if (!match) {
|
|
28
|
+
return next(permissions);
|
|
29
|
+
}
|
|
30
|
+
const search = qs__namespace.parse(ctx.search);
|
|
31
|
+
if (typeof search !== 'object') {
|
|
32
|
+
return next(permissions);
|
|
33
|
+
}
|
|
34
|
+
if (!('plugins' in search && typeof search.plugins === 'object')) {
|
|
35
|
+
return next(permissions);
|
|
36
|
+
}
|
|
37
|
+
if (!('i18n' in search.plugins && typeof search.plugins.i18n === 'object' && !Array.isArray(search.plugins.i18n))) {
|
|
38
|
+
return next(permissions);
|
|
39
|
+
}
|
|
40
|
+
const { locale } = search.plugins.i18n;
|
|
41
|
+
if (typeof locale !== 'string') {
|
|
42
|
+
return next(permissions);
|
|
43
|
+
}
|
|
44
|
+
const revisedPermissions = permissions.filter((permission)=>!permission.properties?.locales || permission.properties.locales.includes(locale));
|
|
45
|
+
return next(revisedPermissions);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
exports.localeMiddleware = localeMiddleware;
|
|
49
|
+
//# sourceMappingURL=rbac-middleware.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rbac-middleware.js","sources":["../../../admin/src/middlewares/rbac-middleware.ts"],"sourcesContent":["/* eslint-disable check-file/filename-naming-convention */\nimport * as qs from 'qs';\nimport { matchPath } from 'react-router-dom';\n\nimport type { RBACMiddleware } from '@strapi/admin/strapi-admin';\n\nconst localeMiddleware: RBACMiddleware = (ctx) => (next) => (permissions) => {\n const match = matchPath('/content-manager/:collectionType/:model?/:id', ctx.pathname);\n\n if (!match) {\n return next(permissions);\n }\n\n const search = qs.parse(ctx.search);\n\n if (typeof search !== 'object') {\n return next(permissions);\n }\n\n if (!('plugins' in search && typeof search.plugins === 'object')) {\n return next(permissions);\n }\n\n if (\n !(\n 'i18n' in search.plugins &&\n typeof search.plugins.i18n === 'object' &&\n !Array.isArray(search.plugins.i18n)\n )\n ) {\n return next(permissions);\n }\n\n const { locale } = search.plugins.i18n;\n\n if (typeof locale !== 'string') {\n return next(permissions);\n }\n\n const revisedPermissions = permissions.filter(\n (permission) =>\n !permission.properties?.locales || permission.properties.locales.includes(locale)\n );\n\n return next(revisedPermissions);\n};\n\nexport { localeMiddleware };\n"],"names":["localeMiddleware","ctx","next","permissions","match","matchPath","pathname","search","qs","parse","plugins","i18n","Array","isArray","locale","revisedPermissions","filter","permission","properties","locales","includes"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAMA,gBAAmC,GAAA,CAACC,GAAQ,GAAA,CAACC,OAAS,CAACC,WAAAA,GAAAA;AAC3D,YAAA,MAAMC,KAAQC,GAAAA,wBAAAA,CAAU,8CAAgDJ,EAAAA,GAAAA,CAAIK,QAAQ,CAAA;AAEpF,YAAA,IAAI,CAACF,KAAO,EAAA;AACV,gBAAA,OAAOF,IAAKC,CAAAA,WAAAA,CAAAA;AACd;AAEA,YAAA,MAAMI,MAASC,GAAAA,aAAAA,CAAGC,KAAK,CAACR,IAAIM,MAAM,CAAA;YAElC,IAAI,OAAOA,WAAW,QAAU,EAAA;AAC9B,gBAAA,OAAOL,IAAKC,CAAAA,WAAAA,CAAAA;AACd;YAEA,IAAI,EAAE,SAAaI,IAAAA,MAAAA,IAAU,OAAOA,MAAOG,CAAAA,OAAO,KAAK,QAAO,CAAI,EAAA;AAChE,gBAAA,OAAOR,IAAKC,CAAAA,WAAAA,CAAAA;AACd;YAEA,IACE,EACE,MAAUI,IAAAA,MAAAA,CAAOG,OAAO,IACxB,OAAOH,MAAOG,CAAAA,OAAO,CAACC,IAAI,KAAK,QAC/B,IAAA,CAACC,MAAMC,OAAO,CAACN,OAAOG,OAAO,CAACC,IAAI,CAAA,CAEpC,EAAA;AACA,gBAAA,OAAOT,IAAKC,CAAAA,WAAAA,CAAAA;AACd;AAEA,YAAA,MAAM,EAAEW,MAAM,EAAE,GAAGP,MAAOG,CAAAA,OAAO,CAACC,IAAI;YAEtC,IAAI,OAAOG,WAAW,QAAU,EAAA;AAC9B,gBAAA,OAAOZ,IAAKC,CAAAA,WAAAA,CAAAA;AACd;AAEA,YAAA,MAAMY,qBAAqBZ,WAAYa,CAAAA,MAAM,CAC3C,CAACC,aACC,CAACA,UAAAA,CAAWC,UAAU,EAAEC,WAAWF,UAAWC,CAAAA,UAAU,CAACC,OAAO,CAACC,QAAQ,CAACN,MAAAA,CAAAA,CAAAA;AAG9E,YAAA,OAAOZ,IAAKa,CAAAA,kBAAAA,CAAAA;AACd;;;;"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import * as qs from 'qs';
|
|
2
|
+
import { matchPath } from 'react-router-dom';
|
|
3
|
+
|
|
4
|
+
const localeMiddleware = (ctx)=>(next)=>(permissions)=>{
|
|
5
|
+
const match = matchPath('/content-manager/:collectionType/:model?/:id', ctx.pathname);
|
|
6
|
+
if (!match) {
|
|
7
|
+
return next(permissions);
|
|
8
|
+
}
|
|
9
|
+
const search = qs.parse(ctx.search);
|
|
10
|
+
if (typeof search !== 'object') {
|
|
11
|
+
return next(permissions);
|
|
12
|
+
}
|
|
13
|
+
if (!('plugins' in search && typeof search.plugins === 'object')) {
|
|
14
|
+
return next(permissions);
|
|
15
|
+
}
|
|
16
|
+
if (!('i18n' in search.plugins && typeof search.plugins.i18n === 'object' && !Array.isArray(search.plugins.i18n))) {
|
|
17
|
+
return next(permissions);
|
|
18
|
+
}
|
|
19
|
+
const { locale } = search.plugins.i18n;
|
|
20
|
+
if (typeof locale !== 'string') {
|
|
21
|
+
return next(permissions);
|
|
22
|
+
}
|
|
23
|
+
const revisedPermissions = permissions.filter((permission)=>!permission.properties?.locales || permission.properties.locales.includes(locale));
|
|
24
|
+
return next(revisedPermissions);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export { localeMiddleware };
|
|
28
|
+
//# sourceMappingURL=rbac-middleware.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rbac-middleware.mjs","sources":["../../../admin/src/middlewares/rbac-middleware.ts"],"sourcesContent":["/* eslint-disable check-file/filename-naming-convention */\nimport * as qs from 'qs';\nimport { matchPath } from 'react-router-dom';\n\nimport type { RBACMiddleware } from '@strapi/admin/strapi-admin';\n\nconst localeMiddleware: RBACMiddleware = (ctx) => (next) => (permissions) => {\n const match = matchPath('/content-manager/:collectionType/:model?/:id', ctx.pathname);\n\n if (!match) {\n return next(permissions);\n }\n\n const search = qs.parse(ctx.search);\n\n if (typeof search !== 'object') {\n return next(permissions);\n }\n\n if (!('plugins' in search && typeof search.plugins === 'object')) {\n return next(permissions);\n }\n\n if (\n !(\n 'i18n' in search.plugins &&\n typeof search.plugins.i18n === 'object' &&\n !Array.isArray(search.plugins.i18n)\n )\n ) {\n return next(permissions);\n }\n\n const { locale } = search.plugins.i18n;\n\n if (typeof locale !== 'string') {\n return next(permissions);\n }\n\n const revisedPermissions = permissions.filter(\n (permission) =>\n !permission.properties?.locales || permission.properties.locales.includes(locale)\n );\n\n return next(revisedPermissions);\n};\n\nexport { localeMiddleware };\n"],"names":["localeMiddleware","ctx","next","permissions","match","matchPath","pathname","search","qs","parse","plugins","i18n","Array","isArray","locale","revisedPermissions","filter","permission","properties","locales","includes"],"mappings":";;;AAMA,MAAMA,gBAAmC,GAAA,CAACC,GAAQ,GAAA,CAACC,OAAS,CAACC,WAAAA,GAAAA;AAC3D,YAAA,MAAMC,KAAQC,GAAAA,SAAAA,CAAU,8CAAgDJ,EAAAA,GAAAA,CAAIK,QAAQ,CAAA;AAEpF,YAAA,IAAI,CAACF,KAAO,EAAA;AACV,gBAAA,OAAOF,IAAKC,CAAAA,WAAAA,CAAAA;AACd;AAEA,YAAA,MAAMI,MAASC,GAAAA,EAAAA,CAAGC,KAAK,CAACR,IAAIM,MAAM,CAAA;YAElC,IAAI,OAAOA,WAAW,QAAU,EAAA;AAC9B,gBAAA,OAAOL,IAAKC,CAAAA,WAAAA,CAAAA;AACd;YAEA,IAAI,EAAE,SAAaI,IAAAA,MAAAA,IAAU,OAAOA,MAAOG,CAAAA,OAAO,KAAK,QAAO,CAAI,EAAA;AAChE,gBAAA,OAAOR,IAAKC,CAAAA,WAAAA,CAAAA;AACd;YAEA,IACE,EACE,MAAUI,IAAAA,MAAAA,CAAOG,OAAO,IACxB,OAAOH,MAAOG,CAAAA,OAAO,CAACC,IAAI,KAAK,QAC/B,IAAA,CAACC,MAAMC,OAAO,CAACN,OAAOG,OAAO,CAACC,IAAI,CAAA,CAEpC,EAAA;AACA,gBAAA,OAAOT,IAAKC,CAAAA,WAAAA,CAAAA;AACd;AAEA,YAAA,MAAM,EAAEW,MAAM,EAAE,GAAGP,MAAOG,CAAAA,OAAO,CAACC,IAAI;YAEtC,IAAI,OAAOG,WAAW,QAAU,EAAA;AAC9B,gBAAA,OAAOZ,IAAKC,CAAAA,WAAAA,CAAAA;AACd;AAEA,YAAA,MAAMY,qBAAqBZ,WAAYa,CAAAA,MAAM,CAC3C,CAACC,aACC,CAACA,UAAAA,CAAWC,UAAU,EAAEC,WAAWF,UAAWC,CAAAA,UAAU,CAACC,OAAO,CAACC,QAAQ,CAACN,MAAAA,CAAAA,CAAAA;AAG9E,YAAA,OAAOZ,IAAKa,CAAAA,kBAAAA,CAAAA;AACd;;;;"}
|
|
@@ -0,0 +1,182 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
require('react');
|
|
5
|
+
var strapiAdmin = require('@strapi/admin/strapi-admin');
|
|
6
|
+
var ee = require('@strapi/admin/strapi-admin/ee');
|
|
7
|
+
var designSystem = require('@strapi/design-system');
|
|
8
|
+
var icons = require('@strapi/icons');
|
|
9
|
+
var symbols = require('@strapi/icons/symbols');
|
|
10
|
+
var reactIntl = require('react-intl');
|
|
11
|
+
var CreateLocale = require('../components/CreateLocale.js');
|
|
12
|
+
var LocaleTable = require('../components/LocaleTable.js');
|
|
13
|
+
var constants = require('../constants.js');
|
|
14
|
+
var locales = require('../services/locales.js');
|
|
15
|
+
var settings = require('../services/settings.js');
|
|
16
|
+
var getTranslation = require('../utils/getTranslation.js');
|
|
17
|
+
|
|
18
|
+
const SettingsErrrorTooltip = ({ children, error })=>{
|
|
19
|
+
const { _unstableFormatAPIError: formatAPIError } = strapiAdmin.useAPIErrorHandler();
|
|
20
|
+
if (error) {
|
|
21
|
+
return /*#__PURE__*/ jsxRuntime.jsx(designSystem.Tooltip, {
|
|
22
|
+
label: formatAPIError(error),
|
|
23
|
+
style: {
|
|
24
|
+
maxWidth: '200px'
|
|
25
|
+
},
|
|
26
|
+
children: children
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
return children;
|
|
30
|
+
};
|
|
31
|
+
const SettingsPage = ()=>{
|
|
32
|
+
const { formatMessage } = reactIntl.useIntl();
|
|
33
|
+
const { toggleNotification } = strapiAdmin.useNotification();
|
|
34
|
+
const { data: locales$1, isLoading: isLoadingLocales, error } = locales.useGetLocalesQuery();
|
|
35
|
+
const { isLoading: isLoadingRBAC, allowedActions: { canUpdate, canCreate, canDelete } } = strapiAdmin.useRBAC(constants.PERMISSIONS);
|
|
36
|
+
const isAIAvailable = ee.useAIAvailability();
|
|
37
|
+
// Settings state management
|
|
38
|
+
const { data: settings$1, isLoading: isLoadingSettings, error: settingsError } = settings.useGetSettingsQuery();
|
|
39
|
+
const [updateSettings] = settings.useUpdatei18nSettingsMutation();
|
|
40
|
+
const handleToggleChange = async (checked)=>{
|
|
41
|
+
try {
|
|
42
|
+
await updateSettings({
|
|
43
|
+
aiLocalizations: checked
|
|
44
|
+
}).unwrap();
|
|
45
|
+
toggleNotification({
|
|
46
|
+
type: 'success',
|
|
47
|
+
message: formatMessage({
|
|
48
|
+
id: 'notification.form.success.fields'
|
|
49
|
+
})
|
|
50
|
+
});
|
|
51
|
+
} catch (err) {
|
|
52
|
+
console.error(err);
|
|
53
|
+
toggleNotification({
|
|
54
|
+
type: 'danger',
|
|
55
|
+
message: formatMessage({
|
|
56
|
+
id: 'notification.error',
|
|
57
|
+
defaultMessage: 'An error occurred'
|
|
58
|
+
})
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
const isLoading = isLoadingLocales || isLoadingRBAC || isLoadingSettings;
|
|
63
|
+
if (isLoading) {
|
|
64
|
+
return /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.Loading, {});
|
|
65
|
+
}
|
|
66
|
+
if (error || !Array.isArray(locales$1)) {
|
|
67
|
+
return /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.Error, {});
|
|
68
|
+
}
|
|
69
|
+
return /*#__PURE__*/ jsxRuntime.jsxs(strapiAdmin.Page.Main, {
|
|
70
|
+
tabIndex: -1,
|
|
71
|
+
children: [
|
|
72
|
+
/*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Layouts.Header, {
|
|
73
|
+
primaryAction: /*#__PURE__*/ jsxRuntime.jsx(CreateLocale.CreateLocale, {
|
|
74
|
+
disabled: !canCreate
|
|
75
|
+
}),
|
|
76
|
+
title: formatMessage({
|
|
77
|
+
id: getTranslation.getTranslation('plugin.name'),
|
|
78
|
+
defaultMessage: 'Internationalization'
|
|
79
|
+
}),
|
|
80
|
+
subtitle: formatMessage({
|
|
81
|
+
id: getTranslation.getTranslation('Settings.list.description'),
|
|
82
|
+
defaultMessage: 'Configure the settings'
|
|
83
|
+
})
|
|
84
|
+
}),
|
|
85
|
+
/*#__PURE__*/ jsxRuntime.jsxs(strapiAdmin.Layouts.Content, {
|
|
86
|
+
children: [
|
|
87
|
+
isAIAvailable && window.strapi.future.isEnabled('unstableAILocalizations') && /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
|
|
88
|
+
background: "neutral0",
|
|
89
|
+
padding: 6,
|
|
90
|
+
marginBottom: 6,
|
|
91
|
+
shadow: "filterShadow",
|
|
92
|
+
hasRadius: true,
|
|
93
|
+
children: [
|
|
94
|
+
/*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
|
|
95
|
+
direction: "column",
|
|
96
|
+
alignItems: "stretch",
|
|
97
|
+
gap: 1,
|
|
98
|
+
flex: 1,
|
|
99
|
+
children: [
|
|
100
|
+
/*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
|
|
101
|
+
gap: 1,
|
|
102
|
+
children: [
|
|
103
|
+
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
|
|
104
|
+
color: "alternative700",
|
|
105
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(icons.Sparkle, {})
|
|
106
|
+
}),
|
|
107
|
+
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
|
|
108
|
+
variant: "delta",
|
|
109
|
+
tag: "h2",
|
|
110
|
+
children: formatMessage({
|
|
111
|
+
id: getTranslation.getTranslation('Settings.aiLocalizations.label'),
|
|
112
|
+
defaultMessage: 'AI Translations'
|
|
113
|
+
})
|
|
114
|
+
})
|
|
115
|
+
]
|
|
116
|
+
}),
|
|
117
|
+
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
|
|
118
|
+
variant: "pi",
|
|
119
|
+
textColor: "neutral600",
|
|
120
|
+
fontSize: "14px",
|
|
121
|
+
children: formatMessage({
|
|
122
|
+
id: getTranslation.getTranslation('Settings.aiLocalizations.description'),
|
|
123
|
+
defaultMessage: 'Everytime you save in the Content Manager, our AI will use your default locale to translate all other locales automatically.'
|
|
124
|
+
})
|
|
125
|
+
})
|
|
126
|
+
]
|
|
127
|
+
}),
|
|
128
|
+
/*#__PURE__*/ jsxRuntime.jsx(designSystem.Field.Root, {
|
|
129
|
+
name: "aiLocalizations",
|
|
130
|
+
minWidth: "200px",
|
|
131
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(SettingsErrrorTooltip, {
|
|
132
|
+
error: settingsError,
|
|
133
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Toggle, {
|
|
134
|
+
disabled: Boolean(settingsError),
|
|
135
|
+
checked: settings$1?.data?.aiLocalizations ?? false,
|
|
136
|
+
offLabel: formatMessage({
|
|
137
|
+
id: 'app.components.ToggleCheckbox.disabled-label',
|
|
138
|
+
defaultMessage: 'Disabled'
|
|
139
|
+
}),
|
|
140
|
+
onLabel: formatMessage({
|
|
141
|
+
id: 'app.components.ToggleCheckbox.enabled-label',
|
|
142
|
+
defaultMessage: 'Enabled'
|
|
143
|
+
}),
|
|
144
|
+
onChange: (e)=>handleToggleChange(e.target.checked)
|
|
145
|
+
})
|
|
146
|
+
})
|
|
147
|
+
})
|
|
148
|
+
]
|
|
149
|
+
}),
|
|
150
|
+
locales$1.length > 0 ? /*#__PURE__*/ jsxRuntime.jsx(LocaleTable.LocaleTable, {
|
|
151
|
+
locales: locales$1,
|
|
152
|
+
canDelete: canDelete,
|
|
153
|
+
canUpdate: canUpdate
|
|
154
|
+
}) : /*#__PURE__*/ jsxRuntime.jsx(designSystem.EmptyStateLayout, {
|
|
155
|
+
icon: /*#__PURE__*/ jsxRuntime.jsx(symbols.EmptyDocuments, {
|
|
156
|
+
width: undefined,
|
|
157
|
+
height: undefined
|
|
158
|
+
}),
|
|
159
|
+
content: formatMessage({
|
|
160
|
+
id: getTranslation.getTranslation('Settings.list.empty.title'),
|
|
161
|
+
defaultMessage: 'There are no locales'
|
|
162
|
+
}),
|
|
163
|
+
action: /*#__PURE__*/ jsxRuntime.jsx(CreateLocale.CreateLocale, {
|
|
164
|
+
disabled: !canCreate,
|
|
165
|
+
variant: "secondary"
|
|
166
|
+
})
|
|
167
|
+
})
|
|
168
|
+
]
|
|
169
|
+
})
|
|
170
|
+
]
|
|
171
|
+
});
|
|
172
|
+
};
|
|
173
|
+
const ProtectedSettingsPage = ()=>{
|
|
174
|
+
return /*#__PURE__*/ jsxRuntime.jsx(strapiAdmin.Page.Protect, {
|
|
175
|
+
permissions: constants.PERMISSIONS.read,
|
|
176
|
+
children: /*#__PURE__*/ jsxRuntime.jsx(SettingsPage, {})
|
|
177
|
+
});
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
exports.ProtectedSettingsPage = ProtectedSettingsPage;
|
|
181
|
+
exports.SettingsPage = SettingsPage;
|
|
182
|
+
//# sourceMappingURL=SettingsPage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsPage.js","sources":["../../../admin/src/pages/SettingsPage.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { SerializedError } from '@reduxjs/toolkit';\nimport {\n Page,\n useAPIErrorHandler,\n useNotification,\n useRBAC,\n Layouts,\n BaseQueryError,\n} from '@strapi/admin/strapi-admin';\nimport { useAIAvailability } from '@strapi/admin/strapi-admin/ee';\nimport {\n Box,\n EmptyStateLayout,\n Field,\n Flex,\n Tooltip,\n Toggle,\n Typography,\n} from '@strapi/design-system';\nimport { Sparkle } from '@strapi/icons';\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 { useGetSettingsQuery, useUpdatei18nSettingsMutation } from '../services/settings';\nimport { getTranslation } from '../utils/getTranslation';\n\nconst SettingsErrrorTooltip = ({\n children,\n error,\n}: {\n children: React.ReactNode;\n error: BaseQueryError | SerializedError | undefined;\n}) => {\n const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();\n\n if (error) {\n return (\n <Tooltip label={formatAPIError(error)} style={{ maxWidth: '200px' }}>\n {children}\n </Tooltip>\n );\n }\n\n return children;\n};\n\nconst SettingsPage = () => {\n const { formatMessage } = useIntl();\n const { toggleNotification } = useNotification();\n const { data: locales, isLoading: isLoadingLocales, error } = useGetLocalesQuery();\n const {\n isLoading: isLoadingRBAC,\n allowedActions: { canUpdate, canCreate, canDelete },\n } = useRBAC(PERMISSIONS);\n const isAIAvailable = useAIAvailability();\n\n // Settings state management\n const {\n data: settings,\n isLoading: isLoadingSettings,\n error: settingsError,\n } = useGetSettingsQuery();\n const [updateSettings] = useUpdatei18nSettingsMutation();\n\n const handleToggleChange = async (checked: boolean) => {\n try {\n await updateSettings({ aiLocalizations: checked }).unwrap();\n\n toggleNotification({\n type: 'success',\n message: formatMessage({ id: 'notification.form.success.fields' }),\n });\n } catch (err) {\n console.error(err);\n toggleNotification({\n type: 'danger',\n message: formatMessage({\n id: 'notification.error',\n defaultMessage: 'An error occurred',\n }),\n });\n }\n };\n\n const isLoading = isLoadingLocales || isLoadingRBAC || isLoadingSettings;\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 {isAIAvailable && window.strapi.future.isEnabled('unstableAILocalizations') && (\n <Flex background=\"neutral0\" padding={6} marginBottom={6} shadow=\"filterShadow\" hasRadius>\n <Flex direction=\"column\" alignItems=\"stretch\" gap={1} flex={1}>\n <Flex gap={1}>\n <Box color=\"alternative700\">\n <Sparkle />\n </Box>\n <Typography variant=\"delta\" tag=\"h2\">\n {formatMessage({\n id: getTranslation('Settings.aiLocalizations.label'),\n defaultMessage: 'AI Translations',\n })}\n </Typography>\n </Flex>\n <Typography variant=\"pi\" textColor=\"neutral600\" fontSize=\"14px\">\n {formatMessage({\n id: getTranslation('Settings.aiLocalizations.description'),\n defaultMessage:\n 'Everytime you save in the Content Manager, our AI will use your default locale to translate all other locales automatically.',\n })}\n </Typography>\n </Flex>\n <Field.Root name=\"aiLocalizations\" minWidth=\"200px\">\n <SettingsErrrorTooltip error={settingsError}>\n <Toggle\n disabled={Boolean(settingsError)}\n checked={settings?.data?.aiLocalizations ?? false}\n offLabel={formatMessage({\n id: 'app.components.ToggleCheckbox.disabled-label',\n defaultMessage: 'Disabled',\n })}\n onLabel={formatMessage({\n id: 'app.components.ToggleCheckbox.enabled-label',\n defaultMessage: 'Enabled',\n })}\n onChange={(e) => handleToggleChange(e.target.checked)}\n />\n </SettingsErrrorTooltip>\n </Field.Root>\n </Flex>\n )}\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":["SettingsErrrorTooltip","children","error","_unstableFormatAPIError","formatAPIError","useAPIErrorHandler","_jsx","Tooltip","label","style","maxWidth","SettingsPage","formatMessage","useIntl","toggleNotification","useNotification","data","locales","isLoading","isLoadingLocales","useGetLocalesQuery","isLoadingRBAC","allowedActions","canUpdate","canCreate","canDelete","useRBAC","PERMISSIONS","isAIAvailable","useAIAvailability","settings","isLoadingSettings","settingsError","useGetSettingsQuery","updateSettings","useUpdatei18nSettingsMutation","handleToggleChange","checked","aiLocalizations","unwrap","type","message","id","err","console","defaultMessage","Page","Loading","Array","isArray","Error","_jsxs","Main","tabIndex","Layouts","Header","primaryAction","CreateLocale","disabled","title","getTranslation","subtitle","Content","window","strapi","future","isEnabled","Flex","background","padding","marginBottom","shadow","hasRadius","direction","alignItems","gap","flex","Box","color","Sparkle","Typography","variant","tag","textColor","fontSize","Field","Root","name","minWidth","Toggle","Boolean","offLabel","onLabel","onChange","e","target","length","LocaleTable","EmptyStateLayout","icon","EmptyDocuments","width","undefined","height","content","action","ProtectedSettingsPage","Protect","permissions","read"],"mappings":";;;;;;;;;;;;;;;;;AAgCA,MAAMA,wBAAwB,CAAC,EAC7BC,QAAQ,EACRC,KAAK,EAIN,GAAA;AACC,IAAA,MAAM,EAAEC,uBAAAA,EAAyBC,cAAc,EAAE,GAAGC,8BAAAA,EAAAA;AAEpD,IAAA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