@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
package/README.md
CHANGED
|
@@ -16,12 +16,15 @@ Translation plugin for Payload CMS 3.x. Automatically translate your localized c
|
|
|
16
16
|
## Installation
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
|
-
# pnpm
|
|
20
|
-
pnpm add @focus-reactive/payload-plugin-translator
|
|
21
|
-
|
|
22
19
|
# npm
|
|
23
20
|
npm install @focus-reactive/payload-plugin-translator
|
|
24
21
|
|
|
22
|
+
# bun
|
|
23
|
+
bun add @focus-reactive/payload-plugin-translator
|
|
24
|
+
|
|
25
|
+
# pnpm
|
|
26
|
+
pnpm add @focus-reactive/payload-plugin-translator
|
|
27
|
+
|
|
25
28
|
# yarn
|
|
26
29
|
yarn add @focus-reactive/payload-plugin-translator
|
|
27
30
|
```
|
|
@@ -29,14 +32,14 @@ yarn add @focus-reactive/payload-plugin-translator
|
|
|
29
32
|
## Quick Start
|
|
30
33
|
|
|
31
34
|
```typescript
|
|
32
|
-
import { buildConfig } from
|
|
35
|
+
import { buildConfig } from "payload";
|
|
33
36
|
import {
|
|
34
37
|
translatorPlugin,
|
|
35
38
|
createOpenAIProvider,
|
|
36
39
|
createPayloadJobsRunner,
|
|
37
|
-
} from
|
|
38
|
-
import { Posts } from
|
|
39
|
-
import { Pages } from
|
|
40
|
+
} from "@focus-reactive/payload-plugin-translator";
|
|
41
|
+
import { Posts } from "./collections/Posts";
|
|
42
|
+
import { Pages } from "./collections/Pages";
|
|
40
43
|
|
|
41
44
|
export default buildConfig({
|
|
42
45
|
collections: [Posts, Pages],
|
|
@@ -50,10 +53,10 @@ export default buildConfig({
|
|
|
50
53
|
}),
|
|
51
54
|
],
|
|
52
55
|
localization: {
|
|
53
|
-
locales: [
|
|
54
|
-
defaultLocale:
|
|
56
|
+
locales: ["en", "de", "fr"],
|
|
57
|
+
defaultLocale: "en",
|
|
55
58
|
},
|
|
56
|
-
})
|
|
59
|
+
});
|
|
57
60
|
```
|
|
58
61
|
|
|
59
62
|
## Configuration
|
|
@@ -62,7 +65,6 @@ export default buildConfig({
|
|
|
62
65
|
|
|
63
66
|
Configuration for `translatorPlugin()`.
|
|
64
67
|
|
|
65
|
-
|
|
66
68
|
| Property | Type | Required | Default | Description |
|
|
67
69
|
| --------------------- | --------------------- | -------- | -------------- | ------------------------------------------------------------------------------------------------------------------- |
|
|
68
70
|
| `collections` | `CollectionConfig[]` | Yes | — | Original collection configs to enable translation for. Must be the same objects passed to `buildConfig`, not slugs. |
|
|
@@ -71,38 +73,37 @@ Configuration for `translatorPlugin()`.
|
|
|
71
73
|
| `access` | `AccessGuard` | No | `undefined` | Access control function for translation endpoints |
|
|
72
74
|
| `basePath` | `string` | No | `'/translate'` | Base path for all API endpoints |
|
|
73
75
|
|
|
74
|
-
|
|
75
76
|
```typescript
|
|
76
77
|
translatorPlugin({
|
|
77
78
|
collections: [Posts, Pages],
|
|
78
|
-
translationProvider: createOpenAIProvider({
|
|
79
|
+
translationProvider: createOpenAIProvider({
|
|
80
|
+
apiKey: process.env.OPENAI_API_KEY,
|
|
81
|
+
}),
|
|
79
82
|
runner: createPayloadJobsRunner(),
|
|
80
|
-
access: async ({ req }) => req.user?.role ===
|
|
81
|
-
basePath:
|
|
82
|
-
})
|
|
83
|
+
access: async ({ req }) => req.user?.role === "admin",
|
|
84
|
+
basePath: "/translate",
|
|
85
|
+
});
|
|
83
86
|
```
|
|
84
87
|
|
|
85
88
|
### OpenAIProviderConfig
|
|
86
89
|
|
|
87
90
|
Configuration for `createOpenAIProvider()`.
|
|
88
91
|
|
|
89
|
-
|
|
90
|
-
|
|
|
91
|
-
|
|
|
92
|
-
| `
|
|
93
|
-
| `
|
|
94
|
-
| `
|
|
95
|
-
| `dryRun` | `boolean | DryRunConfig` | No | `false` | Simulate translations without API calls |
|
|
96
|
-
|
|
92
|
+
| Property | Type | Required | Default | Description |
|
|
93
|
+
| -------------- | ------------------------- | -------- | --------------- | ------------------------------------------ |
|
|
94
|
+
| `apiKey` | `string` | Yes | — | OpenAI API key |
|
|
95
|
+
| `model` | `string \| ChatModel` | No | `'gpt-4o'` | OpenAI model to use for translation |
|
|
96
|
+
| `systemPrompt` | `SystemPromptBuilder` | No | Built-in prompt | Custom function to build the system prompt |
|
|
97
|
+
| `dryRun` | `boolean \| DryRunConfig` | No | `false` | Simulate translations without API calls |
|
|
97
98
|
|
|
98
99
|
```typescript
|
|
99
100
|
createOpenAIProvider({
|
|
100
101
|
apiKey: process.env.OPENAI_API_KEY,
|
|
101
|
-
model:
|
|
102
|
+
model: "gpt-4o-mini",
|
|
102
103
|
systemPrompt: ({ sourceLang, targetLang, defaultPrompt }) =>
|
|
103
104
|
`${defaultPrompt}\nUse formal language. Keep brand names unchanged.`,
|
|
104
105
|
dryRun: false,
|
|
105
|
-
})
|
|
106
|
+
});
|
|
106
107
|
```
|
|
107
108
|
|
|
108
109
|
#### SystemPromptBuilder
|
|
@@ -110,13 +111,13 @@ createOpenAIProvider({
|
|
|
110
111
|
Function signature for custom system prompt:
|
|
111
112
|
|
|
112
113
|
```typescript
|
|
113
|
-
type SystemPromptBuilder = (context: SystemPromptContext) => string
|
|
114
|
+
type SystemPromptBuilder = (context: SystemPromptContext) => string;
|
|
114
115
|
|
|
115
116
|
type SystemPromptContext = {
|
|
116
|
-
sourceLang: string
|
|
117
|
-
targetLang: string
|
|
118
|
-
defaultPrompt: string
|
|
119
|
-
}
|
|
117
|
+
sourceLang: string;
|
|
118
|
+
targetLang: string;
|
|
119
|
+
defaultPrompt: string;
|
|
120
|
+
};
|
|
120
121
|
```
|
|
121
122
|
|
|
122
123
|
#### DryRunConfig
|
|
@@ -124,64 +125,61 @@ type SystemPromptContext = {
|
|
|
124
125
|
When `dryRun` is an object, it allows custom transformation with optional delay:
|
|
125
126
|
|
|
126
127
|
```typescript
|
|
127
|
-
type DryRunTransformer = (text: string) => string | Promise<string
|
|
128
|
+
type DryRunTransformer = (text: string) => string | Promise<string>;
|
|
128
129
|
|
|
129
130
|
type DryRunConfig = {
|
|
130
|
-
transform: DryRunTransformer // Custom transformer function
|
|
131
|
-
timeout?: number // Delay in ms (simulates API latency)
|
|
132
|
-
}
|
|
131
|
+
transform: DryRunTransformer; // Custom transformer function
|
|
132
|
+
timeout?: number; // Delay in ms (simulates API latency)
|
|
133
|
+
};
|
|
133
134
|
```
|
|
134
135
|
|
|
135
136
|
### PayloadJobsRunnerOptions
|
|
136
137
|
|
|
137
138
|
Configuration for `createPayloadJobsRunner()`.
|
|
138
139
|
|
|
139
|
-
|
|
140
|
-
|
|
|
141
|
-
|
|
|
142
|
-
| `
|
|
143
|
-
| `
|
|
144
|
-
| `autoRun` | `false | { cron, limit }` | No | `{ cron: '* * * * *', limit: 50 }` | Auto-run config, or `false` to disable (for serverless) |
|
|
145
|
-
|
|
140
|
+
| Property | Type | Required | Default | Description |
|
|
141
|
+
| ----------- | -------------------------- | -------- | ---------------------------------- | ------------------------------------------------------- |
|
|
142
|
+
| `taskName` | `string` | No | `'translate_document'` | Task name in Payload jobs collection |
|
|
143
|
+
| `queueName` | `string` | No | `'translations'` | Queue name for grouping jobs |
|
|
144
|
+
| `autoRun` | `false \| { cron, limit }` | No | `{ cron: '* * * * *', limit: 50 }` | Auto-run config, or `false` to disable (for serverless) |
|
|
146
145
|
|
|
147
146
|
```typescript
|
|
148
147
|
createPayloadJobsRunner({
|
|
149
|
-
taskName:
|
|
150
|
-
queueName:
|
|
148
|
+
taskName: "translate_document",
|
|
149
|
+
queueName: "translations",
|
|
151
150
|
autoRun: {
|
|
152
|
-
cron:
|
|
151
|
+
cron: "* * * * *",
|
|
153
152
|
limit: 50,
|
|
154
153
|
},
|
|
155
|
-
})
|
|
154
|
+
});
|
|
156
155
|
```
|
|
157
156
|
|
|
158
157
|
### FieldTranslationConfig
|
|
159
158
|
|
|
160
159
|
Configuration for `withFieldTranslation()` helper or `field.custom.translateKit`.
|
|
161
160
|
|
|
162
|
-
|
|
163
161
|
| Property | Type | Required | Default | Description |
|
|
164
162
|
| --------- | --------- | -------- | ------- | ----------------------------------- |
|
|
165
163
|
| `exclude` | `boolean` | No | `false` | Exclude this field from translation |
|
|
166
164
|
|
|
167
|
-
|
|
168
165
|
```typescript
|
|
169
|
-
import { withFieldTranslation } from
|
|
166
|
+
import { withFieldTranslation } from "@focus-reactive/payload-plugin-translator";
|
|
170
167
|
|
|
171
|
-
withFieldTranslation(
|
|
168
|
+
withFieldTranslation(
|
|
169
|
+
{ name: "sku", type: "text", localized: true },
|
|
170
|
+
{ exclude: true },
|
|
171
|
+
);
|
|
172
172
|
```
|
|
173
173
|
|
|
174
174
|
## Translation Strategies
|
|
175
175
|
|
|
176
176
|
When translating, you can choose how to handle existing translations:
|
|
177
177
|
|
|
178
|
-
|
|
179
178
|
| Strategy | Description |
|
|
180
179
|
| ----------------- | ------------------------------------------------------------------------ |
|
|
181
180
|
| `'overwrite'` | (Default) Replaces all existing translated content with new translations |
|
|
182
181
|
| `'skip_existing'` | Only translates fields that are empty in the target locale |
|
|
183
182
|
|
|
184
|
-
|
|
185
183
|
## Important Notes
|
|
186
184
|
|
|
187
185
|
### Explicit `localized: true` for nested fields
|
|
@@ -236,7 +234,7 @@ export default buildConfig({
|
|
|
236
234
|
jobs: {
|
|
237
235
|
deleteJobOnComplete: false,
|
|
238
236
|
},
|
|
239
|
-
})
|
|
237
|
+
});
|
|
240
238
|
```
|
|
241
239
|
|
|
242
240
|
## Task Runners
|
|
@@ -246,16 +244,16 @@ export default buildConfig({
|
|
|
246
244
|
Uses Payload's built-in job queue for background processing:
|
|
247
245
|
|
|
248
246
|
```typescript
|
|
249
|
-
import { createPayloadJobsRunner } from
|
|
247
|
+
import { createPayloadJobsRunner } from "@focus-reactive/payload-plugin-translator";
|
|
250
248
|
|
|
251
249
|
const runner = createPayloadJobsRunner({
|
|
252
|
-
taskName:
|
|
253
|
-
queueName:
|
|
250
|
+
taskName: "translate_document",
|
|
251
|
+
queueName: "translations",
|
|
254
252
|
autoRun: {
|
|
255
|
-
cron:
|
|
253
|
+
cron: "* * * * *",
|
|
256
254
|
limit: 50,
|
|
257
255
|
},
|
|
258
|
-
})
|
|
256
|
+
});
|
|
259
257
|
```
|
|
260
258
|
|
|
261
259
|
### SyncRunner
|
|
@@ -263,9 +261,9 @@ const runner = createPayloadJobsRunner({
|
|
|
263
261
|
Executes translations synchronously (useful for development or small datasets):
|
|
264
262
|
|
|
265
263
|
```typescript
|
|
266
|
-
import { createSyncRunner } from
|
|
264
|
+
import { createSyncRunner } from "@focus-reactive/payload-plugin-translator";
|
|
267
265
|
|
|
268
|
-
const runner = createSyncRunner()
|
|
266
|
+
const runner = createSyncRunner();
|
|
269
267
|
```
|
|
270
268
|
|
|
271
269
|
## Translation Providers
|
|
@@ -275,13 +273,13 @@ const runner = createSyncRunner()
|
|
|
275
273
|
Built-in provider using OpenAI's API:
|
|
276
274
|
|
|
277
275
|
```typescript
|
|
278
|
-
import { createOpenAIProvider } from
|
|
276
|
+
import { createOpenAIProvider } from "@focus-reactive/payload-plugin-translator";
|
|
279
277
|
|
|
280
278
|
const provider = createOpenAIProvider({
|
|
281
279
|
apiKey: process.env.OPENAI_API_KEY,
|
|
282
|
-
model:
|
|
280
|
+
model: "gpt-4o-mini",
|
|
283
281
|
systemPrompt: ({ defaultPrompt }) => `${defaultPrompt}\nUse formal language.`,
|
|
284
|
-
})
|
|
282
|
+
});
|
|
285
283
|
```
|
|
286
284
|
|
|
287
285
|
### Custom Provider
|
|
@@ -290,11 +288,9 @@ Create your own translation provider by implementing the `TranslationProvider` i
|
|
|
290
288
|
|
|
291
289
|
#### TranslationProvider Interface
|
|
292
290
|
|
|
293
|
-
|
|
294
|
-
|
|
|
295
|
-
|
|
|
296
|
-
| `translate` | `(content: TranslationInput, sourceLng: string, targetLng: string) => Promise<TranslationOutput | null>` | Translates content from source to target language |
|
|
297
|
-
|
|
291
|
+
| Method | Signature | Description |
|
|
292
|
+
| ----------- | --------------------------------------------------------------------------------------------------------- | ------------------------------------------------- |
|
|
293
|
+
| `translate` | `(content: TranslationInput, sourceLng: string, targetLng: string) => Promise<TranslationOutput \| null>` | Translates content from source to target language |
|
|
298
294
|
|
|
299
295
|
**Important:** The numeric indices in `TranslationInput` must be preserved exactly in `TranslationOutput`. Each index maps to a specific field in the document structure, so the provider must return the same keys with translated values.
|
|
300
296
|
|
|
@@ -302,13 +298,13 @@ Create your own translation provider by implementing the `TranslationProvider` i
|
|
|
302
298
|
|
|
303
299
|
```typescript
|
|
304
300
|
// Numeric index representing position in document structure
|
|
305
|
-
type TranslationIndex = number
|
|
301
|
+
type TranslationIndex = number;
|
|
306
302
|
|
|
307
303
|
// Input: Map of numeric indices to text strings
|
|
308
|
-
type TranslationInput = Record<TranslationIndex, string
|
|
304
|
+
type TranslationInput = Record<TranslationIndex, string>;
|
|
309
305
|
|
|
310
306
|
// Output: Same indices with translated values
|
|
311
|
-
type TranslationOutput = Record<TranslationIndex, string
|
|
307
|
+
type TranslationOutput = Record<TranslationIndex, string>;
|
|
312
308
|
```
|
|
313
309
|
|
|
314
310
|
#### Example Implementation
|
|
@@ -318,40 +314,44 @@ import type {
|
|
|
318
314
|
TranslationProvider,
|
|
319
315
|
TranslationInput,
|
|
320
316
|
TranslationOutput,
|
|
321
|
-
} from
|
|
317
|
+
} from "@focus-reactive/payload-plugin-translator";
|
|
322
318
|
|
|
323
319
|
class DeepLProvider implements TranslationProvider {
|
|
324
320
|
constructor(private apiKey: string) {}
|
|
325
321
|
|
|
326
|
-
async translate(
|
|
322
|
+
async translate(
|
|
323
|
+
content: TranslationInput,
|
|
324
|
+
sourceLng: string,
|
|
325
|
+
targetLng: string,
|
|
326
|
+
): Promise<TranslationOutput | null> {
|
|
327
327
|
try {
|
|
328
328
|
// content example: { "0": "Hello", "1": "World" }
|
|
329
|
-
const texts = Object.values(content)
|
|
329
|
+
const texts = Object.values(content);
|
|
330
330
|
|
|
331
|
-
const response = await fetch(
|
|
332
|
-
method:
|
|
331
|
+
const response = await fetch("https://api.deepl.com/v2/translate", {
|
|
332
|
+
method: "POST",
|
|
333
333
|
headers: {
|
|
334
334
|
Authorization: `DeepL-Auth-Key ${this.apiKey}`,
|
|
335
|
-
|
|
335
|
+
"Content-Type": "application/json",
|
|
336
336
|
},
|
|
337
337
|
body: JSON.stringify({
|
|
338
338
|
text: texts,
|
|
339
339
|
source_lang: sourceLng.toUpperCase(),
|
|
340
340
|
target_lang: targetLng.toUpperCase(),
|
|
341
341
|
}),
|
|
342
|
-
})
|
|
342
|
+
});
|
|
343
343
|
|
|
344
|
-
const data = await response.json()
|
|
344
|
+
const data = await response.json();
|
|
345
345
|
|
|
346
346
|
// Reconstruct the result with same keys
|
|
347
|
-
const result: TranslationOutput = {}
|
|
347
|
+
const result: TranslationOutput = {};
|
|
348
348
|
Object.keys(content).forEach((key, index) => {
|
|
349
|
-
result[key] = data.translations[index].text
|
|
350
|
-
})
|
|
349
|
+
result[key] = data.translations[index].text;
|
|
350
|
+
});
|
|
351
351
|
|
|
352
|
-
return result
|
|
352
|
+
return result;
|
|
353
353
|
} catch {
|
|
354
|
-
return null
|
|
354
|
+
return null;
|
|
355
355
|
}
|
|
356
356
|
}
|
|
357
357
|
}
|
|
@@ -361,7 +361,7 @@ translatorPlugin({
|
|
|
361
361
|
collections: [Posts],
|
|
362
362
|
translationProvider: new DeepLProvider(process.env.DEEPL_API_KEY),
|
|
363
363
|
runner: createPayloadJobsRunner(),
|
|
364
|
-
})
|
|
364
|
+
});
|
|
365
365
|
```
|
|
366
366
|
|
|
367
367
|
## UI Components
|
|
@@ -401,17 +401,9 @@ import type {
|
|
|
401
401
|
|
|
402
402
|
// Field config
|
|
403
403
|
FieldTranslationConfig,
|
|
404
|
-
} from
|
|
404
|
+
} from "@focus-reactive/payload-plugin-translator";
|
|
405
405
|
```
|
|
406
406
|
|
|
407
|
-
## Known Issues
|
|
408
|
-
|
|
409
|
-
### SQLite: Nested JSON queries not supported
|
|
410
|
-
|
|
411
|
-
SQLite adapter doesn't support nested JSON field queries like `{ 'input.collection.value': { equals: '5' } }`.
|
|
412
|
-
|
|
413
|
-
**Affected databases:** SQLite only
|
|
414
|
-
|
|
415
407
|
## Roadmap
|
|
416
408
|
|
|
417
409
|
Planned features for future releases:
|
|
@@ -420,4 +412,3 @@ Planned features for future releases:
|
|
|
420
412
|
- **Global translation dashboard** — Translate all collections at once from a single interface, with progress tracking across the entire CMS
|
|
421
413
|
- **Vercel Cron Jobs runner** — Built-in runner for seamless Vercel/serverless deployments without manual API route configuration
|
|
422
414
|
- Auto-translate on source change — Automatically trigger translation when the default locale content is updated
|
|
423
|
-
|
|
@@ -2,6 +2,5 @@ import type { PropsWithChildren } from 'react';
|
|
|
2
2
|
type CacheProviderProps = PropsWithChildren<{
|
|
3
3
|
basePath?: string;
|
|
4
4
|
}>;
|
|
5
|
-
export declare function CacheProvider({ basePath, children }: CacheProviderProps): import("react").JSX.Element;
|
|
5
|
+
export declare function CacheProvider({ basePath, children }: CacheProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export default CacheProvider;
|
|
7
|
-
//# sourceMappingURL=CacheProvider.d.ts.map
|
|
@@ -3,7 +3,6 @@ type TranslateKitConfig = {
|
|
|
3
3
|
basePath: string;
|
|
4
4
|
};
|
|
5
5
|
export type TranslateKitConfigProviderProps = PropsWithChildren<Partial<TranslateKitConfig>>;
|
|
6
|
-
export declare function TranslateKitConfigProvider({ basePath, children, }: TranslateKitConfigProviderProps): import("react").JSX.Element;
|
|
6
|
+
export declare function TranslateKitConfigProvider({ basePath, children, }: TranslateKitConfigProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export declare function useTranslateKitConfig(): TranslateKitConfig;
|
|
8
8
|
export {};
|
|
9
|
-
//# sourceMappingURL=TranslateKitConfigContext.d.ts.map
|
|
@@ -12,11 +12,9 @@ export declare function useCollectionTranslationStatus({ collection }: Props, op
|
|
|
12
12
|
error: Error;
|
|
13
13
|
isError: true;
|
|
14
14
|
isPending: false;
|
|
15
|
-
isLoading: false;
|
|
16
15
|
isLoadingError: false;
|
|
17
16
|
isRefetchError: true;
|
|
18
17
|
isSuccess: false;
|
|
19
|
-
isPlaceholderData: false;
|
|
20
18
|
status: "error";
|
|
21
19
|
dataUpdatedAt: number;
|
|
22
20
|
errorUpdatedAt: number;
|
|
@@ -26,25 +24,23 @@ export declare function useCollectionTranslationStatus({ collection }: Props, op
|
|
|
26
24
|
isFetched: boolean;
|
|
27
25
|
isFetchedAfterMount: boolean;
|
|
28
26
|
isFetching: boolean;
|
|
27
|
+
isLoading: boolean;
|
|
29
28
|
isInitialLoading: boolean;
|
|
30
29
|
isPaused: boolean;
|
|
30
|
+
isPlaceholderData: boolean;
|
|
31
31
|
isRefetching: boolean;
|
|
32
32
|
isStale: boolean;
|
|
33
|
-
isEnabled: boolean;
|
|
34
33
|
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<GroupedCollectionTranslationStatus, Error>>;
|
|
35
34
|
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
36
|
-
promise: Promise<GroupedCollectionTranslationStatus>;
|
|
37
35
|
} | {
|
|
38
36
|
invalidate: () => void;
|
|
39
37
|
data: GroupedCollectionTranslationStatus;
|
|
40
38
|
error: null;
|
|
41
39
|
isError: false;
|
|
42
40
|
isPending: false;
|
|
43
|
-
isLoading: false;
|
|
44
41
|
isLoadingError: false;
|
|
45
42
|
isRefetchError: false;
|
|
46
43
|
isSuccess: true;
|
|
47
|
-
isPlaceholderData: false;
|
|
48
44
|
status: "success";
|
|
49
45
|
dataUpdatedAt: number;
|
|
50
46
|
errorUpdatedAt: number;
|
|
@@ -54,25 +50,23 @@ export declare function useCollectionTranslationStatus({ collection }: Props, op
|
|
|
54
50
|
isFetched: boolean;
|
|
55
51
|
isFetchedAfterMount: boolean;
|
|
56
52
|
isFetching: boolean;
|
|
53
|
+
isLoading: boolean;
|
|
57
54
|
isInitialLoading: boolean;
|
|
58
55
|
isPaused: boolean;
|
|
56
|
+
isPlaceholderData: boolean;
|
|
59
57
|
isRefetching: boolean;
|
|
60
58
|
isStale: boolean;
|
|
61
|
-
isEnabled: boolean;
|
|
62
59
|
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<GroupedCollectionTranslationStatus, Error>>;
|
|
63
60
|
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
64
|
-
promise: Promise<GroupedCollectionTranslationStatus>;
|
|
65
61
|
} | {
|
|
66
62
|
invalidate: () => void;
|
|
67
63
|
data: undefined;
|
|
68
64
|
error: Error;
|
|
69
65
|
isError: true;
|
|
70
66
|
isPending: false;
|
|
71
|
-
isLoading: false;
|
|
72
67
|
isLoadingError: true;
|
|
73
68
|
isRefetchError: false;
|
|
74
69
|
isSuccess: false;
|
|
75
|
-
isPlaceholderData: false;
|
|
76
70
|
status: "error";
|
|
77
71
|
dataUpdatedAt: number;
|
|
78
72
|
errorUpdatedAt: number;
|
|
@@ -82,42 +76,14 @@ export declare function useCollectionTranslationStatus({ collection }: Props, op
|
|
|
82
76
|
isFetched: boolean;
|
|
83
77
|
isFetchedAfterMount: boolean;
|
|
84
78
|
isFetching: boolean;
|
|
79
|
+
isLoading: boolean;
|
|
85
80
|
isInitialLoading: boolean;
|
|
86
81
|
isPaused: boolean;
|
|
82
|
+
isPlaceholderData: boolean;
|
|
87
83
|
isRefetching: boolean;
|
|
88
84
|
isStale: boolean;
|
|
89
|
-
isEnabled: boolean;
|
|
90
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<GroupedCollectionTranslationStatus, Error>>;
|
|
91
|
-
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
92
|
-
promise: Promise<GroupedCollectionTranslationStatus>;
|
|
93
|
-
} | {
|
|
94
|
-
invalidate: () => void;
|
|
95
|
-
data: undefined;
|
|
96
|
-
error: null;
|
|
97
|
-
isError: false;
|
|
98
|
-
isPending: true;
|
|
99
|
-
isLoading: true;
|
|
100
|
-
isLoadingError: false;
|
|
101
|
-
isRefetchError: false;
|
|
102
|
-
isSuccess: false;
|
|
103
|
-
isPlaceholderData: false;
|
|
104
|
-
status: "pending";
|
|
105
|
-
dataUpdatedAt: number;
|
|
106
|
-
errorUpdatedAt: number;
|
|
107
|
-
failureCount: number;
|
|
108
|
-
failureReason: Error | null;
|
|
109
|
-
errorUpdateCount: number;
|
|
110
|
-
isFetched: boolean;
|
|
111
|
-
isFetchedAfterMount: boolean;
|
|
112
|
-
isFetching: boolean;
|
|
113
|
-
isInitialLoading: boolean;
|
|
114
|
-
isPaused: boolean;
|
|
115
|
-
isRefetching: boolean;
|
|
116
|
-
isStale: boolean;
|
|
117
|
-
isEnabled: boolean;
|
|
118
85
|
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<GroupedCollectionTranslationStatus, Error>>;
|
|
119
86
|
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
120
|
-
promise: Promise<GroupedCollectionTranslationStatus>;
|
|
121
87
|
} | {
|
|
122
88
|
invalidate: () => void;
|
|
123
89
|
data: undefined;
|
|
@@ -127,7 +93,6 @@ export declare function useCollectionTranslationStatus({ collection }: Props, op
|
|
|
127
93
|
isLoadingError: false;
|
|
128
94
|
isRefetchError: false;
|
|
129
95
|
isSuccess: false;
|
|
130
|
-
isPlaceholderData: false;
|
|
131
96
|
status: "pending";
|
|
132
97
|
dataUpdatedAt: number;
|
|
133
98
|
errorUpdatedAt: number;
|
|
@@ -140,40 +105,10 @@ export declare function useCollectionTranslationStatus({ collection }: Props, op
|
|
|
140
105
|
isLoading: boolean;
|
|
141
106
|
isInitialLoading: boolean;
|
|
142
107
|
isPaused: boolean;
|
|
108
|
+
isPlaceholderData: boolean;
|
|
143
109
|
isRefetching: boolean;
|
|
144
110
|
isStale: boolean;
|
|
145
|
-
isEnabled: boolean;
|
|
146
|
-
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<GroupedCollectionTranslationStatus, Error>>;
|
|
147
|
-
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
148
|
-
promise: Promise<GroupedCollectionTranslationStatus>;
|
|
149
|
-
} | {
|
|
150
|
-
invalidate: () => void;
|
|
151
|
-
data: GroupedCollectionTranslationStatus;
|
|
152
|
-
isError: false;
|
|
153
|
-
error: null;
|
|
154
|
-
isPending: false;
|
|
155
|
-
isLoading: false;
|
|
156
|
-
isLoadingError: false;
|
|
157
|
-
isRefetchError: false;
|
|
158
|
-
isSuccess: true;
|
|
159
|
-
isPlaceholderData: true;
|
|
160
|
-
status: "success";
|
|
161
|
-
dataUpdatedAt: number;
|
|
162
|
-
errorUpdatedAt: number;
|
|
163
|
-
failureCount: number;
|
|
164
|
-
failureReason: Error | null;
|
|
165
|
-
errorUpdateCount: number;
|
|
166
|
-
isFetched: boolean;
|
|
167
|
-
isFetchedAfterMount: boolean;
|
|
168
|
-
isFetching: boolean;
|
|
169
|
-
isInitialLoading: boolean;
|
|
170
|
-
isPaused: boolean;
|
|
171
|
-
isRefetching: boolean;
|
|
172
|
-
isStale: boolean;
|
|
173
|
-
isEnabled: boolean;
|
|
174
111
|
refetch: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<GroupedCollectionTranslationStatus, Error>>;
|
|
175
112
|
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
176
|
-
promise: Promise<GroupedCollectionTranslationStatus>;
|
|
177
113
|
};
|
|
178
114
|
export {};
|
|
179
|
-
//# sourceMappingURL=useCollectionTranslationStatus.d.ts.map
|