@parhelia/localization 0.4.13049 → 0.4.13170

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 (50) hide show
  1. package/LICENSE +1 -1
  2. package/dist/LocalizeItemCommand.d.ts.map +1 -1
  3. package/dist/LocalizeItemCommand.js +0 -1
  4. package/dist/LocalizeItemDialog.d.ts.map +1 -1
  5. package/dist/LocalizeItemDialog.js +3 -9
  6. package/dist/LocalizeItemUtils.d.ts +0 -1
  7. package/dist/LocalizeItemUtils.d.ts.map +1 -1
  8. package/dist/LocalizeItemUtils.js +24 -45
  9. package/dist/api/discovery.d.ts +3 -17
  10. package/dist/api/discovery.d.ts.map +1 -1
  11. package/dist/api/discovery.js +14 -35
  12. package/dist/hooks/useTranslationWizard.d.ts.map +1 -1
  13. package/dist/hooks/useTranslationWizard.js +2 -10
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +4 -6
  16. package/dist/services/translationService.d.ts +27 -43
  17. package/dist/services/translationService.d.ts.map +1 -1
  18. package/dist/services/translationService.js +32 -36
  19. package/dist/settings/TranslationServicesPanel.d.ts +4 -14
  20. package/dist/settings/TranslationServicesPanel.d.ts.map +1 -1
  21. package/dist/settings/TranslationServicesPanel.js +263 -186
  22. package/dist/setup/LocalizationSetupStep.d.ts.map +1 -1
  23. package/dist/setup/LocalizationSetupStep.js +33 -14
  24. package/dist/sidebar/TranslationSidebar.d.ts.map +1 -1
  25. package/dist/sidebar/TranslationSidebar.js +14 -35
  26. package/dist/steps/ItemSelectionTree.d.ts +2 -2
  27. package/dist/steps/ItemSelectionTree.d.ts.map +1 -1
  28. package/dist/steps/ItemSelectionTree.js +47 -132
  29. package/dist/steps/ProviderStep.d.ts.map +1 -1
  30. package/dist/steps/ProviderStep.js +42 -55
  31. package/dist/steps/ServiceLanguageSelectionStep.d.ts +1 -1
  32. package/dist/steps/ServiceLanguageSelectionStep.d.ts.map +1 -1
  33. package/dist/steps/ServiceLanguageSelectionStep.js +176 -127
  34. package/dist/steps/types.d.ts +3 -3
  35. package/dist/steps/types.d.ts.map +1 -1
  36. package/dist/translation-center/TranslationBatches.d.ts +0 -37
  37. package/dist/translation-center/TranslationBatches.d.ts.map +1 -1
  38. package/dist/translation-center/TranslationBatches.js +78 -214
  39. package/dist/types.d.ts +0 -1
  40. package/dist/types.d.ts.map +1 -1
  41. package/package.json +3 -2
  42. package/dist/services/translationSettingsService.d.ts +0 -79
  43. package/dist/services/translationSettingsService.d.ts.map +0 -1
  44. package/dist/services/translationSettingsService.js +0 -68
  45. package/dist/settings/ExcludedContentTypeDialog.d.ts +0 -12
  46. package/dist/settings/ExcludedContentTypeDialog.d.ts.map +0 -1
  47. package/dist/settings/ExcludedContentTypeDialog.js +0 -29
  48. package/dist/settings/TranslationProviderDialog.d.ts +0 -18
  49. package/dist/settings/TranslationProviderDialog.d.ts.map +0 -1
  50. package/dist/settings/TranslationProviderDialog.js +0 -105
@@ -1,214 +1,291 @@
1
1
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useCallback, useEffect, useMemo, useState, } from "react";
3
- import { AlertCircle, Languages, Pencil, Plus, Save, SlidersHorizontal, X, } from "lucide-react";
4
- import { Alert, AlertDescription, Badge, Button, DeleteButton, Input, LoadingState, SettingsCard, SettingsEmptyState, SettingsList, SettingsListItem, SettingsPanelLayout, SettingsRow, SimpleIconButton, Switch, settingsText, useEditContext, } from "@parhelia/core";
5
- import { translationSettingsService, } from "../services/translationSettingsService";
6
- import { TranslationProviderDialog } from "./TranslationProviderDialog";
7
- import { ExcludedContentTypeDialog } from "./ExcludedContentTypeDialog";
8
- const errorText = (error, fallback) => error instanceof Error ? error.message : fallback;
9
- const draftOf = (values) => ({
10
- maxConcurrentTranslationJobs: String(values.maxConcurrentTranslationJobs),
11
- maxConcurrentJobsPerBatch: String(values.maxConcurrentJobsPerBatch),
12
- skipSharedFields: values.skipSharedFields,
13
- displayCosts: values.displayCosts,
14
- excludedContentTypes: values.excludedContentTypes,
15
- });
16
- /** An excluded type by its name; a key no mounted store knows any more by the key, so it can still be removed. */
17
- const typeLabel = (type) => type.known ? type.name : `Unknown type ${type.key}`;
18
- const keysOf = (types) => types.map((type) => type.key);
19
- const sameKeys = (a, b) => keysOf(a).join("\n") === keysOf(b).join("\n");
20
- /** What a save sends: only the settings the person changed. */
21
- export function settingsChanges(draft, saved) {
22
- const set = {};
23
- const jobs = Number(draft.maxConcurrentTranslationJobs);
24
- if (draft.maxConcurrentTranslationJobs.trim() !== "" &&
25
- jobs !== saved.maxConcurrentTranslationJobs)
26
- set.maxConcurrentTranslationJobs = jobs;
27
- const perBatch = Number(draft.maxConcurrentJobsPerBatch);
28
- if (draft.maxConcurrentJobsPerBatch.trim() !== "" &&
29
- perBatch !== saved.maxConcurrentJobsPerBatch)
30
- set.maxConcurrentJobsPerBatch = perBatch;
31
- if (draft.skipSharedFields !== saved.skipSharedFields)
32
- set.skipSharedFields = draft.skipSharedFields;
33
- if (draft.displayCosts !== saved.displayCosts)
34
- set.displayCosts = draft.displayCosts;
35
- if (!sameKeys(draft.excludedContentTypes, saved.excludedContentTypes))
36
- set.excludedContentTypes = keysOf(draft.excludedContentTypes);
37
- return set;
38
- }
2
+ import { useCallback, useState, useEffect, } from "react";
3
+ import { Button, Card, useEditContext, Splitter, ItemConfigPanel, DeleteIcon, } from "@parhelia/core";
4
+ import { CheckCircle as LucideCheckCircle, AlertCircle as LucideAlertCircle, RefreshCw as LucideRefreshCw, Plus as LucidePlus, Settings as LucideSettings, Languages as LucideLanguages, ListChecks as LucideListChecks, } from "lucide-react";
5
+ import { getAvailableTranslationServices, createProviderSettings, getTranslationStructure, ensureTranslationStructure, } from "../services/translationService";
6
+ const CheckCircleIcon = LucideCheckCircle;
7
+ const AlertCircleIcon = LucideAlertCircle;
8
+ const RefreshCwIcon = LucideRefreshCw;
9
+ const PlusIcon = LucidePlus;
10
+ const SettingsIcon = LucideSettings;
11
+ const LanguagesIcon = LucideLanguages;
12
+ const ListChecksIcon = LucideListChecks;
13
+ const DEFAULT_STRUCTURE_SETTINGS = {
14
+ translationFolderPath: "/sitecore/system/Parhelia/Settings/Translation",
15
+ translationFolderTemplateId: "b1e40cfe-6e36-4a0e-a49e-19c10b2127b7",
16
+ translationProvidersPath: "/sitecore/system/Parhelia/Settings/Translation/Translation Providers",
17
+ translationProvidersTemplateId: "1e7ee67d-fab9-47c8-b159-d4002f1a84f9",
18
+ };
39
19
  /**
40
- * One translation setting as a settings row. Whether the customer set it comes from the server (`customized`), never
41
- * from comparing values here: a customized setting shows "Customized" and a reset, which removes the customer's value so
42
- * the setting follows the shipped default again (the way System Settings shows its root settings).
43
- */
44
- function TranslationSettingRow({ name, page, busy, onReset, label, htmlFor, hint, toggle, control, children, }) {
45
- const customized = page.customized.includes(name);
46
- return (_jsx(SettingsRow, { "data-testid": `translation-setting-state-${name}`, "data-customized": customized ? "true" : "false", htmlFor: htmlFor, label: _jsxs("span", { className: "flex items-center gap-2", children: [label, customized && _jsx("span", { className: settingsText.meta, children: "Customized" })] }), description: hint || customized ? (_jsxs(_Fragment, { children: [hint, customized && (_jsx("div", { children: _jsx(Button, { variant: "link", size: "xxs", className: "h-auto px-0 text-xs", onClick: () => onReset(name), disabled: busy, "data-testid": `translation-setting-reset-${name}`, children: "Reset to default" }) }))] })) : undefined, toggle: toggle, control: control, children: children }));
47
- }
48
- /**
49
- * Settings → Localization → Translation Services, on every host and every CMS: which translation services are set up
50
- * (each with the fields its service declares), and how translation runs.
20
+ * Settings panel for Translation Services configuration.
21
+ * Configure translation services (OpenAI, Azure, DeepL, etc.) registered in DI.
51
22
  */
52
23
  export function TranslationServicesPanel() {
53
24
  const editContext = useEditContext();
54
- const [page, setPage] = useState(null);
55
- const [loadError, setLoadError] = useState(null);
56
- const [providerError, setProviderError] = useState(null);
57
- const [busyProvider, setBusyProvider] = useState(null);
58
- const [editing, setEditing] = useState(null);
59
- const [dialogError, setDialogError] = useState(null);
60
- const [draft, setDraft] = useState(null);
61
- const [settingsError, setSettingsError] = useState(null);
62
- const [savingSettings, setSavingSettings] = useState(false);
63
- const [typeDialog, setTypeDialog] = useState(false);
64
- const [typeError, setTypeError] = useState(null);
65
- const [readingType, setReadingType] = useState(false);
66
- const apply = useCallback((next) => {
67
- setPage(next);
68
- setDraft(draftOf(next.settings));
25
+ const [state, setState] = useState("loading");
26
+ const [services, setServices] = useState([]);
27
+ const [error, setError] = useState(null);
28
+ const [selectedConfigTarget, setSelectedConfigTarget] = useState(null);
29
+ const [structureSettings, setStructureSettings] = useState(DEFAULT_STRUCTURE_SETTINGS);
30
+ const [structureState, setStructureState] = useState(null);
31
+ const [structureLoading, setStructureLoading] = useState(false);
32
+ const [ensuringStructure, setEnsuringStructure] = useState(false);
33
+ const handleOpenConfig = useCallback((service) => {
34
+ if (service.isConfigured && service.settingsItemId) {
35
+ setSelectedConfigTarget({
36
+ key: `service:${service.serviceName}`,
37
+ itemId: service.settingsItemId,
38
+ title: `Configure: ${service.displayName || service.serviceName}`,
39
+ });
40
+ }
69
41
  }, []);
70
- useEffect(() => {
71
- let cancelled = false;
72
- translationSettingsService
73
- .get()
74
- .then((next) => !cancelled && apply(next))
75
- .catch((error) => !cancelled &&
76
- setLoadError(errorText(error, "Failed to load the translation settings")));
77
- return () => {
78
- cancelled = true;
79
- };
80
- }, [apply]);
81
- const changes = useMemo(() => (page && draft ? settingsChanges(draft, page.settings) : {}), [page, draft]);
82
- const dirty = Object.keys(changes).length > 0;
83
- if (loadError)
84
- return (_jsx(SettingsPanelLayout, { testId: "translation-services-panel", children: _jsxs(Alert, { variant: "destructive", children: [_jsx(AlertCircle, { className: "h-4 w-4", strokeWidth: 1 }), _jsx(AlertDescription, { children: loadError })] }) }));
85
- if (!page || !draft)
86
- return (_jsx(SettingsPanelLayout, { testId: "translation-services-panel", children: _jsx(SettingsCard, { icon: _jsx(Languages, { strokeWidth: 1 }), title: "Translation providers", description: "The translation services of this installation. People can pick a service for translation once it is set up.", children: _jsx(LoadingState, { variant: "inline", message: "Loading translation settings" }) }) }));
87
- const createProvider = async (provider) => {
88
- setBusyProvider(provider.serviceName);
89
- setProviderError(null);
42
+ const handleOpenStructureConfig = useCallback((itemId, title) => {
43
+ setSelectedConfigTarget({
44
+ key: `structure:${itemId}`,
45
+ itemId,
46
+ title,
47
+ });
48
+ }, []);
49
+ const handleCloseConfig = useCallback(() => {
50
+ setSelectedConfigTarget(null);
51
+ }, []);
52
+ const loadStructure = useCallback(async () => {
90
53
  try {
91
- const next = await translationSettingsService.saveProvider(provider.serviceName, {});
92
- apply(next);
93
- setDialogError(null);
94
- setEditing(next.providers.find((candidate) => candidate.serviceName === provider.serviceName) ?? null);
54
+ setStructureLoading(true);
55
+ const result = await getTranslationStructure(structureSettings);
56
+ if (result.type === "success" && result.data) {
57
+ if (result.data.success && result.data.data) {
58
+ setStructureState(result.data.data);
59
+ }
60
+ else {
61
+ throw new Error(result.data.error ||
62
+ result.details ||
63
+ "Failed to read translation structure");
64
+ }
65
+ }
66
+ else {
67
+ throw new Error(result.details || "Failed to read translation structure");
68
+ }
95
69
  }
96
- catch (error) {
97
- setProviderError(errorText(error, "Failed to create the settings"));
70
+ catch (e) {
71
+ setError(e?.message || "Failed to read translation structure");
98
72
  }
99
73
  finally {
100
- setBusyProvider(null);
74
+ setStructureLoading(false);
101
75
  }
102
- };
103
- const saveProvider = async (values) => {
104
- if (!editing)
105
- return;
106
- setBusyProvider(editing.serviceName);
107
- setDialogError(null);
76
+ }, [structureSettings]);
77
+ const ensureStructure = useCallback(async () => {
108
78
  try {
109
- apply(await translationSettingsService.saveProvider(editing.serviceName, values));
110
- setEditing(null);
79
+ setEnsuringStructure(true);
80
+ setError(null);
81
+ const result = await ensureTranslationStructure(structureSettings);
82
+ if (result.type === "success" && result.data) {
83
+ if (result.data.success && result.data.data) {
84
+ setStructureState(result.data.data);
85
+ return true;
86
+ }
87
+ throw new Error(result.data.error ||
88
+ result.details ||
89
+ "Failed to create translation structure");
90
+ }
91
+ throw new Error(result.details || "Failed to create translation structure");
111
92
  }
112
- catch (error) {
113
- setDialogError(errorText(error, "Failed to save the provider"));
93
+ catch (e) {
94
+ setError(e?.message || "Failed to create translation structure");
95
+ return false;
114
96
  }
115
97
  finally {
116
- setBusyProvider(null);
98
+ setEnsuringStructure(false);
117
99
  }
118
- };
119
- const deleteProvider = (provider) => {
120
- const remove = async () => {
121
- setBusyProvider(provider.serviceName);
122
- setProviderError(null);
123
- try {
124
- apply(await translationSettingsService.deleteProvider(provider.serviceName));
125
- }
126
- catch (error) {
127
- setProviderError(errorText(error, "Failed to delete the settings"));
100
+ }, [structureSettings]);
101
+ const loadData = useCallback(async () => {
102
+ try {
103
+ setState("loading");
104
+ setError(null);
105
+ await loadStructure();
106
+ const result = await getAvailableTranslationServices();
107
+ if (result.type === "success" && result.data) {
108
+ if (!result.data.success || !result.data.data) {
109
+ throw new Error(result.data.error ||
110
+ result.details ||
111
+ "Failed to load translation services. The translation API may not be available.");
112
+ }
113
+ const availableServices = result.data.data;
114
+ const serviceStates = availableServices.map((svc) => ({
115
+ ...svc,
116
+ creating: false,
117
+ deleting: false,
118
+ }));
119
+ setServices(serviceStates);
120
+ setState(availableServices.length === 0 ? "error" : "success");
128
121
  }
129
- finally {
130
- setBusyProvider(null);
122
+ else {
123
+ setState("error");
124
+ setError(result.details ||
125
+ "Failed to load translation services. The translation API may not be available.");
131
126
  }
132
- };
133
- const message = `Delete the settings of "${provider.displayName}"? People can no longer pick it for translation until it is set up again.`;
134
- if (!editContext?.confirm) {
135
- if (window.confirm(message))
136
- void remove();
137
- return;
138
127
  }
139
- editContext.confirm({
140
- header: "Delete translation provider settings",
141
- message,
142
- acceptLabel: "Delete",
143
- showCancel: true,
144
- accept: remove,
145
- });
146
- };
147
- const saveSettings = async (set, reset = []) => {
148
- setSavingSettings(true);
149
- setSettingsError(null);
150
- try {
151
- apply(await translationSettingsService.saveSettings(set, reset));
128
+ catch (e) {
129
+ setState("error");
130
+ setError(e?.message || "Failed to load translation services");
152
131
  }
153
- catch (error) {
154
- setSettingsError(errorText(error, "Failed to save the translation settings"));
132
+ }, [loadStructure]);
133
+ const handleStructureInputChange = useCallback((field) => (e) => {
134
+ setStructureSettings((prev) => ({
135
+ ...prev,
136
+ [field]: e.target.value,
137
+ }));
138
+ }, []);
139
+ const createSettings = useCallback(async (serviceName, templateId) => {
140
+ try {
141
+ setServices((prev) => prev.map((s) => s.serviceName === serviceName ? { ...s, creating: true } : s));
142
+ setError(null);
143
+ const language = editContext?.item?.language ??
144
+ editContext?.currentItemDescriptor?.language ??
145
+ "en";
146
+ const result = await createProviderSettings(serviceName, templateId, language, structureSettings);
147
+ if (result.type === "success" && result.data) {
148
+ const payload = result.data.data;
149
+ if (result.data.success && payload) {
150
+ const settingsItemId = payload.itemId;
151
+ setServices((prev) => prev.map((s) => s.serviceName === serviceName
152
+ ? {
153
+ ...s,
154
+ isConfigured: true,
155
+ creating: false,
156
+ settingsItemId,
157
+ }
158
+ : s));
159
+ // Reload data to ensure consistency
160
+ setTimeout(() => loadData(), 500);
161
+ }
162
+ else {
163
+ throw new Error(result.data.error ||
164
+ result.details ||
165
+ "Failed to create settings");
166
+ }
167
+ }
168
+ else {
169
+ throw new Error(result.details || "Failed to create settings");
170
+ }
155
171
  }
156
- finally {
157
- setSavingSettings(false);
172
+ catch (e) {
173
+ const errorMessage = e?.message || "Unknown error";
174
+ // Provide more helpful error messages for common issues
175
+ let displayMessage = errorMessage;
176
+ if (errorMessage.includes("Translation Providers folder not found") ||
177
+ errorMessage.includes("Translation folder not found")) {
178
+ displayMessage =
179
+ "The required folder structure is missing. Configure and create the parent items in the Settings section above.";
180
+ }
181
+ else if (errorMessage.includes("already exists")) {
182
+ displayMessage = `Settings for ${serviceName} already exist. Please refresh the list.`;
183
+ // Reload data to show updated status
184
+ setTimeout(() => loadData(), 500);
185
+ }
186
+ setError(`Failed to create settings for ${serviceName}: ${displayMessage}`);
187
+ setServices((prev) => prev.map((s) => s.serviceName === serviceName ? { ...s, creating: false } : s));
158
188
  }
159
- };
160
- const addContentType = async (store, itemId) => {
161
- setReadingType(true);
162
- setTypeError(null);
189
+ }, [editContext, loadData, structureSettings]);
190
+ const deleteSettings = useCallback(async (service) => {
191
+ if (!editContext || !service.settingsItemId)
192
+ return;
163
193
  try {
164
- const type = await translationSettingsService.contentTypeOf(store, itemId);
165
- setDraft((current) => current &&
166
- !current.excludedContentTypes.some((existing) => existing.key === type.key)
167
- ? {
168
- ...current,
169
- excludedContentTypes: [...current.excludedContentTypes, type],
194
+ setServices((prev) => prev.map((s) => s.serviceName === service.serviceName
195
+ ? { ...s, deleting: true }
196
+ : s));
197
+ setError(null);
198
+ const language = editContext.item?.language ??
199
+ editContext.currentItemDescriptor?.language ??
200
+ "en";
201
+ const deleted = await editContext.operations.deleteItems([
202
+ {
203
+ id: service.settingsItemId,
204
+ language,
205
+ version: 0,
206
+ },
207
+ ]);
208
+ if (deleted) {
209
+ if (selectedConfigTarget?.key === `service:${service.serviceName}` ||
210
+ selectedConfigTarget?.itemId === service.settingsItemId) {
211
+ setSelectedConfigTarget(null);
170
212
  }
171
- : current);
172
- setTypeDialog(false);
173
- }
174
- catch (error) {
175
- setTypeError(errorText(error, "Failed to read the content type"));
213
+ setServices((prev) => prev.map((s) => s.serviceName === service.serviceName
214
+ ? {
215
+ ...s,
216
+ isConfigured: false,
217
+ settingsItemId: undefined,
218
+ deleting: false,
219
+ }
220
+ : s));
221
+ await loadData();
222
+ }
223
+ else {
224
+ setServices((prev) => prev.map((s) => s.serviceName === service.serviceName
225
+ ? { ...s, deleting: false }
226
+ : s));
227
+ }
176
228
  }
177
- finally {
178
- setReadingType(false);
229
+ catch (e) {
230
+ setError(e?.message ||
231
+ `Failed to delete settings for ${service.displayName || service.serviceName}`);
232
+ setServices((prev) => prev.map((s) => s.serviceName === service.serviceName
233
+ ? { ...s, deleting: false }
234
+ : s));
179
235
  }
180
- };
181
- const services = page.providers;
182
- const configuredCount = services.filter((service) => service.configured).length;
183
- const languageName = (code) => page.languages.find((language) => language.code === code)?.name ?? code;
184
- const settingRow = {
185
- page,
186
- busy: savingSettings,
187
- onReset: (reset) => void saveSettings({}, [reset]),
188
- };
189
- const removeType = (key) => setDraft({
190
- ...draft,
191
- excludedContentTypes: draft.excludedContentTypes.filter((existing) => existing.key !== key),
192
- });
193
- return (_jsxs(SettingsPanelLayout, { testId: "translation-services-panel", children: [_jsx(SettingsCard, { icon: _jsx(Languages, { strokeWidth: 1 }), title: `Translation providers (${configuredCount} of ${services.length} set up)`, description: "The translation services of this installation. People can pick a service for translation once it is set up.", children: _jsxs("div", { className: "flex flex-col gap-4", "data-testid": "translation-services-providers", children: [providerError && (_jsxs(Alert, { variant: "destructive", "data-testid": "translation-services-error", children: [_jsx(AlertCircle, { className: "h-4 w-4", strokeWidth: 1 }), _jsx(AlertDescription, { children: providerError })] })), services.length === 0 ? (_jsx(SettingsEmptyState, { icon: Languages, title: "This installation has no translation services." })) : (_jsx(SettingsList, { children: services.map((service) => {
194
- const languages = service.fields.find((field) => field.type === "languages")?.value;
195
- return (_jsx(SettingsListItem, { "data-testid": "translation-provider", "data-service-name": service.serviceName, icon: _jsx(Languages, { strokeWidth: 1 }), title: service.displayName, badges: service.displayName !== service.serviceName && (_jsx("span", { className: settingsText.meta, children: service.serviceName })), meta: _jsx("div", { className: "truncate", "data-testid": "translation-provider-summary", children: !service.configured
196
- ? "Not set up"
197
- : languages
198
- ? `Languages: ${languages.split("|").map(languageName).join(", ")}`
199
- : "Set up" }), actions: service.configured ? (_jsxs(_Fragment, { children: [_jsx(SimpleIconButton, { label: `Edit the settings of ${service.displayName}`, icon: _jsx(Pencil, { className: "size-4", strokeWidth: 1 }), className: "size-7 p-0", onClick: () => {
200
- setDialogError(null);
201
- setEditing(service);
202
- }, disabled: busyProvider !== null, "data-testid": "translation-provider-edit" }), _jsx(DeleteButton, { label: `Delete the settings of ${service.displayName}`, onClick: () => deleteProvider(service), disabled: busyProvider !== null, "data-testid": "translation-provider-delete" })] })) : (_jsxs(Button, { size: "sm", variant: "outline", onClick: () => void createProvider(service), disabled: busyProvider !== null, "data-testid": "translation-provider-create", children: [_jsx(Plus, { className: "h-4 w-4", strokeWidth: 1 }), "Set up"] })) }, service.serviceName));
203
- }) }))] }) }), _jsx(SettingsCard, { icon: _jsx(SlidersHorizontal, { strokeWidth: 1 }), title: "Translation settings", description: "How translation runs, for every translation service.", children: _jsxs("div", { "data-testid": "translation-settings-section", children: [_jsxs("div", { children: [_jsx(TranslationSettingRow, { ...settingRow, name: "maxConcurrentTranslationJobs", label: "Jobs at once", htmlFor: "translation-setting-maxConcurrentTranslationJobs", hint: `How many translation jobs run at the same time. Default: ${page.defaults.maxConcurrentTranslationJobs}.`, control: _jsx(Input, { id: "translation-setting-maxConcurrentTranslationJobs", type: "number", min: 1, className: "w-28", value: draft.maxConcurrentTranslationJobs, onChange: (event) => setDraft({
204
- ...draft,
205
- maxConcurrentTranslationJobs: event.target.value,
206
- }), "data-testid": "translation-setting-maxConcurrentTranslationJobs" }) }), _jsx(TranslationSettingRow, { ...settingRow, name: "maxConcurrentJobsPerBatch", label: "Jobs at once per batch", htmlFor: "translation-setting-maxConcurrentJobsPerBatch", hint: `How many jobs of one batch run at the same time; 0 sets no limit. Default: ${page.defaults.maxConcurrentJobsPerBatch}.`, control: _jsx(Input, { id: "translation-setting-maxConcurrentJobsPerBatch", type: "number", min: 0, className: "w-28", value: draft.maxConcurrentJobsPerBatch, onChange: (event) => setDraft({
207
- ...draft,
208
- maxConcurrentJobsPerBatch: event.target.value,
209
- }), "data-testid": "translation-setting-maxConcurrentJobsPerBatch" }) }), _jsx(TranslationSettingRow, { ...settingRow, name: "skipSharedFields", label: "Skip fields that are the same in all languages", htmlFor: "translation-setting-skipSharedFields", toggle: _jsx(Switch, { id: "translation-setting-skipSharedFields", checked: draft.skipSharedFields, onCheckedChange: (checked) => setDraft({ ...draft, skipSharedFields: checked }), "data-testid": "translation-setting-skipSharedFields" }) }), _jsx(TranslationSettingRow, { ...settingRow, name: "displayCosts", label: "Show translation costs", htmlFor: "translation-setting-displayCosts", toggle: _jsx(Switch, { id: "translation-setting-displayCosts", checked: draft.displayCosts, onCheckedChange: (checked) => setDraft({ ...draft, displayCosts: checked }), "data-testid": "translation-setting-displayCosts" }) }), _jsxs(TranslationSettingRow, { ...settingRow, name: "excludedContentTypes", label: "Content types that are not translated", hint: "Items of these types, and of types based on them, are left out of translation.", control: _jsxs(Button, { size: "sm", variant: "outline", onClick: () => {
210
- setTypeError(null);
211
- setTypeDialog(true);
212
- }, "data-testid": "translation-excluded-type-open", children: [_jsx(Plus, { className: "h-4 w-4", strokeWidth: 1 }), "Add content type"] }), children: [draft.excludedContentTypes.length === 0 && (_jsx("p", { className: settingsText.meta, children: "None: every content type is translated." })), _jsx("ul", { className: "flex flex-wrap gap-1.5 empty:hidden", "data-testid": "translation-setting-excludedContentTypes", children: draft.excludedContentTypes.map((type) => (_jsx("li", { className: "contents", children: _jsxs(Badge, { variant: type.known ? "secondary" : "warning", className: "pr-1", "data-testid": "translation-excluded-type", "data-type-key": type.key, "data-known": type.known, children: [typeLabel(type), _jsx("button", { type: "button", "aria-label": `Translate ${typeLabel(type)} again`, className: "flex cursor-pointer items-center rounded-sm opacity-70 hover:opacity-100", onClick: () => removeType(type.key), children: _jsx(X, { className: "size-3", strokeWidth: 1 }) })] }) }, type.key))) })] })] }), settingsError && (_jsx("p", { className: `mt-4 ${settingsText.error}`, role: "alert", "data-testid": "translation-settings-error", children: settingsError })), _jsxs("div", { className: "border-border-default mt-4 flex justify-end gap-2 border-t pt-4", children: [dirty && (_jsx(Button, { size: "sm", variant: "outline", onClick: () => setDraft(draftOf(page.settings)), disabled: savingSettings, children: "Discard changes" })), _jsxs(Button, { size: "sm", onClick: () => void saveSettings(changes), disabled: !dirty || savingSettings, "data-testid": "translation-settings-save", children: [_jsx(Save, { className: "h-4 w-4", strokeWidth: 1 }), "Save"] })] })] }) }), _jsx(TranslationProviderDialog, { provider: editing, saving: busyProvider !== null, error: dialogError, onOpenChange: (open) => !open && setEditing(null), onSave: (values) => void saveProvider(values) }, editing?.serviceName ?? "closed"), _jsx(ExcludedContentTypeDialog, { open: typeDialog, saving: readingType, error: typeError, onOpenChange: setTypeDialog, onPick: (store, itemId) => void addContentType(store, itemId) })] }));
236
+ }, [editContext, loadData, selectedConfigTarget]);
237
+ useEffect(() => {
238
+ loadData();
239
+ }, [loadData]);
240
+ const configuredCount = services.filter((s) => s.isConfigured).length;
241
+ const totalCount = services.length;
242
+ const translationFolderExists = !!structureState?.translationFolder?.exists;
243
+ const providersFolderExists = !!structureState?.translationProvidersFolder?.exists;
244
+ // Build the services list content
245
+ const servicesListContent = (_jsxs("div", { className: "flex h-full flex-col gap-4 p-4", "data-testid": "translation-services-panel", children: [_jsx(Card, { icon: _jsx(ListChecksIcon, { strokeWidth: 1, className: "h-5 w-5" }), title: "Prerequisites", description: "Required Sitecore folders for translation settings.", noPadding: true, className: "shrink-0", headerActions: _jsxs("div", { className: "flex items-center gap-2", children: [_jsx("div", { className: "flex items-center gap-1.5 text-xs text-neutral-grey-50", children: translationFolderExists && providersFolderExists ? (_jsxs(_Fragment, { children: [_jsx(CheckCircleIcon, { className: "h-3.5 w-3.5 text-feedback-green", strokeWidth: 1 }), "All parent items found"] })) : (_jsxs(_Fragment, { children: [_jsx(AlertCircleIcon, { className: "h-3.5 w-3.5 text-feedback-orange", strokeWidth: 1 }), "Parent items missing"] })) }), !providersFolderExists && (_jsxs(Button, { size: "sm", variant: "default", onClick: ensureStructure, disabled: ensuringStructure || structureLoading, children: [ensuringStructure ? (_jsx(RefreshCwIcon, { strokeWidth: 1, className: "mr-1 h-4 w-4 animate-spin" })) : (_jsx(PlusIcon, { strokeWidth: 1, className: "mr-1 h-4 w-4" })), "Ensure items"] }))] }), children: _jsxs("div", { className: "divide-y divide-border-default border-t border-border-default", children: [_jsxs("div", { "data-testid": "translation-structure-folder", className: `flex items-center gap-3 px-3 py-3 text-sm transition-colors ${selectedConfigTarget?.key ===
246
+ `structure:${structureState?.translationFolder?.itemId}`
247
+ ? "bg-feedback-blue-light"
248
+ : "bg-white"}`, children: [translationFolderExists ? (_jsx(CheckCircleIcon, { className: "h-4 w-4 shrink-0 text-feedback-green", strokeWidth: 1 })) : (_jsx(AlertCircleIcon, { className: "h-4 w-4 shrink-0 text-feedback-orange", strokeWidth: 1 })), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: "font-medium text-neutral-grey-100", children: "Translation folder" }), _jsx("div", { className: "mt-0.5 truncate font-mono text-xs text-neutral-grey-50", children: structureSettings.translationFolderPath })] }), translationFolderExists &&
249
+ structureState?.translationFolder?.itemId && (_jsx(Button, { size: "sm", variant: "ghost", onClick: () => handleOpenStructureConfig(structureState.translationFolder.itemId, "Configure: Translation folder"), title: "Configure", children: _jsx(SettingsIcon, { className: "h-3.5 w-3.5", strokeWidth: 1 }) }))] }), _jsxs("div", { "data-testid": "translation-structure-providers-folder", className: `flex items-center gap-3 px-3 py-3 text-sm transition-colors ${selectedConfigTarget?.key ===
250
+ `structure:${structureState?.translationProvidersFolder?.itemId}`
251
+ ? "bg-feedback-blue-light"
252
+ : "bg-white"}`, children: [providersFolderExists ? (_jsx(CheckCircleIcon, { className: "h-4 w-4 shrink-0 text-feedback-green", strokeWidth: 1 })) : (_jsx(AlertCircleIcon, { className: "h-4 w-4 shrink-0 text-feedback-orange", strokeWidth: 1 })), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsx("div", { className: "font-medium text-neutral-grey-100", children: "Translation providers folder" }), _jsx("div", { className: "mt-0.5 truncate font-mono text-xs text-neutral-grey-50", children: structureSettings.translationProvidersPath })] }), providersFolderExists &&
253
+ structureState?.translationProvidersFolder?.itemId && (_jsx(Button, { size: "sm", variant: "ghost", onClick: () => handleOpenStructureConfig(structureState.translationProvidersFolder.itemId, "Configure: Translation Providers folder"), title: "Configure", children: _jsx(SettingsIcon, { className: "h-3.5 w-3.5", strokeWidth: 1 }) }))] })] }) }), _jsxs(Card, { icon: _jsx(LanguagesIcon, { strokeWidth: 1, className: "h-5 w-5" }), title: _jsxs(_Fragment, { children: ["Translation providers", " ", _jsxs("span", { className: "font-normal text-neutral-grey-50", children: ["(", configuredCount, " of ", totalCount, " configured)"] })] }), description: "Translation services registered in Parhelia and their settings.", noPadding: true, className: "flex min-h-0 flex-1 flex-col overflow-hidden", children: [((totalCount === 0 && state === "success") || error) && (_jsxs("div", { className: "border-border-default space-y-2 border-t px-4 py-3", children: [totalCount === 0 && state === "success" && (_jsx("div", { className: "rounded border border-feedback-orange/30 bg-feedback-orange-light p-2 text-xs text-feedback-orange", children: "No translation services are registered in dependency injection. Please check the server configuration." })), error && (_jsx("div", { className: "rounded border border-feedback-red bg-feedback-red-light p-2 text-xs whitespace-pre-wrap text-feedback-red", children: error }))] })), _jsx("div", { className: "min-h-0 flex-1 overflow-y-auto border-t border-border-default", "data-testid": "translation-services-providers", children: services.length > 0 && (_jsx("div", { className: "divide-y divide-border-default", children: services.map((service) => {
254
+ const isSelected = selectedConfigTarget?.key ===
255
+ `service:${service.serviceName}`;
256
+ const isConfigured = service.isConfigured;
257
+ return (_jsxs("div", { className: `group flex items-center gap-3 px-3 py-3 text-sm transition-colors ${isSelected
258
+ ? "bg-feedback-blue-light"
259
+ : "bg-white hover:bg-neutral-grey-5"}`, children: [isConfigured ? (_jsx(CheckCircleIcon, { className: "h-4 w-4 shrink-0 text-feedback-green", strokeWidth: 1 })) : (_jsx(AlertCircleIcon, { className: "h-4 w-4 shrink-0 text-feedback-orange", strokeWidth: 1 })), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-1.5", children: [_jsx("span", { className: "truncate font-medium text-neutral-grey-100", children: service.displayName || service.serviceName }), service.displayName &&
260
+ service.displayName !== service.serviceName && (_jsx("span", { className: "shrink-0 rounded bg-neutral-grey-5 badge-pad-sm text-[10px] font-medium text-neutral-grey-50", children: service.serviceName })), !isConfigured && (_jsx("span", { className: "shrink-0 rounded bg-feedback-orange-light badge-pad-sm text-[10px] font-medium text-feedback-orange", children: "Not configured" }))] }), isConfigured &&
261
+ service.supportedLanguages &&
262
+ service.supportedLanguages.length > 0 && (_jsxs("div", { className: "mt-0.5 truncate text-xs text-neutral-grey-50", children: ["Languages: ", service.supportedLanguages.join(", ")] }))] }), _jsx("div", { className: "flex shrink-0 items-center gap-0.5", children: isConfigured && service.settingsItemId ? (_jsxs("div", { className: "flex items-center gap-0.5 opacity-60 transition-opacity group-hover:opacity-100 group-focus-within:opacity-100", children: [_jsx(Button, { size: "sm", variant: "ghost", onClick: () => handleOpenConfig(service), disabled: service.deleting, title: "Configure", children: _jsx(SettingsIcon, { className: "h-3.5 w-3.5", strokeWidth: 1 }) }), _jsx(Button, { size: "sm", variant: "ghost", onClick: () => deleteSettings(service), className: "text-neutral-grey-50 hover:bg-neutral-grey-5 hover:text-neutral-grey-50", disabled: service.deleting, title: `Delete settings for ${service.displayName || service.serviceName}`, children: service.deleting ? (_jsx(RefreshCwIcon, { strokeWidth: 1, className: "h-3.5 w-3.5 animate-spin" })) : (_jsx(DeleteIcon, { size: "md" })) })] })) : (_jsxs(Button, { size: "sm", variant: "default", onClick: () => createSettings(service.serviceName, service.templateId), disabled: service.creating, title: `Create settings using template: ${service.templateName}`, children: [service.creating ? (_jsx(RefreshCwIcon, { strokeWidth: 1, className: "mr-1 h-3.5 w-3.5 animate-spin" })) : (_jsx(PlusIcon, { strokeWidth: 1, className: "mr-1 h-3.5 w-3.5" })), "Create"] })) })] }, service.serviceName));
263
+ }) })) })] })] }));
264
+ // Build splitter panels - only show config panel when a service is selected
265
+ const panels = selectedConfigTarget?.itemId
266
+ ? [
267
+ {
268
+ name: "services-list",
269
+ defaultSize: "auto",
270
+ content: servicesListContent,
271
+ className: "overflow-hidden",
272
+ },
273
+ {
274
+ name: "service-config",
275
+ defaultSize: 400,
276
+ content: (_jsx(ItemConfigPanel, { itemId: selectedConfigTarget.itemId, title: selectedConfigTarget.title, onClose: handleCloseConfig }, selectedConfigTarget.itemId)),
277
+ className: "overflow-hidden",
278
+ },
279
+ ]
280
+ : [
281
+ {
282
+ name: "services-list",
283
+ defaultSize: "auto",
284
+ content: servicesListContent,
285
+ className: "overflow-hidden",
286
+ },
287
+ ];
288
+ const SplitterComponent = Splitter;
289
+ return (_jsx(SplitterComponent, { panels: panels, localStorageKey: "translation-services-panel-splitter", direction: editContext?.isMobile ? "vertical" : "horizontal", className: "h-full w-full" }));
213
290
  }
214
291
  export default TranslationServicesPanel;
@@ -1 +1 @@
1
- {"version":3,"file":"LocalizationSetupStep.d.ts","sourceRoot":"","sources":["../../src/setup/LocalizationSetupStep.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAgCzE,wBAAgB,qBAAqB,sBAmPpC;eAEc,qBAAqB"}
1
+ {"version":3,"file":"LocalizationSetupStep.d.ts","sourceRoot":"","sources":["../../src/setup/LocalizationSetupStep.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAC;AAgCzE,wBAAgB,qBAAqB,sBA6QpC;eAEc,qBAAqB"}
@@ -1,15 +1,15 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import React, { useCallback, useState } from "react";
3
- import { Card, Button } from "@parhelia/core";
3
+ import { Card, Button, useEditContext } from "@parhelia/core";
4
4
  import { CheckCircle as LucideCheckCircle, AlertCircle as LucideAlertCircle, Languages as LucideLanguages, RefreshCw as LucideRefreshCw, Plus as LucidePlus, } from "lucide-react";
5
- import { getAvailableTranslationServices, } from "../services/translationService";
6
- import { translationSettingsService } from "../services/translationSettingsService";
5
+ import { getAvailableTranslationServices, createProviderSettings, } from "../services/translationService";
7
6
  const CheckCircleIcon = LucideCheckCircle;
8
7
  const AlertCircleIcon = LucideAlertCircle;
9
8
  const LanguagesIcon = LucideLanguages;
10
9
  const RefreshCwIcon = LucideRefreshCw;
11
10
  const PlusIcon = LucidePlus;
12
11
  export function LocalizationSetupStep() {
12
+ const editContext = useEditContext();
13
13
  const [state, setState] = useState("checking");
14
14
  const [error, setError] = useState(null);
15
15
  const [services, setServices] = useState([]);
@@ -49,7 +49,7 @@ export function LocalizationSetupStep() {
49
49
  const totalCount = serviceStates.length;
50
50
  if (configuredCount === 0) {
51
51
  setState("error");
52
- setError(`Found ${totalCount} translation service${totalCount !== 1 ? "s" : ""} in DI, but none have settings items configured.`);
52
+ setError(`Found ${totalCount} translation service${totalCount !== 1 ? "s" : ""} in DI, but none have Sitecore Settings items configured.`);
53
53
  }
54
54
  else if (configuredCount < totalCount) {
55
55
  setState("partial");
@@ -71,28 +71,47 @@ export function LocalizationSetupStep() {
71
71
  setError(e?.message || "Failed to check localization setup");
72
72
  }
73
73
  }, []);
74
- const createSettings = useCallback(async (serviceName) => {
74
+ const createSettings = useCallback(async (serviceName, templateId) => {
75
75
  try {
76
76
  setServices((prev) => prev.map((s) => s.serviceName === serviceName ? { ...s, creating: true } : s));
77
77
  setError(null);
78
- // The Settings page's write path (every host and CMS): an empty save creates the provider's settings.
79
- await translationSettingsService.saveProvider(serviceName, {});
80
- setServices((prev) => prev.map((s) => s.serviceName === serviceName
81
- ? { ...s, isConfigured: true, creating: false }
82
- : s));
83
- setTimeout(() => checkLocalization(), 500);
78
+ const language = editContext?.item?.language ??
79
+ editContext?.currentItemDescriptor?.language ??
80
+ "en";
81
+ const result = await createProviderSettings(serviceName, templateId, language);
82
+ if (result.type === "success" && result.data) {
83
+ if (result.data.success && result.data.data) {
84
+ setServices((prev) => prev.map((s) => s.serviceName === serviceName
85
+ ? {
86
+ ...s,
87
+ isConfigured: true,
88
+ creating: false,
89
+ settingsItemId: result.data?.data?.itemId,
90
+ }
91
+ : s));
92
+ setTimeout(() => checkLocalization(), 500);
93
+ }
94
+ else {
95
+ throw new Error(result.data.error ||
96
+ result.details ||
97
+ "Failed to create settings");
98
+ }
99
+ }
100
+ else {
101
+ throw new Error(result.details || "Failed to create settings");
102
+ }
84
103
  }
85
104
  catch (e) {
86
105
  setError(`Failed to create settings for ${serviceName}: ${e?.message || "Unknown error"}`);
87
106
  setServices((prev) => prev.map((s) => s.serviceName === serviceName ? { ...s, creating: false } : s));
88
107
  }
89
- }, [checkLocalization]);
108
+ }, [editContext, checkLocalization]);
90
109
  React.useEffect(() => {
91
110
  checkLocalization();
92
111
  }, [checkLocalization]);
93
112
  const configuredCount = services.filter((s) => s.isConfigured).length;
94
113
  const totalCount = services.length;
95
- return (_jsx(Card, { icon: _jsx(LanguagesIcon, { strokeWidth: 1, className: "h-5 w-5" }), title: "Localization setup", description: "Verifies that translation services registered in DI have corresponding settings items.", children: _jsxs("div", { className: "space-y-3", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { className: "flex items-center gap-2", children: [statusIcon(state), _jsx("span", { className: "text-sm text-neutral-grey-100", children: state === "success"
114
+ return (_jsx(Card, { icon: _jsx(LanguagesIcon, { strokeWidth: 1, className: "h-5 w-5" }), title: "Localization setup", description: "Verifies that translation services registered in DI have corresponding Sitecore Settings items.", children: _jsxs("div", { className: "space-y-3", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { className: "flex items-center gap-2", children: [statusIcon(state), _jsx("span", { className: "text-sm text-neutral-grey-100", children: state === "success"
96
115
  ? `All ${totalCount} translation service${totalCount !== 1 ? "s" : ""} configured`
97
116
  : state === "partial"
98
117
  ? `${configuredCount} of ${totalCount} services configured`
@@ -103,6 +122,6 @@ export function LocalizationSetupStep() {
103
122
  : "Checking..." })] }), _jsxs(Button, { size: "sm", variant: "outline", onClick: checkLocalization, children: [_jsx(RefreshCwIcon, { strokeWidth: 1, className: "h-4 w-4" }), "Recheck"] })] }), services.length > 0 && (_jsxs("div", { className: "space-y-2 rounded-lg border border-border-default bg-neutral-grey-5 p-3", children: [_jsx("div", { className: "text-xs font-medium text-neutral-grey-50 tracking-wide", children: "Translation Services" }), services.map((service) => (_jsxs("div", { className: "flex items-center justify-between rounded-md bg-background p-3 shadow-sm border border-border-default", children: [_jsxs("div", { className: "flex items-center gap-2", children: [service.isConfigured ? (_jsx(CheckCircleIcon, { className: "h-3.5 w-3.5 text-[var(--color-feedback-green)]", strokeWidth: 1 })) : (_jsx(AlertCircleIcon, { className: "h-3.5 w-3.5 text-[var(--color-feedback-orange)]", strokeWidth: 1 })), _jsxs("div", { children: [_jsx("div", { className: "text-sm font-medium text-neutral-grey-100", children: service.displayName || service.serviceName }), service.displayName &&
104
123
  service.displayName !== service.serviceName && (_jsxs("div", { className: "text-xs text-neutral-grey-50", children: ["Service: ", service.serviceName] })), service.isConfigured &&
105
124
  service.supportedLanguages &&
106
- service.supportedLanguages.length > 0 && (_jsxs("div", { className: "text-xs text-neutral-grey-50", children: ["Languages: ", service.supportedLanguages.join(", ")] }))] })] }), !service.isConfigured && (_jsxs(Button, { size: "xs", onClick: () => createSettings(service.serviceName), disabled: service.creating, title: `Create the settings of ${service.serviceName}`, children: [service.creating ? (_jsx(RefreshCwIcon, { strokeWidth: 1, className: "h-3 w-3 animate-spin" })) : (_jsx(PlusIcon, { strokeWidth: 1, className: "h-3 w-3" })), "Create Settings"] }))] }, service.serviceName)))] })), error && (_jsx("div", { className: "rounded-md border border-feedback-orange/30 bg-feedback-orange-light p-3 text-xs whitespace-pre-wrap text-feedback-orange", children: error }))] }) }));
125
+ service.supportedLanguages.length > 0 && (_jsxs("div", { className: "text-xs text-neutral-grey-50", children: ["Languages: ", service.supportedLanguages.join(", ")] }))] })] }), !service.isConfigured && (_jsxs(Button, { size: "xs", onClick: () => createSettings(service.serviceName, service.templateId), disabled: service.creating, title: `Create using template: ${service.templateName}`, children: [service.creating ? (_jsx(RefreshCwIcon, { strokeWidth: 1, className: "h-3 w-3 animate-spin" })) : (_jsx(PlusIcon, { strokeWidth: 1, className: "h-3 w-3" })), "Create Settings"] }))] }, service.serviceName)))] })), error && (_jsx("div", { className: "rounded-md border border-feedback-orange/30 bg-feedback-orange-light p-3 text-xs whitespace-pre-wrap text-feedback-orange", children: error }))] }) }));
107
126
  }
108
127
  export default LocalizationSetupStep;