@layers-app/shared 0.4.7 → 0.4.9

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 (278) hide show
  1. package/dist/assets/default-workspace-avatar.jpg.js +1 -1
  2. package/dist/components/AliasTextInput/AliasTextInput.d.ts.map +1 -1
  3. package/dist/components/AliasTextInput/AliasTextInput.js +32 -32
  4. package/dist/components/AnimatedFigurePage/AnimatedFigurePage.module.css.js +13 -13
  5. package/dist/components/AppContainer/AppContainer.d.ts +1 -1
  6. package/dist/components/AppContainer/AppContainer.d.ts.map +1 -1
  7. package/dist/components/AppContainer/AppContainer.js +76 -71
  8. package/dist/components/AppContainer/AppContainer.module.css.js +14 -14
  9. package/dist/components/AppContainer/components/AppsSidebar/TopSection.d.ts.map +1 -1
  10. package/dist/components/AppContainer/components/AppsSidebar/TopSection.js +77 -49
  11. package/dist/components/AppContainer/components/NavbarContent.d.ts.map +1 -1
  12. package/dist/components/AppContainer/components/NavbarContent.js +16 -2
  13. package/dist/components/AppContainer/components/ToolSidebar.d.ts +5 -0
  14. package/dist/components/AppContainer/components/ToolSidebar.d.ts.map +1 -1
  15. package/dist/components/AppContainer/components/ToolSidebar.js +42 -30
  16. package/dist/components/AppContainer/components/menus/HelpMenu/HelpMenu.module.css.js +90 -90
  17. package/dist/components/AppContainer/types.d.ts +12 -0
  18. package/dist/components/AppContainer/types.d.ts.map +1 -1
  19. package/dist/components/AppShell/AppShell.module.css.js +5 -5
  20. package/dist/components/AttachmentsGalleryModal/components/ModalHeader.d.ts.map +1 -1
  21. package/dist/components/AttachmentsGalleryModal/components/ModalHeader.js +59 -52
  22. package/dist/components/AttachmentsGalleryModal/components/ShakePlayer/ShakaPlayer.module.css.js +4 -4
  23. package/dist/components/AttachmentsGalleryModal/components/useAttachmentVideoStatus.d.ts +1 -0
  24. package/dist/components/AttachmentsGalleryModal/components/useAttachmentVideoStatus.d.ts.map +1 -1
  25. package/dist/components/AttachmentsGalleryModal/components/useAttachmentVideoStatus.js +16 -15
  26. package/dist/components/AttachmentsGalleryModal/styles.module.css.js +22 -22
  27. package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts +3 -1
  28. package/dist/components/AttachmentsPreview/AttachmentsPreview.d.ts.map +1 -1
  29. package/dist/components/AttachmentsPreview/AttachmentsPreview.js +237 -93
  30. package/dist/components/AttachmentsPreview/AttachmentsPreview.module.css.js +22 -20
  31. package/dist/components/BouncingLogo/BouncingLogo.module.css.js +4 -4
  32. package/dist/components/Chat/CallMessage/CallMessage.module.css.js +8 -8
  33. package/dist/components/Chat/ChatBubble/ChatBubble.module.css.js +1 -1
  34. package/dist/components/Chat/ChatHeader/ChatHeader.module.css.js +1 -1
  35. package/dist/components/Chat/ChatInput/ChatInput.module.css.js +44 -44
  36. package/dist/components/Chat/ChatInput/index.d.ts +13 -1
  37. package/dist/components/Chat/ChatInput/index.d.ts.map +1 -1
  38. package/dist/components/Chat/ChatInput/index.js +264 -164
  39. package/dist/components/Chat/ChatInput/useVoiceRecorder.d.ts +16 -0
  40. package/dist/components/Chat/ChatInput/useVoiceRecorder.d.ts.map +1 -0
  41. package/dist/components/Chat/ChatInput/useVoiceRecorder.js +83 -0
  42. package/dist/components/Chat/ChatLayout/ChatLayout.module.css.js +4 -4
  43. package/dist/components/Chat/ChatMessage/ChatMessage.module.css.js +20 -16
  44. package/dist/components/Chat/ChatMessage/index.d.ts +16 -0
  45. package/dist/components/Chat/ChatMessage/index.d.ts.map +1 -1
  46. package/dist/components/Chat/ChatMessage/index.js +153 -118
  47. package/dist/components/Chat/ChatPill/ChatPill.module.css.js +1 -1
  48. package/dist/components/Chat/DialogItem/DialogItem.module.css.js +4 -4
  49. package/dist/components/Chat/DialogList/DialogList.module.css.js +1 -1
  50. package/dist/components/Chat/MediaDocument/MediaDocument.module.css.js +4 -4
  51. package/dist/components/Chat/MessageActions/MessageActions.module.css.js +1 -1
  52. package/dist/components/Chat/MessageActions/index.d.ts +2 -0
  53. package/dist/components/Chat/MessageActions/index.d.ts.map +1 -1
  54. package/dist/components/Chat/MessageActions/index.js +188 -50
  55. package/dist/components/Chat/MessageAuthor/index.d.ts +7 -1
  56. package/dist/components/Chat/MessageAuthor/index.d.ts.map +1 -1
  57. package/dist/components/Chat/MessageAuthor/index.js +39 -25
  58. package/dist/components/Chat/MessageForward/MessageForward.module.css.js +1 -1
  59. package/dist/components/Chat/MessageList/MessageList.module.css.js +14 -12
  60. package/dist/components/Chat/MessageList/index.d.ts +17 -25
  61. package/dist/components/Chat/MessageList/index.d.ts.map +1 -1
  62. package/dist/components/Chat/MessageList/index.js +201 -149
  63. package/dist/components/Chat/MessageMeta/MessageMeta.module.css.js +3 -3
  64. package/dist/components/Chat/MessageReactions/MessageReactions.module.css.js +12 -12
  65. package/dist/components/Chat/MessageReply/MessageReply.module.css.js +7 -7
  66. package/dist/components/Chat/MessageStatus/MessageStatus.module.css.js +8 -8
  67. package/dist/components/Chat/ServiceMessage/ServiceMessage.module.css.js +1 -1
  68. package/dist/components/CollapsibleContainer/CollapsibleContainer.module.css.js +1 -1
  69. package/dist/components/ColorPicker/ColorPicker.module.css.js +32 -26
  70. package/dist/components/ColorPicker/ColorPickerList.d.ts.map +1 -1
  71. package/dist/components/ColorPicker/ColorPickerList.js +83 -72
  72. package/dist/components/ColorPicker/ColorPickerToolbar.d.ts +1 -0
  73. package/dist/components/ColorPicker/ColorPickerToolbar.d.ts.map +1 -1
  74. package/dist/components/ColorPicker/ColorPickerToolbar.js +94 -85
  75. package/dist/components/ColorPicker/icons.js +5 -5
  76. package/dist/components/ColorPicker/types.d.ts +6 -0
  77. package/dist/components/ColorPicker/types.d.ts.map +1 -1
  78. package/dist/components/ColorPicker/types.js +53 -11
  79. package/dist/components/ColorPicker/useRecentColors.d.ts +3 -1
  80. package/dist/components/ColorPicker/useRecentColors.d.ts.map +1 -1
  81. package/dist/components/ColorPicker/useRecentColors.js +43 -20
  82. package/dist/components/CommentComposer/CommentComposer.module.css.js +14 -10
  83. package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts +2 -1
  84. package/dist/components/CommentComposer/CommentEditorHotkeys.d.ts.map +1 -1
  85. package/dist/components/CommentComposer/CommentEditorHotkeys.js +29 -26
  86. package/dist/components/CommentComposer/index.d.ts +2 -1
  87. package/dist/components/CommentComposer/index.d.ts.map +1 -1
  88. package/dist/components/CommentComposer/index.js +333 -313
  89. package/dist/components/CommentComposer/types.d.ts +10 -0
  90. package/dist/components/CommentComposer/types.d.ts.map +1 -1
  91. package/dist/components/CommunitiesDialog/styles.module.css.js +1 -1
  92. package/dist/components/Copyright/Copyright.module.css.js +1 -1
  93. package/dist/components/CustomKBD/CustomKBD.module.css.js +1 -1
  94. package/dist/components/CustomKBD/index.js +21 -22
  95. package/dist/components/EmojiPicker/EmojiPicker.d.ts +1 -0
  96. package/dist/components/EmojiPicker/EmojiPicker.d.ts.map +1 -1
  97. package/dist/components/EmojiPicker/EmojiPicker.js +129 -121
  98. package/dist/components/EmojiPicker/EmojiPicker.module.css.js +8 -8
  99. package/dist/components/EntityTitle/EntityTitle.d.ts +3 -4
  100. package/dist/components/EntityTitle/EntityTitle.d.ts.map +1 -1
  101. package/dist/components/EntityTitle/EntityTitle.js +81 -80
  102. package/dist/components/EntityTitle/EntityTitle.module.css.js +1 -1
  103. package/dist/components/ErrorPage/components/Error404.d.ts.map +1 -1
  104. package/dist/components/FeatureProgress/FeatureProgress.module.css.js +49 -49
  105. package/dist/components/FilePicker/FilePicker.module.css.js +7 -7
  106. package/dist/components/FormViewer/FormViewer.module.css.js +20 -20
  107. package/dist/components/FormViewer/components/fields/DragOptions/DragOptions.module.css.js +1 -1
  108. package/dist/components/FormViewer/components/fields/DropdownField/DropdownField.module.css.js +1 -1
  109. package/dist/components/FormViewer/components/fields/EditableContent/EditableContent.module.css.js +1 -1
  110. package/dist/components/FormViewer/components/fields/SelectableCard/SelectableCard.module.css.js +8 -8
  111. package/dist/components/FormViewer/components/fields/UploadField/UploadFile/UploadFile.module.css.js +4 -4
  112. package/dist/components/FormViewer/helpers/conditions.d.ts.map +1 -1
  113. package/dist/components/FormViewer/helpers/conditions.js +33 -17
  114. package/dist/components/FormViewer/store/formStore.d.ts.map +1 -1
  115. package/dist/components/ImageCropper/ImageCropper.module.css.js +38 -38
  116. package/dist/components/IntegrationFlowAnimation/IntegrationFlowAnimation.module.css.js +11 -11
  117. package/dist/components/LanguagePicker/LanguagePicker.module.css.js +1 -1
  118. package/dist/components/Loaders/styles.module.css.js +6 -6
  119. package/dist/components/MediaLibrary/MediaLibrary.module.css.js +2 -2
  120. package/dist/components/MusicPlayerBar/MusicPlayerBar.module.css.js +23 -23
  121. package/dist/components/NavMenu/NavMenu.module.css.js +12 -12
  122. package/dist/components/NavbarResizer/NavbarResizer.module.css.js +2 -2
  123. package/dist/components/NotPublicPanel/NotPublicPanel.module.css.js +11 -11
  124. package/dist/components/Notification/InfiniteScroll.d.ts +12 -0
  125. package/dist/components/Notification/InfiniteScroll.d.ts.map +1 -0
  126. package/dist/components/Notification/InfiniteScroll.js +42 -0
  127. package/dist/components/Notification/Notification.d.ts +4 -1
  128. package/dist/components/Notification/Notification.d.ts.map +1 -1
  129. package/dist/components/Notification/Notification.module.css.js +28 -4
  130. package/dist/components/Notification/atoms/ActionBadge.d.ts +11 -0
  131. package/dist/components/Notification/atoms/ActionBadge.d.ts.map +1 -0
  132. package/dist/components/Notification/atoms/ActionBadge.js +53 -0
  133. package/dist/components/Notification/atoms/ArchiveIcon.d.ts +7 -0
  134. package/dist/components/Notification/atoms/ArchiveIcon.d.ts.map +1 -0
  135. package/dist/components/Notification/atoms/ArchiveIcon.js +40 -0
  136. package/dist/components/Notification/atoms/InboxIcon.d.ts +7 -0
  137. package/dist/components/Notification/atoms/InboxIcon.d.ts.map +1 -0
  138. package/dist/components/Notification/atoms/InboxIcon.js +33 -0
  139. package/dist/components/Notification/atoms/MarkReadIcon.d.ts +7 -0
  140. package/dist/components/Notification/atoms/MarkReadIcon.d.ts.map +1 -0
  141. package/dist/components/Notification/atoms/MarkReadIcon.js +33 -0
  142. package/dist/components/Notification/atoms/ResourceIcon.d.ts +7 -0
  143. package/dist/components/Notification/atoms/ResourceIcon.d.ts.map +1 -0
  144. package/dist/components/Notification/atoms/TabBadge.d.ts +7 -0
  145. package/dist/components/Notification/atoms/TabBadge.d.ts.map +1 -0
  146. package/dist/components/Notification/atoms/TabBadge.js +32 -0
  147. package/dist/components/Notification/atoms/UnreadDot.d.ts +6 -0
  148. package/dist/components/Notification/atoms/UnreadDot.d.ts.map +1 -0
  149. package/dist/components/Notification/atoms/UnreadDot.js +23 -0
  150. package/dist/components/Notification/atoms/index.d.ts +5 -0
  151. package/dist/components/Notification/atoms/index.d.ts.map +1 -0
  152. package/dist/components/Notification/hooks/index.d.ts +8 -0
  153. package/dist/components/Notification/hooks/index.d.ts.map +1 -0
  154. package/dist/components/Notification/hooks/useInboxActions.d.ts +12 -0
  155. package/dist/components/Notification/hooks/useInboxActions.d.ts.map +1 -0
  156. package/dist/components/Notification/hooks/useInboxActions.js +58 -0
  157. package/dist/components/Notification/hooks/useInboxLoader.d.ts +8 -0
  158. package/dist/components/Notification/hooks/useInboxLoader.d.ts.map +1 -0
  159. package/dist/components/Notification/hooks/useInboxLoader.js +49 -0
  160. package/dist/components/Notification/hooks/useNotificationItem.d.ts +26 -0
  161. package/dist/components/Notification/hooks/useNotificationItem.d.ts.map +1 -0
  162. package/dist/components/Notification/hooks/useNotificationItem.js +51 -0
  163. package/dist/components/Notification/hooks/useNotificationStore.d.ts +49 -0
  164. package/dist/components/Notification/hooks/useNotificationStore.d.ts.map +1 -0
  165. package/dist/components/Notification/hooks/useNotificationStore.js +139 -0
  166. package/dist/components/Notification/hooks/useNotificationStream.d.ts +2 -0
  167. package/dist/components/Notification/hooks/useNotificationStream.d.ts.map +1 -0
  168. package/dist/components/Notification/hooks/useNotificationStream.js +86 -0
  169. package/dist/components/Notification/hooks/useNotificationTime.d.ts +2 -0
  170. package/dist/components/Notification/hooks/useNotificationTime.d.ts.map +1 -0
  171. package/dist/components/Notification/hooks/useNotificationTime.js +23 -0
  172. package/dist/components/Notification/hooks/useNotificationsApi.d.ts +25 -0
  173. package/dist/components/Notification/hooks/useNotificationsApi.d.ts.map +1 -0
  174. package/dist/components/Notification/hooks/useNotificationsApi.js +64 -0
  175. package/dist/components/Notification/lib/api.d.ts +4 -0
  176. package/dist/components/Notification/lib/api.d.ts.map +1 -0
  177. package/dist/components/Notification/lib/api.js +19 -0
  178. package/dist/components/Notification/lib/index.d.ts +5 -0
  179. package/dist/components/Notification/lib/index.d.ts.map +1 -0
  180. package/dist/components/Notification/lib/notificationText.d.ts +10 -0
  181. package/dist/components/Notification/lib/notificationText.d.ts.map +1 -0
  182. package/dist/components/Notification/lib/notificationText.js +131 -0
  183. package/dist/components/Notification/lib/stripHtml.d.ts +2 -0
  184. package/dist/components/Notification/lib/stripHtml.d.ts.map +1 -0
  185. package/dist/components/Notification/lib/stripHtml.js +6 -0
  186. package/dist/components/Notification/lib/types.d.ts +45 -0
  187. package/dist/components/Notification/lib/types.d.ts.map +1 -0
  188. package/dist/components/Notification/lib/types.js +9 -0
  189. package/dist/components/Notification/molecules/InboxEmpty.d.ts +8 -0
  190. package/dist/components/Notification/molecules/InboxEmpty.d.ts.map +1 -0
  191. package/dist/components/Notification/molecules/InboxEmpty.js +21 -0
  192. package/dist/components/Notification/molecules/InboxHeader.d.ts +17 -0
  193. package/dist/components/Notification/molecules/InboxHeader.d.ts.map +1 -0
  194. package/dist/components/Notification/molecules/InboxHeader.js +73 -0
  195. package/dist/components/Notification/molecules/InboxTabs.d.ts +15 -0
  196. package/dist/components/Notification/molecules/InboxTabs.d.ts.map +1 -0
  197. package/dist/components/Notification/molecules/InboxTabs.js +60 -0
  198. package/dist/components/Notification/molecules/NotificationActions.d.ts +9 -0
  199. package/dist/components/Notification/molecules/NotificationActions.d.ts.map +1 -0
  200. package/dist/components/Notification/molecules/NotificationActions.js +64 -0
  201. package/dist/components/Notification/molecules/NotificationAvatar.d.ts +17 -0
  202. package/dist/components/Notification/molecules/NotificationAvatar.d.ts.map +1 -0
  203. package/dist/components/Notification/molecules/NotificationAvatar.js +38 -0
  204. package/dist/components/Notification/molecules/NotificationContent.d.ts +22 -0
  205. package/dist/components/Notification/molecules/NotificationContent.d.ts.map +1 -0
  206. package/dist/components/Notification/molecules/NotificationContent.js +183 -0
  207. package/dist/components/Notification/molecules/index.d.ts +7 -0
  208. package/dist/components/Notification/molecules/index.d.ts.map +1 -0
  209. package/dist/components/Notification/organisms/InboxItem.d.ts +14 -0
  210. package/dist/components/Notification/organisms/InboxItem.d.ts.map +1 -0
  211. package/dist/components/Notification/organisms/InboxItem.js +100 -0
  212. package/dist/components/Notification/organisms/InboxPanel.d.ts +4 -0
  213. package/dist/components/Notification/organisms/InboxPanel.d.ts.map +1 -0
  214. package/dist/components/Notification/organisms/InboxPanel.js +99 -0
  215. package/dist/components/Notification/organisms/index.d.ts +3 -0
  216. package/dist/components/Notification/organisms/index.d.ts.map +1 -0
  217. package/dist/components/PillTabs/PillTabs.module.css.js +1 -1
  218. package/dist/components/SearchFilters/SearchFilters.module.css.js +1 -1
  219. package/dist/components/SettingsSection/styles.module.css.js +1 -1
  220. package/dist/components/StorageUsageProgress/StorageUsageProgress.module.css.js +1 -1
  221. package/dist/components/TreeIndent/TreeIndent.module.css.js +4 -4
  222. package/dist/components/modals/RemoveConfirmModal.d.ts.map +1 -1
  223. package/dist/components/modals/RemoveConfirmModal.js +27 -26
  224. package/dist/components/table/FrontTable.d.ts.map +1 -1
  225. package/dist/components/table/hooks/useColumnsResizing.d.ts.map +1 -1
  226. package/dist/config/envConfig.d.ts +2 -0
  227. package/dist/config/envConfig.d.ts.map +1 -1
  228. package/dist/config/envConfig.js +29 -28
  229. package/dist/helpers/getFileIcons.js +5 -5
  230. package/dist/helpers/getFileType.d.ts +1 -1
  231. package/dist/helpers/getFileType.d.ts.map +1 -1
  232. package/dist/helpers/getFileType.js +11 -1
  233. package/dist/helpers/platform.d.ts +1 -1
  234. package/dist/helpers/platform.d.ts.map +1 -1
  235. package/dist/helpers/platform.js +1 -0
  236. package/dist/helpers/showFeatureFeedback.module.css.js +4 -4
  237. package/dist/helpers/showNotifications.module.css.js +1 -1
  238. package/dist/hooks/useDateUtils.d.ts +3 -1
  239. package/dist/hooks/useDateUtils.d.ts.map +1 -1
  240. package/dist/hooks/useDateUtils.js +23 -18
  241. package/dist/index.css +1 -1
  242. package/dist/index.js +595 -588
  243. package/dist/lang/locales/ui_en.json.js +9 -7
  244. package/dist/lang/locales/ui_es.json.js +6 -4
  245. package/dist/lang/locales/ui_ru.json.js +8 -6
  246. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/Audio.context.js +15 -0
  247. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/Audio.js +228 -0
  248. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/Audio.module.css.js +4 -0
  249. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioControls.js +19 -0
  250. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioMuteButton.js +30 -0
  251. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioPlayButton.js +40 -0
  252. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioSkipButton.js +28 -0
  253. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioSpectrum.js +137 -0
  254. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioSpeedControl.js +31 -0
  255. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioTimeDisplay.js +44 -0
  256. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioTimeline.js +71 -0
  257. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioVolumeSlider.js +43 -0
  258. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/components/AudioWaveform.js +166 -0
  259. package/dist/node_modules/@gfazioli/mantine-audio/dist/esm/use-audio.js +201 -0
  260. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/Video.context.js +15 -0
  261. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/Video.js +272 -0
  262. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/Video.module.css.js +4 -0
  263. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoCaptionsButton.js +55 -0
  264. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoControls.js +30 -0
  265. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoFullscreenButton.js +31 -0
  266. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoMuteButton.js +29 -0
  267. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoPiPButton.js +29 -0
  268. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoPlayButton.js +28 -0
  269. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoSkipButton.js +27 -0
  270. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoTimeDisplay.js +44 -0
  271. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/components/VideoTimeline.js +70 -0
  272. package/dist/node_modules/@gfazioli/mantine-video/dist/esm/use-video.js +170 -0
  273. package/docs/README.md +499 -499
  274. package/package.json +81 -79
  275. package/dist/components/Notification/Notification.js +0 -119
  276. package/dist/components/Notification/NotificationCard.d.ts +0 -10
  277. package/dist/components/Notification/NotificationCard.d.ts.map +0 -1
  278. package/dist/components/Notification/NotificationCard.js +0 -93
@@ -0,0 +1,23 @@
1
+ import { jsx as r } from "react/jsx-runtime";
2
+ function i({ size: o = 10 }) {
3
+ return /* @__PURE__ */ r(
4
+ "div",
5
+ {
6
+ style: {
7
+ position: "absolute",
8
+ top: -2,
9
+ left: -2,
10
+ width: o,
11
+ height: o,
12
+ borderRadius: "50%",
13
+ backgroundColor: "var(--mantine-primary-color-filled)",
14
+ border: "2px solid var(--mantine-color-body)",
15
+ boxSizing: "content-box",
16
+ zIndex: 2
17
+ }
18
+ }
19
+ );
20
+ }
21
+ export {
22
+ i as UnreadDot
23
+ };
@@ -0,0 +1,5 @@
1
+ export { UnreadDot } from './UnreadDot';
2
+ export { ActionBadge, resolveActionBadge } from './ActionBadge';
3
+ export { ResourceIcon } from './ResourceIcon';
4
+ export { TabBadge } from './TabBadge';
5
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Notification/atoms/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC"}
@@ -0,0 +1,8 @@
1
+ export { useInboxActions } from './useInboxActions';
2
+ export { useInboxLoader } from './useInboxLoader';
3
+ export { useNotificationItem } from './useNotificationItem';
4
+ export { useNotificationsApi } from './useNotificationsApi';
5
+ export { useNotificationStore, getActiveSourceValues } from './useNotificationStore';
6
+ export { useNotificationStream } from './useNotificationStream';
7
+ export { useNotificationTime } from './useNotificationTime';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Notification/hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AACrF,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { NotificationDTO } from '../lib/types';
2
+ export declare function useInboxActions(wsAlias: string, refreshCounts: () => void, loadPage: (p: number) => Promise<void>, onNavigate?: () => void): {
3
+ handleClick: (n: NotificationDTO) => Promise<void>;
4
+ handleRead: (id: number) => Promise<void>;
5
+ handleUnread: (id: number) => Promise<void>;
6
+ handleArchive: (id: number) => void;
7
+ handleUnarchive: (id: number) => void;
8
+ handleMarkAllRead: () => Promise<void>;
9
+ handleArchiveAll: () => Promise<void>;
10
+ handleArchiveRead: () => Promise<void>;
11
+ };
12
+ //# sourceMappingURL=useInboxActions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useInboxActions.d.ts","sourceRoot":"","sources":["../../../../src/components/Notification/hooks/useInboxActions.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAEpD,wBAAgB,eAAe,CAC7B,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,IAAI,EACzB,QAAQ,EAAE,CAAC,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,EACtC,UAAU,CAAC,EAAE,MAAM,IAAI;qBAgCX,eAAe;qBAkBe,MAAM;uBAQJ,MAAM;wBAQX,MAAM;0BAMJ,MAAM;;;;EA0BhD"}
@@ -0,0 +1,58 @@
1
+ import { useCallback as o } from "react";
2
+ import { useNavigate as U } from "react-router-dom";
3
+ import { useNotificationStore as d } from "./useNotificationStore.js";
4
+ import { useNotificationsApi as b } from "./useNotificationsApi.js";
5
+ import { isMention as x, buildNotificationLink as M } from "../lib/notificationText.js";
6
+ function O(p, n, c, l) {
7
+ const m = U(), i = b(), e = d((t) => t.updateNotification), f = d((t) => t.removeNotification), s = o(
8
+ (t, a) => {
9
+ const r = d.getState(), { all: T, mentions: w } = r.unreadCounts;
10
+ r.setUnreadCounts({
11
+ all: Math.max(0, T + t),
12
+ mentions: x(a) ? Math.max(0, w + t) : w
13
+ });
14
+ },
15
+ []
16
+ ), h = o((t) => {
17
+ new URL(t, window.location.origin).pathname === window.location.pathname ? window.location.assign(t) : (m(t), l?.());
18
+ }, [m, l]), A = o(
19
+ async (t) => {
20
+ const a = M(t.notificationType, t.objectId, t.parentId, p, t.link);
21
+ if (!t.read) {
22
+ e(t.id, { read: !0 }), s(-1, t.notificationType), a && h(a), await i.markAsRead([t.id]), n();
23
+ return;
24
+ }
25
+ a && (m(a), l?.());
26
+ },
27
+ [i, m, h, e, n, p, s, l]
28
+ ), y = o(async (t) => {
29
+ const a = d.getState().notifications.find((r) => r.id === t);
30
+ e(t, { read: !0 }), a && !a.read && s(-1, a.notificationType), await i.markAsRead([t]), n();
31
+ }, [i, e, n, s]), k = o(async (t) => {
32
+ const a = d.getState().notifications.find((r) => r.id === t);
33
+ e(t, { read: !1 }), a && a.read && s(1, a.notificationType), await i.markAsUnread([t]), n();
34
+ }, [i, e, n, s]), u = o((t) => {
35
+ i.archiveIds([t]), f(t), n();
36
+ }, [i, f, n]), v = o((t) => {
37
+ i.unarchiveIds([t]), f(t), n();
38
+ }, [i, f, n]), R = o(async () => {
39
+ await i.markAllAsRead(), c(0);
40
+ }, [i, c]), I = o(async () => {
41
+ await i.archiveAll(), c(0);
42
+ }, [i, c]), N = o(async () => {
43
+ await i.archiveRead(), c(0);
44
+ }, [i, c]);
45
+ return {
46
+ handleClick: A,
47
+ handleRead: y,
48
+ handleUnread: k,
49
+ handleArchive: u,
50
+ handleUnarchive: v,
51
+ handleMarkAllRead: R,
52
+ handleArchiveAll: I,
53
+ handleArchiveRead: N
54
+ };
55
+ }
56
+ export {
57
+ O as useInboxActions
58
+ };
@@ -0,0 +1,8 @@
1
+ export declare function useInboxLoader(activeWorkspaceId: string): {
2
+ loadPage: (p: number) => Promise<void>;
3
+ handleLoadMore: () => void;
4
+ refreshCounts: () => Promise<void>;
5
+ loading: boolean;
6
+ hasMore: boolean;
7
+ };
8
+ //# sourceMappingURL=useInboxLoader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useInboxLoader.d.ts","sourceRoot":"","sources":["../../../../src/components/Notification/hooks/useInboxLoader.ts"],"names":[],"mappings":"AAOA,wBAAgB,cAAc,CAAC,iBAAiB,EAAE,MAAM;kBAiB1C,MAAM;;;;;EA8CnB"}
@@ -0,0 +1,49 @@
1
+ import { useCallback as d, useEffect as L, useRef as M } from "react";
2
+ import { useNotificationStore as n, getActiveSourceValues as p } from "./useNotificationStore.js";
3
+ import { useNotificationsApi as P } from "./useNotificationsApi.js";
4
+ const A = 20;
5
+ function T(e) {
6
+ const a = P(), c = n((t) => t.tab), r = n((t) => t.unreadOnly), s = n((t) => t.activeSources), g = n((t) => t.page), y = n((t) => t.loading), f = n((t) => t.hasMore), N = n((t) => t.refreshTrigger), C = n((t) => t.setNotifications), x = n((t) => t.appendNotifications), u = n((t) => t.setUnreadCounts), h = n((t) => t.setLoading), m = n((t) => t.nextPage), i = d(
7
+ async (t) => {
8
+ h(!0);
9
+ try {
10
+ const b = p(s), o = await a.fetchNotifications(
11
+ c,
12
+ t,
13
+ A,
14
+ r,
15
+ b,
16
+ e || void 0
17
+ );
18
+ t === 0 ? C(o.data.notifications, o.pagination.totalElements) : x(o.data.notifications, o.pagination.totalElements), u({ all: o.data.unreadCount, mentions: o.data.unreadMentions });
19
+ } catch {
20
+ } finally {
21
+ h(!1);
22
+ }
23
+ },
24
+ [a, c, r, s, e]
25
+ );
26
+ L(() => {
27
+ i(0);
28
+ }, [c, r, s, e, N]);
29
+ const l = M(!1), E = d(() => {
30
+ if (l.current || !f) return;
31
+ l.current = !0;
32
+ const t = g + 1;
33
+ m(), i(t).finally(() => {
34
+ l.current = !1;
35
+ });
36
+ }, [f, g, m, i]), S = d(async () => {
37
+ try {
38
+ const t = p(s);
39
+ u(
40
+ await a.fetchCounts(e || void 0, t)
41
+ );
42
+ } catch {
43
+ }
44
+ }, [a, e, s, u]);
45
+ return { loadPage: i, handleLoadMore: E, refreshCounts: S, loading: y, hasMore: f };
46
+ }
47
+ export {
48
+ T as useInboxLoader
49
+ };
@@ -0,0 +1,26 @@
1
+ import type { NotificationDTO, NotificationVariant } from '../lib/types';
2
+ export declare function useNotificationItem(n: NotificationDTO): {
3
+ resolved: string | null;
4
+ variant: NotificationVariant;
5
+ isUser: boolean;
6
+ actorName: string;
7
+ verb: string;
8
+ source: string;
9
+ sourceKey: string | null;
10
+ time: string;
11
+ statusValue: string | null;
12
+ statusOldValue: string | null;
13
+ taskKey: string | null;
14
+ commentPreview: string | null;
15
+ objectName: string;
16
+ systemTitle: string | null;
17
+ showInvitationActor: boolean;
18
+ fallbackUser: {
19
+ id: string;
20
+ avatar: string | null;
21
+ name: string | null;
22
+ } | null;
23
+ statusFirst: boolean;
24
+ tailConnector: string;
25
+ };
26
+ //# sourceMappingURL=useNotificationItem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useNotificationItem.d.ts","sourceRoot":"","sources":["../../../../src/components/Notification/hooks/useNotificationItem.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAoBzE,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,eAAe;;;;;;;;;;;;;;;;;;;;;;;EAuIrD"}
@@ -0,0 +1,51 @@
1
+ import { useTranslation as U } from "react-i18next";
2
+ import { IconEntity as G } from "../../ProjectIcon/ProjectIcon.js";
3
+ import { useAppContainerDataStore as x } from "../../AppContainer/hooks/useAppContainerDataStore.js";
4
+ import { resolveNotificationType as F, getNotificationVerbSelf as $, getNotificationVerb as Y, getSourceLabel as B, getSourceKey as W, getSystemMessage as X } from "../lib/notificationText.js";
5
+ import { stripHtml as q } from "../lib/stripHtml.js";
6
+ import { useNotificationTime as z } from "./useNotificationTime.js";
7
+ function J(e) {
8
+ const o = e || "";
9
+ return o.includes("WORKSPACE_CREATED") ? "system-success" : o.includes("INVITATION_ACCEPTED") ? "system-invitation-accepted" : o.includes("INVITATION_DECLINED") ? "system-invitation-declined" : o.includes("WORKSPACE_DELETED") ? "system-alert" : o === "MISSED_CALL" ? "system-call-missed" : o.includes("SUBSCRIPTION") || o.includes("EXPIRE") ? "system-warning" : "user-action";
10
+ }
11
+ function De(e) {
12
+ const { t: o } = U("appContainer"), r = x((n) => n.user), v = z(), t = F(e.notificationType), A = J(t), E = A === "user-action", D = !e.actorUserId || e.actorUserId === r.id, _ = D ? "" : e.actorName || o("inbox.actor.someone"), c = e.params?.reaction || "", d = c.includes("=") && G.parse(c)?.emoji || c, N = d ? { emoji: d } : void 0, O = D ? $(o, e.notificationType, N) : Y(o, e.notificationType, N), M = B(o, e.notificationType, e.link ?? e.parentId), P = W(e.notificationType, e.link ?? e.parentId), b = v(e.createdAt), l = t === "ACCESS_GRANTED" || t === "ACCESS_REVOKED" || t === "INVITATION_ACCEPTED_BY", C = (n) => {
13
+ const a = `inbox.role.${n}`, i = o(a, { defaultValue: n });
14
+ return i === a ? n : i;
15
+ }, T = t === "TASK_TIME_ESTIMATE_ADDED", m = t === "TASK_TIME_ESTIMATE_CHANGED", S = (n) => {
16
+ if (!n) return null;
17
+ const a = Number(n);
18
+ if (!Number.isFinite(a) || a <= 0) return null;
19
+ const i = a / 60;
20
+ return i >= 1 ? i % 1 === 0 ? `${i}h` : `${i.toFixed(1)}h` : `${Math.round(a)}m`;
21
+ }, p = t === "TASK_TIME_ESTIMATE_REMOVED" || (t === "TASK_START_DATE_REMOVED" || t === "TASK_DUE_DATE_REMOVED") || t === "TASK_PARENT_REMOVED" ? null : e.params?.newValue || null, f = e.params?.oldValue || null, u = l ? e.params?.role || null : T || m ? S(p) : p, K = l && u ? C(u) : u, I = t === "TASK_START_DATE_CHANGED" || t === "TASK_DUE_DATE_CHANGED", R = t === "TASK_START_DATE_ADDED" || t === "TASK_DUE_DATE_ADDED", V = I || m ? m ? S(f) : f : null, g = o(l ? "inbox.asConnector" : "inbox.statusConnector"), h = e.params?.taskKey || null, y = (t === "TASK_COMMENT_ADDED" || t === "PAGE_COMMENT_ADDED" || t === "COMMENT_REPLIED") && e.params?.commentPreview || "", w = y && q(y) || null, k = t === "COMMENT_RESOLVED" || t === "COMMENT_REACTION_ADDED" || t === "MISSED_CALL" || t === "CHANNEL_ADDED" ? "" : e.objectName || "", s = {};
22
+ e.objectName && (s.role = e.objectName, s.channel = e.objectName, s.workspace = e.objectName), e.params?.role && (s.role = C(e.params.role)), e.params?.actor ? s.actor = e.params.actor : e.actorName && (s.actor = e.actorName);
23
+ const L = E ? null : X(
24
+ o,
25
+ e.notificationType,
26
+ Object.keys(s).length ? s : void 0
27
+ ) || e.notificationType || "", j = !E && !!_ && !!(t?.includes("INVITATION_ACCEPTED") || t?.includes("INVITATION_DECLINED")), H = r.id ? { id: r.id, avatar: r.avatar || null, name: r.name || null } : null;
28
+ return {
29
+ resolved: t,
30
+ variant: A,
31
+ isUser: E,
32
+ actorName: _,
33
+ verb: O,
34
+ source: M,
35
+ sourceKey: P,
36
+ time: b,
37
+ statusValue: K,
38
+ statusOldValue: V,
39
+ taskKey: h,
40
+ commentPreview: w,
41
+ objectName: k,
42
+ systemTitle: L,
43
+ showInvitationActor: j,
44
+ fallbackUser: H,
45
+ statusFirst: t === "TASK_STATUS_CHANGED" || t === "TASK_TYPE_CHANGED" || t === "TASK_PRIORITY_CHANGED" || t === "TASK_PARENT_CHANGED" || I || R || T || m,
46
+ tailConnector: g
47
+ };
48
+ }
49
+ export {
50
+ De as useNotificationItem
51
+ };
@@ -0,0 +1,49 @@
1
+ import type { NotificationDTO, NotificationTab, SourceCategoryKey, UnreadCounts } from '../lib/types';
2
+ interface PerWorkspaceFilter {
3
+ activeSources: SourceCategoryKey[];
4
+ unreadOnly: boolean;
5
+ }
6
+ interface NotificationStore {
7
+ notifications: NotificationDTO[];
8
+ tab: NotificationTab;
9
+ unreadOnly: boolean;
10
+ activeSources: Set<SourceCategoryKey>;
11
+ unreadCounts: UnreadCounts;
12
+ page: number;
13
+ totalElements: number;
14
+ loading: boolean;
15
+ hasMore: boolean;
16
+ refreshTrigger: number;
17
+ currentWorkspaceId: string | null;
18
+ wsFilters: Record<string, PerWorkspaceFilter>;
19
+ setTab: (tab: NotificationTab) => void;
20
+ setUnreadOnly: (v: boolean) => void;
21
+ toggleSource: (key: SourceCategoryKey) => void;
22
+ setSources: (keys: SourceCategoryKey[]) => void;
23
+ setWorkspaceContext: (workspaceId: string) => void;
24
+ setNotifications: (items: NotificationDTO[], total: number) => void;
25
+ appendNotifications: (items: NotificationDTO[], total: number) => void;
26
+ setUnreadCounts: (counts: UnreadCounts) => void;
27
+ setLoading: (v: boolean) => void;
28
+ nextPage: () => void;
29
+ resetPage: () => void;
30
+ updateNotification: (id: number, patch: Partial<NotificationDTO>) => void;
31
+ removeNotification: (id: number) => void;
32
+ triggerRefresh: () => void;
33
+ }
34
+ export declare const useNotificationStore: import("zustand").UseBoundStore<Omit<import("zustand").StoreApi<NotificationStore>, "setState" | "persist"> & {
35
+ setState(partial: NotificationStore | Partial<NotificationStore> | ((state: NotificationStore) => NotificationStore | Partial<NotificationStore>), replace?: false | undefined): unknown;
36
+ setState(state: NotificationStore | ((state: NotificationStore) => NotificationStore), replace: true): unknown;
37
+ persist: {
38
+ setOptions: (options: Partial<import("zustand/middleware").PersistOptions<NotificationStore, unknown, unknown>>) => void;
39
+ clearStorage: () => void;
40
+ rehydrate: () => Promise<void> | void;
41
+ hasHydrated: () => boolean;
42
+ onHydrate: (fn: (state: NotificationStore) => void) => () => void;
43
+ onFinishHydration: (fn: (state: NotificationStore) => void) => () => void;
44
+ getOptions: () => Partial<import("zustand/middleware").PersistOptions<NotificationStore, unknown, unknown>>;
45
+ };
46
+ }>;
47
+ export declare function getActiveSourceValues(sources: Set<SourceCategoryKey>): number[] | undefined;
48
+ export {};
49
+ //# sourceMappingURL=useNotificationStore.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useNotificationStore.d.ts","sourceRoot":"","sources":["../../../../src/components/Notification/hooks/useNotificationStore.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,YAAY,EACb,MAAM,cAAc,CAAC;AAGtB,UAAU,kBAAkB;IAC1B,aAAa,EAAE,iBAAiB,EAAE,CAAC;IACnC,UAAU,EAAE,OAAO,CAAC;CACrB;AAED,UAAU,iBAAiB;IACzB,aAAa,EAAE,eAAe,EAAE,CAAC;IACjC,GAAG,EAAE,eAAe,CAAC;IACrB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,GAAG,CAAC,iBAAiB,CAAC,CAAC;IACtC,YAAY,EAAE,YAAY,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,aAAa,EAAE,MAAM,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;IAE9C,MAAM,EAAE,CAAC,GAAG,EAAE,eAAe,KAAK,IAAI,CAAC;IACvC,aAAa,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACpC,YAAY,EAAE,CAAC,GAAG,EAAE,iBAAiB,KAAK,IAAI,CAAC;IAC/C,UAAU,EAAE,CAAC,IAAI,EAAE,iBAAiB,EAAE,KAAK,IAAI,CAAC;IAChD,mBAAmB,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IACnD,gBAAgB,EAAE,CAAC,KAAK,EAAE,eAAe,EAAE,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACpE,mBAAmB,EAAE,CAAC,KAAK,EAAE,eAAe,EAAE,EAAE,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACvE,eAAe,EAAE,CAAC,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;IAChD,UAAU,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACjC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,kBAAkB,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,CAAC,eAAe,CAAC,KAAK,IAAI,CAAC;IAC1E,kBAAkB,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,IAAI,CAAC;IACzC,cAAc,EAAE,MAAM,IAAI,CAAC;CAC5B;AA+CD,eAAO,MAAM,oBAAoB;;;;;;;;;;;;EA8GhC,CAAC;AAQF,wBAAgB,qBAAqB,CACnC,OAAO,EAAE,GAAG,CAAC,iBAAiB,CAAC,GAC9B,MAAM,EAAE,GAAG,SAAS,CAWtB"}
@@ -0,0 +1,139 @@
1
+ import { create as l } from "zustand";
2
+ import { persist as d, createJSONStorage as g } from "zustand/middleware";
3
+ import { NotificationSourceCategory as S } from "../lib/types.js";
4
+ const p = /* @__PURE__ */ new Set(["INVITATION_CREATED", "INVITATION_CREATE"]), E = /* @__PURE__ */ new Set([
5
+ "ROLE_CREATED",
6
+ "ROLE_ASSIGNED",
7
+ "ROLE_UPDATED",
8
+ "ROLE_DELETED"
9
+ ]);
10
+ function c(t) {
11
+ return t.filter((e) => !(e.objectName?.startsWith("_system.") || e.notificationType && p.has(e.notificationType) || !e.notificationType && e.title && E.has(e.title)));
12
+ }
13
+ const m = /* @__PURE__ */ new Set([
14
+ "PAGE",
15
+ "PROJECT",
16
+ "FORM",
17
+ "FLOW"
18
+ ]);
19
+ function h(t) {
20
+ return Array.isArray(t) ? t.filter(
21
+ (e) => typeof e == "string" && m.has(e)
22
+ ) : [];
23
+ }
24
+ function o(t) {
25
+ return t.currentWorkspaceId ? {
26
+ ...t.wsFilters,
27
+ [t.currentWorkspaceId]: {
28
+ activeSources: [...t.activeSources],
29
+ unreadOnly: t.unreadOnly
30
+ }
31
+ } : t.wsFilters;
32
+ }
33
+ const N = l()(
34
+ d(
35
+ (t) => ({
36
+ notifications: [],
37
+ tab: "ALL",
38
+ unreadOnly: !1,
39
+ activeSources: /* @__PURE__ */ new Set(),
40
+ unreadCounts: { all: 0, mentions: 0 },
41
+ page: 0,
42
+ totalElements: 0,
43
+ loading: !1,
44
+ hasMore: !0,
45
+ refreshTrigger: 0,
46
+ currentWorkspaceId: null,
47
+ wsFilters: {},
48
+ setTab: (e) => t({ tab: e, page: 0, notifications: [], hasMore: !0 }),
49
+ setUnreadOnly: (e) => t((r) => ({
50
+ unreadOnly: e,
51
+ wsFilters: o({ ...r, unreadOnly: e }),
52
+ page: 0,
53
+ notifications: [],
54
+ hasMore: !0
55
+ })),
56
+ toggleSource: (e) => t((r) => {
57
+ const i = new Set(r.activeSources);
58
+ return i.has(e) ? i.delete(e) : i.add(e), {
59
+ activeSources: i,
60
+ wsFilters: o({ ...r, activeSources: i }),
61
+ page: 0,
62
+ notifications: [],
63
+ hasMore: !0
64
+ };
65
+ }),
66
+ setSources: (e) => t((r) => {
67
+ const i = new Set(e);
68
+ return {
69
+ activeSources: i,
70
+ wsFilters: o({ ...r, activeSources: i }),
71
+ page: 0,
72
+ notifications: [],
73
+ hasMore: !0
74
+ };
75
+ }),
76
+ setWorkspaceContext: (e) => t((r) => {
77
+ if (r.currentWorkspaceId === e) return r;
78
+ const i = o(r), n = i[e];
79
+ return {
80
+ currentWorkspaceId: e,
81
+ wsFilters: i,
82
+ activeSources: new Set(h(n?.activeSources)),
83
+ unreadOnly: n?.unreadOnly ?? !1,
84
+ page: 0,
85
+ notifications: [],
86
+ hasMore: !0
87
+ };
88
+ }),
89
+ setNotifications: (e, r) => {
90
+ const i = c(e);
91
+ t({
92
+ notifications: i,
93
+ totalElements: r,
94
+ hasMore: e.length < r
95
+ });
96
+ },
97
+ appendNotifications: (e, r) => t((i) => {
98
+ const n = c(e), u = new Set(i.notifications.map((a) => a.id)), f = n.filter((a) => !u.has(a.id)), s = [...i.notifications, ...f];
99
+ return {
100
+ notifications: s,
101
+ totalElements: r,
102
+ hasMore: e.length > 0 && s.length < r
103
+ };
104
+ }),
105
+ setUnreadCounts: (e) => t({ unreadCounts: e }),
106
+ setLoading: (e) => t({ loading: e }),
107
+ nextPage: () => t((e) => ({ page: e.page + 1 })),
108
+ resetPage: () => t({ page: 0, notifications: [], hasMore: !0 }),
109
+ updateNotification: (e, r) => t((i) => ({
110
+ notifications: i.notifications.map(
111
+ (n) => n.id === e ? { ...n, ...r } : n
112
+ )
113
+ })),
114
+ removeNotification: (e) => t((r) => ({
115
+ notifications: r.notifications.filter((i) => i.id !== e),
116
+ totalElements: r.totalElements - 1
117
+ })),
118
+ triggerRefresh: () => t((e) => ({ refreshTrigger: e.refreshTrigger + 1 }))
119
+ }),
120
+ {
121
+ name: "inbox-filters",
122
+ version: 1,
123
+ storage: g(() => localStorage),
124
+ partialize: (t) => ({ wsFilters: t.wsFilters }),
125
+ migrate: (t, e) => ({ wsFilters: {} })
126
+ }
127
+ )
128
+ );
129
+ function I(t) {
130
+ if (t.size === 0) return;
131
+ const e = /* @__PURE__ */ new Set();
132
+ for (const r of t)
133
+ e.add(S[r]), r === "PROJECT" && (e.add(4), e.add(5));
134
+ return [...e];
135
+ }
136
+ export {
137
+ I as getActiveSourceValues,
138
+ N as useNotificationStore
139
+ };
@@ -0,0 +1,2 @@
1
+ export declare function useNotificationStream(enabled?: boolean, workspaceId?: string): void;
2
+ //# sourceMappingURL=useNotificationStream.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useNotificationStream.d.ts","sourceRoot":"","sources":["../../../../src/components/Notification/hooks/useNotificationStream.ts"],"names":[],"mappings":"AAWA,wBAAgB,qBAAqB,CAAC,OAAO,UAAO,EAAE,WAAW,CAAC,EAAE,MAAM,QA4JzE"}
@@ -0,0 +1,86 @@
1
+ import { useRef as v, useEffect as g } from "react";
2
+ import { fetchUnreadCounts as U } from "../lib/api.js";
3
+ import { useNotificationStore as S, getActiveSourceValues as p } from "./useNotificationStore.js";
4
+ const w = "/v1/notifications/stream", A = 15e3, M = 1e4, O = 6e4;
5
+ function V(u = !0, t) {
6
+ const C = S((e) => e.setUnreadCounts), y = S((e) => e.triggerRefresh), a = S((e) => e.activeSources), L = S(
7
+ (e) => e.setWorkspaceContext
8
+ ), f = v(C), E = v(y), _ = v(t), h = v(a);
9
+ f.current = C, E.current = y, _.current = t, h.current = a, g(() => {
10
+ t && L(t);
11
+ }, [t, L]), g(() => {
12
+ if (!u) return;
13
+ let e = null, n, s, l = M, c = !1, r = !1;
14
+ const o = async () => {
15
+ if (!r)
16
+ try {
17
+ const i = p(h.current), m = await U(
18
+ _.current,
19
+ i
20
+ );
21
+ r || f.current(m);
22
+ } catch (i) {
23
+ console.warn("[NotificationStream] Failed to fetch counts:", i);
24
+ }
25
+ }, N = () => {
26
+ n || r || (n = setInterval(o, A));
27
+ }, T = () => {
28
+ n && (clearInterval(n), n = void 0);
29
+ }, R = () => {
30
+ if (!r) {
31
+ e && (e.close(), e = null);
32
+ try {
33
+ e = new EventSource(w, { withCredentials: !0 }), e.onopen = () => {
34
+ l = M, c = !1, T();
35
+ }, e.addEventListener("notification_created", () => {
36
+ o(), E.current();
37
+ }), e.addEventListener("badge_update", (i) => {
38
+ if (!r) {
39
+ if (h.current.size > 0) {
40
+ o();
41
+ return;
42
+ }
43
+ try {
44
+ const m = JSON.parse(i.data);
45
+ f.current({
46
+ all: m.allUnread ?? 0,
47
+ mentions: m.mentionsUnread ?? 0
48
+ });
49
+ } catch {
50
+ o();
51
+ }
52
+ }
53
+ }), e.onerror = () => {
54
+ e && (e.close(), e = null), !r && (c || (c = !0, o(), N()), s = setTimeout(() => {
55
+ R();
56
+ }, l), l = Math.min(l * 2, O));
57
+ };
58
+ } catch {
59
+ c = !0, N();
60
+ }
61
+ }
62
+ };
63
+ o(), R();
64
+ const d = () => {
65
+ document.visibilityState === "visible" && (o(), E.current(), (c || !e) && R());
66
+ };
67
+ return document.addEventListener("visibilitychange", d), window.addEventListener("focus", d), () => {
68
+ r = !0, e && (e.close(), e = null), s && clearTimeout(s), T(), document.removeEventListener("visibilitychange", d), window.removeEventListener("focus", d);
69
+ };
70
+ }, [u]), g(() => {
71
+ if (!u) return;
72
+ let e = !1;
73
+ return (async () => {
74
+ try {
75
+ const n = p(a), s = await U(t, n);
76
+ e || f.current(s);
77
+ } catch {
78
+ }
79
+ })(), () => {
80
+ e = !0;
81
+ };
82
+ }, [u, t, a]);
83
+ }
84
+ export {
85
+ V as useNotificationStream
86
+ };
@@ -0,0 +1,2 @@
1
+ export declare function useNotificationTime(): (dateStr: string) => string;
2
+ //# sourceMappingURL=useNotificationTime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useNotificationTime.d.ts","sourceRoot":"","sources":["../../../../src/components/Notification/hooks/useNotificationTime.ts"],"names":[],"mappings":"AAGA,wBAAgB,mBAAmB,IAAI,CAAC,OAAO,EAAE,MAAM,KAAK,MAAM,CAyBjE"}
@@ -0,0 +1,23 @@
1
+ import { useCallback as c } from "react";
2
+ import { useTranslation as f } from "react-i18next";
3
+ function h() {
4
+ const { t, i18n: o } = f("appContainer");
5
+ return c(
6
+ (u) => {
7
+ const e = new Date(u), i = /* @__PURE__ */ new Date(), r = i.getTime() - e.getTime(), n = Math.floor(r / 6e4), a = Math.floor(r / 36e5);
8
+ if (n < 1) return t("inbox.time.justNow");
9
+ if (n < 60) return t("inbox.time.minutesAgo", { count: n });
10
+ if (a < 24) return t("inbox.time.hoursAgo", { count: a });
11
+ const s = o.language === "ru" ? "ru-RU" : "en-US", m = e.getFullYear() === i.getFullYear();
12
+ return new Intl.DateTimeFormat(s, {
13
+ day: "numeric",
14
+ month: "short",
15
+ ...m ? {} : { year: "numeric" }
16
+ }).format(e);
17
+ },
18
+ [t, o.language]
19
+ );
20
+ }
21
+ export {
22
+ h as useNotificationTime
23
+ };
@@ -0,0 +1,25 @@
1
+ import type { NotificationsResponse, NotificationTab, UnreadCounts } from '../lib/types';
2
+ declare function fetchNotifications(tab: NotificationTab, page: number, size: number, unreadOnly: boolean, sources?: number[], workspaceId?: string): Promise<NotificationsResponse>;
3
+ declare function fetchCounts(workspaceId?: string, sources?: number[]): Promise<UnreadCounts>;
4
+ declare function markAsRead(ids: number[]): Promise<unknown>;
5
+ declare function markAsUnread(ids: number[]): Promise<unknown>;
6
+ declare function markAllAsRead(): Promise<unknown>;
7
+ declare function archiveIds(ids: number[]): Promise<unknown>;
8
+ declare function unarchiveIds(ids: number[]): Promise<unknown>;
9
+ declare function archiveAll(): Promise<unknown>;
10
+ declare function archiveRead(): Promise<unknown>;
11
+ declare const api: {
12
+ readonly fetchNotifications: typeof fetchNotifications;
13
+ readonly fetchCounts: typeof fetchCounts;
14
+ readonly markAsRead: typeof markAsRead;
15
+ readonly markAsUnread: typeof markAsUnread;
16
+ readonly markAllAsRead: typeof markAllAsRead;
17
+ readonly archiveIds: typeof archiveIds;
18
+ readonly unarchiveIds: typeof unarchiveIds;
19
+ readonly archiveAll: typeof archiveAll;
20
+ readonly archiveRead: typeof archiveRead;
21
+ };
22
+ export type NotificationsApi = typeof api;
23
+ export declare function useNotificationsApi(): NotificationsApi;
24
+ export {};
25
+ //# sourceMappingURL=useNotificationsApi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useNotificationsApi.d.ts","sourceRoot":"","sources":["../../../../src/components/Notification/hooks/useNotificationsApi.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,qBAAqB,EACrB,eAAe,EACf,YAAY,EACb,MAAM,cAAc,CAAC;AAEtB,iBAAS,kBAAkB,CACzB,GAAG,EAAE,eAAe,EACpB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,UAAU,EAAE,OAAO,EACnB,OAAO,CAAC,EAAE,MAAM,EAAE,EAClB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,qBAAqB,CAAC,CAchC;AAED,iBAAS,WAAW,CAClB,WAAW,CAAC,EAAE,MAAM,EACpB,OAAO,CAAC,EAAE,MAAM,EAAE,GACjB,OAAO,CAAC,YAAY,CAAC,CAEvB;AAED,iBAAS,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,oBAKhC;AAED,iBAAS,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,oBAKlC;AAED,iBAAS,aAAa,qBAErB;AAED,iBAAS,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,oBAKhC;AAED,iBAAS,YAAY,CAAC,GAAG,EAAE,MAAM,EAAE,oBAKlC;AAED,iBAAS,UAAU,qBAElB;AAED,iBAAS,WAAW,qBAEnB;AAED,QAAA,MAAM,GAAG;;;;;;;;;;CAUC,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,OAAO,GAAG,CAAC;AAE1C,wBAAgB,mBAAmB,IAAI,gBAAgB,CAEtD"}