@focus-reactive/payload-plugin-comments 1.1.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 (387) hide show
  1. package/README.md +562 -0
  2. package/dist/collection/access/isAuth.d.ts +3 -0
  3. package/dist/collection/access/isAuth.d.ts.map +1 -0
  4. package/dist/collection/access/isAuth.js +8 -0
  5. package/dist/collection/access/isAuth.js.map +1 -0
  6. package/dist/collection/hooks/setAuthorBeforeCreate.d.ts +3 -0
  7. package/dist/collection/hooks/setAuthorBeforeCreate.d.ts.map +1 -0
  8. package/dist/collection/hooks/setAuthorBeforeCreate.js +10 -0
  9. package/dist/collection/hooks/setAuthorBeforeCreate.js.map +1 -0
  10. package/dist/collection/hooks/setTenantBeforeCreate.d.ts +3 -0
  11. package/dist/collection/hooks/setTenantBeforeCreate.d.ts.map +1 -0
  12. package/dist/collection/hooks/setTenantBeforeCreate.js +24 -0
  13. package/dist/collection/hooks/setTenantBeforeCreate.js.map +1 -0
  14. package/dist/collection/index.d.ts +4 -0
  15. package/dist/collection/index.d.ts.map +1 -0
  16. package/dist/collection/index.js +139 -0
  17. package/dist/collection/index.js.map +1 -0
  18. package/dist/components/Avatar/index.d.ts +11 -0
  19. package/dist/components/Avatar/index.d.ts.map +1 -0
  20. package/dist/components/Avatar/index.js +11 -0
  21. package/dist/components/Avatar/index.js.map +1 -0
  22. package/dist/components/CommentEditor/ActionPanel.d.ts +8 -0
  23. package/dist/components/CommentEditor/ActionPanel.d.ts.map +1 -0
  24. package/dist/components/CommentEditor/ActionPanel.js +17 -0
  25. package/dist/components/CommentEditor/ActionPanel.js.map +1 -0
  26. package/dist/components/CommentEditor/index.d.ts +23 -0
  27. package/dist/components/CommentEditor/index.d.ts.map +1 -0
  28. package/dist/components/CommentEditor/index.js +265 -0
  29. package/dist/components/CommentEditor/index.js.map +1 -0
  30. package/dist/components/CommentItem/ToolsPanel.d.ts +9 -0
  31. package/dist/components/CommentItem/ToolsPanel.d.ts.map +1 -0
  32. package/dist/components/CommentItem/ToolsPanel.js +22 -0
  33. package/dist/components/CommentItem/ToolsPanel.js.map +1 -0
  34. package/dist/components/CommentItem/index.d.ts +8 -0
  35. package/dist/components/CommentItem/index.d.ts.map +1 -0
  36. package/dist/components/CommentItem/index.js +65 -0
  37. package/dist/components/CommentItem/index.js.map +1 -0
  38. package/dist/components/CommentsDrawer/components/Header.d.ts +6 -0
  39. package/dist/components/CommentsDrawer/components/Header.d.ts.map +1 -0
  40. package/dist/components/CommentsDrawer/components/Header.js +46 -0
  41. package/dist/components/CommentsDrawer/components/Header.js.map +1 -0
  42. package/dist/components/CommentsDrawer/index.d.ts +6 -0
  43. package/dist/components/CommentsDrawer/index.d.ts.map +1 -0
  44. package/dist/components/CommentsDrawer/index.js +30 -0
  45. package/dist/components/CommentsDrawer/index.js.map +1 -0
  46. package/dist/components/CommentsHeaderButton/index.d.ts +2 -0
  47. package/dist/components/CommentsHeaderButton/index.d.ts.map +1 -0
  48. package/dist/components/CommentsHeaderButton/index.js +19 -0
  49. package/dist/components/CommentsHeaderButton/index.js.map +1 -0
  50. package/dist/components/CommentsPanel/components/CollapsibleGroup.d.ts +10 -0
  51. package/dist/components/CommentsPanel/components/CollapsibleGroup.d.ts.map +1 -0
  52. package/dist/components/CommentsPanel/components/CollapsibleGroup.js +68 -0
  53. package/dist/components/CommentsPanel/components/CollapsibleGroup.js.map +1 -0
  54. package/dist/components/CommentsPanel/components/DocumentView.d.ts +9 -0
  55. package/dist/components/CommentsPanel/components/DocumentView.d.ts.map +1 -0
  56. package/dist/components/CommentsPanel/components/DocumentView.js +20 -0
  57. package/dist/components/CommentsPanel/components/DocumentView.js.map +1 -0
  58. package/dist/components/CommentsPanel/components/FieldGroupSection.d.ts +11 -0
  59. package/dist/components/CommentsPanel/components/FieldGroupSection.d.ts.map +1 -0
  60. package/dist/components/CommentsPanel/components/FieldGroupSection.js +62 -0
  61. package/dist/components/CommentsPanel/components/FieldGroupSection.js.map +1 -0
  62. package/dist/components/CommentsPanel/components/GlobalDocumentView.d.ts +9 -0
  63. package/dist/components/CommentsPanel/components/GlobalDocumentView.d.ts.map +1 -0
  64. package/dist/components/CommentsPanel/components/GlobalDocumentView.js +20 -0
  65. package/dist/components/CommentsPanel/components/GlobalDocumentView.js.map +1 -0
  66. package/dist/components/CommentsPanel/components/GlobalView.d.ts +9 -0
  67. package/dist/components/CommentsPanel/components/GlobalView.d.ts.map +1 -0
  68. package/dist/components/CommentsPanel/components/GlobalView.js +62 -0
  69. package/dist/components/CommentsPanel/components/GlobalView.js.map +1 -0
  70. package/dist/components/CommentsPanel/constants.d.ts +3 -0
  71. package/dist/components/CommentsPanel/constants.d.ts.map +1 -0
  72. package/dist/components/CommentsPanel/constants.js +9 -0
  73. package/dist/components/CommentsPanel/constants.js.map +1 -0
  74. package/dist/components/CommentsPanel/hooks/useCollapseState.d.ts +2 -0
  75. package/dist/components/CommentsPanel/hooks/useCollapseState.d.ts.map +1 -0
  76. package/dist/components/CommentsPanel/hooks/useCollapseState.js +44 -0
  77. package/dist/components/CommentsPanel/hooks/useCollapseState.js.map +1 -0
  78. package/dist/components/CommentsPanel/hooks/useScrollToTargetFieldGroup.d.ts +2 -0
  79. package/dist/components/CommentsPanel/hooks/useScrollToTargetFieldGroup.d.ts.map +1 -0
  80. package/dist/components/CommentsPanel/hooks/useScrollToTargetFieldGroup.js +35 -0
  81. package/dist/components/CommentsPanel/hooks/useScrollToTargetFieldGroup.js.map +1 -0
  82. package/dist/components/CommentsPanel/index.d.ts +6 -0
  83. package/dist/components/CommentsPanel/index.d.ts.map +1 -0
  84. package/dist/components/CommentsPanel/index.js +32 -0
  85. package/dist/components/CommentsPanel/index.js.map +1 -0
  86. package/dist/components/CommentsPanel/types.d.ts +4 -0
  87. package/dist/components/CommentsPanel/types.d.ts.map +1 -0
  88. package/dist/components/CommentsPanel/types.js +1 -0
  89. package/dist/components/CommentsPanel/types.js.map +1 -0
  90. package/dist/components/CommentsPanel/utils/createCollapsibleGroupKey.d.ts +10 -0
  91. package/dist/components/CommentsPanel/utils/createCollapsibleGroupKey.d.ts.map +1 -0
  92. package/dist/components/CommentsPanel/utils/createCollapsibleGroupKey.js +15 -0
  93. package/dist/components/CommentsPanel/utils/createCollapsibleGroupKey.js.map +1 -0
  94. package/dist/components/CommentsPanel/utils/filterComments.d.ts +9 -0
  95. package/dist/components/CommentsPanel/utils/filterComments.d.ts.map +1 -0
  96. package/dist/components/CommentsPanel/utils/filterComments.js +17 -0
  97. package/dist/components/CommentsPanel/utils/filterComments.js.map +1 -0
  98. package/dist/components/CommentsPanel/utils/groupCommentsByFieldPath.d.ts +4 -0
  99. package/dist/components/CommentsPanel/utils/groupCommentsByFieldPath.d.ts.map +1 -0
  100. package/dist/components/CommentsPanel/utils/groupCommentsByFieldPath.js +14 -0
  101. package/dist/components/CommentsPanel/utils/groupCommentsByFieldPath.js.map +1 -0
  102. package/dist/components/CommentsPanel/utils/groupCommentsGlobally.d.ts +18 -0
  103. package/dist/components/CommentsPanel/utils/groupCommentsGlobally.d.ts.map +1 -0
  104. package/dist/components/CommentsPanel/utils/groupCommentsGlobally.js +58 -0
  105. package/dist/components/CommentsPanel/utils/groupCommentsGlobally.js.map +1 -0
  106. package/dist/components/CommentsPanel/utils/resolveEntityLabel.d.ts +3 -0
  107. package/dist/components/CommentsPanel/utils/resolveEntityLabel.d.ts.map +1 -0
  108. package/dist/components/CommentsPanel/utils/resolveEntityLabel.js +14 -0
  109. package/dist/components/CommentsPanel/utils/resolveEntityLabel.js.map +1 -0
  110. package/dist/components/CommentsPanel/utils/resolveFieldLabel.d.ts +11 -0
  111. package/dist/components/CommentsPanel/utils/resolveFieldLabel.d.ts.map +1 -0
  112. package/dist/components/CommentsPanel/utils/resolveFieldLabel.js +9 -0
  113. package/dist/components/CommentsPanel/utils/resolveFieldLabel.js.map +1 -0
  114. package/dist/components/CommentsPanel/utils/sortGroupsByCreatedAt.d.ts +4 -0
  115. package/dist/components/CommentsPanel/utils/sortGroupsByCreatedAt.d.ts.map +1 -0
  116. package/dist/components/CommentsPanel/utils/sortGroupsByCreatedAt.js +11 -0
  117. package/dist/components/CommentsPanel/utils/sortGroupsByCreatedAt.js.map +1 -0
  118. package/dist/components/FieldCommentLabel/AddCommentPopup.d.ts +8 -0
  119. package/dist/components/FieldCommentLabel/AddCommentPopup.d.ts.map +1 -0
  120. package/dist/components/FieldCommentLabel/AddCommentPopup.js +50 -0
  121. package/dist/components/FieldCommentLabel/AddCommentPopup.js.map +1 -0
  122. package/dist/components/FieldCommentLabel/hooks/useStablePath.d.ts +2 -0
  123. package/dist/components/FieldCommentLabel/hooks/useStablePath.d.ts.map +1 -0
  124. package/dist/components/FieldCommentLabel/hooks/useStablePath.js +12 -0
  125. package/dist/components/FieldCommentLabel/hooks/useStablePath.js.map +1 -0
  126. package/dist/components/FieldCommentLabel/index.d.ts +11 -0
  127. package/dist/components/FieldCommentLabel/index.d.ts.map +1 -0
  128. package/dist/components/FieldCommentLabel/index.js +64 -0
  129. package/dist/components/FieldCommentLabel/index.js.map +1 -0
  130. package/dist/components/FieldCommentLabel/types.d.ts +4 -0
  131. package/dist/components/FieldCommentLabel/types.d.ts.map +1 -0
  132. package/dist/components/FieldCommentLabel/types.js +1 -0
  133. package/dist/components/FieldCommentLabel/types.js.map +1 -0
  134. package/dist/components/FieldCommentLabel/utils/buildStablePath.d.ts +2 -0
  135. package/dist/components/FieldCommentLabel/utils/buildStablePath.d.ts.map +1 -0
  136. package/dist/components/FieldCommentLabel/utils/buildStablePath.js +19 -0
  137. package/dist/components/FieldCommentLabel/utils/buildStablePath.js.map +1 -0
  138. package/dist/components/FieldCommentLabel/utils/exludeComments.d.ts +3 -0
  139. package/dist/components/FieldCommentLabel/utils/exludeComments.d.ts.map +1 -0
  140. package/dist/components/FieldCommentLabel/utils/exludeComments.js +12 -0
  141. package/dist/components/FieldCommentLabel/utils/exludeComments.js.map +1 -0
  142. package/dist/components/FieldCommentLabel/utils/resolveLabel.d.ts +3 -0
  143. package/dist/components/FieldCommentLabel/utils/resolveLabel.d.ts.map +1 -0
  144. package/dist/components/FieldCommentLabel/utils/resolveLabel.js +9 -0
  145. package/dist/components/FieldCommentLabel/utils/resolveLabel.js.map +1 -0
  146. package/dist/components/IconButton/index.d.ts +12 -0
  147. package/dist/components/IconButton/index.d.ts.map +1 -0
  148. package/dist/components/IconButton/index.js +38 -0
  149. package/dist/components/IconButton/index.js.map +1 -0
  150. package/dist/components/MentionDropdown.d.ts +11 -0
  151. package/dist/components/MentionDropdown.d.ts.map +1 -0
  152. package/dist/components/MentionDropdown.js +53 -0
  153. package/dist/components/MentionDropdown.js.map +1 -0
  154. package/dist/components/MentionLabel/index.d.ts +7 -0
  155. package/dist/components/MentionLabel/index.d.ts.map +1 -0
  156. package/dist/components/MentionLabel/index.js +21 -0
  157. package/dist/components/MentionLabel/index.js.map +1 -0
  158. package/dist/config.d.ts +4 -0
  159. package/dist/config.d.ts.map +1 -0
  160. package/dist/config.js +17 -0
  161. package/dist/config.js.map +1 -0
  162. package/dist/constants.d.ts +9 -0
  163. package/dist/constants.d.ts.map +1 -0
  164. package/dist/constants.js +22 -0
  165. package/dist/constants.js.map +1 -0
  166. package/dist/hooks/useRelativeDate.d.ts +2 -0
  167. package/dist/hooks/useRelativeDate.d.ts.map +1 -0
  168. package/dist/hooks/useRelativeDate.js +11 -0
  169. package/dist/hooks/useRelativeDate.js.map +1 -0
  170. package/dist/index.d.ts +5 -0
  171. package/dist/index.d.ts.map +1 -0
  172. package/dist/index.js +7 -0
  173. package/dist/index.js.map +1 -0
  174. package/dist/plugin.d.ts +4 -0
  175. package/dist/plugin.d.ts.map +1 -0
  176. package/dist/plugin.js +60 -0
  177. package/dist/plugin.js.map +1 -0
  178. package/dist/providers/CommentsDrawerProvider/index.d.ts +14 -0
  179. package/dist/providers/CommentsDrawerProvider/index.d.ts.map +1 -0
  180. package/dist/providers/CommentsDrawerProvider/index.js +28 -0
  181. package/dist/providers/CommentsDrawerProvider/index.js.map +1 -0
  182. package/dist/providers/CommentsProvider/index.d.ts +39 -0
  183. package/dist/providers/CommentsProvider/index.d.ts.map +1 -0
  184. package/dist/providers/CommentsProvider/index.js +237 -0
  185. package/dist/providers/CommentsProvider/index.js.map +1 -0
  186. package/dist/providers/CommentsProvider/mergeDocumentTitles.d.ts +3 -0
  187. package/dist/providers/CommentsProvider/mergeDocumentTitles.d.ts.map +1 -0
  188. package/dist/providers/CommentsProvider/mergeDocumentTitles.js +10 -0
  189. package/dist/providers/CommentsProvider/mergeDocumentTitles.js.map +1 -0
  190. package/dist/providers/CommentsProviderWrapper/index.d.ts +7 -0
  191. package/dist/providers/CommentsProviderWrapper/index.d.ts.map +1 -0
  192. package/dist/providers/CommentsProviderWrapper/index.js +16 -0
  193. package/dist/providers/CommentsProviderWrapper/index.js.map +1 -0
  194. package/dist/providers/GlobalCommentsLoader/GlobalCommentsHydrator.d.ts +13 -0
  195. package/dist/providers/GlobalCommentsLoader/GlobalCommentsHydrator.d.ts.map +1 -0
  196. package/dist/providers/GlobalCommentsLoader/GlobalCommentsHydrator.js +22 -0
  197. package/dist/providers/GlobalCommentsLoader/GlobalCommentsHydrator.js.map +1 -0
  198. package/dist/providers/GlobalCommentsLoader/index.d.ts +10 -0
  199. package/dist/providers/GlobalCommentsLoader/index.d.ts.map +1 -0
  200. package/dist/providers/GlobalCommentsLoader/index.js +31 -0
  201. package/dist/providers/GlobalCommentsLoader/index.js.map +1 -0
  202. package/dist/services/createComment.d.ts +12 -0
  203. package/dist/services/createComment.d.ts.map +1 -0
  204. package/dist/services/createComment.js +83 -0
  205. package/dist/services/createComment.js.map +1 -0
  206. package/dist/services/deleteComment.d.ts +3 -0
  207. package/dist/services/deleteComment.d.ts.map +1 -0
  208. package/dist/services/deleteComment.js +34 -0
  209. package/dist/services/deleteComment.js.map +1 -0
  210. package/dist/services/fetchMentionableUsers.d.ts +3 -0
  211. package/dist/services/fetchMentionableUsers.d.ts.map +1 -0
  212. package/dist/services/fetchMentionableUsers.js +46 -0
  213. package/dist/services/fetchMentionableUsers.js.map +1 -0
  214. package/dist/services/fieldLabels/fetchFieldLabels.d.ts +3 -0
  215. package/dist/services/fieldLabels/fetchFieldLabels.d.ts.map +1 -0
  216. package/dist/services/fieldLabels/fetchFieldLabels.js +74 -0
  217. package/dist/services/fieldLabels/fetchFieldLabels.js.map +1 -0
  218. package/dist/services/fieldLabels/utils/groupFieldPathsByDocument.d.ts +5 -0
  219. package/dist/services/fieldLabels/utils/groupFieldPathsByDocument.d.ts.map +1 -0
  220. package/dist/services/fieldLabels/utils/groupFieldPathsByDocument.js +21 -0
  221. package/dist/services/fieldLabels/utils/groupFieldPathsByDocument.js.map +1 -0
  222. package/dist/services/fieldLabels/utils/resolveFieldPath.d.ts +4 -0
  223. package/dist/services/fieldLabels/utils/resolveFieldPath.d.ts.map +1 -0
  224. package/dist/services/fieldLabels/utils/resolveFieldPath.js +66 -0
  225. package/dist/services/fieldLabels/utils/resolveFieldPath.js.map +1 -0
  226. package/dist/services/fieldLabels/utils/schemaUtils.d.ts +6 -0
  227. package/dist/services/fieldLabels/utils/schemaUtils.d.ts.map +1 -0
  228. package/dist/services/fieldLabels/utils/schemaUtils.js +60 -0
  229. package/dist/services/fieldLabels/utils/schemaUtils.js.map +1 -0
  230. package/dist/services/findAllComments.d.ts +11 -0
  231. package/dist/services/findAllComments.d.ts.map +1 -0
  232. package/dist/services/findAllComments.js +47 -0
  233. package/dist/services/findAllComments.js.map +1 -0
  234. package/dist/services/getCurrentTenantId.d.ts +3 -0
  235. package/dist/services/getCurrentTenantId.d.ts.map +1 -0
  236. package/dist/services/getCurrentTenantId.js +13 -0
  237. package/dist/services/getCurrentTenantId.js.map +1 -0
  238. package/dist/services/getDocumentTitles.d.ts +3 -0
  239. package/dist/services/getDocumentTitles.d.ts.map +1 -0
  240. package/dist/services/getDocumentTitles.js +61 -0
  241. package/dist/services/getDocumentTitles.js.map +1 -0
  242. package/dist/services/getEntitiesLabels.d.ts +3 -0
  243. package/dist/services/getEntitiesLabels.d.ts.map +1 -0
  244. package/dist/services/getEntitiesLabels.js +14 -0
  245. package/dist/services/getEntitiesLabels.js.map +1 -0
  246. package/dist/services/resolveComment.d.ts +3 -0
  247. package/dist/services/resolveComment.d.ts.map +1 -0
  248. package/dist/services/resolveComment.js +41 -0
  249. package/dist/services/resolveComment.js.map +1 -0
  250. package/dist/services/sendMentionEmails.d.ts +11 -0
  251. package/dist/services/sendMentionEmails.d.ts.map +1 -0
  252. package/dist/services/sendMentionEmails.js +73 -0
  253. package/dist/services/sendMentionEmails.js.map +1 -0
  254. package/dist/services/syncAllCommentsData.d.ts +12 -0
  255. package/dist/services/syncAllCommentsData.d.ts.map +1 -0
  256. package/dist/services/syncAllCommentsData.js +48 -0
  257. package/dist/services/syncAllCommentsData.js.map +1 -0
  258. package/dist/styles.css +2 -0
  259. package/dist/translations/en.d.ts +5 -0
  260. package/dist/translations/en.d.ts.map +1 -0
  261. package/dist/translations/en.js +36 -0
  262. package/dist/translations/en.js.map +1 -0
  263. package/dist/translations/types.d.ts +32 -0
  264. package/dist/translations/types.d.ts.map +1 -0
  265. package/dist/translations/types.js +1 -0
  266. package/dist/translations/types.js.map +1 -0
  267. package/dist/types/base.d.ts +10 -0
  268. package/dist/types/base.d.ts.map +1 -0
  269. package/dist/types/base.js +1 -0
  270. package/dist/types/base.js.map +1 -0
  271. package/dist/types/collection.d.ts +2 -0
  272. package/dist/types/collection.d.ts.map +1 -0
  273. package/dist/types/collection.js +1 -0
  274. package/dist/types/collection.js.map +1 -0
  275. package/dist/types/comment.d.ts +23 -0
  276. package/dist/types/comment.d.ts.map +1 -0
  277. package/dist/types/comment.js +1 -0
  278. package/dist/types/comment.js.map +1 -0
  279. package/dist/types/config.d.ts +112 -0
  280. package/dist/types/config.d.ts.map +1 -0
  281. package/dist/types/config.js +1 -0
  282. package/dist/types/config.js.map +1 -0
  283. package/dist/types/entity.d.ts +15 -0
  284. package/dist/types/entity.d.ts.map +1 -0
  285. package/dist/types/entity.js +1 -0
  286. package/dist/types/entity.js.map +1 -0
  287. package/dist/types/general.d.ts +10 -0
  288. package/dist/types/general.d.ts.map +1 -0
  289. package/dist/types/general.js +1 -0
  290. package/dist/types/general.js.map +1 -0
  291. package/dist/types/index.d.ts +8 -0
  292. package/dist/types/index.d.ts.map +1 -0
  293. package/dist/types/index.js +1 -0
  294. package/dist/types/index.js.map +1 -0
  295. package/dist/types/user.d.ts +6 -0
  296. package/dist/types/user.d.ts.map +1 -0
  297. package/dist/types/user.js +1 -0
  298. package/dist/types/user.js.map +1 -0
  299. package/dist/utils/comment/extractVisibleComments.d.ts +13 -0
  300. package/dist/utils/comment/extractVisibleComments.d.ts.map +1 -0
  301. package/dist/utils/comment/extractVisibleComments.js +17 -0
  302. package/dist/utils/comment/extractVisibleComments.js.map +1 -0
  303. package/dist/utils/comment/filterCommentsByLocale.d.ts +3 -0
  304. package/dist/utils/comment/filterCommentsByLocale.d.ts.map +1 -0
  305. package/dist/utils/comment/filterCommentsByLocale.js +12 -0
  306. package/dist/utils/comment/filterCommentsByLocale.js.map +1 -0
  307. package/dist/utils/comment/renderCommentText.d.ts +12 -0
  308. package/dist/utils/comment/renderCommentText.d.ts.map +1 -0
  309. package/dist/utils/comment/renderCommentText.js +38 -0
  310. package/dist/utils/comment/renderCommentText.js.map +1 -0
  311. package/dist/utils/comment/serializeEditor.d.ts +2 -0
  312. package/dist/utils/comment/serializeEditor.d.ts.map +1 -0
  313. package/dist/utils/comment/serializeEditor.js +30 -0
  314. package/dist/utils/comment/serializeEditor.js.map +1 -0
  315. package/dist/utils/config/injectFieldCommentComponents.d.ts +4 -0
  316. package/dist/utils/config/injectFieldCommentComponents.d.ts.map +1 -0
  317. package/dist/utils/config/injectFieldCommentComponents.js +80 -0
  318. package/dist/utils/config/injectFieldCommentComponents.js.map +1 -0
  319. package/dist/utils/config/mergeTranslations.d.ts +3 -0
  320. package/dist/utils/config/mergeTranslations.d.ts.map +1 -0
  321. package/dist/utils/config/mergeTranslations.js +29 -0
  322. package/dist/utils/config/mergeTranslations.js.map +1 -0
  323. package/dist/utils/config/normalizeCollections.d.ts +7 -0
  324. package/dist/utils/config/normalizeCollections.d.ts.map +1 -0
  325. package/dist/utils/config/normalizeCollections.js +15 -0
  326. package/dist/utils/config/normalizeCollections.js.map +1 -0
  327. package/dist/utils/config/overrideCollections.d.ts +3 -0
  328. package/dist/utils/config/overrideCollections.d.ts.map +1 -0
  329. package/dist/utils/config/overrideCollections.js +38 -0
  330. package/dist/utils/config/overrideCollections.js.map +1 -0
  331. package/dist/utils/config/overrideCommentsCollection.d.ts +4 -0
  332. package/dist/utils/config/overrideCommentsCollection.d.ts.map +1 -0
  333. package/dist/utils/config/overrideCommentsCollection.js +14 -0
  334. package/dist/utils/config/overrideCommentsCollection.js.map +1 -0
  335. package/dist/utils/config/overrideGlobals.d.ts +3 -0
  336. package/dist/utils/config/overrideGlobals.d.ts.map +1 -0
  337. package/dist/utils/config/overrideGlobals.js +8 -0
  338. package/dist/utils/config/overrideGlobals.js.map +1 -0
  339. package/dist/utils/error/getDefaultErrorMessage.d.ts +2 -0
  340. package/dist/utils/error/getDefaultErrorMessage.d.ts.map +1 -0
  341. package/dist/utils/error/getDefaultErrorMessage.js +9 -0
  342. package/dist/utils/error/getDefaultErrorMessage.js.map +1 -0
  343. package/dist/utils/general/cn.d.ts +3 -0
  344. package/dist/utils/general/cn.d.ts.map +1 -0
  345. package/dist/utils/general/cn.js +9 -0
  346. package/dist/utils/general/cn.js.map +1 -0
  347. package/dist/utils/general/formatRelativeDate.d.ts +2 -0
  348. package/dist/utils/general/formatRelativeDate.d.ts.map +1 -0
  349. package/dist/utils/general/formatRelativeDate.js +28 -0
  350. package/dist/utils/general/formatRelativeDate.js.map +1 -0
  351. package/dist/utils/general/getURL.d.ts +2 -0
  352. package/dist/utils/general/getURL.d.ts.map +1 -0
  353. package/dist/utils/general/getURL.js +13 -0
  354. package/dist/utils/general/getURL.js.map +1 -0
  355. package/dist/utils/general/getValueByPath.d.ts +4 -0
  356. package/dist/utils/general/getValueByPath.d.ts.map +1 -0
  357. package/dist/utils/general/getValueByPath.js +19 -0
  358. package/dist/utils/general/getValueByPath.js.map +1 -0
  359. package/dist/utils/mention/isSelfMention.d.ts +4 -0
  360. package/dist/utils/mention/isSelfMention.d.ts.map +1 -0
  361. package/dist/utils/mention/isSelfMention.js +7 -0
  362. package/dist/utils/mention/isSelfMention.js.map +1 -0
  363. package/dist/utils/mention/parseMentionIds.d.ts +2 -0
  364. package/dist/utils/mention/parseMentionIds.d.ts.map +1 -0
  365. package/dist/utils/mention/parseMentionIds.js +13 -0
  366. package/dist/utils/mention/parseMentionIds.js.map +1 -0
  367. package/dist/utils/mode/defineModeByPathname.d.ts +11 -0
  368. package/dist/utils/mode/defineModeByPathname.d.ts.map +1 -0
  369. package/dist/utils/mode/defineModeByPathname.js +39 -0
  370. package/dist/utils/mode/defineModeByPathname.js.map +1 -0
  371. package/dist/utils/path/detectPluginBasePath.d.ts +2 -0
  372. package/dist/utils/path/detectPluginBasePath.d.ts.map +1 -0
  373. package/dist/utils/path/detectPluginBasePath.js +8 -0
  374. package/dist/utils/path/detectPluginBasePath.js.map +1 -0
  375. package/dist/utils/path/getComponentPath.d.ts +15 -0
  376. package/dist/utils/path/getComponentPath.d.ts.map +1 -0
  377. package/dist/utils/path/getComponentPath.js +22 -0
  378. package/dist/utils/path/getComponentPath.js.map +1 -0
  379. package/dist/utils/payload/extractPayload.d.ts +3 -0
  380. package/dist/utils/payload/extractPayload.d.ts.map +1 -0
  381. package/dist/utils/payload/extractPayload.js +9 -0
  382. package/dist/utils/payload/extractPayload.js.map +1 -0
  383. package/dist/utils/user/resolveUsername.d.ts +4 -0
  384. package/dist/utils/user/resolveUsername.d.ts.map +1 -0
  385. package/dist/utils/user/resolveUsername.js +14 -0
  386. package/dist/utils/user/resolveUsername.js.map +1 -0
  387. package/package.json +113 -0
@@ -0,0 +1,41 @@
1
+ "use server";
2
+ import { headers } from "next/headers";
3
+ import { DEFAULT_COLLECTION_SLUG } from "../constants";
4
+ import { getDefaultErrorMessage } from "../utils/error/getDefaultErrorMessage";
5
+ import { extractPayload } from "../utils/payload/extractPayload";
6
+ async function resolveComment(id, resolved, options) {
7
+ try {
8
+ const payload = await extractPayload(options?.payload);
9
+ const { user } = await payload.auth({ headers: await headers() });
10
+ if (!user) {
11
+ return {
12
+ success: false,
13
+ error: "Unauthorized"
14
+ };
15
+ }
16
+ const res = await payload.update({
17
+ collection: DEFAULT_COLLECTION_SLUG,
18
+ id,
19
+ data: {
20
+ isResolved: resolved,
21
+ resolvedBy: resolved ? user.id : null,
22
+ resolvedAt: resolved ? (/* @__PURE__ */ new Date()).toISOString() : null
23
+ },
24
+ overrideAccess: false,
25
+ user
26
+ });
27
+ return {
28
+ success: true,
29
+ data: res
30
+ };
31
+ } catch (err) {
32
+ return {
33
+ success: false,
34
+ error: getDefaultErrorMessage(err)
35
+ };
36
+ }
37
+ }
38
+ export {
39
+ resolveComment
40
+ };
41
+ //# sourceMappingURL=resolveComment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/services/resolveComment.ts"],"sourcesContent":["\"use server\";\n\nimport type { Response, Comment, BaseServiceOptions } from \"../types\";\nimport { headers } from \"next/headers\";\nimport { DEFAULT_COLLECTION_SLUG } from \"../constants\";\nimport { getDefaultErrorMessage } from \"../utils/error/getDefaultErrorMessage\";\nimport { extractPayload } from \"../utils/payload/extractPayload\";\n\nexport async function resolveComment(\n id: number | string,\n resolved: boolean,\n options?: BaseServiceOptions,\n): Promise<Response<Comment>> {\n try {\n const payload = await extractPayload(options?.payload);\n const { user } = await payload.auth({ headers: await headers() });\n\n if (!user) {\n return {\n success: false,\n error: \"Unauthorized\",\n };\n }\n\n const res = await payload.update({\n collection: DEFAULT_COLLECTION_SLUG,\n id,\n data: {\n isResolved: resolved,\n resolvedBy: resolved ? user.id : null,\n resolvedAt: resolved ? new Date().toISOString() : null,\n },\n overrideAccess: false,\n user,\n });\n\n return {\n success: true,\n data: res as unknown as Comment,\n };\n } catch (err) {\n return {\n success: false,\n error: getDefaultErrorMessage(err),\n };\n }\n}\n"],"mappings":";AAGA,SAAS,eAAe;AACxB,SAAS,+BAA+B;AACxC,SAAS,8BAA8B;AACvC,SAAS,sBAAsB;AAE/B,eAAsB,eACpB,IACA,UACA,SAC4B;AAC5B,MAAI;AACF,UAAM,UAAU,MAAM,eAAe,SAAS,OAAO;AACrD,UAAM,EAAE,KAAK,IAAI,MAAM,QAAQ,KAAK,EAAE,SAAS,MAAM,QAAQ,EAAE,CAAC;AAEhE,QAAI,CAAC,MAAM;AACT,aAAO;AAAA,QACL,SAAS;AAAA,QACT,OAAO;AAAA,MACT;AAAA,IACF;AAEA,UAAM,MAAM,MAAM,QAAQ,OAAO;AAAA,MAC/B,YAAY;AAAA,MACZ;AAAA,MACA,MAAM;AAAA,QACJ,YAAY;AAAA,QACZ,YAAY,WAAW,KAAK,KAAK;AAAA,QACjC,YAAY,YAAW,oBAAI,KAAK,GAAE,YAAY,IAAI;AAAA,MACpD;AAAA,MACA,gBAAgB;AAAA,MAChB;AAAA,IACF,CAAC;AAED,WAAO;AAAA,MACL,SAAS;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EACF,SAAS,KAAK;AACZ,WAAO;AAAA,MACL,SAAS;AAAA,MACT,OAAO,uBAAuB,GAAG;AAAA,IACnC;AAAA,EACF;AACF;","names":[]}
@@ -0,0 +1,11 @@
1
+ import type { BaseServiceOptions } from "../types";
2
+ interface SendMentionEmailsProps extends BaseServiceOptions {
3
+ mentionIds: number[];
4
+ authorName: string;
5
+ commentText: string;
6
+ collectionSlug: string;
7
+ documentId: number | null | undefined;
8
+ }
9
+ export declare function sendMentionEmails({ mentionIds, authorName, commentText, collectionSlug, documentId, payload: payloadProp, }: SendMentionEmailsProps): Promise<void>;
10
+ export {};
11
+ //# sourceMappingURL=sendMentionEmails.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sendMentionEmails.d.ts","sourceRoot":"","sources":["../../src/services/sendMentionEmails.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAqC,MAAM,UAAU,CAAC;AAItF,UAAU,sBAAuB,SAAQ,kBAAkB;IACzD,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC;CACvC;AAED,wBAAsB,iBAAiB,CAAC,EACtC,UAAU,EACV,UAAU,EACV,WAAW,EACX,cAAc,EACd,UAAU,EACV,OAAO,EAAE,WAAW,GACrB,EAAE,sBAAsB,iBAgExB"}
@@ -0,0 +1,73 @@
1
+ import { Resend } from "resend";
2
+ import { getServerSideURL } from "../utils/general/getURL";
3
+ import { extractPayload } from "../utils/payload/extractPayload";
4
+ import { FALLBACK_USERNAME, USERNAME_DEFAULT_FIELD_PATH } from "../constants";
5
+ async function sendMentionEmails({
6
+ mentionIds,
7
+ authorName,
8
+ commentText,
9
+ collectionSlug,
10
+ documentId,
11
+ payload: payloadProp
12
+ }) {
13
+ const payload = await extractPayload(payloadProp);
14
+ const pluginConfig = payload.config.admin?.custom?.commentsPlugin;
15
+ const usernameFieldPath = pluginConfig?.usernameFieldPath ?? USERNAME_DEFAULT_FIELD_PATH;
16
+ const userDocs = await payload.find({
17
+ collection: "users",
18
+ overrideAccess: true,
19
+ limit: mentionIds.length,
20
+ where: {
21
+ id: { in: mentionIds }
22
+ },
23
+ select: {
24
+ id: true,
25
+ email: true,
26
+ [usernameFieldPath]: true
27
+ }
28
+ });
29
+ const users = userDocs.docs;
30
+ const userMap = {};
31
+ for (const user of users) {
32
+ const { id, email } = user;
33
+ const name = user[usernameFieldPath];
34
+ userMap[id] = name ?? email ?? FALLBACK_USERNAME;
35
+ }
36
+ const resolvedText = commentText.replace(/@\((\d+)\)/g, (_match, id) => {
37
+ return `@${userMap[Number(id)]}`;
38
+ });
39
+ const resolvedTextHtml = commentText.replace(/@\((\d+)\)/g, (_match, id) => {
40
+ return `@<strong>${userMap[Number(id)]}</strong>`;
41
+ });
42
+ const adminUrl = `${getServerSideURL()}/admin/collections/${collectionSlug}/${documentId}`;
43
+ const resend = new Resend(process.env.RESEND_API_KEY);
44
+ const fromEmail = process.env.RESEND_FROM_EMAIL;
45
+ if (!fromEmail) {
46
+ console.error(
47
+ `[sendMentionEmails] fromEmail parameter wasn't provided. Use RESEND_FROM_EMAIL env to set up fromEmail`
48
+ );
49
+ return;
50
+ }
51
+ for (const u of users) {
52
+ if (!u.email) continue;
53
+ try {
54
+ await resend.emails.send({
55
+ from: fromEmail,
56
+ to: u.email,
57
+ subject: `${authorName} mentioned you in a comment`,
58
+ text: `${authorName} mentioned you in a comment:
59
+
60
+ "${resolvedText}"
61
+
62
+ View document: ${adminUrl}`,
63
+ html: `<p>${authorName} mentioned you in a comment:</p><blockquote>${resolvedTextHtml}</blockquote><p>View document: <a href="${adminUrl}">${adminUrl}</a></p>`
64
+ });
65
+ } catch (err) {
66
+ console.error(`[sendMentionEmails] Failed to send email to user ${u.id}:`, err);
67
+ }
68
+ }
69
+ }
70
+ export {
71
+ sendMentionEmails
72
+ };
73
+ //# sourceMappingURL=sendMentionEmails.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/services/sendMentionEmails.ts"],"sourcesContent":["import { Resend } from \"resend\";\nimport { getServerSideURL } from \"../utils/general/getURL\";\nimport type { BaseServiceOptions, CommentsPluginConfigStorage, User } from \"../types\";\nimport { extractPayload } from \"../utils/payload/extractPayload\";\nimport { FALLBACK_USERNAME, USERNAME_DEFAULT_FIELD_PATH } from \"../constants\";\n\ninterface SendMentionEmailsProps extends BaseServiceOptions {\n mentionIds: number[];\n authorName: string;\n commentText: string;\n collectionSlug: string;\n documentId: number | null | undefined;\n}\n\nexport async function sendMentionEmails({\n mentionIds,\n authorName,\n commentText,\n collectionSlug,\n documentId,\n payload: payloadProp,\n}: SendMentionEmailsProps) {\n const payload = await extractPayload(payloadProp);\n\n const pluginConfig = payload.config.admin?.custom?.commentsPlugin as CommentsPluginConfigStorage | undefined;\n const usernameFieldPath = pluginConfig?.usernameFieldPath ?? USERNAME_DEFAULT_FIELD_PATH;\n\n const userDocs = await payload.find({\n collection: \"users\",\n overrideAccess: true,\n limit: mentionIds.length,\n where: {\n id: { in: mentionIds },\n },\n select: {\n id: true,\n email: true,\n [usernameFieldPath]: true,\n },\n });\n\n const users = userDocs.docs as User[];\n\n const userMap: Record<number, string> = {};\n for (const user of users) {\n const { id, email } = user;\n const name = user[usernameFieldPath] as string;\n userMap[id] = name ?? email ?? FALLBACK_USERNAME;\n }\n\n const resolvedText = commentText.replace(/@\\((\\d+)\\)/g, (_match, id) => {\n return `@${userMap[Number(id)]}`;\n });\n\n const resolvedTextHtml = commentText.replace(/@\\((\\d+)\\)/g, (_match, id) => {\n return `@<strong>${userMap[Number(id)]}</strong>`;\n });\n\n const adminUrl = `${getServerSideURL()}/admin/collections/${collectionSlug}/${documentId}`;\n const resend = new Resend(process.env.RESEND_API_KEY);\n const fromEmail = process.env.RESEND_FROM_EMAIL;\n\n if (!fromEmail) {\n console.error(\n `[sendMentionEmails] fromEmail parameter wasn't provided. Use RESEND_FROM_EMAIL env to set up fromEmail`,\n );\n\n return;\n }\n\n for (const u of users) {\n if (!u.email) continue;\n\n try {\n await resend.emails.send({\n from: fromEmail,\n to: u.email,\n subject: `${authorName} mentioned you in a comment`,\n text: `${authorName} mentioned you in a comment:\\n\\n\"${resolvedText}\"\\n\\nView document: ${adminUrl}`,\n html: `<p>${authorName} mentioned you in a comment:</p><blockquote>${resolvedTextHtml}</blockquote><p>View document: <a href=\"${adminUrl}\">${adminUrl}</a></p>`,\n });\n } catch (err) {\n console.error(`[sendMentionEmails] Failed to send email to user ${u.id}:`, err);\n }\n }\n}\n"],"mappings":"AAAA,SAAS,cAAc;AACvB,SAAS,wBAAwB;AAEjC,SAAS,sBAAsB;AAC/B,SAAS,mBAAmB,mCAAmC;AAU/D,eAAsB,kBAAkB;AAAA,EACtC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,SAAS;AACX,GAA2B;AACzB,QAAM,UAAU,MAAM,eAAe,WAAW;AAEhD,QAAM,eAAe,QAAQ,OAAO,OAAO,QAAQ;AACnD,QAAM,oBAAoB,cAAc,qBAAqB;AAE7D,QAAM,WAAW,MAAM,QAAQ,KAAK;AAAA,IAClC,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,OAAO,WAAW;AAAA,IAClB,OAAO;AAAA,MACL,IAAI,EAAE,IAAI,WAAW;AAAA,IACvB;AAAA,IACA,QAAQ;AAAA,MACN,IAAI;AAAA,MACJ,OAAO;AAAA,MACP,CAAC,iBAAiB,GAAG;AAAA,IACvB;AAAA,EACF,CAAC;AAED,QAAM,QAAQ,SAAS;AAEvB,QAAM,UAAkC,CAAC;AACzC,aAAW,QAAQ,OAAO;AACxB,UAAM,EAAE,IAAI,MAAM,IAAI;AACtB,UAAM,OAAO,KAAK,iBAAiB;AACnC,YAAQ,EAAE,IAAI,QAAQ,SAAS;AAAA,EACjC;AAEA,QAAM,eAAe,YAAY,QAAQ,eAAe,CAAC,QAAQ,OAAO;AACtE,WAAO,IAAI,QAAQ,OAAO,EAAE,CAAC,CAAC;AAAA,EAChC,CAAC;AAED,QAAM,mBAAmB,YAAY,QAAQ,eAAe,CAAC,QAAQ,OAAO;AAC1E,WAAO,YAAY,QAAQ,OAAO,EAAE,CAAC,CAAC;AAAA,EACxC,CAAC;AAED,QAAM,WAAW,GAAG,iBAAiB,CAAC,sBAAsB,cAAc,IAAI,UAAU;AACxF,QAAM,SAAS,IAAI,OAAO,QAAQ,IAAI,cAAc;AACpD,QAAM,YAAY,QAAQ,IAAI;AAE9B,MAAI,CAAC,WAAW;AACd,YAAQ;AAAA,MACN;AAAA,IACF;AAEA;AAAA,EACF;AAEA,aAAW,KAAK,OAAO;AACrB,QAAI,CAAC,EAAE,MAAO;AAEd,QAAI;AACF,YAAM,OAAO,OAAO,KAAK;AAAA,QACvB,MAAM;AAAA,QACN,IAAI,EAAE;AAAA,QACN,SAAS,GAAG,UAAU;AAAA,QACtB,MAAM,GAAG,UAAU;AAAA;AAAA,GAAoC,YAAY;AAAA;AAAA,iBAAuB,QAAQ;AAAA,QAClG,MAAM,MAAM,UAAU,+CAA+C,gBAAgB,2CAA2C,QAAQ,KAAK,QAAQ;AAAA,MACvJ,CAAC;AAAA,IACH,SAAS,KAAK;AACZ,cAAQ,MAAM,oDAAoD,EAAE,EAAE,KAAK,GAAG;AAAA,IAChF;AAAA,EACF;AACF;","names":[]}
@@ -0,0 +1,12 @@
1
+ import type { BaseServiceOptions, EntityLabelsMap, Comment, DocumentTitles, GlobalFieldLabelRegistry, Response, User } from "../types";
2
+ interface SyncResult {
3
+ comments: Comment[];
4
+ documentTitles: DocumentTitles;
5
+ mentionUsers: User[];
6
+ fieldLabels: GlobalFieldLabelRegistry;
7
+ collectionLabels: EntityLabelsMap;
8
+ globalLabels: EntityLabelsMap;
9
+ }
10
+ export declare function syncAllCommentsData(options?: BaseServiceOptions): Promise<Response<SyncResult>>;
11
+ export {};
12
+ //# sourceMappingURL=syncAllCommentsData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"syncAllCommentsData.d.ts","sourceRoot":"","sources":["../../src/services/syncAllCommentsData.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EACV,kBAAkB,EAClB,eAAe,EACf,OAAO,EAEP,cAAc,EACd,wBAAwB,EACxB,QAAQ,EACR,IAAI,EACL,MAAM,UAAU,CAAC;AAGlB,UAAU,UAAU;IAClB,QAAQ,EAAE,OAAO,EAAE,CAAC;IACpB,cAAc,EAAE,cAAc,CAAC;IAC/B,YAAY,EAAE,IAAI,EAAE,CAAC;IACrB,WAAW,EAAE,wBAAwB,CAAC;IACtC,gBAAgB,EAAE,eAAe,CAAC;IAClC,YAAY,EAAE,eAAe,CAAC;CAC/B;AAOD,wBAAsB,mBAAmB,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC,CAwCrG"}
@@ -0,0 +1,48 @@
1
+ "use server";
2
+ import { findAllComments } from "./findAllComments";
3
+ import { getDocumentTitles } from "./getDocumentTitles";
4
+ import { fetchMentionableUsers } from "./fetchMentionableUsers";
5
+ import { fetchFieldLabels } from "./fieldLabels/fetchFieldLabels";
6
+ import { getEntitiesLabels } from "./getEntitiesLabels";
7
+ import { extractPayload } from "../utils/payload/extractPayload";
8
+ const errorResult = {
9
+ success: false,
10
+ error: "Failed to sync all comments data"
11
+ };
12
+ async function syncAllCommentsData(options) {
13
+ const payload = await extractPayload(options?.payload);
14
+ const pluginConfig = payload.config.admin?.custom?.commentsPlugin;
15
+ const commentsResult = await findAllComments({
16
+ enabledCollections: pluginConfig?.collections,
17
+ enabledGlobals: pluginConfig?.globals,
18
+ options: {
19
+ payload
20
+ }
21
+ });
22
+ if (!commentsResult.success) return errorResult;
23
+ const comments = commentsResult.data;
24
+ const [titlesResult, mentionUsersResult, fieldLabels] = await Promise.all([
25
+ getDocumentTitles(comments, pluginConfig?.documentTitleFields ?? {}, { payload, locale: options?.locale }),
26
+ fetchMentionableUsers({ payload }),
27
+ fetchFieldLabels(comments)
28
+ ]);
29
+ const success = titlesResult.success && mentionUsersResult.success;
30
+ if (!success) return errorResult;
31
+ const collectionLabels = getEntitiesLabels(payload.config.collections, pluginConfig?.collections ?? []);
32
+ const globalLabels = getEntitiesLabels(payload.config.globals, pluginConfig?.globals ?? []);
33
+ return {
34
+ success: true,
35
+ data: {
36
+ comments,
37
+ documentTitles: titlesResult.data,
38
+ mentionUsers: mentionUsersResult.data,
39
+ fieldLabels,
40
+ collectionLabels,
41
+ globalLabels
42
+ }
43
+ };
44
+ }
45
+ export {
46
+ syncAllCommentsData
47
+ };
48
+ //# sourceMappingURL=syncAllCommentsData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/services/syncAllCommentsData.ts"],"sourcesContent":["\"use server\";\n\nimport { findAllComments } from \"./findAllComments\";\nimport { getDocumentTitles } from \"./getDocumentTitles\";\nimport { fetchMentionableUsers } from \"./fetchMentionableUsers\";\nimport { fetchFieldLabels } from \"./fieldLabels/fetchFieldLabels\";\nimport { getEntitiesLabels } from \"./getEntitiesLabels\";\nimport type {\n BaseServiceOptions,\n EntityLabelsMap,\n Comment,\n CommentsPluginConfigStorage,\n DocumentTitles,\n GlobalFieldLabelRegistry,\n Response,\n User,\n} from \"../types\";\nimport { extractPayload } from \"../utils/payload/extractPayload\";\n\ninterface SyncResult {\n comments: Comment[];\n documentTitles: DocumentTitles;\n mentionUsers: User[];\n fieldLabels: GlobalFieldLabelRegistry;\n collectionLabels: EntityLabelsMap;\n globalLabels: EntityLabelsMap;\n}\n\nconst errorResult: Response<SyncResult> = {\n success: false,\n error: \"Failed to sync all comments data\",\n};\n\nexport async function syncAllCommentsData(options?: BaseServiceOptions): Promise<Response<SyncResult>> {\n const payload = await extractPayload(options?.payload);\n const pluginConfig = payload.config.admin?.custom?.commentsPlugin as CommentsPluginConfigStorage | undefined;\n\n const commentsResult = await findAllComments({\n enabledCollections: pluginConfig?.collections,\n enabledGlobals: pluginConfig?.globals,\n options: {\n payload,\n },\n });\n\n if (!commentsResult.success) return errorResult;\n\n const comments = commentsResult.data;\n\n const [titlesResult, mentionUsersResult, fieldLabels] = await Promise.all([\n getDocumentTitles(comments, pluginConfig?.documentTitleFields ?? {}, { payload, locale: options?.locale }),\n fetchMentionableUsers({ payload }),\n fetchFieldLabels(comments),\n ]);\n\n const success = titlesResult.success && mentionUsersResult.success;\n\n if (!success) return errorResult;\n\n const collectionLabels = getEntitiesLabels(payload.config.collections, pluginConfig?.collections ?? []);\n const globalLabels = getEntitiesLabels(payload.config.globals, pluginConfig?.globals ?? []);\n\n return {\n success: true,\n data: {\n comments,\n documentTitles: titlesResult.data,\n mentionUsers: mentionUsersResult.data,\n fieldLabels,\n collectionLabels,\n globalLabels,\n },\n };\n}\n"],"mappings":";AAEA,SAAS,uBAAuB;AAChC,SAAS,yBAAyB;AAClC,SAAS,6BAA6B;AACtC,SAAS,wBAAwB;AACjC,SAAS,yBAAyB;AAWlC,SAAS,sBAAsB;AAW/B,MAAM,cAAoC;AAAA,EACxC,SAAS;AAAA,EACT,OAAO;AACT;AAEA,eAAsB,oBAAoB,SAA6D;AACrG,QAAM,UAAU,MAAM,eAAe,SAAS,OAAO;AACrD,QAAM,eAAe,QAAQ,OAAO,OAAO,QAAQ;AAEnD,QAAM,iBAAiB,MAAM,gBAAgB;AAAA,IAC3C,oBAAoB,cAAc;AAAA,IAClC,gBAAgB,cAAc;AAAA,IAC9B,SAAS;AAAA,MACP;AAAA,IACF;AAAA,EACF,CAAC;AAED,MAAI,CAAC,eAAe,QAAS,QAAO;AAEpC,QAAM,WAAW,eAAe;AAEhC,QAAM,CAAC,cAAc,oBAAoB,WAAW,IAAI,MAAM,QAAQ,IAAI;AAAA,IACxE,kBAAkB,UAAU,cAAc,uBAAuB,CAAC,GAAG,EAAE,SAAS,QAAQ,SAAS,OAAO,CAAC;AAAA,IACzG,sBAAsB,EAAE,QAAQ,CAAC;AAAA,IACjC,iBAAiB,QAAQ;AAAA,EAC3B,CAAC;AAED,QAAM,UAAU,aAAa,WAAW,mBAAmB;AAE3D,MAAI,CAAC,QAAS,QAAO;AAErB,QAAM,mBAAmB,kBAAkB,QAAQ,OAAO,aAAa,cAAc,eAAe,CAAC,CAAC;AACtG,QAAM,eAAe,kBAAkB,QAAQ,OAAO,SAAS,cAAc,WAAW,CAAC,CAAC;AAE1F,SAAO;AAAA,IACL,SAAS;AAAA,IACT,MAAM;AAAA,MACJ;AAAA,MACA,gBAAgB,aAAa;AAAA,MAC7B,cAAc,mBAAmB;AAAA,MACjC;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,EACF;AACF;","names":[]}
@@ -0,0 +1,2 @@
1
+ /*! tailwindcss v4.2.1 | MIT License | https://tailwindcss.com */
2
+ @layer properties{@supports (((-webkit-hyphens:none)) and (not (margin-trim:inline))) or ((-moz-orient:inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-rotate-x:initial;--tw-rotate-y:initial;--tw-rotate-z:initial;--tw-skew-x:initial;--tw-skew-y:initial;--tw-border-style:solid;--tw-leading:initial;--tw-font-weight:initial;--tw-shadow:0 0 #0000;--tw-shadow-color:initial;--tw-shadow-alpha:100%;--tw-inset-shadow:0 0 #0000;--tw-inset-shadow-color:initial;--tw-inset-shadow-alpha:100%;--tw-ring-color:initial;--tw-ring-shadow:0 0 #0000;--tw-inset-ring-color:initial;--tw-inset-ring-shadow:0 0 #0000;--tw-ring-inset:initial;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-offset-shadow:0 0 #0000;--tw-blur:initial;--tw-brightness:initial;--tw-contrast:initial;--tw-grayscale:initial;--tw-hue-rotate:initial;--tw-invert:initial;--tw-opacity:initial;--tw-saturate:initial;--tw-sepia:initial;--tw-drop-shadow:initial;--tw-drop-shadow-color:initial;--tw-drop-shadow-alpha:100%;--tw-drop-shadow-size:initial;--tw-duration:initial;--tw-content:""}}}:root,:host{--color-black:#000;--spacing:.25rem;--text-2xl:1.5rem;--text-2xl--line-height:calc(2 / 1.5);--font-weight-medium:500;--font-weight-semibold:600;--font-weight-bold:700;--leading-normal:1.5;--radius-sm:.25rem;--radius-md:.375rem;--animate-spin:spin 1s linear infinite;--default-transition-duration:.15s;--default-transition-timing-function:cubic-bezier(.4, 0, .2, 1)}.pointer-events-none{pointer-events:none}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.sticky{position:sticky}.inset-0{inset:calc(var(--spacing) * 0)}.start{inset-inline-start:var(--spacing)}.top-0{top:calc(var(--spacing) * 0)}.top-3{top:calc(var(--spacing) * 3)}.right-3{right:calc(var(--spacing) * 3)}.z-29{z-index:29}.m-0{margin:calc(var(--spacing) * 0)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-3{margin-bottom:calc(var(--spacing) * 3)}.ml-auto{margin-left:auto}.box-border{box-sizing:border-box}.block{display:block}.flex{display:flex}.hidden{display:none}.h-4{height:calc(var(--spacing) * 4)}.h-9{height:calc(var(--spacing) * 9)}.h-\[20px\]{height:20px}.h-\[24px\]{height:24px}.min-h-5{min-height:calc(var(--spacing) * 5)}.w-4{width:calc(var(--spacing) * 4)}.w-9{width:calc(var(--spacing) * 9)}.w-80{width:calc(var(--spacing) * 80)}.w-\[20px\]{width:20px}.w-\[24px\]{width:24px}.w-auto{width:auto}.w-full{width:100%}.w-px{width:1px}.max-w-150{max-width:calc(var(--spacing) * 150)}.flex-1{flex:1}.shrink-0{flex-shrink:0}.-rotate-90{rotate:-90deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-pointer{cursor:pointer}.flex-col{flex-direction:column}.items-center{align-items:center}.items-start{align-items:flex-start}.justify-center{justify-content:center}.justify-end{justify-content:flex-end}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-2\.5{gap:calc(var(--spacing) * 2.5)}.gap-3{gap:calc(var(--spacing) * 3)}.truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.rounded{border-radius:.25rem}.rounded-full{border-radius:3.40282e38px}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.border{border-style:var(--tw-border-style);border-width:1px}.border-l-2{border-left-style:var(--tw-border-style);border-left-width:2px}.border-none{--tw-border-style:none;border-style:none}.border-\(--theme-elevation-100\){border-color:var(--theme-elevation-100)}.border-transparent{border-color:#0000}.bg-\(--theme-bg\){background-color:var(--theme-bg)}.bg-\(--theme-elevation-0\){background-color:var(--theme-elevation-0)}.bg-\(--theme-elevation-100\){background-color:var(--theme-elevation-100)}.bg-\(--theme-elevation-150\){background-color:var(--theme-elevation-150)}.bg-\(--theme-elevation-1000\){background-color:var(--theme-elevation-1000)}.bg-\[\#36c5f021\]{background-color:#36c5f021}.bg-\[\#f0be3621\]{background-color:#f0be3621}.bg-black\/50{background-color:#00000080}@supports (color:color-mix(in lab, red, red)){.bg-black\/50{background-color:color-mix(in oklab, var(--color-black) 50%, transparent)}}.bg-transparent{background-color:#0000}.p-0{padding:calc(var(--spacing) * 0)}.p-1{padding:calc(var(--spacing) * 1)}.px-0\.5{padding-inline:calc(var(--spacing) * .5)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-2\.5{padding-inline:calc(var(--spacing) * 2.5)}.px-3{padding-inline:calc(var(--spacing) * 3)}.py-1\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-5{padding-block:calc(var(--spacing) * 5)}.py-6{padding-block:calc(var(--spacing) * 6)}.pt-2{padding-top:calc(var(--spacing) * 2)}.pb-1\.25{padding-bottom:calc(var(--spacing) * 1.25)}.pb-5{padding-bottom:calc(var(--spacing) * 5)}.pl-3{padding-left:calc(var(--spacing) * 3)}.text-center{text-align:center}.text-2xl{font-size:var(--text-2xl);line-height:var(--tw-leading,var(--text-2xl--line-height))}.text-\[11px\]{font-size:11px}.text-\[12px\]{font-size:12px}.text-\[13px\]{font-size:13px}.text-\[14px\]{font-size:14px}.leading-5{--tw-leading:calc(var(--spacing) * 5);line-height:calc(var(--spacing) * 5)}.leading-none{--tw-leading:1;line-height:1}.leading-normal{--tw-leading:var(--leading-normal);line-height:var(--leading-normal)}.font-bold{--tw-font-weight:var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight:var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight:var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.wrap-break-word{overflow-wrap:break-word}.whitespace-pre-wrap{white-space:pre-wrap}.text-\(--theme-elevation-0\){color:var(--theme-elevation-0)}.text-\(--theme-elevation-450\){color:var(--theme-elevation-450)}.text-\(--theme-elevation-500\){color:var(--theme-elevation-500)}.text-\(--theme-elevation-600\){color:var(--theme-elevation-600)}.text-\(--theme-text\){color:var(--theme-text)}.text-\[\#1264a3\]{color:#1264a3}.text-\[\#a36e12\]{color:#a36e12}.opacity-0{opacity:0}.opacity-100{opacity:1}.shadow-\[0_-2px_16px_-2px_rgba\(0\,0\,0\,0\.2\)\]{--tw-shadow:0 -2px 16px -2px var(--tw-shadow-color,#0003);box-shadow:var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow)}.filter{filter:var(--tw-blur,) var(--tw-brightness,) var(--tw-contrast,) var(--tw-grayscale,) var(--tw-hue-rotate,) var(--tw-invert,) var(--tw-saturate,) var(--tw-sepia,) var(--tw-drop-shadow,)}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease,var(--default-transition-timing-function));transition-duration:var(--tw-duration,var(--default-transition-duration))}.duration-150{--tw-duration:.15s;transition-duration:.15s}.outline-none{--tw-outline-style:none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.group-focus-within\:flex:is(:where(.group):focus-within *){display:flex}@media (hover:hover){.group-hover\:pointer-events-auto:is(:where(.group):hover *){pointer-events:auto}.group-hover\:opacity-100:is(:where(.group):hover *){opacity:1}}.focus-within\:border-\(--theme-elevation-150\):focus-within{border-color:var(--theme-elevation-150)}@media (hover:hover){.hover\:bg-\(--theme-elevation-50\):hover{background-color:var(--theme-elevation-50)}.hover\:bg-\(--theme-elevation-150\):hover{background-color:var(--theme-elevation-150)}.hover\:bg-\(--theme-elevation-800\):hover{background-color:var(--theme-elevation-800)}.hover\:text-\(--theme-text\):hover{color:var(--theme-text)}}.\[\&\.is-empty\]\:before\:pointer-events-none.is-empty:before{content:var(--tw-content);pointer-events:none}.\[\&\.is-empty\]\:before\:absolute.is-empty:before{content:var(--tw-content);position:absolute}.\[\&\.is-empty\]\:before\:text-\(--theme-elevation-450\).is-empty:before{content:var(--tw-content);color:var(--theme-elevation-450)}.\[\&\.is-empty\]\:before\:content-\[attr\(data-placeholder\)\].is-empty:before{--tw-content:attr(data-placeholder);content:var(--tw-content)}.comments-drawer .gutter{padding:0 20px!important}.comments-drawer .drawer__content{--gutter-h:1px}.comments-drawer header .rs__control{min-width:120px;min-height:0;padding:2px 4px;font-size:13px}.comments-drawer header .rs__single-value,.comments-drawer header .rs__option{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}@property --tw-rotate-x{syntax:"*";inherits:false}@property --tw-rotate-y{syntax:"*";inherits:false}@property --tw-rotate-z{syntax:"*";inherits:false}@property --tw-skew-x{syntax:"*";inherits:false}@property --tw-skew-y{syntax:"*";inherits:false}@property --tw-border-style{syntax:"*";inherits:false;initial-value:solid}@property --tw-leading{syntax:"*";inherits:false}@property --tw-font-weight{syntax:"*";inherits:false}@property --tw-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-shadow-color{syntax:"*";inherits:false}@property --tw-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-inset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-shadow-color{syntax:"*";inherits:false}@property --tw-inset-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-ring-color{syntax:"*";inherits:false}@property --tw-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-inset-ring-color{syntax:"*";inherits:false}@property --tw-inset-ring-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-ring-inset{syntax:"*";inherits:false}@property --tw-ring-offset-width{syntax:"<length>";inherits:false;initial-value:0}@property --tw-ring-offset-color{syntax:"*";inherits:false;initial-value:#fff}@property --tw-ring-offset-shadow{syntax:"*";inherits:false;initial-value:0 0 #0000}@property --tw-blur{syntax:"*";inherits:false}@property --tw-brightness{syntax:"*";inherits:false}@property --tw-contrast{syntax:"*";inherits:false}@property --tw-grayscale{syntax:"*";inherits:false}@property --tw-hue-rotate{syntax:"*";inherits:false}@property --tw-invert{syntax:"*";inherits:false}@property --tw-opacity{syntax:"*";inherits:false}@property --tw-saturate{syntax:"*";inherits:false}@property --tw-sepia{syntax:"*";inherits:false}@property --tw-drop-shadow{syntax:"*";inherits:false}@property --tw-drop-shadow-color{syntax:"*";inherits:false}@property --tw-drop-shadow-alpha{syntax:"<percentage>";inherits:false;initial-value:100%}@property --tw-drop-shadow-size{syntax:"*";inherits:false}@property --tw-duration{syntax:"*";inherits:false}@property --tw-content{syntax:"*";inherits:false;initial-value:""}@keyframes spin{to{transform:rotate(360deg)}}
@@ -0,0 +1,5 @@
1
+ import type { CommentsTranslations } from "./types";
2
+ export declare const en: {
3
+ comments: CommentsTranslations;
4
+ };
5
+ //# sourceMappingURL=en.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/translations/en.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEpD,eAAO,MAAM,EAAE,EAAE;IAAE,QAAQ,EAAE,oBAAoB,CAAA;CA+BhD,CAAC"}
@@ -0,0 +1,36 @@
1
+ const en = {
2
+ comments: {
3
+ label: "Comments",
4
+ openComments_one: "{{count}} open comment",
5
+ openComments_other: "{{count}} open comments",
6
+ add: "Add comment",
7
+ writeComment: "Write a comment",
8
+ comment: "Comment",
9
+ cancel: "Cancel",
10
+ posting: "Posting\u2026",
11
+ resolve: "Resolve",
12
+ reopen: "Reopen",
13
+ delete: "Delete",
14
+ general: "General",
15
+ close: "Close",
16
+ syncingComments: "Syncing comments",
17
+ openCommentsAria: "Open comments",
18
+ failedToPost: "Failed to post comment",
19
+ failedToUpdate: "Failed to update comment",
20
+ failedToDelete: "Failed to delete comment",
21
+ failedToAdd: "Failed to add comment",
22
+ unknownAuthor: "Unknown",
23
+ deletedUser: "Deleted user",
24
+ noOpenComments: "No open comments",
25
+ noResolvedComments: "No resolved comments",
26
+ noMentionedComments: "No comments mentioning you",
27
+ filterOpen: "Open",
28
+ filterResolved: "Resolved",
29
+ filterMentioned: "Mentioned me",
30
+ noMentionMatches: "No matches"
31
+ }
32
+ };
33
+ export {
34
+ en
35
+ };
36
+ //# sourceMappingURL=en.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/translations/en.ts"],"sourcesContent":["import type { CommentsTranslations } from \"./types\";\n\nexport const en: { comments: CommentsTranslations } = {\n comments: {\n label: \"Comments\",\n openComments_one: \"{{count}} open comment\",\n openComments_other: \"{{count}} open comments\",\n add: \"Add comment\",\n writeComment: \"Write a comment\",\n comment: \"Comment\",\n cancel: \"Cancel\",\n posting: \"Posting…\",\n resolve: \"Resolve\",\n reopen: \"Reopen\",\n delete: \"Delete\",\n general: \"General\",\n close: \"Close\",\n syncingComments: \"Syncing comments\",\n openCommentsAria: \"Open comments\",\n failedToPost: \"Failed to post comment\",\n failedToUpdate: \"Failed to update comment\",\n failedToDelete: \"Failed to delete comment\",\n failedToAdd: \"Failed to add comment\",\n unknownAuthor: \"Unknown\",\n deletedUser: \"Deleted user\",\n noOpenComments: \"No open comments\",\n noResolvedComments: \"No resolved comments\",\n noMentionedComments: \"No comments mentioning you\",\n filterOpen: \"Open\",\n filterResolved: \"Resolved\",\n filterMentioned: \"Mentioned me\",\n noMentionMatches: \"No matches\",\n },\n};\n"],"mappings":"AAEO,MAAM,KAAyC;AAAA,EACpD,UAAU;AAAA,IACR,OAAO;AAAA,IACP,kBAAkB;AAAA,IAClB,oBAAoB;AAAA,IACpB,KAAK;AAAA,IACL,cAAc;AAAA,IACd,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,SAAS;AAAA,IACT,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,OAAO;AAAA,IACP,iBAAiB;AAAA,IACjB,kBAAkB;AAAA,IAClB,cAAc;AAAA,IACd,gBAAgB;AAAA,IAChB,gBAAgB;AAAA,IAChB,aAAa;AAAA,IACb,eAAe;AAAA,IACf,aAAa;AAAA,IACb,gBAAgB;AAAA,IAChB,oBAAoB;AAAA,IACpB,qBAAqB;AAAA,IACrB,YAAY;AAAA,IACZ,gBAAgB;AAAA,IAChB,iBAAiB;AAAA,IACjB,kBAAkB;AAAA,EACpB;AACF;","names":[]}
@@ -0,0 +1,32 @@
1
+ export interface CommentsTranslations {
2
+ label: string;
3
+ openComments_one: string;
4
+ openComments_other: string;
5
+ add: string;
6
+ writeComment: string;
7
+ comment: string;
8
+ cancel: string;
9
+ posting: string;
10
+ resolve: string;
11
+ reopen: string;
12
+ delete: string;
13
+ general: string;
14
+ close: string;
15
+ syncingComments: string;
16
+ openCommentsAria: string;
17
+ failedToPost: string;
18
+ failedToUpdate: string;
19
+ failedToDelete: string;
20
+ failedToAdd: string;
21
+ unknownAuthor: string;
22
+ deletedUser: string;
23
+ noOpenComments: string;
24
+ noResolvedComments: string;
25
+ noMentionedComments: string;
26
+ filterOpen: string;
27
+ filterResolved: string;
28
+ filterMentioned: string;
29
+ noMentionMatches: string;
30
+ }
31
+ export type Translations = Record<string, Partial<CommentsTranslations>>;
32
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/translations/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,gBAAgB,EAAE,MAAM,CAAC;IACzB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;IACzB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,MAAM,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,10 @@
1
+ import type { Payload } from "payload";
2
+ export interface BaseServiceOptions {
3
+ payload?: Payload;
4
+ locale?: string | null;
5
+ }
6
+ export interface BaseDocument {
7
+ id: string | number;
8
+ [key: string]: unknown;
9
+ }
10
+ //# sourceMappingURL=base.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/types/base.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,WAAW,kBAAkB;IACjC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,YAAY;IAC3B,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=base.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,2 @@
1
+ export type DocumentTitles = Record<string, Record<string, string>>;
2
+ //# sourceMappingURL=collection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collection.d.ts","sourceRoot":"","sources":["../../src/types/collection.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=collection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,23 @@
1
+ import type { User } from "./user";
2
+ export interface CommentMention {
3
+ id: string | number | null;
4
+ user: number | User;
5
+ }
6
+ export interface Comment {
7
+ id: number;
8
+ documentId?: number | null;
9
+ collectionSlug?: string | null;
10
+ globalSlug?: string | null;
11
+ fieldPath?: string | null;
12
+ locale?: string | null;
13
+ text: string;
14
+ mentions?: CommentMention[] | null;
15
+ author: number | User;
16
+ isResolved: boolean;
17
+ resolvedBy?: number | User | null;
18
+ resolvedAt?: string | null;
19
+ tenant?: number | string | null;
20
+ createdAt: string;
21
+ updatedAt: string;
22
+ }
23
+ //# sourceMappingURL=comment.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comment.d.ts","sourceRoot":"","sources":["../../src/types/comment.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAEnC,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAC3B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,cAAc,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1B,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,cAAc,EAAE,GAAG,IAAI,CAAC;IACnC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IAClC,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;CACnB"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=comment.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,112 @@
1
+ import type { CollectionConfig, Field } from "payload";
2
+ import type { Translations } from "../translations/types";
3
+ /**
4
+ * Specify which field is used as the document title in the comments UI.
5
+ * @example
6
+ * {
7
+ * slug: "pages",
8
+ * titleField: "title"
9
+ * }
10
+ */
11
+ export interface CollectionEntry {
12
+ slug: string;
13
+ /** @default "id" */
14
+ titleField?: string;
15
+ }
16
+ /**
17
+ * Multi-tenancy configuration for the comments plugin.
18
+ *
19
+ * When enabled, comments are scoped to the current tenant so that users
20
+ * from different tenants cannot see each other's comments.
21
+ */
22
+ export interface TenantPluginConfig {
23
+ /** Whether multi-tenancy support is active.
24
+ * @default false
25
+ */
26
+ enabled?: boolean;
27
+ /**
28
+ * Slug of the Payload collection that represents tenants.
29
+ * @default "tenants"
30
+ */
31
+ collectionSlug?: string;
32
+ /**
33
+ * Name of the relationship field on each document collection that holds
34
+ * the tenant reference. This field is used to filter comments by tenant.
35
+ * @default "tenant"
36
+ */
37
+ documentTenantField?: string;
38
+ }
39
+ /**
40
+ * Configuration options for the `commentsPlugin`.
41
+ * @example
42
+ * commentsPlugin({
43
+ * collections: [
44
+ * {
45
+ * slug: "pages",
46
+ * titleField: "title"
47
+ * }
48
+ * ],
49
+ * tenant: {
50
+ * enabled: true,
51
+ * collectionSlug: "tenants",
52
+ * documentTenantField: "tenant"
53
+ * },
54
+ * })
55
+ */
56
+ export interface CommentsPluginConfig {
57
+ /** Set to `false` to disable the plugin entirely.
58
+ * @default false
59
+ */
60
+ enabled?: boolean;
61
+ /**
62
+ * List of collection config objects to tune collection document comments. In any way all collections have comments.
63
+ */
64
+ collections?: CollectionEntry[];
65
+ /** Optional multi-tenancy settings. Omit if your project is single-tenant. */
66
+ tenant?: TenantPluginConfig;
67
+ /**
68
+ * Fine-grained overrides for the generated `comments` collection.
69
+ *
70
+ * - `access` / `admin` / `hooks` – merged directly into the collection config.
71
+ * - `fields` – receives the default field array and must return the final
72
+ * array, allowing you to add, remove, or reorder fields.
73
+ */
74
+ overrides?: Partial<Pick<CollectionConfig, "access" | "admin" | "hooks">> & {
75
+ fields?: (defaultFields: Field[]) => Field[];
76
+ };
77
+ /**
78
+ * Translations for the comments UI per locale.
79
+ *
80
+ * The key is the locale code (e.g. `"en"`, `"fr"`, `"de"`).
81
+ * The value is a partial object matching the comments translation namespace —
82
+ * any keys you omit will fall back to the built-in English strings.
83
+ *
84
+ * @example
85
+ * translations: {
86
+ * fr: {
87
+ * label: "Commentaires",
88
+ * add: "Ajouter un commentaire",
89
+ * filterOpen: "Ouverts",
90
+ * filterResolved: "Résolus",
91
+ * filterMentioned: "Me mentionnent",
92
+ * }
93
+ * }
94
+ */
95
+ translations?: Translations;
96
+ /**
97
+ * Dot-notation path to the field on the users collection used as the
98
+ * display name in the comments UI.
99
+ * @default "name"
100
+ * @example "firstName"
101
+ * @example "profile.displayName"
102
+ */
103
+ usernameFieldPath?: string;
104
+ }
105
+ export interface CommentsPluginConfigStorage {
106
+ collections?: string[];
107
+ documentTitleFields?: Record<string, string>;
108
+ globals?: string[];
109
+ tenant?: TenantPluginConfig;
110
+ usernameFieldPath?: string;
111
+ }
112
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AACvD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,oBAAoB;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;OAIG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,oBAAoB;IACnC;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,WAAW,CAAC,EAAE,eAAe,EAAE,CAAC;IAChC,8EAA8E;IAC9E,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,gBAAgB,EAAE,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC,CAAC,GAAG;QAC1E,MAAM,CAAC,EAAE,CAAC,aAAa,EAAE,KAAK,EAAE,KAAK,KAAK,EAAE,CAAC;KAC9C,CAAC;IACF;;;;;;;;;;;;;;;;;OAiBG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,2BAA2B;IAC1C,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,mBAAmB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC7C,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,15 @@
1
+ import type { SanitizedCollectionConfig, SanitizedGlobalConfig } from "payload";
2
+ export type EntityConfig = SanitizedCollectionConfig | SanitizedGlobalConfig;
3
+ export type EntityLabel = string | Record<string, string>;
4
+ export type EntityLabelsMap = Record<string, EntityLabel>;
5
+ export type FieldLabelSegment = {
6
+ type: "field";
7
+ label: string;
8
+ } | {
9
+ type: "row";
10
+ id: string;
11
+ position: number;
12
+ };
13
+ export type GlobalFieldLabelRegistry = Record<string, Record<number, Record<string, FieldLabelSegment[]>>>;
14
+ export type Mode = "document" | "global-document" | "global";
15
+ //# sourceMappingURL=entity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../src/types/entity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAEhF,MAAM,MAAM,YAAY,GAAG,yBAAyB,GAAG,qBAAqB,CAAC;AAE7E,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE1D,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;AAE1D,MAAM,MAAM,iBAAiB,GACzB;IACE,IAAI,EAAE,OAAO,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf,GACD;IACE,IAAI,EAAE,KAAK,CAAC;IACZ,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;CAClB,CAAC;AAEN,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,EAAE,CAAC,CAAC,CAAC,CAAC;AAE3G,MAAM,MAAM,IAAI,GAAG,UAAU,GAAG,iBAAiB,GAAG,QAAQ,CAAC"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=entity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,10 @@
1
+ export type FilterMode = "open" | "resolved" | "mentioned";
2
+ export type LoadingStatus = "idle" | "loading" | "error" | "success";
3
+ export type Response<T> = {
4
+ success: true;
5
+ data: T;
6
+ } | {
7
+ success: false;
8
+ error: string;
9
+ };
10
+ //# sourceMappingURL=general.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"general.d.ts","sourceRoot":"","sources":["../../src/types/general.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,UAAU,GAAG,WAAW,CAAC;AAE3D,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;AAErE,MAAM,MAAM,QAAQ,CAAC,CAAC,IAClB;IACE,OAAO,EAAE,IAAI,CAAC;IACd,IAAI,EAAE,CAAC,CAAC;CACT,GACD;IACE,OAAO,EAAE,KAAK,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf,CAAC"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=general.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,8 @@
1
+ export type { BaseServiceOptions, BaseDocument } from "./base";
2
+ export type { CommentMention, Comment } from "./comment";
3
+ export type { CollectionEntry, TenantPluginConfig, CommentsPluginConfig, CommentsPluginConfigStorage } from "./config";
4
+ export type { User } from "./user";
5
+ export type { FilterMode, LoadingStatus, Response } from "./general";
6
+ export type { DocumentTitles } from "./collection";
7
+ export type { EntityConfig, EntityLabel, EntityLabelsMap, FieldLabelSegment, GlobalFieldLabelRegistry, Mode } from "./entity";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAC;AAC/D,YAAY,EAAE,cAAc,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACzD,YAAY,EAAE,eAAe,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,2BAA2B,EAAE,MAAM,UAAU,CAAC;AACvH,YAAY,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AACnC,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AACrE,YAAY,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,eAAe,EAAE,iBAAiB,EAAE,wBAAwB,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
@@ -0,0 +1,6 @@
1
+ export interface User {
2
+ id: number;
3
+ email?: string | null;
4
+ [key: string]: unknown;
5
+ }
6
+ //# sourceMappingURL=user.d.ts.map