@focus-reactive/payload-plugin-translator 0.6.0 → 0.6.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (461) hide show
  1. package/README.md +172 -306
  2. package/dist/client/app/cache/CacheProvider.d.ts +1 -1
  3. package/dist/client/app/cache/CacheProvider.export.d.ts +1 -1
  4. package/dist/client/app/cache/CacheProvider.export.js +2 -2
  5. package/dist/client/app/cache/CacheProvider.js +5 -5
  6. package/dist/client/app/config/TranslateKitConfigContext.d.ts +1 -1
  7. package/dist/client/app/config/TranslateKitConfigContext.js +3 -3
  8. package/dist/client/app/config/index.d.ts +2 -2
  9. package/dist/client/app/config/index.js +1 -1
  10. package/dist/client/entities/translation/api/mutations/useCancelCollectionTranslations.js +7 -7
  11. package/dist/client/entities/translation/api/mutations/useCancelDocumentTranslation.js +7 -7
  12. package/dist/client/entities/translation/api/mutations/useQueueDocumentTranslation.d.ts +1 -1
  13. package/dist/client/entities/translation/api/mutations/useQueueDocumentTranslation.js +8 -8
  14. package/dist/client/entities/translation/api/mutations/useQueueDocumentTranslations.js +6 -6
  15. package/dist/client/entities/translation/api/mutations/useRunDocumentTranslation.js +7 -7
  16. package/dist/client/entities/translation/api/mutations/useTranslateField.d.ts +1 -1
  17. package/dist/client/entities/translation/api/queries/useCollectionTranslationStatus.d.ts +2 -2
  18. package/dist/client/entities/translation/api/queries/useCollectionTranslationStatus.js +9 -10
  19. package/dist/client/entities/translation/api/queries/useDocumentTranslation.d.ts +2 -2
  20. package/dist/client/entities/translation/api/queries/useDocumentTranslation.js +9 -10
  21. package/dist/client/entities/translation/index.d.ts +12 -12
  22. package/dist/client/entities/translation/index.js +11 -11
  23. package/dist/client/entities/translation/model/types.d.ts +1 -1
  24. package/dist/client/entities/translation/ui/CompletedTranslationStatus/CompletedTranslationStatus.js +12 -12
  25. package/dist/client/entities/translation/ui/CompletedTranslationStatus/index.d.ts +1 -1
  26. package/dist/client/entities/translation/ui/CompletedTranslationStatus/index.js +1 -1
  27. package/dist/client/entities/translation/ui/CompletedTranslationStatus/styles.module.scss +1 -1
  28. package/dist/client/entities/translation/ui/FailedTranslationStatus/FailedTranslationStatus.js +8 -8
  29. package/dist/client/entities/translation/ui/FailedTranslationStatus/index.d.ts +1 -1
  30. package/dist/client/entities/translation/ui/FailedTranslationStatus/index.js +1 -1
  31. package/dist/client/entities/translation/ui/FailedTranslationStatus/styles.module.scss +1 -1
  32. package/dist/client/entities/translation/ui/PendingTranslationStatus/PendingTranslationStatus.js +14 -14
  33. package/dist/client/entities/translation/ui/PendingTranslationStatus/index.d.ts +1 -1
  34. package/dist/client/entities/translation/ui/PendingTranslationStatus/index.js +1 -1
  35. package/dist/client/entities/translation/ui/RunningTranslationStatus/RunningTranslationStatus.js +13 -13
  36. package/dist/client/entities/translation/ui/RunningTranslationStatus/index.d.ts +1 -1
  37. package/dist/client/entities/translation/ui/RunningTranslationStatus/index.js +1 -1
  38. package/dist/client/entities/translation/ui/TranslationDirection/TranslationDirection.d.ts +1 -1
  39. package/dist/client/entities/translation/ui/TranslationDirection/TranslationDirection.js +2 -2
  40. package/dist/client/entities/translation/ui/TranslationDirection/index.d.ts +1 -1
  41. package/dist/client/entities/translation/ui/TranslationDirection/index.js +1 -1
  42. package/dist/client/entities/translation/ui/TranslationDirection/styles.module.scss +1 -1
  43. package/dist/client/features/collection-translation-form/index.client.d.ts +1 -1
  44. package/dist/client/features/collection-translation-form/index.client.js +1 -1
  45. package/dist/client/features/collection-translation-form/index.d.ts +3 -3
  46. package/dist/client/features/collection-translation-form/index.js +2 -2
  47. package/dist/client/features/collection-translation-form/model/constants.d.ts +1 -1
  48. package/dist/client/features/collection-translation-form/model/constants.js +9 -9
  49. package/dist/client/features/collection-translation-form/model/form-model.d.ts +1 -1
  50. package/dist/client/features/collection-translation-form/model/index.d.ts +1 -1
  51. package/dist/client/features/collection-translation-form/model/index.js +1 -1
  52. package/dist/client/features/collection-translation-form/model/schema.d.ts +1 -1
  53. package/dist/client/features/collection-translation-form/model/schema.js +6 -6
  54. package/dist/client/features/collection-translation-form/ui/CollectionTranslationForm.d.ts +1 -1
  55. package/dist/client/features/collection-translation-form/ui/index.d.ts +1 -1
  56. package/dist/client/features/collection-translation-form/ui/index.js +1 -1
  57. package/dist/client/features/collection-translation-form/ui/styles.module.scss +1 -1
  58. package/dist/client/features/collection-translation-popup/index.d.ts +1 -1
  59. package/dist/client/features/collection-translation-popup/index.js +1 -1
  60. package/dist/client/features/collection-translation-popup/ui/CollectionTranslationPopup.d.ts +1 -1
  61. package/dist/client/features/collection-translation-popup/ui/styles.module.scss +1 -1
  62. package/dist/client/features/collection-translation-progress/index.d.ts +1 -1
  63. package/dist/client/features/collection-translation-progress/index.js +1 -1
  64. package/dist/client/features/collection-translation-progress/ui/CollectionTranslationProgress.d.ts +2 -2
  65. package/dist/client/features/collection-translation-progress/ui/CollectionTranslationProgress.js +13 -13
  66. package/dist/client/features/collection-translation-progress/ui/styles.module.scss +1 -1
  67. package/dist/client/features/document-translation-progress-failed/index.d.ts +1 -1
  68. package/dist/client/features/document-translation-progress-failed/index.js +1 -1
  69. package/dist/client/features/document-translation-progress-failed/ui/DocumentTranslationProgressFailed.d.ts +2 -2
  70. package/dist/client/features/document-translation-progress-failed/ui/DocumentTranslationProgressFailed.js +3 -3
  71. package/dist/client/features/document-translation-progress-pending/index.d.ts +1 -1
  72. package/dist/client/features/document-translation-progress-pending/index.js +1 -1
  73. package/dist/client/features/document-translation-progress-pending/ui/DocumentTranslationProgressPending.d.ts +2 -2
  74. package/dist/client/features/document-translation-progress-pending/ui/DocumentTranslationProgressPending.js +5 -5
  75. package/dist/client/features/document-translation-progress-running/index.d.ts +1 -1
  76. package/dist/client/features/document-translation-progress-running/index.js +1 -1
  77. package/dist/client/features/document-translation-progress-running/ui/DocumentTranslationProgressRunning.d.ts +2 -2
  78. package/dist/client/features/document-translation-progress-running/ui/DocumentTranslationProgressRunning.js +3 -3
  79. package/dist/client/features/open-document-translation-popup/index.d.ts +1 -1
  80. package/dist/client/features/open-document-translation-popup/index.js +1 -1
  81. package/dist/client/features/open-document-translation-popup/ui/styles.module.scss +1 -1
  82. package/dist/client/features/translate-document-form/index.client.d.ts +1 -1
  83. package/dist/client/features/translate-document-form/index.client.js +1 -1
  84. package/dist/client/features/translate-document-form/index.d.ts +3 -3
  85. package/dist/client/features/translate-document-form/index.js +2 -2
  86. package/dist/client/features/translate-document-form/model/constants.d.ts +1 -1
  87. package/dist/client/features/translate-document-form/model/constants.js +11 -11
  88. package/dist/client/features/translate-document-form/model/form-model.d.ts +1 -1
  89. package/dist/client/features/translate-document-form/model/index.d.ts +1 -1
  90. package/dist/client/features/translate-document-form/model/index.js +1 -1
  91. package/dist/client/features/translate-document-form/model/schema.d.ts +1 -1
  92. package/dist/client/features/translate-document-form/model/schema.js +5 -5
  93. package/dist/client/features/translate-document-form/ui/DocumentTranslationForm.d.ts +1 -1
  94. package/dist/client/features/translate-document-form/ui/index.d.ts +1 -1
  95. package/dist/client/features/translate-document-form/ui/index.js +1 -1
  96. package/dist/client/features/translate-document-form/ui/styles.module.scss +1 -1
  97. package/dist/client/shared/lib/errors/handleApiError.d.ts +1 -1
  98. package/dist/client/shared/lib/errors/handleApiError.js +2 -2
  99. package/dist/client/shared/lib/forms/handle-form-error.d.ts +1 -1
  100. package/dist/client/shared/lib/forms/handle-form-error.js +6 -6
  101. package/dist/client/shared/lib/payload/hooks/useCollectionDashboardUrlParams.d.ts +1 -1
  102. package/dist/client/shared/lib/payload/hooks/useCollectionDashboardUrlParams.js +1 -1
  103. package/dist/client/shared/lib/payload/hooks/useCollectionDocumentUrlParams.d.ts +1 -1
  104. package/dist/client/shared/lib/payload/hooks/useCollectionDocumentUrlParams.js +2 -2
  105. package/dist/client/shared/lib/payload/hooks/useLocaleOptions.js +2 -2
  106. package/dist/client/shared/lib/utils/errors/handleApiError.d.ts +1 -1
  107. package/dist/client/shared/lib/utils/errors/handleApiError.js +2 -2
  108. package/dist/client/shared/lib/utils/react/useToggle.js +1 -1
  109. package/dist/client/shared/providers/CacheClientProvider/CacheClientProvider.factory.d.ts +2 -2
  110. package/dist/client/shared/providers/CacheClientProvider/CacheClientProvider.factory.js +3 -3
  111. package/dist/client/shared/providers/CacheClientProvider/index.d.ts +1 -1
  112. package/dist/client/shared/providers/CacheClientProvider/index.js +1 -1
  113. package/dist/client/shared/types/AccessGuard.d.ts +1 -1
  114. package/dist/client/shared/ui/Alert/Alert.d.ts +2 -2
  115. package/dist/client/shared/ui/Alert/Alert.js +18 -18
  116. package/dist/client/shared/ui/Alert/index.d.ts +1 -1
  117. package/dist/client/shared/ui/Alert/index.js +1 -1
  118. package/dist/client/shared/ui/Alert/styles.module.scss +1 -1
  119. package/dist/client/shared/ui/Button/index.d.ts +1 -1
  120. package/dist/client/shared/ui/Button/index.js +1 -1
  121. package/dist/client/shared/ui/Button/styles.module.scss +6 -3
  122. package/dist/client/shared/ui/Checkbox/Checkbox.d.ts +2 -2
  123. package/dist/client/shared/ui/Checkbox/Checkbox.js +4 -4
  124. package/dist/client/shared/ui/Checkbox/index.d.ts +1 -1
  125. package/dist/client/shared/ui/Checkbox/index.js +1 -1
  126. package/dist/client/shared/ui/Checkbox/styles.module.scss +1 -1
  127. package/dist/client/shared/ui/ColorIndicator/ColorIndicator.d.ts +2 -2
  128. package/dist/client/shared/ui/ColorIndicator/ColorIndicator.js +2 -2
  129. package/dist/client/shared/ui/ColorIndicator/index.d.ts +1 -1
  130. package/dist/client/shared/ui/ColorIndicator/index.js +1 -1
  131. package/dist/client/shared/ui/ColorIndicator/styles.module.scss +1 -1
  132. package/dist/client/shared/ui/Description/Description.d.ts +3 -3
  133. package/dist/client/shared/ui/Description/Description.js +4 -4
  134. package/dist/client/shared/ui/Description/index.d.ts +1 -1
  135. package/dist/client/shared/ui/Description/index.js +1 -1
  136. package/dist/client/shared/ui/Description/styles.module.scss +1 -1
  137. package/dist/client/shared/ui/Divider/Divider.d.ts +4 -4
  138. package/dist/client/shared/ui/Divider/Divider.js +4 -4
  139. package/dist/client/shared/ui/Divider/index.d.ts +1 -1
  140. package/dist/client/shared/ui/Divider/index.js +1 -1
  141. package/dist/client/shared/ui/Divider/styles.module.scss +1 -1
  142. package/dist/client/shared/ui/Label/Label.d.ts +2 -2
  143. package/dist/client/shared/ui/Label/Label.js +3 -3
  144. package/dist/client/shared/ui/Label/index.d.ts +1 -1
  145. package/dist/client/shared/ui/Label/index.js +1 -1
  146. package/dist/client/shared/ui/Label/styles.module.scss +1 -1
  147. package/dist/client/shared/ui/Loading/Loading.d.ts +1 -1
  148. package/dist/client/shared/ui/Loading/Loading.js +9 -9
  149. package/dist/client/shared/ui/Loading/index.d.ts +1 -1
  150. package/dist/client/shared/ui/Loading/index.js +1 -1
  151. package/dist/client/shared/ui/Loading/styles.module.scss +2 -2
  152. package/dist/client/shared/ui/Popup/Popup.d.ts +1 -1
  153. package/dist/client/shared/ui/Popup/index.d.ts +1 -1
  154. package/dist/client/shared/ui/Popup/index.js +1 -1
  155. package/dist/client/shared/ui/Popup/styles.module.scss +1 -1
  156. package/dist/client/shared/ui/ProgressBar/ProgressBar.d.ts +2 -2
  157. package/dist/client/shared/ui/ProgressBar/ProgressBar.js +3 -3
  158. package/dist/client/shared/ui/ProgressBar/index.d.ts +1 -1
  159. package/dist/client/shared/ui/ProgressBar/index.js +1 -1
  160. package/dist/client/shared/ui/ProgressBar/styles.module.scss +1 -1
  161. package/dist/client/shared/ui/Select/index.d.ts +1 -1
  162. package/dist/client/shared/ui/Select/index.js +1 -1
  163. package/dist/client/shared/ui/Select/styles.module.scss +1 -1
  164. package/dist/client/shared/ui/StatusCounter/StatusCounter.d.ts +2 -2
  165. package/dist/client/shared/ui/StatusCounter/StatusCounter.js +13 -13
  166. package/dist/client/shared/ui/StatusCounter/index.d.ts +1 -1
  167. package/dist/client/shared/ui/StatusCounter/index.js +1 -1
  168. package/dist/client/shared/ui/StatusCounter/styles.module.scss +1 -1
  169. package/dist/client/shared/ui/StatusIndicator/StatusIndicator.d.ts +3 -3
  170. package/dist/client/shared/ui/StatusIndicator/StatusIndicator.js +4 -4
  171. package/dist/client/shared/ui/StatusIndicator/index.d.ts +1 -1
  172. package/dist/client/shared/ui/StatusIndicator/index.js +1 -1
  173. package/dist/client/shared/ui/StatusIndicator/styles.module.scss +1 -1
  174. package/dist/client/shared/ui/Tooltip/Tooltip.d.ts +2 -2
  175. package/dist/client/shared/ui/Tooltip/Tooltip.js +4 -4
  176. package/dist/client/shared/ui/Tooltip/index.d.ts +1 -1
  177. package/dist/client/shared/ui/Tooltip/index.js +1 -1
  178. package/dist/client/shared/ui/Tooltip/styles.module.scss +5 -5
  179. package/dist/client/shared/ui/form/FormCheckbox/FormCheckbox.d.ts +1 -1
  180. package/dist/client/shared/ui/form/FormCheckbox/FormCheckbox.js +6 -6
  181. package/dist/client/shared/ui/form/FormCheckbox/index.d.ts +1 -1
  182. package/dist/client/shared/ui/form/FormCheckbox/index.js +1 -1
  183. package/dist/client/shared/ui/form/FormCheckbox/styles.module.scss +1 -1
  184. package/dist/client/shared/ui/form/FormCheckboxPublish/FormCheckboxPublish.js +5 -5
  185. package/dist/client/shared/ui/form/FormCheckboxPublish/index.d.ts +1 -1
  186. package/dist/client/shared/ui/form/FormCheckboxPublish/index.js +1 -1
  187. package/dist/client/shared/ui/form/FormCheckboxPublish/styles.module.scss +1 -1
  188. package/dist/client/shared/ui/form/FormSelect/FormSelect.d.ts +5 -5
  189. package/dist/client/shared/ui/form/FormSelect/FormSelect.js +9 -9
  190. package/dist/client/shared/ui/form/FormSelect/index.d.ts +1 -1
  191. package/dist/client/shared/ui/form/FormSelect/index.js +1 -1
  192. package/dist/client/shared/ui/form/FormSelectLocale/FormSelectLocale.d.ts +1 -1
  193. package/dist/client/shared/ui/form/FormSelectLocale/FormSelectLocale.js +2 -2
  194. package/dist/client/shared/ui/form/FormSelectLocale/index.d.ts +1 -1
  195. package/dist/client/shared/ui/form/FormSelectLocale/index.js +1 -1
  196. package/dist/client/shared/ui/form/FormSelectStrategy/FormSelectStrategy.d.ts +2 -2
  197. package/dist/client/shared/ui/form/FormSelectStrategy/FormSelectStrategy.js +9 -9
  198. package/dist/client/shared/ui/form/FormSelectStrategy/index.d.ts +2 -2
  199. package/dist/client/shared/ui/form/FormSelectStrategy/index.js +1 -1
  200. package/dist/client/shared/ui/form/FormSelectStrategy/styles.module.scss +1 -1
  201. package/dist/client/shared/utils/componentPath.js +1 -1
  202. package/dist/client/widgets/bulk-translation-dashboard/index.d.ts +1 -1
  203. package/dist/client/widgets/bulk-translation-dashboard/index.js +1 -1
  204. package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.export.d.ts +2 -2
  205. package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.export.js +3 -3
  206. package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.js +11 -11
  207. package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.server.d.ts +2 -2
  208. package/dist/client/widgets/bulk-translation-dashboard/ui/BulkTranslationDashboard.server.js +3 -3
  209. package/dist/client/widgets/bulk-translation-dashboard/ui/index.d.ts +1 -1
  210. package/dist/client/widgets/bulk-translation-dashboard/ui/index.js +1 -1
  211. package/dist/client/widgets/translate-document/index.d.ts +1 -1
  212. package/dist/client/widgets/translate-document/index.js +1 -1
  213. package/dist/client/widgets/translate-document/ui/TranslateDocument.export.d.ts +3 -3
  214. package/dist/client/widgets/translate-document/ui/TranslateDocument.export.js +3 -3
  215. package/dist/client/widgets/translate-document/ui/TranslateDocument.js +16 -16
  216. package/dist/client/widgets/translate-document/ui/TranslateDocument.server.d.ts +2 -2
  217. package/dist/client/widgets/translate-document/ui/TranslateDocument.server.js +3 -3
  218. package/dist/client/widgets/translate-document/ui/index.d.ts +1 -1
  219. package/dist/client/widgets/translate-document/ui/index.js +1 -1
  220. package/dist/client/widgets/translate-field-control/ui/TranslateFieldControl.export.d.ts +1 -1
  221. package/dist/client/widgets/translate-field-control/ui/styles.module.scss +1 -1
  222. package/dist/{server/modules/translation-levels → composition/levels}/collectionLevel.d.ts +1 -1
  223. package/dist/{server/modules/translation-levels → composition/levels}/collectionLevel.js +1 -1
  224. package/dist/{server/modules/translation-levels → composition/levels}/documentLevel.d.ts +1 -1
  225. package/dist/{server/modules/translation-levels → composition/levels}/documentLevel.js +1 -1
  226. package/dist/{server/modules/translation-levels → composition/levels}/fieldLevel.d.ts +1 -1
  227. package/dist/{server/modules/translation-levels → composition/levels}/fieldLevel.js +1 -1
  228. package/dist/composition/levels/index.d.ts +3 -0
  229. package/dist/composition/levels/index.js +5 -0
  230. package/dist/{server/modules/translation-levels → composition/levels}/useDocTranslationApi.d.ts +1 -1
  231. package/dist/{server/modules/translation-levels → composition/levels}/useDocTranslationApi.js +1 -1
  232. package/dist/core/content-projection/contentProjector.d.ts +28 -0
  233. package/dist/core/content-projection/contentProjector.js +97 -0
  234. package/dist/core/content-projection/fingerprinter.d.ts +28 -0
  235. package/dist/core/content-projection/fingerprinter.js +29 -0
  236. package/dist/core/content-projection/idPath.d.ts +48 -0
  237. package/dist/core/content-projection/idPath.js +64 -0
  238. package/dist/core/content-projection/translatableLeaf.d.ts +27 -0
  239. package/dist/core/content-projection/translatableLeaf.js +37 -0
  240. package/dist/core/field-config/getFieldConfig.d.ts +23 -0
  241. package/dist/{server/shared → core}/field-config/getFieldConfig.js +5 -5
  242. package/dist/{server/shared → core}/field-config/index.d.ts +3 -3
  243. package/dist/core/field-config/index.js +4 -0
  244. package/dist/{server/shared → core}/field-traversal/findFieldByPath.d.ts +2 -3
  245. package/dist/core/field-traversal/guards.d.ts +19 -0
  246. package/dist/core/field-traversal/guards.js +20 -0
  247. package/dist/core/field-traversal/index.d.ts +7 -0
  248. package/dist/core/field-traversal/index.js +7 -0
  249. package/dist/{server/shared → core}/field-traversal/kernel.d.ts +7 -8
  250. package/dist/{server/shared → core}/field-traversal/kernel.js +6 -6
  251. package/dist/core/field-traversal/predicates.d.ts +24 -0
  252. package/dist/core/field-traversal/predicates.js +17 -0
  253. package/dist/{server/shared → core}/field-traversal/types.d.ts +129 -27
  254. package/dist/{server/shared → core}/field-traversal/types.js +6 -0
  255. package/dist/{server/shared → core}/field-traversal/walkFields.d.ts +2 -3
  256. package/dist/core/index.d.ts +10 -0
  257. package/dist/core/index.js +14 -0
  258. package/dist/{server/shared → core}/lexical/collectTextNodes.d.ts +1 -1
  259. package/dist/{server/shared → core}/lexical/collectTextNodes.js +1 -1
  260. package/dist/{server/shared → core}/lexical/guards.d.ts +1 -1
  261. package/dist/{server/shared → core}/lexical/guards.js +4 -4
  262. package/dist/core/lexical/index.d.ts +6 -0
  263. package/dist/core/lexical/index.js +6 -0
  264. package/dist/{server/shared → core}/lexical/isEmptyRichText.d.ts +1 -1
  265. package/dist/{server/shared → core}/lexical/isEmptyRichText.js +3 -3
  266. package/dist/{server/shared → core}/lexical/traverseLexicalTree.d.ts +1 -1
  267. package/dist/{server/shared → core}/lexical/traverseLexicalTree.js +1 -1
  268. package/dist/core/lexical/types.d.ts +33 -0
  269. package/dist/core/lexical/types.js +11 -0
  270. package/dist/{server/modules → core}/translation-pipeline/TranslationPipeline.d.ts +4 -4
  271. package/dist/{server/modules → core}/translation-pipeline/TranslationPipeline.js +1 -1
  272. package/dist/{server/modules → core}/translation-pipeline/stages/data-reconciler/DataReconciler.d.ts +2 -2
  273. package/dist/{server/modules → core}/translation-pipeline/stages/data-reconciler/DataReconciler.js +3 -2
  274. package/dist/core/translation-pipeline/stages/data-reconciler/index.d.ts +2 -0
  275. package/dist/core/translation-pipeline/stages/data-reconciler/index.js +4 -0
  276. package/dist/{server/modules → core}/translation-pipeline/stages/field-collector/FieldChunkCollector.d.ts +2 -2
  277. package/dist/{server/modules → core}/translation-pipeline/stages/field-collector/FieldChunkCollector.js +18 -4
  278. package/dist/{server/modules → core}/translation-pipeline/stages/field-collector/FieldChunkCollector.stage.d.ts +2 -2
  279. package/dist/{server/modules → core}/translation-pipeline/stages/field-collector/FieldChunkCollector.stage.js +2 -2
  280. package/dist/core/translation-pipeline/stages/field-collector/index.d.ts +2 -0
  281. package/dist/core/translation-pipeline/stages/field-collector/index.js +4 -0
  282. package/dist/core/translation-pipeline/stages/index.d.ts +6 -0
  283. package/dist/core/translation-pipeline/stages/index.js +7 -0
  284. package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/PlainTextExpander.d.ts +2 -2
  285. package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/PlainTextExpander.js +2 -2
  286. package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/RichTextExpander.d.ts +2 -2
  287. package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/RichTextExpander.js +3 -3
  288. package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/TextChunkExpander.d.ts +2 -2
  289. package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/TextChunkExpander.stage.d.ts +2 -2
  290. package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/TextChunkExpander.stage.js +4 -4
  291. package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/TextExpander.interface.d.ts +1 -1
  292. package/dist/core/translation-pipeline/stages/text-expander/index.d.ts +6 -0
  293. package/dist/core/translation-pipeline/stages/text-expander/index.js +6 -0
  294. package/dist/{server/modules → core}/translation-pipeline/stages/translation/Translation.stage.d.ts +2 -2
  295. package/dist/{server/modules → core}/translation-pipeline/stages/translation/Translation.stage.js +1 -1
  296. package/dist/core/translation-pipeline/stages/translation/index.d.ts +1 -0
  297. package/dist/core/translation-pipeline/stages/translation/index.js +3 -0
  298. package/dist/{server/modules → core}/translation-pipeline/stages/translation-applicator/TranslationMutator.d.ts +1 -1
  299. package/dist/{server/modules → core}/translation-pipeline/stages/translation-applicator/TranslationMutator.js +1 -1
  300. package/dist/{server/modules → core}/translation-pipeline/stages/translation-applicator/TranslationMutator.stage.d.ts +1 -1
  301. package/dist/{server/modules → core}/translation-pipeline/stages/translation-applicator/TranslationMutator.stage.js +2 -2
  302. package/dist/core/translation-pipeline/stages/translation-applicator/index.d.ts +2 -0
  303. package/dist/core/translation-pipeline/stages/translation-applicator/index.js +4 -0
  304. package/dist/{server/modules → core}/translation-pipeline/strategies/Overwrite.strategy.d.ts +1 -1
  305. package/dist/{server/modules → core}/translation-pipeline/strategies/Overwrite.strategy.js +1 -1
  306. package/dist/{server/modules → core}/translation-pipeline/strategies/SkipExisting.strategy.d.ts +1 -1
  307. package/dist/{server/modules → core}/translation-pipeline/strategies/SkipExisting.strategy.js +3 -1
  308. package/dist/core/translation-pipeline/strategies/index.d.ts +13 -0
  309. package/dist/{server/modules → core}/translation-pipeline/strategies/index.js +4 -4
  310. package/dist/{server/modules → core}/translation-pipeline/translateContent.d.ts +2 -2
  311. package/dist/{server/modules → core}/translation-pipeline/types/FieldChunk.d.ts +3 -3
  312. package/dist/{server/modules → core}/translation-pipeline/types/Pipeline.d.ts +2 -2
  313. package/dist/{server/modules → core}/translation-pipeline/types/PipelineContext.d.ts +4 -4
  314. package/dist/{server/modules → core}/translation-pipeline/types/TextChunk.d.ts +3 -3
  315. package/dist/{server/modules → core}/translation-pipeline/types/TextChunk.js +2 -2
  316. package/dist/core/translation-pipeline/types/index.d.ts +5 -0
  317. package/dist/core/translation-pipeline/types/index.js +3 -0
  318. package/dist/core/translation-providers/index.d.ts +1 -0
  319. package/dist/core/translation-providers/index.js +5 -0
  320. package/dist/core/utils/index.d.ts +2 -0
  321. package/dist/core/utils/index.js +4 -0
  322. package/dist/{server/shared → core}/utils/isEmpty.js +2 -2
  323. package/dist/{server/shared → core}/utils/isObject.js +1 -1
  324. package/dist/field-actions.d.ts +1 -1
  325. package/dist/field-config.d.ts +1 -1
  326. package/dist/field-config.js +1 -1
  327. package/dist/index.d.ts +5 -4
  328. package/dist/index.js +4 -4
  329. package/dist/plugin.d.ts +1 -1
  330. package/dist/plugin.js +1 -1
  331. package/dist/server/features/_lib/collection-utils.d.ts +1 -1
  332. package/dist/server/features/_lib/index.d.ts +1 -1
  333. package/dist/server/features/_lib/index.js +1 -1
  334. package/dist/server/features/cancel/index.d.ts +1 -1
  335. package/dist/server/features/cancel/index.js +1 -1
  336. package/dist/server/features/cancel-by-collection/index.d.ts +1 -1
  337. package/dist/server/features/cancel-by-collection/index.js +1 -1
  338. package/dist/server/features/cancel-by-collection/model.d.ts +2 -2
  339. package/dist/server/features/cancel-by-collection/model.js +1 -1
  340. package/dist/server/features/createTranslationRoutes.d.ts +1 -1
  341. package/dist/server/features/enqueue-translation/index.d.ts +1 -1
  342. package/dist/server/features/enqueue-translation/index.js +1 -1
  343. package/dist/server/features/enqueue-translation/model.d.ts +2 -2
  344. package/dist/server/features/enqueue-translation/model.js +4 -4
  345. package/dist/server/features/get-collection-status/index.d.ts +1 -1
  346. package/dist/server/features/get-collection-status/index.js +1 -1
  347. package/dist/server/features/get-collection-status/model.d.ts +3 -3
  348. package/dist/server/features/get-collection-status/model.js +1 -1
  349. package/dist/server/features/get-document-status/index.d.ts +2 -2
  350. package/dist/server/features/get-document-status/index.js +2 -2
  351. package/dist/server/features/run-translation/index.d.ts +1 -1
  352. package/dist/server/features/run-translation/index.js +1 -1
  353. package/dist/server/features/translate-document/handler.d.ts +3 -2
  354. package/dist/server/features/translate-document/handler.js +1 -1
  355. package/dist/server/features/translate-document/index.d.ts +1 -1
  356. package/dist/server/features/translate-document/model.d.ts +2 -7
  357. package/dist/server/features/translate-document/model.js +1 -2
  358. package/dist/server/features/translate-field/handler.js +1 -1
  359. package/dist/server/features/translate-field/index.d.ts +2 -1
  360. package/dist/server/features/translate-field/model.d.ts +2 -19
  361. package/dist/server/features/translate-field/resolveFieldSubtree.js +1 -1
  362. package/dist/server/features/translate-field/route.d.ts +1 -1
  363. package/dist/server/index.d.ts +3 -3
  364. package/dist/server/index.js +3 -3
  365. package/dist/server/modules/index.d.ts +2 -2
  366. package/dist/server/modules/index.js +2 -2
  367. package/dist/server/modules/task-runner/TaskRunner.interface.d.ts +2 -2
  368. package/dist/server/modules/task-runner/TaskRunnerProvider.interface.d.ts +1 -1
  369. package/dist/server/modules/task-runner/index.d.ts +1 -1
  370. package/dist/server/modules/task-runner/payload-jobs-runner/index.d.ts +2 -2
  371. package/dist/server/modules/task-runner/payload-jobs-runner/index.js +1 -1
  372. package/dist/server/modules/task-runner/sync-runner/index.d.ts +1 -1
  373. package/dist/server/modules/task-runner/sync-runner/index.js +1 -1
  374. package/dist/server/modules/translation-levels/PluginConfigBuilder.d.ts +3 -3
  375. package/dist/server/modules/translation-levels/index.d.ts +1 -4
  376. package/dist/server/modules/translation-levels/index.js +1 -3
  377. package/dist/server/modules/translation-levels/types.d.ts +3 -3
  378. package/dist/server/shared/access/AnyAccessGuard.d.ts +1 -1
  379. package/dist/server/shared/access/handler.d.ts +1 -1
  380. package/dist/server/shared/access/index.d.ts +3 -3
  381. package/dist/server/shared/access/index.js +1 -1
  382. package/dist/server/shared/access/types.d.ts +1 -1
  383. package/dist/server/shared/guards/collection-guards.d.ts +1 -1
  384. package/dist/server/shared/guards/collection-guards.js +2 -2
  385. package/dist/server/shared/guards/field-guards.d.ts +9 -20
  386. package/dist/server/shared/guards/field-guards.js +5 -20
  387. package/dist/server/shared/guards/index.d.ts +3 -3
  388. package/dist/server/shared/guards/index.js +2 -2
  389. package/dist/server/shared/http/ServerResponse.js +15 -15
  390. package/dist/server/shared/http/index.d.ts +3 -3
  391. package/dist/server/shared/http/index.js +3 -3
  392. package/dist/server/shared/http/withAccessCheck.d.ts +2 -2
  393. package/dist/server/shared/http/withAccessCheck.js +1 -1
  394. package/dist/server/shared/http/withErrorHandler.js +3 -3
  395. package/dist/server/shared/index.d.ts +6 -5
  396. package/dist/server/shared/index.js +4 -3
  397. package/dist/server/shared/utils/filterLocalizedFields.js +2 -2
  398. package/dist/server/shared/utils/getByPath.js +2 -2
  399. package/dist/server/shared/utils/index.d.ts +9 -9
  400. package/dist/server/shared/utils/index.js +8 -8
  401. package/dist/server/shared/utils/normalizePath.js +3 -3
  402. package/dist/server/shared/utils/setByPath.js +2 -2
  403. package/dist/translation-providers/index.d.ts +2 -0
  404. package/dist/translation-providers/index.js +10 -0
  405. package/dist/{server/modules/translation-providers → translation-providers/openai}/OpenAITranslation.provider.d.ts +1 -1
  406. package/dist/{server/modules/translation-providers → translation-providers/openai}/OpenAITranslation.provider.js +1 -1
  407. package/dist/translation-providers/openai/index.d.ts +1 -0
  408. package/dist/translation-providers/openai/index.js +5 -0
  409. package/dist/types/CollectionSchemaMap.d.ts +6 -0
  410. package/dist/types/CollectionSchemaMap.js +6 -0
  411. package/dist/{client/shared/types → types}/PayloadComponentExport.d.ts +1 -1
  412. package/dist/types/index.d.ts +4 -1
  413. package/dist/types/wire/field-translation.d.ts +17 -0
  414. package/dist/types/wire/field-translation.js +7 -0
  415. package/package.json +3 -1
  416. package/dist/server/modules/translation-pipeline/stages/data-reconciler/index.d.ts +0 -2
  417. package/dist/server/modules/translation-pipeline/stages/data-reconciler/index.js +0 -4
  418. package/dist/server/modules/translation-pipeline/stages/field-collector/index.d.ts +0 -2
  419. package/dist/server/modules/translation-pipeline/stages/field-collector/index.js +0 -4
  420. package/dist/server/modules/translation-pipeline/stages/index.d.ts +0 -6
  421. package/dist/server/modules/translation-pipeline/stages/index.js +0 -7
  422. package/dist/server/modules/translation-pipeline/stages/text-expander/index.d.ts +0 -6
  423. package/dist/server/modules/translation-pipeline/stages/text-expander/index.js +0 -6
  424. package/dist/server/modules/translation-pipeline/stages/translation/index.d.ts +0 -1
  425. package/dist/server/modules/translation-pipeline/stages/translation/index.js +0 -3
  426. package/dist/server/modules/translation-pipeline/stages/translation-applicator/index.d.ts +0 -2
  427. package/dist/server/modules/translation-pipeline/stages/translation-applicator/index.js +0 -4
  428. package/dist/server/modules/translation-pipeline/strategies/index.d.ts +0 -13
  429. package/dist/server/modules/translation-pipeline/types/index.d.ts +0 -5
  430. package/dist/server/modules/translation-pipeline/types/index.js +0 -3
  431. package/dist/server/modules/translation-providers/index.d.ts +0 -2
  432. package/dist/server/modules/translation-providers/index.js +0 -3
  433. package/dist/server/shared/field-config/getFieldConfig.d.ts +0 -20
  434. package/dist/server/shared/field-config/index.js +0 -4
  435. package/dist/server/shared/field-traversal/index.d.ts +0 -5
  436. package/dist/server/shared/field-traversal/index.js +0 -5
  437. package/dist/server/shared/lexical/index.d.ts +0 -6
  438. package/dist/server/shared/lexical/index.js +0 -6
  439. package/dist/server/shared/lexical/types.d.ts +0 -19
  440. package/dist/server/shared/lexical/types.js +0 -8
  441. /package/dist/{server/shared → core}/field-config/types.d.ts +0 -0
  442. /package/dist/{server/shared → core}/field-config/types.js +0 -0
  443. /package/dist/{server/shared → core}/field-traversal/findFieldByPath.js +0 -0
  444. /package/dist/{server/shared → core}/field-traversal/walkFields.js +0 -0
  445. /package/dist/{server/modules → core}/translation-pipeline/index.d.ts +0 -0
  446. /package/dist/{server/modules → core}/translation-pipeline/index.js +0 -0
  447. /package/dist/{server/modules → core}/translation-pipeline/stages/data-reconciler/DataReconciler.stage.d.ts +0 -0
  448. /package/dist/{server/modules → core}/translation-pipeline/stages/data-reconciler/DataReconciler.stage.js +0 -0
  449. /package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/TextChunkExpander.js +0 -0
  450. /package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/TextExpander.interface.js +0 -0
  451. /package/dist/{server/modules → core}/translation-pipeline/strategies/TranslationStrategy.interface.d.ts +0 -0
  452. /package/dist/{server/modules → core}/translation-pipeline/strategies/TranslationStrategy.interface.js +0 -0
  453. /package/dist/{server/modules → core}/translation-pipeline/translateContent.js +0 -0
  454. /package/dist/{server/modules → core}/translation-pipeline/types/FieldChunk.js +0 -0
  455. /package/dist/{server/modules → core}/translation-pipeline/types/Pipeline.js +0 -0
  456. /package/dist/{server/modules → core}/translation-pipeline/types/PipelineContext.js +0 -0
  457. /package/dist/{server/modules → core}/translation-providers/TranslationProvider.interface.d.ts +0 -0
  458. /package/dist/{server/modules → core}/translation-providers/TranslationProvider.interface.js +0 -0
  459. /package/dist/{server/shared → core}/utils/isEmpty.d.ts +0 -0
  460. /package/dist/{server/shared → core}/utils/isObject.d.ts +0 -0
  461. /package/dist/{client/shared/types → types}/PayloadComponentExport.js +0 -0
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Type guard: Checks if versions config is an object (not boolean).
3
3
  */ function isVersionsObject(versions) {
4
- return typeof versions === 'object' && versions !== null;
4
+ return typeof versions === "object" && versions !== null;
5
5
  }
6
6
  /**
7
7
  * Checks if a collection has drafts enabled.
@@ -10,7 +10,7 @@
10
10
  const { versions } = collection;
11
11
  if (!versions) return false;
12
12
  if (!isVersionsObject(versions)) return false;
13
- return 'drafts' in versions && Boolean(versions.drafts);
13
+ return "drafts" in versions && Boolean(versions.drafts);
14
14
  }
15
15
 
16
16
  //# sourceMappingURL=collection-guards.js.map
@@ -1,14 +1,20 @@
1
- import type { Field, RichTextField, TabsField, TextareaField, TextField } from 'payload';
1
+ import type { Field, RichTextField, TextareaField, TextField } from "payload";
2
2
  /** Translatable field types that contain text content */
3
3
  export type TranslatableField = RichTextField | TextareaField | TextField;
4
4
  /**
5
5
  * Type guard: Checks if a field contains translatable text content (text, textarea, richText).
6
+ * Narrows a `{ type: string }`-shaped field to the concrete Payload {@link TranslatableField}
7
+ * union.
6
8
  */
7
- export declare function isTranslatableField(field: Field): field is TranslatableField;
9
+ export declare function isTranslatableField(field: {
10
+ type: string;
11
+ }): field is TranslatableField;
8
12
  /**
9
13
  * Type guard: Checks if a field has the `localized` property set to true.
10
14
  */
11
- export declare function isLocalizedField(field: Field): field is Field & {
15
+ export declare function isLocalizedField<T extends {
16
+ localized?: boolean;
17
+ }>(field: T): field is T & {
12
18
  localized: true;
13
19
  };
14
20
  /**
@@ -17,20 +23,3 @@ export declare function isLocalizedField(field: Field): field is Field & {
17
23
  export declare function isRelationshipField(field: Field): field is Field & {
18
24
  relationTo: unknown;
19
25
  };
20
- /**
21
- * Type guard: Checks if a field is a tabs field.
22
- */
23
- export declare function isTabsField(field: Field): field is TabsField;
24
- /**
25
- * Type guard: Checks if value is a block item (has blockType property).
26
- */
27
- export declare function isBlockItem(value: unknown): value is Record<string, unknown> & {
28
- blockType: string;
29
- };
30
- /**
31
- * Type guard: Checks if value has a fields array property.
32
- * Works with Field, Tab, or any object with fields.
33
- */
34
- export declare function hasFields(value: unknown): value is {
35
- fields: Field[];
36
- };
@@ -1,34 +1,19 @@
1
- import { isObject } from '../utils';
2
1
  /**
3
2
  * Type guard: Checks if a field contains translatable text content (text, textarea, richText).
3
+ * Narrows a `{ type: string }`-shaped field to the concrete Payload {@link TranslatableField}
4
+ * union.
4
5
  */ export function isTranslatableField(field) {
5
- return field.type === 'text' || field.type === 'textarea' || field.type === 'richText';
6
+ return field.type === "text" || field.type === "textarea" || field.type === "richText";
6
7
  }
7
8
  /**
8
9
  * Type guard: Checks if a field has the `localized` property set to true.
9
10
  */ export function isLocalizedField(field) {
10
- return 'localized' in field && field.localized === true;
11
+ return "localized" in field && field.localized === true;
11
12
  }
12
13
  /**
13
14
  * Type guard: Checks if a field is a relationship or upload field (should be skipped).
14
15
  */ export function isRelationshipField(field) {
15
- return 'relationTo' in field && field.relationTo !== undefined;
16
- }
17
- /**
18
- * Type guard: Checks if a field is a tabs field.
19
- */ export function isTabsField(field) {
20
- return field.type === 'tabs';
21
- }
22
- /**
23
- * Type guard: Checks if value is a block item (has blockType property).
24
- */ export function isBlockItem(value) {
25
- return isObject(value) && 'blockType' in value && typeof value.blockType === 'string';
26
- }
27
- /**
28
- * Type guard: Checks if value has a fields array property.
29
- * Works with Field, Tab, or any object with fields.
30
- */ export function hasFields(value) {
31
- return isObject(value) && 'fields' in value && Array.isArray(value.fields);
16
+ return "relationTo" in field && field.relationTo !== undefined;
32
17
  }
33
18
 
34
19
  //# sourceMappingURL=field-guards.js.map
@@ -1,3 +1,3 @@
1
- export type { TranslatableField } from './field-guards';
2
- export { isTranslatableField, isLocalizedField, isRelationshipField, isTabsField, isBlockItem, hasFields, } from './field-guards';
3
- export { collectionHasDrafts } from './collection-guards';
1
+ export type { TranslatableField } from "./field-guards";
2
+ export { isTranslatableField, isLocalizedField, isRelationshipField } from "./field-guards";
3
+ export { collectionHasDrafts } from "./collection-guards";
@@ -1,4 +1,4 @@
1
- export { isTranslatableField, isLocalizedField, isRelationshipField, isTabsField, isBlockItem, hasFields } from './field-guards';
2
- export { collectionHasDrafts } from './collection-guards';
1
+ export { isTranslatableField, isLocalizedField, isRelationshipField } from "./field-guards";
2
+ export { collectionHasDrafts } from "./collection-guards";
3
3
 
4
4
  //# sourceMappingURL=index.js.map
@@ -13,7 +13,7 @@ export class ServerResponse {
13
13
  status: 201
14
14
  });
15
15
  }
16
- static accepted(message = 'Request accepted') {
16
+ static accepted(message = "Request accepted") {
17
17
  return Response.json({
18
18
  message
19
19
  }, {
@@ -25,7 +25,7 @@ export class ServerResponse {
25
25
  status: 204
26
26
  });
27
27
  }
28
- static badRequest(message = 'Bad request', details) {
28
+ static badRequest(message = "Bad request", details) {
29
29
  const body = details ? {
30
30
  message,
31
31
  details
@@ -36,42 +36,42 @@ export class ServerResponse {
36
36
  status: 400
37
37
  });
38
38
  }
39
- static unauthorized(message = 'Unauthorized') {
39
+ static unauthorized(message = "Unauthorized") {
40
40
  return Response.json({
41
41
  message
42
42
  }, {
43
43
  status: 401
44
44
  });
45
45
  }
46
- static forbidden(message = 'Forbidden') {
46
+ static forbidden(message = "Forbidden") {
47
47
  return Response.json({
48
48
  message
49
49
  }, {
50
50
  status: 403
51
51
  });
52
52
  }
53
- static notFound(message = 'Resource not found') {
53
+ static notFound(message = "Resource not found") {
54
54
  return Response.json({
55
55
  message
56
56
  }, {
57
57
  status: 404
58
58
  });
59
59
  }
60
- static methodNotAllowed(message = 'Method not allowed') {
60
+ static methodNotAllowed(message = "Method not allowed") {
61
61
  return Response.json({
62
62
  message
63
63
  }, {
64
64
  status: 405
65
65
  });
66
66
  }
67
- static conflict(message = 'Conflict') {
67
+ static conflict(message = "Conflict") {
68
68
  return Response.json({
69
69
  message
70
70
  }, {
71
71
  status: 409
72
72
  });
73
73
  }
74
- static unprocessableEntity(message = 'Unprocessable entity', details) {
74
+ static unprocessableEntity(message = "Unprocessable entity", details) {
75
75
  const body = details ? {
76
76
  message,
77
77
  details
@@ -82,42 +82,42 @@ export class ServerResponse {
82
82
  status: 422
83
83
  });
84
84
  }
85
- static tooManyRequests(message = 'Too many requests') {
85
+ static tooManyRequests(message = "Too many requests") {
86
86
  return Response.json({
87
87
  message
88
88
  }, {
89
89
  status: 429
90
90
  });
91
91
  }
92
- static internalServerError(message = 'Internal server error') {
92
+ static internalServerError(message = "Internal server error") {
93
93
  return Response.json({
94
94
  message
95
95
  }, {
96
96
  status: 500
97
97
  });
98
98
  }
99
- static notImplemented(message = 'Not implemented') {
99
+ static notImplemented(message = "Not implemented") {
100
100
  return Response.json({
101
101
  message
102
102
  }, {
103
103
  status: 501
104
104
  });
105
105
  }
106
- static badGateway(message = 'Bad gateway') {
106
+ static badGateway(message = "Bad gateway") {
107
107
  return Response.json({
108
108
  message
109
109
  }, {
110
110
  status: 502
111
111
  });
112
112
  }
113
- static serviceUnavailable(message = 'Service unavailable') {
113
+ static serviceUnavailable(message = "Service unavailable") {
114
114
  return Response.json({
115
115
  message
116
116
  }, {
117
117
  status: 503
118
118
  });
119
119
  }
120
- static gatewayTimeout(message = 'Gateway timeout') {
120
+ static gatewayTimeout(message = "Gateway timeout") {
121
121
  return Response.json({
122
122
  message
123
123
  }, {
@@ -126,7 +126,7 @@ export class ServerResponse {
126
126
  }
127
127
  static validationError(details) {
128
128
  return Response.json({
129
- message: 'Validation error',
129
+ message: "Validation error",
130
130
  details
131
131
  }, {
132
132
  status: 400
@@ -1,3 +1,3 @@
1
- export { ServerResponse } from './ServerResponse';
2
- export { withErrorHandler } from './withErrorHandler';
3
- export { withAccessCheck } from './withAccessCheck';
1
+ export { ServerResponse } from "./ServerResponse";
2
+ export { withErrorHandler } from "./withErrorHandler";
3
+ export { withAccessCheck } from "./withAccessCheck";
@@ -1,5 +1,5 @@
1
- export { ServerResponse } from './ServerResponse';
2
- export { withErrorHandler } from './withErrorHandler';
3
- export { withAccessCheck } from './withAccessCheck';
1
+ export { ServerResponse } from "./ServerResponse";
2
+ export { withErrorHandler } from "./withErrorHandler";
3
+ export { withAccessCheck } from "./withAccessCheck";
4
4
 
5
5
  //# sourceMappingURL=index.js.map
@@ -1,5 +1,5 @@
1
- import type { PayloadRequest } from 'payload';
2
- import type { AccessGuard } from '../access/types';
1
+ import type { PayloadRequest } from "payload";
2
+ import type { AccessGuard } from "../access/types";
3
3
  /**
4
4
  * Wraps handler with access check.
5
5
  * Returns 403 Forbidden if access guard denies the request.
@@ -1,4 +1,4 @@
1
- import { ServerResponse } from './ServerResponse';
1
+ import { ServerResponse } from "./ServerResponse";
2
2
  /**
3
3
  * Wraps handler with access check.
4
4
  * Returns 403 Forbidden if access guard denies the request.
@@ -1,5 +1,5 @@
1
- import { APIError } from 'payload';
2
- import { ServerResponse } from './ServerResponse';
1
+ import { APIError } from "payload";
2
+ import { ServerResponse } from "./ServerResponse";
3
3
  /**
4
4
  * Wraps async handler with error handling.
5
5
  * Catches APIError and generic Error, returns appropriate HTTP response.
@@ -8,7 +8,7 @@ import { ServerResponse } from './ServerResponse';
8
8
  try {
9
9
  return await handler(...args);
10
10
  } catch (e) {
11
- console.error('[TranslateKit] Handler error:', e);
11
+ console.error("[TranslateKit] Handler error:", e);
12
12
  if (e instanceof APIError) {
13
13
  return ServerResponse.custom(e.message, e.status);
14
14
  }
@@ -3,9 +3,10 @@ export { AnyAccessGuard } from "./access";
3
3
  export type { AccessGuard, AccessGuardRequest, Handler } from "./access";
4
4
  export { isEmpty, isObject, normalizePath, pipe, getByPath, setByPath, filterLocalizedFields, } from "./utils";
5
5
  export type { TranslatableField } from "./guards";
6
- export { isTranslatableField, isLocalizedField, isRelationshipField, isTabsField, isBlockItem, hasFields, } from "./guards";
7
- export { isFieldExcludedFromTranslation, getTranslateKitFieldConfig, } from "./field-config";
8
- export type { TranslateKitFieldConfig } from "./field-config";
9
- export { isSerializedLexicalRoot, isEmptyRichText, traverseLexicalTree, collectSerializedLexicalTextNodes, } from "./lexical";
10
- export type { SerializedTextNodeRef } from "./lexical";
6
+ export { isTranslatableField, isLocalizedField, isRelationshipField } from "./guards";
7
+ export { isTabsField, isBlockItem, hasFields } from "../../core/field-traversal";
8
+ export { isFieldExcludedFromTranslation, getTranslateKitFieldConfig, } from "../../core/field-config";
9
+ export type { TranslateKitFieldConfig } from "../../core/field-config";
10
+ export { isSerializedLexicalRoot, isEmptyRichText, traverseLexicalTree, collectSerializedLexicalTextNodes, } from "../../core/lexical";
11
+ export type { SerializedTextNodeRef } from "../../core/lexical";
11
12
  export { JobIdSchema } from "./validation";
@@ -4,11 +4,12 @@ export { ServerResponse, withErrorHandler, withAccessCheck } from "./http";
4
4
  export { AnyAccessGuard } from "./access";
5
5
  // General utilities
6
6
  export { isEmpty, isObject, normalizePath, pipe, getByPath, setByPath, filterLocalizedFields } from "./utils";
7
- export { isTranslatableField, isLocalizedField, isRelationshipField, isTabsField, isBlockItem, hasFields } from "./guards";
7
+ export { isTranslatableField, isLocalizedField, isRelationshipField } from "./guards";
8
+ export { isTabsField, isBlockItem, hasFields } from "../../core/field-traversal";
8
9
  // Field config
9
- export { isFieldExcludedFromTranslation, getTranslateKitFieldConfig } from "./field-config";
10
+ export { isFieldExcludedFromTranslation, getTranslateKitFieldConfig } from "../../core/field-config";
10
11
  // Lexical utilities
11
- export { isSerializedLexicalRoot, isEmptyRichText, traverseLexicalTree, collectSerializedLexicalTextNodes } from "./lexical";
12
+ export { isSerializedLexicalRoot, isEmptyRichText, traverseLexicalTree, collectSerializedLexicalTextNodes } from "../../core/lexical";
12
13
  // Validation primitives
13
14
  export { JobIdSchema } from "./validation";
14
15
 
@@ -1,6 +1,6 @@
1
- import { resolveBlockFields, walkFields } from "../field-traversal";
1
+ import { resolveBlockFields, walkFields } from "../../../core/field-traversal";
2
2
  import { isLocalizedField, isTranslatableField } from "../guards";
3
- import { isObject } from "./isObject";
3
+ import { isObject } from "../../../core/utils/isObject";
4
4
  /**
5
5
  * Filter walker: keeps only translatable, localized leaves, rebuilding the surrounding
6
6
  * object/array/blocks structure and dropping any container left empty. `id` (array/block
@@ -1,4 +1,4 @@
1
- import { isObject } from './isObject';
1
+ import { isObject } from "../../../core/utils/isObject";
2
2
  /**
3
3
  * Gets a value from an object by dot-notation path.
4
4
  *
@@ -6,7 +6,7 @@ import { isObject } from './isObject';
6
6
  * getByPath({ a: { b: 1 } }, 'a.b') // 1
7
7
  * getByPath({ arr: [{ x: 1 }] }, 'arr.0.x') // 1
8
8
  */ export function getByPath(obj, path) {
9
- const keys = path.split('.');
9
+ const keys = path.split(".");
10
10
  let current = obj;
11
11
  for (const key of keys){
12
12
  if (!isObject(current)) return undefined;
@@ -1,9 +1,9 @@
1
- export { isEmpty } from './isEmpty';
2
- export { isObject } from './isObject';
3
- export { normalizePath } from './normalizePath';
4
- export { getByPath } from './getByPath';
5
- export { setByPath } from './setByPath';
6
- export { pipe } from './pipe';
7
- export { filterLocalizedFields } from './filterLocalizedFields';
8
- export { LazyMap } from './LazyMap';
9
- export type { LazyMapOptions } from './LazyMap';
1
+ export { isEmpty } from "../../../core/utils/isEmpty";
2
+ export { isObject } from "../../../core/utils/isObject";
3
+ export { normalizePath } from "./normalizePath";
4
+ export { getByPath } from "./getByPath";
5
+ export { setByPath } from "./setByPath";
6
+ export { pipe } from "./pipe";
7
+ export { filterLocalizedFields } from "./filterLocalizedFields";
8
+ export { LazyMap } from "./LazyMap";
9
+ export type { LazyMapOptions } from "./LazyMap";
@@ -1,10 +1,10 @@
1
- export { isEmpty } from './isEmpty';
2
- export { isObject } from './isObject';
3
- export { normalizePath } from './normalizePath';
4
- export { getByPath } from './getByPath';
5
- export { setByPath } from './setByPath';
6
- export { pipe } from './pipe';
7
- export { filterLocalizedFields } from './filterLocalizedFields';
8
- export { LazyMap } from './LazyMap';
1
+ export { isEmpty } from "../../../core/utils/isEmpty";
2
+ export { isObject } from "../../../core/utils/isObject";
3
+ export { normalizePath } from "./normalizePath";
4
+ export { getByPath } from "./getByPath";
5
+ export { setByPath } from "./setByPath";
6
+ export { pipe } from "./pipe";
7
+ export { filterLocalizedFields } from "./filterLocalizedFields";
8
+ export { LazyMap } from "./LazyMap";
9
9
 
10
10
  //# sourceMappingURL=index.js.map
@@ -13,10 +13,10 @@
13
13
  * normalizePath(' ') // ''
14
14
  */ export function normalizePath(path) {
15
15
  const trimmed = path.trim();
16
- if (!trimmed) return '';
16
+ if (!trimmed) return "";
17
17
  // Remove leading/trailing slashes, then add single leading slash
18
- const normalized = trimmed.replace(/^\/+|\/+$/g, '');
19
- return normalized ? `/${normalized}` : '';
18
+ const normalized = trimmed.replace(/^\/+|\/+$/g, "");
19
+ return normalized ? `/${normalized}` : "";
20
20
  }
21
21
 
22
22
  //# sourceMappingURL=normalizePath.js.map
@@ -1,4 +1,4 @@
1
- import { isObject } from './isObject';
1
+ import { isObject } from "../../../core/utils/isObject";
2
2
  /**
3
3
  * Sets a value in an object by dot-notation path.
4
4
  * Creates intermediate objects/arrays as needed.
@@ -8,7 +8,7 @@ import { isObject } from './isObject';
8
8
  * setByPath(obj, 'a.b', 1) // { a: { b: 1 } }
9
9
  * setByPath(obj, 'arr.0.x', 1) // { arr: [{ x: 1 }] }
10
10
  */ export function setByPath(obj, path, value) {
11
- const keys = path.split('.');
11
+ const keys = path.split(".");
12
12
  let current = obj;
13
13
  for(let i = 0; i < keys.length - 1; i++){
14
14
  const key = keys[i];
@@ -0,0 +1,2 @@
1
+ export type { TranslationProvider, TranslationInput, TranslationOutput, } from "../core/translation-providers";
2
+ export * from "./openai";
@@ -0,0 +1,10 @@
1
+ // Translation-provider implementations (adapters), one directory per vendor. Payload-free and
2
+ // opt-in — each vendor pulls its own deps (e.g. `openai`). Kept OUT of the framework-agnostic core
3
+ // so the core stays dependency-free; the PORT they implement lives in the core and is re-exported
4
+ // here for convenience. Naming is explicit ("translation-providers") to leave room for other kinds
5
+ // of providers later without a collision.
6
+ // The port (contract) — source of truth is the core.
7
+ // Vendor implementations.
8
+ export * from "./openai";
9
+
10
+ //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import type { TranslationProvider, TranslationInput, TranslationOutput } from "./TranslationProvider.interface";
1
+ import type { TranslationProvider, TranslationInput, TranslationOutput } from "../../core/translation-providers/TranslationProvider.interface";
2
2
  import type { ChatModel } from "openai/resources/index.mjs";
3
3
  /**
4
4
  * Function to transform text in dry run mode.
@@ -1,5 +1,5 @@
1
1
  import OpenAI from "openai";
2
- import { isObject } from "../../shared";
2
+ import { isObject } from "../../core/utils/isObject";
3
3
  /** @deprecated Use `createOpenAIProvider` function instead */ export class OpenAITranslationProvider {
4
4
  openAiClient;
5
5
  config;
@@ -0,0 +1 @@
1
+ export { OpenAITranslationProvider, createOpenAIProvider, type OpenAIProviderConfig, type DryRunConfig, type SystemPromptContext, } from "./OpenAITranslation.provider";
@@ -0,0 +1,5 @@
1
+ // OpenAI translation provider — one vendor implementation of the core `TranslationProvider`
2
+ // port. Payload-free; pulls the `openai` SDK (opt-in).
3
+ export { OpenAITranslationProvider, createOpenAIProvider } from "./OpenAITranslation.provider";
4
+
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,6 @@
1
+ import type { CollectionSlug, Field } from "payload";
2
+ /**
3
+ * Map of collection slug to original field schema.
4
+ * Used to access original schemas before Payload sanitization.
5
+ */
6
+ export type CollectionSchemaMap = Map<CollectionSlug, Field[]>;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Map of collection slug to original field schema.
3
+ * Used to access original schemas before Payload sanitization.
4
+ */ export { };
5
+
6
+ //# sourceMappingURL=CollectionSchemaMap.js.map
@@ -1,2 +1,2 @@
1
- import type { RawPayloadComponent } from 'payload';
1
+ import type { RawPayloadComponent } from "payload";
2
2
  export type RawPayloadComponentExport = RawPayloadComponent;
@@ -1 +1,4 @@
1
- export type { AccessGuard, AccessGuardRequest } from './AccessGuard';
1
+ export type { AccessGuard, AccessGuardRequest } from "./AccessGuard";
2
+ export type { CollectionSchemaMap } from "./CollectionSchemaMap";
3
+ export type { RawPayloadComponentExport } from "./PayloadComponentExport";
4
+ export type { FieldTranslationNotice, FieldTranslationResult } from "./wire/field-translation";
@@ -0,0 +1,17 @@
1
+ export type FieldTranslationNotice = {
2
+ level: "info" | "warning";
3
+ message: string;
4
+ };
5
+ /**
6
+ * Successful response. Never an error for "couldn't translate": a field with no
7
+ * localized content (or a path our resolver can't handle yet) is a `noop` with a
8
+ * calm notice, not an HTTP error.
9
+ */
10
+ export type FieldTranslationResult = {
11
+ status: "translated";
12
+ value: unknown;
13
+ } | {
14
+ status: "noop";
15
+ value: unknown;
16
+ notice: FieldTranslationNotice;
17
+ };
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Successful response. Never an error for "couldn't translate": a field with no
3
+ * localized content (or a path our resolver can't handle yet) is a `noop` with a
4
+ * calm notice, not an HTTP error.
5
+ */ export { };
6
+
7
+ //# sourceMappingURL=field-translation.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@focus-reactive/payload-plugin-translator",
3
- "version": "0.6.0",
3
+ "version": "0.6.2",
4
4
  "description": "Translation plugin for Payload CMS 3.x. Automatically translate your localized content using any translation provider.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -53,6 +53,8 @@
53
53
  "dev": "bun run build:swc -- --watch --copy-files",
54
54
  "lint": "ultracite check",
55
55
  "lint:fix": "ultracite fix",
56
+ "format": "ultracite fix",
57
+ "format:check": "ultracite check",
56
58
  "test": "vitest run",
57
59
  "test:watch": "vitest",
58
60
  "check-types": "tsgo --noEmit -p tsconfig.check.json"
@@ -1,2 +0,0 @@
1
- export { DataReconciler } from './DataReconciler';
2
- export { DataReconcilerStage } from './DataReconciler.stage';
@@ -1,4 +0,0 @@
1
- export { DataReconciler } from './DataReconciler';
2
- export { DataReconcilerStage } from './DataReconciler.stage';
3
-
4
- //# sourceMappingURL=index.js.map
@@ -1,2 +0,0 @@
1
- export { FieldChunkCollector } from './FieldChunkCollector';
2
- export { FieldChunkCollectorStage } from './FieldChunkCollector.stage';
@@ -1,4 +0,0 @@
1
- export { FieldChunkCollector } from './FieldChunkCollector';
2
- export { FieldChunkCollectorStage } from './FieldChunkCollector.stage';
3
-
4
- //# sourceMappingURL=index.js.map
@@ -1,6 +0,0 @@
1
- export { DataReconciler, DataReconcilerStage } from './data-reconciler';
2
- export { FieldChunkCollector, FieldChunkCollectorStage } from './field-collector';
3
- export { TextChunkExpander, PlainTextExpander, RichTextExpander, TextChunkExpanderStage } from './text-expander';
4
- export type { TextExpansionResult, TextExpander, ExpansionResult } from './text-expander';
5
- export { TranslationStage } from './translation';
6
- export { TranslationMutator, TranslationMutatorStage } from './translation-applicator';
@@ -1,7 +0,0 @@
1
- export { DataReconciler, DataReconcilerStage } from './data-reconciler';
2
- export { FieldChunkCollector, FieldChunkCollectorStage } from './field-collector';
3
- export { TextChunkExpander, PlainTextExpander, RichTextExpander, TextChunkExpanderStage } from './text-expander';
4
- export { TranslationStage } from './translation';
5
- export { TranslationMutator, TranslationMutatorStage } from './translation-applicator';
6
-
7
- //# sourceMappingURL=index.js.map
@@ -1,6 +0,0 @@
1
- export { TextChunkExpander } from './TextChunkExpander';
2
- export type { TextExpansionResult } from './TextChunkExpander';
3
- export type { TextExpander, ExpansionResult } from './TextExpander.interface';
4
- export { PlainTextExpander } from './PlainTextExpander';
5
- export { RichTextExpander } from './RichTextExpander';
6
- export { TextChunkExpanderStage } from './TextChunkExpander.stage';
@@ -1,6 +0,0 @@
1
- export { TextChunkExpander } from './TextChunkExpander';
2
- export { PlainTextExpander } from './PlainTextExpander';
3
- export { RichTextExpander } from './RichTextExpander';
4
- export { TextChunkExpanderStage } from './TextChunkExpander.stage';
5
-
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- export { TranslationStage } from './Translation.stage';
@@ -1,3 +0,0 @@
1
- export { TranslationStage } from './Translation.stage';
2
-
3
- //# sourceMappingURL=index.js.map
@@ -1,2 +0,0 @@
1
- export { TranslationMutator } from './TranslationMutator';
2
- export { TranslationMutatorStage } from './TranslationMutator.stage';
@@ -1,4 +0,0 @@
1
- export { TranslationMutator } from './TranslationMutator';
2
- export { TranslationMutatorStage } from './TranslationMutator.stage';
3
-
4
- //# sourceMappingURL=index.js.map