@parhelia/localization 0.1.12789 → 0.1.12790

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 (54) hide show
  1. package/dist/LocalizeItemDialog.d.ts.map +1 -1
  2. package/dist/LocalizeItemDialog.js +92 -34
  3. package/dist/LocalizeItemUtils.d.ts +1 -2
  4. package/dist/LocalizeItemUtils.d.ts.map +1 -1
  5. package/dist/LocalizeItemUtils.js +44 -12
  6. package/dist/api/discovery.d.ts +25 -0
  7. package/dist/api/discovery.d.ts.map +1 -1
  8. package/dist/api/discovery.js +87 -0
  9. package/dist/index.d.ts +8 -17
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +29 -30
  12. package/dist/services/translationService.d.ts +40 -9
  13. package/dist/services/translationService.d.ts.map +1 -1
  14. package/dist/services/translationService.js +30 -4
  15. package/dist/settings/TranslationServicesPanel.d.ts.map +1 -1
  16. package/dist/settings/TranslationServicesPanel.js +18 -36
  17. package/dist/sidebar/TranslationSidebar.d.ts.map +1 -1
  18. package/dist/sidebar/TranslationSidebar.js +4 -1
  19. package/dist/steps/ItemSelectionStep.d.ts +3 -0
  20. package/dist/steps/ItemSelectionStep.d.ts.map +1 -0
  21. package/dist/steps/ItemSelectionStep.js +23 -0
  22. package/dist/steps/ItemSelectionTree.d.ts +13 -0
  23. package/dist/steps/ItemSelectionTree.d.ts.map +1 -0
  24. package/dist/steps/ItemSelectionTree.js +326 -0
  25. package/dist/steps/MetadataInputStep.d.ts.map +1 -1
  26. package/dist/steps/MetadataInputStep.js +8 -1
  27. package/dist/steps/PromptCustomizationStep.d.ts +1 -1
  28. package/dist/steps/PromptCustomizationStep.d.ts.map +1 -1
  29. package/dist/steps/PromptCustomizationStep.js +161 -56
  30. package/dist/steps/ServiceLanguageSelectionStep.d.ts +6 -1
  31. package/dist/steps/ServiceLanguageSelectionStep.d.ts.map +1 -1
  32. package/dist/steps/ServiceLanguageSelectionStep.js +53 -163
  33. package/dist/steps/WizardStepShell.d.ts +17 -0
  34. package/dist/steps/WizardStepShell.d.ts.map +1 -0
  35. package/dist/steps/WizardStepShell.js +11 -0
  36. package/dist/steps/index.d.ts +1 -0
  37. package/dist/steps/index.d.ts.map +1 -1
  38. package/dist/steps/index.js +1 -0
  39. package/dist/steps/types.d.ts +17 -1
  40. package/dist/steps/types.d.ts.map +1 -1
  41. package/dist/translation-center/TranslationBatches.d.ts +2 -0
  42. package/dist/translation-center/TranslationBatches.d.ts.map +1 -0
  43. package/dist/translation-center/TranslationBatches.js +995 -0
  44. package/dist/translation-center/TranslationManagement.d.ts.map +1 -1
  45. package/dist/translation-center/TranslationManagement.js +6 -23
  46. package/dist/types.d.ts +1 -0
  47. package/dist/types.d.ts.map +1 -1
  48. package/package.json +1 -1
  49. package/dist/translation-center/BatchTranslationView.d.ts +0 -8
  50. package/dist/translation-center/BatchTranslationView.d.ts.map +0 -1
  51. package/dist/translation-center/BatchTranslationView.js +0 -890
  52. package/dist/translation-center/RecentTranslations.d.ts +0 -2
  53. package/dist/translation-center/RecentTranslations.d.ts.map +0 -1
  54. package/dist/translation-center/RecentTranslations.js +0 -309
@@ -1 +1 @@
1
- {"version":3,"file":"TranslationManagement.d.ts","sourceRoot":"","sources":["../../src/translation-center/TranslationManagement.tsx"],"names":[],"mappings":"AAwCA,wBAAgB,qBAAqB,4CAkFpC"}
1
+ {"version":3,"file":"TranslationManagement.d.ts","sourceRoot":"","sources":["../../src/translation-center/TranslationManagement.tsx"],"names":[],"mappings":"AAOA,wBAAgB,qBAAqB,4CAwEpC"}
@@ -1,35 +1,18 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { EditorSlotContextProvider, SingleEditView, Splitter, useEditContext, usePathname, useRouter, useSearchParams, } from "@parhelia/core";
3
- import { BatchTranslationView } from "./BatchTranslationView";
4
- function TranslationEditorPanel() {
5
- const editContext = useEditContext();
6
- const slotContext = editContext?.getActiveSlotContext();
7
- if (!slotContext) {
8
- return (_jsxs("div", { className: "flex h-full flex-col items-center justify-center gap-3 p-6 text-center", children: [_jsx("div", { className: "text-sm font-medium text-[var(--color-gray-1)]", children: "No item selected" }), _jsx("div", { className: "max-w-sm text-xs text-[var(--color-gray-2)]", children: "Select a translation batch item or language row to preview and edit it here." })] }));
9
- }
10
- return (_jsx(EditorSlotContextProvider, { value: slotContext, children: _jsx(SingleEditView, { compareView: false, name: "translation-management-preview", view: "primary" }) }));
11
- }
2
+ import { ItemEditorPane, Splitter, useEditContext, } from "@parhelia/core";
12
3
  export function TranslationManagement() {
13
4
  const editContext = useEditContext();
14
5
  const config = editContext?.configuration;
15
- const searchParams = useSearchParams();
16
- const batchId = searchParams.get("batchId");
17
- const router = useRouter();
18
- const pathname = usePathname();
19
6
  const showEditorPanel = editContext?.showAgentsWorkspaceEditor ?? false;
20
7
  const isMobile = editContext?.isMobile ?? false;
21
- // Get the Recent Translations panel content (since it's the only one)
22
- const recentTranslationsPanel = config?.translationCenter?.groups
8
+ // Get the Translation Batches panel content (since it's the only one)
9
+ const translationBatchesPanel = config?.translationCenter?.groups
23
10
  ?.flatMap((x) => x.panels)
24
- ?.find((panel) => panel.id === "recent-translations");
11
+ ?.find((panel) => panel.id === "translation-batches");
25
12
  if (!config) {
26
13
  return (_jsx("div", { className: "flex h-full flex-col items-center justify-center bg-[var(--color-gray-5)]", children: _jsxs("div", { className: "flex items-center gap-2 text-[var(--color-gray-2)]", children: [_jsx("i", { className: "pi pi-spin pi-spinner text-[#9650fb]" }), "Loading..."] }) }));
27
14
  }
28
- const managementContent = batchId ? (_jsx(BatchTranslationView, { batchId: batchId, onBack: () => {
29
- const current = new URLSearchParams(searchParams.toString());
30
- current.delete("batchId");
31
- router.push(`${pathname}?${current.toString()}`, { scroll: false });
32
- } })) : recentTranslationsPanel ? (_jsx("div", { className: "flex-1 min-h-0", children: recentTranslationsPanel.content })) : (_jsxs("div", { className: "flex h-full flex-col items-center justify-center text-[var(--color-gray-2)]", children: [_jsx("i", { className: "pi pi-language mb-4 text-4xl text-[var(--color-gray-3)]" }), _jsx("p", { className: "font-medium text-[var(--color-gray-1)]", children: "Recent translations not available" })] }));
15
+ const managementContent = translationBatchesPanel ? (_jsx("div", { className: "flex-1 min-h-0", children: translationBatchesPanel.content })) : (_jsxs("div", { className: "flex h-full flex-col items-center justify-center text-[var(--color-gray-2)]", children: [_jsx("i", { className: "pi pi-language mb-4 text-4xl text-[var(--color-gray-3)]" }), _jsx("p", { className: "font-medium text-[var(--color-gray-1)]", children: "Translation batches not available" })] }));
33
16
  const panels = [
34
17
  {
35
18
  name: "translation-management",
@@ -41,7 +24,7 @@ export function TranslationManagement() {
41
24
  panels.push({
42
25
  name: "editor-preview",
43
26
  defaultSize: isMobile ? 45 : 500,
44
- content: (_jsx("div", { className: "h-full overflow-hidden border-l border-gray-200 bg-gray-50", children: _jsx(TranslationEditorPanel, {}) })),
27
+ content: (_jsx("div", { className: "h-full overflow-hidden border-l border-gray-200 bg-gray-50", children: _jsx(ItemEditorPane, { name: "translation-management-preview", emptyDescription: "Select a translation batch item or language row to preview and edit it here." }) })),
45
28
  });
46
29
  }
47
30
  return (_jsx("div", { className: "absolute inset-0 flex flex-col bg-[var(--color-gray-5)]", "data-testid": "translation-management", children: showEditorPanel ? (_jsx(Splitter, { panels: panels, direction: isMobile ? "vertical" : "horizontal", localStorageKey: "translation-management.panelSizes" })) : (managementContent) }));
package/dist/types.d.ts CHANGED
@@ -7,6 +7,7 @@ export type TranslationStatus = {
7
7
  status: string;
8
8
  timestamp: string;
9
9
  message?: string;
10
+ totalCost?: number | null;
10
11
  };
11
12
  export type translationCenter = {
12
13
  groups: {
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE;QACN,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,SAAS,CAAC;QAChB,MAAM,EAAE,aAAa,EAAE,CAAC;KACzB,EAAE,CAAC;CACL,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAElC,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE;QACN,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,SAAS,CAAC;QAChB,MAAM,EAAE,aAAa,EAAE,CAAC;KACzB,EAAE,CAAC;CACL,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@parhelia/localization",
3
- "version": "0.1.12789",
3
+ "version": "0.1.12790",
4
4
  "type": "module",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -1,8 +0,0 @@
1
- import "react-json-view-lite/dist/index.css";
2
- interface BatchTranslationViewProps {
3
- batchId: string;
4
- onBack?: () => void;
5
- }
6
- export declare function BatchTranslationView({ batchId, onBack, }: BatchTranslationViewProps): import("react/jsx-runtime").JSX.Element;
7
- export {};
8
- //# sourceMappingURL=BatchTranslationView.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"BatchTranslationView.d.ts","sourceRoot":"","sources":["../../src/translation-center/BatchTranslationView.tsx"],"names":[],"mappings":"AA4CA,OAAO,qCAAqC,CAAC;AA4C7C,UAAU,yBAAyB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAwED,wBAAgB,oBAAoB,CAAC,EACnC,OAAO,EACP,MAAM,GACP,EAAE,yBAAyB,2CAqqD3B"}