@strapi/i18n 5.44.0 → 5.45.1
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/index.js
CHANGED
|
@@ -105,17 +105,18 @@ var index = {
|
|
|
105
105
|
permissions: constants.PERMISSIONS.accessMain
|
|
106
106
|
});
|
|
107
107
|
const contentManager = app.getPlugin('content-manager');
|
|
108
|
-
contentManager.apis
|
|
108
|
+
const contentManagerApis = contentManager.apis;
|
|
109
|
+
contentManagerApis.addDocumentHeaderAction([
|
|
109
110
|
CMHeaderActions.AITranslationStatusAction,
|
|
110
111
|
CMHeaderActions.LocalePickerAction,
|
|
111
112
|
CMHeaderActions.FillFromAnotherLocaleAction
|
|
112
113
|
]);
|
|
113
|
-
|
|
114
|
+
contentManagerApis.addDocumentAction((actions)=>{
|
|
114
115
|
const indexOfDeleteAction = actions.findIndex((action)=>action.type === 'delete');
|
|
115
116
|
actions.splice(indexOfDeleteAction, 0, CMHeaderActions.DeleteLocaleAction);
|
|
116
117
|
return actions;
|
|
117
118
|
});
|
|
118
|
-
|
|
119
|
+
contentManagerApis.addDocumentAction((actions)=>{
|
|
119
120
|
// When enabled the bulk locale publish action should be the first action
|
|
120
121
|
// in 'More Document Actions' and therefore the third action in the array
|
|
121
122
|
actions.splice(2, 0, CMHeaderActions.BulkLocalePublishAction);
|
package/dist/admin/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":["../../admin/src/index.ts"],"sourcesContent":["import get from 'lodash/get';\nimport * as yup from 'yup';\n\nimport { CheckboxConfirmation } from './components/CheckboxConfirmation';\nimport {\n BulkLocalePublishAction,\n BulkLocaleUnpublishAction,\n DeleteLocaleAction,\n LocalePickerAction,\n FillFromAnotherLocaleAction,\n AITranslationStatusAction,\n} from './components/CMHeaderActions';\nimport {\n DeleteModalAdditionalInfo,\n PublishModalAdditionalInfo,\n UnpublishModalAdditionalInfo,\n} from './components/CMListViewModalsAdditionalInformation';\nimport { LocalePicker } from './components/LocalePicker';\nimport { PERMISSIONS } from './constants';\nimport { mutateEditViewHook } from './contentManagerHooks/editView';\nimport { addColumnToTableHook } from './contentManagerHooks/listView';\nimport { addLocaleToReleasesHook } from './contentReleasesHooks/releaseDetailsView';\nimport { extendCTBAttributeInitialDataMiddleware } from './middlewares/extendCTBAttributeInitialData';\nimport { extendCTBInitialDataMiddleware } from './middlewares/extendCTBInitialData';\nimport { localeMiddleware } from './middlewares/rbac-middleware';\nimport { pluginId } from './pluginId';\nimport { i18nApi } from './services/api';\nimport { LOCALIZED_FIELDS } from './utils/fields';\nimport { getTranslation } from './utils/getTranslation';\nimport { prefixPluginTranslations } from './utils/prefixPluginTranslations';\nimport { mutateCTBContentTypeSchema } from './utils/schemas';\n\nimport type { DocumentActionComponent } from '@strapi/content-manager/strapi-admin';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n register(app: any) {\n app.addMiddlewares([extendCTBAttributeInitialDataMiddleware, extendCTBInitialDataMiddleware]);\n app.addMiddlewares([() => i18nApi.middleware]);\n app.addReducers({\n [i18nApi.reducerPath]: i18nApi.reducer,\n });\n app.addRBACMiddleware([localeMiddleware]);\n app.registerPlugin({\n id: pluginId,\n name: pluginId,\n });\n },\n bootstrap(app: any) {\n // // Hook that adds a column into the CM's LV table\n app.registerHook('Admin/CM/pages/ListView/inject-column-in-table', addColumnToTableHook);\n app.registerHook('Admin/CM/pages/EditView/mutate-edit-view-layout', mutateEditViewHook);\n // Hooks that checks if the locale is present in the release\n app.registerHook(\n 'ContentReleases/pages/ReleaseDetails/add-locale-in-releases',\n addLocaleToReleasesHook\n );\n\n // Add the settings link\n app.addSettingsLink('global', {\n intlLabel: {\n id: getTranslation('plugin.name'),\n defaultMessage: 'Internationalization',\n },\n id: 'internationalization',\n to: 'internationalization',\n Component: () =>\n import('./pages/SettingsPage').then((mod) => ({ default: mod.ProtectedSettingsPage })),\n permissions: PERMISSIONS.accessMain,\n });\n\n const contentManager = app.getPlugin('content-manager');\n\n contentManager.apis.addDocumentHeaderAction([\n AITranslationStatusAction,\n LocalePickerAction,\n FillFromAnotherLocaleAction,\n ]);\n contentManager.apis.addDocumentAction((actions: DocumentActionComponent[]) => {\n const indexOfDeleteAction = actions.findIndex((action) => action.type === 'delete');\n actions.splice(indexOfDeleteAction, 0, DeleteLocaleAction);\n return actions;\n });\n\n contentManager.apis.addDocumentAction((actions: DocumentActionComponent[]) => {\n // When enabled the bulk locale publish action should be the first action\n // in 'More Document Actions' and therefore the third action in the array\n actions.splice(2, 0, BulkLocalePublishAction);\n actions.splice(5, 0, BulkLocaleUnpublishAction);\n return actions;\n });\n\n contentManager.injectComponent('listView', 'actions', {\n name: 'i18n-locale-filter',\n Component: LocalePicker,\n });\n\n contentManager.injectComponent('listView', 'publishModalAdditionalInfos', {\n name: 'i18n-publish-bullets-in-modal',\n Component: PublishModalAdditionalInfo,\n });\n\n contentManager.injectComponent('listView', 'unpublishModalAdditionalInfos', {\n name: 'i18n-unpublish-bullets-in-modal',\n Component: UnpublishModalAdditionalInfo,\n });\n\n contentManager.injectComponent('listView', 'deleteModalAdditionalInfos', {\n name: 'i18n-delete-bullets-in-modal',\n Component: DeleteModalAdditionalInfo,\n });\n\n const ctbPlugin = app.getPlugin('content-type-builder');\n\n if (ctbPlugin) {\n const ctbFormsAPI = ctbPlugin.apis.forms;\n ctbFormsAPI.addContentTypeSchemaMutation(mutateCTBContentTypeSchema);\n ctbFormsAPI.components.add({ id: 'checkboxConfirmation', component: CheckboxConfirmation });\n\n ctbFormsAPI.extendContentType({\n validator: () => ({\n i18n: yup.object().shape({\n localized: yup.bool(),\n }),\n }),\n form: {\n advanced() {\n return [\n {\n name: 'pluginOptions.i18n.localized',\n description: {\n id: getTranslation('plugin.schema.i18n.localized.description-content-type'),\n defaultMessage: 'Allows translating an entry into different languages',\n },\n type: 'checkboxConfirmation',\n intlLabel: {\n id: getTranslation('plugin.schema.i18n.localized.label-content-type'),\n defaultMessage: 'Localization',\n },\n },\n ];\n },\n },\n });\n\n ctbFormsAPI.extendFields(LOCALIZED_FIELDS, {\n form: {\n advanced({ contentTypeSchema, forTarget, type, step }: any) {\n if (forTarget !== 'contentType') {\n return [];\n }\n\n const hasI18nEnabled = get(\n contentTypeSchema,\n ['pluginOptions', 'i18n', 'localized'],\n false\n );\n\n if (!hasI18nEnabled) {\n return [];\n }\n\n if (type === 'component' && step === '1') {\n return [];\n }\n\n return [\n {\n name: 'pluginOptions.i18n.localized',\n description: {\n id: getTranslation('plugin.schema.i18n.localized.description-field'),\n defaultMessage: 'The field can have different values in each locale',\n },\n type: 'checkbox',\n intlLabel: {\n id: getTranslation('plugin.schema.i18n.localized.label-field'),\n defaultMessage: 'Enable localization for this field',\n },\n },\n ];\n },\n },\n });\n }\n },\n async registerTrads({ locales }: { locales: string[] }) {\n const importedTrads = await Promise.all(\n locales.map((locale) => {\n return import(`./translations/${locale}.json`)\n .then(({ default: data }) => {\n return {\n data: prefixPluginTranslations(data, pluginId),\n locale,\n };\n })\n .catch(() => {\n return {\n data: {},\n locale,\n };\n });\n })\n );\n\n return Promise.resolve(importedTrads);\n },\n};\n"],"names":["register","app","addMiddlewares","extendCTBAttributeInitialDataMiddleware","extendCTBInitialDataMiddleware","i18nApi","middleware","addReducers","reducerPath","reducer","addRBACMiddleware","localeMiddleware","registerPlugin","id","pluginId","name","bootstrap","registerHook","addColumnToTableHook","mutateEditViewHook","addLocaleToReleasesHook","addSettingsLink","intlLabel","getTranslation","defaultMessage","to","Component","then","mod","default","ProtectedSettingsPage","permissions","PERMISSIONS","accessMain","contentManager","getPlugin","apis","addDocumentHeaderAction","AITranslationStatusAction","LocalePickerAction","FillFromAnotherLocaleAction","addDocumentAction","actions","indexOfDeleteAction","findIndex","action","type","splice","DeleteLocaleAction","BulkLocalePublishAction","BulkLocaleUnpublishAction","injectComponent","LocalePicker","PublishModalAdditionalInfo","UnpublishModalAdditionalInfo","DeleteModalAdditionalInfo","ctbPlugin","ctbFormsAPI","forms","addContentTypeSchemaMutation","mutateCTBContentTypeSchema","components","add","component","CheckboxConfirmation","extendContentType","validator","i18n","yup","object","shape","localized","bool","form","advanced","description","extendFields","LOCALIZED_FIELDS","contentTypeSchema","forTarget","step","hasI18nEnabled","get","registerTrads","locales","importedTrads","Promise","all","map","locale","data","prefixPluginTranslations","catch","resolve"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA;AACA,YAAe;AACbA,IAAAA,QAAAA,CAAAA,CAASC,GAAQ,EAAA;AACfA,QAAAA,GAAAA,CAAIC,cAAc,CAAC;AAACC,YAAAA,qEAAAA;AAAyCC,YAAAA;AAA+B,SAAA,CAAA;AAC5FH,QAAAA,GAAAA,CAAIC,cAAc,CAAC;AAAC,YAAA,IAAMG,YAAQC;AAAW,SAAA,CAAA;AAC7CL,QAAAA,GAAAA,CAAIM,WAAW,CAAC;AACd,YAAA,CAACF,WAAAA,CAAQG,WAAW,GAAGH,YAAQI;AACjC,SAAA,CAAA;AACAR,QAAAA,GAAAA,CAAIS,iBAAiB,CAAC;AAACC,YAAAA;AAAiB,SAAA,CAAA;AACxCV,QAAAA,GAAAA,CAAIW,cAAc,CAAC;YACjBC,EAAAA,EAAIC,iBAAAA;YACJC,IAAAA,EAAMD;AACR,SAAA,CAAA;AACF,IAAA,CAAA;AACAE,IAAAA,SAAAA,CAAAA,CAAUf,GAAQ,EAAA;;QAEhBA,GAAAA,CAAIgB,YAAY,CAAC,gDAAA,EAAkDC,6BAAAA,CAAAA;QACnEjB,GAAAA,CAAIgB,YAAY,CAAC,iDAAA,EAAmDE,2BAAAA,CAAAA;;QAEpElB,GAAAA,CAAIgB,YAAY,CACd,6DAAA,EACAG,0CAAAA,CAAAA;;QAIFnB,GAAAA,CAAIoB,eAAe,CAAC,QAAA,EAAU;YAC5BC,SAAAA,EAAW;AACTT,gBAAAA,EAAAA,EAAIU,6BAAAA,CAAe,aAAA,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CAAC,CAAC,eAAe,EAAEA,MAAAA,CAAO,KAAK,CAAC,CAAA,CAC1C9D,IAAI,CAAC,CAAC,EAAEE,OAAAA,EAAS6D,IAAI,EAAE,GAAA;gBACtB,OAAO;AACLA,oBAAAA,IAAAA,EAAMC,kDAAyBD,IAAAA,EAAM5E,iBAAAA,CAAAA;AACrC2E,oBAAAA;AACF,iBAAA;AACF,YAAA,CAAA,CAAA,CACCG,KAAK,CAAC,IAAA;gBACL,OAAO;AACLF,oBAAAA,IAAAA,EAAM,EAAC;AACPD,oBAAAA;AACF,iBAAA;AACF,YAAA,CAAA,CAAA;AACJ,QAAA,CAAA,CAAA,CAAA;QAGF,OAAOH,OAAAA,CAAQO,OAAO,CAACR,aAAAA,CAAAA;AACzB,IAAA;AACF,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../../admin/src/index.ts"],"sourcesContent":["import get from 'lodash/get';\nimport * as yup from 'yup';\n\nimport { CheckboxConfirmation } from './components/CheckboxConfirmation';\nimport {\n BulkLocalePublishAction,\n BulkLocaleUnpublishAction,\n DeleteLocaleAction,\n LocalePickerAction,\n FillFromAnotherLocaleAction,\n AITranslationStatusAction,\n} from './components/CMHeaderActions';\nimport {\n DeleteModalAdditionalInfo,\n PublishModalAdditionalInfo,\n UnpublishModalAdditionalInfo,\n} from './components/CMListViewModalsAdditionalInformation';\nimport { LocalePicker } from './components/LocalePicker';\nimport { PERMISSIONS } from './constants';\nimport { mutateEditViewHook } from './contentManagerHooks/editView';\nimport { addColumnToTableHook } from './contentManagerHooks/listView';\nimport { addLocaleToReleasesHook } from './contentReleasesHooks/releaseDetailsView';\nimport { extendCTBAttributeInitialDataMiddleware } from './middlewares/extendCTBAttributeInitialData';\nimport { extendCTBInitialDataMiddleware } from './middlewares/extendCTBInitialData';\nimport { localeMiddleware } from './middlewares/rbac-middleware';\nimport { pluginId } from './pluginId';\nimport { i18nApi } from './services/api';\nimport { LOCALIZED_FIELDS } from './utils/fields';\nimport { getTranslation } from './utils/getTranslation';\nimport { prefixPluginTranslations } from './utils/prefixPluginTranslations';\nimport { mutateCTBContentTypeSchema } from './utils/schemas';\n\nimport type { StrapiApp } from '@strapi/admin/strapi-admin';\nimport type {\n ContentManagerPlugin,\n DocumentActionComponent,\n HeaderActionComponent,\n} from '@strapi/content-manager/strapi-admin';\n\ntype ContentTypeBuilderFormsAPI = {\n addContentTypeSchemaMutation: (mutation: typeof mutateCTBContentTypeSchema) => void;\n components: {\n add: (component: { id: string; component: typeof CheckboxConfirmation }) => void;\n };\n extendContentType: (extension: {\n validator: () => Record<string, unknown>;\n form: {\n advanced: () => Array<Record<string, unknown>>;\n };\n }) => void;\n extendFields: (\n fields: typeof LOCALIZED_FIELDS,\n extension: {\n form: {\n advanced: (args: any) => Array<Record<string, unknown>>;\n };\n }\n ) => void;\n};\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n register(app: StrapiApp) {\n app.addMiddlewares([extendCTBAttributeInitialDataMiddleware, extendCTBInitialDataMiddleware]);\n app.addMiddlewares([() => i18nApi.middleware]);\n app.addReducers({\n [i18nApi.reducerPath]: i18nApi.reducer,\n });\n app.addRBACMiddleware([localeMiddleware]);\n app.registerPlugin({\n id: pluginId,\n name: pluginId,\n });\n },\n bootstrap(app: StrapiApp) {\n // // Hook that adds a column into the CM's LV table\n app.registerHook('Admin/CM/pages/ListView/inject-column-in-table', addColumnToTableHook);\n app.registerHook('Admin/CM/pages/EditView/mutate-edit-view-layout', mutateEditViewHook);\n // Hooks that checks if the locale is present in the release\n app.registerHook(\n 'ContentReleases/pages/ReleaseDetails/add-locale-in-releases',\n addLocaleToReleasesHook\n );\n\n // Add the settings link\n app.addSettingsLink('global', {\n intlLabel: {\n id: getTranslation('plugin.name'),\n defaultMessage: 'Internationalization',\n },\n id: 'internationalization',\n to: 'internationalization',\n Component: () =>\n import('./pages/SettingsPage').then((mod) => ({ default: mod.ProtectedSettingsPage })),\n permissions: PERMISSIONS.accessMain,\n });\n\n const contentManager = app.getPlugin('content-manager');\n const contentManagerApis = contentManager.apis as ContentManagerPlugin['config']['apis'];\n\n contentManagerApis.addDocumentHeaderAction([\n AITranslationStatusAction,\n LocalePickerAction,\n FillFromAnotherLocaleAction,\n ] as HeaderActionComponent[]);\n contentManagerApis.addDocumentAction((actions: DocumentActionComponent[]) => {\n const indexOfDeleteAction = actions.findIndex((action) => action.type === 'delete');\n actions.splice(indexOfDeleteAction, 0, DeleteLocaleAction);\n return actions;\n });\n\n contentManagerApis.addDocumentAction((actions: DocumentActionComponent[]) => {\n // When enabled the bulk locale publish action should be the first action\n // in 'More Document Actions' and therefore the third action in the array\n actions.splice(2, 0, BulkLocalePublishAction);\n actions.splice(5, 0, BulkLocaleUnpublishAction);\n return actions;\n });\n\n contentManager.injectComponent('listView', 'actions', {\n name: 'i18n-locale-filter',\n Component: LocalePicker,\n });\n\n contentManager.injectComponent('listView', 'publishModalAdditionalInfos', {\n name: 'i18n-publish-bullets-in-modal',\n Component: PublishModalAdditionalInfo,\n });\n\n contentManager.injectComponent('listView', 'unpublishModalAdditionalInfos', {\n name: 'i18n-unpublish-bullets-in-modal',\n Component: UnpublishModalAdditionalInfo,\n });\n\n contentManager.injectComponent('listView', 'deleteModalAdditionalInfos', {\n name: 'i18n-delete-bullets-in-modal',\n Component: DeleteModalAdditionalInfo,\n });\n\n const ctbPlugin = app.getPlugin('content-type-builder');\n\n if (ctbPlugin) {\n const ctbFormsAPI = ctbPlugin.apis.forms as ContentTypeBuilderFormsAPI;\n ctbFormsAPI.addContentTypeSchemaMutation(mutateCTBContentTypeSchema);\n ctbFormsAPI.components.add({ id: 'checkboxConfirmation', component: CheckboxConfirmation });\n\n ctbFormsAPI.extendContentType({\n validator: () => ({\n i18n: yup.object().shape({\n localized: yup.bool(),\n }),\n }),\n form: {\n advanced() {\n return [\n {\n name: 'pluginOptions.i18n.localized',\n description: {\n id: getTranslation('plugin.schema.i18n.localized.description-content-type'),\n defaultMessage: 'Allows translating an entry into different languages',\n },\n type: 'checkboxConfirmation',\n intlLabel: {\n id: getTranslation('plugin.schema.i18n.localized.label-content-type'),\n defaultMessage: 'Localization',\n },\n },\n ];\n },\n },\n });\n\n ctbFormsAPI.extendFields(LOCALIZED_FIELDS, {\n form: {\n advanced({ contentTypeSchema, forTarget, type, step }: any) {\n if (forTarget !== 'contentType') {\n return [];\n }\n\n const hasI18nEnabled = get(\n contentTypeSchema,\n ['pluginOptions', 'i18n', 'localized'],\n false\n );\n\n if (!hasI18nEnabled) {\n return [];\n }\n\n if (type === 'component' && step === '1') {\n return [];\n }\n\n return [\n {\n name: 'pluginOptions.i18n.localized',\n description: {\n id: getTranslation('plugin.schema.i18n.localized.description-field'),\n defaultMessage: 'The field can have different values in each locale',\n },\n type: 'checkbox',\n intlLabel: {\n id: getTranslation('plugin.schema.i18n.localized.label-field'),\n defaultMessage: 'Enable localization for this field',\n },\n },\n ];\n },\n },\n });\n }\n },\n async registerTrads({ locales }: { locales: string[] }) {\n const importedTrads = await Promise.all(\n locales.map((locale) => {\n return import(`./translations/${locale}.json`)\n .then(({ default: data }) => {\n return {\n data: prefixPluginTranslations(data, pluginId),\n locale,\n };\n })\n .catch(() => {\n return {\n data: {},\n locale,\n };\n });\n })\n );\n\n return Promise.resolve(importedTrads);\n },\n};\n"],"names":["register","app","addMiddlewares","extendCTBAttributeInitialDataMiddleware","extendCTBInitialDataMiddleware","i18nApi","middleware","addReducers","reducerPath","reducer","addRBACMiddleware","localeMiddleware","registerPlugin","id","pluginId","name","bootstrap","registerHook","addColumnToTableHook","mutateEditViewHook","addLocaleToReleasesHook","addSettingsLink","intlLabel","getTranslation","defaultMessage","to","Component","then","mod","default","ProtectedSettingsPage","permissions","PERMISSIONS","accessMain","contentManager","getPlugin","contentManagerApis","apis","addDocumentHeaderAction","AITranslationStatusAction","LocalePickerAction","FillFromAnotherLocaleAction","addDocumentAction","actions","indexOfDeleteAction","findIndex","action","type","splice","DeleteLocaleAction","BulkLocalePublishAction","BulkLocaleUnpublishAction","injectComponent","LocalePicker","PublishModalAdditionalInfo","UnpublishModalAdditionalInfo","DeleteModalAdditionalInfo","ctbPlugin","ctbFormsAPI","forms","addContentTypeSchemaMutation","mutateCTBContentTypeSchema","components","add","component","CheckboxConfirmation","extendContentType","validator","i18n","yup","object","shape","localized","bool","form","advanced","description","extendFields","LOCALIZED_FIELDS","contentTypeSchema","forTarget","step","hasI18nEnabled","get","registerTrads","locales","importedTrads","Promise","all","map","locale","data","prefixPluginTranslations","catch","resolve"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DA;AACA,YAAe;AACbA,IAAAA,QAAAA,CAAAA,CAASC,GAAc,EAAA;AACrBA,QAAAA,GAAAA,CAAIC,cAAc,CAAC;AAACC,YAAAA,qEAAAA;AAAyCC,YAAAA;AAA+B,SAAA,CAAA;AAC5FH,QAAAA,GAAAA,CAAIC,cAAc,CAAC;AAAC,YAAA,IAAMG,YAAQC;AAAW,SAAA,CAAA;AAC7CL,QAAAA,GAAAA,CAAIM,WAAW,CAAC;AACd,YAAA,CAACF,WAAAA,CAAQG,WAAW,GAAGH,YAAQI;AACjC,SAAA,CAAA;AACAR,QAAAA,GAAAA,CAAIS,iBAAiB,CAAC;AAACC,YAAAA;AAAiB,SAAA,CAAA;AACxCV,QAAAA,GAAAA,CAAIW,cAAc,CAAC;YACjBC,EAAAA,EAAIC,iBAAAA;YACJC,IAAAA,EAAMD;AACR,SAAA,CAAA;AACF,IAAA,CAAA;AACAE,IAAAA,SAAAA,CAAAA,CAAUf,GAAc,EAAA;;QAEtBA,GAAAA,CAAIgB,YAAY,CAAC,gDAAA,EAAkDC,6BAAAA,CAAAA;QACnEjB,GAAAA,CAAIgB,YAAY,CAAC,iDAAA,EAAmDE,2BAAAA,CAAAA;;QAEpElB,GAAAA,CAAIgB,YAAY,CACd,6DAAA,EACAG,0CAAAA,CAAAA;;QAIFnB,GAAAA,CAAIoB,eAAe,CAAC,QAA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rCH,OAAAA,CAAQI,GAAG,CAAC,CAACC,MAAAA,GAAAA;AACX,YAAA,OAAO,iCAAM,CAAC,CAAC,eAAe,EAAEA,MAAAA,CAAO,KAAK,CAAC,CAAA,CAC1C/D,IAAI,CAAC,CAAC,EAAEE,OAAAA,EAAS8D,IAAI,EAAE,GAAA;gBACtB,OAAO;AACLA,oBAAAA,IAAAA,EAAMC,kDAAyBD,IAAAA,EAAM7E,iBAAAA,CAAAA;AACrC4E,oBAAAA;AACF,iBAAA;AACF,YAAA,CAAA,CAAA,CACCG,KAAK,CAAC,IAAA;gBACL,OAAO;AACLF,oBAAAA,IAAAA,EAAM,EAAC;AACPD,oBAAAA;AACF,iBAAA;AACF,YAAA,CAAA,CAAA;AACJ,QAAA,CAAA,CAAA,CAAA;QAGF,OAAOH,OAAAA,CAAQO,OAAO,CAACR,aAAAA,CAAAA;AACzB,IAAA;AACF,CAAA;;;;"}
|
package/dist/admin/index.mjs
CHANGED
|
@@ -82,17 +82,18 @@ var index = {
|
|
|
82
82
|
permissions: PERMISSIONS.accessMain
|
|
83
83
|
});
|
|
84
84
|
const contentManager = app.getPlugin('content-manager');
|
|
85
|
-
contentManager.apis
|
|
85
|
+
const contentManagerApis = contentManager.apis;
|
|
86
|
+
contentManagerApis.addDocumentHeaderAction([
|
|
86
87
|
AITranslationStatusAction,
|
|
87
88
|
LocalePickerAction,
|
|
88
89
|
FillFromAnotherLocaleAction
|
|
89
90
|
]);
|
|
90
|
-
|
|
91
|
+
contentManagerApis.addDocumentAction((actions)=>{
|
|
91
92
|
const indexOfDeleteAction = actions.findIndex((action)=>action.type === 'delete');
|
|
92
93
|
actions.splice(indexOfDeleteAction, 0, DeleteLocaleAction);
|
|
93
94
|
return actions;
|
|
94
95
|
});
|
|
95
|
-
|
|
96
|
+
contentManagerApis.addDocumentAction((actions)=>{
|
|
96
97
|
// When enabled the bulk locale publish action should be the first action
|
|
97
98
|
// in 'More Document Actions' and therefore the third action in the array
|
|
98
99
|
actions.splice(2, 0, BulkLocalePublishAction);
|
package/dist/admin/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../admin/src/index.ts"],"sourcesContent":["import get from 'lodash/get';\nimport * as yup from 'yup';\n\nimport { CheckboxConfirmation } from './components/CheckboxConfirmation';\nimport {\n BulkLocalePublishAction,\n BulkLocaleUnpublishAction,\n DeleteLocaleAction,\n LocalePickerAction,\n FillFromAnotherLocaleAction,\n AITranslationStatusAction,\n} from './components/CMHeaderActions';\nimport {\n DeleteModalAdditionalInfo,\n PublishModalAdditionalInfo,\n UnpublishModalAdditionalInfo,\n} from './components/CMListViewModalsAdditionalInformation';\nimport { LocalePicker } from './components/LocalePicker';\nimport { PERMISSIONS } from './constants';\nimport { mutateEditViewHook } from './contentManagerHooks/editView';\nimport { addColumnToTableHook } from './contentManagerHooks/listView';\nimport { addLocaleToReleasesHook } from './contentReleasesHooks/releaseDetailsView';\nimport { extendCTBAttributeInitialDataMiddleware } from './middlewares/extendCTBAttributeInitialData';\nimport { extendCTBInitialDataMiddleware } from './middlewares/extendCTBInitialData';\nimport { localeMiddleware } from './middlewares/rbac-middleware';\nimport { pluginId } from './pluginId';\nimport { i18nApi } from './services/api';\nimport { LOCALIZED_FIELDS } from './utils/fields';\nimport { getTranslation } from './utils/getTranslation';\nimport { prefixPluginTranslations } from './utils/prefixPluginTranslations';\nimport { mutateCTBContentTypeSchema } from './utils/schemas';\n\nimport type { DocumentActionComponent } from '@strapi/content-manager/strapi-admin';\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n register(app: any) {\n app.addMiddlewares([extendCTBAttributeInitialDataMiddleware, extendCTBInitialDataMiddleware]);\n app.addMiddlewares([() => i18nApi.middleware]);\n app.addReducers({\n [i18nApi.reducerPath]: i18nApi.reducer,\n });\n app.addRBACMiddleware([localeMiddleware]);\n app.registerPlugin({\n id: pluginId,\n name: pluginId,\n });\n },\n bootstrap(app: any) {\n // // Hook that adds a column into the CM's LV table\n app.registerHook('Admin/CM/pages/ListView/inject-column-in-table', addColumnToTableHook);\n app.registerHook('Admin/CM/pages/EditView/mutate-edit-view-layout', mutateEditViewHook);\n // Hooks that checks if the locale is present in the release\n app.registerHook(\n 'ContentReleases/pages/ReleaseDetails/add-locale-in-releases',\n addLocaleToReleasesHook\n );\n\n // Add the settings link\n app.addSettingsLink('global', {\n intlLabel: {\n id: getTranslation('plugin.name'),\n defaultMessage: 'Internationalization',\n },\n id: 'internationalization',\n to: 'internationalization',\n Component: () =>\n import('./pages/SettingsPage').then((mod) => ({ default: mod.ProtectedSettingsPage })),\n permissions: PERMISSIONS.accessMain,\n });\n\n const contentManager = app.getPlugin('content-manager');\n\n contentManager.apis.addDocumentHeaderAction([\n AITranslationStatusAction,\n LocalePickerAction,\n FillFromAnotherLocaleAction,\n ]);\n contentManager.apis.addDocumentAction((actions: DocumentActionComponent[]) => {\n const indexOfDeleteAction = actions.findIndex((action) => action.type === 'delete');\n actions.splice(indexOfDeleteAction, 0, DeleteLocaleAction);\n return actions;\n });\n\n contentManager.apis.addDocumentAction((actions: DocumentActionComponent[]) => {\n // When enabled the bulk locale publish action should be the first action\n // in 'More Document Actions' and therefore the third action in the array\n actions.splice(2, 0, BulkLocalePublishAction);\n actions.splice(5, 0, BulkLocaleUnpublishAction);\n return actions;\n });\n\n contentManager.injectComponent('listView', 'actions', {\n name: 'i18n-locale-filter',\n Component: LocalePicker,\n });\n\n contentManager.injectComponent('listView', 'publishModalAdditionalInfos', {\n name: 'i18n-publish-bullets-in-modal',\n Component: PublishModalAdditionalInfo,\n });\n\n contentManager.injectComponent('listView', 'unpublishModalAdditionalInfos', {\n name: 'i18n-unpublish-bullets-in-modal',\n Component: UnpublishModalAdditionalInfo,\n });\n\n contentManager.injectComponent('listView', 'deleteModalAdditionalInfos', {\n name: 'i18n-delete-bullets-in-modal',\n Component: DeleteModalAdditionalInfo,\n });\n\n const ctbPlugin = app.getPlugin('content-type-builder');\n\n if (ctbPlugin) {\n const ctbFormsAPI = ctbPlugin.apis.forms;\n ctbFormsAPI.addContentTypeSchemaMutation(mutateCTBContentTypeSchema);\n ctbFormsAPI.components.add({ id: 'checkboxConfirmation', component: CheckboxConfirmation });\n\n ctbFormsAPI.extendContentType({\n validator: () => ({\n i18n: yup.object().shape({\n localized: yup.bool(),\n }),\n }),\n form: {\n advanced() {\n return [\n {\n name: 'pluginOptions.i18n.localized',\n description: {\n id: getTranslation('plugin.schema.i18n.localized.description-content-type'),\n defaultMessage: 'Allows translating an entry into different languages',\n },\n type: 'checkboxConfirmation',\n intlLabel: {\n id: getTranslation('plugin.schema.i18n.localized.label-content-type'),\n defaultMessage: 'Localization',\n },\n },\n ];\n },\n },\n });\n\n ctbFormsAPI.extendFields(LOCALIZED_FIELDS, {\n form: {\n advanced({ contentTypeSchema, forTarget, type, step }: any) {\n if (forTarget !== 'contentType') {\n return [];\n }\n\n const hasI18nEnabled = get(\n contentTypeSchema,\n ['pluginOptions', 'i18n', 'localized'],\n false\n );\n\n if (!hasI18nEnabled) {\n return [];\n }\n\n if (type === 'component' && step === '1') {\n return [];\n }\n\n return [\n {\n name: 'pluginOptions.i18n.localized',\n description: {\n id: getTranslation('plugin.schema.i18n.localized.description-field'),\n defaultMessage: 'The field can have different values in each locale',\n },\n type: 'checkbox',\n intlLabel: {\n id: getTranslation('plugin.schema.i18n.localized.label-field'),\n defaultMessage: 'Enable localization for this field',\n },\n },\n ];\n },\n },\n });\n }\n },\n async registerTrads({ locales }: { locales: string[] }) {\n const importedTrads = await Promise.all(\n locales.map((locale) => {\n return import(`./translations/${locale}.json`)\n .then(({ default: data }) => {\n return {\n data: prefixPluginTranslations(data, pluginId),\n locale,\n };\n })\n .catch(() => {\n return {\n data: {},\n locale,\n };\n });\n })\n );\n\n return Promise.resolve(importedTrads);\n },\n};\n"],"names":["register","app","addMiddlewares","extendCTBAttributeInitialDataMiddleware","extendCTBInitialDataMiddleware","i18nApi","middleware","addReducers","reducerPath","reducer","addRBACMiddleware","localeMiddleware","registerPlugin","id","pluginId","name","bootstrap","registerHook","addColumnToTableHook","mutateEditViewHook","addLocaleToReleasesHook","addSettingsLink","intlLabel","getTranslation","defaultMessage","to","Component","then","mod","default","ProtectedSettingsPage","permissions","PERMISSIONS","accessMain","contentManager","getPlugin","apis","addDocumentHeaderAction","AITranslationStatusAction","LocalePickerAction","FillFromAnotherLocaleAction","addDocumentAction","actions","indexOfDeleteAction","findIndex","action","type","splice","DeleteLocaleAction","BulkLocalePublishAction","BulkLocaleUnpublishAction","injectComponent","LocalePicker","PublishModalAdditionalInfo","UnpublishModalAdditionalInfo","DeleteModalAdditionalInfo","ctbPlugin","ctbFormsAPI","forms","addContentTypeSchemaMutation","mutateCTBContentTypeSchema","components","add","component","CheckboxConfirmation","extendContentType","validator","i18n","yup","object","shape","localized","bool","form","advanced","description","extendFields","LOCALIZED_FIELDS","contentTypeSchema","forTarget","step","hasI18nEnabled","get","registerTrads","locales","importedTrads","Promise","all","map","locale","data","prefixPluginTranslations","catch","resolve"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCA;AACA,YAAe;AACbA,IAAAA,QAAAA,CAAAA,CAASC,GAAQ,EAAA;AACfA,QAAAA,GAAAA,CAAIC,cAAc,CAAC;AAACC,YAAAA,uCAAAA;AAAyCC,YAAAA;AAA+B,SAAA,CAAA;AAC5FH,QAAAA,GAAAA,CAAIC,cAAc,CAAC;AAAC,YAAA,IAAMG,QAAQC;AAAW,SAAA,CAAA;AAC7CL,QAAAA,GAAAA,CAAIM,WAAW,CAAC;AACd,YAAA,CAACF,OAAAA,CAAQG,WAAW,GAAGH,QAAQI;AACjC,SAAA,CAAA;AACAR,QAAAA,GAAAA,CAAIS,iBAAiB,CAAC;AAACC,YAAAA;AAAiB,SAAA,CAAA;AACxCV,QAAAA,GAAAA,CAAIW,cAAc,CAAC;YACjBC,EAAAA,EAAIC,QAAAA;YACJC,IAAAA,EAAMD;AACR,SAAA,CAAA;AACF,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xB,SAAAA,EAAW;AACTT,oCAAAA,EAAAA,EAAIU,cAAAA,CAAe,0CAAA,CAAA;oCACnBC,cAAAA,EAAgB;AAClB;AACF;AACD,yBAAA;AACH,oBAAA;AACF;AACF,aAAA,CAAA;AACF,QAAA;AACF,IAAA,CAAA;IACA,MAAM2D,aAAAA,CAAAA,CAAc,EAAEC,OAAO,EAAyB,EAAA;QACpD,MAAMC,aAAAA,GAAgB,MAAMC,OAAAA,CAAQC,GAAG,CACrCH,OAAAA,CAAQI,GAAG,CAAC,CAACC,MAAAA,GAAAA;AACX,YAAA,OAAO,iCAAM,CAAC,CAAC,eAAe,EAAEA,MAAAA,CAAO,KAAK,CAAC,CAAA,CAC1C9D,IAAI,CAAC,CAAC,EAAEE,OAAAA,EAAS6D,IAAI,EAAE,GAAA;gBACtB,OAAO;AACLA,oBAAAA,IAAAA,EAAMC,yBAAyBD,IAAAA,EAAM5E,QAAAA,CAAAA;AACrC2E,oBAAAA;AACF,iBAAA;AACF,YAAA,CAAA,CAAA,CACCG,KAAK,CAAC,IAAA;gBACL,OAAO;AACLF,oBAAAA,IAAAA,EAAM,EAAC;AACPD,oBAAAA;AACF,iBAAA;AACF,YAAA,CAAA,CAAA;AACJ,QAAA,CAAA,CAAA,CAAA;QAGF,OAAOH,OAAAA,CAAQO,OAAO,CAACR,aAAAA,CAAAA;AACzB,IAAA;AACF,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../admin/src/index.ts"],"sourcesContent":["import get from 'lodash/get';\nimport * as yup from 'yup';\n\nimport { CheckboxConfirmation } from './components/CheckboxConfirmation';\nimport {\n BulkLocalePublishAction,\n BulkLocaleUnpublishAction,\n DeleteLocaleAction,\n LocalePickerAction,\n FillFromAnotherLocaleAction,\n AITranslationStatusAction,\n} from './components/CMHeaderActions';\nimport {\n DeleteModalAdditionalInfo,\n PublishModalAdditionalInfo,\n UnpublishModalAdditionalInfo,\n} from './components/CMListViewModalsAdditionalInformation';\nimport { LocalePicker } from './components/LocalePicker';\nimport { PERMISSIONS } from './constants';\nimport { mutateEditViewHook } from './contentManagerHooks/editView';\nimport { addColumnToTableHook } from './contentManagerHooks/listView';\nimport { addLocaleToReleasesHook } from './contentReleasesHooks/releaseDetailsView';\nimport { extendCTBAttributeInitialDataMiddleware } from './middlewares/extendCTBAttributeInitialData';\nimport { extendCTBInitialDataMiddleware } from './middlewares/extendCTBInitialData';\nimport { localeMiddleware } from './middlewares/rbac-middleware';\nimport { pluginId } from './pluginId';\nimport { i18nApi } from './services/api';\nimport { LOCALIZED_FIELDS } from './utils/fields';\nimport { getTranslation } from './utils/getTranslation';\nimport { prefixPluginTranslations } from './utils/prefixPluginTranslations';\nimport { mutateCTBContentTypeSchema } from './utils/schemas';\n\nimport type { StrapiApp } from '@strapi/admin/strapi-admin';\nimport type {\n ContentManagerPlugin,\n DocumentActionComponent,\n HeaderActionComponent,\n} from '@strapi/content-manager/strapi-admin';\n\ntype ContentTypeBuilderFormsAPI = {\n addContentTypeSchemaMutation: (mutation: typeof mutateCTBContentTypeSchema) => void;\n components: {\n add: (component: { id: string; component: typeof CheckboxConfirmation }) => void;\n };\n extendContentType: (extension: {\n validator: () => Record<string, unknown>;\n form: {\n advanced: () => Array<Record<string, unknown>>;\n };\n }) => void;\n extendFields: (\n fields: typeof LOCALIZED_FIELDS,\n extension: {\n form: {\n advanced: (args: any) => Array<Record<string, unknown>>;\n };\n }\n ) => void;\n};\n\n// eslint-disable-next-line import/no-default-export\nexport default {\n register(app: StrapiApp) {\n app.addMiddlewares([extendCTBAttributeInitialDataMiddleware, extendCTBInitialDataMiddleware]);\n app.addMiddlewares([() => i18nApi.middleware]);\n app.addReducers({\n [i18nApi.reducerPath]: i18nApi.reducer,\n });\n app.addRBACMiddleware([localeMiddleware]);\n app.registerPlugin({\n id: pluginId,\n name: pluginId,\n });\n },\n bootstrap(app: StrapiApp) {\n // // Hook that adds a column into the CM's LV table\n app.registerHook('Admin/CM/pages/ListView/inject-column-in-table', addColumnToTableHook);\n app.registerHook('Admin/CM/pages/EditView/mutate-edit-view-layout', mutateEditViewHook);\n // Hooks that checks if the locale is present in the release\n app.registerHook(\n 'ContentReleases/pages/ReleaseDetails/add-locale-in-releases',\n addLocaleToReleasesHook\n );\n\n // Add the settings link\n app.addSettingsLink('global', {\n intlLabel: {\n id: getTranslation('plugin.name'),\n defaultMessage: 'Internationalization',\n },\n id: 'internationalization',\n to: 'internationalization',\n Component: () =>\n import('./pages/SettingsPage').then((mod) => ({ default: mod.ProtectedSettingsPage })),\n permissions: PERMISSIONS.accessMain,\n });\n\n const contentManager = app.getPlugin('content-manager');\n const contentManagerApis = contentManager.apis as ContentManagerPlugin['config']['apis'];\n\n contentManagerApis.addDocumentHeaderAction([\n AITranslationStatusAction,\n LocalePickerAction,\n FillFromAnotherLocaleAction,\n ] as HeaderActionComponent[]);\n contentManagerApis.addDocumentAction((actions: DocumentActionComponent[]) => {\n const indexOfDeleteAction = actions.findIndex((action) => action.type === 'delete');\n actions.splice(indexOfDeleteAction, 0, DeleteLocaleAction);\n return actions;\n });\n\n contentManagerApis.addDocumentAction((actions: DocumentActionComponent[]) => {\n // When enabled the bulk locale publish action should be the first action\n // in 'More Document Actions' and therefore the third action in the array\n actions.splice(2, 0, BulkLocalePublishAction);\n actions.splice(5, 0, BulkLocaleUnpublishAction);\n return actions;\n });\n\n contentManager.injectComponent('listView', 'actions', {\n name: 'i18n-locale-filter',\n Component: LocalePicker,\n });\n\n contentManager.injectComponent('listView', 'publishModalAdditionalInfos', {\n name: 'i18n-publish-bullets-in-modal',\n Component: PublishModalAdditionalInfo,\n });\n\n contentManager.injectComponent('listView', 'unpublishModalAdditionalInfos', {\n name: 'i18n-unpublish-bullets-in-modal',\n Component: UnpublishModalAdditionalInfo,\n });\n\n contentManager.injectComponent('listView', 'deleteModalAdditionalInfos', {\n name: 'i18n-delete-bullets-in-modal',\n Component: DeleteModalAdditionalInfo,\n });\n\n const ctbPlugin = app.getPlugin('content-type-builder');\n\n if (ctbPlugin) {\n const ctbFormsAPI = ctbPlugin.apis.forms as ContentTypeBuilderFormsAPI;\n ctbFormsAPI.addContentTypeSchemaMutation(mutateCTBContentTypeSchema);\n ctbFormsAPI.components.add({ id: 'checkboxConfirmation', component: CheckboxConfirmation });\n\n ctbFormsAPI.extendContentType({\n validator: () => ({\n i18n: yup.object().shape({\n localized: yup.bool(),\n }),\n }),\n form: {\n advanced() {\n return [\n {\n name: 'pluginOptions.i18n.localized',\n description: {\n id: getTranslation('plugin.schema.i18n.localized.description-content-type'),\n defaultMessage: 'Allows translating an entry into different languages',\n },\n type: 'checkboxConfirmation',\n intlLabel: {\n id: getTranslation('plugin.schema.i18n.localized.label-content-type'),\n defaultMessage: 'Localization',\n },\n },\n ];\n },\n },\n });\n\n ctbFormsAPI.extendFields(LOCALIZED_FIELDS, {\n form: {\n advanced({ contentTypeSchema, forTarget, type, step }: any) {\n if (forTarget !== 'contentType') {\n return [];\n }\n\n const hasI18nEnabled = get(\n contentTypeSchema,\n ['pluginOptions', 'i18n', 'localized'],\n false\n );\n\n if (!hasI18nEnabled) {\n return [];\n }\n\n if (type === 'component' && step === '1') {\n return [];\n }\n\n return [\n {\n name: 'pluginOptions.i18n.localized',\n description: {\n id: getTranslation('plugin.schema.i18n.localized.description-field'),\n defaultMessage: 'The field can have different values in each locale',\n },\n type: 'checkbox',\n intlLabel: {\n id: getTranslation('plugin.schema.i18n.localized.label-field'),\n defaultMessage: 'Enable localization for this field',\n },\n },\n ];\n },\n },\n });\n }\n },\n async registerTrads({ locales }: { locales: string[] }) {\n const importedTrads = await Promise.all(\n locales.map((locale) => {\n return import(`./translations/${locale}.json`)\n .then(({ default: data }) => {\n return {\n data: prefixPluginTranslations(data, pluginId),\n locale,\n };\n })\n .catch(() => {\n return {\n data: {},\n locale,\n };\n });\n })\n );\n\n return Promise.resolve(importedTrads);\n },\n};\n"],"names":["register","app","addMiddlewares","extendCTBAttributeInitialDataMiddleware","extendCTBInitialDataMiddleware","i18nApi","middleware","addReducers","reducerPath","reducer","addRBACMiddleware","localeMiddleware","registerPlugin","id","pluginId","name","bootstrap","registerHook","addColumnToTableHook","mutateEditViewHook","addLocaleToReleasesHook","addSettingsLink","intlLabel","getTranslation","defaultMessage","to","Component","then","mod","default","ProtectedSettingsPage","permissions","PERMISSIONS","accessMain","contentManager","getPlugin","contentManagerApis","apis","addDocumentHeaderAction","AITranslationStatusAction","LocalePickerAction","FillFromAnotherLocaleAction","addDocumentAction","actions","indexOfDeleteAction","findIndex","action","type","splice","DeleteLocaleAction","BulkLocalePublishAction","BulkLocaleUnpublishAction","injectComponent","LocalePicker","PublishModalAdditionalInfo","UnpublishModalAdditionalInfo","DeleteModalAdditionalInfo","ctbPlugin","ctbFormsAPI","forms","addContentTypeSchemaMutation","mutateCTBContentTypeSchema","components","add","component","CheckboxConfirmation","extendContentType","validator","i18n","yup","object","shape","localized","bool","form","advanced","description","extendFields","LOCALIZED_FIELDS","contentTypeSchema","forTarget","step","hasI18nEnabled","get","registerTrads","locales","importedTrads","Promise","all","map","locale","data","prefixPluginTranslations","catch","resolve"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DA;AACA,YAAe;AACbA,IAAAA,QAAAA,CAAAA,CAASC,GAAc,EAAA;AACrBA,QAAAA,GAAAA,CAAIC,cAAc,CAAC;AAACC,YAAAA,uCAAAA;AAAyCC,YAAAA;AAA+B,SAAA,CAAA;AAC5FH,QAAAA,GAAAA,CAAIC,cAAc,CAAC;AAAC,YAAA,IAAMG,QAAQC;AAAW,SAAA,CAAA;AAC7CL,QAAAA,GAAAA,CAAIM,WAAW,CAAC;AACd,YAAA,CAACF,OAAAA,CAAQG,WAAW,GAAGH,QAAQI;AACjC,SAAA,CAAA;AACAR,QAAAA,GAAAA,CAAIS,iBAAiB,CAAC;AAACC,YAAAA;AAAiB,SAAA,CAAA;AACxCV,QAAAA,GAAAA,CAAIW,cAAc,CAAC;YACjBC,EAAAA,EAAIC,QAAA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iCAAA;gCACAuB,IAAAA,EAAM,UAAA;gCACNzB,SAAAA,EAAW;AACTT,oCAAAA,EAAAA,EAAIU,cAAAA,CAAe,0CAAA,CAAA;oCACnBC,cAAAA,EAAgB;AAClB;AACF;AACD,yBAAA;AACH,oBAAA;AACF;AACF,aAAA,CAAA;AACF,QAAA;AACF,IAAA,CAAA;IACA,MAAM4D,aAAAA,CAAAA,CAAc,EAAEC,OAAO,EAAyB,EAAA;QACpD,MAAMC,aAAAA,GAAgB,MAAMC,OAAAA,CAAQC,GAAG,CACrCH,OAAAA,CAAQI,GAAG,CAAC,CAACC,MAAAA,GAAAA;AACX,YAAA,OAAO,iCAAM,CAAC,CAAC,eAAe,EAAEA,MAAAA,CAAO,KAAK,CAAC,CAAA,CAC1C/D,IAAI,CAAC,CAAC,EAAEE,OAAAA,EAAS8D,IAAI,EAAE,GAAA;gBACtB,OAAO;AACLA,oBAAAA,IAAAA,EAAMC,yBAAyBD,IAAAA,EAAM7E,QAAAA,CAAAA;AACrC4E,oBAAAA;AACF,iBAAA;AACF,YAAA,CAAA,CAAA,CACCG,KAAK,CAAC,IAAA;gBACL,OAAO;AACLF,oBAAAA,IAAAA,EAAM,EAAC;AACPD,oBAAAA;AACF,iBAAA;AACF,YAAA,CAAA,CAAA;AACJ,QAAA,CAAA,CAAA,CAAA;QAGF,OAAOH,OAAAA,CAAQO,OAAO,CAACR,aAAAA,CAAAA;AACzB,IAAA;AACF,CAAA;;;;"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import type { StrapiApp } from '@strapi/admin/strapi-admin';
|
|
1
2
|
declare const _default: {
|
|
2
|
-
register(app:
|
|
3
|
-
bootstrap(app:
|
|
3
|
+
register(app: StrapiApp): void;
|
|
4
|
+
bootstrap(app: StrapiApp): void;
|
|
4
5
|
registerTrads({ locales }: {
|
|
5
6
|
locales: string[];
|
|
6
7
|
}): Promise<({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@strapi/i18n",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.45.1",
|
|
4
4
|
"description": "Create read and update content in different languages, both from the Admin Panel and from the API",
|
|
5
5
|
"homepage": "https://strapi.io",
|
|
6
6
|
"bugs": {
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
"@reduxjs/toolkit": "1.9.7",
|
|
64
64
|
"@strapi/design-system": "2.2.0",
|
|
65
65
|
"@strapi/icons": "2.2.0",
|
|
66
|
-
"@strapi/utils": "5.
|
|
66
|
+
"@strapi/utils": "5.45.1",
|
|
67
67
|
"lodash": "4.18.1",
|
|
68
68
|
"qs": "6.15.0",
|
|
69
69
|
"react-intl": "6.6.2",
|
|
@@ -72,11 +72,11 @@
|
|
|
72
72
|
"zod": "3.25.67"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@strapi/admin": "5.
|
|
76
|
-
"@strapi/admin-test-utils": "5.
|
|
77
|
-
"@strapi/content-manager": "5.
|
|
78
|
-
"@strapi/database": "5.
|
|
79
|
-
"@strapi/types": "5.
|
|
75
|
+
"@strapi/admin": "5.45.1",
|
|
76
|
+
"@strapi/admin-test-utils": "5.45.1",
|
|
77
|
+
"@strapi/content-manager": "5.45.1",
|
|
78
|
+
"@strapi/database": "5.45.1",
|
|
79
|
+
"@strapi/types": "5.45.1",
|
|
80
80
|
"@testing-library/react": "16.3.0",
|
|
81
81
|
"@testing-library/user-event": "14.6.1",
|
|
82
82
|
"koa": "2.16.4",
|