@finsemble/finsemble-ui 6.4.0 → 6.5.1-beta.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (218) hide show
  1. package/package.json +19 -18
  2. package/react/actions/smartDesktopDesignerActions.d.ts +6 -2
  3. package/react/actions/smartDesktopDesignerActions.js +2 -0
  4. package/react/actions/smartDesktopDesignerActions.js.map +1 -1
  5. package/react/assets/icons/code-block.svg +15 -0
  6. package/react/components/FinsembleProvider.js.map +1 -1
  7. package/react/components/appCatalog/modules/FDC3.d.ts +1 -1
  8. package/react/components/appCatalog/modules/FDC3.js.map +1 -1
  9. package/react/components/appCatalog/stores/appStore.d.ts +2 -2
  10. package/react/components/appCatalog/stores/appStore.js.map +1 -1
  11. package/react/components/common/Checkbox.js +1 -1
  12. package/react/components/common/Checkbox.js.map +1 -1
  13. package/react/components/common/DropZone.js +3 -1
  14. package/react/components/common/DropZone.js.map +1 -1
  15. package/react/components/common/FinsembleIcon.d.ts +1 -1
  16. package/react/components/common/FinsembleIcon.js +2 -0
  17. package/react/components/common/FinsembleIcon.js.map +1 -1
  18. package/react/components/common/FinsembleSelect.js +1 -1
  19. package/react/components/common/FinsembleSelect.js.map +1 -1
  20. package/react/components/common/Tooltip.js +3 -1
  21. package/react/components/common/Tooltip.js.map +1 -1
  22. package/react/components/common/css/application-list.css +4 -0
  23. package/react/components/common/css/preload-edit-page.css +37 -0
  24. package/react/components/favorites/FavoritesShell.stories.js.map +1 -1
  25. package/react/components/fdc3Resolver/ResolverContainer.js.map +1 -1
  26. package/react/components/legacyControls/FinsembleDnDContext.d.ts +2 -1
  27. package/react/components/legacyControls/FinsembleDnDContext.js +8 -6
  28. package/react/components/legacyControls/FinsembleDnDContext.js.map +1 -1
  29. package/react/components/linker/remoteRedux.d.ts +1 -1
  30. package/react/components/linker/remoteRedux.js.map +1 -1
  31. package/react/components/menu/MenuAutoResizer.js.map +1 -1
  32. package/react/components/menu/MenuPortal.js +19 -0
  33. package/react/components/menu/MenuPortal.js.map +1 -1
  34. package/react/components/notifications/components/notificationsCenter/NotificationsCenter.js.map +1 -1
  35. package/react/components/notifications/components/notificationsToasts/NotificationsToasts.js.map +1 -1
  36. package/react/components/notifications/components/shared/CheckButton.d.ts +1 -1
  37. package/react/components/notifications/components/shared/CheckButton.js.map +1 -1
  38. package/react/components/notifications/components/shared/NotificationCardShell.d.ts +1 -1
  39. package/react/components/notifications/components/shared/NotificationCardShell.js.map +1 -1
  40. package/react/components/notifications/components/shared/OverflowMenu.d.ts +1 -1
  41. package/react/components/notifications/components/shared/OverflowMenu.js.map +1 -1
  42. package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyActions.d.ts +1 -1
  43. package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyActions.js.map +1 -1
  44. package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.d.ts +1 -1
  45. package/react/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.js.map +1 -1
  46. package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.d.ts +1 -1
  47. package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.js.map +1 -1
  48. package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderShell.d.ts +1 -1
  49. package/react/components/notifications/components/shared/notificationCard/NotificationCardHeaderShell.js.map +1 -1
  50. package/react/components/notifications/components/views/CardView.js.map +1 -1
  51. package/react/components/notifications/components/views/ListView.d.ts +1 -1
  52. package/react/components/notifications/components/views/ListView.js.map +1 -1
  53. package/react/components/notifications/components/views/NotificationDetailsView.d.ts +1 -1
  54. package/react/components/notifications/components/views/NotificationDetailsView.js.map +1 -1
  55. package/react/components/notifications/types.d.ts +1 -1
  56. package/react/components/notifications/types.js.map +1 -1
  57. package/react/components/notifications/utils.d.ts +1 -1
  58. package/react/components/notifications/utils.js.map +1 -1
  59. package/react/components/processMonitor/ProcessMonitor.js.map +1 -1
  60. package/react/components/processMonitor/components/ChildWindow.js.map +1 -1
  61. package/react/components/processMonitor/components/ListHeader.d.ts +1 -1
  62. package/react/components/processMonitor/components/ListHeader.js.map +1 -1
  63. package/react/components/processMonitor/stores/ProcessMonitorStore.d.ts +3 -3
  64. package/react/components/processMonitor/stores/ProcessMonitorStore.js.map +1 -1
  65. package/react/components/search/SearchResult.js +4 -3
  66. package/react/components/search/SearchResult.js.map +1 -1
  67. package/react/components/smartDesktopDesigner/AppEditAccess.js.map +1 -1
  68. package/react/components/smartDesktopDesigner/AppEditPage.d.ts +2 -1
  69. package/react/components/smartDesktopDesigner/AppEditPage.js +77 -73
  70. package/react/components/smartDesktopDesigner/AppEditPage.js.map +1 -1
  71. package/react/components/smartDesktopDesigner/Appearance.css +8 -0
  72. package/react/components/smartDesktopDesigner/Application.d.ts +10 -3
  73. package/react/components/smartDesktopDesigner/Application.js +35 -42
  74. package/react/components/smartDesktopDesigner/Application.js.map +1 -1
  75. package/react/components/smartDesktopDesigner/Applications.d.ts +2 -0
  76. package/react/components/smartDesktopDesigner/Applications.js +17 -7
  77. package/react/components/smartDesktopDesigner/Applications.js.map +1 -1
  78. package/react/components/smartDesktopDesigner/EditPreload.d.ts +14 -0
  79. package/react/components/smartDesktopDesigner/EditPreload.js +169 -0
  80. package/react/components/smartDesktopDesigner/EditPreload.js.map +1 -0
  81. package/react/components/smartDesktopDesigner/ItemList.d.ts +17 -0
  82. package/react/components/smartDesktopDesigner/ItemList.js +58 -0
  83. package/react/components/smartDesktopDesigner/ItemList.js.map +1 -0
  84. package/react/components/smartDesktopDesigner/OptionalSettingsView.d.ts +11 -0
  85. package/react/components/smartDesktopDesigner/OptionalSettingsView.js +71 -0
  86. package/react/components/smartDesktopDesigner/OptionalSettingsView.js.map +1 -0
  87. package/react/components/smartDesktopDesigner/Preloads.d.ts +8 -0
  88. package/react/components/smartDesktopDesigner/Preloads.js +26 -0
  89. package/react/components/smartDesktopDesigner/Preloads.js.map +1 -0
  90. package/react/components/smartDesktopDesigner/Publish.js.map +1 -1
  91. package/react/components/smartDesktopDesigner/SmartDesktopDesigner.js.map +1 -1
  92. package/react/components/smartDesktopDesigner/Toolbar.js +5 -5
  93. package/react/components/smartDesktopDesigner/Toolbar.js.map +1 -1
  94. package/react/components/smartDesktopDesigner/common/views.js +18 -0
  95. package/react/components/smartDesktopDesigner/common/views.js.map +1 -1
  96. package/react/components/smartDesktopDesigner/css/appearance.css +3 -0
  97. package/react/components/smartDesktopDesigner/fixtures/apps.d.ts +1 -1
  98. package/react/components/smartDesktopDesigner/fixtures/apps.js +23 -1
  99. package/react/components/smartDesktopDesigner/fixtures/apps.js.map +1 -1
  100. package/react/components/smartDesktopDesigner/fixtures/exportProps.js.map +1 -1
  101. package/react/components/smartDesktopDesigner/fixtures/preloads.d.ts +22 -0
  102. package/react/components/smartDesktopDesigner/fixtures/preloads.js +40 -0
  103. package/react/components/smartDesktopDesigner/fixtures/preloads.js.map +1 -0
  104. package/react/components/smartDesktopDesigner/fixtures/publishProgress.d.ts +1 -1
  105. package/react/components/smartDesktopDesigner/fixtures/publishProgress.js.map +1 -1
  106. package/react/components/smartDesktopDesigner/fixtures/views.js +9 -0
  107. package/react/components/smartDesktopDesigner/fixtures/views.js.map +1 -1
  108. package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.d.ts +1 -1
  109. package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.js +1 -0
  110. package/react/components/smartDesktopDesigner/stories/AppEditPage.stories.js.map +1 -1
  111. package/react/components/smartDesktopDesigner/stories/EditPreload.stories.d.ts +11 -0
  112. package/react/components/smartDesktopDesigner/stories/EditPreload.stories.js +35 -0
  113. package/react/components/smartDesktopDesigner/stories/EditPreload.stories.js.map +1 -0
  114. package/react/components/smartDesktopDesigner/stories/ItemList.stories.d.ts +16 -0
  115. package/react/components/smartDesktopDesigner/stories/{ApplicationList.stories.js → ItemList.stories.js} +26 -26
  116. package/react/components/smartDesktopDesigner/stories/ItemList.stories.js.map +1 -0
  117. package/react/components/smartDesktopDesigner/stories/OptionalSettingsView.stories.d.ts +11 -0
  118. package/react/components/smartDesktopDesigner/stories/OptionalSettingsView.stories.js +28 -0
  119. package/react/components/smartDesktopDesigner/stories/OptionalSettingsView.stories.js.map +1 -0
  120. package/react/components/smartDesktopDesigner/stories/Preloads.stories.d.ts +11 -0
  121. package/react/components/smartDesktopDesigner/stories/Preloads.stories.js +31 -0
  122. package/react/components/smartDesktopDesigner/stories/Preloads.stories.js.map +1 -0
  123. package/react/components/smartDesktopDesigner/stories/SmartDesktopDesigner.stories.js.map +1 -1
  124. package/react/components/smartDesktopDesigner/tests/AppEditPage.spec.js +1099 -258
  125. package/react/components/smartDesktopDesigner/tests/AppEditPage.spec.js.map +1 -1
  126. package/react/components/smartDesktopDesigner/tests/{ApplicationList.spec.d.ts → Application.spec.d.ts} +0 -0
  127. package/react/components/smartDesktopDesigner/tests/Application.spec.js +1496 -0
  128. package/react/components/smartDesktopDesigner/tests/Application.spec.js.map +1 -0
  129. package/react/components/smartDesktopDesigner/tests/Applications.spec.js +3 -3
  130. package/react/components/smartDesktopDesigner/tests/Applications.spec.js.map +1 -1
  131. package/react/components/smartDesktopDesigner/tests/EditPreload.spec.d.ts +1 -0
  132. package/react/components/smartDesktopDesigner/tests/EditPreload.spec.js +61 -0
  133. package/react/components/smartDesktopDesigner/tests/EditPreload.spec.js.map +1 -0
  134. package/react/components/smartDesktopDesigner/tests/ItemList.spec.d.ts +1 -0
  135. package/react/components/smartDesktopDesigner/tests/{ApplicationList.spec.js → ItemList.spec.js} +8 -8
  136. package/react/components/smartDesktopDesigner/tests/ItemList.spec.js.map +1 -0
  137. package/react/components/smartDesktopDesigner/tests/Preloads.spec.d.ts +1 -0
  138. package/react/components/smartDesktopDesigner/tests/Preloads.spec.js +47 -0
  139. package/react/components/smartDesktopDesigner/tests/Preloads.spec.js.map +1 -0
  140. package/react/components/smartDesktopDesigner/tests/SmartDesktopDesigner.spec.js +6 -0
  141. package/react/components/smartDesktopDesigner/tests/SmartDesktopDesigner.spec.js.map +1 -1
  142. package/react/components/toolbar/DragHandle.spec.d.ts +1 -0
  143. package/react/components/toolbar/DragHandle.spec.js +31 -0
  144. package/react/components/toolbar/DragHandle.spec.js.map +1 -0
  145. package/react/components/toolbar/DragHandle.stories.d.ts +13 -0
  146. package/react/components/toolbar/DragHandle.stories.js +39 -0
  147. package/react/components/toolbar/DragHandle.stories.js.map +1 -0
  148. package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.d.ts +1 -1
  149. package/react/components/toolbar/advancedAppLauncher/AdvancedAppLauncher.js.map +1 -1
  150. package/react/components/toolbar/advancedAppLauncher/components/Content.d.ts +1 -1
  151. package/react/components/toolbar/advancedAppLauncher/components/Content.js.map +1 -1
  152. package/react/components/toolbar/advancedAppLauncher/components/FilterSort.js.map +1 -1
  153. package/react/components/toolbar/advancedAppLauncher/components/FoldersList.d.ts +1 -1
  154. package/react/components/toolbar/advancedAppLauncher/components/FoldersList.js.map +1 -1
  155. package/react/components/toolbar/advancedAppLauncher/components/TagsList.d.ts +1 -1
  156. package/react/components/toolbar/advancedAppLauncher/components/TagsList.js.map +1 -1
  157. package/react/components/toolbar/advancedAppLauncher/stores/LauncherStore.d.ts +2 -2
  158. package/react/components/toolbar/advancedAppLauncher/stores/LauncherStore.js.map +1 -1
  159. package/react/components/toolbar/advancedAppLauncher/stores/StoreActions.js.map +1 -1
  160. package/react/components/toolbar/appLauncher/components/componentList.d.ts +2 -2
  161. package/react/components/toolbar/appLauncher/components/componentList.js.map +1 -1
  162. package/react/components/toolbar/appLauncher/stores/appLauncherStore.d.ts +2 -2
  163. package/react/components/toolbar/appLauncher/stores/appLauncherStore.js.map +1 -1
  164. package/react/components/toolbar/dashbar/Dashbar.js +9 -12
  165. package/react/components/toolbar/dashbar/Dashbar.js.map +1 -1
  166. package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.d.ts +2 -2
  167. package/react/components/toolbar/workspaceManagementMenu/WorkspaceManagementMenu.js.map +1 -1
  168. package/react/components/toolbar/workspaceManagementMenu/components/Workspace.d.ts +1 -1
  169. package/react/components/toolbar/workspaceManagementMenu/components/Workspace.js.map +1 -1
  170. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.d.ts +1 -1
  171. package/react/components/toolbar/workspaceManagementMenu/components/WorkspaceList.js.map +1 -1
  172. package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.d.ts +4 -4
  173. package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js +1 -1
  174. package/react/components/toolbar/workspaceManagementMenu/stores/workspaceManagementMenuStore.js.map +1 -1
  175. package/react/components/userPreferences/components/content/Workspaces.d.ts +1 -1
  176. package/react/components/userPreferences/components/content/Workspaces.js +1 -1
  177. package/react/components/userPreferences/components/content/Workspaces.js.map +1 -1
  178. package/react/components/userPreferences/components/content/notificationViews/NotificationsSourceTypes.js.map +1 -1
  179. package/react/components/userPreferences/components/content/notificationViews/notificationViewsUtils.js.map +1 -1
  180. package/react/components/userPreferences/stores/UserPreferencesStore.d.ts +1 -1
  181. package/react/components/userPreferences/stores/UserPreferencesStore.js.map +1 -1
  182. package/react/components/windowTitleBar/WindowTitleBarShell.d.ts +4 -2
  183. package/react/components/windowTitleBar/WindowTitleBarShell.js +60 -59
  184. package/react/components/windowTitleBar/WindowTitleBarShell.js.map +1 -1
  185. package/react/components/windowTitleBar/components/center/TabList.d.ts +2 -2
  186. package/react/components/windowTitleBar/components/center/TabList.js +3 -0
  187. package/react/components/windowTitleBar/components/center/TabList.js.map +1 -1
  188. package/react/components/windowTitleBar/components/left/LinkerButton.js.map +1 -1
  189. package/react/components/windowTitleBar/components/right/GroupingButton.js.map +1 -1
  190. package/react/components/windowTitleBar/components/right/MaximizeButton.js.map +1 -1
  191. package/react/components/windowTitleBar/components/windowTitle.d.ts +5 -2
  192. package/react/components/windowTitleBar/components/windowTitle.js +93 -89
  193. package/react/components/windowTitleBar/components/windowTitle.js.map +1 -1
  194. package/react/components/windowTitleBar/stores/windowTitleBarStore.d.ts +3 -3
  195. package/react/components/windowTitleBar/stores/windowTitleBarStore.js +213 -217
  196. package/react/components/windowTitleBar/stores/windowTitleBarStore.js.map +1 -1
  197. package/react/hooks/useDashbar.js.map +1 -1
  198. package/react/hooks/useFavoritesShell.js.map +1 -1
  199. package/react/hooks/useNotifications.d.ts +1 -1
  200. package/react/hooks/useNotifications.js.map +1 -1
  201. package/react/reducers/rootReducer.d.ts +11 -3
  202. package/react/reducers/smartDesktopDesignerReducer.js +8 -0
  203. package/react/reducers/smartDesktopDesignerReducer.js.map +1 -1
  204. package/react/store.d.ts +22 -6
  205. package/react/types/fdc3.d.ts +2 -2
  206. package/react/types/fdc3.js.map +1 -1
  207. package/react/types/searchTypes.d.ts +1 -8
  208. package/react/types/searchTypes.js.map +1 -1
  209. package/react/types/smartDesktopDesignerTypes.d.ts +8 -2
  210. package/react/types/smartDesktopDesignerTypes.js.map +1 -1
  211. package/react/types/windowTitleBar.d.ts +1 -1
  212. package/react/types/windowTitleBar.js.map +1 -1
  213. package/react/components/smartDesktopDesigner/ApplicationList.d.ts +0 -16
  214. package/react/components/smartDesktopDesigner/ApplicationList.js +0 -60
  215. package/react/components/smartDesktopDesigner/ApplicationList.js.map +0 -1
  216. package/react/components/smartDesktopDesigner/stories/ApplicationList.stories.d.ts +0 -16
  217. package/react/components/smartDesktopDesigner/stories/ApplicationList.stories.js.map +0 -1
  218. package/react/components/smartDesktopDesigner/tests/ApplicationList.spec.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationsToasts.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/notificationsToasts/NotificationsToasts.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,gBAAgB,EAAE,EACxB,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,KAAK,GACL,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAA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,GAAG,CAAC,CAAC;wBACnB,OAAO;qBACP;oBAED,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,MAAM,eAAe,CAAC,SAAS,EAAE,CAAC;oBAC3D,MAAM,KAAK,GAAG,CAAC,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,KAAK,mCAAI,CAAC,CAAC,GAAG,CAAC,MAAA,MAAM,aAAN,MAAM,uBAAN,MAAM,CAAE,IAAI,mCAAI,CAAC,CAAC,CAAC;oBACzD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,aAAJ,IAAI,uBAAJ,IAAI,CAAE,MAAgB,CAAC,GAAG,CAAC,CAAC;oBAEtD,MAAM,eAAe,CAAC,SAAS,CAAC;wBAC/B,MAAM,EAAE;4BACP,GAAG,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC;4BACjC,IAAI,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC,OAAO,CAAC,GAAG,KAAK;4BAC5C,MAAM,EAAE,MAAM,GAAG,EAAE;4BACnB,KAAK,EAAE,KAAK;yBACZ;qBACD,CAAC,CAAC;iBACH;aACD;QACF,CAAC,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,OAAO,CACN,iCACE,aAAa,CAAC,GAAG,CAAC,CAAC,YAA2B,EAAE,EAAE,CAAC,CACnD,oBAAC,SAAS,kBACT,GAAG,EAAE,cAAc,YAAY,CAAC,EAAE,EAAE,EACpC,YAAY,EAAE,YAAY,EAC1B,gCAAgC,EAAE,oBAAoB,EACtD,wBAAwB,EAAE,wBAAwB,EAClD,cAAc,EAAE,kBAAkB,EAClC,gBAAgB,EAAE,oBAAoB,IAClC,KAAK,EACR,CACF,CAAC,CACG,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useEffect, useRef, useState } from \"react\";\nimport useNotifications, {\n\tuseNotificationUI,\n\tmoveToToolbarMonitor,\n\tgetNotificationConfig,\n\tgetOS,\n} from \"../../../../hooks/useNotifications\";\nimport { NotificationCardShell } from \"../shared/NotificationCardShell\";\nimport { CSSTransition } from \"react-transition-group\";\nimport { INotificationToastsProps } from \"../../types\";\nimport \"../../../../assets/css/notificationsCenter.css\";\nimport { services } from \"@finsemble/finsemble-core\";\n\ntype INotification = services.notification.types.INotification;\n\ntype ToastCardProps = {\n\tnotification: INotification;\n\tremoveFunction: Function;\n\tisActiveFunction: Function;\n\tinformationalNotificationTimeout: number | false;\n\tactionableTimeoutEnabled: boolean;\n\tnotificationCard?: React.ComponentType<any>;\n};\n\nconst ToastCard = (props: ToastCardProps) => {\n\tconst notificationRef = useRef<INotification>();\n\tconst { notification, informationalNotificationTimeout, removeFunction, isActiveFunction, actionableTimeoutEnabled } =\n\t\tprops;\n\tconst [slideIn, setSlideIn] = useState(isActiveFunction(notification));\n\tconst [showNotification] = useState(isActiveFunction(notification));\n\n\tuseEffect(() => {\n\t\tnotificationRef.current = notification;\n\t\tlet timeoutId: any;\n\n\t\tif (!notification.actions || notification.actions.length == 0 || actionableTimeoutEnabled) {\n\t\t\t// Is an informational notification or timeout enabled actionable notifications\n\t\t\tlet timeoutLength;\n\n\t\t\tif (informationalNotificationTimeout !== false) {\n\t\t\t\t// Convert to milliseconds\n\t\t\t\ttimeoutLength = informationalNotificationTimeout * 1000;\n\t\t\t\tif (notification.timeout && Number.isInteger(notification.timeout)) {\n\t\t\t\t\ttimeoutLength = notification.timeout;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (timeoutLength) {\n\t\t\t\ttimeoutId = setTimeout(() => {\n\t\t\t\t\tsetSlideIn(false);\n\t\t\t\t}, timeoutLength);\n\t\t\t}\n\t\t}\n\n\t\treturn () => {\n\t\t\tclearInterval(timeoutId);\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (!isActiveFunction(notificationRef.current)) {\n\t\t\tremoveFunction(notification);\n\t\t}\n\t\tsetSlideIn(isActiveFunction(notification));\n\t}, [notification]);\n\n\tconst onExited = () => {\n\t\tremoveFunction(notification);\n\t};\n\n\tconst Card = props.notificationCard ? props.notificationCard : NotificationCardShell;\n\n\treturn (\n\t\tshowNotification && (\n\t\t\t<CSSTransition in={slideIn} timeout={500} onExited={onExited} classNames=\"notifications-toast\">\n\t\t\t\t<div className=\"notifications-toast__offscreen\">\n\t\t\t\t\t<Card\n\t\t\t\t\t\tnotification={notification}\n\t\t\t\t\t\tuiContext=\"toasts\"\n\t\t\t\t\t\tremoveNotification={() => {\n\t\t\t\t\t\t\tsetSlideIn(false);\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t\t<div className=\"divider\">&nbsp;</div>\n\t\t\t\t</div>\n\t\t\t</CSSTransition>\n\t\t)\n\t);\n};\n\nexport const NotificationsToasts: React.FunctionComponent<INotificationToastsProps> = (props) => {\n\tconst { notifications, notificationIsActive, setOpaqueClassName, removeNotification, activeNotifications } =\n\t\tuseNotifications({ config: { notificationsHistory: { options: { sentAfter: \"startup\" } } } });\n\tconst notificationsRef = useRef<INotification[]>(notifications);\n\tconst [uiState] = useNotificationUI();\n\n\tconst isNotificationActive = (notification: INotification): boolean => {\n\t\tconst notificationCenterNotActive = !uiState.showCenter || uiState.poppedOut;\n\t\treturn notificationIsActive(notification) && notificationCenterNotActive;\n\t};\n\n\tconst config = getNotificationConfig();\n\tconst [isMac] = useState(getOS() === \"Mac\");\n\n\tconst [informationalTimeout, setInformationalTimeout] = useState<number | false>(false);\n\tconst [actionableTimeoutEnabled, setActionableTimeoutEnabled] = useState<boolean>(true);\n\n\tuseEffect(() => {\n\t\tasync function listenForPreferenceChange(error: any, response: any) {\n\t\t\tif (error) {\n\t\t\t\tconsole.error(\"FinsembleUserPreferencesChannel: \", error);\n\t\t\t} else {\n\t\t\t\tconst { data } = response;\n\t\t\t\tif (data.notificationPreferences) {\n\t\t\t\t\tconst { informationalNotificationToastPeriodSeconds, toastTimeoutOnActionableNotifications } =\n\t\t\t\t\t\tdata.notificationPreferences;\n\n\t\t\t\t\tif (informationalNotificationToastPeriodSeconds) {\n\t\t\t\t\t\tsetInformationalTimeout(informationalNotificationToastPeriodSeconds);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (typeof toastTimeoutOnActionableNotifications !== \"undefined\") {\n\t\t\t\t\t\tsetActionableTimeoutEnabled(toastTimeoutOnActionableNotifications);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tFSBL.Clients.RouterClient.addListener(\"FinsembleUserPreferencesChannel\", listenForPreferenceChange);\n\t\treturn () => {\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"FinsembleUserPreferencesChannel\", listenForPreferenceChange);\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tconst transparencySupported = config.isTransparent;\n\n\t\tsetOpaqueClassName(!transparencySupported);\n\n\t\tif (transparencySupported) {\n\t\t\tfinsembleWindow.show();\n\t\t}\n\n\t\tasync function getNotificationsPreferences() {\n\t\t\treturn await FSBL.Clients.NotificationClient.getPreferences();\n\t\t}\n\n\t\tgetNotificationsPreferences().then((preferences: any) => {\n\t\t\tsetInformationalTimeout(preferences.informationalNotificationToastPeriodSeconds);\n\t\t});\n\t}, []);\n\n\tuseEffect(() => {\n\t\tmoveToToolbarMonitor().then(async () => {\n\t\t\tlet forceHide = false;\n\t\t\tif (\n\t\t\t\tactiveNotifications(notifications).length === 0 &&\n\t\t\t\tactiveNotifications(notificationsRef.current).length === 0\n\t\t\t) {\n\t\t\t\t// Bug fix: Toasts flash when inActive components (partially caused by allowing notifications to animate out)\n\t\t\t\tforceHide = true;\n\t\t\t}\n\n\t\t\tnotificationsRef.current = notifications;\n\t\t\tconst rect = document.getElementById(\"notifications-toasts\")?.getBoundingClientRect();\n\t\t\tif (notifications.length === 0 || forceHide) {\n\t\t\t\tif (config.isTransparent && !isMac) {\n\t\t\t\t\tconst roundedRect = {\n\t\t\t\t\t\tx: Math.round(rect?.x as number),\n\t\t\t\t\t\ty: Math.round(rect?.y as number),\n\t\t\t\t\t\twidth: 1,\n\t\t\t\t\t\theight: 1,\n\t\t\t\t\t};\n\n\t\t\t\t\tfinsembleWindow.setShape([roundedRect]);\n\t\t\t\t}\n\n\t\t\t\tfinsembleWindow.hide();\n\t\t\t} else {\n\t\t\t\tfinsembleWindow.bringToFront();\n\t\t\t\tif (config.isTransparent && !isMac) {\n\t\t\t\t\tconst roundedRect = {\n\t\t\t\t\t\tx: Math.round(rect?.x as number),\n\t\t\t\t\t\ty: Math.round(rect?.y as number),\n\t\t\t\t\t\twidth: Math.round(rect?.width as number),\n\t\t\t\t\t\theight: Math.round(rect?.height as number),\n\t\t\t\t\t};\n\n\t\t\t\t\tawait finsembleWindow.show();\n\t\t\t\t\tfinsembleWindow.setShape([roundedRect]);\n\t\t\t\t} else {\n\t\t\t\t\tawait finsembleWindow.show();\n\t\t\t\t\tconst { err, data } = await FSBL.Clients.LauncherClient.getMonitorInfo({ monitor: \"mine\" });\n\t\t\t\t\tif (err || !data) {\n\t\t\t\t\t\tconsole.error(err);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst { data: bounds } = await finsembleWindow.getBounds();\n\t\t\t\t\tconst width = (bounds?.right ?? 0) - (bounds?.left ?? 0);\n\t\t\t\t\tconst height = Math.round(rect?.height as number) + 6;\n\n\t\t\t\t\tawait finsembleWindow.setBounds({\n\t\t\t\t\t\tbounds: {\n\t\t\t\t\t\t\ttop: data[\"availableRect\"][\"top\"],\n\t\t\t\t\t\t\tleft: data[\"availableRect\"][\"right\"] - width,\n\t\t\t\t\t\t\theight: height + 10,\n\t\t\t\t\t\t\twidth: width,\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}, [notifications]);\n\n\treturn (\n\t\t<div>\n\t\t\t{notifications.map((notification: INotification) => (\n\t\t\t\t<ToastCard\n\t\t\t\t\tkey={`toast-card-${notification.id}`}\n\t\t\t\t\tnotification={notification}\n\t\t\t\t\tinformationalNotificationTimeout={informationalTimeout}\n\t\t\t\t\tactionableTimeoutEnabled={actionableTimeoutEnabled}\n\t\t\t\t\tremoveFunction={removeNotification}\n\t\t\t\t\tisActiveFunction={isNotificationActive}\n\t\t\t\t\t{...props}\n\t\t\t\t/>\n\t\t\t))}\n\t\t</div>\n\t);\n};\n"]}
1
+ {"version":3,"file":"NotificationsToasts.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/notificationsToasts/NotificationsToasts.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,gBAAgB,EAAE,EACxB,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,KAAK,GACL,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,gDAAgD,CAAC;AAcxD,MAAM,SAAS,GAAG,CAAC,KAAqB,EAAE,EAAE;IAC3C,MAAM,eAAe,GAAG,MAAM,EAAiB,CAAC;IAChD,MAAM,EAAE,YAAY,EAAE,gCAAgC,EAAE,cAAc,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,GACnH,KAAK,CAAC;IACP,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,CAAC;IACvE,MAAM,CAAC,gBAAgB,CAAC,GAAG,QAAQ,CAAC,gBAAgB,CAAC,YAAY,CAAC,CAAC,CAAC;IAEpE,SAAS,CAAC,GAAG,EAAE;QACd,eAAe,CAAC,OAAO,GAAG,YAAY,CAAC;QACvC,IAAI,SAAc,CAAC;QAEnB,IAAI,CAAC,YAAY,CAAC,OAAO,IAAI,YAAY,CAAC,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,wB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;qBACD,CAAC,CAAC;iBACH;aACD;QACF,CAAC,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,aAAa,CAAC,CAAC,CAAC;IAEpB,OAAO,CACN,iCACE,aAAa,CAAC,GAAG,CAAC,CAAC,YAA2B,EAAE,EAAE,CAAC,CACnD,oBAAC,SAAS,kBACT,GAAG,EAAE,cAAc,YAAY,CAAC,EAAE,EAAE,EACpC,YAAY,EAAE,YAAY,EAC1B,gCAAgC,EAAE,oBAAoB,EACtD,wBAAwB,EAAE,wBAAwB,EAClD,cAAc,EAAE,kBAAkB,EAClC,gBAAgB,EAAE,oBAAoB,IAClC,KAAK,EACR,CACF,CAAC,CACG,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useEffect, useRef, useState } from \"react\";\nimport useNotifications, {\n\tuseNotificationUI,\n\tmoveToToolbarMonitor,\n\tgetNotificationConfig,\n\tgetOS,\n} from \"../../../../hooks/useNotifications\";\nimport { NotificationCardShell } from \"../shared/NotificationCardShell\";\nimport { CSSTransition } from \"react-transition-group\";\nimport { INotificationToastsProps } from \"../../types\";\nimport \"../../../../assets/css/notificationsCenter.css\";\nimport { services } from \"@finsemble/finsemble-api\";\n\ntype INotification = services.notification.types.INotification;\n\ntype ToastCardProps = {\n\tnotification: INotification;\n\tremoveFunction: Function;\n\tisActiveFunction: Function;\n\tinformationalNotificationTimeout: number | false;\n\tactionableTimeoutEnabled: boolean;\n\tnotificationCard?: React.ComponentType<any>;\n};\n\nconst ToastCard = (props: ToastCardProps) => {\n\tconst notificationRef = useRef<INotification>();\n\tconst { notification, informationalNotificationTimeout, removeFunction, isActiveFunction, actionableTimeoutEnabled } =\n\t\tprops;\n\tconst [slideIn, setSlideIn] = useState(isActiveFunction(notification));\n\tconst [showNotification] = useState(isActiveFunction(notification));\n\n\tuseEffect(() => {\n\t\tnotificationRef.current = notification;\n\t\tlet timeoutId: any;\n\n\t\tif (!notification.actions || notification.actions.length == 0 || actionableTimeoutEnabled) {\n\t\t\t// Is an informational notification or timeout enabled actionable notifications\n\t\t\tlet timeoutLength;\n\n\t\t\tif (informationalNotificationTimeout !== false) {\n\t\t\t\t// Convert to milliseconds\n\t\t\t\ttimeoutLength = informationalNotificationTimeout * 1000;\n\t\t\t\tif (notification.timeout && Number.isInteger(notification.timeout)) {\n\t\t\t\t\ttimeoutLength = notification.timeout;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (timeoutLength) {\n\t\t\t\ttimeoutId = setTimeout(() => {\n\t\t\t\t\tsetSlideIn(false);\n\t\t\t\t}, timeoutLength);\n\t\t\t}\n\t\t}\n\n\t\treturn () => {\n\t\t\tclearInterval(timeoutId);\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (!isActiveFunction(notificationRef.current)) {\n\t\t\tremoveFunction(notification);\n\t\t}\n\t\tsetSlideIn(isActiveFunction(notification));\n\t}, [notification]);\n\n\tconst onExited = () => {\n\t\tremoveFunction(notification);\n\t};\n\n\tconst Card = props.notificationCard ? props.notificationCard : NotificationCardShell;\n\n\treturn (\n\t\tshowNotification && (\n\t\t\t<CSSTransition in={slideIn} timeout={500} onExited={onExited} classNames=\"notifications-toast\">\n\t\t\t\t<div className=\"notifications-toast__offscreen\">\n\t\t\t\t\t<Card\n\t\t\t\t\t\tnotification={notification}\n\t\t\t\t\t\tuiContext=\"toasts\"\n\t\t\t\t\t\tremoveNotification={() => {\n\t\t\t\t\t\t\tsetSlideIn(false);\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\t\t\t\t\t<div className=\"divider\">&nbsp;</div>\n\t\t\t\t</div>\n\t\t\t</CSSTransition>\n\t\t)\n\t);\n};\n\nexport const NotificationsToasts: React.FunctionComponent<INotificationToastsProps> = (props) => {\n\tconst { notifications, notificationIsActive, setOpaqueClassName, removeNotification, activeNotifications } =\n\t\tuseNotifications({ config: { notificationsHistory: { options: { sentAfter: \"startup\" } } } });\n\tconst notificationsRef = useRef<INotification[]>(notifications);\n\tconst [uiState] = useNotificationUI();\n\n\tconst isNotificationActive = (notification: INotification): boolean => {\n\t\tconst notificationCenterNotActive = !uiState.showCenter || uiState.poppedOut;\n\t\treturn notificationIsActive(notification) && notificationCenterNotActive;\n\t};\n\n\tconst config = getNotificationConfig();\n\tconst [isMac] = useState(getOS() === \"Mac\");\n\n\tconst [informationalTimeout, setInformationalTimeout] = useState<number | false>(false);\n\tconst [actionableTimeoutEnabled, setActionableTimeoutEnabled] = useState<boolean>(true);\n\n\tuseEffect(() => {\n\t\tasync function listenForPreferenceChange(error: any, response: any) {\n\t\t\tif (error) {\n\t\t\t\tconsole.error(\"FinsembleUserPreferencesChannel: \", error);\n\t\t\t} else {\n\t\t\t\tconst { data } = response;\n\t\t\t\tif (data.notificationPreferences) {\n\t\t\t\t\tconst { informationalNotificationToastPeriodSeconds, toastTimeoutOnActionableNotifications } =\n\t\t\t\t\t\tdata.notificationPreferences;\n\n\t\t\t\t\tif (informationalNotificationToastPeriodSeconds) {\n\t\t\t\t\t\tsetInformationalTimeout(informationalNotificationToastPeriodSeconds);\n\t\t\t\t\t}\n\n\t\t\t\t\tif (typeof toastTimeoutOnActionableNotifications !== \"undefined\") {\n\t\t\t\t\t\tsetActionableTimeoutEnabled(toastTimeoutOnActionableNotifications);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tFSBL.Clients.RouterClient.addListener(\"FinsembleUserPreferencesChannel\", listenForPreferenceChange);\n\t\treturn () => {\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"FinsembleUserPreferencesChannel\", listenForPreferenceChange);\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tconst transparencySupported = config.isTransparent;\n\n\t\tsetOpaqueClassName(!transparencySupported);\n\n\t\tif (transparencySupported) {\n\t\t\tfinsembleWindow.show();\n\t\t}\n\n\t\tasync function getNotificationsPreferences() {\n\t\t\treturn await FSBL.Clients.NotificationClient.getPreferences();\n\t\t}\n\n\t\tgetNotificationsPreferences().then((preferences: any) => {\n\t\t\tsetInformationalTimeout(preferences.informationalNotificationToastPeriodSeconds);\n\t\t});\n\t}, []);\n\n\tuseEffect(() => {\n\t\tmoveToToolbarMonitor().then(async () => {\n\t\t\tlet forceHide = false;\n\t\t\tif (\n\t\t\t\tactiveNotifications(notifications).length === 0 &&\n\t\t\t\tactiveNotifications(notificationsRef.current).length === 0\n\t\t\t) {\n\t\t\t\t// Bug fix: Toasts flash when inActive components (partially caused by allowing notifications to animate out)\n\t\t\t\tforceHide = true;\n\t\t\t}\n\n\t\t\tnotificationsRef.current = notifications;\n\t\t\tconst rect = document.getElementById(\"notifications-toasts\")?.getBoundingClientRect();\n\t\t\tif (notifications.length === 0 || forceHide) {\n\t\t\t\tif (config.isTransparent && !isMac) {\n\t\t\t\t\tconst roundedRect = {\n\t\t\t\t\t\tx: Math.round(rect?.x as number),\n\t\t\t\t\t\ty: Math.round(rect?.y as number),\n\t\t\t\t\t\twidth: 1,\n\t\t\t\t\t\theight: 1,\n\t\t\t\t\t};\n\n\t\t\t\t\tfinsembleWindow.setShape([roundedRect]);\n\t\t\t\t}\n\n\t\t\t\tfinsembleWindow.hide();\n\t\t\t} else {\n\t\t\t\tfinsembleWindow.bringToFront();\n\t\t\t\tif (config.isTransparent && !isMac) {\n\t\t\t\t\tconst roundedRect = {\n\t\t\t\t\t\tx: Math.round(rect?.x as number),\n\t\t\t\t\t\ty: Math.round(rect?.y as number),\n\t\t\t\t\t\twidth: Math.round(rect?.width as number),\n\t\t\t\t\t\theight: Math.round(rect?.height as number),\n\t\t\t\t\t};\n\n\t\t\t\t\tawait finsembleWindow.show();\n\t\t\t\t\tfinsembleWindow.setShape([roundedRect]);\n\t\t\t\t} else {\n\t\t\t\t\tawait finsembleWindow.show();\n\t\t\t\t\tconst { err, data } = await FSBL.Clients.LauncherClient.getMonitorInfo({ monitor: \"mine\" });\n\t\t\t\t\tif (err || !data) {\n\t\t\t\t\t\tconsole.error(err);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tconst { data: bounds } = await finsembleWindow.getBounds();\n\t\t\t\t\tconst width = (bounds?.right ?? 0) - (bounds?.left ?? 0);\n\t\t\t\t\tconst height = Math.round(rect?.height as number) + 6;\n\n\t\t\t\t\tawait finsembleWindow.setBounds({\n\t\t\t\t\t\tbounds: {\n\t\t\t\t\t\t\ttop: data[\"availableRect\"][\"top\"],\n\t\t\t\t\t\t\tleft: data[\"availableRect\"][\"right\"] - width,\n\t\t\t\t\t\t\theight: height + 10,\n\t\t\t\t\t\t\twidth: width,\n\t\t\t\t\t\t},\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}, [notifications]);\n\n\treturn (\n\t\t<div>\n\t\t\t{notifications.map((notification: INotification) => (\n\t\t\t\t<ToastCard\n\t\t\t\t\tkey={`toast-card-${notification.id}`}\n\t\t\t\t\tnotification={notification}\n\t\t\t\t\tinformationalNotificationTimeout={informationalTimeout}\n\t\t\t\t\tactionableTimeoutEnabled={actionableTimeoutEnabled}\n\t\t\t\t\tremoveFunction={removeNotification}\n\t\t\t\t\tisActiveFunction={isNotificationActive}\n\t\t\t\t\t{...props}\n\t\t\t\t/>\n\t\t\t))}\n\t\t</div>\n\t);\n};\n"]}
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { services } from "@finsemble/finsemble-core";
2
+ import { services } from "@finsemble/finsemble-api";
3
3
  declare type INotification = services.notification.types.INotification;
4
4
  export declare const CheckButton: React.FunctionComponent<{
5
5
  notification: INotification;
@@ -1 +1 @@
1
- {"version":3,"file":"CheckButton.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/shared/CheckButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAKlE,MAAM,CAAC,MAAM,WAAW,GAEnB,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE;IACzB,MAAM,oBAAoB,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC;IAC9D,MAAM,EAAE,oBAAoB,EAAE,GAAG,oBAAoB,CAAC;IACtD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAGlD,SAAS,CAAC,GAAG,EAAE;QACd,IAAI,oBAAoB,EAAE;YACzB,YAAY,CAAC,oBAAoB,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SAC/D;IACF,CAAC,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAE3B,MAAM,iBAAiB,GAAG,GAAG,EAAE;QAC9B,IAAI,CAAC,SAAS,EAAE;YACf,oBAAoB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;SACxC;aAAM;YACN,IAAI,KAAK,GAAG,oBAAoB,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;YACvD,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;gBACjB,oBAAoB,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;aACtC;SACD;QACD,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC;IAC1B,CAAC,CAAC;IAEF,OAAO,CACN,6BAAK,SAAS,EAAC,sBAAsB,EAAC,OAAO,EAAE,iBAAiB;QAC/D,2BAAG,SAAS,EAAE,mCAAmC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,GAAI,CAC5E,CACN,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import React, { useState, useContext, useEffect } from \"react\";\nimport { NotificationsContext } from \"../../notificationsContext\";\nimport { services } from \"@finsemble/finsemble-core\";\n\ntype INotification = services.notification.types.INotification;\n\nexport const CheckButton: React.FunctionComponent<{\n\tnotification: INotification;\n}> = ({ notification }) => {\n\tconst notificationsContext = useContext(NotificationsContext);\n\tconst { checkedNotifications } = notificationsContext;\n\tconst [isChecked, setIsChecked] = useState(false);\n\n\t// update isChecked value on action\n\tuseEffect(() => {\n\t\tif (checkedNotifications) {\n\t\t\tsetIsChecked(checkedNotifications.indexOf(notification) != -1);\n\t\t}\n\t}, [checkedNotifications]);\n\n\tconst checkNotification = () => {\n\t\tif (!isChecked) {\n\t\t\tcheckedNotifications.push(notification);\n\t\t} else {\n\t\t\tvar index = checkedNotifications.indexOf(notification);\n\t\t\tif (index !== -1) {\n\t\t\t\tcheckedNotifications.splice(index, 1);\n\t\t\t}\n\t\t}\n\t\tsetIsChecked(!isChecked);\n\t};\n\n\treturn (\n\t\t<div className=\"check_icon_container\" onClick={checkNotification}>\n\t\t\t<i className={`ff-check-mark default-img large ${isChecked ? \"checked\" : \"\"}`} />\n\t\t</div>\n\t);\n};\n\nexport default CheckButton;\n"]}
1
+ {"version":3,"file":"CheckButton.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/shared/CheckButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAKlE,MAAM,CAAC,MAAM,WAAW,GAEnB,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE;IACzB,MAAM,oBAAoB,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC;IAC9D,MAAM,EAAE,oBAAoB,EAAE,GAAG,oBAAoB,CAAC;IACtD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAGlD,SAAS,CAAC,GAAG,EAAE;QACd,IAAI,oBAAoB,EAAE;YACzB,YAAY,CAAC,oBAAoB,CAAC,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;SAC/D;IACF,CAAC,EAAE,CAAC,oBAAoB,CAAC,CAAC,CAAC;IAE3B,MAAM,iBAAiB,GAAG,GAAG,EAAE;QAC9B,IAAI,CAAC,SAAS,EAAE;YACf,oBAAoB,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;SACxC;aAAM;YACN,IAAI,KAAK,GAAG,oBAAoB,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;YACvD,IAAI,KAAK,KAAK,CAAC,CAAC,EAAE;gBACjB,oBAAoB,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC;aACtC;SACD;QACD,YAAY,CAAC,CAAC,SAAS,CAAC,CAAC;IAC1B,CAAC,CAAC;IAEF,OAAO,CACN,6BAAK,SAAS,EAAC,sBAAsB,EAAC,OAAO,EAAE,iBAAiB;QAC/D,2BAAG,SAAS,EAAE,mCAAmC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE,GAAI,CAC5E,CACN,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,WAAW,CAAC","sourcesContent":["import React, { useState, useContext, useEffect } from \"react\";\nimport { NotificationsContext } from \"../../notificationsContext\";\nimport { services } from \"@finsemble/finsemble-api\";\n\ntype INotification = services.notification.types.INotification;\n\nexport const CheckButton: React.FunctionComponent<{\n\tnotification: INotification;\n}> = ({ notification }) => {\n\tconst notificationsContext = useContext(NotificationsContext);\n\tconst { checkedNotifications } = notificationsContext;\n\tconst [isChecked, setIsChecked] = useState(false);\n\n\t// update isChecked value on action\n\tuseEffect(() => {\n\t\tif (checkedNotifications) {\n\t\t\tsetIsChecked(checkedNotifications.indexOf(notification) != -1);\n\t\t}\n\t}, [checkedNotifications]);\n\n\tconst checkNotification = () => {\n\t\tif (!isChecked) {\n\t\t\tcheckedNotifications.push(notification);\n\t\t} else {\n\t\t\tvar index = checkedNotifications.indexOf(notification);\n\t\t\tif (index !== -1) {\n\t\t\t\tcheckedNotifications.splice(index, 1);\n\t\t\t}\n\t\t}\n\t\tsetIsChecked(!isChecked);\n\t};\n\n\treturn (\n\t\t<div className=\"check_icon_container\" onClick={checkNotification}>\n\t\t\t<i className={`ff-check-mark default-img large ${isChecked ? \"checked\" : \"\"}`} />\n\t\t</div>\n\t);\n};\n\nexport default CheckButton;\n"]}
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { services } from "@finsemble/finsemble-core";
2
+ import { services } from "@finsemble/finsemble-api";
3
3
  declare type INotification = services.notification.types.INotification;
4
4
  export declare type NotificationCardPropType = {
5
5
  notification: INotification;
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationCardShell.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/shared/NotificationCardShell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,wBAAwB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvF,OAAO,EAAE,2BAA2B,EAAE,MAAM,gDAAgD,CAAC;AAC7F,OAAO,EAAE,yBAAyB,EAAE,MAAM,8CAA8C,CAAC;AAuBzF,MAAM,CAAC,MAAM,qBAAqB,GAAsD,CAAC,EACxF,YAAY,EACZ,SAAS,EACT,kBAAkB,EAClB,QAAQ,GACR,EAAE,EAAE;IACJ,MAAM,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC;IAEhC,MAAM,CAAC,gCAAgC,EAAE,gCAAgC,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IAEzF,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,iBAAiB,CAAC,YAAY,EAAE,gCAAgC,CAAC,CAAC,CAAC;IACtG,MAAM,CAAC,cAAc,EAAE,iBAAiB,CAAC,GAAG,QAAQ,CACnD,gBAAgB,CAAC,YAAY,EAAE,gCAAgC,CAAC,CAChE,CAAC;IAGF,SA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AC,EAAE,IAAI,KAAK,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;KAC1F,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,IAE7D,QAAQ,CAAC,CAAC,CAAC,CACX,QAAQ,CACR,CAAC,CAAC,CAAC,CACH;QACC,oBAAC,2BAA2B,IAC3B,YAAY,EAAE,YAAY,EAC1B,kBAAkB,EAAE,kBAAkB,EACtC,SAAS,EAAE,SAAS,GACnB;QACF,oBAAC,yBAAyB,IAAC,YAAY,EAAE,YAAY,GAAI,CACvD,CACH,CACI,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useState, useEffect } from \"react\";\nimport { parseISO, differenceInMilliseconds, addSeconds } from \"date-fns\";\nimport { isNewNotification, isReNotification, getMostRecentAction } from \"../../utils\";\nimport { NotificationCardHeaderShell } from \"./notificationCard/NotificationCardHeaderShell\";\nimport { NotificationCardBodyShell } from \"./notificationCard/NotificationCardBodyShell\";\nimport { services } from \"@finsemble/finsemble-core\";\n\ntype INotification = services.notification.types.INotification;\ntype IPerformedAction = services.notification.types.IPerformedAction;\n\nexport type NotificationCardPropType = {\n\t/**\n\t * The Notification to be displayed\n\t */\n\tnotification: INotification;\n\n\t/**\n\t * Which UI context the Card is being used in\n\t */\n\tuiContext: \"toasts\" | \"center\";\n\n\t/**\n\t * The internal function that will be called on toasts when dismissed or marked as read\n\t */\n\tremoveNotification: Function;\n};\n\nexport const NotificationCardShell: React.FunctionComponent<NotificationCardPropType> = ({\n\tnotification,\n\tuiContext,\n\tremoveNotification,\n\tchildren,\n}) => {\n\tconst { isRead } = notification;\n\n\tconst [newNotificationHaloPeriodSeconds, setNotificationHaloPeriodSeconds] = useState(0);\n\n\tconst [isNew, setIsNew] = useState(isNewNotification(notification, newNotificationHaloPeriodSeconds));\n\tconst [wokeFromSnooze, setWokeFromSnooze] = useState(\n\t\tisReNotification(notification, newNotificationHaloPeriodSeconds)\n\t);\n\n\t// Sets the current default preference\n\tuseEffect(() => {\n\t\tasync function getNotificationsPreferences() {\n\t\t\treturn await FSBL.Clients.NotificationClient.getPreferences();\n\t\t}\n\n\t\tgetNotificationsPreferences().then((preferences: any) => {\n\t\t\tsetNotificationHaloPeriodSeconds(preferences.newNotificationHaloPeriodSeconds);\n\t\t\tsetIsNew(isNewNotification(notification, preferences.newNotificationHaloPeriodSeconds));\n\t\t});\n\t}, []);\n\n\t// Listens for preferences change\n\tuseEffect(() => {\n\t\tasync function listenForPreferenceChange(error: any, response: any) {\n\t\t\tif (error) {\n\t\t\t\tconsole.error(\"FinsembleUserPreferencesChannel: \", error);\n\t\t\t} else {\n\t\t\t\tconst { data } = response;\n\t\t\t\tif (\n\t\t\t\t\tdata.notificationPreferences &&\n\t\t\t\t\tdata.notificationPreferences.hasOwnProperty(\"newNotificationHaloPeriodSeconds\")\n\t\t\t\t) {\n\t\t\t\t\tsetNotificationHaloPeriodSeconds(data.notificationPreferences.newNotificationHaloPeriodSeconds);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tFSBL.Clients.RouterClient.addListener(\"FinsembleUserPreferencesChannel\", listenForPreferenceChange);\n\t\treturn () => {\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"FinsembleUserPreferencesChannel\", listenForPreferenceChange);\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tlet isNewTimerId: any;\n\t\tif (isNew) {\n\t\t\tif (notification.isRead) {\n\t\t\t\tsetIsNew(false);\n\t\t\t\tclearTimeout(isNewTimerId);\n\t\t\t} else {\n\t\t\t\tisNewTimerId = setTimeout(() => {\n\t\t\t\t\tsetIsNew(false);\n\t\t\t\t}, differenceInMilliseconds(addSeconds(parseISO(notification.issuedAt), newNotificationHaloPeriodSeconds), Date.now()));\n\t\t\t}\n\t\t}\n\t\treturn () => {\n\t\t\tclearTimeout(isNewTimerId);\n\t\t};\n\t}, [isNew, notification]);\n\n\tuseEffect(() => {\n\t\tlet isRenotificationTimerId: any;\n\t\tif (isReNotification(notification, newNotificationHaloPeriodSeconds)) {\n\t\t\tconst mostRecentAction: IPerformedAction | null = getMostRecentAction(notification);\n\t\t\tif (mostRecentAction) {\n\t\t\t\tsetWokeFromSnooze(true);\n\t\t\t\tisRenotificationTimerId = setTimeout(() => {\n\t\t\t\t\tsetWokeFromSnooze(false);\n\t\t\t\t}, differenceInMilliseconds(addSeconds(parseISO(mostRecentAction.datePerformed), newNotificationHaloPeriodSeconds), Date.now()));\n\t\t\t}\n\t\t} else {\n\t\t\tsetWokeFromSnooze(false);\n\t\t\tclearTimeout(isRenotificationTimerId);\n\t\t}\n\t\treturn () => {\n\t\t\tclearTimeout(isRenotificationTimerId);\n\t\t};\n\t}, [newNotificationHaloPeriodSeconds, notification]);\n\treturn (\n\t\t<div\n\t\t\tclassName={`notification-card ${isRead ? \"read\" : \"\"} ${isNew || wokeFromSnooze ? \"new\" : \"\"} \n\t\t\t${notification.cssClassName ? notification.cssClassName : \"\"}`}\n\t\t>\n\t\t\t{children ? (\n\t\t\t\tchildren\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<NotificationCardHeaderShell\n\t\t\t\t\t\tnotification={notification}\n\t\t\t\t\t\tremoveNotification={removeNotification}\n\t\t\t\t\t\tuiContext={uiContext}\n\t\t\t\t\t/>\n\t\t\t\t\t<NotificationCardBodyShell notification={notification} />\n\t\t\t\t</>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n"]}
1
+ {"version":3,"file":"NotificationCardShell.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/shared/NotificationCardShell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,EAAE,QAAQ,EAAE,wBAAwB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC1E,OAAO,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,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pF,IAAI,gBAAgB,EAAE;gBACrB,iBAAiB,CAAC,IAAI,CAAC,CAAC;gBACxB,uBAAuB,GAAG,UAAU,CAAC,GAAG,EAAE;oBACzC,iBAAiB,CAAC,KAAK,CAAC,CAAC;gBAC1B,CAAC,EAAE,wBAAwB,CAAC,UAAU,CAAC,QAAQ,CAAC,gBAAgB,CAAC,aAAa,CAAC,EAAE,gCAAgC,CAAC,EAAE,IAAI,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC;aACjI;SACD;aAAM;YACN,iBAAiB,CAAC,KAAK,CAAC,CAAC;YACzB,YAAY,CAAC,uBAAuB,CAAC,CAAC;SACtC;QACD,OAAO,GAAG,EAAE;YACX,YAAY,CAAC,uBAAuB,CAAC,CAAC;QACvC,CAAC,CAAC;IACH,CAAC,EAAE,CAAC,gCAAgC,EAAE,YAAY,CAAC,CAAC,CAAC;IACrD,OAAO,CACN,6BACC,SAAS,EAAE,qBAAqB,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,IAAI,KAAK,IAAI,cAAc,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE;KAC1F,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,EAAE,EAAE,IAE7D,QAAQ,CAAC,CAAC,CAAC,CACX,QAAQ,CACR,CAAC,CAAC,CAAC,CACH;QACC,oBAAC,2BAA2B,IAC3B,YAAY,EAAE,YAAY,EAC1B,kBAAkB,EAAE,kBAAkB,EACtC,SAAS,EAAE,SAAS,GACnB;QACF,oBAAC,yBAAyB,IAAC,YAAY,EAAE,YAAY,GAAI,CACvD,CACH,CACI,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useState, useEffect } from \"react\";\nimport { parseISO, differenceInMilliseconds, addSeconds } from \"date-fns\";\nimport { isNewNotification, isReNotification, getMostRecentAction } from \"../../utils\";\nimport { NotificationCardHeaderShell } from \"./notificationCard/NotificationCardHeaderShell\";\nimport { NotificationCardBodyShell } from \"./notificationCard/NotificationCardBodyShell\";\nimport { services } from \"@finsemble/finsemble-api\";\n\ntype INotification = services.notification.types.INotification;\ntype IPerformedAction = services.notification.types.IPerformedAction;\n\nexport type NotificationCardPropType = {\n\t/**\n\t * The Notification to be displayed\n\t */\n\tnotification: INotification;\n\n\t/**\n\t * Which UI context the Card is being used in\n\t */\n\tuiContext: \"toasts\" | \"center\";\n\n\t/**\n\t * The internal function that will be called on toasts when dismissed or marked as read\n\t */\n\tremoveNotification: Function;\n};\n\nexport const NotificationCardShell: React.FunctionComponent<NotificationCardPropType> = ({\n\tnotification,\n\tuiContext,\n\tremoveNotification,\n\tchildren,\n}) => {\n\tconst { isRead } = notification;\n\n\tconst [newNotificationHaloPeriodSeconds, setNotificationHaloPeriodSeconds] = useState(0);\n\n\tconst [isNew, setIsNew] = useState(isNewNotification(notification, newNotificationHaloPeriodSeconds));\n\tconst [wokeFromSnooze, setWokeFromSnooze] = useState(\n\t\tisReNotification(notification, newNotificationHaloPeriodSeconds)\n\t);\n\n\t// Sets the current default preference\n\tuseEffect(() => {\n\t\tasync function getNotificationsPreferences() {\n\t\t\treturn await FSBL.Clients.NotificationClient.getPreferences();\n\t\t}\n\n\t\tgetNotificationsPreferences().then((preferences: any) => {\n\t\t\tsetNotificationHaloPeriodSeconds(preferences.newNotificationHaloPeriodSeconds);\n\t\t\tsetIsNew(isNewNotification(notification, preferences.newNotificationHaloPeriodSeconds));\n\t\t});\n\t}, []);\n\n\t// Listens for preferences change\n\tuseEffect(() => {\n\t\tasync function listenForPreferenceChange(error: any, response: any) {\n\t\t\tif (error) {\n\t\t\t\tconsole.error(\"FinsembleUserPreferencesChannel: \", error);\n\t\t\t} else {\n\t\t\t\tconst { data } = response;\n\t\t\t\tif (\n\t\t\t\t\tdata.notificationPreferences &&\n\t\t\t\t\tdata.notificationPreferences.hasOwnProperty(\"newNotificationHaloPeriodSeconds\")\n\t\t\t\t) {\n\t\t\t\t\tsetNotificationHaloPeriodSeconds(data.notificationPreferences.newNotificationHaloPeriodSeconds);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tFSBL.Clients.RouterClient.addListener(\"FinsembleUserPreferencesChannel\", listenForPreferenceChange);\n\t\treturn () => {\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"FinsembleUserPreferencesChannel\", listenForPreferenceChange);\n\t\t};\n\t}, []);\n\n\tuseEffect(() => {\n\t\tlet isNewTimerId: any;\n\t\tif (isNew) {\n\t\t\tif (notification.isRead) {\n\t\t\t\tsetIsNew(false);\n\t\t\t\tclearTimeout(isNewTimerId);\n\t\t\t} else {\n\t\t\t\tisNewTimerId = setTimeout(() => {\n\t\t\t\t\tsetIsNew(false);\n\t\t\t\t}, differenceInMilliseconds(addSeconds(parseISO(notification.issuedAt), newNotificationHaloPeriodSeconds), Date.now()));\n\t\t\t}\n\t\t}\n\t\treturn () => {\n\t\t\tclearTimeout(isNewTimerId);\n\t\t};\n\t}, [isNew, notification]);\n\n\tuseEffect(() => {\n\t\tlet isRenotificationTimerId: any;\n\t\tif (isReNotification(notification, newNotificationHaloPeriodSeconds)) {\n\t\t\tconst mostRecentAction: IPerformedAction | null = getMostRecentAction(notification);\n\t\t\tif (mostRecentAction) {\n\t\t\t\tsetWokeFromSnooze(true);\n\t\t\t\tisRenotificationTimerId = setTimeout(() => {\n\t\t\t\t\tsetWokeFromSnooze(false);\n\t\t\t\t}, differenceInMilliseconds(addSeconds(parseISO(mostRecentAction.datePerformed), newNotificationHaloPeriodSeconds), Date.now()));\n\t\t\t}\n\t\t} else {\n\t\t\tsetWokeFromSnooze(false);\n\t\t\tclearTimeout(isRenotificationTimerId);\n\t\t}\n\t\treturn () => {\n\t\t\tclearTimeout(isRenotificationTimerId);\n\t\t};\n\t}, [newNotificationHaloPeriodSeconds, notification]);\n\treturn (\n\t\t<div\n\t\t\tclassName={`notification-card ${isRead ? \"read\" : \"\"} ${isNew || wokeFromSnooze ? \"new\" : \"\"} \n\t\t\t${notification.cssClassName ? notification.cssClassName : \"\"}`}\n\t\t>\n\t\t\t{children ? (\n\t\t\t\tchildren\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<NotificationCardHeaderShell\n\t\t\t\t\t\tnotification={notification}\n\t\t\t\t\t\tremoveNotification={removeNotification}\n\t\t\t\t\t\tuiContext={uiContext}\n\t\t\t\t\t/>\n\t\t\t\t\t<NotificationCardBodyShell notification={notification} />\n\t\t\t\t</>\n\t\t\t)}\n\t\t</div>\n\t);\n};\n"]}
@@ -1,6 +1,6 @@
1
1
  import React, { Dispatch, SetStateAction } from "react";
2
2
  import { OverFlowMenuAction } from "../../types";
3
- import { services } from "@finsemble/finsemble-core";
3
+ import { services } from "@finsemble/finsemble-api";
4
4
  declare type INotification = services.notification.types.INotification;
5
5
  export declare const OverflowMenuActions: {
6
6
  [key: string]: OverFlowMenuAction;
@@ -1 +1 @@
1
- {"version":3,"file":"OverflowMenu.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/shared/OverflowMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA4B,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGrF,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,EACN,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,GACnB,MAAM,oCAAoC,CAAC;AAM5C,OAAO,iBAAiB,MAAM,2BAA2B,CAAC;AAC1D,OAAO,gBAAgB,MAAM,0BAA0B,CAAC;AACxD,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAKhD,MAAM,CAAC,MAAM,mBAAmB,GAA0C;IACzE,cAAc,EAAE;QACf,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,oBAAC,iBAAiB,OAAG;QAC3B,KAAK,EAAE,aAAa;QACpB,MAAM,EAAE,CAAC,YAA2B,EAAE,EAAE,CAAC,uBAAuB,CAAC,CAAC,YAAY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KAAK,CAAQ,CACjD,CACN,CAAC;AACH,CAAC,CAAC;AAMF,MAAM,YAAY,GAEb,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE;IAChC,MAAM,UAAU,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAChD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,0BAA0B,CAAC,CAAC;IAEvE,uBAAuB,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IAE5D,MAAM,mBAAmB,GAAG,GAAG,EAAE;;QAChC,MAAM,cAAc,GAAG,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC;QAC3D,MAAM,OAAO,GAAG,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,OAAO,0CAAE,qBAAqB,EAAE,CAAC;QAC7D,MAAM,aAAa,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;QAEnF,IAAI,aAAa,IAAI,aAAa,GAAG,cAAc,EAAE;YACpD,YAAY,CAAC,kCAAkC,CAAC,CAAC;SACjD;IACF,CAAC,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACd,mBAAmB,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,OAAO,CACN,6BAAK,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,IACxC,QAAQ,CACJ,CACN,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import React, { Dispatch, SetStateAction, useEffect, useRef, useState } from \"react\";\n\n// Hooks\nimport { useOutsideClickDetector } from \"../../../../hooks/useOutsideClickDetector\";\nimport {\n\tmarkNotificationsRead,\n\tmarkNotificationsUnread,\n\tsnoozeNotifications,\n} from \"../../../../hooks/useNotifications\";\n\n// Types\nimport { OverFlowMenuAction } from \"../../types\";\n\n// Icons\nimport EnvelopeCloseIcon from \"../../icons/EnvelopeClose\";\nimport EnvelopeOpenIcon from \"../../icons/EnvelopeOpen\";\nimport SnoozeIcon from \"../../icons/SnoozeIcon\";\nimport { services } from \"@finsemble/finsemble-core\";\n\ntype INotification = services.notification.types.INotification;\n\nexport const OverflowMenuActions: { [key: string]: OverFlowMenuAction } = {\n\tMARK_AS_UNREAD: {\n\t\tname: \"MARK_AS_UNREAD\",\n\t\ticon: <EnvelopeCloseIcon />,\n\t\tlabel: \"Mark Unread\",\n\t\taction: (notification: INotification) => markNotificationsUnread([notification]),\n\t},\n\tMARK_AS_READ: {\n\t\tname: \"MARK_AS_READ\",\n\t\ticon: <EnvelopeOpenIcon />,\n\t\tlabel: \"Mark Read\",\n\t\taction: (notification: INotification) => markNotificationsRead([notification]),\n\t},\n\tSNOOZE: {\n\t\tname: \"SNOOZE\",\n\t\ticon: <SnoozeIcon />,\n\t\tlabel: \"Snooze\",\n\t\taction: (notification: INotification) => snoozeNotifications([notification]),\n\t},\n\tDISMISS: {\n\t\tname: \"DISMISS\",\n\t\ticon: (\n\t\t\t<div className=\"finsemble-icon\">\n\t\t\t\t<i className=\"ff-close\" />\n\t\t\t</div>\n\t\t),\n\t\tlabel: \"Dismiss\",\n\t\taction: () => {\n\t\t\t// Empty - filled in later\n\t\t},\n\t},\n\tSETTINGS: {\n\t\tname: \"SETTINGS\",\n\t\ticon: (\n\t\t\t<div className=\"finsemble-icon\">\n\t\t\t\t<i className=\"ff-settings\" />\n\t\t\t</div>\n\t\t),\n\t\tlabel: \"Settings\",\n\t\taction: (notification: INotification) => {\n\t\t\tFSBL.Clients.LauncherClient.showWindow(\n\t\t\t\t{\n\t\t\t\t\tcomponentType: \"UserPreferences\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmonitor: \"mine\",\n\t\t\t\t\tleft: \"center\",\n\t\t\t\t\ttop: \"center\",\n\t\t\t\t},\n\t\t\t\t() => {\n\t\t\t\t\tFSBL.Clients.RouterClient.transmit(\"FinsembleUserPreferencesChannel\", {\n\t\t\t\t\t\tpreferencesTab: \"Notifications\",\n\t\t\t\t\t\tnotification,\n\t\t\t\t\t});\n\t\t\t\t\t// we need this timeout otherwise the UserPreferences screen does not detect the message being transmited\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tFSBL.Clients.RouterClient.transmit(\"FinsembleNotificationsNavigationChannel\", { notification });\n\t\t\t\t\t}, 50);\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t},\n\tDETAILS: {\n\t\tname: \"DETAILS\",\n\t\ticon: (\n\t\t\t<div className=\"finsemble-icon\">\n\t\t\t\t<i className=\"ff-dots-horz\" />\n\t\t\t</div>\n\t\t),\n\t\tlabel: \"Details\",\n\t\taction: () => {\n\t\t\t// Empty - filled in later\n\t\t},\n\t},\n};\n\nexport const renderOverflowMenuAction = (\n\tnotification: INotification,\n\tmenuAction: OverFlowMenuAction,\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tisMuted: boolean\n) => {\n\tif (\n\t\t// Don't display read if notification is read\n\t\t(notification.isRead && menuAction.name === OverflowMenuActions.MARK_AS_READ.name) ||\n\t\t// Don't display unread if notification is unread\n\t\t(!notification.isRead && menuAction.name === OverflowMenuActions.MARK_AS_UNREAD.name)\n\t) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tkey={`${notification.id}_${menuAction.name}`}\n\t\t\tclassName=\"overflow-menu__action\"\n\t\t\ttabIndex={0}\n\t\t\tonClick={() => {\n\t\t\t\tmenuAction?.action(notification);\n\t\t\t}}\n\t\t\tonKeyDown={(e) => {\n\t\t\t\tif (e.key === \"Enter\") {\n\t\t\t\t\tmenuAction?.action(notification);\n\t\t\t\t}\n\t\t\t}}\n\t\t>\n\t\t\t{menuAction?.icon}\n\t\t\t<span className=\"btn-label\">{menuAction?.label}</span>\n\t\t</div>\n\t);\n};\n\n/**\n * Overflow menu component for notifications that will provide a set of actions\n * a user can perform on a notification (e.g. dismiss, snooze)\n */\nconst OverflowMenu: React.FunctionComponent<{\n\tcloseSelf: Dispatch<SetStateAction<boolean>>;\n}> = ({ closeSelf, children }) => {\n\tconst wrapperRef = useRef<HTMLDivElement>(null);\n\tconst [className, setClassName] = useState(\"overflow-menu__container\");\n\n\tuseOutsideClickDetector(wrapperRef, () => closeSelf(false));\n\n\tconst moveElementIntoView = () => {\n\t\tconst bottomViewPort = window.innerHeight + window.scrollY;\n\t\tconst domRect = wrapperRef?.current?.getBoundingClientRect();\n\t\tconst elementBottom = domRect ? domRect.y + domRect.height + window.scrollY : null;\n\n\t\tif (elementBottom && elementBottom > bottomViewPort) {\n\t\t\tsetClassName(\"overflow-menu__container flow-up\");\n\t\t}\n\t};\n\n\tuseEffect(() => {\n\t\tmoveElementIntoView();\n\t});\n\n\treturn (\n\t\t<div ref={wrapperRef} className={className}>\n\t\t\t{children}\n\t\t</div>\n\t);\n};\n\nexport default OverflowMenu;\n"]}
1
+ {"version":3,"file":"OverflowMenu.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/shared/OverflowMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAA4B,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAGrF,OAAO,EAAE,uBAAuB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,EACN,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,GACnB,MAAM,oCAAoC,CAAC;AAM5C,OAAO,iBAAiB,MAAM,2BAA2B,CAAC;AAC1D,OAAO,gBAAgB,MAAM,0BAA0B,CAAC;AACxD,OAAO,UAAU,MAAM,wBAAwB,CAAC;AAKhD,MAAM,CAAC,MAAM,mBAAmB,GAA0C;IACzE,cAAc,EAAE;QACf,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,oBAAC,iBAAiB,OAAG;QAC3B,KAAK,EAAE,aAAa;QACpB,MAAM,E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SAAS,EAAC,WAAW,IAAE,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,KAAK,CAAQ,CACjD,CACN,CAAC;AACH,CAAC,CAAC;AAMF,MAAM,YAAY,GAEb,CAAC,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE;IAChC,MAAM,UAAU,GAAG,MAAM,CAAiB,IAAI,CAAC,CAAC;IAChD,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,0BAA0B,CAAC,CAAC;IAEvE,uBAAuB,CAAC,UAAU,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;IAE5D,MAAM,mBAAmB,GAAG,GAAG,EAAE;;QAChC,MAAM,cAAc,GAAG,MAAM,CAAC,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC;QAC3D,MAAM,OAAO,GAAG,MAAA,UAAU,aAAV,UAAU,uBAAV,UAAU,CAAE,OAAO,0CAAE,qBAAqB,EAAE,CAAC;QAC7D,MAAM,aAAa,GAAG,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;QAEnF,IAAI,aAAa,IAAI,aAAa,GAAG,cAAc,EAAE;YACpD,YAAY,CAAC,kCAAkC,CAAC,CAAC;SACjD;IACF,CAAC,CAAC;IAEF,SAAS,CAAC,GAAG,EAAE;QACd,mBAAmB,EAAE,CAAC;IACvB,CAAC,CAAC,CAAC;IAEH,OAAO,CACN,6BAAK,GAAG,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,IACxC,QAAQ,CACJ,CACN,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,YAAY,CAAC","sourcesContent":["import React, { Dispatch, SetStateAction, useEffect, useRef, useState } from \"react\";\n\n// Hooks\nimport { useOutsideClickDetector } from \"../../../../hooks/useOutsideClickDetector\";\nimport {\n\tmarkNotificationsRead,\n\tmarkNotificationsUnread,\n\tsnoozeNotifications,\n} from \"../../../../hooks/useNotifications\";\n\n// Types\nimport { OverFlowMenuAction } from \"../../types\";\n\n// Icons\nimport EnvelopeCloseIcon from \"../../icons/EnvelopeClose\";\nimport EnvelopeOpenIcon from \"../../icons/EnvelopeOpen\";\nimport SnoozeIcon from \"../../icons/SnoozeIcon\";\nimport { services } from \"@finsemble/finsemble-api\";\n\ntype INotification = services.notification.types.INotification;\n\nexport const OverflowMenuActions: { [key: string]: OverFlowMenuAction } = {\n\tMARK_AS_UNREAD: {\n\t\tname: \"MARK_AS_UNREAD\",\n\t\ticon: <EnvelopeCloseIcon />,\n\t\tlabel: \"Mark Unread\",\n\t\taction: (notification: INotification) => markNotificationsUnread([notification]),\n\t},\n\tMARK_AS_READ: {\n\t\tname: \"MARK_AS_READ\",\n\t\ticon: <EnvelopeOpenIcon />,\n\t\tlabel: \"Mark Read\",\n\t\taction: (notification: INotification) => markNotificationsRead([notification]),\n\t},\n\tSNOOZE: {\n\t\tname: \"SNOOZE\",\n\t\ticon: <SnoozeIcon />,\n\t\tlabel: \"Snooze\",\n\t\taction: (notification: INotification) => snoozeNotifications([notification]),\n\t},\n\tDISMISS: {\n\t\tname: \"DISMISS\",\n\t\ticon: (\n\t\t\t<div className=\"finsemble-icon\">\n\t\t\t\t<i className=\"ff-close\" />\n\t\t\t</div>\n\t\t),\n\t\tlabel: \"Dismiss\",\n\t\taction: () => {\n\t\t\t// Empty - filled in later\n\t\t},\n\t},\n\tSETTINGS: {\n\t\tname: \"SETTINGS\",\n\t\ticon: (\n\t\t\t<div className=\"finsemble-icon\">\n\t\t\t\t<i className=\"ff-settings\" />\n\t\t\t</div>\n\t\t),\n\t\tlabel: \"Settings\",\n\t\taction: (notification: INotification) => {\n\t\t\tFSBL.Clients.LauncherClient.showWindow(\n\t\t\t\t{\n\t\t\t\t\tcomponentType: \"UserPreferences\",\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tmonitor: \"mine\",\n\t\t\t\t\tleft: \"center\",\n\t\t\t\t\ttop: \"center\",\n\t\t\t\t},\n\t\t\t\t() => {\n\t\t\t\t\tFSBL.Clients.RouterClient.transmit(\"FinsembleUserPreferencesChannel\", {\n\t\t\t\t\t\tpreferencesTab: \"Notifications\",\n\t\t\t\t\t\tnotification,\n\t\t\t\t\t});\n\t\t\t\t\t// we need this timeout otherwise the UserPreferences screen does not detect the message being transmited\n\t\t\t\t\tsetTimeout(() => {\n\t\t\t\t\t\tFSBL.Clients.RouterClient.transmit(\"FinsembleNotificationsNavigationChannel\", { notification });\n\t\t\t\t\t}, 50);\n\t\t\t\t}\n\t\t\t);\n\t\t},\n\t},\n\tDETAILS: {\n\t\tname: \"DETAILS\",\n\t\ticon: (\n\t\t\t<div className=\"finsemble-icon\">\n\t\t\t\t<i className=\"ff-dots-horz\" />\n\t\t\t</div>\n\t\t),\n\t\tlabel: \"Details\",\n\t\taction: () => {\n\t\t\t// Empty - filled in later\n\t\t},\n\t},\n};\n\nexport const renderOverflowMenuAction = (\n\tnotification: INotification,\n\tmenuAction: OverFlowMenuAction,\n\t// eslint-disable-next-line @typescript-eslint/no-unused-vars\n\tisMuted: boolean\n) => {\n\tif (\n\t\t// Don't display read if notification is read\n\t\t(notification.isRead && menuAction.name === OverflowMenuActions.MARK_AS_READ.name) ||\n\t\t// Don't display unread if notification is unread\n\t\t(!notification.isRead && menuAction.name === OverflowMenuActions.MARK_AS_UNREAD.name)\n\t) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tkey={`${notification.id}_${menuAction.name}`}\n\t\t\tclassName=\"overflow-menu__action\"\n\t\t\ttabIndex={0}\n\t\t\tonClick={() => {\n\t\t\t\tmenuAction?.action(notification);\n\t\t\t}}\n\t\t\tonKeyDown={(e) => {\n\t\t\t\tif (e.key === \"Enter\") {\n\t\t\t\t\tmenuAction?.action(notification);\n\t\t\t\t}\n\t\t\t}}\n\t\t>\n\t\t\t{menuAction?.icon}\n\t\t\t<span className=\"btn-label\">{menuAction?.label}</span>\n\t\t</div>\n\t);\n};\n\n/**\n * Overflow menu component for notifications that will provide a set of actions\n * a user can perform on a notification (e.g. dismiss, snooze)\n */\nconst OverflowMenu: React.FunctionComponent<{\n\tcloseSelf: Dispatch<SetStateAction<boolean>>;\n}> = ({ closeSelf, children }) => {\n\tconst wrapperRef = useRef<HTMLDivElement>(null);\n\tconst [className, setClassName] = useState(\"overflow-menu__container\");\n\n\tuseOutsideClickDetector(wrapperRef, () => closeSelf(false));\n\n\tconst moveElementIntoView = () => {\n\t\tconst bottomViewPort = window.innerHeight + window.scrollY;\n\t\tconst domRect = wrapperRef?.current?.getBoundingClientRect();\n\t\tconst elementBottom = domRect ? domRect.y + domRect.height + window.scrollY : null;\n\n\t\tif (elementBottom && elementBottom > bottomViewPort) {\n\t\t\tsetClassName(\"overflow-menu__container flow-up\");\n\t\t}\n\t};\n\n\tuseEffect(() => {\n\t\tmoveElementIntoView();\n\t});\n\n\treturn (\n\t\t<div ref={wrapperRef} className={className}>\n\t\t\t{children}\n\t\t</div>\n\t);\n};\n\nexport default OverflowMenu;\n"]}
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { services } from "@finsemble/finsemble-core";
2
+ import { services } from "@finsemble/finsemble-api";
3
3
  declare type INotification = services.notification.types.INotification;
4
4
  export declare const NotificationCardBodyActions: React.FunctionComponent<{
5
5
  notification: INotification;
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationCardBodyActions.js","sourceRoot":"","sources":["../../../../../../src/components/notifications/components/shared/notificationCard/NotificationCardBodyActions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,cAAuD,MAAM,mCAAmC,CAAC;AACxG,OAAO,MAAiC,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AAMjE,MAAM,mBAAmB,GAAG,CAAC,YAA2B,EAAE,MAA2B,EAAE,EAAmB,EA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AAU,CAAC,CAAC,CAAC,CACb,6BAAK,SAAS,EAAC,eAAe,IAC5B,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,GAAG,CAAC,CAAC,MAA2B,EAAE,KAAU,EAAE,EAAE,CAAC,mBAAmB,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CACvG,CACN,CAAC,CAAC,CAAC,IAAI,CACN,CACH,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React from \"react\";\nimport DropdownButton, { IFinsembleDropdownActionButtonProps } from \"../../../../common/DropdownButton\";\nimport Button, { IFinsembleButtonProps } from \"../../../../shared/Button\";\nimport { doAction } from \"../../../../../hooks/useNotifications\";\nimport { services } from \"@finsemble/finsemble-core\";\n\ntype INotification = services.notification.types.INotification;\ntype IAction = services.notification.types.IAction;\n\nconst renderActionButtons = (notification: INotification, action: IAction | IAction[], id: string | number) => {\n\tif (Array.isArray(action)) {\n\t\tlet buttonData = {} as IFinsembleDropdownActionButtonProps;\n\t\tlet buttonOptions: IFinsembleButtonProps[] = [];\n\t\taction.forEach((compositeAction, index) => {\n\t\t\tif (index === 0) {\n\t\t\t\tbuttonData.mainAction = () => doAction && doAction(notification, compositeAction);\n\t\t\t\tbuttonData.buttonLabel = compositeAction.buttonText;\n\t\t\t} else {\n\t\t\t\tbuttonOptions.push({\n\t\t\t\t\tbuttonLabel: compositeAction.buttonText,\n\t\t\t\t\tclickHandler: () => doAction && doAction(notification, compositeAction),\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t\treturn (\n\t\t\t<DropdownButton\n\t\t\t\tkey={id}\n\t\t\t\tbuttonLabel={buttonData.buttonLabel}\n\t\t\t\tmainAction={buttonData.mainAction}\n\t\t\t\tbuttonOptions={buttonOptions}\n\t\t\t/>\n\t\t);\n\t} else {\n\t\treturn (\n\t\t\t<Button\n\t\t\t\tkey={id}\n\t\t\t\tbuttonLabel={action.buttonText}\n\t\t\t\tclickHandler={() => doAction && doAction(notification, action)}\n\t\t\t/>\n\t\t);\n\t}\n};\n\nexport const NotificationCardBodyActions: React.FunctionComponent<{ notification: INotification }> = ({\n\tnotification,\n}) => {\n\tconst { actions } = notification;\n\tconst hasActions = actions && actions.length > 0;\n\n\treturn (\n\t\t<>\n\t\t\t{hasActions ? (\n\t\t\t\t<div className=\"actions-panel\">\n\t\t\t\t\t{actions?.map((action: IAction | IAction[], index: any) => renderActionButtons(notification, action, index))}\n\t\t\t\t</div>\n\t\t\t) : null}\n\t\t</>\n\t);\n};\n"]}
1
+ {"version":3,"file":"NotificationCardBodyActions.js","sourceRoot":"","sources":["../../../../../../src/components/notifications/components/shared/notificationCard/NotificationCardBodyActions.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,cAAuD,MAAM,mCAAmC,CAAC;AACxG,OAAO,MAAiC,MAAM,2BAA2B,CAAC;AAC1E,OAAO,EAAE,QAAQ,EAAE,MAAM,uCAAuC,CAAC;AAMjE,MAAM,mBAAmB,GAAG,CAAC,YAA2B,EAAE,MAA2B,EAAE,EAAmB,EAAE,EAAE;IAC7G,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QAC1B,IAAI,UAAU,GAAG,EAAyC,CAAC;QAC3D,IAAI,aAAa,GAA4B,EAAE,CAAC;QAChD,MAAM,CAAC,OAAO,CAAC,CAAC,eAAe,EAAE,KAAK,EAAE,EAAE;YACzC,IAAI,KAAK,KAAK,CAAC,EAAE;gBAChB,UAAU,CAAC,UAAU,GAAG,GAAG,EAAE,CAAC,QAAQ,IAAI,QAAQ,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;gBAClF,UAAU,CAAC,WAAW,GAAG,eAAe,CAAC,UAAU,CAAC;aACpD;iBAAM;gBACN,aAAa,CAAC,IAAI,CAAC;oBAClB,WAAW,EAAE,eAAe,CAAC,UAAU;oBACvC,YAAY,EAAE,GAAG,EAAE,CAAC,QAAQ,IAAI,QAAQ,CAAC,YAAY,EAAE,eAAe,CAAC;iBACvE,CAAC,CAAC;aACH;QACF,CAAC,CAAC,CAAC;QACH,OAAO,CACN,oBAAC,cAAc,IACd,GAAG,EAAE,EAAE,EACP,WAAW,EAAE,UAAU,CAAC,WAAW,EACnC,UAAU,EAAE,UAAU,CAAC,UAAU,EACjC,aAAa,EAAE,aAAa,GAC3B,CACF,CAAC;KACF;SAAM;QACN,OAAO,CACN,oBAAC,MAAM,IACN,GAAG,EAAE,EAAE,EACP,WAAW,EAAE,MAAM,CAAC,UAAU,EAC9B,YAAY,EAAE,GAAG,EAAE,CAAC,QAAQ,IAAI,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC,GAC7D,CACF,CAAC;KACF;AACF,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,2BAA2B,GAA6D,CAAC,EACrG,YAAY,GACZ,EAAE,EAAE;IACJ,MAAM,EAAE,OAAO,EAAE,GAAG,YAAY,CAAC;IACjC,MAAM,UAAU,GAAG,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IAEjD,OAAO,CACN,0CACE,UAAU,CAAC,CAAC,CAAC,CACb,6BAAK,SAAS,EAAC,eAAe,IAC5B,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,GAAG,CAAC,CAAC,MAA2B,EAAE,KAAU,EAAE,EAAE,CAAC,mBAAmB,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,CAAC,CAAC,CACvG,CACN,CAAC,CAAC,CAAC,IAAI,CACN,CACH,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React from \"react\";\nimport DropdownButton, { IFinsembleDropdownActionButtonProps } from \"../../../../common/DropdownButton\";\nimport Button, { IFinsembleButtonProps } from \"../../../../shared/Button\";\nimport { doAction } from \"../../../../../hooks/useNotifications\";\nimport { services } from \"@finsemble/finsemble-api\";\n\ntype INotification = services.notification.types.INotification;\ntype IAction = services.notification.types.IAction;\n\nconst renderActionButtons = (notification: INotification, action: IAction | IAction[], id: string | number) => {\n\tif (Array.isArray(action)) {\n\t\tlet buttonData = {} as IFinsembleDropdownActionButtonProps;\n\t\tlet buttonOptions: IFinsembleButtonProps[] = [];\n\t\taction.forEach((compositeAction, index) => {\n\t\t\tif (index === 0) {\n\t\t\t\tbuttonData.mainAction = () => doAction && doAction(notification, compositeAction);\n\t\t\t\tbuttonData.buttonLabel = compositeAction.buttonText;\n\t\t\t} else {\n\t\t\t\tbuttonOptions.push({\n\t\t\t\t\tbuttonLabel: compositeAction.buttonText,\n\t\t\t\t\tclickHandler: () => doAction && doAction(notification, compositeAction),\n\t\t\t\t});\n\t\t\t}\n\t\t});\n\t\treturn (\n\t\t\t<DropdownButton\n\t\t\t\tkey={id}\n\t\t\t\tbuttonLabel={buttonData.buttonLabel}\n\t\t\t\tmainAction={buttonData.mainAction}\n\t\t\t\tbuttonOptions={buttonOptions}\n\t\t\t/>\n\t\t);\n\t} else {\n\t\treturn (\n\t\t\t<Button\n\t\t\t\tkey={id}\n\t\t\t\tbuttonLabel={action.buttonText}\n\t\t\t\tclickHandler={() => doAction && doAction(notification, action)}\n\t\t\t/>\n\t\t);\n\t}\n};\n\nexport const NotificationCardBodyActions: React.FunctionComponent<{ notification: INotification }> = ({\n\tnotification,\n}) => {\n\tconst { actions } = notification;\n\tconst hasActions = actions && actions.length > 0;\n\n\treturn (\n\t\t<>\n\t\t\t{hasActions ? (\n\t\t\t\t<div className=\"actions-panel\">\n\t\t\t\t\t{actions?.map((action: IAction | IAction[], index: any) => renderActionButtons(notification, action, index))}\n\t\t\t\t</div>\n\t\t\t) : null}\n\t\t</>\n\t);\n};\n"]}
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { services } from "@finsemble/finsemble-core";
2
+ import { services } from "@finsemble/finsemble-api";
3
3
  declare type INotification = services.notification.types.INotification;
4
4
  export declare const NotificationCardBodyShell: React.FunctionComponent<{
5
5
  notification: INotification;
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationCardBodyShell.js","sourceRoot":"","sources":["../../../../../../src/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AAKpF,MAAM,CAAC,MAAM,yBAAyB,GAA6D,CAAC,EACnG,YAAY,EACZ,QAAQ,GACR,EAAE,EAAE;IACJ,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,YAAY,CAAC;IACvD,MAAM,UAAU,GAAG,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IAEjD,OAAO,CACN,6BAAK,SAAS,EAAE,2BAA2B,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;QACtE,QAAQ,CAAC,CAAC,CAAC,CACX,QAAQ,CACR,CAAC,CAAC,CAAC,CACH;YACC,oBAAC,+BAA+B,IAAC,WAAW,EAAE,WAAW,GAAI;YAC7D,6BAAK,SAAS,EAAC,8BAA8B,IAAE,OAAO,CAAO,CAC3D,CACH;QACD,oBAAC,2BAA2B,IAAC,YAAY,EAAE,YAAY,GAAI,CACtD,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React from \"react\";\nimport { NotificationCardBodyActions } from \"./NotificationCardBodyActions\";\nimport { NotificationCardBodyContentLogo } from \"./NotificationCardBodyContentLogo\";\nimport { services } from \"@finsemble/finsemble-core\";\n\ntype INotification = services.notification.types.INotification;\n\nexport const NotificationCardBodyShell: React.FunctionComponent<{ notification: INotification }> = ({\n\tnotification,\n\tchildren,\n}) => {\n\tconst { actions, details, contentLogo } = notification;\n\tconst hasActions = actions && actions.length > 0;\n\n\treturn (\n\t\t<div className={`notification-card__body ${hasActions ? \"actions\" : \"\"}`}>\n\t\t\t{children ? (\n\t\t\t\tchildren\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<NotificationCardBodyContentLogo contentLogo={contentLogo} />\n\t\t\t\t\t<div className=\"notification-card__body_text\">{details}</div>\n\t\t\t\t</>\n\t\t\t)}\n\t\t\t<NotificationCardBodyActions notification={notification} />\n\t\t</div>\n\t);\n};\n"]}
1
+ {"version":3,"file":"NotificationCardBodyShell.js","sourceRoot":"","sources":["../../../../../../src/components/notifications/components/shared/notificationCard/NotificationCardBodyShell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AAC5E,OAAO,EAAE,+BAA+B,EAAE,MAAM,mCAAmC,CAAC;AAKpF,MAAM,CAAC,MAAM,yBAAyB,GAA6D,CAAC,EACnG,YAAY,EACZ,QAAQ,GACR,EAAE,EAAE;IACJ,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,YAAY,CAAC;IACvD,MAAM,UAAU,GAAG,OAAO,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,CAAC;IAEjD,OAAO,CACN,6BAAK,SAAS,EAAE,2BAA2B,UAAU,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,EAAE;QACtE,QAAQ,CAAC,CAAC,CAAC,CACX,QAAQ,CACR,CAAC,CAAC,CAAC,CACH;YACC,oBAAC,+BAA+B,IAAC,WAAW,EAAE,WAAW,GAAI;YAC7D,6BAAK,SAAS,EAAC,8BAA8B,IAAE,OAAO,CAAO,CAC3D,CACH;QACD,oBAAC,2BAA2B,IAAC,YAAY,EAAE,YAAY,GAAI,CACtD,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React from \"react\";\nimport { NotificationCardBodyActions } from \"./NotificationCardBodyActions\";\nimport { NotificationCardBodyContentLogo } from \"./NotificationCardBodyContentLogo\";\nimport { services } from \"@finsemble/finsemble-api\";\n\ntype INotification = services.notification.types.INotification;\n\nexport const NotificationCardBodyShell: React.FunctionComponent<{ notification: INotification }> = ({\n\tnotification,\n\tchildren,\n}) => {\n\tconst { actions, details, contentLogo } = notification;\n\tconst hasActions = actions && actions.length > 0;\n\n\treturn (\n\t\t<div className={`notification-card__body ${hasActions ? \"actions\" : \"\"}`}>\n\t\t\t{children ? (\n\t\t\t\tchildren\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<NotificationCardBodyContentLogo contentLogo={contentLogo} />\n\t\t\t\t\t<div className=\"notification-card__body_text\">{details}</div>\n\t\t\t\t</>\n\t\t\t)}\n\t\t\t<NotificationCardBodyActions notification={notification} />\n\t\t</div>\n\t);\n};\n"]}
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { services } from "@finsemble/finsemble-core";
2
+ import { services } from "@finsemble/finsemble-api";
3
3
  declare type INotification = services.notification.types.INotification;
4
4
  export declare const NotificationCardHeaderControls: React.FunctionComponent<{
5
5
  notification: INotification;
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationCardHeaderControls.js","sourceRoot":"","sources":["../../../../../../src/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,YAAY,EAAE,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC9F,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAK/C,MAAM,CAAC,MAAM,8BAA8B,GAItC,CAAC,EAAE,YAAY,EAAE,kBAAkB,EAAE,SAAS,GAAG,QAAQ,EAAE,EAAE,EAAE;IACnE,MAAM,oBAAoB,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC;IAC9D,MAAM,EAAE,uBAAuB,EAAE,WAAW,EAAE,GAAG,oBAAoB,CAAC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iC;YAChD,oBAAC,UAAU,IAAC,QAAQ,EAAC,cAAc,EAAC,OAAO,EAAC,SAAS,EAAC,YAAY,EAAE,kBAAkB,IACpF,gBAAgB,CAAC,CAAC,CAAC,oBAAC,YAAY,IAAC,SAAS,EAAE,mBAAmB,IAAG,WAAW,CAAgB,CAAC,CAAC,CAAC,IAAI,CACzF,CACP;QACN,SAAS,IAAI,QAAQ,IAAI,CACzB,oBAAC,UAAU,IACV,QAAQ,EAAC,UAAU,EACnB,UAAU,EAAE,qCAAqC,EACjD,OAAO,EAAC,SAAS,EACjB,YAAY,EAAE,kBAAkB,GAC/B,CACF;QACA,SAAS,IAAI,QAAQ,IAAI,8BAAM,SAAS,EAAC,6BAA6B,IAAE,IAAI,CAAQ,CAChF,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useContext, useEffect, useState } from \"react\";\nimport IconButton from \"../IconButton\";\nimport OverflowMenu, { OverflowMenuActions, renderOverflowMenuAction } from \"../OverflowMenu\";\nimport { NotificationsContext } from \"../../../notificationsContext\";\nimport { formatDistanceToNow } from \"date-fns\";\nimport { services } from \"@finsemble/finsemble-core\";\n\ntype INotification = services.notification.types.INotification;\n\nexport const NotificationCardHeaderControls: React.FunctionComponent<{\n\tnotification: INotification;\n\tuiContext?: string;\n\tremoveNotification?: Function;\n}> = ({ notification, removeNotification, uiContext = \"center\" }) => {\n\tconst notificationsContext = useContext(NotificationsContext);\n\tconst { setSelectedNotification, muteFilters } = notificationsContext;\n\n\tconst [overflowMenuOpen, setOverflowMenuOpen] = useState(false);\n\tconst [isMuteFilterApplied, setIsMuteFilterApplied] = useState(\n\t\tmuteFilters\n\t\t\t? muteFilters.some((filter) => filter.source === notification.source && filter.type === notification.type)\n\t\t\t: false\n\t);\n\n\tconst [time, setTime] = useState(\n\t\tformatDistanceToNow(new Date(notification.issuedAt), {\n\t\t\tincludeSeconds: true,\n\t\t})\n\t);\n\n\tuseEffect(() => {\n\t\tconst id = setInterval(() => {\n\t\t\tsetTime(\n\t\t\t\tformatDistanceToNow(new Date(notification.issuedAt), {\n\t\t\t\t\tincludeSeconds: true,\n\t\t\t\t})\n\t\t\t);\n\t\t}, 60000);\n\t\treturn () => clearInterval(id);\n\t});\n\n\tconst toggleOverflowMenu = () => {\n\t\tsetOverflowMenuOpen(!overflowMenuOpen);\n\t};\n\n\tconst overFlowActions = Object.assign({}, OverflowMenuActions);\n\tlet optionsToggleClassName = \"notification-card__more-options__toggle\";\n\n\tif (uiContext === \"center\") {\n\t\tdelete overFlowActions.DISMISS;\n\t\toverFlowActions.DETAILS.action = (overflowNotification: INotification) => {\n\t\t\tsetSelectedNotification(overflowNotification);\n\t\t};\n\t} else {\n\t\toptionsToggleClassName = \"notification-card__more-options__no-toggle\";\n\t\tdelete overFlowActions.MARK_AS_READ;\n\t\tdelete overFlowActions.MARK_AS_UNREAD;\n\t\tdelete overFlowActions.DETAILS;\n\t\tdelete overFlowActions.DISMISS;\n\t}\n\n\tuseEffect(() => {\n\t\tfunction listenMuteStateChanged(error: any, response: any) {\n\t\t\tif (error) {\n\t\t\t\tconsole.error(\"FinsembleNotificationsMuteStateChannel: \", error);\n\t\t\t} else {\n\t\t\t\tconst { data } = response;\n\t\t\t\tif (notification.source === data.source && notification.type === data.type) {\n\t\t\t\t\tsetIsMuteFilterApplied(data.isMuted);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tFSBL.Clients.RouterClient.addListener(\"FinsembleNotificationsMuteStateChannel\", listenMuteStateChanged);\n\t\treturn () => {\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"FinsembleNotificationsMuteStateChannel\", listenMuteStateChanged);\n\t\t};\n\t}, []);\n\n\tconst menuActions = Object.values(overFlowActions).map((value) =>\n\t\trenderOverflowMenuAction(notification, value, isMuteFilterApplied)\n\t);\n\n\treturn (\n\t\t<div className={optionsToggleClassName} onMouseLeave={() => setOverflowMenuOpen(false)}>\n\t\t\t<span className=\"notification-card_overflow_menu\">\n\t\t\t\t<IconButton iconName=\"ff-dots-vert\" tooltip=\"Options\" clickHandler={toggleOverflowMenu}>\n\t\t\t\t\t{overflowMenuOpen ? <OverflowMenu closeSelf={setOverflowMenuOpen}>{menuActions}</OverflowMenu> : null}\n\t\t\t\t</IconButton>\n\t\t\t</span>\n\t\t\t{uiContext == \"toasts\" && (\n\t\t\t\t<IconButton\n\t\t\t\t\ticonName=\"ff-close\"\n\t\t\t\t\tclassNames={\"notification-card__dismiss no-hover\"}\n\t\t\t\t\ttooltip=\"Dismiss\"\n\t\t\t\t\tclickHandler={removeNotification}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{uiContext == \"center\" && <span className=\"notification-card_timestamp\">{time}</span>}\n\t\t</div>\n\t);\n};\n"]}
1
+ {"version":3,"file":"NotificationCardHeaderControls.js","sourceRoot":"","sources":["../../../../../../src/components/notifications/components/shared/notificationCard/NotificationCardHeaderControls.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,UAAU,MAAM,eAAe,CAAC;AACvC,OAAO,YAAY,EAAE,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAC9F,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,mBAAmB,EAAE,MAAM,UAAU,CAAC;AAK/C,MAAM,CAAC,MAAM,8BAA8B,GAItC,CAAC,EAAE,YAAY,EAAE,kBAAkB,EAAE,SAAS,GAAG,QAAQ,EAAE,EAAE,EAAE;IACnE,MAAM,oBAAoB,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC;IAC9D,MAAM,EAAE,uBAAuB,EAAE,WAAW,EAAE,GAAG,oBAAoB,CAAC;IAEtE,MAAM,CAAC,gBAAgB,EAAE,mBAAmB,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAChE,MAAM,CAAC,mBAAmB,EAAE,sBA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C,CAAC,oBAAC,YAAY,IAAC,SAAS,EAAE,mBAAmB,IAAG,WAAW,CAAgB,CAAC,CAAC,CAAC,IAAI,CACzF,CACP;QACN,SAAS,IAAI,QAAQ,IAAI,CACzB,oBAAC,UAAU,IACV,QAAQ,EAAC,UAAU,EACnB,UAAU,EAAE,qCAAqC,EACjD,OAAO,EAAC,SAAS,EACjB,YAAY,EAAE,kBAAkB,GAC/B,CACF;QACA,SAAS,IAAI,QAAQ,IAAI,8BAAM,SAAS,EAAC,6BAA6B,IAAE,IAAI,CAAQ,CAChF,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useContext, useEffect, useState } from \"react\";\nimport IconButton from \"../IconButton\";\nimport OverflowMenu, { OverflowMenuActions, renderOverflowMenuAction } from \"../OverflowMenu\";\nimport { NotificationsContext } from \"../../../notificationsContext\";\nimport { formatDistanceToNow } from \"date-fns\";\nimport { services } from \"@finsemble/finsemble-api\";\n\ntype INotification = services.notification.types.INotification;\n\nexport const NotificationCardHeaderControls: React.FunctionComponent<{\n\tnotification: INotification;\n\tuiContext?: string;\n\tremoveNotification?: Function;\n}> = ({ notification, removeNotification, uiContext = \"center\" }) => {\n\tconst notificationsContext = useContext(NotificationsContext);\n\tconst { setSelectedNotification, muteFilters } = notificationsContext;\n\n\tconst [overflowMenuOpen, setOverflowMenuOpen] = useState(false);\n\tconst [isMuteFilterApplied, setIsMuteFilterApplied] = useState(\n\t\tmuteFilters\n\t\t\t? muteFilters.some((filter) => filter.source === notification.source && filter.type === notification.type)\n\t\t\t: false\n\t);\n\n\tconst [time, setTime] = useState(\n\t\tformatDistanceToNow(new Date(notification.issuedAt), {\n\t\t\tincludeSeconds: true,\n\t\t})\n\t);\n\n\tuseEffect(() => {\n\t\tconst id = setInterval(() => {\n\t\t\tsetTime(\n\t\t\t\tformatDistanceToNow(new Date(notification.issuedAt), {\n\t\t\t\t\tincludeSeconds: true,\n\t\t\t\t})\n\t\t\t);\n\t\t}, 60000);\n\t\treturn () => clearInterval(id);\n\t});\n\n\tconst toggleOverflowMenu = () => {\n\t\tsetOverflowMenuOpen(!overflowMenuOpen);\n\t};\n\n\tconst overFlowActions = Object.assign({}, OverflowMenuActions);\n\tlet optionsToggleClassName = \"notification-card__more-options__toggle\";\n\n\tif (uiContext === \"center\") {\n\t\tdelete overFlowActions.DISMISS;\n\t\toverFlowActions.DETAILS.action = (overflowNotification: INotification) => {\n\t\t\tsetSelectedNotification(overflowNotification);\n\t\t};\n\t} else {\n\t\toptionsToggleClassName = \"notification-card__more-options__no-toggle\";\n\t\tdelete overFlowActions.MARK_AS_READ;\n\t\tdelete overFlowActions.MARK_AS_UNREAD;\n\t\tdelete overFlowActions.DETAILS;\n\t\tdelete overFlowActions.DISMISS;\n\t}\n\n\tuseEffect(() => {\n\t\tfunction listenMuteStateChanged(error: any, response: any) {\n\t\t\tif (error) {\n\t\t\t\tconsole.error(\"FinsembleNotificationsMuteStateChannel: \", error);\n\t\t\t} else {\n\t\t\t\tconst { data } = response;\n\t\t\t\tif (notification.source === data.source && notification.type === data.type) {\n\t\t\t\t\tsetIsMuteFilterApplied(data.isMuted);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tFSBL.Clients.RouterClient.addListener(\"FinsembleNotificationsMuteStateChannel\", listenMuteStateChanged);\n\t\treturn () => {\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"FinsembleNotificationsMuteStateChannel\", listenMuteStateChanged);\n\t\t};\n\t}, []);\n\n\tconst menuActions = Object.values(overFlowActions).map((value) =>\n\t\trenderOverflowMenuAction(notification, value, isMuteFilterApplied)\n\t);\n\n\treturn (\n\t\t<div className={optionsToggleClassName} onMouseLeave={() => setOverflowMenuOpen(false)}>\n\t\t\t<span className=\"notification-card_overflow_menu\">\n\t\t\t\t<IconButton iconName=\"ff-dots-vert\" tooltip=\"Options\" clickHandler={toggleOverflowMenu}>\n\t\t\t\t\t{overflowMenuOpen ? <OverflowMenu closeSelf={setOverflowMenuOpen}>{menuActions}</OverflowMenu> : null}\n\t\t\t\t</IconButton>\n\t\t\t</span>\n\t\t\t{uiContext == \"toasts\" && (\n\t\t\t\t<IconButton\n\t\t\t\t\ticonName=\"ff-close\"\n\t\t\t\t\tclassNames={\"notification-card__dismiss no-hover\"}\n\t\t\t\t\ttooltip=\"Dismiss\"\n\t\t\t\t\tclickHandler={removeNotification}\n\t\t\t\t/>\n\t\t\t)}\n\t\t\t{uiContext == \"center\" && <span className=\"notification-card_timestamp\">{time}</span>}\n\t\t</div>\n\t);\n};\n"]}
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { services } from "@finsemble/finsemble-core";
2
+ import { services } from "@finsemble/finsemble-api";
3
3
  declare type INotification = services.notification.types.INotification;
4
4
  export declare const NotificationCardHeaderShell: React.FunctionComponent<{
5
5
  notification: INotification;
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationCardHeaderShell.js","sourceRoot":"","sources":["../../../../../../src/components/notifications/components/shared/notificationCard/NotificationCardHeaderShell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAK7C,MAAM,CAAC,MAAM,2BAA2B,GAInC,CAAC,EAAE,YAAY,EAAE,kBAAkB,EAAE,SAAS,GAAG,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC7E,MAAM,oBAAoB,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC;IAC9D,MAAM,EAAE,aAAa,EAAE,GAAG,oBAAoB,CAAC;IAE/C,OAAO,CACN,6BAAK,SAAS,EAAC,2BAA2B;QACxC,QAAQ,CAAC,CAAC,CAAC,CACX;YACE,aAAa,KAAK,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,oBAAC,WAAW,IAAC,YAAY,EAAE,YAAY,GAAI,CAAC,CAAC,CAAC,yCAAK;YAC/F,QAAQ,CACP,CACH,CAAC,CAAC,CAAC,CACH;YACE,aAAa,KAAK,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,CAC5C,oBAAC,WAAW,IAAC,YAAY,EAAE,YAAY,GAAI,CAC3C,CAAC,CAAC,CAAC,CACH,oBAAC,0BAA0B,IAAC,UAAU,EAAE,YAAY,CAAC,UAAU,GAAI,CACnE;YACD,6BAAK,SAAS,EAAC,0BAA0B,IAAE,YAAY,CAAC,KAAK,CAAO,CAClE,CACH;QACD,oBAAC,8BAA8B,IAC9B,YAAY,EAAE,YAAY,EAC1B,kBAAkB,EAAE,kBAAkB,EACtC,SAAS,EAAE,SAAS,GACnB,CACG,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useContext } from \"react\";\nimport { NotificationCardHeaderControls } from \"./NotificationCardHeaderControls\";\nimport { NotificationCardHeaderLogo } from \"./NotificationCardHeaderLogo\";\nimport { NotificationsContext } from \"../../../notificationsContext\";\nimport { SelectionMode } from \"../../../constants\";\nimport { CheckButton } from \"../CheckButton\";\nimport { services } from \"@finsemble/finsemble-core\";\n\ntype INotification = services.notification.types.INotification;\n\nexport const NotificationCardHeaderShell: React.FunctionComponent<{\n\tnotification: INotification;\n\tuiContext: string;\n\tremoveNotification: Function;\n}> = ({ notification, removeNotification, uiContext = \"center\", children }) => {\n\tconst notificationsContext = useContext(NotificationsContext);\n\tconst { selectionMode } = notificationsContext;\n\n\treturn (\n\t\t<div className=\"notification-card__header\">\n\t\t\t{children ? (\n\t\t\t\t<>\n\t\t\t\t\t{selectionMode === SelectionMode.SELECTION ? <CheckButton notification={notification} /> : <></>}\n\t\t\t\t\t{children}\n\t\t\t\t</>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t{selectionMode === SelectionMode.SELECTION ? (\n\t\t\t\t\t\t<CheckButton notification={notification} />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<NotificationCardHeaderLogo headerLogo={notification.headerLogo} />\n\t\t\t\t\t)}\n\t\t\t\t\t<div className=\"notification-card__title\">{notification.title}</div>\n\t\t\t\t</>\n\t\t\t)}\n\t\t\t<NotificationCardHeaderControls\n\t\t\t\tnotification={notification}\n\t\t\t\tremoveNotification={removeNotification}\n\t\t\t\tuiContext={uiContext}\n\t\t\t/>\n\t\t</div>\n\t);\n};\n"]}
1
+ {"version":3,"file":"NotificationCardHeaderShell.js","sourceRoot":"","sources":["../../../../../../src/components/notifications/components/shared/notificationCard/NotificationCardHeaderShell.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAK7C,MAAM,CAAC,MAAM,2BAA2B,GAInC,CAAC,EAAE,YAAY,EAAE,kBAAkB,EAAE,SAAS,GAAG,QAAQ,EAAE,QAAQ,EAAE,EAAE,EAAE;IAC7E,MAAM,oBAAoB,GAAG,UAAU,CAAC,oBAAoB,CAAC,CAAC;IAC9D,MAAM,EAAE,aAAa,EAAE,GAAG,oBAAoB,CAAC;IAE/C,OAAO,CACN,6BAAK,SAAS,EAAC,2BAA2B;QACxC,QAAQ,CAAC,CAAC,CAAC,CACX;YACE,aAAa,KAAK,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,oBAAC,WAAW,IAAC,YAAY,EAAE,YAAY,GAAI,CAAC,CAAC,CAAC,yCAAK;YAC/F,QAAQ,CACP,CACH,CAAC,CAAC,CAAC,CACH;YACE,aAAa,KAAK,aAAa,CAAC,SAAS,CAAC,CAAC,CAAC,CAC5C,oBAAC,WAAW,IAAC,YAAY,EAAE,YAAY,GAAI,CAC3C,CAAC,CAAC,CAAC,CACH,oBAAC,0BAA0B,IAAC,UAAU,EAAE,YAAY,CAAC,UAAU,GAAI,CACnE;YACD,6BAAK,SAAS,EAAC,0BAA0B,IAAE,YAAY,CAAC,KAAK,CAAO,CAClE,CACH;QACD,oBAAC,8BAA8B,IAC9B,YAAY,EAAE,YAAY,EAC1B,kBAAkB,EAAE,kBAAkB,EACtC,SAAS,EAAE,SAAS,GACnB,CACG,CACN,CAAC;AACH,CAAC,CAAC","sourcesContent":["import React, { useContext } from \"react\";\nimport { NotificationCardHeaderControls } from \"./NotificationCardHeaderControls\";\nimport { NotificationCardHeaderLogo } from \"./NotificationCardHeaderLogo\";\nimport { NotificationsContext } from \"../../../notificationsContext\";\nimport { SelectionMode } from \"../../../constants\";\nimport { CheckButton } from \"../CheckButton\";\nimport { services } from \"@finsemble/finsemble-api\";\n\ntype INotification = services.notification.types.INotification;\n\nexport const NotificationCardHeaderShell: React.FunctionComponent<{\n\tnotification: INotification;\n\tuiContext: string;\n\tremoveNotification: Function;\n}> = ({ notification, removeNotification, uiContext = \"center\", children }) => {\n\tconst notificationsContext = useContext(NotificationsContext);\n\tconst { selectionMode } = notificationsContext;\n\n\treturn (\n\t\t<div className=\"notification-card__header\">\n\t\t\t{children ? (\n\t\t\t\t<>\n\t\t\t\t\t{selectionMode === SelectionMode.SELECTION ? <CheckButton notification={notification} /> : <></>}\n\t\t\t\t\t{children}\n\t\t\t\t</>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t{selectionMode === SelectionMode.SELECTION ? (\n\t\t\t\t\t\t<CheckButton notification={notification} />\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<NotificationCardHeaderLogo headerLogo={notification.headerLogo} />\n\t\t\t\t\t)}\n\t\t\t\t\t<div className=\"notification-card__title\">{notification.title}</div>\n\t\t\t\t</>\n\t\t\t)}\n\t\t\t<NotificationCardHeaderControls\n\t\t\t\tnotification={notification}\n\t\t\t\tremoveNotification={removeNotification}\n\t\t\t\tuiContext={uiContext}\n\t\t\t/>\n\t\t</div>\n\t);\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"CardView.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/views/CardView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAM5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAGlE,OAAO,EAAE,qBAAqB,EAAE,MAAM,iCAAiC,CAAC;AACxE,OAAO,eAAe,MAAM,oBAAoB,CAAC;AAGjD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAMnE,IAAK,OAKJ;AALD,WAAK,OAAO;IACX,0BAAe,CAAA;IACf,iCAAsB,CAAA;IACtB,kCAAuB,CAAA;IACvB,0BAAe,CAAA;AAChB,CAAC,EALI,OAAO,KAAP,OAAO,QAKX;AAED,MAAM,OAAO,GAAG,CAAC,qBAAuD,EAAE,gBAAyB,EAAE,EAAE;IACtG,IAAI,gBAAgB,EAAE;QACrB,OAAO,MAAM,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,KAAK,CAAC,CAAC,KAAsB,EAAE,EAAE,CAAC,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC;KAClG;SAAM;QACN,OAAO,MAAM,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,KAAK,CAChD,CAAC,KAAsB,EAAE,EAAE,CAC1B,KAAK,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,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Y,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;SAChH,GAAG,CAAC,CAAC,YAAY,EAAE,KAAK,EAAE,EAAE;QAC5B,MAAM,EAAE,GAAG,YAAY,CAAC,EAAE,IAAI,KAAK,CAAC,QAAQ,EAAE,CAAC;QAC/C,OAAO,CACN,6BAAK,GAAG,EAAE,EAAE;YACV,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI;YAClD,oBAAC,yBAAyB,IAAC,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,GAAG,EAAE,GAAE,CAAC,EAAE,SAAS,EAAE,QAAQ,GAAI;YAC5G,6BAAK,SAAS,EAAC,SAAS,aAAa,CAChC,CACN,CAAC;IACH,CAAC,CAAC,CAAC;IAEL,OAAO,OAAO,CAAC,qBAAqB,EAAE,YAAY,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAC1E,oBAAC,eAAe,OAAG,CACnB,CAAC,CAAC,CAAC,CACH,0CAAG,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,wBAAwB,CAAC,MAAiB,CAAC,CAAC,CAAI,CACtG,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import React, { useContext, useEffect } from \"react\";\nimport { isToday, isYesterday, isThisWeek } from \"date-fns\";\n\n// Types\nimport { NotificationCardViewProps } from \"../../types\";\n\n// Context\nimport { NotificationsContext } from \"../../notificationsContext\";\n\n// Components\nimport { NotificationCardShell } from \"../shared/NotificationCardShell\";\nimport NoNotifications from \"../NoNotifications\";\n\n// Utils\nimport { getActiveFilter, searchNotifications } from \"../../utils\";\n\nimport { services } from \"@finsemble/finsemble-core\";\n\ntype INotification = services.notification.types.INotification;\n\nenum Periods {\n\tTODAY = \"today\",\n\tTHIS_WEEK = \"thisWeek\",\n\tYESTERDAY = \"yesterday\",\n\tOLDER = \"older\",\n}\n\nconst isEmpty = (byPeriodNotifications: Record<Periods, INotification[]>, accountForSnooze: boolean) => {\n\tif (accountForSnooze) {\n\t\treturn Object.values(byPeriodNotifications).every((value: INotification[]) => value.length === 0);\n\t} else {\n\t\treturn Object.values(byPeriodNotifications).every(\n\t\t\t(value: INotification[]) =>\n\t\t\t\tvalue.length === 0 || value.filter((notification: INotification) => !notification.isSnoozed).length === 0\n\t\t);\n\t}\n};\n\nexport const CardView: React.FunctionComponent<NotificationCardViewProps> = (props: NotificationCardViewProps) => {\n\tconst { notifications } = props;\n\n\tconst notificationsContext = useContext(NotificationsContext);\n\tconst { drawerControlProps, searchString, filteredNotifications, setFilteredNotifications } = notificationsContext;\n\tconst activeFilter = getActiveFilter(drawerControlProps);\n\n\tconst byPeriodNotifications: Record<Periods, INotification[]> = {\n\t\ttoday: [],\n\t\tyesterday: [],\n\t\tthisWeek: [],\n\t\tolder: [],\n\t};\n\n\tuseEffect(() => {\n\t\tif (searchString === \"\") {\n\t\t\tsetFilteredNotifications(notifications);\n\t\t} else {\n\t\t\tsetFilteredNotifications(searchNotifications(notifications, searchString));\n\t\t}\n\t}, [searchString, notifications]);\n\n\tconst controlFilteredNotifications = activeFilter ? activeFilter.run?.(filteredNotifications) : [];\n\n\tcontrolFilteredNotifications.reduce((accumulator: any, notification: INotification) => {\n\t\tconst notificationDate: number = Date.parse(notification.issuedAt);\n\t\tif (isToday(notificationDate)) {\n\t\t\taccumulator.today.push(notification);\n\t\t} else if (isYesterday(notificationDate)) {\n\t\t\taccumulator.yesterday.push(notification);\n\t\t} else if (isThisWeek(notificationDate)) {\n\t\t\taccumulator.thisWeek.push(notification);\n\t\t} else {\n\t\t\taccumulator.older.push(notification);\n\t\t}\n\t\treturn accumulator;\n\t}, byPeriodNotifications);\n\n\tconst NotificationCardComponent = props.notificationCard ? props.notificationCard : NotificationCardShell;\n\n\tconst renderSeparatorLabel = (period: string) => {\n\t\tif (period === Periods.TODAY) {\n\t\t\treturn <p className=\"notification-day\">Today</p>;\n\t\t} else if (period === Periods.YESTERDAY) {\n\t\t\treturn <p className=\"notification-day\">Yesterday</p>;\n\t\t} else if (period === Periods.THIS_WEEK) {\n\t\t\treturn <p className=\"notification-day\">This Week</p>;\n\t\t} else {\n\t\t\treturn <p className=\"notification-day\">Older</p>;\n\t\t}\n\t};\n\n\tconst renderNotificationsBlock = (period: Periods) =>\n\t\tbyPeriodNotifications[period]\n\t\t\t.sort((a: INotification, b: INotification) => Date.parse(b.issuedAt) - Date.parse(a.issuedAt))\n\t\t\t.filter((notification) => (activeFilter.action === \"snoozed\" ? notification.isSnoozed : !notification.isSnoozed))\n\t\t\t.map((notification, index) => {\n\t\t\t\tconst id = notification.id || index.toString();\n\t\t\t\treturn (\n\t\t\t\t\t<div key={id}>\n\t\t\t\t\t\t{index === 0 ? renderSeparatorLabel(period) : null}\n\t\t\t\t\t\t<NotificationCardComponent notification={notification} removeNotification={() => {}} uiContext={\"center\"} />\n\t\t\t\t\t\t<div className=\"divider\">&nbsp;</div>\n\t\t\t\t\t</div>\n\t\t\t\t);\n\t\t\t});\n\n\treturn isEmpty(byPeriodNotifications, activeFilter.action === \"snoozed\") ? (\n\t\t<NoNotifications />\n\t) : (\n\t\t<>{Object.keys(byPeriodNotifications).map((period) => renderNotificationsBlock(period as Periods))}</>\n\t);\n};\n\nexport default CardView;\n"]}
1
+ {"version":3,"file":"CardView.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/views/CardView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAM5D,OAAO,EAAE,oBAAoB,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AAC,EAAE,SAAS,EAAE,QAAQ,GAAI;YAC5G,6BAAK,SAAS,EAAC,SAAS,aAAa,CAChC,CACN,CAAC;IACH,CAAC,CAAC,CAAC;IAEL,OAAO,OAAO,CAAC,qBAAqB,EAAE,YAAY,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,CAAC,CAC1E,oBAAC,eAAe,OAAG,CACnB,CAAC,CAAC,CAAC,CACH,0CAAG,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,wBAAwB,CAAC,MAAiB,CAAC,CAAC,CAAI,CACtG,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import React, { useContext, useEffect } from \"react\";\nimport { isToday, isYesterday, isThisWeek } from \"date-fns\";\n\n// Types\nimport { NotificationCardViewProps } from \"../../types\";\n\n// Context\nimport { NotificationsContext } from \"../../notificationsContext\";\n\n// Components\nimport { NotificationCardShell } from \"../shared/NotificationCardShell\";\nimport NoNotifications from \"../NoNotifications\";\n\n// Utils\nimport { getActiveFilter, searchNotifications } from \"../../utils\";\n\nimport { services } from \"@finsemble/finsemble-api\";\n\ntype INotification = services.notification.types.INotification;\n\nenum Periods {\n\tTODAY = \"today\",\n\tTHIS_WEEK = \"thisWeek\",\n\tYESTERDAY = \"yesterday\",\n\tOLDER = \"older\",\n}\n\nconst isEmpty = (byPeriodNotifications: Record<Periods, INotification[]>, accountForSnooze: boolean) => {\n\tif (accountForSnooze) {\n\t\treturn Object.values(byPeriodNotifications).every((value: INotification[]) => value.length === 0);\n\t} else {\n\t\treturn Object.values(byPeriodNotifications).every(\n\t\t\t(value: INotification[]) =>\n\t\t\t\tvalue.length === 0 || value.filter((notification: INotification) => !notification.isSnoozed).length === 0\n\t\t);\n\t}\n};\n\nexport const CardView: React.FunctionComponent<NotificationCardViewProps> = (props: NotificationCardViewProps) => {\n\tconst { notifications } = props;\n\n\tconst notificationsContext = useContext(NotificationsContext);\n\tconst { drawerControlProps, searchString, filteredNotifications, setFilteredNotifications } = notificationsContext;\n\tconst activeFilter = getActiveFilter(drawerControlProps);\n\n\tconst byPeriodNotifications: Record<Periods, INotification[]> = {\n\t\ttoday: [],\n\t\tyesterday: [],\n\t\tthisWeek: [],\n\t\tolder: [],\n\t};\n\n\tuseEffect(() => {\n\t\tif (searchString === \"\") {\n\t\t\tsetFilteredNotifications(notifications);\n\t\t} else {\n\t\t\tsetFilteredNotifications(searchNotifications(notifications, searchString));\n\t\t}\n\t}, [searchString, notifications]);\n\n\tconst controlFilteredNotifications = activeFilter ? activeFilter.run?.(filteredNotifications) : [];\n\n\tcontrolFilteredNotifications.reduce((accumulator: any, notification: INotification) => {\n\t\tconst notificationDate: number = Date.parse(notification.issuedAt);\n\t\tif (isToday(notificationDate)) {\n\t\t\taccumulator.today.push(notification);\n\t\t} else if (isYesterday(notificationDate)) {\n\t\t\taccumulator.yesterday.push(notification);\n\t\t} else if (isThisWeek(notificationDate)) {\n\t\t\taccumulator.thisWeek.push(notification);\n\t\t} else {\n\t\t\taccumulator.older.push(notification);\n\t\t}\n\t\treturn accumulator;\n\t}, byPeriodNotifications);\n\n\tconst NotificationCardComponent = props.notificationCard ? props.notificationCard : NotificationCardShell;\n\n\tconst renderSeparatorLabel = (period: string) => {\n\t\tif (period === Periods.TODAY) {\n\t\t\treturn <p className=\"notification-day\">Today</p>;\n\t\t} else if (period === Periods.YESTERDAY) {\n\t\t\treturn <p className=\"notification-day\">Yesterday</p>;\n\t\t} else if (period === Periods.THIS_WEEK) {\n\t\t\treturn <p className=\"notification-day\">This Week</p>;\n\t\t} else {\n\t\t\treturn <p className=\"notification-day\">Older</p>;\n\t\t}\n\t};\n\n\tconst renderNotificationsBlock = (period: Periods) =>\n\t\tbyPeriodNotifications[period]\n\t\t\t.sort((a: INotification, b: INotification) => Date.parse(b.issuedAt) - Date.parse(a.issuedAt))\n\t\t\t.filter((notification) => (activeFilter.action === \"snoozed\" ? notification.isSnoozed : !notification.isSnoozed))\n\t\t\t.map((notification, index) => {\n\t\t\t\tconst id = notification.id || index.toString();\n\t\t\t\treturn (\n\t\t\t\t\t<div key={id}>\n\t\t\t\t\t\t{index === 0 ? renderSeparatorLabel(period) : null}\n\t\t\t\t\t\t<NotificationCardComponent notification={notification} removeNotification={() => {}} uiContext={\"center\"} />\n\t\t\t\t\t\t<div className=\"divider\">&nbsp;</div>\n\t\t\t\t\t</div>\n\t\t\t\t);\n\t\t\t});\n\n\treturn isEmpty(byPeriodNotifications, activeFilter.action === \"snoozed\") ? (\n\t\t<NoNotifications />\n\t) : (\n\t\t<>{Object.keys(byPeriodNotifications).map((period) => renderNotificationsBlock(period as Periods))}</>\n\t);\n};\n\nexport default CardView;\n"]}
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { NotificationListViewProps } from "../../types";
3
- import { services } from "@finsemble/finsemble-core";
3
+ import { services } from "@finsemble/finsemble-api";
4
4
  declare type INotification = services.notification.types.INotification;
5
5
  export declare type NotificationListRowPropType = {
6
6
  notification: INotification;
@@ -1 +1 @@
1
- {"version":3,"file":"ListView.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/views/ListView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,wBAAwB,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAMlF,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAGlE,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAC9C,OAAO,eAAe,MAAM,oBAAoB,CAAC;AACjD,OAAO,YAAY,EAAE,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AACrG,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAGpD,OAAO,EACN,eAAe,EACf,mBA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,CACF,CAAC;QACH,CAAC,CAAC,CACA,CACH,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import React, { useContext, useState, useEffect } from \"react\";\nimport { format, differenceInMilliseconds, parseISO, addSeconds } from \"date-fns\";\n\n// types\nimport { NotificationListViewProps } from \"../../types\";\n\n// Context\nimport { NotificationsContext } from \"../../notificationsContext\";\n\n// Components\nimport IconButton from \"../shared/IconButton\";\nimport NoNotifications from \"../NoNotifications\";\nimport OverflowMenu, { OverflowMenuActions, renderOverflowMenuAction } from \"../shared/OverflowMenu\";\nimport { CheckButton } from \"../shared/CheckButton\";\n\n// Utils\nimport {\n\tgetActiveFilter,\n\tgetMostRecentAction,\n\tisNewNotification,\n\tisReNotification,\n\tsearchNotifications,\n} from \"../../utils\";\n\nimport { NotificationCardHeaderLogo } from \"../shared/notificationCard/NotificationCardHeaderLogo\";\n\n// Constants\nimport { SelectionMode } from \"../../constants\";\nimport { services } from \"@finsemble/finsemble-core\";\n\ntype INotification = services.notification.types.INotification;\ntype IPerformedAction = services.notification.types.IPerformedAction;\n\nconst ListHeaderComponent = () => (\n\t<div className=\"list-header__container\">\n\t\t<div className=\"list-header_cell\">Received</div>\n\t\t<div className=\"list-header_cell\">App</div>\n\t\t<div className=\"list-header_cell\">Content</div>\n\t\t<div className=\"list-header_cell\">{\"\"}</div>\n\t</div>\n);\n\nexport type NotificationListRowPropType = {\n\tnotification: INotification;\n\tnewNotificationHaloPeriodSeconds: number;\n};\n\nexport const NotificationListRowShell: React.FunctionComponent<NotificationListRowPropType> = ({\n\tnotification,\n\tnewNotificationHaloPeriodSeconds,\n\tchildren,\n}: any) => {\n\tconst notificationsContext = useContext(NotificationsContext);\n\tconst { setSelectedNotification, muteFilters, selectionMode } = notificationsContext;\n\tconst [overflowMenuOpen, setOverflowMenuOpen] = useState(false);\n\tconst toggleOverflowMenu = () => {\n\t\tsetOverflowMenuOpen(!overflowMenuOpen);\n\t};\n\n\tconst [isNew, setIsNew] = useState(isNewNotification(notification, newNotificationHaloPeriodSeconds));\n\tconst [wokeFromSnooze, setWokeFromSnooze] = useState(\n\t\tisReNotification(notification, newNotificationHaloPeriodSeconds)\n\t);\n\tconst [isMuteFilterApplied, setIsMuteFilterApplied] = useState(\n\t\tmuteFilters\n\t\t\t? muteFilters.some((filter) => filter.source === notification.source && filter.type === notification.type)\n\t\t\t: false\n\t);\n\n\t// effect needed as the newNotificationHaloPeriodSeconds is fecthed asynchronously in the parent component\n\t// and sometimes at the first render, this value is still 0\n\tuseEffect(() => {\n\t\tsetIsNew(isNewNotification(notification, newNotificationHaloPeriodSeconds));\n\t}, [newNotificationHaloPeriodSeconds]);\n\n\tuseEffect(() => {\n\t\tlet isNewTimerId: any;\n\t\tif (isNew) {\n\t\t\tif (notification.isRead) {\n\t\t\t\tsetIsNew(false);\n\t\t\t\tclearTimeout(isNewTimerId);\n\t\t\t} else {\n\t\t\t\tisNewTimerId = setTimeout(() => {\n\t\t\t\t\tsetIsNew(false);\n\t\t\t\t}, differenceInMilliseconds(addSeconds(parseISO(notification.issuedAt), newNotificationHaloPeriodSeconds), Date.now()));\n\t\t\t}\n\t\t}\n\t\treturn () => {\n\t\t\tclearTimeout(isNewTimerId);\n\t\t};\n\t}, [isNew, notification]);\n\n\tuseEffect(() => {\n\t\tlet isRenotificationTimerId: any;\n\t\tif (isReNotification(notification, newNotificationHaloPeriodSeconds)) {\n\t\t\tconst mostRecentAction: IPerformedAction | null = getMostRecentAction(notification);\n\t\t\tif (mostRecentAction) {\n\t\t\t\tconst { datePerformed } = mostRecentAction;\n\t\t\t\tsetWokeFromSnooze(true);\n\t\t\t\tisRenotificationTimerId = setTimeout(() => {\n\t\t\t\t\tsetWokeFromSnooze(false);\n\t\t\t\t}, differenceInMilliseconds(addSeconds(parseISO(datePerformed), newNotificationHaloPeriodSeconds), Date.now()));\n\t\t\t}\n\t\t} else {\n\t\t\tsetWokeFromSnooze(false);\n\t\t\tclearTimeout(isRenotificationTimerId);\n\t\t}\n\t\treturn () => {\n\t\t\tclearTimeout(isRenotificationTimerId);\n\t\t};\n\t}, [newNotificationHaloPeriodSeconds, notification]);\n\n\tconst overFlowActions = Object.assign({}, OverflowMenuActions);\n\toverFlowActions.DETAILS.action = (detailNotification: INotification) => {\n\t\tsetSelectedNotification(detailNotification);\n\t};\n\n\tdelete overFlowActions.DISMISS;\n\n\tuseEffect(() => {\n\t\tfunction listenMuteStateChanged(error: any, response: any) {\n\t\t\tif (error) {\n\t\t\t\tconsole.error(\"FinsembleNotificationsMuteStateChannel: \", error);\n\t\t\t} else {\n\t\t\t\tconst { data } = response;\n\t\t\t\tif (notification.source === data.source && notification.type === data.type) {\n\t\t\t\t\tsetIsMuteFilterApplied(data.isMuted);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tFSBL.Clients.RouterClient.addListener(\"FinsembleNotificationsMuteStateChannel\", listenMuteStateChanged);\n\t\treturn () => {\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"FinsembleNotificationsMuteStateChannel\", listenMuteStateChanged);\n\t\t};\n\t}, []);\n\n\tconst menuActions = Object.values(overFlowActions).map((value) =>\n\t\trenderOverflowMenuAction(notification, value, isMuteFilterApplied)\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={`list-row__container notification-item ${notification.isRead ? \"is-read\" : \"\"} ${\n\t\t\t\tisNew || wokeFromSnooze ? \"new\" : \"\"\n\t\t\t}\n\t\t\t\t${notification.cssClassName ? notification.cssClassName : \"\"}`}\n\t\t>\n\t\t\t{children ? (\n\t\t\t\t<>\n\t\t\t\t\t{selectionMode === SelectionMode.SELECTION ? (\n\t\t\t\t\t\t<div className=\"list-row__cell\">\n\t\t\t\t\t\t\t<CheckButton notification={notification} />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<></>\n\t\t\t\t\t)}\n\t\t\t\t\t{children}\n\t\t\t\t</>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<div className=\"list-row__cell\">{format(Date.parse(notification.issuedAt), \"dd-MM-yyyy HH:mm\")}</div>\n\t\t\t\t\t<div className=\"list-row__cell\">\n\t\t\t\t\t\t{selectionMode === SelectionMode.SELECTION ? (\n\t\t\t\t\t\t\t<div className=\"list-row__cell\">\n\t\t\t\t\t\t\t\t<CheckButton notification={notification} />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<NotificationCardHeaderLogo headerLogo={notification.headerLogo} />\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"list-row__cell\">{`${notification.title} - ${notification.details}`}</div>\n\t\t\t\t</>\n\t\t\t)}\n\t\t\t<div className=\"list-row__cell\">\n\t\t\t\t<span>\n\t\t\t\t\t<IconButton iconName=\"ff-dots-vert\" tooltip=\"Options\" clickHandler={toggleOverflowMenu}>\n\t\t\t\t\t\t{overflowMenuOpen ? <OverflowMenu closeSelf={setOverflowMenuOpen}>{menuActions}</OverflowMenu> : null}\n\t\t\t\t\t</IconButton>\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nconst ListView: React.FunctionComponent<NotificationListViewProps> = ({\n\tnotificationHeaderRow,\n\tnotificationListRow,\n\tnotifications,\n}) => {\n\tconst notificationsContext = useContext(NotificationsContext);\n\t// The context will be used to filter the notifications\n\tconst { drawerControlProps, searchString, filteredNotifications, setFilteredNotifications } = notificationsContext;\n\n\tconst activeFilter = getActiveFilter(drawerControlProps);\n\n\tconst [newNotificationHaloPeriodSeconds, setNotificationHaloPeriodSeconds] = useState(0);\n\n\tconst NotificationHeaderRow = notificationHeaderRow || ListHeaderComponent;\n\tconst NotificationListRow = notificationListRow || NotificationListRowShell;\n\n\t// Sets the current default preference\n\tuseEffect(() => {\n\t\tasync function getNotificationsPreferences() {\n\t\t\treturn await FSBL.Clients.NotificationClient.getPreferences();\n\t\t}\n\n\t\tgetNotificationsPreferences().then((preferences: any) => {\n\t\t\tsetNotificationHaloPeriodSeconds(preferences.newNotificationHaloPeriodSeconds);\n\t\t});\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (searchString === \"\") {\n\t\t\tsetFilteredNotifications(notifications);\n\t\t} else {\n\t\t\tsetFilteredNotifications(searchNotifications(notifications, searchString));\n\t\t}\n\t}, [searchString, notifications]);\n\n\tlet controlFilteredNotifications = activeFilter ? activeFilter.run?.(filteredNotifications) : [];\n\tcontrolFilteredNotifications.sort(\n\t\t(a: INotification, b: INotification) => Date.parse(b.issuedAt) - Date.parse(a.issuedAt)\n\t);\n\n\tcontrolFilteredNotifications = controlFilteredNotifications.filter((notification: INotification) =>\n\t\tactiveFilter.action === \"snoozed\" ? notification.isSnoozed : !notification.isSnoozed\n\t);\n\n\treturn controlFilteredNotifications.length === 0 ? (\n\t\t<NoNotifications />\n\t) : (\n\t\t<>\n\t\t\t<NotificationHeaderRow />\n\t\t\t{controlFilteredNotifications.map((notification: INotification, index: number) => {\n\t\t\t\tconst key = `${index}_${notification.id ? notification.id : notification.issuedAt}`;\n\t\t\t\treturn (\n\t\t\t\t\t<NotificationListRow\n\t\t\t\t\t\tkey={key}\n\t\t\t\t\t\tnotification={notification}\n\t\t\t\t\t\tnewNotificationHaloPeriodSeconds={newNotificationHaloPeriodSeconds}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t})}\n\t\t</>\n\t);\n};\n\nexport default ListView;\n"]}
1
+ {"version":3,"file":"ListView.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/views/ListView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAC/D,OAAO,EAAE,MAAM,EAAE,wBAAwB,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAMlF,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAGlE,OAAO,UAAU,MAAM,sBAAsB,CAAC;AAC9C,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,CAAC,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC;YACpF,OAAO,CACN,oBAAC,mBAAmB,IACnB,GAAG,EAAE,GAAG,EACR,YAAY,EAAE,YAAY,EAC1B,gCAAgC,EAAE,gCAAgC,GACjE,CACF,CAAC;QACH,CAAC,CAAC,CACA,CACH,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,QAAQ,CAAC","sourcesContent":["import React, { useContext, useState, useEffect } from \"react\";\nimport { format, differenceInMilliseconds, parseISO, addSeconds } from \"date-fns\";\n\n// types\nimport { NotificationListViewProps } from \"../../types\";\n\n// Context\nimport { NotificationsContext } from \"../../notificationsContext\";\n\n// Components\nimport IconButton from \"../shared/IconButton\";\nimport NoNotifications from \"../NoNotifications\";\nimport OverflowMenu, { OverflowMenuActions, renderOverflowMenuAction } from \"../shared/OverflowMenu\";\nimport { CheckButton } from \"../shared/CheckButton\";\n\n// Utils\nimport {\n\tgetActiveFilter,\n\tgetMostRecentAction,\n\tisNewNotification,\n\tisReNotification,\n\tsearchNotifications,\n} from \"../../utils\";\n\nimport { NotificationCardHeaderLogo } from \"../shared/notificationCard/NotificationCardHeaderLogo\";\n\n// Constants\nimport { SelectionMode } from \"../../constants\";\nimport { services } from \"@finsemble/finsemble-api\";\n\ntype INotification = services.notification.types.INotification;\ntype IPerformedAction = services.notification.types.IPerformedAction;\n\nconst ListHeaderComponent = () => (\n\t<div className=\"list-header__container\">\n\t\t<div className=\"list-header_cell\">Received</div>\n\t\t<div className=\"list-header_cell\">App</div>\n\t\t<div className=\"list-header_cell\">Content</div>\n\t\t<div className=\"list-header_cell\">{\"\"}</div>\n\t</div>\n);\n\nexport type NotificationListRowPropType = {\n\tnotification: INotification;\n\tnewNotificationHaloPeriodSeconds: number;\n};\n\nexport const NotificationListRowShell: React.FunctionComponent<NotificationListRowPropType> = ({\n\tnotification,\n\tnewNotificationHaloPeriodSeconds,\n\tchildren,\n}: any) => {\n\tconst notificationsContext = useContext(NotificationsContext);\n\tconst { setSelectedNotification, muteFilters, selectionMode } = notificationsContext;\n\tconst [overflowMenuOpen, setOverflowMenuOpen] = useState(false);\n\tconst toggleOverflowMenu = () => {\n\t\tsetOverflowMenuOpen(!overflowMenuOpen);\n\t};\n\n\tconst [isNew, setIsNew] = useState(isNewNotification(notification, newNotificationHaloPeriodSeconds));\n\tconst [wokeFromSnooze, setWokeFromSnooze] = useState(\n\t\tisReNotification(notification, newNotificationHaloPeriodSeconds)\n\t);\n\tconst [isMuteFilterApplied, setIsMuteFilterApplied] = useState(\n\t\tmuteFilters\n\t\t\t? muteFilters.some((filter) => filter.source === notification.source && filter.type === notification.type)\n\t\t\t: false\n\t);\n\n\t// effect needed as the newNotificationHaloPeriodSeconds is fecthed asynchronously in the parent component\n\t// and sometimes at the first render, this value is still 0\n\tuseEffect(() => {\n\t\tsetIsNew(isNewNotification(notification, newNotificationHaloPeriodSeconds));\n\t}, [newNotificationHaloPeriodSeconds]);\n\n\tuseEffect(() => {\n\t\tlet isNewTimerId: any;\n\t\tif (isNew) {\n\t\t\tif (notification.isRead) {\n\t\t\t\tsetIsNew(false);\n\t\t\t\tclearTimeout(isNewTimerId);\n\t\t\t} else {\n\t\t\t\tisNewTimerId = setTimeout(() => {\n\t\t\t\t\tsetIsNew(false);\n\t\t\t\t}, differenceInMilliseconds(addSeconds(parseISO(notification.issuedAt), newNotificationHaloPeriodSeconds), Date.now()));\n\t\t\t}\n\t\t}\n\t\treturn () => {\n\t\t\tclearTimeout(isNewTimerId);\n\t\t};\n\t}, [isNew, notification]);\n\n\tuseEffect(() => {\n\t\tlet isRenotificationTimerId: any;\n\t\tif (isReNotification(notification, newNotificationHaloPeriodSeconds)) {\n\t\t\tconst mostRecentAction: IPerformedAction | null = getMostRecentAction(notification);\n\t\t\tif (mostRecentAction) {\n\t\t\t\tconst { datePerformed } = mostRecentAction;\n\t\t\t\tsetWokeFromSnooze(true);\n\t\t\t\tisRenotificationTimerId = setTimeout(() => {\n\t\t\t\t\tsetWokeFromSnooze(false);\n\t\t\t\t}, differenceInMilliseconds(addSeconds(parseISO(datePerformed), newNotificationHaloPeriodSeconds), Date.now()));\n\t\t\t}\n\t\t} else {\n\t\t\tsetWokeFromSnooze(false);\n\t\t\tclearTimeout(isRenotificationTimerId);\n\t\t}\n\t\treturn () => {\n\t\t\tclearTimeout(isRenotificationTimerId);\n\t\t};\n\t}, [newNotificationHaloPeriodSeconds, notification]);\n\n\tconst overFlowActions = Object.assign({}, OverflowMenuActions);\n\toverFlowActions.DETAILS.action = (detailNotification: INotification) => {\n\t\tsetSelectedNotification(detailNotification);\n\t};\n\n\tdelete overFlowActions.DISMISS;\n\n\tuseEffect(() => {\n\t\tfunction listenMuteStateChanged(error: any, response: any) {\n\t\t\tif (error) {\n\t\t\t\tconsole.error(\"FinsembleNotificationsMuteStateChannel: \", error);\n\t\t\t} else {\n\t\t\t\tconst { data } = response;\n\t\t\t\tif (notification.source === data.source && notification.type === data.type) {\n\t\t\t\t\tsetIsMuteFilterApplied(data.isMuted);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tFSBL.Clients.RouterClient.addListener(\"FinsembleNotificationsMuteStateChannel\", listenMuteStateChanged);\n\t\treturn () => {\n\t\t\tFSBL.Clients.RouterClient.removeListener(\"FinsembleNotificationsMuteStateChannel\", listenMuteStateChanged);\n\t\t};\n\t}, []);\n\n\tconst menuActions = Object.values(overFlowActions).map((value) =>\n\t\trenderOverflowMenuAction(notification, value, isMuteFilterApplied)\n\t);\n\n\treturn (\n\t\t<div\n\t\t\tclassName={`list-row__container notification-item ${notification.isRead ? \"is-read\" : \"\"} ${\n\t\t\t\tisNew || wokeFromSnooze ? \"new\" : \"\"\n\t\t\t}\n\t\t\t\t${notification.cssClassName ? notification.cssClassName : \"\"}`}\n\t\t>\n\t\t\t{children ? (\n\t\t\t\t<>\n\t\t\t\t\t{selectionMode === SelectionMode.SELECTION ? (\n\t\t\t\t\t\t<div className=\"list-row__cell\">\n\t\t\t\t\t\t\t<CheckButton notification={notification} />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<></>\n\t\t\t\t\t)}\n\t\t\t\t\t{children}\n\t\t\t\t</>\n\t\t\t) : (\n\t\t\t\t<>\n\t\t\t\t\t<div className=\"list-row__cell\">{format(Date.parse(notification.issuedAt), \"dd-MM-yyyy HH:mm\")}</div>\n\t\t\t\t\t<div className=\"list-row__cell\">\n\t\t\t\t\t\t{selectionMode === SelectionMode.SELECTION ? (\n\t\t\t\t\t\t\t<div className=\"list-row__cell\">\n\t\t\t\t\t\t\t\t<CheckButton notification={notification} />\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<NotificationCardHeaderLogo headerLogo={notification.headerLogo} />\n\t\t\t\t\t\t)}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"list-row__cell\">{`${notification.title} - ${notification.details}`}</div>\n\t\t\t\t</>\n\t\t\t)}\n\t\t\t<div className=\"list-row__cell\">\n\t\t\t\t<span>\n\t\t\t\t\t<IconButton iconName=\"ff-dots-vert\" tooltip=\"Options\" clickHandler={toggleOverflowMenu}>\n\t\t\t\t\t\t{overflowMenuOpen ? <OverflowMenu closeSelf={setOverflowMenuOpen}>{menuActions}</OverflowMenu> : null}\n\t\t\t\t\t</IconButton>\n\t\t\t\t</span>\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nconst ListView: React.FunctionComponent<NotificationListViewProps> = ({\n\tnotificationHeaderRow,\n\tnotificationListRow,\n\tnotifications,\n}) => {\n\tconst notificationsContext = useContext(NotificationsContext);\n\t// The context will be used to filter the notifications\n\tconst { drawerControlProps, searchString, filteredNotifications, setFilteredNotifications } = notificationsContext;\n\n\tconst activeFilter = getActiveFilter(drawerControlProps);\n\n\tconst [newNotificationHaloPeriodSeconds, setNotificationHaloPeriodSeconds] = useState(0);\n\n\tconst NotificationHeaderRow = notificationHeaderRow || ListHeaderComponent;\n\tconst NotificationListRow = notificationListRow || NotificationListRowShell;\n\n\t// Sets the current default preference\n\tuseEffect(() => {\n\t\tasync function getNotificationsPreferences() {\n\t\t\treturn await FSBL.Clients.NotificationClient.getPreferences();\n\t\t}\n\n\t\tgetNotificationsPreferences().then((preferences: any) => {\n\t\t\tsetNotificationHaloPeriodSeconds(preferences.newNotificationHaloPeriodSeconds);\n\t\t});\n\t}, []);\n\n\tuseEffect(() => {\n\t\tif (searchString === \"\") {\n\t\t\tsetFilteredNotifications(notifications);\n\t\t} else {\n\t\t\tsetFilteredNotifications(searchNotifications(notifications, searchString));\n\t\t}\n\t}, [searchString, notifications]);\n\n\tlet controlFilteredNotifications = activeFilter ? activeFilter.run?.(filteredNotifications) : [];\n\tcontrolFilteredNotifications.sort(\n\t\t(a: INotification, b: INotification) => Date.parse(b.issuedAt) - Date.parse(a.issuedAt)\n\t);\n\n\tcontrolFilteredNotifications = controlFilteredNotifications.filter((notification: INotification) =>\n\t\tactiveFilter.action === \"snoozed\" ? notification.isSnoozed : !notification.isSnoozed\n\t);\n\n\treturn controlFilteredNotifications.length === 0 ? (\n\t\t<NoNotifications />\n\t) : (\n\t\t<>\n\t\t\t<NotificationHeaderRow />\n\t\t\t{controlFilteredNotifications.map((notification: INotification, index: number) => {\n\t\t\t\tconst key = `${index}_${notification.id ? notification.id : notification.issuedAt}`;\n\t\t\t\treturn (\n\t\t\t\t\t<NotificationListRow\n\t\t\t\t\t\tkey={key}\n\t\t\t\t\t\tnotification={notification}\n\t\t\t\t\t\tnewNotificationHaloPeriodSeconds={newNotificationHaloPeriodSeconds}\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t})}\n\t\t</>\n\t);\n};\n\nexport default ListView;\n"]}
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { services } from "@finsemble/finsemble-core";
2
+ import { services } from "@finsemble/finsemble-api";
3
3
  declare type INotification = services.notification.types.INotification;
4
4
  declare const NotificationDetailsView: React.FunctionComponent<{
5
5
  notification: INotification | null;
@@ -1 +1 @@
1
- {"version":3,"file":"NotificationDetailsView.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/views/NotificationDetailsView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAMhD,MAAM,eAAe,GAAG,CAAC,UAAkB,EAAU,EAAE;IACtD,QAAQ,UAAU,EAAE;QACnB,KAAK,oBAAoB;YACxB,OAAO,uBAAuB,CAAC;QAEhC,KAAK,gBAAgB;YACpB,OAAO,6BAA6B,CAAC;QAEtC,KAAK,kBAAkB;YACtB,OAAO,+BAA+B,CAAC;QAExC,KAAK,QAAQ;YACZ,OAAO,SAAS,CAAC;QAElB,KAAK,gBAAgB;YACpB,OAAO,YAAY,CAAC;QAErB,KAAK,OAAO;YACX,OAAO,eAAe,CAAC;QAExB;YACC,OAAO,UAAU,CAAC;KACnB;AACF,CAAC,CAAC;AAEF,MAAM,eAAe,GAAG,CAAC,SAAiB,EAAE,UAAU,GAAG,kBAAkB,EAAE,EAAE,CAC9E,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAC;AAE3C,MAAM,wBAAwB,GAAG,CAAC,0BAA0D,EAAE,EAAE;IAC/F,IAAI,CAAC,0BAA0B,IAAI,0BAA0B,CAAC,MAAM,KAAK,CAAC,EAAE;QAC3E,OAAO,0DAAkC,CAAC;KAC1C;SAAM;QACN,OAAO,0BAA0B;aAC/B,IAAI,CAAC,CAAC,CAAmB,EAAE,CAAmB,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC,GAAG,IAAI,CAAC,KAAK,CAAC,CAA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AC,CAAC,CAAC,EAAE,EACjD,OAAO,EAAE,GAAG,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC,GACtC;YACD,eAAe,CAAC,CAAC,CAAC,2BAAG,SAAS,EAAC,0BAA0B,GAAG,CAAC,CAAC,CAAC,IAAI;YACpE,6BAAK,SAAS,EAAC,0BAA0B,IAAE,YAAY,CAAC,KAAK,CAAO,CAC/D;QACN,6BAAK,SAAS,EAAC,4BAA4B,IAAE,YAAY,CAAC,OAAO,CAAO;QACxE,6BAAK,SAAS,EAAC,+BAA+B;YAC7C,6BAAK,SAAS,EAAC,qCAAqC,cAAc;YACjE,wBAAwB,CAAC,YAAY,CAAC,cAAc,CAAC,CACjD;QACN,6BAAK,SAAS,EAAC,+BAA+B;YAC7C,6BAAK,SAAS,EAAC,qCAAqC,UAAU;YAC7D,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAChD;QACL,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CACpB,6BAAK,SAAS,EAAC,+BAA+B;YAC7C,6BAAK,SAAS,EAAC,qCAAqC,WAAW;YAC/D,8BAAM,SAAS,EAAC,0CAA0C,IAAE,YAAY,CAAC,IAAI,CAAQ,CAChF,CACN,CAAC,CAAC,CAAC,IAAI,CACH,CACN,CAAC,CAAC,CAAC,IAAI,CAAC;AACV,CAAC,CAAC;AAEF,eAAe,uBAAuB,CAAC","sourcesContent":["import React, { useContext, useState } from \"react\";\nimport { format } from \"date-fns\";\n\nimport { NotificationsContext } from \"../../notificationsContext\";\nimport { Button } from \"../../../common/Button\";\nimport { services } from \"@finsemble/finsemble-core\";\n\ntype INotification = services.notification.types.INotification;\ntype IPerformedAction = services.notification.types.IPerformedAction;\n\nconst translateAction = (actionType: string): string => {\n\tswitch (actionType) {\n\t\tcase \"FINSEMBLE:RECEIVED\":\n\t\t\treturn \"Notification received\";\n\n\t\tcase \"FINSEMBLE:READ\":\n\t\t\treturn \"Notification marked as read\";\n\n\t\tcase \"FINSEMBLE:UNREAD\":\n\t\t\treturn \"Notification marked as unread\";\n\n\t\tcase \"SNOOZE\":\n\t\t\treturn \"Snoozed\";\n\n\t\tcase \"FINSEMBLE:WAKE\":\n\t\t\treturn \"Renotified\";\n\n\t\tcase \"SPAWN\":\n\t\t\treturn \"Action: Spawn\";\n\n\t\tdefault:\n\t\t\treturn actionType;\n\t}\n};\n\nconst formatTimeStamp = (timestamp: string, dateFormat = \"dd-MM-yyyy HH:mm\") =>\n\tformat(Date.parse(timestamp), dateFormat);\n\nconst renderActionHistoryItems = (notificationActionsHistory: IPerformedAction[] | undefined) => {\n\tif (!notificationActionsHistory || notificationActionsHistory.length === 0) {\n\t\treturn <span>No actions to display</span>;\n\t} else {\n\t\treturn notificationActionsHistory\n\t\t\t.sort((a: IPerformedAction, b: IPerformedAction) => Date.parse(b.datePerformed) - Date.parse(a.datePerformed))\n\t\t\t.map((actionHistoryItem, index) => {\n\t\t\t\tconst performedAction = actionHistoryItem as IPerformedAction;\n\t\t\t\treturn (\n\t\t\t\t\t<div key={performedAction.id || index} className=\"notification-details__performed-action\">\n\t\t\t\t\t\t<span className=\"notification-details__performed-action-timestamp\">\n\t\t\t\t\t\t\t{formatTimeStamp(performedAction.datePerformed, \"HH:mm dd-MM-yyyy\")}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span className=\"notification-details__performed-action-translated\">\n\t\t\t\t\t\t\t{translateAction(performedAction.type)}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t);\n\t\t\t});\n\t}\n};\n\nconst NotificationDetailsView: React.FunctionComponent<{ notification: INotification | null }> = ({ notification }) => {\n\tconst notificationsContext = useContext(NotificationsContext);\n\tconst [showDefaultIcon, setShowDefaultIcon] = useState(false);\n\n\tconst goBack = () => {\n\t\tnotificationsContext.setSelectedNotification(null);\n\t};\n\n\treturn notification ? (\n\t\t<div className=\"notifications-details__container\">\n\t\t\t<div style={{ paddingRight: 8, marginLeft: -3 }}>\n\t\t\t\t<Button onClick={() => goBack()} fashion=\"primary\" iconBefore=\"chevron-left\" text=\"Back\" />\n\t\t\t</div>\n\t\t\t<div className=\"notification-details__header\">\n\t\t\t\t<img\n\t\t\t\t\tsrc={notification.headerLogo}\n\t\t\t\t\tstyle={showDefaultIcon ? { display: \"none\" } : {}}\n\t\t\t\t\tonError={() => setShowDefaultIcon(true)}\n\t\t\t\t/>\n\t\t\t\t{showDefaultIcon ? <i className=\"ff-finsemble default-img\" /> : null}\n\t\t\t\t<div className=\"notification-card__title\">{notification.title}</div>\n\t\t\t</div>\n\t\t\t<div className=\"notification-details__body\">{notification.details}</div>\n\t\t\t<div className=\"notification-details__section\">\n\t\t\t\t<div className=\"notification-details__section-title\">History</div>\n\t\t\t\t{renderActionHistoryItems(notification.actionsHistory)}\n\t\t\t</div>\n\t\t\t<div className=\"notification-details__section\">\n\t\t\t\t<div className=\"notification-details__section-title\">App</div>\n\t\t\t\t{notification.source ? notification.source : \"Uknown\"}\n\t\t\t</div>\n\t\t\t{notification.type ? (\n\t\t\t\t<div className=\"notification-details__section\">\n\t\t\t\t\t<div className=\"notification-details__section-title\">Type</div>\n\t\t\t\t\t<span className=\"notification-details__section-type-label\">{notification.type}</span>\n\t\t\t\t</div>\n\t\t\t) : null}\n\t\t</div>\n\t) : null;\n};\n\nexport default NotificationDetailsView;\n"]}
1
+ {"version":3,"file":"NotificationDetailsView.js","sourceRoot":"","sources":["../../../../../src/components/notifications/components/views/NotificationDetailsView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAElC,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAMhD,MAAM,eAAe,GAAG,CAAC,UAAkB,EAAU,EA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BAAwB,CAAC,YAAY,CAAC,cAAc,CAAC,CACjD;QACN,6BAAK,SAAS,EAAC,+BAA+B;YAC7C,6BAAK,SAAS,EAAC,qCAAqC,UAAU;YAC7D,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAChD;QACL,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC,CACpB,6BAAK,SAAS,EAAC,+BAA+B;YAC7C,6BAAK,SAAS,EAAC,qCAAqC,WAAW;YAC/D,8BAAM,SAAS,EAAC,0CAA0C,IAAE,YAAY,CAAC,IAAI,CAAQ,CAChF,CACN,CAAC,CAAC,CAAC,IAAI,CACH,CACN,CAAC,CAAC,CAAC,IAAI,CAAC;AACV,CAAC,CAAC;AAEF,eAAe,uBAAuB,CAAC","sourcesContent":["import React, { useContext, useState } from \"react\";\nimport { format } from \"date-fns\";\n\nimport { NotificationsContext } from \"../../notificationsContext\";\nimport { Button } from \"../../../common/Button\";\nimport { services } from \"@finsemble/finsemble-api\";\n\ntype INotification = services.notification.types.INotification;\ntype IPerformedAction = services.notification.types.IPerformedAction;\n\nconst translateAction = (actionType: string): string => {\n\tswitch (actionType) {\n\t\tcase \"FINSEMBLE:RECEIVED\":\n\t\t\treturn \"Notification received\";\n\n\t\tcase \"FINSEMBLE:READ\":\n\t\t\treturn \"Notification marked as read\";\n\n\t\tcase \"FINSEMBLE:UNREAD\":\n\t\t\treturn \"Notification marked as unread\";\n\n\t\tcase \"SNOOZE\":\n\t\t\treturn \"Snoozed\";\n\n\t\tcase \"FINSEMBLE:WAKE\":\n\t\t\treturn \"Renotified\";\n\n\t\tcase \"SPAWN\":\n\t\t\treturn \"Action: Spawn\";\n\n\t\tdefault:\n\t\t\treturn actionType;\n\t}\n};\n\nconst formatTimeStamp = (timestamp: string, dateFormat = \"dd-MM-yyyy HH:mm\") =>\n\tformat(Date.parse(timestamp), dateFormat);\n\nconst renderActionHistoryItems = (notificationActionsHistory: IPerformedAction[] | undefined) => {\n\tif (!notificationActionsHistory || notificationActionsHistory.length === 0) {\n\t\treturn <span>No actions to display</span>;\n\t} else {\n\t\treturn notificationActionsHistory\n\t\t\t.sort((a: IPerformedAction, b: IPerformedAction) => Date.parse(b.datePerformed) - Date.parse(a.datePerformed))\n\t\t\t.map((actionHistoryItem, index) => {\n\t\t\t\tconst performedAction = actionHistoryItem as IPerformedAction;\n\t\t\t\treturn (\n\t\t\t\t\t<div key={performedAction.id || index} className=\"notification-details__performed-action\">\n\t\t\t\t\t\t<span className=\"notification-details__performed-action-timestamp\">\n\t\t\t\t\t\t\t{formatTimeStamp(performedAction.datePerformed, \"HH:mm dd-MM-yyyy\")}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span className=\"notification-details__performed-action-translated\">\n\t\t\t\t\t\t\t{translateAction(performedAction.type)}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</div>\n\t\t\t\t);\n\t\t\t});\n\t}\n};\n\nconst NotificationDetailsView: React.FunctionComponent<{ notification: INotification | null }> = ({ notification }) => {\n\tconst notificationsContext = useContext(NotificationsContext);\n\tconst [showDefaultIcon, setShowDefaultIcon] = useState(false);\n\n\tconst goBack = () => {\n\t\tnotificationsContext.setSelectedNotification(null);\n\t};\n\n\treturn notification ? (\n\t\t<div className=\"notifications-details__container\">\n\t\t\t<div style={{ paddingRight: 8, marginLeft: -3 }}>\n\t\t\t\t<Button onClick={() => goBack()} fashion=\"primary\" iconBefore=\"chevron-left\" text=\"Back\" />\n\t\t\t</div>\n\t\t\t<div className=\"notification-details__header\">\n\t\t\t\t<img\n\t\t\t\t\tsrc={notification.headerLogo}\n\t\t\t\t\tstyle={showDefaultIcon ? { display: \"none\" } : {}}\n\t\t\t\t\tonError={() => setShowDefaultIcon(true)}\n\t\t\t\t/>\n\t\t\t\t{showDefaultIcon ? <i className=\"ff-finsemble default-img\" /> : null}\n\t\t\t\t<div className=\"notification-card__title\">{notification.title}</div>\n\t\t\t</div>\n\t\t\t<div className=\"notification-details__body\">{notification.details}</div>\n\t\t\t<div className=\"notification-details__section\">\n\t\t\t\t<div className=\"notification-details__section-title\">History</div>\n\t\t\t\t{renderActionHistoryItems(notification.actionsHistory)}\n\t\t\t</div>\n\t\t\t<div className=\"notification-details__section\">\n\t\t\t\t<div className=\"notification-details__section-title\">App</div>\n\t\t\t\t{notification.source ? notification.source : \"Uknown\"}\n\t\t\t</div>\n\t\t\t{notification.type ? (\n\t\t\t\t<div className=\"notification-details__section\">\n\t\t\t\t\t<div className=\"notification-details__section-title\">Type</div>\n\t\t\t\t\t<span className=\"notification-details__section-type-label\">{notification.type}</span>\n\t\t\t\t</div>\n\t\t\t) : null}\n\t\t</div>\n\t) : null;\n};\n\nexport default NotificationDetailsView;\n"]}
@@ -1,6 +1,6 @@
1
1
  import React from "react";
2
2
  import { ViewMode, SelectionMode } from "./constants";
3
- import { services } from "@finsemble/finsemble-core";
3
+ import { services } from "@finsemble/finsemble-api";
4
4
  declare type INotification = services.notification.types.INotification;
5
5
  declare type INotificationHistoryOptions = services.notification.types.INotificationHistoryOptions;
6
6
  declare type IMuteFilter = services.notification.types.IMuteFilter;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/notifications/types.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Notification types\n */\nimport React from \"react\";\nimport { ViewMode, SelectionMode } from \"./constants\";\nimport { services } from \"@finsemble/finsemble-core\";\n\ntype INotification = services.notification.types.INotification;\ntype INotificationHistoryOptions = services.notification.types.INotificationHistoryOptions;\ntype IMuteFilter = services.notification.types.IMuteFilter;\ntype IFilter = services.notification.types.IFilter;\ntype SpawnParams = services.window.types.SpawnParams;\n\nexport interface Control {\n\taction: string;\n\tlabel: string;\n\trun?: Function;\n}\n\nexport interface NotificationCenterControlsProps {\n\tcontrols: Array<Control>;\n\tactive?: Control[\"action\"];\n}\n\nexport interface INotificationCenterProps {\n\tcontrols?: NotificationCenterControlsProps;\n\tnotificationCard?: React.ComponentType<any>;\n\tnotificationHeaderRow?: React.ComponentType<any>;\n\tnotificationListRow?: React.ComponentType<any>;\n}\n\nexport interface INotificationToastsProps {\n\tnotificationCard?: React.ComponentType<any>;\n}\n\nexport interface INotificationDetailProps {\n\tnotification: INotification;\n}\n\nexport type NotificationListViewProps = {\n\tnotifications: INotification[];\n\tnotificationListRow?: React.ComponentType<INotificationDetailProps>;\n\tnotificationHeaderRow?: React.ComponentType<any>;\n};\n\nexport type NotificationCardViewProps = {\n\tnotifications: INotification[];\n\tnotificationCard?: React.ComponentType<any>; // A custom component used to render a notification\n};\n\nexport type NotificationsContextType = {\n\tviewMode: ViewMode;\n\tsetViewMode: React.Dispatch<React.SetStateAction<ViewMode>>;\n\tselectionMode: SelectionMode;\n\tsetSelectionMode: React.Dispatch<React.SetStateAction<SelectionMode>>;\n\tdrawerControlProps: NotificationCenterControlsProps;\n\tsetDrawerControlProps: React.Dispatch<React.SetStateAction<NotificationCenterControlsProps>>;\n\tselectedNotification: INotification | null;\n\tsetSelectedNotification: React.Dispatch<React.SetStateAction<INotification | null>>;\n\tsearchString: string;\n\tsetSearchString: React.Dispatch<React.SetStateAction<string>>;\n\tfilteredNotifications: INotification[];\n\tcheckedNotifications: INotification[];\n\tsetFilteredNotifications: React.Dispatch<React.SetStateAction<INotification[]>>;\n\tmuteFilters: IMuteFilter[];\n\tsetMuteFilters: React.Dispatch<React.SetStateAction<IMuteFilter[]>>;\n};\n\nexport interface NotificationsConfig {\n\tfilter?: {\n\t\tinclude?: [];\n\t\texclude?: [];\n\t};\n\tposition?: {};\n\tanimation?: {\n\t\tdisplayDuration: number;\n\t\tanimateIn: string;\n\t\tanimateOut: string;\n\t};\n\tisTransparent?: boolean;\n\tnotificationsHistory?: { since?: string; filter?: IFilter; options?: INotificationHistoryOptions } | boolean;\n\tapplyMuteFilters?: boolean;\n\twindowName: string;\n}\n\nexport interface WindowConfig {\n\twindow: SpawnParams & NotificationsConfig;\n}\n\nexport type OverFlowMenuAction = {\n\tname: string;\n\ticon: React.ReactElement;\n\taction: (notification: INotification) => void;\n\tlabel: string;\n};\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/components/notifications/types.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Notification types\n */\nimport React from \"react\";\nimport { ViewMode, SelectionMode } from \"./constants\";\nimport { services } from \"@finsemble/finsemble-api\";\n\ntype INotification = services.notification.types.INotification;\ntype INotificationHistoryOptions = services.notification.types.INotificationHistoryOptions;\ntype IMuteFilter = services.notification.types.IMuteFilter;\ntype IFilter = services.notification.types.IFilter;\ntype SpawnParams = services.window.types.SpawnParams;\n\nexport interface Control {\n\taction: string;\n\tlabel: string;\n\trun?: Function;\n}\n\nexport interface NotificationCenterControlsProps {\n\tcontrols: Array<Control>;\n\tactive?: Control[\"action\"];\n}\n\nexport interface INotificationCenterProps {\n\tcontrols?: NotificationCenterControlsProps;\n\tnotificationCard?: React.ComponentType<any>;\n\tnotificationHeaderRow?: React.ComponentType<any>;\n\tnotificationListRow?: React.ComponentType<any>;\n}\n\nexport interface INotificationToastsProps {\n\tnotificationCard?: React.ComponentType<any>;\n}\n\nexport interface INotificationDetailProps {\n\tnotification: INotification;\n}\n\nexport type NotificationListViewProps = {\n\tnotifications: INotification[];\n\tnotificationListRow?: React.ComponentType<INotificationDetailProps>;\n\tnotificationHeaderRow?: React.ComponentType<any>;\n};\n\nexport type NotificationCardViewProps = {\n\tnotifications: INotification[];\n\tnotificationCard?: React.ComponentType<any>; // A custom component used to render a notification\n};\n\nexport type NotificationsContextType = {\n\tviewMode: ViewMode;\n\tsetViewMode: React.Dispatch<React.SetStateAction<ViewMode>>;\n\tselectionMode: SelectionMode;\n\tsetSelectionMode: React.Dispatch<React.SetStateAction<SelectionMode>>;\n\tdrawerControlProps: NotificationCenterControlsProps;\n\tsetDrawerControlProps: React.Dispatch<React.SetStateAction<NotificationCenterControlsProps>>;\n\tselectedNotification: INotification | null;\n\tsetSelectedNotification: React.Dispatch<React.SetStateAction<INotification | null>>;\n\tsearchString: string;\n\tsetSearchString: React.Dispatch<React.SetStateAction<string>>;\n\tfilteredNotifications: INotification[];\n\tcheckedNotifications: INotification[];\n\tsetFilteredNotifications: React.Dispatch<React.SetStateAction<INotification[]>>;\n\tmuteFilters: IMuteFilter[];\n\tsetMuteFilters: React.Dispatch<React.SetStateAction<IMuteFilter[]>>;\n};\n\nexport interface NotificationsConfig {\n\tfilter?: {\n\t\tinclude?: [];\n\t\texclude?: [];\n\t};\n\tposition?: {};\n\tanimation?: {\n\t\tdisplayDuration: number;\n\t\tanimateIn: string;\n\t\tanimateOut: string;\n\t};\n\tisTransparent?: boolean;\n\tnotificationsHistory?: { since?: string; filter?: IFilter; options?: INotificationHistoryOptions } | boolean;\n\tapplyMuteFilters?: boolean;\n\twindowName: string;\n}\n\nexport interface WindowConfig {\n\twindow: SpawnParams & NotificationsConfig;\n}\n\nexport type OverFlowMenuAction = {\n\tname: string;\n\ticon: React.ReactElement;\n\taction: (notification: INotification) => void;\n\tlabel: string;\n};\n"]}
@@ -1,5 +1,5 @@
1
1
  import { Control, NotificationCenterControlsProps } from "./types";
2
- import { services } from "@finsemble/finsemble-core";
2
+ import { services } from "@finsemble/finsemble-api";
3
3
  declare type INotification = services.notification.types.INotification;
4
4
  declare type IMuteFilter = services.notification.types.IMuteFilter;
5
5
  declare type IPerformedAction = services.notification.types.IPerformedAction;