@focus-reactive/payload-plugin-translator 0.7.2 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -3
- package/dist/client/entities/translation/api/mutations/useDismissStaleness.d.ts +12 -0
- package/dist/client/entities/translation/api/mutations/useDismissStaleness.js +40 -0
- package/dist/client/entities/translation/api/mutations/useQueueDocumentTranslation.js +6 -0
- package/dist/client/entities/translation/api/mutations/useRunDocumentTranslation.js +6 -0
- package/dist/client/entities/translation/api/queries/useDocumentStaleness.d.ts +17 -0
- package/dist/client/entities/translation/api/queries/useDocumentStaleness.js +35 -0
- package/dist/client/entities/translation/api/queries/useDocumentTranslation.js +23 -1
- package/dist/client/entities/translation/index.d.ts +12 -5
- package/dist/client/entities/translation/index.js +10 -5
- package/dist/client/entities/translation/model/panelStatus.d.ts +60 -0
- package/dist/client/entities/translation/model/panelStatus.js +101 -0
- package/dist/client/entities/translation/model/statusRows.d.ts +42 -0
- package/dist/client/entities/translation/model/statusRows.js +79 -0
- package/dist/client/entities/translation/model/types.d.ts +11 -0
- package/dist/client/entities/translation/model/types.js +1 -1
- package/dist/client/entities/translation/ui/ActionButton/ActionButton.d.ts +14 -0
- package/dist/client/entities/translation/ui/ActionButton/ActionButton.js +28 -0
- package/dist/client/entities/translation/ui/ActionButton/index.d.ts +1 -0
- package/dist/client/entities/translation/ui/ActionButton/index.js +3 -0
- package/dist/client/entities/translation/ui/ActionButton/styles.module.scss +11 -0
- package/dist/client/entities/translation/ui/PanelStatusMarker/PanelStatusMarker.d.ts +12 -0
- package/dist/client/entities/translation/ui/PanelStatusMarker/PanelStatusMarker.js +26 -0
- package/dist/client/entities/translation/ui/PanelStatusMarker/index.d.ts +1 -0
- package/dist/client/entities/translation/ui/PanelStatusMarker/index.js +3 -0
- package/dist/client/entities/translation/ui/PanelStatusMarker/styles.module.scss +12 -0
- package/dist/client/entities/translation/ui/TranslationDirection/styles.module.scss +2 -2
- package/dist/client/entities/translation/ui/TranslationStatusList/StatusBadge.d.ts +10 -0
- package/dist/client/entities/translation/ui/TranslationStatusList/StatusBadge.js +27 -0
- package/dist/client/entities/translation/ui/TranslationStatusList/TranslationStatusList.d.ts +14 -0
- package/dist/client/entities/translation/ui/TranslationStatusList/TranslationStatusList.js +194 -0
- package/dist/client/entities/translation/ui/TranslationStatusList/index.d.ts +1 -0
- package/dist/client/entities/translation/ui/TranslationStatusList/index.js +3 -0
- package/dist/client/entities/translation/ui/TranslationStatusList/styles.module.scss +72 -0
- package/dist/client/features/collection-translation-form/ui/CollectionTranslationForm.js +17 -21
- package/dist/client/features/collection-translation-form/ui/styles.module.scss +14 -14
- package/dist/client/features/collection-translation-popup/ui/CollectionTranslationPopup.d.ts +4 -2
- package/dist/client/features/collection-translation-popup/ui/CollectionTranslationPopup.js +9 -9
- package/dist/client/features/collection-translation-popup/ui/styles.module.scss +5 -3
- package/dist/client/features/collection-translation-progress/ui/CollectionTranslationProgress.d.ts +5 -1
- package/dist/client/features/collection-translation-progress/ui/CollectionTranslationProgress.js +100 -93
- package/dist/client/features/collection-translation-progress/ui/styles.module.scss +52 -3
- package/dist/client/features/open-document-translation-popup/ui/OpenDocumentTranslationPopup.d.ts +4 -1
- package/dist/client/features/open-document-translation-popup/ui/OpenDocumentTranslationPopup.js +16 -5
- package/dist/client/features/open-document-translation-popup/ui/styles.module.scss +5 -3
- package/dist/client/features/translate-document-form/ui/DocumentTranslationForm.js +5 -2
- package/dist/client/features/translate-document-form/ui/styles.module.scss +8 -2
- package/dist/client/shared/lib/assets/icons/AlertTriangleIcon.d.ts +1 -0
- package/dist/client/shared/lib/assets/icons/AlertTriangleIcon.js +14 -0
- package/dist/client/shared/lib/assets/icons/CheckIcon.d.ts +1 -0
- package/dist/client/shared/lib/assets/icons/CheckIcon.js +17 -0
- package/dist/client/shared/lib/assets/icons/CloseIcon.d.ts +1 -0
- package/dist/client/shared/lib/assets/icons/CloseIcon.js +16 -0
- package/dist/client/shared/ui/Button/Button.js +2 -1
- package/dist/client/shared/ui/ColorIndicator/ColorIndicator.d.ts +1 -1
- package/dist/client/shared/ui/ColorIndicator/styles.module.scss +4 -0
- package/dist/client/shared/ui/Label/Label.d.ts +2 -0
- package/dist/client/shared/ui/Label/Label.js +3 -2
- package/dist/client/shared/ui/Label/styles.module.scss +11 -0
- package/dist/client/shared/ui/Loading/Loading.d.ts +6 -2
- package/dist/client/shared/ui/Loading/Loading.js +4 -2
- package/dist/client/shared/ui/Loading/barCount.d.ts +3 -0
- package/dist/client/shared/ui/Loading/barCount.js +11 -0
- package/dist/client/shared/ui/Loading/styles.module.scss +20 -27
- package/dist/client/shared/ui/Popup/Popup.js +3 -0
- package/dist/client/shared/ui/Select/Select.js +1 -1
- package/dist/client/shared/ui/form/FormSelect/FormSelect.js +1 -0
- package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.js +37 -17
- package/dist/client/widgets/bulk-translation-dashboard/ui/styles.module.scss +27 -0
- package/dist/client/widgets/translate-document/ui/TranslateDocument.js +53 -27
- package/dist/client/widgets/translate-document/ui/styles.module.scss +27 -0
- package/dist/composition/levels/useDocTranslationApi.d.ts +3 -2
- package/dist/composition/levels/useDocTranslationApi.js +6 -3
- package/dist/core/provenance/ProvenanceStore.interface.d.ts +18 -0
- package/dist/core/provenance/index.d.ts +1 -0
- package/dist/core/provenance/index.js +1 -1
- package/dist/core/provenance/staleness.d.ts +19 -0
- package/dist/core/provenance/staleness.js +21 -0
- package/dist/plugin.js +2 -1
- package/dist/server/features/_lib/sourceDocument.d.ts +9 -0
- package/dist/server/features/_lib/sourceDocument.js +16 -0
- package/dist/server/features/createTranslationRoutes.d.ts +12 -4
- package/dist/server/features/createTranslationRoutes.js +15 -5
- package/dist/server/features/get-document-status/model.js +7 -2
- package/dist/server/features/staleness/dismissStaleness.handler.d.ts +8 -0
- package/dist/server/features/staleness/dismissStaleness.handler.js +27 -0
- package/dist/server/features/staleness/getDocumentStaleness.handler.d.ts +12 -0
- package/dist/server/features/staleness/getDocumentStaleness.handler.js +43 -0
- package/dist/server/features/staleness/index.d.ts +2 -0
- package/dist/server/features/staleness/index.js +3 -0
- package/dist/server/features/staleness/model.d.ts +52 -0
- package/dist/server/features/staleness/model.js +17 -0
- package/dist/server/features/staleness/route.d.ts +7 -0
- package/dist/server/features/staleness/route.js +21 -0
- package/dist/server/features/staleness/service.d.ts +15 -0
- package/dist/server/features/staleness/service.js +78 -0
- package/dist/server/features/translate-document/handler.js +22 -8
- package/dist/server/modules/provenance/PayloadProvenanceStore.d.ts +2 -0
- package/dist/server/modules/provenance/PayloadProvenanceStore.js +37 -14
- package/dist/server/modules/translation-levels/PluginConfigBuilder.d.ts +3 -0
- package/dist/server/modules/translation-levels/PluginConfigBuilder.js +2 -0
- package/dist/server/modules/translation-levels/types.d.ts +3 -0
- package/dist/server/shared/http/index.d.ts +1 -0
- package/dist/server/shared/http/index.js +1 -0
- package/dist/server/shared/http/toClientErrorMessage.d.ts +15 -0
- package/dist/server/shared/http/toClientErrorMessage.js +26 -0
- package/dist/server/shared/index.d.ts +1 -1
- package/dist/server/shared/index.js +1 -1
- package/package.json +1 -1
- package/dist/client/entities/translation/ui/CompletedTranslationStatus/CompletedTranslationStatus.d.ts +0 -7
- package/dist/client/entities/translation/ui/CompletedTranslationStatus/CompletedTranslationStatus.js +0 -45
- package/dist/client/entities/translation/ui/CompletedTranslationStatus/index.d.ts +0 -1
- package/dist/client/entities/translation/ui/CompletedTranslationStatus/index.js +0 -3
- package/dist/client/entities/translation/ui/CompletedTranslationStatus/styles.module.scss +0 -3
- package/dist/client/entities/translation/ui/FailedTranslationStatus/FailedTranslationStatus.d.ts +0 -9
- package/dist/client/entities/translation/ui/FailedTranslationStatus/FailedTranslationStatus.js +0 -54
- package/dist/client/entities/translation/ui/FailedTranslationStatus/index.d.ts +0 -1
- package/dist/client/entities/translation/ui/FailedTranslationStatus/index.js +0 -3
- package/dist/client/entities/translation/ui/FailedTranslationStatus/styles.module.scss +0 -3
- package/dist/client/entities/translation/ui/PendingTranslationStatus/PendingTranslationStatus.d.ts +0 -11
- package/dist/client/entities/translation/ui/PendingTranslationStatus/PendingTranslationStatus.js +0 -83
- package/dist/client/entities/translation/ui/PendingTranslationStatus/index.d.ts +0 -1
- package/dist/client/entities/translation/ui/PendingTranslationStatus/index.js +0 -3
- package/dist/client/entities/translation/ui/RunningTranslationStatus/RunningTranslationStatus.d.ts +0 -10
- package/dist/client/entities/translation/ui/RunningTranslationStatus/RunningTranslationStatus.js +0 -66
- package/dist/client/entities/translation/ui/RunningTranslationStatus/index.d.ts +0 -1
- package/dist/client/entities/translation/ui/RunningTranslationStatus/index.js +0 -3
- package/dist/client/features/document-translation-progress-failed/index.d.ts +0 -1
- package/dist/client/features/document-translation-progress-failed/index.js +0 -3
- package/dist/client/features/document-translation-progress-failed/ui/DocumentTranslationProgressFailed.d.ts +0 -6
- package/dist/client/features/document-translation-progress-failed/ui/DocumentTranslationProgressFailed.js +0 -28
- package/dist/client/features/document-translation-progress-pending/index.d.ts +0 -1
- package/dist/client/features/document-translation-progress-pending/index.js +0 -3
- package/dist/client/features/document-translation-progress-pending/ui/DocumentTranslationProgressPending.d.ts +0 -6
- package/dist/client/features/document-translation-progress-pending/ui/DocumentTranslationProgressPending.js +0 -44
- package/dist/client/features/document-translation-progress-running/index.d.ts +0 -1
- package/dist/client/features/document-translation-progress-running/index.js +0 -3
- package/dist/client/features/document-translation-progress-running/ui/DocumentTranslationProgressRunning.d.ts +0 -6
- package/dist/client/features/document-translation-progress-running/ui/DocumentTranslationProgressRunning.js +0 -28
package/dist/client/entities/translation/ui/FailedTranslationStatus/FailedTranslationStatus.js
DELETED
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { LanguageTranslateIcon } from "../../../../shared/lib/assets/icons/LanguageTranslateIcon";
|
|
3
|
-
import { ReloadIcon } from "../../../../shared/lib/assets/icons/ReloadIcon";
|
|
4
|
-
import Button from "../../../../shared/ui/Button";
|
|
5
|
-
import Divider from "../../../../shared/ui/Divider";
|
|
6
|
-
import StatusIndicator from "../../../../shared/ui/StatusIndicator";
|
|
7
|
-
import Tooltip from "../../../../shared/ui/Tooltip";
|
|
8
|
-
import { TranslationDirection } from "../TranslationDirection";
|
|
9
|
-
import styles from "./styles.module.scss";
|
|
10
|
-
export function FailedTranslationStatus({ onRetry, message, isLoading, sourceLocale, targetLocale }) {
|
|
11
|
-
return /*#__PURE__*/ _jsxs(StatusIndicator, {
|
|
12
|
-
$color: "red",
|
|
13
|
-
title: "Failed",
|
|
14
|
-
children: [
|
|
15
|
-
/*#__PURE__*/ _jsx(Tooltip, {
|
|
16
|
-
sideOffset: 12,
|
|
17
|
-
side: "bottom",
|
|
18
|
-
content: message,
|
|
19
|
-
children: /*#__PURE__*/ _jsx(Button, {
|
|
20
|
-
type: "button",
|
|
21
|
-
$variant: "unstyled",
|
|
22
|
-
children: /*#__PURE__*/ _jsx(LanguageTranslateIcon, {})
|
|
23
|
-
})
|
|
24
|
-
}),
|
|
25
|
-
/*#__PURE__*/ _jsx(TranslationDirection, {
|
|
26
|
-
sourceLocale: sourceLocale,
|
|
27
|
-
targetLocale: targetLocale
|
|
28
|
-
}),
|
|
29
|
-
/*#__PURE__*/ _jsx(Divider, {
|
|
30
|
-
className: styles.divider,
|
|
31
|
-
$orientation: "vertical",
|
|
32
|
-
$size: "sm"
|
|
33
|
-
}),
|
|
34
|
-
/*#__PURE__*/ _jsx(Tooltip, {
|
|
35
|
-
side: "bottom",
|
|
36
|
-
sideOffset: 12,
|
|
37
|
-
content: "Retry",
|
|
38
|
-
children: /*#__PURE__*/ _jsx(Button, {
|
|
39
|
-
$variant: "light",
|
|
40
|
-
$size: "sm",
|
|
41
|
-
$isIconButton: true,
|
|
42
|
-
"aria-label": "Retry failed translation",
|
|
43
|
-
type: "button",
|
|
44
|
-
onClick: onRetry,
|
|
45
|
-
disabled: isLoading,
|
|
46
|
-
$isLoading: isLoading,
|
|
47
|
-
children: /*#__PURE__*/ _jsx(ReloadIcon, {})
|
|
48
|
-
})
|
|
49
|
-
})
|
|
50
|
-
]
|
|
51
|
-
});
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
//# sourceMappingURL=FailedTranslationStatus.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { FailedTranslationStatus } from "./FailedTranslationStatus";
|
package/dist/client/entities/translation/ui/PendingTranslationStatus/PendingTranslationStatus.d.ts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
type TranslationStatusProps = {
|
|
2
|
-
onCancel: () => void;
|
|
3
|
-
onRun: () => void;
|
|
4
|
-
isLoading?: boolean;
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
sourceLocale: string;
|
|
7
|
-
targetLocale: string;
|
|
8
|
-
createdAt: string;
|
|
9
|
-
};
|
|
10
|
-
export declare function PendingTranslationStatus({ onCancel, onRun, isLoading, disabled, sourceLocale, targetLocale, createdAt, }: TranslationStatusProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export {};
|
package/dist/client/entities/translation/ui/PendingTranslationStatus/PendingTranslationStatus.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { TrashIcon } from "@payloadcms/ui/icons/Trash";
|
|
3
|
-
import { LanguageTranslateIcon } from "../../../../shared/lib/assets/icons/LanguageTranslateIcon";
|
|
4
|
-
import { ReloadIcon } from "../../../../shared/lib/assets/icons/ReloadIcon";
|
|
5
|
-
import Button from "../../../../shared/ui/Button";
|
|
6
|
-
import Divider from "../../../../shared/ui/Divider";
|
|
7
|
-
import StatusIndicator from "../../../../shared/ui/StatusIndicator";
|
|
8
|
-
import Tooltip from "../../../../shared/ui/Tooltip";
|
|
9
|
-
import { TranslationDirection } from "../TranslationDirection";
|
|
10
|
-
export function PendingTranslationStatus({ onCancel, onRun, isLoading, disabled, sourceLocale, targetLocale, createdAt }) {
|
|
11
|
-
return /*#__PURE__*/ _jsxs(StatusIndicator, {
|
|
12
|
-
$color: "gray",
|
|
13
|
-
$animated: true,
|
|
14
|
-
title: "Pending",
|
|
15
|
-
children: [
|
|
16
|
-
/*#__PURE__*/ _jsx(Tooltip, {
|
|
17
|
-
side: "bottom",
|
|
18
|
-
sideOffset: 12,
|
|
19
|
-
content: /*#__PURE__*/ _jsxs("time", {
|
|
20
|
-
dateTime: createdAt,
|
|
21
|
-
children: [
|
|
22
|
-
"Created at:",
|
|
23
|
-
" ",
|
|
24
|
-
new Date(createdAt).toLocaleString(undefined, {
|
|
25
|
-
year: "numeric",
|
|
26
|
-
month: "short",
|
|
27
|
-
day: "numeric",
|
|
28
|
-
hour: "2-digit",
|
|
29
|
-
minute: "2-digit"
|
|
30
|
-
})
|
|
31
|
-
]
|
|
32
|
-
}),
|
|
33
|
-
children: /*#__PURE__*/ _jsx(Button, {
|
|
34
|
-
type: "button",
|
|
35
|
-
$variant: "unstyled",
|
|
36
|
-
children: /*#__PURE__*/ _jsx(LanguageTranslateIcon, {})
|
|
37
|
-
})
|
|
38
|
-
}),
|
|
39
|
-
/*#__PURE__*/ _jsx(TranslationDirection, {
|
|
40
|
-
sourceLocale: sourceLocale,
|
|
41
|
-
targetLocale: targetLocale
|
|
42
|
-
}),
|
|
43
|
-
/*#__PURE__*/ _jsx(Divider, {
|
|
44
|
-
$size: "sm",
|
|
45
|
-
$orientation: "vertical"
|
|
46
|
-
}),
|
|
47
|
-
/*#__PURE__*/ _jsx(Tooltip, {
|
|
48
|
-
sideOffset: 12,
|
|
49
|
-
side: "bottom",
|
|
50
|
-
content: "Cancel",
|
|
51
|
-
children: /*#__PURE__*/ _jsx(Button, {
|
|
52
|
-
$variant: "light",
|
|
53
|
-
$size: "sm",
|
|
54
|
-
$isIconButton: true,
|
|
55
|
-
"aria-label": "Cancel",
|
|
56
|
-
type: "button",
|
|
57
|
-
onClick: onCancel,
|
|
58
|
-
disabled: isLoading || disabled,
|
|
59
|
-
$isLoading: isLoading,
|
|
60
|
-
children: /*#__PURE__*/ _jsx(TrashIcon, {})
|
|
61
|
-
})
|
|
62
|
-
}),
|
|
63
|
-
/*#__PURE__*/ _jsx(Tooltip, {
|
|
64
|
-
sideOffset: 12,
|
|
65
|
-
side: "bottom",
|
|
66
|
-
content: "Run queued translation",
|
|
67
|
-
children: /*#__PURE__*/ _jsx(Button, {
|
|
68
|
-
$variant: "light",
|
|
69
|
-
$size: "sm",
|
|
70
|
-
$isIconButton: true,
|
|
71
|
-
"aria-label": "Run queued translation",
|
|
72
|
-
type: "button",
|
|
73
|
-
onClick: onRun,
|
|
74
|
-
disabled: isLoading || disabled,
|
|
75
|
-
$isLoading: isLoading,
|
|
76
|
-
children: /*#__PURE__*/ _jsx(ReloadIcon, {})
|
|
77
|
-
})
|
|
78
|
-
})
|
|
79
|
-
]
|
|
80
|
-
});
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
//# sourceMappingURL=PendingTranslationStatus.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { PendingTranslationStatus } from "./PendingTranslationStatus";
|
package/dist/client/entities/translation/ui/RunningTranslationStatus/RunningTranslationStatus.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
type TranslationStatusProps = {
|
|
2
|
-
onCancel: () => void;
|
|
3
|
-
isLoading?: boolean;
|
|
4
|
-
disabled?: boolean;
|
|
5
|
-
sourceLocale: string;
|
|
6
|
-
targetLocale: string;
|
|
7
|
-
createdAt: string;
|
|
8
|
-
};
|
|
9
|
-
export declare function RunningTranslationStatus({ onCancel, isLoading, disabled, sourceLocale, targetLocale, createdAt, }: TranslationStatusProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
export {};
|
package/dist/client/entities/translation/ui/RunningTranslationStatus/RunningTranslationStatus.js
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { TrashIcon } from "@payloadcms/ui/icons/Trash";
|
|
3
|
-
import { LanguageTranslateIcon } from "../../../../shared/lib/assets/icons/LanguageTranslateIcon";
|
|
4
|
-
import Button from "../../../../shared/ui/Button";
|
|
5
|
-
import Divider from "../../../../shared/ui/Divider";
|
|
6
|
-
import StatusIndicator from "../../../../shared/ui/StatusIndicator";
|
|
7
|
-
import Tooltip from "../../../../shared/ui/Tooltip";
|
|
8
|
-
import { TranslationDirection } from "../TranslationDirection";
|
|
9
|
-
export function RunningTranslationStatus({ onCancel, isLoading, disabled, sourceLocale, targetLocale, createdAt }) {
|
|
10
|
-
return /*#__PURE__*/ _jsxs(StatusIndicator, {
|
|
11
|
-
$animated: true,
|
|
12
|
-
$color: "blue",
|
|
13
|
-
title: "In Progress",
|
|
14
|
-
children: [
|
|
15
|
-
/*#__PURE__*/ _jsx(Tooltip, {
|
|
16
|
-
side: "bottom",
|
|
17
|
-
sideOffset: 12,
|
|
18
|
-
content: /*#__PURE__*/ _jsxs("time", {
|
|
19
|
-
dateTime: createdAt,
|
|
20
|
-
children: [
|
|
21
|
-
"Created at:",
|
|
22
|
-
" ",
|
|
23
|
-
new Date(createdAt).toLocaleString(undefined, {
|
|
24
|
-
year: "numeric",
|
|
25
|
-
month: "short",
|
|
26
|
-
day: "numeric",
|
|
27
|
-
hour: "2-digit",
|
|
28
|
-
minute: "2-digit"
|
|
29
|
-
})
|
|
30
|
-
]
|
|
31
|
-
}),
|
|
32
|
-
children: /*#__PURE__*/ _jsx(Button, {
|
|
33
|
-
type: "button",
|
|
34
|
-
$variant: "unstyled",
|
|
35
|
-
children: /*#__PURE__*/ _jsx(LanguageTranslateIcon, {})
|
|
36
|
-
})
|
|
37
|
-
}),
|
|
38
|
-
/*#__PURE__*/ _jsx(TranslationDirection, {
|
|
39
|
-
sourceLocale: sourceLocale,
|
|
40
|
-
targetLocale: targetLocale
|
|
41
|
-
}),
|
|
42
|
-
/*#__PURE__*/ _jsx(Divider, {
|
|
43
|
-
$size: "sm",
|
|
44
|
-
$orientation: "vertical"
|
|
45
|
-
}),
|
|
46
|
-
/*#__PURE__*/ _jsx(Tooltip, {
|
|
47
|
-
sideOffset: 12,
|
|
48
|
-
side: "bottom",
|
|
49
|
-
content: "Cancel",
|
|
50
|
-
children: /*#__PURE__*/ _jsx(Button, {
|
|
51
|
-
$variant: "light",
|
|
52
|
-
$size: "sm",
|
|
53
|
-
$isIconButton: true,
|
|
54
|
-
"aria-label": "Cancel",
|
|
55
|
-
type: "button",
|
|
56
|
-
onClick: onCancel,
|
|
57
|
-
disabled: isLoading || disabled,
|
|
58
|
-
$isLoading: isLoading,
|
|
59
|
-
children: /*#__PURE__*/ _jsx(TrashIcon, {})
|
|
60
|
-
})
|
|
61
|
-
})
|
|
62
|
-
]
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
//# sourceMappingURL=RunningTranslationStatus.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { RunningTranslationStatus } from "./RunningTranslationStatus";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { DocumentTranslationProgressFailed } from "./ui/DocumentTranslationProgressFailed";
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { DocumentTranslationFailed } from "../../../entities/translation";
|
|
2
|
-
type DocumentTranslationProgressFailedProps = {
|
|
3
|
-
data: DocumentTranslationFailed;
|
|
4
|
-
};
|
|
5
|
-
export declare function DocumentTranslationProgressFailed({ data, }: DocumentTranslationProgressFailedProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export {};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { toast } from "@payloadcms/ui";
|
|
3
|
-
import { FailedTranslationStatus, TranslationsApi } from "../../../entities/translation";
|
|
4
|
-
export function DocumentTranslationProgressFailed({ data }) {
|
|
5
|
-
const runQueuedTranslationApi = TranslationsApi.useRunDocumentTranslation();
|
|
6
|
-
const handleRunDocumentTranslation = async ()=>{
|
|
7
|
-
try {
|
|
8
|
-
await runQueuedTranslationApi.mutateAsync({
|
|
9
|
-
id: data.id
|
|
10
|
-
});
|
|
11
|
-
} catch (e) {
|
|
12
|
-
if (e instanceof Error) {
|
|
13
|
-
toast.error(e.message);
|
|
14
|
-
} else {
|
|
15
|
-
toast.error("Error running document translation");
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
return /*#__PURE__*/ _jsx(FailedTranslationStatus, {
|
|
20
|
-
onRetry: handleRunDocumentTranslation,
|
|
21
|
-
isLoading: runQueuedTranslationApi.isPending,
|
|
22
|
-
sourceLocale: data.input.source_lng,
|
|
23
|
-
targetLocale: data.input.target_lng,
|
|
24
|
-
message: data.error.message
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
//# sourceMappingURL=DocumentTranslationProgressFailed.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { DocumentTranslationProgressPending } from "./ui/DocumentTranslationProgressPending";
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { DocumentTranslationPending } from "../../../entities/translation";
|
|
2
|
-
type DocumentTranslationProgressPendingProps = {
|
|
3
|
-
data: DocumentTranslationPending;
|
|
4
|
-
};
|
|
5
|
-
export declare function DocumentTranslationProgressPending({ data, }: DocumentTranslationProgressPendingProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export {};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { toast } from "@payloadcms/ui";
|
|
3
|
-
import { TranslationsApi } from "../../../entities/translation";
|
|
4
|
-
import { PendingTranslationStatus } from "../../../entities/translation";
|
|
5
|
-
export function DocumentTranslationProgressPending({ data }) {
|
|
6
|
-
const cancelDocumentTranslationApi = TranslationsApi.useCancelDocumentTranslation();
|
|
7
|
-
const runQueuedTranslationApi = TranslationsApi.useRunDocumentTranslation();
|
|
8
|
-
const handleCancelDocumentTranslation = async ()=>{
|
|
9
|
-
try {
|
|
10
|
-
await cancelDocumentTranslationApi.mutateAsync({
|
|
11
|
-
id: data.id
|
|
12
|
-
});
|
|
13
|
-
} catch (e) {
|
|
14
|
-
if (e instanceof Error) {
|
|
15
|
-
toast.error(e.message);
|
|
16
|
-
} else {
|
|
17
|
-
toast.error("Error canceling document translation");
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
};
|
|
21
|
-
const handleRunDocumentTranslation = async ()=>{
|
|
22
|
-
try {
|
|
23
|
-
await runQueuedTranslationApi.mutateAsync({
|
|
24
|
-
id: data.id
|
|
25
|
-
});
|
|
26
|
-
} catch (e) {
|
|
27
|
-
if (e instanceof Error) {
|
|
28
|
-
toast.error(e.message);
|
|
29
|
-
} else {
|
|
30
|
-
toast.error("Error running document translation");
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
return /*#__PURE__*/ _jsx(PendingTranslationStatus, {
|
|
35
|
-
onRun: handleRunDocumentTranslation,
|
|
36
|
-
createdAt: data.created_at,
|
|
37
|
-
sourceLocale: data.input.source_lng,
|
|
38
|
-
targetLocale: data.input.target_lng,
|
|
39
|
-
isLoading: cancelDocumentTranslationApi.isPending || runQueuedTranslationApi.isPending,
|
|
40
|
-
onCancel: handleCancelDocumentTranslation
|
|
41
|
-
});
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
//# sourceMappingURL=DocumentTranslationProgressPending.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { DocumentTranslationProgressRunning } from "./ui/DocumentTranslationProgressRunning";
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import type { DocumentTranslationRunning } from "../../../entities/translation";
|
|
2
|
-
type DocumentTranslationProgressRunningProps = {
|
|
3
|
-
data: DocumentTranslationRunning;
|
|
4
|
-
};
|
|
5
|
-
export declare function DocumentTranslationProgressRunning({ data, }: DocumentTranslationProgressRunningProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
export {};
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { toast } from "@payloadcms/ui";
|
|
3
|
-
import { RunningTranslationStatus, TranslationsApi } from "../../../entities/translation";
|
|
4
|
-
export function DocumentTranslationProgressRunning({ data }) {
|
|
5
|
-
const cancelDocumentTranslationApi = TranslationsApi.useCancelDocumentTranslation();
|
|
6
|
-
const handleCancelDocumentTranslation = async ()=>{
|
|
7
|
-
try {
|
|
8
|
-
await cancelDocumentTranslationApi.mutateAsync({
|
|
9
|
-
id: data.id
|
|
10
|
-
});
|
|
11
|
-
} catch (e) {
|
|
12
|
-
if (e instanceof Error) {
|
|
13
|
-
toast.error(e.message);
|
|
14
|
-
} else {
|
|
15
|
-
toast.error("Error canceling document translation");
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
return /*#__PURE__*/ _jsx(RunningTranslationStatus, {
|
|
20
|
-
createdAt: data.created_at,
|
|
21
|
-
sourceLocale: data.input.source_lng,
|
|
22
|
-
targetLocale: data.input.target_lng,
|
|
23
|
-
isLoading: cancelDocumentTranslationApi.isPending,
|
|
24
|
-
onCancel: handleCancelDocumentTranslation
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
//# sourceMappingURL=DocumentTranslationProgressRunning.js.map
|