@strapi/i18n 0.0.0-next.990615b2ed4dd2f0589b4fda91418246d7b9450e → 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.
Files changed (193) hide show
  1. package/dist/admin/components/CMHeaderActions.js +240 -4
  2. package/dist/admin/components/CMHeaderActions.js.map +1 -1
  3. package/dist/admin/components/CMHeaderActions.mjs +244 -9
  4. package/dist/admin/components/CMHeaderActions.mjs.map +1 -1
  5. package/dist/admin/components/CreateLocale.js +1 -1
  6. package/dist/admin/components/CreateLocale.js.map +1 -1
  7. package/dist/admin/components/CreateLocale.mjs +1 -1
  8. package/dist/admin/components/CreateLocale.mjs.map +1 -1
  9. package/dist/admin/components/EditLocale.js +1 -1
  10. package/dist/admin/components/EditLocale.js.map +1 -1
  11. package/dist/admin/components/EditLocale.mjs +1 -1
  12. package/dist/admin/components/EditLocale.mjs.map +1 -1
  13. package/dist/admin/components/LocaleListCell.js +65 -45
  14. package/dist/admin/components/LocaleListCell.js.map +1 -1
  15. package/dist/admin/components/LocaleListCell.mjs +66 -46
  16. package/dist/admin/components/LocaleListCell.mjs.map +1 -1
  17. package/dist/admin/components/LocalePicker.js +18 -11
  18. package/dist/admin/components/LocalePicker.js.map +1 -1
  19. package/dist/admin/components/LocalePicker.mjs +19 -12
  20. package/dist/admin/components/LocalePicker.mjs.map +1 -1
  21. package/dist/admin/contentManagerHooks/editView.js +6 -3
  22. package/dist/admin/contentManagerHooks/editView.js.map +1 -1
  23. package/dist/admin/contentManagerHooks/editView.mjs +7 -4
  24. package/dist/admin/contentManagerHooks/editView.mjs.map +1 -1
  25. package/dist/admin/contentManagerHooks/listView.js +2 -1
  26. package/dist/admin/contentManagerHooks/listView.js.map +1 -1
  27. package/dist/admin/contentManagerHooks/listView.mjs +2 -1
  28. package/dist/admin/contentManagerHooks/listView.mjs.map +1 -1
  29. package/dist/admin/hooks/useAILocalizationJobsPolling.js +110 -0
  30. package/dist/admin/hooks/useAILocalizationJobsPolling.js.map +1 -0
  31. package/dist/admin/hooks/useAILocalizationJobsPolling.mjs +89 -0
  32. package/dist/admin/hooks/useAILocalizationJobsPolling.mjs.map +1 -0
  33. package/dist/admin/hooks/useI18n.js +4 -4
  34. package/dist/admin/hooks/useI18n.js.map +1 -1
  35. package/dist/admin/hooks/useI18n.mjs +4 -4
  36. package/dist/admin/hooks/useI18n.mjs.map +1 -1
  37. package/dist/admin/index.js +1 -1
  38. package/dist/admin/index.js.map +1 -1
  39. package/dist/admin/index.mjs +2 -2
  40. package/dist/admin/index.mjs.map +1 -1
  41. package/dist/admin/middlewares/extendCTBAttributeInitialData.js +34 -24
  42. package/dist/admin/middlewares/extendCTBAttributeInitialData.js.map +1 -1
  43. package/dist/admin/middlewares/extendCTBAttributeInitialData.mjs +34 -24
  44. package/dist/admin/middlewares/extendCTBAttributeInitialData.mjs.map +1 -1
  45. package/dist/admin/pages/SettingsPage.js +121 -46
  46. package/dist/admin/pages/SettingsPage.js.map +1 -1
  47. package/dist/admin/pages/SettingsPage.mjs +124 -30
  48. package/dist/admin/pages/SettingsPage.mjs.map +1 -1
  49. package/dist/admin/services/aiLocalizationJobs.js +26 -0
  50. package/dist/admin/services/aiLocalizationJobs.js.map +1 -0
  51. package/dist/admin/services/aiLocalizationJobs.mjs +24 -0
  52. package/dist/admin/services/aiLocalizationJobs.mjs.map +1 -0
  53. package/dist/admin/services/api.js +4 -1
  54. package/dist/admin/services/api.js.map +1 -1
  55. package/dist/admin/services/api.mjs +4 -1
  56. package/dist/admin/services/api.mjs.map +1 -1
  57. package/dist/admin/services/locales.js +4 -2
  58. package/dist/admin/services/locales.js.map +1 -1
  59. package/dist/admin/services/locales.mjs +4 -2
  60. package/dist/admin/services/locales.mjs.map +1 -1
  61. package/dist/admin/services/settings.js +29 -0
  62. package/dist/admin/services/settings.js.map +1 -0
  63. package/dist/admin/services/settings.mjs +26 -0
  64. package/dist/admin/services/settings.mjs.map +1 -0
  65. package/dist/admin/src/components/CMHeaderActions.d.ts +17 -4
  66. package/dist/admin/src/components/LocaleListCell.d.ts +2 -1
  67. package/dist/admin/src/hooks/useAILocalizationJobsPolling.d.ts +9 -0
  68. package/dist/admin/src/services/aiLocalizationJobs.d.ts +6 -0
  69. package/dist/admin/src/services/api.d.ts +1 -1
  70. package/dist/admin/src/services/locales.d.ts +1 -1
  71. package/dist/admin/src/services/relations.d.ts +1 -1
  72. package/dist/admin/src/services/settings.d.ts +5 -0
  73. package/dist/admin/src/utils/schemas.d.ts +642 -16
  74. package/dist/admin/translations/en.json.js +10 -0
  75. package/dist/admin/translations/en.json.js.map +1 -1
  76. package/dist/admin/translations/en.json.mjs +10 -0
  77. package/dist/admin/translations/en.json.mjs.map +1 -1
  78. package/dist/admin/utils/clean.js +2 -2
  79. package/dist/admin/utils/clean.js.map +1 -1
  80. package/dist/admin/utils/clean.mjs +2 -2
  81. package/dist/admin/utils/clean.mjs.map +1 -1
  82. package/dist/admin/utils/fields.js +6 -1
  83. package/dist/admin/utils/fields.js.map +1 -1
  84. package/dist/admin/utils/fields.mjs +6 -1
  85. package/dist/admin/utils/fields.mjs.map +1 -1
  86. package/dist/admin/utils/schemas.js +19 -13
  87. package/dist/admin/utils/schemas.js.map +1 -1
  88. package/dist/admin/utils/schemas.mjs +19 -13
  89. package/dist/admin/utils/schemas.mjs.map +1 -1
  90. package/dist/server/bootstrap.js +2 -0
  91. package/dist/server/bootstrap.js.map +1 -1
  92. package/dist/server/bootstrap.mjs +2 -0
  93. package/dist/server/bootstrap.mjs.map +1 -1
  94. package/dist/server/constants/iso-locales.json.js +4 -0
  95. package/dist/server/constants/iso-locales.json.js.map +1 -1
  96. package/dist/server/constants/iso-locales.json.mjs +4 -0
  97. package/dist/server/constants/iso-locales.json.mjs.map +1 -1
  98. package/dist/server/controllers/ai-localization-jobs.js +47 -0
  99. package/dist/server/controllers/ai-localization-jobs.js.map +1 -0
  100. package/dist/server/controllers/ai-localization-jobs.mjs +45 -0
  101. package/dist/server/controllers/ai-localization-jobs.mjs.map +1 -0
  102. package/dist/server/controllers/index.js +5 -1
  103. package/dist/server/controllers/index.js.map +1 -1
  104. package/dist/server/controllers/index.mjs +5 -1
  105. package/dist/server/controllers/index.mjs.map +1 -1
  106. package/dist/server/controllers/settings.js +24 -0
  107. package/dist/server/controllers/settings.js.map +1 -0
  108. package/dist/server/controllers/settings.mjs +22 -0
  109. package/dist/server/controllers/settings.mjs.map +1 -0
  110. package/dist/server/models/ai-localization-job.js +60 -0
  111. package/dist/server/models/ai-localization-job.js.map +1 -0
  112. package/dist/server/models/ai-localization-job.mjs +57 -0
  113. package/dist/server/models/ai-localization-job.mjs.map +1 -0
  114. package/dist/server/register.js +3 -1
  115. package/dist/server/register.js.map +1 -1
  116. package/dist/server/register.mjs +3 -1
  117. package/dist/server/register.mjs.map +1 -1
  118. package/dist/server/routes/admin.js +40 -0
  119. package/dist/server/routes/admin.js.map +1 -1
  120. package/dist/server/routes/admin.mjs +40 -0
  121. package/dist/server/routes/admin.mjs.map +1 -1
  122. package/dist/server/routes/content-api.js +11 -7
  123. package/dist/server/routes/content-api.js.map +1 -1
  124. package/dist/server/routes/content-api.mjs +11 -7
  125. package/dist/server/routes/content-api.mjs.map +1 -1
  126. package/dist/server/routes/index.mjs +2 -2
  127. package/dist/server/routes/validation/locale.js +57 -0
  128. package/dist/server/routes/validation/locale.js.map +1 -0
  129. package/dist/server/routes/validation/locale.mjs +36 -0
  130. package/dist/server/routes/validation/locale.mjs.map +1 -0
  131. package/dist/server/services/ai-localization-jobs.js +64 -0
  132. package/dist/server/services/ai-localization-jobs.js.map +1 -0
  133. package/dist/server/services/ai-localization-jobs.mjs +62 -0
  134. package/dist/server/services/ai-localization-jobs.mjs.map +1 -0
  135. package/dist/server/services/ai-localizations.js +272 -0
  136. package/dist/server/services/ai-localizations.js.map +1 -0
  137. package/dist/server/services/ai-localizations.mjs +270 -0
  138. package/dist/server/services/ai-localizations.mjs.map +1 -0
  139. package/dist/server/services/index.js +7 -1
  140. package/dist/server/services/index.js.map +1 -1
  141. package/dist/server/services/index.mjs +7 -1
  142. package/dist/server/services/index.mjs.map +1 -1
  143. package/dist/server/services/settings.js +25 -0
  144. package/dist/server/services/settings.js.map +1 -0
  145. package/dist/server/services/settings.mjs +23 -0
  146. package/dist/server/services/settings.mjs.map +1 -0
  147. package/dist/server/src/bootstrap.d.ts.map +1 -1
  148. package/dist/server/src/controllers/ai-localization-jobs.d.ts +17 -0
  149. package/dist/server/src/controllers/ai-localization-jobs.d.ts.map +1 -0
  150. package/dist/server/src/controllers/index.d.ts +10 -0
  151. package/dist/server/src/controllers/index.d.ts.map +1 -1
  152. package/dist/server/src/controllers/settings.d.ts +7 -0
  153. package/dist/server/src/controllers/settings.d.ts.map +1 -0
  154. package/dist/server/src/index.d.ts +47 -8
  155. package/dist/server/src/index.d.ts.map +1 -1
  156. package/dist/server/src/models/ai-localization-job.d.ts +5 -0
  157. package/dist/server/src/models/ai-localization-job.d.ts.map +1 -0
  158. package/dist/server/src/models/index.d.ts +5 -0
  159. package/dist/server/src/models/index.d.ts.map +1 -0
  160. package/dist/server/src/register.d.ts +1 -1
  161. package/dist/server/src/register.d.ts.map +1 -1
  162. package/dist/server/src/routes/admin.d.ts.map +1 -1
  163. package/dist/server/src/routes/content-api.d.ts +5 -8
  164. package/dist/server/src/routes/content-api.d.ts.map +1 -1
  165. package/dist/server/src/routes/index.d.ts +3 -7
  166. package/dist/server/src/routes/index.d.ts.map +1 -1
  167. package/dist/server/src/routes/validation/index.d.ts +2 -0
  168. package/dist/server/src/routes/validation/index.d.ts.map +1 -0
  169. package/dist/server/src/routes/validation/locale.d.ts +41 -0
  170. package/dist/server/src/routes/validation/locale.d.ts.map +1 -0
  171. package/dist/server/src/services/ai-localization-jobs.d.ts +26 -0
  172. package/dist/server/src/services/ai-localization-jobs.d.ts.map +1 -0
  173. package/dist/server/src/services/ai-localizations.d.ts +18 -0
  174. package/dist/server/src/services/ai-localizations.d.ts.map +1 -0
  175. package/dist/server/src/services/index.d.ts +33 -0
  176. package/dist/server/src/services/index.d.ts.map +1 -1
  177. package/dist/server/src/services/settings.d.ts +13 -0
  178. package/dist/server/src/services/settings.d.ts.map +1 -0
  179. package/dist/server/src/utils/index.d.ts +7 -1
  180. package/dist/server/src/utils/index.d.ts.map +1 -1
  181. package/dist/server/src/validation/settings.d.ts +12 -0
  182. package/dist/server/src/validation/settings.d.ts.map +1 -0
  183. package/dist/server/utils/index.js.map +1 -1
  184. package/dist/server/utils/index.mjs.map +1 -1
  185. package/dist/server/validation/settings.js +11 -0
  186. package/dist/server/validation/settings.js.map +1 -0
  187. package/dist/server/validation/settings.mjs +9 -0
  188. package/dist/server/validation/settings.mjs.map +1 -0
  189. package/dist/shared/contracts/ai-localization-jobs.d.ts +27 -0
  190. package/dist/shared/contracts/ai-localization-jobs.d.ts.map +1 -0
  191. package/dist/shared/contracts/settings.d.ts +40 -0
  192. package/dist/shared/contracts/shared.d.ts.map +1 -0
  193. package/package.json +12 -9
@@ -4,15 +4,19 @@ var jsxRuntime = require('react/jsx-runtime');
4
4
  var React = require('react');
5
5
  var query = require('@reduxjs/toolkit/query');
6
6
  var strapiAdmin = require('@strapi/admin/strapi-admin');
7
+ var ee = require('@strapi/admin/strapi-admin/ee');
7
8
  var strapiAdmin$1 = require('@strapi/content-manager/strapi-admin');
8
9
  var designSystem = require('@strapi/design-system');
9
10
  var icons = require('@strapi/icons');
10
11
  var reactIntl = require('react-intl');
11
12
  var reactRouterDom = require('react-router-dom');
12
13
  var styledComponents = require('styled-components');
14
+ var useAILocalizationJobsPolling = require('../hooks/useAILocalizationJobsPolling.js');
13
15
  var useI18n = require('../hooks/useI18n.js');
16
+ var aiLocalizationJobs = require('../services/aiLocalizationJobs.js');
14
17
  var locales = require('../services/locales.js');
15
18
  var relations = require('../services/relations.js');
19
+ var settings = require('../services/settings.js');
16
20
  var clean = require('../utils/clean.js');
17
21
  var getTranslation = require('../utils/getTranslation.js');
18
22
  var strings = require('../utils/strings.js');
@@ -81,6 +85,18 @@ const LocaleOption = ({ isDraftAndPublishEnabled, locale, status, entryExists })
81
85
  ]
82
86
  });
83
87
  };
88
+ const LocaleOptionStartIcon = ({ entryWithLocaleExists, translationStatus, index })=>{
89
+ const isAiAvailable = ee.useAIAvailability();
90
+ if (!entryWithLocaleExists) {
91
+ return /*#__PURE__*/ jsxRuntime.jsx(icons.Plus, {});
92
+ }
93
+ if (isAiAvailable && index !== 0 && translationStatus === 'failed') {
94
+ return /*#__PURE__*/ jsxRuntime.jsx(icons.WarningCircle, {
95
+ fill: "warning600"
96
+ });
97
+ }
98
+ return null;
99
+ };
84
100
  const LocalePickerAction = ({ document, meta, model, collectionType, documentId })=>{
85
101
  const { formatMessage } = reactIntl.useIntl();
86
102
  const [{ query }, setQuery] = strapiAdmin.useQueryParams();
@@ -95,6 +111,14 @@ const LocalePickerAction = ({ document, meta, model, collectionType, documentId
95
111
  locale: currentDesiredLocale
96
112
  }
97
113
  });
114
+ const { data: jobData } = aiLocalizationJobs.useGetAILocalizationJobsByDocumentQuery({
115
+ documentId: documentId,
116
+ model: model,
117
+ collectionType: collectionType
118
+ });
119
+ const { data: settings$1 } = settings.useGetSettingsQuery();
120
+ const isAiAvailable = ee.useAIAvailability();
121
+ const setValues = strapiAdmin.useForm('LocalePickerAction', (state)=>state.setValues);
98
122
  const handleSelect = React__namespace.useCallback((value)=>{
99
123
  setQuery({
100
124
  plugins: {
@@ -108,6 +132,51 @@ const LocalePickerAction = ({ document, meta, model, collectionType, documentId
108
132
  query.plugins,
109
133
  setQuery
110
134
  ]);
135
+ const nonTranslatedFields = React__namespace.useMemo(()=>{
136
+ if (!schema?.attributes) return [];
137
+ return Object.keys(schema.attributes).filter((field)=>{
138
+ const attribute = schema.attributes[field];
139
+ return attribute?.pluginOptions?.i18n?.localized === false;
140
+ });
141
+ }, [
142
+ schema?.attributes
143
+ ]);
144
+ const sourceLocaleData = React__namespace.useMemo(()=>{
145
+ if (!Array.isArray(locales$1) || !meta?.availableLocales) return null;
146
+ const defaultLocale = locales$1.find((locale)=>locale.isDefault);
147
+ const existingLocales = meta.availableLocales.map((loc)=>loc.locale);
148
+ const sourceLocaleCode = defaultLocale && existingLocales.includes(defaultLocale.code) && defaultLocale.code !== currentDesiredLocale ? defaultLocale.code : existingLocales.find((locale)=>locale !== currentDesiredLocale);
149
+ if (!sourceLocaleCode) return null;
150
+ // Find the document data from availableLocales (now includes non-translatable fields)
151
+ const sourceLocaleDoc = meta.availableLocales.find((loc)=>loc.locale === sourceLocaleCode);
152
+ return sourceLocaleDoc ? {
153
+ locale: sourceLocaleCode,
154
+ data: sourceLocaleDoc
155
+ } : null;
156
+ }, [
157
+ locales$1,
158
+ meta?.availableLocales,
159
+ currentDesiredLocale
160
+ ]);
161
+ /**
162
+ * Prefilling form with non-translatable fields from already existing locale
163
+ */ React__namespace.useEffect(()=>{
164
+ // Only run when creating a new locale (no document ID yet) and when we have non-translatable fields
165
+ if (!document?.id && nonTranslatedFields.length > 0 && sourceLocaleData?.data) {
166
+ const dataToSet = nonTranslatedFields.reduce((acc, field)=>{
167
+ acc[field] = sourceLocaleData.data[field];
168
+ return acc;
169
+ }, {});
170
+ if (Object.keys(dataToSet).length > 0) {
171
+ setValues(dataToSet);
172
+ }
173
+ }
174
+ }, [
175
+ document?.id,
176
+ nonTranslatedFields,
177
+ sourceLocaleData?.data,
178
+ setValues
179
+ ]);
111
180
  React__namespace.useEffect(()=>{
112
181
  if (!Array.isArray(locales$1) || !hasI18n) {
113
182
  return;
@@ -127,12 +196,18 @@ const LocalePickerAction = ({ document, meta, model, collectionType, documentId
127
196
  currentDesiredLocale
128
197
  ]);
129
198
  const currentLocale = Array.isArray(locales$1) ? locales$1.find((locale)=>locale.code === currentDesiredLocale) : undefined;
199
+ // Use meta.availableLocales instead of document.localizations
200
+ // meta.availableLocales contains all locales for the document, even when creating new locales
201
+ const availableLocales = meta?.availableLocales ?? [];
202
+ const documentLocalizations = document?.localizations ?? [];
203
+ // Prefer meta.availableLocales as it's more reliable, fallback to document.localizations
204
+ const allLocalizations = availableLocales.length > 0 ? availableLocales : documentLocalizations;
130
205
  const allCurrentLocales = [
131
206
  {
132
207
  status: getDocumentStatus(document, meta),
133
208
  locale: currentLocale?.code
134
209
  },
135
- ...document?.localizations ?? []
210
+ ...allLocalizations
136
211
  ];
137
212
  if (!hasI18n || !Array.isArray(locales$1) || locales$1.length === 0) {
138
213
  return null;
@@ -148,10 +223,46 @@ const LocalePickerAction = ({ document, meta, model, collectionType, documentId
148
223
  id: getTranslation.getTranslation('Settings.locales.modal.locales.label'),
149
224
  defaultMessage: 'Locales'
150
225
  }),
151
- options: displayedLocales.map((locale)=>{
226
+ options: displayedLocales.map((locale, index)=>{
152
227
  const entryWithLocaleExists = allCurrentLocales.some((doc)=>doc.locale === locale.code);
153
228
  const currentLocaleDoc = allCurrentLocales.find((doc)=>'locale' in doc ? doc.locale === locale.code : false);
154
229
  const permissionsToCheck = currentLocaleDoc ? canRead : canCreate;
230
+ if (window.strapi.future.isEnabled('unstableAILocalizations') && isAiAvailable && settings$1?.data?.aiLocalizations) {
231
+ return {
232
+ _render: ()=>/*#__PURE__*/ jsxRuntime.jsxs(React__namespace.Fragment, {
233
+ children: [
234
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.SingleSelectOption, {
235
+ disabled: !permissionsToCheck.includes(locale.code),
236
+ startIcon: /*#__PURE__*/ jsxRuntime.jsx(LocaleOptionStartIcon, {
237
+ entryWithLocaleExists: entryWithLocaleExists,
238
+ translationStatus: jobData?.data?.status,
239
+ index: index
240
+ }),
241
+ value: locale.code,
242
+ children: /*#__PURE__*/ jsxRuntime.jsx(LocaleOption, {
243
+ isDraftAndPublishEnabled: !!schema?.options?.draftAndPublish,
244
+ locale: locale,
245
+ status: currentLocaleDoc?.status,
246
+ entryExists: entryWithLocaleExists
247
+ })
248
+ }, locale.code),
249
+ index === 0 && /*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
250
+ paddingRight: 4,
251
+ paddingLeft: 4,
252
+ paddingTop: 2,
253
+ paddingBottom: 2,
254
+ children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
255
+ variant: "sigma",
256
+ children: formatMessage({
257
+ id: getTranslation.getTranslation('CMEditViewLocalePicker.locale.ai-translations'),
258
+ defaultMessage: 'AI Translations'
259
+ })
260
+ })
261
+ })
262
+ ]
263
+ }, index)
264
+ };
265
+ }
155
266
  return {
156
267
  disabled: !permissionsToCheck.includes(locale.code),
157
268
  value: locale.code,
@@ -159,9 +270,12 @@ const LocalePickerAction = ({ document, meta, model, collectionType, documentId
159
270
  isDraftAndPublishEnabled: !!schema?.options?.draftAndPublish,
160
271
  locale: locale,
161
272
  status: currentLocaleDoc?.status,
162
- entryExists: entryWithLocaleExists
273
+ entryExists: entryWithLocaleExists,
274
+ translationStatus: jobData?.data?.status
163
275
  }),
164
- startIcon: !entryWithLocaleExists ? /*#__PURE__*/ jsxRuntime.jsx(icons.Plus, {}) : null
276
+ startIcon: /*#__PURE__*/ jsxRuntime.jsx(LocaleOptionStartIcon, {
277
+ entryWithLocaleExists: entryWithLocaleExists
278
+ })
165
279
  };
166
280
  }),
167
281
  customizeContent: ()=>currentLocale?.name,
@@ -184,6 +298,119 @@ const getDocumentStatus = (document, meta)=>{
184
298
  }
185
299
  return docStatus;
186
300
  };
301
+ /* -------------------------------------------------------------------------------------------------
302
+ * AISettingsStatusAction
303
+ * -----------------------------------------------------------------------------------------------*/ const AITranslationStatusIcon = styledComponents.styled(designSystem.Status)`
304
+ display: flex;
305
+ gap: ${({ theme })=>theme.spaces[1]};
306
+ justify-content: center;
307
+ align-items: center;
308
+ height: 100%;
309
+
310
+ // Disabled state
311
+ ${({ $isAISettingEnabled, theme })=>!$isAISettingEnabled && `
312
+ background-color: ${theme.colors.neutral150};
313
+ `}
314
+
315
+ svg {
316
+ ${({ $isAISettingEnabled, theme })=>!$isAISettingEnabled && `
317
+ fill: ${theme.colors.neutral300};
318
+ `}
319
+ }
320
+ `;
321
+ const AITranslationStatusAction = ({ documentId, model, collectionType })=>{
322
+ const { formatMessage } = reactIntl.useIntl();
323
+ const isAIAvailable = ee.useAIAvailability();
324
+ const { data: settings$1 } = settings.useGetSettingsQuery();
325
+ const isAISettingEnabled = settings$1?.data?.aiLocalizations;
326
+ const { hasI18n } = useI18n.useI18n();
327
+ // Poll for AI localizations jobs when AI is enabled and we have a documentId
328
+ const { status } = useAILocalizationJobsPolling.useAILocalizationJobsPolling({
329
+ documentId,
330
+ model,
331
+ collectionType
332
+ });
333
+ const statusVariant = (()=>{
334
+ if (status === 'failed') {
335
+ return 'warning';
336
+ }
337
+ if (isAISettingEnabled) {
338
+ return 'alternative';
339
+ }
340
+ return 'neutral';
341
+ })();
342
+ // Do not display this action when i18n is not available
343
+ if (!hasI18n) {
344
+ return null;
345
+ }
346
+ // Do not display this action when AI is not available
347
+ const hasAIFutureFlag = window.strapi.future.isEnabled('unstableAILocalizations');
348
+ if (!isAIAvailable || !hasAIFutureFlag) {
349
+ return null;
350
+ }
351
+ return {
352
+ _status: {
353
+ message: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Box, {
354
+ height: "100%",
355
+ "aria-label": formatMessage({
356
+ id: getTranslation.getTranslation('CMEditViewAITranslation.status-aria-label'),
357
+ defaultMessage: 'AI Translation Status'
358
+ }),
359
+ children: /*#__PURE__*/ jsxRuntime.jsx(AITranslationStatusIcon, {
360
+ $isAISettingEnabled: Boolean(isAISettingEnabled),
361
+ variant: statusVariant,
362
+ size: "S",
363
+ children: /*#__PURE__*/ jsxRuntime.jsx(icons.Sparkle, {})
364
+ })
365
+ }),
366
+ tooltip: /*#__PURE__*/ jsxRuntime.jsxs(designSystem.Flex, {
367
+ direction: "column",
368
+ padding: 4,
369
+ alignItems: "flex-start",
370
+ width: "25rem",
371
+ children: [
372
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
373
+ variant: "pi",
374
+ fontWeight: "600",
375
+ children: formatMessage({
376
+ id: getTranslation.getTranslation('CMEditViewAITranslation.status-title'),
377
+ defaultMessage: '{enabled, select, true {AI translation enabled} false {AI translation disabled} other {AI translation disabled}}'
378
+ }, {
379
+ enabled: isAISettingEnabled
380
+ })
381
+ }),
382
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
383
+ variant: "pi",
384
+ paddingTop: 1,
385
+ paddingBottom: 3,
386
+ children: formatMessage({
387
+ id: getTranslation.getTranslation('CMEditViewAITranslation.status-description'),
388
+ defaultMessage: 'Our AI translates content in all locales each time you save a modification.'
389
+ })
390
+ }),
391
+ /*#__PURE__*/ jsxRuntime.jsx(designSystem.Link, {
392
+ fontSize: "inherit",
393
+ tag: reactRouterDom.NavLink,
394
+ to: "/settings/internationalization",
395
+ style: {
396
+ alignSelf: 'flex-end'
397
+ },
398
+ children: /*#__PURE__*/ jsxRuntime.jsx(designSystem.Typography, {
399
+ variant: "pi",
400
+ textAlign: "right",
401
+ children: formatMessage({
402
+ id: getTranslation.getTranslation('CMEditViewAITranslation.settings-link'),
403
+ defaultMessage: '{enabled, select, true {Disable it in settings} false {Enable it in settings} other {Enable it in settings}}'
404
+ }, {
405
+ enabled: isAISettingEnabled
406
+ })
407
+ })
408
+ })
409
+ ]
410
+ })
411
+ }
412
+ };
413
+ };
187
414
  /* -------------------------------------------------------------------------------------------------
188
415
  * FillFromAnotherLocaleAction
189
416
  * -----------------------------------------------------------------------------------------------*/ const FillFromAnotherLocaleAction = ({ documentId, meta, model, collectionType })=>{
@@ -203,6 +430,9 @@ const getDocumentStatus = (document, meta)=>{
203
430
  }
204
431
  });
205
432
  const { data: locales$1 = [] } = locales.useGetLocalesQuery();
433
+ const isAIAvailable = ee.useAIAvailability();
434
+ const { data: settings$1 } = settings.useGetSettingsQuery();
435
+ const isAISettingEnabled = settings$1?.data?.aiLocalizations;
206
436
  const availableLocales = Array.isArray(locales$1) ? locales$1.filter((locale)=>meta?.availableLocales.some((l)=>l.locale === locale.code)) : [];
207
437
  const fillFromLocale = (onClose)=>async ()=>{
208
438
  const response = await getDocument({
@@ -224,6 +454,11 @@ const getDocumentStatus = (document, meta)=>{
224
454
  if (!hasI18n) {
225
455
  return null;
226
456
  }
457
+ // Do not display this action when AI is available and AI translations are enabled
458
+ const hasAIFutureFlag = window.strapi.future.isEnabled('unstableAILocalizations');
459
+ if (hasAIFutureFlag && isAIAvailable && isAISettingEnabled) {
460
+ return null;
461
+ }
227
462
  return {
228
463
  type: 'icon',
229
464
  icon: /*#__PURE__*/ jsxRuntime.jsx(icons.Earth, {}),
@@ -713,6 +948,7 @@ const getDocumentStatus = (document, meta)=>{
713
948
  }
714
949
  `;
715
950
 
951
+ exports.AITranslationStatusAction = AITranslationStatusAction;
716
952
  exports.BulkLocalePublishAction = BulkLocalePublishAction;
717
953
  exports.BulkLocaleUnpublishAction = BulkLocaleUnpublishAction;
718
954
  exports.DeleteLocaleAction = DeleteLocaleAction;
@@ -1 +1 @@
1
- {"version":3,"file":"CMHeaderActions.js","sources":["../../../admin/src/components/CMHeaderActions.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { skipToken } from '@reduxjs/toolkit/query';\nimport {\n useNotification,\n useQueryParams,\n Table,\n useAPIErrorHandler,\n FormErrors,\n useForm,\n} from '@strapi/admin/strapi-admin';\nimport {\n type DocumentActionComponent,\n type DocumentActionProps,\n unstable_useDocument as useDocument,\n unstable_useDocumentActions as useDocumentActions,\n buildValidParams,\n HeaderActionProps,\n} from '@strapi/content-manager/strapi-admin';\nimport {\n Flex,\n Status,\n Typography,\n Button,\n Modal,\n Field,\n SingleSelect,\n SingleSelectOption,\n Dialog,\n type StatusVariant,\n} from '@strapi/design-system';\nimport { WarningCircle, ListPlus, Trash, Earth, Cross, Plus } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\nimport { useNavigate } from 'react-router-dom';\nimport { styled } from 'styled-components';\n\nimport { useI18n } from '../hooks/useI18n';\nimport { useGetLocalesQuery } from '../services/locales';\nimport { useGetManyDraftRelationCountQuery } from '../services/relations';\nimport { cleanData } from '../utils/clean';\nimport { getTranslation } from '../utils/getTranslation';\nimport { capitalize } from '../utils/strings';\n\nimport { BulkLocaleActionModal } from './BulkLocaleActionModal';\n\nimport type { Locale } from '../../../shared/contracts/locales';\nimport type { I18nBaseQuery } from '../types';\nimport type { Modules } from '@strapi/types';\n\n/* -------------------------------------------------------------------------------------------------\n * LocalePickerAction\n * -----------------------------------------------------------------------------------------------*/\n\ninterface LocaleOptionProps {\n isDraftAndPublishEnabled: boolean;\n locale: Locale;\n status: 'draft' | 'published' | 'modified';\n entryExists: boolean;\n}\n\nconst statusVariants: Record<LocaleOptionProps['status'], StatusVariant> = {\n draft: 'secondary',\n published: 'success',\n modified: 'alternative',\n};\n\nconst LocaleOption = ({\n isDraftAndPublishEnabled,\n locale,\n status,\n entryExists,\n}: LocaleOptionProps) => {\n const { formatMessage } = useIntl();\n\n if (!entryExists) {\n return formatMessage(\n {\n id: getTranslation('CMEditViewLocalePicker.locale.create'),\n defaultMessage: 'Create <bold>{locale}</bold> locale',\n },\n {\n bold: (locale: React.ReactNode) => <b>{locale}</b>,\n locale: locale.name,\n }\n );\n }\n\n return (\n <Flex width=\"100%\" gap={1} justifyContent=\"space-between\">\n <Typography>{locale.name}</Typography>\n {isDraftAndPublishEnabled ? (\n <Status\n display=\"flex\"\n paddingLeft=\"6px\"\n paddingRight=\"6px\"\n paddingTop=\"2px\"\n paddingBottom=\"2px\"\n size=\"S\"\n variant={statusVariants[status]}\n >\n <Typography tag=\"span\" variant=\"pi\" fontWeight=\"bold\">\n {capitalize(status)}\n </Typography>\n </Status>\n ) : null}\n </Flex>\n );\n};\n\nconst LocalePickerAction = ({\n document,\n meta,\n model,\n collectionType,\n documentId,\n}: HeaderActionProps) => {\n const { formatMessage } = useIntl();\n const [{ query }, setQuery] = useQueryParams<I18nBaseQuery>();\n const { hasI18n, canCreate, canRead } = useI18n();\n const { data: locales = [] } = useGetLocalesQuery();\n const currentDesiredLocale = query.plugins?.i18n?.locale;\n const { schema } = useDocument({\n model,\n collectionType,\n documentId,\n params: { locale: currentDesiredLocale },\n });\n\n const handleSelect = React.useCallback(\n (value: string) => {\n setQuery({\n plugins: {\n ...query.plugins,\n i18n: {\n locale: value,\n },\n },\n });\n },\n [query.plugins, setQuery]\n );\n\n React.useEffect(() => {\n if (!Array.isArray(locales) || !hasI18n) {\n return;\n }\n /**\n * Handle the case where the current locale query param doesn't exist\n * in the list of available locales, so we redirect to the default locale.\n */\n const doesLocaleExist = locales.find((loc) => loc.code === currentDesiredLocale);\n const defaultLocale = locales.find((locale) => locale.isDefault);\n if (!doesLocaleExist && defaultLocale?.code) {\n handleSelect(defaultLocale.code);\n }\n }, [handleSelect, hasI18n, locales, currentDesiredLocale]);\n\n const currentLocale = Array.isArray(locales)\n ? locales.find((locale) => locale.code === currentDesiredLocale)\n : undefined;\n\n const allCurrentLocales = [\n { status: getDocumentStatus(document, meta), locale: currentLocale?.code },\n ...(document?.localizations ?? []),\n ];\n\n if (!hasI18n || !Array.isArray(locales) || locales.length === 0) {\n return null;\n }\n\n const displayedLocales = locales.filter((locale) => {\n /**\n * If you can read we allow you to see the locale exists\n * otherwise the locale is hidden.\n */\n return canRead.includes(locale.code);\n });\n\n return {\n label: formatMessage({\n id: getTranslation('Settings.locales.modal.locales.label'),\n defaultMessage: 'Locales',\n }),\n options: displayedLocales.map((locale) => {\n const entryWithLocaleExists = allCurrentLocales.some((doc) => doc.locale === locale.code);\n\n const currentLocaleDoc = allCurrentLocales.find((doc) =>\n 'locale' in doc ? doc.locale === locale.code : false\n );\n\n const permissionsToCheck = currentLocaleDoc ? canRead : canCreate;\n\n return {\n disabled: !permissionsToCheck.includes(locale.code),\n value: locale.code,\n label: (\n <LocaleOption\n isDraftAndPublishEnabled={!!schema?.options?.draftAndPublish}\n locale={locale}\n status={currentLocaleDoc?.status}\n entryExists={entryWithLocaleExists}\n />\n ),\n startIcon: !entryWithLocaleExists ? <Plus /> : null,\n };\n }),\n customizeContent: () => currentLocale?.name,\n onSelect: handleSelect,\n value: currentLocale,\n };\n};\n\ntype UseDocument = typeof useDocument;\n\nconst getDocumentStatus = (\n document: ReturnType<UseDocument>['document'],\n meta: ReturnType<UseDocument>['meta']\n): 'draft' | 'published' | 'modified' => {\n const docStatus = document?.status;\n const statuses = meta?.availableStatus ?? [];\n\n /**\n * Creating an entry\n */\n if (!docStatus) {\n return 'draft';\n }\n\n /**\n * We're viewing a draft, but the document could have a published version\n */\n if (docStatus === 'draft' && statuses.find((doc) => doc.publishedAt !== null)) {\n return 'published';\n }\n\n return docStatus;\n};\n\n/* -------------------------------------------------------------------------------------------------\n * FillFromAnotherLocaleAction\n * -----------------------------------------------------------------------------------------------*/\n\nconst FillFromAnotherLocaleAction = ({\n documentId,\n meta,\n model,\n collectionType,\n}: HeaderActionProps) => {\n const { formatMessage } = useIntl();\n const [{ query }] = useQueryParams<I18nBaseQuery>();\n const { hasI18n } = useI18n();\n const currentDesiredLocale = query.plugins?.i18n?.locale;\n const [localeSelected, setLocaleSelected] = React.useState<string | null>(null);\n const setValues = useForm('FillFromAnotherLocale', (state) => state.setValues);\n\n const { getDocument } = useDocumentActions();\n const { schema, components } = useDocument({\n model,\n documentId,\n collectionType,\n params: { locale: currentDesiredLocale },\n });\n const { data: locales = [] } = useGetLocalesQuery();\n\n const availableLocales = Array.isArray(locales)\n ? locales.filter((locale) => meta?.availableLocales.some((l) => l.locale === locale.code))\n : [];\n\n const fillFromLocale = (onClose: () => void) => async () => {\n const response = await getDocument({\n collectionType,\n model,\n documentId,\n params: { locale: localeSelected },\n });\n if (!response || !schema) {\n return;\n }\n\n const { data } = response;\n\n const cleanedData = cleanData(data, schema, components);\n\n setValues(cleanedData);\n\n onClose();\n };\n\n if (!hasI18n) {\n return null;\n }\n\n return {\n type: 'icon',\n icon: <Earth />,\n disabled: availableLocales.length === 0,\n label: formatMessage({\n id: getTranslation('CMEditViewCopyLocale.copy-text'),\n defaultMessage: 'Fill in from another locale',\n }),\n dialog: {\n type: 'dialog',\n title: formatMessage({\n id: getTranslation('CMEditViewCopyLocale.dialog.title'),\n defaultMessage: 'Confirmation',\n }),\n content: ({ onClose }: { onClose: () => void }) => (\n <>\n <Dialog.Body>\n <Flex direction=\"column\" gap={3}>\n <WarningCircle width=\"24px\" height=\"24px\" fill=\"danger600\" />\n <Typography textAlign=\"center\">\n {formatMessage({\n id: getTranslation('CMEditViewCopyLocale.dialog.body'),\n defaultMessage:\n 'Your current content will be erased and filled by the content of the selected locale:',\n })}\n </Typography>\n <Field.Root width=\"100%\">\n <Field.Label>\n {formatMessage({\n id: getTranslation('CMEditViewCopyLocale.dialog.field.label'),\n defaultMessage: 'Locale',\n })}\n </Field.Label>\n <SingleSelect\n value={localeSelected}\n placeholder={formatMessage({\n id: getTranslation('CMEditViewCopyLocale.dialog.field.placeholder'),\n defaultMessage: 'Select one locale...',\n })}\n // @ts-expect-error – the DS will handle numbers, but we're not allowing the API.\n onChange={(value) => setLocaleSelected(value)}\n >\n {availableLocales.map((locale) => (\n <SingleSelectOption key={locale.code} value={locale.code}>\n {locale.name}\n </SingleSelectOption>\n ))}\n </SingleSelect>\n </Field.Root>\n </Flex>\n </Dialog.Body>\n <Dialog.Footer>\n <Flex gap={2} width=\"100%\">\n <Button flex=\"auto\" variant=\"tertiary\" onClick={onClose}>\n {formatMessage({\n id: getTranslation('CMEditViewCopyLocale.cancel-text'),\n defaultMessage: 'No, cancel',\n })}\n </Button>\n <Button flex=\"auto\" variant=\"success\" onClick={fillFromLocale(onClose)}>\n {formatMessage({\n id: getTranslation('CMEditViewCopyLocale.submit-text'),\n defaultMessage: 'Yes, fill in',\n })}\n </Button>\n </Flex>\n </Dialog.Footer>\n </>\n ),\n },\n };\n};\n\n/* -------------------------------------------------------------------------------------------------\n * DeleteLocaleAction\n * -----------------------------------------------------------------------------------------------*/\n\nconst DeleteLocaleAction: DocumentActionComponent = ({\n document,\n documentId,\n model,\n collectionType,\n}) => {\n const { formatMessage } = useIntl();\n const navigate = useNavigate();\n const { toggleNotification } = useNotification();\n const { delete: deleteAction, isLoading } = useDocumentActions();\n const { hasI18n, canDelete } = useI18n();\n\n // Get the current locale object, using the URL instead of document so it works while creating\n const [{ query }] = useQueryParams<I18nBaseQuery>();\n const { data: locales = [] } = useGetLocalesQuery();\n const currentDesiredLocale = query.plugins?.i18n?.locale;\n const locale = !('error' in locales) && locales.find((loc) => loc.code === currentDesiredLocale);\n\n if (!hasI18n) {\n return null;\n }\n\n return {\n disabled:\n (document?.locale && !canDelete.includes(document.locale)) || !document || !document.id,\n position: ['header', 'table-row'],\n label: formatMessage(\n {\n id: getTranslation('actions.delete.label'),\n defaultMessage: 'Delete entry ({locale})',\n },\n { locale: locale && locale.name }\n ),\n icon: <StyledTrash />,\n variant: 'danger',\n dialog: {\n type: 'dialog',\n title: formatMessage({\n id: getTranslation('actions.delete.dialog.title'),\n defaultMessage: 'Confirmation',\n }),\n content: (\n <Flex direction=\"column\" gap={2}>\n <WarningCircle width=\"24px\" height=\"24px\" fill=\"danger600\" />\n <Typography tag=\"p\" variant=\"omega\" textAlign=\"center\">\n {formatMessage({\n id: getTranslation('actions.delete.dialog.body'),\n defaultMessage: 'Are you sure?',\n })}\n </Typography>\n </Flex>\n ),\n loading: isLoading,\n onConfirm: async () => {\n const unableToDelete =\n // We are unable to delete a collection type without a document ID\n // & unable to delete generally if there is no document locale\n (collectionType !== 'single-types' && !documentId) || !document?.locale;\n\n if (unableToDelete) {\n console.error(\n \"You're trying to delete a document without an id or locale, this is likely a bug with Strapi. Please open an issue.\"\n );\n\n toggleNotification({\n message: formatMessage({\n id: getTranslation('actions.delete.error'),\n defaultMessage: 'An error occurred while trying to delete the document locale.',\n }),\n type: 'danger',\n });\n\n return;\n }\n\n const res = await deleteAction({\n documentId,\n model,\n collectionType,\n params: { locale: document.locale },\n });\n\n if (!('error' in res)) {\n navigate({ pathname: `../${collectionType}/${model}` }, { replace: true });\n }\n },\n },\n };\n};\n\nexport type LocaleStatus = {\n locale: string;\n status: Modules.Documents.Params.PublicationStatus.Kind | 'modified';\n};\n\ninterface ExtendedDocumentActionProps extends DocumentActionProps {\n action?: 'bulk-publish' | 'bulk-unpublish';\n}\n\n/* -------------------------------------------------------------------------------------------------\n * BulkLocaleAction\n *\n * This component is used to handle bulk publish and unpublish actions on locales.\n * -----------------------------------------------------------------------------------------------*/\n\nconst BulkLocaleAction: DocumentActionComponent = ({\n document,\n documentId,\n model,\n collectionType,\n action,\n}: ExtendedDocumentActionProps) => {\n const locale = document?.locale ?? null;\n const [{ query }] = useQueryParams<{ status: 'draft' | 'published' }>();\n\n const params = React.useMemo(() => buildValidParams(query), [query]);\n const isOnPublishedTab = query.status === 'published';\n\n const { formatMessage } = useIntl();\n const { hasI18n, canPublish } = useI18n();\n const { toggleNotification } = useNotification();\n const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();\n\n const [selectedRows, setSelectedRows] = React.useState<any[]>([]);\n const [isDraftRelationConfirmationOpen, setIsDraftRelationConfirmationOpen] =\n React.useState<boolean>(false);\n\n const { publishMany: publishManyAction, unpublishMany: unpublishManyAction } =\n useDocumentActions();\n\n const { schema, validate } = useDocument(\n {\n model,\n collectionType,\n documentId,\n params: {\n locale,\n },\n },\n {\n // No need to fetch the document, the data is already available in the `document` prop\n skip: true,\n }\n );\n\n const { data: localesMetadata = [] } = useGetLocalesQuery(hasI18n ? undefined : skipToken);\n\n const headers = [\n {\n label: formatMessage({\n id: 'global.name',\n defaultMessage: 'Name',\n }),\n name: 'name',\n },\n {\n label: formatMessage({\n id: getTranslation('CMEditViewBulkLocale.status'),\n defaultMessage: 'Status',\n }),\n name: 'status',\n },\n {\n label: formatMessage({\n id: getTranslation('CMEditViewBulkLocale.publication-status'),\n defaultMessage: 'Publication Status',\n }),\n name: 'publication-status',\n },\n ];\n\n // Extract the rows for the bulk locale publish modal and any validation\n // errors per locale\n const [rows, validationErrors] = React.useMemo(() => {\n if (!document) {\n return [[], {}];\n }\n\n const localizations = document.localizations ?? [];\n\n // Build the rows for the bulk locale publish modal by combining the current\n // document with all the available locales from the document meta\n const locales: LocaleStatus[] = localizations.map((doc: any) => {\n const { locale, status } = doc;\n return { locale, status };\n });\n\n // Add the current document locale\n locales.unshift({\n locale: document.locale,\n status: document.status,\n });\n\n // Build the validation errors for each locale.\n const allDocuments = [document, ...localizations];\n const errors = allDocuments.reduce<FormErrors>((errs, document) => {\n if (!document) {\n return errs;\n }\n\n // Validate each locale entry via the useDocument validate function and store any errors in a dictionary\n const validation = validate(document as Modules.Documents.AnyDocument);\n if (validation !== null) {\n errs[document.locale] = validation;\n }\n return errs;\n }, {});\n\n return [locales, errors];\n }, [document, validate]);\n\n const isBulkPublish = action === 'bulk-publish';\n const localesForAction = selectedRows.reduce((acc: string[], selectedRow: LocaleStatus) => {\n const isValidLocale =\n // Validation errors are irrelevant if we are trying to unpublish\n !isBulkPublish || !Object.keys(validationErrors).includes(selectedRow.locale);\n\n const shouldAddLocale = isBulkPublish\n ? selectedRow.status !== 'published' && isValidLocale\n : selectedRow.status !== 'draft' && isValidLocale;\n\n if (shouldAddLocale) {\n acc.push(selectedRow.locale);\n }\n\n return acc;\n }, []);\n\n // TODO skipping this for now as there is a bug with the draft relation count that will be worked on separately\n // see https://www.notion.so/strapi/Count-draft-relations-56901b492efb45ab90d42fe975b32bd8?pvs=4\n const enableDraftRelationsCount = false;\n const {\n data: draftRelationsCount = 0,\n isLoading: isDraftRelationsLoading,\n error: isDraftRelationsError,\n } = useGetManyDraftRelationCountQuery(\n {\n model,\n documentIds: [documentId!],\n locale: localesForAction,\n },\n {\n skip: !enableDraftRelationsCount || !documentId || localesForAction.length === 0,\n }\n );\n\n React.useEffect(() => {\n if (isDraftRelationsError) {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(isDraftRelationsError),\n });\n }\n }, [isDraftRelationsError, toggleNotification, formatAPIError]);\n\n if (!schema?.options?.draftAndPublish) {\n return null;\n }\n\n if (!hasI18n) {\n return null;\n }\n\n if (!documentId) {\n return null;\n }\n\n // This document action can be enabled given that draft and publish and i18n are\n // enabled and we can publish the current locale.\n\n const publish = async () => {\n await publishManyAction({\n model,\n documentIds: [documentId],\n params: {\n ...params,\n locale: localesForAction,\n },\n });\n\n setSelectedRows([]);\n };\n\n const unpublish = async () => {\n await unpublishManyAction({\n model,\n documentIds: [documentId],\n params: {\n ...params,\n locale: localesForAction,\n },\n });\n\n setSelectedRows([]);\n };\n\n const handleAction = async () => {\n if (draftRelationsCount > 0) {\n setIsDraftRelationConfirmationOpen(true);\n } else if (isBulkPublish) {\n await publish();\n } else {\n await unpublish();\n }\n };\n\n if (isDraftRelationConfirmationOpen) {\n return {\n label: formatMessage({\n id: 'app.components.ConfirmDialog.title',\n defaultMessage: 'Confirmation',\n }),\n variant: 'danger',\n dialog: {\n onCancel: () => {\n setIsDraftRelationConfirmationOpen(false);\n },\n onConfirm: async () => {\n await publish();\n\n setIsDraftRelationConfirmationOpen(false);\n },\n type: 'dialog',\n title: formatMessage({\n id: getTranslation('actions.publish.dialog.title'),\n defaultMessage: 'Confirmation',\n }),\n content: (\n <Flex direction=\"column\" alignItems=\"center\" gap={2}>\n <WarningCircle width=\"2.4rem\" height=\"2.4rem\" fill=\"danger600\" />\n <Typography textAlign=\"center\">\n {formatMessage({\n id: getTranslation('CMEditViewBulkLocale.draft-relation-warning'),\n defaultMessage:\n 'Some locales are related to draft entries. Publishing them could leave broken links in your app.',\n })}\n </Typography>\n <Typography textAlign=\"center\">\n {formatMessage({\n id: getTranslation('CMEditViewBulkLocale.continue-confirmation'),\n defaultMessage: 'Are you sure you want to continue?',\n })}\n </Typography>\n </Flex>\n ),\n },\n };\n }\n\n const hasPermission = selectedRows\n .map(({ locale }) => locale)\n .every((locale) => canPublish.includes(locale));\n\n return {\n label: formatMessage({\n id: getTranslation(`CMEditViewBulkLocale.${isBulkPublish ? 'publish' : 'unpublish'}-title`),\n defaultMessage: `${isBulkPublish ? 'Publish' : 'Unpublish'} Multiple Locales`,\n }),\n variant: isBulkPublish ? 'secondary' : 'danger',\n icon: isBulkPublish ? <ListPlus /> : <Cross />,\n disabled: isOnPublishedTab || canPublish.length === 0,\n position: ['panel'],\n dialog: {\n type: 'modal',\n title: formatMessage({\n id: getTranslation(`CMEditViewBulkLocale.${isBulkPublish ? 'publish' : 'unpublish'}-title`),\n defaultMessage: `${isBulkPublish ? 'Publish' : 'Unpublish'} Multiple Locales`,\n }),\n content: () => {\n return (\n <Table.Root\n headers={headers}\n rows={rows.map((row) => ({\n ...row,\n id: row.locale,\n }))}\n selectedRows={selectedRows}\n onSelectedRowsChange={(tableSelectedRows) => setSelectedRows(tableSelectedRows)}\n >\n <BulkLocaleActionModal\n validationErrors={validationErrors}\n headers={headers}\n rows={rows}\n localesMetadata={localesMetadata as Locale[]}\n action={action ?? 'bulk-publish'}\n />\n </Table.Root>\n );\n },\n footer: () => (\n <Modal.Footer justifyContent=\"flex-end\">\n <Button\n loading={isDraftRelationsLoading}\n disabled={!hasPermission || localesForAction.length === 0}\n variant=\"default\"\n onClick={handleAction}\n >\n {formatMessage({\n id: isBulkPublish ? 'app.utils.publish' : 'app.utils.unpublish',\n defaultMessage: isBulkPublish ? 'Publish' : 'Unpublish',\n })}\n </Button>\n </Modal.Footer>\n ),\n },\n };\n};\n\n/* -------------------------------------------------------------------------------------------------\n * BulkLocalePublishAction\n * -----------------------------------------------------------------------------------------------*/\nconst BulkLocalePublishAction: DocumentActionComponent = (props: ExtendedDocumentActionProps) => {\n return BulkLocaleAction({ action: 'bulk-publish', ...props });\n};\n\n/* -------------------------------------------------------------------------------------------------\n * BulkLocaleUnpublishAction\n * -----------------------------------------------------------------------------------------------*/\nconst BulkLocaleUnpublishAction: DocumentActionComponent = (props: ExtendedDocumentActionProps) => {\n return BulkLocaleAction({ action: 'bulk-unpublish', ...props });\n};\n\n/**\n * Because the icon system is completely broken, we have to do\n * this to remove the fill from the cog.\n */\nconst StyledTrash = styled(Trash)`\n path {\n fill: currentColor;\n }\n`;\n\nexport {\n BulkLocalePublishAction,\n BulkLocaleUnpublishAction,\n DeleteLocaleAction,\n LocalePickerAction,\n FillFromAnotherLocaleAction,\n};\n"],"names":["statusVariants","draft","published","modified","LocaleOption","isDraftAndPublishEnabled","locale","status","entryExists","formatMessage","useIntl","id","getTranslation","defaultMessage","bold","_jsx","b","name","_jsxs","Flex","width","gap","justifyContent","Typography","Status","display","paddingLeft","paddingRight","paddingTop","paddingBottom","size","variant","tag","fontWeight","capitalize","LocalePickerAction","document","meta","model","collectionType","documentId","query","setQuery","useQueryParams","hasI18n","canCreate","canRead","useI18n","data","locales","useGetLocalesQuery","currentDesiredLocale","plugins","i18n","schema","useDocument","params","handleSelect","React","useCallback","value","useEffect","Array","isArray","doesLocaleExist","find","loc","code","defaultLocale","isDefault","currentLocale","undefined","allCurrentLocales","getDocumentStatus","localizations","length","displayedLocales","filter","includes","label","options","map","entryWithLocaleExists","some","doc","currentLocaleDoc","permissionsToCheck","disabled","draftAndPublish","startIcon","Plus","customizeContent","onSelect","docStatus","statuses","availableStatus","publishedAt","FillFromAnotherLocaleAction","localeSelected","setLocaleSelected","useState","setValues","useForm","state","getDocument","useDocumentActions","components","availableLocales","l","fillFromLocale","onClose","response","cleanedData","cleanData","type","icon","Earth","dialog","title","content","_Fragment","Dialog","Body","direction","WarningCircle","height","fill","textAlign","Field","Root","Label","SingleSelect","placeholder","onChange","SingleSelectOption","Footer","Button","flex","onClick","DeleteLocaleAction","navigate","useNavigate","toggleNotification","useNotification","delete","deleteAction","isLoading","canDelete","position","StyledTrash","loading","onConfirm","unableToDelete","console","error","message","res","pathname","replace","BulkLocaleAction","action","useMemo","buildValidParams","isOnPublishedTab","canPublish","_unstableFormatAPIError","formatAPIError","useAPIErrorHandler","selectedRows","setSelectedRows","isDraftRelationConfirmationOpen","setIsDraftRelationConfirmationOpen","publishMany","publishManyAction","unpublishMany","unpublishManyAction","validate","skip","localesMetadata","skipToken","headers","rows","validationErrors","unshift","allDocuments","errors","reduce","errs","validation","isBulkPublish","localesForAction","acc","selectedRow","isValidLocale","Object","keys","shouldAddLocale","push","enableDraftRelationsCount","draftRelationsCount","isDraftRelationsLoading","isDraftRelationsError","useGetManyDraftRelationCountQuery","documentIds","publish","unpublish","handleAction","onCancel","alignItems","hasPermission","every","ListPlus","Cross","Table","row","onSelectedRowsChange","tableSelectedRows","BulkLocaleActionModal","footer","Modal","BulkLocalePublishAction","props","BulkLocaleUnpublishAction","styled","Trash"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4DA,MAAMA,cAAqE,GAAA;IACzEC,KAAO,EAAA,WAAA;IACPC,SAAW,EAAA,SAAA;IACXC,QAAU,EAAA;AACZ,CAAA;AAEA,MAAMC,YAAAA,GAAe,CAAC,EACpBC,wBAAwB,EACxBC,MAAM,EACNC,MAAM,EACNC,WAAW,EACO,GAAA;IAClB,MAAM,EAAEC,aAAa,EAAE,GAAGC,iBAAAA,EAAAA;AAE1B,IAAA,IAAI,CAACF,WAAa,EAAA;AAChB,QAAA,OAAOC,aACL,CAAA;AACEE,YAAAA,EAAAA,EAAIC,6BAAe,CAAA,sCAAA,CAAA;YACnBC,cAAgB,EAAA;SAElB,EAAA;YACEC,IAAM,EAAA,CAACR,uBAA4BS,cAACC,CAAAA,GAAAA,EAAAA;AAAGV,oBAAAA,QAAAA,EAAAA;;AACvCA,YAAAA,MAAAA,EAAQA,OAAOW;AACjB,SAAA,CAAA;AAEJ;AAEA,IAAA,qBACEC,eAACC,CAAAA,iBAAAA,EAAAA;QAAKC,KAAM,EAAA,MAAA;QAAOC,GAAK,EAAA,CAAA;QAAGC,cAAe,EAAA,eAAA;;0BACxCP,cAACQ,CAAAA,uBAAAA,EAAAA;AAAYjB,gBAAAA,QAAAA,EAAAA,MAAAA,CAAOW;;AACnBZ,YAAAA,wBAAAA,iBACCU,cAACS,CAAAA,mBAAAA,EAAAA;gBACCC,OAAQ,EAAA,MAAA;gBACRC,WAAY,EAAA,KAAA;gBACZC,YAAa,EAAA,K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AA,CAAM;;;;AAIjC,CAAC;;;;;;;;"}
1
+ {"version":3,"file":"CMHeaderActions.js","sources":["../../../admin/src/components/CMHeaderActions.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport { skipToken } from '@reduxjs/toolkit/query';\nimport {\n useNotification,\n useQueryParams,\n Table,\n useAPIErrorHandler,\n FormErrors,\n useForm,\n} from '@strapi/admin/strapi-admin';\nimport { useAIAvailability } from '@strapi/admin/strapi-admin/ee';\nimport {\n type DocumentActionComponent,\n type DocumentActionProps,\n unstable_useDocument as useDocument,\n unstable_useDocumentActions as useDocumentActions,\n buildValidParams,\n HeaderActionProps,\n} from '@strapi/content-manager/strapi-admin';\nimport {\n Flex,\n Status,\n Typography,\n Button,\n Modal,\n Field,\n SingleSelect,\n SingleSelectOption,\n Dialog,\n type StatusVariant,\n Box,\n Link,\n} from '@strapi/design-system';\nimport { WarningCircle, ListPlus, Trash, Earth, Cross, Plus, Sparkle } from '@strapi/icons';\nimport { useIntl } from 'react-intl';\nimport { NavLink, useNavigate } from 'react-router-dom';\nimport { styled } from 'styled-components';\n\nimport { useAILocalizationJobsPolling } from '../hooks/useAILocalizationJobsPolling';\nimport { useI18n } from '../hooks/useI18n';\nimport { useGetAILocalizationJobsByDocumentQuery } from '../services/aiLocalizationJobs';\nimport { useGetLocalesQuery } from '../services/locales';\nimport { useGetManyDraftRelationCountQuery } from '../services/relations';\nimport { useGetSettingsQuery } from '../services/settings';\nimport { cleanData } from '../utils/clean';\nimport { getTranslation } from '../utils/getTranslation';\nimport { capitalize } from '../utils/strings';\n\nimport { BulkLocaleActionModal } from './BulkLocaleActionModal';\n\nimport type { Locale } from '../../../shared/contracts/locales';\nimport type { I18nBaseQuery } from '../types';\nimport type { Modules } from '@strapi/types';\n\n/* -------------------------------------------------------------------------------------------------\n * LocalePickerAction\n * -----------------------------------------------------------------------------------------------*/\n\ninterface LocaleOptionProps {\n isDraftAndPublishEnabled: boolean;\n locale: Locale;\n status: 'draft' | 'published' | 'modified';\n entryExists: boolean;\n translationStatus?: 'processing' | 'failed' | 'completed' | undefined;\n}\n\nconst statusVariants: Record<LocaleOptionProps['status'], StatusVariant> = {\n draft: 'secondary',\n published: 'success',\n modified: 'alternative',\n};\n\nconst LocaleOption = ({\n isDraftAndPublishEnabled,\n locale,\n status,\n entryExists,\n}: LocaleOptionProps) => {\n const { formatMessage } = useIntl();\n\n if (!entryExists) {\n return formatMessage(\n {\n id: getTranslation('CMEditViewLocalePicker.locale.create'),\n defaultMessage: 'Create <bold>{locale}</bold> locale',\n },\n {\n bold: (locale: React.ReactNode) => <b>{locale}</b>,\n locale: locale.name,\n }\n );\n }\n\n return (\n <Flex width=\"100%\" gap={1} justifyContent=\"space-between\">\n <Typography>{locale.name}</Typography>\n {isDraftAndPublishEnabled ? (\n <Status\n display=\"flex\"\n paddingLeft=\"6px\"\n paddingRight=\"6px\"\n paddingTop=\"2px\"\n paddingBottom=\"2px\"\n size=\"S\"\n variant={statusVariants[status]}\n >\n <Typography tag=\"span\" variant=\"pi\" fontWeight=\"bold\">\n {capitalize(status)}\n </Typography>\n </Status>\n ) : null}\n </Flex>\n );\n};\n\nconst LocaleOptionStartIcon = ({\n entryWithLocaleExists,\n translationStatus,\n index,\n}: {\n entryWithLocaleExists: boolean;\n translationStatus?: 'processing' | 'failed' | 'completed' | undefined;\n index?: number;\n}) => {\n const isAiAvailable = useAIAvailability();\n\n if (!entryWithLocaleExists) {\n return <Plus />;\n }\n\n if (isAiAvailable && index !== 0 && translationStatus === 'failed') {\n return <WarningCircle fill=\"warning600\" />;\n }\n\n return null;\n};\n\nconst LocalePickerAction = ({\n document,\n meta,\n model,\n collectionType,\n documentId,\n}: HeaderActionProps) => {\n const { formatMessage } = useIntl();\n const [{ query }, setQuery] = useQueryParams<I18nBaseQuery>();\n const { hasI18n, canCreate, canRead } = useI18n();\n const { data: locales = [] } = useGetLocalesQuery();\n const currentDesiredLocale = query.plugins?.i18n?.locale;\n const { schema } = useDocument({\n model,\n collectionType,\n documentId,\n params: { locale: currentDesiredLocale },\n });\n const { data: jobData } = useGetAILocalizationJobsByDocumentQuery({\n documentId: documentId!,\n model: model!,\n collectionType: collectionType!,\n });\n const { data: settings } = useGetSettingsQuery();\n const isAiAvailable = useAIAvailability();\n const setValues = useForm('LocalePickerAction', (state) => state.setValues);\n\n const handleSelect = React.useCallback(\n (value: string) => {\n setQuery({\n plugins: {\n ...query.plugins,\n i18n: {\n locale: value,\n },\n },\n });\n },\n [query.plugins, setQuery]\n );\n\n const nonTranslatedFields = React.useMemo(() => {\n if (!schema?.attributes) return [];\n return Object.keys(schema.attributes).filter((field) => {\n const attribute = schema.attributes[field] as Record<string, unknown>;\n return (attribute?.pluginOptions as any)?.i18n?.localized === false;\n });\n }, [schema?.attributes]);\n\n const sourceLocaleData = React.useMemo(() => {\n if (!Array.isArray(locales) || !meta?.availableLocales) return null;\n\n const defaultLocale = locales.find((locale: Locale) => locale.isDefault);\n const existingLocales = meta.availableLocales.map((loc) => loc.locale);\n\n const sourceLocaleCode =\n defaultLocale &&\n existingLocales.includes(defaultLocale.code) &&\n defaultLocale.code !== currentDesiredLocale\n ? defaultLocale.code\n : existingLocales.find((locale) => locale !== currentDesiredLocale);\n\n if (!sourceLocaleCode) return null;\n\n // Find the document data from availableLocales (now includes non-translatable fields)\n const sourceLocaleDoc = meta.availableLocales.find((loc) => loc.locale === sourceLocaleCode);\n\n return sourceLocaleDoc\n ? { locale: sourceLocaleCode, data: sourceLocaleDoc as Record<string, unknown> }\n : null;\n }, [locales, meta?.availableLocales, currentDesiredLocale]);\n\n /**\n * Prefilling form with non-translatable fields from already existing locale\n */\n React.useEffect(() => {\n // Only run when creating a new locale (no document ID yet) and when we have non-translatable fields\n if (!document?.id && nonTranslatedFields.length > 0 && sourceLocaleData?.data) {\n const dataToSet = nonTranslatedFields.reduce(\n (acc: Record<string, unknown>, field: string) => {\n acc[field] = sourceLocaleData.data[field];\n return acc;\n },\n {}\n );\n\n if (Object.keys(dataToSet).length > 0) {\n setValues(dataToSet);\n }\n }\n }, [document?.id, nonTranslatedFields, sourceLocaleData?.data, setValues]);\n\n React.useEffect(() => {\n if (!Array.isArray(locales) || !hasI18n) {\n return;\n }\n /**\n * Handle the case where the current locale query param doesn't exist\n * in the list of available locales, so we redirect to the default locale.\n */\n const doesLocaleExist = locales.find((loc) => loc.code === currentDesiredLocale);\n const defaultLocale = locales.find((locale) => locale.isDefault);\n if (!doesLocaleExist && defaultLocale?.code) {\n handleSelect(defaultLocale.code);\n }\n }, [handleSelect, hasI18n, locales, currentDesiredLocale]);\n\n const currentLocale = Array.isArray(locales)\n ? locales.find((locale) => locale.code === currentDesiredLocale)\n : undefined;\n\n // Use meta.availableLocales instead of document.localizations\n // meta.availableLocales contains all locales for the document, even when creating new locales\n const availableLocales = meta?.availableLocales ?? [];\n const documentLocalizations = document?.localizations ?? [];\n\n // Prefer meta.availableLocales as it's more reliable, fallback to document.localizations\n const allLocalizations = availableLocales.length > 0 ? availableLocales : documentLocalizations;\n\n const allCurrentLocales = [\n { status: getDocumentStatus(document, meta), locale: currentLocale?.code },\n ...allLocalizations,\n ];\n\n if (!hasI18n || !Array.isArray(locales) || locales.length === 0) {\n return null;\n }\n\n const displayedLocales = locales.filter((locale) => {\n /**\n * If you can read we allow you to see the locale exists\n * otherwise the locale is hidden.\n */\n return canRead.includes(locale.code);\n });\n\n return {\n label: formatMessage({\n id: getTranslation('Settings.locales.modal.locales.label'),\n defaultMessage: 'Locales',\n }),\n options: displayedLocales.map((locale, index) => {\n const entryWithLocaleExists = allCurrentLocales.some((doc) => doc.locale === locale.code);\n\n const currentLocaleDoc = allCurrentLocales.find((doc) =>\n 'locale' in doc ? doc.locale === locale.code : false\n );\n\n const permissionsToCheck = currentLocaleDoc ? canRead : canCreate;\n\n if (\n window.strapi.future.isEnabled('unstableAILocalizations') &&\n isAiAvailable &&\n settings?.data?.aiLocalizations\n ) {\n return {\n _render: () => (\n <React.Fragment key={index}>\n <SingleSelectOption\n disabled={!permissionsToCheck.includes(locale.code)}\n key={locale.code}\n startIcon={\n <LocaleOptionStartIcon\n entryWithLocaleExists={entryWithLocaleExists}\n translationStatus={jobData?.data?.status}\n index={index}\n />\n }\n value={locale.code}\n >\n <LocaleOption\n isDraftAndPublishEnabled={!!schema?.options?.draftAndPublish}\n locale={locale}\n status={currentLocaleDoc?.status}\n entryExists={entryWithLocaleExists}\n />\n </SingleSelectOption>\n {index === 0 && (\n <Box paddingRight={4} paddingLeft={4} paddingTop={2} paddingBottom={2}>\n <Typography variant=\"sigma\">\n {formatMessage({\n id: getTranslation('CMEditViewLocalePicker.locale.ai-translations'),\n defaultMessage: 'AI Translations',\n })}\n </Typography>\n </Box>\n )}\n </React.Fragment>\n ),\n };\n }\n\n return {\n disabled: !permissionsToCheck.includes(locale.code),\n value: locale.code,\n label: (\n <LocaleOption\n isDraftAndPublishEnabled={!!schema?.options?.draftAndPublish}\n locale={locale}\n status={currentLocaleDoc?.status}\n entryExists={entryWithLocaleExists}\n translationStatus={jobData?.data?.status}\n />\n ),\n startIcon: <LocaleOptionStartIcon entryWithLocaleExists={entryWithLocaleExists} />,\n };\n }),\n customizeContent: () => currentLocale?.name,\n onSelect: handleSelect,\n value: currentLocale,\n };\n};\n\ntype UseDocument = typeof useDocument;\n\nconst getDocumentStatus = (\n document: ReturnType<UseDocument>['document'],\n meta: ReturnType<UseDocument>['meta']\n): 'draft' | 'published' | 'modified' => {\n const docStatus = document?.status;\n const statuses = meta?.availableStatus ?? [];\n\n /**\n * Creating an entry\n */\n if (!docStatus) {\n return 'draft';\n }\n\n /**\n * We're viewing a draft, but the document could have a published version\n */\n if (docStatus === 'draft' && statuses.find((doc) => doc.publishedAt !== null)) {\n return 'published';\n }\n\n return docStatus;\n};\n\n/* -------------------------------------------------------------------------------------------------\n * AISettingsStatusAction\n * -----------------------------------------------------------------------------------------------*/\n\nconst AITranslationStatusIcon = styled(Status)<{ $isAISettingEnabled: boolean }>`\n display: flex;\n gap: ${({ theme }) => theme.spaces[1]};\n justify-content: center;\n align-items: center;\n height: 100%;\n\n // Disabled state\n ${({ $isAISettingEnabled, theme }) =>\n !$isAISettingEnabled &&\n `\n background-color: ${theme.colors.neutral150};\n `}\n\n svg {\n ${({ $isAISettingEnabled, theme }) =>\n !$isAISettingEnabled &&\n `\n fill: ${theme.colors.neutral300};\n `}\n }\n`;\n\nconst AITranslationStatusAction = ({ documentId, model, collectionType }: HeaderActionProps) => {\n const { formatMessage } = useIntl();\n const isAIAvailable = useAIAvailability();\n const { data: settings } = useGetSettingsQuery();\n const isAISettingEnabled = settings?.data?.aiLocalizations;\n const { hasI18n } = useI18n();\n\n // Poll for AI localizations jobs when AI is enabled and we have a documentId\n const { status } = useAILocalizationJobsPolling({\n documentId,\n model,\n collectionType,\n });\n const statusVariant = (() => {\n if (status === 'failed') {\n return 'warning';\n }\n\n if (isAISettingEnabled) {\n return 'alternative';\n }\n\n return 'neutral';\n })();\n\n // Do not display this action when i18n is not available\n if (!hasI18n) {\n return null;\n }\n\n // Do not display this action when AI is not available\n const hasAIFutureFlag = window.strapi.future.isEnabled('unstableAILocalizations');\n if (!isAIAvailable || !hasAIFutureFlag) {\n return null;\n }\n\n return {\n _status: {\n message: (\n <Box\n height=\"100%\"\n aria-label={formatMessage({\n id: getTranslation('CMEditViewAITranslation.status-aria-label'),\n defaultMessage: 'AI Translation Status',\n })}\n >\n <AITranslationStatusIcon\n $isAISettingEnabled={Boolean(isAISettingEnabled)}\n variant={statusVariant}\n size=\"S\"\n >\n <Sparkle />\n </AITranslationStatusIcon>\n </Box>\n ),\n tooltip: (\n <Flex direction=\"column\" padding={4} alignItems=\"flex-start\" width=\"25rem\">\n <Typography variant=\"pi\" fontWeight=\"600\">\n {formatMessage(\n {\n id: getTranslation('CMEditViewAITranslation.status-title'),\n defaultMessage:\n '{enabled, select, true {AI translation enabled} false {AI translation disabled} other {AI translation disabled}}',\n },\n { enabled: isAISettingEnabled }\n )}\n </Typography>\n <Typography variant=\"pi\" paddingTop={1} paddingBottom={3}>\n {formatMessage({\n id: getTranslation('CMEditViewAITranslation.status-description'),\n defaultMessage:\n 'Our AI translates content in all locales each time you save a modification.',\n })}\n </Typography>\n <Link\n fontSize=\"inherit\"\n tag={NavLink}\n to=\"/settings/internationalization\"\n style={{ alignSelf: 'flex-end' }}\n >\n <Typography variant=\"pi\" textAlign=\"right\">\n {formatMessage(\n {\n id: getTranslation('CMEditViewAITranslation.settings-link'),\n defaultMessage:\n '{enabled, select, true {Disable it in settings} false {Enable it in settings} other {Enable it in settings}}',\n },\n { enabled: isAISettingEnabled }\n )}\n </Typography>\n </Link>\n </Flex>\n ),\n },\n };\n};\n\n/* -------------------------------------------------------------------------------------------------\n * FillFromAnotherLocaleAction\n * -----------------------------------------------------------------------------------------------*/\n\nconst FillFromAnotherLocaleAction = ({\n documentId,\n meta,\n model,\n collectionType,\n}: HeaderActionProps) => {\n const { formatMessage } = useIntl();\n const [{ query }] = useQueryParams<I18nBaseQuery>();\n const { hasI18n } = useI18n();\n const currentDesiredLocale = query.plugins?.i18n?.locale;\n const [localeSelected, setLocaleSelected] = React.useState<string | null>(null);\n const setValues = useForm('FillFromAnotherLocale', (state) => state.setValues);\n\n const { getDocument } = useDocumentActions();\n const { schema, components } = useDocument({\n model,\n documentId,\n collectionType,\n params: { locale: currentDesiredLocale },\n });\n const { data: locales = [] } = useGetLocalesQuery();\n\n const isAIAvailable = useAIAvailability();\n const { data: settings } = useGetSettingsQuery();\n const isAISettingEnabled = settings?.data?.aiLocalizations;\n\n const availableLocales = Array.isArray(locales)\n ? locales.filter((locale) => meta?.availableLocales.some((l) => l.locale === locale.code))\n : [];\n\n const fillFromLocale = (onClose: () => void) => async () => {\n const response = await getDocument({\n collectionType,\n model,\n documentId,\n params: { locale: localeSelected },\n });\n if (!response || !schema) {\n return;\n }\n\n const { data } = response;\n\n const cleanedData = cleanData(data, schema, components);\n\n setValues(cleanedData);\n\n onClose();\n };\n\n if (!hasI18n) {\n return null;\n }\n\n // Do not display this action when AI is available and AI translations are enabled\n const hasAIFutureFlag = window.strapi.future.isEnabled('unstableAILocalizations');\n if (hasAIFutureFlag && isAIAvailable && isAISettingEnabled) {\n return null;\n }\n\n return {\n type: 'icon',\n icon: <Earth />,\n disabled: availableLocales.length === 0,\n label: formatMessage({\n id: getTranslation('CMEditViewCopyLocale.copy-text'),\n defaultMessage: 'Fill in from another locale',\n }),\n dialog: {\n type: 'dialog',\n title: formatMessage({\n id: getTranslation('CMEditViewCopyLocale.dialog.title'),\n defaultMessage: 'Confirmation',\n }),\n content: ({ onClose }: { onClose: () => void }) => (\n <>\n <Dialog.Body>\n <Flex direction=\"column\" gap={3}>\n <WarningCircle width=\"24px\" height=\"24px\" fill=\"danger600\" />\n <Typography textAlign=\"center\">\n {formatMessage({\n id: getTranslation('CMEditViewCopyLocale.dialog.body'),\n defaultMessage:\n 'Your current content will be erased and filled by the content of the selected locale:',\n })}\n </Typography>\n <Field.Root width=\"100%\">\n <Field.Label>\n {formatMessage({\n id: getTranslation('CMEditViewCopyLocale.dialog.field.label'),\n defaultMessage: 'Locale',\n })}\n </Field.Label>\n <SingleSelect\n value={localeSelected}\n placeholder={formatMessage({\n id: getTranslation('CMEditViewCopyLocale.dialog.field.placeholder'),\n defaultMessage: 'Select one locale...',\n })}\n // @ts-expect-error – the DS will handle numbers, but we're not allowing the API.\n onChange={(value) => setLocaleSelected(value)}\n >\n {availableLocales.map((locale) => (\n <SingleSelectOption key={locale.code} value={locale.code}>\n {locale.name}\n </SingleSelectOption>\n ))}\n </SingleSelect>\n </Field.Root>\n </Flex>\n </Dialog.Body>\n <Dialog.Footer>\n <Flex gap={2} width=\"100%\">\n <Button flex=\"auto\" variant=\"tertiary\" onClick={onClose}>\n {formatMessage({\n id: getTranslation('CMEditViewCopyLocale.cancel-text'),\n defaultMessage: 'No, cancel',\n })}\n </Button>\n <Button flex=\"auto\" variant=\"success\" onClick={fillFromLocale(onClose)}>\n {formatMessage({\n id: getTranslation('CMEditViewCopyLocale.submit-text'),\n defaultMessage: 'Yes, fill in',\n })}\n </Button>\n </Flex>\n </Dialog.Footer>\n </>\n ),\n },\n };\n};\n\n/* -------------------------------------------------------------------------------------------------\n * DeleteLocaleAction\n * -----------------------------------------------------------------------------------------------*/\n\nconst DeleteLocaleAction: DocumentActionComponent = ({\n document,\n documentId,\n model,\n collectionType,\n}) => {\n const { formatMessage } = useIntl();\n const navigate = useNavigate();\n const { toggleNotification } = useNotification();\n const { delete: deleteAction, isLoading } = useDocumentActions();\n const { hasI18n, canDelete } = useI18n();\n\n // Get the current locale object, using the URL instead of document so it works while creating\n const [{ query }] = useQueryParams<I18nBaseQuery>();\n const { data: locales = [] } = useGetLocalesQuery();\n const currentDesiredLocale = query.plugins?.i18n?.locale;\n const locale = !('error' in locales) && locales.find((loc) => loc.code === currentDesiredLocale);\n\n if (!hasI18n) {\n return null;\n }\n\n return {\n disabled:\n (document?.locale && !canDelete.includes(document.locale)) || !document || !document.id,\n position: ['header', 'table-row'],\n label: formatMessage(\n {\n id: getTranslation('actions.delete.label'),\n defaultMessage: 'Delete entry ({locale})',\n },\n { locale: locale && locale.name }\n ),\n icon: <StyledTrash />,\n variant: 'danger',\n dialog: {\n type: 'dialog',\n title: formatMessage({\n id: getTranslation('actions.delete.dialog.title'),\n defaultMessage: 'Confirmation',\n }),\n content: (\n <Flex direction=\"column\" gap={2}>\n <WarningCircle width=\"24px\" height=\"24px\" fill=\"danger600\" />\n <Typography tag=\"p\" variant=\"omega\" textAlign=\"center\">\n {formatMessage({\n id: getTranslation('actions.delete.dialog.body'),\n defaultMessage: 'Are you sure?',\n })}\n </Typography>\n </Flex>\n ),\n loading: isLoading,\n onConfirm: async () => {\n const unableToDelete =\n // We are unable to delete a collection type without a document ID\n // & unable to delete generally if there is no document locale\n (collectionType !== 'single-types' && !documentId) || !document?.locale;\n\n if (unableToDelete) {\n console.error(\n \"You're trying to delete a document without an id or locale, this is likely a bug with Strapi. Please open an issue.\"\n );\n\n toggleNotification({\n message: formatMessage({\n id: getTranslation('actions.delete.error'),\n defaultMessage: 'An error occurred while trying to delete the document locale.',\n }),\n type: 'danger',\n });\n\n return;\n }\n\n const res = await deleteAction({\n documentId,\n model,\n collectionType,\n params: { locale: document.locale },\n });\n\n if (!('error' in res)) {\n navigate({ pathname: `../${collectionType}/${model}` }, { replace: true });\n }\n },\n },\n };\n};\n\nexport type LocaleStatus = {\n locale: string;\n status: Modules.Documents.Params.PublicationStatus.Kind | 'modified';\n};\n\ninterface ExtendedDocumentActionProps extends DocumentActionProps {\n action?: 'bulk-publish' | 'bulk-unpublish';\n}\n\n/* -------------------------------------------------------------------------------------------------\n * BulkLocaleAction\n *\n * This component is used to handle bulk publish and unpublish actions on locales.\n * -----------------------------------------------------------------------------------------------*/\n\nconst BulkLocaleAction: DocumentActionComponent = ({\n document,\n documentId,\n model,\n collectionType,\n action,\n}: ExtendedDocumentActionProps) => {\n const locale = document?.locale ?? null;\n const [{ query }] = useQueryParams<{ status: 'draft' | 'published' }>();\n\n const params = React.useMemo(() => buildValidParams(query), [query]);\n const isOnPublishedTab = query.status === 'published';\n\n const { formatMessage } = useIntl();\n const { hasI18n, canPublish } = useI18n();\n const { toggleNotification } = useNotification();\n const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();\n\n const [selectedRows, setSelectedRows] = React.useState<any[]>([]);\n const [isDraftRelationConfirmationOpen, setIsDraftRelationConfirmationOpen] =\n React.useState<boolean>(false);\n\n const { publishMany: publishManyAction, unpublishMany: unpublishManyAction } =\n useDocumentActions();\n\n const { schema, validate } = useDocument(\n {\n model,\n collectionType,\n documentId,\n params: {\n locale,\n },\n },\n {\n // No need to fetch the document, the data is already available in the `document` prop\n skip: true,\n }\n );\n\n const { data: localesMetadata = [] } = useGetLocalesQuery(hasI18n ? undefined : skipToken);\n\n const headers = [\n {\n label: formatMessage({\n id: 'global.name',\n defaultMessage: 'Name',\n }),\n name: 'name',\n },\n {\n label: formatMessage({\n id: getTranslation('CMEditViewBulkLocale.status'),\n defaultMessage: 'Status',\n }),\n name: 'status',\n },\n {\n label: formatMessage({\n id: getTranslation('CMEditViewBulkLocale.publication-status'),\n defaultMessage: 'Publication Status',\n }),\n name: 'publication-status',\n },\n ];\n\n // Extract the rows for the bulk locale publish modal and any validation\n // errors per locale\n const [rows, validationErrors] = React.useMemo(() => {\n if (!document) {\n return [[], {}];\n }\n\n const localizations = document.localizations ?? [];\n\n // Build the rows for the bulk locale publish modal by combining the current\n // document with all the available locales from the document meta\n const locales: LocaleStatus[] = localizations.map((doc: any) => {\n const { locale, status } = doc;\n return { locale, status };\n });\n\n // Add the current document locale\n locales.unshift({\n locale: document.locale,\n status: document.status,\n });\n\n // Build the validation errors for each locale.\n const allDocuments = [document, ...localizations];\n const errors = allDocuments.reduce<FormErrors>((errs, document) => {\n if (!document) {\n return errs;\n }\n\n // Validate each locale entry via the useDocument validate function and store any errors in a dictionary\n const validation = validate(document as Modules.Documents.AnyDocument);\n if (validation !== null) {\n errs[document.locale] = validation;\n }\n return errs;\n }, {});\n\n return [locales, errors];\n }, [document, validate]);\n\n const isBulkPublish = action === 'bulk-publish';\n const localesForAction = selectedRows.reduce((acc: string[], selectedRow: LocaleStatus) => {\n const isValidLocale =\n // Validation errors are irrelevant if we are trying to unpublish\n !isBulkPublish || !Object.keys(validationErrors).includes(selectedRow.locale);\n\n const shouldAddLocale = isBulkPublish\n ? selectedRow.status !== 'published' && isValidLocale\n : selectedRow.status !== 'draft' && isValidLocale;\n\n if (shouldAddLocale) {\n acc.push(selectedRow.locale);\n }\n\n return acc;\n }, []);\n\n // TODO skipping this for now as there is a bug with the draft relation count that will be worked on separately\n // see https://www.notion.so/strapi/Count-draft-relations-56901b492efb45ab90d42fe975b32bd8?pvs=4\n const enableDraftRelationsCount = false;\n const {\n data: draftRelationsCount = 0,\n isLoading: isDraftRelationsLoading,\n error: isDraftRelationsError,\n } = useGetManyDraftRelationCountQuery(\n {\n model,\n documentIds: [documentId!],\n locale: localesForAction,\n },\n {\n skip: !enableDraftRelationsCount || !documentId || localesForAction.length === 0,\n }\n );\n\n React.useEffect(() => {\n if (isDraftRelationsError) {\n toggleNotification({\n type: 'danger',\n message: formatAPIError(isDraftRelationsError),\n });\n }\n }, [isDraftRelationsError, toggleNotification, formatAPIError]);\n\n if (!schema?.options?.draftAndPublish) {\n return null;\n }\n\n if (!hasI18n) {\n return null;\n }\n\n if (!documentId) {\n return null;\n }\n\n // This document action can be enabled given that draft and publish and i18n are\n // enabled and we can publish the current locale.\n\n const publish = async () => {\n await publishManyAction({\n model,\n documentIds: [documentId],\n params: {\n ...params,\n locale: localesForAction,\n },\n });\n\n setSelectedRows([]);\n };\n\n const unpublish = async () => {\n await unpublishManyAction({\n model,\n documentIds: [documentId],\n params: {\n ...params,\n locale: localesForAction,\n },\n });\n\n setSelectedRows([]);\n };\n\n const handleAction = async () => {\n if (draftRelationsCount > 0) {\n setIsDraftRelationConfirmationOpen(true);\n } else if (isBulkPublish) {\n await publish();\n } else {\n await unpublish();\n }\n };\n\n if (isDraftRelationConfirmationOpen) {\n return {\n label: formatMessage({\n id: 'app.components.ConfirmDialog.title',\n defaultMessage: 'Confirmation',\n }),\n variant: 'danger',\n dialog: {\n onCancel: () => {\n setIsDraftRelationConfirmationOpen(false);\n },\n onConfirm: async () => {\n await publish();\n\n setIsDraftRelationConfirmationOpen(false);\n },\n type: 'dialog',\n title: formatMessage({\n id: getTranslation('actions.publish.dialog.title'),\n defaultMessage: 'Confirmation',\n }),\n content: (\n <Flex direction=\"column\" alignItems=\"center\" gap={2}>\n <WarningCircle width=\"2.4rem\" height=\"2.4rem\" fill=\"danger600\" />\n <Typography textAlign=\"center\">\n {formatMessage({\n id: getTranslation('CMEditViewBulkLocale.draft-relation-warning'),\n defaultMessage:\n 'Some locales are related to draft entries. Publishing them could leave broken links in your app.',\n })}\n </Typography>\n <Typography textAlign=\"center\">\n {formatMessage({\n id: getTranslation('CMEditViewBulkLocale.continue-confirmation'),\n defaultMessage: 'Are you sure you want to continue?',\n })}\n </Typography>\n </Flex>\n ),\n },\n };\n }\n\n const hasPermission = selectedRows\n .map(({ locale }) => locale)\n .every((locale) => canPublish.includes(locale));\n\n return {\n label: formatMessage({\n id: getTranslation(`CMEditViewBulkLocale.${isBulkPublish ? 'publish' : 'unpublish'}-title`),\n defaultMessage: `${isBulkPublish ? 'Publish' : 'Unpublish'} Multiple Locales`,\n }),\n variant: isBulkPublish ? 'secondary' : 'danger',\n icon: isBulkPublish ? <ListPlus /> : <Cross />,\n disabled: isOnPublishedTab || canPublish.length === 0,\n position: ['panel'],\n dialog: {\n type: 'modal',\n title: formatMessage({\n id: getTranslation(`CMEditViewBulkLocale.${isBulkPublish ? 'publish' : 'unpublish'}-title`),\n defaultMessage: `${isBulkPublish ? 'Publish' : 'Unpublish'} Multiple Locales`,\n }),\n content: () => {\n return (\n <Table.Root\n headers={headers}\n rows={rows.map((row) => ({\n ...row,\n id: row.locale,\n }))}\n selectedRows={selectedRows}\n onSelectedRowsChange={(tableSelectedRows) => setSelectedRows(tableSelectedRows)}\n >\n <BulkLocaleActionModal\n validationErrors={validationErrors}\n headers={headers}\n rows={rows}\n localesMetadata={localesMetadata as Locale[]}\n action={action ?? 'bulk-publish'}\n />\n </Table.Root>\n );\n },\n footer: () => (\n <Modal.Footer justifyContent=\"flex-end\">\n <Button\n loading={isDraftRelationsLoading}\n disabled={!hasPermission || localesForAction.length === 0}\n variant=\"default\"\n onClick={handleAction}\n >\n {formatMessage({\n id: isBulkPublish ? 'app.utils.publish' : 'app.utils.unpublish',\n defaultMessage: isBulkPublish ? 'Publish' : 'Unpublish',\n })}\n </Button>\n </Modal.Footer>\n ),\n },\n };\n};\n\n/* -------------------------------------------------------------------------------------------------\n * BulkLocalePublishAction\n * -----------------------------------------------------------------------------------------------*/\nconst BulkLocalePublishAction: DocumentActionComponent = (props: ExtendedDocumentActionProps) => {\n return BulkLocaleAction({ action: 'bulk-publish', ...props });\n};\n\n/* -------------------------------------------------------------------------------------------------\n * BulkLocaleUnpublishAction\n * -----------------------------------------------------------------------------------------------*/\nconst BulkLocaleUnpublishAction: DocumentActionComponent = (props: ExtendedDocumentActionProps) => {\n return BulkLocaleAction({ action: 'bulk-unpublish', ...props });\n};\n\n/**\n * Because the icon system is completely broken, we have to do\n * this to remove the fill from the cog.\n */\nconst StyledTrash = styled(Trash)`\n path {\n fill: currentColor;\n }\n`;\n\nexport {\n BulkLocalePublishAction,\n BulkLocaleUnpublishAction,\n DeleteLocaleAction,\n LocalePickerAction,\n FillFromAnotherLocaleAction,\n AITranslationStatusAction,\n};\n"],"names":["statusVariants","draft","published","modified","LocaleOption","isDraftAndPublishEnabled","locale","status","entryExists","formatMessage","useIntl","id","getTranslation","defaultMessage","bold","_jsx","b","name","_jsxs","Flex","width","gap","justifyContent","Typography","Status","display","paddingLeft","paddingRight","paddingTop","paddingBottom","size","variant","tag","fontWeight","capitalize","LocaleOptionStartIcon","entryWithLocaleExists","translationStatus","index","isAiAvailable","useAIAvailability","Plus","WarningCircle","fill","LocalePickerAction","document","meta","model","collectionType","documentId","query","setQuery","useQueryParams","hasI18n","canCreate","canRead","useI18n","data","locales","useGetLocalesQuery","currentDesiredLocale","plugins","i18n","schema","useDocument","params","jobData","useGetAILocalizationJobsByDocumentQuery","settings","useGetSettingsQuery","setValues","useForm","state","handleSelect","React","useCallback","value","nonTranslatedFields","useMemo","attributes","Object","keys","filter","field","attribute","pluginOptions","localized","sourceLocaleData","Array","isArray","availableLocales","defaultLocale","find","isDefault","existingLocales","map","loc","sourceLocaleCode","includes","code","sourceLocaleDoc","useEffect","length","dataToSet","reduce","acc","doesLocaleExist","currentLocale","undefined","documentLocalizations","localizations","allLocalizations","allCurrentLocales","getDocumentStatus","displayedLocales","label","options","some","doc","currentLocaleDoc","permissionsToCheck","window","strapi","future","isEnabled","aiLocalizations","_render","Fragment","SingleSelectOption","disabled","startIcon","draftAndPublish","Box","customizeContent","onSelect","docStatus","statuses","availableStatus","publishedAt","AITranslationStatusIcon","styled","theme","spaces","$isAISettingEnabled","colors","neutral150","neutral300","AITranslationStatusAction","isAIAvailable","isAISettingEnabled","useAILocalizationJobsPolling","statusVariant","hasAIFutureFlag","_status","message","height","aria-label","Boolean","Sparkle","tooltip","direction","padding","alignItems","enabled","Link","fontSize","NavLink","to","style","alignSelf","textAlign","FillFromAnotherLocaleAction","localeSelected","setLocaleSelected","useState","getDocument","useDocumentActions","components","l","fillFromLocale","onClose","response","cleanedData","cleanData","type","icon","Earth","dialog","title","content","_Fragment","Dialog","Body","Field","Root","Label","SingleSelect","placeholder","onChange","Footer","Button","flex","onClick","DeleteLocaleAction","navigate","useNavigate","toggleNotification","useNotification","delete","deleteAction","isLoading","canDelete","position","StyledTrash","loading","onConfirm","unableToDelete","console","error","res","pathname","replace","BulkLocaleAction","action","buildValidParams","isOnPublishedTab","canPublish","_unstableFormatAPIError","formatAPIError","useAPIErrorHandler","selectedRows","setSelectedRows","isDraftRelationConfirmationOpen","setIsDraftRelationConfirmationOpen","publishMany","publishManyAction","unpublishMany","unpublishManyAction","validate","skip","localesMetadata","skipToken","headers","rows","validationErrors","unshift","allDocuments","errors","errs","validation","isBulkPublish","localesForAction","selectedRow","isValidLocale","shouldAddLocale","push","enableDraftRelationsCount","draftRelationsCount","isDraftRelationsLoading","isDraftRelationsError","useGetManyDraftRelationCountQuery","documentIds","publish","unpublish","handleAction","onCancel","hasPermission","every","ListPlus","Cross","Table","row","onSelectedRowsChange","tableSelectedRows","BulkLocaleActionModal","footer","Modal","BulkLocalePublishAction","props","BulkLocaleUnpublishAction","Trash"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmEA,MAAMA,cAAqE,GAAA;IACzEC,KAAO,EAAA,WAAA;IACPC,SAAW,EAAA,SAAA;IACXC,QAAU,EAAA;AACZ,CAAA;AAEA,MAAMC,YAAAA,GAAe,CAAC,EACpBC,wBAAwB,EACxBC,MAAM,EACNC,MAAM,EACNC,WAAW,EACO,GAAA;IAClB,MAAM,EAAEC,aAAa,EAAE,GAA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