@parhelia/localization 0.1.12788 → 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 (57) 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 +32 -32
  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 +22 -14
  46. package/dist/translation-center/TranslationsTitlebar.d.ts +7 -0
  47. package/dist/translation-center/TranslationsTitlebar.d.ts.map +1 -0
  48. package/dist/translation-center/TranslationsTitlebar.js +16 -0
  49. package/dist/types.d.ts +1 -0
  50. package/dist/types.d.ts.map +1 -1
  51. package/package.json +1 -1
  52. package/dist/translation-center/BatchTranslationView.d.ts +0 -8
  53. package/dist/translation-center/BatchTranslationView.d.ts.map +0 -1
  54. package/dist/translation-center/BatchTranslationView.js +0 -870
  55. package/dist/translation-center/RecentTranslations.d.ts +0 -2
  56. package/dist/translation-center/RecentTranslations.d.ts.map +0 -1
  57. 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":"AAQA,wBAAgB,qBAAqB,4CA+CpC"}
1
+ {"version":3,"file":"TranslationManagement.d.ts","sourceRoot":"","sources":["../../src/translation-center/TranslationManagement.tsx"],"names":[],"mappings":"AAOA,wBAAgB,qBAAqB,4CAwEpC"}
@@ -1,23 +1,31 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { useEditContext, usePathname, useRouter, useSearchParams, } from "@parhelia/core";
3
- import { BatchTranslationView } from "./BatchTranslationView";
2
+ import { ItemEditorPane, Splitter, useEditContext, } from "@parhelia/core";
4
3
  export function TranslationManagement() {
5
4
  const editContext = useEditContext();
6
5
  const config = editContext?.configuration;
7
- const searchParams = useSearchParams();
8
- const batchId = searchParams.get("batchId");
9
- const router = useRouter();
10
- const pathname = usePathname();
11
- // Get the Recent Translations panel content (since it's the only one)
12
- const recentTranslationsPanel = config?.translationCenter?.groups
6
+ const showEditorPanel = editContext?.showAgentsWorkspaceEditor ?? false;
7
+ const isMobile = editContext?.isMobile ?? false;
8
+ // Get the Translation Batches panel content (since it's the only one)
9
+ const translationBatchesPanel = config?.translationCenter?.groups
13
10
  ?.flatMap((x) => x.panels)
14
- ?.find((panel) => panel.id === "recent-translations");
11
+ ?.find((panel) => panel.id === "translation-batches");
15
12
  if (!config) {
16
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..."] }) }));
17
14
  }
18
- return (_jsx("div", { className: "absolute inset-0 flex flex-col bg-[var(--color-gray-5)]", "data-testid": "translation-management", children: batchId ? (_jsx(BatchTranslationView, { batchId: batchId, onBack: () => {
19
- const current = new URLSearchParams(searchParams.toString());
20
- current.delete("batchId");
21
- router.push(`${pathname}?${current.toString()}`, { scroll: false });
22
- } })) : 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" })] }));
16
+ const panels = [
17
+ {
18
+ name: "translation-management",
19
+ defaultSize: "auto",
20
+ content: managementContent,
21
+ },
22
+ ];
23
+ if (showEditorPanel) {
24
+ panels.push({
25
+ name: "editor-preview",
26
+ defaultSize: isMobile ? 45 : 500,
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." }) })),
28
+ });
29
+ }
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) }));
23
31
  }
@@ -0,0 +1,7 @@
1
+ /**
2
+ * TranslationsTitlebar - Titlebar content for the Translation Management workspace.
3
+ * Matches the AI Agents / Tasks titlebar pattern: title + subtitle stacked,
4
+ * with consistent left padding so it aligns across workspaces.
5
+ */
6
+ export declare function TranslationsTitlebar(): import("react/jsx-runtime").JSX.Element | null;
7
+ //# sourceMappingURL=TranslationsTitlebar.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TranslationsTitlebar.d.ts","sourceRoot":"","sources":["../../src/translation-center/TranslationsTitlebar.tsx"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,wBAAgB,oBAAoB,mDA8CnC"}
@@ -0,0 +1,16 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { SimpleIconButton, useEditContext, cn, } from "@parhelia/core";
3
+ import { SquarePen } from "lucide-react";
4
+ /**
5
+ * TranslationsTitlebar - Titlebar content for the Translation Management workspace.
6
+ * Matches the AI Agents / Tasks titlebar pattern: title + subtitle stacked,
7
+ * with consistent left padding so it aligns across workspaces.
8
+ */
9
+ export function TranslationsTitlebar() {
10
+ const editContext = useEditContext();
11
+ if (!editContext?.workspace)
12
+ return null;
13
+ const showSubtitle = !editContext.isMobile;
14
+ const { showAgentsWorkspaceEditor, setShowAgentsWorkspaceEditor } = editContext;
15
+ return (_jsxs("div", { className: cn("flex w-full flex-row items-center gap-3 pl-2", editContext.isMobile && "border-b px-1.5 py-1"), children: [_jsxs("div", { className: "flex min-w-0 flex-1 flex-col items-start justify-center leading-tight", "data-testid": "translations-titlebar-identity", children: [_jsx("span", { className: "truncate text-sm font-medium leading-tight text-gray-900", children: "Translation Management" }), showSubtitle && (_jsx("span", { className: "truncate text-[11px] leading-tight text-gray-500", children: "Track and manage content translations" }))] }), !editContext.isMobile && (_jsx("div", { className: "flex shrink-0 items-center gap-2", children: _jsx(SimpleIconButton, { icon: _jsx(SquarePen, { className: "h-5 w-5", strokeWidth: 1 }), label: showAgentsWorkspaceEditor ? "Hide Editor" : "Show Editor", size: "large", "data-testid": "translations-editor-panel-toggle", selected: showAgentsWorkspaceEditor, onClick: () => setShowAgentsWorkspaceEditor(!showAgentsWorkspaceEditor) }) }))] }));
16
+ }
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.12788",
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,2CAmoD3B"}