@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.
Files changed (487) hide show
  1. package/README.md +55 -0
  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/computeSourceFingerprint.d.ts +15 -0
  233. package/dist/core/content-projection/computeSourceFingerprint.js +19 -0
  234. package/dist/core/content-projection/contentProjector.d.ts +28 -0
  235. package/dist/core/content-projection/contentProjector.js +97 -0
  236. package/dist/core/content-projection/fingerprinter.d.ts +28 -0
  237. package/dist/core/content-projection/fingerprinter.js +29 -0
  238. package/dist/core/content-projection/idPath.d.ts +48 -0
  239. package/dist/core/content-projection/idPath.js +64 -0
  240. package/dist/core/content-projection/translatableLeaf.d.ts +27 -0
  241. package/dist/core/content-projection/translatableLeaf.js +37 -0
  242. package/dist/core/field-config/getFieldConfig.d.ts +23 -0
  243. package/dist/{server/shared → core}/field-config/getFieldConfig.js +5 -5
  244. package/dist/{server/shared → core}/field-config/index.d.ts +3 -3
  245. package/dist/core/field-config/index.js +4 -0
  246. package/dist/{server/shared → core}/field-traversal/findFieldByPath.d.ts +2 -3
  247. package/dist/core/field-traversal/guards.d.ts +19 -0
  248. package/dist/core/field-traversal/guards.js +20 -0
  249. package/dist/core/field-traversal/index.d.ts +7 -0
  250. package/dist/core/field-traversal/index.js +7 -0
  251. package/dist/{server/shared → core}/field-traversal/kernel.d.ts +7 -8
  252. package/dist/{server/shared → core}/field-traversal/kernel.js +6 -6
  253. package/dist/core/field-traversal/predicates.d.ts +24 -0
  254. package/dist/core/field-traversal/predicates.js +17 -0
  255. package/dist/{server/shared → core}/field-traversal/types.d.ts +129 -27
  256. package/dist/{server/shared → core}/field-traversal/types.js +6 -0
  257. package/dist/{server/shared → core}/field-traversal/walkFields.d.ts +2 -3
  258. package/dist/core/index.d.ts +12 -0
  259. package/dist/core/index.js +15 -0
  260. package/dist/{server/shared → core}/lexical/collectTextNodes.d.ts +1 -1
  261. package/dist/{server/shared → core}/lexical/collectTextNodes.js +1 -1
  262. package/dist/{server/shared → core}/lexical/guards.d.ts +1 -1
  263. package/dist/{server/shared → core}/lexical/guards.js +4 -4
  264. package/dist/core/lexical/index.d.ts +6 -0
  265. package/dist/core/lexical/index.js +6 -0
  266. package/dist/{server/shared → core}/lexical/isEmptyRichText.d.ts +1 -1
  267. package/dist/{server/shared → core}/lexical/isEmptyRichText.js +3 -3
  268. package/dist/{server/shared → core}/lexical/traverseLexicalTree.d.ts +1 -1
  269. package/dist/{server/shared → core}/lexical/traverseLexicalTree.js +1 -1
  270. package/dist/core/lexical/types.d.ts +33 -0
  271. package/dist/core/lexical/types.js +11 -0
  272. package/dist/core/provenance/ProvenanceStore.interface.d.ts +99 -0
  273. package/dist/core/provenance/ProvenanceStore.interface.js +37 -0
  274. package/dist/core/provenance/index.d.ts +1 -0
  275. package/dist/core/provenance/index.js +5 -0
  276. package/dist/{server/modules → core}/translation-pipeline/TranslationPipeline.d.ts +4 -4
  277. package/dist/{server/modules → core}/translation-pipeline/TranslationPipeline.js +1 -1
  278. package/dist/{server/modules → core}/translation-pipeline/stages/data-reconciler/DataReconciler.d.ts +2 -2
  279. package/dist/{server/modules → core}/translation-pipeline/stages/data-reconciler/DataReconciler.js +3 -2
  280. package/dist/core/translation-pipeline/stages/data-reconciler/index.d.ts +2 -0
  281. package/dist/core/translation-pipeline/stages/data-reconciler/index.js +4 -0
  282. package/dist/{server/modules → core}/translation-pipeline/stages/field-collector/FieldChunkCollector.d.ts +2 -2
  283. package/dist/{server/modules → core}/translation-pipeline/stages/field-collector/FieldChunkCollector.js +18 -4
  284. package/dist/{server/modules → core}/translation-pipeline/stages/field-collector/FieldChunkCollector.stage.d.ts +2 -2
  285. package/dist/{server/modules → core}/translation-pipeline/stages/field-collector/FieldChunkCollector.stage.js +2 -2
  286. package/dist/core/translation-pipeline/stages/field-collector/index.d.ts +2 -0
  287. package/dist/core/translation-pipeline/stages/field-collector/index.js +4 -0
  288. package/dist/core/translation-pipeline/stages/index.d.ts +6 -0
  289. package/dist/core/translation-pipeline/stages/index.js +7 -0
  290. package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/PlainTextExpander.d.ts +2 -2
  291. package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/PlainTextExpander.js +2 -2
  292. package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/RichTextExpander.d.ts +2 -2
  293. package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/RichTextExpander.js +3 -3
  294. package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/TextChunkExpander.d.ts +2 -2
  295. package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/TextChunkExpander.stage.d.ts +2 -2
  296. package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/TextChunkExpander.stage.js +4 -4
  297. package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/TextExpander.interface.d.ts +1 -1
  298. package/dist/core/translation-pipeline/stages/text-expander/index.d.ts +6 -0
  299. package/dist/core/translation-pipeline/stages/text-expander/index.js +6 -0
  300. package/dist/{server/modules → core}/translation-pipeline/stages/translation/Translation.stage.d.ts +2 -2
  301. package/dist/{server/modules → core}/translation-pipeline/stages/translation/Translation.stage.js +1 -1
  302. package/dist/core/translation-pipeline/stages/translation/index.d.ts +1 -0
  303. package/dist/core/translation-pipeline/stages/translation/index.js +3 -0
  304. package/dist/{server/modules → core}/translation-pipeline/stages/translation-applicator/TranslationMutator.d.ts +1 -1
  305. package/dist/{server/modules → core}/translation-pipeline/stages/translation-applicator/TranslationMutator.js +1 -1
  306. package/dist/{server/modules → core}/translation-pipeline/stages/translation-applicator/TranslationMutator.stage.d.ts +1 -1
  307. package/dist/{server/modules → core}/translation-pipeline/stages/translation-applicator/TranslationMutator.stage.js +2 -2
  308. package/dist/core/translation-pipeline/stages/translation-applicator/index.d.ts +2 -0
  309. package/dist/core/translation-pipeline/stages/translation-applicator/index.js +4 -0
  310. package/dist/{server/modules → core}/translation-pipeline/strategies/Overwrite.strategy.d.ts +1 -1
  311. package/dist/{server/modules → core}/translation-pipeline/strategies/Overwrite.strategy.js +1 -1
  312. package/dist/{server/modules → core}/translation-pipeline/strategies/SkipExisting.strategy.d.ts +1 -1
  313. package/dist/{server/modules → core}/translation-pipeline/strategies/SkipExisting.strategy.js +3 -1
  314. package/dist/core/translation-pipeline/strategies/index.d.ts +13 -0
  315. package/dist/{server/modules → core}/translation-pipeline/strategies/index.js +4 -4
  316. package/dist/{server/modules → core}/translation-pipeline/translateContent.d.ts +2 -2
  317. package/dist/{server/modules → core}/translation-pipeline/types/FieldChunk.d.ts +3 -3
  318. package/dist/{server/modules → core}/translation-pipeline/types/Pipeline.d.ts +2 -2
  319. package/dist/{server/modules → core}/translation-pipeline/types/PipelineContext.d.ts +4 -4
  320. package/dist/{server/modules → core}/translation-pipeline/types/TextChunk.d.ts +3 -3
  321. package/dist/{server/modules → core}/translation-pipeline/types/TextChunk.js +2 -2
  322. package/dist/core/translation-pipeline/types/index.d.ts +5 -0
  323. package/dist/core/translation-pipeline/types/index.js +3 -0
  324. package/dist/core/translation-providers/index.d.ts +1 -0
  325. package/dist/core/translation-providers/index.js +5 -0
  326. package/dist/core/utils/index.d.ts +2 -0
  327. package/dist/core/utils/index.js +4 -0
  328. package/dist/{server/shared → core}/utils/isEmpty.js +2 -2
  329. package/dist/{server/shared → core}/utils/isObject.js +1 -1
  330. package/dist/field-actions.d.ts +1 -1
  331. package/dist/field-config.d.ts +1 -1
  332. package/dist/field-config.js +1 -1
  333. package/dist/index.d.ts +7 -4
  334. package/dist/index.js +4 -4
  335. package/dist/plugin.d.ts +27 -1
  336. package/dist/plugin.js +56 -16
  337. package/dist/server/features/_lib/collection-utils.d.ts +1 -1
  338. package/dist/server/features/_lib/index.d.ts +1 -1
  339. package/dist/server/features/_lib/index.js +1 -1
  340. package/dist/server/features/cancel/index.d.ts +1 -1
  341. package/dist/server/features/cancel/index.js +1 -1
  342. package/dist/server/features/cancel-by-collection/index.d.ts +1 -1
  343. package/dist/server/features/cancel-by-collection/index.js +1 -1
  344. package/dist/server/features/cancel-by-collection/model.d.ts +2 -2
  345. package/dist/server/features/cancel-by-collection/model.js +1 -1
  346. package/dist/server/features/createTranslationRoutes.d.ts +1 -1
  347. package/dist/server/features/enqueue-translation/index.d.ts +1 -1
  348. package/dist/server/features/enqueue-translation/index.js +1 -1
  349. package/dist/server/features/enqueue-translation/model.d.ts +2 -2
  350. package/dist/server/features/enqueue-translation/model.js +4 -4
  351. package/dist/server/features/get-collection-status/index.d.ts +1 -1
  352. package/dist/server/features/get-collection-status/index.js +1 -1
  353. package/dist/server/features/get-collection-status/model.d.ts +3 -3
  354. package/dist/server/features/get-collection-status/model.js +1 -1
  355. package/dist/server/features/get-document-status/index.d.ts +2 -2
  356. package/dist/server/features/get-document-status/index.js +2 -2
  357. package/dist/server/features/run-translation/index.d.ts +1 -1
  358. package/dist/server/features/run-translation/index.js +1 -1
  359. package/dist/server/features/translate-document/handler.d.ts +6 -3
  360. package/dist/server/features/translate-document/handler.js +28 -2
  361. package/dist/server/features/translate-document/index.d.ts +1 -1
  362. package/dist/server/features/translate-document/model.d.ts +2 -7
  363. package/dist/server/features/translate-document/model.js +1 -2
  364. package/dist/server/features/translate-field/handler.js +1 -1
  365. package/dist/server/features/translate-field/index.d.ts +2 -1
  366. package/dist/server/features/translate-field/model.d.ts +2 -19
  367. package/dist/server/features/translate-field/resolveFieldSubtree.js +1 -1
  368. package/dist/server/features/translate-field/route.d.ts +1 -1
  369. package/dist/server/index.d.ts +3 -3
  370. package/dist/server/index.js +3 -3
  371. package/dist/server/modules/index.d.ts +2 -2
  372. package/dist/server/modules/index.js +2 -2
  373. package/dist/server/modules/lifecycle/LifecycleNotifier.d.ts +21 -0
  374. package/dist/server/modules/lifecycle/LifecycleNotifier.js +38 -0
  375. package/dist/server/modules/lifecycle/index.d.ts +4 -0
  376. package/dist/server/modules/lifecycle/index.js +7 -0
  377. package/dist/server/modules/lifecycle/taskMapping.d.ts +7 -0
  378. package/dist/server/modules/lifecycle/taskMapping.js +16 -0
  379. package/dist/server/modules/lifecycle/types.d.ts +45 -0
  380. package/dist/server/modules/lifecycle/types.js +21 -0
  381. package/dist/server/modules/lifecycle/withQueuedNotification.d.ts +9 -0
  382. package/dist/server/modules/lifecycle/withQueuedNotification.js +19 -0
  383. package/dist/server/modules/provenance/PayloadProvenanceStore.d.ts +21 -0
  384. package/dist/server/modules/provenance/PayloadProvenanceStore.js +109 -0
  385. package/dist/server/modules/provenance/index.d.ts +5 -0
  386. package/dist/server/modules/provenance/index.js +8 -0
  387. package/dist/server/modules/provenance/provenanceCleanupHook.d.ts +18 -0
  388. package/dist/server/modules/provenance/provenanceCleanupHook.js +41 -0
  389. package/dist/server/modules/provenance/provenanceCollection.d.ts +23 -0
  390. package/dist/server/modules/provenance/provenanceCollection.js +82 -0
  391. package/dist/server/modules/provenance/slugGuard.d.ts +16 -0
  392. package/dist/server/modules/provenance/slugGuard.js +19 -0
  393. package/dist/server/modules/task-runner/TaskRunner.interface.d.ts +2 -2
  394. package/dist/server/modules/task-runner/TaskRunnerProvider.interface.d.ts +1 -1
  395. package/dist/server/modules/task-runner/index.d.ts +1 -1
  396. package/dist/server/modules/task-runner/payload-jobs-runner/index.d.ts +2 -2
  397. package/dist/server/modules/task-runner/payload-jobs-runner/index.js +1 -1
  398. package/dist/server/modules/task-runner/sync-runner/index.d.ts +1 -1
  399. package/dist/server/modules/task-runner/sync-runner/index.js +1 -1
  400. package/dist/server/modules/translation-levels/PluginConfigBuilder.d.ts +3 -3
  401. package/dist/server/modules/translation-levels/index.d.ts +1 -4
  402. package/dist/server/modules/translation-levels/index.js +1 -3
  403. package/dist/server/modules/translation-levels/types.d.ts +3 -3
  404. package/dist/server/shared/access/AnyAccessGuard.d.ts +1 -1
  405. package/dist/server/shared/access/handler.d.ts +1 -1
  406. package/dist/server/shared/access/index.d.ts +3 -3
  407. package/dist/server/shared/access/index.js +1 -1
  408. package/dist/server/shared/access/types.d.ts +1 -1
  409. package/dist/server/shared/guards/collection-guards.d.ts +1 -1
  410. package/dist/server/shared/guards/collection-guards.js +2 -2
  411. package/dist/server/shared/guards/field-guards.d.ts +9 -20
  412. package/dist/server/shared/guards/field-guards.js +5 -20
  413. package/dist/server/shared/guards/index.d.ts +3 -3
  414. package/dist/server/shared/guards/index.js +2 -2
  415. package/dist/server/shared/http/ServerResponse.js +15 -15
  416. package/dist/server/shared/http/index.d.ts +3 -3
  417. package/dist/server/shared/http/index.js +3 -3
  418. package/dist/server/shared/http/withAccessCheck.d.ts +2 -2
  419. package/dist/server/shared/http/withAccessCheck.js +1 -1
  420. package/dist/server/shared/http/withErrorHandler.js +3 -3
  421. package/dist/server/shared/index.d.ts +6 -5
  422. package/dist/server/shared/index.js +4 -3
  423. package/dist/server/shared/utils/filterLocalizedFields.js +2 -2
  424. package/dist/server/shared/utils/getByPath.js +2 -2
  425. package/dist/server/shared/utils/index.d.ts +9 -9
  426. package/dist/server/shared/utils/index.js +8 -8
  427. package/dist/server/shared/utils/normalizePath.js +3 -3
  428. package/dist/server/shared/utils/setByPath.js +2 -2
  429. package/dist/translation-providers/index.d.ts +2 -0
  430. package/dist/translation-providers/index.js +10 -0
  431. package/dist/{server/modules/translation-providers → translation-providers/openai}/OpenAITranslation.provider.d.ts +1 -1
  432. package/dist/{server/modules/translation-providers → translation-providers/openai}/OpenAITranslation.provider.js +1 -1
  433. package/dist/translation-providers/openai/index.d.ts +1 -0
  434. package/dist/translation-providers/openai/index.js +5 -0
  435. package/dist/types/CollectionSchemaMap.d.ts +6 -0
  436. package/dist/types/CollectionSchemaMap.js +6 -0
  437. package/dist/{client/shared/types → types}/PayloadComponentExport.d.ts +1 -1
  438. package/dist/types/index.d.ts +4 -1
  439. package/dist/types/wire/field-translation.d.ts +17 -0
  440. package/dist/types/wire/field-translation.js +7 -0
  441. package/package.json +3 -1
  442. package/dist/server/modules/translation-pipeline/stages/data-reconciler/index.d.ts +0 -2
  443. package/dist/server/modules/translation-pipeline/stages/data-reconciler/index.js +0 -4
  444. package/dist/server/modules/translation-pipeline/stages/field-collector/index.d.ts +0 -2
  445. package/dist/server/modules/translation-pipeline/stages/field-collector/index.js +0 -4
  446. package/dist/server/modules/translation-pipeline/stages/index.d.ts +0 -6
  447. package/dist/server/modules/translation-pipeline/stages/index.js +0 -7
  448. package/dist/server/modules/translation-pipeline/stages/text-expander/index.d.ts +0 -6
  449. package/dist/server/modules/translation-pipeline/stages/text-expander/index.js +0 -6
  450. package/dist/server/modules/translation-pipeline/stages/translation/index.d.ts +0 -1
  451. package/dist/server/modules/translation-pipeline/stages/translation/index.js +0 -3
  452. package/dist/server/modules/translation-pipeline/stages/translation-applicator/index.d.ts +0 -2
  453. package/dist/server/modules/translation-pipeline/stages/translation-applicator/index.js +0 -4
  454. package/dist/server/modules/translation-pipeline/strategies/index.d.ts +0 -13
  455. package/dist/server/modules/translation-pipeline/types/index.d.ts +0 -5
  456. package/dist/server/modules/translation-pipeline/types/index.js +0 -3
  457. package/dist/server/modules/translation-providers/index.d.ts +0 -2
  458. package/dist/server/modules/translation-providers/index.js +0 -3
  459. package/dist/server/shared/field-config/getFieldConfig.d.ts +0 -20
  460. package/dist/server/shared/field-config/index.js +0 -4
  461. package/dist/server/shared/field-traversal/index.d.ts +0 -5
  462. package/dist/server/shared/field-traversal/index.js +0 -5
  463. package/dist/server/shared/lexical/index.d.ts +0 -6
  464. package/dist/server/shared/lexical/index.js +0 -6
  465. package/dist/server/shared/lexical/types.d.ts +0 -19
  466. package/dist/server/shared/lexical/types.js +0 -8
  467. /package/dist/{server/shared → core}/field-config/types.d.ts +0 -0
  468. /package/dist/{server/shared → core}/field-config/types.js +0 -0
  469. /package/dist/{server/shared → core}/field-traversal/findFieldByPath.js +0 -0
  470. /package/dist/{server/shared → core}/field-traversal/walkFields.js +0 -0
  471. /package/dist/{server/modules → core}/translation-pipeline/index.d.ts +0 -0
  472. /package/dist/{server/modules → core}/translation-pipeline/index.js +0 -0
  473. /package/dist/{server/modules → core}/translation-pipeline/stages/data-reconciler/DataReconciler.stage.d.ts +0 -0
  474. /package/dist/{server/modules → core}/translation-pipeline/stages/data-reconciler/DataReconciler.stage.js +0 -0
  475. /package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/TextChunkExpander.js +0 -0
  476. /package/dist/{server/modules → core}/translation-pipeline/stages/text-expander/TextExpander.interface.js +0 -0
  477. /package/dist/{server/modules → core}/translation-pipeline/strategies/TranslationStrategy.interface.d.ts +0 -0
  478. /package/dist/{server/modules → core}/translation-pipeline/strategies/TranslationStrategy.interface.js +0 -0
  479. /package/dist/{server/modules → core}/translation-pipeline/translateContent.js +0 -0
  480. /package/dist/{server/modules → core}/translation-pipeline/types/FieldChunk.js +0 -0
  481. /package/dist/{server/modules → core}/translation-pipeline/types/Pipeline.js +0 -0
  482. /package/dist/{server/modules → core}/translation-pipeline/types/PipelineContext.js +0 -0
  483. /package/dist/{server/modules → core}/translation-providers/TranslationProvider.interface.d.ts +0 -0
  484. /package/dist/{server/modules → core}/translation-providers/TranslationProvider.interface.js +0 -0
  485. /package/dist/{server/shared → core}/utils/isEmpty.d.ts +0 -0
  486. /package/dist/{server/shared → core}/utils/isObject.d.ts +0 -0
  487. /package/dist/{client/shared/types → types}/PayloadComponentExport.js +0 -0
@@ -0,0 +1,12 @@
1
+ export type { TranslationProvider, TranslationInput, TranslationOutput, TranslationIndex, } from "./translation-providers";
2
+ export { TranslationPipeline, translateContent } from "./translation-pipeline";
3
+ export type { TranslateContentArgs, TranslationStrategy } from "./translation-pipeline";
4
+ export type { ProvenanceKey, ProvenanceStore, TranslationProvenanceRecord } from "./provenance";
5
+ export { projectTranslatableContent } from "./content-projection/contentProjector";
6
+ export type { ProjectionEntry } from "./content-projection/contentProjector";
7
+ export { fingerprint } from "./content-projection/fingerprinter";
8
+ export { computeSourceFingerprint } from "./content-projection/computeSourceFingerprint";
9
+ export { makeIdPath } from "./content-projection/idPath";
10
+ export type { IdPath, PathSegment } from "./content-projection/idPath";
11
+ export { classifyField, findFieldByPath, hasFields, isBlockItem, isTabsField, matchElementById, resolveBlockFields, tabScopes, walkFields, } from "./field-traversal";
12
+ export type { ArrayFieldLike, BlockLike, BlocksFieldLike, FieldLike, FieldStructure, FieldWalker, GroupFieldLike, LeafField, LeafFieldLike, TabLike, TabScope, TabsFieldLike, } from "./field-traversal";
@@ -0,0 +1,15 @@
1
+ // Framework-agnostic translator core. No payload / @payloadcms / next / react.
2
+ // The plugin (adapter) re-exports the public bits from here.
3
+ // Translation provider PORT (contract) only — dependency-free. The built-in OpenAI
4
+ // implementation lives in the plugin src/providers (outside core) so this barrel never pulls `openai`.
5
+ // Translation pipeline
6
+ export { TranslationPipeline, translateContent } from "./translation-pipeline";
7
+ // Content projection
8
+ export { projectTranslatableContent } from "./content-projection/contentProjector";
9
+ export { fingerprint } from "./content-projection/fingerprinter";
10
+ export { computeSourceFingerprint } from "./content-projection/computeSourceFingerprint";
11
+ export { makeIdPath } from "./content-projection/idPath";
12
+ // Field traversal
13
+ export { classifyField, findFieldByPath, hasFields, isBlockItem, isTabsField, matchElementById, resolveBlockFields, tabScopes, walkFields } from "./field-traversal";
14
+
15
+ //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import type { SerializedLexicalNode, SerializedTextNodeRef } from './types';
1
+ import type { SerializedLexicalNode, SerializedTextNodeRef } from "./types";
2
2
  /**
3
3
  * Traverses serialized Lexical JSON and returns all non-empty text node references.
4
4
  * Only collects text nodes with content (after trimming whitespace).
@@ -1,4 +1,4 @@
1
- import { hasChildren, isSerializedLexicalTextNode } from './guards';
1
+ import { hasChildren, isSerializedLexicalTextNode } from "./guards";
2
2
  /**
3
3
  * Recursively collects text node references from serialized Lexical JSON.
4
4
  */ function collectTextNodesRecursive(node, refs) {
@@ -1,4 +1,4 @@
1
- import type { SerializedLexicalNode, SerializedLexicalRoot, SerializedTextNode } from './types';
1
+ import type { SerializedLexicalNode, SerializedLexicalRoot, SerializedTextNode } from "./types";
2
2
  /**
3
3
  * Node with children property.
4
4
  */
@@ -1,18 +1,18 @@
1
- import { isObject } from '../utils';
1
+ import { isObject } from "../utils/isObject";
2
2
  /**
3
3
  * Type guard: Checks if value is a serialized Lexical root structure.
4
4
  */ export function isSerializedLexicalRoot(value) {
5
- return isObject(value) && 'root' in value && isObject(value.root);
5
+ return isObject(value) && "root" in value && isObject(value.root);
6
6
  }
7
7
  /**
8
8
  * Type guard: Checks if node is a serialized Lexical text node.
9
9
  */ export function isSerializedLexicalTextNode(node) {
10
- return node.type === 'text' && 'text' in node && typeof node.text === 'string';
10
+ return node.type === "text" && "text" in node && typeof node.text === "string";
11
11
  }
12
12
  /**
13
13
  * Type guard: Checks if node has children array.
14
14
  */ export function hasChildren(node) {
15
- return 'children' in node && Array.isArray(node.children);
15
+ return "children" in node && Array.isArray(node.children);
16
16
  }
17
17
 
18
18
  //# sourceMappingURL=guards.js.map
@@ -0,0 +1,6 @@
1
+ export type { SerializedTextNodeRef, SerializedLexicalRoot, SerializedLexicalNode, SerializedTextNode, SerializedRootNode, } from "./types";
2
+ export type { SerializedLexicalNodeWithChildren } from "./guards";
3
+ export { isSerializedLexicalRoot, isSerializedLexicalTextNode, hasChildren } from "./guards";
4
+ export { isEmptyRichText } from "./isEmptyRichText";
5
+ export { traverseLexicalTree } from "./traverseLexicalTree";
6
+ export { collectSerializedLexicalTextNodes } from "./collectTextNodes";
@@ -0,0 +1,6 @@
1
+ export { isSerializedLexicalRoot, isSerializedLexicalTextNode, hasChildren } from "./guards";
2
+ export { isEmptyRichText } from "./isEmptyRichText";
3
+ export { traverseLexicalTree } from "./traverseLexicalTree";
4
+ export { collectSerializedLexicalTextNodes } from "./collectTextNodes";
5
+
6
+ //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import type { SerializedLexicalRoot } from './types';
1
+ import type { SerializedLexicalRoot } from "./types";
2
2
  /**
3
3
  * Checks if a serialized Lexical richText structure is empty.
4
4
  *
@@ -1,5 +1,5 @@
1
- import { traverseLexicalTree } from './traverseLexicalTree';
2
- import { isSerializedLexicalTextNode } from './guards';
1
+ import { traverseLexicalTree } from "./traverseLexicalTree";
2
+ import { isSerializedLexicalTextNode } from "./guards";
3
3
  /**
4
4
  * Checks if a serialized Lexical richText structure is empty.
5
5
  *
@@ -14,7 +14,7 @@ import { isSerializedLexicalTextNode } from './guards';
14
14
  let hasContent = false;
15
15
  traverseLexicalTree(value.root, (node)=>{
16
16
  const { type } = node;
17
- if (type !== 'paragraph' && type !== 'text' && type !== 'root') {
17
+ if (type !== "paragraph" && type !== "text" && type !== "root") {
18
18
  hasContent = true;
19
19
  return false;
20
20
  }
@@ -1,4 +1,4 @@
1
- import type { SerializedLexicalNode } from './types';
1
+ import type { SerializedLexicalNode } from "./types";
2
2
  /**
3
3
  * Traverses serialized Lexical tree depth-first and calls visitor for each node.
4
4
  * Stops early if visitor returns false.
@@ -1,4 +1,4 @@
1
- import { hasChildren } from './guards';
1
+ import { hasChildren } from "./guards";
2
2
  /**
3
3
  * Traverses serialized Lexical tree depth-first and calls visitor for each node.
4
4
  * Stops early if visitor returns false.
@@ -0,0 +1,33 @@
1
+ /**
2
+ * Locally-owned structural views of the serialized Lexical JSON stored in Payload richText
3
+ * fields. Defined here (rather than imported from `@payloadcms/richtext-lexical`) so this layer
4
+ * stays framework-agnostic for the `@repo/translator-core` extraction. They are intentionally a
5
+ * structural SUPERSET of what this package reads (`type`, `text`, `children`) — Payload's concrete
6
+ * `Serialized*` nodes remain assignable to them (guarded by `types.conformance.test.ts`).
7
+ */
8
+ /** Base serialized Lexical node. `version` is carried by real nodes but never read here. */
9
+ export type SerializedLexicalNode = {
10
+ type: string;
11
+ version?: number;
12
+ };
13
+ /** A serialized text node — the only node whose `text` this package translates (and mutates). */
14
+ export type SerializedTextNode = SerializedLexicalNode & {
15
+ text: string;
16
+ };
17
+ /** An element node that carries children (e.g. the editor root, paragraphs). */
18
+ export type SerializedRootNode = SerializedLexicalNode & {
19
+ children: SerializedLexicalNode[];
20
+ };
21
+ /**
22
+ * Serialized Lexical root structure as stored in Payload CMS richText fields.
23
+ * Wraps the root node in a { root: ... } object.
24
+ */
25
+ export type SerializedLexicalRoot = {
26
+ root: SerializedLexicalNode;
27
+ };
28
+ /**
29
+ * Reference to a serialized text node for mutation during translation.
30
+ */
31
+ export type SerializedTextNodeRef = {
32
+ node: SerializedTextNode;
33
+ };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Locally-owned structural views of the serialized Lexical JSON stored in Payload richText
3
+ * fields. Defined here (rather than imported from `@payloadcms/richtext-lexical`) so this layer
4
+ * stays framework-agnostic for the `@repo/translator-core` extraction. They are intentionally a
5
+ * structural SUPERSET of what this package reads (`type`, `text`, `children`) — Payload's concrete
6
+ * `Serialized*` nodes remain assignable to them (guarded by `types.conformance.test.ts`).
7
+ */ /** Base serialized Lexical node. `version` is carried by real nodes but never read here. */ /**
8
+ * Reference to a serialized text node for mutation during translation.
9
+ */ export { };
10
+
11
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1,99 @@
1
+ /**
2
+ * Translation provenance — the durable record of *what source state a target locale was translated
3
+ * from* (design: `docs/plans/2026-06-26-translation-provenance-and-lifecycle-design.md`).
4
+ *
5
+ * These are framework-agnostic contracts: plain data plus a storage port, with no Payload types, so
6
+ * they live in the core. Only the Payload-backed implementation of {@link ProvenanceStore} (in the
7
+ * plugin adapter) knows about Payload.
8
+ */
9
+ /**
10
+ * One provenance receipt: a single `(collection, document, target locale)` translation.
11
+ *
12
+ * `documentId` is always a string (Payload ids may be string or number — callers stringify on the
13
+ * way in) and `translatedAt` is an ISO-8601 string, so the record shape is stable across databases.
14
+ *
15
+ * @since 0.7.0
16
+ */
17
+ export interface TranslationProvenanceRecord {
18
+ /** Slug of the translated collection. */
19
+ collectionSlug: string;
20
+ /** Stringified id of the translated document. */
21
+ documentId: string;
22
+ /** Locale that was written (translated into). */
23
+ targetLocale: string;
24
+ /** Locale the translation was derived from. */
25
+ sourceLocale: string;
26
+ /**
27
+ * Fingerprint of the source content at translation time —
28
+ * `fingerprint(projectTranslatableContent(sourceDoc, schema))`. Staleness (later, in #50) is
29
+ * `currentSourceFingerprint !== sourceFingerprint`.
30
+ */
31
+ sourceFingerprint: string;
32
+ /** ISO-8601 timestamp of the last successful translation. */
33
+ translatedAt: string;
34
+ /**
35
+ * The source fingerprint an editor acknowledged as "stale but leave it" (#50's dismissable
36
+ * indicator). `null` until dismissed. Written by #50 — carried here now so no later migration is
37
+ * needed.
38
+ */
39
+ dismissedFingerprint: string | null;
40
+ }
41
+ /**
42
+ * The composite key that identifies exactly one provenance record. Also the {@link ProvenanceStore}
43
+ * `upsert`/`find` match key.
44
+ *
45
+ * @since 0.7.0
46
+ */
47
+ export interface ProvenanceKey {
48
+ /** Slug of the translated collection. */
49
+ collectionSlug: string;
50
+ /** Stringified id of the translated document. */
51
+ documentId: string;
52
+ /** Locale that was written (translated into). */
53
+ targetLocale: string;
54
+ }
55
+ /**
56
+ * Storage port for translation provenance. The core depends only on this interface; the plugin
57
+ * supplies a Payload-backed implementation. Kept minimal so it maps cleanly onto any store.
58
+ *
59
+ * @since 0.7.0
60
+ *
61
+ * @example
62
+ * ```ts
63
+ * const store: ProvenanceStore = new PayloadProvenanceStore(payload, "translator-provenance");
64
+ * await store.upsert({
65
+ * collectionSlug: "posts",
66
+ * documentId: "42",
67
+ * targetLocale: "de",
68
+ * sourceLocale: "en",
69
+ * sourceFingerprint: fp,
70
+ * translatedAt: new Date().toISOString(),
71
+ * dismissedFingerprint: null,
72
+ * });
73
+ * const record = await store.find({ collectionSlug: "posts", documentId: "42", targetLocale: "de" });
74
+ * ```
75
+ */
76
+ export interface ProvenanceStore {
77
+ /**
78
+ * Create the record, or update it in place if one already exists for its
79
+ * `(collectionSlug, documentId, targetLocale)` key. Never produces a duplicate for the same key.
80
+ *
81
+ * @param record - The provenance receipt to persist.
82
+ */
83
+ upsert(record: TranslationProvenanceRecord): Promise<void>;
84
+ /**
85
+ * Look up the record for a key.
86
+ *
87
+ * @param key - The `(collectionSlug, documentId, targetLocale)` identity.
88
+ * @returns The stored record, or `null` if none exists.
89
+ */
90
+ find(key: ProvenanceKey): Promise<TranslationProvenanceRecord | null>;
91
+ /**
92
+ * Delete every record for a document (all target locales). Used to cascade-clean when the source
93
+ * document is deleted.
94
+ *
95
+ * @param collectionSlug - Slug of the deleted document's collection.
96
+ * @param documentId - Stringified id of the deleted document.
97
+ */
98
+ deleteByDocument(collectionSlug: string, documentId: string): Promise<void>;
99
+ }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Translation provenance — the durable record of *what source state a target locale was translated
3
+ * from* (design: `docs/plans/2026-06-26-translation-provenance-and-lifecycle-design.md`).
4
+ *
5
+ * These are framework-agnostic contracts: plain data plus a storage port, with no Payload types, so
6
+ * they live in the core. Only the Payload-backed implementation of {@link ProvenanceStore} (in the
7
+ * plugin adapter) knows about Payload.
8
+ */ /**
9
+ * One provenance receipt: a single `(collection, document, target locale)` translation.
10
+ *
11
+ * `documentId` is always a string (Payload ids may be string or number — callers stringify on the
12
+ * way in) and `translatedAt` is an ISO-8601 string, so the record shape is stable across databases.
13
+ *
14
+ * @since 0.7.0
15
+ */ /**
16
+ * Storage port for translation provenance. The core depends only on this interface; the plugin
17
+ * supplies a Payload-backed implementation. Kept minimal so it maps cleanly onto any store.
18
+ *
19
+ * @since 0.7.0
20
+ *
21
+ * @example
22
+ * ```ts
23
+ * const store: ProvenanceStore = new PayloadProvenanceStore(payload, "translator-provenance");
24
+ * await store.upsert({
25
+ * collectionSlug: "posts",
26
+ * documentId: "42",
27
+ * targetLocale: "de",
28
+ * sourceLocale: "en",
29
+ * sourceFingerprint: fp,
30
+ * translatedAt: new Date().toISOString(),
31
+ * dismissedFingerprint: null,
32
+ * });
33
+ * const record = await store.find({ collectionSlug: "posts", documentId: "42", targetLocale: "de" });
34
+ * ```
35
+ */ export { };
36
+
37
+ //# sourceMappingURL=ProvenanceStore.interface.js.map
@@ -0,0 +1 @@
1
+ export type { ProvenanceKey, ProvenanceStore, TranslationProvenanceRecord, } from "./ProvenanceStore.interface";
@@ -0,0 +1,5 @@
1
+ // Provenance contracts (port + record types) only — payload-free. The Payload-backed store lives
2
+ // in the plugin (src/server/modules/provenance), outside the core.
3
+ export { };
4
+
5
+ //# sourceMappingURL=index.js.map
@@ -1,7 +1,7 @@
1
- import type { TranslationProvider } from '../translation-providers';
2
- import type { PipelineConfig, PipelineResult } from './types';
3
- import type { TranslationStrategy } from './strategies';
4
- import type { TextExpander } from './stages';
1
+ import type { TranslationProvider } from "../translation-providers";
2
+ import type { PipelineConfig, PipelineResult } from "./types";
3
+ import type { TranslationStrategy } from "./strategies";
4
+ import type { TextExpander } from "./stages";
5
5
  /**
6
6
  * Options for TranslationPipeline.
7
7
  */
@@ -1,4 +1,4 @@
1
- import { DataReconcilerStage, FieldChunkCollectorStage, TranslationStage, TextChunkExpanderStage, TranslationMutatorStage } from './stages';
1
+ import { DataReconcilerStage, FieldChunkCollectorStage, TranslationStage, TextChunkExpanderStage, TranslationMutatorStage } from "./stages";
2
2
  /**
3
3
  * Main orchestrator for the translation pipeline.
4
4
  * Coordinates all stages in sequence via PipelineContext.
@@ -1,4 +1,4 @@
1
- import type { Field } from "payload";
1
+ import type { FieldLike } from "../../../field-traversal";
2
2
  /**
3
3
  * Deep-merges source and target data with target priority, producing the full document shape
4
4
  * Payload validation needs. Built on the shared {@link walkFields} engine.
@@ -7,7 +7,7 @@ import type { Field } from "payload";
7
7
  */
8
8
  export declare class DataReconciler {
9
9
  private readonly schema;
10
- constructor(schema: Field[]);
10
+ constructor(schema: FieldLike[]);
11
11
  /**
12
12
  * Reconciles source and target data into a complete document shape.
13
13
  *
@@ -1,5 +1,6 @@
1
- import { isEmpty, isObject } from "../../../../shared";
2
- import { matchElementById, resolveBlockFields, walkFields } from "../../../../shared/field-traversal";
1
+ import { isEmpty } from "../../../utils/isEmpty";
2
+ import { isObject } from "../../../utils/isObject";
3
+ import { matchElementById, resolveBlockFields, walkFields } from "../../../field-traversal";
3
4
  const asObject = (value)=>isObject(value) ? value : {};
4
5
  /**
5
6
  * Reconcile walker: produces the full document shape from source + target, with target
@@ -0,0 +1,2 @@
1
+ export { DataReconciler } from "./DataReconciler";
2
+ export { DataReconcilerStage } from "./DataReconciler.stage";
@@ -0,0 +1,4 @@
1
+ export { DataReconciler } from "./DataReconciler";
2
+ export { DataReconcilerStage } from "./DataReconciler.stage";
3
+
4
+ //# sourceMappingURL=index.js.map
@@ -1,4 +1,4 @@
1
- import type { Field } from "payload";
1
+ import type { FieldLike } from "../../../field-traversal";
2
2
  import type { TranslationStrategy } from "../../strategies";
3
3
  import type { FieldChunk } from "../../types";
4
4
  /**
@@ -22,7 +22,7 @@ export declare class FieldChunkCollector {
22
22
  private readonly sourceData;
23
23
  private readonly targetData;
24
24
  private readonly strategy;
25
- constructor(schema: Field[], filteredData: Record<string, unknown>, sourceData: Record<string, unknown>, targetData: Record<string, unknown>, strategy: TranslationStrategy);
25
+ constructor(schema: FieldLike[], filteredData: Record<string, unknown>, sourceData: Record<string, unknown>, targetData: Record<string, unknown>, strategy: TranslationStrategy);
26
26
  /** Collects translatable field chunks that need translation. */
27
27
  collect(): FieldChunk[];
28
28
  }
@@ -1,5 +1,6 @@
1
- import { isFieldExcludedFromTranslation, isLocalizedField, isObject, isTranslatableField } from "../../../../shared";
2
- import { matchElementById, resolveBlockFields, walkFields } from "../../../../shared/field-traversal";
1
+ import { isTranslatableLeaf } from "../../../content-projection/translatableLeaf";
2
+ import { matchElementById, resolveBlockFields, walkFields } from "../../../field-traversal";
3
+ import { isObject } from "../../../utils/isObject";
3
4
  const asObject = (value)=>isObject(value) ? value : {};
4
5
  /**
5
6
  * Collects FieldChunks by walking schema + data with the shared {@link walkFields} engine.
@@ -29,6 +30,10 @@ const asObject = (value)=>isObject(value) ? value : {};
29
30
  this.strategy = strategy;
30
31
  }
31
32
  /** Collects translatable field chunks that need translation. */ collect() {
33
+ // The read walk SELECTS translatable leaves (via the shared selection core) and records, per
34
+ // selected leaf, the source value to translate plus its write target. The mutation is applied
35
+ // in a separate explicit pass below — read and write are no longer fused inside the walk.
36
+ const selected = [];
32
37
  const chunks = [];
33
38
  const { strategy } = this;
34
39
  const walker = {
@@ -83,11 +88,15 @@ const asObject = (value)=>isObject(value) ? value : {};
83
88
  if (value === undefined || value === null) return undefined;
84
89
  const sourceValue = cursor.source[field.name];
85
90
  const targetValue = cursor.target[field.name];
86
- if (isTranslatableField(field) && isLocalizedField(field) && !isFieldExcludedFromTranslation(field) && strategy.shouldTranslate({
91
+ if (isTranslatableLeaf(field) && strategy.shouldTranslate({
87
92
  sourceValue,
88
93
  targetValue
89
94
  })) {
90
- cursor.data[field.name] = sourceValue; // write source value into filteredData — this is what gets translated
95
+ selected.push({
96
+ dataRef: cursor.data,
97
+ key: field.name,
98
+ sourceValue
99
+ });
91
100
  chunks.push({
92
101
  schema: field,
93
102
  dataRef: cursor.data,
@@ -110,6 +119,11 @@ const asObject = (value)=>isObject(value) ? value : {};
110
119
  target: this.targetData,
111
120
  path: []
112
121
  }, walker);
122
+ // Apply pass: write each selected leaf's source value into filteredData — this is what gets
123
+ // translated. Kept separate from the read walk above so selection stays read-only.
124
+ for (const { dataRef, key, sourceValue } of selected){
125
+ dataRef[key] = sourceValue;
126
+ }
113
127
  return chunks;
114
128
  }
115
129
  }
@@ -1,5 +1,5 @@
1
- import type { PipelineContext, PipelineStage } from '../../types';
2
- import type { TranslationStrategy } from '../../strategies';
1
+ import type { PipelineContext, PipelineStage } from "../../types";
2
+ import type { TranslationStrategy } from "../../strategies";
3
3
  /**
4
4
  * Collects FieldChunks with schema metadata and data references.
5
5
  * Applies all filtering logic including strategy.shouldTranslate().
@@ -1,4 +1,4 @@
1
- import { FieldChunkCollector } from './FieldChunkCollector';
1
+ import { FieldChunkCollector } from "./FieldChunkCollector";
2
2
  /**
3
3
  * Collects FieldChunks with schema metadata and data references.
4
4
  * Applies all filtering logic including strategy.shouldTranslate().
@@ -10,7 +10,7 @@ import { FieldChunkCollector } from './FieldChunkCollector';
10
10
  }
11
11
  execute(ctx) {
12
12
  if (!ctx.filteredData) {
13
- throw new Error('FieldChunkCollectorStage requires filteredData from previous stage');
13
+ throw new Error("FieldChunkCollectorStage requires filteredData from previous stage");
14
14
  }
15
15
  const collector = new FieldChunkCollector(ctx.schema, ctx.filteredData, ctx.sourceData, ctx.targetData, this.strategy);
16
16
  return {
@@ -0,0 +1,2 @@
1
+ export { FieldChunkCollector } from "./FieldChunkCollector";
2
+ export { FieldChunkCollectorStage } from "./FieldChunkCollector.stage";
@@ -0,0 +1,4 @@
1
+ export { FieldChunkCollector } from "./FieldChunkCollector";
2
+ export { FieldChunkCollectorStage } from "./FieldChunkCollector.stage";
3
+
4
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1,6 @@
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";
@@ -0,0 +1,7 @@
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,5 +1,5 @@
1
- import type { FieldChunk } from '../../types';
2
- import type { ExpansionResult, TextExpander } from './TextExpander.interface';
1
+ import type { FieldChunk } from "../../types";
2
+ import type { ExpansionResult, TextExpander } from "./TextExpander.interface";
3
3
  /**
4
4
  * Expands plain text and textarea fields into PlainTextChunks.
5
5
  */
@@ -2,12 +2,12 @@
2
2
  * Expands plain text and textarea fields into PlainTextChunks.
3
3
  */ export class PlainTextExpander {
4
4
  canExpand(_chunk, value) {
5
- return typeof value === 'string' && value.trim().length > 0;
5
+ return typeof value === "string" && value.trim().length > 0;
6
6
  }
7
7
  expand(chunk, value, startIndex) {
8
8
  const text = value;
9
9
  const textChunk = {
10
- type: 'plain',
10
+ type: "plain",
11
11
  index: startIndex,
12
12
  text,
13
13
  dataRef: chunk.dataRef,
@@ -1,5 +1,5 @@
1
- import type { FieldChunk } from '../../types';
2
- import type { ExpansionResult, TextExpander } from './TextExpander.interface';
1
+ import type { FieldChunk } from "../../types";
2
+ import type { ExpansionResult, TextExpander } from "./TextExpander.interface";
3
3
  /**
4
4
  * Expands richText fields into multiple RichTextChunks (one per text node).
5
5
  */
@@ -1,9 +1,9 @@
1
- import { isSerializedLexicalRoot, collectSerializedLexicalTextNodes } from '../../../../shared/lexical';
1
+ import { isSerializedLexicalRoot, collectSerializedLexicalTextNodes } from "../../../lexical";
2
2
  /**
3
3
  * Expands richText fields into multiple RichTextChunks (one per text node).
4
4
  */ export class RichTextExpander {
5
5
  canExpand(chunk, value) {
6
- return chunk.schema.type === 'richText' && isSerializedLexicalRoot(value);
6
+ return chunk.schema.type === "richText" && isSerializedLexicalRoot(value);
7
7
  }
8
8
  expand(_chunk, value, startIndex) {
9
9
  const root = value;
@@ -13,7 +13,7 @@ import { isSerializedLexicalRoot, collectSerializedLexicalTextNodes } from '../.
13
13
  let index = startIndex;
14
14
  for (const ref of textNodeRefs){
15
15
  chunks.push({
16
- type: 'richText',
16
+ type: "richText",
17
17
  index,
18
18
  text: ref.node.text,
19
19
  nodeRef: ref.node
@@ -1,5 +1,5 @@
1
- import type { FieldChunk, TextChunk } from '../../types';
2
- import type { TextExpander } from './TextExpander.interface';
1
+ import type { FieldChunk, TextChunk } from "../../types";
2
+ import type { TextExpander } from "./TextExpander.interface";
3
3
  /**
4
4
  * Result of text chunk expansion.
5
5
  */
@@ -1,5 +1,5 @@
1
- import type { PipelineContext, PipelineStage } from '../../types';
2
- import type { TextExpander } from './TextExpander.interface';
1
+ import type { PipelineContext, PipelineStage } from "../../types";
2
+ import type { TextExpander } from "./TextExpander.interface";
3
3
  /**
4
4
  * Expands FieldChunks to TextChunks (schema-free).
5
5
  */
@@ -1,6 +1,6 @@
1
- import { TextChunkExpander } from './TextChunkExpander';
2
- import { RichTextExpander } from './RichTextExpander';
3
- import { PlainTextExpander } from './PlainTextExpander';
1
+ import { TextChunkExpander } from "./TextChunkExpander";
2
+ import { RichTextExpander } from "./RichTextExpander";
3
+ import { PlainTextExpander } from "./PlainTextExpander";
4
4
  const defaultExpanders = [
5
5
  new RichTextExpander(),
6
6
  new PlainTextExpander()
@@ -14,7 +14,7 @@ const defaultExpanders = [
14
14
  }
15
15
  execute(ctx) {
16
16
  if (!ctx.fieldChunks) {
17
- throw new Error('TextChunkExpanderStage requires fieldChunks from previous stage');
17
+ throw new Error("TextChunkExpanderStage requires fieldChunks from previous stage");
18
18
  }
19
19
  const expander = new TextChunkExpander(this.expanders);
20
20
  const { textChunks, textMap } = expander.expand(ctx.fieldChunks);
@@ -1,4 +1,4 @@
1
- import type { FieldChunk, TextChunk } from '../../types';
1
+ import type { FieldChunk, TextChunk } from "../../types";
2
2
  /**
3
3
  * Result of text expansion for a single FieldChunk.
4
4
  */
@@ -0,0 +1,6 @@
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";
@@ -0,0 +1,6 @@
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