@parhelia/localization 0.4.12884 → 0.4.13030

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 (48) hide show
  1. package/LICENSE +1 -1
  2. package/dist/LocalizeItemCommand.d.ts.map +1 -1
  3. package/dist/LocalizeItemCommand.js +1 -0
  4. package/dist/LocalizeItemDialog.d.ts.map +1 -1
  5. package/dist/LocalizeItemDialog.js +9 -3
  6. package/dist/LocalizeItemUtils.d.ts +1 -0
  7. package/dist/LocalizeItemUtils.d.ts.map +1 -1
  8. package/dist/LocalizeItemUtils.js +44 -18
  9. package/dist/api/discovery.d.ts +17 -3
  10. package/dist/api/discovery.d.ts.map +1 -1
  11. package/dist/api/discovery.js +35 -14
  12. package/dist/hooks/useTranslationWizard.d.ts.map +1 -1
  13. package/dist/hooks/useTranslationWizard.js +10 -2
  14. package/dist/index.d.ts.map +1 -1
  15. package/dist/index.js +6 -4
  16. package/dist/services/translationService.d.ts +43 -27
  17. package/dist/services/translationService.d.ts.map +1 -1
  18. package/dist/services/translationService.js +36 -32
  19. package/dist/services/translationSettingsService.d.ts +79 -0
  20. package/dist/services/translationSettingsService.d.ts.map +1 -0
  21. package/dist/services/translationSettingsService.js +68 -0
  22. package/dist/settings/ExcludedContentTypeDialog.d.ts +12 -0
  23. package/dist/settings/ExcludedContentTypeDialog.d.ts.map +1 -0
  24. package/dist/settings/ExcludedContentTypeDialog.js +29 -0
  25. package/dist/settings/TranslationProviderDialog.d.ts +18 -0
  26. package/dist/settings/TranslationProviderDialog.d.ts.map +1 -0
  27. package/dist/settings/TranslationProviderDialog.js +105 -0
  28. package/dist/settings/TranslationServicesPanel.d.ts +14 -4
  29. package/dist/settings/TranslationServicesPanel.d.ts.map +1 -1
  30. package/dist/settings/TranslationServicesPanel.js +186 -263
  31. package/dist/setup/LocalizationSetupStep.d.ts.map +1 -1
  32. package/dist/setup/LocalizationSetupStep.js +14 -33
  33. package/dist/sidebar/TranslationSidebar.d.ts.map +1 -1
  34. package/dist/sidebar/TranslationSidebar.js +35 -14
  35. package/dist/steps/ItemSelectionTree.d.ts.map +1 -1
  36. package/dist/steps/ItemSelectionTree.js +130 -43
  37. package/dist/steps/ProviderStep.d.ts.map +1 -1
  38. package/dist/steps/ProviderStep.js +54 -42
  39. package/dist/steps/ServiceLanguageSelectionStep.d.ts.map +1 -1
  40. package/dist/steps/ServiceLanguageSelectionStep.js +32 -9
  41. package/dist/steps/types.d.ts +7 -1
  42. package/dist/steps/types.d.ts.map +1 -1
  43. package/dist/translation-center/TranslationBatches.d.ts +36 -0
  44. package/dist/translation-center/TranslationBatches.d.ts.map +1 -1
  45. package/dist/translation-center/TranslationBatches.js +200 -77
  46. package/dist/types.d.ts +1 -0
  47. package/dist/types.d.ts.map +1 -1
  48. package/package.json +1 -1
package/LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Parhelia - AI-Powered Editor for Sitecore
1
+ Parhelia - AI-Powered Content Editor
2
2
 
3
3
  Copyright © 2025 Canvas REPLY GmbH. All rights reserved.
4
4
 
@@ -1 +1 @@
1
- {"version":3,"file":"LocalizeItemCommand.d.ts","sourceRoot":"","sources":["../src/LocalizeItemCommand.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EACP,cAAc,EACd,WAAW,EACX,eAAe,EACf,QAAQ,EACT,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAEL,uBAAuB,EACxB,MAAM,eAAe,CAAC;AAQvB,MAAM,MAAM,uBAAuB,GAAG,WAAW,GAAG;IAClD,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GACpC,cAAc,CAAC,uBAAuB,CAAC,CAAC;AAC1C,MAAM,MAAM,mBAAmB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAEnE,wBAAsB,sBAAsB,CAAC,EAC3C,WAAW,EACX,UAAmC,EACnC,KAAK,GACN,EAAE;IACD,WAAW,EAAE,eAAe,CAAC;IAC7B,UAAU,CAAC,EAAE,eAAe,CAAC,YAAY,CAAC,CAAC;IAC3C,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB,2CAiCA;AAED,eAAO,MAAM,mBAAmB,EAAE,mBAkCjC,CAAC"}
1
+ {"version":3,"file":"LocalizeItemCommand.d.ts","sourceRoot":"","sources":["../src/LocalizeItemCommand.tsx"],"names":[],"mappings":"AACA,OAAO,EACL,OAAO,EACP,cAAc,EACd,WAAW,EACX,eAAe,EACf,QAAQ,EACT,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAEL,uBAAuB,EACxB,MAAM,eAAe,CAAC;AAQvB,MAAM,MAAM,uBAAuB,GAAG,WAAW,GAAG;IAClD,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,0BAA0B,GACpC,cAAc,CAAC,uBAAuB,CAAC,CAAC;AAC1C,MAAM,MAAM,mBAAmB,GAAG,OAAO,CAAC,uBAAuB,CAAC,CAAC;AAEnE,wBAAsB,sBAAsB,CAAC,EAC3C,WAAW,EACX,UAAmC,EACnC,KAAK,GACN,EAAE;IACD,WAAW,EAAE,eAAe,CAAC;IAC7B,UAAU,CAAC,EAAE,eAAe,CAAC,YAAY,CAAC,CAAC;IAC3C,KAAK,EAAE,QAAQ,EAAE,CAAC;CACnB,2CAiCA;AAED,eAAO,MAAM,mBAAmB,EAAE,mBAmCjC,CAAC"}
@@ -33,6 +33,7 @@ export async function openLocalizeItemDialog({ editContext, openDialog = editCon
33
33
  }
34
34
  export const localizeItemCommand = {
35
35
  id: "localizeItem",
36
+ right: "parhelia.translate",
36
37
  label: "Translate",
37
38
  icon: _jsx(GlobeIcon, { strokeWidth: 1 }),
38
39
  disabled: (context) => {
@@ -1 +1 @@
1
- {"version":3,"file":"LocalizeItemDialog.d.ts","sourceRoot":"","sources":["../src/LocalizeItemDialog.tsx"],"names":[],"mappings":"AA8BA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EAExB,MAAM,eAAe,CAAC;AAmEvB,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,uBAAuB,GAAG,WAAW,CAAC,uBAAuB,CAAC,+BA4hBtE"}
1
+ {"version":3,"file":"LocalizeItemDialog.d.ts","sourceRoot":"","sources":["../src/LocalizeItemDialog.tsx"],"names":[],"mappings":"AA8BA,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EAExB,MAAM,eAAe,CAAC;AAoEvB,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,uBAAuB,GAAG,WAAW,CAAC,uBAAuB,CAAC,+BAoiBtE"}
@@ -3,6 +3,7 @@ import { Dialog, DialogContent, StyledDialogTitle, Button, cn, AlertDialog, Aler
3
3
  import { useCallback, useEffect, useMemo, useRef, useState, } from "react";
4
4
  import { AlertTriangle as LucideAlertTriangle, ArrowRight as LucideArrowRight, Globe as LucideGlobe, } from "lucide-react";
5
5
  import { useTranslationWizard } from "./hooks/useTranslationWizard";
6
+ import { translationDescriptorKey } from "./services/translationService";
6
7
  import { performDefaultTranslation, } from "./LocalizeItemUtils";
7
8
  const AlertTriangleIcon = LucideAlertTriangle;
8
9
  const GlobeIcon = LucideGlobe;
@@ -86,7 +87,7 @@ export function LocalizeItemDialog(props) {
86
87
  useEffect(() => {
87
88
  beforeNextCallbackRef.current = beforeNextCallback;
88
89
  }, [beforeNextCallback]);
89
- // Switch step helper that clears callbacks (similar to page wizard)
90
+ // Switch step helper that clears callbacks
90
91
  const switchStep = useCallback((index) => {
91
92
  beforeNextCallbackRef.current = null; // Clear callback when switching steps
92
93
  setBeforeNextCallback(null);
@@ -136,7 +137,7 @@ export function LocalizeItemDialog(props) {
136
137
  itemCount += 1;
137
138
  if (!entry.includeSubitems)
138
139
  continue;
139
- const c = subitemCounts[entry.descriptor.id];
140
+ const c = subitemCounts[translationDescriptorKey(entry.descriptor)];
140
141
  if (c === undefined || c === "loading") {
141
142
  isStreaming = true;
142
143
  }
@@ -242,10 +243,15 @@ export function LocalizeItemDialog(props) {
242
243
  targetLanguages: [...newData.targetLanguages].sort(),
243
244
  includeSubitems: newData.includeSubitems,
244
245
  discoveredItemIds: (newData.discoveredItems || [])
245
- .map((item) => item?.descriptor?.id || item?.id)
246
+ .map((item) => translationDescriptorKey(item.descriptor))
246
247
  .filter(Boolean)
247
248
  .sort(),
248
249
  itemsCount: newData.items?.length || 0,
250
+ selectionTreeItems: newData.selectionTreeItems?.map((entry) => [
251
+ translationDescriptorKey(entry.descriptor),
252
+ entry.descriptor.language,
253
+ entry.includeSubitems,
254
+ ]),
249
255
  serviceCustomData: serviceCustomDataKey,
250
256
  metadata: metadataKey,
251
257
  // batchName must be part of the key — otherwise the ProviderStep's
@@ -3,6 +3,7 @@ import { FullItem } from "@parhelia/core";
3
3
  import { TranslationWizardData } from "./steps/types";
4
4
  import { EditContextType } from "@parhelia/core";
5
5
  export type StartedTranslation = {
6
+ store: string;
6
7
  itemId: string;
7
8
  targetLanguage: string;
8
9
  jobId?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"LocalizeItemUtils.d.ts","sourceRoot":"","sources":["../src/LocalizeItemUtils.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAsDjD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAIF,wBAAsB,yBAAyB,CAC7C,UAAU,EAAE,qBAAqB,EACjC,WAAW,EAAE,eAAe,GAC3B,OAAO,CAAC,iBAAiB,CAAC,CAwH5B;AAGD,eAAO,MAAM,mBAAmB,kBACf,MAAM,EAAE,qBACJ,iBAAiB,EAAE,aAC3B,MAAM,QACX,QAAQ,uBACO,MAAM,+BAkC5B,CAAC"}
1
+ {"version":3,"file":"LocalizeItemUtils.d.ts","sourceRoot":"","sources":["../src/LocalizeItemUtils.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AACtD,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AA8EjD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,kBAAkB,EAAE,CAAC;IAC9B,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAIF,wBAAsB,yBAAyB,CAC7C,UAAU,EAAE,qBAAqB,EACjC,WAAW,EAAE,eAAe,GAC3B,OAAO,CAAC,iBAAiB,CAAC,CAgI5B;AAGD,eAAO,MAAM,mBAAmB,kBACf,MAAM,EAAE,qBACJ,iBAAiB,EAAE,aAC3B,MAAM,QACX,QAAQ,uBACO,MAAM,+BAqC5B,CAAC"}
@@ -1,4 +1,4 @@
1
- import { requestBatchTranslation, } from "./services/translationService";
1
+ import { requestBatchTranslation, translationItem, translationItemKey, } from "./services/translationService";
2
2
  import { discoverItemsTree, flattenSelectableItemsFromBackendTrees, } from "./api/discovery";
3
3
  /**
4
4
  * Resolve the final list of item IDs to translate, expanding subitems for
@@ -12,38 +12,61 @@ import { discoverItemsTree, flattenSelectableItemsFromBackendTrees, } from "./ap
12
12
  async function resolveItemIdsToTranslate(wizardData, sessionId) {
13
13
  if (wizardData.selectionTreeItems &&
14
14
  wizardData.selectionTreeItems.length > 0) {
15
- const directIds = [];
16
- const rootsToExpand = [];
15
+ const directItems = [];
16
+ const rootsToExpand = new Map();
17
17
  for (const entry of wizardData.selectionTreeItems) {
18
18
  if (entry.includeSubitems) {
19
- rootsToExpand.push(entry.descriptor.id);
19
+ const item = translationItem(entry.descriptor);
20
+ const key = JSON.stringify([item.store, entry.descriptor.language]);
21
+ const group = rootsToExpand.get(key) ?? {
22
+ store: item.store,
23
+ language: entry.descriptor.language,
24
+ rootItemIds: [],
25
+ };
26
+ group.rootItemIds.push(item.itemId);
27
+ rootsToExpand.set(key, group);
20
28
  }
21
29
  else {
22
- directIds.push(entry.descriptor.id);
30
+ directItems.push(translationItem(entry.descriptor));
23
31
  }
24
32
  }
25
- const expandedIds = [];
26
- if (rootsToExpand.length > 0) {
27
- const language = wizardData.selectionTreeItems[0]?.descriptor.language;
28
- const tree = await discoverItemsTree({ rootItemIds: rootsToExpand, language }, sessionId);
29
- expandedIds.push(...flattenSelectableItemsFromBackendTrees(tree.trees).map((n) => n.id));
33
+ const expandedItems = [];
34
+ for (const request of rootsToExpand.values()) {
35
+ const tree = await discoverItemsTree(request, sessionId);
36
+ expandedItems.push(...flattenSelectableItemsFromBackendTrees(tree.trees).map((n) => ({
37
+ store: n.store,
38
+ itemId: n.id,
39
+ })));
30
40
  }
31
- return Array.from(new Set([...directIds, ...expandedIds]));
41
+ return Array.from(new Map([...directItems, ...expandedItems].map((item) => [
42
+ translationItemKey(item),
43
+ item,
44
+ ])).values());
32
45
  }
33
46
  const fallback = wizardData.discoveredItems && wizardData.discoveredItems.length > 0
34
47
  ? wizardData.discoveredItems
35
48
  : wizardData.items;
36
- return fallback.map((item) => item.descriptor.id);
49
+ return Array.from(new Map(fallback.map((item) => {
50
+ const coordinate = translationItem(item.descriptor);
51
+ return [translationItemKey(coordinate), coordinate];
52
+ })).values());
37
53
  }
38
54
  // Unified translation function that handles both single and batch translations
39
55
  // Now always uses batch logic for traceability in recentTranslation view
40
56
  export async function performDefaultTranslation(wizardData, editContext) {
41
57
  // Build language mappings (source -> target) from the wizard data
42
- // The source language is consistent for each target language across all items
58
+ // The source language is consistent for each target language across all items.
59
+ // The source the user chose in the dialog wins; the status endpoint's
60
+ // per-target suggestion is only the fallback for callers without one.
43
61
  const languageMappings = [];
44
62
  for (const language of wizardData.targetLanguages) {
45
63
  const languageInfo = wizardData.languageData.get(language);
46
- const sourceLanguage = languageInfo?.translationStatus?.sourceLanguage || "en";
64
+ const sourceLanguage = wizardData.sourceLanguage ||
65
+ wizardData.selectionTreeItems?.[0]?.descriptor.language ||
66
+ wizardData.items[0]?.descriptor.language ||
67
+ languageInfo?.translationStatus?.sourceLanguage;
68
+ if (!sourceLanguage)
69
+ throw new Error("Select a source language before translating.");
47
70
  // Skip if target language equals source language
48
71
  if (language === sourceLanguage)
49
72
  continue;
@@ -53,9 +76,9 @@ export async function performDefaultTranslation(wizardData, editContext) {
53
76
  });
54
77
  }
55
78
  // Resolve item IDs, expanding subitems per-item-flag where applicable.
56
- const itemIds = await resolveItemIdsToTranslate(wizardData, editContext.sessionId);
79
+ const items = await resolveItemIdsToTranslate(wizardData, editContext.sessionId);
57
80
  // Validate that we have translation requests to process
58
- if (languageMappings.length === 0 || itemIds.length === 0) {
81
+ if (languageMappings.length === 0 || items.length === 0) {
59
82
  const error = new Error("No translations needed. All selected target languages match the source languages of the items.");
60
83
  error.name = "NoTranslationsNeededError";
61
84
  throw error;
@@ -106,7 +129,7 @@ export async function performDefaultTranslation(wizardData, editContext) {
106
129
  provider: wizardData.translationProvider,
107
130
  batchMetadata,
108
131
  languageMappings,
109
- itemIds,
132
+ items,
110
133
  });
111
134
  if (batchResult.type === "error") {
112
135
  console.error("Translation request failed:", batchResult);
@@ -126,6 +149,7 @@ export async function performDefaultTranslation(wizardData, editContext) {
126
149
  throw error;
127
150
  }
128
151
  const started = batchResponse.started?.map((result) => ({
152
+ store: result.store,
129
153
  itemId: result.itemId,
130
154
  targetLanguage: result.targetLanguage,
131
155
  jobId: result.jobId,
@@ -142,7 +166,9 @@ export const defaultTranslateAll = async (languageCodes, translationStatus, sess
142
166
  items: [item],
143
167
  targetLanguages: languageCodes,
144
168
  languageData: new Map(languageCodes.map((lang) => {
145
- const status = translationStatus?.find((x) => x.targetLanguage === lang);
169
+ const status = translationStatus?.find((x) => x.store === item.descriptor.database &&
170
+ x.itemId === item.descriptor.id &&
171
+ x.targetLanguage === lang);
146
172
  return [
147
173
  lang,
148
174
  {
@@ -1,9 +1,12 @@
1
+ import { type TranslationItem } from "../services/translationService";
1
2
  export declare function suggestBatchName(req: {
2
- itemIds: string[];
3
+ items: TranslationItem[];
4
+ language: string;
3
5
  targetLanguages: string[];
4
6
  includeSubitems?: boolean;
5
7
  }, sessionId?: string): Promise<string | null>;
6
8
  export type DiscoveredItem = {
9
+ store: string;
7
10
  id: string;
8
11
  name: string;
9
12
  path: string;
@@ -17,6 +20,7 @@ export type TreeNode = {
17
20
  children?: TreeNode[];
18
21
  };
19
22
  export type BackendTreeNode = {
23
+ store: string;
20
24
  id: string;
21
25
  name: string;
22
26
  path: string;
@@ -25,8 +29,9 @@ export type BackendTreeNode = {
25
29
  children: BackendTreeNode[];
26
30
  };
27
31
  export type DiscoverItemsTreeRequest = {
32
+ store: string;
28
33
  rootItemIds: string[];
29
- language?: string;
34
+ language: string;
30
35
  };
31
36
  export type DiscoverItemsTreeResponse = {
32
37
  trees: BackendTreeNode[];
@@ -36,10 +41,18 @@ export type DiscoverItemsTreeResponse = {
36
41
  export declare function discoverItemsTree(req: DiscoverItemsTreeRequest, sessionId?: string): Promise<DiscoverItemsTreeResponse>;
37
42
  export declare function convertBackendTreeToTreeNodes(trees: BackendTreeNode[]): TreeNode[];
38
43
  export declare function flattenSelectableItemsFromBackendTrees(trees: BackendTreeNode[]): DiscoveredItem[];
44
+ /**
45
+ * One line of the subitem-count stream. `refusal` (multi-cms cfsmall, A15; cfabove §5): the store refused to list the subtree
46
+ * past its bound — the server's last line names why, the count is what was walked before, and the translation itself would
47
+ * refuse with the same reason.
48
+ */
39
49
  export type SubitemCountUpdate = {
40
50
  count: number;
41
51
  complete: boolean;
52
+ refusal?: string;
42
53
  };
54
+ /** The update a parsed stream line states, or undefined for a line without a count. */
55
+ export declare function subitemCountUpdateOf(line: unknown): SubitemCountUpdate | undefined;
43
56
  /**
44
57
  * Streams the running subitem count for a given root item from the
45
58
  * backend. The endpoint returns newline-delimited JSON; each parsed line
@@ -50,8 +63,9 @@ export type SubitemCountUpdate = {
50
63
  * subitems flag off again).
51
64
  */
52
65
  export declare function streamSubitemCount(req: {
66
+ store: string;
53
67
  itemId: string;
54
- language?: string;
68
+ language: string;
55
69
  }, onProgress: (update: SubitemCountUpdate) => void, options?: {
56
70
  sessionId?: string;
57
71
  signal?: AbortSignal;
@@ -1 +1 @@
1
- {"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/api/discovery.ts"],"names":[],"mappings":"AAEA,wBAAsB,gBAAgB,CACpC,GAAG,EAAE;IACH,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,EACD,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAaxB;AAED,MAAM,MAAM,cAAc,GAAG;IAC3B,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,WAAW,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF,MAAM,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translationItemKey, } from "../services/translationService";
2
3
  export async function suggestBatchName(req, sessionId) {
3
4
  const { data, type } = await post("/parhelia/translation/suggestBatchName", {
4
- ItemIds: req.itemIds,
5
+ Items: req.items,
6
+ Language: req.language,
5
7
  TargetLanguages: req.targetLanguages,
6
8
  IncludeSubitems: !!req.includeSubitems,
7
9
  }, sessionId);
@@ -12,6 +14,7 @@ export async function suggestBatchName(req, sessionId) {
12
14
  }
13
15
  export async function discoverItemsTree(req, sessionId) {
14
16
  const { data, type, details } = await post("/parhelia/translation/discoveritemstree", {
17
+ Store: req.store,
15
18
  RootItemIds: req.rootItemIds,
16
19
  Language: req.language,
17
20
  }, sessionId);
@@ -21,9 +24,10 @@ export async function discoverItemsTree(req, sessionId) {
21
24
  }
22
25
  export function convertBackendTreeToTreeNodes(trees) {
23
26
  const convert = (n) => ({
24
- key: n.id,
27
+ key: translationItemKey({ store: n.store, itemId: n.id }),
25
28
  label: n.name,
26
29
  data: {
30
+ store: n.store,
27
31
  id: n.id,
28
32
  name: n.name,
29
33
  path: n.path,
@@ -40,6 +44,7 @@ export function flattenSelectableItemsFromBackendTrees(trees) {
40
44
  const out = [];
41
45
  const walk = (n) => {
42
46
  out.push({
47
+ store: n.store,
43
48
  id: n.id,
44
49
  name: n.name,
45
50
  path: n.path,
@@ -51,6 +56,18 @@ export function flattenSelectableItemsFromBackendTrees(trees) {
51
56
  trees.forEach(walk);
52
57
  return out;
53
58
  }
59
+ /** The update a parsed stream line states, or undefined for a line without a count. */
60
+ export function subitemCountUpdateOf(line) {
61
+ if (!line || typeof line !== "object")
62
+ return undefined;
63
+ const parsed = line;
64
+ if (typeof parsed.count !== "number")
65
+ return undefined;
66
+ const update = { count: parsed.count, complete: !!parsed.complete };
67
+ if (typeof parsed.refusal === "string" && parsed.refusal.trim())
68
+ update.refusal = parsed.refusal;
69
+ return update;
70
+ }
54
71
  /**
55
72
  * Streams the running subitem count for a given root item from the
56
73
  * backend. The endpoint returns newline-delimited JSON; each parsed line
@@ -66,12 +83,16 @@ export async function streamSubitemCount(req, onProgress, options) {
66
83
  url += "?sessionId=" + options.sessionId;
67
84
  const response = await fetch(url, {
68
85
  method: "POST",
69
- body: JSON.stringify({ ItemId: req.itemId, Language: req.language }),
86
+ body: JSON.stringify({
87
+ Store: req.store,
88
+ ItemId: req.itemId,
89
+ Language: req.language,
90
+ }),
70
91
  credentials: "include",
71
- headers: {
92
+ headers: withParheliaRequestHeader({
72
93
  "Content-Type": "application/json",
73
94
  Accept: "application/x-ndjson",
74
- },
95
+ }),
75
96
  signal: options?.signal,
76
97
  });
77
98
  if (!response.ok || !response.body) {
@@ -94,10 +115,10 @@ export async function streamSubitemCount(req, onProgress, options) {
94
115
  if (!line)
95
116
  continue;
96
117
  try {
97
- const parsed = JSON.parse(line);
98
- if (typeof parsed.count === "number") {
99
- lastCount = parsed.count;
100
- onProgress({ count: parsed.count, complete: !!parsed.complete });
118
+ const update = subitemCountUpdateOf(JSON.parse(line));
119
+ if (update) {
120
+ lastCount = update.count;
121
+ onProgress(update);
101
122
  }
102
123
  }
103
124
  catch {
@@ -109,10 +130,10 @@ export async function streamSubitemCount(req, onProgress, options) {
109
130
  const tail = buffer.trim();
110
131
  if (tail) {
111
132
  try {
112
- const parsed = JSON.parse(tail);
113
- if (typeof parsed.count === "number") {
114
- lastCount = parsed.count;
115
- onProgress({ count: parsed.count, complete: !!parsed.complete });
133
+ const update = subitemCountUpdateOf(JSON.parse(tail));
134
+ if (update) {
135
+ lastCount = update.count;
136
+ onProgress(update);
116
137
  }
117
138
  }
118
139
  catch {
@@ -1 +1 @@
1
- {"version":3,"file":"useTranslationWizard.d.ts","sourceRoot":"","sources":["../../src/hooks/useTranslationWizard.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAUhF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,uBAAuB;;;EAuGlE"}
1
+ {"version":3,"file":"useTranslationWizard.d.ts","sourceRoot":"","sources":["../../src/hooks/useTranslationWizard.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAUhF,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,uBAAuB;;;EA+GlE"}
@@ -16,6 +16,7 @@ export function useTranslationWizard(props) {
16
16
  });
17
17
  // Load initial data
18
18
  useEffect(() => {
19
+ let cancelled = false;
19
20
  const loadInitialData = async () => {
20
21
  const itemDescriptors = props.items.map((x) => x.descriptor);
21
22
  // Load translation providers
@@ -35,7 +36,7 @@ export function useTranslationWizard(props) {
35
36
  }));
36
37
  // Load translation status for each item
37
38
  const translationStatuses = await Promise.all(itemDescriptors.map(async (item) => {
38
- const result = await getTranslationStatus(item.id);
39
+ const result = await getTranslationStatus(item);
39
40
  return result.data || [];
40
41
  }));
41
42
  const languageMap = new Map();
@@ -50,15 +51,19 @@ export function useTranslationWizard(props) {
50
51
  if (language.versions > 0 && itemDescriptors[itemIndex]) {
51
52
  languageData.items.push(itemDescriptors[itemIndex]);
52
53
  }
53
- const status = translationStatuses[itemIndex]?.find((s) => s.targetLanguage === language.languageCode);
54
+ const status = translationStatuses[itemIndex]?.find((s) => s.store === itemDescriptors[itemIndex]?.database &&
55
+ s.targetLanguage === language.languageCode);
54
56
  if (status && !languageData.translationStatus) {
55
57
  languageData.translationStatus = status;
56
58
  }
57
59
  languageMap.set(language.languageCode, languageData);
58
60
  });
59
61
  });
62
+ if (cancelled)
63
+ return;
60
64
  setWizardData((prevData) => ({
61
65
  ...prevData,
66
+ items: props.items,
62
67
  translationProviders: providers,
63
68
  translationProvider: defaultProvider,
64
69
  languageData: languageMap,
@@ -66,6 +71,9 @@ export function useTranslationWizard(props) {
66
71
  }
67
72
  };
68
73
  loadInitialData();
74
+ return () => {
75
+ cancelled = true;
76
+ };
69
77
  }, [props.items]);
70
78
  // Save translation provider to localStorage when it changes
71
79
  useEffect(() => {
@@ -1 +1 @@
1
- {"version":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AAmB,EAClC,OAAO,CAAC,EAAE,yBAAyB,uBAuIpC"}
package/dist/index.js CHANGED
@@ -204,7 +204,7 @@ export function configureLocalization(configuration, options) {
204
204
  const translationServicesPanel = {
205
205
  id: "translation-services",
206
206
  title: "Translation Services",
207
- subtitle: "Configure translation services (OpenAI, Azure, DeepL, etc.)",
207
+ subtitle: "Translation services and how translation runs",
208
208
  icon: _jsx(LanguagesIcon, { strokeWidth: 1 }),
209
209
  content: _jsx(TranslationServicesPanel, {}),
210
210
  requiresAdministrator: true,
@@ -222,14 +222,16 @@ export function configureLocalization(configuration, options) {
222
222
  }
223
223
  else {
224
224
  const groups = configuration.settings.groups;
225
- const aboutIndex = groups.findIndex((g) => g.title === "About");
225
+ // Localization sits above System (or above About when there is no System group).
226
+ const systemIndex = groups.findIndex((g) => g.title === "System");
227
+ const insertIndex = systemIndex >= 0 ? systemIndex : groups.findIndex((g) => g.title === "About");
226
228
  const localizationGroup = {
227
229
  title: "Localization",
228
230
  icon: _jsx(LanguagesIcon, { strokeWidth: 1 }),
229
231
  panels: [translationServicesPanel],
230
232
  };
231
- if (aboutIndex >= 0) {
232
- groups.splice(aboutIndex, 0, localizationGroup);
233
+ if (insertIndex >= 0) {
234
+ groups.splice(insertIndex, 0, localizationGroup);
233
235
  }
234
236
  else {
235
237
  groups.push(localizationGroup);
@@ -6,7 +6,27 @@ export type TranslationApiResponse<T> = {
6
6
  error?: string;
7
7
  message?: string;
8
8
  };
9
- export declare function getTranslationStatus(itemId: string): Promise<import("@parhelia/core").ExecutionResult<TranslationStatus[]>>;
9
+ export type TranslationItem = {
10
+ store: string;
11
+ itemId: string;
12
+ };
13
+ export declare function translationDescriptorKey(descriptor: {
14
+ database?: string;
15
+ id: string;
16
+ }): string;
17
+ export declare function translationItemKey(item: {
18
+ store?: string | null;
19
+ itemId: string;
20
+ }): string;
21
+ export declare function translationItem(descriptor: {
22
+ database?: string;
23
+ id: string;
24
+ }): TranslationItem;
25
+ export declare function getTranslationStatus(item: {
26
+ database?: string;
27
+ id: string;
28
+ language: string;
29
+ }): Promise<import("@parhelia/core").ExecutionResult<TranslationStatus[]>>;
10
30
  export declare function getTranslationProviders(): Promise<import("@parhelia/core").ExecutionResult<TranslationProviderInfo[]>>;
11
31
  export type AvailableTranslationService = {
12
32
  serviceName: string;
@@ -14,33 +34,10 @@ export type AvailableTranslationService = {
14
34
  isConfigured: boolean;
15
35
  supportedLanguages?: string[];
16
36
  settingsItemId?: string;
17
- templateId: string;
18
- templateName: string;
19
37
  };
20
38
  export declare function getAvailableTranslationServices(): Promise<import("@parhelia/core").ExecutionResult<TranslationApiResponse<AvailableTranslationService[]>>>;
21
- export declare function createProviderSettings(serviceName: string, templateId: string, language?: string, structureSettings?: TranslationStructureSettings): Promise<import("@parhelia/core").ExecutionResult<TranslationApiResponse<{
22
- itemId: string;
23
- itemPath: string;
24
- }>>>;
25
- export type TranslationStructureSettings = {
26
- translationFolderPath: string;
27
- translationFolderTemplateId: string;
28
- translationProvidersPath: string;
29
- translationProvidersTemplateId: string;
30
- };
31
- export type TranslationStructureItemInfo = {
32
- exists: boolean;
33
- itemId?: string;
34
- path?: string;
35
- templateId?: string;
36
- };
37
- export type TranslationStructureResponse = {
38
- translationFolder: TranslationStructureItemInfo;
39
- translationProvidersFolder: TranslationStructureItemInfo;
40
- };
41
- export declare function getTranslationStructure(settings: TranslationStructureSettings): Promise<import("@parhelia/core").ExecutionResult<TranslationApiResponse<TranslationStructureResponse>>>;
42
- export declare function ensureTranslationStructure(settings: TranslationStructureSettings): Promise<import("@parhelia/core").ExecutionResult<TranslationApiResponse<TranslationStructureResponse>>>;
43
39
  export type TranslationJobRecord = {
40
+ store?: string | null;
44
41
  id?: string;
45
42
  sequenceId?: number;
46
43
  itemId: string;
@@ -85,6 +82,8 @@ export type TranslationBatchInfo = {
85
82
  startedAtUtc?: string;
86
83
  completedAtUtc?: string;
87
84
  initiatedByUser?: string;
85
+ /** The initiator's account id; the name where names are ids (the classic CM). */
86
+ initiatedBySubjectId?: string;
88
87
  initiatorSessionId?: string;
89
88
  provider?: string;
90
89
  status?: string;
@@ -106,6 +105,8 @@ export type TranslationBatchInfo = {
106
105
  };
107
106
  export declare function getBatchInfo(batchId: string): Promise<import("@parhelia/core").ExecutionResult<TranslationBatchInfo>>;
108
107
  export type ListBatchesFilters = {
108
+ store?: string;
109
+ language?: string;
109
110
  fromUtc?: string;
110
111
  status?: string;
111
112
  user?: string;
@@ -123,6 +124,16 @@ export type AbortTranslationResponse = {
123
124
  };
124
125
  export declare function abortJob(id: string): Promise<import("@parhelia/core").ExecutionResult<AbortTranslationResponse>>;
125
126
  export declare function abortBatch(id: string): Promise<import("@parhelia/core").ExecutionResult<AbortTranslationResponse>>;
127
+ export type DeleteTranslationBatchResponse = {
128
+ success: boolean;
129
+ batchId: string;
130
+ deletedJobs: number;
131
+ };
132
+ /**
133
+ * Deletes a batch that has stopped, with its jobs. A running batch is refused
134
+ * (409): abort it first. Translations already written to content stay.
135
+ */
136
+ export declare function deleteBatch(id: string): Promise<import("@parhelia/core").ExecutionResult<DeleteTranslationBatchResponse>>;
126
137
  export declare function subscribeToBatch(batchId: string, sessionId: string): Promise<import("@parhelia/core").ExecutionResult<{
127
138
  success: boolean;
128
139
  message: string;
@@ -136,11 +147,13 @@ export type LanguageMapping = {
136
147
  targetLanguage: string;
137
148
  };
138
149
  export type BatchTranslationResult = {
150
+ store: string;
139
151
  itemId: string;
140
152
  targetLanguage: string;
141
153
  jobId: string;
142
154
  };
143
155
  export type BatchTranslationError = {
156
+ store: string;
144
157
  itemId: string;
145
158
  targetLanguage: string;
146
159
  error: string;
@@ -150,14 +163,15 @@ export type BatchTranslationResponse = {
150
163
  started: BatchTranslationResult[];
151
164
  skipped: BatchTranslationError[];
152
165
  };
153
- export declare function requestBatchTranslation({ sessionId, provider, batchMetadata, languageMappings, itemIds, }: {
166
+ export declare function requestBatchTranslation({ sessionId, provider, batchMetadata, languageMappings, items, }: {
154
167
  sessionId: string;
155
168
  provider: string;
156
169
  batchMetadata?: string;
157
170
  languageMappings: LanguageMapping[];
158
- itemIds: string[];
171
+ items: TranslationItem[];
159
172
  }): Promise<import("@parhelia/core").ExecutionResult<BatchTranslationResponse>>;
160
173
  export type RetryBatchTranslationJobRequest = {
174
+ store: string;
161
175
  sourceTranslationId?: string;
162
176
  itemId: string;
163
177
  sourceLanguage: string;
@@ -165,6 +179,7 @@ export type RetryBatchTranslationJobRequest = {
165
179
  metadata?: string | null;
166
180
  };
167
181
  export type RetryBatchTranslationStartedJob = {
182
+ store: string;
168
183
  sourceTranslationId?: string;
169
184
  itemId: string;
170
185
  sourceLanguage: string;
@@ -173,6 +188,7 @@ export type RetryBatchTranslationStartedJob = {
173
188
  jobId: string;
174
189
  };
175
190
  export type RetryBatchTranslationSkippedJob = {
191
+ store: string;
176
192
  sourceTranslationId?: string;
177
193
  itemId: string;
178
194
  sourceLanguage: string;