@focus-reactive/payload-plugin-translator 0.6.1 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -0
- package/dist/client/app/cache/CacheProvider.d.ts +1 -1
- package/dist/client/app/cache/CacheProvider.export.d.ts +1 -1
- package/dist/client/app/cache/CacheProvider.export.js +2 -2
- package/dist/client/app/cache/CacheProvider.js +5 -5
- package/dist/client/app/config/TranslateKitConfigContext.d.ts +1 -1
- package/dist/client/app/config/TranslateKitConfigContext.js +3 -3
- package/dist/client/app/config/index.d.ts +2 -2
- package/dist/client/app/config/index.js +1 -1
- package/dist/client/entities/translation/api/mutations/useCancelCollectionTranslations.js +7 -7
- package/dist/client/entities/translation/api/mutations/useCancelDocumentTranslation.js +7 -7
- package/dist/client/entities/translation/api/mutations/useQueueDocumentTranslation.d.ts +1 -1
- package/dist/client/entities/translation/api/mutations/useQueueDocumentTranslation.js +8 -8
- package/dist/client/entities/translation/api/mutations/useQueueDocumentTranslations.js +6 -6
- package/dist/client/entities/translation/api/mutations/useRunDocumentTranslation.js +7 -7
- package/dist/client/entities/translation/api/mutations/useTranslateField.d.ts +1 -1
- package/dist/client/entities/translation/api/queries/useCollectionTranslationStatus.d.ts +2 -2
- package/dist/client/entities/translation/api/queries/useCollectionTranslationStatus.js +9 -10
- package/dist/client/entities/translation/api/queries/useDocumentTranslation.d.ts +2 -2
- package/dist/client/entities/translation/api/queries/useDocumentTranslation.js +9 -10
- package/dist/client/entities/translation/index.d.ts +12 -12
- package/dist/client/entities/translation/index.js +11 -11
- package/dist/client/entities/translation/model/types.d.ts +1 -1
- package/dist/client/entities/translation/ui/CompletedTranslationStatus/CompletedTranslationStatus.js +12 -12
- package/dist/client/entities/translation/ui/CompletedTranslationStatus/index.d.ts +1 -1
- package/dist/client/entities/translation/ui/CompletedTranslationStatus/index.js +1 -1
- package/dist/client/entities/translation/ui/CompletedTranslationStatus/styles.module.scss +1 -1
- package/dist/client/entities/translation/ui/FailedTranslationStatus/FailedTranslationStatus.js +8 -8
- package/dist/client/entities/translation/ui/FailedTranslationStatus/index.d.ts +1 -1
- package/dist/client/entities/translation/ui/FailedTranslationStatus/index.js +1 -1
- package/dist/client/entities/translation/ui/FailedTranslationStatus/styles.module.scss +1 -1
- package/dist/client/entities/translation/ui/PendingTranslationStatus/PendingTranslationStatus.js +14 -14
- package/dist/client/entities/translation/ui/PendingTranslationStatus/index.d.ts +1 -1
- package/dist/client/entities/translation/ui/PendingTranslationStatus/index.js +1 -1
- package/dist/client/entities/translation/ui/RunningTranslationStatus/RunningTranslationStatus.js +13 -13
- package/dist/client/entities/translation/ui/RunningTranslationStatus/index.d.ts +1 -1
- package/dist/client/entities/translation/ui/RunningTranslationStatus/index.js +1 -1
- package/dist/client/entities/translation/ui/TranslationDirection/TranslationDirection.d.ts +1 -1
- package/dist/client/entities/translation/ui/TranslationDirection/TranslationDirection.js +2 -2
- package/dist/client/entities/translation/ui/TranslationDirection/index.d.ts +1 -1
- package/dist/client/entities/translation/ui/TranslationDirection/index.js +1 -1
- package/dist/client/entities/translation/ui/TranslationDirection/styles.module.scss +1 -1
- package/dist/client/features/collection-translation-form/index.client.d.ts +1 -1
- package/dist/client/features/collection-translation-form/index.client.js +1 -1
- package/dist/client/features/collection-translation-form/index.d.ts +3 -3
- package/dist/client/features/collection-translation-form/index.js +2 -2
- package/dist/client/features/collection-translation-form/model/constants.d.ts +1 -1
- package/dist/client/features/collection-translation-form/model/constants.js +9 -9
- package/dist/client/features/collection-translation-form/model/form-model.d.ts +1 -1
- package/dist/client/features/collection-translation-form/model/index.d.ts +1 -1
- package/dist/client/features/collection-translation-form/model/index.js +1 -1
- package/dist/client/features/collection-translation-form/model/schema.d.ts +1 -1
- package/dist/client/features/collection-translation-form/model/schema.js +6 -6
- package/dist/client/features/collection-translation-form/ui/CollectionTranslationForm.d.ts +1 -1
- package/dist/client/features/collection-translation-form/ui/index.d.ts +1 -1
- package/dist/client/features/collection-translation-form/ui/index.js +1 -1
- package/dist/client/features/collection-translation-form/ui/styles.module.scss +1 -1
- package/dist/client/features/collection-translation-popup/index.d.ts +1 -1
- package/dist/client/features/collection-translation-popup/index.js +1 -1
- package/dist/client/features/collection-translation-popup/ui/CollectionTranslationPopup.d.ts +1 -1
- package/dist/client/features/collection-translation-popup/ui/styles.module.scss +1 -1
- package/dist/client/features/collection-translation-progress/index.d.ts +1 -1
- package/dist/client/features/collection-translation-progress/index.js +1 -1
- package/dist/client/features/collection-translation-progress/ui/CollectionTranslationProgress.d.ts +2 -2
- package/dist/client/features/collection-translation-progress/ui/CollectionTranslationProgress.js +13 -13
- package/dist/client/features/collection-translation-progress/ui/styles.module.scss +1 -1
- package/dist/client/features/document-translation-progress-failed/index.d.ts +1 -1
- package/dist/client/features/document-translation-progress-failed/index.js +1 -1
- package/dist/client/features/document-translation-progress-failed/ui/DocumentTranslationProgressFailed.d.ts +2 -2
- package/dist/client/features/document-translation-progress-failed/ui/DocumentTranslationProgressFailed.js +3 -3
- package/dist/client/features/document-translation-progress-pending/index.d.ts +1 -1
- package/dist/client/features/document-translation-progress-pending/index.js +1 -1
- package/dist/client/features/document-translation-progress-pending/ui/DocumentTranslationProgressPending.d.ts +2 -2
- package/dist/client/features/document-translation-progress-pending/ui/DocumentTranslationProgressPending.js +5 -5
- package/dist/client/features/document-translation-progress-running/index.d.ts +1 -1
- package/dist/client/features/document-translation-progress-running/index.js +1 -1
- package/dist/client/features/document-translation-progress-running/ui/DocumentTranslationProgressRunning.d.ts +2 -2
- package/dist/client/features/document-translation-progress-running/ui/DocumentTranslationProgressRunning.js +3 -3
- package/dist/client/features/open-document-translation-popup/index.d.ts +1 -1
- package/dist/client/features/open-document-translation-popup/index.js +1 -1
- package/dist/client/features/open-document-translation-popup/ui/styles.module.scss +1 -1
- package/dist/client/features/translate-document-form/index.client.d.ts +1 -1
- package/dist/client/features/translate-document-form/index.client.js +1 -1
- package/dist/client/features/translate-document-form/index.d.ts +3 -3
- package/dist/client/features/translate-document-form/index.js +2 -2
- package/dist/client/features/translate-document-form/model/constants.d.ts +1 -1
- package/dist/client/features/translate-document-form/model/constants.js +11 -11
- package/dist/client/features/translate-document-form/model/form-model.d.ts +1 -1
- package/dist/client/features/translate-document-form/model/index.d.ts +1 -1
- package/dist/client/features/translate-document-form/model/index.js +1 -1
- package/dist/client/features/translate-document-form/model/schema.d.ts +1 -1
- package/dist/client/features/translate-document-form/model/schema.js +5 -5
- package/dist/client/features/translate-document-form/ui/DocumentTranslationForm.d.ts +1 -1
- package/dist/client/features/translate-document-form/ui/index.d.ts +1 -1
- package/dist/client/features/translate-document-form/ui/index.js +1 -1
- package/dist/client/features/translate-document-form/ui/styles.module.scss +1 -1
- package/dist/client/shared/lib/errors/handleApiError.d.ts +1 -1
- package/dist/client/shared/lib/errors/handleApiError.js +2 -2
- package/dist/client/shared/lib/forms/handle-form-error.d.ts +1 -1
- package/dist/client/shared/lib/forms/handle-form-error.js +6 -6
- package/dist/client/shared/lib/payload/hooks/useCollectionDashboardUrlParams.d.ts +1 -1
- package/dist/client/shared/lib/payload/hooks/useCollectionDashboardUrlParams.js +1 -1
- package/dist/client/shared/lib/payload/hooks/useCollectionDocumentUrlParams.d.ts +1 -1
- package/dist/client/shared/lib/payload/hooks/useCollectionDocumentUrlParams.js +2 -2
- package/dist/client/shared/lib/payload/hooks/useLocaleOptions.js +2 -2
- package/dist/client/shared/lib/utils/errors/handleApiError.d.ts +1 -1
- package/dist/client/shared/lib/utils/errors/handleApiError.js +2 -2
- package/dist/client/shared/lib/utils/react/useToggle.js +1 -1
- package/dist/client/shared/providers/CacheClientProvider/CacheClientProvider.factory.d.ts +2 -2
- package/dist/client/shared/providers/CacheClientProvider/CacheClientProvider.factory.js +3 -3
- package/dist/client/shared/providers/CacheClientProvider/index.d.ts +1 -1
- package/dist/client/shared/providers/CacheClientProvider/index.js +1 -1
- package/dist/client/shared/types/AccessGuard.d.ts +1 -1
- package/dist/client/shared/ui/Alert/Alert.d.ts +2 -2
- package/dist/client/shared/ui/Alert/Alert.js +18 -18
- package/dist/client/shared/ui/Alert/index.d.ts +1 -1
- package/dist/client/shared/ui/Alert/index.js +1 -1
- package/dist/client/shared/ui/Alert/styles.module.scss +1 -1
- package/dist/client/shared/ui/Button/index.d.ts +1 -1
- package/dist/client/shared/ui/Button/index.js +1 -1
- package/dist/client/shared/ui/Button/styles.module.scss +6 -3
- package/dist/client/shared/ui/Checkbox/Checkbox.d.ts +2 -2
- package/dist/client/shared/ui/Checkbox/Checkbox.js +4 -4
- package/dist/client/shared/ui/Checkbox/index.d.ts +1 -1
- package/dist/client/shared/ui/Checkbox/index.js +1 -1
- package/dist/client/shared/ui/Checkbox/styles.module.scss +1 -1
- package/dist/client/shared/ui/ColorIndicator/ColorIndicator.d.ts +2 -2
- package/dist/client/shared/ui/ColorIndicator/ColorIndicator.js +2 -2
- package/dist/client/shared/ui/ColorIndicator/index.d.ts +1 -1
- package/dist/client/shared/ui/ColorIndicator/index.js +1 -1
- package/dist/client/shared/ui/ColorIndicator/styles.module.scss +1 -1
- package/dist/client/shared/ui/Description/Description.d.ts +3 -3
- package/dist/client/shared/ui/Description/Description.js +4 -4
- package/dist/client/shared/ui/Description/index.d.ts +1 -1
- package/dist/client/shared/ui/Description/index.js +1 -1
- package/dist/client/shared/ui/Description/styles.module.scss +1 -1
- package/dist/client/shared/ui/Divider/Divider.d.ts +4 -4
- package/dist/client/shared/ui/Divider/Divider.js +4 -4
- package/dist/client/shared/ui/Divider/index.d.ts +1 -1
- package/dist/client/shared/ui/Divider/index.js +1 -1
- package/dist/client/shared/ui/Divider/styles.module.scss +1 -1
- package/dist/client/shared/ui/Label/Label.d.ts +2 -2
- package/dist/client/shared/ui/Label/Label.js +3 -3
- package/dist/client/shared/ui/Label/index.d.ts +1 -1
- package/dist/client/shared/ui/Label/index.js +1 -1
- package/dist/client/shared/ui/Label/styles.module.scss +1 -1
- package/dist/client/shared/ui/Loading/Loading.d.ts +1 -1
- package/dist/client/shared/ui/Loading/Loading.js +9 -9
- package/dist/client/shared/ui/Loading/index.d.ts +1 -1
- package/dist/client/shared/ui/Loading/index.js +1 -1
- package/dist/client/shared/ui/Loading/styles.module.scss +2 -2
- package/dist/client/shared/ui/Popup/Popup.d.ts +1 -1
- package/dist/client/shared/ui/Popup/index.d.ts +1 -1
- package/dist/client/shared/ui/Popup/index.js +1 -1
- package/dist/client/shared/ui/Popup/styles.module.scss +1 -1
- package/dist/client/shared/ui/ProgressBar/ProgressBar.d.ts +2 -2
- package/dist/client/shared/ui/ProgressBar/ProgressBar.js +3 -3
- package/dist/client/shared/ui/ProgressBar/index.d.ts +1 -1
- package/dist/client/shared/ui/ProgressBar/index.js +1 -1
- package/dist/client/shared/ui/ProgressBar/styles.module.scss +1 -1
- package/dist/client/shared/ui/Select/index.d.ts +1 -1
- package/dist/client/shared/ui/Select/index.js +1 -1
- package/dist/client/shared/ui/Select/styles.module.scss +1 -1
- package/dist/client/shared/ui/StatusCounter/StatusCounter.d.ts +2 -2
- package/dist/client/shared/ui/StatusCounter/StatusCounter.js +13 -13
- package/dist/client/shared/ui/StatusCounter/index.d.ts +1 -1
- package/dist/client/shared/ui/StatusCounter/index.js +1 -1
- package/dist/client/shared/ui/StatusCounter/styles.module.scss +1 -1
- package/dist/client/shared/ui/StatusIndicator/StatusIndicator.d.ts +3 -3
- package/dist/client/shared/ui/StatusIndicator/StatusIndicator.js +4 -4
- package/dist/client/shared/ui/StatusIndicator/index.d.ts +1 -1
- package/dist/client/shared/ui/StatusIndicator/index.js +1 -1
- package/dist/client/shared/ui/StatusIndicator/styles.module.scss +1 -1
- package/dist/client/shared/ui/Tooltip/Tooltip.d.ts +2 -2
- package/dist/client/shared/ui/Tooltip/Tooltip.js +4 -4
- package/dist/client/shared/ui/Tooltip/index.d.ts +1 -1
- package/dist/client/shared/ui/Tooltip/index.js +1 -1
- package/dist/client/shared/ui/Tooltip/styles.module.scss +5 -5
- package/dist/client/shared/ui/form/FormCheckbox/FormCheckbox.d.ts +1 -1
- package/dist/client/shared/ui/form/FormCheckbox/FormCheckbox.js +6 -6
- package/dist/client/shared/ui/form/FormCheckbox/index.d.ts +1 -1
- package/dist/client/shared/ui/form/FormCheckbox/index.js +1 -1
- package/dist/client/shared/ui/form/FormCheckbox/styles.module.scss +1 -1
- package/dist/client/shared/ui/form/FormCheckboxPublish/FormCheckboxPublish.js +5 -5
- package/dist/client/shared/ui/form/FormCheckboxPublish/index.d.ts +1 -1
- package/dist/client/shared/ui/form/FormCheckboxPublish/index.js +1 -1
- package/dist/client/shared/ui/form/FormCheckboxPublish/styles.module.scss +1 -1
- package/dist/client/shared/ui/form/FormSelect/FormSelect.d.ts +5 -5
- package/dist/client/shared/ui/form/FormSelect/FormSelect.js +9 -9
- package/dist/client/shared/ui/form/FormSelect/index.d.ts +1 -1
- package/dist/client/shared/ui/form/FormSelect/index.js +1 -1
- package/dist/client/shared/ui/form/FormSelectLocale/FormSelectLocale.d.ts +1 -1
- package/dist/client/shared/ui/form/FormSelectLocale/FormSelectLocale.js +2 -2
- package/dist/client/shared/ui/form/FormSelectLocale/index.d.ts +1 -1
- package/dist/client/shared/ui/form/FormSelectLocale/index.js +1 -1
- package/dist/client/shared/ui/form/FormSelectStrategy/FormSelectStrategy.d.ts +2 -2
- package/dist/client/shared/ui/form/FormSelectStrategy/FormSelectStrategy.js +9 -9
- package/dist/client/shared/ui/form/FormSelectStrategy/index.d.ts +2 -2
- package/dist/client/shared/ui/form/FormSelectStrategy/index.js +1 -1
- package/dist/client/shared/ui/form/FormSelectStrategy/styles.module.scss +1 -1
- package/dist/client/shared/utils/componentPath.js +1 -1
- package/dist/client/widgets/bulk-translation-dashboard/index.d.ts +1 -1
- package/dist/client/widgets/bulk-translation-dashboard/index.js +1 -1
- package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.export.d.ts +2 -2
- package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.export.js +3 -3
- package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.js +11 -11
- package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.server.d.ts +2 -2
- package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.server.js +3 -3
- package/dist/client/widgets/bulk-translation-dashboard/ui/index.d.ts +1 -1
- package/dist/client/widgets/bulk-translation-dashboard/ui/index.js +1 -1
- package/dist/client/widgets/translate-document/index.d.ts +1 -1
- package/dist/client/widgets/translate-document/index.js +1 -1
- package/dist/client/widgets/translate-document/ui/TranslateDocument.export.d.ts +3 -3
- package/dist/client/widgets/translate-document/ui/TranslateDocument.export.js +3 -3
- package/dist/client/widgets/translate-document/ui/TranslateDocument.js +16 -16
- package/dist/client/widgets/translate-document/ui/TranslateDocument.server.d.ts +2 -2
- package/dist/client/widgets/translate-document/ui/TranslateDocument.server.js +3 -3
- package/dist/client/widgets/translate-document/ui/index.d.ts +1 -1
- package/dist/client/widgets/translate-document/ui/index.js +1 -1
- package/dist/client/widgets/translate-field-control/ui/TranslateFieldControl.export.d.ts +1 -1
- package/dist/client/widgets/translate-field-control/ui/styles.module.scss +1 -1
- package/dist/{server/modules/translation-levels → composition/levels}/collectionLevel.d.ts +1 -1
- package/dist/{server/modules/translation-levels → composition/levels}/collectionLevel.js +1 -1
- package/dist/{server/modules/translation-levels → composition/levels}/documentLevel.d.ts +1 -1
- package/dist/{server/modules/translation-levels → composition/levels}/documentLevel.js +1 -1
- package/dist/{server/modules/translation-levels → composition/levels}/fieldLevel.d.ts +1 -1
- package/dist/{server/modules/translation-levels → composition/levels}/fieldLevel.js +1 -1
- package/dist/composition/levels/index.d.ts +3 -0
- package/dist/composition/levels/index.js +5 -0
- package/dist/{server/modules/translation-levels → composition/levels}/useDocTranslationApi.d.ts +1 -1
- package/dist/{server/modules/translation-levels → composition/levels}/useDocTranslationApi.js +1 -1
- package/dist/core/content-projection/computeSourceFingerprint.d.ts +15 -0
- package/dist/core/content-projection/computeSourceFingerprint.js +19 -0
- package/dist/core/content-projection/contentProjector.d.ts +28 -0
- package/dist/core/content-projection/contentProjector.js +97 -0
- package/dist/core/content-projection/fingerprinter.d.ts +28 -0
- package/dist/core/content-projection/fingerprinter.js +29 -0
- package/dist/core/content-projection/idPath.d.ts +48 -0
- package/dist/core/content-projection/idPath.js +64 -0
- package/dist/core/content-projection/translatableLeaf.d.ts +27 -0
- package/dist/core/content-projection/translatableLeaf.js +37 -0
- package/dist/core/field-config/getFieldConfig.d.ts +23 -0
- package/dist/{server/shared → core}/field-config/getFieldConfig.js +5 -5
- package/dist/{server/shared → core}/field-config/index.d.ts +3 -3
- package/dist/core/field-config/index.js +4 -0
- package/dist/{server/shared → core}/field-traversal/findFieldByPath.d.ts +2 -3
- package/dist/core/field-traversal/guards.d.ts +19 -0
- package/dist/core/field-traversal/guards.js +20 -0
- package/dist/core/field-traversal/index.d.ts +7 -0
- package/dist/core/field-traversal/index.js +7 -0
- package/dist/{server/shared → core}/field-traversal/kernel.d.ts +7 -8
- package/dist/{server/shared → core}/field-traversal/kernel.js +6 -6
- package/dist/core/field-traversal/predicates.d.ts +24 -0
- package/dist/core/field-traversal/predicates.js +17 -0
- package/dist/{server/shared → core}/field-traversal/types.d.ts +129 -27
- package/dist/{server/shared → core}/field-traversal/types.js +6 -0
- package/dist/{server/shared → core}/field-traversal/walkFields.d.ts +2 -3
- package/dist/core/index.d.ts +12 -0
- package/dist/core/index.js +15 -0
- package/dist/{server/shared → core}/lexical/collectTextNodes.d.ts +1 -1
- package/dist/{server/shared → core}/lexical/collectTextNodes.js +1 -1
- package/dist/{server/shared → core}/lexical/guards.d.ts +1 -1
- package/dist/{server/shared → core}/lexical/guards.js +4 -4
- package/dist/core/lexical/index.d.ts +6 -0
- package/dist/core/lexical/index.js +6 -0
- package/dist/{server/shared → core}/lexical/isEmptyRichText.d.ts +1 -1
- package/dist/{server/shared → core}/lexical/isEmptyRichText.js +3 -3
- package/dist/{server/shared → core}/lexical/traverseLexicalTree.d.ts +1 -1
- package/dist/{server/shared → core}/lexical/traverseLexicalTree.js +1 -1
- package/dist/core/lexical/types.d.ts +33 -0
- package/dist/core/lexical/types.js +11 -0
- package/dist/core/provenance/ProvenanceStore.interface.d.ts +99 -0
- package/dist/core/provenance/ProvenanceStore.interface.js +37 -0
- package/dist/core/provenance/index.d.ts +1 -0
- package/dist/core/provenance/index.js +5 -0
- package/dist/{server/modules → core}/translation-pipeline/TranslationPipeline.d.ts +4 -4
- package/dist/{server/modules → core}/translation-pipeline/TranslationPipeline.js +1 -1
- package/dist/{server/modules → core}/translation-pipeline/stages/data-reconciler/DataReconciler.d.ts +2 -2
- package/dist/{server/modules → core}/translation-pipeline/stages/data-reconciler/DataReconciler.js +3 -2
- package/dist/core/translation-pipeline/stages/data-reconciler/index.d.ts +2 -0
- package/dist/core/translation-pipeline/stages/data-reconciler/index.js +4 -0
- package/dist/{server/modules → core}/translation-pipeline/stages/field-collector/FieldChunkCollector.d.ts +2 -2
- package/dist/{server/modules → core}/translation-pipeline/stages/field-collector/FieldChunkCollector.js +18 -4
- package/dist/{server/modules → core}/translation-pipeline/stages/field-collector/FieldChunkCollector.stage.d.ts +2 -2
- package/dist/{server/modules → core}/translation-pipeline/stages/field-collector/FieldChunkCollector.stage.js +2 -2
- package/dist/core/translation-pipeline/stages/field-collector/index.d.ts +2 -0
- package/dist/core/translation-pipeline/stages/field-collector/index.js +4 -0
- package/dist/core/translation-pipeline/stages/index.d.ts +6 -0
- package/dist/core/translation-pipeline/stages/index.js +7 -0
- package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/PlainTextExpander.d.ts +2 -2
- package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/PlainTextExpander.js +2 -2
- package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/RichTextExpander.d.ts +2 -2
- package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/RichTextExpander.js +3 -3
- package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/TextChunkExpander.d.ts +2 -2
- package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/TextChunkExpander.stage.d.ts +2 -2
- package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/TextChunkExpander.stage.js +4 -4
- package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/TextExpander.interface.d.ts +1 -1
- package/dist/core/translation-pipeline/stages/text-expander/index.d.ts +6 -0
- package/dist/core/translation-pipeline/stages/text-expander/index.js +6 -0
- package/dist/{server/modules → core}/translation-pipeline/stages/translation/Translation.stage.d.ts +2 -2
- package/dist/{server/modules → core}/translation-pipeline/stages/translation/Translation.stage.js +1 -1
- package/dist/core/translation-pipeline/stages/translation/index.d.ts +1 -0
- package/dist/core/translation-pipeline/stages/translation/index.js +3 -0
- package/dist/{server/modules → core}/translation-pipeline/stages/translation-applicator/TranslationMutator.d.ts +1 -1
- package/dist/{server/modules → core}/translation-pipeline/stages/translation-applicator/TranslationMutator.js +1 -1
- package/dist/{server/modules → core}/translation-pipeline/stages/translation-applicator/TranslationMutator.stage.d.ts +1 -1
- package/dist/{server/modules → core}/translation-pipeline/stages/translation-applicator/TranslationMutator.stage.js +2 -2
- package/dist/core/translation-pipeline/stages/translation-applicator/index.d.ts +2 -0
- package/dist/core/translation-pipeline/stages/translation-applicator/index.js +4 -0
- package/dist/{server/modules → core}/translation-pipeline/strategies/Overwrite.strategy.d.ts +1 -1
- package/dist/{server/modules → core}/translation-pipeline/strategies/Overwrite.strategy.js +1 -1
- package/dist/{server/modules → core}/translation-pipeline/strategies/SkipExisting.strategy.d.ts +1 -1
- package/dist/{server/modules → core}/translation-pipeline/strategies/SkipExisting.strategy.js +3 -1
- package/dist/core/translation-pipeline/strategies/index.d.ts +13 -0
- package/dist/{server/modules → core}/translation-pipeline/strategies/index.js +4 -4
- package/dist/{server/modules → core}/translation-pipeline/translateContent.d.ts +2 -2
- package/dist/{server/modules → core}/translation-pipeline/types/FieldChunk.d.ts +3 -3
- package/dist/{server/modules → core}/translation-pipeline/types/Pipeline.d.ts +2 -2
- package/dist/{server/modules → core}/translation-pipeline/types/PipelineContext.d.ts +4 -4
- package/dist/{server/modules → core}/translation-pipeline/types/TextChunk.d.ts +3 -3
- package/dist/{server/modules → core}/translation-pipeline/types/TextChunk.js +2 -2
- package/dist/core/translation-pipeline/types/index.d.ts +5 -0
- package/dist/core/translation-pipeline/types/index.js +3 -0
- package/dist/core/translation-providers/index.d.ts +1 -0
- package/dist/core/translation-providers/index.js +5 -0
- package/dist/core/utils/index.d.ts +2 -0
- package/dist/core/utils/index.js +4 -0
- package/dist/{server/shared → core}/utils/isEmpty.js +2 -2
- package/dist/{server/shared → core}/utils/isObject.js +1 -1
- package/dist/field-actions.d.ts +1 -1
- package/dist/field-config.d.ts +1 -1
- package/dist/field-config.js +1 -1
- package/dist/index.d.ts +7 -4
- package/dist/index.js +4 -4
- package/dist/plugin.d.ts +27 -1
- package/dist/plugin.js +56 -16
- package/dist/server/features/_lib/collection-utils.d.ts +1 -1
- package/dist/server/features/_lib/index.d.ts +1 -1
- package/dist/server/features/_lib/index.js +1 -1
- package/dist/server/features/cancel/index.d.ts +1 -1
- package/dist/server/features/cancel/index.js +1 -1
- package/dist/server/features/cancel-by-collection/index.d.ts +1 -1
- package/dist/server/features/cancel-by-collection/index.js +1 -1
- package/dist/server/features/cancel-by-collection/model.d.ts +2 -2
- package/dist/server/features/cancel-by-collection/model.js +1 -1
- package/dist/server/features/createTranslationRoutes.d.ts +1 -1
- package/dist/server/features/enqueue-translation/index.d.ts +1 -1
- package/dist/server/features/enqueue-translation/index.js +1 -1
- package/dist/server/features/enqueue-translation/model.d.ts +2 -2
- package/dist/server/features/enqueue-translation/model.js +4 -4
- package/dist/server/features/get-collection-status/index.d.ts +1 -1
- package/dist/server/features/get-collection-status/index.js +1 -1
- package/dist/server/features/get-collection-status/model.d.ts +3 -3
- package/dist/server/features/get-collection-status/model.js +1 -1
- package/dist/server/features/get-document-status/index.d.ts +2 -2
- package/dist/server/features/get-document-status/index.js +2 -2
- package/dist/server/features/run-translation/index.d.ts +1 -1
- package/dist/server/features/run-translation/index.js +1 -1
- package/dist/server/features/translate-document/handler.d.ts +6 -3
- package/dist/server/features/translate-document/handler.js +28 -2
- package/dist/server/features/translate-document/index.d.ts +1 -1
- package/dist/server/features/translate-document/model.d.ts +2 -7
- package/dist/server/features/translate-document/model.js +1 -2
- package/dist/server/features/translate-field/handler.js +1 -1
- package/dist/server/features/translate-field/index.d.ts +2 -1
- package/dist/server/features/translate-field/model.d.ts +2 -19
- package/dist/server/features/translate-field/resolveFieldSubtree.js +1 -1
- package/dist/server/features/translate-field/route.d.ts +1 -1
- package/dist/server/index.d.ts +3 -3
- package/dist/server/index.js +3 -3
- package/dist/server/modules/index.d.ts +2 -2
- package/dist/server/modules/index.js +2 -2
- package/dist/server/modules/lifecycle/LifecycleNotifier.d.ts +21 -0
- package/dist/server/modules/lifecycle/LifecycleNotifier.js +38 -0
- package/dist/server/modules/lifecycle/index.d.ts +4 -0
- package/dist/server/modules/lifecycle/index.js +7 -0
- package/dist/server/modules/lifecycle/taskMapping.d.ts +7 -0
- package/dist/server/modules/lifecycle/taskMapping.js +16 -0
- package/dist/server/modules/lifecycle/types.d.ts +45 -0
- package/dist/server/modules/lifecycle/types.js +21 -0
- package/dist/server/modules/lifecycle/withQueuedNotification.d.ts +9 -0
- package/dist/server/modules/lifecycle/withQueuedNotification.js +19 -0
- package/dist/server/modules/provenance/PayloadProvenanceStore.d.ts +21 -0
- package/dist/server/modules/provenance/PayloadProvenanceStore.js +109 -0
- package/dist/server/modules/provenance/index.d.ts +5 -0
- package/dist/server/modules/provenance/index.js +8 -0
- package/dist/server/modules/provenance/provenanceCleanupHook.d.ts +18 -0
- package/dist/server/modules/provenance/provenanceCleanupHook.js +41 -0
- package/dist/server/modules/provenance/provenanceCollection.d.ts +23 -0
- package/dist/server/modules/provenance/provenanceCollection.js +82 -0
- package/dist/server/modules/provenance/slugGuard.d.ts +16 -0
- package/dist/server/modules/provenance/slugGuard.js +19 -0
- package/dist/server/modules/task-runner/TaskRunner.interface.d.ts +2 -2
- package/dist/server/modules/task-runner/TaskRunnerProvider.interface.d.ts +1 -1
- package/dist/server/modules/task-runner/index.d.ts +1 -1
- package/dist/server/modules/task-runner/payload-jobs-runner/index.d.ts +2 -2
- package/dist/server/modules/task-runner/payload-jobs-runner/index.js +1 -1
- package/dist/server/modules/task-runner/sync-runner/index.d.ts +1 -1
- package/dist/server/modules/task-runner/sync-runner/index.js +1 -1
- package/dist/server/modules/translation-levels/PluginConfigBuilder.d.ts +3 -3
- package/dist/server/modules/translation-levels/index.d.ts +1 -4
- package/dist/server/modules/translation-levels/index.js +1 -3
- package/dist/server/modules/translation-levels/types.d.ts +3 -3
- package/dist/server/shared/access/AnyAccessGuard.d.ts +1 -1
- package/dist/server/shared/access/handler.d.ts +1 -1
- package/dist/server/shared/access/index.d.ts +3 -3
- package/dist/server/shared/access/index.js +1 -1
- package/dist/server/shared/access/types.d.ts +1 -1
- package/dist/server/shared/guards/collection-guards.d.ts +1 -1
- package/dist/server/shared/guards/collection-guards.js +2 -2
- package/dist/server/shared/guards/field-guards.d.ts +9 -20
- package/dist/server/shared/guards/field-guards.js +5 -20
- package/dist/server/shared/guards/index.d.ts +3 -3
- package/dist/server/shared/guards/index.js +2 -2
- package/dist/server/shared/http/ServerResponse.js +15 -15
- package/dist/server/shared/http/index.d.ts +3 -3
- package/dist/server/shared/http/index.js +3 -3
- package/dist/server/shared/http/withAccessCheck.d.ts +2 -2
- package/dist/server/shared/http/withAccessCheck.js +1 -1
- package/dist/server/shared/http/withErrorHandler.js +3 -3
- package/dist/server/shared/index.d.ts +6 -5
- package/dist/server/shared/index.js +4 -3
- package/dist/server/shared/utils/filterLocalizedFields.js +2 -2
- package/dist/server/shared/utils/getByPath.js +2 -2
- package/dist/server/shared/utils/index.d.ts +9 -9
- package/dist/server/shared/utils/index.js +8 -8
- package/dist/server/shared/utils/normalizePath.js +3 -3
- package/dist/server/shared/utils/setByPath.js +2 -2
- package/dist/translation-providers/index.d.ts +2 -0
- package/dist/translation-providers/index.js +10 -0
- package/dist/{server/modules/translation-providers → translation-providers/openai}/OpenAITranslation.provider.d.ts +1 -1
- package/dist/{server/modules/translation-providers → translation-providers/openai}/OpenAITranslation.provider.js +1 -1
- package/dist/translation-providers/openai/index.d.ts +1 -0
- package/dist/translation-providers/openai/index.js +5 -0
- package/dist/types/CollectionSchemaMap.d.ts +6 -0
- package/dist/types/CollectionSchemaMap.js +6 -0
- package/dist/{client/shared/types → types}/PayloadComponentExport.d.ts +1 -1
- package/dist/types/index.d.ts +4 -1
- package/dist/types/wire/field-translation.d.ts +17 -0
- package/dist/types/wire/field-translation.js +7 -0
- package/package.json +3 -1
- package/dist/server/modules/translation-pipeline/stages/data-reconciler/index.d.ts +0 -2
- package/dist/server/modules/translation-pipeline/stages/data-reconciler/index.js +0 -4
- package/dist/server/modules/translation-pipeline/stages/field-collector/index.d.ts +0 -2
- package/dist/server/modules/translation-pipeline/stages/field-collector/index.js +0 -4
- package/dist/server/modules/translation-pipeline/stages/index.d.ts +0 -6
- package/dist/server/modules/translation-pipeline/stages/index.js +0 -7
- package/dist/server/modules/translation-pipeline/stages/text-expander/index.d.ts +0 -6
- package/dist/server/modules/translation-pipeline/stages/text-expander/index.js +0 -6
- package/dist/server/modules/translation-pipeline/stages/translation/index.d.ts +0 -1
- package/dist/server/modules/translation-pipeline/stages/translation/index.js +0 -3
- package/dist/server/modules/translation-pipeline/stages/translation-applicator/index.d.ts +0 -2
- package/dist/server/modules/translation-pipeline/stages/translation-applicator/index.js +0 -4
- package/dist/server/modules/translation-pipeline/strategies/index.d.ts +0 -13
- package/dist/server/modules/translation-pipeline/types/index.d.ts +0 -5
- package/dist/server/modules/translation-pipeline/types/index.js +0 -3
- package/dist/server/modules/translation-providers/index.d.ts +0 -2
- package/dist/server/modules/translation-providers/index.js +0 -3
- package/dist/server/shared/field-config/getFieldConfig.d.ts +0 -20
- package/dist/server/shared/field-config/index.js +0 -4
- package/dist/server/shared/field-traversal/index.d.ts +0 -5
- package/dist/server/shared/field-traversal/index.js +0 -5
- package/dist/server/shared/lexical/index.d.ts +0 -6
- package/dist/server/shared/lexical/index.js +0 -6
- package/dist/server/shared/lexical/types.d.ts +0 -19
- package/dist/server/shared/lexical/types.js +0 -8
- /package/dist/{server/shared → core}/field-config/types.d.ts +0 -0
- /package/dist/{server/shared → core}/field-config/types.js +0 -0
- /package/dist/{server/shared → core}/field-traversal/findFieldByPath.js +0 -0
- /package/dist/{server/shared → core}/field-traversal/walkFields.js +0 -0
- /package/dist/{server/modules → core}/translation-pipeline/index.d.ts +0 -0
- /package/dist/{server/modules → core}/translation-pipeline/index.js +0 -0
- /package/dist/{server/modules → core}/translation-pipeline/stages/data-reconciler/DataReconciler.stage.d.ts +0 -0
- /package/dist/{server/modules → core}/translation-pipeline/stages/data-reconciler/DataReconciler.stage.js +0 -0
- /package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/TextChunkExpander.js +0 -0
- /package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/TextExpander.interface.js +0 -0
- /package/dist/{server/modules → core}/translation-pipeline/strategies/TranslationStrategy.interface.d.ts +0 -0
- /package/dist/{server/modules → core}/translation-pipeline/strategies/TranslationStrategy.interface.js +0 -0
- /package/dist/{server/modules → core}/translation-pipeline/translateContent.js +0 -0
- /package/dist/{server/modules → core}/translation-pipeline/types/FieldChunk.js +0 -0
- /package/dist/{server/modules → core}/translation-pipeline/types/Pipeline.js +0 -0
- /package/dist/{server/modules → core}/translation-pipeline/types/PipelineContext.js +0 -0
- /package/dist/{server/modules → core}/translation-providers/TranslationProvider.interface.d.ts +0 -0
- /package/dist/{server/modules → core}/translation-providers/TranslationProvider.interface.js +0 -0
- /package/dist/{server/shared → core}/utils/isEmpty.d.ts +0 -0
- /package/dist/{server/shared → core}/utils/isObject.d.ts +0 -0
- /package/dist/{client/shared/types → types}/PayloadComponentExport.js +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const PACKAGE_NAME =
|
|
1
|
+
const PACKAGE_NAME = "@focus-reactive/payload-plugin-translator";
|
|
2
2
|
/**
|
|
3
3
|
* Creates a full path to a client component for Payload's import map.
|
|
4
4
|
* @param relativePath - Path relative to the client folder (e.g., 'widgets/translate-document/ui/TranslateDocument.server')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { BulkDocumentTranslationDashboard } from
|
|
1
|
+
export { BulkDocumentTranslationDashboard } from "./ui/BulkTranslationDashboard.export";
|
package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.export.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AccessGuard } from
|
|
2
|
-
import type { RawPayloadComponentExport } from
|
|
1
|
+
import type { AccessGuard } from "../../../../types/AccessGuard";
|
|
2
|
+
import type { RawPayloadComponentExport } from "../../../../types/PayloadComponentExport";
|
|
3
3
|
export declare class BulkDocumentTranslationDashboard implements RawPayloadComponentExport {
|
|
4
4
|
readonly access: AccessGuard;
|
|
5
5
|
serverProps?: object | Record<string, any> | undefined;
|
package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.export.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { AnyAccessGuard } from
|
|
2
|
-
import { clientComponentPath } from
|
|
1
|
+
import { AnyAccessGuard } from "../../../../server/shared";
|
|
2
|
+
import { clientComponentPath } from "../../../shared/utils/componentPath";
|
|
3
3
|
export class BulkDocumentTranslationDashboard {
|
|
4
4
|
access;
|
|
5
5
|
serverProps;
|
|
6
6
|
constructor(access = new AnyAccessGuard()){
|
|
7
7
|
this.access = access;
|
|
8
|
-
this.path = clientComponentPath(
|
|
8
|
+
this.path = clientComponentPath("widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.server");
|
|
9
9
|
this.serverProps = {
|
|
10
10
|
access
|
|
11
11
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { toast, useLocale, useSelection } from
|
|
4
|
-
import { SelectAllStatus } from
|
|
5
|
-
import { useEffect, useMemo } from
|
|
6
|
-
import { TranslationsApi } from
|
|
7
|
-
import { CollectionTranslationForm, FORM_FIELDS } from
|
|
8
|
-
import { CollectionTranslationFormModel } from
|
|
9
|
-
import CollectionTranslationPopup from
|
|
10
|
-
import { CollectionTranslationProgress } from
|
|
11
|
-
import { handleFormError } from
|
|
12
|
-
import { useCollectionDashboardUrlParams } from
|
|
3
|
+
import { toast, useLocale, useSelection } from "@payloadcms/ui";
|
|
4
|
+
import { SelectAllStatus } from "@payloadcms/ui/providers/Selection";
|
|
5
|
+
import { useEffect, useMemo } from "react";
|
|
6
|
+
import { TranslationsApi } from "../../../entities/translation";
|
|
7
|
+
import { CollectionTranslationForm, FORM_FIELDS } from "../../../features/collection-translation-form";
|
|
8
|
+
import { CollectionTranslationFormModel } from "../../../features/collection-translation-form/index.client";
|
|
9
|
+
import CollectionTranslationPopup from "../../../features/collection-translation-popup";
|
|
10
|
+
import { CollectionTranslationProgress } from "../../../features/collection-translation-progress";
|
|
11
|
+
import { handleFormError } from "../../../shared/lib/forms/handle-form-error";
|
|
12
|
+
import { useCollectionDashboardUrlParams } from "../../../shared/lib/payload/hooks/useCollectionDashboardUrlParams";
|
|
13
13
|
export default function BulkTranslationDashboard({ hasDrafts }) {
|
|
14
14
|
const locale = useLocale();
|
|
15
15
|
const { collection } = useCollectionDashboardUrlParams();
|
package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.server.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BeforeListTableServerProps } from
|
|
2
|
-
import type { AccessGuard } from
|
|
1
|
+
import type { BeforeListTableServerProps } from "payload";
|
|
2
|
+
import type { AccessGuard } from "../../../../types/AccessGuard";
|
|
3
3
|
type BulkTranslationDashboardServerProps = BeforeListTableServerProps & {
|
|
4
4
|
access: AccessGuard;
|
|
5
5
|
};
|
package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.server.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { headers as getHeaders } from
|
|
3
|
-
import { collectionHasDrafts } from
|
|
4
|
-
import BulkTranslationDashboard from
|
|
2
|
+
import { headers as getHeaders } from "next/headers";
|
|
3
|
+
import { collectionHasDrafts } from "../../../../server/shared/guards";
|
|
4
|
+
import BulkTranslationDashboard from "./BulkTranslationDashboard";
|
|
5
5
|
const BulkTranslationDashboardServer = async (props)=>{
|
|
6
6
|
const headers = await getHeaders();
|
|
7
7
|
const hasAccess = await props.access.check({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from
|
|
1
|
+
export { default } from "./BulkTranslationDashboard";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { TranslateDocumentExport } from
|
|
1
|
+
export { TranslateDocumentExport } from "./ui/TranslateDocument.export";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { CollectionConfig } from
|
|
2
|
-
import type { AccessGuard } from
|
|
3
|
-
import type { RawPayloadComponentExport } from
|
|
1
|
+
import type { CollectionConfig } from "payload";
|
|
2
|
+
import type { AccessGuard } from "../../../../types/AccessGuard";
|
|
3
|
+
import type { RawPayloadComponentExport } from "../../../../types/PayloadComponentExport";
|
|
4
4
|
export declare class TranslateDocumentExport implements RawPayloadComponentExport {
|
|
5
5
|
readonly collection: CollectionConfig;
|
|
6
6
|
readonly access: AccessGuard;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { AnyAccessGuard } from
|
|
2
|
-
import { clientComponentPath } from
|
|
1
|
+
import { AnyAccessGuard } from "../../../../server/shared";
|
|
2
|
+
import { clientComponentPath } from "../../../shared/utils/componentPath";
|
|
3
3
|
export class TranslateDocumentExport {
|
|
4
4
|
collection;
|
|
5
5
|
access;
|
|
@@ -7,7 +7,7 @@ export class TranslateDocumentExport {
|
|
|
7
7
|
constructor(collection, access = new AnyAccessGuard()){
|
|
8
8
|
this.collection = collection;
|
|
9
9
|
this.access = access;
|
|
10
|
-
this.path = clientComponentPath(
|
|
10
|
+
this.path = clientComponentPath("widgets/translate-document/ui/TranslateDocument.server");
|
|
11
11
|
this.serverProps = {
|
|
12
12
|
collection,
|
|
13
13
|
access
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
|
|
1
|
+
"use client";
|
|
2
2
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import { toast, useLocale } from
|
|
4
|
-
import { useEffect, useMemo } from
|
|
5
|
-
import { CompletedTranslationStatus, TranslationsApi } from
|
|
6
|
-
import { OpenDocumentTranslationPopup } from
|
|
7
|
-
import { DocumentTranslationForm, FORM_FIELDS } from
|
|
8
|
-
import { DocumentTranslationFormModel } from
|
|
9
|
-
import { handleFormError } from
|
|
10
|
-
import { useCollectionDocumentUrlParams } from
|
|
11
|
-
import { DocumentTranslationProgressFailed } from
|
|
12
|
-
import { DocumentTranslationProgressRunning } from
|
|
13
|
-
import { DocumentTranslationProgressPending } from
|
|
3
|
+
import { toast, useLocale } from "@payloadcms/ui";
|
|
4
|
+
import { useEffect, useMemo } from "react";
|
|
5
|
+
import { CompletedTranslationStatus, TranslationsApi } from "../../../entities/translation";
|
|
6
|
+
import { OpenDocumentTranslationPopup } from "../../../features/open-document-translation-popup";
|
|
7
|
+
import { DocumentTranslationForm, FORM_FIELDS } from "../../../features/translate-document-form";
|
|
8
|
+
import { DocumentTranslationFormModel } from "../../../features/translate-document-form/index.client";
|
|
9
|
+
import { handleFormError } from "../../../shared/lib/forms/handle-form-error";
|
|
10
|
+
import { useCollectionDocumentUrlParams } from "../../../shared/lib/payload/hooks/useCollectionDocumentUrlParams";
|
|
11
|
+
import { DocumentTranslationProgressFailed } from "../../../features/document-translation-progress-failed";
|
|
12
|
+
import { DocumentTranslationProgressRunning } from "../../../features/document-translation-progress-running";
|
|
13
|
+
import { DocumentTranslationProgressPending } from "../../../features/document-translation-progress-pending";
|
|
14
14
|
const TranslateDocument = ({ hasDrafts })=>{
|
|
15
15
|
const locale = useLocale();
|
|
16
16
|
const params = useCollectionDocumentUrlParams();
|
|
@@ -65,18 +65,18 @@ const TranslateDocument = ({ hasDrafts })=>{
|
|
|
65
65
|
]
|
|
66
66
|
})
|
|
67
67
|
}),
|
|
68
|
-
data?.status ===
|
|
68
|
+
data?.status === "completed" && /*#__PURE__*/ _jsx(CompletedTranslationStatus, {
|
|
69
69
|
sourceLocale: data.input.source_lng,
|
|
70
70
|
targetLocale: data.input.target_lng,
|
|
71
71
|
completed_at: data.completed_at
|
|
72
72
|
}),
|
|
73
|
-
data?.status ===
|
|
73
|
+
data?.status === "failed" && /*#__PURE__*/ _jsx(DocumentTranslationProgressFailed, {
|
|
74
74
|
data: data
|
|
75
75
|
}),
|
|
76
|
-
data?.status ===
|
|
76
|
+
data?.status === "running" && /*#__PURE__*/ _jsx(DocumentTranslationProgressRunning, {
|
|
77
77
|
data: data
|
|
78
78
|
}),
|
|
79
|
-
data?.status ===
|
|
79
|
+
data?.status === "pending" && /*#__PURE__*/ _jsx(DocumentTranslationProgressPending, {
|
|
80
80
|
data: data
|
|
81
81
|
})
|
|
82
82
|
]
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { BeforeDocumentControlsServerProps, CollectionConfig } from
|
|
2
|
-
import type { AccessGuard } from
|
|
1
|
+
import type { BeforeDocumentControlsServerProps, CollectionConfig } from "payload";
|
|
2
|
+
import type { AccessGuard } from "../../../../types/AccessGuard";
|
|
3
3
|
type TranslateDocumentServerProps = BeforeDocumentControlsServerProps & {
|
|
4
4
|
collection: CollectionConfig;
|
|
5
5
|
access: AccessGuard;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { headers as getHeaders } from
|
|
3
|
-
import { collectionHasDrafts } from
|
|
4
|
-
import TranslateDocument from
|
|
2
|
+
import { headers as getHeaders } from "next/headers";
|
|
3
|
+
import { collectionHasDrafts } from "../../../../server/shared/guards";
|
|
4
|
+
import TranslateDocument from "./TranslateDocument";
|
|
5
5
|
async function TranslateDocumentServer(props) {
|
|
6
6
|
const headers = await getHeaders();
|
|
7
7
|
const hasAccess = await props.access.check({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { default } from
|
|
1
|
+
export { default } from "./TranslateDocument";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RawPayloadComponentExport } from "
|
|
1
|
+
import type { RawPayloadComponentExport } from "../../../../types/PayloadComponentExport";
|
|
2
2
|
/**
|
|
3
3
|
* Import-map reference to the per-field Translate control. Appended to a field's
|
|
4
4
|
* `admin.components.beforeInput` by `withFieldTranslation(field)`, so it renders just above the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TranslationLevel } from "
|
|
1
|
+
import type { TranslationLevel } from "../../server/modules/translation-levels";
|
|
2
2
|
/**
|
|
3
3
|
* Bulk collection translation: a dashboard on the list view (translate many
|
|
4
4
|
* documents at once), backed by the same shared document-translation API as
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BulkDocumentTranslationDashboard } from "
|
|
1
|
+
import { BulkDocumentTranslationDashboard } from "../../client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.export";
|
|
2
2
|
import { useDocTranslationApi } from "./useDocTranslationApi";
|
|
3
3
|
/**
|
|
4
4
|
* Bulk collection translation: a dashboard on the list view (translate many
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TranslationLevel } from "
|
|
1
|
+
import type { TranslationLevel } from "../../server/modules/translation-levels";
|
|
2
2
|
/**
|
|
3
3
|
* Per-document translation: a popup control on the document edit view, backed by
|
|
4
4
|
* the shared document-translation API (async/job by default; synchronous if the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { TranslateDocumentExport } from "
|
|
1
|
+
import { TranslateDocumentExport } from "../../client/widgets/translate-document";
|
|
2
2
|
import { useDocTranslationApi } from "./useDocTranslationApi";
|
|
3
3
|
/**
|
|
4
4
|
* Per-document translation: a popup control on the document edit view, backed by
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { TranslationLevel } from "
|
|
1
|
+
import type { TranslationLevel } from "../../server/modules/translation-levels";
|
|
2
2
|
/**
|
|
3
3
|
* Field-level translation surface: a synchronous `POST {basePath}/field` endpoint that translates
|
|
4
4
|
* a single declared field **from a chosen source locale** — it reads the field's value from the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createFieldRoute } from "../../features/translate-field";
|
|
1
|
+
import { createFieldRoute } from "../../server/features/translate-field";
|
|
2
2
|
/**
|
|
3
3
|
* Field-level translation surface: a synchronous `POST {basePath}/field` endpoint that translates
|
|
4
4
|
* a single declared field **from a chosen source locale** — it reads the field's value from the
|
package/dist/{server/modules/translation-levels → composition/levels}/useDocTranslationApi.d.ts
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { LevelContext } from "
|
|
1
|
+
import type { LevelContext } from "../../server/modules/translation-levels";
|
|
2
2
|
/**
|
|
3
3
|
* Contribute the runner-agnostic document-translation API — the shared 6-route
|
|
4
4
|
* bundle, bound to the level context's runner. Both `documentLevel` and
|
package/dist/{server/modules/translation-levels → composition/levels}/useDocTranslationApi.js
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createTranslationRoutes } from "../../features/createTranslationRoutes";
|
|
1
|
+
import { createTranslationRoutes } from "../../server/features/createTranslationRoutes";
|
|
2
2
|
/**
|
|
3
3
|
* Contribute the runner-agnostic document-translation API — the shared 6-route
|
|
4
4
|
* bundle, bound to the level context's runner. Both `documentLevel` and
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { FieldLike } from "../field-traversal";
|
|
2
|
+
/**
|
|
3
|
+
* The staleness baseline: a stable hash of a document's translatable content.
|
|
4
|
+
* `CURRENT = computeSourceFingerprint(sourceDoc, schema)` — the value provenance stores at translation
|
|
5
|
+
* time and #50 recomputes to detect source drift. A named composition of
|
|
6
|
+
* {@link projectTranslatableContent} + {@link fingerprint} so the "how to fingerprint source content"
|
|
7
|
+
* contract lives in one place (callers don't re-wire the two primitives). Reorder-invariant and
|
|
8
|
+
* text-nodes-only, inheriting those properties from its parts.
|
|
9
|
+
*
|
|
10
|
+
* @param doc - The source document to fingerprint (never mutated).
|
|
11
|
+
* @param schema - The ORIGINAL (un-sanitized) field schema.
|
|
12
|
+
* @returns A hex sha256 digest of the projected translatable content.
|
|
13
|
+
* @since 0.7.0
|
|
14
|
+
*/
|
|
15
|
+
export declare function computeSourceFingerprint(doc: Record<string, unknown>, schema: FieldLike[]): string;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { projectTranslatableContent } from "./contentProjector";
|
|
2
|
+
import { fingerprint } from "./fingerprinter";
|
|
3
|
+
/**
|
|
4
|
+
* The staleness baseline: a stable hash of a document's translatable content.
|
|
5
|
+
* `CURRENT = computeSourceFingerprint(sourceDoc, schema)` — the value provenance stores at translation
|
|
6
|
+
* time and #50 recomputes to detect source drift. A named composition of
|
|
7
|
+
* {@link projectTranslatableContent} + {@link fingerprint} so the "how to fingerprint source content"
|
|
8
|
+
* contract lives in one place (callers don't re-wire the two primitives). Reorder-invariant and
|
|
9
|
+
* text-nodes-only, inheriting those properties from its parts.
|
|
10
|
+
*
|
|
11
|
+
* @param doc - The source document to fingerprint (never mutated).
|
|
12
|
+
* @param schema - The ORIGINAL (un-sanitized) field schema.
|
|
13
|
+
* @returns A hex sha256 digest of the projected translatable content.
|
|
14
|
+
* @since 0.7.0
|
|
15
|
+
*/ export function computeSourceFingerprint(doc, schema) {
|
|
16
|
+
return fingerprint(projectTranslatableContent(doc, schema));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=computeSourceFingerprint.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `projectTranslatableContent` — the pure, read-only `ContentProjector` (slice 6 design,
|
|
3
|
+
* `docs/plans/2026-06-30-slice6-contentprojector-idpath-design.md`).
|
|
4
|
+
*
|
|
5
|
+
* Produces one `{ idPath, text }` entry per translatable leaf of a document — the projection the
|
|
6
|
+
* provenance fingerprint (#47) hashes. It reuses the SAME traversal engine ({@link walkFields}),
|
|
7
|
+
* the SAME leaf-selection predicate + text notion ({@link isTranslatableLeaf} /
|
|
8
|
+
* {@link leafSourceText}) as the translation pipeline's `FieldChunkCollector`, so projection and
|
|
9
|
+
* translation can never disagree on which content is translatable. Payload-free and read-only:
|
|
10
|
+
* it never mutates the document and never captures write handles.
|
|
11
|
+
*/
|
|
12
|
+
import type { FieldLike } from "../field-traversal/types";
|
|
13
|
+
import type { IdPath } from "./idPath";
|
|
14
|
+
/** One translatable leaf of a document: WHERE it lives ({@link IdPath}) and WHAT text it holds. */
|
|
15
|
+
export interface ProjectionEntry {
|
|
16
|
+
idPath: IdPath;
|
|
17
|
+
text: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Project a document's translatable content into a flat, location-keyed list.
|
|
21
|
+
*
|
|
22
|
+
* @param doc - The source document to read (never mutated).
|
|
23
|
+
* @param schema - The ORIGINAL (un-sanitized) field schema — preserves nested `localized` flags.
|
|
24
|
+
* @returns One entry per translatable, localized, non-excluded leaf that holds text, in traversal
|
|
25
|
+
* order. `richText` is field-level (one entry, joined node text). Reordering array/blocks elements
|
|
26
|
+
* does not change the set (each entry's `idPath` is keyed by element `id`, not index).
|
|
27
|
+
*/
|
|
28
|
+
export declare function projectTranslatableContent(doc: Record<string, unknown>, schema: FieldLike[]): ProjectionEntry[];
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `projectTranslatableContent` — the pure, read-only `ContentProjector` (slice 6 design,
|
|
3
|
+
* `docs/plans/2026-06-30-slice6-contentprojector-idpath-design.md`).
|
|
4
|
+
*
|
|
5
|
+
* Produces one `{ idPath, text }` entry per translatable leaf of a document — the projection the
|
|
6
|
+
* provenance fingerprint (#47) hashes. It reuses the SAME traversal engine ({@link walkFields}),
|
|
7
|
+
* the SAME leaf-selection predicate + text notion ({@link isTranslatableLeaf} /
|
|
8
|
+
* {@link leafSourceText}) as the translation pipeline's `FieldChunkCollector`, so projection and
|
|
9
|
+
* translation can never disagree on which content is translatable. Payload-free and read-only:
|
|
10
|
+
* it never mutates the document and never captures write handles.
|
|
11
|
+
*/ import { resolveBlockFields, walkFields } from "../field-traversal";
|
|
12
|
+
import { isObject } from "../utils/isObject";
|
|
13
|
+
import { elementSegment, makeIdPath } from "./idPath";
|
|
14
|
+
import { isTranslatableLeaf, leafSourceText } from "./translatableLeaf";
|
|
15
|
+
/**
|
|
16
|
+
* Project a document's translatable content into a flat, location-keyed list.
|
|
17
|
+
*
|
|
18
|
+
* @param doc - The source document to read (never mutated).
|
|
19
|
+
* @param schema - The ORIGINAL (un-sanitized) field schema — preserves nested `localized` flags.
|
|
20
|
+
* @returns One entry per translatable, localized, non-excluded leaf that holds text, in traversal
|
|
21
|
+
* order. `richText` is field-level (one entry, joined node text). Reordering array/blocks elements
|
|
22
|
+
* does not change the set (each entry's `idPath` is keyed by element `id`, not index).
|
|
23
|
+
*/ export function projectTranslatableContent(doc, schema) {
|
|
24
|
+
const entries = [];
|
|
25
|
+
const walker = {
|
|
26
|
+
enterObject (field, cursor) {
|
|
27
|
+
const value = cursor.data[field.name];
|
|
28
|
+
if (!isObject(value)) return "skip";
|
|
29
|
+
return {
|
|
30
|
+
data: value,
|
|
31
|
+
segments: [
|
|
32
|
+
...cursor.segments,
|
|
33
|
+
{
|
|
34
|
+
kind: "key",
|
|
35
|
+
name: field.name
|
|
36
|
+
}
|
|
37
|
+
]
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
enterList (field, cursor) {
|
|
41
|
+
const value = cursor.data[field.name];
|
|
42
|
+
if (!Array.isArray(value)) return "skip";
|
|
43
|
+
const isBlocks = field.type === "blocks";
|
|
44
|
+
const listSegments = [
|
|
45
|
+
...cursor.segments,
|
|
46
|
+
{
|
|
47
|
+
kind: "key",
|
|
48
|
+
name: field.name
|
|
49
|
+
}
|
|
50
|
+
];
|
|
51
|
+
const children = [];
|
|
52
|
+
value.forEach((item, index)=>{
|
|
53
|
+
if (!isObject(item)) return;
|
|
54
|
+
const fields = isBlocks ? resolveBlockFields(field, item) : field.fields;
|
|
55
|
+
if (!fields) return; // unknown blockType → skip element
|
|
56
|
+
children.push({
|
|
57
|
+
cursor: {
|
|
58
|
+
data: item,
|
|
59
|
+
segments: [
|
|
60
|
+
...listSegments,
|
|
61
|
+
elementSegment(item, isBlocks, index)
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
fields,
|
|
65
|
+
key: index
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
return children;
|
|
69
|
+
},
|
|
70
|
+
leaf (field, cursor) {
|
|
71
|
+
if (!isTranslatableLeaf(field)) return undefined;
|
|
72
|
+
const text = leafSourceText(field, cursor.data[field.name]);
|
|
73
|
+
if (text === null) return undefined;
|
|
74
|
+
entries.push({
|
|
75
|
+
idPath: makeIdPath([
|
|
76
|
+
...cursor.segments,
|
|
77
|
+
{
|
|
78
|
+
kind: "key",
|
|
79
|
+
name: field.name
|
|
80
|
+
}
|
|
81
|
+
]),
|
|
82
|
+
text
|
|
83
|
+
});
|
|
84
|
+
return undefined;
|
|
85
|
+
},
|
|
86
|
+
combine () {
|
|
87
|
+
return undefined; // collect-only — nothing to assemble
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
walkFields(schema, {
|
|
91
|
+
data: doc,
|
|
92
|
+
segments: []
|
|
93
|
+
}, walker);
|
|
94
|
+
return entries;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
//# sourceMappingURL=contentProjector.js.map
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `fingerprint` — a stable, reorder-invariant hash of a content projection (slice 6 design,
|
|
3
|
+
* `docs/plans/2026-06-30-slice6-contentprojector-idpath-design.md`). It is the roll-up the
|
|
4
|
+
* provenance staleness check compares over time: `CURRENT = fingerprint(projectTranslatableContent(
|
|
5
|
+
* sourceDoc, schema))`.
|
|
6
|
+
*
|
|
7
|
+
* Entries are sorted by `idPath` before hashing, so reordering array/blocks elements (which keeps
|
|
8
|
+
* the same `{ idPath, text }` set) does not move the hash — only a real content change does. The
|
|
9
|
+
* key and the value are length-prefixed so no shift of the text/key boundary can alias two
|
|
10
|
+
* different projections onto the same serialization.
|
|
11
|
+
*
|
|
12
|
+
* Depends only on `node:crypto` (a node built-in) — payload-free, so it can move to
|
|
13
|
+
* `@repo/translator-core` unchanged.
|
|
14
|
+
*/
|
|
15
|
+
import type { IdPath } from "./idPath";
|
|
16
|
+
interface ProjectionEntry {
|
|
17
|
+
idPath: IdPath;
|
|
18
|
+
text: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Hash a projection into a hex sha256 digest. Order-independent (sorted by `idPath` first) and
|
|
22
|
+
* deterministic.
|
|
23
|
+
*
|
|
24
|
+
* @param projection - The `{ idPath, text }` entries from {@link projectTranslatableContent}.
|
|
25
|
+
* @returns A hex sha256 string; equal projections (same entries, any order) hash equally.
|
|
26
|
+
*/
|
|
27
|
+
export declare function fingerprint(projection: ProjectionEntry[]): string;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `fingerprint` — a stable, reorder-invariant hash of a content projection (slice 6 design,
|
|
3
|
+
* `docs/plans/2026-06-30-slice6-contentprojector-idpath-design.md`). It is the roll-up the
|
|
4
|
+
* provenance staleness check compares over time: `CURRENT = fingerprint(projectTranslatableContent(
|
|
5
|
+
* sourceDoc, schema))`.
|
|
6
|
+
*
|
|
7
|
+
* Entries are sorted by `idPath` before hashing, so reordering array/blocks elements (which keeps
|
|
8
|
+
* the same `{ idPath, text }` set) does not move the hash — only a real content change does. The
|
|
9
|
+
* key and the value are length-prefixed so no shift of the text/key boundary can alias two
|
|
10
|
+
* different projections onto the same serialization.
|
|
11
|
+
*
|
|
12
|
+
* Depends only on `node:crypto` (a node built-in) — payload-free, so it can move to
|
|
13
|
+
* `@repo/translator-core` unchanged.
|
|
14
|
+
*/ import { createHash } from "node:crypto";
|
|
15
|
+
const serializeEntry = (entry)=>`${entry.idPath.length}:${entry.idPath}=${entry.text.length}:${entry.text}`;
|
|
16
|
+
/**
|
|
17
|
+
* Hash a projection into a hex sha256 digest. Order-independent (sorted by `idPath` first) and
|
|
18
|
+
* deterministic.
|
|
19
|
+
*
|
|
20
|
+
* @param projection - The `{ idPath, text }` entries from {@link projectTranslatableContent}.
|
|
21
|
+
* @returns A hex sha256 string; equal projections (same entries, any order) hash equally.
|
|
22
|
+
*/ export function fingerprint(projection) {
|
|
23
|
+
const serialized = [
|
|
24
|
+
...projection
|
|
25
|
+
].sort((a, b)=>a.idPath < b.idPath ? -1 : a.idPath > b.idPath ? 1 : 0).map(serializeEntry).join("\n");
|
|
26
|
+
return createHash("sha256").update(serialized).digest("hex");
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
//# sourceMappingURL=fingerprinter.js.map
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `IdPath` — the stable, location-based identity of a translatable leaf (slice 6 design,
|
|
3
|
+
* `docs/plans/2026-06-30-slice6-contentprojector-idpath-design.md`).
|
|
4
|
+
*
|
|
5
|
+
* It is the field path from the document root, with one crucial change over a positional path:
|
|
6
|
+
* **array/blocks element indices are replaced by the element's `id`** (`+ blockType` for blocks),
|
|
7
|
+
* so the path survives reordering and means the same thing across time. Group/tab/leaf name
|
|
8
|
+
* segments are unchanged; an element with no `id` falls back to a marked positional segment.
|
|
9
|
+
*
|
|
10
|
+
* `idPath` is *where* a piece lives (identity), never *what* it contains — so it can be compared
|
|
11
|
+
* across time to detect content drift. The whole grammar (escaping, blockType folding, fallback)
|
|
12
|
+
* lives in {@link makeIdPath}, the sole constructor, so it can never drift.
|
|
13
|
+
*/
|
|
14
|
+
export type IdPath = string & {
|
|
15
|
+
readonly __brand: "IdPath";
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* One structural step of an {@link IdPath}. Callers push these while walking; only
|
|
19
|
+
* {@link makeIdPath} renders them to a string, keeping the grammar in one place.
|
|
20
|
+
*/
|
|
21
|
+
export type PathSegment = {
|
|
22
|
+
kind: "key";
|
|
23
|
+
name: string;
|
|
24
|
+
} | {
|
|
25
|
+
kind: "element";
|
|
26
|
+
id: string;
|
|
27
|
+
blockType?: string;
|
|
28
|
+
} | {
|
|
29
|
+
kind: "index";
|
|
30
|
+
index: number;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* The sole constructor of an {@link IdPath}. Renders structural segments to the branded string.
|
|
34
|
+
*/
|
|
35
|
+
export declare function makeIdPath(segments: PathSegment[]): IdPath;
|
|
36
|
+
/**
|
|
37
|
+
* Build the {@link PathSegment} for one array/blocks element from its data item: keyed by the
|
|
38
|
+
* element's `id` (with `blockType` folded in for blocks), or a positional fallback when the element
|
|
39
|
+
* carries no usable `id`.
|
|
40
|
+
*
|
|
41
|
+
* @param item - The element's data object.
|
|
42
|
+
* @param isBlocks - Whether the parent field is a `blocks` field (then `blockType` is folded in).
|
|
43
|
+
* @param index - Position, used only for the no-id fallback.
|
|
44
|
+
*/
|
|
45
|
+
export declare function elementSegment(item: {
|
|
46
|
+
id?: unknown;
|
|
47
|
+
blockType?: unknown;
|
|
48
|
+
}, isBlocks: boolean, index: number): PathSegment;
|