@strapi/i18n 0.0.0-next.973df62640087231761ffaeb1c2b5d0d706346d8 → 0.0.0-next.9c630ba4333dffc2c1c8150d9226dfbb67b02e09
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 +957 -0
- package/dist/admin/components/CMHeaderActions.js.map +1 -0
- package/dist/admin/components/CMHeaderActions.mjs +931 -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/useAILocalizationJobsPolling.js +110 -0
- package/dist/admin/hooks/useAILocalizationJobsPolling.js.map +1 -0
- package/dist/admin/hooks/useAILocalizationJobsPolling.mjs +89 -0
- package/dist/admin/hooks/useAILocalizationJobsPolling.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/aiLocalizationJobs.js +26 -0
- package/dist/admin/services/aiLocalizationJobs.js.map +1 -0
- package/dist/admin/services/aiLocalizationJobs.mjs +24 -0
- package/dist/admin/services/aiLocalizationJobs.mjs.map +1 -0
- package/dist/admin/services/api.js +15 -0
- package/dist/admin/services/api.js.map +1 -0
- package/dist/admin/services/api.mjs +13 -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 +18 -5
- 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/hooks/useAILocalizationJobsPolling.d.ts +9 -0
- package/dist/admin/src/pages/tests/SettingsPage.test.d.ts +1 -0
- package/dist/admin/src/services/aiLocalizationJobs.d.ts +6 -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 +91 -0
- package/dist/admin/translations/en.json.js.map +1 -0
- package/dist/admin/translations/en.json.mjs +89 -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 +81 -0
- package/dist/server/bootstrap.js.map +1 -0
- package/dist/server/bootstrap.mjs +79 -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/ai-localization-jobs.js +47 -0
- package/dist/server/controllers/ai-localization-jobs.js.map +1 -0
- package/dist/server/controllers/ai-localization-jobs.mjs +45 -0
- package/dist/server/controllers/ai-localization-jobs.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 +18 -0
- package/dist/server/controllers/index.js.map +1 -0
- package/dist/server/controllers/index.mjs +16 -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 -3453
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +17 -3435
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/models/ai-localization-job.js +60 -0
- package/dist/server/models/ai-localization-job.js.map +1 -0
- package/dist/server/models/ai-localization-job.mjs +57 -0
- package/dist/server/models/ai-localization-job.mjs.map +1 -0
- package/dist/server/register.js +81 -0
- package/dist/server/register.js.map +1 -0
- package/dist/server/register.mjs +79 -0
- package/dist/server/register.mjs.map +1 -0
- package/dist/server/routes/admin.js +142 -0
- package/dist/server/routes/admin.js.map +1 -0
- package/dist/server/routes/admin.mjs +140 -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-localization-jobs.js +64 -0
- package/dist/server/services/ai-localization-jobs.js.map +1 -0
- package/dist/server/services/ai-localization-jobs.mjs +62 -0
- package/dist/server/services/ai-localization-jobs.mjs.map +1 -0
- package/dist/server/services/ai-localizations.js +272 -0
- package/dist/server/services/ai-localizations.js.map +1 -0
- package/dist/server/services/ai-localizations.mjs +270 -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 +28 -0
- package/dist/server/services/index.js.map +1 -0
- package/dist/server/services/index.mjs +26 -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/bootstrap.d.ts.map +1 -1
- package/dist/server/src/controllers/ai-localization-jobs.d.ts +17 -0
- package/dist/server/src/controllers/ai-localization-jobs.d.ts.map +1 -0
- package/dist/server/src/controllers/index.d.ts +10 -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 +47 -8
- package/dist/server/src/index.d.ts.map +1 -1
- package/dist/server/src/models/ai-localization-job.d.ts +5 -0
- package/dist/server/src/models/ai-localization-job.d.ts.map +1 -0
- package/dist/server/src/models/index.d.ts +5 -0
- package/dist/server/src/models/index.d.ts.map +1 -0
- package/dist/server/src/register.d.ts +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-localization-jobs.d.ts +26 -0
- package/dist/server/src/services/ai-localization-jobs.d.ts.map +1 -0
- package/dist/server/src/services/ai-localizations.d.ts +18 -0
- package/dist/server/src/services/ai-localizations.d.ts.map +1 -0
- package/dist/server/src/services/index.d.ts +33 -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/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/ai-localization-jobs.d.ts +27 -0
- package/dist/shared/contracts/ai-localization-jobs.d.ts.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/dist/shared/contracts/shared.d.ts.map +1 -0
- package/package.json +21 -16
- package/dist/_chunks/SettingsPage-D0hqaut-.js +0 -574
- package/dist/_chunks/SettingsPage-D0hqaut-.js.map +0 -1
- package/dist/_chunks/SettingsPage-D67CaQAB.mjs +0 -554
- package/dist/_chunks/SettingsPage-D67CaQAB.mjs.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-46DNtLCn.js +0 -1635
- package/dist/_chunks/index-46DNtLCn.js.map +0 -1
- package/dist/_chunks/index-CNR8i3KM.mjs +0 -1613
- package/dist/_chunks/index-CNR8i3KM.mjs.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,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,IAAIH,KAAO,EAAA;AACT,QAAA,qBACEI,cAACC,CAAAA,oBAAAA,EAAAA;AAAQC,YAAAA,KAAAA,EAAOJ,cAAeF,CAAAA,KAAAA,CAAAA;YAAQO,KAAO,EAAA;gBAAEC,QAAU,EAAA;AAAQ,aAAA;AAC/DT,YAAAA,QAAAA,EAAAA;;AAGP;IAEA,OAAOA,QAAAA;AACT,CAAA;AAEA,MAAMU,YAAe,GAAA,IAA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ClB,yCAAA,CAAA;AACAgD,wCAAAA,QAAAA,EAAU,CAACC,CAAM1D,GAAAA,kBAAAA,CAAmB0D,CAAEC,CAAAA,MAAM,CAAC1D,OAAO;;;;;;oBAM7DpB,SAAQ+E,CAAAA,MAAM,GAAG,CAAA,iBAChB1F,cAAC2F,CAAAA,uBAAAA,EAAAA;wBAAYhF,OAASA,EAAAA,SAAAA;wBAASQ,SAAWA,EAAAA,SAAAA;wBAAWF,SAAWA,EAAAA;uCAEhEjB,cAAC4F,CAAAA,6BAAAA,EAAAA;AACCC,wBAAAA,IAAAA,gBAAM7F,cAAC8F,CAAAA,sBAAAA,EAAAA;4BAAeC,KAAOC,EAAAA,SAAAA;4BAAWC,MAAQD,EAAAA;;AAChDE,wBAAAA,OAAAA,EAAS5F,aAAc,CAAA;AACrB8B,4BAAAA,EAAAA,EAAIkB,6BAAe,CAAA,2BAAA,CAAA;4BACnBf,cAAgB,EAAA;AAClB,yBAAA,CAAA;AACA4D,wBAAAA,MAAAA,gBAAQnG,cAACmD,CAAAA,yBAAAA,EAAAA;AAAaC,4BAAAA,QAAAA,EAAU,CAAClC,SAAAA;4BAAWyD,OAAQ,EAAA;;;;;;;AAMhE;AAEA,MAAMyB,qBAAwB,GAAA,IAAA;IAC5B,qBACEpG,cAAA,CAACwC,iBAAK6D,OAAO,EAAA;AAACC,QAAAA,WAAAA,EAAajF,sBAAYkF,IAAI;AACzC,QAAA,QAAA,gBAAAvG,cAACK,CAAAA,YAAAA,EAAAA,EAAAA;;AAGP;;;;;"}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import 'react';
|
|
3
|
+
import { useNotification, useRBAC, Page, Layouts, useAPIErrorHandler } from '@strapi/admin/strapi-admin';
|
|
4
|
+
import { useAIAvailability } from '@strapi/admin/strapi-admin/ee';
|
|
5
|
+
import { Flex, Box, Typography, Field, Toggle, EmptyStateLayout, Tooltip } from '@strapi/design-system';
|
|
6
|
+
import { Sparkle } from '@strapi/icons';
|
|
7
|
+
import { EmptyDocuments } from '@strapi/icons/symbols';
|
|
8
|
+
import { useIntl } from 'react-intl';
|
|
9
|
+
import { CreateLocale } from '../components/CreateLocale.mjs';
|
|
10
|
+
import { LocaleTable } from '../components/LocaleTable.mjs';
|
|
11
|
+
import { PERMISSIONS } from '../constants.mjs';
|
|
12
|
+
import { useGetLocalesQuery } from '../services/locales.mjs';
|
|
13
|
+
import { useGetSettingsQuery, useUpdatei18nSettingsMutation } from '../services/settings.mjs';
|
|
14
|
+
import { getTranslation } from '../utils/getTranslation.mjs';
|
|
15
|
+
|
|
16
|
+
const SettingsErrrorTooltip = ({ children, error })=>{
|
|
17
|
+
const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();
|
|
18
|
+
if (error) {
|
|
19
|
+
return /*#__PURE__*/ jsx(Tooltip, {
|
|
20
|
+
label: formatAPIError(error),
|
|
21
|
+
style: {
|
|
22
|
+
maxWidth: '200px'
|
|
23
|
+
},
|
|
24
|
+
children: children
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
return children;
|
|
28
|
+
};
|
|
29
|
+
const SettingsPage = ()=>{
|
|
30
|
+
const { formatMessage } = useIntl();
|
|
31
|
+
const { toggleNotification } = useNotification();
|
|
32
|
+
const { data: locales, isLoading: isLoadingLocales, error } = useGetLocalesQuery();
|
|
33
|
+
const { isLoading: isLoadingRBAC, allowedActions: { canUpdate, canCreate, canDelete } } = useRBAC(PERMISSIONS);
|
|
34
|
+
const isAIAvailable = useAIAvailability();
|
|
35
|
+
// Settings state management
|
|
36
|
+
const { data: settings, isLoading: isLoadingSettings, error: settingsError } = useGetSettingsQuery();
|
|
37
|
+
const [updateSettings] = useUpdatei18nSettingsMutation();
|
|
38
|
+
const handleToggleChange = async (checked)=>{
|
|
39
|
+
try {
|
|
40
|
+
await updateSettings({
|
|
41
|
+
aiLocalizations: checked
|
|
42
|
+
}).unwrap();
|
|
43
|
+
toggleNotification({
|
|
44
|
+
type: 'success',
|
|
45
|
+
message: formatMessage({
|
|
46
|
+
id: 'notification.form.success.fields'
|
|
47
|
+
})
|
|
48
|
+
});
|
|
49
|
+
} catch (err) {
|
|
50
|
+
console.error(err);
|
|
51
|
+
toggleNotification({
|
|
52
|
+
type: 'danger',
|
|
53
|
+
message: formatMessage({
|
|
54
|
+
id: 'notification.error',
|
|
55
|
+
defaultMessage: 'An error occurred'
|
|
56
|
+
})
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const isLoading = isLoadingLocales || isLoadingRBAC || isLoadingSettings;
|
|
61
|
+
if (isLoading) {
|
|
62
|
+
return /*#__PURE__*/ jsx(Page.Loading, {});
|
|
63
|
+
}
|
|
64
|
+
if (error || !Array.isArray(locales)) {
|
|
65
|
+
return /*#__PURE__*/ jsx(Page.Error, {});
|
|
66
|
+
}
|
|
67
|
+
return /*#__PURE__*/ jsxs(Page.Main, {
|
|
68
|
+
tabIndex: -1,
|
|
69
|
+
children: [
|
|
70
|
+
/*#__PURE__*/ jsx(Layouts.Header, {
|
|
71
|
+
primaryAction: /*#__PURE__*/ jsx(CreateLocale, {
|
|
72
|
+
disabled: !canCreate
|
|
73
|
+
}),
|
|
74
|
+
title: formatMessage({
|
|
75
|
+
id: getTranslation('plugin.name'),
|
|
76
|
+
defaultMessage: 'Internationalization'
|
|
77
|
+
}),
|
|
78
|
+
subtitle: formatMessage({
|
|
79
|
+
id: getTranslation('Settings.list.description'),
|
|
80
|
+
defaultMessage: 'Configure the settings'
|
|
81
|
+
})
|
|
82
|
+
}),
|
|
83
|
+
/*#__PURE__*/ jsxs(Layouts.Content, {
|
|
84
|
+
children: [
|
|
85
|
+
isAIAvailable && window.strapi.future.isEnabled('unstableAILocalizations') && /*#__PURE__*/ jsxs(Flex, {
|
|
86
|
+
background: "neutral0",
|
|
87
|
+
padding: 6,
|
|
88
|
+
marginBottom: 6,
|
|
89
|
+
shadow: "filterShadow",
|
|
90
|
+
hasRadius: true,
|
|
91
|
+
children: [
|
|
92
|
+
/*#__PURE__*/ jsxs(Flex, {
|
|
93
|
+
direction: "column",
|
|
94
|
+
alignItems: "stretch",
|
|
95
|
+
gap: 1,
|
|
96
|
+
flex: 1,
|
|
97
|
+
children: [
|
|
98
|
+
/*#__PURE__*/ jsxs(Flex, {
|
|
99
|
+
gap: 1,
|
|
100
|
+
children: [
|
|
101
|
+
/*#__PURE__*/ jsx(Box, {
|
|
102
|
+
color: "alternative700",
|
|
103
|
+
children: /*#__PURE__*/ jsx(Sparkle, {})
|
|
104
|
+
}),
|
|
105
|
+
/*#__PURE__*/ jsx(Typography, {
|
|
106
|
+
variant: "delta",
|
|
107
|
+
tag: "h2",
|
|
108
|
+
children: formatMessage({
|
|
109
|
+
id: getTranslation('Settings.aiLocalizations.label'),
|
|
110
|
+
defaultMessage: 'AI Translations'
|
|
111
|
+
})
|
|
112
|
+
})
|
|
113
|
+
]
|
|
114
|
+
}),
|
|
115
|
+
/*#__PURE__*/ jsx(Typography, {
|
|
116
|
+
variant: "pi",
|
|
117
|
+
textColor: "neutral600",
|
|
118
|
+
fontSize: "14px",
|
|
119
|
+
children: formatMessage({
|
|
120
|
+
id: getTranslation('Settings.aiLocalizations.description'),
|
|
121
|
+
defaultMessage: 'Everytime you save in the Content Manager, our AI will use your default locale to translate all other locales automatically.'
|
|
122
|
+
})
|
|
123
|
+
})
|
|
124
|
+
]
|
|
125
|
+
}),
|
|
126
|
+
/*#__PURE__*/ jsx(Field.Root, {
|
|
127
|
+
name: "aiLocalizations",
|
|
128
|
+
minWidth: "200px",
|
|
129
|
+
children: /*#__PURE__*/ jsx(SettingsErrrorTooltip, {
|
|
130
|
+
error: settingsError,
|
|
131
|
+
children: /*#__PURE__*/ jsx(Toggle, {
|
|
132
|
+
disabled: Boolean(settingsError),
|
|
133
|
+
checked: settings?.data?.aiLocalizations ?? false,
|
|
134
|
+
offLabel: formatMessage({
|
|
135
|
+
id: 'app.components.ToggleCheckbox.disabled-label',
|
|
136
|
+
defaultMessage: 'Disabled'
|
|
137
|
+
}),
|
|
138
|
+
onLabel: formatMessage({
|
|
139
|
+
id: 'app.components.ToggleCheckbox.enabled-label',
|
|
140
|
+
defaultMessage: 'Enabled'
|
|
141
|
+
}),
|
|
142
|
+
onChange: (e)=>handleToggleChange(e.target.checked)
|
|
143
|
+
})
|
|
144
|
+
})
|
|
145
|
+
})
|
|
146
|
+
]
|
|
147
|
+
}),
|
|
148
|
+
locales.length > 0 ? /*#__PURE__*/ jsx(LocaleTable, {
|
|
149
|
+
locales: locales,
|
|
150
|
+
canDelete: canDelete,
|
|
151
|
+
canUpdate: canUpdate
|
|
152
|
+
}) : /*#__PURE__*/ jsx(EmptyStateLayout, {
|
|
153
|
+
icon: /*#__PURE__*/ jsx(EmptyDocuments, {
|
|
154
|
+
width: undefined,
|
|
155
|
+
height: undefined
|
|
156
|
+
}),
|
|
157
|
+
content: formatMessage({
|
|
158
|
+
id: getTranslation('Settings.list.empty.title'),
|
|
159
|
+
defaultMessage: 'There are no locales'
|
|
160
|
+
}),
|
|
161
|
+
action: /*#__PURE__*/ jsx(CreateLocale, {
|
|
162
|
+
disabled: !canCreate,
|
|
163
|
+
variant: "secondary"
|
|
164
|
+
})
|
|
165
|
+
})
|
|
166
|
+
]
|
|
167
|
+
})
|
|
168
|
+
]
|
|
169
|
+
});
|
|
170
|
+
};
|
|
171
|
+
const ProtectedSettingsPage = ()=>{
|
|
172
|
+
return /*#__PURE__*/ jsx(Page.Protect, {
|
|
173
|
+
permissions: PERMISSIONS.read,
|
|
174
|
+
children: /*#__PURE__*/ jsx(SettingsPage, {})
|
|
175
|
+
});
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
export { ProtectedSettingsPage, SettingsPage };
|
|
179
|
+
//# sourceMappingURL=SettingsPage.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SettingsPage.mjs","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,kBAAAA,EAAAA;AAEpD,IAAA,IAAIH,KAAO,EAAA;AACT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src/pluginId.ts"],"sourcesContent":["export const pluginId = 'i18n';\n"],"names":["pluginId"],"mappings":";;AAAO,MAAMA,WAAW;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pluginId.mjs","sources":["../../admin/src/pluginId.ts"],"sourcesContent":["export const pluginId = 'i18n';\n"],"names":["pluginId"],"mappings":"AAAO,MAAMA,WAAW;;;;"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var api = require('./api.js');
|
|
4
|
+
|
|
5
|
+
// Import the same constant used by the documents service for consistency
|
|
6
|
+
const SINGLE_TYPES = 'single-types';
|
|
7
|
+
const aiLocalizationJobsApi = api.i18nApi.injectEndpoints({
|
|
8
|
+
endpoints: (builder)=>({
|
|
9
|
+
getAILocalizationJobsByDocument: builder.query({
|
|
10
|
+
query: ({ documentId, collectionType, model })=>({
|
|
11
|
+
url: collectionType === SINGLE_TYPES ? `/i18n/ai-localization-jobs/single-types/${model}` : `/i18n/ai-localization-jobs/collection-types/${model}/${documentId}`,
|
|
12
|
+
method: 'GET'
|
|
13
|
+
}),
|
|
14
|
+
providesTags: (result, error, { documentId, model, collectionType })=>[
|
|
15
|
+
{
|
|
16
|
+
type: 'AILocalizationJobs',
|
|
17
|
+
id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model
|
|
18
|
+
}
|
|
19
|
+
]
|
|
20
|
+
})
|
|
21
|
+
})
|
|
22
|
+
});
|
|
23
|
+
const { useGetAILocalizationJobsByDocumentQuery } = aiLocalizationJobsApi;
|
|
24
|
+
|
|
25
|
+
exports.useGetAILocalizationJobsByDocumentQuery = useGetAILocalizationJobsByDocumentQuery;
|
|
26
|
+
//# sourceMappingURL=aiLocalizationJobs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aiLocalizationJobs.js","sources":["../../../admin/src/services/aiLocalizationJobs.ts"],"sourcesContent":["import { i18nApi } from './api';\n\nimport type { GetAILocalizationJobsByDocument } from '../../../shared/contracts/ai-localization-jobs';\n\n// Import the same constant used by the documents service for consistency\nconst SINGLE_TYPES = 'single-types';\n\nconst aiLocalizationJobsApi = i18nApi.injectEndpoints({\n endpoints: (builder) => ({\n getAILocalizationJobsByDocument: builder.query<\n GetAILocalizationJobsByDocument.Response,\n {\n documentId: string;\n model: string;\n collectionType: string;\n }\n >({\n query: ({ documentId, collectionType, model }) => ({\n url:\n collectionType === SINGLE_TYPES\n ? `/i18n/ai-localization-jobs/single-types/${model}`\n : `/i18n/ai-localization-jobs/collection-types/${model}/${documentId}`,\n method: 'GET',\n }),\n providesTags: (result, error, { documentId, model, collectionType }) => [\n {\n type: 'AILocalizationJobs',\n id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model,\n },\n ],\n }),\n }),\n});\n\nexport const { useGetAILocalizationJobsByDocumentQuery } = aiLocalizationJobsApi;\n"],"names":["SINGLE_TYPES","aiLocalizationJobsApi","i18nApi","injectEndpoints","endpoints","builder","getAILocalizationJobsByDocument","query","documentId","collectionType","model","url","method","providesTags","result","error","type","id","useGetAILocalizationJobsByDocumentQuery"],"mappings":";;;;AAIA;AACA,MAAMA,YAAe,GAAA,cAAA;AAErB,MAAMC,qBAAAA,GAAwBC,WAAQC,CAAAA,eAAe,CAAC;IACpDC,SAAW,EAAA,CAACC,WAAa;YACvBC,+BAAiCD,EAAAA,OAAAA,CAAQE,KAAK,CAO5C;gBACAA,KAAO,EAAA,CAAC,EAAEC,UAAU,EAAEC,cAAc,EAAEC,KAAK,EAAE,IAAM;AACjDC,wBAAAA,GAAAA,EACEF,cAAmBT,KAAAA,YAAAA,GACf,CAAC,wCAAwC,EAAEU,KAAM,CAAA,CAAC,GAClD,CAAC,4CAA4C,EAAEA,KAAAA,CAAM,CAAC,EAAEF,WAAW,CAAC;wBAC1EI,MAAQ,EAAA;qBACV,CAAA;gBACAC,YAAc,EAAA,CAACC,MAAQC,EAAAA,KAAAA,EAAO,EAAEP,UAAU,EAAEE,KAAK,EAAED,cAAc,EAAE,GAAK;AACtE,wBAAA;4BACEO,IAAM,EAAA,oBAAA;4BACNC,EAAIR,EAAAA,cAAAA,KAAmBT,eAAe,CAAC,EAAEU,MAAM,CAAC,EAAEF,UAAW,CAAA,CAAC,GAAGE;AACnE;AACD;AACH,aAAA;SACF;AACF,CAAA,CAAA;AAEa,MAAA,EAAEQ,uCAAuC,EAAE,GAAGjB;;;;"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { i18nApi } from './api.mjs';
|
|
2
|
+
|
|
3
|
+
// Import the same constant used by the documents service for consistency
|
|
4
|
+
const SINGLE_TYPES = 'single-types';
|
|
5
|
+
const aiLocalizationJobsApi = i18nApi.injectEndpoints({
|
|
6
|
+
endpoints: (builder)=>({
|
|
7
|
+
getAILocalizationJobsByDocument: builder.query({
|
|
8
|
+
query: ({ documentId, collectionType, model })=>({
|
|
9
|
+
url: collectionType === SINGLE_TYPES ? `/i18n/ai-localization-jobs/single-types/${model}` : `/i18n/ai-localization-jobs/collection-types/${model}/${documentId}`,
|
|
10
|
+
method: 'GET'
|
|
11
|
+
}),
|
|
12
|
+
providesTags: (result, error, { documentId, model, collectionType })=>[
|
|
13
|
+
{
|
|
14
|
+
type: 'AILocalizationJobs',
|
|
15
|
+
id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
})
|
|
19
|
+
})
|
|
20
|
+
});
|
|
21
|
+
const { useGetAILocalizationJobsByDocumentQuery } = aiLocalizationJobsApi;
|
|
22
|
+
|
|
23
|
+
export { useGetAILocalizationJobsByDocumentQuery };
|
|
24
|
+
//# sourceMappingURL=aiLocalizationJobs.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"aiLocalizationJobs.mjs","sources":["../../../admin/src/services/aiLocalizationJobs.ts"],"sourcesContent":["import { i18nApi } from './api';\n\nimport type { GetAILocalizationJobsByDocument } from '../../../shared/contracts/ai-localization-jobs';\n\n// Import the same constant used by the documents service for consistency\nconst SINGLE_TYPES = 'single-types';\n\nconst aiLocalizationJobsApi = i18nApi.injectEndpoints({\n endpoints: (builder) => ({\n getAILocalizationJobsByDocument: builder.query<\n GetAILocalizationJobsByDocument.Response,\n {\n documentId: string;\n model: string;\n collectionType: string;\n }\n >({\n query: ({ documentId, collectionType, model }) => ({\n url:\n collectionType === SINGLE_TYPES\n ? `/i18n/ai-localization-jobs/single-types/${model}`\n : `/i18n/ai-localization-jobs/collection-types/${model}/${documentId}`,\n method: 'GET',\n }),\n providesTags: (result, error, { documentId, model, collectionType }) => [\n {\n type: 'AILocalizationJobs',\n id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model,\n },\n ],\n }),\n }),\n});\n\nexport const { useGetAILocalizationJobsByDocumentQuery } = aiLocalizationJobsApi;\n"],"names":["SINGLE_TYPES","aiLocalizationJobsApi","i18nApi","injectEndpoints","endpoints","builder","getAILocalizationJobsByDocument","query","documentId","collectionType","model","url","method","providesTags","result","error","type","id","useGetAILocalizationJobsByDocumentQuery"],"mappings":";;AAIA;AACA,MAAMA,YAAe,GAAA,cAAA;AAErB,MAAMC,qBAAAA,GAAwBC,OAAQC,CAAAA,eAAe,CAAC;IACpDC,SAAW,EAAA,CAACC,WAAa;YACvBC,+BAAiCD,EAAAA,OAAAA,CAAQE,KAAK,CAO5C;gBACAA,KAAO,EAAA,CAAC,EAAEC,UAAU,EAAEC,cAAc,EAAEC,KAAK,EAAE,IAAM;AACjDC,wBAAAA,GAAAA,EACEF,cAAmBT,KAAAA,YAAAA,GACf,CAAC,wCAAwC,EAAEU,KAAM,CAAA,CAAC,GAClD,CAAC,4CAA4C,EAAEA,KAAAA,CAAM,CAAC,EAAEF,WAAW,CAAC;wBAC1EI,MAAQ,EAAA;qBACV,CAAA;gBACAC,YAAc,EAAA,CAACC,MAAQC,EAAAA,KAAAA,EAAO,EAAEP,UAAU,EAAEE,KAAK,EAAED,cAAc,EAAE,GAAK;AACtE,wBAAA;4BACEO,IAAM,EAAA,oBAAA;4BACNC,EAAIR,EAAAA,cAAAA,KAAmBT,eAAe,CAAC,EAAEU,MAAM,CAAC,EAAEF,UAAW,CAAA,CAAC,GAAGE;AACnE;AACD;AACH,aAAA;SACF;AACF,CAAA,CAAA;AAEa,MAAA,EAAEQ,uCAAuC,EAAE,GAAGjB;;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var strapiAdmin = require('@strapi/admin/strapi-admin');
|
|
4
|
+
|
|
5
|
+
const i18nApi = strapiAdmin.adminApi.enhanceEndpoints({
|
|
6
|
+
addTagTypes: [
|
|
7
|
+
'Locale',
|
|
8
|
+
'KeyStatistics',
|
|
9
|
+
'Settings',
|
|
10
|
+
'AILocalizationJobs'
|
|
11
|
+
]
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
exports.i18nApi = i18nApi;
|
|
15
|
+
//# sourceMappingURL=api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.js","sources":["../../../admin/src/services/api.ts"],"sourcesContent":["import { adminApi } from '@strapi/admin/strapi-admin';\n\nconst i18nApi = adminApi.enhanceEndpoints({\n addTagTypes: ['Locale', 'KeyStatistics', 'Settings', 'AILocalizationJobs'],\n});\n\nexport { i18nApi };\n"],"names":["i18nApi","adminApi","enhanceEndpoints","addTagTypes"],"mappings":";;;;AAEMA,MAAAA,OAAAA,GAAUC,oBAASC,CAAAA,gBAAgB,CAAC;IACxCC,WAAa,EAAA;AAAC,QAAA,QAAA;AAAU,QAAA,eAAA;AAAiB,QAAA,UAAA;AAAY,QAAA;AAAqB;AAC5E,CAAA;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { adminApi } from '@strapi/admin/strapi-admin';
|
|
2
|
+
|
|
3
|
+
const i18nApi = adminApi.enhanceEndpoints({
|
|
4
|
+
addTagTypes: [
|
|
5
|
+
'Locale',
|
|
6
|
+
'KeyStatistics',
|
|
7
|
+
'Settings',
|
|
8
|
+
'AILocalizationJobs'
|
|
9
|
+
]
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export { i18nApi };
|
|
13
|
+
//# sourceMappingURL=api.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api.mjs","sources":["../../../admin/src/services/api.ts"],"sourcesContent":["import { adminApi } from '@strapi/admin/strapi-admin';\n\nconst i18nApi = adminApi.enhanceEndpoints({\n addTagTypes: ['Locale', 'KeyStatistics', 'Settings', 'AILocalizationJobs'],\n});\n\nexport { i18nApi };\n"],"names":["i18nApi","adminApi","enhanceEndpoints","addTagTypes"],"mappings":";;AAEMA,MAAAA,OAAAA,GAAUC,QAASC,CAAAA,gBAAgB,CAAC;IACxCC,WAAa,EAAA;AAAC,QAAA,QAAA;AAAU,QAAA,eAAA;AAAiB,QAAA,UAAA;AAAY,QAAA;AAAqB;AAC5E,CAAA;;;;"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var api = require('./api.js');
|
|
4
|
+
|
|
5
|
+
const localesApi = api.i18nApi.injectEndpoints({
|
|
6
|
+
endpoints: (builder)=>({
|
|
7
|
+
createLocale: builder.mutation({
|
|
8
|
+
query: (data)=>({
|
|
9
|
+
url: '/i18n/locales',
|
|
10
|
+
method: 'POST',
|
|
11
|
+
data
|
|
12
|
+
}),
|
|
13
|
+
invalidatesTags: [
|
|
14
|
+
{
|
|
15
|
+
type: 'Locale',
|
|
16
|
+
id: 'LIST'
|
|
17
|
+
},
|
|
18
|
+
'HomepageKeyStatistics'
|
|
19
|
+
]
|
|
20
|
+
}),
|
|
21
|
+
deleteLocale: builder.mutation({
|
|
22
|
+
query: (id)=>({
|
|
23
|
+
url: `/i18n/locales/${id}`,
|
|
24
|
+
method: 'DELETE'
|
|
25
|
+
}),
|
|
26
|
+
invalidatesTags: (result, error, id)=>[
|
|
27
|
+
{
|
|
28
|
+
type: 'Locale',
|
|
29
|
+
id
|
|
30
|
+
},
|
|
31
|
+
'HomepageKeyStatistics'
|
|
32
|
+
]
|
|
33
|
+
}),
|
|
34
|
+
getLocales: builder.query({
|
|
35
|
+
query: ()=>'/i18n/locales',
|
|
36
|
+
providesTags: (res)=>[
|
|
37
|
+
{
|
|
38
|
+
type: 'Locale',
|
|
39
|
+
id: 'LIST'
|
|
40
|
+
},
|
|
41
|
+
...Array.isArray(res) ? res.map((locale)=>({
|
|
42
|
+
type: 'Locale',
|
|
43
|
+
id: locale.id
|
|
44
|
+
})) : []
|
|
45
|
+
]
|
|
46
|
+
}),
|
|
47
|
+
getDefaultLocales: builder.query({
|
|
48
|
+
query: ()=>'/i18n/iso-locales'
|
|
49
|
+
}),
|
|
50
|
+
updateLocale: builder.mutation({
|
|
51
|
+
query: ({ id, ...data })=>({
|
|
52
|
+
url: `/i18n/locales/${id}`,
|
|
53
|
+
method: 'PUT',
|
|
54
|
+
data
|
|
55
|
+
}),
|
|
56
|
+
invalidatesTags: (result, error, { id })=>[
|
|
57
|
+
{
|
|
58
|
+
type: 'Locale',
|
|
59
|
+
id
|
|
60
|
+
}
|
|
61
|
+
]
|
|
62
|
+
})
|
|
63
|
+
})
|
|
64
|
+
});
|
|
65
|
+
const { useCreateLocaleMutation, useDeleteLocaleMutation, useGetLocalesQuery, useGetDefaultLocalesQuery, useUpdateLocaleMutation } = localesApi;
|
|
66
|
+
|
|
67
|
+
exports.useCreateLocaleMutation = useCreateLocaleMutation;
|
|
68
|
+
exports.useDeleteLocaleMutation = useDeleteLocaleMutation;
|
|
69
|
+
exports.useGetDefaultLocalesQuery = useGetDefaultLocalesQuery;
|
|
70
|
+
exports.useGetLocalesQuery = useGetLocalesQuery;
|
|
71
|
+
exports.useUpdateLocaleMutation = useUpdateLocaleMutation;
|
|
72
|
+
//# sourceMappingURL=locales.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"locales.js","sources":["../../../admin/src/services/locales.ts"],"sourcesContent":["import { i18nApi } from './api';\n\nimport type { GetISOLocales } from '../../../shared/contracts/iso-locales';\nimport type {\n GetLocales,\n CreateLocale,\n DeleteLocale,\n UpdateLocale,\n} from '../../../shared/contracts/locales';\n\nconst localesApi = i18nApi.injectEndpoints({\n endpoints: (builder) => ({\n createLocale: builder.mutation<CreateLocale.Response, CreateLocale.Request['body']>({\n query: (data) => ({\n url: '/i18n/locales',\n method: 'POST',\n data,\n }),\n invalidatesTags: [{ type: 'Locale', id: 'LIST' }, 'HomepageKeyStatistics'],\n }),\n deleteLocale: builder.mutation<DeleteLocale.Response, DeleteLocale.Params['id']>({\n query: (id) => ({\n url: `/i18n/locales/${id}`,\n method: 'DELETE',\n }),\n invalidatesTags: (result, error, id) => [{ type: 'Locale', id }, 'HomepageKeyStatistics'],\n }),\n getLocales: builder.query<GetLocales.Response, void>({\n query: () => '/i18n/locales',\n providesTags: (res) => [\n { type: 'Locale', id: 'LIST' },\n ...(Array.isArray(res)\n ? res.map((locale) => ({\n type: 'Locale' as const,\n id: locale.id,\n }))\n : []),\n ],\n }),\n getDefaultLocales: builder.query<GetISOLocales.Response, void>({\n query: () => '/i18n/iso-locales',\n }),\n updateLocale: builder.mutation<\n UpdateLocale.Response,\n UpdateLocale.Request['body'] & UpdateLocale.Params\n >({\n query: ({ id, ...data }) => ({\n url: `/i18n/locales/${id}`,\n method: 'PUT',\n data,\n }),\n invalidatesTags: (result, error, { id }) => [{ type: 'Locale', id }],\n }),\n }),\n});\n\nconst {\n useCreateLocaleMutation,\n useDeleteLocaleMutation,\n useGetLocalesQuery,\n useGetDefaultLocalesQuery,\n useUpdateLocaleMutation,\n} = localesApi;\n\nexport {\n useCreateLocaleMutation,\n useDeleteLocaleMutation,\n useGetLocalesQuery,\n useGetDefaultLocalesQuery,\n useUpdateLocaleMutation,\n};\n"],"names":["localesApi","i18nApi","injectEndpoints","endpoints","builder","createLocale","mutation","query","data","url","method","invalidatesTags","type","id","deleteLocale","result","error","getLocales","providesTags","res","Array","isArray","map","locale","getDefaultLocales","updateLocale","useCreateLocaleMutation","useDeleteLocaleMutation","useGetLocalesQuery","useGetDefaultLocalesQuery","useUpdateLocaleMutation"],"mappings":";;;;AAUA,MAAMA,UAAAA,GAAaC,WAAQC,CAAAA,eAAe,CAAC;IACzCC,SAAW,EAAA,CAACC,WAAa;YACvBC,YAAcD,EAAAA,OAAAA,CAAQE,QAAQ,CAAsD;gBAClFC,KAAO,EAAA,CAACC,QAAU;wBAChBC,GAAK,EAAA,eAAA;wBACLC,MAAQ,EAAA,MAAA;AACRF,wBAAAA;qBACF,CAAA;gBACAG,eAAiB,EAAA;AAAC,oBAAA;wBAAEC,IAAM,EAAA,QAAA;wBAAUC,EAAI,EAAA;AAAO,qBAAA;AAAG,oBAAA;AAAwB;AAC5E,aAAA,CAAA;YACAC,YAAcV,EAAAA,OAAAA,CAAQE,QAAQ,CAAmD;gBAC/EC,KAAO,EAAA,CAACM,MAAQ;AACdJ,wBAAAA,GAAAA,EAAK,CAAC,cAAc,EAAEI,EAAAA,CAAG,CAAC;wBAC1BH,MAAQ,EAAA;qBACV,CAAA;gBACAC,eAAiB,EAAA,CAACI,MAAQC,EAAAA,KAAAA,EAAOH,EAAO,GAAA;AAAC,wBAAA;4BAAED,IAAM,EAAA,QAAA;AAAUC,4BAAAA;AAAG,yBAAA;AAAG,wBAAA;AAAwB;AAC3F,aAAA,CAAA;YACAI,UAAYb,EAAAA,OAAAA,CAAQG,KAAK,CAA4B;AACnDA,gBAAAA,KAAAA,EAAO,IAAM,eAAA;AACbW,gBAAAA,YAAAA,EAAc,CAACC,GAAQ,GAAA;AACrB,wBAAA;4BAAEP,IAAM,EAAA,QAAA;4BAAUC,EAAI,EAAA;AAAO,yBAAA;2BACzBO,KAAMC,CAAAA,OAAO,CAACF,GACdA,CAAAA,GAAAA,GAAAA,CAAIG,GAAG,CAAC,CAACC,UAAY;gCACnBX,IAAM,EAAA,QAAA;AACNC,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