@strapi/i18n 0.0.0-experimental.e60ec1829240dae21c1e1d29076681c322288813 → 0.0.0-experimental.edc24aaa3bb5a90fa5fd4fee208167dd4e2e38d4
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/LICENSE +18 -3
- package/dist/_chunks/{SettingsPage-CeqfDjsb.mjs → SettingsPage-CsGvujny.mjs} +115 -126
- package/dist/_chunks/SettingsPage-CsGvujny.mjs.map +1 -0
- package/dist/_chunks/{SettingsPage-Djqsdrzs.js → SettingsPage-DA9haizZ.js} +115 -126
- package/dist/_chunks/SettingsPage-DA9haizZ.js.map +1 -0
- package/dist/_chunks/{en-BuBc6LKZ.js → en-BsOU9o5z.js} +6 -1
- package/dist/_chunks/en-BsOU9o5z.js.map +1 -0
- package/dist/_chunks/{en-CnrTsjWS.mjs → en-CM6Pjfyv.mjs} +6 -1
- package/dist/_chunks/en-CM6Pjfyv.mjs.map +1 -0
- package/dist/_chunks/{index-BDU1w_fd.mjs → index-CCZJF_EJ.mjs} +461 -152
- package/dist/_chunks/index-CCZJF_EJ.mjs.map +1 -0
- package/dist/_chunks/{index-DMXJeGjN.js → index-DIzVXZoE.js} +467 -160
- package/dist/_chunks/index-DIzVXZoE.js.map +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +2 -2
- package/dist/admin/src/components/BulkLocaleActionModal.d.ts +15 -0
- package/dist/admin/src/components/CMHeaderActions.d.ts +7 -1
- package/dist/admin/src/components/EditLocale.d.ts +5 -4
- package/dist/admin/src/contentReleasesHooks/releaseDetailsView.d.ts +9 -5
- package/dist/admin/src/services/api.d.ts +2 -3
- package/dist/admin/src/services/locales.d.ts +1 -1
- package/dist/admin/src/services/relations.d.ts +7 -0
- package/dist/admin/src/utils/baseQuery.d.ts +4 -19
- package/dist/admin/src/utils/schemas.d.ts +1 -0
- package/dist/shared/contracts/content-manager.d.ts +20 -1
- package/package.json +15 -16
- package/dist/_chunks/SettingsPage-CeqfDjsb.mjs.map +0 -1
- package/dist/_chunks/SettingsPage-Djqsdrzs.js.map +0 -1
- package/dist/_chunks/en-BuBc6LKZ.js.map +0 -1
- package/dist/_chunks/en-CnrTsjWS.mjs.map +0 -1
- package/dist/_chunks/index-BDU1w_fd.mjs.map +0 -1
- package/dist/_chunks/index-DMXJeGjN.js.map +0 -1
- package/dist/admin/src/components/Initializer.d.ts +0 -5
@@ -6,12 +6,11 @@ const React = require("react");
|
|
6
6
|
const designSystem = require("@strapi/design-system");
|
7
7
|
const icons = require("@strapi/icons");
|
8
8
|
const reactIntl = require("react-intl");
|
9
|
-
const
|
9
|
+
const styledComponents = require("styled-components");
|
10
|
+
const query = require("@reduxjs/toolkit/query");
|
10
11
|
const strapiAdmin = require("@strapi/admin/strapi-admin");
|
11
12
|
const strapiAdmin$1 = require("@strapi/content-manager/strapi-admin");
|
12
13
|
const reactRouterDom = require("react-router-dom");
|
13
|
-
const react = require("@reduxjs/toolkit/query/react");
|
14
|
-
const axios = require("axios");
|
15
14
|
const qs = require("qs");
|
16
15
|
const omit = require("lodash/omit");
|
17
16
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
@@ -36,7 +35,6 @@ function _interopNamespace(e) {
|
|
36
35
|
const get__default = /* @__PURE__ */ _interopDefault(get);
|
37
36
|
const yup__namespace = /* @__PURE__ */ _interopNamespace(yup);
|
38
37
|
const React__namespace = /* @__PURE__ */ _interopNamespace(React);
|
39
|
-
const styled__default = /* @__PURE__ */ _interopDefault(styled);
|
40
38
|
const qs__namespace = /* @__PURE__ */ _interopNamespace(qs);
|
41
39
|
const omit__default = /* @__PURE__ */ _interopDefault(omit);
|
42
40
|
const __variableDynamicImportRuntimeHelper = (glob, path) => {
|
@@ -50,7 +48,7 @@ const __variableDynamicImportRuntimeHelper = (glob, path) => {
|
|
50
48
|
};
|
51
49
|
const pluginId = "i18n";
|
52
50
|
const getTranslation = (id) => `${pluginId}.${id}`;
|
53
|
-
const TextAlignTypography =
|
51
|
+
const TextAlignTypography = styledComponents.styled(designSystem.Typography)`
|
54
52
|
text-align: center;
|
55
53
|
`;
|
56
54
|
const CheckboxConfirmation = ({
|
@@ -74,9 +72,7 @@ const CheckboxConfirmation = ({
|
|
74
72
|
};
|
75
73
|
const handleConfirm = () => {
|
76
74
|
onChange({ target: { name, value: false, type: "checkbox" } });
|
77
|
-
setIsOpen(false);
|
78
75
|
};
|
79
|
-
const handleToggle = () => setIsOpen((prev) => !prev);
|
80
76
|
const label = intlLabel.id ? formatMessage(
|
81
77
|
{ id: intlLabel.id, defaultMessage: intlLabel.defaultMessage },
|
82
78
|
{ ...intlLabel.values }
|
@@ -85,43 +81,36 @@ const CheckboxConfirmation = ({
|
|
85
81
|
{ id: description.id, defaultMessage: description.defaultMessage },
|
86
82
|
{ ...description.values }
|
87
83
|
) : "";
|
88
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
89
|
-
/* @__PURE__ */ jsxRuntime.
|
90
|
-
designSystem.Checkbox,
|
91
|
-
{
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
),
|
101
|
-
isOpen && /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog, { onClose: handleToggle, title: "Confirmation", isOpen, children: [
|
102
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.DialogBody, { icon: /* @__PURE__ */ jsxRuntime.jsx(icons.WarningCircle, {}), children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 2, children: [
|
103
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(TextAlignTypography, { id: "confirm-description", children: formatMessage({
|
84
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Root, { open: isOpen, onOpenChange: setIsOpen, children: [
|
85
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { hint, name, children: [
|
86
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Checkbox, { onCheckedChange: handleChange, checked: value, children: label }),
|
87
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {})
|
88
|
+
] }),
|
89
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Content, { children: [
|
90
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Header, { children: formatMessage({
|
91
|
+
id: getTranslation("CheckboxConfirmation.Modal.title"),
|
92
|
+
defaultMessage: "Disable localization"
|
93
|
+
}) }),
|
94
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Body, { icon: /* @__PURE__ */ jsxRuntime.jsx(icons.WarningCircle, {}), children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 2, children: [
|
95
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(TextAlignTypography, { children: formatMessage({
|
104
96
|
id: getTranslation("CheckboxConfirmation.Modal.content"),
|
105
97
|
defaultMessage: "Disabling localization will engender the deletion of all your content but the one associated to your default locale (if existing)."
|
106
98
|
}) }) }),
|
107
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontWeight: "semiBold",
|
99
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontWeight: "semiBold", children: formatMessage({
|
108
100
|
id: getTranslation("CheckboxConfirmation.Modal.body"),
|
109
101
|
defaultMessage: "Do you want to disable it?"
|
110
102
|
}) }) })
|
111
103
|
] }) }),
|
112
|
-
/* @__PURE__ */ jsxRuntime.
|
113
|
-
designSystem.
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
}) })
|
123
|
-
}
|
124
|
-
)
|
104
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Footer, { children: [
|
105
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Cancel, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", children: formatMessage({
|
106
|
+
id: "components.popUpWarning.button.cancel",
|
107
|
+
defaultMessage: "No, cancel"
|
108
|
+
}) }) }),
|
109
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Action, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "danger-light", onClick: handleConfirm, children: formatMessage({
|
110
|
+
id: getTranslation("CheckboxConfirmation.Modal.button-confirm"),
|
111
|
+
defaultMessage: "Yes, disable"
|
112
|
+
}) }) })
|
113
|
+
] })
|
125
114
|
] })
|
126
115
|
] });
|
127
116
|
};
|
@@ -172,7 +161,7 @@ const useI18n = () => {
|
|
172
161
|
model: params.slug
|
173
162
|
},
|
174
163
|
{
|
175
|
-
skip:
|
164
|
+
skip: true
|
176
165
|
}
|
177
166
|
);
|
178
167
|
if (doesPluginOptionsHaveI18nLocalized(schema?.pluginOptions)) {
|
@@ -186,64 +175,8 @@ const useI18n = () => {
|
|
186
175
|
...actions
|
187
176
|
};
|
188
177
|
};
|
189
|
-
const
|
190
|
-
|
191
|
-
const { get: get2, post, del, put } = strapiAdmin.getFetchClient();
|
192
|
-
if (typeof query === "string") {
|
193
|
-
const result = await get2(query, { signal });
|
194
|
-
return { data: result.data };
|
195
|
-
} else {
|
196
|
-
const { url, method = "GET", data, config } = query;
|
197
|
-
if (method === "POST") {
|
198
|
-
const result2 = await post(url, data, { ...config, signal });
|
199
|
-
return { data: result2.data };
|
200
|
-
}
|
201
|
-
if (method === "DELETE") {
|
202
|
-
const result2 = await del(url, { ...config, signal });
|
203
|
-
return { data: result2.data };
|
204
|
-
}
|
205
|
-
if (method === "PUT") {
|
206
|
-
const result2 = await put(url, data, { ...config, signal });
|
207
|
-
return { data: result2.data };
|
208
|
-
}
|
209
|
-
const result = await get2(url, { ...config, signal });
|
210
|
-
return { data: result.data };
|
211
|
-
}
|
212
|
-
} catch (err) {
|
213
|
-
if (axios.isAxiosError(err)) {
|
214
|
-
if (typeof err.response?.data === "object" && err.response?.data !== null && "error" in err.response?.data) {
|
215
|
-
return { data: void 0, error: err.response?.data.error };
|
216
|
-
} else {
|
217
|
-
return {
|
218
|
-
data: void 0,
|
219
|
-
error: {
|
220
|
-
name: "UnknownError",
|
221
|
-
message: "There was an unknown error response from the API",
|
222
|
-
details: err.response?.data,
|
223
|
-
status: err.response?.status
|
224
|
-
}
|
225
|
-
};
|
226
|
-
}
|
227
|
-
}
|
228
|
-
const error = err;
|
229
|
-
return {
|
230
|
-
data: void 0,
|
231
|
-
error: {
|
232
|
-
name: error.name,
|
233
|
-
message: error.message,
|
234
|
-
stack: error.stack
|
235
|
-
}
|
236
|
-
};
|
237
|
-
}
|
238
|
-
};
|
239
|
-
const isBaseQueryError = (error) => {
|
240
|
-
return error.name !== void 0;
|
241
|
-
};
|
242
|
-
const i18nApi = react.createApi({
|
243
|
-
reducerPath: "i18nApi",
|
244
|
-
baseQuery: axiosBaseQuery(),
|
245
|
-
tagTypes: ["Locale"],
|
246
|
-
endpoints: () => ({})
|
178
|
+
const i18nApi = strapiAdmin.adminApi.enhanceEndpoints({
|
179
|
+
addTagTypes: ["Locale"]
|
247
180
|
});
|
248
181
|
const localesApi = i18nApi.injectEndpoints({
|
249
182
|
endpoints: (builder) => ({
|
@@ -292,6 +225,176 @@ const {
|
|
292
225
|
useGetDefaultLocalesQuery,
|
293
226
|
useUpdateLocaleMutation
|
294
227
|
} = localesApi;
|
228
|
+
const relationsApi = i18nApi.injectEndpoints({
|
229
|
+
overrideExisting: true,
|
230
|
+
endpoints: (builder) => ({
|
231
|
+
getManyDraftRelationCount: builder.query({
|
232
|
+
query: ({ model, ...params }) => ({
|
233
|
+
url: `/content-manager/collection-types/${model}/actions/countManyEntriesDraftRelations`,
|
234
|
+
method: "GET",
|
235
|
+
config: {
|
236
|
+
params
|
237
|
+
}
|
238
|
+
}),
|
239
|
+
transformResponse: (response) => response.data
|
240
|
+
})
|
241
|
+
})
|
242
|
+
});
|
243
|
+
const { useGetManyDraftRelationCountQuery } = relationsApi;
|
244
|
+
const isErrorMessageDescriptor = (object) => {
|
245
|
+
return typeof object === "object" && object !== null && "id" in object && "defaultMessage" in object;
|
246
|
+
};
|
247
|
+
const EntryValidationText = ({ status = "draft", validationErrors }) => {
|
248
|
+
const { formatMessage } = reactIntl.useIntl();
|
249
|
+
const getErrorStr = (key, value) => {
|
250
|
+
if (typeof value === "string") {
|
251
|
+
return `${key}: ${value}`;
|
252
|
+
} else if (isErrorMessageDescriptor(value)) {
|
253
|
+
return `${key}: ${formatMessage(value)}`;
|
254
|
+
} else if (Array.isArray(value)) {
|
255
|
+
return value.map((v) => getErrorStr(key, v)).join(" ");
|
256
|
+
} else if (typeof value === "object" && !Array.isArray(value)) {
|
257
|
+
return Object.entries(value).map(([k, v]) => getErrorStr(k, v)).join(" ");
|
258
|
+
} else {
|
259
|
+
return "";
|
260
|
+
}
|
261
|
+
};
|
262
|
+
if (validationErrors) {
|
263
|
+
const validationErrorsMessages = Object.entries(validationErrors).map(([key, value]) => {
|
264
|
+
return getErrorStr(key, value);
|
265
|
+
}).join(" ");
|
266
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
267
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons.CrossCircle, { fill: "danger600" }),
|
268
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { label: validationErrorsMessages, children: /* @__PURE__ */ jsxRuntime.jsx(
|
269
|
+
designSystem.Typography,
|
270
|
+
{
|
271
|
+
maxWidth: "30rem",
|
272
|
+
textColor: "danger600",
|
273
|
+
variant: "omega",
|
274
|
+
fontWeight: "semiBold",
|
275
|
+
ellipsis: true,
|
276
|
+
children: validationErrorsMessages
|
277
|
+
}
|
278
|
+
) })
|
279
|
+
] });
|
280
|
+
}
|
281
|
+
if (status === "published") {
|
282
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
283
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons.CheckCircle, { fill: "success600" }),
|
284
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "success600", fontWeight: "bold", children: formatMessage({
|
285
|
+
id: "content-manager.bulk-publish.already-published",
|
286
|
+
defaultMessage: "Already Published"
|
287
|
+
}) })
|
288
|
+
] });
|
289
|
+
}
|
290
|
+
if (status === "modified") {
|
291
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
292
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons.ArrowsCounterClockwise, { fill: "alternative600" }),
|
293
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
|
294
|
+
id: "app.utils.ready-to-publish-changes",
|
295
|
+
defaultMessage: "Ready to publish changes"
|
296
|
+
}) })
|
297
|
+
] });
|
298
|
+
}
|
299
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
300
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons.CheckCircle, { fill: "success600" }),
|
301
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
|
302
|
+
id: "app.utils.ready-to-publish",
|
303
|
+
defaultMessage: "Ready to publish"
|
304
|
+
}) })
|
305
|
+
] });
|
306
|
+
};
|
307
|
+
const BoldChunk = (chunks) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontWeight: "bold", children: chunks });
|
308
|
+
const BulkLocaleActionModal = ({
|
309
|
+
headers,
|
310
|
+
rows,
|
311
|
+
localesMetadata,
|
312
|
+
validationErrors = {}
|
313
|
+
}) => {
|
314
|
+
const { formatMessage } = reactIntl.useIntl();
|
315
|
+
const selectedRows = strapiAdmin.useTable(
|
316
|
+
"BulkLocaleActionModal",
|
317
|
+
(state) => state.selectedRows
|
318
|
+
);
|
319
|
+
const getFormattedCountMessage = () => {
|
320
|
+
const currentStatusByLocale = rows.reduce((acc, { locale, status }) => {
|
321
|
+
acc[locale] = status;
|
322
|
+
return acc;
|
323
|
+
}, {});
|
324
|
+
const localesWithErrors = Object.keys(validationErrors);
|
325
|
+
const alreadyPublishedCount = selectedRows.filter(
|
326
|
+
({ locale }) => currentStatusByLocale[locale] === "published"
|
327
|
+
).length;
|
328
|
+
const readyToPublishCount = selectedRows.filter(
|
329
|
+
({ locale }) => (currentStatusByLocale[locale] === "draft" || currentStatusByLocale[locale] === "modified") && !localesWithErrors.includes(locale)
|
330
|
+
).length;
|
331
|
+
const withErrorsCount = localesWithErrors.length;
|
332
|
+
return formatMessage(
|
333
|
+
{
|
334
|
+
id: "content-manager.containers.list.selectedEntriesModal.selectedCount",
|
335
|
+
defaultMessage: "<b>{alreadyPublishedCount}</b> {alreadyPublishedCount, plural, =0 {entries} one {entry} other {entries}} already published. <b>{readyToPublishCount}</b> {readyToPublishCount, plural, =0 {entries} one {entry} other {entries}} ready to publish. <b>{withErrorsCount}</b> {withErrorsCount, plural, =0 {entries} one {entry} other {entries}} waiting for action."
|
336
|
+
},
|
337
|
+
{
|
338
|
+
withErrorsCount,
|
339
|
+
readyToPublishCount,
|
340
|
+
alreadyPublishedCount,
|
341
|
+
b: BoldChunk
|
342
|
+
}
|
343
|
+
);
|
344
|
+
};
|
345
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Modal.Body, { children: [
|
346
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: getFormattedCountMessage() }),
|
347
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { marginTop: 5, children: /* @__PURE__ */ jsxRuntime.jsxs(strapiAdmin.Table.Content, { children: [
|
348
|
+
/* @__PURE__ */ jsxRuntime.jsxs(strapiAdmin.Table.Head, { children: [
|
349
|
+
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.HeaderCheckboxCell, {}),
|
350
|
+
headers.map((head) => /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.HeaderCell, { ...head }, head.name))
|
351
|
+
] }),
|
352
|
+
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Body, { children: rows.map(({ locale, status }, index2) => {
|
353
|
+
const error = validationErrors?.[locale] ?? null;
|
354
|
+
const statusVariant = status === "draft" ? "primary" : status === "published" ? "success" : "alternative";
|
355
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(strapiAdmin.Table.Row, { children: [
|
356
|
+
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.CheckboxCell, { id: locale, "aria-label": `Select ${locale}` }),
|
357
|
+
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Cell, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", textColor: "neutral600", children: Array.isArray(localesMetadata) ? localesMetadata.find((localeEntry) => localeEntry.code === locale)?.name : locale }) }),
|
358
|
+
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Cell, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { display: "flex", children: /* @__PURE__ */ jsxRuntime.jsx(
|
359
|
+
designSystem.Status,
|
360
|
+
{
|
361
|
+
display: "flex",
|
362
|
+
paddingLeft: "6px",
|
363
|
+
paddingRight: "6px",
|
364
|
+
paddingTop: "2px",
|
365
|
+
paddingBottom: "2px",
|
366
|
+
showBullet: false,
|
367
|
+
size: "S",
|
368
|
+
variant: statusVariant,
|
369
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "span", variant: "pi", fontWeight: "bold", children: capitalize(status) })
|
370
|
+
}
|
371
|
+
) }) }),
|
372
|
+
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Cell, { children: /* @__PURE__ */ jsxRuntime.jsx(EntryValidationText, { validationErrors: error, status }) }),
|
373
|
+
/* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Cell, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
374
|
+
designSystem.IconButton,
|
375
|
+
{
|
376
|
+
tag: reactRouterDom.Link,
|
377
|
+
to: {
|
378
|
+
search: qs.stringify({ plugins: { i18n: { locale } } })
|
379
|
+
},
|
380
|
+
label: formatMessage(
|
381
|
+
{
|
382
|
+
id: getTranslation("Settings.list.actions.edit"),
|
383
|
+
defaultMessage: "Edit {name} locale"
|
384
|
+
},
|
385
|
+
{
|
386
|
+
name: locale
|
387
|
+
}
|
388
|
+
),
|
389
|
+
borderWidth: 0,
|
390
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(icons.Pencil, {})
|
391
|
+
}
|
392
|
+
) })
|
393
|
+
] }, index2);
|
394
|
+
}) })
|
395
|
+
] }) })
|
396
|
+
] });
|
397
|
+
};
|
295
398
|
const LocalePickerAction = ({
|
296
399
|
document,
|
297
400
|
meta,
|
@@ -300,7 +403,7 @@ const LocalePickerAction = ({
|
|
300
403
|
documentId
|
301
404
|
}) => {
|
302
405
|
const { formatMessage } = reactIntl.useIntl();
|
303
|
-
const [{ query }, setQuery] = strapiAdmin.useQueryParams();
|
406
|
+
const [{ query: query2 }, setQuery] = strapiAdmin.useQueryParams();
|
304
407
|
const { hasI18n, canCreate, canRead } = useI18n();
|
305
408
|
const { data: locales = [] } = useGetLocalesQuery();
|
306
409
|
const { schema } = strapiAdmin$1.unstable_useDocument({ model, collectionType, documentId });
|
@@ -308,30 +411,30 @@ const LocalePickerAction = ({
|
|
308
411
|
(value) => {
|
309
412
|
setQuery({
|
310
413
|
plugins: {
|
311
|
-
...
|
414
|
+
...query2.plugins,
|
312
415
|
i18n: {
|
313
416
|
locale: value
|
314
417
|
}
|
315
418
|
}
|
316
419
|
});
|
317
420
|
},
|
318
|
-
[
|
421
|
+
[query2.plugins, setQuery]
|
319
422
|
);
|
320
423
|
React__namespace.useEffect(() => {
|
321
424
|
if (!Array.isArray(locales) || !hasI18n) {
|
322
425
|
return;
|
323
426
|
}
|
324
|
-
const currentDesiredLocale =
|
427
|
+
const currentDesiredLocale = query2.plugins?.i18n?.locale;
|
325
428
|
const doesLocaleExist = locales.find((loc) => loc.code === currentDesiredLocale);
|
326
429
|
const defaultLocale = locales.find((locale) => locale.isDefault);
|
327
430
|
if (!doesLocaleExist && defaultLocale?.code) {
|
328
431
|
handleSelect(defaultLocale.code);
|
329
432
|
}
|
330
|
-
}, [handleSelect, hasI18n, locales,
|
433
|
+
}, [handleSelect, hasI18n, locales, query2.plugins?.i18n?.locale]);
|
331
434
|
if (!hasI18n || !Array.isArray(locales) || locales.length === 0) {
|
332
435
|
return null;
|
333
436
|
}
|
334
|
-
const currentLocale =
|
437
|
+
const currentLocale = query2.plugins?.i18n?.locale || locales.find((loc) => loc.isDefault)?.code;
|
335
438
|
const allCurrentLocales = [
|
336
439
|
{ status: getDocumentStatus(document, meta), locale: currentLocale },
|
337
440
|
...meta?.availableLocales ?? []
|
@@ -363,7 +466,7 @@ const LocalePickerAction = ({
|
|
363
466
|
showBullet: false,
|
364
467
|
size: "S",
|
365
468
|
variant: statusVariant,
|
366
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, {
|
469
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "span", variant: "pi", fontWeight: "bold", children: capitalize(status) })
|
367
470
|
}
|
368
471
|
) : null
|
369
472
|
};
|
@@ -414,7 +517,7 @@ const DeleteLocaleAction = ({
|
|
414
517
|
}),
|
415
518
|
content: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 2, children: [
|
416
519
|
/* @__PURE__ */ jsxRuntime.jsx(icons.WarningCircle, { width: "24px", height: "24px", fill: "danger600" }),
|
417
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, {
|
520
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "p", variant: "omega", textAlign: "center", children: formatMessage({
|
418
521
|
id: getTranslation("actions.delete.dialog.body"),
|
419
522
|
defaultMessage: "Are you sure?"
|
420
523
|
}) })
|
@@ -446,7 +549,239 @@ const DeleteLocaleAction = ({
|
|
446
549
|
}
|
447
550
|
};
|
448
551
|
};
|
449
|
-
const
|
552
|
+
const BulkLocalePublishAction = ({
|
553
|
+
document: baseDocument,
|
554
|
+
documentId,
|
555
|
+
model,
|
556
|
+
collectionType
|
557
|
+
}) => {
|
558
|
+
const baseLocale = baseDocument?.locale ?? null;
|
559
|
+
const [{ query: query$1 }] = strapiAdmin.useQueryParams();
|
560
|
+
const params = React__namespace.useMemo(() => strapiAdmin$1.buildValidParams(query$1), [query$1]);
|
561
|
+
const isPublishedTab = query$1.status === "published";
|
562
|
+
const { formatMessage } = reactIntl.useIntl();
|
563
|
+
const { hasI18n, canPublish } = useI18n();
|
564
|
+
const { toggleNotification } = strapiAdmin.useNotification();
|
565
|
+
const { _unstableFormatAPIError: formatAPIError } = strapiAdmin.useAPIErrorHandler();
|
566
|
+
const [selectedRows, setSelectedRows] = React__namespace.useState([]);
|
567
|
+
const [isDraftRelationConfirmationOpen, setIsDraftRelationConfirmationOpen] = React__namespace.useState(false);
|
568
|
+
const { publishMany: publishManyAction } = strapiAdmin$1.unstable_useDocumentActions();
|
569
|
+
const {
|
570
|
+
document,
|
571
|
+
meta: documentMeta,
|
572
|
+
schema,
|
573
|
+
validate
|
574
|
+
} = strapiAdmin$1.unstable_useDocument(
|
575
|
+
{
|
576
|
+
model,
|
577
|
+
collectionType,
|
578
|
+
documentId,
|
579
|
+
params: {
|
580
|
+
locale: baseLocale
|
581
|
+
}
|
582
|
+
},
|
583
|
+
{
|
584
|
+
skip: !hasI18n
|
585
|
+
}
|
586
|
+
);
|
587
|
+
const { data: localesMetadata = [] } = useGetLocalesQuery(hasI18n ? void 0 : query.skipToken);
|
588
|
+
const headers = [
|
589
|
+
{
|
590
|
+
label: formatMessage({
|
591
|
+
id: "global.name",
|
592
|
+
defaultMessage: "Name"
|
593
|
+
}),
|
594
|
+
name: "name"
|
595
|
+
},
|
596
|
+
{
|
597
|
+
label: formatMessage({
|
598
|
+
id: getTranslation("CMEditViewBulkLocale.status"),
|
599
|
+
defaultMessage: "Status"
|
600
|
+
}),
|
601
|
+
name: "status"
|
602
|
+
},
|
603
|
+
{
|
604
|
+
label: formatMessage({
|
605
|
+
id: getTranslation("CMEditViewBulkLocale.publication-status"),
|
606
|
+
defaultMessage: "Publication Status"
|
607
|
+
}),
|
608
|
+
name: "publication-status"
|
609
|
+
}
|
610
|
+
];
|
611
|
+
const [rows, validationErrors] = React__namespace.useMemo(() => {
|
612
|
+
if (!document || !documentMeta?.availableLocales) {
|
613
|
+
return [[], {}];
|
614
|
+
}
|
615
|
+
const rowsFromMeta = documentMeta?.availableLocales.map((doc) => {
|
616
|
+
const { locale, status } = doc;
|
617
|
+
return { locale, status };
|
618
|
+
});
|
619
|
+
rowsFromMeta.unshift({
|
620
|
+
locale: document.locale,
|
621
|
+
status: document.status
|
622
|
+
});
|
623
|
+
const allDocuments = [document, ...documentMeta?.availableLocales ?? []];
|
624
|
+
const errors = allDocuments.reduce((errs, document2) => {
|
625
|
+
if (!document2) {
|
626
|
+
return errs;
|
627
|
+
}
|
628
|
+
const validation = validate(document2);
|
629
|
+
if (validation !== null) {
|
630
|
+
errs[document2.locale] = validation;
|
631
|
+
}
|
632
|
+
return errs;
|
633
|
+
}, {});
|
634
|
+
return [rowsFromMeta, errors];
|
635
|
+
}, [document, documentMeta?.availableLocales, validate]);
|
636
|
+
const localesToPublish = selectedRows.reduce((acc, selectedRow) => {
|
637
|
+
if (selectedRow.status !== "published" && !Object.keys(validationErrors).includes(selectedRow.locale)) {
|
638
|
+
acc.push(selectedRow.locale);
|
639
|
+
}
|
640
|
+
return acc;
|
641
|
+
}, []);
|
642
|
+
const {
|
643
|
+
data: draftRelationsCount = 0,
|
644
|
+
isLoading: isDraftRelationsLoading,
|
645
|
+
error: isDraftRelationsError
|
646
|
+
} = useGetManyDraftRelationCountQuery(
|
647
|
+
{
|
648
|
+
model,
|
649
|
+
documentIds: [documentId],
|
650
|
+
locale: localesToPublish
|
651
|
+
},
|
652
|
+
{
|
653
|
+
skip: !documentId || localesToPublish.length === 0
|
654
|
+
}
|
655
|
+
);
|
656
|
+
React__namespace.useEffect(() => {
|
657
|
+
if (isDraftRelationsError) {
|
658
|
+
toggleNotification({
|
659
|
+
type: "danger",
|
660
|
+
message: formatAPIError(isDraftRelationsError)
|
661
|
+
});
|
662
|
+
}
|
663
|
+
}, [isDraftRelationsError, toggleNotification, formatAPIError]);
|
664
|
+
if (!schema?.options?.draftAndPublish) {
|
665
|
+
return null;
|
666
|
+
}
|
667
|
+
if (!hasI18n) {
|
668
|
+
return null;
|
669
|
+
}
|
670
|
+
if (!documentId) {
|
671
|
+
return null;
|
672
|
+
}
|
673
|
+
const publish = async () => {
|
674
|
+
await publishManyAction({
|
675
|
+
model,
|
676
|
+
documentIds: [documentId],
|
677
|
+
params: {
|
678
|
+
...params,
|
679
|
+
locale: localesToPublish
|
680
|
+
}
|
681
|
+
});
|
682
|
+
setSelectedRows([]);
|
683
|
+
};
|
684
|
+
const handleAction = async () => {
|
685
|
+
if (draftRelationsCount > 0) {
|
686
|
+
setIsDraftRelationConfirmationOpen(true);
|
687
|
+
} else {
|
688
|
+
await publish();
|
689
|
+
}
|
690
|
+
};
|
691
|
+
const isUnpublish = document?.status === "published";
|
692
|
+
if (isUnpublish) {
|
693
|
+
console.warn(["I18N"], "Bulk locale unpublish modal not implemented");
|
694
|
+
}
|
695
|
+
if (isDraftRelationConfirmationOpen) {
|
696
|
+
return {
|
697
|
+
label: formatMessage({
|
698
|
+
id: "app.components.ConfirmDialog.title",
|
699
|
+
defaultMessage: "Confirmation"
|
700
|
+
}),
|
701
|
+
variant: "danger",
|
702
|
+
dialog: {
|
703
|
+
onCancel: () => {
|
704
|
+
setIsDraftRelationConfirmationOpen(false);
|
705
|
+
},
|
706
|
+
onConfirm: async () => {
|
707
|
+
await publish();
|
708
|
+
setIsDraftRelationConfirmationOpen(false);
|
709
|
+
},
|
710
|
+
type: "dialog",
|
711
|
+
title: formatMessage({
|
712
|
+
id: getTranslation("actions.publish.dialog.title"),
|
713
|
+
defaultMessage: "Confirmation"
|
714
|
+
}),
|
715
|
+
content: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "center", gap: 2, children: [
|
716
|
+
/* @__PURE__ */ jsxRuntime.jsx(icons.WarningCircle, { width: "2.4rem", height: "2.4rem", fill: "danger600" }),
|
717
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textAlign: "center", children: formatMessage({
|
718
|
+
id: getTranslation("CMEditViewBulkLocale.draft-relation-warning"),
|
719
|
+
defaultMessage: "Some locales are related to draft entries. Publishing them could leave broken links in your app."
|
720
|
+
}) }),
|
721
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textAlign: "center", children: formatMessage({
|
722
|
+
id: getTranslation("CMEditViewBulkLocale.continue-confirmation"),
|
723
|
+
defaultMessage: "Are you sure you want to continue?"
|
724
|
+
}) })
|
725
|
+
] })
|
726
|
+
}
|
727
|
+
};
|
728
|
+
}
|
729
|
+
const hasPermission = selectedRows.map(({ locale }) => locale).every((locale) => canPublish.includes(locale));
|
730
|
+
return {
|
731
|
+
label: formatMessage({
|
732
|
+
id: getTranslation("CMEditViewBulkLocale.publish-title"),
|
733
|
+
defaultMessage: "Publish Multiple Locales"
|
734
|
+
}),
|
735
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(icons.ListPlus, {}),
|
736
|
+
disabled: isPublishedTab || canPublish.length === 0,
|
737
|
+
position: ["panel"],
|
738
|
+
variant: "secondary",
|
739
|
+
dialog: {
|
740
|
+
type: "modal",
|
741
|
+
title: formatMessage({
|
742
|
+
id: getTranslation("CMEditViewBulkLocale.publish-title"),
|
743
|
+
defaultMessage: "Publish Multiple Locales"
|
744
|
+
}),
|
745
|
+
content: () => {
|
746
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
747
|
+
strapiAdmin.Table.Root,
|
748
|
+
{
|
749
|
+
headers,
|
750
|
+
rows: rows.map((row) => ({
|
751
|
+
...row,
|
752
|
+
id: row.locale
|
753
|
+
})),
|
754
|
+
selectedRows,
|
755
|
+
onSelectedRowsChange: (tableSelectedRows) => setSelectedRows(tableSelectedRows),
|
756
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
757
|
+
BulkLocaleActionModal,
|
758
|
+
{
|
759
|
+
validationErrors,
|
760
|
+
headers,
|
761
|
+
rows,
|
762
|
+
localesMetadata
|
763
|
+
}
|
764
|
+
)
|
765
|
+
}
|
766
|
+
);
|
767
|
+
},
|
768
|
+
footer: () => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Footer, { justifyContent: "flex-end", children: /* @__PURE__ */ jsxRuntime.jsx(
|
769
|
+
designSystem.Button,
|
770
|
+
{
|
771
|
+
loading: isDraftRelationsLoading,
|
772
|
+
disabled: !hasPermission || localesToPublish.length === 0,
|
773
|
+
variant: "default",
|
774
|
+
onClick: handleAction,
|
775
|
+
children: formatMessage({
|
776
|
+
id: "app.utils.publish",
|
777
|
+
defaultMessage: "Publish"
|
778
|
+
})
|
779
|
+
}
|
780
|
+
) })
|
781
|
+
}
|
782
|
+
};
|
783
|
+
};
|
784
|
+
const StyledTrash = styledComponents.styled(icons.Trash)`
|
450
785
|
path {
|
451
786
|
fill: currentColor;
|
452
787
|
}
|
@@ -502,16 +837,9 @@ const UnpublishModalAdditionalInfo = () => {
|
|
502
837
|
}
|
503
838
|
) });
|
504
839
|
};
|
505
|
-
const Initializer = ({ setPlugin }) => {
|
506
|
-
const setPluginRef = React__namespace.useRef(setPlugin);
|
507
|
-
React__namespace.useEffect(() => {
|
508
|
-
setPluginRef.current(pluginId);
|
509
|
-
}, []);
|
510
|
-
return null;
|
511
|
-
};
|
512
840
|
const LocalePicker = () => {
|
513
841
|
const { formatMessage } = reactIntl.useIntl();
|
514
|
-
const [{ query }, setQuery] = strapiAdmin.useQueryParams();
|
842
|
+
const [{ query: query2 }, setQuery] = strapiAdmin.useQueryParams();
|
515
843
|
const { hasI18n, canRead, canCreate } = useI18n();
|
516
844
|
const { data: locales = [] } = useGetLocalesQuery(void 0, {
|
517
845
|
skip: !hasI18n
|
@@ -521,25 +849,25 @@ const LocalePicker = () => {
|
|
521
849
|
setQuery(
|
522
850
|
{
|
523
851
|
page: 1,
|
524
|
-
plugins: { ...
|
852
|
+
plugins: { ...query2.plugins, i18n: { locale: code } }
|
525
853
|
},
|
526
854
|
"push",
|
527
855
|
replace
|
528
856
|
);
|
529
857
|
},
|
530
|
-
[
|
858
|
+
[query2.plugins, setQuery]
|
531
859
|
);
|
532
860
|
React__namespace.useEffect(() => {
|
533
861
|
if (!Array.isArray(locales) || !hasI18n) {
|
534
862
|
return;
|
535
863
|
}
|
536
|
-
const currentDesiredLocale =
|
864
|
+
const currentDesiredLocale = query2.plugins?.i18n?.locale;
|
537
865
|
const doesLocaleExist = locales.find((loc) => loc.code === currentDesiredLocale);
|
538
866
|
const defaultLocale = locales.find((locale) => locale.isDefault);
|
539
867
|
if (!doesLocaleExist && defaultLocale?.code) {
|
540
868
|
handleChange(defaultLocale.code, true);
|
541
869
|
}
|
542
|
-
}, [hasI18n, handleChange, locales,
|
870
|
+
}, [hasI18n, handleChange, locales, query2.plugins?.i18n?.locale]);
|
543
871
|
if (!hasI18n || !Array.isArray(locales) || locales.length === 0) {
|
544
872
|
return null;
|
545
873
|
}
|
@@ -554,7 +882,7 @@ const LocalePicker = () => {
|
|
554
882
|
id: getTranslation("actions.select-locale"),
|
555
883
|
defaultMessage: "Select locale"
|
556
884
|
}),
|
557
|
-
value:
|
885
|
+
value: query2.plugins?.i18n?.locale || locales.find((locale) => locale.isDefault)?.code,
|
558
886
|
onChange: handleChange,
|
559
887
|
children: displayedLocales.map((locale) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: locale.code, children: locale.name }, locale.id))
|
560
888
|
}
|
@@ -568,7 +896,7 @@ const PERMISSIONS = {
|
|
568
896
|
read: [{ action: "plugin::i18n.locale.read", subject: null }]
|
569
897
|
};
|
570
898
|
const mutateEditViewHook = ({ layout }) => {
|
571
|
-
if ("i18n" in layout.options
|
899
|
+
if (!("i18n" in layout.options) || typeof layout.options.i18n === "object" && layout.options.i18n !== null && "localized" in layout.options.i18n && !layout.options.i18n.localized) {
|
572
900
|
return { layout };
|
573
901
|
}
|
574
902
|
const components = Object.entries(layout.components).reduce(
|
@@ -613,8 +941,8 @@ const doesFieldHaveI18nPluginOpt = (pluginOpts) => {
|
|
613
941
|
};
|
614
942
|
const LabelAction = ({ title, icon }) => {
|
615
943
|
const { formatMessage } = reactIntl.useIntl();
|
616
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Span, {
|
617
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.VisuallyHidden, {
|
944
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Span, { tag: "span", children: [
|
945
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.VisuallyHidden, { tag: "span", children: formatMessage(title) }),
|
618
946
|
React__namespace.cloneElement(icon, {
|
619
947
|
"aria-hidden": true,
|
620
948
|
focusable: false
|
@@ -622,7 +950,7 @@ const LabelAction = ({ title, icon }) => {
|
|
622
950
|
})
|
623
951
|
] });
|
624
952
|
};
|
625
|
-
const Span =
|
953
|
+
const Span = styledComponents.styled(designSystem.Flex)`
|
626
954
|
svg {
|
627
955
|
width: 12px;
|
628
956
|
height: 12px;
|
@@ -649,13 +977,7 @@ const LocaleListCell = ({
|
|
649
977
|
}
|
650
978
|
});
|
651
979
|
const { locale: language } = reactIntl.useIntl();
|
652
|
-
const [visible, setVisible] = React__namespace.useState(false);
|
653
|
-
const buttonRef = React__namespace.useRef(null);
|
654
980
|
const { data: locales = [] } = useGetLocalesQuery();
|
655
|
-
const handleTogglePopover = (e) => {
|
656
|
-
e.stopPropagation();
|
657
|
-
setVisible((prev) => !prev);
|
658
|
-
};
|
659
981
|
const formatter = designSystem.useCollator(language, {
|
660
982
|
sensitivity: "base"
|
661
983
|
});
|
@@ -677,8 +999,8 @@ const LocaleListCell = ({
|
|
677
999
|
}
|
678
1000
|
return locale.name;
|
679
1001
|
}).toSorted((a, b) => formatter.compare(a, b));
|
680
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
681
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
1002
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Popover.Root, { children: [
|
1003
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(Button, { type: "button", onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsxRuntime.jsxs(
|
682
1004
|
ActionWrapper,
|
683
1005
|
{
|
684
1006
|
minWidth: "100%",
|
@@ -691,20 +1013,11 @@ const LocaleListCell = ({
|
|
691
1013
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { children: /* @__PURE__ */ jsxRuntime.jsx(icons.CaretDown, {}) })
|
692
1014
|
]
|
693
1015
|
}
|
694
|
-
),
|
695
|
-
|
696
|
-
designSystem.Popover,
|
697
|
-
{
|
698
|
-
onDismiss: () => setVisible(false),
|
699
|
-
source: buttonRef,
|
700
|
-
spacing: 16,
|
701
|
-
centered: true,
|
702
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("ul", { children: localesForDocument.map((name) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 3, as: "li", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: name }) }, name)) })
|
703
|
-
}
|
704
|
-
)
|
1016
|
+
) }) }),
|
1017
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Content, { sideOffset: 16, children: /* @__PURE__ */ jsxRuntime.jsx("ul", { children: localesForDocument.map((name) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 3, tag: "li", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: name }) }, name)) }) })
|
705
1018
|
] });
|
706
1019
|
};
|
707
|
-
const Button =
|
1020
|
+
const Button = styledComponents.styled.button`
|
708
1021
|
width: 100%;
|
709
1022
|
|
710
1023
|
svg {
|
@@ -730,7 +1043,7 @@ const Button = styled__default.default.button`
|
|
730
1043
|
}
|
731
1044
|
}
|
732
1045
|
`;
|
733
|
-
const ActionWrapper =
|
1046
|
+
const ActionWrapper = styledComponents.styled(designSystem.Flex)`
|
734
1047
|
svg {
|
735
1048
|
height: 0.4rem;
|
736
1049
|
}
|
@@ -763,18 +1076,11 @@ const addColumnToTableHook = ({ displayedHeaders, layout }) => {
|
|
763
1076
|
const addLocaleToReleasesHook = ({ displayedHeaders = [] }) => {
|
764
1077
|
return {
|
765
1078
|
displayedHeaders: [
|
766
|
-
|
767
|
-
// ...displayedHeaders,
|
1079
|
+
...displayedHeaders,
|
768
1080
|
{
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
label: {
|
773
|
-
id: "content-releases.page.ReleaseDetails.table.header.label.locale",
|
774
|
-
defaultMessage: "locale"
|
775
|
-
},
|
776
|
-
searchable: false,
|
777
|
-
sortable: false
|
1081
|
+
label: {
|
1082
|
+
id: "content-releases.page.ReleaseDetails.table.header.label.locale",
|
1083
|
+
defaultMessage: "locale"
|
778
1084
|
},
|
779
1085
|
name: "locale"
|
780
1086
|
}
|
@@ -922,8 +1228,6 @@ const index = {
|
|
922
1228
|
app.addRBACMiddleware([localeMiddleware]);
|
923
1229
|
app.registerPlugin({
|
924
1230
|
id: pluginId,
|
925
|
-
initializer: Initializer,
|
926
|
-
isReady: false,
|
927
1231
|
name: pluginId
|
928
1232
|
});
|
929
1233
|
},
|
@@ -941,7 +1245,7 @@ const index = {
|
|
941
1245
|
},
|
942
1246
|
id: "internationalization",
|
943
1247
|
to: "internationalization",
|
944
|
-
Component: () => Promise.resolve().then(() => require("./SettingsPage-
|
1248
|
+
Component: () => Promise.resolve().then(() => require("./SettingsPage-DA9haizZ.js")).then((mod) => ({ default: mod.ProtectedSettingsPage })),
|
945
1249
|
permissions: PERMISSIONS.accessMain
|
946
1250
|
});
|
947
1251
|
const contentManager = app.getPlugin("content-manager");
|
@@ -951,6 +1255,10 @@ const index = {
|
|
951
1255
|
actions.splice(indexOfDeleteAction, 0, DeleteLocaleAction);
|
952
1256
|
return actions;
|
953
1257
|
});
|
1258
|
+
contentManager.apis.addDocumentAction((actions) => {
|
1259
|
+
actions.splice(2, 0, BulkLocalePublishAction);
|
1260
|
+
return actions;
|
1261
|
+
});
|
954
1262
|
contentManager.injectComponent("listView", "actions", {
|
955
1263
|
name: "i18n-locale-filter",
|
956
1264
|
Component: LocalePicker
|
@@ -1054,7 +1362,7 @@ const index = {
|
|
1054
1362
|
async registerTrads({ locales }) {
|
1055
1363
|
const importedTrads = await Promise.all(
|
1056
1364
|
locales.map((locale) => {
|
1057
|
-
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/de.json": () => Promise.resolve().then(() => require("./de-DtWiGdHl.js")), "./translations/dk.json": () => Promise.resolve().then(() => require("./dk-D8C-casx.js")), "./translations/en.json": () => Promise.resolve().then(() => require("./en-
|
1365
|
+
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/de.json": () => Promise.resolve().then(() => require("./de-DtWiGdHl.js")), "./translations/dk.json": () => Promise.resolve().then(() => require("./dk-D8C-casx.js")), "./translations/en.json": () => Promise.resolve().then(() => require("./en-BsOU9o5z.js")), "./translations/es.json": () => Promise.resolve().then(() => require("./es-DS-XFGSw.js")), "./translations/fr.json": () => Promise.resolve().then(() => require("./fr-BTjekDpq.js")), "./translations/ko.json": () => Promise.resolve().then(() => require("./ko-DmcGUBQ3.js")), "./translations/pl.json": () => Promise.resolve().then(() => require("./pl-Cn5RYonZ.js")), "./translations/ru.json": () => Promise.resolve().then(() => require("./ru-BMBgVL3s.js")), "./translations/tr.json": () => Promise.resolve().then(() => require("./tr-CarUU76c.js")), "./translations/zh-Hans.json": () => Promise.resolve().then(() => require("./zh-Hans-DSHIXAa3.js")), "./translations/zh.json": () => Promise.resolve().then(() => require("./zh-CukOviB0.js")) }), `./translations/${locale}.json`).then(({ default: data }) => {
|
1058
1366
|
return {
|
1059
1367
|
data: prefixPluginTranslations(data, pluginId),
|
1060
1368
|
locale
|
@@ -1073,10 +1381,9 @@ const index = {
|
|
1073
1381
|
exports.PERMISSIONS = PERMISSIONS;
|
1074
1382
|
exports.getTranslation = getTranslation;
|
1075
1383
|
exports.index = index;
|
1076
|
-
exports.isBaseQueryError = isBaseQueryError;
|
1077
1384
|
exports.useCreateLocaleMutation = useCreateLocaleMutation;
|
1078
1385
|
exports.useDeleteLocaleMutation = useDeleteLocaleMutation;
|
1079
1386
|
exports.useGetDefaultLocalesQuery = useGetDefaultLocalesQuery;
|
1080
1387
|
exports.useGetLocalesQuery = useGetLocalesQuery;
|
1081
1388
|
exports.useUpdateLocaleMutation = useUpdateLocaleMutation;
|
1082
|
-
//# sourceMappingURL=index-
|
1389
|
+
//# sourceMappingURL=index-DIzVXZoE.js.map
|