@focus-reactive/payload-plugin-translator 0.1.4 → 0.1.6
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 +86 -95
- package/dist/client/app/cache/CacheProvider.d.ts +1 -2
- package/dist/client/app/cache/CacheProvider.export.d.ts +0 -1
- package/dist/client/app/config/TranslateKitConfigContext.d.ts +1 -2
- package/dist/client/app/config/index.d.ts +0 -1
- package/dist/client/entities/translation/api/mutations/useCancelCollectionTranslations.d.ts +0 -1
- package/dist/client/entities/translation/api/mutations/useCancelDocumentTranslation.d.ts +0 -1
- package/dist/client/entities/translation/api/mutations/useQueueDocumentTranslation.d.ts +0 -1
- package/dist/client/entities/translation/api/mutations/useQueueDocumentTranslations.d.ts +0 -1
- package/dist/client/entities/translation/api/mutations/useRunDocumentTranslation.d.ts +0 -1
- package/dist/client/entities/translation/api/queries/useCollectionTranslationStatus.d.ts +7 -72
- package/dist/client/entities/translation/api/queries/useDocumentTranslation.d.ts +7 -72
- package/dist/client/entities/translation/index.d.ts +0 -1
- package/dist/client/entities/translation/model/enums.d.ts +0 -1
- package/dist/client/entities/translation/model/enums.js +3 -3
- package/dist/client/entities/translation/model/types.d.ts +0 -1
- package/dist/client/entities/translation/ui/CompletedTranslationStatus/CompletedTranslationStatus.d.ts +1 -2
- package/dist/client/entities/translation/ui/CompletedTranslationStatus/index.d.ts +0 -1
- package/dist/client/entities/translation/ui/FailedTranslationStatus/FailedTranslationStatus.d.ts +1 -2
- package/dist/client/entities/translation/ui/FailedTranslationStatus/index.d.ts +0 -1
- package/dist/client/entities/translation/ui/PendingTranslationStatus/PendingTranslationStatus.d.ts +1 -2
- package/dist/client/entities/translation/ui/PendingTranslationStatus/index.d.ts +0 -1
- package/dist/client/entities/translation/ui/RunningTranslationStatus/RunningTranslationStatus.d.ts +1 -2
- package/dist/client/entities/translation/ui/RunningTranslationStatus/index.d.ts +0 -1
- package/dist/client/entities/translation/ui/TranslationDirection/TranslationDirection.d.ts +1 -2
- package/dist/client/entities/translation/ui/TranslationDirection/index.d.ts +0 -1
- package/dist/client/features/collection-translation-form/index.client.d.ts +0 -1
- package/dist/client/features/collection-translation-form/index.d.ts +0 -1
- package/dist/client/features/collection-translation-form/model/constants.d.ts +0 -1
- package/dist/client/features/collection-translation-form/model/form-model.d.ts +0 -1
- package/dist/client/features/collection-translation-form/model/index.d.ts +0 -1
- package/dist/client/features/collection-translation-form/model/schema.d.ts +0 -1
- package/dist/client/features/collection-translation-form/ui/CollectionTranslationForm.d.ts +1 -2
- package/dist/client/features/collection-translation-form/ui/index.d.ts +0 -1
- package/dist/client/features/collection-translation-popup/index.d.ts +0 -1
- package/dist/client/features/collection-translation-popup/ui/CollectionTranslationPopup.d.ts +1 -2
- package/dist/client/features/collection-translation-progress/index.d.ts +0 -1
- package/dist/client/features/collection-translation-progress/ui/CollectionTranslationProgress.d.ts +1 -2
- package/dist/client/features/document-translation-progress-failed/index.d.ts +0 -1
- package/dist/client/features/document-translation-progress-failed/ui/DocumentTranslationProgressFailed.d.ts +1 -2
- package/dist/client/features/document-translation-progress-pending/index.d.ts +0 -1
- package/dist/client/features/document-translation-progress-pending/ui/DocumentTranslationProgressPending.d.ts +1 -2
- package/dist/client/features/document-translation-progress-running/index.d.ts +0 -1
- package/dist/client/features/document-translation-progress-running/ui/DocumentTranslationProgressRunning.d.ts +1 -2
- package/dist/client/features/open-document-translation-popup/index.d.ts +0 -1
- package/dist/client/features/open-document-translation-popup/ui/OpenDocumentTranslationPopup.d.ts +1 -2
- package/dist/client/features/translate-document-form/index.client.d.ts +0 -1
- package/dist/client/features/translate-document-form/index.d.ts +0 -1
- package/dist/client/features/translate-document-form/model/constants.d.ts +0 -1
- package/dist/client/features/translate-document-form/model/form-model.d.ts +0 -1
- package/dist/client/features/translate-document-form/model/index.d.ts +0 -1
- package/dist/client/features/translate-document-form/model/schema.d.ts +0 -1
- package/dist/client/features/translate-document-form/ui/DocumentTranslationForm.d.ts +1 -2
- package/dist/client/features/translate-document-form/ui/index.d.ts +0 -1
- package/dist/client/shared/lib/assets/icons/LanguageTranslateIcon.d.ts +1 -2
- package/dist/client/shared/lib/assets/icons/QuestionCircleIcon.d.ts +1 -2
- package/dist/client/shared/lib/assets/icons/ReloadIcon.d.ts +1 -2
- package/dist/client/shared/lib/errors/handleApiError.d.ts +0 -1
- package/dist/client/shared/lib/errors/handleApiError.js +3 -1
- package/dist/client/shared/lib/forms/handle-form-error.d.ts +0 -1
- package/dist/client/shared/lib/payload/hooks/useCollectionDashboardUrlParams.d.ts +0 -1
- package/dist/client/shared/lib/payload/hooks/useCollectionDocumentUrlParams.d.ts +0 -1
- package/dist/client/shared/lib/payload/hooks/useLocaleOptions.d.ts +0 -1
- package/dist/client/shared/lib/utils/errors/handleApiError.d.ts +0 -1
- package/dist/client/shared/lib/utils/errors/handleApiError.js +3 -1
- package/dist/client/shared/lib/utils/react/useToggle.d.ts +0 -1
- package/dist/client/shared/providers/CacheClientProvider/CacheClientProvider.factory.d.ts +0 -1
- package/dist/client/shared/providers/CacheClientProvider/index.d.ts +0 -1
- package/dist/client/shared/types/AccessGuard.d.ts +0 -1
- package/dist/client/shared/types/PayloadComponentExport.d.ts +0 -1
- package/dist/client/shared/ui/Alert/Alert.d.ts +0 -1
- package/dist/client/shared/ui/Alert/index.d.ts +0 -1
- package/dist/client/shared/ui/Button/Button.d.ts +0 -1
- package/dist/client/shared/ui/Button/index.d.ts +0 -1
- package/dist/client/shared/ui/Checkbox/Checkbox.d.ts +0 -1
- package/dist/client/shared/ui/Checkbox/index.d.ts +0 -1
- package/dist/client/shared/ui/ColorIndicator/ColorIndicator.d.ts +1 -2
- package/dist/client/shared/ui/ColorIndicator/index.d.ts +0 -1
- package/dist/client/shared/ui/Description/Description.d.ts +1 -2
- package/dist/client/shared/ui/Description/index.d.ts +0 -1
- package/dist/client/shared/ui/Divider/Divider.d.ts +0 -1
- package/dist/client/shared/ui/Divider/index.d.ts +0 -1
- package/dist/client/shared/ui/Label/Label.d.ts +0 -1
- package/dist/client/shared/ui/Label/index.d.ts +0 -1
- package/dist/client/shared/ui/Loading/Loading.d.ts +1 -2
- package/dist/client/shared/ui/Loading/index.d.ts +0 -1
- package/dist/client/shared/ui/Popup/Popup.d.ts +1 -2
- package/dist/client/shared/ui/Popup/index.d.ts +0 -1
- package/dist/client/shared/ui/ProgressBar/ProgressBar.d.ts +1 -2
- package/dist/client/shared/ui/ProgressBar/index.d.ts +0 -1
- package/dist/client/shared/ui/Select/Select.d.ts +2 -3
- package/dist/client/shared/ui/Select/index.d.ts +0 -1
- package/dist/client/shared/ui/StatusCounter/StatusCounter.d.ts +1 -2
- package/dist/client/shared/ui/StatusCounter/index.d.ts +0 -1
- package/dist/client/shared/ui/StatusIndicator/StatusIndicator.d.ts +1 -2
- package/dist/client/shared/ui/StatusIndicator/index.d.ts +0 -1
- package/dist/client/shared/ui/Tooltip/Tooltip.d.ts +1 -2
- package/dist/client/shared/ui/Tooltip/index.d.ts +0 -1
- package/dist/client/shared/ui/form/FormCheckbox/FormCheckbox.d.ts +1 -2
- package/dist/client/shared/ui/form/FormCheckbox/index.d.ts +0 -1
- package/dist/client/shared/ui/form/FormCheckboxPublish/FormCheckboxPublish.d.ts +1 -2
- package/dist/client/shared/ui/form/FormCheckboxPublish/index.d.ts +0 -1
- package/dist/client/shared/ui/form/FormSelect/FormSelect.d.ts +1 -2
- package/dist/client/shared/ui/form/FormSelect/index.d.ts +0 -1
- package/dist/client/shared/ui/form/FormSelectLocale/FormSelectLocale.d.ts +1 -2
- package/dist/client/shared/ui/form/FormSelectLocale/index.d.ts +0 -1
- package/dist/client/shared/ui/form/FormSelectStrategy/FormSelectStrategy.d.ts +1 -2
- package/dist/client/shared/ui/form/FormSelectStrategy/index.d.ts +0 -1
- package/dist/client/shared/utils/componentPath.d.ts +0 -1
- package/dist/client/widgets/bulk-translation-dashboard/index.d.ts +0 -1
- package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.d.ts +1 -2
- package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.export.d.ts +0 -1
- package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.export.js +2 -1
- package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.server.d.ts +1 -2
- package/dist/client/widgets/bulk-translation-dashboard/ui/index.d.ts +0 -1
- package/dist/client/widgets/translate-document/index.d.ts +0 -1
- package/dist/client/widgets/translate-document/ui/TranslateDocument.d.ts +1 -2
- package/dist/client/widgets/translate-document/ui/TranslateDocument.export.d.ts +0 -1
- package/dist/client/widgets/translate-document/ui/TranslateDocument.export.js +2 -1
- package/dist/client/widgets/translate-document/ui/TranslateDocument.server.d.ts +1 -2
- package/dist/client/widgets/translate-document/ui/index.d.ts +0 -1
- package/dist/field-config.d.ts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/plugin.d.ts +0 -1
- package/dist/server/features/_lib/collection-utils.d.ts +0 -1
- package/dist/server/features/_lib/index.d.ts +0 -1
- package/dist/server/features/cancel/handler.d.ts +0 -1
- package/dist/server/features/cancel/index.d.ts +0 -1
- package/dist/server/features/cancel/model.d.ts +4 -5
- package/dist/server/features/cancel/model.js +4 -3
- package/dist/server/features/cancel/route.d.ts +0 -1
- package/dist/server/features/cancel-by-collection/handler.d.ts +0 -1
- package/dist/server/features/cancel-by-collection/index.d.ts +0 -1
- package/dist/server/features/cancel-by-collection/model.d.ts +0 -1
- package/dist/server/features/cancel-by-collection/route.d.ts +0 -1
- package/dist/server/features/enqueue-translation/handler.d.ts +0 -1
- package/dist/server/features/enqueue-translation/index.d.ts +0 -1
- package/dist/server/features/enqueue-translation/model.d.ts +0 -1
- package/dist/server/features/enqueue-translation/route.d.ts +0 -1
- package/dist/server/features/get-collection-status/handler.d.ts +0 -1
- package/dist/server/features/get-collection-status/index.d.ts +0 -1
- package/dist/server/features/get-collection-status/model.d.ts +0 -1
- package/dist/server/features/get-collection-status/route.d.ts +0 -1
- package/dist/server/features/get-document-status/handler.d.ts +0 -1
- package/dist/server/features/get-document-status/index.d.ts +0 -1
- package/dist/server/features/get-document-status/model.d.ts +10 -7
- package/dist/server/features/get-document-status/model.js +8 -5
- package/dist/server/features/get-document-status/route.d.ts +0 -1
- package/dist/server/features/index.d.ts +0 -1
- package/dist/server/features/run-translation/handler.d.ts +0 -1
- package/dist/server/features/run-translation/index.d.ts +0 -1
- package/dist/server/features/run-translation/model.d.ts +8 -5
- package/dist/server/features/run-translation/model.js +8 -3
- package/dist/server/features/run-translation/route.d.ts +0 -1
- package/dist/server/features/translate-document/handler.d.ts +0 -1
- package/dist/server/features/translate-document/index.d.ts +0 -1
- package/dist/server/features/translate-document/model.d.ts +0 -1
- package/dist/server/features/translate-document/task.d.ts +0 -1
- package/dist/server/index.d.ts +0 -1
- package/dist/server/modules/index.d.ts +0 -1
- package/dist/server/modules/task-runner/TaskRunner.interface.d.ts +0 -1
- package/dist/server/modules/task-runner/TaskRunnerProvider.interface.d.ts +3 -4
- package/dist/server/modules/task-runner/index.d.ts +0 -1
- package/dist/server/modules/task-runner/payload-jobs-runner/PayloadJobsRunnerProvider.d.ts +1 -2
- package/dist/server/modules/task-runner/payload-jobs-runner/PayloadJobsTaskRunner.d.ts +80 -5
- package/dist/server/modules/task-runner/payload-jobs-runner/PayloadJobsTaskRunner.js +98 -38
- package/dist/server/modules/task-runner/payload-jobs-runner/index.d.ts +0 -1
- package/dist/server/modules/task-runner/payload-jobs-runner/normalizeJob.d.ts +0 -1
- package/dist/server/modules/task-runner/payload-jobs-runner/types.d.ts +0 -1
- package/dist/server/modules/task-runner/sync-runner/SyncRunnerProvider.d.ts +0 -1
- package/dist/server/modules/task-runner/sync-runner/SyncTaskRunner.d.ts +0 -1
- package/dist/server/modules/task-runner/sync-runner/index.d.ts +0 -1
- package/dist/server/modules/task-runner/sync-runner/types.d.ts +0 -1
- package/dist/server/modules/task-runner/types.d.ts +0 -1
- package/dist/server/modules/translation-pipeline/TranslationPipeline.d.ts +0 -1
- package/dist/server/modules/translation-pipeline/index.d.ts +0 -1
- package/dist/server/modules/translation-pipeline/stages/data-reconciler/DataReconciler.d.ts +0 -1
- package/dist/server/modules/translation-pipeline/stages/data-reconciler/DataReconciler.stage.d.ts +0 -1
- package/dist/server/modules/translation-pipeline/stages/data-reconciler/index.d.ts +0 -1
- package/dist/server/modules/translation-pipeline/stages/field-collector/FieldChunkCollector.d.ts +0 -1
- package/dist/server/modules/translation-pipeline/stages/field-collector/FieldChunkCollector.js +2 -1
- package/dist/server/modules/translation-pipeline/stages/field-collector/FieldChunkCollector.stage.d.ts +0 -1
- package/dist/server/modules/translation-pipeline/stages/field-collector/index.d.ts +0 -1
- package/dist/server/modules/translation-pipeline/stages/index.d.ts +0 -1
- package/dist/server/modules/translation-pipeline/stages/text-expander/PlainTextExpander.d.ts +0 -1
- package/dist/server/modules/translation-pipeline/stages/text-expander/RichTextExpander.d.ts +0 -1
- package/dist/server/modules/translation-pipeline/stages/text-expander/TextChunkExpander.d.ts +0 -1
- package/dist/server/modules/translation-pipeline/stages/text-expander/TextChunkExpander.stage.d.ts +0 -1
- package/dist/server/modules/translation-pipeline/stages/text-expander/TextExpander.interface.d.ts +0 -1
- package/dist/server/modules/translation-pipeline/stages/text-expander/index.d.ts +0 -1
- package/dist/server/modules/translation-pipeline/stages/translation/Translation.stage.d.ts +0 -1
- package/dist/server/modules/translation-pipeline/stages/translation/index.d.ts +0 -1
- package/dist/server/modules/translation-pipeline/stages/translation-applicator/TranslationMutator.d.ts +0 -1
- package/dist/server/modules/translation-pipeline/stages/translation-applicator/TranslationMutator.stage.d.ts +0 -1
- package/dist/server/modules/translation-pipeline/stages/translation-applicator/index.d.ts +0 -1
- package/dist/server/modules/translation-pipeline/strategies/Overwrite.strategy.d.ts +0 -1
- package/dist/server/modules/translation-pipeline/strategies/SkipExisting.strategy.d.ts +0 -1
- package/dist/server/modules/translation-pipeline/strategies/TranslationStrategy.interface.d.ts +0 -1
- package/dist/server/modules/translation-pipeline/strategies/index.d.ts +0 -1
- package/dist/server/modules/translation-pipeline/types/FieldChunk.d.ts +0 -1
- package/dist/server/modules/translation-pipeline/types/Pipeline.d.ts +0 -1
- package/dist/server/modules/translation-pipeline/types/PipelineContext.d.ts +0 -1
- package/dist/server/modules/translation-pipeline/types/TextChunk.d.ts +0 -1
- package/dist/server/modules/translation-pipeline/types/index.d.ts +0 -1
- package/dist/server/modules/translation-providers/OpenAITranslation.provider.d.ts +1 -2
- package/dist/server/modules/translation-providers/TranslationProvider.interface.d.ts +0 -1
- package/dist/server/modules/translation-providers/index.d.ts +0 -1
- package/dist/server/shared/access/AnyAccessGuard.d.ts +0 -1
- package/dist/server/shared/access/handler.d.ts +1 -2
- package/dist/server/shared/access/index.d.ts +0 -1
- package/dist/server/shared/access/types.d.ts +0 -1
- package/dist/server/shared/field-config/getFieldConfig.d.ts +0 -1
- package/dist/server/shared/field-config/index.d.ts +0 -1
- package/dist/server/shared/field-config/types.d.ts +0 -1
- package/dist/server/shared/guards/collection-guards.d.ts +0 -1
- package/dist/server/shared/guards/field-guards.d.ts +0 -1
- package/dist/server/shared/guards/index.d.ts +0 -1
- package/dist/server/shared/http/ServerResponse.d.ts +0 -1
- package/dist/server/shared/http/index.d.ts +0 -1
- package/dist/server/shared/http/withAccessCheck.d.ts +0 -1
- package/dist/server/shared/http/withErrorHandler.d.ts +0 -1
- package/dist/server/shared/index.d.ts +11 -11
- package/dist/server/shared/index.js +8 -6
- package/dist/server/shared/lexical/collectTextNodes.d.ts +0 -1
- package/dist/server/shared/lexical/guards.d.ts +0 -1
- package/dist/server/shared/lexical/index.d.ts +0 -1
- package/dist/server/shared/lexical/isEmptyRichText.d.ts +0 -1
- package/dist/server/shared/lexical/traverseLexicalTree.d.ts +0 -1
- package/dist/server/shared/lexical/types.d.ts +0 -1
- package/dist/server/shared/utils/LazyMap.d.ts +0 -1
- package/dist/server/shared/utils/filterLocalizedFields.d.ts +0 -1
- package/dist/server/shared/utils/getByPath.d.ts +0 -1
- package/dist/server/shared/utils/index.d.ts +0 -1
- package/dist/server/shared/utils/isEmpty.d.ts +0 -1
- package/dist/server/shared/utils/isObject.d.ts +0 -1
- package/dist/server/shared/utils/normalizePath.d.ts +0 -1
- package/dist/server/shared/utils/pipe.d.ts +0 -1
- package/dist/server/shared/utils/setByPath.d.ts +0 -1
- package/dist/server/shared/validation/index.d.ts +1 -0
- package/dist/server/shared/validation/index.js +3 -0
- package/dist/server/shared/validation/jobId.d.ts +17 -0
- package/dist/server/shared/validation/jobId.js +23 -0
- package/dist/types/AccessGuard.d.ts +0 -1
- package/dist/types/index.d.ts +0 -1
- package/package.json +33 -32
- package/dist/client/app/cache/CacheProvider.jsx +0 -11
- package/dist/client/app/config/TranslateKitConfigContext.jsx +0 -13
- package/dist/client/entities/translation/ui/CompletedTranslationStatus/CompletedTranslationStatus.jsx +0 -25
- package/dist/client/entities/translation/ui/FailedTranslationStatus/FailedTranslationStatus.jsx +0 -24
- package/dist/client/entities/translation/ui/PendingTranslationStatus/PendingTranslationStatus.jsx +0 -38
- package/dist/client/entities/translation/ui/RunningTranslationStatus/RunningTranslationStatus.jsx +0 -32
- package/dist/client/entities/translation/ui/TranslationDirection/TranslationDirection.jsx +0 -16
- package/dist/client/features/collection-translation-form/ui/CollectionTranslationForm.jsx +0 -25
- package/dist/client/features/collection-translation-popup/ui/CollectionTranslationPopup.jsx +0 -23
- package/dist/client/features/collection-translation-progress/ui/CollectionTranslationProgress.jsx +0 -47
- package/dist/client/features/document-translation-progress-failed/ui/DocumentTranslationProgressFailed.jsx +0 -19
- package/dist/client/features/document-translation-progress-pending/ui/DocumentTranslationProgressPending.jsx +0 -34
- package/dist/client/features/document-translation-progress-running/ui/DocumentTranslationProgressRunning.jsx +0 -19
- package/dist/client/features/open-document-translation-popup/ui/OpenDocumentTranslationPopup.jsx +0 -15
- package/dist/client/features/translate-document-form/ui/DocumentTranslationForm.jsx +0 -24
- package/dist/client/shared/lib/assets/icons/LanguageTranslateIcon.jsx +0 -4
- package/dist/client/shared/lib/assets/icons/QuestionCircleIcon.jsx +0 -3
- package/dist/client/shared/lib/assets/icons/ReloadIcon.jsx +0 -3
- package/dist/client/shared/ui/Alert/Alert.jsx +0 -33
- package/dist/client/shared/ui/Button/Button.jsx +0 -35
- package/dist/client/shared/ui/Checkbox/Checkbox.jsx +0 -6
- package/dist/client/shared/ui/ColorIndicator/ColorIndicator.jsx +0 -7
- package/dist/client/shared/ui/Description/Description.jsx +0 -7
- package/dist/client/shared/ui/Divider/Divider.jsx +0 -7
- package/dist/client/shared/ui/Label/Label.jsx +0 -9
- package/dist/client/shared/ui/Loading/Loading.jsx +0 -11
- package/dist/client/shared/ui/Popup/Popup.jsx +0 -13
- package/dist/client/shared/ui/ProgressBar/ProgressBar.jsx +0 -11
- package/dist/client/shared/ui/Select/Select.jsx +0 -41
- package/dist/client/shared/ui/StatusCounter/StatusCounter.jsx +0 -26
- package/dist/client/shared/ui/StatusIndicator/StatusIndicator.jsx +0 -10
- package/dist/client/shared/ui/Tooltip/Tooltip.jsx +0 -16
- package/dist/client/shared/ui/form/FormCheckbox/FormCheckbox.jsx +0 -24
- package/dist/client/shared/ui/form/FormCheckboxPublish/FormCheckboxPublish.jsx +0 -21
- package/dist/client/shared/ui/form/FormSelect/FormSelect.jsx +0 -44
- package/dist/client/shared/ui/form/FormSelectLocale/FormSelectLocale.jsx +0 -6
- package/dist/client/shared/ui/form/FormSelectStrategy/FormSelectStrategy.jsx +0 -25
- package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.export.jsx +0 -11
- package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.jsx +0 -55
- package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.server.jsx +0 -17
- package/dist/client/widgets/translate-document/ui/TranslateDocument.jsx +0 -55
- package/dist/client/widgets/translate-document/ui/TranslateDocument.server.jsx +0 -16
- package/dist/vitest-env.d.js +0 -3
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { getFieldTranslationConfig, getTranslateKitFieldConfig, isFieldExcludedFromTranslation } from './getFieldConfig';
|
|
2
2
|
export { TRANSLATE_KIT_CUSTOM_KEY } from './types';
|
|
3
3
|
export type { FieldTranslationConfig, TranslateKitFieldConfig } from './types';
|
|
4
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -4,4 +4,3 @@ import type { CollectionConfig, SanitizedCollectionConfig } from 'payload';
|
|
|
4
4
|
* Handles both CollectionConfig and SanitizedCollectionConfig.
|
|
5
5
|
*/
|
|
6
6
|
export declare function collectionHasDrafts(collection: CollectionConfig | SanitizedCollectionConfig): boolean;
|
|
7
|
-
//# sourceMappingURL=collection-guards.d.ts.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export type { TranslatableField } from './field-guards';
|
|
2
2
|
export { isTranslatableField, isLocalizedField, isRelationshipField, isTabsField, isBlockItem, hasFields, } from './field-guards';
|
|
3
3
|
export { collectionHasDrafts } from './collection-guards';
|
|
4
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -5,4 +5,3 @@ import type { AccessGuard } from '../access/types';
|
|
|
5
5
|
* Returns 403 Forbidden if access guard denies the request.
|
|
6
6
|
*/
|
|
7
7
|
export declare function withAccessCheck(handler: (req: PayloadRequest) => Promise<Response>, access?: AccessGuard): (req: PayloadRequest) => Promise<Response>;
|
|
8
|
-
//# sourceMappingURL=withAccessCheck.d.ts.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export { ServerResponse, withErrorHandler, withAccessCheck } from
|
|
2
|
-
export { AnyAccessGuard } from
|
|
3
|
-
export type { AccessGuard, AccessGuardRequest, Handler } from
|
|
4
|
-
export { isEmpty, isObject, normalizePath, pipe, getByPath, setByPath, filterLocalizedFields } from
|
|
5
|
-
export type { TranslatableField } from
|
|
6
|
-
export { isTranslatableField, isLocalizedField, isRelationshipField, isTabsField, isBlockItem, hasFields, } from
|
|
7
|
-
export { isFieldExcludedFromTranslation, getTranslateKitFieldConfig } from
|
|
8
|
-
export type { TranslateKitFieldConfig } from
|
|
9
|
-
export { isSerializedLexicalRoot, isEmptyRichText, traverseLexicalTree, collectSerializedLexicalTextNodes, } from
|
|
10
|
-
export type { SerializedTextNodeRef } from
|
|
11
|
-
|
|
1
|
+
export { ServerResponse, withErrorHandler, withAccessCheck } from "./http";
|
|
2
|
+
export { AnyAccessGuard } from "./access";
|
|
3
|
+
export type { AccessGuard, AccessGuardRequest, Handler } from "./access";
|
|
4
|
+
export { isEmpty, isObject, normalizePath, pipe, getByPath, setByPath, filterLocalizedFields, } from "./utils";
|
|
5
|
+
export type { TranslatableField } from "./guards";
|
|
6
|
+
export { isTranslatableField, isLocalizedField, isRelationshipField, isTabsField, isBlockItem, hasFields, } from "./guards";
|
|
7
|
+
export { isFieldExcludedFromTranslation, getTranslateKitFieldConfig, } from "./field-config";
|
|
8
|
+
export type { TranslateKitFieldConfig } from "./field-config";
|
|
9
|
+
export { isSerializedLexicalRoot, isEmptyRichText, traverseLexicalTree, collectSerializedLexicalTextNodes, } from "./lexical";
|
|
10
|
+
export type { SerializedTextNodeRef } from "./lexical";
|
|
11
|
+
export { JobIdSchema } from "./validation";
|
|
@@ -1,13 +1,15 @@
|
|
|
1
1
|
// HTTP utilities
|
|
2
|
-
export { ServerResponse, withErrorHandler, withAccessCheck } from
|
|
2
|
+
export { ServerResponse, withErrorHandler, withAccessCheck } from "./http";
|
|
3
3
|
// Access control
|
|
4
|
-
export { AnyAccessGuard } from
|
|
4
|
+
export { AnyAccessGuard } from "./access";
|
|
5
5
|
// General utilities
|
|
6
|
-
export { isEmpty, isObject, normalizePath, pipe, getByPath, setByPath, filterLocalizedFields } from
|
|
7
|
-
export { isTranslatableField, isLocalizedField, isRelationshipField, isTabsField, isBlockItem, hasFields } from
|
|
6
|
+
export { isEmpty, isObject, normalizePath, pipe, getByPath, setByPath, filterLocalizedFields } from "./utils";
|
|
7
|
+
export { isTranslatableField, isLocalizedField, isRelationshipField, isTabsField, isBlockItem, hasFields } from "./guards";
|
|
8
8
|
// Field config
|
|
9
|
-
export { isFieldExcludedFromTranslation, getTranslateKitFieldConfig } from
|
|
9
|
+
export { isFieldExcludedFromTranslation, getTranslateKitFieldConfig } from "./field-config";
|
|
10
10
|
// Lexical utilities
|
|
11
|
-
export { isSerializedLexicalRoot, isEmptyRichText, traverseLexicalTree, collectSerializedLexicalTextNodes } from
|
|
11
|
+
export { isSerializedLexicalRoot, isEmptyRichText, traverseLexicalTree, collectSerializedLexicalTextNodes } from "./lexical";
|
|
12
|
+
// Validation primitives
|
|
13
|
+
export { JobIdSchema } from "./validation";
|
|
12
14
|
|
|
13
15
|
//# sourceMappingURL=index.js.map
|
|
@@ -7,4 +7,3 @@ import type { SerializedLexicalNode, SerializedTextNodeRef } from './types';
|
|
|
7
7
|
* @returns Array of references to text nodes for mutation
|
|
8
8
|
*/
|
|
9
9
|
export declare function collectSerializedLexicalTextNodes(node: SerializedLexicalNode): SerializedTextNodeRef[];
|
|
10
|
-
//# sourceMappingURL=collectTextNodes.d.ts.map
|
|
@@ -17,4 +17,3 @@ export declare function isSerializedLexicalTextNode(node: SerializedLexicalNode)
|
|
|
17
17
|
* Type guard: Checks if node has children array.
|
|
18
18
|
*/
|
|
19
19
|
export declare function hasChildren(node: SerializedLexicalNode): node is SerializedLexicalNodeWithChildren;
|
|
20
|
-
//# sourceMappingURL=guards.d.ts.map
|
|
@@ -4,4 +4,3 @@ export { isSerializedLexicalRoot, isSerializedLexicalTextNode, hasChildren } fro
|
|
|
4
4
|
export { isEmptyRichText } from './isEmptyRichText';
|
|
5
5
|
export { traverseLexicalTree } from './traverseLexicalTree';
|
|
6
6
|
export { collectSerializedLexicalTextNodes } from './collectTextNodes';
|
|
7
|
-
//# sourceMappingURL=index.d.ts.map
|
|
@@ -8,4 +8,3 @@ import type { SerializedLexicalNode } from './types';
|
|
|
8
8
|
* @returns false if traversal was stopped early, true otherwise
|
|
9
9
|
*/
|
|
10
10
|
export declare function traverseLexicalTree(node: SerializedLexicalNode, visitor: (node: SerializedLexicalNode) => boolean | void): boolean;
|
|
11
|
-
//# sourceMappingURL=traverseLexicalTree.d.ts.map
|
|
@@ -8,4 +8,3 @@ import type { Field } from 'payload';
|
|
|
8
8
|
* @returns Filtered data containing only translatable localized fields
|
|
9
9
|
*/
|
|
10
10
|
export declare function filterLocalizedFields(schema: Field[], data: Record<string, unknown>): Record<string, unknown>;
|
|
11
|
-
//# sourceMappingURL=filterLocalizedFields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { JobIdSchema } from "./jobId";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Zod schema for a Payload document/job ID over the HTTP boundary.
|
|
4
|
+
*
|
|
5
|
+
* Accepts the two shapes IDs can arrive in: a JS string (UUID, MongoDB
|
|
6
|
+
* ObjectId hex, custom string id) or a JS number (SQLite/Postgres integer
|
|
7
|
+
* autoincrement). Anything else (null, undefined, boolean, object, array)
|
|
8
|
+
* is rejected by the union itself. The schema normalizes to a non-empty
|
|
9
|
+
* string so callers can compare and Set-membership-check uniformly.
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This is intentionally a wire-format guard, not a domain check. We
|
|
12
|
+
* do not pattern-match for UUID v4 or ObjectId here — different deployments
|
|
13
|
+
* use different ID formats, and a stricter regex would lock the plugin to
|
|
14
|
+
* one adapter. Callers that need DB-specific validation should layer it
|
|
15
|
+
* on top.
|
|
16
|
+
*/
|
|
17
|
+
export declare const JobIdSchema: z.ZodEffects<z.ZodUnion<[z.ZodEffects<z.ZodString, string, string>, z.ZodNumber]>, string, string | number>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
/**
|
|
3
|
+
* Zod schema for a Payload document/job ID over the HTTP boundary.
|
|
4
|
+
*
|
|
5
|
+
* Accepts the two shapes IDs can arrive in: a JS string (UUID, MongoDB
|
|
6
|
+
* ObjectId hex, custom string id) or a JS number (SQLite/Postgres integer
|
|
7
|
+
* autoincrement). Anything else (null, undefined, boolean, object, array)
|
|
8
|
+
* is rejected by the union itself. The schema normalizes to a non-empty
|
|
9
|
+
* string so callers can compare and Set-membership-check uniformly.
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This is intentionally a wire-format guard, not a domain check. We
|
|
12
|
+
* do not pattern-match for UUID v4 or ObjectId here — different deployments
|
|
13
|
+
* use different ID formats, and a stricter regex would lock the plugin to
|
|
14
|
+
* one adapter. Callers that need DB-specific validation should layer it
|
|
15
|
+
* on top.
|
|
16
|
+
*/ export const JobIdSchema = z.union([
|
|
17
|
+
z.string().refine((val)=>val.length > 0 && val !== "undefined", {
|
|
18
|
+
message: "ID must be a non-empty string"
|
|
19
|
+
}),
|
|
20
|
+
z.number().finite()
|
|
21
|
+
]).transform(String);
|
|
22
|
+
|
|
23
|
+
//# sourceMappingURL=jobId.js.map
|
package/dist/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@focus-reactive/payload-plugin-translator",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "Translation plugin for Payload CMS 3.x. Automatically translate your localized content using any translation provider.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"author": "
|
|
7
|
+
"author": "FocusReactive <ship@focusreactive.com>",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|
|
10
|
-
"url": "
|
|
11
|
-
"directory": "plugin"
|
|
10
|
+
"url": "https://github.com/focusreactive/payload-plugins",
|
|
11
|
+
"directory": "packages/payload-plugin-translator"
|
|
12
12
|
},
|
|
13
13
|
"bugs": {
|
|
14
|
-
"url": "https://github.com/focusreactive/payload-
|
|
14
|
+
"url": "https://github.com/focusreactive/payload-plugins/issues"
|
|
15
15
|
},
|
|
16
|
-
"homepage": "https://github.com/focusreactive/payload-plugin-translator
|
|
16
|
+
"homepage": "https://github.com/focusreactive/payload-plugins/tree/main/packages/payload-plugin-translator",
|
|
17
17
|
"keywords": [
|
|
18
18
|
"payload",
|
|
19
19
|
"payloadcms",
|
|
@@ -24,37 +24,38 @@
|
|
|
24
24
|
"openai",
|
|
25
25
|
"ai-translation"
|
|
26
26
|
],
|
|
27
|
+
"main": "./dist/index.js",
|
|
28
|
+
"types": "./dist/index.d.ts",
|
|
27
29
|
"exports": {
|
|
28
30
|
".": {
|
|
29
31
|
"import": "./dist/index.js",
|
|
30
32
|
"types": "./dist/index.d.ts"
|
|
31
33
|
},
|
|
32
34
|
"./client/*": {
|
|
33
|
-
"import": "./dist/client
|
|
34
|
-
"types": "./dist/client
|
|
35
|
+
"import": "./dist/client/*.js",
|
|
36
|
+
"types": "./dist/client/*.d.ts"
|
|
35
37
|
}
|
|
36
38
|
},
|
|
37
39
|
"files": [
|
|
38
40
|
"dist",
|
|
39
41
|
"!dist/**/*.test.*",
|
|
40
|
-
"!dist/**/*.map"
|
|
41
|
-
"README.md",
|
|
42
|
-
"LICENSE"
|
|
42
|
+
"!dist/**/*.map"
|
|
43
43
|
],
|
|
44
44
|
"publishConfig": {
|
|
45
45
|
"access": "public"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|
|
48
|
-
"
|
|
49
|
-
"build": "
|
|
50
|
-
"build:types": "tsc
|
|
51
|
-
"
|
|
52
|
-
"
|
|
48
|
+
"build": "bun run clean && bun run build:swc && bun run build:types && bun run copyfiles",
|
|
49
|
+
"build:swc": "swc ./src -d ./dist --config-file .swcrc --strip-leading-paths --ignore '**/*.test.ts' --ignore '**/*.d.ts' --ignore '**/__tests__/**' --ignore '**/__mocks__/**'",
|
|
50
|
+
"build:types": "tsc --emitDeclarationOnly --outDir dist",
|
|
51
|
+
"copyfiles": "copyfiles -u 1 \"src/**/*.scss\" dist",
|
|
52
|
+
"clean": "rm -rf dist",
|
|
53
|
+
"dev": "bun run build:swc -- --watch",
|
|
53
54
|
"lint": "eslint src",
|
|
54
55
|
"lint:fix": "eslint src --fix",
|
|
55
56
|
"test": "vitest run",
|
|
56
57
|
"test:watch": "vitest",
|
|
57
|
-
"
|
|
58
|
+
"check-types": "tsc --noEmit"
|
|
58
59
|
},
|
|
59
60
|
"peerDependencies": {
|
|
60
61
|
"@payloadcms/richtext-lexical": "^3.76.0",
|
|
@@ -76,21 +77,21 @@
|
|
|
76
77
|
"openai": "^4.50.0"
|
|
77
78
|
},
|
|
78
79
|
"devDependencies": {
|
|
79
|
-
"@
|
|
80
|
-
"@payloadcms/
|
|
81
|
-
"@
|
|
82
|
-
"@swc/
|
|
83
|
-
"@
|
|
84
|
-
"@
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
"eslint": "
|
|
80
|
+
"@payloadcms/richtext-lexical": "3.79.0",
|
|
81
|
+
"@payloadcms/ui": "3.79.0",
|
|
82
|
+
"@swc/cli": "0.4.0",
|
|
83
|
+
"@swc/core": "1.7.0",
|
|
84
|
+
"@types/react": "19.2.9",
|
|
85
|
+
"@vitest/coverage-v8": "3.2.4",
|
|
86
|
+
"copyfiles": "2.4.1",
|
|
87
|
+
"eslint": "9.0.0",
|
|
88
|
+
"eslint-config-prettier": "9.0.0",
|
|
89
|
+
"next": "15.4.11",
|
|
90
|
+
"payload": "3.79.0",
|
|
91
|
+
"react": "19.0.0",
|
|
92
|
+
"typescript": "5.5.2",
|
|
88
93
|
"eslint-plugin-react-hooks": "6.0.0-rc.2",
|
|
89
|
-
"
|
|
90
|
-
"
|
|
91
|
-
"react": "^19.0.0",
|
|
92
|
-
"typescript": "^5.7.0",
|
|
93
|
-
"typescript-eslint": "^8.56.0",
|
|
94
|
-
"vitest": "^3.0.0"
|
|
94
|
+
"typescript-eslint": "8.0.0",
|
|
95
|
+
"vitest": "3.2.4"
|
|
95
96
|
}
|
|
96
97
|
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { QueryClientProvider } from '@tanstack/react-query';
|
|
3
|
-
import { CacheClientProviderFactory } from '../../shared/providers/CacheClientProvider';
|
|
4
|
-
import { TranslateKitConfigProvider } from '../config';
|
|
5
|
-
const queryClient = new CacheClientProviderFactory().create('client');
|
|
6
|
-
export function CacheProvider({ basePath, children }) {
|
|
7
|
-
return (<TranslateKitConfigProvider basePath={basePath}>
|
|
8
|
-
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
|
|
9
|
-
</TranslateKitConfigProvider>);
|
|
10
|
-
}
|
|
11
|
-
export default CacheProvider;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { createContext, useContext, useMemo } from 'react';
|
|
3
|
-
const defaultConfig = {
|
|
4
|
-
basePath: '/translate',
|
|
5
|
-
};
|
|
6
|
-
const TranslateKitConfigContext = createContext(defaultConfig);
|
|
7
|
-
export function TranslateKitConfigProvider({ basePath = defaultConfig.basePath, children, }) {
|
|
8
|
-
const value = useMemo(() => ({ basePath }), [basePath]);
|
|
9
|
-
return <TranslateKitConfigContext.Provider value={value}>{children}</TranslateKitConfigContext.Provider>;
|
|
10
|
-
}
|
|
11
|
-
export function useTranslateKitConfig() {
|
|
12
|
-
return useContext(TranslateKitConfigContext);
|
|
13
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { LanguageTranslateIcon } from '../../../../shared/lib/assets/icons/LanguageTranslateIcon';
|
|
2
|
-
import Button from '../../../../shared/ui/Button';
|
|
3
|
-
import StatusIndicator from '../../../../shared/ui/StatusIndicator';
|
|
4
|
-
import Tooltip from '../../../../shared/ui/Tooltip';
|
|
5
|
-
import { TranslationDirection } from '../TranslationDirection';
|
|
6
|
-
import styles from './styles.module.scss';
|
|
7
|
-
export function CompletedTranslationStatus({ completed_at, sourceLocale, targetLocale, }) {
|
|
8
|
-
return (<StatusIndicator className={styles.indicator} $color="green" title="Completed">
|
|
9
|
-
<Tooltip sideOffset={12} side="bottom" content={<time dateTime={completed_at}>
|
|
10
|
-
Completed at:{' '}
|
|
11
|
-
{new Date(completed_at).toLocaleString(undefined, {
|
|
12
|
-
year: 'numeric',
|
|
13
|
-
month: 'short',
|
|
14
|
-
day: 'numeric',
|
|
15
|
-
hour: '2-digit',
|
|
16
|
-
minute: '2-digit',
|
|
17
|
-
})}
|
|
18
|
-
</time>}>
|
|
19
|
-
<Button type="button" $variant="unstyled">
|
|
20
|
-
<LanguageTranslateIcon />
|
|
21
|
-
</Button>
|
|
22
|
-
</Tooltip>
|
|
23
|
-
<TranslationDirection sourceLocale={sourceLocale} targetLocale={targetLocale}/>
|
|
24
|
-
</StatusIndicator>);
|
|
25
|
-
}
|
package/dist/client/entities/translation/ui/FailedTranslationStatus/FailedTranslationStatus.jsx
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { LanguageTranslateIcon } from '../../../../shared/lib/assets/icons/LanguageTranslateIcon';
|
|
2
|
-
import { ReloadIcon } from '../../../../shared/lib/assets/icons/ReloadIcon';
|
|
3
|
-
import Button from '../../../../shared/ui/Button';
|
|
4
|
-
import Divider from '../../../../shared/ui/Divider';
|
|
5
|
-
import StatusIndicator from '../../../../shared/ui/StatusIndicator';
|
|
6
|
-
import Tooltip from '../../../../shared/ui/Tooltip';
|
|
7
|
-
import { TranslationDirection } from '../TranslationDirection';
|
|
8
|
-
import styles from './styles.module.scss';
|
|
9
|
-
export function FailedTranslationStatus({ onRetry, message, isLoading, sourceLocale, targetLocale, }) {
|
|
10
|
-
return (<StatusIndicator $color="red" title="Failed">
|
|
11
|
-
<Tooltip sideOffset={12} side="bottom" content={message}>
|
|
12
|
-
<Button type="button" $variant="unstyled">
|
|
13
|
-
<LanguageTranslateIcon />
|
|
14
|
-
</Button>
|
|
15
|
-
</Tooltip>
|
|
16
|
-
<TranslationDirection sourceLocale={sourceLocale} targetLocale={targetLocale}/>
|
|
17
|
-
<Divider className={styles.divider} $orientation="vertical" $size="sm"/>
|
|
18
|
-
<Tooltip side="bottom" sideOffset={12} content="Retry">
|
|
19
|
-
<Button $variant="light" $size="sm" $isIconButton aria-label="Retry failed translation" type="button" onClick={onRetry} disabled={isLoading} $isLoading={isLoading}>
|
|
20
|
-
<ReloadIcon />
|
|
21
|
-
</Button>
|
|
22
|
-
</Tooltip>
|
|
23
|
-
</StatusIndicator>);
|
|
24
|
-
}
|
package/dist/client/entities/translation/ui/PendingTranslationStatus/PendingTranslationStatus.jsx
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { TrashIcon } from '@payloadcms/ui/icons/Trash';
|
|
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
|
-
export function PendingTranslationStatus({ onCancel, onRun, isLoading, disabled, sourceLocale, targetLocale, createdAt, }) {
|
|
10
|
-
return (<StatusIndicator $color="gray" $animated title="Pending">
|
|
11
|
-
<Tooltip side="bottom" sideOffset={12} content={<time dateTime={createdAt}>
|
|
12
|
-
Created at:{' '}
|
|
13
|
-
{new Date(createdAt).toLocaleString(undefined, {
|
|
14
|
-
year: 'numeric',
|
|
15
|
-
month: 'short',
|
|
16
|
-
day: 'numeric',
|
|
17
|
-
hour: '2-digit',
|
|
18
|
-
minute: '2-digit',
|
|
19
|
-
})}
|
|
20
|
-
</time>}>
|
|
21
|
-
<Button type="button" $variant="unstyled">
|
|
22
|
-
<LanguageTranslateIcon />
|
|
23
|
-
</Button>
|
|
24
|
-
</Tooltip>
|
|
25
|
-
<TranslationDirection sourceLocale={sourceLocale} targetLocale={targetLocale}/>
|
|
26
|
-
<Divider $size="sm" $orientation="vertical"/>
|
|
27
|
-
<Tooltip sideOffset={12} side="bottom" content="Cancel">
|
|
28
|
-
<Button $variant="light" $size="sm" $isIconButton aria-label="Cancel" type="button" onClick={onCancel} disabled={isLoading || disabled} $isLoading={isLoading}>
|
|
29
|
-
<TrashIcon />
|
|
30
|
-
</Button>
|
|
31
|
-
</Tooltip>
|
|
32
|
-
<Tooltip sideOffset={12} side="bottom" content="Run queued translation">
|
|
33
|
-
<Button $variant="light" $size="sm" $isIconButton aria-label="Run queued translation" type="button" onClick={onRun} disabled={isLoading || disabled} $isLoading={isLoading}>
|
|
34
|
-
<ReloadIcon />
|
|
35
|
-
</Button>
|
|
36
|
-
</Tooltip>
|
|
37
|
-
</StatusIndicator>);
|
|
38
|
-
}
|
package/dist/client/entities/translation/ui/RunningTranslationStatus/RunningTranslationStatus.jsx
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { TrashIcon } from '@payloadcms/ui/icons/Trash';
|
|
2
|
-
import { LanguageTranslateIcon } from '../../../../shared/lib/assets/icons/LanguageTranslateIcon';
|
|
3
|
-
import Button from '../../../../shared/ui/Button';
|
|
4
|
-
import Divider from '../../../../shared/ui/Divider';
|
|
5
|
-
import StatusIndicator from '../../../../shared/ui/StatusIndicator';
|
|
6
|
-
import Tooltip from '../../../../shared/ui/Tooltip';
|
|
7
|
-
import { TranslationDirection } from '../TranslationDirection';
|
|
8
|
-
export function RunningTranslationStatus({ onCancel, isLoading, disabled, sourceLocale, targetLocale, createdAt, }) {
|
|
9
|
-
return (<StatusIndicator $animated $color="blue" title="In Progress">
|
|
10
|
-
<Tooltip side="bottom" sideOffset={12} content={<time dateTime={createdAt}>
|
|
11
|
-
Created at:{' '}
|
|
12
|
-
{new Date(createdAt).toLocaleString(undefined, {
|
|
13
|
-
year: 'numeric',
|
|
14
|
-
month: 'short',
|
|
15
|
-
day: 'numeric',
|
|
16
|
-
hour: '2-digit',
|
|
17
|
-
minute: '2-digit',
|
|
18
|
-
})}
|
|
19
|
-
</time>}>
|
|
20
|
-
<Button type="button" $variant="unstyled">
|
|
21
|
-
<LanguageTranslateIcon />
|
|
22
|
-
</Button>
|
|
23
|
-
</Tooltip>
|
|
24
|
-
<TranslationDirection sourceLocale={sourceLocale} targetLocale={targetLocale}/>
|
|
25
|
-
<Divider $size="sm" $orientation="vertical"/>
|
|
26
|
-
<Tooltip sideOffset={12} side="bottom" content="Cancel">
|
|
27
|
-
<Button $variant="light" $size="sm" $isIconButton aria-label="Cancel" type="button" onClick={onCancel} disabled={isLoading || disabled} $isLoading={isLoading}>
|
|
28
|
-
<TrashIcon />
|
|
29
|
-
</Button>
|
|
30
|
-
</Tooltip>
|
|
31
|
-
</StatusIndicator>);
|
|
32
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import styles from './styles.module.scss';
|
|
2
|
-
export const TranslationDirection = ({ sourceLocale, targetLocale, className }) => {
|
|
3
|
-
return (<div className={`${styles.container} ${className || ''}`} role="group" aria-label={`Translation from ${sourceLocale} to ${targetLocale}`}>
|
|
4
|
-
<span className={styles.locale} aria-label={`Source language: ${sourceLocale}`}>
|
|
5
|
-
{sourceLocale.toLowerCase()}
|
|
6
|
-
</span>
|
|
7
|
-
|
|
8
|
-
<div className={styles.arrow} aria-hidden="true">
|
|
9
|
-
→
|
|
10
|
-
</div>
|
|
11
|
-
|
|
12
|
-
<span className={styles.locale} aria-label={`Target language: ${targetLocale}`}>
|
|
13
|
-
{targetLocale.toLowerCase()}
|
|
14
|
-
</span>
|
|
15
|
-
</div>);
|
|
16
|
-
};
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { FormProvider } from 'react-hook-form';
|
|
2
|
-
import Button from '../../../shared/ui/Button';
|
|
3
|
-
import FormSelectLocale from '../../../shared/ui/form/FormSelectLocale';
|
|
4
|
-
import { FormSelectStrategy } from '../../../shared/ui/form/FormSelectStrategy';
|
|
5
|
-
import { FormCheckboxPublish } from '../../../shared/ui/form/FormCheckboxPublish';
|
|
6
|
-
import { FORM_FIELDS } from '../model/constants';
|
|
7
|
-
import styles from './styles.module.scss';
|
|
8
|
-
export function CollectionTranslationForm({ form, onSubmit, selectedCount, hasDrafts, }) {
|
|
9
|
-
return (<FormProvider {...form}>
|
|
10
|
-
<fieldset className={styles.fieldset}>
|
|
11
|
-
<div className={styles.row}>
|
|
12
|
-
<div className={styles['locale-group']}>
|
|
13
|
-
<FormSelectLocale label="From" className={styles['select-locale-field']} size="md" name={FORM_FIELDS.SOURCE_LNG}/>
|
|
14
|
-
<FormSelectLocale label="To" className={styles['select-locale-field']} size="md" name={FORM_FIELDS.TARGET_LNG}/>
|
|
15
|
-
</div>
|
|
16
|
-
<FormSelectStrategy className={styles['strategy-field']} name={FORM_FIELDS.STRATEGY} size="md"/>
|
|
17
|
-
</div>
|
|
18
|
-
{hasDrafts && <FormCheckboxPublish name={FORM_FIELDS.PUBLISH_ON_TRANSLATION}/>}
|
|
19
|
-
<input {...form.register(FORM_FIELDS.HIDDEN_COLLECTION_SLUG)} type="hidden"/>
|
|
20
|
-
<Button $variant="filled" disabled={form.formState.isSubmitting || selectedCount === 0} className={styles['submit-button']} onClick={form.handleSubmit(onSubmit)} type="submit" $size="md" $isLoading={form.formState.isSubmitting}>
|
|
21
|
-
{selectedCount ? `Queue ${selectedCount} translations` : 'Queue translations'}
|
|
22
|
-
</Button>
|
|
23
|
-
</fieldset>
|
|
24
|
-
</FormProvider>);
|
|
25
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { LanguageTranslateIcon } from '../../../shared/lib/assets/icons/LanguageTranslateIcon';
|
|
3
|
-
import { useToggle } from '../../../shared/lib/utils/react/useToggle';
|
|
4
|
-
import Button from '../../../shared/ui/Button';
|
|
5
|
-
import ColorIndicator from '../../../shared/ui/ColorIndicator';
|
|
6
|
-
import Popup from '../../../shared/ui/Popup';
|
|
7
|
-
import styles from './styles.module.scss';
|
|
8
|
-
function CollectionTranslationPopup({ children, translationInProgress, selectedCount, }) {
|
|
9
|
-
const [isPopupOpen, popupOpen] = useToggle();
|
|
10
|
-
return (<Popup $align="start" onOpenChange={popupOpen.setValue} $trigger={<Button $size="md" $variant="filled" className={styles['popup-trigger-button']} aria-label="Open translation options" onClick={popupOpen.setTrue}>
|
|
11
|
-
{translationInProgress && <ColorIndicator title="Translations In Progress" $animated $color="blue"/>}
|
|
12
|
-
<LanguageTranslateIcon />
|
|
13
|
-
{selectedCount > 0 && !translationInProgress && (<>
|
|
14
|
-
<span className={styles.arrow} aria-hidden="true">
|
|
15
|
-
→
|
|
16
|
-
</span>
|
|
17
|
-
{selectedCount}
|
|
18
|
-
</>)}
|
|
19
|
-
</Button>} open={isPopupOpen}>
|
|
20
|
-
<div className={styles['popup-content']}>{children}</div>
|
|
21
|
-
</Popup>);
|
|
22
|
-
}
|
|
23
|
-
export default CollectionTranslationPopup;
|